Commit 3ac0c0cf by Vo Duc Thang

10/2 リリース

parent 610779d3
/**
* ABook Viewer for WEB
* Common Library
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
/*
* User Environment Check Class
*/
var UserEnvironment = function() {
this.appName = navigator.appName;
this.userAgent = navigator.userAgent;
this.os = checkOS(this.userAgent);
this.browser = checkBrowser(this.userAgent);
/* windows os check */
this.isWindows = function() {
return (this.os == "windows");
};
/* mac os check */
this.isMac = function() {
return (this.os == "mac");
};
/* ipad check */
this.isIpad = function() {
return (this.os == "ipad");
};
/* iphone check */
this.isIphone = function() {
return (this.os == "iphone");
};
/* android check */
this.isAndroid = function() {
return (this.os == "android");
};
/** check operating system */
function checkOS(userAgent) {
if(userAgent.toLowerCase().indexOf("windows") >= 0) {
return "windows";
}
if(userAgent.toLowerCase().indexOf("mac") >= 0) {
if(userAgent.toLowerCase().indexOf("ipad") >= 0) {
return "ipad";
}
if(userAgent.toLowerCase().indexOf("iphone") >= 0) {
return "iphone";
}
return "mac";
}
if(userAgent.toLowerCase().indexOf("android") >= 0) {
return "android";
}
return "unknown";
};
/** check user browser */
function checkBrowser(userAgent) {
if(userAgent.toLowerCase().indexOf("msie") >= 0) {
return "msie";
}
if(userAgent.toLowerCase().indexOf("firefox") >= 0) {
return "firefox";
}
if(userAgent.toLowerCase().indexOf("safari") >= 0) {
if(userAgent.toLowerCase().indexOf("chrome") >= 0) {
return "chrome";
}
return "safari";
}
if(userAgent.toLowerCase().indexOf("opera") >= 0) {
return "opera";
}
return "unknown";
};
};
/*
* User Settings Class Definition
*/
var UserSetting = function() {
this.US_KEY="AVWUS";
this.userSetting = this.load();
};
/* get user setting from localStorage */
UserSetting.prototype.load = function () {
var storage = window.localStorage;
var value = null;
var js = null;
if (storage) {
var value = storage.getItem(this.US_KEY);
if (!value) {
value = "{}"; // 空JSON文字列
}
js = JSON.parse(value);
}
return js;
};
/* store user setting */
UserSetting.prototype.set = function(key, value) {
if(!this.userSetting) {
this.userSetting = this.load();
}
var values = this.userSetting;
if(!values) {
values = { key: value };
} else {
values[key] = value;
}
var storage = window.localStorage;
if(storage) {
var jsonStr = JSON.stringify(values);
storage.setItem(this.US_KEY, jsonStr);
}
this.userSetting = values;
};
/* grab user setting */
UserSetting.prototype.get = function(key) {
if(!this.userSetting) {
this.userSetting = this.load();
}
var values = this.userSetting;
if(values) {
return values[key];
}
return null;
};
/* show user setting object list */
UserSetting.prototype.show = function(elmid) {
var storage = window.localStorage;
var tags = "<p>";
if(storage) {
var value = storage.getItem(this.US_KEY);
if(value) {
var js = JSON.parse(value);
$.each(js, function(k, v) {
tags = tags + "<b>" + k + "</b>:" + v + "<br />";
});
}
tags = tags + "</p>";
$(elmid).html(tags);
}
};
/* ユーザ設定のキーリストを取得 */
UserSetting.prototype.keys = function() {
var storage = window.localStorage;
var keyList = [];
if(storage) {
var value = storage.getItem(this.US_KEY);
if(value) {
var js = JSON.parse(value);
var i = 0;
$.each(js, function(k, v) {
keyList[i++] = k;
});
}
return keyList;
}
return null;
};
/* ユーザ設定を削除 */
UserSetting.prototype.remove = function(key) {
var storage = window.localStorage;
if(storage) {
var value = storage.getItem(this.US_KEY);
if(value) {
var js = JSON.parse(value);
if(js) {
delete js[key];
storage.setItem(this.US_KEY, JSON.stringify(js));
}
}
}
};
/* ユーザ設定をすべて削除 */
UserSetting.prototype.removeAll = function() {
var storage = window.localStorage;
if(storage) {
storage.remove(this.US_KEY);
}
};
/*
* User Session Class Definition
*/
var UserSession = function() {
this.available = false;
};
/* Initialize User Session */
UserSession.prototype.init = function(option) {
this.available = false;
if(option == 'restore') {
var value = null;
try {
value = this._get('init');
} catch(e) {
value = null;
} finally {
if(value) {
this.available = true;
}
}
} else {
this.set("init", new Date().toLocaleString());
this.available = true;
}
};
/* store key, value item to user session */
UserSession.prototype.set = function(key, value) {
var storage = window.sessionStorage;
if(storage) {
if(this.available == false) {
if(key == "init") {
storage.setItem("AVWS_" + key, value);
} else {
throw new Error("Session destoryed.");
}
} else {
storage.setItem("AVWS_" + key, value);
}
}
};
/* get session item value */
UserSession.prototype.get = function(key) {
var value = null;
if(this.available) {
value = this._get(key);
} else {
throw new Error("Session Destroyed.");
}
return value;
};
/* get item value from session storage */
UserSession.prototype._get = function(key) {
var storage = window.sessionStorage;
var value = null;
if(storage) {
value = storage.getItem("AVWS_" + key);
}
return value;
};
/* destroy user session */
UserSession.prototype.destroy = function() {
var storage = window.sessionStorage;
if(storage) {
storage.clear();
this.available = false;
}
};
/* show user session object list */
UserSession.prototype.show = function(elmid) {
var storage = window.sessionStorage;
var tags = "<p>";
if(storage) {
for(var i = 0; i < storage.length; i++) {
var key = storage.key(i);
var value = storage.getItem(key);
tags = tags + "<b>" + key + "</b>:" + value + "<br />";
}
tags = tags + "</p>";
$(elmid).html(tags);
}
};
/*
* Variables
*/
var avwUserSessionObj = null;
var avwUserSettingObj = null;
var avwUserEnvObj = null;
var avwSysSettingObj = null;
/* Initialize system */
$(function () {
// システム設定ファイルの配置先パスの決定
var location = window.location.toString().toLowerCase();
var sysFile = '';
if (location.indexOf('/abvw') < 0) {
sysFile = './abvw/common/json/sys/conf.json';
} else {
sysFile = './common/json/sys/conf.json';
}
// システム設定ファイルを読み込む
$.ajax({
url: sysFile,
async: false,
cache: false,
dataType: 'json',
success: function (data) {
avwSysSettingObj = data;
},
error: function (xmlHttpRequest, txtStatus, errorThrown) {
var error = 'Could not load the system configuration file. Please check it.';
error += '\n' + xmlHttpRequest.status + ' ' + txtStatus + ' ' + errorThrown + ' : ' + sysFile;
alert(error);
}
});
// ロード時に一旦エラー状態をクリアしておく
avwClearError();
});
/* get system setting object */
function avwSysSetting() {
return avwSysSettingObj;
};
/* get user environment object */
function avwUserEnv() {
if(avwUserEnvObj == null) {
avwUserEnvObj = new UserEnvironment();
}
return avwUserEnvObj;
};
/* get user session object */
function avwUserSession() {
if(!avwUserSessionObj) {
var obj = new UserSession();
obj.init('restore');
if(obj.available) {
avwUserSessionObj = obj;
return avwUserSessionObj;
} else {
return null;
}
}
return avwUserSessionObj;
};
/* create user session object */
function avwCreateUserSession() {
if(avwUserSessionObj) {
avwUserSessionObj.destroy();
} else {
avwUserSessionObj = new UserSession();
avwUserSessionObj.init();
}
return avwUserSessionObj;
};
/* check Login or not */
function avwCheckLogin(option) {
var userSession = avwUserSession();
if(!userSession) {
/* エラー画面を表示 */
var tags = '<div id="avw-auth-error">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p><h4>認証エラー</h4>ログインしてからご利用ください。</p>' +
'<div><button id="avw-unauth-ok">OK</button></div>' +
'</div></div></div>';
$('body').prepend(tags);
$('#avw-auth-error').css({
'color': '#fff',
'opacity': 1,
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': '#ccc',
'zIndex': '10000'
});
// resize error page
$(window).resize(function() {
$('#avw-auth-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
var returnPage;
if(option) {
returnPage = option
} else {
var sysSetting = avwSysSetting();
returnPage = sysSetting.loginPage;
}
/* ログイン画面に戻る */
$('#avw-unauth-ok').click(function() {
window.location = returnPage;
});
return false;
}
return true;
};
/* get user setting object */
function avwUserSetting() {
if(avwUserSettingObj == null) {
avwUserSettingObj = new UserSetting();
}
return avwUserSettingObj;
};
/* String.format function def. */
function format(fmt) {
for (var i = 1; i < arguments.length; i++) {
var reg = new RegExp("\\{" + (i - 1) + "\\}", "g");
fmt = fmt.replace(reg,arguments[i]);
}
return fmt;
};
/* CMS API Call(async. call) */
function avwCmsApi(accountPath, apiName, type, params, success, error) {
var sysSettings = avwSysSetting();
_callCmsApi(sysSettings.apiUrl, accountPath, apiName, type, params, true, success, error);
};
/* CMS API Call(sync. call) */
function avwCmsApiSync(accountPath, apiName, type, params, success, error) {
var sysSettings = avwSysSetting();
_callCmsApi(sysSettings.apiUrl, accountPath, apiName, type, params, false, success, error);
};
/* CMS API Call(async. call) */
function avwCmsApiWithUrl(url, accountPath, apiName, type, params, success, error) {
_callCmsApi(url, accountPath, apiName, type, params, true, success, error);
};
/* CMS API Call(sync. call) */
function avwCmsApiSyncWithUrl(url, accountPath, apiName, type, params, success, error) {
_callCmsApi(url, accountPath, apiName, type, params, false, success, error);
};
/* CMS API Call */
function _callCmsApi(url, accountPath, apiName, type, params, async, success, error) {
// アプリケーション設定取得
var sysSettings = avwSysSetting();
// url 構築
var apiUrl;
if(!url) {
apiUrl = sysSettings.apiUrl;
} else {
apiUrl = url;
}
if(accountPath) {
apiUrl = format(apiUrl, accountPath)
}
apiUrl = apiUrl + '/' + apiName + '/';
//----------------------------------------------------------------------------------
// for IE: 暫定的に対応 (これをすることでIE9でもCrossDomainリクエストが可能だがアクセスのたびに警告が出る)
$.support.cors = true;
//----------------------------------------------------------------------------------
// ajax によるAPIの実行(json)
$.ajax( {
async: (async) ? async : false,
type: (type) ? type : 'get',
url: apiUrl,
cache: false,
dataType: 'json',
data: params,
crossDomain: true,
beforeSend: function(xhr) {
/*
* ABook viewer for WEB 用のリクエストヘッダに、以下のヘッダを付加する
* X-AGT-AppId: ABookWebCL
* X-AGT-AppVersion: 0.0.1
*/
xhr.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
},
success: function(data) {
if(success) {
success(data);
}
},
error: function(xmlHttpRequest, txtStatus, errorThrown) {
/* call custom error process */
if(error) {
error(xmlHttpRequest, txtStatus, errorThrown);
} else {
showSystemError();
}
}
});
};
/*
* Create Image Data Scheme URI
*/
var ImageDataScheme = function () {
// バイナリデータを文字列に変換
this.convBinaryToString = function (filestream) {
var bytes = [];
for (var i = 0; i < filestream.length; i++) {
bytes[i] = filestream.charCodeAt(i) & 0xff;
}
return String.fromCharCode.apply(String, bytes);
};
// 画像のバイト文字列をdataスキームURIに変換
this.convImageToDataScheme = function (binaryData, ie) {
var b64Data;
var imgHeader;
var imgType = 'png';
if (ie) {
// binary to base64 for ie
b64Data = this.base64encodeForIE(binaryData);
} else {
// binary to base64 for FF, Chrome, Safari
var bin = this.convBinaryToString(binaryData);
b64Data = btoa(bin);
imgHeader = bin.substring(0, 9);
imgType = this.checkImageType(imgHeader);
}
return 'data:image/' + imgType + ';base64,' + b64Data;
};
// 画像タイプ(種類をチェック)
this.checkImageType = function (header) {
if (header.match(/^\x89PNG/)) {
return 'png';
} else if (header.match(/^GIF87a/) || header.match(/^GIF89a/)) {
return 'gif';
} else if (header.match(/^\xff\xd8/)) {
return 'jpeg';
} else {
// デフォルトはPNG画像として扱う
return 'png';
}
};
// バイナリデータをBase64文字列に変換する(IE専用)
this.base64encodeForIE = function (binaryData) {
// 新規XMLデータを作成
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.loadXML('<?xml version="1.0" ?> <root/>');
xml.documentElement.setAttribute("xmlns:dt", "urn:schemas-microsoft-com:datatypes");
// バイナリデータを格納するためのノードを作成
var node = xml.createElement("file-node");
node.dataType = "bin.base64";
// バイナリデータを格納
node.nodeTypedValue = binaryData;
xml.documentElement.appendChild(node);
// そのノードからBASE64エンコード済み文字列を取り出す
var base64encoded_text = node.text;
return base64encoded_text;
};
};
/* Grab Content Page Image Function
* <parameters>
* accountPath: accountPath
* params: request parameters (data type: json, see below)
* { 'sid': sid, contentId: 'contentId', pageNo: 'pageNo' }
* success: function(string: this is image binary encoded string)
* error: function(XMLHttpRequest, XMLHttpRequest.status, XMLHttpRequest.statusText)
*/
function avwGrabContentPageImage(accountPath, params, success, error) {
// API実行準備
var sysSettings = avwSysSetting();
var apiName = 'webContentPageImage'; // API名
//url 構築
var apiUrl;
apiUrl = sysSettings.apiUrl;
if(accountPath) {
apiUrl = format(apiUrl, accountPath)
}
apiUrl = apiUrl + '/' + apiName + '/';
// 送信パラメータの構築
var requestParams = 'contentId=' + params.contentId + '&sid=' + params.sid + '&pageNo=' + params.pageNo;
//apiUrl += '?' + requestParams;
apiUrl += '?' + requestParams + '&isBase64=true';
// バイナリ形式で画像イメージを取得し、Base64にエンコードする
var xmlHttp;
var ie = false;
if(window.ActiveXObject) {
xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
ie = true;
} else {
xmlHttp = new XMLHttpRequest();
}
xmlHttp.open('get', apiUrl);
xmlHttp.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xmlHttp.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
/*
if(xmlHttp.overrideMimeType) {
// for FF, Chrome, Safari
xmlHttp.overrideMimeType('text/plain; charset=x-user-defined');
}
*/
xmlHttp.onreadystatechange = function () {
if (xmlHttp.readyState == 4) {
if (xmlHttp.status == 200) {
/*
//base64 encode
var ids = new ImageDataScheme();
var src; // Image Data URI
if(ie) {
// for IE
src = ids.convImageToDataScheme(xmlHttp.responseBody, ie);
} else {
// for FF, Chrome, Safari
src = ids.convImageToDataScheme(xmlHttp.responseText, ie);
}
*/
var src; // Image Data URI
/*
if(ie) {
// for IE
src = 'data:image/png;base64,' + xmlHttp.responseBody;
} else {
// for FF, Chrome, Safari
src = 'data:image/png;base64,' + xmlHttp.responseText;
}
*/
src = 'data:image/png;base64,' + xmlHttp.responseText;
if (success) {
success(src);
}
} else {
if (error) {
error(xmlHttp, xmlHttp.status, xmlHttp.statusText);
} else {
console.log(xmlHttp.status + ' ' + xmlHttp.statusText);
}
}
}
};
xmlHttp.send();
};
/*
* file upload function: call uploadBackupFile API
* <params>
* [
* { name: 'sid', content: 'content' }
* { name: 'deviceType', content: '4' }
* { name: 'formFile', fileName: 'filename', contentType: 'text-plain' }
* ]
*/
function avwUploadBackupFile(accountPath, params, async, success, error) {
/* API実行準備*/
var sysSettings = avwSysSetting();
var apiName = 'uploadBackupFile'; // API名
//url 構築
var apiUrl;
apiUrl = sysSettings.apiUrl;
if(accountPath) {
apiUrl = format(apiUrl, accountPath)
}
apiUrl = apiUrl + '/' + apiName + '/';
/* POST(multipart/form-data)送信準備 */
var body = '';
var boundary = '';
// boundaryを構築
var date = new Date();
boundary = '------------------------' + date.getMilliseconds()
+ (date.getMonth() + 1)
+ date.getMinutes()
+ date.getFullYear()
+ date.getDay()
+ date.getHours()
+ date.getSeconds();
// bodyを構築
for(var i = 0; i < params.length; i++) {
var item = params[i];
body += '--' + boundary + '\r\n';
body += 'Content-Disposition: form-data; name="' + item.name + '"';
if(item.fileName) {
body += '; filename="' + item.fileName + '"\r\n';
} else {
body += '\r\n';
}
if(item.contentType) {
body += 'Content-Type="' + item.contentType + '"\r\n';
}
body += '\r\n';
body += item.content + '\r\n';
}
body += '--' + boundary + '--\r\n';
// ajax によるAPIの実行(json)
$.ajax( {
async: (async) ? async : false,
type: 'post',
url: apiUrl,
data: body,
beforeSend: function(xhr) {
/*
* ABook viewer for WEB 用のリクエストヘッダに、以下のヘッダを付加する
* X-AGT-AppId: ABookWebCL
* X-AGT-AppVersion: 0.0.1
*/
xhr.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
/*
* uploadBackupFileは multipart/form-data でPOST送信する
*/
xhr.setRequestHeader('Content-Type', 'multipart/form-data; boundary=' + boundary);
//xhr.setRequestHeader('Content-Length', getByte(body));
},
success: function(data) {
if(success) {
success(data);
}
},
error: function(xmlHttpRequest, txtStatus, errorThrown) {
/* call custom error process */
if(error) {
error(xmlHttpRequest, txtStatus, errorThrown);
} else {
showSystemError();
}
}
});
};
/* get bytes of text */
function getByte(text) {
count = 0;
for (i=0; i<text.length; i++) {
n = escape(text.charAt(i));
if (n.length < 4) {
count++;
}
else {
count+=2;
}
}
return count;
};
/* show system error message */
var hasErrorKey = 'AVW_HASERR';
function showSystemError() {
if(avwHasError()) {
// すでにエラー状態であればエラーを表示しない
return;
} else {
// エラー状態にセット
avwSetErrorState();
}
// create DOM element for showing error message
var errMes = i18nText('sysErrorCallApi01');
var tags = '<div id="avw-sys-error"></div>';
//$('body').prepend(tags);
$('body').append(tags);
$('#avw-sys-error').css({
'opacity': 0.7,
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': '#999',
'z-index': 90000
});
// resize error page
$(window).resize(function() {
$('#avw-sys-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
// show error messages
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errMes
});
/*
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errMes,
close: function() { isShowErrorMessage = false; }
});
*/
};
/* エラー状態を取得 */
function avwHasError() {
var session = window.sessionStorage;
var isError = false;
if(session) {
isError = session.getItem(hasErrorKey);
}
return (isError == 'true');
};
/* エラー状態にセット */
function avwSetErrorState() {
var session = window.sessionStorage;
if(session) {
session.setItem(hasErrorKey, true);
}
};
/* エラー状態をクリア */
function avwClearError() {
var session = window.sessionStorage;
if(session) {
session.setItem(hasErrorKey, false);
}
};
/* ブラウザunload時に警告メッセージの出力設定を行う関数 */
function avwSetLogoutNortice() {
window.onbeforeunload = function(event) {
// メッセージ表示
// FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない
var message = i18nText('sysInfoWithoutLogout');
var e = event || window.event;
if(e) {
e.returnValue = message;
}
return message;
};
};
/* 警告メッセージを出力しないでページ遷移を行う関数 */
function avwScreenMove(url) {
window.onbeforeunload = null;
window.location = url;
};
/* Debug Log */
function avwLog(msg) {
if(avwSysSetting().debug) {
console.log(msg);
}
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('3 2y=6(){8.1s=2m.1s;8.u=2m.u;8.1d=2i(8.u);8.43=2Q(8.u);8.42=6(){a(8.1d=="1Y")};8.45=6(){a(8.1d=="1W")};8.48=6(){a(8.1d=="29")};8.47=6(){a(8.1d=="1S")};8.46=6(){a(8.1d=="1U")};6 2i(u){5(u.J().K("1Y")>=0){a"1Y"}5(u.J().K("1W")>=0){5(u.J().K("29")>=0){a"29"}5(u.J().K("1S")>=0){a"1S"}a"1W"}5(u.J().K("1U")>=0){a"1U"}a"2A"};6 2Q(u){5(u.J().K("2Y")>=0){a"2Y"}5(u.J().K("2T")>=0){a"2T"}5(u.J().K("2V")>=0){5(u.J().K("2S")>=0){a"2S"}a"2V"}5(u.J().K("2x")>=0){a"2x"}a"2A"}};3 U=6(){8.W="3Z";8.Z=8.1v()};U.D.1v=6(){3 c=f.1i;3 d=x;3 L=x;5(c){3 d=c.13(8.W);5(!d){d="{}";}L=1k.1M(d)}a L};U.D.28=6(o,d){5(!8.Z){8.Z=8.1v()}3 P=8.Z;5(!P){P={o:d}}l{P[o]=d}3 c=f.1i;5(c){3 2z=1k.2G(P);c.1l(8.W,2z)}8.Z=P};U.D.1B=6(o){5(!8.Z){8.Z=8.1v()}3 P=8.Z;5(P){a P[o]}a x};U.D.2D=6(1J){3 c=f.1i;3 y="<p>";5(c){3 d=c.13(8.W);5(d){3 L=1k.1M(d);$.2u(L,6(k,v){y=y+"<b>"+k+"</b>:"+v+"<2I />"})}y=y+"</p>";$(1J).2F(y)}};U.D.4k=6(){3 c=f.1i;3 1Z=[];5(c){3 d=c.13(8.W);5(d){3 L=1k.1M(d);3 i=0;$.2u(L,6(k,v){1Z[i++]=k})}a 1Z}a x};U.D.2H=6(o){3 c=f.1i;5(c){3 d=c.13(8.W);5(d){3 L=1k.1M(d);5(L){4j L[o];c.1l(8.W,1k.2G(L))}}}};U.D.4o=6(){3 c=f.1i;5(c){c.2H(8.W)}};3 S=6(){8.11=A};S.D.1f=6(1u){8.11=A;5(1u==\'2J\'){3 d=x;4m{d=8.25(\'1f\')}4h(e){d=x}4c{5(d){8.11=F}}}l{8.28("1f",I 3v().4b());8.11=F}};S.D.28=6(o,d){3 c=f.16;5(c){5(8.11==A){5(o=="1f"){c.1l("2b"+o,d)}l{2C I 2B("2E 4a.")}}l{c.1l("2b"+o,d)}}};S.D.1B=6(o){3 d=x;5(8.11){d=8.25(o)}l{2C I 2B("2E 4d.")}a d};S.D.25=6(o){3 c=f.16;3 d=x;5(c){d=c.13("2b"+o)}a d};S.D.2U=6(){3 c=f.16;5(c){c.4g();8.11=A}};S.D.2D=6(1J){3 c=f.16;3 y="<p>";5(c){1n(3 i=0;i<c.1g;i++){3 o=c.o(i);3 d=c.13(o);y=y+"<b>"+o+"</b>:"+d+"<2I />"}y=y+"</p>";$(1J).2F(y)}};3 M=x;3 1z=x;3 1L=x;3 2h=x;$(6(){3 1o=f.1o.3C().J();3 1r=\'\';5(1o.K(\'/2v\')<0){1r=\'./2v/2w/19/1p/2t.19\'}l{1r=\'./2w/19/1p/2t.19\'}$.2c({G:1r,T:A,2p:A,27:\'19\',m:6(H){2h=H},h:6(1c,1b,1h){3 h=\'3O 3P 1v 3M 3N 3S 3r. 3T 3Q 3R.\';h+=\'\\n\'+1c.1H+\' \'+1b+\' \'+1h+\' : \'+1r;3G(h)}});3o()});6 V(){a 2h};6 3E(){5(1L==x){1L=I 2y()}a 1L};6 2Z(){5(!M){3 1x=I S();1x.1f(\'2J\');5(1x.11){M=1x;a M}l{a x}}a M};6 3L(){5(M){M.2U()}l{M=I S();M.1f()}a M};6 5k(1u){3 2W=2Z();5(!2W){3 y=\'<N 24="Y-1T-h">\'+\'<N 2M="2N:2K; R:2X%; Q:2X%;">\'+\'<N 2M="2N:2K-5q; 1j-2L:3e; 5o-2L:3g;">\'+\'<p><2R>5m</2R>5g。</p>\'+\'<N><2O 24="Y-2r-2s">59</2O></N>\'+\'</N></N></N>\';$(\'E\').58(y);$(\'#Y-1T-h\').1K({\'56\':\'#57\',\'3q\':1,\'23\':\'3x\',\'3s\':\'0\',\'3t\':\'0\',\'R\':$(f).R(),\'Q\':$(f).Q(),\'3a\':\'#5e\',\'5f\':\'5d\'});$(f).3d(6(){$(\'#Y-1T-h\').1K({\'R\':$(f).R(),\'Q\':$(f).Q()})});3 1w;5(1u){1w=1u}l{3 2P=V();1w=2P.5y}$(\'#Y-2r-2s\').5z(6(){f.1o=1w});a A}a F};6 5r(){5(1z==x){1z=I U()}a 1z};6 1F(1A){1n(3 i=1;i<2l.1g;i++){3 2o=I 5w("\\\\{"+(i-1)+"\\\\}","g");1A=1A.5v(2o,2l[i])}a 1A};6 4D(s,C,B,q,m,h){3 t=V();1t(t.j,s,C,B,q,F,m,h)};6 4B(s,C,B,q,m,h){3 t=V();1t(t.j,s,C,B,q,A,m,h)};6 4C(G,s,C,B,q,m,h){1t(G,s,C,B,q,F,m,h)};6 4J(G,s,C,B,q,m,h){1t(G,s,C,B,q,A,m,h)};6 1t(G,s,C,B,q,T,m,h){3 t=V();3 j;5(!G){j=t.j}l{j=G}5(s){j=1F(j,s)}j=j+\'/\'+C+\'/\';$.4I.4G=F;$.2c({T:(T)?T:A,B:(B)?B:\'1B\',G:j,2p:A,27:\'19\',H:q,4H:F,3i:6(14){14.12(\'X-17-2e\',t.1s);14.12(\'X-17-2f\',t.21)},m:6(H){5(m){m(H)}},h:6(1c,1b,1h){5(h){h(1c,1b,1h)}l{26()}}})};3 4A=6(){8.2q=6(1O){3 2d=[];1n(3 i=0;i<1O.1g;i++){2d[i]=1O.4t(i)&4u}a 2j.4s.4q(2j,2d)};8.4y=6(1q,1D){3 1C;3 2g;3 22=\'1G\';5(1D){1C=8.2k(1q)}l{3 1N=8.2q(1q);1C=4x(1N);2g=1N.4v(0,9);22=8.2n(2g)}a\'H:34/\'+22+\';1R,\'+1C};8.2n=6(1m){5(1m.1E(/^\\50/)){a\'1G\'}l 5(1m.1E(/^4Y/)||1m.1E(/^4W/)){a\'4X\'}l 5(1m.1E(/^\\55\\53/)){a\'51\'}l{a\'1G\'}};8.2k=6(1q){3 1a=I 1V("4O.4P");1a.4N(\'<?1a 4L="1.0" ?> <4M/>\');1a.37.44("4U:4S","4Q:4R-4T-4V:52");3 18=1a.54("3r-18");18.27="1N.1R";18.4Z=1q;1a.37.4w(18);3 31=18.1j;a 31}};6 4z(s,q,m,h){3 t=V();3 C=\'4r\';3 j;j=t.j;5(s){j=1F(j,s)}j=j+\'/\'+C+\'/\';3 3b=\'3h=\'+q.3h+\'&39=\'+q.39+\'&36=\'+q.36;j+=\'?\'+3b+\'&4K=F\';3 w;3 1D=A;5(f.1V){w=I 1V(\'4F.4E\');1D=F}l{w=I 5s()}w.5x(\'1B\',j);w.12(\'X-17-2e\',t.1s);w.12(\'X-17-2f\',t.21);w.5u=6(){5(w.5t==4){5(w.1H==5A){3 1Q;1Q=\'H:34/1G;1R,\'+w.5c;5(m){m(1Q)}}l{5(h){h(w,w.1H,w.32)}l{3l.3m(w.1H+\' \'+w.32)}}}};w.5b()};6 5a(s,q,T,m,h){3 t=V();3 C=\'5n\';3 j;j=t.j;5(s){j=1F(j,s)}j=j+\'/\'+C+\'/\';3 E=\'\';3 1e=\'\';3 10=I 3v();1e=\'------------------------\'+10.5p()+(10.5i()+1)+10.5h()+10.5j()+10.5l()+10.4p()+10.3J();1n(3 i=0;i<q.1g;i++){3 15=q[i];E+=\'--\'+1e+\'\\r\\n\';E+=\'20-3I: 33-H; 3n="\'+15.3n+\'"\';5(15.3p){E+=\'; 3K="\'+15.3p+\'"\\r\\n\'}l{E+=\'\\r\\n\'}5(15.3k){E+=\'20-3c="\'+15.3k+\'"\\r\\n\'}E+=\'\\r\\n\';E+=15.3F+\'\\r\\n\'}E+=\'--\'+1e+\'--\\r\\n\';$.2c({T:(T)?T:A,B:\'3H\',G:j,H:E,3i:6(14){14.12(\'X-17-2e\',t.1s);14.12(\'X-17-2f\',t.21);14.12(\'20-3c\',\'3D/33-H; 1e=\'+1e);},m:6(H){5(m){m(H)}},h:6(1c,1b,1h){5(h){h(1c,1b,1h)}l{26()}}})};6 3A(1j){1I=0;1n(i=0;i<1j.1g;i++){n=3B(1j.3z(i));5(n.1g<4){1I++}l{1I+=2}}a 1I};3 1y=\'3y\';6 26(){5(38()){a}l{35()}3 30=3w(\'4e\');3 y=\'<N 24="Y-1p-h"></N>\';$(\'E\').4f(y);$(\'#Y-1p-h\').1K({\'3q\':0.7,\'23\':\'3x\',\'3s\':\'0\',\'3t\':\'0\',\'R\':$(f).R(),\'Q\':$(f).Q(),\'3a\':\'#4n\',\'z-4l\':4i});$(f).3d(6(){$(\'#Y-1p-h\').1K({\'R\':$(f).R(),\'Q\':$(f).Q()})});$().3f({23:\'3g-3e\'});$().3f(\'49\',{B:\'h\',3Y:F,1j:30});};6 38(){3 O=f.16;3 2a=A;5(O){2a=O.13(1y)}a(2a==\'F\')};6 35(){3 O=f.16;5(O){O.1l(1y,F)}};6 3o(){3 O=f.16;5(O){O.1l(1y,A)}};6 40(){f.3u=6(1X){3 1P=3w(\'3X\');3 e=1X||f.1X;5(e){e.3U=1P}a 1P}};6 3V(G){f.3u=x;f.1o=G};6 3W(3j){5(V().41){3l.3m(3j)}};', 62, 347, '|||var||if|function||this||return||storage|value||window||error||apiUrl||else|success||key||params||accountPath|sysSettings|userAgent||xmlHttp|null|tags||false|type|apiName|prototype|body|true|url|data|new|toLowerCase|indexOf|js|avwUserSessionObj|div|session|values|height|width|UserSession|async|UserSetting|avwSysSetting|US_KEY||avw|userSetting|date|available|setRequestHeader|getItem|xhr|item|sessionStorage|AGT|node|json|xml|txtStatus|xmlHttpRequest|os|boundary|init|length|errorThrown|localStorage|text|JSON|setItem|header|for|location|sys|binaryData|sysFile|appName|_callCmsApi|option|load|returnPage|obj|hasErrorKey|avwUserSettingObj|fmt|get|b64Data|ie|match|format|png|status|count|elmid|css|avwUserEnvObj|parse|bin|filestream|message|src|base64|iphone|auth|android|ActiveXObject|mac|event|windows|keyList|Content|appVersion|imgType|position|id|_get|showSystemError|dataType|set|ipad|isError|AVWS_|ajax|bytes|AppId|AppVersion|imgHeader|avwSysSettingObj|checkOS|String|base64encodeForIE|arguments|navigator|checkImageType|reg|cache|convBinaryToString|unauth|ok|conf|each|abvw|common|opera|UserEnvironment|jsonStr|unknown|Error|throw|show|Session|html|stringify|remove|br|restore|table|align|style|display|button|sysSetting|checkBrowser|h4|chrome|firefox|destroy|safari|userSession|100|msie|avwUserSession|errMes|base64encoded_text|statusText|form|image|avwSetErrorState|pageNo|documentElement|avwHasError|sid|background|requestParams|Type|resize|center|toastmessage|middle|contentId|beforeSend|msg|contentType|console|log|name|avwClearError|fileName|opacity|file|top|left|onbeforeunload|Date|i18nText|fixed|AVW_HASERR|charAt|getByte|escape|toString|multipart|avwUserEnv|content|alert|post|Disposition|getSeconds|filename|avwCreateUserSession|the|system|Could|not|check|it|configuration|Please|returnValue|avwScreenMove|avwLog|sysInfoWithoutLogout|sticky|AVWUS|avwSetLogoutNortice|debug|isWindows|browser|setAttribute|isMac|isAndroid|isIphone|isIpad|showToast|destoryed|toLocaleString|finally|Destroyed|sysErrorCallApi01|append|clear|catch|90000|delete|keys|index|try|999|removeAll|getHours|apply|webContentPageImage|fromCharCode|charCodeAt|0xff|substring|appendChild|btoa|convImageToDataScheme|avwGrabContentPageImage|ImageDataScheme|avwCmsApiSync|avwCmsApiWithUrl|avwCmsApi|XMLHTTP|Msxml2|cors|crossDomain|support|avwCmsApiSyncWithUrl|isBase64|version|root|loadXML|Microsoft|XMLDOM|urn|schemas|dt|microsoft|xmlns|com|GIF89a|gif|GIF87a|nodeTypedValue|x89PNG|jpeg|datatypes|xd8|createElement|xff|color|fff|prepend|OK|avwUploadBackupFile|send|responseText|10000|ccc|zIndex|ログインしてからご利用ください|getMinutes|getMonth|getFullYear|avwCheckLogin|getDay|認証エラー|uploadBackupFile|vertical|getMilliseconds|cell|avwUserSetting|XMLHttpRequest|readyState|onreadystatechange|replace|RegExp|open|loginPage|click|200'.split('|'), 0, {}))
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* ABook Viewer for WEB
* 国際化(言語切替)対応共通処理
*
* 言語リソースファイルは、指定する言語に合わせて以下のファイルを修正する
* - 日本語: lang-ja.json
* - 韓国語: lang-ko.json
* - 英語 : lang-en.json
*
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
/**
* 定数:言語ファイル配置場所
*/
var avwsys_location = "/common/json/lang";
var avwsys_dir = "/abvw";
var avwsys_storagekey = "AVWUS_Lang";
var avwsys_currLang = "AVW_CurrLang";
/* 言語の初期化 */
$(function() {
// ログイン画面/直接アクセス対策
var location = window.location.toString().toLowerCase();
if (location.indexOf(avwsys_dir) < 0) {
// avwsys_dirディレクトリ配下ではない場合は、avwsys_dirディレクトリをつける
avwsys_location = "." + avwsys_dir + avwsys_location;
} else {
// avwsys_dirディレクトリ配下の場合は、相対パスに変換
avwsys_location = "." + avwsys_location;
}
var lang = "en";
var storage = window.localStorage;
if(storage) {
var lang = storage.getItem(avwsys_storagekey);
if(!lang) {
lang = getNavigatorLanguage();
}
}
// 言語ファイルを初期化する
loadLanguage(lang);
});
/* ブラウザの言語設定を取得する */
function getNavigatorLanguage() {
var lang = (navigator.browserLanguage || navigator.language || navigator.userLanguage);
/* 対応言語 */
var languages = ['ja','ko','en']; // 対応言語を増やす場合はここを変更する
if(lang.match(/ja|ko|en/g)) {
for(var i = 0; i < languages.length; i++) {
var index = lang.indexOf(languages[i]);
if(index >= 0) {
lang = lang.substring(index, 2);
break;
}
}
} else {
lang = 'en'; // 対応言語が無ければ英語をデフォルトとする
}
return lang;
};
/* 言語リソースファイル読み込み */
function loadLanguage(lang) {
// 引数から言語ファイルを選択
var langfile = "lang-" + lang + ".json";
// 言語ファイルを読み込む
$.ajax({
url: avwsys_location + "/" + langfile,
async: false,
dataType: 'json',
cache: false,
success: function(data) {
// lang属性の書換え
document.documentElement.lang = lang;
// html の言語データを書換える
var jsonLangData = data;
replaceText(jsonLangData);
// 言語設定、言語データをストレージにキャッシュしておく
storeCurrentLanguage(lang, jsonLangData);
},
error: function(xhr, txtStatus, errorThrown) {
var error = 'Could not load a language file ' + langfile + '. please check it.';
error += '\n' + xhr.status + ' ' + txtStatus + ' ' + errorThrown + ' : ' + langfile;
alert(error);
}
});
};
/* ページ内のテキストをすべて言語に合わせて置換する */
function replaceText(jsonLangData) {
var itemCount = $('.lang').length;
if(itemCount > 0) {
for(var i = 0; i < itemCount; i++) {
var obj = $('.lang:eq(' + i + ')');
var langId = obj.attr('lang');
if(langId) {
var langText = getLangText(jsonLangData, langId);
var tn = obj.get()[0].localName;
if(tn == 'input') {
if(obj.attr('type') == 'button' || obj.attr('type') == 'submit') {
obj.val(langText);
} else {
obj.text(langText);
}
} else {
obj.text(langText);
}
}
}
}
};
/* 現在設定されている言語でHTMLテキストを置き換える */
function i18nReplaceText() {
var storage = window.sessionStorage;
if(storage) {
var value = storage.getItem(avwsys_storagekey);
if(value) {
var json = JSON.parse(value);
replaceText(json);
}
}
};
/* キーから文字列を取得 */
function i18nText(key) {
var storage = window.sessionStorage;
if(storage) {
var value = storage.getItem(avwsys_storagekey);
if(value) {
var json = JSON.parse(value);
return getLangText(json, key);
}
}
return "undefined";
};
/* 言語データのキー値から文字列を取得 */
function getLangText(jsonLangData, key) {
if(jsonLangData) {
var text = jsonLangData[key];
return text;
}
return "undefined.";
};
/* 言語データの切り替え */
function changeLanguage(lang) {
// 言語の切替を行った場合のみ選択言語をストアする
var storage = window.localStorage;
if(storage) {
storage.setItem(avwsys_storagekey, lang);
}
// 言語ファイルを読み込み、テキスト文字列を変換する
loadLanguage(lang);
};
/* 設定言語の保存 */
function storeCurrentLanguage(lang, langData) {
var ss = window.sessionStorage;
if(ss) {
// language data
ss.setItem(avwsys_storagekey, JSON.stringify(langData));
// current language
ss.setItem(avwsys_currLang, lang);
}
};
/* 設定言語の取得 */
function getCurrentLanguage() {
var lang;
var storage = window.sessionStorage;
if(storage) {
lang = storage.getItem(avwsys_currLang);
}
if(!lang) {
lang = getNavigatorLanguage();
}
return lang;
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('1 c="/1b/b/3";1 G="/1c";1 e="1a";1 y="18";$(6(){1 u=9.u.19().1d();4(u.L(G)<0){c="."+G+c}m{c="."+c}1 3="o";1 5=9.U;4(5){1 3=5.q(e);4(!3){3=v()}}C(3)});6 v(){1 3=(H.1i||H.N||H.1e);1 D=[\'S\',\'I\',\'o\'];4(3.1f(/S|I|o/g)){K(1 i=0;i<D.J;i++){1 F=3.L(D[i]);4(F>=0){3=3.16(F,2);15}}}m{3=\'o\';}f 3};6 C(3){1 k="3-"+3+".b";$.17({13:c+"/"+k,12:P,1j:\'b\',1w:P,1z:6(O){1x.1v.3=3;1 7=O;w(7);W(3,7)},l:6(R,Q,M){1 l=\'1C 1A 1D a N 1n \'+k+\'. 1o 1m 1k.\';l+=\'\\n\'+R.1p+\' \'+Q+\' \'+M+\' : \'+k;1s(l)}})};6 w(7){1 z=$(\'.3\').J;4(z>0){K(1 i=0;i<z;i++){1 8=$(\'.3:1r(\'+i+\')\');1 A=8.x(\'3\');4(A){1 p=E(7,A);1 V=8.1q()[0].1u;4(V==\'1t\'){4(8.x(\'X\')==\'1l\'||8.x(\'X\')==\'1B\'){8.1y(p)}m{8.h(p)}}m{8.h(p)}}}}};6 11(){1 5=9.s;4(5){1 d=5.q(e);4(d){1 b=B.Z(d);w(b)}}};6 14(j){1 5=9.s;4(5){1 d=5.q(e);4(d){1 b=B.Z(d);f E(b,j)}}f"Y"};6 E(7,j){4(7){1 h=7[j];f h}f"Y."};6 10(3){1 5=9.U;4(5){5.t(e,3)}C(3)};6 W(3,T){1 r=9.s;4(r){r.t(e,B.1g(T));r.t(y,3)}};6 1h(){1 3;1 5=9.s;4(5){3=5.q(y)}4(!3){3=v()}f 3};', 62, 102, '|var||lang|if|storage|function|jsonLangData|obj|window||json|avwsys_location|value|avwsys_storagekey|return||text||key|langfile|error|else||en|langText|getItem|ss|sessionStorage|setItem|location|getNavigatorLanguage|replaceText|attr|avwsys_currLang|itemCount|langId|JSON|loadLanguage|languages|getLangText|index|avwsys_dir|navigator|ko|length|for|indexOf|errorThrown|language|data|false|txtStatus|xhr|ja|langData|localStorage|tn|storeCurrentLanguage|type|undefined|parse|changeLanguage|i18nReplaceText|async|url|i18nText|break|substring|ajax|AVW_CurrLang|toString|AVWUS_Lang|common|abvw|toLowerCase|userLanguage|match|stringify|getCurrentLanguage|browserLanguage|dataType|it|button|check|file|please|status|get|eq|alert|input|localName|documentElement|cache|document|val|success|not|submit|Could|load'.split('|'), 0, {}))
/**
* ABook Viewer for WEB
* Screen Lock Library
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*
* options
* timeout: タイムアウト秒
* id: オーバーレイ要素のID属性
* html: オーバーレイ上に表示するHTML
* color: テキスト色
* opacity: 透明度
* background: 背景色
* lockspeed: アニメーションスピード( 'slow' 'normal' 'fast' or millisecond like jquery.fadein/fadeout)
* unlockFunc: ロック解除イベント処理
* userScript: ユーザスクリプト
*
* usage:
*
* $(function() {
* var options = { ... };
* screenLock(options);
* }
*
*/
function screenLock(options) {
var idleTimerId = null;
var bTimeout = false;
var defaultOptions = {
timeout : 600000, // default timeout = 10min.
id: 'to',
html: 'Clickして画面ロックを解除してください。',
color: '#fff',
opacity: '0.95',
background: '#333',
lockspeed: 'slow',
errorMessage: 'ロックを解除できません。入力したパスワードを確認してください。',
unlockFunc : function(elmId) {
// overlay click then fade out and remove element
$('#' + elmId).fadeOut(lockspeed, function() {
// ロック画面をDOM要素から削除
$('#' + elmId).remove();
// 画面ロック状態を解除
removeLockState();
// アイドルタイマーをもう一度仕掛ける
setIdleTimer();
});
// unlock
return { 'result': true, 'errorCode' : 'success' };
}
};
var timeout, elmId, html, color, opacity, background, lockspeed, unlockEvent, unlockFunc, errorMessage;
// overlay option
if(options) {
timeout = (options.timeout) ? options.timeout : defaultOptions.timeout;
elmId = (options.id) ? options.id : defaultOptions.id;
html = (options.html) ? options.html : defaultOptions.html;
color = (options.color) ? options.color : defaultOptions.color;
opacity = (options.opacity) ? options.opacity : defaultOptions.opacity;
background = (options.background) ? options.background : defaultOptions.background;
lockspeed = (options.lockspeed) ? options.lockspeed : defaultOptions.lockspeed;
unlockFunc = (options.unlockFunc) ? options.unlockFunc : null;
errorMessage = (options.errorMessage) ? options.errorMessage : defaultOptions.errorMessage;
} else {
timeout = defaultOptions.timeout;
elmId = defaultOptions.id;
html = defaultOptions.html;
color = defaultOptions.color;
opacity = defaultOptions.opacity;
background = defaultOptions.background;
lockspeed = defaultOptions.lockspeed;
unlockFunc = defaultOptions.unlockFunc;
errorMessage = defaultOptions.errorMessage;
}
// bind event
$(window).click(resetIdleTimer)
.mousemove(resetIdleTimer)
.keydown(resetIdleTimer)
.bind('touchstart', resetIdleTimer)
.bind('touchmove', resetIdleTimer);
// アイドルタイマーを起動
setIdleTimer();
/* ロックするまでのアイドルタイマー */
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;
// clear timeout
if(idleTimerId) {
clearTimeout(idleTimerId);
idleTimerId = null;
}
// すでにロック状態かどうかをチェックし、ロック状態であれば、即ロックをかける
if(isLocked()) {
idleStateTimeout = 0;
}
// clear lock state
removeLockState();
// set idle timeout
idleTimerId = setTimeout(function() {
// clear timer id
clearTimeout(idleTimerId);
idleTimerId = null;
bTimeout = true;
// set lock state
setLockState();
// show lock screen
showLockScreen();
}, idleStateTimeout);
// clear time out
bTimeout = false;
};
/* reset idle timer */
function resetIdleTimer() {
if(!bTimeout) {
setIdleTimer();
}
};
/* show lock screen */
function showLockScreen() {
// show message overlay
var tags = '<div id="' + elmId + '" class="screenLock">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p class="screenLock-content">' + html + i18nText('sysInfoScrLock01') + '</p>' +
'<div id="pw" style="display:none;">' +
'<input id="passwd-txt" placeholder="'+i18nText('sysLockScrPwdInput')+'" type="password" value="" />&nbsp;' +
'<button id="unlock-btn">OK</button>' +
'<div id="screenLockErrMsg" class="screenLock-error" style="display:none;">' + errorMessage + '</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
$(document.body).append(tags);
$('#' + elmId).css( {
'color': color,
'opacity': opacity,
'display': 'none',
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': background,
'zIndex': '10000'
})
.fadeIn(lockspeed);
// bind event hander to unlock
$('#' + elmId).click(function() {
$('#pw').fadeIn();
var pwInputTimer = null;
pwInputTimer = setTimeout(function() {
$('#pw').fadeOut();
clearTimeout(pwInputTimer);
}, 15000);
// フォーカスを当ててキーダウンイベントでタイムアウト解除を登録
$('#passwd-txt').focus()
.keydown(function(event) {
// パスワード入力タイマーを解除
if(pwInputTimer) {
clearTimeout(pwInputTimer);
}
pwInputTimer = null;
// エンターキーで解除実行
if(event.which == 13) {
executeUnlock();
}
});
});
// force unlock function
function forceUnlockFunc() {
defaultOptions.unlockFunc(elmId);
};
// execute unlock process
function executeUnlock() {
if (unlockFunc) {
var val = unlockFunc($('#passwd-txt').val(), forceUnlockFunc);
if (!val.result) {
$('#screenLockErrMsg').text(format(errorMessage, val.errorCode.errorMessage));
$('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus();
return;
}
else {
// Set new timeout value
timeout = val.newTimeout;
}
/*
if(!unlockFunc($('#passwd-txt').val(), forceUnlockFunc)) {
$('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus();
return;
}
*/
}
defaultOptions.unlockFunc(elmId);
}
// OKボタン押下でロック解除関数を実行
$('#unlock-btn').click(function() { executeUnlock(); });
// resize overlay
$(window).resize(function() {
$('#' + elmId).css( {
'width': $(window).width(),
'height': $(window).height()
});
});
};
/* set lock state */
function setLockState() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
sessionStorage.setItem('AVW_ScreenLock', true);
}
};
/* unset lock state */
function removeLockState() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
sessionStorage.removeItem('AVW_ScreenLock');
}
};
/* check lock state or not */
function isLocked() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
var lockState = sessionStorage.getItem('AVW_ScreenLock');
if(lockState) {
return true;
}
}
return false;
};
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('3 x(1){7 b=k;7 r=v;7 2={a:1p,g:\'1r\',i:\'1s。\',d:\'#1j\',c:\'0.1q\',f:\'#1i\',h:\'1e\',8:\'1c。1t。\',9:3(6){$(\'#\'+6).Z(h,3(){$(\'#\'+6).1k();B();w()});q{\'10\':C,\'18\':\'1l\'}}};7 a,6,i,d,c,f,h,1n,9,8;4(1){a=(1.a)?1.a:2.a;6=(1.g)?1.g:2.g;i=(1.i)?1.i:2.i;d=(1.d)?1.d:2.d;c=(1.c)?1.c:2.c;f=(1.f)?1.f:2.f;h=(1.h)?1.h:2.h;9=(1.9)?1.9:k;8=(1.8)?1.8:2.8}15{a=2.a;6=2.g;i=2.i;d=2.d;c=2.c;f=2.f;h=2.h;9=2.9;8=2.8}$(j).H(m).1b(m).17(m).Q(\'1m\',m).Q(\'1o\',m);w();3 w(){4(a<0){4(b){t(b);b=k}r=v;B();q}7 I=a;4(b){t(b);b=k}4(V()){I=0}B();b=1a(3(){t(b);b=k;r=C;O();T()},I);r=v};3 m(){4(!r){w()}};3 T(){7 N=\'<e g="\'+6+\'" E="x">\'+\'<e y="u:Y; s:S%; n:S%;">\'+\'<e y="u:Y-1d; 11-W:1g; 1f-W:1h;">\'+\'<p E="x-1u">\'+i+X(\'1N\')+\'</p>\'+\'<e g="J" y="u:G;">\'+\'<1O g="z-A" 1P="\'+X(\'1M\')+\'" 1J="1K" 1L="" />&1U;\'+\'<U g="14-19">1V</U>\'+\'<e g="K" E="x-1R" y="u:G;">\'+8+\'</e>\'+\'</e>\'+\'</e>\'+\'</e>\'+\'</e>\';$(1Q.1T).1S(N);$(\'#\'+6).M({\'d\':d,\'c\':c,\'u\':\'G\',\'1z\':\'1A\',\'1B\':\'0\',\'1y\':\'0\',\'s\':$(j).s(),\'n\':$(j).n(),\'f\':f,\'1v\':\'1w\'}).L(h);$(\'#\'+6).H(3(){$(\'#J\').L();7 l=k;l=1a(3(){$(\'#J\').Z();t(l)},1x);$(\'#z-A\').12().17(3(R){4(l){t(l)}l=k;4(R.1G==13){D()}})});3 16(){2.9(6)};3 D(){4(9){7 o=9($(\'#z-A\').o(),16);4(!o.10){$(\'#K\').11(1H(8,o.18.8));$(\'#K\').L();$(\'#z-A\').12();q}15{a=o.1I}}2.9(6)}$(\'#14-19\').H(3(){D()});$(j).1F(3(){$(\'#\'+6).M({\'s\':$(j).s(),\'n\':$(j).n()})})};3 O(){7 5=j.5;4(5){5.1C(\'F\',C)}};3 B(){7 5=j.5;4(5){5.1D(\'F\')}};3 V(){7 5=j.5;4(5){7 P=5.1E(\'F\');4(P){q C}}q v}};', 62, 120, '|options|defaultOptions|function|if|sessionStorage|elmId|var|errorMessage|unlockFunc|timeout|idleTimerId|opacity|color|div|background|id|lockspeed|html|window|null|pwInputTimer|resetIdleTimer|height|val||return|bTimeout|width|clearTimeout|display|false|setIdleTimer|screenLock|style|passwd|txt|removeLockState|true|executeUnlock|class|AVW_ScreenLock|none|click|idleStateTimeout|pw|screenLockErrMsg|fadeIn|css|tags|setLockState|lockState|bind|event|100|showLockScreen|button|isLocked|align|i18nText|table|fadeOut|result|text|focus||unlock|else|forceUnlockFunc|keydown|errorCode|btn|setTimeout|mousemove|ロックを解除できません|cell|slow|vertical|center|middle|333|fff|remove|success|touchstart|unlockEvent|touchmove|600000|95|to|Clickして画面ロックを解除してください|入力したパスワードを確認してください|content|zIndex|10000|15000|left|position|fixed|top|setItem|removeItem|getItem|resize|which|format|newTimeout|type|password|value|sysLockScrPwdInput|sysInfoScrLock01|input|placeholder|document|error|append|body|nbsp|OK'.split('|'), 0, {}))
$(function() {
if(avwUserEnvObj.os == 'ipad' || avwUserEnvObj.os == 'android'){
}else{
// placement examples
$('.home').powerTip({placement: 's'});
$('.back').powerTip({placement: 's'});
$('.bmList').powerTip({placement: 's'});
$('.bmAdd').powerTip({placement: 's'});
$('.index').powerTip({placement: 's'});
$('.copy').powerTip({placement: 's'});
$('.memoDisplay').powerTip({placement: 's'});
$('.memoAdd').powerTip({placement: 's'});
$('.marking').powerTip({placement: 's'});
$('.markingToolbar').powerTip({placement: 's'});
$('.begin').powerTip({placement: 'n'});
$('.prev').powerTip({placement: 'n'});
$('.next').powerTip({placement: 'n'});
$('.last').powerTip({placement: 'n'});
$('.expansion').powerTip({placement: 'n'});
$('.fit').powerTip({placement: 'n'});
$('.reduction').powerTip({placement: 'n'});
$('.toolbar').powerTip({placement: 'n'});
}
});
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('$(p(){b(3.2==\'a\'||3.2==\'c\'){}e{$(\'.d\').1({0:\'s\'});$(\'.9\').1({0:\'s\'});$(\'.4\').1({0:\'s\'});$(\'.5\').1({0:\'s\'});$(\'.6\').1({0:\'s\'});$(\'.7\').1({0:\'s\'});$(\'.8\').1({0:\'s\'});$(\'.i\').1({0:\'s\'});$(\'.o\').1({0:\'s\'});$(\'.m\').1({0:\'s\'});$(\'.r\').1({0:\'n\'});$(\'.q\').1({0:\'n\'});$(\'.l\').1({0:\'n\'});$(\'.h\').1({0:\'n\'});$(\'.g\').1({0:\'n\'});$(\'.f\').1({0:\'n\'});$(\'.k\').1({0:\'n\'});$(\'.j\').1({0:\'n\'})}});', 29, 29, 'placement|powerTip|os|avwUserEnvObj|bmList|bmAdd|index|copy|memoDisplay|back|ipad|if|android|home|else|fit|expansion|last|memoAdd|toolbar|reduction|next|markingToolbar||marking|function|prev|begin|'.split('|'), 0, {}))
/// <reference path="common.js" />
/*====Variable====*/
var slideshowImgFrom = 0;
var slideshowImgTo = 4;
var slideshowImageCollection = [];
var slideshowClickFlg = false;
var slideshowInitFlg = true;
var slideshowSelectedIndex = 0;
//0: next - 1: prev
var slideshowControlToggleFlg = 0;
var totalRecord;
var slideshowSelectFirstIndex = 0;
var slideshowSelectLastIndex = 4;
var slideshowMainCurrIndex = 0;
/*==========================================*/
function refreshSlideShowValue(){
slideshowImgFrom = 0;
slideshowImgTo = 4;
slideshowImageCollection = [];
slideshowClickFlg = false;
slideshowInitFlg = true;
slideshowSelectedIndex = 0;
//0: next - 1: prev
slideshowControlToggleFlg = 0;
totalRecord;
slideshowSelectFirstIndex = 0;
slideshowSelectLastIndex = 4;
slideshowMainCurrIndex = 0;
};
//Show Image Preview
function showImagePreview(targetId, imgList) {
refreshSlideShowValue();
//Check if imageList is not null
if (imgList != null && imgList != 'undefined' && imgList.length > 0) {
slideshowImageCollection = setImageSource(imgList);
//Check if targetId is not null
if (targetId != null && targetId != 'undefined') {
if (slideshowImageCollection.length == 1) {
targetId.html('');
targetId.append('<div id="slideWrapper">'
+ '</div>');
var mainImg = $('#slideWrapper');
var cssObj = { 'background-image': 'url(' + slideshowImageCollection[0].thumbnail + ')',
'background-repeat': 'no-repeat',
'background-size': 'contain',
'background-position': 'center',
'background-color': 'black'
};
mainImg.css(cssObj);
mainImg.parent().css('padding-top', '0px');
} else {
renderSlideShowBackground(targetId);
renderSelectImage();
renderMainImage(0);
handleImagePreviewEvent();
}
}
}
else {
renderSlideShowBackground(targetId);
$('.main-control').css('visibility', 'hidden');
$('.slideshow-control').css('visibility', 'hidden');
}
optimizeSizeImagePreview();
};
//Set image source for slide show
function setImageSource(source){
var oldSource = source;
var newSource = [];
for(var nIndex = 0; nIndex < oldSource.length; nIndex++){
newSource.push({index : nIndex, image : oldSource[nIndex], thumbnail : oldSource[nIndex]});
}
return newSource;
};
//render background to show image preview
function renderSlideShowBackground(targetId){
var targetDiv = targetId;
targetDiv.html('');
targetDiv.append('<div id="slideWrapper">'
+' <div class="gallery-image" id="gallery-image">'
+' <div class="main-control" id="main-control-prev"> </div>'
+' <div id="main-img" id="mainThumbnail"><div class="mainThumbnail"></div></div>'
+' <div class="main-control" id="main-control-next"> </div>'
+' </div>'
+' <div class="gallery-thumb">'
+' <div id="control-prev" class="slideshow-control"><img src="././img/arrow-left.gif"></div>'
+' <div id="selector-img">'
+' </div>'
+' <div id="control-next" class="slideshow-control"><img src="././img/arrow-right.gif"></div>'
+' </div>'
+'</div>'
);
$(window).resize(function () {
optimizeSizeImagePreview();
});
//handleImagePreviewEvent();
};
function optimizeSizeImagePreview() {
var maxW = "798";
var ratio = 1.566;
var maxH = maxW / ratio;
if ($("#dialog").width() < maxW || $("#dialog").height() < maxH) {
if ($("#dialog").width() < maxW) {
$("#dialog").css('width', maxW + 'px');
$("#dialog").css('height', maxH + 'px');
}
if ($("#dialog").height() < maxH) {
$("#dialog").css('height', maxH + 'px');
$("#dialog").css('width', maxW + 'px');
}
}
else {
$("#dialog").css('width', maxW + 'px');
$("#dialog").css('height', maxH + 'px');
}
$("#dialog").center();
};
//render select image
function renderSelectImage(){
var selectImg = $('#selector-img');
$.each(slideshowImageCollection, function(i, image){
if(slideshowImgFrom <= i && i <= slideshowImgTo){
selectImg.append('<div class="thumbnail" imageId="'+ image.index +'" style="display:block; background-image : url('+image.thumbnail+')"></div>');
}
else{
selectImg.append('<div class="thumbnail" imageId="'+ image.index +'" style="display:none; background-image : url('+image.thumbnail+')"></div>');
}
});
};
//Handle Image Preview Event
function handleImagePreviewEvent(){
$('#control-next').click(imageSelectNextFunction);
$('#control-prev').click(imageSelectPrevFunction);
$('#main-control-next').click(imageMainSelectNextFunction);
$('#main-control-prev').click(imageMainSelectPrevFunction);
$('.thumbnail').click(selectImgClickFunction);
$('.thumbnail').mouseenter(selectImgMouseEnterFunction);
$('.thumbnail').mouseleave(selectImgMouseLeaveFunction);
$('.main-control').css('opacity','0');
$('#main-control-next').mouseleave(mainControlNextMouseLeaveFunction);
$('#main-control-prev').mouseleave(mainControlPrevMouseLeaveFunction);
if (isTouchDevice() == false) {
//$('.main-control').mouseenter(mainControlMouseEnterFunction);
$('#main-control-next').mouseenter(mainControlNextMouseEnterFunction);
$('#main-control-prev').mouseenter(mainControlPrevMouseEnterFunction);
}
//$('.main-control').mouseleave(mainControlMouseLeaveFunction);
$('.thumbnail:first').css('box-shadow','0px 7px 7px #555');
handleDispNextPrevButton();
};
function mainControlNextMouseEnterFunction(){
$(this).css('opacity','0.5');
};
function mainControlNextMouseLeaveFunction(){
$(this).css('opacity','0');
};
function mainControlPrevMouseEnterFunction(){
$(this).css('opacity','0.5');
};
function mainControlPrevMouseLeaveFunction(){
$(this).css('opacity','0');
};
//Image Preview next icon function
function imageSelectNextFunction(){
if(slideshowSelectLastIndex < slideshowImageCollection.length - 1){
$('#selector-img div:eq('+slideshowSelectFirstIndex+')').animate({width: 'hide'},
{step: function(now, fx){
$('#selector-img div:eq('+slideshowSelectLastIndex+')').animate({width: 'show'});
}
}
);
slideshowSelectFirstIndex = slideshowSelectFirstIndex + 1;
slideshowSelectLastIndex = slideshowSelectLastIndex + 1;
handleDispNextPrevButton();
}
};
//Image preview prev icon function
function imageSelectPrevFunction(){
var fixedIndex = slideshowSelectFirstIndex - 1;
if(slideshowSelectFirstIndex > 0){
$('#selector-img div:eq('+fixedIndex+')').animate({width: 'show'});
$('#selector-img div:eq('+slideshowSelectLastIndex+')').animate({width:'hide'});
slideshowSelectFirstIndex = slideshowSelectFirstIndex - 1;
slideshowSelectLastIndex = slideshowSelectLastIndex - 1;
handleDispNextPrevButton();
}
};
var slideshow_isTransaction = false;
//Main Image next icon function
function imageMainSelectNextFunction() {
if (isTouchDevice() == true) {
$('#main-control-next').css('opacity', '0.5');
}
if (slideshow_isTransaction == false) {
slideshow_isTransaction = true;
var fixedIndex = eval(slideshowMainCurrIndex) + 1;
if (slideshowMainCurrIndex < slideshowImageCollection.length - 1) {
$('#main-img div').animate(
{ "left": "-=100%" },
{
/*duration: "slow",*/
complete: function () {
$('#main-img div').hide();
renderMainImage(fixedIndex);
$('#main-img div').css('left', '+=300%');
$('#main-img div').show();
$('<img/>').attr('src', slideshowImageCollection[fixedIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' });
});
slideshowMainCurrIndex = eval(slideshowMainCurrIndex) + 1;
syncImageMainWithSelectImage();
handleDispNextPrevButton();
}
}
);
}
}
};
//Main Image prev icon function
function imageMainSelectPrevFunction() {
if (isTouchDevice() == true) {
$('#main-control-prev').css('opacity', '0.5');
}
if (slideshow_isTransaction == false) {
slideshow_isTransaction = true;
var fixedIndex = eval(slideshowMainCurrIndex) - 1;
if (slideshowMainCurrIndex > 0) {
$('#main-img div').animate(
{ "left": "+=100%" },
{
duration: "medium",
complete: function () {
$('#main-img div').hide();
renderMainImage(fixedIndex);
$('#main-img div').css('left', '-=300%');
$('#main-img div').show();
$('<img/>').attr('src', slideshowImageCollection[fixedIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' });
});
slideshowMainCurrIndex = eval(slideshowMainCurrIndex) - 1;
syncImageMainWithSelectImage();
handleDispNextPrevButton();
}
}
);
}
}
};
//Selector Image click function
function selectImgClickFunction() {
if (slideshow_isTransaction == false) {
slideshow_isTransaction = true;
var imgIndex = $(this).attr('imageId');
if (imgIndex > slideshowMainCurrIndex) {
$('#main-img div').animate(
{ "left": "-=100%" },
{
duration: "medium",
complete: function () {
$('#main-img div').css('display', 'none');
renderMainImage(imgIndex);
$('#main-img div').css('left', '+=300%');
$('#main-img div').css('display', 'block');
$('<img/>').attr('src', slideshowImageCollection[imgIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' });
});
slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton();
}
}
);
}
else if (imgIndex < slideshowMainCurrIndex) {
$('#main-img div').animate(
{ "left": "+=100%" },
{
duration: "medium",
complete: function () {
$('#main-img div').css('display', 'none');
renderMainImage(imgIndex);
$('#main-img div').css('left', '-=300%');
$('#main-img div').css('display', 'block');
$('<img/>').attr('src', slideshowImageCollection[imgIndex].thumbnail).load(function () {
$('#main-img div').animate({ left: '0%' });
});
slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton();
}
}
);
}
else {
slideshow_isTransaction = false;
slideshowMainCurrIndex = imgIndex;
handleDispNextPrevButton();
}
$('.thumbnail').css('box-shadow', '');
$(this).css('box-shadow', '0px 7px 7px #555');
slideshowClickFlg = true;
}
};
//Render Main Image
function renderMainImage(i) {
var mainImg = $('#main-img div');
mainImg.css('background-image', 'url(' + slideshowImageCollection[i].thumbnail + ')');
slideshow_isTransaction = false;
if (isTouchDevice() == true) {
$('#main-control-next').css('opacity', '0');
$('#main-control-prev').css('opacity', '0');
}
};
function selectImgMouseLeaveFunction(){
if(!slideshowClickFlg){
$('this').css('box-shadow','');
slideshowClickFlg = false;
}
else{
//slideshowClickFlg = false;
}
};
function selectImgMouseEnterFunction(){
$('.thumbnail').css('box-shadow','');
$(this).css('box-shadow','0px 7px 7px #555');
};
//Main control mouse leave function
function mainControlMouseLeaveFunction(){
$('.main-control').css('opacity','0');
};
//Main control mouse enter function
function mainControlMouseEnterFunction(){
$('.main-control').css('opacity','0.5');
};
//Sync Main Image with select Image
function syncImageMainWithSelectImage(){
var thumbImg = $('.thumbnail[imageId="'+ slideshowMainCurrIndex +'"]');
if(thumbImg.is(':hidden')){
if(slideshowMainCurrIndex > slideshowSelectLastIndex){
imageSelectNextFunction();
}
else if(slideshowMainCurrIndex < slideshowSelectFirstIndex){
imageSelectPrevFunction();
}
}
$('.thumbnail').css('box-shadow','');
thumbImg.css('box-shadow','0px 7px 7px #555');
};
//Handle display button control
function handleDispNextPrevButton(){
if(slideshowSelectFirstIndex > 0){
$('#control-prev').css('visibility','visible');
}
else{
$('#control-prev').css('visibility','hidden');
}
if(slideshowSelectLastIndex < (eval(slideshowImageCollection.length) - 1)){
$('#control-next').css('visibility','visible');
}
else{
$('#control-next').css('visibility','hidden');
}
if(slideshowMainCurrIndex > 0){
$('#main-control-prev').css('visibility','visible');
}
else{
$('#main-control-prev').css('visibility','hidden');
}
if(slideshowMainCurrIndex < (eval(slideshowImageCollection.length) - 1)){
$('#main-control-next').css('visibility','visible');
}
else{
$('#main-control-next').css('visibility','hidden');
}
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('a 1i=0;a 1c=4;a e=[];a V=t;a 1A=y;a 1D=0;a 1x=0;a 1N;a o=0;a p=4;a c=0;8 1M(){1i=0;1c=4;e=[];V=t;1A=y;1D=0;1x=0;1N;o=0;p=4;c=0};8 27(w,W){1M();b(W!=1H&&W!=\'1I\'&&W.G>0){e=1J(W);b(w!=1H&&w!=\'1I\'){b(e.G==1){w.1z(\'\');w.Z(\'<2 r="1k">\'+\'</2>\');a X=$(\'#1k\');a 1G={\'B-h\':\'16(\'+e[0].d+\')\',\'B-1F\':\'25-1F\',\'B-2b\':\'2a\',\'B-29\':\'1R\',\'B-20\':\'24\'};X.3(1G);X.21().3(\'22-2p\',\'S\')}l{1m(w);1S();O(0);1Z()}}}l{1m(w);$(\'.6-9\').3(\'q\',\'I\');$(\'.1q-9\').3(\'q\',\'I\')}1n()};8 1J(1C){a 17=1C;a 1l=[];2m(a J=0;J<17.G;J++){1l.2n({1f:J,h:17[J],d:17[J]})}2q 1l};8 1m(w){a 1j=w;1j.1z(\'\');1j.Z(\'<2 r="1k">\'+\' <2 z="1p-h" r="1p-h">\'+\' <2 z="6-9" r="6-9-j"> </2>\'+\' <2 r="6-7" r="1y"><2 z="1y"></2></2>\'+\' <2 z="6-9" r="6-9-g"> </2>\'+\' </2>\'+\' <2 z="1p-2d">\'+\' <2 r="9-j" z="1q-9"><7 K="././7/1E-f.1B"></2>\'+\' <2 r="M-7">\'+\' </2>\'+\' <2 r="9-g" z="1q-9"><7 K="././7/1E-2f.1B"></2>\'+\' </2>\'+\'</2>\');$(2h).2g(8(){1n()});};8 1n(){a H="2i";a 1Y=1.2c;a L=H/1Y;b($("#m").v()<H||$("#m").R()<L){b($("#m").v()<H){$("#m").3(\'v\',H+\'P\');$("#m").3(\'R\',L+\'P\')}b($("#m").R()<L){$("#m").3(\'R\',L+\'P\');$("#m").3(\'v\',H+\'P\')}}l{$("#m").3(\'v\',H+\'P\');$("#m").3(\'R\',L+\'P\')}$("#m").1R()};8 1S(){a 1e=$(\'#M-7\');$.2k(e,8(i,h){b(1i<=i&&i<=1c){1e.Z(\'<2 z="d" 10="\'+h.1f+\'" 1U="N:1w; B-h : 16(\'+h.d+\')"></2>\')}l{1e.Z(\'<2 z="d" 10="\'+h.1f+\'" 1U="N:1v; B-h : 16(\'+h.d+\')"></2>\')}})};8 1Z(){$(\'#9-g\').U(1s);$(\'#9-j\').U(1d);$(\'#6-9-g\').U(1T);$(\'#6-9-j\').U(1O);$(\'.d\').U(1P);$(\'.d\').1g(1L);$(\'.d\').1h(1K);$(\'.6-9\').3(\'n\',\'0\');$(\'#6-9-g\').1h(1V);$(\'#6-9-j\').1h(1W);b(15()==t){$(\'#6-9-g\').1g(1X);$(\'#6-9-j\').1g(1Q)}$(\'.d:26\').3(\'F-D\',\'S C C #11\');u()};8 1X(){$(A).3(\'n\',\'0.5\')};8 1V(){$(A).3(\'n\',\'0\')};8 1Q(){$(A).3(\'n\',\'0.5\')};8 1W(){$(A).3(\'n\',\'0\')};8 1s(){b(p<e.G-1){$(\'#M-7 2:1a(\'+o+\')\').k({v:\'12\'},{28:8(23,2l){$(\'#M-7 2:1a(\'+p+\')\').k({v:\'13\'})}});o=o+1;p=p+1;u()}};8 1d(){a E=o-1;b(o>0){$(\'#M-7 2:1a(\'+E+\')\').k({v:\'13\'});$(\'#M-7 2:1a(\'+p+\')\').k({v:\'12\'});o=o-1;p=p-1;u()}};a x=t;8 1T(){b(15()==y){$(\'#6-9-g\').3(\'n\',\'0.5\')}b(x==t){x=y;a E=Q(c)+1;b(c<e.G-1){$(\'#6-7 2\').k({"f":"-=14%"},{Y:8(){$(\'#6-7 2\').12();O(E);$(\'#6-7 2\').3(\'f\',\'+=1b%\');$(\'#6-7 2\').13();$(\'<7/>\').T(\'K\',e[E].d).19(8(){$(\'#6-7 2\').k({f:\'0%\'})});c=Q(c)+1;1t();u()}})}}};8 1O(){b(15()==y){$(\'#6-9-j\').3(\'n\',\'0.5\')}b(x==t){x=y;a E=Q(c)-1;b(c>0){$(\'#6-7 2\').k({"f":"+=14%"},{1r:"1u",Y:8(){$(\'#6-7 2\').12();O(E);$(\'#6-7 2\').3(\'f\',\'-=1b%\');$(\'#6-7 2\').13();$(\'<7/>\').T(\'K\',e[E].d).19(8(){$(\'#6-7 2\').k({f:\'0%\'})});c=Q(c)-1;1t();u()}})}}};8 1P(){b(x==t){x=y;a s=$(A).T(\'10\');b(s>c){$(\'#6-7 2\').k({"f":"-=14%"},{1r:"1u",Y:8(){$(\'#6-7 2\').3(\'N\',\'1v\');O(s);$(\'#6-7 2\').3(\'f\',\'+=1b%\');$(\'#6-7 2\').3(\'N\',\'1w\');$(\'<7/>\').T(\'K\',e[s].d).19(8(){$(\'#6-7 2\').k({f:\'0%\'})});c=s;u()}})}l b(s<c){$(\'#6-7 2\').k({"f":"+=14%"},{1r:"1u",Y:8(){$(\'#6-7 2\').3(\'N\',\'1v\');O(s);$(\'#6-7 2\').3(\'f\',\'-=1b%\');$(\'#6-7 2\').3(\'N\',\'1w\');$(\'<7/>\').T(\'K\',e[s].d).19(8(){$(\'#6-7 2\').k({f:\'0%\'})});c=s;u()}})}l{x=t;c=s;u()}$(\'.d\').3(\'F-D\',\'\');$(A).3(\'F-D\',\'S C C #11\');V=y}};8 O(i){a X=$(\'#6-7 2\');X.3(\'B-h\',\'16(\'+e[i].d+\')\');x=t;b(15()==y){$(\'#6-9-g\').3(\'n\',\'0\');$(\'#6-9-j\').3(\'n\',\'0\')}};8 1K(){b(!V){$(\'A\').3(\'F-D\',\'\');V=t}l{}};8 1L(){$(\'.d\').3(\'F-D\',\'\');$(A).3(\'F-D\',\'S C C #11\')};8 2o(){$(\'.6-9\').3(\'n\',\'0\')};8 2j(){$(\'.6-9\').3(\'n\',\'0.5\')};8 1t(){a 1o=$(\'.d[10="\'+c+\'"]\');b(1o.2e(\':I\')){b(c>p){1s()}l b(c<o){1d()}}$(\'.d\').3(\'F-D\',\'\');1o.3(\'F-D\',\'S C C #11\')};8 u(){b(o>0){$(\'#9-j\').3(\'q\',\'18\')}l{$(\'#9-j\').3(\'q\',\'I\')}b(p<(Q(e.G)-1)){$(\'#9-g\').3(\'q\',\'18\')}l{$(\'#9-g\').3(\'q\',\'I\')}b(c>0){$(\'#6-9-j\').3(\'q\',\'18\')}l{$(\'#6-9-j\').3(\'q\',\'I\')}b(c<(Q(e.G)-1)){$(\'#6-9-g\').3(\'q\',\'18\')}l{$(\'#6-9-g\').3(\'q\',\'I\')}};', 62, 151, '||div|css|||main|img|function|control|var|if|slideshowMainCurrIndex|thumbnail|slideshowImageCollection|left|next|image||prev|animate|else|dialog|opacity|slideshowSelectFirstIndex|slideshowSelectLastIndex|visibility|id|imgIndex|false|handleDispNextPrevButton|width|targetId|slideshow_isTransaction|true|class|this|background|7px|shadow|fixedIndex|box|length|maxW|hidden|nIndex|src|maxH|selector|display|renderMainImage|px|eval|height|0px|attr|click|slideshowClickFlg|imgList|mainImg|complete|append|imageId|555|hide|show|100|isTouchDevice|url|oldSource|visible|load|eq|300|slideshowImgTo|imageSelectPrevFunction|selectImg|index|mouseenter|mouseleave|slideshowImgFrom|targetDiv|slideWrapper|newSource|renderSlideShowBackground|optimizeSizeImagePreview|thumbImg|gallery|slideshow|duration|imageSelectNextFunction|syncImageMainWithSelectImage|medium|none|block|slideshowControlToggleFlg|mainThumbnail|html|slideshowInitFlg|gif|source|slideshowSelectedIndex|arrow|repeat|cssObj|null|undefined|setImageSource|selectImgMouseLeaveFunction|selectImgMouseEnterFunction|refreshSlideShowValue|totalRecord|imageMainSelectPrevFunction|selectImgClickFunction|mainControlPrevMouseEnterFunction|center|renderSelectImage|imageMainSelectNextFunction|style|mainControlNextMouseLeaveFunction|mainControlPrevMouseLeaveFunction|mainControlNextMouseEnterFunction|ratio|handleImagePreviewEvent|color|parent|padding|now|black|no|first|showImagePreview|step|position|contain|size|566|thumb|is|right|resize|window|798|mainControlMouseEnterFunction|each|fx|for|push|mainControlMouseLeaveFunction|top|return'.split('|'), 0, {}))
$(function() {
$("ul.switchingTab li a").click(function(){
$("div.tabUnitList").each(
function(i) {
var thisID = "#list_"+i;
if($(thisID).css("display") == "block"){
$(thisID).css("display","none");
}
}
);
$("ul.switchingTab li a").removeClass("current");
$(this).addClass("current");
var tabTarget = $(this).attr("href");
var tabTargetID = tabTarget;
$(tabTargetID).css("display","block");
return false;
});
});
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('$(4(){$("c.5 7 a").e(4(){$("h.g").k(4(i){2 3="#j"+i;f($(3).1("0")=="b"){$(3).1("0","q")}});$("c.5 7 a").r("8");$(6).p("8");2 d=$(6).m("l");2 9=d;$(9).1("0","b");o n})});', 28, 28, 'display|css|var|thisID|function|switchingTab|this|li|current|tabTargetID||block|ul|tabTarget|click|if|tabUnitList|div||list_|each|href|attr|false|return|addClass|none|removeClass'.split('|'), 0, {}))
/**
* ABook Viewer for WEB
* Drawing HTML Text Library
* **this library depend on htmlparser.js**
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
/**
* get HTML Text Image URL
*/
function getTextObjectImage(width, height, htmlData) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
var context = canvas.getContext('2d');
var dataHtml = '';
var currentLine = 0;
var lineHeight = 0;
var nextLinePosition = 0;
var lineWidth = width; // 1行の幅
var startPosition = 0; // テキスト描画の開始位置
var hasUnderLine = false; // アンダーラインの有無
var textAlign = 'left'; // テキスト揃え
var margin = 2;
/* remove escape charactor '\' */
dataHtml = htmlData.replace(/\\/, '');
//dataHtml = dataHtml.toLowerCase();
//console.log('dataHtml:' + dataHtml);
// parse
HTMLParser(dataHtml,
{
start: function (tag, attrs, unary) {
var t = tag.toLowerCase();
/*
* DIVタグ
*/
if (t == 'div') {
var align;
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'align') {
align = attrs[i].escaped;
textAlign = align;
}
}
if (align == 'left') {
startPosition = 0;
context.textAlign = 'left';
} else if (align == 'center') {
startPosition = lineWidth / 2;
context.textAlign = 'center';
} else if (align == 'right') {
startPosition = lineWidth;
context.textAlign = 'right';
}
}
/*
* FONTタグ
*/
if (t == 'font') {
var fontFace = 'MS Pゴシック';
var fontSize = '11px';
var fontColor = '#000000';
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'face') {
fontFace = attrs[i].escaped;
}
if (attrName == 'style') {
var styleBase = attrs[i].escaped;
var styles = styleBase.split(';');
for (var j = 0; j < styles.length; j++) {
var style = styles[j].split(':');
if (style[0].toLowerCase() == 'font-size') {
fontSize = style[1];
}
if (style[0].toLowerCase() == 'line-height') {
lineHeight = parseInt(style[1].replace('px', ''));
}
}
}
if (attrName == 'color') {
fontColor = attrs[i].escaped;
}
}
// context に設定
context.font = fontSize + " " + "'" + fontFace + "'";
context.fillStyle = fontColor;
// 行間
nextLinePosition = parseInt(fontSize.replace('px', '')) * (lineHeight / 100);
}
/*
* BR タグ
*/
if (t == 'br') {
currentLine += (nextLinePosition + margin);
}
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = true;
}
},
end: function (tag) {
var t = tag.toLowerCase();
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = false;
}
},
chars: function (text) {
// エンティティ文字を置換
// &nbsp; &gt; &lt; &amp; &yen; &copy; &reg; のみ対応
text = text.replace(/&nbsp;/g, ' ');
text = text.replace(/&gt;/g, '>');
text = text.replace(/&lt;/g, '<');
text = text.replace(/&amp;/g, '&');
text = text.replace(/&copy;/g, '(C)');
text = text.replace(/&reg;/g, '(R)');
text = text.replace(/&yen;/g, '\\');
// 初期描画位置を考慮
if (currentLine == 0) {
currentLine += nextLinePosition / 2;
}
//長い文字列を考慮する
var w = 0;
var index = 0;
var fillText = '';
for (var i = 0; i < text.length; i++) {
var metrices = context.measureText(fillText + text.charAt(i), startPosition, currentLine);
// 幅に収まるならバッファに蓄える
if (metrices.width < lineWidth) {
fillText += text.charAt(i);
}
// はみ出す場合
else {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
context.beginPath();
context.moveTo(0, currentLine + margin);
context.lineTo(lineWidth, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
currentLine += (nextLinePosition + margin);
fillText = text.charAt(i);
}
}
if (fillText.length > 0) {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
var x1, x2;
if (textAlign == 'left') {
x1 = 0;
x2 = metrices.width;
} else if (textAlign == 'center') {
x1 = startPosition - (metrices.width / 2);
x2 = startPosition + (metrices.width / 2);
} else if (textAlign = -'right') {
x1 = startPosition;
x2 = startPosition - metrices.width;
}
context.beginPath();
context.moveTo(x1, currentLine + margin);
context.lineTo(x2, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
currentLine += (nextLinePosition + margin);
}
}
}
);
// 描画したイメージを返却する
var imageUrl = canvas.toDataURL();
return imageUrl;
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('D 15(b,z,Z){3 l=17.18(\'l\');l.b=b;l.z=z;3 5=l.16(\'14\');3 J=\'\';3 7=0;3 K=0;3 n=0;3 r=b;3 8=0;3 s=Q;3 e=\'F\';3 a=2;J=Z.9(/\\\\/,\'\');1g(J,{1j:D(A,d,1i){3 t=A.m();4(t==\'1e\'){3 f;y(3 i=0;i<d.p;i++){3 h=d[i].X.m();4(h==\'f\'){f=d[i].B;e=f}}4(f==\'F\'){8=0;5.e=\'F\'}q 4(f==\'M\'){8=r/2;5.e=\'M\'}q 4(f==\'I\'){8=r;5.e=\'I\'}}4(t==\'N\'){3 O=\'1a 19\';3 E=\'1b\';3 L=\'#1d\';y(3 i=0;i<d.p;i++){3 h=d[i].X.m();4(h==\'1c\'){O=d[i].B}4(h==\'o\'){3 S=d[i].B;3 H=S.U(\';\');y(3 j=0;j<H.p;j++){3 o=H[j].U(\':\');4(o[0].m()==\'N-1h\'){E=o[1]}4(o[0].m()==\'1f-z\'){K=T(o[1].9(\'W\',\'\'))}}}4(h==\'1x\'){L=d[i].B}}5.N=E+" "+"\'"+O+"\'";5.G=L;n=T(E.9(\'W\',\'\'))*(K/1y)}4(t==\'1z\'){7+=(n+a)}4(t==\'u\'){s=1v}},1w:D(A){3 t=A.m();4(t==\'u\'){s=Q}},1A:D(6){6=6.9(/&1u;/g,\' \');6=6.9(/&1n;/g,\'>\');6=6.9(/&1o;/g,\'<\');6=6.9(/&1m;/g,\'&\');6=6.9(/&1k;/g,\'(C)\');6=6.9(/&1l;/g,\'(R)\');6=6.9(/&1s;/g,\'\\\\\');4(7==0){7+=n/2}3 w=0;3 1t=0;3 c=\'\';y(3 i=0;i<6.p;i++){3 k=5.1r(c+6.P(i),8,7);4(k.b<r){c+=6.P(i)}q{5.c(c,8,7+a);4(s){5.10();5.12(0,7+a);5.Y(r,7+a);5.11=5.G;5.13()}7+=(n+a);c=6.P(i)}}4(c.p>0){5.c(c,8,7+a);4(s){3 v,x;4(e==\'F\'){v=0;x=k.b}q 4(e==\'M\'){v=8-(k.b/2);x=8+(k.b/2)}q 4(e=-\'I\'){v=8;x=8-k.b}5.10();5.12(v,7+a);5.Y(x,7+a);5.11=5.G;5.13()}7+=(n+a)}}});3 V=l.1p();1q V};', 62, 99, '|||var|if|context|text|currentLine|startPosition|replace|margin|width|fillText|attrs|textAlign|align||attrName|||metrices|canvas|toLowerCase|nextLinePosition|style|length|else|lineWidth|hasUnderLine|||x1||x2|for|height|tag|escaped||function|fontSize|left|fillStyle|styles|right|dataHtml|lineHeight|fontColor|center|font|fontFace|charAt|false||styleBase|parseInt|split|imageUrl|px|name|lineTo|htmlData|beginPath|strokeStyle|moveTo|stroke|2d|getTextObjectImage|getContext|document|createElement|Pゴシック|MS|11px|face|000000|div|line|HTMLParser|size|unary|start|copy|reg|amp|gt|lt|toDataURL|return|measureText|yen|index|nbsp|true|end|color|100|br|chars'.split('|'), 0, {}))
var zoom_ratioPre = 1;
var zoom_ratio = 1;
var zoom_timer;
var zoom_continue = false;
var zoom_callbackFunction;
var zoom_miliSeconds = 1000; // Default is 1 second
var zoom_oldW = -1;
var zoom_oldH = -1;
function calculateZoomLevel() {
zoom_ratioPre = ClientData.zoom_ratioPre();
if (zoom_timer) {
clearTimeout(zoom_timer);
zoom_timer = null;
}
zoom_ratio = document.documentElement.clientWidth / window.innerWidth;
if (zoom_ratioPre != zoom_ratio) {
if (zoom_oldW == -1) {
zoom_oldW = document.documentElement.clientWidth;
}
if (zoom_oldH == -1) {
zoom_oldH = document.documentElement.clientWidth;
}
if (zoom_callbackFunction) {
zoom_callbackFunction(zoom_ratioPre, zoom_ratio, zoom_oldW, zoom_oldH, window.innerWidth, window.innerHeight);
}
zoom_ratioPre = zoom_ratio;
ClientData.zoom_ratioPre(zoom_ratioPre);
zoom_oldW = window.innerWidth;
zoom_oldH = window.innerHeight;
}
if (zoom_continue == true) {
zoom_timer = setTimeout("calculateZoomLevel();", zoom_miliSeconds);
}
};
function stopDetectZoom() {
zoom_continue = false;
};
function startDetectZoom(params) {
zoom_continue = true;
if (params.callbackFunction) {
zoom_callbackFunction = params.callbackFunction;
}
if (params.time) {
zoom_miliSeconds = params.time;
}
zoom_timer = setTimeout("calculateZoomLevel();", zoom_miliSeconds);
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('0 2=1;0 6=1;0 4;0 a=o;0 c;0 b=u;0 5=-1;0 8=-1;i g(){2=j.2();3(4){r(4);4=q}6=f.e.h/7.d;3(2!=6){3(5==-1){5=f.e.h}3(8==-1){8=f.e.h}3(c){c(2,6,5,8,7.d,7.p)}2=6;j.2(2);5=7.d;8=7.p}3(a==l){4=m("g();",b)}};i t(){a=o};i s(9){a=l;3(9.k){c=9.k}3(9.n){b=9.n}4=m("g();",b)};', 31, 31, 'var||zoom_ratioPre|if|zoom_timer|zoom_oldW|zoom_ratio|window|zoom_oldH|params|zoom_continue|zoom_miliSeconds|zoom_callbackFunction|innerWidth|documentElement|document|calculateZoomLevel|clientWidth|function|ClientData|callbackFunction|true|setTimeout|time|false|innerHeight|null|clearTimeout|startDetectZoom|stopDetectZoom|1000'.split('|'), 0, {}))
......@@ -64,7 +64,7 @@
"dspBkCancel":"Logout",
"txtSearchResult":"Result",
"dspHome":"Home",
"txtLoginUser":"(Ver.20130930)User:",
"txtLoginUser":"(Ver.20131002)User:",
"txtAll":"All",
"txtMkgSize":"Size",
"txtMkgS":"S",
......
......@@ -64,7 +64,7 @@
"dspBkCancel":"バックアップせずにログアウト",
"txtSearchResult":"検索結果",
"dspHome":"ホーム",
"txtLoginUser":"(Ver.20130930)ログイン中:",
"txtLoginUser":"(Ver.20131002)ログイン中:",
"txtAll":"すべて",
"txtMkgSize":"太さ",
"txtMkgS":"小",
......
......@@ -64,7 +64,7 @@
"dspBkCancel":"로그아웃",
"txtSearchResult":"검색 결과",
"dspHome":"홈",
"txtLoginUser":"(Ver.20130930)로그인 중:",
"txtLoginUser":"(Ver.20131002)로그인 중:",
"txtAll":"전체",
"txtMkgSize":"두께",
"txtMkgS":"소",
......

var messageLevel = {};
function checkLimitContent(contentId, func,isNotUnlockScreen) {
var levelContent = parseInt(messageLevel[contentId].alertMessageLevel);
if (levelContent == 1) {
if ($('#limit_level1').length <= 0) {
var html = '<section class="sectionLimitAccess" id="limit_level1">';
html += '<h1 class="lang" lang="txtContentWarning">' + i18nText("txtContentWarning") + '</h1>';
html += '<p class="message"></p>';
html += '<p class="deletebtn">';
html += '<a lang="dspOK" class="ok lang">' + i18nText("dspOK") + '</a>';
html += '<a lang="dspCancel" class="cancel lang">' + i18nText("dspCancel") + '</a>';
html += '</p>';
html += '</section>';
$('body').append(html);
}
$('#limit_level1 .deletebtn .cancel').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level1').hide();
}
);
lockLayout();
$('#limit_level1 .message').html(messageLevel[contentId].alertMessage);
$('#limit_level1').show().center();
$('#limit_level1 .deletebtn .ok').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level1').hide();
func();
}
);
}
else if (levelContent == 2) {
if ($('#limit_level2').length <= 0) {
var html = '<section class="sectionLimitAccess" id="limit_level2">';
html += '<h1 class="lang" lang="txtContentPWTitle">' + i18nText("txtContentPWTitle") + '</h1>';
html += '<p class="message">';
html += '<label class="text lang" lang="txtContentPWMsg">' + i18nText("txtContentPWMsg") + '</label>';
html += '<input type="password" />';
html += '<label class="error" id="lblMessageLimitError"></label>';
html += '</p>';
html += '<p class="deletebtn">';
html += '<a lang="dspOK" class="ok lang">' + i18nText("dspOK") + '</a>';
html += '<a lang="dspCancel" class="cancel lang">' + i18nText("dspCancel") + '</a>';
html += '</p>';
html += '</section>';
$('body').append(html);
// press enter at input password
$('#limit_level2 .message input').keydown(
function (e) {
var code = (e.keyCode ? e.keyCode : e.which);
if (code == 13) { //Enter keycode
$('#limit_level2 .deletebtn .ok').click();
}
}
);
}
$('#limit_level2 .deletebtn .cancel').unbind('click').click(
function () {
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level2').hide();
}
);
// lock layout
lockLayout();
//reset input password
$('#limit_level2 .message input').val('');
// hide error message
$('#lblMessageLimitError').hide();
// show dialog
$('#limit_level2').show().center();
$('#limit_level2 .deletebtn .ok').unbind('click').click(
function () {
var password = $('#limit_level2 .message input').val();
if (!ValidationUtil.CheckRequiredForText(password)) {
$('#lblMessageLimitError').html(i18nText('msgPwdEmpty')).show();
return;
}
// start login
var params = {
previousSid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(),
password: password,
urlpath: ClientData.userInfo_accountPath()
};
// Get url to login
var sysSettings = avwSysSetting();
var apiLoginUrl = sysSettings.apiLoginUrl;
avwCmsApiSyncWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params,
function (data) {
if (data.result == 'success') {
// update sid id
ClientData.userInfo_sid(data.sid);
if (isNotUnlockScreen != 1) {
unlockLayout();
}
$('#limit_level2').hide();
// open content
func();
}
else {
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString()).show();
}
},
function (xhr, statusText, errorThrown) {
var errorCode = 'E001';
if (xhr.responseText && xhr.status != 0) {
errorCode = JSON.parse(xhr.responseText).errorMessage;
}
$('#lblMessageLimitError').html(format(i18nText('msgLoginErrWrong'), errorCode).toString()).show();
});
}
);
}
else // content level 0 or null
{
func();
}
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('9 H={};d 18(D,q,j){9 F=19(H[D].1a);6(F==1){6($(\'#c\').R<=0){9 3=\'<r 5="W" G="c">\';3+=\'<u 5="4" 4="S">\'+8("S")+\'</u>\';3+=\'<p 5="g"></p>\';3+=\'<p 5="f">\';3+=\'<a 4="s" 5="k 4">\'+8("s")+\'</a>\';3+=\'<a 4="v" 5="x 4">\'+8("v")+\'</a>\';3+=\'</p>\';3+=\'</r>\';$(\'O\').K(3)}$(\'#c .f .x\').A(\'b\').b(d(){6(j!=1){w()}$(\'#c\').h()});N();$(\'#c .g\').3(H[D].15);$(\'#c\').m().J();$(\'#c .f .k\').A(\'b\').b(d(){6(j!=1){w()}$(\'#c\').h();q()})}B 6(F==2){6($(\'#7\').R<=0){9 3=\'<r 5="W" G="7">\';3+=\'<u 5="4" 4="11">\'+8("11")+\'</u>\';3+=\'<p 5="g">\';3+=\'<t 5="16 4" 4="X">\'+8("X")+\'</t>\';3+=\'<n 17="i" />\';3+=\'<t 5="14" G="l"></t>\';3+=\'</p>\';3+=\'<p 5="f">\';3+=\'<a 4="s" 5="k 4">\'+8("s")+\'</a>\';3+=\'<a 4="v" 5="x 4">\'+8("v")+\'</a>\';3+=\'</p>\';3+=\'</r>\';$(\'O\').K(3);$(\'#7 .g n\').12(d(e){9 L=(e.I?e.I:e.1r);6(L==13){$(\'#7 .f .k\').b()}})}$(\'#7 .f .x\').A(\'b\').b(d(){6(j!=1){w()}$(\'#7\').h()});N();$(\'#7 .g n\').M(\'\');$(\'#l\').h();$(\'#7\').m().J();$(\'#7 .f .k\').A(\'b\').b(d(){9 i=$(\'#7 .g n\').M();6(!1s.1t(i)){$(\'#l\').3(8(\'1q\')).m();1x}9 10={1y:o.Q(),1v:o.1w(),i:i,1u:o.1o()};9 Y=1e();9 C=Y.C;1p(C,1g,\'1b\',\'1c\',10,d(y){6(y.1d==\'1h\'){o.Q(y.1l);6(j!=1){w()}$(\'#7\').h();q()}B{$(\'#l\').3(V(8(\'P\'),y.U).Z()).m()}},d(z,1m,1n){9 E=\'1i\';6(z.T&&z.1j!=0){E=1k.1f(z.T).U}$(\'#l\').3(V(8(\'P\'),E).Z()).m()})})}B{q()}};', 62, 97, '|||html|lang|class|if|limit_level2|i18nText|var||click|limit_level1|function||deletebtn|message|hide|password|isNotUnlockScreen|ok|lblMessageLimitError|show|input|ClientData||func|section|dspOK|label|h1|dspCancel|unlockLayout|cancel|data|xhr|unbind|else|apiLoginUrl|contentId|errorCode|levelContent|id|messageLevel|keyCode|center|append|code|val|lockLayout|body|msgLoginErrWrong|userInfo_sid|length|txtContentWarning|responseText|errorMessage|format|sectionLimitAccess|txtContentPWMsg|sysSettings|toString|params|txtContentPWTitle|keydown||error|alertMessage|text|type|checkLimitContent|parseInt|alertMessageLevel|webClientLogin|GET|result|avwSysSetting|parse|null|success|E001|status|JSON|sid|statusText|errorThrown|userInfo_accountPath|avwCmsApiSyncWithUrl|msgPwdEmpty|which|ValidationUtil|CheckRequiredForText|urlpath|loginId|userInfo_loginId_session|return|previousSid'.split('|'), 0, {}))
/// しおりリスト画面 - SCRSLS0100
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="init.js" />
//var TotalThread = 0;
var contentTypes = {};
var contentName = {};
var pathImgContentNone = './img/page-none.png';
// Init function of page
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
LockScreen();
document.title = i18nText('dspShiori') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.BookmarkList);
//Check if Force Change password
if (ClientData.requirePasswordChange() != 1) {
// Synchronize bookmarks with server
SyncContent();
// Collection all detail of pages
bookmark_collectAllPages();
$("#dspDelete").click(dspDelete_Click);
$("#dspDelete1").click(dspDelete1_Click);
$("#dspCancel").click(dspCancel_Click);
$("#dspConfirmOK").click(dspConfirmOK_Click);
ClearGrid();
if (ClientData.BookMarkData().length == 0) {
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
$("#dspDelete1").hide();
}
else {
$("#msgShioriNotExists").hide();
$("#dspDelete").show();
$("#dspDelete1").show();
}
// Show book in local storage
//ShowBookmark();
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(dspRead_Click);
HideSorting();
// Default sort is タイトル名, default is asc
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(2);
dspTitleNm_Click();
}
else {
checkForceChangePassword();
}
});
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
// update status sort
//function changeStatusSort(obj, isAsc) {
// $('#sortingDiv .sort li a').removeClass().addClass('lang');
// $('#sortingDiv .sort li').removeClass('current');
// $(obj).addClass(isAsc ? 'ascending_sort' : 'descending_sort').parent().addClass("current");
//};
function dspTitleNm_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 1) { // Name
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(1);
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortTitleName(isAsc);
// $("#dspTitleNm").addClass("active_tops");
// $("#dspTitleNmKn").removeClass("active_tops");
// $("#dspPubDt").removeClass("active_tops");
//changeStatusSort(this, isAsc);
setStatusSort('#dspTitleNm', isAsc);
};
function dspTitleNmKn_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 2) { // Kana
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(2); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortTitleNameKana(isAsc);
// $("#dspTitleNm").removeClass("active_tops");
// $("#dspTitleNmKn").addClass("active_tops");
// $("#dspPubDt").removeClass("active_tops");
//changeStatusSort(this, isAsc);
setStatusSort('#dspTitleNmKn', isAsc);
};
function dspPubDt_Click() {
var isAsc = false;
if (ClientData.sortOpt_searchDivision() == 3) { // Publish date
if (ClientData.sortOpt_sortType() == 1) { // ASC
isAsc = false;
ClientData.sortOpt_sortType(2);
}
else {
isAsc = true;
ClientData.sortOpt_sortType(1);
}
}
else {
ClientData.sortOpt_searchDivision(3); // Kana
ClientData.sortOpt_sortType(1); // default is asc
isAsc = true;
}
SortPubDate(isAsc);
// $("#dspTitleNm").removeClass("active_tops");
// $("#dspTitleNmKn").removeClass("active_tops");
// $("#dspPubDt").addClass("active_tops");
//changeStatusSort(this, isAsc);
setStatusSort('#dspPubDt', isAsc);
};
// Event of each button [読む]
function dspRead_Click() {
var jsondata = $(this).attr("value");
var data = JSON.parse(jsondata);
checkLimitContent(data.contentid, function () { dspRead_Click_callback(data); });
};
//
function dspRead_Click_callback(data) {
ClientData.contentInfo_contentId(data.contentid);
ClientData.bookmark_pageNo(data.pageNo);
ClientData.contentInfo_contentType(data.contentType);
ClientData.IsRefresh(false);
avwScreenMove(ScreenIds.ContentView);
};
// Cancel dialog of deleting
function dspCancel_Click() {
// Close dialog
//$('#dlgConfirm').dialog('close');
$("#delete_shiori").hide();
unlockLayout();
};
// Process deleting
function dspConfirmOK_Click() {
// --------------------------------
// Process deleting [start]
// --------------------------------
// Get selected bookmarks
var arrSelectedBookmarks = $("input[name='chkDelete']:checked");
$.each(arrSelectedBookmarks, function () {
// Delete selected items on layout
var contentid = JSON.parse(this.value).contentid;
var pageNo = JSON.parse(this.value).pageNo;
$(this).parent().parent().parent().remove();
// Remove from ClientData
var bm = ClientData.BookMarkData();
for (var nIndex = bm.length - 1; nIndex >= 0; nIndex--) {
if (bm[nIndex].contentid == contentid && bm[nIndex].pageNo == pageNo) {
bm.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
ClientData.BookMarkData(bm);
if (ClientData.BookMarkData().length == 0) {
// Show error
$("#msgShioriNotExists").show();
$("#dspDelete").hide();
$("#dspDelete1").hide();
}
});
// --------------------------------
// Process deleting [ end ]
// --------------------------------
$("#delete_shiori").hide();
unlockLayout();
};
function dspDelete1_Click() {
dspDelete_Click();
};
function dspDelete_Click() {
if ($("input[name='chkDelete']:checked").length > 0) {
lockLayout();
$("#delete_shiori").show();
$("#delete_shiori").center();
}
};
// Show detail content
function ShowBookmark() {
if (avwHasError()) {
return;
}
else {
var hasMemo = false;
var hasMarking = false;
var contentid = "";
var pageNo = 0;
if (ClientData.BookMarkData().length > 0) {
$("#dspDelete").show();
$("#dspDelete1").show();
}
//TotalThread = ClientData.BookMarkData().length;
for (var nIndex = ClientData.BookMarkData().length - 1; nIndex >= 0; nIndex--) {
hasMarking = false;
hasMemo = false;
contentid = ClientData.BookMarkData()[nIndex].contentid;
pageNo = ClientData.BookMarkData()[nIndex].pageNo;
// Check if contentid has marking
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentid
&& ClientData.MarkingData()[nIndex1].pageNo == pageNo) {
hasMarking = true;
}
}
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentid
&& ClientData.MemoData()[nIndex1].pageNo == pageNo) {
hasMemo = true;
}
}
var pageDetail;
var contentTitle = "";
var contentTitleKana = "";
var contentType = "";
// Search current page if collection that get details before
for (var nIndex2 = 0; nIndex2 < collection_contents.length; nIndex2++) {
if (collection_contents[nIndex2].contentid == contentid) {
contentTitle = collection_contents[nIndex2].contentTitle;
contentTitleKana = collection_contents[nIndex2].contentTitleKana;
contentType = collection_contents[nIndex2].contentType;
// Search in pages
for (var nIndex3 = 0; nIndex3 < collection_contents[nIndex2].pages.length; nIndex3++) {
if (pageNo == collection_contents[nIndex2].pages[nIndex3].pageNo) {
pageDetail = collection_contents[nIndex2].pages[nIndex3];
break;
}
}
}
}
if (pageDetail) {
// If bookmark does not exist
if (pageDetail.existed == true) {
// Show normal
UpdateBookmark(contentid, pageDetail.pageNo, contentTitle, contentTitleKana);
var pageThumbnail = (pageDetail.pageThumbnail != pathImgContentNone) ? ("data:image/jpeg;base64," + pageDetail.pageThumbnail) : pathImgContentNone;
insertRow(contentid, pageThumbnail, htmlEncode(contentTitle),
pageDetail.pageText, pageDetail.pageNo, hasMemo, hasMarking, nIndex, contentType);
}
else {
// Not existed -> Show error
insertRowError(contentid, htmlEncode(contentTitle), pageDetail.pageNo);
}
}
}
$("a[name='dspRead']").unbind('click');
$("a[name='dspRead']").click(dspRead_Click);
}
};
// Hide all sorting symbol
function HideSorting() {
// $("#txtTitleNmAsc").hide();
// $("#txtTitleNmDesc").hide();
// $("#txtTitleNmKnAsc").hide();
// $("#txtTitleNmKnDesc").hide();
// $("#txtPubDtAsc").hide();
// $("#txtPubDtDesc").hide();
$('#menu_sort li a').removeClass('ascending_sort').removeClass('descending_sort');
};
// Sort by title name
function SortTitleName(isAsc) {
// HideSorting();
//
// if (isAsc) {
// $("#txtTitleNmAsc").show();
// }
// else {
// $("#txtTitleNmDesc").show();
// }
setStatusSort('#dspTitleNm', isAsc);
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
strTemp = "";
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (strTemp == "") {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].contentTitle < strTemp) {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].contentTitle > strTemp) {
strTemp = arrSource[nIndex].contentTitle;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
// Clear all rows of grid
function ClearGrid() {
var arrSelectedBookmarks = $("input[name='chkDelete']");
$.each(arrSelectedBookmarks, function () {
$(this).parent().parent().parent().remove();
});
//if (TotalThread == 0) {
//$('#grid tr').remove();
//}
// var arrSelectedBookmarks = $("input[name='chkDelete']");
};
// Sort by title name kana
function SortTitleNameKana(isAsc) {
// HideSorting();
// if (isAsc) {
// $("#txtTitleNmKnAsc").show();
// }
// else {
// $("#txtTitleNmKnDesc").show();
// }
setStatusSort('#dspTitleNmKn', isAsc);
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var strTemp = "";
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
strTemp = "";
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (strTemp == "") {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].contentTitleKana < strTemp) {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].contentTitleKana > strTemp) {
strTemp = arrSource[nIndex].contentTitleKana;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
// Sort by publish date
function SortPubDate(isAsc) {
// HideSorting();
// if (isAsc) {
// $("#txtPubDtAsc").show();
// }
// else {
// $("#txtPubDtDesc").show();
// }
setStatusSort('#dspPubDt', isAsc);
var arrSource = ClientData.BookMarkData();
var arrTarget = [];
var dateTemp = undefined;
var nTempIndex = 0;
var isStop = false;
while (!isStop) {
if (arrSource.length > 0) {
dateTemp = undefined;
// Lookup min item
for (var nIndex = 0; nIndex < arrSource.length; nIndex++) {
if (dateTemp == undefined) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
else {
// ASC
if (isAsc) {
if (arrSource[nIndex].registerDate < dateTemp) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
}
else {
if (arrSource[nIndex].registerDate > dateTemp) {
dateTemp = arrSource[nIndex].registerDate;
nTempIndex = nIndex;
}
}
}
}
// Add to target array
arrTarget.push(arrSource[nTempIndex]);
// Remove min item from source array
arrSource.splice(nTempIndex, 1);
}
else {
isStop = true;
}
}
ClearGrid();
ClientData.BookMarkData(arrTarget);
ShowBookmark();
};
/*
Update information of specified bookmark
*/
function UpdateBookmark(contentid, pageNo, contentTitle, contentTitleKana) {
var arrBookmarks = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < arrBookmarks.length; nIndex++) {
if (contentid == arrBookmarks[nIndex].contentid && pageNo == arrBookmarks[nIndex].pageNo) {
if (contentTitle != null && contentTitle != undefined) {
arrBookmarks[nIndex].contentTitle = contentTitle;
}
if (contentTitleKana != null && contentTitleKana != undefined) {
arrBookmarks[nIndex].contentTitleKana = contentTitleKana;
}
break;
}
}
// Set bookmark back to client data
ClientData.BookMarkData(arrBookmarks);
};
/*
Insert error row
*/
function insertRowError(contentid, pageTitle, pageNo) {
var newRow = "";
newRow += "<section class='sectionBookmark'>";
newRow += " <div class='cnt_section'>";
// newRow += " <div class='check'>";
// newRow += " <input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo + "}'/>";
// newRow += " </div>";
newRow += '<span class="check">';
newRow += "<input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo +"}' />";
newRow += '</span>';
newRow += " <div class='text'>";
newRow += ' <label class="name" style="color: #2D83DA;">' + truncate(pageTitle, 20) + '</label>';
newRow += ' <div class="info">';
newRow += " <label class='lang name' lang='msgShioriDeleted'>" + i18nText('msgShioriDeleted') + "</label>";
newRow += " </div>";
newRow += " </div>";
newRow += "</section>";
$('#pnlTop').after(newRow);
};
// Insert row to grid
function insertRow(contentid, pageThumbnail, pageTitle, pageText, pageNo, hasMemo, hasMarking, index, contentType) {
var imgMarkingHide = '<img style="visibility:hidden" class="pen" alt="" src="./img/list/icon_pen.png" />';
var imgMemoHide = '<img style="visibility:hidden" class="sticker" alt="" src="./img/list/icon_sticker.png" />';
var imgMarking = '<img class="pen" alt="" src="./img/list/icon_pen.png" />';
var imgMemo = '<img class="sticker" alt="" src="./img/list/icon_sticker.png" />';
var newRow = "";
/*newRow += "<section class='sectionBookmark'>";
newRow += "<div class='cnt_section'>";
newRow += "<span class='check'>";
newRow += "<input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo + ", \"index\": " + index+ "}'/>";
newRow += "</span>";
newRow += "<a class='img'>";
newRow += '<img id="pageImg' + contentid + '" src="' + pageThumbnail + '" width="160" height="120" style="display:none;">';
newRow += '<img id="loadingIcon' + contentid + "_" + pageNo + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>';
newRow += "</a>";
newRow += "<div class='text'>";
//newRow += '<label id="Label1" class="name" style="color: #2D83DA;">' + truncate(pageTitle, 20) + '</label>';
newRow += '<a class="name" href="#" id="Label1">' + truncate(pageTitle, 20) + '</a>'; //<img src="img/bookshelf/icon_01.jpg" width="20" height="20" class="listIcon">
newRow += '<div class="info">';
newRow += '<ul class="date">';
newRow += '<li><label id="Label2" class="lang" lang="txtPage">' + i18nText('txtPage') + '</label><label id="Label3">' + pageNo + '</label></li>';
var contentText = htmlEncode(getLines(pageText, 3));
newRow += '<li><label id="Label1">' + truncate(contentText, 80) + '</label></li>';
newRow += "</ul>";
newRow += '<ul class="pic" style="align:right">';
newRow += "<li>";
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function () {
if (imgTemp.width > imgTemp.height) {
$("img#pageImg" + contentid).attr('height', '');
$("img#pageImg" + contentid).removeAttr('height');
$("img#pageImg" + contentid).attr('width', '120');
var realHeight = (120 * imgTemp.height) / imgTemp.width;
$("img#pageImg" + contentid).css('padding-top', (120 - realHeight) / 2 + 'px');
}
else {
$("img#pageImg" + contentid).attr('width', '');
$("img#pageImg" + contentid).removeAttr('width');
$("img#pageImg" + contentid).attr('height', '120');
$("img#pageImg" + contentid).css('padding-top', '0px');
}
$("#loadingIcon" + contentid + "_" + pageNo).fadeOut('slow', function () {
$("img#pageImg" + contentid).fadeIn('slow');
});
};
imgTemp.src = pageThumbnail;
if (hasMemo) {
newRow += imgMemo;
}
else {
newRow += imgMemoHide;
}
newRow += "</li>";
newRow += "<li>";
if (hasMarking) {
newRow += imgMarking;
}
else {
newRow += imgMarkingHide;
}
newRow += "</li>";
newRow += "<li><a class='read lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\"}' lang='txtRead'>" + i18nText('txtRead') + "</a></li>";
newRow += "</ul>";
newRow += "</div>";
newRow += "</div>";
newRow += "</div>";
newRow += "</section>";
*/
newRow += "<section class='sectionBookmark'>";
newRow +='<div class="cnt_section">';
newRow +='<span class="check">';
// newRow +="<input type='checkbox' name='chkDelete' value='{contentid:" + contentid + ", pageNo:" + pageNo + ", index: " + index+ "}' />";
newRow += "<input type='checkbox' name='chkDelete' value='{\"contentid\":" + contentid + ", \"pageNo\":" + pageNo + ", \"index\": " + index + "}'/>";
newRow +='</span>';
newRow +='<a class="img" href="#">';
newRow +='<img id="pageImg' + contentid + '" src="' + pageThumbnail + '" width="160" height="120" style="display:none;">';
newRow +='<img id="loadingIcon' + contentid + "_" + pageNo + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>';
newRow +='</a>';
newRow +='<div class="text">';
//newRow += '<a class="name" href="#"><img src="img/bookshelf/icon_01.jpg" width="20" height="20" class="listIcon">' + truncate(pageTitle, 20) + '</a>';
newRow += '<a class="name" href="#">' + truncate(pageTitle, 20) + '</a>';
newRow +='<div class="info">';
newRow += '<ul class="date">';
var contentText = htmlEncode(getLines(pageText, 3));
newRow += '<li><label id="Label1">' + truncate(contentText, 60) + '</label></li>';
// newRow +='<li>公開日:2012/09/14</li>';
// newRow += '<li>閲覧日:2012/09/18</li>';
newRow +='</ul>';
newRow += '<ul class="pic">';
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function () {
if (imgTemp.width > imgTemp.height) {
$("img#pageImg" + contentid).attr('height', '');
$("img#pageImg" + contentid).removeAttr('height');
$("img#pageImg" + contentid).attr('width', '120');
var realHeight = (120 * imgTemp.height) / imgTemp.width;
$("img#pageImg" + contentid).css('padding-top', (120 - realHeight) / 2 + 'px');
}
else {
$("img#pageImg" + contentid).attr('width', '');
$("img#pageImg" + contentid).removeAttr('width');
$("img#pageImg" + contentid).attr('height', '120');
$("img#pageImg" + contentid).css('padding-top', '0px');
}
$("#loadingIcon" + contentid + "_" + pageNo).fadeOut('slow', function () {
$("img#pageImg" + contentid).fadeIn('slow');
});
};
imgTemp.src = pageThumbnail;
if (hasMemo) {
newRow += '<li><a href="#">' + imgMemo + '</a></li>';
}
else {
newRow += '<li><a href="#">' + imgMemoHide + '</a></li>';
}
// newRow += "</li>";
// newRow += "<li>";
if (hasMarking) {
newRow += '<li><a href="#">' + imgMarking + '</a></li>';
}
else {
newRow += '<li><a href="#">' + imgMarkingHide + '</a></li>';
}
newRow += '<li class="pageno"><label id="Label2" class="lang" lang="txtPage">' + i18nText('txtPage') + '</label><label id="Label3">' + pageNo + '</label></li>';
//newRow +='<li><a href="#"><img class="sticker" src="img/list/icon_sticker.png"></a></li>';
//newRow +='<li><a href="#"><img class="pen" src="img/list/icon_pen.png"></a></li>';
//newRow += "<li><a class='read lang' name='dspRead' value='{contentid:" + contentid + ", pageNo:" + pageNo + "}' lang='txtRead'>" + i18nText('txtRead') + "</a></li>";
newRow += "<li><a class='read lang' name='dspRead' value='{\"contentid\":\"" + contentid + "\", \"pageNo\":\"" + pageNo + "\", \"contentType\":\"" + contentType + "\" }' lang='txtRead'>" + i18nText('txtRead') + "</a></li>";
newRow +='</ul>';
newRow +='</div>';
newRow +='</div>';
newRow +='</div>';
newRow += "</section>";
$('#pnlTop').after(newRow);
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------------------
Setting dialog [start]
----------------------------------------------------------------------------
*/
$(function () {
$("#dspTitleNm").click(dspTitleNm_Click);
$("#dspTitleNmKn").click(dspTitleNmKn_Click);
$("#dspPubDt").click(dspPubDt_Click);
// Check JP language and show title kana
if (getCurrentLanguage() != Consts.ConstLanguage_Ja) {
$("#dspTitleNmKn").hide();
$("#dspTitleNmKn_Seperate").hide();
}
else {
$("#dspTitleNmKn").show();
$("#dspTitleNmKn_Seperate").show();
}
});
// Contains non-exist content
var bookmark_errorContent = [];
// Contain contents
var collection_contents = [];
/*
Get all detail pages of content in bookmark
*/
function bookmark_collectAllPages() {
var arrBookMarks = ClientData.BookMarkData();
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
var contentid = collection_contents[nIndex].contentid;
var pages = [];
// Collect all pages of current content
for (var nIndex1 = 0; nIndex1 < arrBookMarks.length; nIndex1++) {
// Found content
if (arrBookMarks[nIndex1].contentid == contentid) {
pages.push({ pageNo: arrBookMarks[nIndex1].pageNo, pageText: "", pageThumbnail: "", existed: false });
}
}
// Add collected pages to content
collection_contents[nIndex].pages = pages;
// Join pages to request to server
var strPageNos = buildPageNos(collection_contents[nIndex].pages);
// Call api to get all details of pages 1 time
avwCmsApiSync(ClientData.userInfo_accountPath(), "webContentPage", "GET",
{ contentId: contentid, sid: ClientData.userInfo_sid(), pageNos: strPageNos, thumbnailFlg: 1 },
function (data) {
collection_contents[nIndex].contentTitle = data.contentTitle;
collection_contents[nIndex].contentTitleKana = data.contentTitleKana;
for (var nIndex2 = 0; nIndex2 < collection_contents[nIndex].pages.length; nIndex2++) {
var comparePageNo = collection_contents[nIndex].pages[nIndex2].pageNo;
for (var nIndex3 = 0; nIndex3 < data.pages.length; nIndex3++) {
if (data.pages[nIndex2] && comparePageNo == data.pages[nIndex2].pageNo) {
// Set flag to determine page existed
collection_contents[nIndex].pages[nIndex2].existed = true;
// Store detail of page
collection_contents[nIndex].pages[nIndex2].pageText = data.pages[nIndex2].pageText;
collection_contents[nIndex].pages[nIndex2].pageThumbnail = data.pages[nIndex2].pageThumbnail;
}
else if (contentTypes[contentid] == "none" && data.pages.length > 0) {
collection_contents[nIndex].pages[nIndex2].existed = true;
// Store detail of page
collection_contents[nIndex].pages[nIndex2].pageText = ''; //data.pages[0].pageText;
collection_contents[nIndex].pages[nIndex2].pageThumbnail = pathImgContentNone; //data.pages[nIndex2].pageThumbnail;
}
}
}
},
function () { // when server response error
if (contentTypes[contentid] == "none") {
collection_contents[nIndex].contentTitle = contentName[contentid];
for (var nIndex2 = 0; nIndex2 < collection_contents[nIndex].pages.length; nIndex2++) {
collection_contents[nIndex].pages[nIndex2].existed = true;
collection_contents[nIndex].pages[nIndex2].pageThumbnail = pathImgContentNone;
collection_contents[nIndex].pages[nIndex2].pageText = '';
}
}
}
);
}
};
/*
Build pageNos
*/
function buildPageNos(pages) {
var strResult = "";
for (var nIndex = 0; nIndex < pages.length; nIndex++) {
if (strResult == "") {
strResult = "" + pages[nIndex].pageNo;
}
else {
strResult += "," + pages[nIndex].pageNo;
}
}
return strResult;
};
/*
Check a content is error or not
*/
function IsErrorContent(strContentId) {
var isError = false;
for (var nIndex = 0; nIndex < bookmark_errorContent.length; nIndex++) {
if (strContentId == bookmark_errorContent[nIndex].contentid) {
isError = true;
break;
}
}
return isError;
};
/*
Check a content is checked + ok
*/
function IsOKCheckedContent(strContentId) {
var isOK = false;
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
if (strContentId == collection_contents[nIndex].contentid) {
isOK = true;
break;
}
}
return isOK;
};
// Add OK checked content
function AddContent(strContentId, contentType) {
var isFound = false;
for (var nIndex = 0; nIndex < collection_contents.length; nIndex++) {
if (collection_contents[nIndex].contentid == strContentId) {
isFound = true;
break;
}
}
// Add to bufer if it does not exist
if(!isFound) {
collection_contents.push({ 'contentid': strContentId, 'contentType': contentType, 'contentTitle': "", 'contentTitleKana': "", 'pages': [] });
}
};
/*
event of changing language
*/
function changeLanguageCallBackFunction() {
if (getCurrentLanguage() != Consts.ConstLanguage_Ja) {
$("#dspTitleNmKn").hide();
$("#dspTitleNmKn_Seperate").hide();
$("#txtTitleNmKnAsc").hide();
$("#txtTitleNmKnDesc").hide();
}
else {
$("#dspTitleNmKn").show();
$("#dspTitleNmKn_Seperate").show();
if (ClientData.sortOpt_searchDivision() == 2) { // Kana
// if (ClientData.sortOpt_sortType() == 1) { // ASC
// $("#txtTitleNmKnAsc").show();
// }
// else {
// $("#txtTitleNmKnDesc").show();
// }
setStatusSort('#dspTitleNmKn', orderSort == Consts.ConstOrderSetting_Asc);
}
}
document.title = i18nText('dspShiori') + ' | ' + i18nText('sysAppTitle');
};
/*
Synchronize bookmark with server
. Check existence of content
-> Delete absence content in local
. Check existence of pages
-> Delete absence pages in local
*/
function SyncContent() {
// Reset error contents
bookmark_errorContent = [];
// Reset ok checked content
collection_contents = [];
// Get bookmarks from local storage
var arrBookmarks = ClientData.BookMarkData();
for (var nIndex = arrBookmarks.length - 1; nIndex >= 0; nIndex--) {
var oneBookMark = arrBookmarks[nIndex];
// ==================================
// Check existence of content [start]
// ==================================
if (IsErrorContent(oneBookMark.contentid) == false) {
// If content is ok + checked
if (IsOKCheckedContent(oneBookMark.contentid) == false) {
if (!IsExistContent(oneBookMark.contentid)["isExisted"]) {
if (avwHasError()) {
// System error excepting 404
showSystemError();
return;
}
else {
// Add to list of error content
bookmark_errorContent.push({ contentid: oneBookMark.contentid });
// Remove bookmark
arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
// ==================================
// Check existence of content [ end ]
// ==================================
else {
// Add nromal content
AddContent(oneBookMark.contentid, IsExistContent(oneBookMark.contentid)["contentType"]);
}
}
}
else {
arrBookmarks.splice(nIndex, 1);
ClientData.isChangedBookmark(true);
}
}
// Set back to storage
ClientData.BookMarkData(arrBookmarks);
};
/*
Check content whether existed or not
*/
function IsExistContent(strContentId) {
var isExisted = false;
var contentType = '';
var result = [];
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
contentType = data.contentData.contentType;
result["isExisted"] = isExisted;
result["contentType"] = contentType;
// save content type
contentTypes[strContentId] = contentType;
contentName[strContentId] = data.contentData.contentName;
// save alert message level
messageLevel[strContentId] = { alertMessageLevel: data.contentData.alertMessageLevel, alertMessage: data.contentData.alertMessage };
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
showSystemError();
}
});
return result;
};
/*
----------------------------------------------------------------------------
Setting dialog [ end ]
----------------------------------------------------------------------------
*/
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('5 1I={};5 1B={};5 1f=\'./n/4h-1H.1q\';$(1Z).3p(b(){8(!3r(21.3s))K;3o();1Z.2T=T(\'2S\')+\' | \'+T(\'2W\');7.3n(21.3E);8(7.3C()!=1){2V();2E();$("#1m").E(24);$("#19").E(28);$("#3D").E(3d);$("#3I").E(3j);1j();8(7.r().e==0){$("#1M").F();$("#1m").z();$("#19").z()}g{$("#1M").z();$("#1m").F();$("#19").F()}$("a[A=\'1g\']").2g(\'E\');$("a[A=\'1g\']").E(1T);2n();7.O(1);7.B(2);22()}g{3H()}});b 22(){5 j=o;8(7.O()==1){8(7.B()==1){j=o;7.B(2)}g{j=l;7.B(1)}}g{7.O(1);7.B(1);j=l}2m(j);X(\'#26\',j)};b 2N(){5 j=o;8(7.O()==2){8(7.B()==1){j=o;7.B(2)}g{j=l;7.B(1)}}g{7.O(2);7.B(1);j=l}2p(j);X(\'#N\',j)};b 2F(){5 j=o;8(7.O()==3){8(7.B()==1){j=o;7.B(2)}g{j=l;7.B(1)}}g{7.O(3);7.B(1);j=l}2o(j);X(\'#23\',j)};b 1T(){5 2I=$(1p).1o("13");5 m=1X.1N(2I);3v(m.6,b(){2M(m)})};b 2M(m){7.3z(m.6);7.3y(m.c);7.3B(m.s);7.3A(o);3u(21.3F)};b 3d(){$("#1F").z();27()};b 3j(){5 1s=$("1e[A=\'1l\']:2c");$.2l(1s,b(){5 6=1X.1N(1p.13).6;5 c=1X.1N(1p.13).c;$(1p).18().18().18().2q();5 17=7.r();q(5 4=17.e-1;4>=0;4--){8(17[4].6==6&&17[4].c==c){17.11(4,1);7.1Y(l)}}7.r(17);8(7.r().e==0){$("#1M").F();$("#1m").z();$("#19").z()}});$("#1F").z();27()};b 28(){24()};b 24(){8($("1e[A=\'1l\']:2c").e>0){3t();$("#1F").F();$("#1F").3m()}};b 1G(){8(2X()){K}g{5 15=o;5 12=o;5 6="";5 c=0;8(7.r().e>0){$("#1m").F();$("#19").F()}q(5 4=7.r().e-1;4>=0;4--){12=o;15=o;6=7.r()[4].6;c=7.r()[4].c;q(5 x=0;x<7.1K().e;x++){8(7.1K()[x].6==6&&7.1K()[x].c==c){12=l}}q(5 x=0;x<7.1L().e;x++){8(7.1L()[x].6==6&&7.1L()[x].c==c){15=l}}5 I;5 p="";5 u="";5 s="";q(5 h=0;h<d.e;h++){8(d[h].6==6){p=d[h].p;u=d[h].u;s=d[h].s;q(5 P=0;P<d[h].f.e;P++){8(c==d[h].f[P].c){I=d[h].f[P];1d}}}}8(I){8(I.1h==l){2f(6,I.c,p,u);5 D=(I.D!=1f)?("m:3w/3x;3G,"+I.D):1f;2z(6,D,25(p),I.R,I.c,15,12,4,s)}g{2j(6,25(p),I.c)}}}$("a[A=\'1g\']").2g(\'E\');$("a[A=\'1g\']").E(1T)}};b 2n(){$(\'#3q w a\').2b(\'4b\').2b(\'4a\')};b 2m(j){X(\'#26\',j);5 i=7.r();5 L=[];5 v="";5 t=0;5 M=o;1V(!M){8(i.e>0){v="";q(5 4=0;4<i.e;4++){8(v==""){v=i[4].p;t=4}g{8(j){8(i[4].p<v){v=i[4].p;t=4}}g{8(i[4].p>v){v=i[4].p;t=4}}}}L.10(i[t]);i.11(t,1)}g{M=l}}1j();7.r(L);1G()};b 1j(){5 1s=$("1e[A=\'1l\']");$.2l(1s,b(){$(1p).18().18().18().2q()});};b 2p(j){X(\'#N\',j);5 i=7.r();5 L=[];5 v="";5 t=0;5 M=o;1V(!M){8(i.e>0){v="";q(5 4=0;4<i.e;4++){8(v==""){v=i[4].u;t=4}g{8(j){8(i[4].u<v){v=i[4].u;t=4}}g{8(i[4].u>v){v=i[4].u;t=4}}}}L.10(i[t]);i.11(t,1)}g{M=l}}1j();7.r(L);1G()};b 2o(j){X(\'#23\',j);5 i=7.r();5 L=[];5 Q=1i;5 t=0;5 M=o;1V(!M){8(i.e>0){Q=1i;q(5 4=0;4<i.e;4++){8(Q==1i){Q=i[4].1r;t=4}g{8(j){8(i[4].1r<Q){Q=i[4].1r;t=4}}g{8(i[4].1r>Q){Q=i[4].1r;t=4}}}}L.10(i[t]);i.11(t,1)}g{M=l}}1j();7.r(L);1G()};b 2f(6,c,p,u){5 y=7.r();q(5 4=0;4<y.e;4++){8(6==y[4].6&&c==y[4].c){8(p!=2k&&p!=1i){y[4].p=p}8(u!=2k&&u!=1i){y[4].u=u}1d}}7.r(y)};b 2j(6,1x,c){5 9="";9+="<1y k=\'2s\'>";9+=" <G k=\'2r\'>";9+=\'<1C k="2w">\';9+="<1e 2v=\'2u\' A=\'1l\' 13=\'{\\"6\\":"+6+", \\"c\\":"+c+"}\' />";9+=\'</1C>\';9+=" <G k=\'29\'>";9+=\' <J k="A" 1c="4d: #46;">\'+1D(1x,20)+\'</J>\';9+=\' <G k="2d">\';9+=" <J k=\'16 A\' 16=\'2i\'>"+T(\'2i\')+"</J>";9+=" </G>";9+=" </G>";9+="</1y>";$(\'#2P\').2O(9)};b 2z(6,D,1x,R,c,15,12,1O,s){5 3g=\'<n 1c="2y:2x" k="2C" 1u="" S="./n/1t/2B.1q" />\';5 35=\'<n 1c="2y:2x" k="2A" 1u="" S="./n/1t/2t.1q" />\';5 38=\'<n k="2C" 1u="" S="./n/1t/2B.1q" />\';5 3c=\'<n k="2A" 1u="" S="./n/1t/2t.1q" />\';5 9="";9+="<1y k=\'2s\'>";9+=\'<G k="2r">\';9+=\'<1C k="2w">\';9+="<1e 2v=\'2u\' A=\'1l\' 13=\'{\\"6\\":"+6+", \\"c\\":"+c+", \\"1O\\": "+1O+"}\'/>";9+=\'</1C>\';9+=\'<a k="n" 14="#">\';9+=\'<n 1b="H\'+6+\'" S="\'+D+\'" V="45" W="1k" 1c="47:1H;">\';9+=\'<n 1b="39\'+6+"36"+c+\'" S="./n/49.48" W="2e" V="2e" 1c="1S: 4f; "/>\';9+=\'</a>\';9+=\'<G k="29">\';9+=\'<a k="A" 14="#">\'+1D(1x,20)+\'</a>\';9+=\'<G k="2d">\';9+=\'<1w k="4m">\';5 2a=25(4n(R,3));9+=\'<w><J 1b="4l">\'+1D(2a,4i)+\'</J></w>\';9+=\'</1w>\';9+=\'<1w k="4k">\';5 U=4j 4g();U.4o=b(){8(U.V>U.W){$("n#H"+6).1o(\'W\',\'\');$("n#H"+6).3e(\'W\');$("n#H"+6).1o(\'V\',\'1k\');5 3h=(1k*U.W)/U.V;$("n#H"+6).3k(\'1S-3i\',(1k-3h)/2+\'3Q\')}g{$("n#H"+6).1o(\'V\',\'\');$("n#H"+6).3e(\'V\');$("n#H"+6).1o(\'W\',\'1k\');$("n#H"+6).3k(\'1S-3i\',\'3R\')}$("#39"+6+"36"+c).3T(\'37\',b(){$("n#H"+6).3L(\'37\')})};U.S=D;8(15){9+=\'<w><a 14="#">\'+3c+\'</a></w>\'}g{9+=\'<w><a 14="#">\'+35+\'</a></w>\'}8(12){9+=\'<w><a 14="#">\'+38+\'</a></w>\'}g{9+=\'<w><a 14="#">\'+3g+\'</a></w>\'}9+=\'<w k="3K"><J 1b="3M" k="16" 16="3f">\'+T(\'3f\')+\'</J><J 1b="3O">\'+c+\'</J></w>\';9+="<w><a k=\'3U 16\' A=\'1g\' 13=\'{\\"6\\":\\""+6+"\\", \\"c\\":\\""+c+"\\", \\"s\\":\\""+s+"\\" }\' 16=\'34\'>"+T(\'34\')+"</a></w>";9+=\'</1w>\';9+=\'</G>\';9+=\'</G>\';9+=\'</G>\';9+="</1y>";$(\'#2P\').2O(9)};$(b(){$("#26").E(22);$("#N").E(2N);$("#23").E(2F);8(33()!=1W.32){$("#N").z();$("#1A").z()}g{$("#N").F();$("#1A").F()}});5 1n=[];5 d=[];b 2E(){5 1z=7.r();q(5 4=0;4<d.e;4++){5 6=d[4].6;5 f=[];q(5 x=0;x<1z.e;x++){8(1z[x].6==6){f.10({c:1z[x].c,R:"",D:"",1h:o})}}d[4].f=f;5 2H=2Z(d[4].f);2D(7.2J(),"40","2K",{2G:6,2Y:7.30(),42:2H,44:1},b(m){d[4].p=m.p;d[4].u=m.u;q(5 h=0;h<d[4].f.e;h++){5 2Q=d[4].f[h].c;q(5 P=0;P<m.f.e;P++){8(m.f[h]&&2Q==m.f[h].c){d[4].f[h].1h=l;d[4].f[h].R=m.f[h].R;d[4].f[h].D=m.f[h].D}g 8(1I[6]=="1H"&&m.f.e>0){d[4].f[h].1h=l;d[4].f[h].R=\'\';d[4].f[h].D=1f;}}}},b(){8(1I[6]=="1H"){d[4].p=1B[6];q(5 h=0;h<d[4].f.e;h++){d[4].f[h].1h=l;d[4].f[h].D=1f;d[4].f[h].R=\'\'}}})}};b 2Z(f){5 1a="";q(5 4=0;4<f.e;4++){8(1a==""){1a=""+f[4].c}g{1a+=","+f[4].c}}K 1a};b 2U(C){5 1R=o;q(5 4=0;4<1n.e;4++){8(C==1n[4].6){1R=l;1d}}K 1R};b 2R(C){5 1P=o;q(5 4=0;4<d.e;4++){8(C==d[4].6){1P=l;1d}}K 1P};b 31(C,s){5 1Q=o;q(5 4=0;4<d.e;4++){8(d[4].6==C){1Q=l;1d}}8(!1Q){d.10({\'6\':C,\'s\':s,\'p\':"",\'u\':"",\'f\':[]})}};b 3W(){8(33()!=1W.32){$("#N").z();$("#1A").z();$("#3V").z();$("#3X").z()}g{$("#N").F();$("#1A").F();8(7.O()==2){X(\'#N\',3Z==1W.3Y)}}1Z.2T=T(\'2S\')+\' | \'+T(\'2W\')};b 2V(){1n=[];d=[];5 y=7.r();q(5 4=y.e-1;4>=0;4--){5 Z=y[4];8(2U(Z.6)==o){8(2R(Z.6)==o){8(!1U(Z.6)["Y"]){8(2X()){2h();K}g{1n.10({6:Z.6});y.11(4,1);7.1Y(l)}}g{31(Z.6,1U(Z.6)["s"])}}}g{y.11(4,1);7.1Y(l)}}7.r(y)};b 1U(C){5 Y=o;5 s=\'\';5 1E=[];5 2L={2Y:7.30(),43:\'1\',2G:C};2D(7.2J(),"41",\'2K\',2L,b(m){Y=l;s=m.1v.s;1E["Y"]=Y;1E["s"]=s;1I[C]=s;1B[C]=m.1v.1B;3N[C]={3a:m.1v.3a,3b:m.1v.3b}},b(3l,3S,3P){8(3l.4e==4c){Y=o}g{Y=l;2h()}});K 1E};b 1D(1J,e){8(1J.e<=e){K 1J}g{K 1J.3J(0,e)+"..."}};', 62, 273, '||||nIndex|var|contentid|ClientData|if|newRow||function|pageNo|collection_contents|length|pages|else|nIndex2|arrSource|isAsc|class|true|data|img|false|contentTitle|for|BookMarkData|contentType|nTempIndex|contentTitleKana|strTemp|li|nIndex1|arrBookmarks|hide|name|sortOpt_sortType|strContentId|pageThumbnail|click|show|div|pageImg|pageDetail|label|return|arrTarget|isStop|dspTitleNmKn|sortOpt_searchDivision|nIndex3|dateTemp|pageText|src|i18nText|imgTemp|width|height|setStatusSort|isExisted|oneBookMark|push|splice|hasMarking|value|href|hasMemo|lang|bm|parent|dspDelete1|strResult|id|style|break|input|pathImgContentNone|dspRead|existed|undefined|ClearGrid|120|chkDelete|dspDelete|bookmark_errorContent|attr|this|png|registerDate|arrSelectedBookmarks|list|alt|contentData|ul|pageTitle|section|arrBookMarks|dspTitleNmKn_Seperate|contentName|span|truncate|result|delete_shiori|ShowBookmark|none|contentTypes|strInput|MarkingData|MemoData|msgShioriNotExists|parse|index|isOK|isFound|isError|padding|dspRead_Click|IsExistContent|while|Consts|JSON|isChangedBookmark|document||ScreenIds|dspTitleNm_Click|dspPubDt|dspDelete_Click|htmlEncode|dspTitleNm|unlockLayout|dspDelete1_Click|text|contentText|removeClass|checked|info|25px|UpdateBookmark|unbind|showSystemError|msgShioriDeleted|insertRowError|null|each|SortTitleName|HideSorting|SortPubDate|SortTitleNameKana|remove|cnt_section|sectionBookmark|icon_sticker|checkbox|type|check|hidden|visibility|insertRow|sticker|icon_pen|pen|avwCmsApiSync|bookmark_collectAllPages|dspPubDt_Click|contentId|strPageNos|jsondata|userInfo_accountPath|GET|params|dspRead_Click_callback|dspTitleNmKn_Click|after|pnlTop|comparePageNo|IsOKCheckedContent|dspShiori|title|IsErrorContent|SyncContent|sysAppTitle|avwHasError|sid|buildPageNos|userInfo_sid|AddContent|ConstLanguage_Ja|getCurrentLanguage|txtRead|imgMemoHide|_|slow|imgMarking|loadingIcon|alertMessageLevel|alertMessage|imgMemo|dspCancel_Click|removeAttr|txtPage|imgMarkingHide|realHeight|top|dspConfirmOK_Click|css|xmlHttpRequest|center|BookmarkScreen|LockScreen|ready|menu_sort|avwCheckLogin|Login|lockLayout|avwScreenMove|checkLimitContent|image|jpeg|bookmark_pageNo|contentInfo_contentId|IsRefresh|contentInfo_contentType|requirePasswordChange|dspCancel|BookmarkList|ContentView|base64|checkForceChangePassword|dspConfirmOK|substring|pageno|fadeIn|Label2|messageLevel|Label3|errorThrown|px|0px|txtStatus|fadeOut|read|txtTitleNmKnAsc|changeLanguageCallBackFunction|txtTitleNmKnDesc|ConstOrderSetting_Asc|orderSort|webContentPage|webGetContent|pageNos|getType|thumbnailFlg|160|2D83DA|display|gif|data_loading|descending_sort|ascending_sort|404|color|status|46px|Image|page|60|new|pic|Label1|date|getLines|onload'.split('|'), 0, {}))
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables
//----Constant-----------//
var DEFAULT_DISP_NUMBER_RECORD_FROM = 1;
var DEFAULT_DISP_NUMBER_RECORD_TO = 15;
var DEFAULT_SORT_TYPE = '1';
var DEFAULT_SORT_ORDER = '1';
var DEFAULT_SEARCH_DIVISION = 0;
var DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png';
var DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png';
var DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/common/band_new.png';
var iNumberOfNextRecord = 15;
//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 = [];
var ThumbnailForOtherType = {
Thumbnail_ImageType : 'img/image_type.png',
Thumbnail_VideoType : 'img/iPad_video.png',
Thumbnail_MusicType : 'img/thumb_default_sound.png',
Thumbnail_OthersType : 'img/thumb_default_other.png',
Thumbnail_NoFileType : 'img/thumb_default_none.png',
Thumbnail_HtmlType : 'img/thumb_default_html.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 = [];
var totalPage;
var chkSearchTextEmpty = false;
var noRecordFlg = false;
var home_isMove = false;
$(document).ready(function(){
if (!avwCheckLogin(ScreenIds.Login)){
return;
}
LockScreen();
document.title = i18nText('txtSearchResult') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.ContentSearch);
//Check if Force Change password
if(ClientData.requirePasswordChange() != 1){
//Format text display more record
formatDisplayMoreRecord();
//remove hover effect when is touch device
removeHoverCss();
//InitScreen
initialScreen();
//Render Grid
renderGridView();
//Go To Details Page
$('canvas').live('click', canvasClickFunction);
//$('canvas').live('touchstart', canvasClickFunction);
$('canvas').live('touchend', canvasClickFunction);
$('canvas').live('touchmove', function () { home_isMove = true; });
//Open dialog
$('.dialog').live('click', titleClickFunction);
//$('.dialog').live('touchstart', titleClickFunction);
$('.dialog').live('touchend', titleClickFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Show Next Record
$('a#control-nextrecord').click(showNextRecordFunction);
//Sort Title
$('#control-sort-title').click(sortByTitleFunction);
//Sort by title kana
$('#control-sort-titlekana').click(sortByTitleKanaFunction);
//sort by release date
$('#control-sort-releasedate').click(sortByReleaseDateFunction);
//Go To Details Page
$('.button-details').live('click', readSubmenuFunction);
//$('.button-details').live('touchstart', readSubmenuFunction);
$('.button-details').live('touchend', readSubmenuFunction);
$('.button-details').live('touchmove', function () { home_isMove = true; });
$('#main-search').click(searchEventButtonFunction);
$('#txtSearch').keydown(mainSearchKeyDownFunction);
$('#main-search-content').click(mainSearchContentClickFunction);
$('#main-search-tag').click(mainSearchTagClickFunction);
$('#main-search-body').click(mainSearchBodyClickFunction);
$('#control-nextrecord').css('visibility', 'hidden');
$(window).resize(function () {
if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center.
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
}
});
}else{
//Check if Force Change password
checkForceChangePassword();
}
});
function mainSearchBodyClickFunction(){
$('#main-body').attr('checked','checked');
$('#main-tag').removeAttr('checked');
$('#main-content').removeAttr('checked');
};
function mainSearchTagClickFunction(){
$('#main-tag').attr('checked','checked');
$('#main-body').removeAttr('checked');
$('#main-content').removeAttr('checked');
};
function mainSearchContentClickFunction(){
$('#main-content').attr('checked','checked');
$('#main-tag').removeAttr('checked');
$('#main-body').removeAttr('checked');
};
function mainSearchKeyDownFunction(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#main-search').click();
}
};
//Call API
function abapi(name, param, method, callback){
avwCmsApi(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
//Initial screen
function initialScreen(){
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
$('#txtSearch').val(searchText);
//ClientData.searchCond_searchText('');
if(searchDivision == 1){
$('#main-tag').attr('checked',false);
$('#main-body').attr('checked',false);
$('#main-content').attr('checked','checked');
}
else if(searchDivision == 2){
$('#main-content').attr('checked',false);
$('#main-body').attr('checked',false);
$('#main-tag').attr('checked','checked');
}
else
{
$('#main-content').attr('checked',false);
$('#main-tag').attr('checked',false);
$('#main-body').attr('checked','checked');
}
handleLanguage();
};
///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid){
var params = {
sid: id,
searchText: text,
searchDivision: division,
sortType: type,
sortOrder: order,
recordFrom: from,
recordTo: to,
genreId: cateid,
groupId: grpid
};
abapi('webContentList', params, 'POST', function (data) {
$.each(data.contentList, function (i, post) {
var outputDate ="";
if(post.contentDeliveryDate!=null&&post.contentDeliveryDate!=undefined&&post.contentDeliveryDate!='undefined')
{
outputDate=formatDeliveryDate(post.contentDeliveryDate);
}
/* $('#content-grid').append(
'<section>'
+' <div class="cnt_section">'
+' <a class="img">'
+' <canvas height="105px" width="150px" id="content-thumbnail'+post.contentId+'" contentid="'+post.contentId+'" style="display:none;">'
+ ' </canvas>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding-top: 46px; padding-left: 66px"/>'
+ ' </a>'
+' <div class="text">'
+' <a id="title'+post.contentId+'" class="dialog name" contentid="'+post.contentId+'">'+ truncate(htmlEncode(post.contentTitle), 25)+'</a>'
+' <div class="info">'
+' <ul class="date">'
+' <li><span class="lang" lang="txtPubDt"> </span> : '+outputDate+'</li>'
+' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate'+post.contentId+'"> </span></li>'
+' </ul>'
+' <ul class="pic">'
+' <li><img src="'+DEFAULT_IMG_OPTION_MEMO+'" id="imgMemo'+post.contentId+'" class="sticker" /></li>'
+' <li><img src="'+DEFAULT_IMG_OPTION_MARKING+'" id="imgBookMark'+post.contentId+'" class="pen" /></li>'
+' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">読む</a></li>'
+' </ul>'
+' </div>'
+' </div>'
+' </div>'
+'</section>'
);
*/
$('#content-grid').append(
'<section class="sectionsearchlist">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
+ ' <canvas height="110" width="150" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' <img id="loadingIcon' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="name dialog" contentid="' + post.contentId + '">'
+ ' <img class="listIcon" src="'+getIconTypeContent(post.contentType)+'" width="20" height="20">'
+ truncate(htmlEncode(post.contentTitle), 20)
+ ' </a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt"> </span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">'+i18nText("txtRead")+'</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'
);
//Start : Apply New Css - Editor : Long - Date : 09/03/2013 - Summary : Edit for applying new css
/*if(post.contentType == ContentTypeKeys.Type_PDF){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_01.jpg");
};
tempImg.src = "img/bookshelf/icon_01.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Enquete){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_01.jpg");
};
tempImg.src = "img/bookshelf/icon_01.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Html){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_05.jpg");
};
tempImg.src = "img/bookshelf/icon_05.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Image){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_02.jpg");
};
tempImg.src = "img/bookshelf/icon_02.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Music){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_06.jpg");
};
tempImg.src = "img/bookshelf/icon_06.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_NoFile){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_01.jpg");
};
tempImg.src = "img/bookshelf/icon_01.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Others){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_01.jpg");
};
tempImg.src = "img/bookshelf/icon_01.jpg";
}
else if(post.contentType == ContentTypeKeys.Type_Video){
var tempImg = new Image();
tempImg.onload = function(){
$('a#title'+post.contentId + ' img').attr('src', "img/bookshelf/icon_04.jpg");
};
tempImg.src = "img/bookshelf/icon_04.jpg";
}*/
//End : Apply New Css - Editor : Long - Date : 09/03/2013 - Summary : Edit for applying new css
getNextRecordNumForList();
//assign thumbnail to array
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.
// save alert message level
messageLevel[post.contentId] = { alertMessageLevel:post.alertMessageLevel, alertMessage:post.alertMessage};
//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);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null || viewdate != 'undefined') {
$('#lblVdate' + post.contentId).html(viewdate);
}
});
//Get Next record number for list
getNextRecordNumForList();
if(data.totalRecord < data.recordTo){
ClientData.searchCond_recordTo(data.totalRecord);
}else{
ClientData.searchCond_recordTo(data.recordTo);
}
ClientData.searchCond_recordFrom(data.recordFrom);
totalPage = data.totalRecord;
//Render Page number
if(totalPage == 0){
reRenderPageNumber(totalPage, totalPage);
}
else{
reRenderPageNumber(ClientData.searchCond_recordTo(), totalPage);
}
//Toggle scroll to top Control
handleBackToTop();
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
});
};
//Handle Back To Top Button
function handleBackToTop(){
if(ClientData.searchCond_recordTo() >= totalPage){
$('#control-nextrecord').css('visibility','hidden');
}
else{
$('#control-nextrecord').css('visibility','visible');
}
if(totalPage == 0){
$('#control-nextrecord').css('visibility','hidden');
displayResultNoRecord();
noRecordFlg = true;
}
else {
$('#msgSearchNotExist').hide();
$('#content-grid').removeClass('lang');
$('#content-grid').removeAttr('lang');
enableSort();
noRecordFlg = false;
}
};
//Handle language
function handleLanguage(){
//if(ClientData.userInfo_language() == Consts.ConstLanguage_En || ClientData.userInfo_language() == Consts.ConstLanguage_Ko)
if (getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko)
{
$('#control-sort-titlekana').css('display','none');
$('#separate').css('display','none');
$("#titlekana-sorttype").html('');
}
else {
if (ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != '') {
var typeSort = ClientData.searchCond_sortType();
var orderSort = ClientData.searchCond_sortOrder();
// if (typeSort == 2) {
// if (orderSort == Consts.ConstOrderSetting_Asc) {
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// }
// else {
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// }
// }
setStatusSort('#'+$('#menu_sort li.current a').attr('id'),orderSort == Consts.ConstOrderSetting_Asc);
}
if(noRecordFlg){
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}else{
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}
}
};
//Initial Screen
function renderGridView(){
var fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
var toPage = returnNumberDispRecordForList();
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var sid = ClientData.userInfo_sid();
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_searchDivision(searchDivision);
ClientData.searchCond_genreId('');
ClientData.searchCond_groupId('');
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
//Handle display sort
handleSortDisp();
//Language Handle
handleLanguage();
//Refresh GridView
refreshGrid();
if(searchText == '' || searchText == null){
displayResultNoRecord();
chkSearchTextEmpty = true;
noRecordFlg = true;
reRenderPageNumber(0, 0);
}
else {
$('#msgSearchNotExist').hide();
chkSearchTextEmpty = false;
//Render Gridview
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
$('#control-nextrecord').css('visibility','visible');
}
};
//Canvas Click function
function canvasClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('id');
var outputId = contentId.substring(17);
var checkflag = false;
// Set content id for screen: content detail
ClientData.contentInfo_contentId(outputId);
// Get image of selected image
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();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
};
//Re-render page from and total record
function reRenderPageNumber(dispRecord, dispTotal){
$('#dispPage').html(dispRecord);
$('#totalPage').html(dispTotal);
$('.pageNumControl').css('visibility','visible');
};
//Show Next Record Function
function showNextRecordFunction(){
var fromPage = ClientData.searchCond_recordFrom();
var toPage = ClientData.searchCond_recordTo();
var sortType = ClientData.searchCond_sortType();
var sortOrder = ClientData.searchCond_sortOrder();
var searchText = ClientData.searchCond_searchText();
var searchDivision = ClientData.searchCond_searchDivision();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
var sid = ClientData.userInfo_sid();
var totalrecord = totalPage;
if(fromPage == null || fromPage == 'undefined'){
fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
}
if(toPage == null || toPage == 'undefined'){
toPage = returnNumberDispRecordForList();
}
fromPage = eval(toPage) + 1;
var iRecordNumber = eval(totalrecord) - eval(fromPage);
if(iRecordNumber < iNumberOfNextRecord)
{
toPage = eval(fromPage) + eval(iRecordNumber);
}
else
{
toPage = eval(fromPage) + (eval(iNumberOfNextRecord) - 1);
}
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
if(fromPage <= totalrecord)
{
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
}
};
//Sort By Title Function
function sortByTitleFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '1'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▼');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
setStatusSort('#control-sort-title',sortOrder == Consts.ConstOrderSetting_Asc);
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '1';
ClientData.searchCond_sortType(sortType);
//refresh Gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Title Kana function
function sortByTitleKanaFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '2'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
}
setStatusSort('#control-sort-titlekana',sortOrder == Consts.ConstOrderSetting_Asc);
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '2';
//refresh gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Release Date
function sortByReleaseDateFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
var recordTo = ClientData.searchCond_recordTo();
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '3'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▼');
// $('#rDate-sorttype').css('width', '12px');
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
ClientData.searchCond_sortOrder(sortOrder);
}
setStatusSort('#control-sort-releasedate',sortOrder == Consts.ConstOrderSetting_Asc);
if(recordFrom == null || recordFrom == 'undefined'){
recordFrom = DEFAULT_DISP_NUMBER_RECORD_FROM;
ClientData.searchCond_recordFrom(recordFrom);
}
if(recordTo == null || recordTo == 'undefined'){
recordTo = returnNumberDispRecordForList();
ClientData.searchCond_recordFrom(recordTo);
}
sortType = '3';
//refresh gridview
refreshGrid();
//refresh add more record
$('#control-nextrecord').css('visibility','hidden');
ClientData.searchCond_sortType(sortType);
renderContent(sid, ClientData.searchCond_searchText(), ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Get Thumnail base on contentid
function returnThumbnail(contentid){
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, "_blank");
// // redraw content remove new icon
// drawEditImage(contentId);
//
// });
//};
////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;
};
//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) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
// check limit of content
checkLimitContent(contentId,
function()
{
readSubmenuFunction_callback(contentId);
});
};
// read content callback
function readSubmenuFunction_callback(contentId)
{
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
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
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
//Set data for readingcontentid
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);
// redraw content remove new icon
drawEditImage(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
function checkContentMarkingMemoOption(contentId){
//Check if contentid has marking
if(ClientData.MarkingData().length == 0){
$('#imgBookMark'+contentId).css('visibility','hidden');
}
else{
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentId) {
$('#imgBookMark'+contentId).css('visibility','visible');
break;
}
else{
$('#imgBookMark'+contentId).css('visibility','hidden');
}
}
}
if(ClientData.MemoData().length == 0){
$('#imgMemo'+contentId).css('visibility','hidden');
}
else{
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentId) {
$('#imgMemo'+contentId).css('visibility','visible');
break;
}
else
{
$('#imgMemo'+contentId).css('visibility','hidden');
}
}
}
};
//Check if User has read content
function checkUserHasReadContent(contId, resourceVer, metaVer) {
var imgThumb = new Image();
//imgThumb.src = returnThumbnail(contId);
var imgIconNew = new Image();
//imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
var imgIconEdit = new Image();
//imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
var c = document.getElementById('content-thumbnail' + contId);
var ctx = c.getContext('2d');
var readFlg = false;
var versionArr = ClientData.ResourceVersion();
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);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if (ClientData.ReadingContentIds()[nIndex1].contentid == contId) {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
//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;
}
else {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function () {
ctx.drawImage(imgIconNew, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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.
}
}
}
//Check if resource version has change
if (readFlg) {
if (versionArr == null || versionArr <= 0 || versionArr == 'undefined') {
}
else {
for (var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++) {
if (versionArr[nIndex2].contentid == contId) {
if (versionArr[nIndex2].resourceversion != resourceVer) {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
//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;
}
}
}
}
if (metaArr == null || metaArr <= 0 || metaArr == 'undefined') {
}
else {
for (var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++) {
if (metaArr[nIndex2].contentid == contId) {
if (metaArr[nIndex2].metaversion != metaVer) {
imgThumb.onload = function () {
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
imgIconEdit.onload = function () {
ctx.drawImage(imgIconEdit, c.width / 2 - resizeImg[0] / 2, c.height - resizeImg[1]);
$("#loadingIcon" + contId).fadeOut('slow', function () {
$('#content-thumbnail' + contId).fadeIn('slow');
});
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
//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;
}
}
}
}
readFlg = false;
}
};
//draw Edit Image
function drawEditImage(id) {
var img = new Image();
var imgSrc = returnThumbnail(id);
if(imgSrc != null){
}
else{
var contentType = returnContentType(id);
if(contentType == ContentTypeKeys.Type_Image){
imgSrc = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgSrc = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgSrc = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgSrc = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgSrc = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgSrc = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
var c = document.getElementById('content-thumbnail' + id);
//use getContext to use the canvas for drawing
var ctx = c.getContext('2d');
ctx.clearRect(0, 0, c.width, c.height);
img.onload = function () {
var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow');
});
};
img.src = imgSrc;
};
//Search Function
function searchEventButtonFunction(){
var fromPage = DEFAULT_DISP_NUMBER_RECORD_FROM;
var toPage = returnNumberDispRecordForList();
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = $('#txtSearch').val();
var searchDivision;
var content = $('#main-content').attr('checked');
var tag = $('#main-tag').attr('checked');
var body = $('#main-body').attr('checked');
if(content == 'checked')
{
searchDivision = $('#searchbox-content').val();
}
if(tag == 'checked')
{
searchDivision = $('#searchbox-tag').val();
}
if(body == 'checked')
{
searchDivision = $('#searchbox-body').val();
}
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
var sid = ClientData.userInfo_sid();
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
//refresh grid
refreshGrid();
//Handle display sort
handleSortDisp();
if(searchText == '' || searchText == null){
displayResultNoRecord();
chkSearchTextEmpty = true;
noRecordFlg = true;
reRenderPageNumber(0, 0);
}
else {
$('#msgSearchNotExist').hide();
$('#control-nextrecord').css('visibility','hidden');
//Render Gridview
chkSearchTextEmpty = false;
renderContent(sid, searchText, searchDivision, sortType, sortOrder, fromPage, toPage, genreId, groupId);
//$('#control-nextrecord').css('visibility','visible');
}
};
//Render User view date
function renderViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].viewdate;
}
}
};
//set resource version data
function setResourceVersionData(conId){
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if(ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined'){
tempResourceArr = [];
}
else{
tempResourceArr = ClientData.ResourceVersion();
}
for(var i = 0; i < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = resourceVersionArr[i].resourceversion;
break;
}
}
if(tempResourceArr.length > 0){
for(var j = 0; j < tempResourceArr.length; j++){
if(tempResourceArr[j].contentid == conId){
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
}else{
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
function setMetaVersionData(conId){
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if(ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined'){
tempMetaArr = [];
}
else{
tempMetaArr = ClientData.MetaVersion();
}
for(var i = 0; i < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = metaVersionArr[i].metaversion;
break;
}
}
if(tempMetaArr.length > 0){
for(var j = 0; j < tempMetaArr.length; j++){
if(tempMetaArr[j].contentid == conId){
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
}else{
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
ClientData.MetaVersion(tempMetaArr);
};
//handle display sort direction
function handleSortDisp(){
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
var typeSort;
var orderSort;
if(ClientData.searchCond_sortType() == null || ClientData.searchCond_sortType() == 'undefined' || ClientData.searchCond_sortType() == ''){
$('#title-sorttype').html('');
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
}
else{
if(ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != ''){
typeSort = ClientData.searchCond_sortType();
orderSort = ClientData.searchCond_sortOrder();
if(typeSort == 1){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// }
// else{
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▼');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// }
//
// $('#control-sort-title').addClass('active_tops');
setStatusSort('#control-sort-title',orderSort == Consts.ConstOrderSetting_Asc);
}
else if(typeSort == 2){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// }
// else{
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// }
//
// $('#control-sort-titlekana').addClass('active_tops');
setStatusSort('#control-sort-titlekana',orderSort == Consts.ConstOrderSetting_Asc);
}
else if(typeSort == 3){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
// }
// else{
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▼');
// $('#rDate-sorttype').css('width', '12px');
// }
//
// $('#control-sort-releasedate').addClass('active_tops');
setStatusSort('#control-sort-releasedate',orderSort == Consts.ConstOrderSetting_Asc);
}
}
}
};
//convert delivery Date
function formatDeliveryDate(date){
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog
function titleClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var checkflag = false;
var contentid = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentid);
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();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Close Submenu
$('#dlgSubMenu').hide();
//Delete 'new' icon
drawEditImage(contentid);
//Open content Detail
openContentDetail();
};
//Get Number Disp Record For List
function returnNumberDispRecordForList() {
var toPage = 0;
var sysSettings = avwSysSetting();
toPage = sysSettings.bookListCount;
return toPage;
};
//Get number record disp next for list
function getNextRecordNumForList(){
iNumberOfNextRecord = returnNumberDispRecordForList();
};
//refresh sort order
function refreshSortTypeOrder(){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
};
//refresh GridView
function refreshGrid(){
$('#control-nextrecord').css('visibility','hidden');
$('#content-grid').html('');
$('.pageNumControl').css('visibility','hidden');
};
//format text display more record
function formatDisplayMoreRecord(){
i18nReplaceText();
//changeLanguage(ClientData.userInfo_language());
$('#control-nextrecord').html(format(i18nText('dspViewMore'), returnNumberDispRecordForList()));
};
function changeLanguageCallBackFunction(){
handleLanguage();
formatDisplayMoreRecord();
if(chkSearchTextEmpty){
displayResultNoRecord();
} else
{
if(!noRecordFlg)
{
$('#control-nextrecord').css('visibility','visible');
}
enableSort();
}
document.title = i18nText('txtSearchResult') + ' | ' + i18nText('sysAppTitle');
};
function displayResultNoRecord(){
i18nReplaceText();
//$('#content-grid').html(i18nText('msgSearchNotExist'));
//$('#content-grid').css({ 'text-align': 'left', 'margin-top': '20px', 'clear': 'both' });
$('#content-grid').html('');
$('#msgSearchNotExist').show();
$('#msgSearchNotExist').css({ 'text-align': 'left', 'margin-top': '20px', 'clear': 'both' });
$('#control-nextrecord').css('visibility','hidden');
$('.control_sort_on').hide();
$('.control_sort_off').show();
if(getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko){
/*$('#control-sort-titlekana').hide();*/
$('#separate').hide();
$('#control-sort-titlekana').hide();
}
};
function enableSort(){
$('.control_sort_on').show();
$('.control_sort_off').hide();
if(getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko){
$('#control-sort-titlekana').hide();
$('#separate').hide();
}
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function resizeResourceThumbnail(mg, width, height) {
var newWidth;
var newHeight;
/*if(mg.width > mg.height) {
newWidth = width;
newHeight = (mg.height * width)/mg.width;
}
else {
newHeight = height;
newWidth = (mg.width * height)/mg.height;
}*/
var delta=Math.min(width/mg.width,height/mg.height);
newHeight=parseInt(delta*mg.height);
newWidth=parseInt(delta*mg.width);
var result = [newWidth, newHeight];
return result;
};
function removeHoverCss(){
if(isTouchDevice()){
$('#control-sort-title').removeClass('nottouchdevice');
$('#control-sort-titlekana').removeClass('nottouchdevice');
$('#control-sort-releasedate').removeClass('nottouchdevice');
}
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('5 1o=1;5 57=15;5 3M=\'1\';5 3O=\'1\';5 5s=0;5 3W=\'E/4l/5t.1p\';5 4r=\'E/4l/5u.1p\';5 3k=\'E/3X/5p.1p\';5 3t=\'E/3X/5r.1p\';5 32=15;5 2J=[];5 2I=[];5 m={1R:\'E/5y.1p\',28:\'E/5z.1p\',1T:\'E/5A.1p\',24:\'E/5v.1p\',26:\'E/5w.1p\',29:\'E/5h.1p\'};5 A=[];5 2G=[];5 2Q=[];5 1t;5 2k=s;5 2b=s;5 1q=s;$(2O).5i(9(){6(!5d(3p.5e)){N}5f();2O.1w=2j(\'4P\')+\' | \'+2j(\'43\');7.5m(3p.5n);6(7.5o()!=1){3E();4L();4q();3U();$(\'2E\').1H(\'1f\',3q);$(\'2E\').1H(\'3K\',3q);$(\'2E\').1H(\'3P\',9(){1q=L});$(\'.3f\').1H(\'1f\',3A);$(\'.3f\').1H(\'3K\',3A);$(\'.3f\').1H(\'3P\',9(){1q=L});$(\'a#q-Z\').1f(47);$(\'#q-R-1w\').1f(45);$(\'#q-R-1c\').1f(41);$(\'#q-R-34\').1f(40);$(\'.3a-3d\').1H(\'1f\',3s);$(\'.3a-3d\').1H(\'3K\',3s);$(\'.3a-3d\').1H(\'3P\',9(){1q=L});$(\'#v-2H\').1f(4I);$(\'#3L\').5j(50);$(\'#v-2H-y\').1f(4X);$(\'#v-2H-1j\').1f(4Y);$(\'#v-2H-1k\').1f(53);$(\'#q-Z\').u(\'F\',\'10\');$(4O).5k(9(){6($("#35").u("1L")!="37"){$("#35").5l();6($("#35").w()>$(4O).w()){$("#35").u(\'48\',\'0\')}}})}8{5g()}});9 53(){$(\'#v-1k\').H(\'r\',\'r\');$(\'#v-1j\').1U(\'r\');$(\'#v-y\').1U(\'r\')};9 4Y(){$(\'#v-1j\').H(\'r\',\'r\');$(\'#v-1k\').1U(\'r\');$(\'#v-y\').1U(\'r\')};9 4X(){$(\'#v-y\').H(\'r\',\'r\');$(\'#v-1j\').1U(\'r\');$(\'#v-1k\').1U(\'r\')};9 50(e){5 4Q=(e.52?e.52:e.5x);6(4Q==13){$(\'#v-2H\').1f()}};9 4U(3m,4p,3V,4m){5q(7.4Z(),3m,3V,4p,4m,t)};9 4q(){5 11=7.27();5 X=7.1K();$(\'#3L\').2C(11);6(X==1){$(\'#v-1j\').H(\'r\',s);$(\'#v-1k\').H(\'r\',s);$(\'#v-y\').H(\'r\',\'r\')}8 6(X==2){$(\'#v-y\').H(\'r\',s);$(\'#v-1k\').H(\'r\',s);$(\'#v-1j\').H(\'r\',\'r\')}8{$(\'#v-y\').H(\'r\',s);$(\'#v-1j\').H(\'r\',s);$(\'#v-1k\').H(\'r\',\'r\')}30()};9 1O(J,3g,4k,4a,4o,4b,3Z,49,42){5 4R={18:J,11:3g,X:4k,z:4a,n:4o,G:4b,C:3Z,1b:49,1a:42};4U(\'5a\',4R,\'58\',9(1D){$.5b(1D.55,9(i,o){5 1i="";6(o.2V!=t&&o.2V!=D&&o.2V!=\'D\'){1i=4G(o.2V)}$(\'#y-2L\').59(\'<4i 12="5c">\'+\' <2y 12="54">\'+\' <a 12="E">\'+\' <2E w="56" B="66" J="y-1n\'+o.f+\'" h="\'+o.f+\'" 4M="1L:37;">\'+\' </2E>\'+\' <E J="21\'+o.f+\'" g="./E/6c.6d" w="4J" B="4J" 4M="6a: 6b; "/>\'+\' </a>\'+\' <2y 12="3g">\'+\' <a J="1w\'+o.f+\'" 12="3m 3f" h="\'+o.f+\'">\'+\' <E 12="6g" g="\'+6h(o.b)+\'" B="20" w="20">\'+4e(6e(o.6f),20)+\' </a>\'+\' <2y 12="64">\'+\' <3e 12="19">\'+\' <1m><2w 12="1N" 1N="65"> </2w> : \'+1i+\'</1m>\'+\' <1m><2w 12="1N" 1N="62"> </2w>:<2w J="4f\'+o.f+\'"> </2w></1m>\'+\' </3e>\'+\' <3e 12="63">\'+\' <1m><E g="\'+3W+\'" J="3h\'+o.f+\'" 12="68" /></1m>\'+\' <1m><E g="\'+4r+\'" J="33\'+o.f+\'" 12="69" /></1m>\'+\' <1m><a 12="67 1N 3a-3d" h="\'+o.f+\'" 1N="4t">\'+2j("4t")+\'</a></1m>\'+\' </3e>\'+\' </2y>\'+\' </2y>\'+\' </2y>\'+\'</4i>\');3I();5 1W=o.I;6((1W!=t)&&(1W!=\'D\')&&(1W!=\'\')){1W=4K(1W)}2J.14({f:o.f,1n:1W});2I.14({f:o.f,b:o.b});6l[o.f]={4j:o.4j,4g:o.4g};4z(o.f,o.4d,o.4c);2G.14({h:o.f,2h:o.4d});2Q.14({h:o.f,2i:o.4c});4B(o.f);5 V=4F(o.f);6(V!=t||V!=\'D\'){$(\'#4f\'+o.f).W(V)}});3I();6(1D.3l<1D.C){7.1s(1D.3l)}8{7.1s(1D.C)}7.1B(1D.G);1t=1D.3l;6(1t==0){2B(1t,1t)}8{2B(7.1s(),1t)}4s();3F()})};9 4s(){6(7.1s()>=1t){$(\'#q-Z\').u(\'F\',\'10\')}8{$(\'#q-Z\').u(\'F\',\'2l\')}6(1t==0){$(\'#q-Z\').u(\'F\',\'10\');2N();2b=L}8{$(\'#2M\').1l();$(\'#y-2L\').31(\'1N\');$(\'#y-2L\').1U(\'1N\');3J();2b=s}};9 30(){6(2x()==x.3B||2x()==x.3y){$(\'#q-R-1c\').u(\'1L\',\'37\');$(\'#2P\').u(\'1L\',\'37\');$("#1c-1C").W(\'\')}8{6(7.K()!=t&&7.K()!=\'D\'||7.T()!=\'\'){5 2c=7.T();5 1Y=7.K();1V(\'#\'+$(\'#6k 1m.6j a\').H(\'J\'),1Y==x.S)}6(2b){$(\'#q-R-1c\').u(\'1L\',\'38\');$(\'#2P\').u(\'1L\',\'38\')}8{$(\'#q-R-1c\').u(\'1L\',\'38\');$(\'#2P\').u(\'1L\',\'38\')}}};9 3U(){5 U=1o;5 P=1G();5 z=3M;5 n=3O;5 11=7.27();5 X=7.1K();5 18=7.2v();7.1B(U);7.1s(P);7.T(z);7.K(n);7.1K(X);7.23(\'\');7.2a(\'\');5 1b=7.23();5 1a=7.2a();3N();30();2e();6(11==\'\'||11==t){2N();2k=L;2b=L;2B(0,0)}8{$(\'#2M\').1l();2k=s;1O(18,11,X,z,n,U,P,1b,1a);$(\'#q-Z\').u(\'F\',\'2l\')}};9 3q(e){6(e){e.3v()}6(1q==L){1q=s;N}5 f=$(3u).H(\'J\');5 1u=f.4h(17);5 1e=s;7.3w(1u);5 39=2t(1u);7.3x(39);5 b=2u(1u);7.3H(b);6(7.M().p>0){A=7.M();Y(5 O=0;O<A.p;O++){6(A[O].h==1u){1e=L;1d}8{1e=s}}6(!1e){A.14({h:1u,V:\'\',22:\'\'})}}8{A.14({h:1u,V:\'\',22:\'\'})}5 2s=[];7.M(2s);7.M(A);2X(1u);2Y(1u);$(\'#4C\').1l();2T(1u);4D()};9 2B(3Y,3T){$(\'#6i\').W(3Y);$(\'#1t\').W(3T);$(\'.4V\').u(\'F\',\'2l\')};9 47(){5 U=7.1B();5 P=7.1s();5 z=7.T();5 n=7.K();5 11=7.27();5 X=7.1K();5 1b=7.23();5 1a=7.2a();5 18=7.2v();5 3j=1t;6(U==t||U==\'D\'){U=1o}6(P==t||P==\'D\'){P=1G()}U=1F(P)+1;5 3o=1F(3j)-1F(U);6(3o<32){P=1F(U)+1F(3o)}8{P=1F(U)+(1F(32)-1)}7.1B(U);7.1s(P);6(U<=3j){1O(18,11,X,z,n,U,P,1b,1a)}};9 45(){5 n=7.K();5 z=7.T();5 18=7.2v();5 G=1o;5 C=7.1s();5 1b=7.23();5 1a=7.2a();6(n==x.S){6(z==\'1\'){n=x.3i;}8{n=x.S;}7.K(n)}8{n=x.S;7.K(n)}1V(\'#q-R-1w\',n==x.S);6(G==t||G==\'D\'){G=1o;7.1B(G)}6(C==t||C==\'D\'){C=1G();7.1B(C)}z=\'1\';7.T(z);2e();$(\'#q-Z\').u(\'F\',\'10\');1O(18,7.27(),7.1K(),z,n,G,C,1b,1a)};9 41(){5 n=7.K();5 z=7.T();5 18=7.2v();5 G=1o;5 C=7.1s();5 1b=7.23();5 1a=7.2a();6(n==x.S){6(z==\'2\'){n=x.3i;}8{n=x.S;}7.K(n)}8{n=x.S;7.K(n)}1V(\'#q-R-1c\',n==x.S);6(G==t||G==\'D\'){G=1o;7.1B(G)}6(C==t||C==\'D\'){C=1G();7.1B(C)}z=\'2\';2e();$(\'#q-Z\').u(\'F\',\'10\');7.T(z);1O(18,7.27(),7.1K(),z,n,G,C,1b,1a)};9 40(){5 n=7.K();5 z=7.T();5 18=7.2v();5 G=1o;5 C=7.1s();5 1b=7.23();5 1a=7.2a();6(n==x.S){6(z==\'3\'){n=x.3i;}8{n=x.S;}7.K(n)}8{n=x.S;7.K(n)}1V(\'#q-R-34\',n==x.S);6(G==t||G==\'D\'){G=1o;7.1B(G)}6(C==t||C==\'D\'){C=1G();7.1B(C)}z=\'3\';2e();$(\'#q-Z\').u(\'F\',\'10\');7.T(z);1O(18,7.27(),7.1K(),z,n,G,C,1b,1a)};9 2t(h){Y(5 i=0;i<2J.p;i++){6(2J[i].f==h){N 2J[i].1n}}};9 2u(h){5 4T=2I.p;Y(5 i=0;i<4T;i++){6(2I[i].f==h){N 2I[i].b}}};9 2q(b){6(!(b==l.6o)){N s}8{N L}};9 6m(4S){5 2W=4A();5 2Z=2W.6n;2Z=4W(2Z,7.4Z())+\'/\'+4S;N 2Z};9 3s(e){6(e){e.3v()}6(1q==L){1q=s;N}5 f=$(3u).H(\'h\');5K(f,9(){51(f)})};9 51(f){5 I=2t(f);5 19=2S 5J();5 1I=19.5I()+1;5 1J=19.5N();5 1i=4N(1J,1I,19.5M());7.3w(f);7.3x(I);5 b=2u(f);7.3H(b);5 1e=s;6(7.M().p>0){A=7.M();Y(5 O=0;O<A.p;O++){6(A[O].h==f){1e=L;6(A[O].V==t||A[O].V==\'D\'||A[O].V==\'\'){A[O].V=1i;A[O].22=19}1d}8{1e=s}}6(!1e){A.14({h:f,V:1i,22:19})}}8{A.14({h:f,V:1i,22:19})}5 2s=[];7.M(2s);2X(f);2Y(f);7.M(A);7.5L(s);6(b==l.25){5H(f);2T(f)}8{5D(3p.5C)}};9 4B(f){6(7.3r().p==0){$(\'#33\'+f).u(\'F\',\'10\')}8{Y(5 1g=0;1g<7.3r().p;1g++){6(7.3r()[1g].h==f){$(\'#33\'+f).u(\'F\',\'2l\');1d}8{$(\'#33\'+f).u(\'F\',\'10\')}}}6(7.3n().p==0){$(\'#3h\'+f).u(\'F\',\'10\')}8{Y(5 1g=0;1g<7.3n().p;1g++){6(7.3n()[1g].h==f){$(\'#3h\'+f).u(\'F\',\'2l\');1d}8{$(\'#3h\'+f).u(\'F\',\'10\')}}}};9 4z(Q,4v,4x){5 d=2S 3b();5 1Q=2S 3b();5 1Z=2S 3b();5 c=2O.44(\'y-1n\'+Q);5 16=c.4H(\'2d\');5 2U=s;5 1S=7.2g();5 1X=7.2o();5 36=7.M();5 I=2t(Q);5 b=2u(Q);6(36==t||36<=0||36==\'D\'){d.1x=9(){5 k=1P(d,c.B,c.w);16.1A(d,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);1Q.1x=9(){16.1A(1Q,c.B/ 2 - k[0] /2,c.w-k[1]);$("#21"+Q).2z(\'1h\',9(){$(\'#y-1n\'+Q).2A(\'1h\')})};1Q.g=3t};6(I==\'\'||I==t){6(!2q(b)){6(b==l.2m){d.g=m.1R}8 6(b==l.2f){d.g=m.1T}8 6(b==l.2p){d.g=m.28}8 6(b==l.2r){d.g=m.26}8 6(b==l.25){d.g=m.24}8 6(b==l.2n){d.g=m.29}}}8{d.g=I}}8{Y(5 1g=0;1g<7.M().p;1g++){6(7.M()[1g].h==Q){d.1x=9(){5 k=1P(d,c.B,c.w);16.1A(d,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);$("#21"+Q).2z(\'1h\',9(){$(\'#y-1n\'+Q).2A(\'1h\')})};6(I==\'\'||I==t){6(!2q(b)){6(b==l.2m){d.g=m.1R}8 6(b==l.2f){d.g=m.1T}8 6(b==l.2p){d.g=m.28}8 6(b==l.2r){d.g=m.26}8 6(b==l.25){d.g=m.24}8 6(b==l.2n){d.g=m.29}}}8{d.g=I}2U=L;1d}8{d.1x=9(){5 k=1P(d,c.B,c.w);16.1A(d,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);1Q.1x=9(){16.1A(1Q,c.B/ 2 - k[0] /2,c.w-k[1]);$("#21"+Q).2z(\'1h\',9(){$(\'#y-1n\'+Q).2A(\'1h\')})};1Q.g=3t};6(I==\'\'||I==t){6(!2q(b)){6(b==l.2m){d.g=m.1R}8 6(b==l.2f){d.g=m.1T}8 6(b==l.2p){d.g=m.28}8 6(b==l.2r){d.g=m.26}8 6(b==l.25){d.g=m.24}8 6(b==l.2n){d.g=m.29}}}8{d.g=I}}}}6(2U){6(1S==t||1S<=0||1S==\'D\'){}8{Y(5 1r=0;1r<1S.p;1r++){6(1S[1r].h==Q){6(1S[1r].2h!=4v){d.1x=9(){5 k=1P(d,c.B,c.w);16.1A(d,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);1Z.1x=9(){16.1A(1Z,c.B/ 2 - k[0] /2,c.w-k[1]);$("#21"+Q).2z(\'1h\',9(){$(\'#y-1n\'+Q).2A(\'1h\')})};1Z.g=3k};6(I==\'\'||I==t){6(!2q(b)){6(b==l.2m){d.g=m.1R}8 6(b==l.2f){d.g=m.1T}8 6(b==l.2p){d.g=m.28}8 6(b==l.2r){d.g=m.26}8 6(b==l.25){d.g=m.24}8 6(b==l.2n){d.g=m.29}}}8{d.g=I}1d}}}}6(1X==t||1X<=0||1X==\'D\'){}8{Y(5 1r=0;1r<1X.p;1r++){6(1X[1r].h==Q){6(1X[1r].2i!=4x){d.1x=9(){5 k=1P(d,c.B,c.w);16.1A(d,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);1Z.1x=9(){16.1A(1Z,c.B/ 2 - k[0] /2,c.w-k[1]);$("#21"+Q).2z(\'1h\',9(){$(\'#y-1n\'+Q).2A(\'1h\')})};1Z.g=3k};6(I==\'\'||I==t){6(!2q(b)){6(b==l.2m){d.g=m.1R}8 6(b==l.2f){d.g=m.1T}8 6(b==l.2p){d.g=m.28}8 6(b==l.2r){d.g=m.26}8 6(b==l.25){d.g=m.24}8 6(b==l.2n){d.g=m.29}}}8{d.g=I}1d}}}}2U=s}};9 2T(J){5 E=2S 3b();5 1E=2t(J);6(1E!=t){}8{5 b=2u(J);6(b==l.2m){1E=m.1R}8 6(b==l.2f){1E=m.1T}8 6(b==l.2p){1E=m.28}8 6(b==l.2r){1E=m.26}8 6(b==l.25){1E=m.24}8 6(b==l.2n){1E=m.29}}5 c=2O.44(\'y-1n\'+J);5 16=c.4H(\'2d\');16.5B(0,0,c.B,c.w);E.1x=9(){5 k=1P(E,c.B,c.w);16.1A(E,(c.B/ 2) - (k[0] /2)+4,c.w-k[1]+4,k[0],k[1]);$("#21"+J).2z(\'1h\',9(){$(\'#y-1n\'+J).2A(\'1h\')})};E.g=1E};9 4I(){5 U=1o;5 P=1G();5 z=3M;5 n=3O;5 11=$(\'#3L\').2C();5 X;5 y=$(\'#v-y\').H(\'r\');5 1j=$(\'#v-1j\').H(\'r\');5 1k=$(\'#v-1k\').H(\'r\');6(y==\'r\'){X=$(\'#3R-y\').2C()}6(1j==\'r\'){X=$(\'#3R-1j\').2C()}6(1k==\'r\'){X=$(\'#3R-1k\').2C()}5 1b=7.23();5 1a=7.2a();5 18=7.2v();7.K(n);7.T(z);7.27(11);7.1K(X);2e();3N();6(11==\'\'||11==t){2N();2k=L;2b=L;2B(0,0)}8{$(\'#2M\').1l();$(\'#q-Z\').u(\'F\',\'10\');2k=s;1O(18,11,X,z,n,U,P,1b,1a);}};9 4F(J){Y(5 i=0;i<7.M().p;i++){6(7.M()[i].h==J){N 7.M()[i].V}}};9 2X(1y){5 1v;5 2D;5 1M=s;6(7.2g().p<=0||7.2g()==t||7.2g()==\'D\'){1v=[]}8{1v=7.2g()}Y(5 i=0;i<2G.p;i++){6(2G[i].h==1y){2D=2G[i].2h;1d}}6(1v.p>0){Y(5 j=0;j<1v.p;j++){6(1v[j].h==1y){1v[j].2h=2D;1M=L;1d}8{1M=s}}6(!1M){1v.14({h:1y,2h:2D})}}8{1v.14({h:1y,2h:2D})}7.2g(1v)};9 2Y(1y){5 1z;5 2R;5 1M=s;6(7.2o().p<=0||7.2o()==t||7.2o()==\'D\'){1z=[]}8{1z=7.2o()}Y(5 i=0;i<2Q.p;i++){6(2Q[i].h==1y){2R=2Q[i].2i;1d}}6(1z.p>0){Y(5 j=0;j<1z.p;j++){6(1z[j].h==1y){1z[j].2i=2R;1M=L;1d}8{1M=s}}6(!1M){1z.14({h:1y,2i:2R})}}8{1z.14({h:1y,2i:2R})}7.2o(1z)};9 3N(){5 2c;5 1Y;6(7.T()==t||7.T()==\'D\'||7.T()==\'\'){$(\'#1w-1C\').W(\'\');$(\'#1w-1C\').W(\'\');$(\'#1c-1C\').W(\'\');$(\'#3D-1C\').W(\'\')}8{6(7.K()!=t&&7.K()!=\'D\'||7.T()!=\'\'){2c=7.T();1Y=7.K();6(2c==1){1V(\'#q-R-1w\',1Y==x.S)}8 6(2c==2){1V(\'#q-R-1c\',1Y==x.S)}8 6(2c==3){1V(\'#q-R-34\',1Y==x.S)}}}};9 4G(19){5 1J=19.19;5 1I=1F(19.1I)+1;5 2K=1F(19.2K)+5G;5 1i=2K+\'/\'+((\'\'+1I).p<2?\'0\':\'\')+1I+\'/\'+((\'\'+1J).p<2?\'0\':\'\')+1J;N 1i};9 4N(1J,1I,2K){5 1i=2K+\'/\'+((\'\'+1I).p<2?\'0\':\'\')+1I+\'/\'+((\'\'+1J).p<2?\'0\':\'\')+1J;N 1i};9 4K(4y){5 4w=\'1D:5F/5E;5O,\'+4y;N 4w};9 3A(e){6(e){e.3v()}6(1q==L){1q=s;N}5 1e=s;5 h=$(3u).H(\'h\');5 39=2t(h);7.3x(39);7.3w(h);5 b=2u(h);7.3H(b);6(7.M().p>0){A=7.M();Y(5 O=0;O<A.p;O++){6(A[O].h==h){1e=L;1d}8{1e=s}}6(!1e){A.14({h:h,V:\'\',22:\'\'})}}8{A.14({h:h,V:\'\',22:\'\'})}5 2s=[];7.M(2s);7.M(A);2X(h);2Y(h);$(\'#4C\').1l();2T(h);4D()};9 1G(){5 P=0;5 2W=4A();P=2W.5Y;N P};9 3I(){32=1G()};9 5X(){$(\'#1w-1C\').W(\'\');$(\'#1c-1C\').W(\'\');$(\'#3D-1C\').W(\'\');$(\'#3D-1C\').W(\'\')};9 2e(){$(\'#q-Z\').u(\'F\',\'10\');$(\'#y-2L\').W(\'\');$(\'.4V\').u(\'F\',\'10\')};9 3E(){3F();$(\'#q-Z\').W(4W(2j(\'5W\'),1G()))};9 61(){30();3E();6(2k){2N()}8{6(!2b){$(\'#q-Z\').u(\'F\',\'2l\')}3J()}2O.1w=2j(\'4P\')+\' | \'+2j(\'43\')};9 2N(){3F();$(\'#y-2L\').W(\'\');$(\'#2M\').3G();$(\'#2M\').u({\'3g-60\':\'5Z\',\'5V-48\':\'5R\',\'5Q\':\'5P\'});$(\'#q-Z\').u(\'F\',\'10\');$(\'.4n\').1l();$(\'.4u\').3G();6(2x()==x.3B||2x()==x.3y){$(\'#2P\').1l();$(\'#q-R-1c\').1l()}};9 3J(){$(\'.4n\').3G();$(\'.4u\').1l();6(2x()==x.3B||2x()==x.3y){$(\'#q-R-1c\').1l();$(\'#2P\').1l()}};9 4e(3c,p){6(3c.p<=p){N 3c}8{N 3c.4h(0,p)+"..."}};9 1P(2F,B,w){5 3C;5 3z;5 3Q=5U.5T(B/2F.B,w/2F.w);3z=46(3Q*2F.w);3C=46(3Q*2F.B);5 4E=[3C,3z];N 4E};9 4L(){6(5S()){$(\'#q-R-1w\').31(\'3S\');$(\'#q-R-1c\').31(\'3S\');$(\'#q-R-34\').31(\'3S\')}};', 62, 397, '|||||var|if|ClientData|else|function||contentType||imgThumb||contentId|src|contentid|||resizeImg|ContentTypeKeys|ThumbnailForOtherType|sortOrder|post|length|control|checked|false|null|css|main|height|Consts|content|sortType|contentIdArray|width|recordTo|undefined|img|visibility|recordFrom|attr|contentThumbnail|id|searchCond_sortOrder|true|ReadingContentIds|return|nIndex|toPage|contId|sort|ConstOrderSetting_Asc|searchCond_sortType|fromPage|viewdate|html|searchDivision|for|nextrecord|hidden|searchText|class||push||ctx||sid|date|groupId|genreId|titlekana|break|checkflag|click|nIndex1|slow|outputDate|tag|body|hide|li|thumbnail|DEFAULT_DISP_NUMBER_RECORD_FROM|png|home_isMove|nIndex2|searchCond_recordTo|totalPage|outputId|tempResourceArr|title|onload|conId|tempMetaArr|drawImage|searchCond_recordFrom|sorttype|data|imgSrc|eval|returnNumberDispRecordForList|live|month|day|searchCond_searchDivision|display|flag|lang|renderContent|resizeResourceThumbnail|imgIconNew|Thumbnail_ImageType|versionArr|Thumbnail_MusicType|removeAttr|setStatusSort|formatThumbnail|metaArr|orderSort|imgIconEdit||loadingIcon|originviewdate|searchCond_genreId|Thumbnail_OthersType|Type_Others|Thumbnail_NoFileType|searchCond_searchText|Thumbnail_VideoType|Thumbnail_HtmlType|searchCond_groupId|noRecordFlg|typeSort||refreshGrid|Type_Music|ResourceVersion|resourceversion|metaversion|i18nText|chkSearchTextEmpty|visible|Type_Image|Type_Html|MetaVersion|Type_Video|isPdfContent|Type_NoFile|newArray|returnThumbnail|returnContentType|userInfo_sid|span|getCurrentLanguage|div|fadeOut|fadeIn|reRenderPageNumber|val|tempResource|canvas|mg|resourceVersionArr|search|contentTypeArr|thumbnailArr|year|grid|msgSearchNotExist|displayResultNoRecord|document|separate|metaVersionArr|tempMeta|new|drawEditImage|readFlg|contentDeliveryDate|sysSettings|setResourceVersionData|setMetaVersionData|url|handleLanguage|removeClass|iNumberOfNextRecord|imgBookMark|releasedate|contentDetail|readArr|none|block|base64String|button|Image|strInput|details|ul|dialog|text|imgMemo|ConstOrderSetting_Desc|totalrecord|DEFAULT_IMG_CONTENT_EDIT|totalRecord|name|MemoData|iRecordNumber|ScreenIds|canvasClickFunction|MarkingData|readSubmenuFunction|DEFAULT_IMG_CONTENT_NEW|this|preventDefault|contentInfo_contentId|contentInfo_contentThumbnail|ConstLanguage_Ko|newHeight|titleClickFunction|ConstLanguage_En|newWidth|rDate|formatDisplayMoreRecord|i18nReplaceText|show|contentInfo_contentType|getNextRecordNumForList|enableSort|touchend|txtSearch|DEFAULT_SORT_TYPE|handleSortDisp|DEFAULT_SORT_ORDER|touchmove|delta|searchbox|nottouchdevice|dispTotal|renderGridView|method|DEFAULT_IMG_OPTION_MEMO|common|dispRecord|to|sortByReleaseDateFunction|sortByTitleKanaFunction|grpid|sysAppTitle|getElementById|sortByTitleFunction|parseInt|showNextRecordFunction|top|cateid|type|from|metaVersion|resourceVersion|truncate|lblVdate|alertMessage|substring|section|alertMessageLevel|division|list|callback|control_sort_on|order|param|initialScreen|DEFAULT_IMG_OPTION_MARKING|handleBackToTop|txtRead|control_sort_off|resourceVer|outputString|metaVer|imgStr|checkUserHasReadContent|avwSysSetting|checkContentMarkingMemoOption|dlgSubMenu|openContentDetail|result|renderViewDate|formatDeliveryDate|getContext|searchEventButtonFunction|25px|formatStringBase64|removeHoverCss|style|formatNormalDate|window|txtSearchResult|code|params|apiName|iArrCnt|abapi|pageNumControl|format|mainSearchContentClickFunction|mainSearchTagClickFunction|userInfo_accountPath|mainSearchKeyDownFunction|readSubmenuFunction_callback|keyCode|mainSearchBodyClickFunction|cnt_section_list|contentList|110|DEFAULT_DISP_NUMBER_RECORD_TO|POST|append|webContentList|each|sectionsearchlist|avwCheckLogin|Login|LockScreen|checkForceChangePassword|thumb_default_html|ready|keydown|resize|center|BookmarkScreen|ContentSearch|requirePasswordChange|band_updated|avwCmsApi|band_new|DEFAULT_SEARCH_DIVISION|icon_sticker|icon_pen|thumb_default_other|thumb_default_none|which|image_type|iPad_video|thumb_default_sound|clearRect|ContentView|avwScreenMove|jpeg|image|1900|downloadResourceById|getMonth|Date|checkLimitContent|IsRefresh|getFullYear|getDate|base64|both|clear|20px|isTouchDevice|min|Math|margin|dspViewMore|refreshSortTypeOrder|bookListCount|left|align|changeLanguageCallBackFunction|txtViewDt|pic|info|txtPubDt|150|read|sticker|pen|padding|46px|data_loading|gif|htmlEncode|contentTitle|listIcon|getIconTypeContent|dispPage|current|menu_sort|messageLevel|getURL|apiResourceDlUrl|Type_PDF'.split('|'), 0, {}))
......@@ -1728,7 +1728,9 @@ function handleDisplayToolbar() {
isFullScreen = true;
$('#header_toolbar').hide();
$('#footer_toolbar_2').show();
//START TRB00097
//$('#footer_toolbar_2').show();
//END TRB00097
$('#control_screen_2').show();
$('#footer_toolbar_1').hide();
sizingFullSize(w, h);
......@@ -2453,7 +2455,9 @@ function fullScreenForNotPdfType(){
var $container = $('#dialog');
$('#header_toolbar').hide();
$('#footer_toolbar_2').show();
//START TRB00097
//$('#footer_toolbar_2').show();
//END TRB00097
$('#control_screen_2').show();
$('#footer_toolbar_2').css('z-index', '999');
$('#control_screen_2').css('z-index', '999');
......@@ -3049,19 +3053,29 @@ ContentPage.prototype.drawPage = function (context, opt) {
//var height = this.image.height;
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(opt == null || opt == 0){
getPageSizeByPageNo(changePageIndex(getPageIndex()));
}
else if(opt == 1){
getPageSizeByPageNo(changePageIndex(getPageIndex() + 1));
}
else if(opt == 2){
getPageSizeByPageNo(changePageIndex(getPageIndex() - 1));
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){
getPageSizeByPageNo(changePageIndex(getPageIndex()));
widthEachPage = widthContentImage;
heightEachPage = heightContentImage;
}
else if(opt == 1){
getPageSizeByPageNo(changePageIndex(getPageIndex() + 1));
widthEachNextPage = widthContentImage;
heightEachNextPage = heightContentImage;
}
else if(opt == 2){
getPageSizeByPageNo(changePageIndex(getPageIndex() - 1));
widthEachPrevPage = widthContentImage;
heightEachPrevPage = heightContentImage;
}
}
widthEachPage = widthContentImage;
heightEachPage = heightContentImage;
else{
widthEachPage = widthContentImage;
heightEachPage = heightContentImage;
}
/* set width canvas */
/*
......@@ -3082,25 +3096,59 @@ ContentPage.prototype.drawPage = function (context, opt) {
heightEachPage = widthContentImage;
}
}*/
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(opt == null || opt == 0){
$("#offscreen").attr('height', heightEachPage);
$("#offscreen").attr('width', widthEachPage);
}
else if(opt == 1){
$("#offscreenNext").attr('height', heightEachPage);
$("#offscreenNext").attr('width', widthEachPage);
if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){
$("#offscreen").attr('height', heightEachPage);
$("#offscreen").attr('width', widthEachPage);
}
else if(opt == 1){
$("#offscreenNext").attr('height', heightEachNextPage);
$("#offscreenNext").attr('width', widthEachNextPage);
}
else if(opt == 2){
$("#offscreenPre").attr('height', heightEachPrevPage);
$("#offscreenPre").attr('width', widthEachPrevPage);
}
}
else if(opt == 2){
$("#offscreenPre").attr('height', heightEachPage);
$("#offscreenPre").attr('width', widthEachPage);
else{
if(opt == null || opt == 0){
$("#offscreen").attr('height', heightEachPage);
$("#offscreen").attr('width', widthEachPage);
}
else if(opt == 1){
$("#offscreenNext").attr('height', heightEachPage);
$("#offscreenNext").attr('width', widthEachPage);
}
else if(opt == 2){
$("#offscreenPre").attr('height', heightEachPage);
$("#offscreenPre").attr('width', widthEachPage);
}
}
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
var objPageTemp = this.pageObjects;
var img = new Image();
img.onload = function () {
context.drawImage(img, 0, 0, widthEachPage, heightEachPage);
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(contentType == ContentTypeKeys.Type_PDF){
if(opt == null || opt == 0){
context.drawImage(img, 0, 0, widthEachPage, heightEachPage);
}
else if(opt == 1){
context.drawImage(img, 0, 0, widthEachNextPage, heightEachNextPage);
}
else if(opt == 2){
context.drawImage(img, 0, 0, widthEachPrevPage, heightEachPrevPage);
}
}
else{
context.drawImage(img, 0, 0, widthEachPage, heightEachPage);
}
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
flip(opt);
//Start Function: No.12
if(contentType == ContentTypeKeys.Type_PDF){
......@@ -3371,6 +3419,14 @@ function checkExistNextPrePage() {
var content = new Content();
var srcRect = new Rect(0, 0, 0, 0);
var destRect = new Rect(0, 0, 0, 0);
//START TRB00097
var srcRectNext = new Rect(0, 0, 0, 0);
var srcRectPrev = new Rect(0, 0, 0, 0);
var destRectNext = new Rect(0, 0, 0, 0);
var destRectPrev = new Rect(0, 0, 0, 0);
var moveXNext = 0, moveYNext = 0;
var moveXPrev = 0, moveYPrev = 0;
//END TRB00097
var isDestPositionDetect = false;
var destPosX = 0, destPosY = 0;
var moveX = 0, moveY = 0;
......@@ -3899,14 +3955,21 @@ function drawMemoOnScreen(opt) {
//Start Function : No.4
var canvas;
var context;
//START TRB00097
var tempPageHeight;
var tempPageWidth;
//END TRB00097
var tempPageNo = 0;
if(opt == null || opt == 0){
canvas = document.getElementById('offscreen');
canvasWidth = $('#offscreen').width();
canvasHeight = $('#offscreen').height();
canvasHeight = $('#offscreen').height();
//START TRB00097
tempPageHeight = heightEachPage;
tempPageWidth = widthEachPage;
//END TRB00097
tempPageNo = changePageIndex(getPageIndex());
}
else if(opt == 1){
......@@ -3914,13 +3977,20 @@ function drawMemoOnScreen(opt) {
canvasWidth = $('#offscreenNext').width();
canvasHeight = $('#offscreenNext').height();
//START TRB00097
tempPageHeight = heightEachNextPage;
tempPageWidth = widthEachNextPage;
//END TRB00097
tempPageNo = changePageIndex(getPageIndex() + 1);
}
else if(opt == 2){
canvas = document.getElementById('offscreenPre');
canvasWidth = $('#offscreenPre').width();
canvasHeight = $('#offscreenPre').height();
//START TRB00097
tempPageHeight = heightEachPrevPage;
tempPageWidth = widthEachPrevPage;
//END TRB00097
tempPageNo = changePageIndex(getPageIndex() - 1);
}
......@@ -3943,15 +4013,16 @@ function drawMemoOnScreen(opt) {
&& memoData[nIndex].pageNo == tempPageNo) {
/* create object of memo */
var memoObject = null;
if (memoData[nIndex].posY > heightEachPage - 50) {
memoData[nIndex].posY = heightEachPage - 50;
//START TRB00097
if (memoData[nIndex].posY > tempPageHeight - 50) {
memoData[nIndex].posY = tempPageHeight - 50;
}
if (memoData[nIndex].posX > widthEachPage - 50) {
memoData[nIndex].posX = widthEachPage - 50;
if (memoData[nIndex].posX > tempPageWidth - 50) {
memoData[nIndex].posX = tempPageWidth - 50;
}
//END TRB00097
//Start Function : No.17 - Editor : Long - Date: 08/13/2013 - Summary : Draw newest memo
if(memoData[nIndex].posY != tempPosY && memoData[nIndex].posX != tempPosX){
tempPosX = memoData[nIndex].posX;
......@@ -4131,11 +4202,11 @@ function draw(context, opt) {
getContent().currentPage.drawPage(context);
}
//Draw on next canvas
else if(opt==null || opt == 1){
else if(opt == 1){
getNextContent().currentPage.drawPage(context, 1);
}
//Draw on previous canvas
else if(opt==null || opt == 2){
else if(opt == 2){
getPrevContent().currentPage.drawPage(context, 2);
}
......@@ -4168,126 +4239,374 @@ function flip(opt) {
var context = canvas.getContext('2d');
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
// init rect
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
//if (srcRect.width == 0) {
srcRect = new Rect(0, 0, offscreen.width, offscreen.height);
//}
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
// display rect
srcRect.add(moveX, moveY);
// fix rect
if (srcRect.left < 0) {
srcRect.left = 0;
srcRect.right = srcRect.left + srcRect.width;
} else if (srcRect.right > offscreen.width) {
srcRect.left = offscreen.width - srcRect.width;
srcRect.right = offscreen.width
}
if (srcRect.top < 0) {
srcRect.top = 0;
srcRect.bottom = srcRect.top + srcRect.height;
} else if (srcRect.bottom > offscreen.height) {
srcRect.top = offscreen.height - srcRect.height;
srcRect.bottom = offscreen.height;
}
// target rect
var width = offscreen.width;
var height = offscreen.height;
var aspect = offscreen.width / offscreen.height;
if (canvas.width > canvas.height) {
height = canvas.height;
width = height * aspect;
} else {
width = canvas.width;
height = width / aspect;
if(opt==null || opt == 0){
if (srcRect.width == 0) {
srcRect = new Rect(0, 0, offscreen.width, offscreen.height);
}
}
if (height > canvas.height) {
var size = canvas.height / height;
height = canvas.height;
width = width * size;
else if(opt==1){
srcRectNext = new Rect(0, 0, offscreen.width, offscreen.height);
}
if (width > canvas.width) {
var size = canvas.width / width;
width = canvas.width;
height = height * size;
else if(opt==2){
srcRectPrev = new Rect(0, 0, offscreen.width, offscreen.height);
}
if (userScale != 1 && width < canvas.width) {
width = width * userScale;
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
if(opt==null || opt==0){
// display rect
srcRect.add(moveX, moveY);
// fix rect
if (srcRect.left < 0) {
srcRect.left = 0;
srcRect.right = srcRect.left + srcRect.width;
} else if (srcRect.right > offscreen.width) {
srcRect.left = offscreen.width - srcRect.width;
srcRect.right = offscreen.width
}
if (srcRect.top < 0) {
srcRect.top = 0;
srcRect.bottom = srcRect.top + srcRect.height;
} else if (srcRect.bottom > offscreen.height) {
srcRect.top = offscreen.height - srcRect.height;
srcRect.bottom = offscreen.height;
}
// target rect
var width = offscreen.width;
var height = offscreen.height;
var aspect = offscreen.width / offscreen.height;
if (canvas.width > canvas.height) {
height = canvas.height;
width = height * aspect;
} else {
width = canvas.width;
height = width / aspect;
}
if (height > canvas.height) {
var size = canvas.height / height;
height = canvas.height;
width = width * size;
}
if (width > canvas.width) {
var size = canvas.width / width;
width = canvas.width;
height = height * size;
}
if (userScale != 1 && width < canvas.width) {
} else if (userScale != 1 && height < canvas.height) {
height = height * userScale;
width = width * userScale;
if (width > canvas.width) {
width = canvas.width;
}
} else if (userScale != 1 && height < canvas.height) {
height = height * userScale;
if (height > canvas.height) {
height = canvas.height;
}
}
var destX = 0, destY = 0;
destX = (canvas.width / 2) - (width / 2);
destY = (canvas.height / 2) - (height / 2);
if (destX < 0) {
destX = 0;
}
if (destY < 0) {
destY = 0;
}
if (srcRect.left < 0) {
srcRect.left = 0;
}
if (srcRect.top < 0) {
srcRect.top = 0;
}
destRect = new Rect(destX, destY, width, height);
/* get position for drawing canvas*/
if (isFirstLoad == true) {
nPositionCanvas.left = destRect.left;
nPositionCanvas.right = destRect.right;
nPositionCanvas.top = destRect.top;
nPositionCanvas.bottom = destRect.bottom;
$("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY)
.css('left', destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY)
.css('left', destRect.left + marginX);
isFirstLoad = false;
}
leftCanvas = destX;
topCanvas = destY;
// change scale
scaleX = offscreen.width / width;
scaleY = offscreen.height / height;
// draw canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
context.drawImage(offscreen,
srcRect.left, srcRect.top, srcRect.right - srcRect.left, srcRect.bottom - srcRect.top,
destRect.left, destRect.top, width, height);
context.restore();
}
else if(opt==1){
// display rect
//srcRectNext.add(moveX, moveY);
// fix rect
if (srcRectNext.left < 0) {
srcRectNext.left = 0;
srcRectNext.right = srcRectNext.left + srcRectNext.width;
} else if (srcRectNext.right > offscreen.width) {
srcRectNext.left = offscreen.width - srcRectNext.width;
srcRectNext.right = offscreen.width
}
if (srcRectNext.top < 0) {
srcRectNext.top = 0;
srcRectNext.bottom = srcRectNext.top + srcRectNext.height;
} else if (srcRectNext.bottom > offscreen.height) {
srcRectNext.top = offscreen.height - srcRectNext.height;
srcRectNext.bottom = offscreen.height;
}
// target rect
var width = offscreen.width;
var height = offscreen.height;
var aspect = offscreen.width / offscreen.height;
if (canvas.width > canvas.height) {
height = canvas.height;
width = height * aspect;
} else {
width = canvas.width;
height = width / aspect;
}
if (height > canvas.height) {
var size = canvas.height / height;
height = canvas.height;
width = width * size;
}
}
var destX = 0, destY = 0;
destX = (canvas.width / 2) - (width / 2);
destY = (canvas.height / 2) - (height / 2);
if (destX < 0) {
destX = 0;
}
if (destY < 0) {
destY = 0;
}
if (srcRect.left < 0) {
srcRect.left = 0;
}
if (srcRect.top < 0) {
srcRect.top = 0;
}
destRect = new Rect(destX, destY, width, height);
/* get position for drawing canvas*/
if (isFirstLoad == true) {
nPositionCanvas.left = destRect.left;
nPositionCanvas.right = destRect.right;
nPositionCanvas.top = destRect.top;
nPositionCanvas.bottom = destRect.bottom;
$("#draw_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY)
.css('left', destRect.left + marginX);
$("#marker_canvas").attr('height', destRect.bottom - destRect.top)
.attr('width', destRect.right - destRect.left)
.css('top', destRect.top + marginY)
.css('left', destRect.left + marginX);
isFirstLoad = false;
}
if (width > canvas.width) {
var size = canvas.width / width;
width = canvas.width;
height = height * size;
}
if (userScale != 1 && width < canvas.width)
{
leftCanvas = destX;
topCanvas = destY;
// change scale
scaleX = offscreen.width / width;
scaleY = offscreen.height / height;
width = width * userScale;
if (width > canvas.width) {
width = canvas.width;
}
// draw canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
}
else if (userScale != 1 && height < canvas.height) {
height = height * userScale;
if (height > canvas.height) {
height = canvas.height;
}
}
var destX = 0, destY = 0;
destX = (canvas.width / 2) - (width / 2);
destY = (canvas.height / 2) - (height / 2);
if (destX < 0) {
destX = 0;
}
if (destY < 0) {
destY = 0;
}
if (srcRectNext.left < 0) {
srcRectNext.left = 0;
}
if (srcRectNext.top < 0) {
srcRectNext.top = 0;
}
destRectNext = new Rect(destX, destY, width, height);
/* get position for drawing canvas*/
if (isFirstLoad == true) {
nPositionCanvas.left = destRectNext.left;
nPositionCanvas.right = destRectNext.right;
nPositionCanvas.top = destRectNext.top;
nPositionCanvas.bottom = destRectNext.bottom;
$("#draw_canvas").attr('height', destRectNext.bottom - destRectNext.top)
.attr('width', destRectNext.right - destRectNext.left)
.css('top', destRectNext.top + marginY)
.css('left', destRectNext.left + marginX);
$("#marker_canvas").attr('height', destRectNext.bottom - destRectNext.top)
.attr('width', destRectNext.right - destRectNext.left)
.css('top', destRectNext.top + marginY)
.css('left', destRectNext.left + marginX);
isFirstLoad = false;
}
//leftCanvas = destX;
//topCanvas = destY;
// change scale
//scaleX = offscreen.width / width;
//scaleY = offscreen.height / height;
// draw canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
context.drawImage(offscreen,
srcRectNext.left, srcRectNext.top, srcRectNext.right - srcRectNext.left, srcRectNext.bottom - srcRectNext.top,
destRectNext.left, destRectNext.top, width, height);
context.restore();
}
else if(opt==2){
// display rect
//srcRectNext.add(moveX, moveY);
// fix rect
if (srcRectPrev.left < 0) {
srcRectPrev.left = 0;
srcRectPrev.right = srcRectPrev.left + srcRectPrev.width;
} else if (srcRectNext.right > offscreen.width) {
srcRectPrev.left = offscreen.width - srcRectPrev.width;
srcRectPrev.right = offscreen.width
}
if (srcRectPrev.top < 0) {
srcRectPrev.top = 0;
srcRectPrev.bottom = srcRectPrev.top + srcRectPrev.height;
} else if (srcRectPrev.bottom > offscreen.height) {
srcRectPrev.top = offscreen.height - srcRectPrev.height;
srcRectPrev.bottom = offscreen.height;
}
// target rect
var width = offscreen.width;
var height = offscreen.height;
var aspect = offscreen.width / offscreen.height;
if (canvas.width > canvas.height) {
height = canvas.height;
width = height * aspect;
} else {
width = canvas.width;
height = width / aspect;
}
if (height > canvas.height) {
var size = canvas.height / height;
height = canvas.height;
width = width * size;
}
if (width > canvas.width) {
var size = canvas.width / width;
width = canvas.width;
height = height * size;
}
if (userScale != 1 && width < canvas.width)
{
context.drawImage(offscreen,
srcRect.left, srcRect.top, srcRect.right - srcRect.left, srcRect.bottom - srcRect.top,
destRect.left, destRect.top, width, height);
context.restore();
width = width * userScale;
if (width > canvas.width) {
width = canvas.width;
}
}
else if (userScale != 1 && height < canvas.height) {
height = height * userScale;
if (height > canvas.height) {
height = canvas.height;
}
}
var destX = 0, destY = 0;
destX = (canvas.width / 2) - (width / 2);
destY = (canvas.height / 2) - (height / 2);
if (destX < 0) {
destX = 0;
}
if (destY < 0) {
destY = 0;
}
if (srcRectPrev.left < 0) {
srcRectPrev.left = 0;
}
if (srcRectPrev.top < 0) {
srcRectPrev.top = 0;
}
destRectPrev = new Rect(destX, destY, width, height);
/* get position for drawing canvas*/
if (isFirstLoad == true) {
nPositionCanvas.left = destRectPrev.left;
nPositionCanvas.right = destRectPrev.right;
nPositionCanvas.top = destRectPrev.top;
nPositionCanvas.bottom = destRectPrev.bottom;
$("#draw_canvas").attr('height', destRectPrev.bottom - destRectPrev.top)
.attr('width', destRectPrev.right - destRectPrev.left)
.css('top', destRectPrev.top + marginY)
.css('left', destRectPrev.left + marginX);
$("#marker_canvas").attr('height', destRectPrev.bottom - destRectPrev.top)
.attr('width', destRectPrev.right - destRectPrev.left)
.css('top', destRectPrev.top + marginY)
.css('left', destRectPrev.left + marginX);
isFirstLoad = false;
}
//leftCanvas = destX;
//topCanvas = destY;
// change scale
//scaleX = offscreen.width / width;
//scaleY = offscreen.height / height;
// draw canvas
context.clearRect(0, 0, canvas.width, canvas.height);
context.save();
context.drawImage(offscreen,
srcRectPrev.left, srcRectPrev.top, srcRectPrev.right - srcRectPrev.left, srcRectPrev.bottom - srcRectPrev.top,
destRectPrev.left, destRectPrev.top, width, height);
context.restore();
}
};
//End Function : No.4 - Editor : Long - Date: 08/09/2013 - Summary : Edit function to draw multi canvas
......@@ -4493,11 +4812,15 @@ function sizingNotFull(width, height) {
flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(2);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
}
......@@ -4552,11 +4875,16 @@ function sizingFullSize(width, height) {
flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(2);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
}
......@@ -4674,11 +5002,15 @@ function zoomIn() {
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(2);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
......@@ -4765,11 +5097,15 @@ function zoomOut() {
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(1);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
......@@ -4788,10 +5124,11 @@ function zoomOut() {
function screenFit() {
var canvas = document.getElementById('main');
var offScreen = document.getElementById('offscreen');
var offScreen = document.getElementById('offscreen');
context_main.clearRect(0, 0, canvas_main.width, canvas_main.height);
srcRect = new Rect(0, 0, offScreen.width, offScreen.height);
userScale = 1;
moveX = 0;
moveY = 0;
......@@ -4891,7 +5228,6 @@ function changeScale(scale) {
srcRect.width = srcRect.right - srcRect.left;
srcRect.height = srcRect.bottom - srcRect.top;
};
/* change Scale screen*/
function changeScaleDrawCanvas(scale) {
var canvas = document.getElementById('draw_canvas');
......
......@@ -66,9 +66,9 @@ function getPageSizeByPageNo(pageNo){
for(var i = 0; i < contentPageSizeArr.length; i++){
var page = contentPageSizeArr[i];
if(page.pageNo == pageNo){
if(page.pageNo == pageNo){
widthContentImage = page.pageWidth;
heightContentImage = page.pageHeight;
heightContentImage = page.pageHeight;
}
}
};
......
......@@ -1437,7 +1437,17 @@ Transition.prototype.flipToPage = function (index) {
});
//change pageIndex and image bookmark
userScale = 1;
changeScale(userScale);
//START TRB00097
//changeScale(userScale);
srcRect = new Rect(0, 0, 0, 0);
srcRectNext = new Rect(0, 0, 0, 0);
srcRectPrev = new Rect(0, 0, 0, 0);
destRect = new Rect(0, 0, 0, 0);
destRectNext = new Rect(0, 0, 0, 0);
destRectPrev = new Rect(0, 0, 0, 0);
//END TRB00097
checkDisableButtonZoom();
getContent().toPage(index);
......@@ -1497,7 +1507,17 @@ Transition.prototype.flipToPage = function (index) {
});
//change pageIndex and image bookmark
userScale = 1;
changeScale(userScale);
//START TRB00097
//changeScale(userScale);
srcRect = new Rect(0, 0, 0, 0);
srcRectNext = new Rect(0, 0, 0, 0);
srcRectPrev = new Rect(0, 0, 0, 0);
destRect = new Rect(0, 0, 0, 0);
destRectNext = new Rect(0, 0, 0, 0);
destRectPrev = new Rect(0, 0, 0, 0);
//END TRB00097
checkDisableButtonZoom();
getContent().toPage(index);
......
......@@ -369,7 +369,11 @@ function firstPage_click() {
$('#divImageLoading').css('display', 'none');
changeScale(userScale);
//START TRB00097
//userScale = 1;
//changeScale(userScale);
//END TRB00097
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
......@@ -385,8 +389,12 @@ function firstPage_click() {
getContent().setPageImages(totalPage, pageImages).setPageObjects(pageObjects);
$('#divImageLoading').css('display', 'none');
//START TRB00097
//START TRB00097
//userScale = 1;
changeScale(userScale);
//changeScale(userScale);
//END TRB00097
checkDisableButtonZoom();
var tran = new Transition();
tran.flipToPage(0);
......@@ -614,8 +622,78 @@ $(document).keyup(function (e) {
});
//END TRB00049 - Editor: Long - Date: 09/26/2013 - Summary : Add short key alt
//START TRB - Editor : Long -Date : 10/01/2013 - Summary : Re Assign sid for image 3d
function update3DImagesArr(){
if(_object3DImageArr.length > 0){
var temp3DArr = [];
_object3DImageArr = [];
for(var i = 0; i < _object3DImageArr; i++){
var object3D = _object3DImageArr[i];
var temp3dview = object3d["3dview"];
var tempCurrX = object3d["_currFrameX"];
var tempCurrY = object3d["_currFrameY"];
var tempLastSelectedFrame = object3d["lastSelectedFrame"];
var tempActionType = object3d["actionType"];
var tempHeight = object3d["height"];
var tempHorizonCnt = object3d["horizonCount"];
var tempId = object3d["id"];
var tempInitImage = object3d["initImage"];
var tempMediaType = object3d["mediaType"];
var tempVerticalCnt = object3d["verticalCount"];
var tempVisible = object3d["visible"];
var tempWidth = object3d["width"];
var tempX = object3d["x"];
var tempY = object3d["y"];
tempInitImage = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + getUrlParams(tempInitImage, 'resourceId');
for(var j = 0; j< temp3dview.length; j++){
var url = temp3dview[j];
var id = getUrlParamByUrl(url, 'resourceId');
temp3dview[j] = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + id;
}
var arr3D = [];
arr3D["3dview"] = temp3dview;
arr3D["_currFrameX"] = tempCurrX;
arr3D["_currFrameY"] = tempCurrY;
arr3D["lastSelectedFrame"] = tempLastSelectedFrame;
arr3D["actionType"] = tempActionType;
arr3D["height"] = tempHeight;
arr3D["horizonCount"] = tempHorizonCnt;
arr3D["id"] = tempId;
arr3D["initImage"] = tempInitImage;
arr3D["mediaType"] = tempMediaType;
arr3D["verticalCount"] = tempVerticalCnt;
arr3D["visible"] = tempVisible;
arr3D["width"] = tempWidth;
arr3D["x"] = tempX;
arr3D["y"] = tempY;
temp3DArr.push(arr3D);
}
_object3DImageArr = temp3DArr;
}
};
//Get param url
function getUrlParamByUrl(url, name){
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var results = regex.exec(url);
if( results == null ){
return "";
}
else{
return results[1];
}
};
//END TRB - Editor : Long -Date : 10/01/2013 - Summary : Re Assign sid for image 3d
function onUnlock() {
removeObject();
update3DImagesArr();
getPageObjectsByPageIndex(pageObjectsData, 0);
/* handle play BGM of content jump */
for (var nIndex = 0; nIndex < pageObjects.length; nIndex++) {
......@@ -806,14 +884,22 @@ function onClick_CanvasMain(event) {
//Start : TRB00005, TRB00006 - Editor : Long - Date: 08/28/2013 - Summary : Prevent click when transit
if (event.pageX > 0 && event.pageX < 300) {
if(!isPreventClick){
prevPage_click();
//START TRB00097
if(userScale == 1){
prevPage_click();
}
//END TRB00097
}
else{
isPreventClick = false;
}
} else if (event.pageX > (cwMain - 300) && event.pageX < cwMain) {
if(!isPreventClick){
nextPage_click();
//START TRB00097
if(userScale == 1){
nextPage_click();
}
//END TRB00097
}
else{
isPreventClick = false;
......@@ -876,7 +962,9 @@ function mouseMove_canvasMain(event) {
/* base image move when userScale over 1 */
if (moveFlag && userScale != 1) {
$('#main').css('cursor', 'pointer');
//START TRB00097
cancelClick = true;
//END TRB00097
var mx;
var my;
// calc mouse moving distance
......@@ -1528,7 +1616,9 @@ function onTouchmove(evt){
//when change from zoom mode
if(userScale != 1){
_isPageNaviTouch = false;
//START TRB00097
cancelClick = true;
//END TRB00097
$('#main').css('cursor', 'pointer');
var mx;
......@@ -2043,11 +2133,15 @@ function processZoomPage(touch1, touch2){
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(2);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
......@@ -2067,11 +2161,15 @@ function processZoomPage(touch1, touch2){
flip();
//Start Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
if(getPageIndex() < totalPage - 1){
flip(1);
//START TRB00097
//flip(1);
//END TRB00097
}
if(getPageIndex() > 0){
flip(2);
//START TRB00097
//flip(2);
//END TRB00097
}
//End Function : No.4 - Editor : Long - Date : 08/13/2013 - Summary : Fix for zooming
/* zoom video */
......
......@@ -95,6 +95,10 @@ var resourceImage = new Image();
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
//Array of pages size
var contentPageSizeArr = [];
var widthEachNextPage = 0;
var heightEachNextPage = 0;
var widthEachPrevPage = 0;
var heightEachPrevPage = 0;
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
/* zoom video */
......
......@@ -1359,6 +1359,24 @@ function switchCanvas(nav){
$('#offscreen').attr("id","offscreenPre");
$('#offscreenNext').attr("id","offscreen");
$('#mainPreBK').attr("id","offscreenNext");
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachPrevPage = widthEachPage;
widthEachPage = widthEachNextPage;
heightEachPrevPage = heightEachPage;
heightEachPage = heightEachNextPage;
srcRectPrev = srcRect;
srcRect = srcRectNext;
destRectPrev = destRect;
destRect = destRectNext;
userScale = 1;
changeScale(userScale);
flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
}
else{
// change div id
......@@ -1371,6 +1389,25 @@ function switchCanvas(nav){
$('#offscreen').attr("id","offscreenNext");
$('#offscreenPre').attr("id","offscreen");
$('#mainNextBK').attr("id","offscreenPre");
//START TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
widthEachNextPage = widthEachPage;
widthEachPage = widthEachPrevPage;
heightEachNextPage = heightEachPage;
heightEachPage = heightEachPrevPage;
srcRectNext = srcRect;
srcRect = srcRectPrev;
destRectNext = destRect;
destRect = destRectPrev;
userScale = 1;
changeScale(userScale);
flip();
//END TRB00097 - Editor: Long - Date: 09/30/2013 - Summary : Get All Page size of content
}
};
......@@ -1397,6 +1434,7 @@ function assignCurrentContentPage(nav){
prevPageObjects = pageObjects;
pageObjects = nextPageObjects;
}
else{
nextPageImage = pageImages;
......@@ -1416,6 +1454,7 @@ function assignCurrentContentPage(nav){
nextPageObjects = pageObjects;
pageObjects = prevPageObjects;
}
};
......
......@@ -34,78 +34,94 @@ function dlgMarking_dspSave_click() {
var img = new Image();
img.onload = function () {
//TRB00098
context_draw.drawImage(img, 0, 0, canvas_draw.width, canvas_draw.height);
/*create new entity marking */
var marking = new MarkingEntity();
marking.contentid = contentID;
if(contentType == ContentTypeKeys.Type_Image){
marking.pageNo = 1;
}else{
marking.pageNo = changePageIndex(getPageIndex());
}
//TRB00098
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;
for (var nIndex = 0; nIndex < arr.length; nIndex++) {
if (arr[nIndex].contentid == contentID
&& arr[nIndex].pageNo == changePageIndex(getPageIndex())) {
nIndexMarking = nIndex;
break;
}
}
if (isDrawing == true) {/* if has draw image */
if (isClearDrawing == true) {
arr.splice(nIndexMarking, 1);
} else {
/* case not exist marking */
if (nIndexMarking == -1) {
arr.push(marking);
} else {
/* case exist 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.
}
}
}
/*add marking to local storage */
ClientData.MarkingData(arr);
// Close dialog
//$("#dlgMarking").dialog('close');
$("#dlgMarking").hide();
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display', 'none');
/*set flag change marking */
ClientData.isChangedMarkingData(true);
ClientData.IsHideToolbar(false);
/* draw again*/
//drawCanvas();
//disableAllControl();
handleDisplayToolbar();
/* visible button fullscreen */
//$('#control_screen_2').show();
/* init clear drawing canvas */
isClearDrawing = false;
//START TRB00098
var saveImg = new Image();
var saveImgUrl = canvas_draw.toDataURL("image/png");
saveImg.onload = function(){
/*create new entity marking */
var marking = new MarkingEntity();
marking.contentid = contentID;
if(contentType == ContentTypeKeys.Type_Image){
marking.pageNo = 1;
}else{
marking.pageNo = changePageIndex(getPageIndex());
}
var saveCanvas = document.createElement('canvas');
saveCanvas.width = canvas_offscreen.width;
saveCanvas.height = canvas_offscreen.height;
var saveContext = saveCanvas.getContext('2d');
saveContext.drawImage(saveImg, 0, 0, saveCanvas.width, saveCanvas.height);
marking.content = saveCanvas.toDataURL("image/png");
//END TRB00098
//=== 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;
for (var nIndex = 0; nIndex < arr.length; nIndex++) {
if (arr[nIndex].contentid == contentID
&& arr[nIndex].pageNo == changePageIndex(getPageIndex())) {
nIndexMarking = nIndex;
break;
}
}
if (isDrawing == true) {/* if has draw image */
if (isClearDrawing == true) {
arr.splice(nIndexMarking, 1);
} else {
/* case not exist marking */
if (nIndexMarking == -1) {
arr.push(marking);
} else {
/* case exist 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.
}
}
}
/*add marking to local storage */
ClientData.MarkingData(arr);
// Close dialog
//$("#dlgMarking").dialog('close');
$("#dlgMarking").hide();
ClientData.IsAddingMarking(false);
$('#draw_canvas').css('display', 'none');
/*set flag change marking */
ClientData.isChangedMarkingData(true);
ClientData.IsHideToolbar(false);
/* draw again*/
//drawCanvas();
//disableAllControl();
handleDisplayToolbar();
/* visible button fullscreen */
//$('#control_screen_2').show();
/* init clear drawing canvas */
isClearDrawing = false;
};
saveImg.src = saveImgUrl;
};
img.src = imgMarkerTemp;
......
......@@ -136,8 +136,20 @@ function AddMemo(contentId,pageNo,targetId, posX, posY, callback) {
$("#overlay").show();
disableControlsCopyMemo();
targetDiv.css('z-index','1005');
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
//START TRB00097
if(targetY >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
}
else{
targetDiv.css('top',targetY);
targetDiv.css('left',targetX - ($('#memoWrapper').width() /2 ));
}
//END TRB00097
targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog();
......@@ -163,8 +175,17 @@ function EditMemo(index, posXPlus, posYPlus, targetId, callback){
targetDiv.css('z-index','1005');
var pt = imageToScreen(targetX, targetY);
targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
//START TRB00097
if(pt.y >= $('#wrapper').height()/2){
targetDiv.css('top', $('#wrapper').height()/3);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
}
else{
targetDiv.css('top',pt.y);
targetDiv.css('left',pt.x - ($('#memoWrapper').width() /2 ));
}
//END TRB00097
targetDiv.draggable({ handle: "h1" });
//editJqueryUIDialog();
......
/// コンテンツ詳細画面
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="init.js" />
/// <reference path="home.js" />
var resourceIdDetail="";
var displayData = {
contentID: "",
contentTitle: "",
contentDetail: "",
contentThumbnail: "",
deliveryDate: (new Date()),
pages: []
};
// Init function of page
$(document).ready(function () {
//alert(ClientData.contentInfo_contentId());
//if (!avwCheckLogin(ScreenIds.Login)) return;
//openContentDetail();
});
// 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');
$('#sectionContentDetail').removeClass().addClass('sectiondetailnopdf');
}else
{
// $("#book_data").css('border-right','2px solid #CCC');
// $("#book_data").css('float','left');
// $("#book_data").css('background-color', '#f7f7f7');
$('#sectionContentDetail').removeClass().addClass('sectiondetail');
}
displayData = {
contentID: "",
contentTitle: "",
contentDetail: "",
contentThumbnail: "",
deliveryDate: (new Date()),
pages: []
};
// Clear childs
$('#book_list').html('');
// Clear display info
//$("#imgContentThumbnail").css('padding-top', "60px");
$("#imgContentThumbnail").attr('src', "img/data_loading.gif");
resetLoadingImageSize();
$("#txtContentTitle").text('');
$("#txtPubDt2_Dsp").text('');
$("#txtContentDetail").text('');
$("#contentDetailClose").click(contentDetailClose_Click);
//$("#contentdetail_dspBack").click(contentdetail_dspBack_Click);
$("#contentdetail_dspRead").click(contentdetail_dspRead_Click);
lockLayout();
$("#contentDetail").css('z-index', 101);
$("#sectionContentDetail").show();
$("#contentDetail").show();
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
// Get contentid, thumbnail from list screen
displayData.contentID = ClientData.contentInfo_contentId();
displayData.contentThumbnail = ClientData.contentInfo_contentThumbnail();
// 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) {
displayData.pages.push({ pageNo: data.pages[nIndex].pageNo, pageText: data.pages[nIndex].pageText, pageThumbnail: ("data:image/jpeg;base64," + data.pages[nIndex].pageThumbnail) });
}
}
// Show to screen
ShowContent(displayData.contentID, truncate(displayData.contentTitle, 20), displayData.contentDetail, ClientData.contentInfo_contentThumbnail(), displayData.deliveryDate, displayData.pages);
},
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
function contentDetailClose_Click(e) {
e.preventDefault();
unlockLayout();
$("#contentDetail").hide();
$("#sectionContentDetail").hide();
};
/*
----------------------------------------------------------------------------
Event groups [start]
----------------------------------------------------------------------------
*/
function contentdetail_dspRead_Click(e) {
e.preventDefault();
var outputId = ClientData.contentInfo_contentId();
checkLimitContent(outputId,
function () {
contentdetail_dspRead_Click_callback(outputId);
},1);
};
function contentdetail_dspRead_Click_callback(outputId) {
var date = new Date();
var month = date.getMonth() + 1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
var contentIdArray = [];
var checkflag = false;
//Store Content id that user has read
if (ClientData.ReadingContentIds().length > 0) {
contentIdArray = ClientData.ReadingContentIds();
for (var nIndex = 0; nIndex < contentIdArray.length; nIndex++) {
if (contentIdArray[nIndex].contentid == outputId) {
checkflag = true;
if (contentIdArray[nIndex].viewdate == '' || contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined') {
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else {
checkflag = false;
}
}
if (!checkflag) {
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date });
}
}
else {
contentIdArray.push({ contentid: outputId, viewdate: outputDate, originviewdate: date });
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
// Redirect to screen: contentview
//$('body,html').animate({ scrollTop: 0 }, 0);
ClientData.IsRefresh(false);
//var contentType = "1";
if (ClientData.contentInfo_contentType() == ContentTypeKeys.Type_Others) {
// 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;
// var resourceUrl = getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceIdDetail + "&isDownload=true";
// window.open(resourceUrl, "_blank");
// }
// });
// },
// null
// );
downloadResourceById(ClientData.contentInfo_contentId());
}
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());
$("#txtContentDetail").text(contentDetail);
$("#txtContentTitle").text(contentTitle);
$("#imgContentThumbnail").attr("src", contentThumbnail);
var imgTemp = new Image();
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;
//resizeThumbnailContentDetail(contentThumbnail, 120, 160);
// Show pages
for (var nIndex = 0; nIndex < pages.length; nIndex++) {
//insertRow(imgSample, pages[nIndex].pageText, pages[nIndex].pageNo);
insertRow(pages[nIndex].pageThumbnail, truncate(getLines(pages[nIndex].pageText, 3), 45), pages[nIndex].pageNo); //55
}
};
function insertRow(pageThumbnail, pageText, pageNo) {
var newRow = "";
newRow += "<ul>";
newRow += '<li class="list_img"><img src="' + pageThumbnail + '" alt="" width="90" /></li>';
newRow += '<li class="list_title"><a href="#">' + htmlEncode(pageText) + '</a></li>';
newRow += '<li class="page"><label id="Label2" class="lang" lang="txtPage">' + i18nText('txtPage') + '</label>' + pageNo + '</li>';
newRow += "</ul>";
$('#book_list').append(newRow);
i18nReplaceText();
//Resize Image
var imgTemp = new Image();
imgTemp.onload = function(){
if(imgTemp.width > imgTemp.height) {
$("li.list_img img").attr('height', '');
$("li.list_img img").removeAttr('height');
$("li.list_img img").attr('width', '90');
}
else {
$("li.list_img img").attr('width', '');
$("li.list_img img").removeAttr('width');
$("li.list_img img").attr('height', '90');
}
};
imgTemp.src = pageThumbnail;
};
function insertRow1(pageThumbnail, pageText, pageNo) {
var newRow = "";
newRow += "<tr>";
newRow += "<td id='left'>";
newRow += '<img src="' + pageThumbnail;
newRow += '" id="imgPageThumbnail" alt="" width="50" height="50"/>';
newRow += "</td>";
newRow += "<td>";
newRow += '<div><label id="Label1">' + pageText + '</label></div>';
newRow += '<div><label id="Label2" class="lang" lang="txtPage">ページ:</label><label id="Label3">' + pageNo + '</label></div>';
newRow += "</td>";
newRow += "</tr>";
$('#contentdetail_grid tr:last').after(newRow);
//changeLanguage(ClientData.userInfo_language());
i18nReplaceText();
};
//set resource version data
function setResourceVersionData(conId){
var tempResourceArr;
var tempResource;
//check if insert new or edit
var flag = false;
if(ClientData.ResourceVersion().length <= 0 || ClientData.ResourceVersion() == null || ClientData.ResourceVersion() == 'undefined'){
tempResourceArr = [];
}
else{
tempResourceArr = ClientData.ResourceVersion();
}
for(var i = 0; i < resourceVersionArr.length; i++){
if(resourceVersionArr[i].contentid == conId){
tempResource = resourceVersionArr[i].resourceversion;
break;
}
}
if(tempResourceArr.length > 0){
for(var j = 0; j < tempResourceArr.length; j++){
if(tempResourceArr[j].contentid == conId){
tempResourceArr[j].resourceversion = tempResource;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
}else{
tempResourceArr.push({contentid: conId, resourceversion: tempResource});
}
ClientData.ResourceVersion(tempResourceArr);
};
//set meta Version Data
function setMetaVersionData(conId){
var tempMetaArr;
var tempMeta;
//check if insert new or edit
var flag = false;
if(ClientData.MetaVersion().length <= 0 || ClientData.MetaVersion() == null || ClientData.MetaVersion() == 'undefined'){
tempMetaArr = [];
}
else{
tempMetaArr = ClientData.MetaVersion();
}
for(var i = 0; i < metaVersionArr.length; i++){
if(metaVersionArr[i].contentid == conId){
tempMeta = metaVersionArr[i].metaversion;
break;
}
}
if(tempMetaArr.length > 0){
for(var j = 0; j < tempMetaArr.length; j++){
if(tempMetaArr[j].contentid == conId){
tempMetaArr[j].metaversion = tempMeta;
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
}else{
tempMetaArr.push({contentid: conId, metaversion: tempMeta});
}
ClientData.MetaVersion(tempMetaArr);
};
function formatNormalDate(day, month, year) {
var outputDate = year + '/' + (('' + month).length < 2 ? '0' : '') + month + '/' + (('' + day).length < 2 ? '0' : '') + day;
return outputDate;
};
//function contentdetail_dspBack_Click() {
//parent.history.back();
//$(this).parent().parent().parent().parent().parent().parent().parent().hide();
//$(this).parent().parent().parent().parent().parent().parent().parent().dialog('close');
//}
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
/*
----------------------------------------------------------------------------
Setting dialog [start]
----------------------------------------------------------------------------
*/
$(function () {
});
/*
----------------------------------------------------------------------------
Setting dialog [ end ]
----------------------------------------------------------------------------
*/
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function resetLoadingImageSize(){
$("#imgContentThumbnail").attr('height','25px');
$("#imgContentThumbnail").attr('width','25px');
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('7 2I="";7 l={X:"",B:"",q:"",g:"",v:(S 1z()),r:[]};$(2H).2J(b(){});b 2L(){8(!1p(9.1o())){$(\'#1j\').1P().1Q(\'2K\')}c{$(\'#1j\').1P().1Q(\'2D\')}l={X:"",B:"",q:"",g:"",v:(S 1z()),r:[]};$(\'#29\').2C(\'\');$("#f").o(\'I\',"E/2E.2G");2c();$("#1v").C(\'\');$("#1A").C(\'\');$("#1u").C(\'\');$("#2F").1N(21);$("#2S").1N(22);2T();$("#q").11(\'z-2V\',2U);$("#1j").1R();$("#q").1R();$("#q").2N();8($("#q").m()>$(2M).m()){$("#q").11(\'19\',\'0\')}l.X=9.1e();l.g=9.1Y();2O(9.1w(),"2Q","1M",{1L:l.X,1K:9.1Z(),2P:1},b(y){7 1q=9.1o();l.B=y.1C.2B;l.q=y.1C.q;l.v=2m(y.1C.2p);8(!1p(1q)){1X(l.B,l.q,l.g,l.v)}c{2q(9.1w(),"2r","1M",{1L:9.1e(),1K:9.1Z(),2n:1,2s:\'1,2,3,4,5,6\'},b(y){P(7 d=0;d<y.r.n;d++){8(d<6){l.r.Q({N:y.r[d].N,R:y.r[d].R,G:("y:2y/2x;2A,"+y.r[d].G)})}}1O(l.X,1x(l.B,20),l.q,9.1Y(),l.v,l.r)},Z)}},Z)};b 21(e){e.1T();2w();$("#q").1J();$("#1j").1J()};b 22(e){e.1T();7 D=9.1e();3o(D,b(){1S(D)},1)};b 1S(D){7 O=S 1z();7 18=O.3p()+1;7 1b=O.3k();7 U=2a(1b,18,O.3j());7 s=[];7 1c=K;8(9.1d().n>0){s=9.1d();P(7 d=0;d<s.n;d++){8(s[d].u==D){1c=1m;8(s[d].10==\'\'||s[d].10==Z||s[d].10==\'1k\'){s[d].10=U;s[d].1H=O}16}c{1c=K}}8(!1c){s.Q({u:D,10:U,1H:O})}}c{s.Q({u:D,10:U,1H:O})}7 1V=[];9.1d(1V);9.1d(s);2e(D);2f(D);9.34(K);8(9.1o()==F.23){33(9.1e())}c{37(36.32)}};b 2Y(1U){7 1W=2X();7 1g=1W.2Z;1g=31(1g,9.1w())+\'/\'+1U;V 1g};b 1p(1q){8(!(1q==F.3i)){V K}c{V 1m}};b 1X(B,q,g,v){$("#1A").C(v.2j()+" "+v.2k());$("#1u").C(q);$("#1v").C(B);7 H=9.1o();8(g==\'\'||g==Z||g==\'1k\'){8(!1p(H)){8(H==F.39){g=12.38}c 8(H==F.3a){g=12.3c}c 8(H==F.3b){g=12.3g}c 8(H==F.3r){g=12.3t}c 8(H==F.23){g=12.3q}c 8(H==F.2z){g=12.2o}}}c{g=g}7 h=S 1G();$("#f").o("I",g);h.1F=b(){8(h.p>h.m){$("#f").o(\'m\',\'\');$("#f").T(\'m\');$("#f").o(\'p\',\'Y\');7 1n=(Y*h.m)/h.p;$("#f").11(\'1i-19\',(2h-1n)/2+"2l")}c{$("#f").o(\'p\',\'\');$("#f").T(\'p\');$("#f").o(\'m\',\'Y\');$("#f").11(\'1i-19\',"2g")}};h.I=g};b 1O(X,B,q,g,v,r){$("#1A").C(v.2j()+" "+v.2k());$("#1u").C(q);$("#1v").C(B);$("#f").o("I",g);7 h=S 1G();h.1F=b(){8(h.p>h.m){$("#f").o(\'m\',\'\');$("#f").T(\'m\');$("#f").o(\'p\',\'Y\');7 1n=(Y*h.m)/h.p;$("#f").11(\'1i-19\',(2h-1n)/2+"2l")}c{$("#f").o(\'p\',\'\');$("#f").T(\'p\');$("#f").o(\'m\',\'Y\');$("#f").11(\'1i-19\',"2g")}};h.I=g;P(7 d=0;d<r.n;d++){27(r[d].G,1x(3d(r[d].R,3),3h),r[d].N);}};b 27(G,R,N){7 k="";k+="<28>";k+=\'<t 13="M"><E I="\'+G+\'" 24="" p="1I" /></t>\';k+=\'<t 13="3e"><a 3f="#">\'+30(R)+\'</a></t>\';k+=\'<t 13="35"><J W="26" 13="1r" 1r="1E">\'+3u(\'1E\')+\'</J>\'+N+\'</t>\';k+="</28>";$(\'#29\').3s(k);2d();7 h=S 1G();h.1F=b(){8(h.p>h.m){$("t.M E").o(\'m\',\'\');$("t.M E").T(\'m\');$("t.M E").o(\'p\',\'1I\')}c{$("t.M E").o(\'p\',\'\');$("t.M E").T(\'p\');$("t.M E").o(\'m\',\'1I\')}};h.I=G};b 3v(G,R,N){7 k="";k+="<1D>";k+="<1t W=\'3w\'>";k+=\'<E I="\'+G;k+=\'" W="3l" 24="" p="25" m="25"/>\';k+="</1t>";k+="<1t>";k+=\'<1s><J W="3n">\'+R+\'</J></1s>\';k+=\'<1s><J W="26" 13="1r" 1r="1E">3m:</J><J W="2W">\'+N+\'</J></1s>\';k+="</1t>";k+="</1D>";$(\'#2v 1D:2t\').2u(k);2d()};b 2e(x){7 w;7 14;7 L=K;8(9.17().n<=0||9.17()==Z||9.17()==\'1k\'){w=[]}c{w=9.17()}P(7 i=0;i<1B.n;i++){8(1B[i].u==x){14=1B[i].1h;16}}8(w.n>0){P(7 j=0;j<w.n;j++){8(w[j].u==x){w[j].1h=14;L=1m;16}c{L=K}}8(!L){w.Q({u:x,1h:14})}}c{w.Q({u:x,1h:14})}9.17(w)};b 2f(x){7 A;7 15;7 L=K;8(9.1a().n<=0||9.1a()==Z||9.1a()==\'1k\'){A=[]}c{A=9.1a()}P(7 i=0;i<1y.n;i++){8(1y[i].u==x){15=1y[i].1l;16}}8(A.n>0){P(7 j=0;j<A.n;j++){8(A[j].u==x){A[j].1l=15;L=1m;16}c{L=K}}8(!L){A.Q({u:x,1l:15})}}c{A.Q({u:x,1l:15})}9.1a(A)};b 2a(1b,18,2b){7 U=2b+\'/\'+((\'\'+18).n<2?\'0\':\'\')+18+\'/\'+((\'\'+1b).n<2?\'0\':\'\')+1b;V U};$(b(){});b 1x(1f,n){8(1f.n<=n){V 1f}c{V 1f.2R(0,n)+"..."}};b 2c(){$("#f").o(\'m\',\'2i\');$("#f").o(\'p\',\'2i\')};', 62, 219, '|||||||var|if|ClientData||function|else|nIndex||imgContentThumbnail|contentThumbnail|imgTemp|||newRow|displayData|height|length|attr|width|contentDetail|pages|contentIdArray|li|contentid|deliveryDate|tempResourceArr|conId|data||tempMetaArr|contentTitle|text|outputId|img|ContentTypeKeys|pageThumbnail|tempContentType|src|label|false|flag|list_img|pageNo|date|for|push|pageText|new|removeAttr|outputDate|return|id|contentID|120|null|viewdate|css|ThumbnailForOtherType|class|tempResource|tempMeta|break|ResourceVersion|month|top|MetaVersion|day|checkflag|ReadingContentIds|contentInfo_contentId|strInput|url|resourceversion|padding|sectionContentDetail|undefined|metaversion|true|realHeight|contentInfo_contentType|isPdfContent|contentType|lang|div|td|txtContentDetail|txtContentTitle|userInfo_accountPath|truncate|metaVersionArr|Date|txtPubDt2_Dsp|resourceVersionArr|contentData|tr|txtPage|onload|Image|originviewdate|90|hide|sid|contentId|GET|click|ShowContent|removeClass|addClass|show|contentdetail_dspRead_Click_callback|preventDefault|apiName|newArray|sysSettings|ShowContentNotPDF|contentInfo_contentThumbnail|userInfo_sid||contentDetailClose_Click|contentdetail_dspRead_Click|Type_Others|alt|50|Label2|insertRow|ul|book_list|formatNormalDate|year|resetLoadingImageSize|i18nReplaceText|setResourceVersionData|setMetaVersionData|12px|145|25px|jpDateString|jpShortTimeString|px|convertToDate|thumbnailFlg|Thumbnail_HtmlType|deliveryStartDate|avwCmsApiSync|webContentPage|pageNos|last|after|contentdetail_grid|unlockLayout|jpeg|image|Type_Html|base64|contentName|html|sectiondetail|data_loading|contentDetailClose|gif|document|resourceIdDetail|ready|sectiondetailnopdf|openContentDetail|window|center|avwCmsApi|getType|webGetContent|substring|contentdetail_dspRead|lockLayout|101|index|Label3|avwSysSetting|getURL|apiResourceDlUrl|htmlEncode|format|ContentView|downloadResourceById|IsRefresh|page|ScreenIds|avwScreenMove|Thumbnail_ImageType|Type_Image|Type_Music|Type_Video|Thumbnail_MusicType|getLines|list_title|href|Thumbnail_VideoType|45|Type_PDF|getFullYear|getDate|imgPageThumbnail|ページ|Label1|checkLimitContent|getMonth|Thumbnail_OthersType|Type_NoFile|append|Thumbnail_NoFileType|i18nText|insertRow1|left'.split('|'), 0, {}))
/// <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 timeWaitCloseNewInfoPushMessage = 5000; // time wait close info new push message 5 seconds
var currentPagePushMessage = 1;
var isHoverOn = false;
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
// Set event to prevent leave
//avwSetLogoutNortice();
if (ClientData.requirePasswordChange() != 1) {
ToogleLogoutNortice();
}
//Toggle Searchbox
$('input#searchbox-key').click(toggleSearchPanel);
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
//Go to Search Page
$('#searchbox-search').click(searchHeaderButtonFunction);
//Change Language JP
$('#language-jp').click(changeLanguageJa);
//Change Language KR
$('#language-kr').click(changeLanguageKo);
//Change Language EN
$('#language-en').click(changeLanguageEn);
//Go To Bookmark Page
$('#dspShiori').click(bookmarkFunction);
//Go To update configuration
$('#dspSetting').click(updateConfigFunction);
// hide logout button with anonymous user
if (isAnonymousLogin()) {
$('#dspLogout').hide();
$('#dspSetting').hide();
}
else {
//Go To Login Page
$('#dspLogout').click(logoutFunction);
$('#dspLogout').show();
$('#dspSetting').show();
}
$('#dspViewHistory').click(historyClickFunction);
$('#dspHome').click(homeClickFunction);
//Hide search panel until click on text field
$('div#header-searchbox').css('display', 'none');
if (isAnonymousLogin()) {
$('#li-login-username').hide();
}
else {
//li-login-username
$('#li-login-username').show();
//Display user name
$('#login-username').text(ClientData.userInfo_userName());
}
$('#dlgConfirmBackup-backup').click(confirmWithBackupFunction);
$('#dlgConfirmBackup-withoutbackup').click(confirmWithoutBackupFunction);
$('#dlgConfirmBackup1').hide();
$('#searchbox-key').keydown(headerSearchKeyDownEventFunction);
$('#searchbox-content-header').click(headerSearchContentClickFunction);
$('#searchbox-tag-header').click(headerSearchTagClickFunction);
$('#searchbox-body-header').click(headerSearchBodyClickFunction);
//init push message
initPushMessage();
//$('*').click(handleHeaderSearchBoxEvent);
if (isTouchDevice() == false) {
$('#searchbox-key').hover(searchBoxHoverFunction, searchBoxHoverOffFunction);
$('#header-searchbox').hover(searchBoxHoverFunction, searchBoxHoverOffFunction);
}
if (isTouchDevice() == true) {
var bodyTag = document.getElementsByTagName('body')[0];
bodyTag.addEventListener('touchstart', bodyClickFunction, false);
}
else {
$('body').click(bodyClickFunction);
}
});
function searchBoxHoverFunction(){
isHoverOn = true;
};
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()) {
// Check mouse is in rectangle of searching panel
if ($('#header-searchbox').is(":visible")) //if ($('#header-searchbox').css('display') != "none")
{
var currPosX, currPosY;
var avwUserEnvObj = new UserEnvironment();
if (avwUserEnvObj.os == 'android') {
//$("#searchbox-key").val(event.targetTouches[0].pageX + "_" + $('#header-searchbox').position().left + ":" + ($('#header-searchbox').position().left + $('#header-searchbox').width()));
currPosX = event.targetTouches[0].pageX;
currPosY = event.targetTouches[0].pageY;
}
else {
currPosX = event.targetTouches[0].clientX;
currPosY = event.targetTouches[0].clientY;
}
var leftsearch = $('#header-searchbox').offset().left;
var topsearch = $('#header-searchbox').offset().top;
var rightsearch = $('#header-searchbox').width() + leftsearch;
var bottomsearch = $('#header-searchbox').height() + topsearch;
// check mouse position in search region
if (currPosX >= leftsearch && currPosX <= rightsearch && currPosY >= topsearch && currPosY <= bottomsearch) {
isHoverOn = true;
}
else {
isHoverOn = false;
$('#header-searchbox').hide();
}
// if (currPosX >= $('#header-searchbox').position().left
// && currPosX <= ($('#header-searchbox').position().left + $('#header-searchbox').width())
// && currPosY >= $('#header-searchbox').position().top
// && currPosY <= ($('#header-searchbox').position().top + $('#header-searchbox').height())) {
// isHoverOn = true;
// }
// else {
// isHoverOn = false;
// }
}
}
else {
if (!isHoverOn) {
$('#header-searchbox').hide();
}
}
};
function headerSearchBodyClickFunction() {
$('#searchbox-body').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
isHoverOn = true;
};
function headerSearchTagClickFunction() {
$('#searchbox-tag').attr('checked','checked');
$('#searchbox-body').removeAttr('checked');
$('#searchbox-content').removeAttr('checked');
isHoverOn = true;
};
function headerSearchContentClickFunction() {
$('#searchbox-content').attr('checked','checked');
$('#searchbox-tag').removeAttr('checked');
$('#searchbox-body').removeAttr('checked');
isHoverOn = true;
};
//function header search box key down function
function headerSearchKeyDownEventFunction(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#searchbox-search').click();
}
isHoverOn = true;
};
//Toggle Search Panel Click function
function toggleSearchPanel(){
if ($("div#header-searchbox").is(":hidden")) {
// show radio options
$('div#header-searchbox').slideDown('slow');
// set default option search
if ($('#header-searchbox input:checked').length == 0) {
// set option default is searchbox content
$('#searchbox-content').attr('checked', 'checked');
}
} else {
$('div#header-searchbox').hide();
}
};
//Button Search Event function
function searchHeaderButtonFunction(){
var content = $('#searchbox-content').attr('checked');
var tag = $('#searchbox-tag').attr('checked');
var body = $('#searchbox-body').attr('checked');
var searchDivision;
var searchText = $('#searchbox-key').val();
if(content == 'checked')
{
searchDivision = $('#searchbox-content').val();
}
if(tag == 'checked')
{
searchDivision = $('#searchbox-tag').val();
}
if(body == 'checked')
{
searchDivision = $('#searchbox-body').val();
}
ClientData.searchCond_searchText(searchText);
ClientData.searchCond_searchDivision(searchDivision);
//window.location = ScreenIds.ContentSearch;
avwScreenMove(ScreenIds.ContentSearch);
};
function homeClickFunction(){
//window.location = ScreenIds.Home;
avwScreenMove(ScreenIds.Home);
};
//Change Language Japanese function
function changeLanguageJa(){
changeLanguage(Consts.ConstLanguage_Ja);
//ClientData.userInfo_language(Consts.ConstLanguage_Ja);
//$('#control-sort-titlekana').css('display','inline-block');
//$('#separate').css('display','inline-block');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Change Language English functions
function changeLanguageEn(){
changeLanguage(Consts.ConstLanguage_En);
//ClientData.userInfo_language(Consts.ConstLanguage_En);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Change Language English function
function changeLanguageKo(){
changeLanguage(Consts.ConstLanguage_Ko);
//ClientData.userInfo_language(Consts.ConstLanguage_Ko);
//$('#control-sort-titlekana').css('display','none');
//$('#separate').css('display','none');
//formatDisplayMoreRecord();
if(window.changeLanguageCallBackFunction){
changeLanguageCallBackFunction();
}
$("#searchbox-key").attr('placeholder', i18nText('msgPlaceHolder'));
};
//Shiori function
function bookmarkFunction(){
//window.location = ScreenIds.BookmarkList;
avwScreenMove(ScreenIds.BookmarkList);
};
//Update Config function
function updateConfigFunction(){
//window.location = ScreenIds.Setting;
avwScreenMove(ScreenIds.Setting);
};
//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") {
if (ClientData.userOpt_bkConfirmFlg() == 1) { // Show confirming dialog
//$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
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) {
//$('#dlgConfirmBackup1').dialog({ width: 600, height: 200, modal: true });
lockLayout();
$('#dlgConfirmBackup1').show();
$('#dlgConfirmBackup1').center();
}
else {
if (ClientData.userOpt_logoutMode() == 0) { // Logout with backup
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();
}
}
}
}
// In case: user_data_backup != "Y" -> No backup, logout
else {
webLogoutEvent();
}
}
else{
webLogoutEvent();
}
};
function historyClickFunction(){
//window.location = ScreenIds.History;
avwScreenMove(ScreenIds.History);
};
//Web Logout Event
function webLogoutEvent(){
var params = {
sid: ClientData.userInfo_sid()
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webLogout", "GET", params,
function (data) {
SessionStorageUtils.clear();
avwUserSetting().remove(Keys.userInfo_sid);
// Move to login screen
//window.location = ScreenIds.Login;
avwScreenMove(ScreenIds.Login);
},
null);
};
//Logout Without Backup function
function confirmWithoutBackupFunction(e) {
e.preventDefault();
var remember = $('#chkRememberBackup').attr('checked');
if(remember == 'checked'){
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
}
else{
ClientData.userOpt_bkConfirmFlg(1); // Show dialog in next time
}
ClientData.userOpt_logoutMode(1); // In next time, if choose: [do not show dialog], will not backup and logout
//window.location = ScreenIds.Login;
webLogoutEvent();
};
//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') {
ClientData.userOpt_bkConfirmFlg(0); // Do not show dialog in next time
// 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(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(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'));
//
// // 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();
}
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: '',
sticky: true,
text: '',
customMessages: 'divResultMessage'
});
// 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>");
}
// 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 (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){
if(ClientData.requirePasswordChange() == 1){
//alert(i18nText('msgPWDNeedChange'));
showErrorScreenForceChangePassword();
}
}
};
function showErrorScreenForceChangePassword(){
var tags = '<div id="avw-auth-error">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p>'+i18nText('msgPWDNeedChange')+'</p>' +
'<div><button id="avw-unauth-ok">OK</button></div>' +
'</div></div></div>';
$('body').prepend(tags);
$('#avw-auth-error').css( {
'color': '#fff',
'opacity': 1,
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': '#ccc',
'zIndex': '10000'
});
// resize error page
$(window).resize(function() {
$('#avw-auth-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
$('#avw-unauth-ok').click(function() {
ClientData.BookmarkScreen(ScreenIds.Setting);
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');
$('#accordion').slideUp();
}
else {
$('.notification-pushmessage').hide(); // hide notification
$(this).removeClass('hide').addClass('show');
currentPagePushMessage = 1;
getPushMessageList();
}
}
);
// set default hide list message
$('#liPushMessage').removeClass('show').addClass('hide');
$('#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) {
// $('#liPushMessage').removeClass('show').addClass('hide');
// $('#list-push-message').slideUp();
// 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();
// auto off notification push message after timeWaitCloseNewInfoPushMessage
setTimeout(function () {
$('.notification-pushmessage').slideUp();
}, timeWaitCloseNewInfoPushMessage);
}
}
// 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);
},
function (xhr, b, c) {
showSystemError();
});
};
// get string from date crate pushmessage
function getDateCreatePushMessage(data) {
return (data.year + 1900) + "/" + (data.month + 1) + "/" + data.date + " " + data.hours + ":" + data.minutes;
}
// 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++)
{
var titleMessage = truncate(data.messageList[i].messageDetail, 30).replace(/</g, '&lt;').replace(/>/g, '&gt;');
var detailMessage = data.messageList[i].messageDetail.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\n/g, '<br/>');
var message = '<div class="newmsg">';
message += '<h5 class="postItem"><a href="#">' + titleMessage + '</a></h5>';
message += '<p>' + detailMessage + '<span class="date">' + getDateCreatePushMessage(data.messageList[i].messageSendDate) + '</span></p></div>';
$('#show-push-message').append(message);
}
// hide all detail message
$('#show-push-message .newmsg p').hide();
// show list title message
$('#accordion').slideDown();
if (currentPagePushMessage > 1 || data.recordTo < data.totalRecord) {
$('#accordion .pagechange').show();
}
else {
$('#accordion .pagechange').hide();
}
// check show next button
if (data.recordTo < data.totalRecord) {
$('#next-page-message').show();
}
else {
$('#next-page-message').hide();
}
// check show previous button
if (currentPagePushMessage > 1) {
$('#prev-page-message').css({ "visibility": "visible" });
}
else {
$('#prev-page-message').css({ "visibility":"hidden"});
}
// show detail message when click at title
$('#show-push-message .newmsg h5').click(
function () {
var isshow = !$(this).parent().find('p').is(':visible');
$('#show-push-message .newmsg p').slideUp();
if (isshow) {
$(this).parent().find('p').slideDown();
}
}
);
};
// load next page message
function nextPushMessageClick() {
currentPagePushMessage++;
getPushMessageList();
};
// load previous page message
function previousPushMessageClick() {
if (currentPagePushMessage > 1)
currentPagePushMessage--;
else currentPagePushMessage = 1;
getPushMessageList();
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function setStatusSort(currentid, isAsc) {
$('#menu_sort li a').removeClass('descending_sort').removeClass('ascending_sort');
if($('#menu_sort li a#off-default').size()){
$('#menu_sort li a#off-default').addClass('descending_sort');
}
$('#menu_sort li').removeClass('current');
$(currentid).addClass(isAsc ? 'ascending_sort' : 'descending_sort').parent().addClass("current");
};
// get icon of content type
function getIconTypeContent(contentType) {
var src = '';
switch (contentType) {
case ContentTypeKeys.Type_PDF:
{
src = 'img/bookshelf/icon_01.jpg';
break;
}
case ContentTypeKeys.Type_Enquete:
{
src = 'img/bookshelf/icon_05.jpg';
break;
}
case ContentTypeKeys.Type_Html:
{
src = 'img/bookshelf/icon_05.jpg';
break;
}
case ContentTypeKeys.Type_Image:
{
src = 'img/bookshelf/icon_02.jpg';
break;
}
case ContentTypeKeys.Type_Music:
{
src = 'img/bookshelf/icon_06.jpg';
break;
}
case ContentTypeKeys.Type_NoFile:
{
src = 'img/bookshelf/icon_07.png';
break;
}
case ContentTypeKeys.Type_Others:
{
src = 'img/bookshelf/icon_03.jpg';
break;
}
case ContentTypeKeys.Type_Video:
{
src = 'img/bookshelf/icon_04.jpg';
break;
}
default: break
}
return src;
};
// download resouce content id
function downloadResourceById(contentId){
var params = {
sid: ClientData.userInfo_sid(),
contentId: contentId,
getType: '2'
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", "get", params,
function (data) {
//Get resourceurl
var resourceUrl = getResourceByIdFromAPI(data.contentData.content.resourceId);
// open url to download file
if (isSafariNotOnIpad()) {
window.onbeforeunload = null;
window.open(resourceUrl, "_self"); // open url to download file on safari not for ipad
var toogleTime = setTimeout(function () { ToogleLogoutNortice() }, 200);
}
else {
window.open(resourceUrl); //open url to download file on orther browser
}
},
function (xhr, b, c) { });
};
//Download resource
function getResourceByIdFromAPI(resourceId){
return getURL("webResourceDownload") + "/?sid=" + ClientData.userInfo_sid() + "&resourceId=" + resourceId + "&isDownload=true";
};
// check is browser safari on Mac and Window devide ( not Ipad )
function isSafariNotOnIpad() {
if (!window.chrome) {
var ua = navigator.userAgent.toLowerCase();
if (!/ipad/.test(ua) && /safari/.test(ua)) {
return true;
}
}
return false;
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('8 4v=5g;8 K=1;8 H=x;$(4p).5e(6(){5(!54(F.37))w;5(7.3f()!=1){4e()}$(\'2L#d-X\').l(4s);$("#d-X").m(\'1I\',q(\'1N\'));$(\'#d-4w\').l(4c);$(\'#2n-4U\').l(3b);$(\'#2n-4S\').l(39);$(\'#2n-52\').l(32);$(\'#4V\').l(3k);$(\'#2R\').l(3l);5(4f()){$(\'#2O\').t();$(\'#2R\').t()}h{$(\'#2O\').l(3d);$(\'#2O\').u();$(\'#2R\').u()}$(\'#5f\').l(3w);$(\'#4M\').l(4g);$(\'j#s-d\').R(\'2i\',\'4B\');5(4f()){$(\'#1c-2x-2r\').t()}h{$(\'#1c-2x-2r\').u();$(\'#2x-2r\').26(7.4P())}$(\'#2X-3q\').l(3t);$(\'#2X-4I\').l(38);$(\'#1b\').t();$(\'#d-X\').4F(4u);$(\'#d-A-s\').l(3K);$(\'#d-10-s\').l(3I);$(\'#d-E-s\').l(3M);4i();5(2w()==x){$(\'#d-X\').4l(2q,2B);$(\'#s-d\').4l(2q,2B)}5(2w()==k){8 3z=4p.4O(\'E\')[0];3z.4Q(\'4K\',2u,x)}h{$(\'E\').l(2u)}});6 2q(){H=k};6 2B(){H=x};6 3o(1p,1o){$(1p).l(6(){2A(1p,1o)});2A(1p,1o)};6 2A(1p,1o){8 3F=$(1p+\':9\').15==0;5(3F){$(1o).16(\'P\')}h{$(1o).18(\'P\')}};6 2u(1x){5(2w()){5($(\'#s-d\').2W(":2H")){8 1D,1q;8 45=4J 4H();5(45.4N==\'4C\'){1D=1x.2e[0].5a;1q=1x.2e[0].56}h{1D=1x.2e[0].57;1q=1x.2e[0].5b}8 2P=$(\'#s-d\').3X().2o;8 2J=$(\'#s-d\').3X().36;8 3A=$(\'#s-d\').17()+2P;8 3G=$(\'#s-d\').1n()+2J;5(1D>=2P&&1D<=3A&&1q>=2J&&1q<=3G){H=k}h{H=x;$(\'#s-d\').t()}}}h{5(!H){$(\'#s-d\').t()}}};6 3M(){$(\'#d-E\').m(\'9\',\'9\');$(\'#d-10\').D(\'9\');$(\'#d-A\').D(\'9\');H=k};6 3I(){$(\'#d-10\').m(\'9\',\'9\');$(\'#d-E\').D(\'9\');$(\'#d-A\').D(\'9\');H=k};6 3K(){$(\'#d-A\').m(\'9\',\'9\');$(\'#d-10\').D(\'9\');$(\'#d-E\').D(\'9\');H=k};6 4u(e){8 4q=(e.4x?e.4x:e.4R);5(4q==13){$(\'#d-4w\').l()}H=k};6 4s(){5($("j#s-d").2W(":44")){$(\'j#s-d\').2f(\'4T\');5($(\'#s-d 2L:9\').15==0){$(\'#d-A\').m(\'9\',\'9\')}}h{$(\'j#s-d\').t()}};6 4c(){8 A=$(\'#d-A\').m(\'9\');8 10=$(\'#d-10\').m(\'9\');8 E=$(\'#d-E\').m(\'9\');8 1C;8 4d=$(\'#d-X\').1Q();5(A==\'9\'){1C=$(\'#d-A\').1Q()}5(10==\'9\'){1C=$(\'#d-10\').1Q()}5(E==\'9\'){1C=$(\'#d-E\').1Q()}7.51(4d);7.4Z(1C);12(F.50)};6 4g(){12(F.5c)};6 3b(){2t(2E.4Y);5(B.1h){1h()}$("#d-X").m(\'1I\',q(\'1N\'))};6 32(){2t(2E.53);5(B.1h){1h()}$("#d-X").m(\'1I\',q(\'1N\'))};6 39(){2t(2E.4X);5(B.1h){1h()}$("#d-X").m(\'1I\',q(\'1N\'))};6 3k(){12(F.4W)};6 3l(){12(F.1W)};6 3d(){5(7.1y()){5(7.2s()==0){$("#25").D(\'9\')}h{$("#25").m(\'9\',\'9\')}}h{$(\'#25\').m(\'P\',\'P\').D(\'9\')}5(7.1z()){5(7.2F()==0){$("#1S").D(\'9\')}h{$("#1S").m(\'9\',\'9\')}}h{$(\'#1S\').m(\'P\',\'P\').D(\'9\')}5(7.1B()){5(7.2T()==0){$("#1P").D(\'9\')}h{$("#1P").m(\'9\',\'9\')}}h{$(\'#1P\').m(\'P\',\'P\').D(\'9\')}5(7.1y()==k||7.1B()==k||7.1z()==k){5(7.5d()=="Y"){5(7.1t()==1){2c();$(\'#1b\').u();$(\'#1b\').1j();3o(\'#1b .5h 2L\',\'#2X-3q\')}h{5(7.1e()==1U||7.1e()==55){2c();$(\'#1b\').u();$(\'#1b\').1j()}h{5(7.1e()==0){8 Q=7.2T()==1;8 M=7.2F()==1;8 L=7.2s()==1;2d(Q,M,L,k)}h 5(7.1e()==1){14()}}}}h{14()}}h{14()}};6 3w(){12(F.59)};6 14(){8 y={Z:7.O()};1w(7.1a(),"58","4D",y,6(f){4E.4z();4A().4G(4L.O);12(F.37)},1U)};6 38(e){e.4a();8 2g=$(\'#3e\').m(\'9\');5(2g==\'9\'){7.1t(0);}h{7.1t(1);}7.1e(1);14()};6 3t(e){e.4a();5($(11).2C(\'P\'))w;8 Q=$("#1P").m(\'9\')==\'9\';8 M=$("#1S").m(\'9\')==\'9\';8 L=$("#25").m(\'9\')==\'9\';8 2g=$(\'#3e\').m(\'9\');6n();$(\'#1b\').R(\'z-6o\',\'6p\');2c();5(2g==\'9\'){7.1t(0);7.2T(Q);7.2F(M);7.2s(L);2d(Q,M,L,k)}h{7.1t(1);2d(Q,M,L,k)}7.1e(0);};6 2d(Q,M,L,1K,2I){5((7.1y()==k&&L)||(7.1B()==k&&Q)||(7.1z()==k&&M)){5(1K){2c()}$().2M({1V:\'1T-1j\'});$().2M(\'6k\',{1r:\'\',6l:k,26:\'\',6m:\'G\'});$(\'#G\').S("<j I=\'r-v-35\'></j>");1X(6(){8 1g=k;8 1i=k;8 1l=k;5(Q&&7.1B()==k){1g=1F(2);5(1g){1g=1O(1M.2m({"1r":2,"f":7.6q()}),\'6u.2V\',2);5(1g){7.1B(x);$(\'#G\').S("<j I=\'r-v-1k-1m r-v-o\'>"+q(\'3r\')+" "+q(\'2S\')+"</j>")}1H(2)}5(!1g){$(\'#G\').S("<j I=\'r-v-1k-1f r-v-o\'>"+q(\'3r\')+" "+q(\'2Z\')+"</j>")}}5(L&&7.1y()==k){1l=1F(4);5(1l){1l=1O(1M.2m({"1r":3,"f":7.6v()}),\'6w.2V\',4);5(1l){7.1y(x);$(\'#G\').S("<j I=\'r-v-1k-1m r-v-o\'>"+q(\'3x\')+" "+q(\'2S\')+"</j>")}1H(4)}5(!1l){$(\'#G\').S("<j I=\'r-v-1k-1f r-v-o\'>"+q(\'3x\')+" "+q(\'2Z\')+"</j>")}}5(M&&7.1z()==k){1i=1F(1);5(1i){1i=1O(1M.2m({"1r":1,"f":7.6r()}),\'6s.2V\',1);5(1i){7.1z(x);$(\'#G\').S("<j I=\'r-v-1k-1m r-v-o\'>"+q(\'34\')+" "+q(\'2S\')+"</j>")}1H(1)}5(!1i){$(\'#G\').S("<j I=\'r-v-1k-1f r-v-o\'>"+q(\'34\')+" "+q(\'2Z\')+"</j>")}}$(\'#G .r-v-35\').t();$(\'.r-v-3p\').l(6(){$().2M(\'6t\',$(\'#G\'),1U)});5(1K){$(\'.r-1V-1T-1j\').R(\'17\',\'6j\');$(\'.r-1V-1T-1j\').R(\'69-2o\',\'-6a\');$(\'.r-v-3p\').6b(\'l\',14)}5(2I){2I()}},47)}h{5(1K){14()}}};6 1O(f,3m,1r){8 C=x;8 y=[{3u:\'Z\',A:7.O()},{3u:\'66\',A:f,67:3m,2y:\'26-68\'}];6c(7.1a(),y,x,6(f){5(1M.6g(f).C=="1m"){C=k}},6(a,b,c){});w C};6 1F(20){8 C=x;8 y={"Z":7.O(),"3j":20};1w(7.1a(),"6h","21",y,6(f){5(f.C=="1m"){C=k}},6(1s,b,c){});w C};6 1H(20){8 C=x;8 y={"Z":7.O(),"3j":20};1w(7.1a(),"6i","21",y,6(f){5(f.C=="1m"){C=k}},6(1s,b,c){});w C};6 6d(){5(7.4j()!=F.1W){5(7.3f()==1){3h()}}};6 3h(){8 33=\'<j 31="1A-2v-1f">\'+\'<j 3n="2i:3v; 17:3g%; 1n:3g%;">\'+\'<j 3n="2i:3v-6e; 26-3s:1j; 6f-3s:1T;">\'+\'<p>\'+q(\'6x\')+\'</p>\'+\'<j><3a 31="1A-4h-4k">6N</3a></j>\'+\'</j></j></j>\';$(\'E\').6O(33);$(\'#1A-2v-1f\').R({\'6K\':\'#6M\',\'6L\':1,\'1V\':\'6J\',\'36\':\'0\',\'2o\':\'0\',\'17\':$(B).17(),\'1n\':$(B).1n(),\'6I\':\'#6B\',\'6C\':\'6A\'});$(B).6y(6(){$(\'#1A-2v-1f\').R({\'17\':$(B).17(),\'1n\':$(B).1n()})});$(\'#1A-4h-4k\').l(6(){7.4j(F.1W);12(F.1W)})};6 4i(){$(\'#2z\').l(6(){5($(11).2C(\'u\')){$(11).18(\'u\').16(\'t\');$(\'#1J\').2b()}h{$(\'.22-1Z\').t();$(11).18(\'t\').16(\'u\');K=1;28()}});$(\'#2z\').18(\'u\').16(\'t\');$(\'#2Y-1d-o\').l(6(e){3S();e.48();w x});$(\'#2K-1d-o\').l(6(e){3R();e.48();w x});$(\'.22-1Z\').l(6(){$(11).2b()});2j()};6 4y(){w 4t().6z*47;}6 2j(){8 y={"Z":7.O()};6G(7.1a(),"6H","21",y,46,6(1s,b,c){})};6 46(f){5(f){8 24=6F(7.2p());5(6D(24)){24=0}8 23=24+f.4b;5($(\'#2z\').2C(\'t\')){7.2p(23);5(23>0){$(\'#2k\').1v(23)}h $(\'#2k\').1v(\'\')}5(f.4b>0){$(\'.22-1Z\').1v(q("6E")).2f();1X(6(){$(\'.22-1Z\').2b()},4v)}}1X(2j,4y())};6 28(){8 4o=4t();8 1Y=4o.1Y;8 4n=(K-1)*1Y+1;8 4m=K*1Y;8 y={"Z":7.O(),"3H":4n,"1G":4m};1w(7.1a(),"5y","21",y,6(f){7.2p(0);$(\'#2k\').1v(\'\');3J(f)},6(1s,b,c){5z()})};6 49(f){w(f.5A+5v)+"/"+(f.5w+1)+"/"+f.3E+" "+f.5x+":"+f.5E}6 3J(f){$(\'#u-1E-o\').1v(\'\');5F(8 i=0;i<f.1L.15&&i<=(f.1G-f.3H);i++){8 3B=3P(f.1L[i].3N,30).1u(/</g,\'&3O;\').1u(/>/g,\'&3L;\');8 3y=f.1L[i].3N.1u(/</g,\'&3O;\').1u(/>/g,\'&3L;\').1u(/\\n/g,\'<5G/>\');8 o=\'<j I="29">\';o+=\'<2Q I="5B"><a 5C="#">\'+3B+\'</a></2Q>\';o+=\'<p>\'+3y+\'<3D I="3E">\'+49(f.1L[i].5D)+\'</3D></p></j>\';$(\'#u-1E-o\').S(o)}$(\'#u-1E-o .29 p\').t();$(\'#1J\').2f();5(K>1||f.1G<f.41){$(\'#1J .40\').u()}h{$(\'#1J .40\').t()}5(f.1G<f.41){$(\'#2K-1d-o\').u()}h{$(\'#2K-1d-o\').t()}5(K>1){$(\'#2Y-1d-o\').R({"3Z":"2H"})}h{$(\'#2Y-1d-o\').R({"3Z":"44"})}$(\'#u-1E-o .29 2Q\').l(6(){8 42=!$(11).2D().43(\'p\').2W(\':2H\');$(\'#u-1E-o .29 p\').2b();5(42){$(11).2D().43(\'p\').2f()}})};6 3R(){K++;28()};6 3S(){5(K>1)K--;h K=1;28()};6 3P(2a,15){5(2a.15<=15){w 2a}h{w 2a.5u(0,15)+"..."}};6 5l(3V,3W){$(\'#27 1c a\').18(\'2G\').18(\'3T\');5($(\'#27 1c a#3Q-2U\').5m()){$(\'#27 1c a#3Q-2U\').16(\'2G\')}$(\'#27 1c\').18(\'3U\');$(3V).16(3W?\'3T\':\'2G\').2D().16("3U")};6 5n(2y){8 J=\'\';5i(2y){U V.5j:{J=\'W/T/5k.19\';N}U V.5r:{J=\'W/T/3C.19\';N}U V.5s:{J=\'W/T/3C.19\';N}U V.5t:{J=\'W/T/5o.19\';N}U V.5p:{J=\'W/T/5q.19\';N}U V.5X:{J=\'W/T/5Y.5Z\';N}U V.5U:{J=\'W/T/5V.19\';N}U V.5W:{J=\'W/T/63.19\';N}2U:N}w J};6 64(2N){8 y={Z:7.O(),2N:2N,65:\'2\'};1w(7.1a(),"60","61",y,6(f){8 2h=3Y(f.62.A.1R);5(3c()){B.5T=1U;B.4r(2h,"5K");8 5L=1X(6(){4e()},5M)}h{B.4r(2h);}},6(1s,b,c){})};6 3Y(1R){w 5H("5I")+"/?Z="+7.O()+"&1R="+1R+"&5J=k"};6 3c(){5(!B.5Q){8 2l=5R.5S.5N();5(!/5O/.3i(2l)&&/5P/.3i(2l)){w k}}w x};', 62, 423, '|||||if|function|ClientData|var|checked||||searchbox||data||else||div|true|click|attr||message||i18nText|toast|header|hide|show|item|return|false|params||content|window|result|removeAttr|body|ScreenIds|divResultMessage|isHoverOn|class|src|currentPagePushMessage|isBackupBookmark|isBackupMemo|break|userInfo_sid|disabled|isBackupMarking|css|append|bookshelf|case|ContentTypeKeys|img|key||sid|tag|this|avwScreenMove||webLogoutEvent|length|addClass|width|removeClass|jpg|userInfo_accountPath|dlgConfirmBackup1|li|page|userOpt_logoutMode|error|isBackupMarkingOK|changeLanguageCallBackFunction|isBackupMemoOK|center|image|isBackupBookmarkOK|success|height|buttonid|selector|currPosY|type|xhr|userOpt_bkConfirmFlg|replace|html|avwCmsApiSync|event|isChangedBookmark|isChangedMemo|avw|isChangedMarkingData|searchDivision|currPosX|push|sendSignalBackupStart|recordTo|sendSignalBackupFinish|placeholder|accordion|isLogout|messageList|JSON|msgPlaceHolder|backupFile|chkBkAllMarking|val|resourceId|chkBkAllMemo|middle|null|position|Setting|setTimeout|pushPageCount|pushmessage|typeBackup|post|notification|totalMessage|currentMessage|chkBkAllShiori|text|menu_sort|getPushMessageList|newmsg|strInput|slideUp|lockLayout|DoBackup|targetTouches|slideDown|remember|resourceUrl|display|getPushMessageNew|numbermessage|ua|stringify|language|left|pushInfo_newMsgNumber|searchBoxHoverFunction|username|userOpt_bkShioriFlag|changeLanguage|bodyClickFunction|auth|isTouchDevice|login|contentType|liPushMessage|setDisabledButton|searchBoxHoverOffFunction|hasClass|parent|Consts|userOpt_bkMemoFlag|descending_sort|visible|funcCallback|topsearch|next|input|toastmessage|contentId|dspLogout|leftsearch|h5|dspSetting|msgBackupSuccess|userOpt_bkMakingFlag|default|json|is|dlgConfirmBackup|prev|msgBackupFailed||id|changeLanguageEn|tags|txtBkMemo|loading|top|Login|confirmWithoutBackupFunction|changeLanguageKo|button|changeLanguageJa|isSafariNotOnIpad|logoutFunction|chkRememberBackup|requirePasswordChange|100|showErrorScreenForceChangePassword|test|fileType|bookmarkFunction|updateConfigFunction|file|style|checkDisabledButton|close|backup|txtBkMarking|align|confirmWithBackupFunction|name|table|historyClickFunction|txtBkShiori|detailMessage|bodyTag|rightsearch|titleMessage|icon_05|span|date|isDisabled|bottomsearch|recordFrom|headerSearchTagClickFunction|showListPushMessage|headerSearchContentClickFunction|gt|headerSearchBodyClickFunction|messageDetail|lt|truncate|off|nextPushMessageClick|previousPushMessageClick|ascending_sort|current|currentid|isAsc|offset|getResourceByIdFromAPI|visibility|pagechange|totalRecord|isshow|find|hidden|avwUserEnvObj|callbackGetPushMessageNewSuccess|1000|stopPropagation|getDateCreatePushMessage|preventDefault|count|searchHeaderButtonFunction|searchText|ToogleLogoutNortice|isAnonymousLogin|homeClickFunction|unauth|initPushMessage|BookmarkScreen|ok|hover|to|from|sysSettings|document|code|open|toggleSearchPanel|avwSysSetting|headerSearchKeyDownEventFunction|timeWaitCloseNewInfoPushMessage|search|keyCode|getTimeWaitCheckNewPushMessage|clear|avwUserSetting|none|android|GET|SessionStorageUtils|keydown|remove|UserEnvironment|withoutbackup|new|touchstart|Keys|dspHome|os|getElementsByTagName|userInfo_userName|addEventListener|which|kr|slow|jp|dspShiori|BookmarkList|ConstLanguage_Ko|ConstLanguage_Ja|searchCond_searchDivision|ContentSearch|searchCond_searchText|en|ConstLanguage_En|avwCheckLogin|undefined|pageY|clientX|webLogout|History|pageX|clientY|Home|serviceOpt_user_data_backup|ready|dspViewHistory|5000|option_backup|switch|Type_PDF|icon_01|setStatusSort|size|getIconTypeContent|icon_02|Type_Music|icon_06|Type_Enquete|Type_Html|Type_Image|substring|1900|month|hours|webPushMessageList|showSystemError|year|postItem|href|messageSendDate|minutes|for|br|getURL|webResourceDownload|isDownload|_self|toogleTime|200|toLowerCase|ipad|safari|chrome|navigator|userAgent|onbeforeunload|Type_Others|icon_03|Type_Video|Type_NoFile|icon_07|png|webGetContent|get|contentData|icon_04|downloadResourceById|getType|formFile|fileName|plain|margin|250px|live|avwUploadBackupFile|checkForceChangePassword|cell|vertical|parse|notifyBackupStart|notifyBackupFinish|500px|showToast|sticky|customMessages|unlockLayout|index|99|MarkingData|MemoData|ContentMemo|removeToast|Marking|BookMarkData|Bookmark|msgPWDNeedChange|resize|pushTimePeriod|10000|ccc|zIndex|isNaN|msgPushAlert|parseInt|avwCmsApi|webPushMessageNew|background|fixed|color|opacity|fff|OK|prepend'.split('|'), 0, {}))
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
/// <reference path="header.js" />
//Start Declare Variables
//----Constant-----------//
var DEFAULT_DISP_NUMBER_RECORD_FROM = 1;
var DEFAULT_DISP_NUMBER_RECORD_TO = 15;
var DEFAULT_SORT_TYPE = '4';
var DEFAULT_SORT_ORDER = '2';
var DEFAULT_SEARCH_DIVISION = 0;
var DEFAULT_IMG_OPTION_MEMO = 'img/list/icon_sticker.png';
var DEFAULT_IMG_OPTION_MARKING = 'img/list/icon_pen.png';
var DEFAULT_IMG_CONTENT_EDIT = 'img/common/band_updated.png';
var DEFAULT_IMG_CONTENT_NEW = 'img/common/band_new.png';
var iNumberOfNextRecord = 15;
//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 = [];
var ThumbnailForOtherType = {
Thumbnail_ImageType : 'img/image_type.png',
Thumbnail_VideoType : 'img/iPad_video.png',
Thumbnail_MusicType : 'img/thumb_default_sound.png',
Thumbnail_OthersType : 'img/thumb_default_other.png',
Thumbnail_NoFileType : 'img/thumb_default_none.png',
Thumbnail_HtmlType : 'img/thumb_default_html.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 = [];
var totalPage;
var contentViewData = [];
var noRecordFlg = false;
var home_isMove = false;
var history_contentTitleKana = [];
$(document).ready(function(){
if (!avwCheckLogin(ScreenIds.Login)){
return;
}
LockScreen();
document.title = i18nText('dspViewHistory') + ' | ' + i18nText('sysAppTitle');
ClientData.BookmarkScreen(ScreenIds.History);
if(ClientData.requirePasswordChange() != 1){
if(ClientData.ReadingContentIds() == null || ClientData.ReadingContentIds() == 'undefined' || ClientData.ReadingContentIds().length == 0){
}else{
syncReadingContent();
}
//remove hover effect when is touch device
removeHoverCss();
//Render Grid
renderGridView();
//Go To Details Page
$('canvas').live('click', canvasClickFunction);
//$('canvas').live('touchstart', canvasClickFunction);
$('canvas').live('touchend', canvasClickFunction);
$('canvas').live('touchmove', function () { home_isMove = true; });
//Open dialog
$('.dialog').live('click', titleClickFunction);
//$('.dialog').live('touchstart', titleClickFunction);
$('.dialog').live('touchend', titleClickFunction);
$('.dialog').live('touchmove', function () { home_isMove = true; });
//Sort Title
$('#control-sort-title').click(sortByTitleFunction);
//Sort by title kana
$('#control-sort-titlekana').click(sortByTitleKanaFunction);
//sort by release date
$('#control-sort-releasedate').click(sortByReleaseDateFunction);
$('#control-sort-viewdate').click(sortByViewDateFunction);
//Go To Details Page
$('.button-details').live('click', readSubmenuFunction);
//$('.button-details').live('touchstart', readSubmenuFunction);
$('.button-details').live('touchend', readSubmenuFunction);
$('.button-details').live('touchmove', function () { home_isMove = true; });
$(window).resize(function () {
if ($("#contentDetail").css("display") != "none") {
// Refresh panel of detail to center.
$("#contentDetail").center();
if ($("#contentDetail").height() > $(window).height()){
$("#contentDetail").css('top', '0');
}
}
});
}
else{
//Check if Force Change password
checkForceChangePassword();
}
});
//Call API
function abapi(name, param, method, callback){
avwCmsApiSync(ClientData.userInfo_accountPath(), name, method, param, callback, null);
};
///Render Content
function renderContent(id, text, division, type, order, from, to, cateid, grpid) {
var params = {
sid: id,
searchText: text,
searchDivision: division,
sortType: type,
sortOrder: order,
//recordFrom: from,
//recordTo: to,
categoryId: cateid,
groupId: grpid
};
avwCmsApiSync(ClientData.userInfo_accountPath(), 'webContentList', 'POST', params,
function (data) {
$('#content-grid').html('');
//var htmlTemp = "";
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
var outputDate = formatDeliveryDate(post.contentDeliveryDate);
//renderViewDate
var viewdate = renderViewDate(post.contentId);
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
/*htmlTemp += '<section class="sectionhistory">'
//$('#content-grid').append(
// '<section>'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
+ ' <canvas style="display:none" height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '">'
+ ' </canvas>'
+ ' <img id="imgloading'+ post.contentId +'" class="home_canvas" src="./img/data_loading.gif" height="25px" width="25px" style=""/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="dialog name" contentid="' + post.contentId + '">' + truncate(htmlEncode(post.contentTitle), 25) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt">' + i18nText("txtPubDt") + '</span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt">' + i18nText("txtViewDt") + '</span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">' + i18nText("txtRead") + '</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>'*/
var htmlTemp = '<section class="sectionhistory">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
+ ' <canvas height="110" width="150" id="content-thumbnail' + post.contentId + '" contentid="' + post.contentId + '" style="display:none;">'
+ ' </canvas>'
+ ' <img id="imgloading' + post.contentId + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentId + '" class="name dialog" contentid="' + post.contentId + '">'
+ ' <img class="listIcon" src="'+getIconTypeContent(post.contentType)+'" width="20" height="20">'
+ truncate(htmlEncode(post.contentTitle), 20)
+ ' </a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt"> </span> : ' + outputDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt"> </span>:<span id="lblVdate' + post.contentId + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentId + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentId + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentId + '" lang="txtRead">'+i18nText("txtRead")+'</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>';
$('#content-grid').append(htmlTemp);
}
}
for (var i = 0; i < data.contentList.length; i++) {
post = data.contentList[i];
var viewdate = renderViewDate(post.contentId);
// save alert message level
messageLevel[post.contentId] = { alertMessageLevel:post.alertMessageLevel, alertMessage:post.alertMessage};
if (viewdate != null && viewdate != 'undefined' && viewdate != '') {
//assign thumbnail to array
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);
//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,post.contentType);
//showContentThumbnail();
}
}
if (data.recordFrom) {
ClientData.searchCond_recordFrom(data.recordFrom);
}
if (data.recordTo) {
ClientData.searchCond_recordTo(data.recordTo);
}
totalPage = data.totalRecord;
//Render Page number
reRenderPageNumber(totalPage, totalPage);
}, null);
};
//Handle language
function handleLanguage(){
//if(ClientData.userInfo_language() == Consts.ConstLanguage_En || ClientData.userInfo_language() == Consts.ConstLanguage_Ko)
if (getCurrentLanguage() == Consts.ConstLanguage_En || getCurrentLanguage() == Consts.ConstLanguage_Ko)
{
$('#control-sort-titlekana').css('display','none');
$('#control-sort-titlekana-off').css('display','none');
$('#label-sort-titlekana').css('display','none');
$('#separate').css('display','none');
$("#titlekana-sorttype").html('');
}
else {
if (ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' || ClientData.searchCond_sortType() != '') {
var typeSort = ClientData.searchCond_sortType();
var orderSort = ClientData.searchCond_sortOrder();
setStatusSort('#'+$('#menu_sort li.current a').attr('id'),orderSort == Consts.ConstOrderSetting_Asc);
// if (typeSort == 2) {
// if (orderSort == Consts.ConstOrderSetting_Asc) {
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// }
// else {
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// }
// }
}
if(noRecordFlg){
$('#label-sort-titlekana').css('display','block');
$('#separate').css('display','block');
$('#control-sort-titlekana-off').css('display','block');
$('#content-grid').html(i18nText('msgHistoryNotExist'));
}else{
$('#control-sort-titlekana').css('display','block');
$('#separate').css('display','block');
}
}
};
//Initial Screen
function renderGridView(){
var fromPage = '';
var toPage = '';
var sortType = DEFAULT_SORT_TYPE;
var sortOrder = DEFAULT_SORT_ORDER;
var searchText = '';
var searchDivision = DEFAULT_SEARCH_DIVISION;
var genreId = '';
var groupId = '';
var sid = ClientData.userInfo_sid();
ClientData.searchCond_recordFrom(fromPage);
ClientData.searchCond_recordTo(toPage);
ClientData.searchCond_sortType(sortType);
ClientData.searchCond_sortOrder(sortOrder);
ClientData.searchCond_searchDivision(searchDivision);
//Handle display sort
handleSortDisp();
//Display user name
$('#login-username').html(ClientData.userInfo_loginId_session());
//Refresh GridView
refreshGrid();
if(ClientData.ReadingContentIds() == null || ClientData.ReadingContentIds() == 'undefined' || ClientData.ReadingContentIds().length == 0){
displayResultNoRecord();
noRecordFlg = true;
reRenderPageNumber(0,0);
}
else{
//Render Gridview
renderContent(sid, searchText, searchDivision, 3, sortOrder, fromPage, toPage, genreId, groupId);
sortByViewDateDesc();
}
//Language Handle
handleLanguage();
};
//Canvas Click function
function canvasClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('id');
var outputId = contentId.substring(17);
// Set content id for screen: content detail
ClientData.contentInfo_contentId(outputId);
// Get image of selected image
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();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == outputId){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: outputId, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(outputId);
//Set MetaVersion for content
setMetaVersionData(outputId);
//Delete 'new' icon
drawEditImage(outputId);
//Open content Detail
openContentDetail();
};
//Re-render page from and total record
function reRenderPageNumber(dispRecord, dispTotal){
$('#dispPage').html(contentViewData.length);
$('#totalPage').html(contentViewData.length);
$('.pageNumControl').css('visibility','visible');
};
//Sort By Title Function
function sortByTitleFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
// $('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '1'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▼');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
sortByTitleDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
sortByTitleAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByTitleAsc();
}
setStatusSort('#control-sort-title',sortOrder == Consts.ConstOrderSetting_Asc);
sortType = '1';
ClientData.searchCond_sortType(sortType);
//refresh Gridview
//refreshGrid();
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By Title Kana function
function sortByTitleKanaFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
// $('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '2'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
sortByTitleKanaDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
sortByTitleKanaAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByTitleKanaAsc();
}
setStatusSort('#control-sort-titlekana',sortOrder == Consts.ConstOrderSetting_Asc);
sortType = '2';
//refresh gridview
//refreshGrid();
ClientData.searchCond_sortType(sortType);
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, null, null, genreId, groupId);
};
//Sort By Release Date
function sortByReleaseDateFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-viewdate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
var sid = ClientData.userInfo_sid();
var recordFrom = null;
var recordTo = null;
var genreId = ClientData.searchCond_genreId();
var groupId = ClientData.searchCond_groupId();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '3'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▼');
// $('#rDate-sorttype').css('width', '12px');
// $('#vDate-sorttype').html('');
sortByPublishDateDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
// $('#vDate-sorttype').html('');
sortByPublishDateAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
// $('#vDate-sorttype').html('');
ClientData.searchCond_sortOrder(sortOrder);
sortByPublishDateAsc();
}
setStatusSort('#control-sort-releasedate',sortOrder == Consts.ConstOrderSetting_Asc);
sortType = '3';
ClientData.searchCond_sortType(sortType);
//renderContent(sid, '', ClientData.searchCond_searchDivision(), sortType, sortOrder, recordFrom, recordTo, genreId, groupId);
};
//Sort By View Date
function sortByViewDateFunction(){
// $(this).addClass('active_tops');
// $('#control-sort-titlekana').removeClass('active_tops');
// $('#control-sort-title').removeClass('active_tops');
// $('#control-sort-releasedate').removeClass('active_tops');
var sortOrder = ClientData.searchCond_sortOrder();
var sortType = ClientData.searchCond_sortType();
if(sortOrder == Consts.ConstOrderSetting_Asc)
{
if(sortType == '4'){
sortOrder = Consts.ConstOrderSetting_Desc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// $('#vDate-sorttype').html('▼');
// $('#vDate-sorttype').css('width', '12px');
sortByViewDateDesc();
}
else{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// $('#vDate-sorttype').html('▲');
// $('#vDate-sorttype').css('width', '12px');
sortByViewDateAsc();
}
ClientData.searchCond_sortOrder(sortOrder);
}
else
{
sortOrder = Consts.ConstOrderSetting_Asc;
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// $('#vDate-sorttype').html('▲');
// $('#vDate-sorttype').css('width', '12px');
sortByViewDateAsc();
ClientData.searchCond_sortOrder(sortOrder);
}
setStatusSort('#control-sort-viewdate',sortOrder == Consts.ConstOrderSetting_Asc);
sortType = '4';
ClientData.searchCond_sortType(sortType);
};
//Get Thumnail base on contentid
function returnThumbnail(contentid){
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, "_blank");
// // redraw content remove new icon
// drawEditImage(contentId);
// });
//};
////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;
};
//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) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentId = $(this).attr('contentid');
// check limit of content
checkLimitContent(contentId,
function()
{
readSubmenuFunction_callback(contentId);
});
};
// read content callback
function readSubmenuFunction_callback(contentId)
{
var contentThumbnail = returnThumbnail(contentId);
var date = new Date();
var month = date.getMonth()+1;
var day = date.getDate();
var outputDate = formatNormalDate(day, month, date.getFullYear());
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
if(ClientData.ReadingContentIds().length > 0){
contentIdArray = ClientData.ReadingContentIds();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentId){
checkflag = true;
if(contentIdArray[nIndex].viewdate == null || contentIdArray[nIndex].viewdate == 'undefined' || contentIdArray[nIndex].viewdate == ''){
contentIdArray[nIndex].viewdate = outputDate;
contentIdArray[nIndex].originviewdate = date;
}
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
}
else{
contentIdArray.push({contentid: contentId, viewdate: outputDate, originviewdate: date});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set ResouceVersion for content
setResourceVersionData(contentId);
//Set MetaVersion for content
setMetaVersionData(contentId);
//Set data for readingcontentid
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);
// redraw content remove new icon
drawEditImage(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
function checkContentMarkingMemoOption(contentId){
//Check if contentid has marking
if(ClientData.MarkingData().length == 0){
$('#imgBookMark'+contentId).css('visibility','hidden');
}
else{
for (var nIndex1 = 0; nIndex1 < ClientData.MarkingData().length; nIndex1++) {
if (ClientData.MarkingData()[nIndex1].contentid == contentId) {
$('#imgBookMark'+contentId).css('visibility','visible');
break;
}
else{
$('#imgBookMark'+contentId).css('visibility','hidden');
}
}
}
if(ClientData.MemoData().length == 0){
$('#imgMemo'+contentId).css('visibility','hidden');
}
else{
// Check if contentid has memo
for (var nIndex1 = 0; nIndex1 < ClientData.MemoData().length; nIndex1++) {
if (ClientData.MemoData()[nIndex1].contentid == contentId) {
$('#imgMemo'+contentId).css('visibility','visible');
break;
}
else
{
$('#imgMemo'+contentId).css('visibility','hidden');
}
}
}
};
//Check if User has read content
function checkUserHasReadContent(contId, resourceVer, metaVer){
var imgThumb = new Image();
//imgThumb.src = returnThumbnail(contId);
var imgIconNew = new Image();
//imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
var imgIconEdit = new Image();
//imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
var c = document.getElementById('content-thumbnail'+contId);
var ctx = c.getContext('2d');
var readFlg = false;
var versionArr = ClientData.ResourceVersion();
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);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
showContentThumbnail(contId);
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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
for (var nIndex1 = 0; nIndex1 < ClientData.ReadingContentIds().length; nIndex1++) {
if(ClientData.ReadingContentIds()[nIndex1].contentid == contId){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(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;
}
else{
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconNew.onload = function(){
ctx.drawImage(imgIconNew, c.width/2 - resizeImg[0]/2, 0);
};
imgIconNew.src = DEFAULT_IMG_CONTENT_NEW;
};
//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.
}
}
}
//Check if resource version has change
if(readFlg){
if(versionArr == null || versionArr <= 0 || versionArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < versionArr.length; nIndex2++){
if(versionArr[nIndex2].contentid == contId){
if(versionArr[nIndex2].resourceversion != resourceVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
//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;
}
}
}
}
if(metaArr == null || metaArr <= 0 || metaArr == 'undefined'){
}
else{
for(var nIndex2 = 0; nIndex2 < metaArr.length; nIndex2++){
if(metaArr[nIndex2].contentid == contId){
if(metaArr[nIndex2].metaversion != metaVer){
imgThumb.onload = function(){
var resizeImg = resizeResourceThumbnail(imgThumb, c.width, c.height);
ctx.drawImage(imgThumb, c.width/2 - resizeImg[0]/2, 0, resizeImg[0], resizeImg[1]);
showContentThumbnail(contId);
imgIconEdit.onload = function(){
ctx.drawImage(imgIconEdit, c.width/2 - resizeImg[0]/2, 0);
};
imgIconEdit.src = DEFAULT_IMG_CONTENT_EDIT;
};
//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;
}
}
}
}
readFlg = false;
}
};
//draw Edit Image
function drawEditImage(id) {
var img = new Image();
var imgSrc = returnThumbnail(id);
if(imgSrc != null){
}
else{
var contentType = returnContentType(id);
if(contentType == ContentTypeKeys.Type_Image){
imgSrc = ThumbnailForOtherType.Thumbnail_ImageType;
}
else if(contentType == ContentTypeKeys.Type_Music){
imgSrc = ThumbnailForOtherType.Thumbnail_MusicType;
}
else if(contentType == ContentTypeKeys.Type_Video){
imgSrc = ThumbnailForOtherType.Thumbnail_VideoType;
}
else if(contentType == ContentTypeKeys.Type_NoFile){
imgSrc = ThumbnailForOtherType.Thumbnail_NoFileType;
}
else if(contentType == ContentTypeKeys.Type_Others){
imgSrc = ThumbnailForOtherType.Thumbnail_OthersType;
}
else if(contentType == ContentTypeKeys.Type_Html){
imgSrc = ThumbnailForOtherType.Thumbnail_HtmlType;
}
}
var c = document.getElementById('content-thumbnail' + id);
//use getContext to use the canvas for drawing
var ctx = c.getContext('2d');
ctx.clearRect(0, 0, c.width, c.height);
img.onload = function () {
var resizeImg = resizeResourceThumbnail(img, c.width, c.height);
ctx.drawImage(img, (c.width / 2) - (resizeImg[0] / 2) + 4, c.height - resizeImg[1] + 4, resizeImg[0], resizeImg[1]);
$("#loadingIcon" + id).fadeOut('slow', function () {
$('#content-thumbnail' + id).fadeIn('slow');
});
};
img.src = imgSrc;
};
//Render User view date
function renderViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].viewdate;
}
}
};
function returnOriginalViewDate(id){
for(var i = 0; i < ClientData.ReadingContentIds().length; i++){
if(ClientData.ReadingContentIds()[i].contentid == id){
return ClientData.ReadingContentIds()[i].originviewdate;
}
}
};
//handle display sort direction
function handleSortDisp(){
$('#control-sort-title').removeClass('active_tops');
$('#control-sort-titlekana').removeClass('active_tops');
$('#control-sort-releasedate').removeClass('active_tops');
$('#control-sort-viewdate').removeClass('active_tops');
var typeSort;
var orderSort;
if(ClientData.searchCond_sortType() == null || ClientData.searchCond_sortType() == 'undefined' || ClientData.searchCond_sortType() == ''){
$('#title-sorttype').html('');
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
}
else{
if(ClientData.searchCond_sortOrder() != null && ClientData.searchCond_sortOrder() != 'undefined' && ClientData.searchCond_sortType() != ''){
typeSort = ClientData.searchCond_sortType();
orderSort = ClientData.searchCond_sortOrder();
if(typeSort == 1){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▲');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// }
// else{
// $('#title-sorttype').html('');
// $('#title-sorttype').html('▼');
// $('#title-sorttype').css('width', '12px');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// }
//$('#control-sort-title').addClass('active_tops');
setStatusSort('#control-sort-title',orderSort == Consts.ConstOrderSetting_Asc);
}
else if(typeSort == 2){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▲');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// }
// else{
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#titlekana-sorttype').html('▼');
// $('#titlekana-sorttype').css('width', '12px');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('');
// }
//$('#control-sort-titlekana').addClass('active_tops');
setStatusSort('#control-sort-titlekana',orderSort == Consts.ConstOrderSetting_Asc);
}
else if(typeSort == 3){
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▲');
// $('#rDate-sorttype').css('width', '12px');
// $('#vDate-sorttype').html('');
// }
// else{
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('▼');
// $('#rDate-sorttype').css('width', '12px');
// $('#vDate-sorttype').html('');
// }
//$('#control-sort-releasedate').addClass('active_tops');
setStatusSort('#control-sort-releasedate',orderSort == Consts.ConstOrderSetting_Asc);
}
else{
// if(orderSort == Consts.ConstOrderSetting_Asc){
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('▲');
// $('#vDate-sorttype').css('width', '12px');
//
// }
// else{
// $('#title-sorttype').html('');
// $('#titlekana-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#rDate-sorttype').html('');
// $('#vDate-sorttype').html('▼');
// $('#vDate-sorttype').css('width', '12px');
// }
//$('#control-sort-viewdate').addClass('active_tops');
setStatusSort('#control-sort-viewdate',orderSort == Consts.ConstOrderSetting_Asc);
}
}
}
};
//convert delivery Date
function formatDeliveryDate(date){
var day = date.date;
var month = eval(date.month) + 1;
var year = eval(date.year) + 1900;
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//convert view Date
function formatNormalDate(day, month, year){
var outputDate = year + '/' + ((''+month).length<2 ? '0' : '') + month + '/' + ((''+day).length<2 ? '0' : '') + day;
return outputDate;
};
//format Image string
function formatStringBase64(imgStr){
var outputString = 'data:image/jpeg;base64,'+imgStr;
return outputString;
};
//function Open SubMenu Dialog
function titleClickFunction(e){
if (e) {
e.preventDefault();
}
if (home_isMove == true) {
home_isMove = false;
return;
}
var contentid = $(this).attr('contentid');
// Get image of selected image
var base64String = returnThumbnail(contentid);
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();
for(var nIndex = 0; nIndex < contentIdArray.length; nIndex++){
if(contentIdArray[nIndex].contentid == contentid){
checkflag = true;
break;
}
else{
checkflag = false;
}
}
if(!checkflag){
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
}
else{
contentIdArray.push({contentid: contentid, viewdate: '', originviewdate: ''});
}
//Renew ReadingContentID
var newArray = [];
ClientData.ReadingContentIds(newArray);
//Set data for readingcontentid
ClientData.ReadingContentIds(contentIdArray);
//Set ResouceVersion for content
setResourceVersionData(contentid);
//Set MetaVersion for content
setMetaVersionData(contentid);
//Delete 'new' icon
drawEditImage(contentid);
//Open content Detail
openContentDetail();
};
//refresh sort order
function refreshSortTypeOrder(){
$('#title-sorttype').html('');
$('#titlekana-sorttype').html('');
$('#rDate-sorttype').html('');
$('#rDate-sorttype').html('');
$('#vDate-sorttype').html('');
};
//refresh GridView
function refreshGrid(){
//$('#content-grid').html('');
$('#content-grid').empty();
$('.pageNumControl').css('visibility','hidden');
};
function sortByViewDateAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].originviewdate > sortArr[j].originviewdate){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function formatDate(originDate){
var sourceDate = new Date(originDate);
var year = sourceDate.getFullYear() + 1;
var month = sourceDate.getMonth();
var day = sourceDate.getDate();
var hour = sourceDate.getHours();
var minute = sourceDate.getMinutes();
var second = sourceDate.getSeconds();
var milisecond = sourceDate.getMilliseconds();
var newDate = new Date(year, month, day, hour, minute, second, milisecond);
return newDate;
};
function sortByViewDateDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].originviewdate > sortArr[j - 1].originviewdate){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function addReadContentToArray(strContentId, strResourceVersion, strMetaVersion, strThumbnail, strTitle, strTitleKana, strDelivDate,contentType){
if (contentViewData.length > 0) {
var flag;
for(var j = 0; j < contentViewData.length; j++){
if(contentViewData[j].contentid == strContentId){
flag = true;
break;
}
else{
flag = false;
}
}
if(!flag){
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail),contenttype:contentType });
}
}else{
contentViewData.push({contentid: strContentId, originviewdate: formatDate(returnOriginalViewDate(strContentId)), contenttitle: strTitle, contenttitlekana: strTitleKana, deliverydate: strDelivDate, resourceversion: strResourceVersion, metaversion: strMetaVersion, thumbnail: formatStringBase64(strThumbnail),contenttype:contentType });
}
};
function showContentThumbnail(conid) {
$('img#imgloading'+conid).fadeOut('slow',function(){
$('canvas#content-thumbnail'+conid).fadeIn('slow');
});
};
function syncReadingContent(){
var readArr = ClientData.ReadingContentIds();
var metaArr = ClientData.MetaVersion();
var resourceArr = ClientData.ResourceVersion();
for (var i = readArr.length - 1; i >= 0; i--) {
var readContent = readArr[i];
if (!IsExistContent(readContent.contentid)) {
readArr.splice(i, 1);
metaArr.splice(i, 1);
resourceArr.splice(i, 1);
}
// Do not process next
if (avwHasError()) {
return;
}
}
ClientData.ReadingContentIds(readArr);
ClientData.MetaVersion(metaArr);
ClientData.ResourceVersion(resourceArr);
};
/*
Get content title kana if it existed
*/
function getContentNameKana(strContentId) {
var strContentNameKana = null;
for (var nIndex = 0; nIndex < history_contentTitleKana.length; nIndex++) {
if (history_contentTitleKana[nIndex].contentId == strContentId) {
strContentNameKana = history_contentTitleKana[nIndex].contentNameKana;
break;
}
}
return strContentNameKana;
};
/*
Check content whether existed or not
*/
function IsExistContent(strContentId) {
var isExisted = true;
var params = {
sid: ClientData.userInfo_sid(),
getType: '1',
contentId: strContentId
};
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
isExisted = true;
history_contentTitleKana.push({ contentId: strContentId, contentNameKana: data.contentData.contentNameKana });
},
function (xmlHttpRequest, txtStatus, errorThrown) {
if (xmlHttpRequest.status == 404) {
isExisted = false;
}
else {
// Show system error
isExisted = true; // Mark this flag to prevent bookmarks from deleting
showSystemError();
}
});
return isExisted;
};
function changeLanguageCallBackFunction(){
handleLanguage();
document.title = i18nText('dspViewHistory') + ' | ' + i18nText('sysAppTitle');
};
function displayResultNoRecord(){
i18nReplaceText();
$('#content-grid').html(i18nText('msgHistoryNotExist'));
$('#content-grid').css({'text-align':'left','margin-top':'20px','clear':'both','font-size':'16px','color':'red'});
$('#control-nextrecord').css('visibility','hidden');
$('.control_sort_on').hide();
$('.control_sort_off').show();
$('#off-default').addClass('descending_sort');
};
function enableSort(){
$('.control_sort_on').show();
$('.control_sort_off').hide();
};
function truncate(strInput, length){
if (strInput.length <= length)
{
return strInput;
}
else
{
return strInput.substring(0, length) + "...";
}
};
function sortByTitleAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].contenttitle.toUpperCase() > sortArr[j].contenttitle.toUpperCase()){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].contenttitle.toUpperCase() > sortArr[j - 1].contenttitle.toUpperCase()){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = contentViewData;
renderContentAfterSort(resultArr);
};
function sortByPublishDateAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(formatOriginalPublishDate(sortArr[j-1].deliverydate) > formatOriginalPublishDate(sortArr[j].deliverydate)){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByPublishDateDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(formatOriginalPublishDate(sortArr[j].deliverydate) > formatOriginalPublishDate(sortArr[j - 1].deliverydate)){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleKanaAsc(){
var sortArr = contentViewData;
var t;
for(var i = 0; i < sortArr.length; i++){
for(var j = 1; j < sortArr.length - i; j++){
if(sortArr[j-1].contenttitlekana > sortArr[j].contenttitlekana){
t = sortArr[j-1];
sortArr[j-1] = sortArr[j];
sortArr[j] = t;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function sortByTitleKanaDesc(){
var sortArr = contentViewData;
var temp;
for(var i = 0; i < sortArr.length; i++){
for(var j = sortArr.length - 1; j > i; j--){
if(sortArr[j].contenttitlekana > sortArr[j - 1].contenttitlekana){
temp = sortArr[j];
sortArr[j] = sortArr[j - 1];
sortArr[j - 1] = temp;
}
}
}
var resultArr = sortArr;
renderContentAfterSort(resultArr);
};
function renderContentAfterSort(contentSortArr){
refreshGrid();
//var htmlTemp = "";
for(var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
var outputDeliveryDate = formatDeliveryDate(post.deliverydate);
/*htmlTemp += '<section class="sectionhistory">'
+ ' <div class="cnt_section">'
+ ' <a class="img">'
+ ' <canvas style="display:none" height="105px" width="150px" class="home_canvas" id="content-thumbnail' + post.contentid + '" contentid="' + post.contentid + '">'
+ ' </canvas>'
+ ' <img id="imgloading'+ post.contentid +'" src="./img/data_loading.gif" height="25px" class="home_canvas" width="25px"/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentid + '" class="dialog name" contentid="' + post.contentid + '">' + truncate(htmlEncode(post.contenttitle), 25) + '</a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt">' + i18nText("txtPubDt") + '</span> : ' + outputDeliveryDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt">' + i18nText("txtViewDt") + '</span>:<span id="lblVdate' + post.contentid + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentid + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentid + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">' + i18nText("txtRead") + '</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>';*/
var htmlTemp = '<section class="sectionhistory">'
+ ' <div class="cnt_section_list">'
+ ' <a class="img">'
+ ' <canvas height="110" width="150" id="content-thumbnail' + post.contentid + '" contentid="' + post.contentid + '" style="display:none;">'
+ ' </canvas>'
+ ' <img id="imgloading' + post.contentid + '" src="./img/data_loading.gif" height="25px" width="25px" style="padding: 46px; "/>'
+ ' </a>'
+ ' <div class="text">'
+ ' <a id="title' + post.contentid + '" class="name dialog" contentid="' + post.contentid + '">'
+ ' <img class="listIcon" src="'+getIconTypeContent(post.contenttype)+'" width="20" height="20">'
+ truncate(htmlEncode(post.contenttitle), 20)
+ ' </a>'
+ ' <div class="info">'
+ ' <ul class="date">'
+ ' <li><span class="lang" lang="txtPubDt">'+i18nText("txtPubDt")+'</span> : ' + outputDeliveryDate + '</li>'
+ ' <li><span class="lang" lang="txtViewDt">'+i18nText("txtViewDt")+'</span>:<span id="lblVdate' + post.contentid + '"> </span></li>'
+ ' </ul>'
+ ' <ul class="pic">'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MEMO + '" id="imgMemo' + post.contentid + '" class="sticker" /></li>'
+ ' <li><img src="' + DEFAULT_IMG_OPTION_MARKING + '" id="imgBookMark' + post.contentid + '" class="pen" /></li>'
+ ' <li><a class="read lang button-details" contentid="' + post.contentid + '" lang="txtRead">'+i18nText("txtRead")+'</a></li>'
+ ' </ul>'
+ ' </div>'
+ ' </div>'
+ ' </div>'
+ '</section>';
$('#content-grid').append(htmlTemp);
}
for (var i = 0; i < contentSortArr.length; i++) {
post = contentSortArr[i];
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();
}
};
function formatOriginalPublishDate(date){
var day = date.date;
var month = date.month + 1;
var year = date.year + 1900;
var hour = date.hours;
var minute = date.minutes;
var second = date.seconds;
var resultDate = new Date(year, month, day, hour, minute, second);
return resultDate;
};
function returnContentTitleKana(id) {
var titleKana;
// Get title kana from existed contents
titleKana = getContentNameKana(id);
if (titleKana != null) {
// Skip this case
}
else {
var params = {
contentId: id,
sid: ClientData.userInfo_sid(),
getType: 1
};
// Get all pages of content
avwCmsApiSync(ClientData.userInfo_accountPath(), "webGetContent", 'GET', params,
function (data) {
// Success
titleKana = data.contentData.contentNameKana;
}, null);
}
return titleKana;
};
function resizeResourceThumbnail(mg, width, height) {
var newWidth;
var newHeight;
/*if(mg.width > mg.height) {
newWidth = width;
newHeight = (mg.height * width)/mg.width;
}
else {
newHeight = height;
newWidth = (mg.width * height)/mg.height;
}*/
var delta=Math.min(width/mg.width,height/mg.height);
newHeight=parseInt(delta*mg.height);
newWidth=parseInt(delta*mg.width);
var result = [newWidth, newHeight];
return result;
};
function removeHoverCss(){
if(isTouchDevice()){
$('#control-sort-title').removeClass('nottouchdevice');
$('#control-sort-titlekana').removeClass('nottouchdevice');
$('#control-sort-releasedate').removeClass('nottouchdevice');
$('#control-sort-viewdate').removeClass('nottouchdevice');
}
};
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('5 7e=1;5 6d=15;5 4Y=\'4\';5 4W=\'2\';5 4T=0;5 3u=\'x/4l/6e.1p\';5 3w=\'x/4l/6c.1p\';5 3t=\'x/4p/6h.1p\';5 3s=\'x/4p/6f.1p\';5 6g=15;5 2r=[];5 2v=[];5 o={1L:\'x/6a.1p\',1F:\'x/64.1p\',1O:\'x/65.1p\',1P:\'x/62.1p\',1S:\'x/63.1p\',1H:\'x/68.1p\'};5 D=[];5 4Q=[];5 4R=[];5 1J;5 P=[];5 3Z=T;5 1f=T;5 2l=[];$(2y).66(b(){6(!67(3D.6u)){E}6v();2y.1b=1j(\'5w\')+\' | \'+1j(\'59\');7.6s(3D.6t);6(7.6y()!=1){6(7.u()==r||7.u()==\'12\'||7.u().k==0){}9{55()}4e();4X();$(\'1E\').1u(\'1R\',47);$(\'1E\').1u(\'3Q\',47);$(\'1E\').1u(\'3O\',b(){1f=R});$(\'.2f\').1u(\'1R\',3z);$(\'.2f\').1u(\'3Q\',3z);$(\'.2f\').1u(\'3O\',b(){1f=R});$(\'#C-B-1b\').1R(4G);$(\'#C-B-V\').1R(4F);$(\'#C-B-2h\').1R(4E);$(\'#C-B-y\').1R(4y);$(\'.2p-2w\').1u(\'1R\',3a);$(\'.2p-2w\').1u(\'3Q\',3a);$(\'.2p-2w\').1u(\'3O\',b(){1f=R});$(4u).6l(b(){6($("#2L").H("13")!="1M"){$("#2L").6m();6($("#2L").L()>$(4u).L()){$("#2L").H(\'5j\',\'0\')}}})}9{6p()}});b 6q(2U,4q,4t,4r){2W(7.2m(),2U,4t,4q,4r,r)};b 4H(v,2o,4s,4i,4a,5S,5R,49,4c){5 2e={1y:v,48:2o,2E:4s,O:4i,p:4a,5X:49,2c:4c};2W(7.2m(),\'5V\',\'5W\',2e,b(U){$(\'#Y-1I\').N(\'\');q(5 i=0;i<U.2H.k;i++){d=U.2H[i];5 1o=3b(d.4P);5 y=37(d.h);6(y!=r&&y!=\'12\'&&y!=\'\'){5 36=\'<32 w="50">\'+\' <19 w="51">\'+\' <a w="x">\'+\' <1E L="56" z="5a" v="Y-1q\'+d.h+\'" g="\'+d.h+\'" 34="13:1M;">\'+\' </1E>\'+\' <x v="3I\'+d.h+\'" m="./x/5b.5c" L="2X" z="2X" 34="5K: 5u; "/>\'+\' </a>\'+\' <19 w="2o">\'+\' <a v="1b\'+d.h+\'" w="2U 2f" g="\'+d.h+\'">\'+\' <x w="5v" m="\'+5s(d.f)+\'" z="20" L="20">\'+3x(5t(d.4S),20)+\' </a>\'+\' <19 w="5B">\'+\' <1D w="G">\'+\' <J><1c w="18" 18="3y"> </1c> : \'+1o+\'</J>\'+\' <J><1c w="18" 18="3v"> </1c>:<1c v="2V\'+d.h+\'"> </1c></J>\'+\' </1D>\'+\' <1D w="5y">\'+\' <J><x m="\'+3u+\'" v="2i\'+d.h+\'" w="4m" /></J>\'+\' <J><x m="\'+3w+\'" v="2n\'+d.h+\'" w="4n" /></J>\'+\' <J><a w="4o 18 2p-2w" g="\'+d.h+\'" 18="35">\'+1j("35")+\'</a></J>\'+\' </1D>\'+\' </19>\'+\' </19>\'+\' </19>\'+\'</32>\';$(\'#Y-1I\').4k(36)}}q(5 i=0;i<U.2H.k;i++){d=U.2H[i];5 y=37(d.h);5P[d.h]={4f:d.4f,4d:d.4d};6(y!=r&&y!=\'12\'&&y!=\'\'){5 1W=d.K;6((1W!=r)&&(1W!=\'12\')&&(1W!=\'\')){1W=2Q(1W)}2r.10({h:d.h,1q:1W});2v.10({h:d.h,f:d.f});3p(d.h,d.3S,d.3V);4Q.10({g:d.h,2z:d.3S});4R.10({g:d.h,2x:d.3V});3r(d.h);$(\'#2V\'+d.h).N(y);5e(d.h,d.3S,d.3V,d.K,d.4S,4C(d.h),d.4P,d.f);}}6(U.2s){7.4U(U.2s)}6(U.2B){7.4z(U.2B)}1J=U.7a;31(1J,1J)},r)};b 3T(){6(4M()==A.72||4M()==A.73){$(\'#C-B-V\').H(\'13\',\'1M\');$(\'#C-B-V-44\').H(\'13\',\'1M\');$(\'#4N-B-V\').H(\'13\',\'1M\');$(\'#3X\').H(\'13\',\'1M\');$("#V-1d").N(\'\')}9{6(7.M()!=r&&7.M()!=\'12\'||7.Q()!=\'\'){5 29=7.Q();5 1C=7.M();1v(\'#\'+$(\'#75 J.77 a\').2K(\'v\'),1C==A.I);}6(3Z){$(\'#4N-B-V\').H(\'13\',\'2A\');$(\'#3X\').H(\'13\',\'2A\');$(\'#C-B-V-44\').H(\'13\',\'2A\');$(\'#Y-1I\').N(1j(\'53\'))}9{$(\'#C-B-V\').H(\'13\',\'2A\');$(\'#3X\').H(\'13\',\'2A\')}}};b 4X(){5 42=\'\';5 45=\'\';5 O=4Y;5 p=4W;5 48=\'\';5 2E=4T;5 2g=\'\';5 2c=\'\';5 1y=7.27();7.4U(42);7.4z(45);7.Q(O);7.M(p);7.6Y(2E);5A();$(\'#6X-6Z\').N(7.71());3d();6(7.u()==r||7.u()==\'12\'||7.u().k==0){52();3Z=R;31(0,0)}9{4H(1y,48,2E,3,p,42,45,2g,2c);3o()}3T()};b 47(e){6(e){e.3G()}6(1f==R){1f=T;E}5 h=$(3F).2K(\'v\');5 1g=h.5L(17);7.3B(1g);5 2C=1Y(1g);7.3J(2C);5 f=25(1g);7.3C(f);6(7.u().k>0){D=7.u();q(5 F=0;F<D.k;F++){6(D[F].g==1g){1r=R;1n}9{1r=T}}6(!1r){D.10({g:1g,y:\'\',X:\'\'})}}9{D.10({g:1g,y:\'\',X:\'\'})}5 23=[];7.u(23);7.u(D);39(1g);38(1g);2F(1g);54()};b 31(7g,79){$(\'#78\').N(P.k);$(\'#1J\').N(P.k);$(\'.5q\').H(\'1t\',\'3H\')};b 4G(){5 p=7.M();5 O=7.Q();5 1y=7.27();5 2s=r;5 2B=r;5 2g=7.3k();5 2c=7.3l();6(p==A.I){6(O==\'1\'){p=A.2D;5J()}9{p=A.I;3R()}7.M(p)}9{p=A.I;7.M(p);3R()}1v(\'#C-B-1b\',p==A.I);O=\'1\';7.Q(O);};b 4F(){5 p=7.M();5 O=7.Q();5 1y=7.27();5 2s=r;5 2B=r;5 2g=7.3k();5 2c=7.3l();6(p==A.I){6(O==\'2\'){p=A.2D;5f()}9{p=A.I;3K()}7.M(p)}9{p=A.I;7.M(p);3K()}1v(\'#C-B-V\',p==A.I);O=\'2\';7.Q(O);};b 4E(){5 p=7.M();5 O=7.Q();5 1y=7.27();5 2s=r;5 2B=r;5 2g=7.3k();5 2c=7.3l();6(p==A.I){6(O==\'3\'){p=A.2D;5l()}9{p=A.I;43()}7.M(p)}9{p=A.I;7.M(p);43()}1v(\'#C-B-2h\',p==A.I);O=\'3\';7.Q(O);};b 4y(){5 p=7.M();5 O=7.Q();6(p==A.I){6(O==\'4\'){p=A.2D;3o()}9{p=A.I;3c()}7.M(p)}9{p=A.I;3c();7.M(p)}1v(\'#C-B-y\',p==A.I);O=\'4\';7.Q(O)};b 1Y(g){q(5 i=0;i<2r.k;i++){6(2r[i].h==g){E 2r[i].1q}}};b 25(g){5 4D=2v.k;q(5 i=0;i<4D;i++){6(2v[i].h==g){E 2v[i].f}}};b 26(f){6(!(f==n.6K)){E T}9{E R}};b 6J(4L){5 4B=6F();5 2N=4B.6A;2N=6C(2N,7.2m())+\'/\'+4L;E 2N};b 3a(e){6(e){e.3G()}6(1f==R){1f=T;E}5 h=$(3F).2K(\'g\');6D(h,b(){4Z(h)})};b 4Z(h){5 K=1Y(h);5 G=1z 2R();5 W=G.5k()+1;5 11=G.5g();5 1o=5E(11,W,G.5o());7.3B(h);7.3J(K);5 f=25(h);7.3C(f);5 1r=T;6(7.u().k>0){D=7.u();q(5 F=0;F<D.k;F++){6(D[F].g==h){1r=R;6(D[F].y==r||D[F].y==\'12\'||D[F].y==\'\'){D[F].y=1o;D[F].X=G}1n}9{1r=T}}6(!1r){D.10({g:h,y:1o,X:G})}}9{D.10({g:h,y:1o,X:G})}5 23=[];7.u(23);39(h);38(h);7.u(D);7.6L(T);6(f==n.1T){6T(h);2F(h)}9{6S(3D.6U)}}b 3r(h){6(7.3E().k==0){$(\'#2n\'+h).H(\'1t\',\'21\')}9{q(5 14=0;14<7.3E().k;14++){6(7.3E()[14].g==h){$(\'#2n\'+h).H(\'1t\',\'3H\');1n}9{$(\'#2n\'+h).H(\'1t\',\'21\')}}}6(7.3A().k==0){$(\'#2i\'+h).H(\'1t\',\'21\')}9{q(5 14=0;14<7.3A().k;14++){6(7.3A()[14].g==h){$(\'#2i\'+h).H(\'1t\',\'3H\');1n}9{$(\'#2i\'+h).H(\'1t\',\'21\')}}}};b 3p(1a,4h,4g){5 l=1z 2J();5 1X=1z 2J();5 1U=1z 2J();5 c=2y.4v(\'Y-1q\'+1a);5 Z=c.4w(\'2d\');5 2G=T;5 1V=7.3L();5 1m=7.3P();5 1s=7.u();5 K=1Y(1a);5 f=25(1a);6(1s==r||1s<=0||1s==\'12\'){l.1i=b(){5 s=1K(l,c.z,c.L);Z.1k(l,c.z/2-s[0]/2,0,s[0],s[1]);1X.1i=b(){Z.1k(1X,c.z/2-s[0]/2,0);1Q(1a)};1X.m=3s};6(K==\'\'||K==r){6(!26(f)){6(f==n.24){l.m=o.1L}9 6(f==n.1Z){l.m=o.1O}9 6(f==n.28){l.m=o.1F}9 6(f==n.2a){l.m=o.1S}9 6(f==n.1T){l.m=o.1P}9 6(f==n.2b){l.m=o.1H}}}9{l.m=K}}9{q(5 14=0;14<7.u().k;14++){6(7.u()[14].g==1a){l.1i=b(){5 s=1K(l,c.z,c.L);Z.1k(l,c.z/2-s[0]/2,0,s[0],s[1]);1Q(1a)};6(K==\'\'||K==r){6(!26(f)){6(f==n.24){l.m=o.1L}9 6(f==n.1Z){l.m=o.1O}9 6(f==n.28){l.m=o.1F}9 6(f==n.2a){l.m=o.1S}9 6(f==n.1T){l.m=o.1P}9 6(f==n.2b){l.m=o.1H}}}9{l.m=K}2G=R;1n}9{l.1i=b(){5 s=1K(l,c.z,c.L);Z.1k(l,c.z/2-s[0]/2,0,s[0],s[1]);1Q(1a);1X.1i=b(){Z.1k(1X,c.z/2-s[0]/2,0)};1X.m=3s};6(K==\'\'||K==r){6(!26(f)){6(f==n.24){l.m=o.1L}9 6(f==n.1Z){l.m=o.1O}9 6(f==n.28){l.m=o.1F}9 6(f==n.2a){l.m=o.1S}9 6(f==n.1T){l.m=o.1P}9 6(f==n.2b){l.m=o.1H}}}9{l.m=K}}}}6(2G){6(1V==r||1V<=0||1V==\'12\'){}9{q(5 1h=0;1h<1V.k;1h++){6(1V[1h].g==1a){6(1V[1h].2z!=4h){l.1i=b(){5 s=1K(l,c.z,c.L);Z.1k(l,c.z/2-s[0]/2,0,s[0],s[1]);1Q(1a);1U.1i=b(){Z.1k(1U,c.z/2-s[0]/2,0)};1U.m=3t};6(K==\'\'||K==r){6(!26(f)){6(f==n.24){l.m=o.1L}9 6(f==n.1Z){l.m=o.1O}9 6(f==n.28){l.m=o.1F}9 6(f==n.2a){l.m=o.1S}9 6(f==n.1T){l.m=o.1P}9 6(f==n.2b){l.m=o.1H}}}9{l.m=K}1n}}}}6(1m==r||1m<=0||1m==\'12\'){}9{q(5 1h=0;1h<1m.k;1h++){6(1m[1h].g==1a){6(1m[1h].2x!=4g){l.1i=b(){5 s=1K(l,c.z,c.L);Z.1k(l,c.z/2-s[0]/2,0,s[0],s[1]);1Q(1a);1U.1i=b(){Z.1k(1U,c.z/2-s[0]/2,0)};1U.m=3t};6(K==\'\'||K==r){6(!26(f)){6(f==n.24){l.m=o.1L}9 6(f==n.1Z){l.m=o.1O}9 6(f==n.28){l.m=o.1F}9 6(f==n.2a){l.m=o.1S}9 6(f==n.1T){l.m=o.1P}9 6(f==n.2b){l.m=o.1H}}}9{l.m=K}1n}}}}2G=T}};b 2F(v){5 x=1z 2J();5 1w=1Y(v);6(1w!=r){}9{5 f=25(v);6(f==n.24){1w=o.1L}9 6(f==n.1Z){1w=o.1O}9 6(f==n.28){1w=o.1F}9 6(f==n.2a){1w=o.1S}9 6(f==n.1T){1w=o.1P}9 6(f==n.2b){1w=o.1H}}5 c=2y.4v(\'Y-1q\'+v);5 Z=c.4w(\'2d\');Z.6P(0,0,c.z,c.L);x.1i=b(){5 s=1K(x,c.z,c.L);Z.1k(x,(c.z/ 2) - (s[0] /2)+4,c.L-s[1]+4,s[0],s[1]);$("#6Q"+v).5m(\'2M\',b(){$(\'#Y-1q\'+v).5n(\'2M\')})};x.m=1w};b 37(v){q(5 i=0;i<7.u().k;i++){6(7.u()[i].g==v){E 7.u()[i].y}}};b 3g(v){q(5 i=0;i<7.u().k;i++){6(7.u()[i].g==v){E 7.u()[i].X}}};b 5A(){$(\'#C-B-1b\').1B(\'2I\');$(\'#C-B-V\').1B(\'2I\');$(\'#C-B-2h\').1B(\'2I\');$(\'#C-B-y\').1B(\'2I\');5 29;5 1C;6(7.Q()==r||7.Q()==\'12\'||7.Q()==\'\'){$(\'#1b-1d\').N(\'\');$(\'#1b-1d\').N(\'\');$(\'#V-1d\').N(\'\');$(\'#3e-1d\').N(\'\');$(\'#5d-1d\').N(\'\')}9{6(7.M()!=r&&7.M()!=\'12\'&&7.Q()!=\'\'){29=7.Q();1C=7.M();6(29==1){1v(\'#C-B-1b\',1C==A.I)}9 6(29==2){1v(\'#C-B-V\',1C==A.I)}9 6(29==3){1v(\'#C-B-2h\',1C==A.I)}9{1v(\'#C-B-y\',1C==A.I)}}}};b 3b(G){5 11=G.G;5 W=5I(G.W)+1;5 1l=5I(G.1l)+4b;5 1o=1l+\'/\'+((\'\'+W).k<2?\'0\':\'\')+W+\'/\'+((\'\'+11).k<2?\'0\':\'\')+11;E 1o};b 5E(11,W,1l){5 1o=1l+\'/\'+((\'\'+W).k<2?\'0\':\'\')+W+\'/\'+((\'\'+11).k<2?\'0\':\'\')+11;E 1o};b 2Q(58){5 57=\'U:6R/6V;6W,\'+58;E 57};b 3z(e){6(e){e.3G()}6(1f==R){1f=T;E}5 g=$(3F).2K(\'g\');5 2C=1Y(g);7.3J(2C);7.3B(g);5 f=25(g);7.3C(f);6(7.u().k>0){D=7.u();q(5 F=0;F<D.k;F++){6(D[F].g==g){1r=R;1n}9{1r=T}}6(!1r){D.10({g:g,y:\'\',X:\'\'})}}9{D.10({g:g,y:\'\',X:\'\'})}5 23=[];7.u(23);7.u(D);39(g);38(g);2F(g);54()};b 6E(){$(\'#1b-1d\').N(\'\');$(\'#V-1d\').N(\'\');$(\'#3e-1d\').N(\'\');$(\'#3e-1d\').N(\'\');$(\'#5d-1d\').N(\'\')};b 3d(){$(\'#Y-1I\').6B();$(\'.5q\').H(\'1t\',\'21\')};b 3c(){5 8=P;5 t;q(5 i=0;i<8.k;i++){q(5 j=1;j<8.k-i;j++){6(8[j-1].X>8[j].X){t=8[j-1];8[j-1]=8[j];8[j]=t}}}5 S=8;1x(S)};b 3n(5p){5 1A=1z 2R(5p);5 1l=1A.5o()+1;5 W=1A.5k();5 11=1A.5g();5 2S=1A.6I();5 2Y=1A.6G();5 2Z=1A.6H();5 5i=1A.7c();5 5h=1z 2R(1l,W,11,2S,2Y,2Z,5i);E 5h};b 3o(){5 8=P;5 16;q(5 i=0;i<8.k;i++){q(5 j=8.k-1;j>i;j--){6(8[j].X>8[j-1].X){16=8[j];8[j]=8[j-1];8[j-1]=16}}}5 S=8;1x(S)};b 5e(1e,3i,3m,46,3f,3h,3j,f){6(P.k>0){5 2O;q(5 j=0;j<P.k;j++){6(P[j].g==1e){2O=R;1n}9{2O=T}}6(!2O){P.10({g:1e,X:3n(3g(1e)),1N:3f,22:3h,1G:3j,2z:3i,2x:3m,1q:2Q(46),3q:f})}}9{P.10({g:1e,X:3n(3g(1e)),1N:3f,22:3h,1G:3j,2z:3i,2x:3m,1q:2Q(46),3q:f})}};b 1Q(41){$(\'x#3I\'+41).5m(\'2M\',b(){$(\'1E#Y-1q\'+41).5n(\'2M\')})};b 55(){5 1s=7.u();5 1m=7.3P();5 3N=7.3L();q(5 i=1s.k-1;i>=0;i--){5 5z=1s[i];6(!5F(5z.g)){1s.40(i,1);1m.40(i,1);3N.40(i,1)}6(70()){E}}7.u(1s);7.3P(1m);7.3L(3N)};b 4A(1e){5 3W=r;q(5 F=0;F<2l.k;F++){6(2l[F].h==1e){3W=2l[F].2T;1n}}E 3W};b 5F(1e){5 2k=R;5 2e={1y:7.27(),4x:\'1\',h:1e};2W(7.2m(),"4I",\'4J\',2e,b(U){2k=R;2l.10({h:1e,2T:U.4K.2T})},b(5r,7b,76){6(5r.74==5Q){2k=T}9{2k=R;5Z()}});E 2k};b 5U(){3T();2y.1b=1j(\'5w\')+\' | \'+1j(\'59\')};b 52(){5N();$(\'#Y-1I\').N(1j(\'53\'));$(\'#Y-1I\').H({\'2o-60\':\'61\',\'5O-5j\':\'6o\',\'6n\':\'6k\',\'6j-6r\':\'6x\',\'6w\':\'6z\'});$(\'#C-6i\').H(\'1t\',\'21\');$(\'.5C\').5G();$(\'.5H\').5D();$(\'#44-6b\').5T(\'5Y\')};b 5M(){$(\'.5C\').5D();$(\'.5H\').5G()};b 3x(33,k){6(33.k<=k){E 33}9{E 33.5L(0,k)+"..."}};b 3R(){5 8=P;5 t;q(5 i=0;i<8.k;i++){q(5 j=1;j<8.k-i;j++){6(8[j-1].1N.30()>8[j].1N.30()){t=8[j-1];8[j-1]=8[j];8[j]=t}}}5 S=8;1x(S)};b 5J(){5 8=P;5 16;q(5 i=0;i<8.k;i++){q(5 j=8.k-1;j>i;j--){6(8[j].1N.30()>8[j-1].1N.30()){16=8[j];8[j]=8[j-1];8[j-1]=16}}}5 S=P;1x(S)};b 43(){5 8=P;5 t;q(5 i=0;i<8.k;i++){q(5 j=1;j<8.k-i;j++){6(2q(8[j-1].1G)>2q(8[j].1G)){t=8[j-1];8[j-1]=8[j];8[j]=t}}}5 S=8;1x(S)};b 5l(){5 8=P;5 16;q(5 i=0;i<8.k;i++){q(5 j=8.k-1;j>i;j--){6(2q(8[j].1G)>2q(8[j-1].1G)){16=8[j];8[j]=8[j-1];8[j-1]=16}}}5 S=8;1x(S)};b 3K(){5 8=P;5 t;q(5 i=0;i<8.k;i++){q(5 j=1;j<8.k-i;j++){6(8[j-1].22>8[j].22){t=8[j-1];8[j-1]=8[j];8[j]=t}}}5 S=8;1x(S)};b 5f(){5 8=P;5 16;q(5 i=0;i<8.k;i++){q(5 j=8.k-1;j>i;j--){6(8[j].22>8[j-1].22){16=8[j];8[j]=8[j-1];8[j-1]=16}}}5 S=8;1x(S)};b 1x(2u){3d();q(5 i=0;i<2u.k;i++){d=2u[i];5 5x=3b(d.1G);5 36=\'<32 w="50">\'+\' <19 w="51">\'+\' <a w="x">\'+\' <1E L="56" z="5a" v="Y-1q\'+d.g+\'" g="\'+d.g+\'" 34="13:1M;">\'+\' </1E>\'+\' <x v="3I\'+d.g+\'" m="./x/5b.5c" L="2X" z="2X" 34="5K: 5u; "/>\'+\' </a>\'+\' <19 w="2o">\'+\' <a v="1b\'+d.g+\'" w="2U 2f" g="\'+d.g+\'">\'+\' <x w="5v" m="\'+5s(d.3q)+\'" z="20" L="20">\'+3x(5t(d.1N),20)+\' </a>\'+\' <19 w="5B">\'+\' <1D w="G">\'+\' <J><1c w="18" 18="3y">\'+1j("3y")+\'</1c> : \'+5x+\'</J>\'+\' <J><1c w="18" 18="3v">\'+1j("3v")+\'</1c>:<1c v="2V\'+d.g+\'"> </1c></J>\'+\' </1D>\'+\' <1D w="5y">\'+\' <J><x m="\'+3u+\'" v="2i\'+d.g+\'" w="4m" /></J>\'+\' <J><x m="\'+3w+\'" v="2n\'+d.g+\'" w="4n" /></J>\'+\' <J><a w="4o 18 2p-2w" g="\'+d.g+\'" 18="35">\'+1j("35")+\'</a></J>\'+\' </1D>\'+\' </19>\'+\' </19>\'+\' </19>\'+\'</32>\';$(\'#Y-1I\').4k(36)}q(5 i=0;i<2u.k;i++){d=2u[i];5 y=37(d.g);31(1J,1J);3p(d.g,d.2z,d.2x);3r(d.g);$(\'#2V\'+d.g).N(y);1Q()}};b 2q(G){5 11=G.G;5 W=G.W+1;5 1l=G.1l+4b;5 2S=G.6O;5 2Y=G.6M;5 2Z=G.6N;5 4V=1z 2R(1l,W,11,2S,2Y,2Z);E 4V};b 4C(v){5 2t;2t=4A(v);6(2t!=r){}9{5 2e={h:v,1y:7.27(),4x:1};2W(7.2m(),"4I",\'4J\',2e,b(U){2t=U.4K.2T},r)}E 2t};b 1K(2j,z,L){5 3Y;5 3M;5 3U=7f.7d(z/2j.z,L/2j.L);3M=4O(3U*2j.L);3Y=4O(3U*2j.z);5 4j=[3Y,3M];E 4j};b 4e(){6(69()){$(\'#C-B-1b\').1B(\'2P\');$(\'#C-B-V\').1B(\'2P\');$(\'#C-B-2h\').1B(\'2P\');$(\'#C-B-y\').1B(\'2P\')}};', 62, 451, '|||||var|if|ClientData|sortArr|else||function||post||contentType|contentid|contentId|||length|imgThumb|src|ContentTypeKeys|ThumbnailForOtherType|sortOrder|for|null|resizeImg||ReadingContentIds|id|class|img|viewdate|width|Consts|sort|control|contentIdArray|return|nIndex|date|css|ConstOrderSetting_Asc|li|contentThumbnail|height|searchCond_sortOrder|html|sortType|contentViewData|searchCond_sortType|true|resultArr|false|data|titlekana|month|originviewdate|content|ctx|push|day|undefined|display|nIndex1||temp||lang|div|contId|title|span|sorttype|strContentId|home_isMove|outputId|nIndex2|onload|i18nText|drawImage|year|metaArr|break|outputDate|png|thumbnail|checkflag|readArr|visibility|live|setStatusSort|imgSrc|renderContentAfterSort|sid|new|sourceDate|removeClass|orderSort|ul|canvas|Thumbnail_VideoType|deliverydate|Thumbnail_HtmlType|grid|totalPage|resizeResourceThumbnail|Thumbnail_ImageType|none|contenttitle|Thumbnail_MusicType|Thumbnail_OthersType|showContentThumbnail|click|Thumbnail_NoFileType|Type_Others|imgIconEdit|versionArr|formatThumbnail|imgIconNew|returnThumbnail|Type_Music||hidden|contenttitlekana|newArray|Type_Image|returnContentType|isPdfContent|userInfo_sid|Type_Video|typeSort|Type_NoFile|Type_Html|groupId||params|dialog|genreId|releasedate|imgMemo|mg|isExisted|history_contentTitleKana|userInfo_accountPath|imgBookMark|text|button|formatOriginalPublishDate|thumbnailArr|recordFrom|titleKana|contentSortArr|contentTypeArr|details|metaversion|document|resourceversion|block|recordTo|base64String|ConstOrderSetting_Desc|searchDivision|drawEditImage|readFlg|contentList|active_tops|Image|attr|contentDetail|slow|url|flag|nottouchdevice|formatStringBase64|Date|hour|contentNameKana|name|lblVdate|avwCmsApiSync|25px|minute|second|toUpperCase|reRenderPageNumber|section|strInput|style|txtRead|htmlTemp|renderViewDate|setMetaVersionData|setResourceVersionData|readSubmenuFunction|formatDeliveryDate|sortByViewDateAsc|refreshGrid|rDate|strTitle|returnOriginalViewDate|strTitleKana|strResourceVersion|strDelivDate|searchCond_genreId|searchCond_groupId|strMetaVersion|formatDate|sortByViewDateDesc|checkUserHasReadContent|contenttype|checkContentMarkingMemoOption|DEFAULT_IMG_CONTENT_NEW|DEFAULT_IMG_CONTENT_EDIT|DEFAULT_IMG_OPTION_MEMO|txtViewDt|DEFAULT_IMG_OPTION_MARKING|truncate|txtPubDt|titleClickFunction|MemoData|contentInfo_contentId|contentInfo_contentType|ScreenIds|MarkingData|this|preventDefault|visible|imgloading|contentInfo_contentThumbnail|sortByTitleKanaAsc|ResourceVersion|newHeight|resourceArr|touchmove|MetaVersion|touchend|sortByTitleAsc|resourceVersion|handleLanguage|delta|metaVersion|strContentNameKana|separate|newWidth|noRecordFlg|splice|conid|fromPage|sortByPublishDateAsc|off|toPage|strThumbnail|canvasClickFunction|searchText|cateid|order|1900|grpid|alertMessage|removeHoverCss|alertMessageLevel|metaVer|resourceVer|type|result|append|list|sticker|pen|read|common|param|callback|division|method|window|getElementById|getContext|getType|sortByViewDateFunction|searchCond_recordTo|getContentNameKana|sysSettings|returnContentTitleKana|iArrCnt|sortByReleaseDateFunction|sortByTitleKanaFunction|sortByTitleFunction|renderContent|webGetContent|GET|contentData|apiName|getCurrentLanguage|label|parseInt|contentDeliveryDate|resourceVersionArr|metaVersionArr|contentTitle|DEFAULT_SEARCH_DIVISION|searchCond_recordFrom|resultDate|DEFAULT_SORT_ORDER|renderGridView|DEFAULT_SORT_TYPE|readSubmenuFunction_callback|sectionhistory|cnt_section_list|displayResultNoRecord|msgHistoryNotExist|openContentDetail|syncReadingContent|110|outputString|imgStr|sysAppTitle|150|data_loading|gif|vDate|addReadContentToArray|sortByTitleKanaDesc|getDate|newDate|milisecond|top|getMonth|sortByPublishDateDesc|fadeOut|fadeIn|getFullYear|originDate|pageNumControl|xmlHttpRequest|getIconTypeContent|htmlEncode|46px|listIcon|dspViewHistory|outputDeliveryDate|pic|readContent|handleSortDisp|info|control_sort_on|show|formatNormalDate|IsExistContent|hide|control_sort_off|eval|sortByTitleDesc|padding|substring|enableSort|i18nReplaceText|margin|messageLevel|404|to|from|addClass|changeLanguageCallBackFunction|webContentList|POST|categoryId|descending_sort|showSystemError|align|left|thumb_default_other|thumb_default_none|iPad_video|thumb_default_sound|ready|avwCheckLogin|thumb_default_html|isTouchDevice|image_type|default|icon_pen|DEFAULT_DISP_NUMBER_RECORD_TO|icon_sticker|band_new|iNumberOfNextRecord|band_updated|nextrecord|font|both|resize|center|clear|20px|checkForceChangePassword|abapi|size|BookmarkScreen|History|Login|LockScreen|color|16px|requirePasswordChange|red|apiResourceDlUrl|empty|format|checkLimitContent|refreshSortTypeOrder|avwSysSetting|getMinutes|getSeconds|getHours|getURL|Type_PDF|IsRefresh|minutes|seconds|hours|clearRect|loadingIcon|image|avwScreenMove|downloadResourceById|ContentView|jpeg|base64|login|searchCond_searchDivision|username|avwHasError|userInfo_loginId_session|ConstLanguage_En|ConstLanguage_Ko|status|menu_sort|errorThrown|current|dispPage|dispTotal|totalRecord|txtStatus|getMilliseconds|min|DEFAULT_DISP_NUMBER_RECORD_FROM|Math|dispRecord'.split('|'), 0, {}))
This source diff could not be displayed because it is too large. You can view the blob instead.
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
var requirePasswordChange;
var userinfo_sid;
var userInfo_userName;
var optionList = [];
var force_pw_change_on_login;
var force_pw_change_periodically;
var user_data_backup;
var marking;
var force_login_periodically;
var login_errorMessage = "";
var timeWaitSplashScreen = 2000;// wait splash screen 2 second
//Load login Info
function loadLoginInfo() {
$('#chkRemember').attr('checked', 'checked');
if (ClientData.userInfo_accountPath() != null) {
$('#txtAccPath').val(ClientData.userInfo_accountPath());
}
if (ClientData.userInfo_loginId() != null) {
$('#txtAccId').val(ClientData.userInfo_loginId());
}
};
//Initial Screen
function initialScreen() {
//Check Last time display language
//ClientData.userInfo_language(localStorage.getItem(avwsys_storagekey));
if (ClientData.userInfo_rememberLogin()) {
loadLoginInfo();
}
};
//check Save Login Info
function saveLoginInfo() {
var lang = getCurrentLanguage();
//clear session of old user
SessionStorageUtils.clear();
avwUserSessionObj = null;
// create new session for anonymous user
avwCreateUserSession();
// load language
changeLanguage(lang);
//SessionStorageUtils.login();
// Set flag コンテンツデータチェックフラグ = true to sync local with server
ClientData.common_contentDataChkFlg(true);
var chkRemember = $('#chkRemember').attr('checked');
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var date = new Date();
ClientData.userInfo_accountPath(accountPath);
ClientData.userInfo_loginId(loginId);
ClientData.userInfo_accountPath_session(accountPath);
ClientData.userInfo_loginId_session(loginId);
ClientData.userInfo_userName(userInfo_userName);
if(chkRemember == 'checked')
{
ClientData.userInfo_rememberLogin(true);
}
else
{
ClientData.userInfo_rememberLogin(false);
}
ClientData.userInfo_lastLoginTime(date.jpDateTimeString());
//ClientData.requirePasswordChange(requirePasswordChange);
//ClientData.userInfo_sid(userinfo_sid);
ClientData.userInfo_sid_local(userinfo_sid);
saveServiceUserOption();
};
//Check validation
function checkValidation() {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var msgError = $('#main-error-message');
if (!ValidationUtil.CheckRequiredForText(accountPath)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else if (!ValidationUtil.CheckRequiredForText(loginId)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else if (!ValidationUtil.CheckRequiredForText(password)) {
login_errorMessage = "";
msgError.html(i18nText('msgLoginEmpty'));
msgError.attr('lang', 'msgLoginEmpty');
msgError.show();
return false;
}
else {
return true;
}
};
//Check Dialog validation
function checkDialogValidation() {
var currentPass = $('#txtCurrentPass').val();
var newPass = $('#txtNewPass').val();
var confirmPass = $('#txtConfirmNew').val();
var msgError = $('#dialog-error-message');
if (!ValidationUtil.CheckRequiredForText(currentPass)) {
login_errorMessage = "";
msgError.html(i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
return false;
}
else if (!ValidationUtil.CheckRequiredForText(newPass)) {
login_errorMessage = "";
msgError.html(i18nText('msgPwdEmpty'));
msgError.attr('lang', 'msgPwdEmpty');
msgError.show();
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
return false;
}
// else if (!ValidationUtil.CheckRequiredForText(confirmPass)) {
// //msgError.html(i18nText('msgPwdEmpty'));
// //msgError.show();
// /* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
// });
// return false;
// }
else
{
if(newPass != confirmPass){
login_errorMessage = "";
msgError.html(i18nText('msgPwdNotMatch'));
msgError.attr('lang', 'msgPwdNotMatch');
msgError.show();
/* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdNotMatch')
//});
return false;
}
else{
return true;
}
}
};
//Login Process
function processLogin() {
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
var password = $('#txtPassword').val();
var requireChangePassword = 0;
var skipPwdDate;
var params = {
previousSid: '',
loginId: loginId,
password: password,
urlpath: accountPath
};
// Set sid for login, this will be checked authoring 2 sessions
if (ClientData.userInfo_sid_local()) {
params.previousSid = ClientData.userInfo_sid_local();
}
// Get url to login
var sysSettings = avwSysSetting();
var apiLoginUrl = sysSettings.apiLoginUrl;
avwCmsApiWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params, function (data) {
requirePasswordChange = data.requirePasswordChange;
userinfo_sid = data.sid;
userInfo_userName = data.userName;
optionList = data.serviceOptionList;
getServiceOptionList();
if (data.result == 'success') {
// Save retrieved info
saveLoginInfo();
// data.requirePasswordChange = 1;
// force_pw_change_on_login = 2;
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0);
$('#main-error-message').css('display', 'none');
if (data.requirePasswordChange == 0) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (data.requirePasswordChange == 1) {
if (force_pw_change_on_login == 2) { // force to change password
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
$('#btnSkip').hide();
$("#txtPwdRemind").css('visibility', 'hidden');
}
else if (force_pw_change_on_login == 1) { // recommend to change password
// Check 30 days
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
}
else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (numDay > 30) {
OpenChangePasswordDialog();
$('#btnSkip').show();
$(".ui-dialog-titlebar").hide();
}
}
}
else { // no need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
}
else if (data.requirePasswordChange == 2) {
if (force_pw_change_periodically == 1) { // recommend to change password
$('#btnSkip').show();
skipPwdDate = ClientData.userInfo_pwdSkipDt();
if (skipPwdDate == null || skipPwdDate == 'undefined') {
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
}
else {
var date = new Date();
var skpPwdDt = new Date(skipPwdDate);
var numDay = date.subtractByDays(skpPwdDt);
if (numDay <= 30) {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else if (numDay > 30) {
OpenChangePasswordDialog();
$(".ui-dialog-titlebar").hide();
}
}
} else if (force_pw_change_periodically == 2) { // Force to change password
OpenChangePasswordDialog();
$('#btnSkip').hide();
$(".ui-dialog-titlebar").hide();
$("#txtPwdRemind").css('visibility', 'hidden');
}
else { // No need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
}
}
else {
login_errorMessage = data.errorMessage;
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').show();
// $('#main-error-message').attr('lang', 'msgLoginErrWrong');
// //$('#main-error-message').html(i18nText('msgLoginErrWrong'));
// //alert($('#main-error-message').html());
// $('#main-error-message').css('display', 'block');
// if (ClientData.userInfo_language() != null) {
// changeLanguage(ClientData.userInfo_language());
// }
// else {
// changeLanguage(Consts.ConstLanguage_Ja);
// }
}
}, function (xhr, statusText, errorThrown) {
if (xhr.responseText && xhr.status != 0) {
login_errorMessage = JSON.parse(xhr.responseText).errorMessage;
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), JSON.parse(xhr.responseText).errorMessage).toString());
} else {
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
});
};
//Change Password Process
function changePasswordProcess(){
var accountPath = $('#txtAccPath').val();
//var sid = ClientData.userInfo_sid();
var sid = ClientData.userInfo_sid_local();
var loginId = $('#txtAccId').val();
var password = $('#txtCurrentPass').val();
var confirmPass = $('#txtConfirmNew').val();
var params = {
sid: sid,
loginId: loginId,
password: password,
newPassword: confirmPass,
appId: 4
};
avwCmsApiSync(accountPath, 'passwordChange', 'GET', params, function (data) {
var result = data.result;
if (result == 'success') {
$('#dialog-error-message').css('display', 'none');
CloseChangePasswordDialog();
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
}
else {
$('#dialog-error-message').html(i18nText('msgPwdOldWrong'));
$('#dialog-error-message').show();
}
},
function (xhr, b, c) {
if (xhr.responseText && xhr.status != 0) {
$('#dialog-error-message').html(JSON.parse(xhr.responseText).errorMessage);
$('#dialog-error-message').show();
}
else {
// Show systemerror
showSystemError();
}
});
};
//Change Language Japanese
function changeLanguageJa(){
changeLanguage(Consts.ConstLanguage_Ja);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_Ja);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Change Language Korean
function changeLanguageKo(){
changeLanguage(Consts.ConstLanguage_Ko);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_Ko);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Change Language English
function changeLanguageEn(){
changeLanguage(Consts.ConstLanguage_En);
document.title = i18nText('dspLogin') + ' | ' + i18nText('sysAppTitle');
//ClientData.userInfo_language(Consts.ConstLanguage_En);
if (login_errorMessage != ""){
$('#main-error-message').html(format(i18nText('msgLoginErrWrong'), login_errorMessage).toString());
}
};
//Login click function
function loginFunction() {
if (checkValidation()) {
processLogin();
}
};
//Change Password function
function changePassFunction(){
if(checkDialogValidation()){
changePasswordProcess();
}
};
//Skip Password function
function skipPassFunction(){
var date = new Date();
ClientData.userInfo_pwdSkipDt(date);
//window.location = "abvw/" + ScreenIds.Home;
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
avwScreenMove("abvw/" + ScreenIds.Home);
};
//Open Change Password Dialog
function OpenChangePasswordDialog(){
// Clear all input values
$("#main-password-change").show();
$("#main-password-change").center();
lockLayout();
};
//Close Chnage Password Dialog
function CloseChangePasswordDialog(){
$("#main-password-change").dialog('close');
};
//Save Service Option
function saveServiceUserOption(){
$.each(optionList, function (i, option) {
if (option.serviceName == 'force_pw_change_periodically') {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
}
else if (option.serviceName == 'force_pw_change_on_login') {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
}
// 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') {
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);
}
});
};
//Get Service Option
function getServiceOptionList(){
$.each(optionList, function(i, option){
if(option.serviceName == 'force_pw_change_periodically'){
force_pw_change_periodically = option.value;
}
else if(option.serviceName == 'force_pw_change_on_login'){
force_pw_change_on_login = option.value;
}
else if(option.serviceName == 'force_login_periodically'){
force_login_periodically = option.value;
}
else if(option.serviceName == 'marking'){
marking = option.value;
}
else if(option.serviceName == 'user_data_backup'){
user_data_backup = option.value;
}
});
};
function OpenChangePassword() {
//$("#dlgChangePassword").dialog("open");
//$(".ui-dialog-titlebar").hide();
};
function loginWhenClickEnter(e){
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
$('#btnLogin').click();
}
};
$(document).ready(function (e) {
if (isAnonymousLogin()) {
$('#anonymous').show();
setTimeout(
function () {
initLoginAnonymousUser();
}, timeWaitSplashScreen);
}
else {
$('#normalUser').show();
$('#formlogin').hide();
$('#logologin').animate({ "margin-top": 0 }, timeWaitSplashScreen,
function () {
$('#formlogin').show();
$('#menu-language').animate({ opacity: 1 }, timeWaitSplashScreen);
$('#formlogin').animate({ opacity: 1 }, timeWaitSplashScreen);
$('.cnt_footer').animate({ opacity: 1 }, timeWaitSplashScreen);
}
);
initLoginNormalUser();
}
// 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
initialScreen();
//Change language japanese
$('#language-ja').click(changeLanguageJa);
//Change language korean
$('#language-ko').click(changeLanguageKo);
//Change laguage english
$('#language-en').click(changeLanguageEn);
//Button login click event
$('#btnLogin').click(loginFunction);
//Button Change click event
$('#btnChange').click(changePassFunction);
//Button Skip click event
$('#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();
// set number new push message to 0
ClientData.pushInfo_newMsgNumber(0);
// get service option list
optionList = data.serviceOptionList;
// save service user option
$.each(data.serviceOptionList, function (i, option) {
if (option.serviceName == 'marking') {
ClientData.serviceOpt_marking(option.value);
}
});
// hide splash screen then move to home page
$('#anonymous').fadeOut('slow', 'swing', function () {
avwScreenMove("abvw/" + ScreenIds.Home);
});
}
else {
if (data.errorMessage != null && data.errorMessage != undefined) {
showMessageErrorLoginAnonymous(format(i18nText('msgAnonymousLoginErr'), data.errorMessage).toString());
}
else {
showMessageErrorLoginAnonymous(i18nText('msgAnonymousLoginErr2'));
}
}
}, function (xhr, statusText, errorThrown) {
if (xhr.responseText && xhr.status != 0) {
var errorMessage = JSON.parse(xhr.responseText).errorMessage;
if (errorMessage) {
showMessageErrorLoginAnonymous(format(i18nText('msgAnonymousLoginErr'), errorMessage).toString());
}
else {
showMessageErrorLoginAnonymous(i18nText('msgAnonymousLoginErr2'));
}
} else {
showMessageErrorLoginAnonymous(i18nText('msgAnonymousLoginErr2'));
}
});
};
function showMessageErrorLoginAnonymous(errorMessage) {
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errorMessage
});
$('.toast-position-middle-center').css('width', '400px');
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('6 U;6 1C;6 1g;6 1b=[];6 12;6 14;6 1u;6 1c;6 1B;6 l="";6 R=2L;7 25(){$(\'#1j\').G(\'1k\',\'1k\');5(3.1r()!=x){$(\'#1a\').g(3.1r())}5(3.1t()!=x){$(\'#1e\').g(3.1t())}};7 2v(){5(3.1F()){25()}};7 2D(){6 F=2U();2l.1K();2w=x;2F();1n(F);3.2T(1d);6 1j=$(\'#1j\').G(\'1k\');6 A=$(\'#1a\').g();6 v=$(\'#1e\').g();6 s=$(\'#1l\').g();6 J=Z 10();3.1r(A);3.1t(v);3.2z(A);3.2x(v);3.1g(1g);5(1j==\'1k\'){3.1F(1d)}8{3.1F(N)}3.2N(J.2O());3.t(1C);1X()};7 21(){6 A=$(\'#1a\').g();6 v=$(\'#1e\').g();6 s=$(\'#1l\').g();6 f=$(\'#q-j-k\');5(!16.17(A)){l="";f.n(a(\'11\'));f.G(\'F\',\'11\');f.h();I N}8 5(!16.17(v)){l="";f.n(a(\'11\'));f.G(\'F\',\'11\');f.h();I N}8 5(!16.17(s)){l="";f.n(a(\'11\'));f.G(\'F\',\'11\');f.h();I N}8{I 1d}};7 28(){6 2y=$(\'#1U\').g();6 1S=$(\'#2R\').g();6 1i=$(\'#1V\').g();6 f=$(\'#o-j-k\');5(!16.17(2y)){l="";f.n(a(\'1p\'));f.G(\'F\',\'1p\');f.h();I N}8 5(!16.17(1S)){l="";f.n(a(\'1p\'));f.G(\'F\',\'1p\');f.h();I N}8{5(1S!=1i){l="";f.n(a(\'2s\'));f.G(\'F\',\'2s\');f.h();I N}8{I 1d}}};7 2f(){6 A=$(\'#1a\').g();6 v=$(\'#1e\').g();6 s=$(\'#1l\').g();6 2J=0;6 z;6 L={1I:\'\',v:v,s:s,2k:A};5(3.t()){L.1I=3.t()}6 w=2h();6 1x=w.1x;2n(1x,x,\'2Q\',\'1W\',L,7(d){U=d.U;1C=d.Y;1g=d.2C;1b=d.1R;24();5(d.19==\'1H\'){2D();3.2G(0);$(\'#q-j-k\').1f(\'1T\',\'1Z\');5(d.U==0){3.H(3.t());D("B/"+E.C)}8 5(d.U==1){5(12==2){Q();$(".X-o-S").y();$(\'#W\').y();$("#2H").1f(\'23\',\'22\')}8 5(12==1){z=3.1E();5(z==x||z==\'1N\'){Q();$(\'#W\').h();$(".X-o-S").y()}8{6 J=Z 10();6 1s=Z 10(z);6 V=J.2E(1s);5(V<=30){3.H(3.t());D("B/"+E.C)}8 5(V>30){Q();$(\'#W\').h();$(".X-o-S").y()}}}8{3.H(3.t());D("B/"+E.C)}}8 5(d.U==2){5(14==1){$(\'#W\').h();z=3.1E();5(z==x||z==\'1N\'){Q();$(".X-o-S").y()}8{6 J=Z 10();6 1s=Z 10(z);6 V=J.2E(1s);5(V<=30){3.H(3.t());D("B/"+E.C)}8 5(V>30){Q();$(".X-o-S").y()}}}8 5(14==2){Q();$(\'#W\').y();$(".X-o-S").y();$("#2H").1f(\'23\',\'22\')}8{3.H(3.t());D("B/"+E.C)}}}8{l=d.m;$(\'#q-j-k\').n(K(a(\'T\'),d.m).O());$(\'#q-j-k\').h();}},7(p,2c,2g){5(p.M&&p.1G!=0){l=1v.1y(p.M).m;$(\'#q-j-k\').n(K(a(\'T\'),1v.1y(p.M).m).O())}8{$(\'#q-j-k\').n(K(a(\'T\'),\'2S\'))}$(\'#q-j-k\').h()})};7 29(){6 A=$(\'#1a\').g();6 Y=3.t();6 v=$(\'#1e\').g();6 s=$(\'#1U\').g();6 1i=$(\'#1V\').g();6 L={Y:Y,v:v,s:s,2P:1i,2I:4};2M(A,\'2K\',\'1W\',L,7(d){6 19=d.19;5(19==\'1H\'){$(\'#o-j-k\').1f(\'1T\',\'1Z\');2b();3.H(3.t());D("B/"+E.C)}8{$(\'#o-j-k\').n(a(\'3s\'));$(\'#o-j-k\').h()}},7(p,b,c){5(p.M&&p.1G!=0){$(\'#o-j-k\').n(1v.1y(p.M).m);$(\'#o-j-k\').h()}8{3r()}})};7 2p(){1n(1D.3t);18.1h=a(\'1o\')+\' | \'+a(\'1m\');5(l!=""){$(\'#q-j-k\').n(K(a(\'T\'),l).O())}};7 2q(){1n(1D.3v);18.1h=a(\'1o\')+\' | \'+a(\'1m\');5(l!=""){$(\'#q-j-k\').n(K(a(\'T\'),l).O())}};7 20(){1n(1D.3u);18.1h=a(\'1o\')+\' | \'+a(\'1m\');5(l!=""){$(\'#q-j-k\').n(K(a(\'T\'),l).O())}};7 2r(){5(21()){2f()}};7 2u(){5(28()){29()}};7 2t(){6 J=Z 10();3.1E(J);3.H(3.t());D("B/"+E.C)};7 Q(){$("#q-s-1A").h();$("#q-s-1A").1Q();3q()};7 2b(){$("#q-s-1A").o(\'3m\')};7 1X(){$.1L(1b,7(i,9){5(9.u==\'14\'){3.3l(9.r)}8 5(9.u==\'12\'){3.3n(9.r)}8 5(9.u==\'1c\'){3.1Y(9.r)}8 5(9.u==\'1u\'){3.3p(9.r)}8 5(9.u==\'3o\'){3.3w(9.r)}8 5(9.u==\'3C\'){3.3B(9.r)}})};7 24(){$.1L(1b,7(i,9){5(9.u==\'14\'){14=9.r}8 5(9.u==\'12\'){12=9.r}8 5(9.u==\'1B\'){1B=9.r}8 5(9.u==\'1c\'){1c=9.r}8 5(9.u==\'1u\'){1u=9.r}})};7 3A(){};7 2o(e){6 2B=(e.2A?e.2A:e.3x);5(2B==13){$(\'#2m\').P()}};$(18).3z(7(e){5(3y()){$(\'#2d\').h();34(7(){2i()},R)}8{$(\'#33\').h();$(\'#1P\').y();$(\'#32\').1w({"37-36":0},R,7(){$(\'#1P\').h();$(\'#35-1q\').1w({1z:1},R);$(\'#1P\').1w({1z:1},R);$(\'.2W\').1w({1z:1},R)});2j()}});7 2j(){18.1h=a(\'1o\')+\' | \'+a(\'1m\');2v();$(\'#1q-2V\').P(2p);$(\'#1q-31\').P(2q);$(\'#1q-2Z\').P(20);$(\'#2m\').P(2r);$(\'#2Y\').P(2u);$(\'#W\').P(2t);$(\'#1l\').38(2o)};7 2i(){6 w=2h();6 L={1I:x,v:w.1M,2k:w.1O};2n(w.1x,x,\'3h\',\'3g\',L,7(d){5(d.19==\'1H\'){2l.1K();2w=x;2F();3.1r(w.1O);3.2z(w.1O);3.1t(w.1M);3.2x(w.1M);3.1g(d.2C);3.H(d.Y);3.t(d.Y);3f.1K();3.2G(0);1b=d.1R;$.1L(d.1R,7(i,9){5(9.u==\'1c\'){3.1Y(9.r)}});$(\'#2d\').3k(\'3j\',\'3i\',7(){D("B/"+E.C)})}8{5(d.m!=x&&d.m!=1N){15(K(a(\'26\'),d.m).O())}8{15(a(\'1J\'))}}},7(p,2c,2g){5(p.M&&p.1G!=0){6 m=1v.1y(p.M).m;5(m){15(K(a(\'26\'),m).O())}8{15(a(\'1J\'))}}8{15(a(\'1J\'))}})};7 15(m){$().2a({27:\'2e-1Q\'});$().2a(\'3b\',{3a:\'j\',39:1d,3e:m});$(\'.3d-27-2e-1Q\').1f(\'3c\',\'2X\')};', 62, 225, '|||ClientData||if|var|function|else|option|i18nText|||data||msgError|val|show||error|message|login_errorMessage|errorMessage|html|dialog|xhr|main|value|password|userInfo_sid_local|serviceName|loginId|sysSettings|null|hide|skipPwdDate|accountPath|abvw|Home|avwScreenMove|ScreenIds|lang|attr|userInfo_sid|return|date|format|params|responseText|false|toString|click|OpenChangePasswordDialog|timeWaitSplashScreen|titlebar|msgLoginErrWrong|requirePasswordChange|numDay|btnSkip|ui|sid|new|Date|msgLoginEmpty|force_pw_change_on_login||force_pw_change_periodically|showMessageErrorLoginAnonymous|ValidationUtil|CheckRequiredForText|document|result|txtAccPath|optionList|marking|true|txtAccId|css|userInfo_userName|title|confirmPass|chkRemember|checked|txtPassword|sysAppTitle|changeLanguage|dspLogin|msgPwdEmpty|language|userInfo_accountPath|skpPwdDt|userInfo_loginId|user_data_backup|JSON|animate|apiLoginUrl|parse|opacity|change|force_login_periodically|userinfo_sid|Consts|userInfo_pwdSkipDt|userInfo_rememberLogin|status|success|previousSid|msgAnonymousLoginErr2|clear|each|anonymousLoginId|undefined|anonymousLoginPath|formlogin|center|serviceOptionList|newPass|display|txtCurrentPass|txtConfirmNew|GET|saveServiceUserOption|serviceOpt_marking|none|changeLanguageEn|checkValidation|hidden|visibility|getServiceOptionList|loadLoginInfo|msgAnonymousLoginErr|position|checkDialogValidation|changePasswordProcess|toastmessage|CloseChangePasswordDialog|statusText|anonymous|middle|processLogin|errorThrown|avwSysSetting|initLoginAnonymousUser|initLoginNormalUser|urlpath|SessionStorageUtils|btnLogin|avwCmsApiWithUrl|loginWhenClickEnter|changeLanguageJa|changeLanguageKo|loginFunction|msgPwdNotMatch|skipPassFunction|changePassFunction|initialScreen|avwUserSessionObj|userInfo_loginId_session|currentPass|userInfo_accountPath_session|keyCode|code|userName|saveLoginInfo|subtractByDays|avwCreateUserSession|pushInfo_newMsgNumber|txtPwdRemind|appId|requireChangePassword|passwordChange|2000|avwCmsApiSync|userInfo_lastLoginTime|jpDateTimeString|newPassword|webClientLogin|txtNewPass|E001|common_contentDataChkFlg|getCurrentLanguage|ja|cnt_footer|400px|btnChange|en||ko|logologin|normalUser|setTimeout|menu|top|margin|keydown|sticky|type|showToast|width|toast|text|LocalStorageUtils|post|webClientAnonymousLogin|swing|slow|fadeOut|serviceOpt_force_pw_change_periodically|close|serviceOpt_force_pw_change_on_login|web_screen_lock|serviceOpt_user_data_backup|lockLayout|showSystemError|msgPwdOldWrong|ConstLanguage_Ja|ConstLanguage_En|ConstLanguage_Ko|serviceOpt_web_screen_lock|which|isAnonymousLogin|ready|OpenChangePassword|serviceOpt_web_screen_lock_wait|web_screen_lock_wait'.split('|'), 0, {}))
/// 設定変更画面
/// <reference path="../common/js/avweb.js" />
/// <reference path="../common/js/screenLock.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" />
/// <reference path="../common/js/pageViewer.js" />
// Init function of page
$(document).ready(function () {
if (!avwCheckLogin(ScreenIds.Login)) return;
ToogleLogoutNortice();
LockScreen();
document.title = i18nText('dspSetting') + ' | ' + i18nText('sysAppTitle');
// Set bookmark screen
ClientData.BookmarkScreen(ScreenIds.Setting);
InitScreen();
$("#dspSave").click(dspSave_Click);
$("#dspPwdUpd").click(dspPwdUpd_Click);
$("#dspOptReset").click(dspOptReset_Click);
$("#dspOptBk").click(dspOptBk_Click);
$("#dspOptRes").click(dspOptRes_Click);
$("#dspPwdUpd1").click(dspPwdUpd1_Click);
$("#dspSkip").click(dspSkip_Click);
$("#dspCancel").click(dspCancel_Click);
$("#dspOptRes_OK").click(dspOptRes_OK_Click);
$("#dspOptRes_Cancel").click(dspOptRes_Cancel_Click);
$("#dspOptBk_OK").click(dspOptBk_OK_Click);
$("#dspOptBk_Cancel").click(dspOptBk_Cancel_Click);
// Check to hide/show backup button
if (ClientData.isChangedBookmark() == true
|| ClientData.isChangedMarkingData() == true
|| ClientData.isChangedMemo() == true) {
$("#dspOptBk").show();
// check disabled button backup
checkDisabledButton('#dlgConfirmBackup .option_backup input', '#dspOptBk_OK');
}
else {
$("#dspOptBk").hide();
}
// Get flag to determine must change password
avwCmsApi(ClientData.userInfo_accountPath(), "requirePasswordChange", 'GET', { sid: ClientData.userInfo_sid() },
avwCmsApi_requirePasswordChange_success,
null
);
// In case: user_data_backup = "Y" -> backup
if (ClientData.serviceOpt_user_data_backup() != "Y") {
$("#dspOptBk").css('visibility', 'hidden');
$("#dspOptRes").css('visibility', 'hidden');
$("#chkOptBkCfm").css('visibility', 'hidden');
$("#txtOptBkCfm").css('visibility', 'hidden');
$("#txtBkResCap").css('visibility', 'hidden');
$('#regionOptionBackup').css('visibility', 'hidden');
}
else {
// 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 {
$('#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');
}
}
});
/*
event of changing language
*/
function changeLanguageCallBackFunction() {
document.title = i18nText('dspSetting') + ' | ' + i18nText('sysAppTitle');
};
/*
Check backup file exists or not
*/
//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(), "filename": file, fileType: type }; //, deviceType: '4'
// 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;
};
// Event success
function avwCmsApi_requirePasswordChange_success(data) {
ClientData.requirePasswordChange(0);
if (data.requirePasswordChange == 1) {
if (ClientData.serviceOpt_force_pw_change_on_login() == 0) { // No need to change password
// Skip this case
}
else if (ClientData.serviceOpt_force_pw_change_on_login() == 1) { // Recommend to change password
var pwdSkipDt = ClientData.userInfo_pwdSkipDt();
if (pwdSkipDt) {
// Check 30 days
var currDate = new Date();
var skipDate = new Date(pwdSkipDt);
var numDay = currDate.subtractByDays(skipDate);
if (numDay <= 30) {
// Do not show dialog to change password
}
else if (numDay > 30) {
// Show dialog to change password
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else {
//alert('pwdSkipDt=null');
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else if (ClientData.serviceOpt_force_pw_change_on_login() == 2) { // Force to change password
ClientData.requirePasswordChange(1);
OpenChangePassword();
$("#dspSkip").hide();
$("#dspCancel").hide();
//$("#dspPwdUpd1").css('margin', $("#dspCancel").css('margin'));
//$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
$("#txtChangePassComment").css('visibility', 'hidden');
}
}
else if (data.requirePasswordChange == 2) {
if (ClientData.serviceOpt_force_pw_change_periodically() == 0) { // No need to change password
// Skip this case
}
else if (ClientData.serviceOpt_force_pw_change_periodically() == 1) { // Recommend to change password
var pwdSkipDt = ClientData.userInfo_pwdSkipDt();
if (pwdSkipDt) {
// Check 30 days
var currDate = new Date();
var skipDate = new Date(pwdSkipDt);
var numDay = currDate.subtractByDays(skipDate);
if (numDay <= 30) {
// Do not show dialog to change password
}
else if (numDay > 30) {
// Show dialog to change password
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else {
//alert('pwdSkipDt=null');
OpenChangePassword();
$("#dspSkip").show();
$("#dspCancel").hide();
}
}
else if (ClientData.serviceOpt_force_pw_change_periodically() == 2) { // Force to change password
ClientData.requirePasswordChange(1);
OpenChangePassword();
$("#dspSkip").hide();
$("#dspCancel").hide();
//$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
$("#txtChangePassComment").css('visibility', 'hidden');
}
}
else if (data.requirePasswordChange == 0) {
// Skip this case
}
};
/*
----------------------------------------------------------------------------
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')
// });
// });
// 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;
}
// 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();
});
};
// 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 {
$("#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();
closeBackup(true);
};
// OK for restore
function dspOptRes_OK_Click(e) {
e.preventDefault();
// ----------------------------
// 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
// $().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: '',
sticky: true,
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 {
$('#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) {
// 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) {
getDataBookmark(data);
ClientData.isChangedBookmark(false);
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();
closeRestore(true);
};
// Cancel to change password
function dspCancel_Click(e) {
e.preventDefault();
var msgError = $('#dialog-error-message');
msgError.html('');
closeChangePassword(true);
};
// Save setting
function dspSave_Click(e) {
e.preventDefault();
// 最初の画面を選択
if ($("#rdoOpt001").attr('checked') == 'checked') {
ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_BookShelf); // Bookshelf
}
else {
ClientData.sortOpt_viewMode(Consts.ConstDisplayMode_List); // List
}
// 動画、音楽繰り返し
if ($("#chkOpt002").attr('checked') == 'checked') {
ClientData.userOpt_musicMode(1);
ClientData.userOpt_videoMode(1);
}
else {
ClientData.userOpt_musicMode(0);
ClientData.userOpt_videoMode(0);
}
// マーキング(コンテンツを開いた時に表示する)
if ($("#chkOpt003").attr('checked') == 'checked') {
ClientData.userOpt_makingDsp(1);
}
else {
ClientData.userOpt_makingDsp(0);
}
// Show/not show alert when press F5.close tab.broswer.
if ($("#chkOpt005").attr('checked') == 'checked') {
ClientData.userOpt_closeOrRefreshAlert(1);
ToogleLogoutNortice();
}
else {
ClientData.userOpt_closeOrRefreshAlert(0);
ToogleLogoutNortice();
}
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
if ($("#chkOptBkCfm").attr('checked') == 'checked') {
ClientData.userOpt_bkConfirmFlg(1);
}
else {
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);
}
// save config page transition No.4
ClientData.userOpt_pageTransition($('#cboAnimation').val());
var timeAnimation = $('#txtValueAnimation').val();
if (isNaN(timeAnimation) || timeAnimation < 0.1 || timeAnimation.length == 2 || timeAnimation.length > 3 || timeAnimation.indexOf('.')==0) {
timeAnimation = 0.1;
}
else if (timeAnimation > 9.9) {
timeAnimation = 9.9;
}
ClientData.userOpt_pageTransitionPeriod(timeAnimation);
$('#txtValueAnimation').val(timeAnimation);
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgSaveOk')
});
};
// Skip to change password
function dspSkip_Click(e) {
e.preventDefault();
var msgError = $('#dialog-error-message');
msgError.html('');
// Update パスワードスキップ日時
ClientData.userInfo_pwdSkipDt(new Date());
closeChangePassword();
};
function OpenChangePassword() {
//$("#dlgChangePassword").dialog("open");
//$(".ui-dialog-titlebar").hide();
// Clear all input values
$("#txtPwdCur").val('');
$("#txtPwdNew").val('');
$("#txtPwdNewRe").val('');
lockLayout();
$("#dlgChangePassword").show();
$("#dlgChangePassword").center();
};
function closeChangePassword(skip) {
//$("#dlgChangePassword").dialog("close");
$("#dlgChangePassword").hide();
unlockLayout();
};
// Want to change password
function dspPwdUpd_Click(e) {
e.preventDefault();
$("#dspCancel").show();
$("#dspSkip").hide();
$("#txtChangePassComment").css('visibility', 'hidden');
//$("#dspPwdUpd1").css('margin', '-27px 97px 0 0');
// Show dialog
OpenChangePassword();
};
// Reset setting
function dspOptReset_Click(e) {
e.preventDefault();
// 最初の画面を選択
$("#rdoOpt001").attr('checked', 'checked');
// 動画、音楽繰り返し
$("#chkOpt002").attr('checked', 'checked');
// マーキング(コンテンツを開いた時に表示する)
$("#chkOpt003").attr('checked', 'checked');
// Show alert when press F5.close tab.broswer
$("#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');
// reset page transition no.4
$('#txtValueAnimation').val(1);
$('#cboAnimation').val(0);
$('#slidebar-animation').slider('value', 1);
};
// 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();
};
// Restore
function dspOptRes_Click(e) {
e.preventDefault();
openRestore();
};
// Process changing password
function dspPwdUpd1_Click(e) {
e.preventDefault();
var isOK = true;
var msgError = $('#dialog-error-message');
// Check validation
if (!ValidationUtil.CheckRequiredForText(getCurrentPassword())) {
isOK = false;
//alert(i18nText('msgPwdEmpty'));
/* show error messages */
// $().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
msgError.html(i18nText('msgPwdEmpty'));
msgError.show();
}
else {
if (!ValidationUtil.CheckRequiredForText(getNewPassword())) {
isOK = false;
//alert(i18nText('msgPwdEmpty'));
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdEmpty')
//});
msgError.html(i18nText('msgPwdEmpty'));
msgError.show();
}
else {
if (getNewPassword() != getNewPasswordRe()) {
isOK = false;
//alert(i18nText('msgPwdNotMatch'));
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
// $().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdNotMatch')
// });
msgError.html(i18nText('msgPwdNotMatch'));
msgError.show();
}
}
}
if (isOK) {
// Check max length
if (!ValidationUtil.CheckMaxLengthForByte(getCurrentPassword(), 10)) {
isOK = false;
}
if (!ValidationUtil.CheckMaxLengthForByte(getNewPassword(), 10)) {
isOK = false;
}
if (!ValidationUtil.CheckMaxLengthForByte(getNewPasswordRe(), 10)) {
isOK = false;
}
// Data type
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getCurrentPassword())) {
isOK = false;
}
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getNewPassword())) {
isOK = false;
}
if (!ValidationUtil.IsAlphabetOrNumberOrSymbol(getNewPasswordRe())) {
isOK = false;
}
var str = getCurrentPassword() + "";
// if (str.contains("_") || str.contains("‐")) {
// isOK = false;
// }
}
// Do changing password
var params = {
sid: ClientData.userInfo_sid(),
loginId: ClientData.userInfo_loginId_session(),
password: getCurrentPassword(),
newPassword: getNewPassword(),
appId: 4
};
if (isOK) {
avwCmsApi(ClientData.userInfo_accountPath(), "passwordChange", "GET", params,
avwCmsApi_passwordChange_success,
avwCmsApi_passwordChange_fail);
}
else {
//alert('error');
}
};
function avwCmsApi_passwordChange_success(data) {
// OK
var msgError = $('#dialog-error-message');
if (data.result != undefined && data.result != null) {
if (data.result != Consts.ConstAPI_SUCCESS) {
/* show error messages */
//$().toastmessage({ position: 'middle-center' });
//$().toastmessage('showToast', {
// type: 'error',
// sticky: true,
// text: i18nText('msgPwdChangeNG')
//});
//alert(i18nText('msgPwdOldWrong'));
msgError.html(i18nText('msgPwdChangeNG'));
msgError.show();
}
else {
ClientData.requirePasswordChange(0);
msgError.html('');
closeChangePassword();
/* show messages */
$().toastmessage({ position: 'middle-center' });
$().toastmessage('showToast', {
type: 'success',
sticky: true,
text: i18nText('msgPwdChangeOK')
});
}
}
};
function avwCmsApi_passwordChange_fail(xhr, b, c) {
if (xhr.responseText && xhr.status != 0) {
/* show error messages */
var msgError = $('#dialog-error-message');
//msgError.html(i18nText('msgPwdChangeNG'));
msgError.html(JSON.parse(xhr.responseText).errorMessage);
msgError.show();
}
else {
showSystemError();
}
};
/*
----------------------------------------------------------------------------
Event groups [ end ]
----------------------------------------------------------------------------
*/
// Setting dialog
$(function () {
$('#dlgChangePassword').center();
$('#dlgConfirmBackup').center();
$('#dlgConfirmRestore').center();
$('#dlgChangePassword').hide();
$('#dlgConfirmBackup').hide();
$('#dlgConfirmRestore').hide();
// $('#dlgChangePassword').dialog({
// autoOpen: false,
// title: 'Change password',
// modal: true,
// resizable: false,
// width: 550,
// height: 400
// });
// $('#dlgConfirmBackup').dialog({
// autoOpen: false,
// title: 'Backup',
// modal: true,
// resizable: false,
// width: 550,
// height: 400
// });
// $('#dlgConfirmRestore').dialog({
// autoOpen: false,
// title: 'Restore',
// modal: true,
// resizable: false,
// width: 550,
// height: 450
// });
// LockScreen();
});
function openBackup() {
//$("#dlgConfirmBackup").dialog("open");
//$(".ui-dialog-titlebar").hide();
lockLayout();
$("#dlgConfirmBackup").show();
$("#dlgConfirmBackup").center();
};
function closeBackup(cancel) {
if (cancel != undefined || cancel == true) {
//alert('you cancelled');
}
//$("#dlgConfirmBackup").dialog("close");
$("#dlgConfirmBackup").hide();
unlockLayout();
};
function openRestore() {
//$("#dlgConfirmRestore").dialog("open");
//$(".ui-dialog-titlebar").hide();
// check avaliable restore no.17
lockLayout();
$("#dlgConfirmRestore").show();
$("#dlgConfirmRestore").center();
};
function closeRestore(cancel) {
if (cancel != undefined || cancel == true) {
//alert('you cancelled');
}
//$("#dlgConfirmRestore").dialog("close");
$("#dlgConfirmRestore").hide();
unlockLayout();
};
// Get input current password
function getCurrentPassword() {
return $("#txtPwdCur").val();
};
// Get input new password
function getNewPassword() {
return $("#txtPwdNew").val();
};
// Get input new password
function getNewPasswordRe() {
return $("#txtPwdNewRe").val();
};
// Initalize screen
function InitScreen() {
// ログインID
$("#txtLoginId").text(ClientData.userInfo_loginId_session());
// アカウントパス
$("#txtLoginPath").text(ClientData.userInfo_accountPath_session());
// 最終ログイン時間
$("#txtLastLoginTime").text(ClientData.userInfo_lastLoginTime());
//alert(getLastLoginDate());
// 最初の画面を選択
if (ClientData.sortOpt_viewMode() == Consts.ConstDisplayMode_List) {
$("#rdoOpt0011").attr('checked', 'checked');
}
else {
$("#rdoOpt001").attr('checked', 'checked');
}
// 動画、音楽繰り返し
if (ClientData.userOpt_musicMode() == 0) {
$("#chkOpt002").removeAttr('checked');
}
else {
$("#chkOpt002").attr('checked', 'checked');
}
// マーキング(コンテンツを開いた時に表示する)
if (ClientData.userOpt_makingDsp() == 0) {
$("#chkOpt003").removeAttr('checked');
}
else {
$("#chkOpt003").attr('checked', 'checked');
}
// Show alert when press F5.close tab.broswer
if (ClientData.userOpt_closeOrRefreshAlert() == 0) {
$("#chkOpt005").removeAttr('checked');
}
else {
$("#chkOpt005").attr('checked', 'checked');
}
// 毎回ログアウトの時、バックアップするかどうかは必ず確認する
if (ClientData.userOpt_bkConfirmFlg() == 0) {
$("#chkOptBkCfm").removeAttr('checked');
}
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');
}
// load config page transition & page transition period No.4
$('#cboAnimation').val(ClientData.userOpt_pageTransition());
$('#txtValueAnimation').val(ClientData.userOpt_pageTransitionPeriod());
$('#txtValueAnimation').blur(function () {
var value = $(this).val();
if (isNaN(value) || value < 0.1 || value.length == 2 || value.length > 3 || value.indexOf('.') == 0) {
value = 0.1;
}
else if (value > 9.9) {
value = 9.9;
}
$(this).val(value);
$('#slidebar-animation').slider('value', value);
});
$('#slidebar-animation').slider(
{
min: 0.1,
max: 9.9,
step: 0.1,
value: $('#txtValueAnimation').val(),
slide: doChangeAnimationSlidebar
}
);
};
function doChangeAnimationSlidebar(e,obj) {
$('#txtValueAnimation').val(obj.value);
};
\ No newline at end of file
eval(function (p, a, c, k, e, d) { e = function (c) { return (c < a ? "" : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36)) }; if (!''.replace(/^/, String)) { while (c--) d[e(c)] = k[c] || e(c); k = [function (e) { return d[e] } ]; e = function () { return '\\w+' }; c = 1; }; while (c--) if (k[c]) p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c]); return p; } ('$(2p).4b(a(){6(!3B(3g.3F))y;1U();3y();2p.2R=i(\'2W\')+\' | \'+i(\'3k\');7.3x(3g.3z);2U();$("#3u").u(2y);$("#3v").u(3e);$("#3A").u(3b);$("#V").u(3a);$("#1u").u(3d);$("#3G").u(3c);$("#M").u(2w);$("#N").u(2z);$("#39").u(2D);$("#3C").u(2v);$("#28").u(2F);$("#3q").u(2N);6(7.18()==j||7.13()==j||7.1j()==j){$("#V").q();32(\'#R .1Z 25\',\'#28\')}8{$("#V").l()}2V(7.1b(),"J",\'2Y\',{1c:7.1a()},3l,2r);6(7.3s()!="Y"){$("#V").B(\'C\',\'E\');$("#1u").B(\'C\',\'E\');$("#1l").B(\'C\',\'E\');$("#3p").B(\'C\',\'E\');$("#3r").B(\'C\',\'E\');$(\'#3t\').B(\'C\',\'E\')}8{f 2j=1s(\'2M.15\',2);f 2k=1s(\'2G.15\',1);f 2h=1s(\'2u.15\',4);6(2j||2k||2h){$("#1u").B(\'C\',\'\');6(!2j){$(\'#1n\').d(\'g\',\'g\').h(\'5\')}8{$(\'#1n\').h(\'g\')}6(!2k){$(\'#1q\').d(\'g\',\'g\').h(\'5\')}8{$(\'#1q\').h(\'g\')}6(!2h){$(\'#1t\').d(\'g\',\'g\').h(\'5\')}8{$(\'#1t\').h(\'g\')}32(\'#U .1Z 25\',\'#39\')}8{$("#1u").B(\'C\',\'E\')}}});a 3D(){2p.2R=i(\'2W\')+\' | \'+i(\'3k\')};a 1s(3j,1k){f 1z=n;f 1D={"1c":7.1a(),"1m":3j,3w:1k};1y(7.1b(),"1x","1A",1D,a(k){6(k){1z=j}},a(G,b,c){6(G.38!=0){1z=n}8{33()}});y 1z};a 3l(k){7.J(0);6(k.J==1){6(7.27()==0){}8 6(7.27()==1){f 1d=7.1T();6(1d){f 1r=1e 1f();f 1N=1e 1f(1d);f 17=1r.3f(1N);6(17<=30){}8 6(17>30){I();$("#M").q();$("#N").l()}}8{I();$("#M").q();$("#N").l()}}8 6(7.27()==2){7.J(1);I();$("#M").l();$("#N").l();$("#26").B(\'C\',\'E\')}}8 6(k.J==2){6(7.22()==0){}8 6(7.22()==1){f 1d=7.1T();6(1d){f 1r=1e 1f();f 1N=1e 1f(1d);f 17=1r.3f(1N);6(17<=30){}8 6(17>30){I();$("#M").q();$("#N").l()}}8{I();$("#M").q();$("#N").l()}}8 6(7.22()==2){7.J(1);I();$("#M").l();$("#N").l();$("#26").B(\'C\',\'E\')}}8 6(k.J==0){}};a 2F(e){e.w();6($(1v).2E(\'g\'))y;f 1E=$(\'#14\').d(\'5\')==\'5\';f 1C=$(\'#16\').d(\'5\')==\'5\';f 1o=$(\'#19\').d(\'5\')==\'5\';6(!1E&&!1C&&!1o){1G();y}3E(1E,1C,1o,n,a(){2K();6(1E&&!7.13()){$(\'#1n\').h(\'g\')}6(1C&&!7.1j()){$(\'#1q\').h(\'g\')}6(1o&&!7.18()){$(\'#1t\').h(\'g\')}1G()})};a 2K(){6(7.18()==j||7.13()==j||7.1j()==j){6(7.18()!=j){$(\'#19\').d(\'g\',\'g\').h(\'5\')}6(7.13()!=j){$(\'#14\').d(\'g\',\'g\').h(\'5\')}6(7.1j()!=j){$(\'#16\').d(\'g\',\'g\').h(\'5\')}$("#V").q()}8{$("#V").l()}};a 2N(e){e.w();1G(j)};a 2D(e){e.w();6($(1v).2E(\'g\'))y;f 2i=$(\'#1n\').d(\'5\')==\'5\';f 2b=$(\'#1q\').d(\'5\')==\'5\';f 2d=$(\'#1t\').d(\'5\')==\'5\';6(!2i&&!2b&&!2d){1K();y}$().S({2q:\'2e-F\'});$().S(\'2a\',{1k:\'\',2f:j,T:\'\',46:\'D\'});$(\'#D\').O("<t P=\'s-r-2O\'></t>");45(a(){6(2i){f 12=2I();6(!12){$(\'#D\').O("<t P=\'s-r-W-L s-r-z\'>"+i(\'2A\')+" "+i(\'2c\')+"</t>")}8{$(\'#D\').O("<t P=\'s-r-W-1g s-r-z\'>"+i(\'2A\')+" "+i(\'2o\')+"</t>")}}6(2b){f 12=2H();6(!12){$(\'#D\').O("<t P=\'s-r-W-L s-r-z\'>"+i(\'2x\')+" "+i(\'2c\')+"</t>")}8{$(\'#D\').O("<t P=\'s-r-W-1g s-r-z\'>"+i(\'2x\')+" "+i(\'2o\')+"</t>")}}6(2d){f 12=2B();6(!12){$(\'#D\').O("<t P=\'s-r-W-L s-r-z\'>"+i(\'2J\')+" "+i(\'2c\')+"</t>")}8{$(\'#D\').O("<t P=\'s-r-W-1g s-r-z\'>"+i(\'2J\')+" "+i(\'2o\')+"</t>")}}$(\'#D .s-r-2O\').l();$(\'.s-r-47\').u(a(){$().S(\'49\',$(\'#D\'),2r)})},48);1K()};a 2B(){f v=n;1y(7.1b(),"1x","1A",{1c:7.1a(),1m:"2u.15"},a(k){6(k){41(k);7.18(n);v=j}},a(G,b,c){});y v};a 2H(){f v=n;1y(7.1b(),"1x","1A",{1c:7.1a(),1m:"2G.15"},a(k){6(k){40(k);v=j}},a(G,b,c){});y v};a 2I(){f v=n;1y(7.1b(),"1x","1A",{1c:7.1a(),1m:"2M.15"},a(k){6(k){42(k);7.13(n);v=j}},a(G,b,c){});y v}a 2v(e){e.w();1K(j)};a 2z(e){e.w();f m=$(\'#1h-L-z\');m.K(\'\');1p(j)};a 2y(e){e.w();6($("#1V").d(\'5\')==\'5\'){7.1Y(1w.44);}8{7.1Y(1w.3h);}6($("#1R").d(\'5\')==\'5\'){7.1W(1);7.2t(1)}8{7.1W(0);7.2t(0)}6($("#1J").d(\'5\')==\'5\'){7.23(1)}8{7.23(0)}6($("#1F").d(\'5\')==\'5\'){7.20(1);1U()}8{7.20(0);1U()}6($("#1l").d(\'5\')==\'5\'){7.2l(1)}8{7.2l(0)}6($("#1H").d(\'5\')==\'5\'){7.1L(1)}8{7.1L(0)}6($("#1O").d(\'5\')==\'5\'){7.1M(1)}8{7.1M(0)}6($("#1I").d(\'5\')==\'5\'){7.1Q(1)}8{7.1Q(0)}7.2Z($(\'#2g\').o());f A=$(\'#Q\').o();6(2T(A)||A<0.1||A.1B==2||A.1B>3||A.3n(\'.\')==0){A=0.1}8 6(A>9.9){A=9.9}7.31(A);$(\'#Q\').o(A);$().S({2q:\'2e-F\'});$().S(\'2a\',{1k:\'1g\',2f:j,T:i(\'43\')})};a 2w(e){e.w();f m=$(\'#1h-L-z\');m.K(\'\');7.1T(1e 1f());1p()};a I(){$("#2S").o(\'\');$("#2P").o(\'\');$("#2Q").o(\'\');2m();$("#1i").q();$("#1i").F()};a 1p(4a){$("#1i").l();2s()};a 3e(e){e.w();$("#N").q();$("#M").l();$("#26").B(\'C\',\'E\');I()};a 3b(e){e.w();$("#1V").d(\'5\',\'5\');$("#1R").d(\'5\',\'5\');$("#1J").d(\'5\',\'5\');$("#1F").d(\'5\',\'5\');$("#1l").d(\'5\',\'5\');$(\'#1H\').d(\'5\',\'5\');$(\'#1O\').d(\'5\',\'5\');$(\'#1I\').d(\'5\',\'5\');$(\'#Q\').o(1);$(\'#2g\').o(0);$(\'#24-1X\').29(\'p\',1)};a 3a(e){e.w();6(7.1L()==0){$("#14").h(\'5\')}8{$("#14").d(\'5\',\'5\')}6(7.1M()==0){$("#16").h(\'5\')}8{$("#16").d(\'5\',\'5\')}6(7.1Q()==0){$("#19").h(\'5\')}8{$("#19").d(\'5\',\'5\')}6(!7.18()){$(\'#19\').d(\'g\',\'g\').h(\'5\')}8{$(\'#19\').h(\'g\')}6(!7.1j()){$(\'#16\').d(\'g\',\'g\').h(\'5\')}8{$(\'#16\').h(\'g\')}6(!7.13()){$(\'#14\').d(\'g\',\'g\').h(\'5\')}8{$(\'#14\').h(\'g\')}4h(\'#R .1Z 25\',\'#28\');35()};a 3d(e){e.w();36()};a 3c(e){e.w();f x=j;f m=$(\'#1h-L-z\');6(!H.3o(Z())){x=n;m.K(i(\'3m\'));m.q()}8{6(!H.3o(X())){x=n;m.K(i(\'3m\'));m.q()}8{6(X()!=1P()){x=n;m.K(i(\'4g\'));m.q()}}}6(x){6(!H.21(Z(),10)){x=n}6(!H.21(X(),10)){x=n}6(!H.21(1P(),10)){x=n}6(!H.1S(Z())){x=n}6(!H.1S(X())){x=n}6(!H.1S(1P())){x=n}f 4e=Z()+"";}f 1D={1c:7.1a(),4d:7.3i(),4c:Z(),4f:X(),3N:4};6(x){2V(7.1b(),"3M","2Y",1D,2X,37)}8{}};a 2X(k){f m=$(\'#1h-L-z\');6(k.v!=2n&&k.v!=2r){6(k.v!=1w.3P){m.K(i(\'3O\'));m.q()}8{7.J(0);m.K(\'\');1p();$().S({2q:\'2e-F\'});$().S(\'2a\',{1k:\'1g\',2f:j,T:i(\'3L\')})}}};a 37(G,b,c){6(G.34&&G.38!=0){f m=$(\'#1h-L-z\');m.K(3I.3H(G.34).3K);m.q()}8{33()}};$(a(){$(\'#1i\').F();$(\'#R\').F();$(\'#U\').F();$(\'#1i\').l();$(\'#R\').l();$(\'#U\').l();});a 35(){2m();$("#R").q();$("#R").F()};a 1G(11){6(11!=2n||11==j){}$("#R").l();2s()};a 36(){2m();$("#U").q();$("#U").F()};a 1K(11){6(11!=2n||11==j){}$("#U").l();2s()};a Z(){y $("#2S").o()};a X(){y $("#2P").o()};a 1P(){y $("#2Q").o()};a 2U(){$("#3J").T(7.3i());$("#3Q").T(7.3X());$("#3W").T(7.3Z());6(7.1Y()==1w.3h){$("#3Y").d(\'5\',\'5\')}8{$("#1V").d(\'5\',\'5\')}6(7.1W()==0){$("#1R").h(\'5\')}8{$("#1R").d(\'5\',\'5\')}6(7.23()==0){$("#1J").h(\'5\')}8{$("#1J").d(\'5\',\'5\')}6(7.20()==0){$("#1F").h(\'5\')}8{$("#1F").d(\'5\',\'5\')}6(7.2l()==0){$("#1l").h(\'5\')}8{$("#1l").d(\'5\',\'5\')}6(7.1L()==0){$("#1H").h(\'5\')}8{$("#1H").d(\'5\',\'5\')}6(7.1M()==0){$("#1O").h(\'5\')}8{$("#1O").d(\'5\',\'5\')}6(7.1Q()==0){$("#1I").h(\'5\')}8{$("#1I").d(\'5\',\'5\')}$(\'#2g\').o(7.2Z());$(\'#Q\').o(7.31());$(\'#Q\').3V(a(){f p=$(1v).o();6(2T(p)||p<0.1||p.1B==2||p.1B>3||p.3n(\'.\')==0){p=0.1}8 6(p>9.9){p=9.9}$(1v).o(p);$(\'#24-1X\').29(\'p\',p)});$(\'#24-1X\').29({3S:0.1,3R:9.9,3U:0.1,p:$(\'#Q\').o(),3T:2C})};a 2C(e,2L){$(\'#Q\').o(2L.p)};', 62, 266, '|||||checked|if|ClientData|else||function|||attr||var|disabled|removeAttr|i18nText|true|data|hide|msgError|false|val|value|show|item|toast|div|click|result|preventDefault|isOK|return|message|timeAnimation|css|visibility|divResultMessage|hidden|center|xhr|ValidationUtil|OpenChangePassword|requirePasswordChange|html|error|dspSkip|dspCancel|append|class|txtValueAnimation|dlgConfirmBackup|toastmessage|text|dlgConfirmRestore|dspOptBk|image|getNewPassword||getCurrentPassword||cancel|res|isChangedMarkingData|chkopBkMarking|json|chkopBkMemo|numDay|isChangedBookmark|chkopBkShiori|userInfo_sid|userInfo_accountPath|sid|pwdSkipDt|new|Date|success|dialog|dlgChangePassword|isChangedMemo|type|chkOptBkCfm|filename|chkopResMarking|isBackupBookmark|closeChangePassword|chkopResMemo|currDate|IsExistBackupFile|chkopResShiori|dspOptRes|this|Consts|getBackupFile|avwCmsApiSync|isExisted|post|length|isBackupMemo|params|isBackupMarking|chkOpt005|closeBackup|chkBkMarking|chkBkShiori|chkOpt003|closeRestore|userOpt_bkMakingFlag|userOpt_bkMemoFlag|skipDate|chkBkMemo|getNewPasswordRe|userOpt_bkShioriFlag|chkOpt002|IsAlphabetOrNumberOrSymbol|userInfo_pwdSkipDt|ToogleLogoutNortice|rdoOpt001|userOpt_musicMode|animation|sortOpt_viewMode|option_backup|userOpt_closeOrRefreshAlert|CheckMaxLengthForByte|serviceOpt_force_pw_change_periodically|userOpt_makingDsp|slidebar|input|txtChangePassComment|serviceOpt_force_pw_change_on_login|dspOptBk_OK|slider|showToast|isRestoreMemo|msgRestoreFailed|isRestoreBookmark|middle|sticky|cboAnimation|isExistBookmark|isRestoreMarking|isExistMarking|isExistContentMemo|userOpt_bkConfirmFlg|lockLayout|undefined|msgRestoreSuccess|document|position|null|unlockLayout|userOpt_videoMode|Bookmark|dspOptRes_Cancel_Click|dspSkip_Click|txtBkMemo|dspSave_Click|dspCancel_Click|txtBkMarking|restoreBookmarkData|doChangeAnimationSlidebar|dspOptRes_OK_Click|hasClass|dspOptBk_OK_Click|ContentMemo|restoreMemoData|restoreMarkingData|txtBkShiori|setStatusButtonBackup|obj|Marking|dspOptBk_Cancel_Click|loading|txtPwdNew|txtPwdNewRe|title|txtPwdCur|isNaN|InitScreen|avwCmsApi|dspSetting|avwCmsApi_passwordChange_success|GET|userOpt_pageTransition||userOpt_pageTransitionPeriod|checkDisabledButton|showSystemError|responseText|openBackup|openRestore|avwCmsApi_passwordChange_fail|status|dspOptRes_OK|dspOptBk_Click|dspOptReset_Click|dspPwdUpd1_Click|dspOptRes_Click|dspPwdUpd_Click|subtractByDays|ScreenIds|ConstDisplayMode_List|userInfo_loginId_session|file|sysAppTitle|avwCmsApi_requirePasswordChange_success|msgPwdEmpty|indexOf|CheckRequiredForText|txtOptBkCfm|dspOptBk_Cancel|txtBkResCap|serviceOpt_user_data_backup|regionOptionBackup|dspSave|dspPwdUpd|fileType|BookmarkScreen|LockScreen|Setting|dspOptReset|avwCheckLogin|dspOptRes_Cancel|changeLanguageCallBackFunction|DoBackup|Login|dspPwdUpd1|parse|JSON|txtLoginId|errorMessage|msgPwdChangeOK|passwordChange|appId|msgPwdChangeNG|ConstAPI_SUCCESS|txtLoginPath|max|min|slide|step|blur|txtLastLoginTime|userInfo_accountPath_session|rdoOpt0011|userInfo_lastLoginTime|getDataMemo|getDataBookmark|getDataMarking|msgSaveOk|ConstDisplayMode_BookShelf|setTimeout|customMessages|close|1000|removeToast|skip|ready|password|loginId|str|newPassword|msgPwdNotMatch|setDisabledButton'.split('|'), 0, {}))
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