Commit 15f984ed by Vo Duc Thang

No.17 異機種間データ互換性(バックアップ・リストア)のリリース

parent 9f7d04ce
......@@ -40,11 +40,22 @@
<a href="#"> </a>
</p>
<header>
<div class="notification-pushmessage" style="display:none;">
新着メッセージがあります!!!
</div>
<div class="cnt_header">
<a class="logo" href="javascript:void(0);" onclick="avwScreenMove(ScreenIds.Home)"> </a>
<div class="menu_language">
<ul>
<li><label class="lang" lang="txtLoginUser">こんにちは</label><label id="login-username"> </label></li>
<li class="pushmessage hide" id="liPushMessage"><label class="lang" lang="txtPushAlert">新着 : </label><label id="numbermessage"></label><span></span>
<div id="list-push-message">
<div id="show-push-message"></div>
<p><a id='prev-page-message' style="display:none;" class="lang" lang="txtPrevious"><前</a><a id='next-page-message' style="display:none;" class="lang" lang="txtNext">次k></a></p>
</div>
</li>
<li class="jp" id="language-jp"><a href="#">日本語</a></li>
<li class="eng" id="language-en"><a href="#">English</a></li>
<li class="kor" id="language-kr"><a href="#">한글</a></li>
......@@ -58,7 +69,7 @@
</div>
</ul>
<p class="button">
<a style="margin-right:0;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a style="margin-right:0;display:none;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a class="blue lang" href="#" lang="dspSetting" id="dspSetting">設定変更</a>
<a class="blue lang" href="#" lang="dspViewHistory" id="dspViewHistory">閲覧履歴</a>
<a class="blue lang" href="#" id="dspShiori" lang="dspShiori">しおり</a>
......@@ -68,7 +79,7 @@
</div>
</header>
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<!--<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
......@@ -80,7 +91,28 @@
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>-->
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
<p class="message-options">
<label class="option_backup">
<label lang="txtBkSelect" class="lang" class="lang">バックアップするデータを選択してください。</label><br />
<input type="checkbox" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice">
<input type="checkbox" id="chkRememberBackup" /><label for="chkRememberBackup" class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</label>
</p>
<p class="backupbtn">
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>
<div class="wrapper">
<div id="main">
......
......@@ -66,6 +66,19 @@
background:url(./images/error.png);
}
/* add for multiline */
.toast-item-message
{
background-position:left center;
padding-left:44px;
height: 32px;
background-repeat:no-repeat;
line-height:32px;
font-size:14px;
margin:5px 10px;
}
/**
* toast types
......
......@@ -14,6 +14,8 @@
/// <reference path="pageViewer.js" />
/// <reference path="uuid.js" />
// =============================================================================================
// Constants [start]
......@@ -157,8 +159,14 @@ var Keys = {
serviceOpt_user_data_backup: 'user_data_backup',
// Session :事業者オプション(serviceOpt)_マーキング機能使用:Char(Y:可能, N:不可)
serviceOpt_marking: 'marking',
// No.8: do not use this value: serviceOpt_force_login_periodically
// Session :事業者オプション(serviceOpt)_一定期間経過後アプリロック:Char(Y:可能, N:不可)
serviceOpt_force_login_periodically: 'force_login_periodically',
//serviceOpt_force_login_periodically: 'force_login_periodically',
// No.8: スクリーンロック
// Session :事業者オプション(serviceOpt)_スクリーンロック(Web版):Char(Y:可能, N:不可)
serviceOpt_web_screen_lock: 'web_screen_lock',
// Session :事業者オプション(serviceOpt)_スクリーンロック待ち時間:Interger
serviceOpt_web_screen_lock_wait: 'web_screen_lock_wait',
// Session :共通(common)_コンテンツID:Integer
common_contentId: 'common_contentId',
// Local :共通(common)_コンテンツID:Integer
......@@ -213,6 +221,8 @@ var Keys = {
contentInfo_resourceVersion: 'contentInfo_resourceVersion',
// Session :コンテンツ詳細情報(contentInfo)_PDF総ページ数:Interger
contentInfo_allPageNum: 'allPageNum',
// Session :(contentType):String
contentInfo_contentType: 'allPageNum',
// Session :検索条件(searchCond)_検索テキスト:String
searchCond_searchText: 'searchText',
// Session :検索条件(searchCond)_検索区分:Interger(1:コンテンツ検索, 2:タグ検索, 3:全文検索)
......@@ -229,6 +239,8 @@ var Keys = {
searchCond_genreId: 'genreId',
// Session :検索条件(searchCond)_グループID:Interger
searchCond_groupId: 'groupId',
// Session :通知情報(pushInfo)_新着件数:Interger
pushInfo_newMsgNumber: 'pushInfo_newMsgNumber',
// Local :ペン書式設定(penOpt)_色:String
penOpt_color: 'penOpt_color',
// Local :ペン書式設定(penOpt)_サイズ:Interger
......@@ -276,7 +288,20 @@ var Keys = {
// Local :メモデータ(memo)_ページNo:Interger
memo_pageNo: 'memo_pageNo',
// Local :メモ(memo)_CopyText:String
memo_copyText: 'memo_copyText'
memo_copyText: 'memo_copyText',
// Local :ユーザオプション(userOpt)_バックアップデフォルト_マーキング:Interger
userOpt_bkMakingFlag: 'userOpt_bkMakingFlag',
// Local :ユーザオプション(userOpt)_バックアップデフォルト_メモ:Interger
userOpt_bkMemoFlag: 'userOpt_bkMemoFlag',
// Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger
userOpt_bkShioriFlag: 'userOpt_bkShioriFlag',
// Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
userOpt_pageTransition: 'userOpt_pageTransition',
// Local :ユーザオプション(userOpt)_アニメーション時間:Interger
userOpt_pageTransitionPeriod: 'userOpt_pageTransitionPeriod'
/* -------------------------------------------------------------------------------- */
};
......@@ -289,6 +314,9 @@ function BookMarkEntity() {
this.contentTitle = "";
this.contentTitleKana = "";
this.registerDate = new Date();
//Add for phase2
this.bookmarkid = "";
};
// Entity for Memo
......@@ -298,6 +326,10 @@ function MemoEntity() {
this.posX = -1;
this.posY = -1;
this.Text = "";
//Add for phase2
this.memoid = "";
this.registerDate = new Date();
};
// Entity for marking
......@@ -305,6 +337,10 @@ function MarkingEntity() {
this.contentid = "";
this.pageNo = -1;
this.content = "";
//Add for phase2
this.markingid = "";
this.registerDate = new Date();
};
// Entity for log
function LogEntity() {
......@@ -315,7 +351,9 @@ function LogEntity() {
this.deviceTypeId = 4;
};
// No.17 Phase 2: do not use this function
// Build memo/marking/bookmark to base64string
/*
function buildBackupData() {
var result =[];
var template1 = { type: 1, data: [] };
......@@ -333,7 +371,6 @@ function buildBackupData() {
registerDate: ClientData.BookMarkData()[nIndex].registerDate
};
template3.data.push(oneItem);
}
result.push(template3);
......@@ -350,7 +387,10 @@ function buildBackupData() {
pageNo: ClientData.MemoData()[nIndex].pageNo,
posX: ClientData.MemoData()[nIndex].posX,
posY: ClientData.MemoData()[nIndex].posY,
Text: ClientData.MemoData()[nIndex].Text
Text: ClientData.MemoData()[nIndex].Text,
// Add for phase 2
memoid:ClientData.MemoData()[nIndex].memoid,
registerDate: ClientData.MemoData()[nIndex].registerDate
};
template1.data.push(oneItem2);
}
......@@ -358,10 +398,12 @@ function buildBackupData() {
return result;
};
*/
// No.17 Phase 2: do not use this function
/*
Restore data from server to local
*/
/*
function restoreData(jsonString) {
var data = jsonString;
......@@ -398,6 +440,11 @@ function restoreData(jsonString) {
obj.posX = oneType.data[nIndex1].posX;
obj.posY = oneType.data[nIndex1].posY;
obj.Text = oneType.data[nIndex1].Text;
//Add for phase2
obj.memoid = oneType.data[nIndex1].memoid;
obj.registerDate = oneType.data[nIndex1].registerDate;
// Add object to client
arrMemo.push(obj);
}
......@@ -410,6 +457,11 @@ function restoreData(jsonString) {
obj.contentid = oneType.data[nIndex1].contentid;
obj.pageNo = oneType.data[nIndex1].pageNo;
obj.content = oneType.data[nIndex1].content;
//Add for phase2
obj.markingid = oneType.data[nIndex1].markingid;
obj.registerDate = oneType.data[nIndex1].registerDate;
// Add object to client
arrMarking.push(obj);
}
......@@ -424,6 +476,10 @@ function restoreData(jsonString) {
obj.contentTitle = oneType.data[nIndex1].contentTitle;
obj.contentTitleKana = oneType.data[nIndex1].contentTitleKana;
obj.registerDate = oneType.data[nIndex1].registerDate;
//Add for phase2
obj.bookmarkid = oneType.data[nIndex1].bookmarkid;
// Add object to client
arrBookMark.push(obj);
}
......@@ -435,15 +491,123 @@ function restoreData(jsonString) {
return data;
};
*/
/*
Get data from localstorage and sessionstorage synchronization
If has any param (args.length > 0) -> setter
If has not param (args.length = 0) -> getter
. Get from session:
+ if it existed and key existed in localstorage -> return result
+ else:
* set value from local to sessionstorage -> return value of sessionstorage if value is not empty,
otherwise, return default result.
* Extract memo data from result of API and merge with local memo
*/
function getDataMemo(jsonString) {
var memoDataFromServer = jsonString.data;
var arrLocalMemo = ClientData.MemoData();
for (var i = 0; i < memoDataFromServer.length; i++) {
var objServerMemo = new MemoEntity();
objServerMemo.contentid = memoDataFromServer[i].contentid;
objServerMemo.pageNo = memoDataFromServer[i].pageNo;
objServerMemo.posX = memoDataFromServer[i].posX;
objServerMemo.posY = memoDataFromServer[i].posY;
objServerMemo.Text = memoDataFromServer[i].Text;
//Add for phase2
objServerMemo.memoid = memoDataFromServer[i].memoid; // UUID
objServerMemo.registerDate = memoDataFromServer[i].registerDate; // UTC+0
// Searching memoid in local that is matching with memo of server
var nIndexFoundLocalMemo = -1;
for (var nIndexLocalMemo = 0; nIndexLocalMemo < arrLocalMemo.length; nIndexLocalMemo++) {
if (arrLocalMemo[nIndexLocalMemo].memoid == objServerMemo.memoid) {
nIndexFoundLocalMemo = nIndexLocalMemo;
break;
}
}
// Found local memo that has memoid = memoid of server memo
if (nIndexFoundLocalMemo >= 0) {
// Local date is older than server date -> restore
if (arrLocalMemo[nIndexFoundLocalMemo].registerDate < objServerMemo.registerDate) {
arrLocalMemo[nIndexFoundLocalMemo].contentid = objServerMemo.contentid;
arrLocalMemo[nIndexFoundLocalMemo].pageNo = objServerMemo.pageNo;
arrLocalMemo[nIndexFoundLocalMemo].posX = objServerMemo.posX;
arrLocalMemo[nIndexFoundLocalMemo].posY = objServerMemo.posY;
arrLocalMemo[nIndexFoundLocalMemo].Text = objServerMemo.Text;
arrLocalMemo[nIndexFoundLocalMemo].registerDate = objServerMemo.registerDate;
}
} else { // Not found: [local memo].memoid = [server memo].memoid
// Merge server memo to local
arrLocalMemo.push(objServerMemo);
}
}
ClientData.MemoData(arrLocalMemo);
};
/*
* Extract marking data from result of API and replace to local marking
*/
function getDataMarking(jsonString) {
var data = jsonString.data;
var arr = ClientData.MarkingData();
arr.clear();
ClientData.MarkingData(arr);
var arrMarking = [];
for (var nIndex1 = 0; nIndex1 < data.length; nIndex1++) {
var obj = new MarkingEntity();
obj.contentid = data[nIndex1].contentid;
obj.pageNo = data[nIndex1].pageNo;
obj.content = data[nIndex1].content;
//Add for phase2
obj.markingid = data[nIndex1].markingid;
obj.registerDate = data[nIndex1].registerDate;
// Add object to client
arrMarking.push(obj);
}
ClientData.MarkingData(arrMarking);
};
/*
* Extract bookmark data from result of API and replace to local bookmark
*/
function getDataBookmark(jsonString) {
var data = jsonString.data;
var arr = ClientData.BookMarkData();
arr.clear();
ClientData.BookMarkData(arr);
var arrBookmark = [];
for (var nIndex1 = 0; nIndex1 < data.length; nIndex1++) {
var obj = new BookMarkEntity();
obj.contentid = data[nIndex1].contentid;
obj.pageNo = data[nIndex1].pageNo;
obj.contentTitle = data[nIndex1].contentTitle;
obj.contentTitleKana = data[nIndex1].contentTitleKana;
obj.registerDate = data[nIndex1].registerDate;
//Add for phase2
obj.bookmarkid = data[nIndex1].bookmarkid;
// Add object to client
arrBookmark.push(obj);
}
ClientData.BookMarkData(arrBookmark);
};
/*
Get data from localstorage and sessionstorage synchronization
If has any param (args.length > 0) -> setter
If has not param (args.length = 0) -> getter
. Get from session:
+ if it existed and key existed in localstorage -> return result
+ else:
* set value from local to sessionstorage -> return value of sessionstorage if value is not empty,
otherwise, return default result.
*/
function operateData(args, strKey, returnDefaultData) {
......@@ -935,6 +1099,57 @@ var ClientData = {
return operateData(arguments, Keys.memo_pageNo, undefined);
}
},
// Local :ユーザオプション(userOpt)_バックアップデフォルト_マーキング:Interger
userOpt_bkMakingFlag: function (data) {
if (arguments.length > 0) {
operateData(arguments, Keys.userOpt_bkMakingFlag, undefined);
}
else {
return operateData(arguments, Keys.userOpt_bkMakingFlag, undefined);
}
},
// Local :ユーザオプション(userOpt)_バックアップデフォルト_メモ:Interger
userOpt_bkMemoFlag: function (data) {
if (arguments.length > 0) {
operateData(arguments, Keys.userOpt_bkMemoFlag, undefined);
}
else {
return operateData(arguments, Keys.userOpt_bkMemoFlag, undefined);
}
},
// Local :ユーザオプション(userOpt)_バックアップデフォルト_しおり:Interger
userOpt_bkShioriFlag: function (data) {
if (arguments.length > 0) {
operateData(arguments, Keys.userOpt_bkShioriFlag, undefined);
}
else {
return operateData(arguments, Keys.userOpt_bkShioriFlag, undefined);
}
},
// Local :ユーザオプション(userOpt)_ビューのアニメーション種類:Interger
userOpt_pageTransition: function (data) {
if (arguments.length > 0) {
operateData(arguments, Keys.userOpt_pageTransition, undefined);
}
else {
return operateData(arguments, Keys.userOpt_pageTransition, undefined);
}
},
// Local :ユーザオプション(userOpt)_アニメーション時間:Interger
userOpt_pageTransitionPeriod: function (data) {
if (arguments.length > 0) {
operateData(arguments, Keys.userOpt_pageTransitionPeriod, undefined);
}
else {
return operateData(arguments, Keys.userOpt_pageTransitionPeriod, undefined);
}
},
// Session
memo_copyText: function (data) {
if (arguments.length > 0) {
......@@ -1041,15 +1256,15 @@ var ClientData = {
return SessionStorageUtils.get(Keys.serviceOpt_marking);
}
},
// No.8: do not use this value: serviceOpt_force_login_periodically
// Session :事業者オプション(serviceOpt)_一定期間経過後アプリロック:Char(Y:可能, N:不可)
serviceOpt_force_login_periodically: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(Keys.serviceOpt_force_login_periodically, data);
} else {
return SessionStorageUtils.get(Keys.serviceOpt_force_login_periodically);
}
},
//serviceOpt_force_login_periodically: function (data) {
// if (arguments.length > 0) {
// SessionStorageUtils.set(Keys.serviceOpt_force_login_periodically, data);
// } else {
// return SessionStorageUtils.get(Keys.serviceOpt_force_login_periodically);
// }
//},
// Session :共通(common)_コンテンツID:Integer
common_contentId: function (data) {
......@@ -1275,6 +1490,14 @@ var ClientData = {
}
},
// Session :(contentType):String
contentInfo_contentType: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(Keys.contentInfo_contentType, data);
} else {
return SessionStorageUtils.get(Keys.contentInfo_contentType);
}
},
// Session :検索条件(searchCond)_検索テキスト:String
searchCond_searchText: function (data) {
if (arguments.length > 0) {
......@@ -1347,6 +1570,15 @@ var ClientData = {
}
},
// Session :通知情報(pushInfo)_新着件数:Interger
pushInfo_newMsgNumber: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(Keys.pushInfo_newMsgNumber, data);
} else {
return SessionStorageUtils.get(Keys.pushInfo_newMsgNumber);
}
},
// Session :ユーザ情報(userInfo)_ログインID:String
userInfo_loginId_session: function (data) {
if (arguments.length > 0) {
......@@ -1363,6 +1595,22 @@ var ClientData = {
} else {
return SessionStorageUtils.get(Keys.userInfo_accountPath);
}
},
// Session :事業者オプション(serviceOpt)_スクリーンロック(Web版):Char(Y:可能, N:不可)
serviceOpt_web_screen_lock: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(Keys.serviceOpt_web_screen_lock, data);
} else {
return SessionStorageUtils.get(Keys.serviceOpt_web_screen_lock);
}
},
// Session :事業者オプション(serviceOpt)_スクリーンロック待ち時間:Interger
serviceOpt_web_screen_lock_wait: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(Keys.serviceOpt_web_screen_lock_wait, data);
} else {
return SessionStorageUtils.get(Keys.serviceOpt_web_screen_lock_wait);
}
}
};
......@@ -1722,19 +1970,19 @@ var ValidationUtil = {
var reg = new RegExp("^[0-9a-zA-Z]+@[0-9a-zA-Z]+[\\.]{1}[0-9a-zA-Z]+[\\.]?[0-9a-zA-Z]+$");
return reg.test(value);
},
// Password
CheckPasswordValid: function (value) {
//Check if string is a valid email address
var reg = new RegExp("^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[#+-\\./:_]).{1,47}$");
return reg.test(value);
},
// Alphabet + Nunber + Symbol
IsAlphabetOrNumberOrSymbol: function (value) {
//Check if string is alphabet or number or symbol
var reg = new RegExp("\u005b\u005e\u0061\u002d\u007a\u0041\u002d\u005a\u0030\u002d\u0039\u0027\u0060\u0027\u007e\u0027\u0021\u0027\u0040\u0027\u0023\u0027\u0024\u0027\u0025\u0027\u005e\u0027\u0026\u0027\u002a\u0027\u0028\u0027\u0029\u0027\u005f\u0027\u002b\u0027\u003d\u0027\u007b\u0027\u007d\u0027\u007c\u0027\u003a\u0027\u0022\u0027\u003b\u0027\u0027\u0027\u003c\u0027\u003e\u0027\u003f\u0027\u002f\u0027\u002e\u0027\u002c\u005c\u002d\u005b\u005c\u005d\u005c\u005c\u005d");
return !reg.test(value);
},
// Get the total of types in array
CheckNumberOfTypeInString: function (value) {
var list = new Array();
var c;
......@@ -1751,7 +1999,7 @@ var ValidationUtil = {
var count = list.length;
return count
},
// Special character: *
IsCharacterSpecial: function (value) {
for (var i = 0; i < value.length; i++) {
if (value[i] == '*')
......@@ -1760,7 +2008,6 @@ var ValidationUtil = {
return false;
},
// 半記号
IsPasswordSymbol: function (value) {
var reg = new RegExp("\u005b\u005e\u0027\u0023\u0027\u002b\u005c\u002d\u0027\u002e\u0027\u002f\u0027\u003a\u0027\u005f\u005d");
......@@ -1774,25 +2021,69 @@ var ValidationUtil = {
}
};
// Get format based64 string to show inline
function getBase64Image(imgSource) {
return imgSource.replace(/^data:image\/(png|jpg);base64,/, "");
};
// get time wait lockscreen
function getTimeWaitLockScreen() {
var timeWaitLockScreen = -1;
if (ClientData.serviceOpt_web_screen_lock() == "Y")
{
var sysSettings = avwSysSetting();
if (isNaN(ClientData.serviceOpt_web_screen_lock_wait())) {
timeWaitLockScreen = sysSettings.screenlockTimeDefault * 60000;
}
else
{
timeWaitLockScreen = parseInt(ClientData.serviceOpt_web_screen_lock_wait()) * 60000; // time unit is minute
if (timeWaitLockScreen < 0) {
timeWaitLockScreen = sysSettings.screenlockTimeDefault * 60000;
}
else if (timeWaitLockScreen == 0) { // no lockscreen
timeWaitLockScreen = -1;
}
}
}
return timeWaitLockScreen;
};
// Do locking screen after idle time
function LockScreen() {
if(avwUserSession()) {
if (ClientData.serviceOpt_force_login_periodically() == "Y") {
if (avwUserSession()) {
// no lockscreen for user anonymous
if (isAnonymousLogin()) {
return;
}
var timeWaitLockScreen = getTimeWaitLockScreen();
if (timeWaitLockScreen > 0) {
//var message = i18nText("sysInfoScrLock01");
screenLock({
timeout: Consts.ConstLockScreenTime,
timeout: timeWaitLockScreen,
html: '<img src="img/1222.png" alt="Screen Lock" /><br />', //+ message,
unlockFunc: unlockFunction,
errorMessage: i18nText('msgLoginErrWrong')
});
}
// if (ClientData.serviceOpt_force_login_periodically() == "Y") {
// //var message = i18nText("sysInfoScrLock01");
// screenLock({
// timeout: Consts.ConstLockScreenTime,
// html: '<img src="img/1222.png" alt="Screen Lock" /><br />', //+ message,
// unlockFunc: unlockFunction,
// errorMessage: i18nText('msgLoginErrWrong')
// });
// }
}
};
// Lock screen
// The function will be called at the time: loading
$(function () {
// Init setting values
......@@ -1825,11 +2116,28 @@ $(function () {
if (ClientData.userOpt_closeOrRefreshAlert() == null || ClientData.userOpt_closeOrRefreshAlert() == undefined) {
ClientData.userOpt_closeOrRefreshAlert(1);
}
// Set default value for options backup: marking -> checked
if (ClientData.userOpt_bkMakingFlag() == null || ClientData.userOpt_bkMakingFlag() == undefined) {
ClientData.userOpt_bkMakingFlag(1);
}
// Set default value for options backup: memo -> checked
if (ClientData.userOpt_bkMemoFlag() == null || ClientData.userOpt_bkMemoFlag() == undefined) {
ClientData.userOpt_bkMemoFlag(1);
}
// Set default value for options backup: bookmark -> checked
if (ClientData.userOpt_bkShioriFlag() == null || ClientData.userOpt_bkShioriFlag() == undefined) {
ClientData.userOpt_bkShioriFlag(1);
}
// Set default value for logoutMode (backup auto and logout)
if (ClientData.userOpt_logoutMode() == null || ClientData.userOpt_logoutMode() == undefined) {
ClientData.userOpt_logoutMode(0);
}
}
});
// Unlock the locked screen by inputing password on screen to check authentication
function unlockFunction(inputPass) {
var forceUnlockFunc = arguments[1]; // added secret arguments : forceUnlockFunction
var result = false;
......@@ -1850,6 +2158,19 @@ function unlockFunction(inputPass) {
ClientData.userInfo_sid(data.sid);
result = true;
//forceUnlockFunc();
// update status wait lockscreen
var serviceOptionList = data.serviceOptionList;
$.each(serviceOptionList, function (i, option) {
if (option.serviceName == 'web_screen_lock') {
ClientData.serviceOpt_web_screen_lock(option.value);
}
else if (option.serviceName == 'web_screen_lock_wait') {
ClientData.serviceOpt_web_screen_lock_wait(option.value);
}
});
}
},
function (xhr, statusText, errorThrown) {
......@@ -1867,13 +2188,13 @@ function unlockFunction(inputPass) {
onUnlock();
}
}
return { 'result': result, 'errorCode': errorCode };
return { 'result': result, 'errorCode': errorCode, 'newTimeout': getTimeWaitLockScreen() };
};
/*
Set log for reading content
Set starting log for reading content
*/
function SetStartLog(strContentId) {
var isFound = false;
......@@ -1914,6 +2235,7 @@ function SetStartLog(strContentId) {
ClientData.ContentLogData(arrContentLogs);
};
// Set ending log for reading content
function SetEndLog(strContentId) {
var log = new LogEntity();
var arrContentLogs = ClientData.ContentLogData();
......@@ -1931,8 +2253,9 @@ function SetEndLog(strContentId) {
}
ClientData.ContentLogData(arrContentLogs);
};
/*
register reading log of content
Register reading log of content to server by calling api
*/
function RegisterLog() {
var arrContentLogs = ClientData.ContentLogData();
......@@ -1991,9 +2314,12 @@ function enable() {
}
};
// Stop waiting screen
function StopWaitProcess() {
$('#avw-sys-modal-wait').hide();
};
// Show waiting screen
function WaitProcess() {
if (document.getElementById('avw-sys-modal-wait')) {
$('#avw-sys-modal-wait').show();
......@@ -2025,9 +2351,12 @@ function WaitProcess() {
}
};
// Hide the locking layout
function unlockLayout() {
$('#avw-sys-modal').hide();
};
// Show the locking layout
function lockLayout() {
if (document.getElementById('avw-sys-modal')) {
$('#avw-sys-modal').show();
......@@ -2054,6 +2383,8 @@ function lockLayout() {
});
}
};
// Function to set position of object to center
jQuery.fn.center = function () {
this.css("position", "fixed");
......@@ -2062,25 +2393,28 @@ jQuery.fn.center = function () {
return this;
};
// Function to set position of object to top
jQuery.fn.top = function () {
this.css("position", "absolute");
this.css("top", ($(window).scrollTop() + 1) + "px");
return this;
};
// Function to set position of object to right
jQuery.fn.right = function () {
this.css("position", "absolute");
this.css("left", ($(window).width() - this.width() - 5) + $(window).scrollLeft() + "px");
return this;
};
// Function to set position of object to bottom
jQuery.fn.bottom = function () {
this.css("position", "absolute");
this.css("top", ($(window).height() - this.height() - 5) + $(window).scrollTop() + "px");
return this;
};
// Replace all text
// Replace all text by new text
String.prototype.replaceAll = function (oldText, newText) {
var strResult = this;
while (strResult.indexOf(oldText) >= 0) {
......@@ -2223,3 +2557,30 @@ function ToogleLogoutNortice() {
avwSetLogoutNortice();
}
};
/*
Get UTC Time ( GMT + 0 )
*/
function getUtcTime() {
var curTime = new Date();
/* get time zone */
var timeZone = curTime.getTimezoneOffset();
var resultTime = new Date(curTime.getTime() + (timeZone * 60000));
return resultTime;
};
// Get UUID version 4
function getUUID() {
return uuid.v4();
};
/*
Check is anonymous user login
*/
function isAnonymousLogin() {
return avwSysSetting().anonymousLoginFlg;
}
\ No newline at end of file
......@@ -53,10 +53,9 @@
*
* Author: Daniel Bremer-Tonn
**/
(function($)
{
(function ($) {
var settings = {
inEffect: {opacity: 'show'}, // in effect
inEffect: { opacity: 'show' }, // in effect
inEffectDuration: 600, // in effect duration in miliseconds
stayTime: 3000, // time in miliseconds before the item has to disappear
text: '', // content of the item. Might be a string or a jQuery object. Be aware that any jQuery object which is acting as a message will be deleted when the toast is fading away.
......@@ -64,19 +63,19 @@
type: 'notice', // notice, warning, error, success
position: 'top-right', // top-left, top-center, top-right, middle-left, middle-center, middle-right ... Position of the toast container holding different toast. Position can be set only once at the very first call, changing the position after the first call does nothing
closeText: '', // text which will be shown as close button, set to '' when you want to introduce an image via css
close: null // callback function when the toastmessage is closed
close: null, // callback function when the toastmessage is closed
messages: null, // No.17: for multi messages, structure: type+text
customMessages: null // No.17 for custom message
};
var methods = {
init : function(options)
{
init: function (options) {
if (options) {
$.extend( settings, options );
$.extend(settings, options);
}
},
showToast : function(options)
{
showToast: function (options) {
var localSettings = {};
$.extend(localSettings, settings, options);
......@@ -85,19 +84,46 @@
toastWrapAll = (!$('.toast-container').length) ? $('<div></div>').addClass('toast-container').addClass('toast-position-' + localSettings.position).appendTo('body') : $('.toast-container');
toastItemOuter = $('<div></div>').addClass('toast-item-wrapper');
toastItemInner = $('<div></div>').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('<p>').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter);
toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function() { $().toastmessage('removeToast',toastItemInner, localSettings) });
// [start] No.17
//toastItemInner = $('<div></div>').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('<p>').append (localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter);
//toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function() { $().toastmessage('removeToast',toastItemInner, localSettings) });
//toastItemImage = $('<div></div>').addClass('toast-item-image').addClass('toast-item-image-' + localSettings.type).prependTo(toastItemInner);
// cusstom messages
if (localSettings.customMessages) {
toastItemInner = $('<div id="' + localSettings.customMessages + '"></div>').addClass('toast-item').appendTo(toastWrapAll); //.animate(localSettings.inEffect, localSettings.inEffectDuration);
toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText); //.click(function () { $().toastmessage('removeToast', toastItemInner, localSettings) });
}
// Multi messages
else if (localSettings.messages) {
toastItemInner = $('<div></div>').hide().addClass('toast-item').appendTo(toastWrapAll).animate(localSettings.inEffect, localSettings.inEffectDuration);
toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function () { $().toastmessage('removeToast', toastItemInner, localSettings) });
for (var nIndexMsg = 0; nIndexMsg < localSettings.messages.length; nIndexMsg++) {
// Add each message to display
$('<div></div>').addClass('toast-item-image-' + localSettings.messages[nIndexMsg].type).addClass('toast-item-message').html(localSettings.messages[nIndexMsg].text).prependTo(toastItemInner);
}
}
else { // Single message -> Same to old method
toastItemInner = $('<div></div>').hide().addClass('toast-item toast-type-' + localSettings.type).appendTo(toastWrapAll).html($('<p>').append(localSettings.text)).animate(localSettings.inEffect, localSettings.inEffectDuration).wrap(toastItemOuter);
toastItemClose = $('<div></div>').addClass('toast-item-close').prependTo(toastItemInner).html(localSettings.closeText).click(function () { $().toastmessage('removeToast', toastItemInner, localSettings) });
toastItemImage = $('<div></div>').addClass('toast-item-image').addClass('toast-item-image-' + localSettings.type).prependTo(toastItemInner);
}
// [ end ] No.17
if(navigator.userAgent.match(/MSIE 6/i))
{
toastWrapAll.css({top: document.documentElement.scrollTop});
if (navigator.userAgent.match(/MSIE 6/i)) {
toastWrapAll.css({ top: document.documentElement.scrollTop });
}
if(!localSettings.sticky)
{
setTimeout(function()
{
if (!localSettings.sticky) {
setTimeout(function () {
$().toastmessage('removeToast', toastItemInner, localSettings);
},
localSettings.stayTime);
......@@ -105,56 +131,48 @@
return toastItemInner;
},
showNoticeToast : function (message)
{
var options = {text : message, type : 'notice'};
showNoticeToast: function (message) {
var options = { text: message, type: 'notice' };
return $().toastmessage('showToast', options);
},
showSuccessToast : function (message)
{
var options = {text : message, type : 'success'};
showSuccessToast: function (message) {
var options = { text: message, type: 'success' };
return $().toastmessage('showToast', options);
},
showErrorToast : function (message)
{
var options = {text : message, type : 'error'};
showErrorToast: function (message) {
var options = { text: message, type: 'error' };
return $().toastmessage('showToast', options);
},
showWarningToast : function (message)
{
var options = {text : message, type : 'warning'};
showWarningToast: function (message) {
var options = { text: message, type: 'warning' };
return $().toastmessage('showToast', options);
},
removeToast: function(obj, options)
{
obj.animate({opacity: '0'}, 600, function()
{
obj.parent().animate({height: '0px'}, 300, function()
{
removeToast: function (obj, options) {
obj.animate({ opacity: '0' }, 600, function () {
obj.parent().animate({ height: '0px' }, 300, function () {
obj.parent().remove();
});
});
// callback
if (options && options.close !== null)
{
if (options && options.close !== null) {
options.close();
}
}
};
$.fn.toastmessage = function( method ) {
$.fn.toastmessage = function (method) {
// Method calling logic
if ( methods[method] ) {
return methods[ method ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof method === 'object' || ! method ) {
return methods.init.apply( this, arguments );
if (methods[method]) {
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
} else if (typeof method === 'object' || !method) {
return methods.init.apply(this, arguments);
} else {
$.error( 'Method ' + method + ' does not exist on jQuery.toastmessage' );
$.error('Method ' + method + ' does not exist on jQuery.toastmessage');
}
};
......
......@@ -92,6 +92,23 @@ function screenLock(options) {
/* ロックするまでのアイドルタイマー */
function setIdleTimer() {
// check time out
if (timeout < 0) { // Remove unlock when timeout < 0 (this case for: after unlock, values from service options: web_screen_lock=N)
// clear timeout
if (idleTimerId) {
clearTimeout(idleTimerId);
idleTimerId = null;
}
bTimeout = false;
// clear lock state
removeLockState();
return;
}
// アイドルタイマーのタイムアウト時間(デフォルト/オプション指定時間)
var idleStateTimeout = timeout;
......@@ -205,6 +222,10 @@ function screenLock(options) {
$('#screenLockErrMsg').text(format(errorMessage, val.errorCode.errorMessage));
$('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus();
// Set new timeout value
if (val.newTimeout) {
timeout = val.newTimeout;
}
return;
}
/*
......
// uuid.js
//
// Copyright (c) 2010-2012 Robert Kieffer
// MIT License - http://opensource.org/licenses/mit-license.php
(function() {
var _global = this;
// Unique ID creation requires a high quality random # generator. We feature
// detect to determine the best RNG source, normalizing to a function that
// returns 128-bits of randomness, since that's what's usually required
var _rng;
// Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
//
// Moderately fast, high quality
if (typeof(require) == 'function') {
try {
var _rb = require('crypto').randomBytes;
_rng = _rb && function() {return _rb(16);};
} catch(e) {}
}
if (!_rng && _global.crypto && crypto.getRandomValues) {
// WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
//
// Moderately fast, high quality
var _rnds8 = new Uint8Array(16);
_rng = function whatwgRNG() {
crypto.getRandomValues(_rnds8);
return _rnds8;
};
}
if (!_rng) {
// Math.random()-based (RNG)
//
// If all else fails, use Math.random(). It's fast, but is of unspecified
// quality.
var _rnds = new Array(16);
_rng = function() {
for (var i = 0, r; i < 16; i++) {
if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
_rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
}
return _rnds;
};
}
// Buffer class to use
var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array;
// Maps for number <-> hex string conversion
var _byteToHex = [];
var _hexToByte = {};
for (var i = 0; i < 256; i++) {
_byteToHex[i] = (i + 0x100).toString(16).substr(1);
_hexToByte[_byteToHex[i]] = i;
}
// **`parse()` - Parse a UUID into it's component bytes**
function parse(s, buf, offset) {
var i = (buf && offset) || 0, ii = 0;
buf = buf || [];
s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
if (ii < 16) { // Don't overflow!
buf[i + ii++] = _hexToByte[oct];
}
});
// Zero out remaining bytes if string was short
while (ii < 16) {
buf[i + ii++] = 0;
}
return buf;
}
// **`unparse()` - Convert UUID byte array (ala parse()) into a string**
function unparse(buf, offset) {
var i = offset || 0, bth = _byteToHex;
return bth[buf[i++]] + bth[buf[i++]] +
bth[buf[i++]] + bth[buf[i++]] + '-' +
bth[buf[i++]] + bth[buf[i++]] + '-' +
bth[buf[i++]] + bth[buf[i++]] + '-' +
bth[buf[i++]] + bth[buf[i++]] + '-' +
bth[buf[i++]] + bth[buf[i++]] +
bth[buf[i++]] + bth[buf[i++]] +
bth[buf[i++]] + bth[buf[i++]];
}
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
// random #'s we need to init node and clockseq
var _seedBytes = _rng();
// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
var _nodeId = [
_seedBytes[0] | 0x01,
_seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
];
// Per 4.2.2, randomize (14 bit) clockseq
var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
// Previous uuid creation time
var _lastMSecs = 0, _lastNSecs = 0;
// See https://github.com/broofa/node-uuid for API details
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || [];
options = options || {};
var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
// UUID timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
// time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
var msecs = options.msecs != null ? options.msecs : new Date().getTime();
// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
// Time since last uuid creation (in msecs)
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
// Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq == null) {
clockseq = clockseq + 1 & 0x3fff;
}
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
nsecs = 0;
}
// Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000;
// `time_low`
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff;
// `time_mid`
var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff;
// `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff;
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80;
// `clock_seq_low`
b[i++] = clockseq & 0xff;
// `node`
var node = options.node || _nodeId;
for (var n = 0; n < 6; n++) {
b[i + n] = node[n];
}
return buf ? buf : unparse(b);
}
// **`v4()` - Generate random UUID**
// See https://github.com/broofa/node-uuid for API details
function v4(options, buf, offset) {
// Deprecated - 'format' argument, as supported in v1.2
var i = buf && offset || 0;
if (typeof(options) == 'string') {
buf = options == 'binary' ? new BufferClass(16) : null;
options = null;
}
options = options || {};
var rnds = options.random || (options.rng || _rng)();
// Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
rnds[6] = (rnds[6] & 0x0f) | 0x40;
rnds[8] = (rnds[8] & 0x3f) | 0x80;
// Copy bytes to buffer, if provided
if (buf) {
for (var ii = 0; ii < 16; ii++) {
buf[i + ii] = rnds[ii];
}
}
return buf || unparse(rnds);
}
// Export public API
var uuid = v4;
uuid.v1 = v1;
uuid.v4 = v4;
uuid.parse = parse;
uuid.unparse = unparse;
uuid.BufferClass = BufferClass;
if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() {return uuid;});
} else if (typeof(module) != 'undefined' && module.exports) {
// Publish as node.js module
module.exports = uuid;
} else {
// Publish as global (in browsers)
var _previousRoot = _global.uuid;
// **`noConflict()` - (browser only) to reset global 'uuid' var**
uuid.noConflict = function() {
_global.uuid = _previousRoot;
return uuid;
};
_global.uuid = uuid;
}
}).call(this);
\ No newline at end of file
......@@ -43,7 +43,7 @@
"dspShiori":"Bookmark",
"dspSetting":"Setting",
"dspLogout":"Logout",
"txtRead":"Read",
"txtRead":"Open",
"txtSort":"Sort",
"dspTitleNm":"Title",
"dspTitleNmKn":"Title(Kana)",
......@@ -64,7 +64,7 @@
"dspBkCancel":"Logout",
"txtSearchResult":"Result",
"dspHome":"Home",
"txtLoginUser":"(Ver.20121221-3)User:",
"txtLoginUser":"(Ver.20130712)User:",
"txtAll":"All",
"txtMkgSize":"Size",
"txtMkgS":"S",
......@@ -122,6 +122,21 @@
"txtMemo":"Memo",
"msgBGMPlayConfirm":"Content BGM will be played automatically.",
"msgPWDNeedChange":"Change password is required. Please back Setting view.",
"msgBGMPagePlayConfirm":"Page BGM will be played automatically."
"msgBGMPagePlayConfirm":"Page BGM will be played automatically.",
"txtBkSelectData":"EN_バックアップするデータを選択してください。",
"txtBkMarking":"EN_マーキング",
"txtBkMemo":"EN_メモ",
"txtBkShiori":"EN_しおり",
"txtResSelect":"EN_リストアするデータを選択してください。",
"txtBkDefault":"EN_バックアップのデフォルト:",
"txtOptPageTrans":"ビューのアニメーション種類",
"txtOptPageTransSlide":"スライド",
"txtOptPageTransFade":"フェード",
"txtOptPageTransRev":"リヴェール&ムーブイン",
"txtOptPageTransPeriod":"アニメーション時間(Sec)",
"msgPushAlert":"新着メッセージがあります!!!",
"txtPushAlert":"通知",
"txtNext":"次>",
"txtPrevious":"<前",
"msgAnonymousLoginErr":"ログインできません。(エラーコード:)"
}
......@@ -43,7 +43,7 @@
"dspShiori":"しおり",
"dspSetting":"設定変更",
"dspLogout":"ログアウト",
"txtRead":"読む",
"txtRead":"開く",
"txtSort":"並べ替え",
"dspTitleNm":"タイトル",
"dspTitleNmKn":"タイトル(カナ)",
......@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果",
"dspHome":"ホーム",
"txtLoginUser":"(Ver.20121221-3)ログイン中:",
"txtLoginUser":"(Ver.20130712)ログイン中:",
"txtAll":"すべて",
"txtMkgSize":"太さ",
"txtMkgS":"小",
......@@ -102,10 +102,10 @@
"txtResMsgNotice":"※リストアすると、現時点のローカルのデータでサーバのバックアップデータを上書きします。リストア後、元の状態に復元できませんので、ご注意ください",
"dspChange":"変更",
"msgNoIndex":"インデックスがありません",
"msgBackupSuccess":"バックアップが正常に終了しました",
"msgBackupFailed":"バックアップに失敗しました",
"msgRestoreSuccess":"リストアが正常に終了しました",
"msgRestoreFailed":"リストアに失敗しました",
"msgBackupSuccess":"のバックアップに成功しました",
"msgBackupFailed":"バックアップに失敗しました",
"msgRestoreSuccess":"のリストアに成功しました",
"msgRestoreFailed":"リストアに失敗しました",
"txtDeleteConfirmTitle":"しおり削除確認",
"msgHistoryNotExist":"閲覧履歴はありません。",
"msgChangePassword":"パスワード変更",
......@@ -122,5 +122,22 @@
"txtMemo":"メモ",
"msgBGMPlayConfirm":"コンテンツBGMが自動再生されます。",
"msgPWDNeedChange":"パスワードの変更が必要です。設定変更画面に戻って変更してください。",
"msgBGMPagePlayConfirm":"ページBGMが自動再生されます。"
"msgBGMPagePlayConfirm":"ページBGMが自動再生されます。",
"txtBkSelectData":"バックアップするデータを選択してください。",
"txtBkMarking":"マーキング",
"txtBkMemo":"メモ",
"txtBkShiori":"しおり",
"txtResSelect":"リストアするデータを選択してください。",
"txtBkDefault":"バックアップのデフォルト:",
"txtOptPageTrans":"ビューのアニメーション種類",
"txtOptPageTransSlide":"スライド",
"txtOptPageTransFade":"フェード",
"txtOptPageTransRev":"リヴェール&ムーブイン",
"txtOptPageTransPeriod":"アニメーション時間(Sec)",
"msgPushAlert":"新着メッセージがあります!!!",
"txtPushAlert":"通知",
"txtNext":"次>",
"txtPrevious":"<前",
"msgAnonymousLoginErr":"ログインできません。(エラーコード:)"
}
......@@ -43,7 +43,7 @@
"dspShiori":"북마크",
"dspSetting":"환경설정",
"dspLogout":"로그아웃",
"txtRead":"열",
"txtRead":"열",
"txtSort":"정렬",
"dspTitleNm":"제목",
"dspTitleNmKn":"제목",
......@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과",
"dspHome":"홈",
"txtLoginUser":"(Ver.20121221-3)로그인 중:",
"txtLoginUser":"(Ver.20130712)로그인 중:",
"txtAll":"전체",
"txtMkgSize":"두께",
"txtMkgS":"소",
......@@ -122,5 +122,21 @@
"txtMemo":"메모",
"msgBGMPlayConfirm":"이 컨텐츠는 BGM을 포함하고 있습니다. 재생을 시작합니다.",
"msgPWDNeedChange":"패스워드를 변경해야 합니다. 환경설정에서 패스워드를 변경해 주십시오.",
"msgBGMPagePlayConfirm":"이 페이지는 BGM을 포함하고 있습니다. 재생을 시작합니다."
"msgBGMPagePlayConfirm":"이 페이지는 BGM을 포함하고 있습니다. 재생을 시작합니다.",
"txtBkSelectData":"KO_バックアップするデータを選択してください。",
"txtBkMarking":"KO_マーキング",
"txtBkMemo":"KO_メモ",
"txtBkShiori":"KO_しおり",
"txtResSelect":"KO_リストアするデータを選択してください。",
"txtBkDefault":"KO_バックアップのデフォルト:",
"txtOptPageTrans":"ビューのアニメーション種類",
"txtOptPageTransSlide":"スライド",
"txtOptPageTransFade":"フェード",
"txtOptPageTransRev":"リヴェール&ムーブイン",
"txtOptPageTransPeriod":"アニメーション時間(Sec)",
"msgPushAlert":"新着メッセージがあります!!!",
"txtPushAlert":"通知",
"txtNext":"次>",
"txtPrevious":"<前",
"msgAnonymousLoginErr":"ログインできません。(エラーコード:)"
}
{
"apiUrl" : "https://221.111.54.26/sc/{0}/abvapi",
"apiLoginUrl" : "https://221.111.54.26/sc/nuabvapi",
"apiResourceDlUrl" : "https://221.111.54.26/scdl/{0}/dl",
"apiUrl" : "http://web3.agentec.jp/acms/{0}/abvapi",
"apiLoginUrl" : "http://web3.agentec.jp/acms/nuabvapi",
"apiResourceDlUrl" : "http://web3.agentec.jp/acms/{0}/dl",
"bookShelfCount": 15,
"bookListCount" : 15,
"screenlockTimeDefault" : 30,
"pushPageCount" : 10,
"pushTimePeriod" : 60,
"debug" : true,
"loginPage" : "index.html",
"anonymousLoginFlg" : false,
"anonymousLoginPath" : "abetest",
"anonymousLoginId" : "nologin",
"appName" : "ABookWebCL",
"appVersion" : "0.0.1"
......
......@@ -41,11 +41,22 @@
<a> </a>
</p>
<header>
<div class="notification-pushmessage" style="display:none;">
新着メッセージがあります!!!
</div>
<div class="cnt_header">
<a class="logo" href="javascript:void(0);" onclick="avwScreenMove(ScreenIds.Home)"> </a>
<div class="menu_language">
<ul>
<li><label class="lang" lang="txtLoginUser">こんにちは</label><label id="login-username"> </label></li>
<li class="pushmessage hide" id="liPushMessage"><label class="lang" lang="txtPushAlert">新着 : </label><label id="numbermessage"></label><span></span>
<div id="list-push-message">
<div id="show-push-message"></div>
<p><a id='prev-page-message' style="display:none;" class="lang" lang="txtPrevious"><前</a><a id='next-page-message' style="display:none;" class="lang" lang="txtNext">次k></a></p>
</div>
</li>
<li class="jp" id="language-jp"><a href="#">日本語</a></li>
<li class="eng" id="language-en"><a href="#">English</a></li>
<li class="kor" id="language-kr"><a href="#">한글</a></li>
......@@ -59,7 +70,7 @@
</div>
</ul>
<p class="button">
<a style="margin-right:0;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a style="margin-right:0;display:none;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a class="blue lang" href="#" lang="dspSetting" id="dspSetting">設定変更</a>
<a class="blue lang" href="#" lang="dspViewHistory" id="dspViewHistory">閲覧履歴</a>
<a class="blue lang" href="#" id="dspShiori" lang="dspShiori">しおり</a>
......@@ -68,7 +79,7 @@
</div>
</div>
</header>
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<!--<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
......@@ -80,7 +91,29 @@
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>-->
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
<p class="message-options">
<label class="option_backup">
<label lang="txtBkSelect" class="lang" class="lang">バックアップするデータを選択してください。</label><br />
<input type="checkbox" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice">
<input type="checkbox" id="chkRememberBackup" /><label for="chkRememberBackup" class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</label>
</p>
<p class="backupbtn">
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>
<article id="contentDetail" class="contentDetail">
<section id='sectionContentDetail' class='sectionContentDetail'>
<a class="closebtn" href="#" id="contentDetailClose"> </a>
......
......@@ -2,7 +2,7 @@
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1" />
<!--<meta http-equiv="X-UA-Compatible" content="IE=9,chrome=1" />-->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">
<meta http-equiv="Cache-Control" content="no-cache">
......@@ -33,6 +33,15 @@
<script src="./common/js/common.js"></script>
<script src="./common/js/htmlparser.js"></script>
<script src="./common/js/textObject.js"></script>
<!--Start Function : No.17 - Editor : Long - Date : 07/30/2013 - Summary : Include uuid.js for using createUUID function in common.js -->
<script src="./common/js/uuid.js"></script>
<!--End Function : No.17 - Editor : Long - Date : 07/30/2013 - Summary : Include uuid.js for using createUUID function in common.js -->
<script src="js/contentview_CallApi.js" type="text/javascript"></script>
<script src="js/contentview_Events.js" type="text/javascript"></script>
<script src="js/contentview_GetData.js" type="text/javascript"></script>
<script src="js/contentview_InitObjects.js" type="text/javascript"></script>
<script src="js/contentview_CreateObjects.js" type="text/javascript"></script>
<script src="js/contentview_General.js" type="text/javascript"></script>
<script src="./js/contentview.js"></script>
<script src="./js/contentview_Memo.js"></script>
<script src="./js/contentview_Gomu.js"></script>
......@@ -51,6 +60,11 @@
<script type="text/javascript" src="common/js/jquery.powertip.js"></script>
<script type="text/javascript" src="common/js/script.js"></script>
<style>
html, body{
-ms-touch-action : none !important;
}
</style>
</head>
<body id="viewer">
......@@ -188,6 +202,8 @@
<div id="divDialogMemo" style="width:466px;height:389px;display:none; position: absolute"> </div>
<div id="dialog-contenttype-music" style="width:466px;height:389px;display:none; position: absolute"> </div>
<div id="dialogPopUp" class="popuptext_web_dialog"> </div>
<div id="arrow" class="popuptext_arrow"> </div>
<div id="pop_up_memo" class="pop-up-memo">
......
......@@ -108,14 +108,9 @@
background-image: url(../css/button_back_on.svg);
}
.sectionbackup1 {
width:500px;
height: 290px;
height: 310px;
border:1px solid #cccccc;
display: none;
padding:0;
......@@ -132,6 +127,17 @@
z-index: 101;
}
.sectionbackup1 .message-options .option_backup
{
font-size:13px;
margin:0 0 0 24px;
}
.sectionbackup1 .message-options .option_backup input
{
margin:0 5px 0 15px;
}
.sectionbackup1 h1{
margin:0 0 38px 0;
padding:0;
......@@ -152,10 +158,17 @@
font-family: 'trebuchet ms', verdana, arial;
}
.sectionbackup1 p{
.sectionbackup1 p
{
width:360px;
margin:0 50px;
}
.sectionbackup1 p.notice
{
text-align:center;
margin-top:20px;
font-size:13px;
}
.sectionbackup1 p.message{
font-size:15px;
font-weight:bold;
......@@ -224,3 +237,8 @@
-ms-filter: none;
background-image: url(../css/button_back_on.svg);
}
.sectionbackup1 .backupbtn a.disabled,.sectionbackup .backupbtn a.disabled
{
}
\ No newline at end of file
......@@ -23,3 +23,130 @@
{
cursor: pointer;
}
/* push message */
.menu_language ul li.pushmessage
{
-moz-box-shadow:inset 0px 1px 0px 0px #d6ee23;
-webkit-box-shadow:inset 0px 1px 0px 0px #d6ee23;
box-shadow:inset 0px 1px 0px 0px #d6ee23;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #a4d815), color-stop(1, #83c008) );
background:-moz-linear-gradient( center top, #a4d815 5%, #83c008 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#a4d815', endColorstr='#83c008');
background-color:#a4d815;
border:1px solid #83bd07;
display:inline-block;
color:#ffffff;
font-family:arial;
font-size:14px;
font-weight:bold;
padding:2px 0;
line-height:21px;
text-decoration:none;
text-shadow:1px 1px 0px #a2d613;
margin:0 0 0 0;
text-align:center;
padding:0 10px 0 5px;
text-align:center;
cursor:pointer;
position:relative;
}
.menu_language ul li.pushmessage label
{
cursor:pointer;
}
.menu_language ul li.pushmessage span
{
display:inline-block;
width:10px;
height:10px;
margin-left:5px;
cursor:pointer;
}
.menu_language ul li.hide span
{
background:url(arrow_down.png) no-repeat right center;
}
.menu_language ul li.show span
{
background:url(arrow_up.png) no-repeat right center;
}
.menu_language ul li.pushmessage:hover {
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #83c008), color-stop(1, #a4d815) );
background:-moz-linear-gradient( center top, #83c008 5%, #a4d815 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#83c008', endColorstr='#a4d815');
background-color:#83c008;
}
#numbermessage
{
color:#f00;
margin-left:8px;
min-width:20px;
display:inline-block;
}
#list-push-message
{
position:absolute;
top:100%;
left:0;
border:solid 1px #444;
background-color:#fff;
z-index:1;
text-shadow:none;
padding:10px;
font-weight:normal;
width:200px;
text-align:left;
display:none;
}
#list-push-message div
{
margin:0;
padding:0;
list-style-type:none;
background-color:#fff;
}
#list-push-message div
{
color:#000;
font-size:12px;
padding:3px 0;
white-space:nowrap;
line-height:150%;
}
#list-push-message p
{
text-align:right;
margin:0;
padding:0;
}
#list-push-message p a
{
text-decoration:underline;
color:#00f;
padding:0 5px;
}
.notification-pushmessage
{
position:fixed;
height:40px;
line-height:40px;
text-align:center;
background-color:#bde;
opacity:0.8;
border:solid 1px #333;
top:0;
left:0;
right:0;
color:#000;
border:solid 1px #000;
font-weight:bold;
z-index:10000;
font-size:13px;
}
.toast-item-loading
{
text-align:center;
height:40px;
background:url(../img/data_loading.gif) no-repeat center;
}
\ No newline at end of file
......@@ -90,7 +90,6 @@ article .contentDetail {
}
.sectionContentDetail #book_data .read_btn a.read {
position:absolute;
-moz-box-shadow:inset 0px 1px 0px 0px #d6ee23;
-webkit-box-shadow:inset 0px 1px 0px 0px #d6ee23;
box-shadow:inset 0px 1px 0px 0px #d6ee23;
......
......@@ -277,3 +277,17 @@ section h1{
font-size: large;
font-family: 'trebuchet ms', verdana, arial;
}
/* splash */
.splash-screen
{
background-color:#244;
text-align:center;
background:url(Abook_splash.jpg) no-repeat center;
position:fixed;
left:0;
top:0;
right:0;
bottom:0;
}
\ No newline at end of file
......@@ -42,9 +42,13 @@
width:320px;
margin:0 50px;
}
.sectionrestore p.message{
.sectionrestore p.message-options
{
margin-bottom:20px;
}
.sectionrestore p.message
{
/*margin-bottom:20px;*/
font-size:15px;
font-weight:bold;
color:#333;
......@@ -116,3 +120,7 @@
-ms-filter: none;
background-image: url(../css/button_back_on.svg);
}
.sectionrestore .restorebtn a.disabled
{
}
\ No newline at end of file
......@@ -166,7 +166,7 @@ section div#user_info .passchgbtn a:hover:not(:target) {
div#user_option{
width:inherit;
height:395px;
height:415px;
background:url(../img/common/back_dot.gif);
-moz-border-radius:6px;
-webkit-border-radius:6px;
......@@ -215,6 +215,15 @@ section div#user_option .logout_backup{
margin:0 0 16px 30px;
font-size:13px;
}
section div#user_option .option_backup
{
font-size:13px;
margin:0 0 0 24px;
}
section div#user_option .option_backup input
{
margin:0 5px 0 15px;
}
section div#user_option input {
display:inline;
......@@ -223,6 +232,13 @@ section div#user_option input {
padding:0;
}
.message-options
{
font-weight:normal;
text-align:center;
font-size:13px;
margin-bottom:20px;
}
section div#user_option .backupbtn {
margin:0 0 35px 30px;
......
......@@ -40,11 +40,23 @@
<a> </a>
</p>
<header>
<div class="notification-pushmessage" style="display:none;">
新着メッセージがあります!!!
</div>
<div class="cnt_header">
<a class="logo" href="javascript:void(0);" onclick="avwScreenMove(ScreenIds.Home)"> </a>
<div class="menu_language">
<ul>
<li><label class="lang" lang="txtLoginUser">こんにちは</label><label id="login-username"> </label></li>
<li class="pushmessage hide" id="liPushMessage"><label class="lang" lang="txtPushAlert">新着 : </label><label id="numbermessage"></label><span></span>
<div id="list-push-message">
<div id="show-push-message"></div>
<p><a id='prev-page-message' style="display:none;" class="lang" lang="txtPrevious"><前</a><a id='next-page-message' style="display:none;" class="lang" lang="txtNext">次k></a></p>
</div>
</li>
<li class="jp" id="language-jp"><a href="#">日本語</a></li>
<li class="eng" id="language-en"><a href="#">English</a></li>
<li class="kor" id="language-kr"><a href="#">한글</a></li>
......@@ -58,7 +70,7 @@
</div>
</ul>
<p class="button">
<a style="margin-right:0;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a style="margin-right:0;display:none;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a class="blue lang" href="#" lang="dspSetting" id="dspSetting">設定変更</a>
<a class="blue lang" href="#" lang="dspViewHistory" id="dspViewHistory">閲覧履歴</a>
<a class="blue lang" href="#" id="dspShiori" lang="dspShiori">しおり</a>
......@@ -67,7 +79,7 @@
</div>
</div>
</header>
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<!-- <section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
......@@ -79,7 +91,28 @@
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>
</section>-->
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
<p class="message-options">
<label class="option_backup">
<label lang="txtBkSelect" class="lang" class="lang">バックアップするデータを選択してください。</label><br />
<input type="checkbox" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice">
<input type="checkbox" id="chkRememberBackup" /><label for="chkRememberBackup" class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</label>
</p>
<p class="backupbtn">
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>
<article id="contentDetail" class="contentDetail">
<section id='sectionContentDetail' class='sectionContentDetail'>
<a class="closebtn" href="#" id="contentDetailClose"> </a>
......
......@@ -32,6 +32,7 @@
<script src="./common/js/avweb.js"></script>
<script src="./common/js/i18n.js"></script>
<script src="./common/js/common.js"></script>
<script src="./common/js/uuid.js"></script>
<script src="./js/home.js"></script>
<script src="./js/header.js"></script>
<script src="./common/js/gotop.js"></script>
......@@ -50,11 +51,22 @@
<a> </a>
</p>
<header>
<div class="notification-pushmessage" style="display:none;">
新着メッセージがあります!!!
</div>
<div class="cnt_header">
<a class="logo" href="javascript:void(0);" onclick="avwScreenMove(ScreenIds.Home)"> </a>
<div class="menu_language">
<ul>
<li><label class="lang" lang="txtLoginUser">こんにちは</label><label id="login-username"> </label></li>
<li class="pushmessage hide" id="liPushMessage"><label class="lang" lang="txtPushAlert">新着 : </label><label id="numbermessage"></label><span></span>
<div id="list-push-message">
<div id="show-push-message"></div>
<p><a id='prev-page-message' style="display:none;" class="lang" lang="txtPrevious"><前</a><a id='next-page-message' style="display:none;" class="lang" lang="txtNext">次k></a></p>
</div>
</li>
<li class="jp" id="language-jp"><a href="#">日本語</a></li>
<li class="eng" id="language-en"><a href="#">English</a></li>
<li class="kor" id="language-kr"><a href="#">한글</a></li>
......@@ -68,7 +80,7 @@
</div>
</ul>
<p class="button">
<a style="margin-right:0;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a style="margin-right:0;display:none;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a class="blue lang" href="#" lang="dspSetting" id="dspSetting">設定変更</a>
<a class="blue lang" href="#" lang="dspViewHistory" id="dspViewHistory">閲覧履歴</a>
<a class="blue lang" href="#" id="dspShiori" lang="dspShiori">しおり</a>
......@@ -77,7 +89,7 @@
</div>
</div>
</header>
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<!--<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
......@@ -89,6 +101,26 @@
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>-->
<section class="sectionbackup1 " id="dlgConfirmBackup1">
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
<p class="message-options">
<label class="option_backup">
<label lang="txtBkSelect" class="lang" class="lang">バックアップするデータを選択してください。</label><br />
<input type="checkbox" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice">
<input type="checkbox" id="chkRememberBackup" /><label for="chkRememberBackup" class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</label>
</p>
<p class="backupbtn">
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
<a class="ok lang" href="#" id="dlgConfirmBackup-backup" lang="dspBkOK">バックアップしてログアウト</a>
</p>
</section>
<article id="contentDetail">
<section id='sectionContentDetail' class='sectionContentDetail'>
......@@ -110,9 +142,6 @@
<div class="wrapper">
<div id="main">
<div class="tabUnit">
<ul class="switchingTab">
<li class="colleft" ><a href="#list_0" class="current lang" lang="txtGen" id="lnkbtnGenre">ジャンル</a></li>
......
......@@ -30,7 +30,32 @@ var DEFAULT_IMG_CONTENT_EDIT = 'img/list/updatebook.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var iNumberOfNextRecord = 15;
var arrayTemp = [];
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
//Thumbnail array
var thumbnailArr = [];
//Content type array.
var contentTypeArr = [];
//Content's types
var ContentTypeKeys = {
Type_PDF : 'pdfFile',
Type_Image : 'imageFile',
Type_Video : 'movieFile',
Type_Music : 'soundFile',
Type_Others : 'otherFile',
Type_NoFile : 'noFile',
Type_Html: 'htmlFile'
};
var ThumbnailForOtherType = {
Thumbnail_ImageType : 'img/image_type.png',
Thumbnail_VideoType : 'img/iPad_video.png',
Thumbnail_MusicType : 'img/iPad_music.png',
Thumbnail_OthersType : 'img/NoFile_Type.jpg',
Thumbnail_NoFileType : 'img/other_file.jpg',
Thumbnail_HtmlType : 'img/htmltype.png'
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
......@@ -228,7 +253,17 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
);
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = formatStringBase64(formatThumbnail);
}
thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//assign content type to array
contentTypeArr.push({ contentId: post.contentId, contentType: post.contentType });
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
......@@ -415,6 +450,11 @@ function canvasClickFunction(e){
var base64String = returnThumbnail(outputId);
ClientData.contentInfo_contentThumbnail(base64String);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
var contentType = returnContentType(outputId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
......@@ -722,13 +762,78 @@ function sortByReleaseDateFunction(){
//Get Thumnail base on contentid
function returnThumbnail(contentid){
for(var i = 0; i < arrayTemp.length; i++){
if(arrayTemp[i].contentId == contentid){
return arrayTemp[i].thumbnail;
for(var i = 0; i < thumbnailArr.length; i++){
if(thumbnailArr[i].contentId == contentid){
return thumbnailArr[i].thumbnail;
}
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Get content type base on contentid
function returnContentType(contentid){
//Array Length
var iArrCnt = contentTypeArr.length;
//Get contentType in array by contentId
for(var i = 0; i < iArrCnt; i++){
if (contentTypeArr[i].contentId == contentid) {
return contentTypeArr[i].contentType;
}
}
};
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
//Get resource Id of content
function downloadResourceById(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2',
};
var resourceUrl;
abapi('webGetContent', params, 'GET', function (data) {
var resourceId;
$.each(data.contentData , function(i, n){
if(typeof n == "object"){
resourceId = n.resourceId;
}
});
//Get resource
resourceUrl = getResourceByIdFromAPI(resourceId);
window.open(resourceUrl, "_self");
});
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId;
};
/* get url */
function getURL(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiResourceDlUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Dialog Read Button CLick
function readSubmenuFunction(e){
if (e) {
......@@ -750,6 +855,11 @@ function readSubmenuFunction(e){
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
var contentType = returnContentType(contentId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
var checkflag = false;
//Store Content id that user has read
......@@ -792,7 +902,21 @@ function readSubmenuFunction(e){
ClientData.ReadingContentIds(contentIdArray);
ClientData.IsRefresh(false);
//Start Function : No.12 -- Editor : Le Long -- Date : 08/02/2013 -- Summary : Check content type other for download.
//For testing without other Type.
//contentType = ContentTypeKeys.Type_Others;
if(contentType == ContentTypeKeys.Type_Others){
//Download content
downloadResourceById(contentId);
}
else{
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
//End Function : No.12 -- Editor : Le Long -- Date : 08/02/2013 -- Summary : Check content type other for download.
};
//Check if Content Has marking or memo
......@@ -852,6 +976,11 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
var contentThumbnail = returnThumbnail(contId);
var contentType = returnContentType(contId);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
......@@ -865,7 +994,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
else{
......@@ -879,7 +1034,34 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
......@@ -895,7 +1077,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
}
}
......@@ -919,7 +1127,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -943,7 +1177,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -1249,6 +1509,11 @@ function titleClickFunction(e){
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
var contentType = returnContentType(contentid);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type of content.
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
......
This source diff could not be displayed because it is too large. You can view the blob instead.

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
//Call API
function abapi(name, param, method, callback) {
avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
/* get Json stored content info */
function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
webGetPageImageContentSize();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
function webGetPageImageContentSize() {
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPageSize",
"GET",
{ contentId: contentID, sid: ClientData.userInfo_sid() },
function (data) {
widthContentImage = data.width;
heightContentImage = data.height;
},
null);
};
function webGetContentData() {
avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent",
"GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) {
totalPage = data.contentData.allPageNum;
},
null);
};
/* get Json stored page title */
function getJsonDataPageTitle() {
avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent",
"GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 3 },
function (data) {
dataPageTitle = [];
for (var nIndex = 0; nIndex < totalPage; nIndex++) {
dataPageTitle.push("");
}
if (data.contentData) {
if (data.contentData.titleInfo) {
dataPageTitle = data.contentData.titleInfo;
}
}
},
null);
};
/* get Json webGetContent4 */
function getJsonDataType4() {
avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent",
"GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 4 },
function (data) {
dataJsonType4 = data.contentData.linkData;
},
null);
};
/* get Json webGetContent5 */
function getJsonDataType5() {
avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent",
"GET",
{ contentId: contentID, sid: ClientData.userInfo_sid(), getType: 5 },
function (data) {
dataJsonType5 = data.contentData.outlineData;
},
null);
};
/* read file Json -> get page objects */
function getDataJsonFile() {
//get content from JSON
avwCmsApi(ClientData.userInfo_accountPath(),
"webGetContent",
"GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, getType: 2 },
function (data) {
var JsonFile = data.contentData;
pageObjectsData = [];
if (JsonFile.vertical) {
if (JsonFile.vertical.pages) {
pageObjectsData = JsonFile.vertical.pages;
}
}
else if (JsonFile.horizontal) {
if (JsonFile.horizontal.pages) {
pageObjectsData = JsonFile.horizontal.pages;
}
}
getPageObjectsByPageIndex(pageObjectsData, 0);
},
null);
};
function loadDataBookmark(lstPageNo) {
if (isSendingData == true) {
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 },
function (data) {
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_bookmark_' + data.pages[0].pageNo).attr('src', formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function () {
if (imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function (value) {
return value != lstPageNo[0];
});
if (lstPageNo.length > 0) {
loadDataBookmark(lstPageNo);
} else {
isSendingData = false;
}
},
null);
}
};
/* get data using for search */
function getSearchDataFromJson() {
//get data from JSON file
var arrPageNo = '';
for (var nIndex = 0; nIndex < totalPage; nIndex++) {
if (nIndex == 0) {
arrPageNo += (nIndex + 1);
} else {
arrPageNo += "," + (nIndex + 1);
}
}
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, thumbnailFlg: 0 },
function (data) {
contentName = data.contentTitle;
dataWebContentPage = data;
},
null);
};
function loadDataSearch(lstPageNo) {
if (isSendingData == true) {
avwCmsApi(ClientData.userInfo_accountPath(),
"webContentPage",
"GET",
{ sid: ClientData.userInfo_sid(), contentId: contentID, pageNos: lstPageNo[0], thumbnailFlg: 1 },
function (data) {
getDataLoaded(data.pages);
//Resize Image
var imgTemp = new Image();
$('#img_search_' + data.pages[0].pageNo).attr('src', formatStringBase64(data.pages[0].pageThumbnail));
imgTemp.onload = function () {
if (imgTemp.width > imgTemp.height) {
$("img.imgbox").attr('height', '');
$("img.imgbox").removeAttr('height');
$("img.imgbox").attr('width', '43');
}
else {
$("img.imgbox").attr('width', '');
$("img.imgbox").removeAttr('width');
$("img.imgbox").attr('height', '43');
}
};
imgTemp.src = formatStringBase64(data.pages[0].pageThumbnail);
lstPageNo = jQuery.grep(lstPageNo, function (value) {
return value != lstPageNo[0];
});
if (lstPageNo.length > 0) {
loadDataSearch(lstPageNo);
} else {
isSendingData = false;
}
},
null);
}
};

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/// <reference path="contentview_InitObjects.js" />
/// <reference path="contentview_Events.js" />
/* ----------------------------------- Create memo --------------------------------*/
var memoObjects = [];
/* constructor */
var MemoObject = function (id, text, x, y, width, heigth, imageUrl, action) {
};
/* setup each properties */
MemoObject.prototype.setup = function (id, text, x, y, w, h, imageUrl) {
this.text = text;
this.id = id;
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.imageUrl = imageUrl;
};
/* prototype hitTest */
MemoObject.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) {
return true;
}
}
return false;
};
/* draw Memo */
MemoObject.prototype.drawMemo = function (context, opt) {
var posX = this.x;
var posY = this.y;
var objWidth = this.width;
var objHeigth = this.height;
var imageObj = new Image();
imageObj.onload = function () {
context.drawImage(imageObj, posX, posY, objWidth, objHeigth);
flip(opt);
};
imageObj.src = this.imageUrl;
};
/* create memo object */
var memo = function (id, text, x, y, w, h, imageUrl) {
this.setup(id, text, x, y, w, h, imageUrl);
this.action = function () {
EditMemo(id, 0, 0, $('#divDialogMemo'), function () {
/*set flag change memo */
ClientData.isChangedMemo(true);
});
};
};
memo.prototype = new MemoObject();
/*click showEditMemo() */
function showEditMemo() {
objEditMemo.action();
};
/*click copyMemo() */
function copyMemo() {
//isCopyMemo = true;
ClientData.memo_copyText(objEditMemo.text);
//disableControlsCopyMemo();
$("#pop_up_memo").hide();
};
/* ----------------------------------- End create memo -----------------------------*/
/* ----------------------------------- Create webGetContentType4 --------------------------------*/
var webGetContentType4Objects = [];
/* constructor */
var WebGetContentTyp4Object = function (id, x, y, width, heigth, imageUrl, action) {
};
/* setup each properties */
WebGetContentTyp4Object.prototype.setup = function (id, x, y, w, h, imageUrl) {
this.id = id;
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.imageUrl = imageUrl;
};
/* prototype hitTest */
WebGetContentTyp4Object.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) {
return true;
}
}
return false;
};
/* draw Memo */
WebGetContentTyp4Object.prototype.drawObject = function (context, opt) {
var posX = this.x;
var posY = this.y;
var objWidth = this.width;
var objHeigth = this.height;
var imageObj = new Image();
imageObj.onload = function () {
context.globalAlpha = 0.4;
context.drawImage(imageObj, posX, posY, objWidth, objHeigth);
//Start Function : No.4 - Editor: Long - Date : 08/14/2013 - Summary : handle lazy loading
flip(opt);
//Start Function : No.4 - Editor: Long - Date : 08/14/2013 - Summary : handle lazy loading
context.globalAlpha = 1;
};
imageObj.src = this.imageUrl;
};
/* create memo object */
var webContentType4 = function (id, x, y, w, h, imageUrl, linkKind, destURI, destPageNumber) {
this.setup(id, x, y, w, h, imageUrl);
this.action = function () {
if (linkKind == "1") {
window.open(destURI, "_blank", "new window");
} else if (linkKind == "0") {
changePage(changePageNo(destPageNumber));
}
};
};
webContentType4.prototype = new WebGetContentTyp4Object();
/* ----------------------------------- End create webGetContentType4 -----------------------------*/
/**
* PageObject Class Definition
*/
/* constructor */
var PageObject = function (id, imageUrl, x, y, w, h, visible, actionFunction, displayBorder) {
};
/* setup each properties */
PageObject.prototype.setup = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, actionFunction, displayBorder) {
this.mediaType = mediaType;
this.actionType = actionType;
this.id = id;
this.x = x;
this.y = y;
this.width = w;
this.height = h;
this.displayBorder = displayBorder;
this.visible = visible;
this.imageUrl = imageUrl;
this.image = new Image();
this.image.src = this.imageUrl;
};
/* prototype hitTest */
PageObject.prototype.hitTest = function (px, py) {
if (this.x <= px && px <= (this.x + this.width)) {
if (this.y <= py && py <= (this.y + this.height)) {
return true;
}
}
return false;
};
var check;
/* draw page Object */
//Start Function: No.4 - Editor : Long - Date: 08/09/2013 - Summary : Edit function to draw object on next page
PageObject.prototype.drawPageObject = function (context, opt) {
var nObjectCnt = 0;
//Check which pageObject to be count
if(opt == null || opt == 0){
nObjectCnt = pageObjects.length;
}
else if(opt == 1){
nObjectCnt = nextPageObjects.length;
}
else if(opt == 2){
nObjectCnt = prevPageObjects.length;
}
if (this.visible) {
/* init data */
var mediaType = this.mediaType;
var displayBorder = this.displayBorder;
var x = this.x;
var y = this.y;
var w = this.width;
var h = this.height;
if (mediaType == '5') {
nCountObjectLoad++;
context.strokeStyle = "black";
context.lineWidth = "1";
context.strokeRect(x, y, w, h);
}
if (this.imageUrl != '') {
/* init image */
var img = new Image();
img.onload = function () {
nCountObjectLoad++;
/* create object store value image */
var objTemp = [];
objTemp.mediaType = mediaType;
objTemp.img = img;
objTemp.x = x;
objTemp.y = y;
objTemp.w = w;
objTemp.h = h;
objTemp.displayBorder = displayBorder;
/* push to array */
arrImage.push(objTemp);
if (mediaType == '2') {/* media */
img.width = 50;
img.height = 50;
if (img.width > w) {
context.drawImage(img, x, y, w, h);
} else {
/*draw image and border */
context.drawImage(img, x + ((w - img.width) / 2), y + ((h - img.height) / 2), img.width, img.height);
if (displayBorder == '1') {/* draw border */
context.strokeStyle = "black";
context.lineWidth = "1";
context.strokeRect(x, y, w, h);
}
}
} else if (mediaType == '3') {/* audio */
img.width = 50;
img.height = 50;
context.drawImage(img, x, y, img.width, img.height);
} else {
context.drawImage(img, x, y, w, h);
}
flip(opt);
if (nCountObjectLoad >= nObjectCnt) {
/* draw marking */
drawMarkingOnScreen(opt);
/*set status is loading page */
isLoadingObject = false;
/* enable controls in page */
if (ClientData.IsAddingMarking() == true) {
disableAllControl();
enableButtonMarking()
} else {
enableAllControl();
}
/*finish loading */
$('#divImageLoading').css('display', 'none');
/* set pos video */
zoomVideo();
}
};
img.src = this.imageUrl;
}
else {
if (nCountObjectLoad >= nObjectCnt) {
/* draw marking */
drawMarkingOnScreen(opt);
/*set status is loading page */
isLoadingObject = false;
/* enable controls in page */
if (ClientData.IsAddingMarking() == true) {
disableAllControl();
enableButtonMarking()
} else {
enableAllControl();
}
/*finish loading */
$('#divImageLoading').css('display', 'none');
/* set pos video */
zoomVideo();
}
}
}
};
//End Function: No.4 - Editor : Long - Date: 08/09/2013 - Summary : Edit function to draw object on next page
//Start Function : No.9
/*mediaType = 8 3d object*/
var _isEnableRotate = false;
var object3d = function (mediaType, actionType, id, imageUrl, x, y, w, h, hCnt, vCnt, visible, imageObjects){
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function (event){
var object3DInfoArr = get3dObjectInfoById(id);
if(object3DInfoArr._3dLastId == ''){
object3DInfoArr._3dH = Math.round(hCnt/2);
object3DInfoArr._3dV = Math.round(vCnt/2);
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
}
else{
if(event.pageX < object3DInfoArr._3dFirstPointX){
if(event.pageY < object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH--;
object3DInfoArr._3dV--;
if(object3DInfoArr._3dH < 1){
object3DInfoArr._3dH = hCnt;
}
if(object3DInfoArr._3dV < 1){
object3DInfoArr._3dV = vCnt;
}
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
cntTime = 0;
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else if(event.pageY > object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH--;
object3DInfoArr._3dV++;
if(object3DInfoArr._3dH < 1){
object3DInfoArr._3dH = hCnt;
}
if(object3DInfoArr._3dV > vCnt){
object3DInfoArr._3dV = 1;
}
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
cntTime = 0;
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else{
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH--;
if(object3DInfoArr._3dH < 1){
object3DInfoArr._3dH = hCnt;
}
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
}
else if(event.pageX > object3DInfoArr._3dFirstPointX){
if(event.pageY < object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH++;
object3DInfoArr._3dV--;
if(object3DInfoArr._3dH > hCnt){
object3DInfoArr._3dH = 1;
}
if(object3DInfoArr._3dV < 1){
object3DInfoArr._3dV = vCnt;
}
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else if(event.pageY > object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH++;
object3DInfoArr._3dV++;
if(object3DInfoArr._3dH > hCnt){
object3DInfoArr._3dH = 1;
}
if(object3DInfoArr._3dV > vCnt){
object3DInfoArr._3dV = 1;
}
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else{
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dH++;
if(object3DInfoArr._3dH > hCnt){
object3DInfoArr._3dH = 1;
}
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
}
else{
if(event.pageY < object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dV--;
if(object3DInfoArr._3dV < 1){
object3DInfoArr._3dV = vCnt;
}
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else if(event.pageY > object3DInfoArr._3dFirstPointY){
if(cntTime == 50){
if(_isEnableRotate){
object3DInfoArr._3dV++;
if(object3DInfoArr._3dV > vCnt){
object3DInfoArr._3dV = 1;
}
cntTime = 0;
_3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
else{
if(cntTime == 50){
if(_isEnableRotate){
cntTime = 0;
object3DInfoArr._3dLastId = convNumTo2Char(object3DInfoArr._3dV) + '-' + convNumTo2Char(object3DInfoArr._3dH);
$('#test').html(object3DInfoArr._3dLastId);
change3DImage(id, object3DInfoArr._3dLastId, x, y, w, h);
}
}
}
}
set3dObjectInfoById(id, object3DInfoArr);
}
};
};
object3d.prototype = new PageObject();
function change3DImage(objectId, imageId, x, y, w, h){
if(_isEnableRotate){
_isEnableRotate = false;
}
var imageUrl;
var imageObj = new Image();
for(var i = 0 ; i < _object3DImageArr.length; i++){
var obj = _object3DImageArr[i];
if(obj.id == objectId){
var imageObj = obj["3dview"];
imageUrl = imageObj[imageId];
break;
}
}
var imageObj = new Image();
imageObj.onload = function () {
var canvasObject = document.getElementById("offscreen");
var contextObject = canvasObject.getContext("2d");
contextObject.drawImage(imageObj, x, y, w, h);
flip();
_isEnableRotate = true;
};
imageObj.src = imageUrl;
};
function get3dObjectInfoById(objectId){
var arrResult = [];
if(_isEnableRotate){
_isEnableRotate = false;
}
for(var i = 0; i < _object3DImageArr.length; i++){
var obj = _object3DImageArr[i];
if(obj.id == objectId){
arrResult["_3dLastId"] = obj._3dLastId;
arrResult["_3dFirstPointX"] = obj._3dFirstPointX;
arrResult["_3dFirstPointY"] = obj._3dFirstPointY;
arrResult["_3dV"] = obj._3dV;
arrResult["_3dH"] = obj._3dH;
_isEnableRotate = true;
return arrResult;
}
}
};
function set3dObjectInfoById(objectId, arrInfo){
if(_isEnableRotate){
_isEnableRotate = false;
}
for(var i = 0; i < _object3DImageArr.length; i++){
var obj = _object3DImageArr[i];
if(obj.id == objectId){
if(arrInfo._3dLastId != null && arrInfo._3dLastId != ''){
obj["_3dLastId"] = arrInfo._3dLastId;
}
if(arrInfo._3dFirstPointX != null && arrInfo._3dFirstPointX !=''){
obj["_3dFirstPointX"] = arrInfo._3dFirstPointX;
}
if(arrInfo._3dFirstPointY != null && arrInfo._3dFirstPointY !=''){
obj["_3dFirstPointY"] = arrInfo._3dFirstPointY;
}
if(arrInfo._3dV != null && arrInfo._3dV !=''){
obj["_3dV"] = arrInfo._3dV;
}
if(arrInfo._3dH != null && arrInfo._3dH !=''){
obj["_3dH"] = arrInfo._3dH;
}
_isEnableRotate = true;
break;
}
}
};
//End Function : No.9
/* mediaType = 7 write text object*/
var text = function (mediaType, actionType, id, x, y, w, h, visible, actionFunction, content) {
//var imageUrl = displayText(x,y,w,h,id,content);
var imageUrl = getTextObjectImage(w, h, content);
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, actionFunction, null);
this.action = function () {
};
};
text.prototype = new PageObject();
/* mediaType=4 list image object : extends PageObject */
var listImage = function (mediaType, id, imageUrl, x, y, w, h, visible, imageObjects, triggerType) {
this.setup(mediaType, null, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
if (triggerType == '1') {
mediaType4_changeImage++;
/* check index bigger than length object */
if (mediaType4_changeImage > (imageObjects.length - 1)) {
mediaType4_changeImage = 0;
}
/* draw image */
var imageObj = new Image();
imageObj.onload = function () {
var canvasObject = document.getElementById("offscreen");
var contextObject = canvasObject.getContext("2d");
contextObject.drawImage(imageObj, x, y, w, h);
flip();
};
imageObj.src = imageObjects[mediaType4_changeImage].fileName;
}
};
};
listImage.prototype = new PageObject();
/* mediaType=5 Replace Video object : extends PageObject */
var listVideo = function (mediaType, id, imageUrl, x, y, w, h, visible, videoObjects) {
this.setup(mediaType, null, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
};
};
listVideo.prototype = new PageObject();
/* mediaType=6 Trigger object : extends PageObject */
var trigger = function (mediaType, actionType, id, imageUrl, x, y, w, h, index, target, visible, actionFunction) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, actionFunction, null);
this.action = function () {
// draw object
for (var nIndex = 0; nIndex < objType4_5.length; nIndex++) {
for (var nIndex1 = 0; nIndex1 < objType4_5[nIndex].dataObjects.length; nIndex1++) {
if (objType4_5[nIndex].dataObjects[nIndex1].index == index
&& objType4_5[nIndex].id == target) {
if (objType4_5[nIndex].mediaType == '4') { /*image*/
changeImageType4(objType4_5, nIndex, nIndex1);
} else { /* video */
stopAllAudio();
showVideoObject(objType4_5[nIndex].x, objType4_5[nIndex].y, objType4_5[nIndex].width, objType4_5[nIndex].height, objType4_5[nIndex].dataObjects[nIndex1].fileName, false);
}
break;
}
}
}
};
};
trigger.prototype = new PageObject();
/* mediaType=3 Audio object : extends PageObject */
var audioType3 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, audioFile, playType) {
if (playType == "0") {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
createAudio(audioFile, playType);
};
} else {
createAudio(audioFile, playType);
this.setup(mediaType, actionType, id, null, x, y, w, h, visible, null, null);
this.action = function () {
};
}
};
audioType3.prototype = new PageObject();
/* mediaType = 1 and actionType = 5 jumpPage object*/
var jumpPage = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, jumpPage) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
if ((Number(jumpPage) - 1) != getPageIndex()) {
changePage(Number(jumpPage) - 1);
}
};
};
jumpPage.prototype = new PageObject();
/* mediaType = 1 and actionType = 6 send mail object*/
var sendMail = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, emailSubject, emailAddress) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
MailTo(emailAddress, emailSubject);
};
};
sendMail.prototype = new PageObject();
/* mediaType = 1 and actionType = 8 open popup object*/
var openPopUp = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, content) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
isOpenPopUpText = true;
var pt1 = imageToScreen(x, y + h / 2);
if (userScale > 1) {
OpenPopupText(posXPopupMemo, posYPopupMemo, content, $('#dialogPopUp'), $('#arrow'));
} else if ($("#header_toolbar").is(":hidden")) {
OpenPopupText(pt1.x, pt1.y - 65, content, $('#dialogPopUp'), $('#arrow'));
} else {
OpenPopupText(pt1.x, pt1.y, content, $('#dialogPopUp'), $('#arrow'));
}
};
};
openPopUp.prototype = new PageObject();
/* mediaType = 1 and actionType = 10 move to Content object*/
var moveToContent = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, contentId, pageNo) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
/* set end log */
SetEndLog(contentID);
RegisterLog();
ClientData.common_preContentId(contentId);
ClientData.common_prePageNo(pageNo);
/* store old page */
var oldContent = { oldContentID: contentID, oldPageIndex: getPageIndex() };
var dataJump = ClientData.JumpQueue();
dataJump.push(oldContent);
ClientData.JumpQueue(dataJump);
avwScreenMove(ScreenIds.ContentView)
};
};
moveToContent.prototype = new PageObject();
/* mediaType=2 Video object : extends PageObject */
var videoType2 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, mediaFile, media, embed) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, embed);
this.action = function () {
/*stop audio on page */
stopAllAudio();
if (embed == "1") {
showVideoObject(x, y, w, h, mediaFile, false);
} else {
if (media != '') {
$('#playvideo').children().remove();
createVideoFulScreen(mediaFile, id);
$("#btnCloseVideo").click(function (e) {
hideDialog();
/*play audio if exist */
playAllAudio();
});
showDialog(true);
}
}
};
};
videoType2.prototype = new PageObject();
/* mediaType = 1 and actionType = 0 linkURL object*/
var imageNoAction = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
//no action
};
};
imageNoAction.prototype = new PageObject();
/* mediaType=1 Video object : extends PageObject */
var videoType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, mediaFile, media) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
if (media != '') {
/* stop all audio on page */
stopAllAudio();
createVideoFulScreen(mediaFile, id);
$("#btnCloseVideo").click(function (e) {
hideDialog();
/* play audio */
playAllAudio();
});
showDialog(true);
}
};
};
videoType1.prototype = new PageObject();
/* mediaType=1 and actionType = 2 Audio object : extends PageObject */
var audioType1 = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, audioFile) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
createAudio(audioFile, "0")
};
};
audioType1.prototype = new PageObject();
/* mediaType = 1 and actionType = 3 linkURL object*/
var linkURL = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, actionFunction, linkUrl, browserType) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, actionFunction, null);
this.action = function () {
window.open(linkUrl, "_blank", "new window");
};
};
linkURL.prototype = new PageObject();
/* mediaType = 1 and actionType = 4 imagePreview object*/
var imagePreview = function (mediaType, actionType, id, imageUrl, x, y, w, h, visible, imagePreview) {
this.setup(mediaType, actionType, id, imageUrl, x, y, w, h, visible, null, null);
this.action = function () {
createImagePreview();
showImagePreview($('#divImagePreview'), imagePreview);
$("#btnClose").live('click', hideDialog);
showDialog(true);
};
};
imagePreview.prototype = new PageObject();
/* rect object */
var Rect = function (x, y, w, h) {
this.left = Math.floor(x);
this.top = Math.floor(y);
this.right = Math.floor(x + w);
this.bottom = Math.floor(y + h);
this.width = w;
this.height = h;
};
Rect.prototype.add = function (x, y) {
this.left = Math.floor(this.left + x);
this.right = Math.floor(this.right + x);
this.top = Math.floor(this.top + y);
this.bottom = Math.floor(this.bottom + y);
this.width = this.right - this.left;
this.height = this.bottom - this.top;
};
Rect.prototype.center = function () {
var x = (this.left + this.right) / 2;
var y = (this.top + this.bottom) / 2;
return new Point(Math.floor(x), Math.floor(y));
};
/**
* Content Class Definition
*/
var Content = function () {
this.pageCount = 0;
this.pageIndex = 0;
this.pageImages = null;
this.pageObjects = null;
this.currentPage = null;
};
/* ste page images (json data) */
Content.prototype.setPageImages = function (pageCount, imageUrls) {
this.pageCount = pageCount;
this.pageImages = imageUrls;
return this;
};
/* set page objects data (json data) */
Content.prototype.setPageObjects = function (pageObjects) {
this.pageObjects = pageObjects;
return this;
};
/* Set up page */
Content.prototype.setUpPage = function (pageIndex, opt) {
this.currentPage = createPage(
this.pageIndex,
this.pageImages,
this.pageObjects,
function () {
adjustPage(opt);
});
return this;
};
/* check next page exists */
Content.prototype.hasNextPage = function () {
if ((this.pageIndex + 1) > (this.pageCount - 1)) {
return false;
}
return true;
};
/* setup next page */
Content.prototype.nextPage = function () {
this.pageIndex++;
if (this.pageIndex > (this.pageCount - 1)) {
this.pageIndex = this.pageCount - 1;
}
this.setUpPage(this.pageIndex, 1);
return this;
};
/* check previous page exists */
Content.prototype.hasPreviousPage = function () {
if ((this.pageIndex - 1) < 0) {
return false;
}
return true;
};
/* setup previous page */
Content.prototype.previousPage = function () {
this.pageIndex--;
if (this.pageIndex < 0) {
this.pageIndex = 0;
}
this.setUpPage(this.pageIndex, 2);
return this;
};
/* setup previous page */
Content.prototype.toPage = function (index) {
this.pageIndex = eval(index);
if (this.pageIndex < 0) {
this.pageIndex = 0;
}
this.setUpPage(this.pageIndex);
return this;
};
/**
* Transition Class Definition
*/
var Transition = function () { };
//Start Functon : No.4 - Editor : Long - Date : 08/09/2013 - Summary :
/* Flip Next Page Transition */
Transition.prototype.flipNextPage = function () {
var w = $('#canvasWrapper').width();
removeObject();
if(animateType == animateTypeKeys.Type_FadeIn){
$('#mainNext').css('left', marginX + 'px');
$('#mainNext').css('opacity', '1');
$('#main').css('z-index', '1');
}
if (getContent().hasNextPage()) {
if(animateType == animateTypeKeys.Type_Slide){
$('#canvasWrapper').animate(
{ left: '-' + w + 'px' },
{
duration: "slow",
complete: function () {
assignCurrentContentPage(1);
//Change id of canvas
switchCanvas(1);
//restore canvas event
setDefaultEvent();
//init image bookmark
initImageBookmark();
//Change slider
changeSlider(getContent().pageIndex);
//Draw marking on current screen
drawMarkingOnScreen();
//Correct position of canvas for next flipping
correctCanvasPosition();
if(getPageIndex() < totalPage - 1){
//Get Next Page Object
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
//Load Next
renderNextPage();
screenFit();
}else{
//Enable all control
enableAllControl();
$('#divImageLoading').css('display', 'none');
isLoadingObject = false;
}
/* init image had draw */
initDisplayMarking();
/* change title of page */
if (dataPageTitle[getContent().pageIndex]) {
if (dataPageTitle[getContent().pageIndex] != '') {
document.title = contentName + '_' + dataPageTitle[getContent().pageIndex] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
});
}
else if(animateType == animateTypeKeys.Type_FadeIn){
$('#main').animate(
{ 'opacity': 0 },
{
duration: "slow",
complete: function () {
assignCurrentContentPage(1);
//Change id of canvas
switchCanvas(1);
//restore canvas event
setDefaultEvent();
//init image bookmark
initImageBookmark();
//Change slider
changeSlider(getContent().pageIndex);
//Draw marking on current screen
drawMarkingOnScreen();
//Correct position of canvas for next flipping
correctCanvasPosition();
if(getPageIndex() < totalPage - 1){
//Get Next Page Object
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
//Load Next
renderNextPage();
screenFit();
}
else{
//Enable all control
enableAllControl();
$('#divImageLoading').css('display', 'none');
isLoadingObject = false;
}
/* init image had draw */
initDisplayMarking();
/* change title of page */
if (dataPageTitle[getContent().pageIndex]) {
if (dataPageTitle[getContent().pageIndex] != '') {
document.title = contentName + '_' + dataPageTitle[getContent().pageIndex] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
});
}
}
};
/* Flip Previous Page Transition */
Transition.prototype.flipPreviousPage = function () {
var w = $('#canvasWrapper').width();
removeObject();
if(animateType == animateTypeKeys.Type_FadeIn){
$('#mainPre').css('left', marginX + 'px');
$('#mainPre').css('opacity', '1');
$('#main').css('z-index', '1');
}
if (getContent().hasPreviousPage()) {
if(animateType == animateTypeKeys.Type_Slide){
$('#canvasWrapper').animate(
{ left: w + 'px' },
{
duration: "slow",
complete: function () {
assignCurrentContentPage(2);
//Change id of canvas
switchCanvas(2);
//restore canvas event
setDefaultEvent();
//init image bookmark
initImageBookmark();
//Change slider
changeSlider(getContent().pageIndex);
//Draw marking on current screen
drawMarkingOnScreen();
//Correct position of canvas for next flipping
correctCanvasPosition();
if(getPageIndex() > 0){
//Get Next Page Object
getPrevPageObjectsByPageIndex(pageObjectsData, getPageIndex() - 1);
//Load Next
renderPrevPage();
}else{
//Enable all control
enableAllControl();
$('#divImageLoading').css('display', 'none');
isLoadingObject = false;
}
screenFit();
/* init image had draw */
initDisplayMarking();
/* change title of page */
if (dataPageTitle[getContent().pageIndex]) {
if (dataPageTitle[getContent().pageIndex] != '') {
document.title = contentName + '_' + dataPageTitle[getContent().pageIndex] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
});
}
else{
$('#main').animate(
{ opacity: '0' },
{
duration: "slow",
complete: function () {
assignCurrentContentPage(2);
//Change id of canvas
switchCanvas(2);
//restore canvas event
setDefaultEvent();
//init image bookmark
initImageBookmark();
//Change slider
changeSlider(getContent().pageIndex);
//Draw marking on current screen
drawMarkingOnScreen();
//Correct position of canvas for next flipping
correctCanvasPosition();
if(getPageIndex() > 0){
//Get Next Page Object
getPrevPageObjectsByPageIndex(pageObjectsData, getPageIndex() - 1);
//Load Next
renderPrevPage();
}else{
//Enable all control
enableAllControl();
$('#divImageLoading').css('display', 'none');
isLoadingObject = false;
}
/* init image had draw */
initDisplayMarking();
screenFit();
/* change title of page */
if (dataPageTitle[getContent().pageIndex]) {
if (dataPageTitle[getContent().pageIndex] != '') {
document.title = contentName + '_' + dataPageTitle[getContent().pageIndex] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
});
}
}
};
//Start Functon : No.4 - Editor : Long - Date : 08/09/2013 - Summary :
/* Flip Page Transition */
Transition.prototype.flipToPage = function (index) {
var w = $('#main').attr('width');
if (index == getContent().pageIndex) {
/* init image had draw */
initDisplayMarking();
} else if (index < getContent().pageIndex) {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject();
$('#main').animate(
{ left: w + 'px' },
{
duration: "slow",
complete: function () {
$('#main').css('left', -w + 'px');
$('#main').animate(
{ left: marginX + 'px' },
{ duration: 'slow',
complete: function () {
isFirstLoad = true;
screenFit();
}
});
//change pageIndex and image bookmark
getContent().toPage(index);
if(getPageIndex() > 0){
prevContent.pageIndex = getPageIndex();
getPrevPageObjectsByPageIndex(pageObjectsData, getPageIndex() - 1);
renderPrevPage();
}
if(getPageIndex() < totalPage - 1){
nextContent.pageIndex = getPageIndex();
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
renderNextPage();
}
screenFit();
initImageBookmark();
checkExistNextPrePage();
changeSlider(index);
/* init image had draw */
initDisplayMarking();
/* change title of page */
if (dataPageTitle[index]) {
if (dataPageTitle[index] != '') {
document.title = contentName + '_' + dataPageTitle[index] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
}
);
} else {
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
removeObject();
$('#main').animate(
{ left: '-' + w + 'px' },
{
duration: "slow",
complete: function () {
$('#main').css('left', w + 'px');
$('#main').animate(
{ left: marginX + 'px' },
{ duration: 'slow',
complete: function () {
isFirstLoad = true;
screenFit();
}
});
//change pageIndex and image bookmark
getContent().toPage(index);
if(getPageIndex() > 0){
prevContent.pageIndex = getPageIndex();
getPrevPageObjectsByPageIndex(pageObjectsData, getPageIndex() - 1);
renderPrevPage();
}
if(getPageIndex() < totalPage - 1){
nextContent.pageIndex = getPageIndex();
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
renderNextPage();
}
initImageBookmark();
checkExistNextPrePage();
changeSlider(index);
/* init image had draw */
initDisplayMarking();
/* change title of page */
if (dataPageTitle[index]) {
if (dataPageTitle[index] != '') {
document.title = contentName + '_' + dataPageTitle[index] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* set end log */
SetEndLog(contentID);
}
});
}
};
function createTextConfirmAudio() {
var text = i18nText('msgBGMPlayConfirm');
$('#txtAudio').html(text);
var text = i18nText('msgBGMPagePlayConfirm');
$('#txtAudio_page').html(text);
};
/* create page */
function createPage(pageNumber, pageImage, pageObjects, onCompleteFunc) {
var page = new ContentPage(pageNumber, pageImage);
/* add page Object */
//Start Function: No.12
if (contentType == ContentTypeKeys.Type_PDF) {
page.addPageObjects(pageObjects);
}
//End Function: No.12
/* load page */
page.load(onCompleteFunc);
return page;
};
function createImagePreview() {
$('#dialog').prepend(
'<h1 style="height:25px;background:url(./img/viewer/pophdbg.png) 0 0 repeat" >' +
'<img src="img/viewer/x.png" style="margin:3px 3px 0px 21px" id="btnClose" class="align_right" ></img>' +
'</h1>' +
'<div id="divImagePreview" class="content_image_preview">' +
'</div>'
);
$('#dialog').css('box-shadow', '0px 0px 3px 1px #666');
$('#dialog').css('border', 'solid 1px #666');
$('#dialog').draggable({ handle: "h1" });
};
/* create video on page */
function createVideoFulScreen(video, id) {
$('#dialog').css('box-shadow', '0px 0px 3px 1px #666');
$('#dialog').css('border', 'solid 1px #666');
$('#dialog').draggable({ handle: "h1" });
$('#dialog').children().remove();
if (ClientData.userOpt_videoMode() == "1") {/* loop video */
$('#dialog').html(
'<h1 style="height:25px;background:url(./img/viewer/pophdbg.png) 0 0 repeat">' +
' <img src="img/viewer/x.png" style="margin:3px 3px 0px 21px" id="btnCloseVideo" class="align_right" ></img>' +
'</h1>' +
' <div id="videoMedia' + id + '">' +
' <video style="height:90%; width:100%;" class="mov" id="videoOnPopUp" autoplay controls loop>' +
' <source src="' + video + '" type="video/mp4"> ' +
' </video>' +
' </div>'
);
} else {
$('#dialog').html(
'<h1 style="height:25px;background:url(./img/viewer/pophdbg.png) 0 0 repeat">' +
' <img src="img/viewer/x.png" style="margin:3px 3px 0px 21px" id="btnCloseVideo" class="align_right" width=25px" ></img>' +
'</h1>' +
' <div id="videoMedia' + id + '">' +
' <video style="height:90%; width:100%;" id="videoOnPopUp" class="mov" autoplay controls>' +
' <source src="' + video + '" type="video/mp4"> ' +
' </video>' +
' </div>'
);
}
$('#videoOnPopUp').css('height', ($('#dialog').height() - 25) + "px");
//showControlsVideo($('#videoOnPopUp'));
};
/* create audio on page */
function createAudio(audio, type) {
// if(avwUserEnvObj.browser == 'firefox'){
// audio = audio.replace("webResourceDownload/", "webResourceDownload");
// }
if (audio != '') {
if (type == "0") { /* play when click */
stopAllAudio();
TypeAudio0 = type;
srcAudioType0 = audio;
if (ClientData.userOpt_musicMode() == "1") {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudio').html(
' <embed id="play_audio_0" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" loop="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudio').html(
' <audio id="play_audio_0" loop="loop" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudio').html(
' <audio id="play_audio_0" loop="loop" autoplay ="autoplay">' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
} else {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudio').html(
' <embed id="play_audio_0" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudio').html(
' <audio id="play_audio_0">' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudio').html(
' <audio id="play_audio_0" autoplay ="autoplay">' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
}
if (avwUserEnvObj.os == "ipad") {
document.getElementById("play_audio_0").load();
document.getElementById("play_audio_0").play();
}
} else if (type == "1") { /* play all page */
if (document.getElementById("play_audio_1") != undefined) {
if (ClientData.userOpt_musicMode() == "1") {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudioallpage').html(
' <embed id="play_audio_1" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" loop="true" hidden="true"> </embed>'
);
} else {
document.getElementById("play_audio_1").play();
}
} else {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudioallpage').html(
' <embed id="play_audio_1" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" hidden="true"> </embed>'
);
} else {
document.getElementById("play_audio_1").play();
}
}
} else {
TypeAudio1 = type;
srcAudioType1 = audio;
if (ClientData.userOpt_musicMode() == "1") {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudioallpage').html(
' <embed id="play_audio_1" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" loop="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudioallpage').html(
' <audio id="play_audio_1" loop="loop" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudioallpage').html(
' <audio id="play_audio_1" loop="loop" autoplay="autoplay" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
} else {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudioallpage').html(
' <embed id="play_audio_1" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudioallpage').html(
' <audio id="play_audio_1" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudioallpage').html(
' <audio id="play_audio_1" autoplay = "autoplay" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
}
// Check to play BGM on ipad
if (avwUserEnvObj.os == "ipad") {
// Show confim message to play background music
$("#bgmConfirm_dspCancel").unbind('click');
$("#bgmConfirm_dspCancel").click(function () {
$("#bgmConfirm").hide();
});
$("#bgmConfirm_dspOK").unbind('click');
$("#bgmConfirm_dspOK").click(function () {
document.getElementById('play_audio_1').load();
document.getElementById('play_audio_1').play();
$("#bgmConfirm").hide();
});
$("#bgmConfirm").show();
$("#bgmConfirm").center();
}
}
}
else if (type == "2") { /* play on page */
if (document.getElementById("play_audio_2") == undefined) {
stopAllAudio();
TypeAudio2 = type;
srcAudioType2 = audio;
if (ClientData.userOpt_musicMode() == "1") {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudiopage').html(
' <embed id="play_audio_2" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" loop="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudiopage').html(
' <audio id="play_audio_2" loop="loop" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudiopage').html(
' <audio id="play_audio_2" loop="loop" autoplay ="autoplay">' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
} else {
if (avwUserEnvObj.browser == 'firefox') {
$('#playaudiopage').html(
' <embed id="play_audio_2" src="' + audio + '&key=' + (new Date()).toIdString() + '" autostart="true" hidden="true"> </embed>'
);
} else if (avwUserEnvObj.os == "ipad") {
$('#playaudiopage').html(
' <audio id="play_audio_2" >' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
} else {
$('#playaudiopage').html(
' <audio id="play_audio_2" autoplay ="autoplay">' +
' <source src="' + audio + '&key=' + (new Date()).toIdString() + '" type="audio/mpeg" />' +
' </audio>'
);
}
}
// Check to play BGM on ipad
if (avwUserEnvObj.os == "ipad") {
// Show confim message to play background music
$("#bgmConfirm_dspCancel_page").unbind('click');
$("#bgmConfirm_dspCancel_page").click(function () {
$("#bgmConfirm_page").hide();
});
$("#bgmConfirm_dspOK_page").unbind('click');
$("#bgmConfirm_dspOK_page").click(function () {
document.getElementById('play_audio_2').load();
document.getElementById('play_audio_2').play();
$("#bgmConfirm_page").hide();
});
$("#bgmConfirm_page").show();
$("#bgmConfirm_page").center();
}
}
}
} else {
stopAllAudio();
}
};

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/// <reference path="contentview_InitObjects.js" />
/* add memo click */
function handleAddMemo(event) {
if (ClientData.IsAddingMemo() == true) {
ClientData.IsAddingMemo(false);
isCopyMemo = false;
/* draw memo */
drawMemoOnScreen();
//Start Function : No.4
if(getContent().hasNextPage()){
drawMemoOnScreen(1);
}
if(getContent().hasPreviousPage()){
drawMemoOnScreen(2);
}
//End Function : No.4
//Start Function : No.4
if(getContent().hasNextPage()){
drawMemoOnScreen(1);
}
if(getContent().hasPreviousPage()){
drawMemoOnScreen(2);
}
//End Function : No.4
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
} else {
ClientData.IsDisplayMemo(true);
ClientData.IsAddingMemo(true);
isCopyMemo = false;
/* draw memo */
drawMemoOnScreen();
//Start Function : No.4
if(getContent().hasNextPage()){
drawMemoOnScreen(1);
}
if(getContent().hasPreviousPage()){
drawMemoOnScreen(2);
}
//End Function : No.4
//change class
$('#imgmemo').removeClass();
$('#imgmemo').addClass('memoDisplay_hover');
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd_hover');
if (ClientData.memo_copyText()) {
$("#overlay").show();
$('#boxAddMemo').css('z-index', '101');
$('#boxAddMemo').css('display', 'block');
$('#boxAddMemo').draggable({ handle: "h1" });
$("#boxAddMemo").offset({ left: event.pageX, top: event.pageY });
$("#divAddMemo").show();
$("#divAddMemo").offset({ left: event.pageX, top: (event.pageY + $('#bookmarkBoxHdMemo').height() - 2) });
}
}
};
/* Marking toolbar*/
function imgmarking_click() {
if (ClientData.IsDisplayMarking() == false) {
ClientData.IsDisplayMarking(true);
drawCanvas();
//Start Function : No.4
if(getContent().hasNextPage()){
drawCanvas(1);
}
if(getContent().hasPreviousPage()){
drawCanvas(2);
}
//End Function : No.4
$("#dlgMarking").hide();
// change class
/*$('#imgmarking').removeClass();
$('#imgmarking').addClass('marking_hover');*/
} else {
ClientData.IsDisplayMarking(false);
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display', 'none');
/*// change class
$('#imgmarking').removeClass();
$('#imgmarking').addClass('marking');*/
drawCanvas();
//Start Function : No.4
if(getContent().hasNextPage()){
drawCanvas(1);
}
if(getContent().hasPreviousPage()){
drawCanvas(2);
}
}
//End Function : No.4
};
/* event for list bookmark: changePageNo */
function clickBookmark() {
changePage($(this).attr('id'));
/* close popup */
// $('#divListBookmark').dialog("close");
$("#overlay").hide();
$('#listbookmark').removeClass();
$('#listbookmark').addClass('bmList');
$("#divListBookmark").hide();
$('#boxBookMark').css('display', 'none');
};
/* event close list bookmark box */
function closeBookmarkBox() {
$("#divListBookmark").hide();
isSendingData = false;
$('#boxBookMark').css('display', 'none');
isDisplayBookMarkList = false;
/* unlock dialog overlay */
$("#overlay").hide();
//change class
$('#listbookmark').removeClass();
if (isTouchDevice() == true) {
$('#listbookmark').addClass('bmList_device');
} else {
$('#listbookmark').addClass('bmList');
}
};
/*event click show dialog bookmark */
function showListBookMark(e) {
var array = [e.pageX, e.pageY];
isDisplayBookMarkList = true;
//change class
$('#listbookmark').removeClass();
$('#listbookmark').addClass('bmList_hover');
/* display dialog overlay */
$("#overlay").show();
getBookmarklist(array);
};
/*event click show dialog index*/
function showListPageIndex(e) {
isDisplayListIndex = true;
var array = [e.pageX, e.pageY];
getPageIndexJson(array);
//change class
$('#listindex').removeClass();
$('#listindex').addClass('index_hover');
/* display dialog overlay */
$("#overlay").show();
};
/* event close list bookmark box */
function closeIndexBox() {
isDisplayListIndex = false;
$("#divListIndex").hide();
$('#boxIndex').css('display', 'none');
//change class
$('#listindex').removeClass();
if (isTouchDevice() == true) {
$('#listindex').addClass('index_device');
} else {
$('#listindex').addClass('index');
}
/* unlock dialog overlay */
$("#overlay").hide();
};
/* event click on list index */
function listIndex_Callback(selectedNode) {
var node = new TreeNode();
node = selectedNode;
// Hide dialog index
$("#divListIndex").dialog('close');
changePage(node.Value - 1);
};
/*event click show copy text */
function showCopyText(e) {
/* display dialog overlay */
if (avwUserEnvObj.os == "android") {
copyText();
} else {
isDisplayCopyText = true;
//change class
$('#copytext').removeClass();
$('#copytext').addClass('copy_hover');
$("#overlay").show();
var array = [e.pageX, e.pageY];
var contentPage = dataWebContentPage.pages;
handleCopyTextData(contentPage, array)
}
};
/* event close copy text box */
function closeCopyTextBox() {
isDisplayCopyText = false;
$("#divCopyText").hide();
$('#boxCopyText').css('display', 'none');
//change class
$('#copytext').removeClass();
if (isTouchDevice() == true) {
$('#copytext').addClass('copy_device');
} else {
$('#copytext').addClass('copy');
}
/* unlock dialog overlay */
$("#overlay").hide();
};
/*event click show dialog search*/
function showListSearchResult() {
$('#txtSearch').keydown(function (e) {
if (e.keyCode == 13) {
searchHandle();
/* display dialog overlay */
//$("#overlay").show();
return false;
}
});
};
/* event close searching result box */
function closeSearchingBox() {
isSendingData = false;
$("#divSearchResult").hide();
$('#boxSearching').css('display', 'none');
/* unlock dialog overlay */
//$("#overlay").hide();
};
/* event for list search results */
function clickSearchDetail() {
// Hide dialog
$("#divSearchResult").dialog('close');
changePage($(this).attr('id'));
};
//Start: Function : No.4 - Editor : Long - Date : 08/09/2013 - Summary :
/* event next page */
function nextPage_click() {
if (getContent().hasNextPage()) {
playBGMOfContent();
playBGMOfPage(getPageIndex() + 1);
isLoadingObject = true;
//cancelClick = true;
disableAllControl();
$('#divImageLoading').css('display', 'block');
var tran = new Transition();
tran.flipNextPage();
}
};
/* event prev page */
function prevPage_click() {
if (getContent().hasPreviousPage()) {
playBGMOfContent();
playBGMOfPage(getPageIndex() - 1);
isLoadingObject = true;
//cancelClick = true;
disableAllControl();
$('#divImageLoading').css('display', 'block');
var tran = new Transition();
tran.flipPreviousPage();
}
};
//End: Function : No.4 - Editor : Long - Date : 08/09/2013 - Summary :
/* event first page */
function firstPage_click() {
if (getContent().pageIndex != 0) {
playBGMOfContent();
playBGMOfPage(0);
disableAllControl();
$('#divImageLoading').css('display', 'block');
// Clear canvas offscreen
clearCanvas(document.getElementById("offscreen"));
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, 0);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
changeScale(userScale);
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
}
};
/* event last page */
function lastPage_click() {
if (getContent().pageIndex != (totalPage - 1)) {
playBGMOfContent();
playBGMOfPage(totalPage - 1);
disableAllControl();
$('#divImageLoading').css('display', 'block');
// Clear canvas offscreen
clearCanvas(document.getElementById("offscreen"));
//pageImages = getURLPageImage("webContentPageImage") + "?contentId=" + contentID + "&sid=" + ClientData.userInfo_sid() + "&pageNo=" + (totalPage - 1);
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: totalPage },
function (data) {
pageImages = data;
/* get page Objects */
getPageObjectsByPageIndex(pageObjectsData, totalPage - 1);
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
$('#divImageLoading').css('display', 'none');
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(totalPage - 1);
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
}
};
/* handle keydown */
$(document).keydown(function (e) {
/* set fag true when click ctrl */
if (e.ctrlKey) {
ctrlMode = true;
}
/* set hot key */
if (ctrlMode == true) {
if (ClientData.IsAddingMarking() == true || isLoadingObject == true) {
/* do nothing*/
} else {
switch (e.keyCode) {
/* move page */
case ShortKeys.MovePrevious: /* move prev */
if (getContent().hasPreviousPage()) {
prevPage_click();
}
break;
case ShortKeys.MoveNext: /* move next */
if (getContent().hasNextPage()) {
nextPage_click();
}
break;
/* zoom */
case ShortKeys.ZoomIn: /* zoomIn */
zoomIn();
break;
case ShortKeys.ZoomOut: /* zoomOut */
zoomOut();
break;
case ShortKeys.ZoomFit: /* screenFit*/
screenFit();
break;
/* marking && toolbar */
case ShortKeys.ShowHideToolbar: /* handle toolbar */
handleDisplayToolbar();
break;
case ShortKeys.ShowHideMarking: /* hide marking */
imgmarking_click();
break;
}
}
}
});
/* handle keydown */
$(document).keyup(function (e) {
ctrlMode = false;
});
function onUnlock() {
removeObject();
getPageObjectsByPageIndex(pageObjectsData, 0);
/* handle play BGM of content jump */
for (var nIndex = 0; nIndex < pageObjects.length; nIndex++) {
if (pageObjects[nIndex].mediaType == '3' && pageObjects[nIndex].playType == '1') {
if (avwUserEnvObj.os == "ipad") {
$('#play_audio_1').attr('src', pageObjects[nIndex].audioFile);
//document.getElementById("play_audio_1").load();
document.getElementById("play_audio_1").play();
isPlayBGMUnlock = true;
} else {
createAudio(pageObjects[nIndex].audioFile, pageObjects[nIndex].playType);
}
}
}
//Start Function: No.4 - Editor : Long - Date : 08/12/2013 - Summary : ReDraw canvas when has new sid
getPageObjectsByPageIndex(pageObjectsData, getPageIndex());
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects).setUpPage(getPageIndex);
if(getPageIndex() < totalPage - 1){
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
renderNextPage();
}
if(getPageIndex() < 0){
getPrevPageObjectsByPageIndex(pageObjectsData, getPageIndex() - 1);
renderPrevPage();
}
//End Function: No.4 - Editor : Long - Date : 08/12/2013 - Summary : ReDraw canvas when has new sid
};
function onClick_CanvasMain(event) {
//alert(cancelClick);
if(isLoadingObject){
cancelClick = true;
}
else{
cancelClick = false;
}
if (!cancelClick) {
//change coordinates
var imagePt = screenToImage(event.pageX, event.pageY);
var canvasWidth = $('#offscreen').width();
posXPopupMemo = event.pageX;
posYPopupMemo = event.pageY;
if ((event.pageX - marginX) >= destRect.left && (event.pageX - marginX) <= destRect.right) {
/* click add memo */
if (ClientData.IsAddingMemo() == true) {
if (!ClientData.memo_copyText()) {
AddMemo(contentID, changePageIndex(getPageIndex()), $('#divDialogMemo'), event.pageX, event.pageY, function () {
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
} else {
if (typeSelectMemo == 1) { /* add new */
AddMemo(contentID, changePageIndex(getPageIndex()), $('#divDialogMemo'), posXPopupMemo, posYPopupMemo, function () {
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
} else if (typeSelectMemo == 2) { /* copy */
CopyMemo(ClientData.memo_copyText(), contentID, changePageIndex(getPageIndex()), $('#divDialogMemo'), posXPopupMemo, posYPopupMemo, function () {
//set flag change memo
ClientData.isChangedMemo(true);
ClientData.IsAddingMemo(false);
/* refresh draw memo */
drawMemoOnScreen();
//change image
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
});
}
}
}
else {
var isClickMemo = false;
if (isOpenPopUpText == true) {
isOpenPopUpText = false;
ClosePopupText();
}
if (isOpenPopUpMemo == true) {
isOpenPopUpMemo = false;
$("#pop_up_memo").hide();
}
/* click memo edit */
if (ClientData.IsDisplayMemo() == true) {
getAllMemoOfPage();
/* check exist object memo in mouse position */
for (var nIndex = 0; nIndex < memoObjects.length; nIndex++) {
var hitPageObjMemo = memoObjects[nIndex];
if (hitPageObjMemo.hitTest(imagePt.x, imagePt.y)) {
//console.log("PageObject Hit!! Id: " + hitPageObjMemo.id);
//hitPageObjMemo.action();
/* save object memo */
objEditMemo = hitPageObjMemo;
var posMemoX = event.pageX;
var posMemoY = event.pageY;
if (imagePt.y > heightEachPage - $("#pop_up_memo").height()) {
posMemoY = posMemoY - $("#pop_up_memo").height();
}
if (imagePt.x > widthEachPage - $("#pop_up_memo").width()) {
posMemoX = posMemoX - $("#pop_up_memo").width();
}
/*display pop-up-memo */
$("#pop_up_memo").css('top', posMemoY).css('left', posMemoX);
$("#pop_up_memo").show();
/*set true for flag click memo */
isClickMemo = true;
isOpenPopUpMemo = true;
}
}
}
/* click pageObject */
if (isClickMemo == false) {
var isClickLinkList = false;
/* check exist object in mouse position */
var hitPageObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
if (hitPageObj) {
//$('#test').html(imagePt.x + " ~ " + imagePt.y);
if(!is3DObject(hitPageObj)){
hitPageObj.action();
}
else{
event.preventDefault();
}
}
else {
/* check click link list */
for (var nIndex = 0; nIndex < webGetContentType4Objects.length; nIndex++) {
var hitPageObjLinkList = webGetContentType4Objects[nIndex];
if (hitPageObjLinkList.hitTest(imagePt.x, imagePt.y)) {
//console.log("PageObject Hit!! Id: " + hitPageObjLinkList.id);
if(hitPageObjLinkList.pageNo == changePageIndex(getPageIndex())){
hitPageObjLinkList.action();
/*set true for flag click memo */
isClickLinkList = true;
}
}
}
if (isClickLinkList == false && ClientData.IsAddingMarking() == false) {
/* area next and prev page */
var cwMain = $('#main').width();
if (event.pageX > 0 && event.pageX < 300) {
prevPage_click();
} else if (event.pageX > (cwMain - 300) && event.pageX < cwMain) {
nextPage_click();
}
}
}
}
}
}
else {
if (ClientData.IsAddingMarking() == false && isCopyMemo == false) {
var cwMain = $('#main').width();
if (event.pageX > 0 && event.pageX < 300) {
prevPage_click();
} else if (event.pageX > (cwMain - 300) && event.pageX < cwMain) {
nextPage_click();
}
}
}
}
cancelClick = false;
};
function mouseMove_canvasMain(event) {
event.preventDefault();
/* base image move when userScale over 1 */
if (moveFlag && userScale != 1) {
$('#main').css('cursor', 'pointer');
cancelClick = true;
var mx;
var my;
// calc mouse moving distance
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
mx = event.pageX - px;
my = event.pageY - py;
} else {
mx = event.targetTouches[0].pageX - px;
my = event.targetTouches[0].pageY - py;
}
var sx = 1 / userScale;
var sy = 1 / userScale;
// calc scaling moving distance
moveX = Math.round(-mx * sx);
moveY = Math.round(-my * sy);
// store current mouse point
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
px = event.pageX;
py = event.pageY;
} else {
px = event.targetTouches[0].pageX;
py = event.targetTouches[0].pageY;
}
// redraw
flip();
zoomVideo();
closeDialogPopUpText();
}
//Start Function : No.20
else if(moveFlag && userScale == 1){
cancelClick = true;
var x = event.pageX;
var y = event.pageY;
var deltaX = x - px;
var deltaY= y - py;
px = x;
py = y;
currPos = {x:event.pageX,y:event.pageY};
// pevious page not exist -> do not move
if(!getContent().hasPreviousPage()){
if(currPos.x >= _clickFirstPos.x){
return;
}
}
// next page not exist -> do not move
if(!getContent().hasNextPage()){
if(currPos.x <= _clickFirstPos.x)
return;
}
//examinate direction
if(_moveNum==0 && deltaX < 0){
_moveNum = 2; // go from right to left => next page
}
if(_moveNum==2 && deltaX > 0){
_moveNum = 1; // go from right to left and back to right => no move
}
if(_moveNum==1 && deltaX < 0){
_moveNum = 2; // go from right to left + back to right + go to left => next page
}
if(_moveNum==0 && deltaX > 0){
_moveNum = -2; // go from left to right=> priveous page
}
if(_moveNum==-2 && deltaX < 0){
_moveNum = -1; // go from left to right and back to left => no move
}
if(_moveNum==0 && deltaX > 0){
_moveNum = -2; // go from left to right + back to left + go to right=> priveous page
}
var left = $('#canvasWrapper').css('left').replace("px","");
left = parseInt(left) + deltaX;
$('#canvasWrapper').css('left', left + "px");
}
if(moveFlag == false && _3dAnimate == true){
var imagePt = screenToImage(event.pageX, event.pageY);
var hitObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
if(hitObj){
cntTime++;
hitObj.action(event);
}
else{
_3dAnimate = false;
}
}
//End Function : No.20
var cwMain = $('#main').width();
var chMain = $('#main').height();
/* handle image prev on canvas */
if (getContent().hasPreviousPage()) {
$('#button_pre_canvas').mousemove(function () {
if (getContent().hasPreviousPage()) {
$(this).css('opacity', '1');
} else {
$(this).css('opacity', '0');
}
});
if (event.pageX > 0 && event.pageX < 300) {
$('#button_pre_canvas').css('opacity', '0.25');
} else {
$('#button_pre_canvas').css('opacity', '0');
}
}
else {
$('#button_pre_canvas').css('opacity', '0');
}
/* handle image next on canvas */
if (getContent().hasNextPage()) {
$('#button_next_canvas').mousemove(function () {
if (getContent().hasNextPage()) {
$(this).css('opacity', '1');
} else {
$(this).css('opacity', '0');
}
});
if (event.pageX > (cwMain - 300) && event.pageX < cwMain) {
$('#button_next_canvas').css('opacity', '0.25');
} else {
$('#button_next_canvas').css('opacity', '0');
}
} else {
$('#button_next_canvas').css('opacity', '0');
}
};
var _3dAnimate = false;
var cntTime = 0;
function mouseDown_CanvasMain(event) {
if(!isLoadingObject){
moveFlag = true;
}
else{
moveFlag = false;
}
if (isTouchDevice() != true) {
event.preventDefault();
}
$('#main').css('cursor', 'default');
var isClickOnObject = false;
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
px = event.pageX;
py = event.pageY;
//Start Function : No.20
_clickFirstPos = {x:event.screenX, y: event.screenY};
_clickLastPos = {x:event.screenX, y: event.screenY};
_moveNum = 0;
$('#mainPre').css("display",'block');
$('#mainNext').css("display",'block');
//End Function : No.20
var imagePt = screenToImage(px, py);
//Start Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary :
var hitPageObj = getContent().currentPage.hitTest(imagePt.x, imagePt.y);
//alert(hitPageObj);
if (hitPageObj) {
moveFlag = false;
if(is3DObject(hitPageObj)){
var arr3DInfo = [];
arr3DInfo["_3dFirstPointX"] = px;
arr3DInfo["_3dFirstPointY"] = py;
set3dObjectInfoById(hitPageObj.id, arr3DInfo);
_3dAnimate = true;
}
else{
_3dAnimate = false;
}
}
//End Function : No.9 - Editor : Long - Date : 08/16/2013 - Summary:
}
else {
px = event.targetTouches[0].pageX;
py = event.targetTouches[0].pageY;
}
};
function mouseUp_CanvasMain(event) {
//Start Function : No.20
if(moveFlag) {
moveFlag = false;
$('#main').css('cursor', 'default');
// navigate page
if(_moveNum == 2){
$('#nextpage').click();
}else if (_moveNum == -2){
$('#prevpage').click();
}else {
correctCanvasPosition();
}
}
if(_3dAnimate == true){
_3dAnimate = false;
_3dFirstPointX = event.pageX;
_3dFirstPointY = event.pageY;
}
//End Function : No.20
};
function imgBack_click() {
/* set end log */
SetEndLog(contentID);
RegisterLog();
window.onbeforeunload = null;
if (ClientData.JumpQueue()) {
var oldDataBack = ClientData.JumpQueue();
if (oldDataBack.length > 0) {
avwScreenMove(ScreenIds.ContentView);
ClientData.IsJumpBack(true);
} else {
/*check back */
if (ClientData.BookmarkScreen()) {
avwScreenMove(ClientData.BookmarkScreen());
} else {
window.history.back();
}
}
} else {
/*check back */
if (ClientData.BookmarkScreen()) {
avwScreenMove(ClientData.BookmarkScreen());
} else {
window.history.back();
}
}
};
function imgHome_click(e) {
e.preventDefault();
/* set end log */
SetEndLog(contentID);
RegisterLog();
//window.location.href = ScreenIds.Home;
avwScreenMove(ScreenIds.Home);
};
function closePopUpCopyMemo() {
$('#boxAddMemo').hide();
//ClientData.memo_copyText(null);
ClientData.IsAddingMemo(false);
/* unlock dialog overlay */
$("#overlay").hide();
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
};
function click_liAddMemo(event) {
typeSelectMemo = 1;
$('#boxAddMemo').hide();
/* unlock dialog overlay */
$("#overlay").hide();
//ClientData.memo_copyText(null);
//ClientData.IsAddingMemo(false);
};
function click_liCopyMemo() {
typeSelectMemo = 2;
$('#boxAddMemo').hide();
/* unlock dialog overlay */
$("#overlay").hide();
//ClientData.memo_copyText(null);
//ClientData.IsAddingMemo(false);
};
function click_liDeleteMemo() {
$('#boxAddMemo').hide();
ClientData.memo_copyText(null);
ClientData.IsAddingMemo(false);
/* unlock dialog overlay */
$("#overlay").hide();
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
};
//Start Funcion : No.20 - Editor : Long - Date : 08/13/2013 - Summary : Win 8 touch handle
/*
* reset navi action as point session increase
*/
function resetNaviAction(){
_isPageNaviTouch = true;
_moveNum = 0;
touchStartedTime = new Date();
$('#mainPre').css("display",'none');
$('#mainNext').css("display",'none');
_touchFirstPos = null;
_touchLastPos=null;
//console.log("================correctCanvasPosition===============");
correctCanvasPosition();
};
function onTouchstart(evt){
//console.log("onTouchstart:::");
var bContinue = true;
if(isTouchDevice()){
evt.stopPropagation();
}
evt.preventDefault();
if(isLoadingObject){
bContinue = false;
}
switch (evt.pointerType) {
case evt.MSPOINTER_TYPE_TOUCH:
//evt.target.style.backgroundColor = "blue"; // A touchscreen was used
//console.log("MSPOINTER_TYPE_TOUCH:::");
break;
case evt.MSPOINTER_TYPE_PEN:
//evt.target.style.backgroundColor = "green"; // A pen was used
bContinue = false;
break;
case evt.MSPOINTER_TYPE_MOUSE:
//evt.target.style.backgroundColor = "yellow"; // A mouse was used
bContinue = false;
break;
}
if(!bContinue){
return;
}
_isPageNaviTouch = false;
_isPageZoomTouch = false;
//evt.preventDefault();
var touch1 = null;
var touch2 = null;
_touchLastPos = null;
_touchFirstPos = null;
if(_bWin8TouchEnabled){
_bufferPoints = [];
if(_startPoints.length == 0){
// start navi page case
touch1 = {clientX: evt.clientX, clientY: evt.clientY,pointerId: evt.pointerId};
_startPoints.push(touch1);
if(userScale != 1){
px = evt.pageX;
py = evt.pageY;
}
} else if(_startPoints.length == 1){
// start zoom page action
if(_isPageNaviTouch){
// reset navi page action if exists
resetNaviAction();
}
touch1 = _startPoints[0];
touch2 = {clientX: evt.clientX, clientY: evt.clientY,pointerId: evt.pointerId};
_startPoints.push(touch2);
//set last dist
_lastDist = getDistance({
x: touch1.clientX,
y: touch1.clientY
}, {
x: touch2.clientX,
y: touch2.clientY
});
px = touch1.clientX+touch2.clientX/2;
py = touch1.clientY+touch2.clientY/2;
//console.log("_lastDist:" + _lastDist);
}
else {
//when _startPoints.length > 1
touch1 = {clientX: evt.clientX, clientY: evt.clientY,pointerId: evt.pointerId};
_startPoints.push(touch1);
if(_isPageNaviTouch){
resetNaviAction();
}
if(_isPageZoomTouch){
resetZoomAction();
}
}
}
else{
// not is win 8 touch event
touch1 = evt.touches[0];
touch2 = evt.touches[1];
if(touch2 == null){
//set touch to move page flag
if(touch2 == null && userScale == 1){
$('#mainPre').css("display",'block');
$('#mainNext').css("display",'block');
_isPageNaviTouch = true;
_moveNum = 0;
touchStartedTime = new Date();
// set first and last Pos
_touchFirstPos = {x:touch1.clientX, y: touch1.clientX};
_touchLastPos = {x:touch1.clientX, y: touch1.clientX};
}
else if(touch2 == null && userScale != 1){
_isPageNaviTouch = false;
px = evt.pageX;
py = evt.pageY;
//onClick_CanvasMain();
}
else {
_isPageNaviTouch = false;
}
}
//set begin value for zoom
if(touch1 && touch2) {
_lastDist = getDistance({
x: touch1.clientX,
y: touch1.clientY
}, {
x: touch2.clientX,
y: touch2.clientY
});
px = touch1.clientX+touch2.clientX/2;
py = touch1.clientY+touch1.clientY/2;
//console.log("_lastDist:" + _lastDist);
_isPageNaviTouch = false;
}
}
};
function onTouchmove(evt){
//console.log("onTouchmove :::");
var bContinue = true;
if(isLoadingObject){
bContinue = false;
}
if(isTouchDevice()){
evt.stopPropagation();
}
switch (evt.pointerType) {
case evt.MSPOINTER_TYPE_TOUCH:
//evt.target.style.backgroundColor = "blue"; // A touchscreen was used
//console.log("MSPOINTER_TYPE_TOUCH:::");
break;
case evt.MSPOINTER_TYPE_PEN:
//evt.target.style.backgroundColor = "green"; // A pen was used
bContinue = false;
break;
case evt.MSPOINTER_TYPE_MOUSE:
//evt.target.style.backgroundColor = "yellow"; // A mouse was used
bContinue = false;
break;
}
if(!bContinue){
return;
}
//console.log("pointerId: " + evt.pointerId);
evt.preventDefault();
var touch1 = null;
var touch2 = null;
if(_bWin8TouchEnabled){
if(_startPoints.length == 1){
//move page case
//when change from zoom mode
if(userScale != 1){
$('#main').css('cursor', 'pointer');
//cancelClick = true;
var mx;
var my;
// calc mouse moving distance
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
mx = evt.pageX - px;
my = evt.pageY - py;
} else {
mx = evt.targetTouches[0].pageX - px;
my = evt.targetTouches[0].pageY - py;
}
var sx = 1 / userScale;
var sy = 1 / userScale;
// calc scaling moving distance
moveX = Math.round(-mx * sx);
moveY = Math.round(-my * sy);
// store current mouse point
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
px = evt.pageX;
py = evt.pageY;
} else {
px = evt.targetTouches[0].pageX;
py = evt.targetTouches[0].pageY;
}
// redraw
flip();
zoomVideo();
closeDialogPopUpText();
}
else{
_isPageNaviTouch = true;
touch1 = {clientX: evt.clientX, clientY: evt.clientY, pointerId: evt.pointerId};
_bufferPoints.push(touch1); // add to buffer to use for another action if occur. ex: zoom page
//console.log("move page case");
$('#mainPre').css("display",'block');
$('#mainNext').css("display",'block');
touchStartedTime = new Date();
var temp = _startPoints[0];
// set first and last Pos
if(_touchFirstPos == null){
_touchFirstPos = {x:temp.clientX, y: temp.clientX};
_moveNum = 0;
}
if(_touchLastPos==null){
_touchLastPos = {x:temp.clientX, y: temp.clientX};
}
}
}
else if(_startPoints.length == 2){
//zoom page case
_isPageZoomTouch = true;
//rest navi touch if active
if(_isPageNaviTouch){
resetNaviAction();
}
//console.log("zoom page case");
if(_bufferPoints.length == 0) {
//first point so that wait to next point
touch1 = {clientX: evt.clientX, clientY: evt.clientY, pointerId: evt.pointerId};
_bufferPoints.push(touch1);
return;
}else if(_bufferPoints.length == 1) {
// second point so that get first point and process zoom page
touch1 = _bufferPoints[0];
// check pointer id
if(touch1.pointerId == evt.pointerId){
// one touch session is identify by one pointerId
// in this case do nothing and go to get next pointerId
return;
}else if(touch1.pointerId > evt.pointerId){
_bufferPoints = [] // reset buffer to get pointerId with correct order from begin
return;
}
touch2 = {clientX: evt.clientX, clientY: evt.clientY, pointerId: evt.pointerId};
//console.log("_bufferPoints.length:" + _bufferPoints.length);
_bufferPoints = [];
}
}else {
//reset navi touch if active
if(_isPageNaviTouch){
resetNaviAction();
}
if(_isPageZoomTouch){
resetZoomAction();
}
return;
}
//process
if(_isPageNaviTouch){
currPos = {x:touch1.clientX, y: touch1.clientY};
if(!processNaviPage(currPos)){
// can not move to previous or next page
return;
}
}
// zoom page case
if(_isPageZoomTouch) {
processZoomPage(touch1, touch2);
}
}else{
// for android or ipad
touch1 = evt.touches[0];
touch2 = evt.touches[1];
//update last touch position
if(touch2 == null && _isPageNaviTouch){
currPos = {x:touch1.clientX, y: touch1.clientY};
//if(!processNaviPage(currPos)){
if(! _transitionObject.processNaviPage(currPos)){
// can not move to previous or next page
return;
}
}
else{
//when change from zoom mode
if(userScale != 1){
$('#main').css('cursor', 'pointer');
//cancelClick = true;
var mx;
var my;
// calc mouse moving distance
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
mx = evt.pageX - px;
my = evt.pageY - py;
} else {
mx = evt.targetTouches[0].pageX - px;
my = evt.targetTouches[0].pageY - py;
}
var sx = 1 / userScale;
var sy = 1 / userScale;
// calc scaling moving distance
moveX = Math.round(-mx * sx);
moveY = Math.round(-my * sy);
// store current mouse point
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
px = evt.pageX;
py = evt.pageY;
} else {
px = evt.targetTouches[0].pageX;
py = evt.targetTouches[0].pageY;
}
// redraw
flip();
zoomVideo();
closeDialogPopUpText();
}
}
// zoom page case
if(touch1 && touch2) {
processZoomPage(touch1, touch2);
}
}
};
function onTouchend(evt){
var bContinue = true;
if(isLoadingObject){
bContinue = false;
}
evt.stopPropagation();
switch (evt.pointerType) {
case evt.MSPOINTER_TYPE_TOUCH:
//evt.target.style.backgroundColor = "blue"; // A touchscreen was used
//console.log("MSPOINTER_TYPE_TOUCH:::");
break;
case evt.MSPOINTER_TYPE_PEN:
//evt.target.style.backgroundColor = "green"; // A pen was used
bContinue = false;
break;
case evt.MSPOINTER_TYPE_MOUSE:
//evt.target.style.backgroundColor = "yellow"; // A mouse was used
bContinue = false;
break;
}
if(!bContinue) return;
evt.preventDefault();
_lastScaleDelta = userScale -1;
if(_bWin8TouchEnabled){
//console.log("onTouchend :::_bufferPoints.length:" + _bufferPoints.length);
// reset all flag
_startPoints = [];
_bufferPoints = [];
}
//move page if enough condition
if(_bTransitionEnable){
if(_isPageNaviTouch){
_isPageNaviTouch = false;
//calculate time period from last time of touchstart event
var currDate = new Date();
var period = currDate - touchStartedTime;
//console.log(period);
//console.log("touchmove == _moveNum:" + _moveNum);
if(period >= _touchMoveTimePeriod && period < _touchMoveTimePeriodInvalid){
touchStartedTime= 0;
if(_moveNum == 2){
//$('#nextpage').click();
nextPage_click();
}else if (_moveNum == -2){
//$('#prevpage').click();
prevPage_click();
}else {
correctCanvasPosition();
}
}
}
}
};
function processZoomPage(touch1, touch2){
var dist = getDistance({
x: touch1.clientX,
y: touch1.clientY
}, {
x: touch2.clientX,
y: touch2.clientY
});
if(_lastDist != dist) {
if(dist > _lastDist){
userScale += 0.05;
if (userScale > 4) {
userScale = 4;
changeScale(userScale);
}else {
changeScale(userScale);
flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex < totalPage - 1){
flip(1);
}
if(getPageIndex > 0){
flip(2);
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
/* zoom video */
zoomVideo();
}
_lastDist = dist;
}
else if (dist < _lastDist)
{
userScale -= 0.05;
if (userScale < 1) {
userScale = 1;
changeScale(userScale);
}else{
changeScale(userScale);
flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex < totalPage - 1){
flip(1);
}
if(getPageIndex > 0){
flip(2);
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
/* zoom video */
zoomVideo();
}
}
}
checkDisableButtonZoom();
};
/*
* Process navi page after touch event
*/
function processNaviPage(currPos){
if(!_bTransitionEnable){
return;
}
// get moved delta period
var lMoveX = currPos.x - _touchLastPos.x;
// pevious page not exist -> do not move
if(!getContent().hasPreviousPage()){
if(currPos.x >= _touchFirstPos.x){
return false;
}
}
// next page not exist -> do not move
if(!getContent().hasNextPage()){
if(currPos.x <= _touchFirstPos.x){
return false;
}
}
//examinate direction
if(_moveNum==0 && lMoveX < 0){
_moveNum = 2; // go from right to left => next page
}
if(_moveNum==2 && lMoveX > 0){
_moveNum = 1; // go from right to left and back to right => no move
}
if(_moveNum==1 && lMoveX < 0){
_moveNum = 2; // go from right to left + back to right + go to left => next page
}
if(_moveNum==0 && lMoveX > 0){
_moveNum = -2; // go from left to right=> priveous page
}
if(_moveNum==-2 && lMoveX < 0){
_moveNum = -1; // go from left to right and back to left => no move
}
if(_moveNum==0 && lMoveX > 0){
_moveNum = -2; // go from left to right + back to left + go to right=> priveous page
}
//console.log("_moveNum:" +_moveNum);
var left = $('#canvasWrapper').css('left').replace("px","");
left = parseInt(left) + lMoveX ;
$('#canvasWrapper').css('left', left + "px");
_touchLastPos = {x:currPos.x, y: currPos.y};
return true;
};
/*
* reset zoom action as point session increase
*/
function resetZoomAction(){
//_isPageZoomTouch = false;
};
function getDistance(p1, p2) {
//return Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2));
return Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2));
};
var TransitionObject = function () {
};
var _transitionObject = new TransitionObject();
TransitionObject.prototype.processNaviPage = function (currPos) {
if(!_bTransitionEnable)
return;
// get moved delta period
var lMoveX = currPos.x - _touchLastPos.x;
// pevious page not exist -> do not move
if(!getContent().hasPreviousPage()){
if(currPos.x >= _touchFirstPos.x)
return false;
}
// next page not exist -> do not move
if(!getContent().hasNextPage()){
if(currPos.x <= _touchFirstPos.x)
return false;
}
//examinate direction
if(_moveNum==0 && lMoveX < 0){
_moveNum = 2; // go from right to left => next page
}
if(_moveNum==2 && lMoveX > 0){
_moveNum = 1; // go from right to left and back to right => no move
}
if(_moveNum==1 && lMoveX < 0){
_moveNum = 2; // go from right to left + back to right + go to left => next page
}
if(_moveNum==0 && lMoveX > 0){
_moveNum = -2; // go from left to right=> priveous page
}
if(_moveNum==-2 && lMoveX < 0){
_moveNum = -1; // go from left to right and back to left => no move
}
if(_moveNum==0 && lMoveX > 0){
_moveNum = -2; // go from left to right + back to left + go to right=> priveous page
}
//console.log("_moveNum:" +_moveNum);
var left = $('#canvasWrapper').css('left').replace("px","");
left = parseInt(left) + lMoveX ;
$('#canvasWrapper').css('left', left + "px");
_touchLastPos = {x:currPos.x, y: currPos.y};
return true;
};
//End Funcion : No.20 - Editor : Long - Date : 08/13/2013 - Summary : Win 8 touch handle
\ No newline at end of file

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/* init const */
var WIDTH_DIALOG_BOOKMARK = 300;
var HEIGHT_DIALOG_BOOKMARK = 700;
var HEIGHT_DIALOG_BOOKMARK_NO_BOOKMARK = 200;
var WIDTH_DIALOG_INDEX = 300;
var HEIGHT_DIALOG_INDEX = 700;
var HEIGHT_DIALOG_INDEX_NO_INDEX = 200;
var WIDTH_DIALOG_SEARCH = 300;
var HEIGHT_DIALOG_SEARCH = 700;
var HEIGHT_DIALOG_SEARCH_NO_SEARCH = 200;
var WIDTH_DIALOG_COPYTEXT = 300;
var HEIGHT_DIALOG_COPYTEXT = 500;
var HEIGHT_DIALOG_COPYTEXT_NO_COPYTEXT = 200;
/* init variable */
var pageImages = '';
var totalPage = 0;
var pageObjects = [];
var pageObjectsData = [];
var tool;
var isFullScreen = false;
var ctrlMode = false;
var dataWebContentPage;
var dataPageTitle;
var dataJsonType4;
var dataJsonType5;
var contentID;
var isOpenPopUpText = false;
var isOpenPopUpMemo = true;
var objEditMemo;
var isCopyMemo = false;
var isExistCopyMemo = false;
var posXPopupMemo = 0;
var posYPopupMemo = 0;
var contentName = '';
var nCountObjectLoad = 0;
var nAjaxLoad = 0;
var isClearDrawing = false;
var isDrawing = false;
var mediaType4_changeImage = 0;
var isLoadingObject = false;
var isFirstLoad = true;
var nPositionCanvas = [];
var arrImage = [];
var posTxtSearch = [];
var sx, sy;
var imgDrawingTemp;
var imgMarkerTemp;
var isSizingDrawCanvas = false;
var isDisplayBookMarkList = false;
var avwUserEnvObj = new UserEnvironment();
var canvas_marker;
var context_marker;
var canvas_draw;
var context_draw;
var canvas_main;
var context_main;
var canvas_offscreen;
var context_offscreen;
var isAddingMarking;
var penSize;
var penColor;
var makerSize;
var makerColor;
var eraseSize;
var markingType;
var isDisplayCopyText = false;
var isDisplayListIndex = false;
var isChangeSizeScreen = false;
var widthContentImage = 0;
var heightContentImage = 0;
var widthEachPage = 0;
var heightEachPage = 0;
var px = 0;
var py = 0;
var isPressLeftMouse = false;
var isMoveOutDrawCanvas = false;
var typeSelectMemo = 0;
var arrThumbnailsLoaded = [];
var isSendingData = true;
var isPlayBGMUnlock = false;
var isJumpNotFromFirstPage = false;
var standardRatio = 1;
var currentRatio = 1;
var resourceImage = new Image();
/* zoom video */
var pxVideo;
var pyVideo;
var wVideo;
var hVideo;
var videoScale;
//Start Function: No.12
//Content's types
var ContentTypeKeys = {
Type_PDF : 'pdfFile',
Type_Image : 'imageFile',
Type_Video : 'movieFile',
Type_Music : 'soundFile',
Type_Others : 'otherFile',
Type_NoFile : 'noFile',
Type_Html: 'htmlFile'
};
var contentType;
var nextPageImage = '';
var nextPageObjects = [];
var nextContent = new Content();
var prevPageObjects = [];
var prevPageImage = '';
var prevContent = new Content();
var animateTypeKeys = {
Type_Slide : 'slide',
Type_FadeIn : 'fade'
};
var animateType = animateTypeKeys.Type_Slide;
function getNextContent(){
return nextContent;
};
function getPrevContent(){
return prevContent;
};
//End Function: No.12
//Start Function : No.20
var _moveFlag = false;
var _moveNum = false;
var _isPageNaviTouch = false;
var _isPageZoomTouch = false;
var _clickFirstPos = null;
var _clickLastPos = null;
var _touchFirstPos = null;
var _touchLastPos = null;
var touchStartedTime = null;
var _touchMoveTimePeriod = 0; // 0 s
var _touchMoveTimePeriodInvalid = 5000; // 5 s
var _bHasNext = false;
var _bHasPrev = false;
var _startPoints = [];
var _bufferPoints = [];
var _bImageMainReload = true; // to not run onload again on the next time on set src value
var _bImageMainPreReload = true; // to not run onload again on the next time on set src value
var _bImageMainNextReload = true; // to not run onload again on the next time on set src value
var _lastDist = 0;
var _lastScaleDelta = 0;
var _bWin8TouchEnabled = false;
var _bTransitionEnable = true;
//End Function : No.20
//Start Function : No.9
var _object3DImageArr = [];
//End Function : No.9
/*disable all control on page */
function disableAllControl() {
/* set cursor pointer*/
$("#imgHome").css('cursor', 'default');
$("#imgBack").css('cursor', 'default');
$("#listbookmark").css('cursor', 'default');
$("#imgbookmark").css('cursor', 'default');
$("#listindex").css('cursor', 'default');
$("#copytext").css('cursor', 'default');
$("#imgmemo").css('cursor', 'default');
$("#imgaddmemo").css('cursor', 'default');
$("#imgmarking").css('cursor', 'default');
$("#imgmarkingtoolbar").css('cursor', 'default');
$("#firstpage").css('cursor', 'default');
$("#prevpage").css('cursor', 'default');
$("#nextpage").css('cursor', 'default');
$("#lastpage").css('cursor', 'default');
$("#zoomfit").css('cursor', 'default');
$("#zoomin").css('cursor', 'default');
$("#zoomout").css('cursor', 'default');
$("#control_screen").css('cursor', 'default');
$("#control_screen_2").css('cursor', 'default');
$("#slider_page").css('cursor', 'default');
$(".ui-slider-handle").css('cursor', 'default');
$('#imgHome').unbind('click');
$('#imgHome').removeClass();
$('#imgHome').addClass('home_off');
/* back button */
$('#imgBack').unbind('click');
$('#imgBack').removeClass();
$('#imgBack').addClass('back_off');
/*list bookmark */
$('#listbookmark').unbind('click');
$('#listbookmark').removeClass();
$('#listbookmark').addClass('bmList_off');
$('#imgbookmark').unbind('click');
$('#imgbookmark').removeClass();
$('#imgbookmark').addClass('bmAdd_off');
$('#listindex').unbind('click');
$('#listindex').removeClass();
$('#listindex').addClass('index_off');
$('#copytext').unbind('click');
$('#copytext').removeClass();
$('#copytext').addClass('copy_off');
/* imgage display memo */
$('#imgmemo').unbind('click');
$('#imgmemo').removeClass();
$('#imgmemo').addClass('memoDisplay_off');
/* image add memo */
$('#imgaddmemo').unbind('click');
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd_off');
$('#imgmarking').unbind('click');
$('#imgmarking').removeClass();
$('#imgmarking').addClass('marking_off');
$('#imgmarkingtoolbar').unbind('click');
$('#imgmarkingtoolbar').removeClass();
$('#imgmarkingtoolbar').addClass('markingToolbar_off');
$('#firstpage').unbind('click');
$('#firstpage').removeClass();
$('#firstpage').addClass('begin_off');
$('#prevpage').unbind('click');
$('#prevpage').removeClass();
$('#prevpage').addClass('prev_off');
$('#nextpage').unbind('click');
$('#nextpage').removeClass();
$('#nextpage').addClass('next_off');
$('#lastpage').unbind('click');
$('#lastpage').removeClass();
$('#lastpage').addClass('last_off');
$('#zoomfit').unbind('click');
$('#zoomfit').removeClass();
$('#zoomfit').addClass('fit_off');
$('#zoomin').unbind('click');
$('#zoomin').removeClass();
$('#zoomin').addClass('expansion_off');
$('#zoomout').unbind('click');
$('#zoomout').removeClass();
$('#zoomout').addClass('reduction_off');
if (avwUserEnvObj.os != "android") {
$("#slider_page").slider("option", "disabled", true);
}
disable('#txtSearch', '#txtSlider');
$('#button_next_canvas').css('display', 'none');
$('#button_pre_canvas').css('display', 'none');
};
/*enable all control on page */
function enableAllControl() {
disableAllControl();
/* set cursor pointer*/
$("#imgHome").css('cursor', 'pointer');
$("#imgBack").css('cursor', 'pointer');
$("#listbookmark").css('cursor', 'pointer');
$("#imgbookmark").css('cursor', 'pointer');
//Start Function: No.12
if (contentType == ContentTypeKeys.Type_PDF) {
$("#listindex").css('cursor', 'pointer');
$("#copytext").css('cursor', 'pointer');
}
//End Function: No.12
$("#imgmemo").css('cursor', 'pointer');
$("#imgaddmemo").css('cursor', 'pointer');
$("#imgmarking").css('cursor', 'pointer');
$("#imgmarkingtoolbar").css('cursor', 'pointer');
$("#firstpage").css('cursor', 'pointer');
$("#prevpage").css('cursor', 'pointer');
$("#nextpage").css('cursor', 'pointer');
$("#lastpage").css('cursor', 'pointer');
$("#zoomfit").css('cursor', 'pointer');
// $("#zoomin").css('cursor', 'pointer');
// $("#zoomout").css('cursor', 'pointer');
$("#control_screen").css('cursor', 'pointer');
$("#control_screen_2").css('cursor', 'pointer');
//Start Function: No.12
if (contentType == ContentTypeKeys.Type_PDF) {
$("#slider_page").css('cursor', 'pointer');
$(".ui-slider-handle").css('cursor', 'pointer');
}
//End Function: No.12
$("#liAddMemo").css('cursor', 'pointer');
$("#liCopyMemo").css('cursor', 'pointer');
$("#liDeleteMemo").css('cursor', 'pointer');
$("#control_screen").removeClass();
$("#control_screen_2").removeClass();
$('#imgHome').bind('click', imgHome_click);
$('#imgHome').removeClass();
$('#imgBack').bind('click', imgBack_click);
$('#imgBack').removeClass();
/*list bookmark */
$('#listbookmark').bind('click', showListBookMark);
$('#listbookmark').removeClass();
$('#imgbookmark').bind('click', bookmarkPage);
$('#imgbookmark').removeClass();
//Start Function: No.12
if (contentType == ContentTypeKeys.Type_PDF) {
$('#listindex').bind('click', showListPageIndex);
$('#listindex').removeClass();
$('#copytext').bind('click', showCopyText);
$('#copytext').removeClass();
}
//End Function: No.12
/* image memo */
$('#imgmemo').bind('click', handleMemo);
$('#imgmemo').removeClass();
/* image add memo */
$('#imgaddmemo').bind('click', handleAddMemo);
$('#imgaddmemo').removeClass();
$('#imgmarking').bind('click', imgmarking_click);
$('#imgmarking').removeClass();
if (ClientData.serviceOpt_marking() == 'Y') {
$('#imgmarkingtoolbar').bind('click', handleDrawCanvas);
$('#imgmarkingtoolbar').removeClass();
}
checkDisableButtonZoom();
//Start Function: No.12
if (contentType == ContentTypeKeys.Type_PDF) {
$("#slider_page").slider("option", "disabled", false);
enable('#txtSearch', '#txtSlider');
}
if (avwUserEnvObj.os != "ipad" && avwUserEnvObj.os != "android") {
$('#button_next_canvas').css('display', 'block');
$('#button_pre_canvas').css('display', 'block');
}
if (isTouchDevice() == true) {/* set css for device */
$('#imgHome').addClass('home_device');
$('#imgBack').addClass('back_device');
$("#control_screen").addClass('toolbar_device');
$("#control_screen_2").addClass('toolbar_device');
var nBookmarkId = isExistBookmark();
if (nBookmarkId == -1) {
$('#imgbookmark').addClass('bmAdd_device');
} else {
$('#imgbookmark').addClass('bmAdd_hover');
}
if (isDisplayBookMarkList == true) {
$('#listbookmark').addClass('bmList_hover');
} else {
$('#listbookmark').addClass('bmList_device');
}
if (isDisplayCopyText == true) {
$('#copytext').addClass('copy_hover');
} else {
$('#copytext').addClass('copy_device');
}
if (isDisplayListIndex == true) {
$('#listindex').addClass('index_hover');
} else {
$('#listindex').addClass('index_device');
}
if (ClientData.IsDisplayMemo() == true) {
$('#imgmemo').addClass('memoDisplay_hover');
} else {
$('#imgmemo').addClass('memoDisplay_device');
}
if (ClientData.IsAddingMemo() == true) {
$('#imgaddmemo').addClass('memoAdd_hover');
} else {
$('#imgaddmemo').addClass('memoAdd_device');
}
if (ClientData.IsDisplayMarking() == true) {
$('#imgmarking').addClass('marking_hover');
} else {
$('#imgmarking').addClass('marking_device');
}
if (ClientData.serviceOpt_marking() == 'Y') {
if (ClientData.IsAddingMarking() == true) {
$('#imgmarkingtoolbar').addClass('markingToolbar_hover');
} else {
$('#imgmarkingtoolbar').addClass('markingToolbar_device');
}
}
} else { /* set css for PC */
$('#imgHome').addClass('home');
$('#imgBack').addClass('back');
/*$('#firstpage').addClass('begin');
$('#prevpage').addClass('prev');
$('#nextpage').addClass('next');
$('#lastpage').addClass('last');*/
$("#control_screen").addClass('toolbar');
$("#control_screen_2").addClass('toolbar');
var nBookmarkId = isExistBookmark();
if (nBookmarkId == -1) {
$('#imgbookmark').addClass('bmAdd');
} else {
$('#imgbookmark').addClass('bmAdd_hover');
}
if (isDisplayBookMarkList == true) {
$('#listbookmark').addClass('bmList_hover');
} else {
$('#listbookmark').addClass('bmList');
}
if (isDisplayCopyText == true) {
$('#copytext').addClass('copy_hover');
} else {
$('#copytext').addClass('copy');
}
if (isDisplayListIndex == true) {
$('#listindex').addClass('index_hover');
} else {
$('#listindex').addClass('index');
}
if (ClientData.IsDisplayMemo() == true) {
$('#imgmemo').addClass('memoDisplay_hover');
} else {
$('#imgmemo').addClass('memoDisplay');
}
if (ClientData.IsAddingMemo() == true) {
$('#imgaddmemo').addClass('memoAdd_hover');
} else {
$('#imgaddmemo').addClass('memoAdd');
}
if (ClientData.IsDisplayMarking() == true) {
$('#imgmarking').addClass('marking_hover');
} else {
$('#imgmarking').addClass('marking');
}
if (ClientData.serviceOpt_marking() == 'Y') {
if (ClientData.IsAddingMarking() == true) {
$('#imgmarkingtoolbar').addClass('markingToolbar_hover');
} else {
$('#imgmarkingtoolbar').addClass('markingToolbar');
}
}
}
checkExistNextPrePage();
};
/*
Clear canvas
*/
function clearCanvas(targetCanvas) {
targetCanvas.width = targetCanvas.width;
};
function encode(data) {
var str = String.fromCharCode.apply(null, data);
return btoa(str).replace(/.{76}(?=.)/g, '$&\n');
};
function showDialog(modal) {
$("#overlay").show();
$("#dialog").fadeIn(300);
if (modal) {
$("#overlay").unbind("click");
}
else {
$("#overlay").click(function (e) {
hideDialog();
});
}
};
function hideDialog() {
$("#overlay").hide();
$("#dialog").fadeOut(300);
$('#dialog').children().remove();
};
\ No newline at end of file

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/* get Json stored content info */
function getJsonContentInfo() {
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: 1 },
function (data) {
pageImages = data;
webGetContentData();
getSearchDataFromJson();
getJsonDataPageTitle();
getJsonDataType4();
getJsonDataType5();
getDataJsonFile();
webGetPageImageContentSize();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
/* get url */
function getURL(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiResourceDlUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
/* get url */
function getURLPageImage(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
function getPageObjectsByPageIndex(contentData, nIndexPage) {
pageObjects = [];
var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
if (contentData[nIndex].page == nIndexPage) {
currentPageObjects = contentData[nIndex].objects;
break;
}
}
if (currentPageObjects != undefined) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
}
}
}
};
/*get data mediaType = 1 */
function getMediaType1(iValueObj) {
/*
* Action Type = 1 : video
* Action Type = 2 : music
* Action Type = 3 : url
* Action Type = 4 : image preview
* Action Type = 5 : jump page
* Action Type = 6 : email
* Action Type = 7 :
* Action Type = 8 : popup
* Action Type = 9 : video
* Action Type = 10 : content
* Action Type = 11 : html
*/
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
pageObject['actionType'] = iValueObj.action.actionType;
pageObject['visible'] = true;
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['id'] = "MediaType1_" + iValueObj.action.actionType;
if (iValueObj.action.actionType == 0) {
/*get mediaInfo */
if (iValueObj.mediaInfo) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
} else if (iValueObj.action.actionType == 1) {
/*get mediaInfo */
if (iValueObj.mediaInfo) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get video file */
if (iValueObj.action.video) {
pageObject['mediaFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + removeExt(iValueObj.action.video);
pageObject['media'] = iValueObj.action.video;
} else {
pageObject['mediaFile'] = '';
pageObject['media'] = '';
}
} else if (iValueObj.action.actionType == 2) {
/*get mediaInfo */
if (iValueObj.mediaInfo) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get video file */
if (iValueObj.action.music) {
if (avwUserEnvObj.browser == 'msie') {
pageObject['audioFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + removeExt(iValueObj.action.music) + "&isIE=true";
} else {
pageObject['audioFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + removeExt(iValueObj.action.music);
}
} else {
pageObject['audioFile'] = '';
}
} else if (iValueObj.action.actionType == 3) {
/*get browserType */
if (iValueObj.action.browserType) {
pageObject['browserType'] = iValueObj.action.browserType;
} else {
pageObject['browserType'] = '';
}
/*get browser */
if (iValueObj.action.browser) {
pageObject['browser'] = iValueObj.action.browser;
} else {
pageObject['browser'] = '';
}
/*get linkUrl */
if (iValueObj.action.linkUrl) {
pageObject['linkUrl'] = iValueObj.action.linkUrl;
} else {
pageObject['linkUrl'] = '';
}
/*get mediaInfo */
if (iValueObj.mediaInfo) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/* action */
pageObject['action'] = null;
} else if (iValueObj.action.actionType == 4) {
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get Image Preview */
var dataResourceImage = iValueObj.action.preview;
var dataImageFromResource = [];
for (var nIndex = 0; nIndex < dataResourceImage.length; nIndex++) {
dataImageFromResource.push(getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceName=" + removeExt(dataResourceImage[nIndex]));
}
pageObject['imagePreview'] = dataImageFromResource;
} else if (iValueObj.action.actionType == 5) {
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get Image Preview */
if (iValueObj.action.jumpPage) {
pageObject['jumpPage'] = iValueObj.action.jumpPage;
} else {
pageObject['jumpPage'] = '';
}
}
else if (iValueObj.action.actionType == 6) {
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get emailSubject */
if (iValueObj.action.emailSubject) {
pageObject['emailSubject'] = iValueObj.action.emailSubject;
} else {
pageObject['emailSubject'] = '';
}
/*get emailAddress */
if (iValueObj.action.emailAddress) {
pageObject['emailAddress'] = iValueObj.action.emailAddress;
} else {
pageObject['emailAddress'] = '';
}
}
else if (iValueObj.action.actionType == 8) {
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get content */
pageObject['content'] = iValueObj.action.content;
}
else if (iValueObj.action.actionType == 10) {
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get contentId */
pageObject['contentId'] = iValueObj.action.contentId;
/*get pageNo */
pageObject['pageNo'] = iValueObj.action.pageNo;
}
return pageObject;
};
function getMediaType2(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
/*get actionType*/
if (iValueObj.action.actionType) {
pageObject['actionType'] = iValueObj.action.actionType;
} else {
pageObject['actionType'] = '';
}
pageObject['id'] = "media" + iValueObj.mediaInfo.resourceId;
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
pageObject['mediaFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
pageObject['media'] = iValueObj.mediaInfo.resourceId;
} else {
pageObject['mediaFile'] = '';
pageObject['media'] = '';
}
/*get mediaInfo */
if (iValueObj.action.embed) {
pageObject['embed'] = iValueObj.action.embed;
} else {
pageObject['embed'] = '';
}
pageObject['imageUrl'] = 'img/iPad_video.png';
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
function getMediaType3(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
/*get actionType*/
if (iValueObj.action.actionType) {
pageObject['actionType'] = iValueObj.action.actionType;
} else {
pageObject['actionType'] = '';
}
pageObject['id'] = "audio" + iValueObj.mediaInfo.resourceId;
/*get mediaInfo */
if (iValueObj.mediaInfo.resourceId) {
if (avwUserEnvObj.browser == 'msie') {
pageObject['audioFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId + "&isIE=true";
} else {
pageObject['audioFile'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
}
} else {
pageObject['audioFile'] = '';
}
/*get playtype */
pageObject['playType'] = iValueObj.action.playType;
pageObject['imageUrl'] = 'img/iPad_music.png';
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
function getMediaType4(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
pageObject['id'] = iValueObj.mediaInfo.id;
/*get image List info */
var imageObjects = iValueObj.mediaInfo.media;
for (var nIndex = 0; nIndex < imageObjects.length; nIndex++) {
/* get image from Json */
imageObjects[nIndex].fileName = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + imageObjects[nIndex].resourceId;
}
pageObject['dataObjects'] = imageObjects;
if (iValueObj.mediaInfo.triggerType) {
pageObject['triggerType'] = iValueObj.mediaInfo.triggerType;
} else {
pageObject['triggerType'] = '';
}
/*get image url */
if (imageObjects.length > 0) {
pageObject['imageUrl'] = imageObjects[0].fileName;
} else {
pageObject['imageUrl'] = null;
}
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
function getMediaType5(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
pageObject['id'] = iValueObj.mediaInfo.id;
/*get video List info */
var videoObjects = iValueObj.mediaInfo.media;
for (var nIndex = 0; nIndex < videoObjects.length; nIndex++) {
/* get image from Json */
videoObjects[nIndex].fileName = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + videoObjects[nIndex].resourceId;
}
pageObject['dataObjects'] = videoObjects;
/*get image url */
pageObject['imageUrl'] = '';
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
function getMediaType6(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
/*get actionType*/
if (iValueObj.action.actionType) {
pageObject['actionType'] = iValueObj.action.actionType;
} else {
pageObject['actionType'] = '';
}
pageObject['id'] = "trigger" + iValueObj.mediaInfo.resourceId;
/*get mediaInfo */
if (iValueObj.mediaInfo) {
/* get image from Json */
pageObject['imageUrl'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
} else {
pageObject['imageUrl'] = null;
}
/*get index */
if (iValueObj.action.index) {
pageObject['index'] = iValueObj.action.index;
} else {
pageObject['index'] = '';
}
/*get target */
if (iValueObj.action.target) {
pageObject['target'] = iValueObj.action.target;
} else {
pageObject['target'] = '';
}
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
function getMediaType7(iValueObj) {
var pageObject = [];
pageObject['mediaType'] = iValueObj.mediaType;
/*get actionType*/
if (iValueObj.action.actionType) {
pageObject['actionType'] = iValueObj.action.actionType;
} else {
pageObject['actionType'] = '';
}
pageObject['id'] = "testText";
/*get mediaInfo */
if (iValueObj.mediaInfo.content) {
pageObject['content'] = iValueObj.mediaInfo.content;
} else {
pageObject['content'] = '';
}
if (iValueObj.action) {
pageObject['action'] = "";
}
/*get location */
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
return pageObject;
};
//Start Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
function getMediaType8(iValueObj) {
var pageObject = [];
//Get object Info
pageObject['mediaType'] = iValueObj.mediaType;
pageObject['id'] = "MediaType8_" + iValueObj.mediaInfo.resourceId;
pageObject['actionType'] = iValueObj.action.actionType;
//Get object Location
pageObject['x'] = iValueObj.location.x;
pageObject['y'] = iValueObj.location.y;
pageObject['width'] = iValueObj.location.width;
pageObject['height'] = iValueObj.location.height;
pageObject['visible'] = true;
if(iValueObj.action.actionType == 9){
pageObject['horizonCount'] = iValueObj.mediaInfo.horizonCount;
pageObject['verticalCount'] = iValueObj.mediaInfo.verticalCount;
pageObject['initImage'] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + iValueObj.mediaInfo.resourceId;
var _3dViewObject = [];
var data3d = iValueObj.action["3dview"];
var horizonCnt = 0;
var verticalCnt = 1;
while(verticalCnt <= iValueObj.mediaInfo.verticalCount){
horizonCnt++;
if(horizonCnt > iValueObj.mediaInfo.horizonCount){
verticalCnt++;
if(verticalCnt > iValueObj.mediaInfo.verticalCount){
break;
}
horizonCnt = 1;
}
_3dViewObject[convNumTo2Char(verticalCnt)+"-"+convNumTo2Char(horizonCnt)] =
getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid()
+ "&resourceId=" + data3d[convNumTo2Char(verticalCnt) +"-"+ convNumTo2Char(horizonCnt)].resourceId;
}
pageObject['3dview'] = _3dViewObject;
}
return pageObject;
};
function convNumTo2Char(num){
var nRet = "";
if(num < 10)
nRet = "0" + num;
else
nRet = "" + num;
return nRet;
};
//End Function : No.9 - Editor : Long - Date : 08/15/2013 - Summary : Handle 3d object
/* get page index */
function getPageIndex() {
var content = getContent();
return eval(content.pageIndex);
};
/* get data marking from local storage */
function getDataClientStorage() {
/*set default size and color */
if (!ClientData.penOpt_size()) {
ClientData.penOpt_size(5);
}
if (!ClientData.penOpt_color()) {
ClientData.penOpt_color("fe0000");
}
if (!ClientData.maker_size()) {
ClientData.maker_size(5);
}
if (!ClientData.maker_color()) {
ClientData.maker_color("f8ff00");
}
if (!ClientData.erase_size()) {
ClientData.erase_size(5);
}
isAddingMarking = ClientData.IsAddingMarking();
penSize = ClientData.penOpt_size();
penColor = ClientData.penOpt_color();
makerSize = ClientData.maker_size();
makerColor = ClientData.maker_color();
eraseSize = ClientData.erase_size();
markingType = ClientData.MarkingType();
};
/* get list bookmark of content */
function getBookMarkListByContentID() {
var bmList = [];
var bmListResult = [];
bmList = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
if (bmList[nIndex].contentid == contentID) {
bmListResult.push(bmList[nIndex]);
}
}
return bmListResult;
};
/* get data load*/
function getDataLoaded(data) {
var isExist = false;
for (var i = 0; i < data.length; i++) {
isExist = false;
for (var n = 0; n < arrThumbnailsLoaded.length; n++) {
if (data[i].pageNo == arrThumbnailsLoaded[n].pageNo) {
isExist = true;
break;
}
}
/* insert if not exist */
if (isExist == false) {
arrThumbnailsLoaded.push(data[i]);
}
}
/* sort data */
arrThumbnailsLoaded.sort(function (a, b) {
var a1 = a.pageNo, b1 = b.pageNo;
if (a1 == b1) return 0;
return a1 > b1 ? 1 : -1;
});
};
/* get list info bookmark */
function getBookmarklist(pos) {
var isExistBookMarkInContent = false;
sortBookmarkList();
var bmList = [];
bmList = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < bmList.length; nIndex++) {
if (bmList[nIndex].contentid == contentID) {
isExistBookMarkInContent = true;
break;
}
}
if (isExistBookMarkInContent == false) {
$('#divListBookmark').children().remove();
$('#divListBookmark').append('<span class="last">' + i18nText('msgShioriNotExists') + '</span>');
// $("#divListBookmark").dialog({
// show: "blind",
// modal: true,
// resizable:false,
// width: WIDTH_DIALOG_BOOKMARK,
// height: HEIGHT_DIALOG_BOOKMARK_NO_BOOKMARK,
// title: i18nText('txtShioriCtnLs'),
// position: pos});
//title start
$('#bookmarkBoxHdBM').children().remove();
$('#bookmarkBoxHdBM').html('<a id="bookmarkClosing" class="delete" > </a>');
$("#bookmarkClosing").click(closeBookmarkBox);
$('#bookmarkBoxHdBM').append(i18nText('txtShioriCtnLs'));
//title end
//lockLayout();
$('#boxBookMark').css('z-index', '101');
$('#boxBookMark').css('display', 'block');
$('#boxBookMark').draggable({ handle: "h1" });
$("#boxBookMark").offset({ left: pos[0], top: pos[1] });
$("#divListBookmark").show();
$("#divListBookmark").offset({ left: pos[0], top: (pos[1] + $('#bookmarkBoxHdBM').height()) });
}
else {
//display dialog
// $("#divListBookmark").dialog({
// show: "blind",
// modal: true,
// width: WIDTH_DIALOG_BOOKMARK,
// height:HEIGHT_DIALOG_BOOKMARK,
// resizable:false,
// title: i18nText('txtShioriCtnLs'),
// position: pos});
handleAPIWebContentPage(dataWebContentPage, pos)
}
};
/* get list info bookmark */
function getPageIndexJson(pos) {
if (dataJsonType5.length > 0) {
$('#divListIndex').children().remove();
// $("#divListIndex").dialog({
// show: "blind",
// modal: true,
// width: WIDTH_DIALOG_INDEX,
// height:HEIGHT_DIALOG_INDEX,
// resizable:false,
// closeOnEscape: false,
// title: i18nText('txtIndex'),
// position: pos});
//title start
$('#indexBoxHdIndex').children().remove();
$('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
$("#indexClosing").click(closeIndexBox);
$('#indexBoxHdIndex').append(i18nText('txtIndex'));
//title end
//lockLayout();
$('#boxIndex').css('z-index', '101');
$('#boxIndex').css('display', 'block');
$('#boxIndex').draggable({ handle: "h1" });
$("#boxIndex").offset({ left: pos[0], top: pos[1] });
$("#divListIndex").show();
$("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });
//set data for dialog index
var dataContent = dataJsonType5;
var arrData = new Array();
$.each(dataContent, function (i, value) {
if (dataContent[i].level == 0) {
//add parent node
var node = new TreeNode();
node.IsCategory = true;
//node.Text = htmlEncode(truncateByBytes(dataContent[i].title, 30));
/* check data text */
if (getBytes(dataContent[i].title) > 30) {
node.Text = htmlEncode(truncateByBytes(dataContent[i].title, 30)) + '...';
} else {
node.Text = htmlEncode(dataContent[i].title);
}
node.id = dataContent[i].ID;
node.Value = dataContent[i].destPageNumber;
AddChidrenNode(node, dataContent);
arrData.push(node);
}
});
var tree = new TreeViewIndex();
tree.IsShowTotal = false;
tree.Show("divListIndex", arrData, "listIndex_Callback");
$("#divListIndex").treeview();
$(".treeview, .treeview ul").css('padding', '0px 8px 0');
} else {
$('#divListIndex').children().remove();
$('#divListIndex').append('<span style="color:#333333; font-size:12px; cursor:default; text-decoration:none;">' + i18nText('msgNoIndex') + '</span>');
// //show dialog index
// $("#divListIndex").dialog({
// show: "blind",
// modal: true,
// resizable:false,
// width: WIDTH_DIALOG_INDEX,
// height:HEIGHT_DIALOG_INDEX_NO_INDEX,
// title: i18nText('txtIndex'),
// position: pos});
//title start
$('#indexBoxHdIndex').children().remove();
$('#indexBoxHdIndex').html('<a id="indexClosing" class="delete" > </a>');
$("#indexClosing").click(closeIndexBox);
$('#indexBoxHdIndex').append(i18nText('txtIndex'));
//title end
//lockLayout();
$('#boxIndex').css('z-index', '101');
$('#boxIndex').css('display', 'block');
$('#boxIndex').draggable({ handle: "h1" });
$("#boxIndex").offset({ left: pos[0], top: pos[1] });
$("#divListIndex").show();
$("#divListIndex").offset({ left: pos[0], top: (pos[1] + $('#indexBoxHdIndex').height()) });
}
};
function getText() {
/* init var page text */
var data = dataWebContentPage.pages;
var sPageText = '';
var w = $("#wrapper").width() / 2 - $('#boxCopyText').width() / 2;
var h = $("#wrapper").height() / 2 - $('#boxCopyText').height() / 2;
for (var nIndex = 0; nIndex < data.length; nIndex++) {
/* get text of current page */
if (data[nIndex].pageNo == changePageIndex(getPageIndex())) {
sPageText = htmlEncode(data[nIndex].pageText);
break;
}
}
if (sPageText == '') {
return { text: i18nText('txtNoTextCopy'), title: i18nText('txtTextCopy') + ' | ' + i18nText('sysAppTitle') };
}
else {
var strPattern = "\n";
var strTemp = sPageText;
strTemp = strTemp.replaceAll(strPattern, "<br/>");
strTemp += "<br/>";
return { text: strTemp, title: i18nText('txtTextCopy') + ' | ' + i18nText('sysAppTitle') };
}
};
/* get contentID */
function getContentID() {
/* init contentID */
if (ClientData.common_preContentId()) {
contentID = ClientData.common_preContentId();
ClientData.common_preContentId(null);
} else if (ClientData.IsJumpBack() == true) {
var dataJump = ClientData.JumpQueue();
contentID = dataJump[dataJump.length - 1].oldContentID;
} else {
contentID = ClientData.contentInfo_contentId();
}
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId;
};
//Get content info type Image
function getContentInfoTypeImage(){
var resourceUrl = downloadResourceById(contentID);
resourceImage.onload = function(){
widthContentImage = resourceImage.width;
heightContentImage = resourceImage.height;
getContent().setPageImages(1, resourceUrl).setUpPage(0);
handleSliderBar();
$('#lblSlider').text('/ ' + 1);
/* window resize event */
$(window).resize(function () {
sizingScreen();
resizeScreen();
isChangeSizeScreen = false;
/* change position dialog */
changePosDialog();
/* close dialog popuptext */
closeDialogResize();
});
};
resourceImage.src = resourceUrl;
};
/* grab viewer content object */
function getContent() {
return content;
};
/* get all memo on page */
function getAllMemoOfPage() {
if (ClientData.IsDisplayMemo() == true) {
memoObjects = [];
/*get data memo */
var memoData = ClientData.MemoData();
for (var nIndex = 0; nIndex < memoData.length; nIndex++) {
if (memoData[nIndex].contentid == contentID
&& memoData[nIndex].pageNo == changePageIndex(getPageIndex())) {
/* create object of memo */
var memoObject = null;
if (memoData[nIndex].posY > heightEachPage - 50) {
memoData[nIndex].posY = heightEachPage - 50;
}
if (memoData[nIndex].posX > widthEachPage - 50) {
memoData[nIndex].posX = widthEachPage - 50;
}
memoObject = new memo(
nIndex,
memoData[nIndex].Text,
memoData[nIndex].posX,
memoData[nIndex].posY,
50,
50,
"img/memo.png"
);
memoObjects.push(memoObject);
}
}
}
};
function getPosVideo(px, py, width, height, scale) {
pxVideo = px;
pyVideo = py;
wVideo = width;
hVideo = height;
videoScale = scale;
};
//Start Function: No.4 - Editor : Long - Summary : Render Next Page Content
//Render next Page Content
function renderNextPage(){
//Get next page Number
var pageNo = parseInt(changePageIndex(getPageIndex())) + 1;
//Get next page background image
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) {
nextPageImage = data;
nextContent.setPageImages(totalPage, nextPageImage)
.setPageObjects(nextPageObjects)
.nextPage();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
//Render prev Page Content
function renderPrevPage(){
//Get next page Number
var pageNo = parseInt(changePageIndex(getPageIndex())) - 1;
//Get next page background image
avwGrabContentPageImage(ClientData.userInfo_accountPath(),
{ contentId: contentID, sid: ClientData.userInfo_sid(), pageNo: pageNo },
function (data) {
prevPageImage = data;
prevContent.setPageImages(totalPage, prevPageImage)
.setPageObjects(prevPageObjects)
.previousPage();
},
function (xmlHttpRequest, txtStatus, errorThrown) {
showErrorScreen();
});
};
//Get next page objects by page index
function getNextPageObjectsByPageIndex(contentData, nIndexPage) {
nextPageObjects = [];
var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
if (contentData[nIndex].page == nIndexPage) {
currentPageObjects = contentData[nIndex].objects;
break;
}
}
if (currentPageObjects != undefined) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]);
/*add object to page */
nextPageObjects.push(pageObject);
}
}
}
};
//Get prev page objects by page index
function getPrevPageObjectsByPageIndex(contentData, nIndexPage) {
prevPageObjects = [];
var currentPageObjects;
for (var nIndex = 0; nIndex < contentData.length; nIndex++) {
if (contentData[nIndex].page == nIndexPage) {
currentPageObjects = contentData[nIndex].objects;
break;
}
}
if (currentPageObjects != undefined) {
for (var nIndex = 0; nIndex < currentPageObjects.length; nIndex++) {
/*get object page*/
if (currentPageObjects[nIndex].mediaType == 1) {/*media type = 1 */
var pageObject = getMediaType1(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 2) { /*mediaType = 2 */
var pageObject = getMediaType2(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 3) { /*mediaType = 3*/
var pageObject = getMediaType3(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 4) { /*mediaType = 4*/
var pageObject = getMediaType4(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 5) { /*mediaType = 5*/
var pageObject = getMediaType5(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 6) { /*mediaType = 6*/
var pageObject = getMediaType6(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 7) { /*mediaType = 7*/
var pageObject = getMediaType7(currentPageObjects[nIndex]);
/*add object to page */
pageObjects.push(pageObject);
} else if (currentPageObjects[nIndex].mediaType == 8) { /*mediaType = 8*/
var pageObject = getMediaType8(currentPageObjects[nIndex]);
/*add object to page */
prevPageObjects.push(pageObject);
}
}
}
};
//Switch canvas when flipping page
function switchCanvas(nav){
// change div id
if(nav == 1){
$('#mainPre').attr("id","mainPreBK");
$('#main').attr("id","mainPre");
$('#mainNext').attr("id","main");
$('#mainPreBK').attr("id","mainNext");
$('#offscreenPre').attr("id","mainPreBK");
$('#offscreen').attr("id","offscreenPre");
$('#offscreenNext').attr("id","offscreen");
$('#mainPreBK').attr("id","offscreenNext");
}
else{
// change div id
$('#mainNext').attr("id","mainNextBK");
$('#main').attr("id","mainNext");
$('#mainPre').attr("id","main");
$('#mainNextBK').attr("id","mainPre");
$('#offscreenNext').attr("id","mainNextBK");
$('#offscreen').attr("id","offscreenNext");
$('#offscreenPre').attr("id","offscreen");
$('#mainNextBK').attr("id","offscreenPre");
}
};
//Assign content properties
function assignCurrentContentPage(nav){
if(nav == 1){
prevPageImage = pageImages;
pageImages = nextPageImage;
prevContent.currentPage = content.currentPage;
prevContent.pageCount = content.pageCount;
prevContent.pageImages = content.pageImages;
prevContent.pageIndex = content.pageIndex;
prevContent.pageObjects = content.pageObjects;
content.currentPage = nextContent.currentPage;
content.pageCount = nextContent.pageCount;
content.pageImages = nextContent.pageImages;
content.pageIndex = nextContent.pageIndex;
content.pageObjects = nextContent.pageObjects;
}
else{
nextPageImage = pageImages;
pageImages = prevPageImage;
nextContent.currentPage = content.currentPage;
nextContent.pageCount = content.pageCount;
nextContent.pageImages = content.pageImages;
nextContent.pageIndex = content.pageIndex;
nextContent.pageObjects = content.pageObjects;
content.currentPage = prevContent.currentPage;
content.pageCount = prevContent.pageCount;
content.pageImages = prevContent.pageImages;
content.pageIndex = prevContent.pageIndex;
content.pageObjects = prevContent.pageObjects;
}
};
//Correct Canvas Position
function correctCanvasPosition(){
//correct canvas position
if(animateType == animateTypeKeys.Type_Slide){
$('#canvasWrapper').css("left",'0px');
$('#main').css("left",'13px');
$('#mainNext').css("left", $("#canvasWrapper").width() +'px');
$('#mainPre').css("left", '-' + $("#canvasWrapper").width() +'px');
}
else if(animateType == animateTypeKeys.Type_FadeIn){
//$('#main').css("z-index",'2');
$('#mainNext').css("z-index",'0');
$('#mainPre').css("z-index",'0');
//$('#mainNext').css("opacity",'0');
//$('#mainPre').css("opacity",'0');
}
};
//End Function: No.4 - Editor : Long - Summary : Render Next Page Content
\ No newline at end of file

/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="contentview_VarDef.js" />
/// <reference path="contentview_CallApi.js" />
/// <reference path="contentview_GetData.js" />
/* init Image memo */
function initImageMemo() {
if (ClientData.IsDisplayMemo() == true) {
//change class
$('#imgmemo').removeClass();
$('#imgmemo').addClass('memoDisplay_hover');
} else {
//change class
$('#imgmemo').removeClass();
$('#imgmemo').addClass('memoDisplay');
}
};
/* init Image add memo */
function initImageAddMemo() {
if (ClientData.IsAddingMemo() == true) {
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd_hover');
} else {
//change class
$('#imgaddmemo').removeClass();
$('#imgaddmemo').addClass('memoAdd');
}
};
/*check display marking?? */
function initDisplayMarking() {
if (ClientData.IsDisplayMarking() == true) {
// change class
$('#imgmarking').removeClass();
$('#imgmarking').addClass('marking_hover');
if (ClientData.IsAddingMarking() == true) {
if (ClientData.IsHideToolbar() == false) {
ShowMarking();
}
disableAllControl();
} else {
//change image
$('#imgmarkingtoolbar').removeClass();
$('#imgmarkingtoolbar').addClass('markingToolbar');
}
} else {
$("#dlgMarking").hide();
// change class
$('#imgmarking').removeClass();
$('#imgmarking').addClass('marking');
$('#draw_canvas').css('display', 'none');
//change image
$('#imgmarkingtoolbar').removeClass();
$('#imgmarkingtoolbar').addClass('markingToolbar');
}
};
/* init Image bookmark */
function initImageBookmark() {
if (isExistBookmark() == -1) {
//change class
$('#imgbookmark').removeClass();
$('#imgbookmark').addClass('bmAdd_off');
} else {
//change class
$('#imgbookmark').removeClass();
$('#imgbookmark').addClass('bmAdd');
}
};
/* init flag marking, memo when init page */
function initFlagDisplay() {
ClientData.IsDisplayMemo(false);
ClientData.IsAddingMemo(false);
if (ClientData.userOpt_makingDsp() == "1") {
ClientData.IsDisplayMarking(true);
} else {
ClientData.IsDisplayMarking(false);
}
ClientData.IsAddingMarking(false);
};
/* set size bot toolbar for ipad */
function initDisplayToolbarDevice() {
if (avwUserEnvObj.os == "ipad" || avwUserEnvObj.os == "android") {
$('.transition').css('padding', '4px 0 0 0');
$('.sizing').css('padding', '4px 0 0 2px');
$('.toolbar').css('margin', '0 0 0 0');
}
};
function initPage() {
//$('body,html').animate({ scrollTop: 0 }, 350);
//animateType = animateTypeKeys.Type_FadeIn;
$('#divImageLoading').css('display', 'block');
/* init footer toolbar */
$('#footer_toolbar_2').hide();
$('#footer_toolbar_1').show();
/* init pos bottom toolbar*/
initDisplayToolbarDevice();
// Lock screen
LockScreen();
getContentID();
StartTimerUpdateLog();
/* set start log */
SetStartLog(contentID);
/* get info of content */
//Start Function: No.12
if(contentType == ContentTypeKeys.Type_Image){
getContentInfoTypeImage();
}
else{
getJsonContentInfo();
}
//End Function: No.12
initializeViewerComponent('wrapper');
/* handle display tooltip */
handleTooltip();
/* set text dialog confirm of audio */
createTextConfirmAudio();
/* handle toolbar */
$('#control_screen').click(handleDisplayToolbar);
$('#control_screen_2').click(handleDisplayToolbar);
/* bookmark Page */
$('#imgbookmark').click(bookmarkPage);
$('#listbookmark').click(showListBookMark);
$('#divListBookmark li').live('click', clickBookmark);
/* close bookmark dialog */
//$("#bookmarkClosing").live('click',closeBookmarkBox);
//Start Function : No.12
if(contentType == ContentTypeKeys.Type_PDF){
/* page index */
$('#listindex').click(showListPageIndex);
$('#divSearchResult li').live('click', clickSearchDetail);
/* copy text */
$('#copytext').click(showCopyText);
/* close copy text dialog */
$("#copyTextClosing").click(closeCopyTextBox);
}
/*event click next page button */
$('#nextpage').click(nextPage_click);
$('#button_next_canvas').click(nextPage_click);
/*event click prev page button */
$('#prevpage').click(prevPage_click);
$('#button_pre_canvas').click(prevPage_click);
/*event click fist page button */
$('#firstpage').click(firstPage_click);
/*event click last page button */
$('#lastpage').click(lastPage_click);
$("#imgBack").click(imgBack_click);
$("#imgHome").click(imgHome_click);
$("#btn_show_memo").click(showEditMemo);
$("#btn_copy_memo").click(copyMemo);
$('#memoClosing').click(closePopUpCopyMemo);
$('#liAddMemo').click(click_liAddMemo);
$('#liCopyMemo').click(click_liCopyMemo);
$('#liDeleteMemo').click(click_liDeleteMemo);
//Start Function: No.12
if(contentType == ContentTypeKeys.Type_PDF){
/*event search*/
showListSearchResult();
}
//End Function: No.12
/* zoom event */
$('#zoomin').click(zoomIn);
$('#zoomout').click(zoomOut);
$('#zoomfit').click(screenFit);
/* event memo */
$('#imgmemo').click(handleMemo);
$('#imgaddmemo').click(handleAddMemo);
/* event marking */
$('#imgmarking').click(imgmarking_click);
$('#imgmarkingtoolbar').click(handleDrawCanvas);
/*draw canvas*/
drawOnCanvas();
/*init flag */
initFlagDisplay();
sizingScreen();
/* move image check marking*/
$('#divCheckExistMarking').css('top', '70px');
$('#divCheckExistMarking').hide();
/* disable controls */
isLoadingObject = true;
disableAllControl();
/* window resize event */
$(window).resize(function () {
sizingScreen();
/* close dialog popuptext */
closeDialogResize();
});
$(document).ajaxComplete(function () {
/*Init Page */
nAjaxLoad++;
if (nAjaxLoad == 7) {
/* handle from bookmark page */
//handleFromBookMarkPage();
/* check move content */
if (ClientData.bookmark_pageNo()) {
handleFromBookMarkPage();
} else if (ClientData.common_prePageNo()) {
/* handle from jump content */
handleFromJumpContent();
} else if (ClientData.IsJumpBack() == true) {
/* handle back */
oldContent_Back();
} else {
if (getPageIndex() == 0) {
getContent().setPageImages(totalPage, pageImages)
.setPageObjects(pageObjects)
.setUpPage(0);
//Start Function: No.12 - Editor : Long - Summary : Render next page
//Get next
getNextPageObjectsByPageIndex(pageObjectsData, getPageIndex() + 1);
//Render next page
renderNextPage();
//End Function: No.12 - Editor : Long - Summary : Render next page
/* set pageTitle*/
if (dataPageTitle[0]) {
if (dataPageTitle[0] != '') {
document.title = contentName + '_' + dataPageTitle[0] + ' | ' + i18nText('sysAppTitle');
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
} else {
document.title = contentName + ' | ' + i18nText('sysAppTitle');
}
/* handle slider bar */
handleSliderBar();
}
}
/* window resize event */
$(window).resize(function () {
if (isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") {
var tempRatio = document.documentElement.clientWidth / window.innerWidth;
if (tempRatio <= 1) {
// Adjust position for toolbar and footer bar
var top = window.innerHeight - $("#footer_toolbar_1").height();
$("#wrapper").css("width", window.innerWidth);
$("#wrapper").css("height", window.innerHeight);
$("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
}
else {
var top = $(window).height() - $("#footer_toolbar_1").height();
$("#wrapper").css("width", $(window).width());
$("#wrapper").css("height", $(window).height());
$("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
}
}
}
resizeScreen();
isChangeSizeScreen = false;
/* change position dialog */
changePosDialog();
/* close dialog popuptext */
closeDialogResize();
});
/* check status button */
checkExistNextPrePage();
/*init Image Bookmark */
initImageBookmark();
$('#lblSlider').text('/ ' + totalPage);
/* memo */
initImageMemo();
initImageAddMemo();
/* init image had draw */
initDisplayMarking();
/* check status */
checkStatusImageMarking();
trackTransforms(context_main);
//nAjaxLoad = 0;
if (isTouchDevice() == true) {
if (avwUserEnvObj.os == "android") {
standardRatio = document.documentElement.clientWidth / window.innerWidth;
startDetectZoom({ time: 500,
callbackFunction: function (oldRatio, newRatio, oldW, oldH, newW, newH) {
currentRatio = newRatio;
}
});
var top = window.innerHeight - $("#footer_toolbar_1").height();
$("#wrapper").css("width", window.innerWidth);
$("#wrapper").css("height", window.innerHeight);
$("#footer_toolbar_1").css("top", top + "px");
$("#footer_toolbar_2").css("top", top + "px");
sizingScreen();
}
}
}
});
};
function initPageMediaAndHtmlType(){
//$('#divImageLoading').css('display', 'block');
/* init footer toolbar */
$('#footer_toolbar_2').hide();
$('#footer_toolbar_1').show();
/* init pos bottom toolbar*/
initDisplayToolbarDevice();
// Lock screen
LockScreen();
//enable SpecifyControl
enableSpecifyControl();
//Display overlay dialog for specify content type
displayOverlayForSpecifyContentType();
//Resize window
$(window).resize(function () {
//Check if content is zooming
if(isZoomingContent){
var $container = $("#dialog");
var w = window.innerWidth;
var h = window.innerHeight;
$container.css('height', h);
$container.css('width', w);
}
});
handleSliderBar();
$('#lblSlider').text('/ ' + 1);
};
//Start: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas
/* Initialize PageViewer Component */
function initializeViewerComponent(viewId) {
/* add some tags we need.*/
$('#' + viewId).prepend(
'<div id="canvasWrapper">' +
'<canvas id="mainPre"></canvas>' +
'<canvas id="main"></canvas>' +
'<canvas id="mainNext"></canvas>' +
'</div>' +
'<canvas id="offscreenPre"></canvas>' +
'<canvas id="offscreen"></canvas>' +
'<canvas id="offscreenNext"></canvas>' +
'<canvas id="draw_canvas"></canvas>' +
'<canvas id="marker_canvas"></canvas>' +
'<div id="playvideo"></div>' +
'<div id="playaudio" style="width:0px; height:0px;"></div>' +
'<div id="playaudiopage" style="width:0px; height:0px;"></div>' +
'<div id="playaudioallpage" style="width:0px; height:0px;"></div>' +
'<div id="text"></div>'
);
/* apply css style */
$('#canvasWrapper').css(
{
'position': 'absolute',
'height' : '100%',
'width' : '100%'
}
);
$('#main').css(
{
'position': 'absolute',
'top': marginY + 'px',
'left': marginX + 'px',
'box-shadow': '3px 3px 14px #333',
'background-color': 'rgba(153, 153, 153, 0.7)',
'border-radius': '4px'
}
);
if(animateType == animateTypeKeys.Type_Slide){
$('#mainNext').css(
{
'position': 'absolute',
'top': marginY + 'px',
'left': marginX + 'px',
'box-shadow': '3px 3px 14px #333',
'background-color': 'rgba(153, 153, 153, 0.7)',
'border-radius': '4px'
}
);
$('#mainPre').css(
{
'position': 'absolute',
'top': marginY + 'px',
'left': marginX + 'px',
'box-shadow': '3px 3px 14px #333',
'background-color': 'rgba(153, 153, 153, 0.7)',
'border-radius': '4px'
}
);
}
else{
$('#mainNext').css(
{
'position': 'absolute',
'top': marginY + 'px',
'left': marginX + 'px',
'box-shadow': '3px 3px 14px #333',
'background-color': 'rgba(153, 153, 153, 0.7)',
'border-radius': '4px',
'opacity': '0'
}
);
$('#mainPre').css(
{
'position': 'absolute',
'top': marginY + 'px',
'left': marginX + 'px',
'box-shadow': '3px 3px 14px #333',
'background-color': 'rgba(153, 153, 153, 0.7)',
'border-radius': '4px',
'opacity': '0'
}
);
}
$('#offscreen').css(
{
'visibility': 'hidden',
'display': 'none'
}
);
$('#offscreenPre').css(
{
'visibility': 'hidden',
'display': 'none'
}
);
$('#offscreenNext').css(
{
'visibility': 'hidden',
'display': 'none'
}
);
$('#marker_canvas').css(
{
'display': 'none',
'position': 'absolute',
'cursor': 'default'
}
);
$('#draw_canvas').css(
{
'display': 'none',
'position': 'absolute',
'cursor': 'default'
}
);
$('#playvideo').css(
{
'position': 'fixed',
'top': marginY + 'px',
'left': marginX + 'px'
}
);
//set default event
setDefaultEvent();
/*init canvas value */
canvas_marker = document.getElementById('marker_canvas');
context_marker = canvas_marker.getContext('2d');
canvas_draw = document.getElementById('draw_canvas');
context_draw = canvas_draw.getContext('2d');
canvas_main = document.getElementById('main');
context_main = canvas_main.getContext('2d');
canvas_offscreen = document.getElementById('offscreen');
context_offscreen = canvas_offscreen.getContext('2d');
};
//End: Function: No.4 - Editor : Long - Date : 08/09/2013 - Summary : Create next and previous canvas
/* init image if exist marking in page */
function initImageCheckMarking() {
/* set draw image if exist */
var dataMarking = ClientData.MarkingData();
var isExistMarking = false;
//Start Function: No.12 - Editor : Long
var tempPageNo = 0;
if(contentType == ContentTypeKeys.Type_Image)
{
tempPageNo = 1;
}
else{
tempPageNo = changePageIndex(getPageIndex());
}
//End Function: No.12 - Editor : Long
for (var nIndex = 0; nIndex < dataMarking.length; nIndex++) {
if (dataMarking[nIndex].contentid == contentID
&& dataMarking[nIndex].pageNo == tempPageNo) {
isExistMarking = true;
break;
}
}
/* init image display or not */
if (ClientData.IsAddingMarking() == true) {
$('#divCheckExistMarking').hide();
} else {
if (isExistMarking == true) {
$('#divCheckExistMarking').show();
} else {
$('#divCheckExistMarking').hide();
}
}
};
......@@ -39,10 +39,17 @@ function dlgMarking_dspSave_click() {
/*create new entity marking */
var marking = new MarkingEntity();
marking.contentid = contentID;
if(contentType == ContentTypeKeys.Type_Image){
marking.pageNo = 1;
}else{
marking.pageNo = changePageIndex(getPageIndex());
marking.content = canvas_draw.toDataURL("image/png");
}
marking.content = canvas_draw.toDataURL("image/png");
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker.
marking.markingid = getUUID();
marking.registerDate = new Date();
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new marking/maker.
/* insert marking */
var arr = ClientData.MarkingData();
var nIndexMarking = -1;
......@@ -64,7 +71,14 @@ function dlgMarking_dspSave_click() {
arr.push(marking);
} else {
/* case exist marking */
arr[nIndexMarking] = marking;
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
var editedMarkingEntity = arr[nIndexMarking];
editedMarkingEntity.content = canvas_draw.toDataURL("image/png");
editedMarkingEntity.registerDate = new Date();
arr[nIndexMarking] = editedMarkingEntity;
//arr[nIndexMarking] = marking;
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit marking/maker.
}
}
}
......@@ -86,7 +100,7 @@ function dlgMarking_dspSave_click() {
$('#imgmarking').addClass('marking');*/
/*set flag change marking */
ClientData.isChangedMemo(true);
ClientData.isChangedMarkingData(true);
ClientData.IsHideToolbar(false);
......
......@@ -49,7 +49,10 @@ function memoSaveFunction(){
var imagePt = screenToImage(targetX, targetY);
memoObj.posX = imagePt.x;
memoObj.posY = imagePt.y;
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new memo.
memoObj.memoid = getUUID();
memoObj.registerDate = new Date();
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time and UUID when create new memo.
tempArr = ClientData.MemoData();
tempArr.push(memoObj);
ClientData.MemoData(tempArr);
......@@ -203,7 +206,9 @@ function editMemoFunction(){
var editContent = $('#txaMemoContent').val();
tempEntity.Text = editContent;
//=== Start Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo.
tempEntity.registerDate = new Date();
//=== End Function : No.17 Editor : Long Date: 07/30/2013 Summary : Set UTC time when edit memo.
arrTemp[EditIndex] = tempEntity;
ClientData.MemoData(arrTemp);
......
......@@ -20,6 +20,8 @@
/// <reference path="home.js" />
var resourceIdDetail="";
var displayData = {
contentID: "",
contentTitle: "",
......@@ -29,6 +31,18 @@ var displayData = {
pages: []
};
//Content's types
var ContentTypeKeys = {
Type_PDF : 'pdfFile',
Type_Image : 'imageFile',
Type_Video : 'movieFile',
Type_Music : 'soundFile',
Type_Others : 'otherFile',
Type_NoFile : 'noFile',
Type_Html: 'htmlFile'
};
// Init function of page
$(document).ready(function () {
//alert(ClientData.contentInfo_contentId());
......@@ -42,6 +56,18 @@ $(document).ready(function () {
// Show content detail
function openContentDetail() {
if(!isPdfContent(ClientData.contentInfo_contentType())){
$("#book_data").css('border-right','0');
$("#book_data").css('float','none');
$("#book_data").css('background-color','white');
$("#book_data").css('margin-left','auto');
$("#book_data").css('margin-right','auto');
}else
{
$("#book_data").css('border-right','2px solid #CCC');
$("#book_data").css('float','left');
$("#book_data").css('background-color','#f7f7f7');
}
displayData = {
contentID: "",
......@@ -85,15 +111,22 @@ function openContentDetail() {
// Get content detail
avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: displayData.contentID, sid: ClientData.userInfo_sid(), getType: 1 },
function (data) {
var contentType = ClientData.contentInfo_contentType();
// Get content detail
displayData.contentTitle = data.contentData.contentName;
displayData.contentDetail = data.contentData.contentDetail;
displayData.deliveryDate = convertToDate(data.contentData.deliveryStartDate);
//Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
if(!isPdfContent(contentType)){
ShowContentNotPDF(displayData.contentTitle,displayData.contentDetail,displayData.contentThumbnail,displayData.deliveryDate);
}else{
// Get pages
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), thumbnailFlg: 1, pageNos: '1,2,3,4,5,6'},
function (data) {
// Get pages
for (var nIndex = 0; nIndex < data.pages.length; nIndex++) {
if (nIndex < 6) {
......@@ -105,10 +138,14 @@ function openContentDetail() {
},
null
);
}
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
},
null
);
};
// Close content detail
......@@ -177,9 +214,110 @@ function contentdetail_dspRead_Click(e) {
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
var contentType = "1";
if(contentType == "1"){
// Get content detail
avwCmsApi(ClientData.userInfo_accountPath(), "webGetContent", "GET", { contentId: ClientData.contentInfo_contentId(), sid: ClientData.userInfo_sid(), getType: 2 },
function (data) {
$.each(data.contentData , function(i, n){
if(typeof n == "object"){
resourceIdDetail = n.resourceId;
window.location.href = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceIdDetail;
}
});
},
null
);
}
else{
avwScreenMove(ScreenIds.ContentView);
}
};
//Start Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
/* get url */
function getURL(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiResourceDlUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
function ShowContentNotPDF(contentTitle, contentDetail, contentThumbnail, deliveryDate) {
$("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString());
$("#txtContentDetail").text(contentDetail);
$("#txtContentTitle").text(contentTitle);
var tempContentType = ClientData.contentInfo_contentType();
if(contentThumbnail == '' || contentThumbnail == null || contentThumbnail == 'undefined'){
if(!isPdfContent(tempContentType)){
if(tempContentType == ContentTypeKeys.Type_Image){
contentThumbnail = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(tempContentType == ContentTypeKeys.Type_Music){
contentThumbnail = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(tempContentType == ContentTypeKeys.Type_Video){
contentThumbnail = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(tempContentType == ContentTypeKeys.Type_NoFile){
contentThumbnail = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(tempContentType == ContentTypeKeys.Type_Others){
contentThumbnail = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(tempContentType == ContentTypeKeys.Type_Html){
contentThumbnail = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
contentThumbnail = contentThumbnail;
}
var imgTemp = new Image();
$("#imgContentThumbnail").attr("src", contentThumbnail);
imgTemp.onload = function () {
//resize Image
if (imgTemp.width > imgTemp.height) {
$("#imgContentThumbnail").attr('height', '');
$("#imgContentThumbnail").removeAttr('height');
$("#imgContentThumbnail").attr('width', '120');
var realHeight = (120 * imgTemp.height) / imgTemp.width;
$("#imgContentThumbnail").css('padding-top', (145 - realHeight)/2 + "px");
}
else {
$("#imgContentThumbnail").attr('width', '');
$("#imgContentThumbnail").removeAttr('width');
$("#imgContentThumbnail").attr('height', '120');
$("#imgContentThumbnail").css('padding-top', "12px");
}
};
imgTemp.src = contentThumbnail;
};
//End Function : No.12 -- Editor : Viet Nguyen -- Date : 08/01/2013 -- Summary : Create new function to return content type of content.
// Show detail content
function ShowContent(contentID, contentTitle, contentDetail, contentThumbnail, deliveryDate, pages) {
$("#txtPubDt2_Dsp").text(deliveryDate.jpDateString() + " " + deliveryDate.jpShortTimeString());
......
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/common.js" />
/// <reference path="../common/js/i18n.js" />
/// <reference path="../common/js/jquery-1.8.1.min.js" />
/// <reference path="../common/js/jquery-ui-1.8.23.custom.min.js" />
/// <reference path="../common/js/jquery.toastmessage.js" />
var currentPagePushMessage = 1;
var isHoverOn = false;
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
// Set event to prevent leave
//avwSetLogoutNortice();
if(ClientData.requirePasswordChange() != 1 ) {
if (ClientData.requirePasswordChange() != 1) {
ToogleLogoutNortice();
}
......@@ -40,8 +41,15 @@ $(document).ready(function () {
//Go To update configuration
$('#dspSetting').click(updateConfigFunction);
// hide logout button with anonymous user
if (isAnonymousLogin()) {
$('#dspLogout').hide();
}
else {
//Go To Login Page
$('#dspLogout').click(logoutFunction);
$('#dspLogout').show();
}
$('#dspViewHistory').click(historyClickFunction);
......@@ -68,6 +76,10 @@ $(document).ready(function () {
$('#searchbox-body-header').click(headerSearchBodyClickFunction);
//init push message
initPushMessage();
//$('*').click(handleHeaderSearchBoxEvent);
if (isTouchDevice() == false) {
......@@ -83,7 +95,6 @@ $(document).ready(function () {
else {
$('body').click(bodyClickFunction);
}
});
function searchBoxHoverFunction(){
......@@ -94,6 +105,26 @@ function searchBoxHoverOffFunction() {
isHoverOn = false;
};
// check disabled button
function checkDisabledButton(selector, buttonid) {
$(selector).click(
function () {
setDisabledButton(selector, buttonid);
});
setDisabledButton(selector, buttonid);
};
function setDisabledButton(selector, buttonid) {
var isDisabled = $(selector + ':checked').length == 0;
if (isDisabled) {
$(buttonid).addClass('disabled');
}
else {
$(buttonid).removeClass('disabled');
}
};
function bodyClickFunction(event) {
if (isTouchDevice()) {
......@@ -263,6 +294,49 @@ function updateConfigFunction(){
//Logout function
function logoutFunction() {
// check content is changed, update status option backup
if (ClientData.isChangedBookmark())
{
if (ClientData.userOpt_bkShioriFlag() == 0) {
$("#chkBkAllShiori").removeAttr('checked');
}
else {
$("#chkBkAllShiori").attr('checked', 'checked');
}
}
else {
$('#chkBkAllShiori').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedMemo()) {
if (ClientData.userOpt_bkMemoFlag() == 0) {
$("#chkBkAllMemo").removeAttr('checked');
}
else {
$("#chkBkAllMemo").attr('checked', 'checked');
}
}
else
{
$('#chkBkAllMemo').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedMarkingData())
{
if (ClientData.userOpt_bkMakingFlag() == 0) {
$("#chkBkAllMarking").removeAttr('checked');
}
else {
$("#chkBkAllMarking").attr('checked', 'checked');
}
}
else {
$('#chkBkAllMarking').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true) {
// In case: user_data_backup = "Y" -> backup
if (ClientData.serviceOpt_user_data_backup() == "Y") {
......@@ -272,6 +346,9 @@ function logoutFunction() {
lockLayout();
$('#dlgConfirmBackup1').show();
$('#dlgConfirmBackup1').center();
// check disabled button backup
checkDisabledButton('#dlgConfirmBackup1 .option_backup input', '#dlgConfirmBackup-backup');
}
else { // Do not show confirming dialog
if (ClientData.userOpt_logoutMode() == null || ClientData.userOpt_logoutMode() == undefined) {
......@@ -282,14 +359,18 @@ function logoutFunction() {
}
else {
if (ClientData.userOpt_logoutMode() == 0) { // Logout with backup
lockLayout();
DoBackup();
var isBackupMarking=ClientData.userOpt_bkMakingFlag() == 1;
var isBackupMemo=ClientData.userOpt_bkMemoFlag() == 1;
var isBackupBookmark = ClientData.userOpt_bkShioriFlag() == 1;
DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
}
else if (ClientData.userOpt_logoutMode() == 1) { // Logout without backup
// Do nothing
//Logout
webLogoutEvent();
}
// Logout
//webLogoutEvent();
}
}
}
......@@ -346,85 +427,260 @@ function confirmWithoutBackupFunction(e) {
//Logout With Backup function
function confirmWithBackupFunction(e) {
e.preventDefault();
// check button is disabled
if ($(this).hasClass('disabled'))
return;
// update status flag update options No.17
var isBackupMarking=$("#chkBkAllMarking").attr('checked') == 'checked';
var isBackupMemo = $("#chkBkAllMemo").attr('checked') == 'checked';
var isBackupBookmark = $("#chkBkAllShiori").attr('checked') == 'checked';
var remember = $('#chkRememberBackup').attr('checked');
unlockLayout();
$('#dlgConfirmBackup1').css('z-index', '99');
lockLayout();
if(remember == 'checked'){
if (remember == 'checked') {
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
DoBackup();
// update status backup in setting
ClientData.userOpt_bkMakingFlag(isBackupMarking);
ClientData.userOpt_bkMemoFlag(isBackupMemo);
ClientData.userOpt_bkShioriFlag(isBackupBookmark);
DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
}
else{
ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
DoBackup();
DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, true);
}
ClientData.userOpt_logoutMode(0); // In next time, if choose: [do not show dialog], will backup and logout
//webLogoutEvent();
};
//Confirm Back Up Ok
function DoBackup() {
function DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark,isLogout,funcCallback) {
// ----------------------------
// Process backup here
// ----------------------------
// Bakup memo/marking/bookmark
var params = [
{ name: 'sid', content: ClientData.userInfo_sid() },
{ name: 'deviceType', content: '4' },
{ name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
];
avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
function (data) {
if (JSON.parse(data).result == "success") {
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
//alert(i18nText('msgBackupSuccess'));
//Bakup memo/marking/bookmark
// var params = [
// { name: 'sid', content: ClientData.userInfo_sid() },
// { name: 'deviceType', content: '4' },
// { name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
// ];
// avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
// function (data) {
// if (JSON.parse(data).result == "success") {
// ClientData.isChangedBookmark(false);
// ClientData.isChangedMarkingData(false);
// ClientData.isChangedMemo(false);
// //alert(i18nText('msgBackupSuccess'));
//
// // Show message: msgBackupSuccess
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'success',
// sticky: true,
// text: i18nText('msgBackupSuccess'),
// });
// $('.toast-position-middle-center').css('width', '500px');
// $('.toast-position-middle-center').css('margin-left', '-250px');
// $('.toast-item-close').live('click', webLogoutEvent);
// }
// else {
// //alert(i18nText('msgBackupFailed'));
// // Show error message: msgBackupFailed
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgBackupFailed')
// });
// $('.toast-position-middle-center').css('width', '500px');
// $('.toast-position-middle-center').css('margin-left', '-250px');
// $('.toast-item-close').live('click', webLogoutEvent);
// }
// },
// function (a, b, c) {
// //alert(i18nText('msgBackupFailed'));
// // Show error message: msgBackupFailed
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgBackupFailed')
// });
// $('.toast-position-middle-center').css('width', '500px');
// $('.toast-position-middle-center').css('margin-left', '-250px');
// $('.toast-item-close').live('click', webLogoutEvent);
// });
// Backup for No.17
// if (!isBackupMarking && !isBackupMemo && !isBackupBookmark)
// return;
// check if data is changed and has option backup
if ((ClientData.isChangedBookmark() == true && isBackupBookmark) || (ClientData.isChangedMarkingData() == true && isBackupMarking) || (ClientData.isChangedMemo() == true && isBackupMemo)) {
if (isLogout) {
lockLayout();
}
// Show message: msgBackupSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
type: '',
sticky: true,
text: i18nText('msgBackupSuccess'),
text: '',
customMessages: 'divResultMessage'
});
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
// show item loading
$('#divResultMessage').append("<div class='toast-item-loading'></div>");
setTimeout(function () {
// backup Marking
var isBackupMarkingOK = true;
var isBackupMemoOK = true;
var isBackupBookmarkOK = true;
if (isBackupMarking && ClientData.isChangedMarkingData() == true) {
isBackupMarkingOK = sendSignalBackupStart(2); // start backup type marking
if (isBackupMarkingOK) {
isBackupMarkingOK = backupFile(JSON.stringify({ "type": 2, "data": ClientData.MarkingData() }), 'Marking.json', 2);
if (isBackupMarkingOK) {
ClientData.isChangedMarkingData(false);
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkMarking') + " " + i18nText('msgBackupSuccess') + "</div>");
}
else {
//alert(i18nText('msgBackupFailed'));
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
// finish backup marking if start backup marking success
sendSignalBackupFinish(2);
}
if (!isBackupMarkingOK) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkMarking') + " " + i18nText('msgBackupFailed') + "</div>");
}
}
// Backup bookmark
if (isBackupBookmark && ClientData.isChangedBookmark() == true) {
isBackupBookmarkOK = sendSignalBackupStart(4); // start backup type bookmark
if (isBackupBookmarkOK) {
isBackupBookmarkOK = backupFile(JSON.stringify({ "type": 3, "data": ClientData.BookMarkData() }), 'Bookmark.json', 4);
if (isBackupBookmarkOK) {
ClientData.isChangedBookmark(false);
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkShiori') + " " + i18nText('msgBackupSuccess') + "</div>");
}
// finish backup bookmark if start backup bookmark ok
sendSignalBackupFinish(4);
}
if (!isBackupBookmarkOK) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkShiori') + " " + i18nText('msgBackupFailed') + "</div>");
}
}
// Backup Memo
if (isBackupMemo && ClientData.isChangedMemo() == true) {
isBackupMemoOK = sendSignalBackupStart(1); // start backup type memo
if (isBackupMemoOK) {
isBackupMemoOK = backupFile(JSON.stringify({ "type": 1, "data": ClientData.MemoData() }), 'ContentMemo.json', 1);
if (isBackupMemoOK) {
ClientData.isChangedMemo(false);
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkMemo') + " " + i18nText('msgBackupSuccess') + "</div>");
}
// finish backup memo if start backup memo ok
sendSignalBackupFinish(1);
}
if (!isBackupMemoOK) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkMemo') + " " + i18nText('msgBackupFailed') + "</div>");
}
}
// hide item loading
$('#divResultMessage .toast-item-loading').hide();
// active close toast button
$('.toast-item-close').click(function () { $().toastmessage('removeToast', $('#divResultMessage'), null) });
if (isLogout) {
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
}
// check call back function
if (funcCallback) {
funcCallback();
}
}, 1000);
}
else
{
if (isLogout) {
webLogoutEvent();
}
}
};
function backupFile(data, file,type) {
var result = false;
var params = [
{ name: 'sid', content: ClientData.userInfo_sid() },
//{ name: 'deviceType', content: '4' },
//{name: 'fileType', content: type },
{ name: 'formFile', content: data, fileName: file, contentType: 'text-plain' }
];
avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false,
function (data)
{
if (JSON.parse(data).result == "success")
{
result = true;
}
}, function (a, b, c) { });
return result;
};
// send signal backup start
function sendSignalBackupStart(typeBackup)
{
var result = false;
var params = { "sid": ClientData.userInfo_sid(), "fileType": typeBackup };
avwCmsApiSync(ClientData.userInfo_accountPath(), "notifyBackupStart", "post", params,
function (data) {
if (data.result == "success") {
result = true;
}
},
function (a, b, c) {
//alert(i18nText('msgBackupFailed'));
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
$('.toast-position-middle-center').css('width', '500px');
$('.toast-position-middle-center').css('margin-left', '-250px');
$('.toast-item-close').live('click', webLogoutEvent);
});
function (xhr, b, c) { });
return result;
};
// send signal backup finish
function sendSignalBackupFinish(typeBackup)
{
var result = false;
var params = { "sid": ClientData.userInfo_sid(), "fileType": typeBackup };
avwCmsApiSync(ClientData.userInfo_accountPath(), "notifyBackupFinish", "post", params,
function (data) {
if (data.result == "success") {
result = true;
}
},
function (xhr, b, c) { });
return result;
};
/* ------ */
function checkForceChangePassword(){
if(ClientData.BookmarkScreen() != ScreenIds.Setting){
......@@ -467,3 +723,168 @@ function showErrorScreenForceChangePassword(){
avwScreenMove(ScreenIds.Setting);
});
};
/* region for Push message */
// init for push message
function initPushMessage()
{
$('#liPushMessage').click(
function () {
if ($(this).hasClass('show')) {
$(this).removeClass('show').addClass('hide');
$('#list-push-message').slideUp();
}
else {
$('.notification-pushmessage').hide(); // hide notification
$(this).removeClass('hide').addClass('show');
currentPagePushMessage = 1;
getPushMessageList();
}
}
);
$('#prev-page-message').click(function (e) {
previousPushMessageClick();
e.stopPropagation();
return false;
});
$('#next-page-message').click(function (e) {
nextPushMessageClick();
e.stopPropagation();
return false;
});
$('#list-push-message').click(
function (e) {
e.stopPropagation();
return false;
}
);
$('.notification-pushmessage').click(
function () {
$(this).slideUp();
}
);
// check new push message
getPushMessageNew();
};
// get time wait check new push message
function getTimeWaitCheckNewPushMessage()
{
return avwSysSetting().pushTimePeriod * 1000;// time unit is seconds
}
// get message new
function getPushMessageNew()
{
//$('.notification-pushmessage').hide();
var params = { "sid": ClientData.userInfo_sid()};
avwCmsApi(ClientData.userInfo_accountPath(), "webPushMessageNew", "post", params,
callbackGetPushMessageNewSuccess,
function (xhr, b, c) { });
};
// callback get number new message success
function callbackGetPushMessageNewSuccess(data) {
if (data) {
// get current number message in session
var currentMessage = parseInt(ClientData.pushInfo_newMsgNumber());
if (isNaN(currentMessage)) {
currentMessage = 0;
}
var totalMessage = currentMessage + data.count;
if ($('#liPushMessage').hasClass('hide')) {
// update new number message to session
ClientData.pushInfo_newMsgNumber(totalMessage);
// only show number new message when total messages greater than 0
if (totalMessage > 0) {
// show current number message
$('#numbermessage').html(totalMessage);
}
else $('#numbermessage').html('');
}
// show notification for new message
if (data.count > 0)
{
$('.notification-pushmessage').html(i18nText("msgPushAlert")).slideDown();
}
}
// continue check new push message
setTimeout(getPushMessageNew, getTimeWaitCheckNewPushMessage());
};
// get message
function getPushMessageList() {
var sysSettings = avwSysSetting();
var pushPageCount=sysSettings.pushPageCount;
var from = (currentPagePushMessage - 1) * pushPageCount + 1;
var to = currentPagePushMessage * pushPageCount;
var params = { "sid": ClientData.userInfo_sid(), "recordFrom": from, "recordTo": to };
avwCmsApiSync(ClientData.userInfo_accountPath(), "webPushMessageList", "post", params,
function (data) {
// reset number message
ClientData.pushInfo_newMsgNumber(0);
// hide number new message
$('#numbermessage').html('');
showListPushMessage(data);
$('#list-push-message').slideDown();
},
function (xhr, b, c) {
showSystemError();
});
};
// show push message list
function showListPushMessage(data)
{
$('#show-push-message').html('');
for (var i = 0; i < data.messageList.length && i <= (data.recordTo - data.recordFrom); i++) {
$('#show-push-message').append('<div>' + (data.recordFrom + i) + ") " + data.messageList[i].messageDetail + '</div>');
}
if (currentPagePushMessage > 1) {
$('#prev-page-message').show();
}
else {
$('#prev-page-message').hide();
}
if (data.recordTo < data.totalRecord) {
$('#next-page-message').show();
}
else {
$('#next-page-message').hide();
}
};
// load next page message
function nextPushMessageClick() {
currentPagePushMessage++;
getPushMessageList();
};
// load previous page message
function previousPushMessageClick() {
if (currentPagePushMessage > 1)
currentPagePushMessage--;
else currentPagePushMessage = 1;
getPushMessageList();
};
\ No newline at end of file
......@@ -30,7 +30,33 @@ var DEFAULT_IMG_CONTENT_EDIT = 'img/list/updatebook.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var iNumberOfNextRecord = 15;
var arrayTemp = [];
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
//Thumbnail array
var thumbnailArr = [];
//Content type array.
var contentTypeArr = [];
//Content's types
var ContentTypeKeys = {
Type_PDF : 'pdfFile',
Type_Image : 'imageFile',
Type_Video : 'movieFile',
Type_Music : 'soundFile',
Type_Others : 'otherFile',
Type_NoFile : 'noFile',
Type_Html: 'htmlFile'
};
var ThumbnailForOtherType = {
Thumbnail_ImageType : 'img/image_type.png',
Thumbnail_VideoType : 'img/iPad_video.png',
Thumbnail_MusicType : 'img/iPad_music.png',
Thumbnail_OthersType : 'img/NoFile_Type.jpg',
Thumbnail_NoFileType : 'img/other_file.jpg',
Thumbnail_HtmlType : 'img/htmltype.png'
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
......@@ -137,7 +163,6 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
//$.each(data.contentList, function (i, post) {
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
//renderViewDate
......@@ -170,33 +195,8 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
+ ' </div>'
+ ' </div>'
+ '</section>'
//);
//$('canvas.home_canvas').hide();
//$('img.home_canvas').show();
/*
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
//assign version to array
resourceVersionArr.push({ contentid: post.contentId, resourceversion: post.resourceVersion });
//assign meta version to array
metaVersionArr.push({ contentid: post.contentId, metaversion: post.metaVersion });
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentId);
$('#lblVdate' + post.contentId).html(viewdate);
addReadContentToArray(post.contentId, post.resourceVersion, post.metaVersion, post.contentThumbnail, post.contentTitle, returnContentTitleKana(post.contentId), post.contentDeliveryDate);
showContentThumbnail();
*/
}
//});
}
$('#content-grid').append(htmlTemp);
for (var i = 0; i < data.contentList.length; i++) {
......@@ -206,7 +206,17 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = formatStringBase64(formatThumbnail);
}
thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//assign content type to array
contentTypeArr.push({ contentId: post.contentId, contentType: post.contentType });
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
......@@ -237,10 +247,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
//Render Page number
reRenderPageNumber(totalPage, totalPage);
//changeLanguage(ClientData.userInfo_language());
}, null);
//i18nReplaceText();
};
//Handle language
......@@ -350,6 +357,11 @@ function canvasClickFunction(e){
var base64String = returnThumbnail(outputId);
ClientData.contentInfo_contentThumbnail(base64String);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType of content.
var contentType = returnContentType(outputId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType of content.
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
......@@ -641,13 +653,77 @@ function sortByViewDateFunction(){
//Get Thumnail base on contentid
function returnThumbnail(contentid){
for(var i = 0; i < arrayTemp.length; i++){
if(arrayTemp[i].contentId == contentid){
return arrayTemp[i].thumbnail;
for(var i = 0; i < thumbnailArr.length; i++){
if(thumbnailArr[i].contentId == contentid){
return thumbnailArr[i].thumbnail;
}
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Get content type base on contentid
function returnContentType(contentid){
//Array Length
var iArrCnt = contentTypeArr.length;
//Get contentType in array by contentId
for(var i = 0; i < iArrCnt; i++){
if (contentTypeArr[i].contentId == contentid) {
return contentTypeArr[i].contentType;
}
}
};
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
//Get resource Id of content
function downloadResourceById(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2',
};
var resourceUrl;
abapi('webGetContent', params, 'GET', function (data) {
var resourceId;
$.each(data.contentData , function(i, n){
if(typeof n == "object"){
resourceId = n.resourceId;
}
});
//Get resource
resourceUrl = getResourceByIdFromAPI(resourceId);
window.open(resourceUrl, "_self");
});
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId;
};
/* get url */
function getURL(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiResourceDlUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Dialog Read Button CLick
function readSubmenuFunction(e){
if (e) {
......@@ -669,6 +745,10 @@ function readSubmenuFunction(e){
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
//Start Function : No.12 -- Editor : Le Long -- Date : 08/01/2013 -- Summary : Store contentType to storage.
var contentType = returnContentType(contentId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 08/01/2013 -- Summary : Store contentType to storage.
var checkflag = false;
//Store Content id that user has read
......@@ -711,7 +791,20 @@ function readSubmenuFunction(e){
ClientData.ReadingContentIds(contentIdArray);
ClientData.IsRefresh(false);
//Start Function : No.12 -- Editor : Le Long -- Date : 08/02/2013 -- Summary : Check content type other for download.
//For testing without other Type.
//contentType = ContentTypeKeys.Type_Others;
if(contentType == ContentTypeKeys.Type_Others){
//Download content
downloadResourceById(contentId);
}
else{
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
//End Function : No.12 -- Editor : Le Long -- Date : 08/02/2013 -- Summary : Check content type other for download.
};
//Check if Content Has marking or memo
......@@ -770,6 +863,11 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
var contentThumbnail = returnThumbnail(contId);
var contentType = returnContentType(contId);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
if(readArr == null || readArr <= 0 || readArr == 'undefined'){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
......@@ -781,7 +879,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
else{
......@@ -793,7 +917,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
......@@ -807,7 +957,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
}
}
......@@ -829,7 +1005,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -851,7 +1053,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer){
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -1047,6 +1275,11 @@ function titleClickFunction(e){
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType of content.
var contentType = returnContentType(contentid);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType of content.
//Store Content id that user has read
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
......@@ -1389,9 +1622,8 @@ function renderContentAfterSort(contentSortArr){
var htmlTemp = "";
for(var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
//$.each(contentSortArr, function(i, post){
var outputDeliveryDate = formatDeliveryDate(post.deliverydate);
//$('#content-grid').append(
htmlTemp += '<section>'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
......@@ -1415,36 +1647,11 @@ function renderContentAfterSort(contentSortArr){
+ ' </div>'
+ ' </div>'
+ '</section>'
//);
;
/*
$('canvas.home_canvas').hide();
$('img.home_canvas').show();
var viewdate = renderViewDate(post.contentid);
reRenderPageNumber(totalPage, totalPage);
//Check if user has read this content or not.
checkUserHasReadContent(post.contentid, post.resourceversion, post.metaversion);
//Check if content has marking or memo
checkContentMarkingMemoOption(post.contentid);
$('#lblVdate' + post.contentid).html(viewdate);
//showContentThumbnail();
i18nReplaceText();
*/
//});
}
$('#content-grid').append(htmlTemp);
for (var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
//$('canvas.home_canvas').hide();
//$('img.home_canvas').show();
var viewdate = renderViewDate(post.contentid);
reRenderPageNumber(totalPage, totalPage);
......@@ -1458,7 +1665,6 @@ function renderContentAfterSort(contentSortArr){
showContentThumbnail();
//i18nReplaceText();
}
};
......
......@@ -31,7 +31,33 @@ var DEFAULT_IMG_CONTENT_NEW = 'img/list/newbook.png';
var home_realTotalRecord = 0;
var iNumberOfNextRecord = 15;
var arrayTemp = [];
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
//Thumbnail array
var thumbnailArr = [];
//Content type array.
var contentTypeArr = [];
//Content's types
var ContentTypeKeys = {
Type_PDF : 'pdfFile',
Type_Image : 'imageFile',
Type_Video : 'movieFile',
Type_Music : 'soundFile',
Type_Others : 'otherFile',
Type_NoFile : 'noFile',
Type_Html: 'htmlFile'
};
var ThumbnailForOtherType = {
Thumbnail_ImageType : 'img/image_type.png',
Thumbnail_VideoType : 'img/iPad_video.png',
Thumbnail_MusicType : 'img/iPad_music.png',
Thumbnail_OthersType : 'img/NoFile_Type.jpg',
Thumbnail_NoFileType : 'img/other_file.jpg',
Thumbnail_HtmlType : 'img/htmltype.png'
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new Array for function No.12.
var contentIdArray = [];
var resourceVersionArr = [];
var metaVersionArr = [];
......@@ -110,7 +136,6 @@ $(document).ready(function () {
$('.dialog').live('touchend', openSubMenuDialogFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Render Genre TreeView
$('#lnkbtnGenre').click(genreSelectFunction);
......@@ -327,6 +352,11 @@ function canvasClickFunction(e) {
// Get image of selected image
ClientData.contentInfo_contentId(outputId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
var contentType = returnContentType(outputId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
//Check Display mode to handle action
if (isShowBookShelf != null) {
......@@ -420,9 +450,19 @@ function canvasClickFunction(e) {
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : check for download content type other.
//contentType = ContentTypeKeys.Type_Others;
if(contentType == ContentTypeKeys.Type_Others){
//Download content
downloadResourceById(outputId);
}
else{
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : check for download content type other.
}
} else {
if (!isShowBookShelf) {
......@@ -514,9 +554,20 @@ function canvasClickFunction(e) {
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
//For testing without other Type.
//contentType = ContentTypeKeys.Type_Others;
if(contentType == ContentTypeKeys.Type_Others){
//Download content
downloadResourceById(outputId);
}
else{
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
}
}
};
......@@ -542,6 +593,11 @@ function openSubMenuDialogFunction(e) {
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
var contentType = returnContentType(contentid);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
//Store Content id that user has read
if (ClientData.ReadingContentIds().length > 0) {
contentIdArray = ClientData.ReadingContentIds();
......@@ -618,6 +674,11 @@ function openSubMenuDialogFunction(e) {
ClientData.contentInfo_contentThumbnail(base64String);
ClientData.contentInfo_contentId(contentid);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
var contentType = returnContentType(contentid);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
//Store Content id that user has read
if (ClientData.ReadingContentIds().length > 0) {
contentIdArray = ClientData.ReadingContentIds();
......@@ -1114,10 +1175,15 @@ function detailsSubmenuFunction(e) {
var contentId = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Set contentType of content to local storage for display details.
var contentType = returnContentType(contentId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Set contentType of content to local storage for display details.
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(base64String);
//Store Content id that user has read
if (ClientData.ReadingContentIds().length > 0) {
contentIdArray = ClientData.ReadingContentIds();
......@@ -1176,8 +1242,8 @@ function readSubmenuFunction(e) {
}
var contentId = $(this).attr('contentid');
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
......@@ -1187,6 +1253,11 @@ function readSubmenuFunction(e) {
ClientData.contentInfo_contentId(contentId);
ClientData.contentInfo_contentThumbnail(contentThumbnail);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
var contentType = returnContentType(contentId);
ClientData.contentInfo_contentType(contentType);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
var checkflag = false;
//Store Content id that user has read
......@@ -1233,7 +1304,20 @@ function readSubmenuFunction(e) {
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
//For testing without other Type.
//contentType = ContentTypeKeys.Type_Others;
if(contentType == ContentTypeKeys.Type_Others){
//Download content
downloadResourceById(contentId);
}
else{
//Go to Conten view page
avwScreenMove(ScreenIds.ContentView);
}
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Add ContentType to Storage.
};
//Item Mouse Enter Event
......@@ -1646,25 +1730,7 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
getNextRecordNumForList();
}
else {
alert('ok');
// $('#content-grid').append(
// '<section class="sectionhomebookshelf">'
// + ' <div class="cnt_section_bookshelf">'
// + ' <div class="img">'
// + ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
// + ' </canvas>'
// + ' </div>'
// + ' </div>'
// + ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
// + '</section>'
// );
// if (i == (eval(countCnt) + 2)) {
// $('#bookshelf' + post.contentId).addClass('no_m_right');
// countCnt = i;
// }
// getNextRecordNumForBookShelf();
}
} else {
......@@ -1721,30 +1787,22 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
getNextRecordNumForList();
}
else {
//alert('ok');
// $('#content-grid').append(
// '<section class="sectionhomebookshelf">'
// + ' <div class="cnt_section_bookshelf">'
// + ' <div class="img">'
// + ' <canvas height="170px" width="170px" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
// + ' </canvas>'
// + ' </div>'
// + ' </div>'
// + ' <a id="title' + post.contentId + '" class="dialog name lang" lang="lblTitle" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 20) + '</a>'
// + '</section>'
// );
// if (i == (eval(countCnt) + 2)) {
// $('#bookshelf' + post.contentId).addClass('no_m_right');
// countCnt = i;
// }
// getNextRecordNumForBookShelf();
}
}
//assign thumbnail to array
arrayTemp.push({ contentId: post.contentId, thumbnail: formatStringBase64(post.contentThumbnail) });
var formatThumbnail = post.contentThumbnail;
if((formatThumbnail != null) && (formatThumbnail != 'undefined') && (formatThumbnail != '')){
formatThumbnail = formatStringBase64(formatThumbnail);
}
thumbnailArr.push({ contentId: post.contentId, thumbnail: formatThumbnail});
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//assign content type to array
contentTypeArr.push({ contentId: post.contentId, contentType: post.contentType });
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Assign content type to array to manage.
//Check if user has read this content or not.
checkUserHasReadContent(post.contentId, post.resourceVersion, post.metaVersion);
......@@ -1776,8 +1834,6 @@ function renderContent(id, text, division, type, order, from, to, cateid, grpid)
}
}
if (data.totalRecord < data.recordTo) {
ClientData.searchCond_recordTo(data.totalRecord);
} else {
......@@ -1854,13 +1910,83 @@ function renderGridView() {
//Get Thumnail base on contentid
function returnThumbnail(contentid) {
var iArrCnt = thumbnailArr.length;
for (var i = 0; i < iArrCnt; i++) {
if (thumbnailArr[i].contentId == contentid) {
return thumbnailArr[i].thumbnail;
}
}
};
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Get content type base on contentid
function returnContentType(contentid){
//Array Length
var iArrCnt = contentTypeArr.length;
//Get contentType in array by contentId
for(var i = 0; i < iArrCnt; i++){
if (contentTypeArr[i].contentId == contentid) {
return contentTypeArr[i].contentType;
}
}
};
for (var i = 0; i < arrayTemp.length; i++) {
if (arrayTemp[i].contentId == contentid) {
return arrayTemp[i].thumbnail;
//Check content type is pdf content
function isPdfContent(contentType){
if(!(contentType == ContentTypeKeys.Type_PDF)){
return false;
}
else{
return true;
}
};
//Get resource Id of content
function downloadResourceById(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2',
};
var resourceUrl;
abapi('webGetContent', params, 'GET', function (data) {
var resourceId;
$.each(data.contentData , function(i, n){
if(typeof n == "object"){
resourceId = n.resourceId;
}
});
//Get resource
resourceUrl = getResourceByIdFromAPI(resourceId);
window.open(resourceUrl, "_blank");
});
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
};
/* get url */
function getURL(apiName) {
var sysSettings = avwSysSetting();
var url = sysSettings.apiResourceDlUrl;
url = format(url, ClientData.userInfo_accountPath()) + '/' + apiName;
return url;
};
function createIframeForDownload(url){
};
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Create new function to return content type of content.
//Check if Content Has marking or memo
function checkContentMarkingMemoOption(contentId) {
......@@ -1921,6 +2047,12 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
var metaArr = ClientData.MetaVersion();
var readArr = ClientData.ReadingContentIds();
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
var contentThumbnail = returnThumbnail(contId);
var contentType = returnContentType(contId);
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Declare variable handle contentType and Thumbnail of content.
if (readArr == null || readArr <= 0 || readArr == 'undefined') {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
......@@ -1934,8 +2066,33 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
else {
//Check if user has read this content or not
......@@ -1948,7 +2105,34 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
readFlg = true;
break;
}
......@@ -1964,7 +2148,34 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
}
}
}
......@@ -1989,7 +2200,34 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -2013,7 +2251,34 @@ function checkUserHasReadContent(contId, resourceVer, metaVer) {
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
imgThumb.src = returnThumbnail(contId);
//Start Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
if(contentThumbnail == '' || contentThumbnail == null){
if(!isPdfContent(contentType)){
if(contentType == ContentTypeKeys.Type_Image){
imgThumb.src = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgThumb.src = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgThumb.src = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgThumb.src = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgThumb.src = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgThumb.src = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
}else{
imgThumb.src = contentThumbnail;
}
//End Function : No.12 -- Editor : Le Long -- Date : 07/31/2013 -- Summary : Check contentType to set thumbnail.
break;
}
}
......@@ -2655,3 +2920,5 @@ function removeHoverCss() {
$('#control-sort-releasedate').removeClass('nottouchdevice');
}
};
......@@ -26,6 +26,9 @@ var marking;
var force_login_periodically;
var login_errorMessage = "";
var timeWaitSplashScreen = 2000;// wait splash screen 2 second
//Load login Info
function loadLoginInfo() {
......@@ -221,6 +224,7 @@ function processLogin() {
userinfo_sid = data.sid;
userInfo_userName = data.userName;
optionList = data.serviceOptionList;
getServiceOptionList();
if (data.result == 'success') {
......@@ -228,6 +232,9 @@ function processLogin() {
// Save retrieved info
saveLoginInfo();
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0);
$('#main-error-message').css('display', 'none');
if (data.requirePasswordChange == 0) {
......@@ -413,7 +420,7 @@ function changeLanguageEn(){
};
//Login click function
function loginFunction(){
function loginFunction() {
if (checkValidation()) {
processLogin();
}
......@@ -455,23 +462,31 @@ function CloseChangePasswordDialog(){
//Save Service Option
function saveServiceUserOption(){
$.each(optionList, function(i, option){
$.each(optionList, function (i, option) {
if(option.serviceName == 'force_pw_change_periodically'){
if (option.serviceName == 'force_pw_change_periodically') {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
}
else if(option.serviceName == 'force_pw_change_on_login'){
else if (option.serviceName == 'force_pw_change_on_login') {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
}
else if(option.serviceName == 'force_login_periodically'){
ClientData.serviceOpt_force_login_periodically(option.value);
}
else if(option.serviceName == 'marking'){
// No.8: do not use serviceOpt_force_login_periodically
// else if (option.serviceName == 'force_login_periodically') {
// ClientData.serviceOpt_force_login_periodically(option.value);
// }
else if (option.serviceName == 'marking') {
ClientData.serviceOpt_marking(option.value);
}
else if(option.serviceName == 'user_data_backup'){
else if (option.serviceName == 'user_data_backup') {
ClientData.serviceOpt_user_data_backup(option.value);
}
else if (option.serviceName == 'web_screen_lock') {
ClientData.serviceOpt_web_screen_lock(option.value);
}
else if (option.serviceName == 'web_screen_lock_wait') {
ClientData.serviceOpt_web_screen_lock_wait(option.value);
}
});
};
......@@ -512,6 +527,23 @@ function loginWhenClickEnter(e){
$(document).ready(function (e) {
setTimeout(function () {
if (isAnonymousLogin()) {
initLoginAnonymousUser();
}
else {
$('#splashscreen').fadeOut(timeWaitSplashScreen, 'swing', function ()
{
$('#login-screen').fadeIn(1000, 'swing');
});
initLoginNormalUser();
}
}, timeWaitSplashScreen);
});
// init login for normal user
function initLoginNormalUser() {
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//Initial Screen
......@@ -530,5 +562,63 @@ $(document).ready(function (e) {
$('#btnSkip').click(skipPassFunction);
$('#txtPassword').keydown(loginWhenClickEnter);
};
});
// init login for anonymous user
function initLoginAnonymousUser() {
var sysSettings = avwSysSetting(); // get info in conf.json
var params = {
previousSid: null,
loginId: sysSettings.anonymousLoginId,
urlpath: sysSettings.anonymousLoginPath
};
avwCmsApiWithUrl(sysSettings.apiLoginUrl, null, 'webClientAnonymousLogin', 'post', params, function (data) {
if (data.result == 'success') {
//clear session of old anonymous user
SessionStorageUtils.clear();
avwUserSessionObj = null;
// create new session for anonymous user
avwCreateUserSession();
// set info user anonymous login
ClientData.userInfo_accountPath(sysSettings.anonymousLoginPath);
ClientData.userInfo_accountPath_session(sysSettings.anonymousLoginPath);
ClientData.userInfo_loginId(sysSettings.anonymousLoginId);
ClientData.userInfo_loginId_session(sysSettings.anonymousLoginId);
ClientData.userInfo_userName(data.userName);
ClientData.userInfo_sid(data.sid);
ClientData.userInfo_sid_local(data.sid);
// clear all local storage data of old anonymous
LocalStorageUtils.clear();
// hide splash screen then move to home page
$('#splashscreen').fadeOut('slow', 'swing', function () {
avwScreenMove("abvw/" + ScreenIds.Home);
});
}
else {
showMessageErrorLoginAnonymous();
}
}, function (xhr, statusText, errorThrown) {
showMessageErrorLoginAnonymous();
});
};
function showMessageErrorLoginAnonymous() {
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text:i18nText('msgAnonymousLoginErr')
});
$('.toast-position-middle-center').css('width', '400px');
};
......@@ -54,6 +54,9 @@ $(document).ready(function () {
|| ClientData.isChangedMarkingData() == true
|| ClientData.isChangedMemo() == true) {
$("#dspOptBk").show();
// check disabled button backup
checkDisabledButton('#dlgConfirmBackup .option_backup input', '#dspOptBk_OK');
}
else {
$("#dspOptBk").hide();
......@@ -75,16 +78,54 @@ $(document).ready(function () {
$("#chkOptBkCfm").css('visibility', 'hidden');
$("#txtOptBkCfm").css('visibility', 'hidden');
$("#txtBkResCap").css('visibility', 'hidden');
$('#regionOptionBackup').css('visibility', 'hidden');
}
else {
if (IsExistBackupFile() == false) {
$("#dspOptRes").css('visibility', 'hidden');
// if (IsExistBackupFile() == false) {
// $("#dspOptRes").css('visibility', 'hidden');
// }
// else {
// $("#dspOptRes").css('visibility', '');
// }
// check show restore button No.17
var isExistMarking = IsExistBackupFile('Marking.json', 2);
var isExistContentMemo = IsExistBackupFile('ContentMemo.json', 1);
var isExistBookmark = IsExistBackupFile('Bookmark.json', 4);
if (isExistMarking || isExistContentMemo || isExistBookmark) {
$("#dspOptRes").css('visibility', '');
if (!isExistMarking) {
$('#chkopResMarking').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$("#dspOptRes").css('visibility', '');
$('#chkopResMarking').removeAttr('disabled');
}
if (!isExistContentMemo) {
$('#chkopResMemo').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopResMemo').removeAttr('disabled');
}
if (!isExistBookmark) {
$('#chkopResShiori').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopResShiori').removeAttr('disabled');
}
// check disabled button restore
checkDisabledButton('#dlgConfirmRestore .option_backup input', '#dspOptRes_OK');
}
else {
$("#dspOptRes").css('visibility', 'hidden');
}
}
});
/*
......@@ -97,9 +138,34 @@ function changeLanguageCallBackFunction() {
/*
Check backup file exists or not
*/
function IsExistBackupFile() {
//function IsExistBackupFile() {
// var isExisted = false;
// var params = { sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" };
// // Get list of files
// avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post", params,
// function (data) {
// if (data) {
// isExisted = true;
// }
// },
// function (xhr, b, c) {
// if (xhr.status != 0) {
// isExisted = false;
// }
// else {
// showSystemError();
// }
// });
// return isExisted;
//};
/*
Check backup file exists or not for No.17
*/
function IsExistBackupFile(file,type) {
var isExisted = false;
var params = { sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" };
var params = { "sid": ClientData.userInfo_sid(), "filename": file, fileType: type }; //, deviceType: '4'
// Get list of files
avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post", params,
function (data) {
......@@ -154,8 +220,6 @@ function avwCmsApi_requirePasswordChange_success(data) {
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else if (ClientData.serviceOpt_force_pw_change_on_login() == 2) { // Force to change password
ClientData.requirePasswordChange(1);
......@@ -230,56 +294,115 @@ Event groups [start]
// OK for backup
function dspOptBk_OK_Click(e) {
e.preventDefault();
// check button is disabled
if ($(this).hasClass('disabled'))
return;
// ----------------------------
// Process backup here
// ----------------------------
// Bakup memo/marking/bookmark
var params = [
{ name: 'sid', content: ClientData.userInfo_sid() },
{ name: 'deviceType', content: '4' },
{ name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
];
avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false, avwCmsApi_uploadBackupFile_success,
function (a, b, c) {
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
});
// var params = [
// { name: 'sid', content: ClientData.userInfo_sid() },
// { name: 'deviceType', content: '4' },
// { name: 'formFile', content: JSON.stringify(buildBackupData()), fileName: 'webBackupData.json', contentType: 'text-plain' }
// ];
// avwUploadBackupFile(ClientData.userInfo_accountPath(), params, false, avwCmsApi_uploadBackupFile_success,
// function (a, b, c) {
// // Show error message: msgBackupFailed
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgBackupFailed')
// });
// });
// backup data for No.17
var isBackupMarking = $('#chkopBkMarking').attr('checked') == 'checked';
var isBackupMemo = $('#chkopBkMemo').attr('checked') == 'checked';
var isBackupBookmark = $('#chkopBkShiori').attr('checked') == 'checked';
if (!isBackupMarking && !isBackupMemo && !isBackupBookmark)
{
closeBackup();
};
return;
}
function avwCmsApi_uploadBackupFile_success(data) {
if (JSON.parse(data).result == "success") {
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
$("#dspOptBk").hide();
$("#dspOptRes").css('visibility', '');
// call backup file at header
DoBackup(isBackupMarking, isBackupMemo, isBackupBookmark, false,
function () {
// Check to hide/show backup button
setStatusButtonBackup();
// update check box restore
if (isBackupMarking && !ClientData.isChangedMarkingData()) {
$('#chkopResMarking').removeAttr('disabled');
}
if (isBackupMemo && !ClientData.isChangedMemo()) {
$('#chkopResMemo').removeAttr('disabled');
}
if (isBackupBookmark && !ClientData.isChangedBookmark()) {
$('#chkopResShiori').removeAttr('disabled');
}
closeBackup();
// Show message: msgBackupSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgBackupSuccess')
});
};
// set status button backup and checkbox option
function setStatusButtonBackup() {
if (ClientData.isChangedBookmark() == true || ClientData.isChangedMarkingData() == true || ClientData.isChangedMemo() == true) {
if (ClientData.isChangedBookmark() != true) {
$('#chkopBkShiori').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedMarkingData() != true) {
$('#chkopBkMarking').attr('disabled', 'disabled').removeAttr('checked');
}
if (ClientData.isChangedMemo() != true) {
$('#chkopBkMemo').attr('disabled', 'disabled').removeAttr('checked');
}
$("#dspOptBk").show();
}
else {
// Show error message: msgBackupFailed
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: i18nText('msgBackupFailed')
});
$("#dspOptBk").hide();
}
};
//function avwCmsApi_uploadBackupFile_success(data) {
// if (JSON.parse(data).result == "success") {
// ClientData.isChangedBookmark(false);
// ClientData.isChangedMarkingData(false);
// ClientData.isChangedMemo(false);
// $("#dspOptBk").hide();
// $("#dspOptRes").css('visibility', '');
// // Show message: msgBackupSuccess
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'success',
// sticky: true,
// text: i18nText('msgBackupSuccess')
// });
// }
// else {
// // Show error message: msgBackupFailed
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgBackupFailed')
// });
// }
//};
// Cancel for backup
function dspOptBk_Cancel_Click(e) {
e.preventDefault();
......@@ -293,45 +416,185 @@ function dspOptRes_OK_Click(e) {
// Process restore
// ----------------------------
// check button is disabled
if ($(this).hasClass('disabled'))
return;
// Get list of files
avwCmsApi(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" },
avwCmsApi_getBackupFile_success,
function (xhr, b, c) {
if (xhr.status != 0) {
// Show error message
// avwCmsApi(ClientData.userInfo_accountPath(), "getBackupFile", "post",
// { sid: ClientData.userInfo_sid(), deviceType: '4', filename: "webBackupData.json" },
// avwCmsApi_getBackupFile_success,
// function (xhr, b, c) {
// if (xhr.status != 0) {
// // Show error message
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgRestoreFailed')
// });
// }
// else {
// showSystemError();
// }
// }
// );
// Restore data for No.17
var isRestoreMarking = $('#chkopResMarking').attr('checked') == 'checked';
var isRestoreMemo = $('#chkopResMemo').attr('checked') == 'checked';
var isRestoreBookmark = $('#chkopResShiori').attr('checked') == 'checked';
if (!isRestoreMarking && !isRestoreMemo && !isRestoreBookmark) {
closeRestore();
return;
}
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
type: '',
sticky: true,
text: i18nText('msgRestoreFailed')
text: '',
customMessages: 'divResultMessage'
});
$('#divResultMessage').append("<div class='toast-item-loading'></div>"); // show item loading
setTimeout(function () {
if (isRestoreMarking) {
// restore Marking Data
var res = restoreMarkingData();
if (!res) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkMarking') + " " + i18nText('msgRestoreFailed') + "</div>");
}
else {
showSystemError();
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkMarking') + " " + i18nText('msgRestoreSuccess') + "</div>");
}
}
);
if (isRestoreMemo) {
// restore Memo data
var res = restoreMemoData();
if (!res) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkMemo') + " " + i18nText('msgRestoreFailed') + "</div>");
}
else {
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkMemo') + " " + i18nText('msgRestoreSuccess') + "</div>");
}
}
if (isRestoreBookmark) {
// restore Bookmark data
var res = restoreBookmarkData();
if (!res) {
$('#divResultMessage').append("<div class='toast-item-image-error toast-item-message'>" + i18nText('txtBkShiori') + " " + i18nText('msgRestoreFailed') + "</div>");
}
else {
$('#divResultMessage').append("<div class='toast-item-image-success toast-item-message'>" + i18nText('txtBkShiori') + " " + i18nText('msgRestoreSuccess') + "</div>");
}
}
// set status button backup
//setStatusButtonBackup();
// show message result restore
// hide item loading
$('#divResultMessage .toast-item-loading').hide();
// active close toast button
$('.toast-item-close').click(function () { $().toastmessage('removeToast', $('#divResultMessage'), null) });
}, 1000);
closeRestore();
};
function avwCmsApi_getBackupFile_success(data) {
//function avwCmsApi_getBackupFile_success(data) {
// if (data) {
// restoreData(data);
// ClientData.isChangedBookmark(false);
// ClientData.isChangedMarkingData(false);
// ClientData.isChangedMemo(false);
// $("#dspOptBk").hide();
// // Show message: msgRestoreSuccess
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'success',
// sticky: true,
// text: i18nText('msgRestoreSuccess')
// });
// }
//};
// Restore data for No.17
/*
* Call api to restore bookmark data
*/
function restoreBookmarkData()
{
var result = false;
avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), filename: "Bookmark.json" }, // deviceType: '4',
function (data) {
if (data) {
restoreData(data);
getDataBookmark(data);
ClientData.isChangedBookmark(false);
ClientData.isChangedMarkingData(false);
ClientData.isChangedMemo(false);
$("#dspOptBk").hide();
// Show message: msgRestoreSuccess
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgRestoreSuccess')
});
result = true;
}
}
,
function (xhr, b, c) {
}
);
return result;
};
/*
* Call api to restore memo data
*/
function restoreMemoData() {
var result = false;
avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), filename: "ContentMemo.json" }, //deviceType: '4',
function (data) {
if (data) {
getDataMemo(data);
//ClientData.isChangedMemo(true);
result = true;
}
}
,
function (xhr, b, c) {
}
);
return result;
};
/*
* Call api to restore marking data
*/
function restoreMarkingData()
{
var result = false;
avwCmsApiSync(ClientData.userInfo_accountPath(), "getBackupFile", "post",
{ sid: ClientData.userInfo_sid(), filename: "Marking.json" }, // deviceType: '4',
function (data) {
if (data) {
getDataMarking(data);
ClientData.isChangedMarkingData(false);
result = true;
}
}
,
function (xhr, b, c) {
}
);
return result;
}
// Cancel for restore
function dspOptRes_Cancel_Click(e) {
e.preventDefault();
......@@ -390,6 +653,29 @@ function dspSave_Click(e) {
ClientData.userOpt_bkConfirmFlg(0);
}
// save options backup No.17
if ($("#chkBkMarking").attr('checked') == 'checked') {
ClientData.userOpt_bkMakingFlag(1);
}
else {
ClientData.userOpt_bkMakingFlag(0);
}
if ($("#chkBkMemo").attr('checked') == 'checked') {
ClientData.userOpt_bkMemoFlag(1);
}
else {
ClientData.userOpt_bkMemoFlag(0);
}
if ($("#chkBkShiori").attr('checked') == 'checked') {
ClientData.userOpt_bkShioriFlag(1);
}
else {
ClientData.userOpt_bkShioriFlag(0);
}
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
......@@ -457,11 +743,69 @@ function dspOptReset_Click(e) {
$("#chkOpt005").attr('checked', 'checked');
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
$("#chkOptBkCfm").attr('checked', 'checked');
// set default backup marking
$('#chkBkMarking').attr('checked', 'checked');
// set default backup memo
$('#chkBkMemo').attr('checked', 'checked');
// set default backup bookmark
$('#chkBkShiori').attr('checked', 'checked');
};
// Backup
function dspOptBk_Click(e) {
e.preventDefault();
// set options backup No.17
if (ClientData.userOpt_bkMakingFlag() == 0)
{
$("#chkopBkMarking").removeAttr('checked');
}
else
{
$("#chkopBkMarking").attr('checked', 'checked');
}
if (ClientData.userOpt_bkMemoFlag() == 0) {
$("#chkopBkMemo").removeAttr('checked');
}
else {
$("#chkopBkMemo").attr('checked', 'checked');
}
if (ClientData.userOpt_bkShioriFlag() == 0) {
$("#chkopBkShiori").removeAttr('checked');
}
else {
$("#chkopBkShiori").attr('checked', 'checked');
}
// check content is changed
if (!ClientData.isChangedBookmark())
{
$('#chkopBkShiori').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopBkShiori').removeAttr('disabled');
}
if (!ClientData.isChangedMemo()) {
$('#chkopBkMemo').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopBkMemo').removeAttr('disabled');
}
if (!ClientData.isChangedMarkingData()) {
$('#chkopBkMarking').attr('disabled', 'disabled').removeAttr('checked');
}
else {
$('#chkopBkMarking').removeAttr('disabled');
}
setDisabledButton('#dlgConfirmBackup .option_backup input', '#dspOptBk_OK');
openBackup();
};
......@@ -631,9 +975,6 @@ Event groups [ end ]
----------------------------------------------------------------------------
*/
// Setting dialog
$(function () {
$('#dlgChangePassword').center();
......@@ -698,6 +1039,8 @@ function openRestore() {
//$("#dlgConfirmRestore").dialog("open");
//$(".ui-dialog-titlebar").hide();
// check avaliable restore no.17
lockLayout();
$("#dlgConfirmRestore").show();
$("#dlgConfirmRestore").center();
......@@ -776,4 +1119,27 @@ function InitScreen() {
else {
$("#chkOptBkCfm").attr('checked', 'checked');
}
// options backup No.17
if (ClientData.userOpt_bkMakingFlag() == 0) {
$("#chkBkMarking").removeAttr('checked');
}
else {
$("#chkBkMarking").attr('checked', 'checked');
}
if (ClientData.userOpt_bkMemoFlag() == 0) {
$("#chkBkMemo").removeAttr('checked');
}
else {
$("#chkBkMemo").attr('checked', 'checked');
}
if (ClientData.userOpt_bkShioriFlag() == 0) {
$("#chkBkShiori").removeAttr('checked');
}
else {
$("#chkBkShiori").attr('checked', 'checked');
}
};
......@@ -21,6 +21,7 @@
<link href="./common/css/default.css" rel="stylesheet" type="text/css" />
<link href="./common/css/screenLock.css" rel="stylesheet" type="text/css" />
<script src="./common/js/jquery-1.8.1.min.js"></script>
<script src="./common/js/jquery-ui-1.8.23.custom.min.js"></script>
<script src="./common/js/jquery.toastmessage.js"></script>
......@@ -31,6 +32,8 @@
<script src="js/header.js" type="text/javascript"></script>
<script src="js/settings.js" type="text/javascript"></script>
<!--[if gte IE 9]>
<style type="text/css">
.gradient {
......@@ -41,11 +44,22 @@
</head>
<body id="user_change">
<header>
<div class="notification-pushmessage" style="display:none;">
新着メッセージがあります!!!
</div>
<div class="cnt_header">
<a class="logo" href="javascript:void(0);" onclick="avwScreenMove(ScreenIds.Home)"> </a>
<div class="menu_language">
<ul>
<li><label class="lang" lang="txtLoginUser">こんにちは</label><label id="login-username"> </label></li>
<li class="pushmessage hide" id="liPushMessage"><label class="lang" lang="txtPushAlert">新着 : </label><label id="numbermessage"></label><span></span>
<div id="list-push-message">
<div id="show-push-message"></div>
<p><a id='prev-page-message' style="display:none;" class="lang" lang="txtPrevious"><前</a><a id='next-page-message' style="display:none;" class="lang" lang="txtNext">次k></a></p>
</div>
</li>
<li class="jp" id="language-jp"><a href="#">日本語</a></li>
<li class="eng" id="language-en"><a href="#">English</a></li>
<li class="kor" id="language-kr"><a href="#">한글</a></li>
......@@ -59,7 +73,7 @@
</div>
</ul>
<p class="button">
<a style="margin-right:0;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a style="margin-right:0;display:none;" class="blue lang" href="#" id="dspLogout" lang="dspLogout">ログアウト</a>
<a class="blue lang" href="#" lang="dspSetting" id="dspSetting">設定変更</a>
<a class="blue lang" href="#" lang="dspViewHistory" id="dspViewHistory">閲覧履歴</a>
<a class="blue lang" href="#" id="dspShiori" lang="dspShiori">しおり</a>
......@@ -73,9 +87,16 @@
<h1><label class="lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label lang="txtLogoutBkMsg" class="lang">ログアウトする前にバックアップしますか?</label></p>
<p class="message-options">
<label class="option_backup">
<label lang="txtBkSelect" class="lang" class="lang">バックアップするデータを選択してください。</label><br />
<input type="checkbox" id="chkBkAllMarking" class="chkbx" checked="checked" /><label for="chkBkAllMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkAllMemo" class="chkbx" checked="checked" /><label for="chkBkAllMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkAllShiori" class="chkbx" checked="checked" /><label for="chkBkAllShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice">
<input type="checkbox" id="chkRememberBackup" />
<span class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</span><br/>
<input type="checkbox" id="chkRememberBackup" /><label for="chkRememberBackup" class="lang" lang="txtLogoutOptBkCfm">今回の行動を記憶し、次回から確認せずに、同じことをする。</label>
</p>
<p class="backupbtn">
<a class="cancel lang" href="#" lang="dspBkCancel" id="dlgConfirmBackup-withoutbackup">バックアップしないでログアウト</a>
......@@ -108,8 +129,17 @@
<li><label><input type=checkbox name="confirmClose" value="confirmClose" class="chkbx" id="chkOpt005" checked="checked" /><label for="chkOpt005" id="txtOpt005" lang="txtOpt005" class="lang">タブ・ブラウザ終了・F5時のアラートが表示する</label></label></li>
</ul>
<h3 id="txtBkResCap" lang="txtBkResCap" class="lang">サーバにバックアップ/リストア</h3>
<p class="logout_backup"><label><input type=checkbox name="backup" value="backup" id="chkOptBkCfm" checked="checked"><label id="txtOptBkCfm" for="chkOptBkCfm" lang="txtOptBkCfm" class="lang">毎回ログアウトの時、バックアップするかどうかは必ず確認する</label></label></p>
<p class="backupbtn"><a class="backup lang" lang="dspOptBk" id="dspOptBk" href="#" >バックアップ</a><a href="#" id="dspOptRes" lang="dspOptRes" class="lang" style="visibility:hidden;">リストア</a></p>
<p class="logout_backup" id="regionOptionBackup"><label><input type=checkbox name="backup" value="backup" id="chkOptBkCfm" checked="checked"><label id="txtOptBkCfm" for="chkOptBkCfm" lang="txtOptBkCfm" class="lang">毎回ログアウトの時、バックアップするかどうかは必ず確認する</label></label>
<br />
<label class="option_backup">
<label id="txtBkDefault" lang="txtBkDefault" class="lang">バックアップのデフォルト : </label>
<input type="checkbox" id="chkBkMarking" class="chkbx" checked="checked" /><label id="txtBkMarking" for="chkBkMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkBkMemo" class="chkbx" checked="checked" /><label id="txtBkMemo" for="chkBkMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkBkShiori" class="chkbx" checked="checked" /><label id="txtBkShiori" for="chkBkShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="backupbtn"><a class="backup lang" lang="dspOptBk" id="dspOptBk" href="#" style="display:none;" >バックアップ</a><a href="#" id="dspOptRes" lang="dspOptRes" class="lang" style="visibility:hidden;">リストア</a></p>
<p class="savebtn"><a class="save lang" href="#" id="dspSave" lang="dspSave">保存する</a><a class="default lang" href="#" id="dspOptReset" lang="dspOptReset">初期設定に戻る</a></p>
</div>
</section>
......@@ -118,15 +148,34 @@
<section class="sectionbackup" id="dlgConfirmBackup">
<h1><label class="title lang" lang="txtBackupTitle">バックアップ確認</label></h1>
<p class="message"><label id="txtBkMsg" lang="txtBkMsg" class="lang">サーバにバックアップしますか?</label></p>
<!--<p class="message"><label id="txtBkMsg" lang="txtBkMsg" class="lang">サーバにバックアップしますか?</label></p>-->
<p class="message">
<label id="txtBkSelect" lang="txtBkSelect" class="lang">バックアップするデータを選択してください。</label>
</p>
<p class="message-options">
<label class="option_backup">
<input type="checkbox" id="chkopBkMarking" class="chkopbx" checked="checked" /><label for="chkopBkMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkopBkMemo" class="chkopbx" checked="checked" /><label for="chkopBkMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkopBkShiori" class="chkopbx" checked="checked" /><label for="chkopBkShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="backupbtn"><a class="ok lang" href="#" id="dspOptBk_OK" lang="dspOK">OK</a><a class="cancel lang" href="#" lang="dspCancel" id="dspOptBk_Cancel">キャンセル</a></p>
</section>
<section class="sectionrestore" id="dlgConfirmRestore">
<h1 class="title lang" lang="txtRestoreTitle">リストア確認</h1>
<p class="message"><label id="txtResMsg" class="lang" lang="txtResMsg"></label></p>
<p class="message">
<!--<label id="txtResMsg" class="lang" lang="txtResMsg"></label>-->
<label id="txtResSelect" class="lang" lang="txtResSelect">リストアするデータを選択してください。</label>
</p>
<p class="message-options">
<label class="option_backup">
<input type="checkbox" id="chkopResMarking" class="chkopbx" checked="checked" /><label for="chkopResMarking" lang="txtBkMarking" class="lang">マーキング</label>
<input type="checkbox" id="chkopResMemo" class="chkopbx" checked="checked" /><label for="chkopResMemo" lang="txtBkMemo" class="lang">メモ</label>
<input type="checkbox" id="chkopResShiori" class="chkopbx" checked="checked" /><label for="chkopResShiori" lang="txtBkShiori" class="lang">しおり</label>
</label>
</p>
<p class="notice"><label class="lang" lang="txtResMsgNotice"></label></p>
<p class="restorebtn"><a class="ok lang" href="#" id="dspOptRes_OK" lang="dspOK">OK</a><a class="cancel lang" href="#" id="dspOptRes_Cancel" lang="dspCancel">キャンセル</a></p>
......@@ -151,7 +200,6 @@
<p class="loginbtn"><a class="change lang" href="#" id="dspPwdUpd1" lang="dspChange">変更</a><a class="skip lang" href="#" lang="dspSkip" id="dspSkip">スキップ</a><a class="cancel lang" href="#" lang="dspCancel" id="dspCancel">キャンセル</a></p>
<br/>
</section>
</div>
<footer>
<div class="border">
......
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment