Commit ec36c21c by Takumi Imai

Merge branch 'feature/1.0_check_web_dev' into feature/1.0_check_web_dev_imai

# Conflicts:
#	abvw/common/js/appCommon/check-common.js
#	abvw/common/js/appCommon/check-footer.js
#	abvw/common/js/constant.js
#	abvw/js/operationList/operationList.js
#	abvw/js/topPage/topPage.js
parents f235a516 a5359e8b
......@@ -47,7 +47,7 @@ FOOTER.inactiveAllBottomNav = function () {
*/
FOOTER.goIndexPage = function (tabId) {
sessionStorage.activeTab = tabId;
CHK_Common.goUrlWithCurrentParams(DAFAULT_PAGE);
COMMON.goUrlWithCurrentParams(DAFAULT_PAGE);
};
/**
......
/**
* common js of app(web).
* The following is written.
* 1.language
* 2.loading
* 3.alert
* 4.url
* 5.cms communication
* 6.check if user is logged in
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var COMMON = {};
COMMON.hasErrorKey = 'AVW_HASERR';
COMMON.lang;
/**
* get lang code in local storage
* web gets lang form local storage
* but app gets lnag from session storage
*/
COMMON.setLangCodeWeb = function () {
let lang = COMMON.getLangWeb();
if (lang.split('-')[0] == CONSTANT.LANG.English) {
lang = CONSTANT.LANG.ENGLISH;
} else if (lang.split('-')[0] == CONSTANT.LANG.KOREA) {
lang = CONSTANT.LANG.KOREA;
} else {
lang = CONSTANT.LANG.JAPAN;
}
COMMON.lang = lang;
};
/**
* get lang in local storage
*
* @returns String pageLang
*/
COMMON.getLangWeb = function () {
if (!COMMON.lang) {
let pageLang;
if (localStorage[CONSTANT.LANG.SAVE_NAME]) {
pageLang = localStorage[CONSTANT.LANG.SAVE_NAME];
} else {
pageLang = (window.navigator.languages && window.navigator.languages[0]) || window.navigator.language || window.navigator.userLanguage || window.navigator.browserLanguage;
localStorage[CONSTANT.LANG.SAVE_NAME] = pageLang;
}
return pageLang;
} else {
return COMMON.lang;
}
return pageLang;
};
/**
* change lang of html
*/
COMMON.updateLang = function () {
$('.multi-lang').each(function () {
const key = $(this).attr('data-msg');
if (key) {
if ($(this).prop('tagName').toLowerCase() == 'input' && ($(this).attr('type') == 'text' || $(this).attr('type') == 'search')) {
const attr = $(this).attr('placeholder');
if (typeof attr !== 'undefined' && attr !== false) {
$(this).attr('placeholder', COMMON.getMsg(key));
} else {
$(this).val(COMMON.getMsg(key));
}
} else {
$(this).html(COMMON.getMsg(key));
}
}
});
};
/**
* get any lang msg from COMMON.msgMap
*
* @param String key
* @returns String msg
*/
COMMON.getMsg = function (key) {
const msg = CONSTANT.MSG_MAP[key];
if (!msg) {
return '';
}
return msg[COMMON.lang];
};
/* page transition without outputting a warning message */
COMMON.avwScreenMove = function (url) {
window.onbeforeunload = null;
window.location = url;
};
/**
* show loading dialog
* show msg by key
*
* @param {String} key
*/
COMMON.showLoading = function () {
$('#check_loading').dialog({
dialogClass: 'noTitleDialog ui-dialog-titlebar dialogNoBorder', //cssを追加する必要がある
autoOpen: false,
resizable: false,
modal: true,
width: '100%',
title: ' ',
open: function (e) {
$(e.target).parent().css('background-color', 'rgba(128,128,128)');
$(e.target).parent().css('position', 'absolute');
$(e.target).parent().css('left', '50%');
$(e.target).parent().css('top', '25vh');
$(e.target).parent().css('transform', 'translateX(-50%)');
$(e.target).parent().css('-webkit- transform', 'translateY(-50%) translateX(-50%)');
$(e.target).parent().children('.ui-dialog-buttonpane').css('background-color', 'rgba(128,128,128)').css('border', 'none');
},
close: function () {},
});
$('#check_loading').dialog('open');
};
/**
* close loading
*/
COMMON.closeLoading = function () {
if ($('#check_loading').hasClass('ui-dialog-content')) {
$('#check_loading').dialog('close');
}
};
/**
* show alert
*
* @param {String} msgCode
*/
COMMON.displayAlert = function (msgCode, title) {
$('#alertMsg').html(COMMON.getMsg(msgCode));
$('.alert-overlay').removeClass('d-none');
$('.alert-area').removeClass('d-none');
const positionY = $(document).scrollTop() + screen.height / 8;
const height = screen.height / 4;
$('.alert-overlay').css('height', screen.height);
$('.alert-area').css('top', positionY);
$('.alert-area').css('min-height', height);
$('body').css('overflow', 'hidden');
};
/**
* close alert
*/
COMMON.alertClose = function () {
$('.alert-overlay').addClass('d-none');
$('.alert-area').addClass('d-none');
$('body').css('overflow', 'visible');
};
/**
* go Url page With Current Params
*
* ios will remove all web types data when reopen webview
* need add common parameters: app, lang, debug, mobile_flg, isChat, ...
*
* @param {String} url
* @param {Object} params
*/
COMMON.goUrlWithCurrentParams = function (url, params) {
if (!params) {
location.href = CONSTANT.URL.BASE_WEB + url;
}
const mixParams = Object.assign(COMMON.getUrlParameter(), params);
if (url.includes('?')) {
location.href = url + '&' + new URLSearchParams(mixParams);
} else {
location.href = url + '?' + new URLSearchParams(mixParams);
}
};
/**
* get url parameter
*
*/
COMMON.getUrlParameter = function () {
var ret = {};
if (location.search) {
var param = {};
location.search
.substring(1)
.split('&')
.forEach(function (val) {
var kv = val.split('=');
param[kv[0]] = kv[1];
});
ret = param;
}
console.log({ ret: ret });
return ret;
};
/**
* get sid in local Storage
*
* @returns sid
*/
COMMON.getSid = function () {
return ClientData.userInfo_sid();
};
/**
* cms communication
*
* @param {String} url
* @param {Json} param
* @param {boolean} async
* @param {Object} callback
* @param {Object} errorCallback
*/
COMMON.cmsAjax = function (url, param, async = true, callback, errorCallback) {
var sysSettings = new COMMON.sysSetting();
if (url) {
$.ajax({
type: 'post',
url: url,
data: param,
dataType: 'json',
cache: false,
async: async,
crossDomain: true,
beforeSend: function (xhr) {
xhr.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
},
success: function (result) {
if (result.httpStatus == '200') {
if (callback) callback(result);
} else if (errorCallback) {
errorCallback();
} else if (result.httpStatus == '401') {
CHK_Common.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
} else if (result.httpStatus == '403') {
CHK_Common.closeLoading();
CHK_Common.displayAlert('errorOccurred');
} else {
CHK_Common.closeLoading();
CHK_Common.displayAlert(result.message);
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
console.log('kdh check XMLHttpRequest = ' + XMLHttpRequest);
console.log('kdh check textStatus = ' + textStatus);
console.log('kdh check errorThrown = ' + errorThrown);
if (errorCallback) {
errorCallback();
} else {
COMMON.closeLoading();
COMMON.displayAlert('errorCommunicationFailed');
}
},
});
} else {
if (errorCallback) {
errorCallback();
} else {
COMMON.closeLoading();
COMMON.displayAlert('errorOccurred');
}
}
};
/**
* Communicate with cms and post
*
* @param {String} url
* @param {Object} params
* @param {String} method
*/
COMMON.postCommunication = function (url, params, method = 'post') {
const form = document.createElement('form');
form.method = method;
form.action = url;
for (const key in params) {
if (params.hasOwnProperty(key)) {
const hiddenField = document.createElement('input');
hiddenField.type = 'hidden';
hiddenField.name = key;
hiddenField.value = params[key];
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
};
/**
* Check if user is logged in
*
* @param {boolean} async
*/
COMMON.checkAuth = function (async = true) {
let params = {};
params.sid = COMMON.getSid;
var urlPath = ClientData.userInfo_accountPath();
const url = CONSTANT.URL.BASE_CMS + urlPath + CONSTANT.URL.BASE_CHECKAPI + CONSTANT.URL.AUTH_SESSION;
COMMON.cmsAjax(url, params, async, null, function () {
COMMON.goUrlWithCurrentParams(CONSTANT.PAGE_NAME.LOGIN);
});
};
var ClientData = {
// Local :ユーザ情報(userInfo)_アカウントパス:String
userInfo_accountPath: function (data) {
if (arguments.length > 0) {
COMMON.userSetting().set(CONSTANT.KEYS.userInfo_accountPath, data);
} else {
return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_accountPath);
}
},
// Local :ユーザ情報(userInfo)_ログインID:String
userInfo_loginId: function (data) {
if (arguments.length > 0) {
COMMON.userSetting().set(CONSTANT.KEYS.userInfo_loginId, data);
} else {
return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_loginId);
}
},
// Local :ユーザ情報(userInfo)_アカウント情報記憶フラグ:Char(Y:可能, N:不可)
userInfo_rememberLogin: function (data) {
if (arguments.length > 0) {
COMMON.userSetting().set(CONSTANT.KEYS.userInfo_rememberLogin, data);
} else {
return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_rememberLogin);
}
},
// Session :ユーザ情報(userInfo)_ログインID:String
userInfo_loginId_session: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.userInfo_loginId, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.userInfo_loginId);
}
},
// Session :ユーザ情報(userInfo)_アカウントパス:String
userInfo_accountPath_session: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.userInfo_accountPath, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.userInfo_accountPath);
}
},
// Session
userInfo_userName: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.userInfo_userName, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.userInfo_userName);
}
},
// Local :ユーザ情報(userInfo)_最終ログイン日時:Datetime
userInfo_lastLoginTime: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, CONSTANT.KEYS.userInfo_lastLoginTime, undefined);
} else {
return COMMON.operateData(arguments, CONSTANT.KEYS.userInfo_lastLoginTime, undefined);
}
},
// Session:ユーザ情報(userInfo)_セッションID:String
userInfo_sid: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.userInfo_sid, data);
// COMMON.userSetting().set(CONSTANT.KEYS.userInfo_sid, data);
} else {
// return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_sid);
if (COMMON.userSession()) {
return SessionStorageUtils.get(CONSTANT.KEYS.userInfo_sid);
}
return null;
}
},
// Local: ユーザ情報(userInfo)_セッションID:String
userInfo_sid_local: function (data) {
if (arguments.length > 0) {
COMMON.userSetting().set(CONSTANT.KEYS.userInfo_sid, data);
} else {
return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_sid);
}
},
// Local: セッションIDのバックアップ
userInfo_sid_local_bak: function (data) {
if (arguments.length > 0) {
COMMON.userSetting().set(CONSTANT.KEYS.userInfo_sid_bak, data);
} else {
return COMMON.userSetting().get(CONSTANT.KEYS.userInfo_sid_bak);
}
},
// Session :通知情報(pushInfo)_新着件数:Interger
pushInfo_newMsgNumber: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.pushInfo_newMsgNumber, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.pushInfo_newMsgNumber);
}
},
conf_apiUrl: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.conf_apiUrl, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.conf_apiUrl);
}
},
conf_apiLoginUrl: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.conf_apiLoginUrl, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.conf_apiLoginUrl);
}
},
conf_apiResourceDlUrl: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.conf_apiResourceDlUrl, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.conf_apiResourceDlUrl);
}
},
// Local :ユーザ情報(userInfo)_パスワードスキップ日時:Datetime
userInfo_pwdSkipDt: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, CONSTANT.KEYS.userInfo_pwdSkipDt, undefined);
} else {
return COMMON.operateData(arguments, CONSTANT.KEYS.userInfo_pwdSkipDt, undefined);
}
},
// Session :事業者オプション(serviceOpt)_ABookCheck:Char(Y:有効, N:無効)
serviceOpt_abook_check: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.serviceOpt_abook_check, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.serviceOpt_abook_check);
}
},
// Session :事業者オプション(serviceOpt)_初回ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
serviceOpt_force_pw_change_on_login: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.serviceOpt_force_pw_change_on_login, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.serviceOpt_force_pw_change_on_login);
}
},
// Session :事業者オプション(serviceOpt)_定期ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
serviceOpt_force_pw_change_periodically: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.serviceOpt_force_pw_change_periodically, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.serviceOpt_force_pw_change_periodically);
}
},
// Session :事業者オプション(serviceOpt)_任意のプッシュメッセージ:Char(Y:可能, N:不可)
serviceOpt_usable_push_message: function (data) {
if (arguments.length > 0) {
SessionStorageUtils.set(CONSTANT.KEYS.serviceOpt_usable_push_message, data);
} else {
return SessionStorageUtils.get(CONSTANT.KEYS.serviceOpt_usable_push_message);
}
},
// Local
JumpQueue: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, CONSTANT.KEYS.JumpQueue, []);
} else {
return COMMON.operateData(arguments, CONSTANT.KEYS.JumpQueue, []);
}
},
// Local
IsJumpBack: function (data) {
if (arguments.length > 0) {
COMMON.operateData(arguments, CONSTANT.KEYS.IsJumpBack, undefined);
} else {
return COMMON.operateData(arguments, CONSTANT.KEYS.IsJumpBack, undefined);
}
},
};
/*
* Variables
*/
COMMON.userSessionObj = null;
COMMON.userSettingObj = null;
COMMON.sysSettingObj = null;
/*
* 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);
}
};
/* 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) {
COMMON.sysSettingObj = 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);
},
});
// ロード時に一旦エラー状態をクリアしておく
COMMON.clearError();
//#31919 【調査】商談支援システム GoogleChromeでビッチイン・アウトが効かない
navigator.pointerEnabled = navigator.maxTouchPoints > 0; // Edge 17 touch support workaround
document.documentElement.ontouchstart = navigator.maxTouchPoints > 0 ? function () {} : undefined; // Chrome 70 touch support workaround
});
// Hide the locking layout
COMMON.unlockLayout = function () {
$('#avw-sys-modal').hide();
};
// Show the locking layout
COMMON.lockLayout = function () {
if (document.getElementById('avw-sys-modal')) {
$('#avw-sys-modal').show();
} else {
var tags = '<div id="avw-sys-modal"></div>';
$('body').prepend(tags);
$('#avw-sys-modal').css({
opacity: 0.7,
position: 'fixed',
top: '0',
left: '0',
width: $(window).width(),
height: $(window).height(),
background: '#999',
'z-index': 100,
});
// resize error page
$(window).resize(function () {
$('#avw-sys-modal').css({
width: $(window).width(),
height: $(window).height(),
});
});
}
};
/* show system error message */
COMMON.showSystemError = function (textId) {
if (COMMON.hasError()) {
// すでにエラー状態であればエラーを表示しない
return;
} else {
// エラー状態にセット
COMMON.setErrorState();
}
if (!textId) {
textId = 'sysErrorCallApi01';
}
// create DOM element for showing error message
var errMes = I18N.i18nText(textId);
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,
close: function () {
if (!HEADER.webLogoutEvent()) {
//ログアウト出来なかった
SessionStorageUtils.clear();
//カスタムURI起動対応のため sidのバックアップは消さない
COMMON.userSetting().remove(CONSTANT.KEYS.userInfo_sid);
COMMON.avwScreenMove(CONSTANT.PAGE_NAME.LOGIN);
}
},
});
/*
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errMes,
close: function() { isShowErrorMessage = false; }
});
*/
};
/* エラー状態をクリア */
COMMON.clearError = function () {
var session = window.sessionStorage;
if (session) {
session.setItem(COMMON.hasErrorKey, false);
}
};
/* エラー状態を取得 */
COMMON.hasError = function () {
var session = window.sessionStorage;
var isError = false;
if (session) {
isError = session.getItem(COMMON.hasErrorKey);
}
return isError == 'true';
};
/* エラー状態にセット */
COMMON.setErrorState = function () {
var session = window.sessionStorage;
if (session) {
session.setItem(COMMON.hasErrorKey, true);
}
};
///* get user environment object */
//function avwUserEnv() {
// if(COMMON.avwUserEnvObj == null) {
// COMMON.avwUserEnvObj = new UserEnvironment();
// }
// return COMMON.avwUserEnvObj;
//};
/* get user session object */
COMMON.userSession = function () {
if (!COMMON.userSessionObj) {
var obj = new UserSession();
obj.init('restore');
if (obj.available) {
COMMON.userSessionObj = obj;
return COMMON.userSessionObj;
} else {
return null;
}
}
return COMMON.userSessionObj;
};
/* create user session object */
COMMON.createUserSession = function () {
if (COMMON.userSessionObj) {
COMMON.userSessionObj.destroy();
} else {
COMMON.userSessionObj = new UserSession();
COMMON.userSessionObj.init();
}
return COMMON.userSessionObj;
};
/* get user setting object */
COMMON.userSetting = function () {
if (COMMON.userSettingObj == null) {
COMMON.userSettingObj = new UserSetting();
}
return COMMON.userSettingObj;
};
/* get system setting object */
COMMON.sysSetting = function () {
return COMMON.sysSettingObj;
};
/*
* Operations for session storage [start]
*/
var SessionStorageUtils = {
login: function () {
if (COMMON.userSession()) {
// Skip this case
} else {
COMMON.avwCreateUserSession();
}
},
get: function (strKey) {
return COMMON.userSession().get(strKey);
},
set: function (strKey, objValue) {
COMMON.userSession().set(strKey, objValue);
},
clear: function () {
if (COMMON.userSession()) {
COMMON.userSession().destroy();
}
},
remove: function (strKey) {
COMMON.userSession().set(strKey, null);
},
};
/*
* Operations for local storage
*/
var LocalStorageUtils = {
getUniqueId: function () {
var uniqueId = '';
if (COMMON.userSetting().get(CONSTANT.KEYS.userInfo_accountPath)) {
uniqueId += COMMON.userSetting().get(CONSTANT.KEYS.userInfo_accountPath);
}
if (COMMON.userSetting().get(CONSTANT.KEYS.userInfo_loginId)) {
uniqueId += '.' + COMMON.userSetting().get(CONSTANT.KEYS.userInfo_loginId);
}
if (uniqueId != '') {
uniqueId += '.';
}
return uniqueId;
},
get: function (strKey) {
var key = this.getUniqueId() + strKey;
return COMMON.userSetting().get(key);
},
set: function (strKey, objValue) {
var key = this.getUniqueId() + strKey;
COMMON.userSetting().set(key, objValue);
},
remove: function (strKey) {
var key = this.getUniqueId() + strKey;
COMMON.userSetting().remove(key);
SessionStorageUtils.remove(strKey);
},
clear: function () {
var localStorageKeys = COMMON.userSetting().keys();
for (var nIndex = 0; nIndex < localStorageKeys.length; nIndex++) {
var strKey = localStorageKeys[nIndex];
if ((strKey + '').contains(this.getUniqueId())) {
COMMON.userSetting().remove(strKey);
}
}
},
existKey: function (strKey) {
var keys = COMMON.userSetting().keys();
var findKey = this.getUniqueId() + strKey;
var isExisted = false;
if (keys != null && keys != undefined) {
for (var nIndex = 0; nIndex < keys.length; nIndex++) {
if (keys[nIndex] == findKey) {
isExisted = true;
break;
}
}
}
return isExisted;
},
};
/* String.format function def. */
COMMON.format = function (fmt) {
for (var i = 1; i < arguments.length; i++) {
var reg = new RegExp('\\{' + (i - 1) + '\\}', 'g');
fmt = fmt.replace(reg, arguments[i]);
}
return fmt;
};
// Get param url
COMMON.getUrlParam = function (name, url) {
if (!url) {
url = window.location.href;
}
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regexS = '[\\?&]' + name + '=([^&#]*)';
var regex = new RegExp(regexS);
var results = regex.exec(url);
if (results == null) {
return '';
} else {
// alert("results[0]:" + results[0]);
// alert("results[1]:" + results[1]);
return results[1];
}
};
COMMON.ToogleLogoutNortice = function () {
window.onbeforeunload = function (event) {
var message = I18N.i18nText('sysInfoWithoutLogout');
var e = event || window.event;
if (e) {
e.returnValue = message;
}
return message;
};
};
/*
* Get data from localstorage and sessionstorage synchronization If has any
* param (args.length > 0) -> setter If has not param (args.length = 0) ->
* getter . Get from session: + if it existed and key existed in localstorage ->
* return result + else: set value from local to sessionstorage -> return value
* of sessionstorage if value is not empty, otherwise, return default result.
*
*/
COMMON.operateData = function (args, strKey, returnDefaultData) {
if (args.length > 0) {
var data = args[0];
LocalStorageUtils.set(strKey, data);
SessionStorageUtils.set(strKey, JSON.stringify(data));
} else {
if (
SessionStorageUtils.get(strKey) != 'undefined' &&
SessionStorageUtils.get(strKey) != undefined &&
SessionStorageUtils.get(strKey) != '' &&
SessionStorageUtils.get(strKey) != null &&
SessionStorageUtils.get(strKey) != 'null'
) {
if (LocalStorageUtils.existKey(strKey) == true) {
return JSON.parse(SessionStorageUtils.get(strKey));
} else {
return returnDefaultData;
}
} else {
if (LocalStorageUtils.existKey(strKey) == true) {
SessionStorageUtils.set(strKey, JSON.stringify(LocalStorageUtils.get(strKey)));
return JSON.parse(SessionStorageUtils.get(strKey));
}
return returnDefaultData;
}
}
};
/*
* Operations for session storage [ end ]
*/
// =============================================================================================
// Utils for string, date, number [start]
// =============================================================================================
/*
* Convert date to JP format date time [start]
*/
/*
* YYYY/MM/DD HH:MM:SS
*/
Date.prototype.jpDateTimeString = function () {
var strResult = '';
var strYear = this.getFullYear() + '';
var strMonth = this.getMonth() + 1 + '';
var strDayInMonth = this.getDate() + '';
var strHour = this.getHours() + '';
var strMinute = this.getMinutes() + '';
var strSecond = this.getSeconds() + '';
strResult += strYear.padLeft('0', 4) + '/' + strMonth.padLeft('0', 2) + '/' + strDayInMonth.padLeft('0', 2);
strResult += ' ' + strHour.padLeft('0', 2) + ':' + strMinute.padLeft('0', 2) + ':' + strSecond.padLeft('0', 2);
return strResult;
};
/*
* YYYY-MM-DD HH:MM:SS
*/
Date.prototype.jpDateTimeString1 = function () {
var strResult = '';
var strYear = this.getFullYear() + '';
var strMonth = this.getMonth() + 1 + '';
var strDayInMonth = this.getDate() + '';
var strHour = this.getHours() + '';
var strMinute = this.getMinutes() + '';
var strSecond = this.getSeconds() + '';
strResult += strYear.padLeft('0', 4) + '-' + strMonth.padLeft('0', 2) + '-' + strDayInMonth.padLeft('0', 2);
strResult += ' ' + strHour.padLeft('0', 2) + ':' + strMinute.padLeft('0', 2) + ':' + strSecond.padLeft('0', 2);
return strResult;
};
/*
* yyyy/MM/dd
*/
Date.prototype.jpDateString = function () {
var strResult = '';
var strYear = this.getFullYear() + '';
var strMonth = this.getMonth() + 1 + '';
var strDayInMonth = this.getDate() + '';
strResult += strYear.padLeft('0', 4) + '/' + strMonth.padLeft('0', 2) + '/' + strDayInMonth.padLeft('0', 2);
return strResult;
};
/*
* HH:mm:ss
*/
Date.prototype.jpTimeString = function () {
var strResult = '';
var strHour = this.getHours() + '';
var strMinute = this.getMinutes() + '';
var strSecond = this.getSeconds() + '';
strResult += ' ' + strHour.padLeft('0', 2) + ':' + strMinute.padLeft('0', 2) + ':' + strSecond.padLeft('0', 2);
return strResult;
};
/*
* HH:mm
*/
Date.prototype.jpShortTimeString = function () {
var strResult = '';
var strHour = this.getHours() + '';
var strMinute = this.getMinutes() + '';
var strSecond = this.getSeconds() + '';
strResult += ' ' + strHour.padLeft('0', 2) + ':' + strMinute.padLeft('0', 2);
return strResult;
};
/*
* yyyyMMddHHmmss
*/
Date.prototype.toIdString = function () {
var strResult = '';
var strYear = this.getFullYear() + '';
var strMonth = this.getMonth() + 1 + '';
var strDayInMonth = this.getDate() + '';
var strHour = this.getHours() + '';
var strMinute = this.getMinutes() + '';
var strSecond = this.getSeconds() + '';
var strMilisecond = this.getMilliseconds() + '';
strResult += strYear.padLeft('0', 4) + strMonth.padLeft('0', 2) + strDayInMonth.padLeft('0', 2);
strResult += strHour.padLeft('0', 2) + strMinute.padLeft('0', 2) + strSecond.padLeft('0', 2) + strMilisecond.padLeft('0', 3);
return strResult;
};
// Subtract date to get days
Date.prototype.subtractByDays = function (targetDate) {
var milis = Math.abs(this - targetDate);
var days = Math.floor(milis / (60 * 60 * 24 * 1000));
return days;
};
Date.prototype.addSeconds = function (plusSeconds) {
var newDate = new Date(this.getTime() + plusSeconds * 1000);
return newDate;
};
// Subtract date to get days
Date.prototype.subtractBySeconds = function (targetDate) {
var milis = Math.abs(this - targetDate);
var days = Math.floor(milis / 1000);
return days;
};
/*
* Convert date to JP format date time [ end ]
*/
// trimming space from both side of the string
String.prototype.trim = function () {
return this.replace(/^\s+|\s+$/g, '');
};
// trimming space from left side of the string
String.prototype.trimLeft = function () {
return this.replace(/^\s+/, '');
};
// trimming space from right side of the string
String.prototype.trimRight = function () {
return this.replace(/\s+$/, '');
};
// String: pads left
String.prototype.padLeft = function (padString, length) {
var str = this;
while (str.length < length) str = padString + str;
return str;
};
// String: pads right
String.prototype.padRight = function (padString, length) {
var str = this;
while (str.length < length) str = str + padString;
return str;
};
// Check contain string
String.prototype.contains = function (string) {
if (this.indexOf(string) != -1) {
return true;
}
return false;
};
// Number: pads left
Number.prototype.padLeft = function (padString, length) {
var str = this + '';
return str.padLeft(padString, length);
};
// Number: pads right
Number.prototype.padRight = function (padString, length) {
var str = this + '';
return str.padRight(padString, length);
};
// Clear data of array
Array.prototype.clear = function () {
this.splice(0, this.length);
};
/* CMS API Call */
COMMON.callCmsApi = function (url, accountPath, apiName, type, params, async, success, error) {
// アプリケーション設定取得
var sysSettings = COMMON.sysSetting();
// url 構築
var apiUrl;
if (!url) {
apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
} else {
apiUrl = url;
}
if (accountPath) {
apiUrl = COMMON.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 {
if (xmlHttpRequest.status == 403) {
COMMON.showSystemError('sysErrorCallApi02');
} else {
COMMON.showSystemError();
}
}
},
});
};
......@@ -18,7 +18,7 @@ CONSTANT.PAGE_NAME = {
OPERATION_LIST: 'operationList',
FOOTER: 'main-footer.html',
DEFAULT: 'index.html',
LOGIN: 'login.html',
LOGIN: './login.html',
};
CONSTANT.PAGE_TAB = {
......@@ -61,6 +61,43 @@ CONSTANT.LANG = {
ENGLISH: 'en',
};
CONSTANT.KEYS = {
userInfo_loginId: 'loginId',
// Local :ユーザ情報(userInfo)_アカウントパス:String
userInfo_accountPath: 'accountPath',
// Local :ユーザ情報(userInfo)_アカウント情報記憶フラグ:Char(Y:可能, N:不可)
userInfo_rememberLogin: 'rememberLogin',
// Local :ユーザ情報(userInfo)_最終ログイン日時:Datetime
userInfo_lastLoginTime: 'lastLoginTime',
// Local :ユーザ情報(userInfo)_パスワードスキップ日時:Datetime
userInfo_pwdSkipDt: 'pwdSkipDt',
// Local :ユーザオプション(userOpt)_動画繰り返しフラグ:Interger(0: 繰り返しなし, 1: 繰り返しあり)
// Session/local:ユーザ情報(userInfo)_セッションID:String
userInfo_sid: 'sid',
userInfo_sid_preview: 'sidPreview',
// Session :事業者オプション(serviceOpt)_初回ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
serviceOpt_force_pw_change_on_login: 'force_pw_change_on_login',
// Session :事業者オプション(serviceOpt)_定期ログイン時パスワード強制変更:Integer(0:なし, 1:催促, 2:強制)
serviceOpt_force_pw_change_periodically: 'force_pw_change_periodically',
// Session:事業者オプション(serviceOpt)_メモ・マーキングデータバックアップ使用:Char(Y:可能, N:不可)
userInfo_userName: 'userInfo_userName',
// Local:セッションID:String
userInfo_sid_bak: 'sid_bak',
// Session :通知情報(pushInfo)_新着件数:Interger
pushInfo_newMsgNumber: 'pushInfo_newMsgNumber',
conf_apiUrl: 'conf_apiUrl',
conf_apiLoginUrl: 'conf_apiLoginUrl',
conf_apiResourceDlUrl: 'conf_apiResourceDlUrl',
// Session :ABookCheck:Char(Y:有効, N:無効)
serviceOpt_abook_check: 'abook_check',
// Session :事業者オプション(serviceOpt)_任意のプッシュメッセージ:Char(Y:可能, N:不可)
serviceOpt_usable_push_message: 'usable_push_message',
// Local
IsJumpBack: 'IsJumpBack',
// Local:
JumpQueue: 'JumpQueue',
};
CONSTANT.MSG_MAP = {
all: { ja: '全て', ko: '전체', en: 'All' },
dateError: { ja: '開始日は終了日の前に設定してください。', ko: '잘못된 검색일입니다.', en: 'Please enter correct search date.' },
......
/**
* Common js for footer.
* ※Code is written mainly for dashboard and operationList.
*
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var FOOTER = {};
/**
* Change specific footer bottom to active.
*
* @param {String} bottomNavId
*/
FOOTER.activeBottomNav = function (bottomNavId) {
let elm = $('#' + bottomNavId);
if (typeof elm !== 'object') {
console.log('FOOTER.activeBottomNav:elm !== object:' + bottomNavId);
return;
}
elm.removeClass('text-secondary');
elm.addClass('text-primary');
let img = elm.find('img')[0];
if (img && img.getAttribute('data-src')) {
img.src = img.getAttribute('data-src');
}
};
/**
* change inactive all footer bottom
*/
FOOTER.inactiveAllBottomNav = function () {
let navs = document.getElementsByClassName('bottom-nav');
for (i = 0; i < navs.length; i++) {
navs[i].className = navs[i].className.replace('text-primary', 'text-secondary');
let img = navs[i].querySelector('img');
if (img && img.getAttribute('data-inactive-src')) {
img.src = img.getAttribute('data-inactive-src');
}
}
};
/**
* Go page of index.html.
* Store tab id in session for want to show display.
*
* @param {String} tabId
*/
FOOTER.goIndexPage = function (tabId) {
sessionStorage.activeTab = tabId;
COMMON.goUrlWithCurrentParams(DAFAULT_PAGE);
};
/**
* is the url index.html?
*/
FOOTER.isIndexPage = function () {
if (typeof location === 'object' && typeof location.pathname === 'string') {
if (location.pathname.includes(CONSTANT.PAGE_NAME.DEFAULT) == true) {
return true;
}
}
return false;
};
/**
* Initialize with any navigation
*
* @param {String} bottomNav
*/
FOOTER.activeInitBottomNav = function (bottomNav) {
FOOTER.inactiveAllBottomNav();
FOOTER.activeBottomNav(bottomNav);
};
/**
* Go page of dashboard
*/
FOOTER.goDashboard = function () {
sessionStorage.activeTab = CONSTANT.PAGE_TAB.DASHBOARD;
FOOTER.activeInitBottomNav('dashboardBottomNav');
if (FOOTER.isIndexPage()) {
TOP.showPage(CONSTANT.PAGE_NAME.DASHBOARD);
return;
}
FOOTER.goIndexPage(CONSTANT.PAGE_NAME.DASHBOARD);
};
/**
* Go page of operationList
*/
FOOTER.goOperationList = function () {
sessionStorage.activeTab = CONSTANT.PAGE_TAB.OPERATION_LIST;
FOOTER.activeInitBottomNav('operationListBottomNav');
if (FOOTER.isIndexPage()) {
TOP.showPage(CONSTANT.PAGE_NAME.OPERATION_LIST);
return;
}
FOOTER.goIndexPage(CONSTANT.PAGE_NAME.OPERATION_LIST);
};
/**
* Go to active tab when footer was loaded.
* If it is no active tab, go to page in settings.
*/
FOOTER.initFooter = function () {
$('#footer').load(CONSTANT.PAGE_NAME.FOOTER, function () {
if (typeof sessionStorage != 'undefined' && typeof sessionStorage.activeTab != 'undefined') {
if (sessionStorage.activeTab == CONSTANT.PAGE_TAB.DASHBOARD) {
FOOTER.goDashboard();
} else {
FOOTER.goOperationList();
}
return;
}
FOOTER.goOperationList();
// CHK.loadDashboardSetting(function() {
// if (CHK.dashboardSetting.dashboardHome) {
// FOOTER.goDashboard();
// } else {
// FOOTER.goOperationList();
// }
// });
});
};
/*
* String utilities [ end ]
*/
// =============================================================================================
// Utils for string, date, number [ end ]
// =============================================================================================
var ValidationUtil = {
// 必須: Text
CheckRequiredForText : function(value) {
if (value == null || value == '') {
return false;
}
return true;
},
// get byte count
GetByteCount : function(value) {
var escapedStr = encodeURI(value);
if (escapedStr.indexOf("%") != -1) {
var count = escapedStr.split("%").length - 1;
if (count == 0)
count++; // perverse case; can't happen with real UTF-8
var tmp = escapedStr.length - (count * 3);
count = count + tmp;
} else {
count = escapedStr.length;
}
return count;
},
// 最小文字数
CheckMinLengthForByte : function(value, len) {
if (this.GetByteCount(value) < len)
return false;
return true;
},
// 最大文字数
CheckMaxLengthForByte : function(value, len) {
if (this.GetByteCount(value) > len)
return false;
return true;
},
// 半数字
IsNumber : function(value) {
var reg = new RegExp("^[0-9]+$");
return reg.test(value);
},
// 半英字
IsAlphabet : function(value) {
var reg = new RegExp("^[a-zA-Z]+$");
return reg.test(value);
},
// 半記号
IsSymbol : function(value) {
var reg = new RegExp(
"\u005b\u005e\u0027\u0060\u0027\u007e\u0027\u0021\u0027\u0040\u0027\u0023\u0027\u0024\u0027\u0025\u0027\u005e\u0027\u0026\u0027\u002a\u0027\u0028\u0027\u0029\u0027\u005f\u0027\u002b\u0027\u003d\u0027\u007b\u0027\u007d\u0027\u007c\u0027\u003a\u0027\u0022\u0027\u003b\u0027\u0027\u0027\u003c\u0027\u003e\u0027\u003f\u0027\u002f\u0027\u002e\u0027\u002c\u005c\u002d\u005b\u005c\u005d\u005c\u005c\u005d");
return !reg.test(value);
},
// メール
CheckEmailValid : function(value) {
// Check if string is a valid email address
var reg = new RegExp("^[0-9a-zA-Z]+@[0-9a-zA-Z]+[\\.]{1}[0-9a-zA-Z]+[\\.]?[0-9a-zA-Z]+$");
return reg.test(value);
},
// Password
CheckPasswordValid : function(value) {
// Check if string is a valid email address
var reg = new RegExp("^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[#+-\\./:_]).{1,47}$");
return reg.test(value);
},
// Alphabet + Nunber + Symbol
IsAlphabetOrNumberOrSymbol : function(value) {
// Check if string is alphabet or number or symbol
var reg = new RegExp(
"\u005b\u005e\u0061\u002d\u007a\u0041\u002d\u005a\u0030\u002d\u0039\u0027\u0060\u0027\u007e\u0027\u0021\u0027\u0040\u0027\u0023\u0027\u0024\u0027\u0025\u0027\u005e\u0027\u0026\u0027\u002a\u0027\u0028\u0027\u0029\u0027\u005f\u0027\u002b\u0027\u003d\u0027\u007b\u0027\u007d\u0027\u007c\u0027\u003a\u0027\u0022\u0027\u003b\u0027\u0027\u0027\u003c\u0027\u003e\u0027\u003f\u0027\u002f\u0027\u002e\u0027\u002c\u005c\u002d\u005b\u005c\u005d\u005c\u005c\u005d");
return !reg.test(value);
},
// Get the total of types in array
CheckNumberOfTypeInString : function(value) {
var list = new Array();
var c;
for ( var i = 0; i < value.length; i++) {
c = value[i];
for ( var j = i + 1; j < value.length; j++) {
if (value[j] == c) {
value = value.slice(0, j) + value.slice(j + 1, value.len);
j = j - 1;
}
}
list[i] = c;
}
var count = list.length;
return count
},
// Special character: *
IsCharacterSpecial : function(value) {
for ( var i = 0; i < value.length; i++) {
if (value[i] == '*')
return true;
}
return false;
},
// 半記号
IsPasswordSymbol : function(value) {
var reg = new RegExp("\u005b\u005e\u0027\u0023\u0027\u002b\u005c\u002d\u0027\u002e\u0027\u002f\u0027\u003a\u0027\u005f\u005d");
return !reg.test(value);
},
// 半記号
IsPasswordAlphabetOrNumerOrSymbol : function(value) {
var reg = new RegExp("\u005b\u005e\u0061\u002d\u007a\u0041\u002d\u005a\u0030\u002d\u0039\u0027\u0023\u0027\u002b\u005c\u002d\u0027\u002e\u0027\u002f\u0027\u003a\u0027\u005f\u005d");
return !reg.test(value);
},
HasSeqChar : function(value, num) {
var count = 0;
var prev = 0;
for (var i = 0; i < str.length(); i++) {
var c = str.charAt(i);
if (i > 0 && prev == c) {
count++;
if (count == num - 1) {
return true;
}
}
else {
count = 0;
}
prev = c;
}
return false;
},
ContainSameSeqChar : function(str1, str2, num) {
if (str2.length < num || str1.length < num) {
return false;
}
for (var i = 0; i <= str2.length - num; i++) {
var target = str2.substring(i, i + num);
if (str1.contains(target)) {
return true;
}
}
return false;
}
};
\ No newline at end of file
/**
* ABook Viewer for WEB
* Common Library
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
//グローバルの名前空間用のオブジェクトを用意する
var AVWEB = {};
AVWEB.hasErrorKey = 'AVW_HASERR';
/*
* 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");
};
/* iOS check */
this.isIos = function() {
if(this.os == "ipad" || this.os == "iphone"){
return true;
} else {
return false;
}
};
/* mobile check */
this.isMobile = function() {
if(this.os == "ipad" || this.os == "iphone" || this.os == "android"){
return true;
} else {
return false;
}
};
/** 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("trident") >= 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
*/
AVWEB.avwUserSessionObj = null;
AVWEB.avwUserSettingObj = null;
//AVWEB.avwUserEnvObj = null;
AVWEB.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) {
AVWEB.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);
}
});
// ロード時に一旦エラー状態をクリアしておく
AVWEB.avwClearError();
//#31919 【調査】商談支援システム GoogleChromeでビッチイン・アウトが効かない
navigator.pointerEnabled = navigator.maxTouchPoints > 0; // Edge 17 touch support workaround
document.documentElement.ontouchstart = navigator.maxTouchPoints > 0 ? function(){} : undefined; // Chrome 70 touch support workaround
});
/* get system setting object */
AVWEB.avwSysSetting = function() {
return AVWEB.avwSysSettingObj;
};
///* get user environment object */
//function avwUserEnv() {
// if(AVWEB.avwUserEnvObj == null) {
// AVWEB.avwUserEnvObj = new UserEnvironment();
// }
// return AVWEB.avwUserEnvObj;
//};
/* get user session object */
AVWEB.avwUserSession = function() {
if(!AVWEB.avwUserSessionObj) {
var obj = new UserSession();
obj.init('restore');
if(obj.available) {
AVWEB.avwUserSessionObj = obj;
return AVWEB.avwUserSessionObj;
} else {
return null;
}
}
return AVWEB.avwUserSessionObj;
};
/* create user session object */
AVWEB.avwCreateUserSession = function() {
if(AVWEB.avwUserSessionObj) {
AVWEB.avwUserSessionObj.destroy();
} else {
AVWEB.avwUserSessionObj = new UserSession();
AVWEB.avwUserSessionObj.init();
}
return AVWEB.avwUserSessionObj;
};
/* check Login or not */
AVWEB.avwCheckLogin = function(option) {
var userSession = AVWEB.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>Authentication error</h4>Please use it after login.</p>' +
'<div><button id="avw-unauth-ok">OK</button></div>' +
'</div></div></div>';
$('body').prepend(tags);
$('#avw-auth-error').css({
'opacity': 1,
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'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 = AVWEB.avwSysSetting();
returnPage = sysSetting.loginPage;
}
/* ログイン画面に戻る */
$('#avw-unauth-ok').click(function() {
window.location = returnPage;
});
return false;
}
return true;
};
/* get user setting object */
AVWEB.avwUserSetting = function() {
if(AVWEB.avwUserSettingObj == null) {
AVWEB.avwUserSettingObj = new UserSetting();
}
return AVWEB.avwUserSettingObj;
};
/* CMS API Call(async. call) */
AVWEB.avwCmsApi = function(accountPath, apiName, type, params, success, error) {
//var sysSettings = AVWEB.avwSysSetting();
AVWEB._callCmsApi(ClientData.conf_apiUrl(), accountPath, apiName, type, params, true, success, error);
};
/* CMS API Call(sync. call) */
AVWEB.avwCmsApiSync = function(accountPath, apiName, type, params, success, error) {
//var sysSettings = AVWEB.avwSysSetting();
AVWEB._callCmsApi(ClientData.conf_apiUrl(), accountPath, apiName, type, params, false, success, error);
};
/* CMS API Call(async. call) */
AVWEB.avwCmsApiWithUrl = function(url, accountPath, apiName, type, params, success, error) {
AVWEB._callCmsApi(url, accountPath, apiName, type, params, true, success, error);
};
/* CMS API Call(sync. call) */
AVWEB.avwCmsApiSyncWithUrl = function(url, accountPath, apiName, type, params, success, error) {
AVWEB._callCmsApi(url, accountPath, apiName, type, params, false, success, error);
};
/* CMS API Call */
AVWEB._callCmsApi = function(url, accountPath, apiName, type, params, async, success, error) {
// アプリケーション設定取得
var sysSettings = AVWEB.avwSysSetting();
// url 構築
var apiUrl;
if(!url) {
apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
} else {
apiUrl = url;
}
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
apiUrl = apiUrl + '/' + apiName + '/';
//オーサリングプレビュー対応
if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
params.pid = CONTENTVIEW_GENERAL.pid;
}
//----------------------------------------------------------------------------------
// 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 {
if(xmlHttpRequest.status == 403) {
AVWEB.showSystemError('sysErrorCallApi02');
}
else {
AVWEB.showSystemError();
}
}
}
});
};
/* CMS API Call */
AVWEB._callCmsApiWhen = function(accountPath, apiName, type, params ) {
// アプリケーション設定取得
var sysSettings = AVWEB.avwSysSetting();
// url 構築
var apiUrl = ClientData.conf_apiUrl();
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
apiUrl = apiUrl + '/' + apiName + '/';
//オーサリングプレビュー対応
if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
params.pid = CONTENTVIEW_GENERAL.pid;
}
//----------------------------------------------------------------------------------
// for IE: 暫定的に対応 (これをすることでIE9でもCrossDomainリクエストが可能だがアクセスのたびに警告が出る)
$.support.cors = true;
//----------------------------------------------------------------------------------
// ajax によるAPIの実行(json)
var ajaxObj = $.ajax( {
async: true,
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);
}
});
return ajaxObj;
};
/*
* 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)
*/
AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
// API実行準備
var sysSettings = AVWEB.avwSysSetting();
var apiName = 'webContentPageImage'; // API名
//url 構築
var apiUrl;
apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath)
}
apiUrl = apiUrl + '/' + apiName + '/';
// 送信パラメータの構築
var requestParams = 'contentId=' + params.contentId + '&sid=' + params.sid + '&pageNo=' + params.pageNo;
//オーサリングプレビュー対応
if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
requestParams = requestParams + '&pid=' + CONTENTVIEW_GENERAL.pid;
}
apiUrl += '?' + requestParams + '&isBase64=true';
if( ClientData.isStreamingMode() ){
apiUrl += '&isStreaming=true';
}
// バイナリ形式で画像イメージを取得し、Base64にエンコードする
var xmlHttp;
var ie = false;
//if(window.ActiveXObject) {
// xmlHttp = new ActiveXObject('Msxml2.XMLHTTP');
// ie = true;
//} else {
//xmlHttp = new XMLHttpRequest();
//}
//IE10以降はXMLHttpRequestを優先して使う
try{
xmlHttp = new XMLHttpRequest();
}catch(e){
try{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
ie = true;
}catch(e){
AVWEB.showSystemError();
return;
}
}
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 {
AVWEB.avwLog(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' }
* ]
*/
AVWEB.avwUploadBackupFile = function(accountPath, params, async, success, error) {
/* API実行準備*/
var sysSettings = AVWEB.avwSysSetting();
var apiName = 'uploadBackupFile'; // API名
//url 構築
var apiUrl;
apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
if(accountPath) {
apiUrl = AVWEB.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', AVWEB.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 {
AVWEB.showSystemError();
}
}
});
};
/* show system error message */
AVWEB.showSystemError = function(textId) {
if(AVWEB.avwHasError()) {
// すでにエラー状態であればエラーを表示しない
return;
} else {
// エラー状態にセット
AVWEB.avwSetErrorState();
}
if( !textId ){
textId = 'sysErrorCallApi01';
}
// create DOM element for showing error message
var errMes = I18N.i18nText(textId);
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,
close: function() {
if( ClientData.isStreamingMode() == false && COMMON.isAuthoringPreview() == false){
//ストリーミングでなければログアウト時と同じ後始末処理をしてログイン画面に戻す
if( !HEADER.webLogoutEvent() ){
//ログアウト出来なかった
SessionStorageUtils.clear();
//カスタムURI起動対応のため sidのバックアップは消さない
AVWEB.avwUserSetting().remove(COMMON.Keys.userInfo_sid);
//AVWEB.avwUserSetting().remove(COMMON.Keys.userInfo_sid_bak);
AVWEB.avwScreenMove(COMMON.ScreenIds.Login);
}
} else if(COMMON.isAuthoringPreview()) {
//オーサリングプレビューモードの場合は閉じる
window.open('', '_self', '');
window.close();
}
}
});
/*
$().toastmessage('showToast', {
type: 'error',
sticky: true,
text: errMes,
close: function() { isShowErrorMessage = false; }
});
*/
};
/* エラー状態を取得 */
AVWEB.avwHasError = function() {
var session = window.sessionStorage;
var isError = false;
if(session) {
isError = session.getItem(AVWEB.hasErrorKey);
}
return (isError == 'true');
};
/* エラー状態にセット */
AVWEB.avwSetErrorState = function() {
var session = window.sessionStorage;
if(session) {
session.setItem(AVWEB.hasErrorKey, true);
}
};
/* エラー状態をクリア */
AVWEB.avwClearError = function() {
var session = window.sessionStorage;
if(session) {
session.setItem(AVWEB.hasErrorKey, false);
}
};
/* ブラウザunload時に警告メッセージの出力設定を行う関数 */
AVWEB.avwSetLogoutNortice = function() {
window.onbeforeunload = function(event) {
if(ClientData.isGetitsMode() || ClientData.isCheckViewMode()){
COMMON.SetEndLog(CONTENTVIEW_GENERAL.contentID);
COMMON.RegisterLog();
} else if (ClientData.isStreamingMode() == false) {
// ストリーミング以外ではメッセージ表示
// FFでは、https://bugzilla.mozilla.org/show_bug.cgi?id=588292 によりメッセージが出力されない
var message = I18N.i18nText('sysInfoWithoutLogout');
var e = event || window.event;
if(e) {
e.returnValue = message;
}
return message;
}
};
};
/* 警告メッセージを出力しないでページ遷移を行う関数 */
AVWEB.avwScreenMove = function(url) {
window.onbeforeunload = null;
window.location = url;
};
/* Debug Log */
AVWEB.avwLog = function(msg) {
if(AVWEB.avwSysSetting().debug) {
console.log(msg);
}
};
/* get bytes of text */
AVWEB.getByte = function(text) {
var count = 0;
var n;
for(var i=0; i<text.length; i++) {
n = escape(text.charAt(i));
if (n.length < 4) {
count++;
}
else {
count+=2;
}
}
return count;
};
AVWEB.getApiUrl = function(accountPath) {
// url 構築
//var sysSettings = AVWEB.avwSysSetting();
var apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
return apiUrl;
};
/** shop配下のアクションを呼ぶURLを作成 */
AVWEB.getShopApiUrl = function(accountPath) {
// Shop url 構築
var apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
return apiUrl.substring(0, apiUrl.length - 6) + "shop";
};
/** checkapi配下のアクションを呼ぶURLを作成 */
AVWEB.getCheckApiUrl = function(accountPath) {
// checkapi url 構築
var apiUrl = ClientData.conf_apiUrl(); //sysSettings.apiUrl;
if(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
return apiUrl.substring(0, apiUrl.length - 6) + "checkapi";
};
/* get url */
AVWEB.getURL = function(apiName) {
//var sysSettings = AVWEB.avwSysSetting();
var isStreaming = "false";
if(ClientData.isStreamingMode()){
isStreaming = "true";
}
var url = ClientData.conf_apiResourceDlUrl(); //sysSettings.apiResourceDlUrl;
url = AVWEB.format(url, ClientData.userInfo_accountPath()) + '/' + apiName + '/?isStreaming=' + isStreaming;
//オーサリングプレビュー対応
if(COMMON.isAuthoringPreview() && CONTENTVIEW_GENERAL.pid != ''){
url = url + '&pid=' + CONTENTVIEW_GENERAL.pid;
}
return url;
};
/* String.format function def. */
AVWEB.format = function(fmt) {
for (var i = 1; i < arguments.length; i++) {
var reg = new RegExp("\\{" + (i - 1) + "\\}", "g");
fmt = fmt.replace(reg,arguments[i]);
}
return fmt;
};
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -16,20 +16,20 @@
<script src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/common.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/avweb.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/constant.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/check-common.js?__UPDATEID__"></script>
<!-- <script src="/abvw/common/js/web/common.js?__UPDATEID__"></script>
<script src="/abvw/common/js/web/avweb.js?__UPDATEID__"></script> -->
<script src="/abvw/common/js/constant.js?__UPDATEID__"></script>
<script src="/abvw/common/js/common.js?__UPDATEID__"></script>
<script src="/abvw/js/operationList/operationList.js?__UPDATEID__"></script>
<script src="/abvw/js/topPage/topPage.js?__UPDATEID__"></script>
<script src="/abvw/js/dashboardSetting/check-dashboard-setting.js?__UPDATEID__"></script>
<script src="/abvw/js/dashboard/check-dashboard.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/check-footer.js?__UPDATEID__"></script>
<script src="/abvw/common/js/footer.js?__UPDATEID__"></script>
<script src="/abvw/common/js/appCommon/app.js?__UPDATEID__" defer></script>
</head>
<body onload="CHK_TOP.init();" style="position: relative; margin-top: 53px;">
<body onload="TOP.init();" style="position: relative; margin-top: 53px;">
<!--作業一覧画面-->
<section id="operationList" class="page-content" style="display: none;">
......@@ -190,7 +190,7 @@
<!--アラート-->
<div class="alert-overlay d-none"></div>
<div class="alert-area d-none">
<i class="text-right fas fa-times fa-2x loading-close" onclick="CHK_Common.alertClose();"></i>
<i class="text-right fas fa-times fa-2x loading-close" onclick="COMMON.alertClose();"></i>
<div class="fs-13 mt-4 text-left" style="padding: 15px;" id="alertMsg"></div>
</div>
......
......@@ -11,28 +11,20 @@
<title></title>
<link rel="stylesheet" type="text/css" href="/abvw/common/css/web/common.css?__UPDATEID__1" />
<!-- <link rel="stylesheet" type="text/css" href="./abvw/common/css/jquery-ui.css?__UPDATEID__" /> -->
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.min.css?__UPDATEID__1" />
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.structure.min.css?__UPDATEID__1" />
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.theme.min.css?__UPDATEID__1" />
<!-- <link rel="stylesheet" type="text/css" href="./abvw/common/css/jquery.toastmessage.css?__UPDATEID__" /> -->
<link rel="stylesheet" type="text/css" href="/abvw/css/login/login.css?__UPDATEID__1" />
<link rel="stylesheet" type="text/css" href="/abvw/css/login/login_validation.css?__UPDATEID__1" />
<!-- <link rel="stylesheet" type="text/css" href="./abvw/css/layout/limit_access.css?__UPDATEID__" /> -->
<link rel="stylesheet" type="text/css" href="/abvw/common/css/web/common.css?__UPDATEID__" />
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.min.css?__UPDATEID__" />
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.structure.min.css?__UPDATEID__" />
<link rel="stylesheet" type="text/css" href="/abvw/common/css/jquery/jquery-ui.theme.min.css?__UPDATEID__" />
<link rel="stylesheet" type="text/css" href="/abvw/css/login/login.css?__UPDATEID__" />
<link rel="stylesheet" type="text/css" href="/abvw/css/login/login_validation.css?__UPDATEID__" />
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__1"></script>
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__1"></script>
<!-- <script type="text/javascript" src="./abvw/common/js/jquery-1.8.1.min.js?__UPDATEID__"></script>-->
<!-- <script type="text/javascript" src="./abvw/common/js/jquery-ui-1.8.23.custom.min.js?__UPDATEID__"></script> -->
<!-- <script type="text/javascript" src="./abvw/common/js/jquery.toastmessage.js?__UPDATEID__"></script> -->
<!-- <script type="text/javascript" src="./abvw/common/js/screenLock.js?__UPDATEID__" ></script> -->
<script type="text/javascript" src="/abvw/common/js/web/thickbox.js?__UPDATEID__1"></script>
<script type="text/javascript" src="/abvw/common/js/web/avweb.js?__UPDATEID__1"></script>
<script type="text/javascript" src="/abvw/common/js/web/i18n.js?__UPDATEID__1"></script>
<script type="text/javascript" src="/abvw/common/js/web/common.js?__UPDATEID__1"></script>
<!-- <script type="text/javascript" src="./abvw/js/Limit_Access_Content.js?__UPDATEID__"></script> -->
<script type="text/javascript" src="/abvw/js/login/login.js?__UPDATEID__1"></script>
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-3.6.0.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/jquery/jquery-ui.min.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/web/i18n.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/constant.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/validation.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/common/js/common.js?__UPDATEID__"></script>
<script type="text/javascript" src="/abvw/js/login/login.js?__UPDATEID__"></script>
<!--[if gte IE 9]>
<style type="text/css">
......
......@@ -40,7 +40,7 @@ LOGIN.saveLoginInfo = function() {
I18N.changeLanguage(lang);
// Set flag コンテンツデータチェックフラグ = true to sync local with server
ClientData.common_contentDataChkFlg(true);
// ClientData.common_contentDataChkFlg(true);
var accountPath, loginId, password;
var chkRemember = $('#chkRemember').attr('checked');
......@@ -76,9 +76,9 @@ LOGIN.saveLoginInfo = function() {
LOGIN.checkValidation = function() {
// 暗号化モードならチェック無し
if (ClientData.serviceOpt_encryption() == 'Y') {
return true;
}
// if (ClientData.serviceOpt_encryption() == 'Y') {
// return true;
// }
var accountPath = $('#txtAccPath').val();
var loginId = $('#txtAccId').val();
......@@ -171,7 +171,7 @@ LOGIN.processLogin = function() {
// Get url to login
var apiLoginUrl = ClientData.conf_apiLoginUrl(); // sysSettings.apiLoginUrl;
AVWEB.avwCmsApiWithUrl(apiLoginUrl, null, 'webClientLogin', 'GET', params, function(data) {
COMMON.callCmsApi(apiLoginUrl, null, 'webClientLogin', 'GET', params, true, function(data) {
LOGIN.userinfo_sid = data.sid;
LOGIN.userInfo_userName = data.userName;
LOGIN.optionList = data.serviceOptionList;
......@@ -186,9 +186,9 @@ LOGIN.processLogin = function() {
$('#main-error-message').css('display', 'none');
if (ClientData.serviceOpt_encryption() == 'Y') {
data.requirePasswordChange = 0;
}
// if (ClientData.serviceOpt_encryption() == 'Y') {
// data.requirePasswordChange = 0;
// }
console.log("data.requirePasswordChange:" + data.requirePasswordChange);
console.log("ClientData.serviceOpt_abook_check:" + ClientData.serviceOpt_abook_check());
......@@ -198,7 +198,7 @@ LOGIN.processLogin = function() {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
} else if (data.requirePasswordChange == 1) {
......@@ -227,7 +227,7 @@ LOGIN.processLogin = function() {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
$('#btnSkip').show();
......@@ -238,7 +238,7 @@ LOGIN.processLogin = function() {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
}
} else if (data.requirePasswordChange == 2) {
......@@ -261,7 +261,7 @@ LOGIN.processLogin = function() {
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
} else if (numDay > 30) {
LOGIN.OpenChangePasswordDialog();
......@@ -279,12 +279,12 @@ LOGIN.processLogin = function() {
} else { // No need to change password
ClientData.userInfo_sid(ClientData.userInfo_sid_local());
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
}
}
} else {
LOGIN.login_errorMessage = data.errorMessage;
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), data.errorMessage).toString());
$('#main-error-message').show();
}
......@@ -294,9 +294,9 @@ LOGIN.processLogin = function() {
if (xhr.responseText && xhr.status != 0) {
LOGIN.login_errorMessage = JSON.parse(xhr.responseText).errorMessage;
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), JSON.parse(xhr.responseText).errorMessage).toString());
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), JSON.parse(xhr.responseText).errorMessage).toString());
} else {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
}
$('#main-error-message').show();
});
......@@ -327,9 +327,9 @@ LOGIN.changePasswordProcess = function() {
if (ClientData.serviceOpt_abook_check() == 'Y') {
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
} else {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').show();
}
......@@ -343,38 +343,38 @@ LOGIN.changePasswordProcess = function() {
$('#dialog-error-message').show();
} else {
// Show systemerror
AVWEB.showSystemError();
COMMON.showSystemError();
}
});
};
// Change Language Japanese
LOGIN.changeLanguageJa = function() {
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ja);
I18N.changeLanguage(CONSTANT.LANG.JAPAN);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ja);
if (LOGIN.login_errorMessage != "") {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
}
};
// Change Language Korean
LOGIN.changeLanguageKo = function() {
I18N.changeLanguage(COMMON.Consts.ConstLanguage_Ko);
I18N.changeLanguage(CONSTANT.LANG.KOREA);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// ClientData.userInfo_language(COMMON.Consts.ConstLanguage_Ko);
if (LOGIN.login_errorMessage != "") {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
}
};
// Change Language English
LOGIN.changeLanguageEn = function() {
I18N.changeLanguage(COMMON.Consts.ConstLanguage_En);
I18N.changeLanguage(CONSTANT.LANG.ENGLISH);
document.title = I18N.i18nText('dspLogin') + ' | ' + I18N.i18nText('sysAppTitle');
// ClientData.userInfo_language(COMMON.Consts.ConstLanguage_En);
if (LOGIN.login_errorMessage != "") {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), LOGIN.login_errorMessage).toString());
}
};
......@@ -401,9 +401,9 @@ LOGIN.skipPassFunction = function() {
if (ClientData.serviceOpt_abook_check() == 'Y') {
// ホームへ移動
AVWEB.avwScreenMove("index.html");
COMMON.avwScreenMove("index.html");
} else {
$('#main-error-message').html(AVWEB.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').html(COMMON.format(I18N.i18nText('msgLoginErrWrong'), 'E001'));
$('#main-error-message').show();
}
......@@ -431,10 +431,6 @@ LOGIN.saveServiceUserOption = function() {
ClientData.serviceOpt_force_pw_change_periodically(option.value);
} else if (option.serviceOptionId == 21) {
ClientData.serviceOpt_force_pw_change_on_login(option.value);
} else if (option.serviceOptionId == 71) {
ClientData.serviceOpt_usable_readinglog_gps(option.value);
} else if (option.serviceOptionId == 72) {
ClientData.serviceOpt_usable_readinglog_object(option.value);
} else if (option.serviceOptionId == 49) {
ClientData.serviceOpt_usable_push_message(option.value);
} else if (option.serviceOptionId == 161) {
......@@ -513,7 +509,7 @@ LOGIN.showAlertScreen = function(errMes, scrMove) {
$('.toast-item-close').live('click', function() {
COMMON.unlockLayout();
if (scrMove) {
AVWEB.avwScreenMove(scrMove);
COMMON.avwScreenMove(scrMove);
}
});
};
......@@ -523,20 +519,13 @@ LOGIN.ready = function() {
// セッションストレージクリア
SessionStorageUtils.clear();
AVWEB.avwUserSessionObj = null;
COMMON.userSessionObj = null;
// create new session
AVWEB.avwCreateUserSession();
COMMON.createUserSession();
I18N.initi18n();
var sysSettings = AVWEB.avwSysSetting(); // get info in conf.json
var sysSettings = COMMON.sysSetting(); // get info in conf.json
// モード初期化
ClientData.isGetitsMode(false);
ClientData.isStreamingMode(false);
ClientData.isCheckViewMode(false);
ClientData.isCheckMode(false);
ClientData.storeUrl("");
// getitsサーバー設定確認
if (sysSettings.apiUrl == "") {
......@@ -546,10 +535,7 @@ LOGIN.ready = function() {
var storeUrl = COMMON.getUrlParam('storeUrl', '');
if (siteUrl != "" && urlPath != "") {
// getitsモード有効
ClientData.isGetitsMode(true);
ClientData.siteUrl(siteUrl);
// ClientData.siteUrl(siteUrl);
// api接続先設定
ClientData.conf_apiUrl(siteUrl + "{0}/abvapi");
ClientData.conf_apiLoginUrl(siteUrl + "nuabvapi");
......@@ -559,8 +545,6 @@ LOGIN.ready = function() {
ClientData.userInfo_accountPath_session(urlPath);
ClientData.userInfo_loginId("");
ClientData.userInfo_loginId_session("");
// ストア遷移用のURL
ClientData.storeUrl(storeUrl);
}
......
......@@ -47,7 +47,7 @@ OL.init = function () {
*/
OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, searchEndDate, operationGroupMasterId) {
let param = {};
param.sid = CHK_Common.getSid();
param.sid = COMMON.getSid();
param.operationName = searchKeyword;
param.sort = sortIndex;
param.startDate = searchStartDate;
......@@ -55,7 +55,7 @@ OL.getAllDataWeb = function (searchKeyword, sortIndex, searchStartDate, searchEn
param.operationGroupMasterId = operationGroupMasterId;
const url = CONSTANT.URL.BASE_CMS + ClientData.userInfo_accountPath() + CONSTANT.URL.BASE_CHECKAPI + CONSTANT.URL.ALL_OPERATION_LIST;
CHK_Common.cmsAjax(url, param, false, function (json) {
COMMON.cmsAjax(url, param, false, function (json) {
OL.operationList = json.operationList;
OL.operationGroupMaster = json.operationGroupMasterList;
OL.isOperationGroupMaster = json.isOperationGroupMaster;
......@@ -250,6 +250,7 @@ OL.createCategoryList = function () {
//common
const noCategory = $("<dl id='groupMasterId_0' class='group-category-list'><dt><a onclick='OL.changeOperationGroupMaster(0);'>" + CHK_Common.getMsg('all') + '</a></dt></dl>');
$('#category-menu').append(noCategory);
//create category(operationGroupMaster) structure
......@@ -341,6 +342,7 @@ OL.changeSortType = function (sortType) {
*
* @param {Number} sortNumber
*/
OL.sortOperationList = function (sortNumber) {
switch (sortNumber) {
case CONSTANT.SORT_TYPE.NAME:
......@@ -361,6 +363,7 @@ OL.sortOperationList = function (sortNumber) {
OL.operationList.sort(function (a, b) {
if (OL.setOperationDate(a.operationStartDate) > OL.setOperationDate(b.operationStartDate)) return 1;
if (OL.setOperationDate(a.operationStartDate) < OL.setOperationDate(b.operationStartDate)) return -1;
return 0;
});
break;
......@@ -392,21 +395,21 @@ OL.sortOperationList = function (sortNumber) {
* search operarionList
*/
OL.search = function () {
CHK_Common.showLoading();
COMMON.showLoading();
const searchKeyword = $('#searchTaskName').val();
const searchStartDate = $('#searchStartDate').val();
const searchEndDate = $('#searchEndDate').val();
if (searchStartDate && searchEndDate && searchStartDate > searchEndDate) {
CHK_Common.closeLoading();
CHK_Common.displayAlert('dateError');
COMMON.closeLoading();
COMMON.displayAlert('dateError');
return;
}
OL.getAllDataWeb(searchKeyword, OL.sortIndex, searchStartDate, searchEndDate, OL.operationGroupMasterId);
OL.createOperationList(OL.operationList);
OL.createCategory();
CHK_Common.closeLoading();
COMMON.closeLoading();
};
/**
......@@ -452,7 +455,7 @@ OL.resetSearch = function () {
OL.sendOperation = function (operationId, operationType, reportType) {
//save operation logs. needed for sorting
let saveParams = {};
saveParams.sid = CHK_Common.getSid();
saveParams.sid = COMMON.getSid();
saveParams.cmd = CONSTANT.ACT_CMD.saveOperationLog;
saveParams.deviceType = 4;
saveParams.operationType = operationType;
......@@ -460,13 +463,13 @@ OL.sendOperation = function (operationId, operationType, reportType) {
const date = new Date();
saveParams.viewingStartDate = date.toLocaleString();
CHK_Common.sendABookCheckApi(saveParam, false);
COMMON.sendABookCheckApi(saveParam, false);
//Transition to the report form or operation list screen
let postParams = {};
postParams.sid = CHK_Common.getSid();
postParams.sid = COMMON.getSid();
postParams.cmd = CONSTANT.ACT_CMD.goOperation;
postParams.operationId = operationId;
const url = CHK_Common.getUrlWeb(postParams.cmd);
const url = COMMON.getUrlWeb(postParams.cmd);
postCommunication(url, postParams);
};
......@@ -5,26 +5,26 @@
* @since cms:1.4.3.2&1.4.3.3 web:1.0
*/
var CHK_TOP = {};
var TOP = {};
$(document).ready(function () {
//setting lang info
CHK_Common.setLangCodeWeb();
COMMON.setLangCodeWeb();
//Check if user is logged in
CHK_Common.checkAuth(false);
COMMON.checkAuth(false);
//setting msg of html
CHK_Common.updateLang();
COMMON.updateLang();
});
/**
* show page
*/
CHK_TOP.init = function () {
CHK_Common.showLoading();
TOP.init = function () {
COMMON.showLoading();
FOOTER.initFooter(); //app should get data after initFooter
CHK_Common.closeLoading();
COMMON.closeLoading();
};
/**
......@@ -32,7 +32,7 @@ CHK_TOP.init = function () {
*
* @param {String} pageId
*/
CHK_TOP.showPage = function (pageId) {
TOP.showPage = function (pageId) {
//get data
if (pageId == CONSTANT.PAGE_NAME.OPERATION_LIST) {
OL.init();
......
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