Commit 11ca8739 by Jung Kwangkyu

#18453【DAIHATSU】閲覧ログ件数不一致

parent e23608cd
......@@ -13,12 +13,12 @@ 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");
......@@ -27,12 +27,12 @@ var UserEnvironment = function() {
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");
......@@ -49,7 +49,7 @@ var UserEnvironment = function() {
return false;
}
};
/** check operating system */
function checkOS(userAgent) {
if(userAgent.toLowerCase().indexOf("windows") >= 0) {
......@@ -71,7 +71,7 @@ var UserEnvironment = function() {
};
/** check user browser */
function checkBrowser(userAgent) {
if(userAgent.toLowerCase().indexOf("msie") >= 0) {
return "msie";
}
......@@ -90,7 +90,7 @@ var UserEnvironment = function() {
if(userAgent.toLowerCase().indexOf("opera") >= 0) {
return "opera";
}
return "unknown";
};
};
......@@ -158,7 +158,7 @@ UserSetting.prototype.show = function(elmid) {
}
tags = tags + "</p>";
$(elmid).html(tags);
}
}
};
/* ユーザ設定のキーリストを取得 */
UserSetting.prototype.keys = function() {
......@@ -188,6 +188,7 @@ UserSetting.prototype.remove = function(key) {
delete js[key];
storage.setItem(this.US_KEY, JSON.stringify(js));
}
this.userSetting = this.load();
}
}
};
......@@ -196,7 +197,7 @@ UserSetting.prototype.removeAll = function() {
var storage = window.localStorage;
if(storage) {
storage.remove(this.US_KEY);
}
}
};
/*
......@@ -207,7 +208,7 @@ var UserSession = function() {
};
/* Initialize User Session */
UserSession.prototype.init = function(option) {
this.available = false;
if(option == 'restore') {
var value = null;
......@@ -222,7 +223,7 @@ UserSession.prototype.init = function(option) {
}
} else {
this.set("init", new Date().toLocaleString());
this.available = true;
this.available = true;
}
};
/* store key, value item to user session */
......@@ -238,7 +239,7 @@ UserSession.prototype.set = function(key, value) {
} else {
storage.setItem("AVWS_" + key, value);
}
}
}
};
/* get session item value */
UserSession.prototype.get = function(key) {
......@@ -248,7 +249,7 @@ UserSession.prototype.get = function(key) {
} else {
throw new Error("Session Destroyed.");
}
return value;
return value;
};
/* get item value from session storage */
UserSession.prototype._get = function(key) {
......@@ -265,7 +266,7 @@ UserSession.prototype.destroy = function() {
if(storage) {
storage.clear();
this.available = false;
}
}
};
/* show user session object list */
UserSession.prototype.show = function(elmid) {
......@@ -279,7 +280,7 @@ UserSession.prototype.show = function(elmid) {
}
tags = tags + "</p>";
$(elmid).html(tags);
}
}
};
/*
* Variables
......@@ -291,7 +292,7 @@ AVWEB.avwSysSettingObj = null;
/* Initialize system */
$(function () {
// システム設定ファイルの配置先パスの決定
var location = window.location.toString().toLowerCase();
var sysFile = '';
......@@ -316,7 +317,7 @@ $(function () {
alert(error);
}
});
// ロード時に一旦エラー状態をクリアしておく
AVWEB.avwClearError();
});
......@@ -364,13 +365,13 @@ AVWEB.avwCheckLogin = function(option) {
/* エラー画面を表示 */
var tags = '<div id="avw-auth-error">' +
'<div style="display:table; width:100%; height:100%;">' +
'<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>' +
'<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({
$('#avw-auth-error').css({
'opacity': 1,
'position': 'fixed',
'top': '0',
......@@ -379,14 +380,14 @@ AVWEB.avwCheckLogin = function(option) {
'height': $(window).height(),
'zIndex': '10000'
});
// resize error page
// resize error page
$(window).resize(function() {
$('#avw-auth-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
});
var returnPage;
if(option) {
returnPage = option
......@@ -431,10 +432,10 @@ AVWEB.avwCmsApiSyncWithUrl = function(url, accountPath, apiName, type, params, s
/* CMS API Call */
AVWEB._callCmsApi = function(url, accountPath, apiName, type, params, async, success, error) {
// アプリケーション設定取得
var sysSettings = AVWEB.avwSysSetting();
// url 構築
var apiUrl;
if(!url) {
......@@ -446,12 +447,12 @@ AVWEB._callCmsApi = function(url, accountPath, apiName, type, params, async, suc
apiUrl = AVWEB.format(apiUrl, accountPath);
}
apiUrl = apiUrl + '/' + apiName + '/';
//----------------------------------------------------------------------------------
// for IE: 暫定的に対応 (これをすることでIE9でもCrossDomainリクエストが可能だがアクセスのたびに警告が出る)
$.support.cors = true;
//----------------------------------------------------------------------------------
// ajax によるAPIの実行(json)
$.ajax( {
async: (async) ? async : false,
......@@ -486,32 +487,32 @@ AVWEB._callCmsApi = function(url, accountPath, apiName, type, params, async, suc
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 + '/';
//----------------------------------------------------------------------------------
// for IE: 暫定的に対応 (これをすることでIE9でもCrossDomainリクエストが可能だがアクセスのたびに警告が出る)
$.support.cors = true;
//----------------------------------------------------------------------------------
// ajax によるAPIの実行(json)
var ajaxObj = $.ajax( {
async: true,
......@@ -531,9 +532,9 @@ AVWEB._callCmsApiWhen = function(accountPath, apiName, type, params ) {
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
}
});
return ajaxObj;
};
......@@ -635,18 +636,18 @@ AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
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();
......@@ -659,14 +660,14 @@ AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
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.overrideMimeType('text/plain; charset=x-user-defined');
}
*/
xmlHttp.onreadystatechange = function () {
......@@ -676,13 +677,13 @@ AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
//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);
src = ids.convImageToDataScheme(xmlHttp.responseText, ie);
}
*/
var src; // Image Data URI
......@@ -692,7 +693,7 @@ AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
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;
}
*/
src = 'data:image/png;base64,' + xmlHttp.responseText;
......@@ -728,11 +729,11 @@ AVWEB.avwGrabContentPageImage = function(accountPath, params, success, error) {
* ]
*/
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;
......@@ -740,25 +741,25 @@ AVWEB.avwUploadBackupFile = function(accountPath, params, async, success, error)
apiUrl = AVWEB.format(apiUrl, accountPath)
}
apiUrl = apiUrl + '/' + apiName + '/';
/* POST(multipart/form-data)送信準備 */
var body = '';
var boundary = '';
// boundaryを構築
var date = new Date();
boundary = '------------------------' + date.getMilliseconds()
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 += '--' + boundary + '\r\n';
body += 'Content-Disposition: form-data; name="' + item.name + '"';
if(item.fileName) {
body += '; filename="' + item.fileName + '"\r\n';
......@@ -772,7 +773,7 @@ AVWEB.avwUploadBackupFile = function(accountPath, params, async, success, error)
body += item.content + '\r\n';
}
body += '--' + boundary + '--\r\n';
// ajax によるAPIの実行(json)
$.ajax( {
async: (async) ? async : false,
......@@ -787,7 +788,7 @@ AVWEB.avwUploadBackupFile = function(accountPath, params, async, success, error)
*/
xhr.setRequestHeader('X-AGT-AppId', sysSettings.appName);
xhr.setRequestHeader('X-AGT-AppVersion', sysSettings.appVersion);
/*
* uploadBackupFileは multipart/form-data でPOST送信する
*/
......@@ -807,11 +808,11 @@ AVWEB.avwUploadBackupFile = function(accountPath, params, async, success, error)
AVWEB.showSystemError();
}
}
});
});
};
/* show system error message */
AVWEB.showSystemError = function(textId) {
if(AVWEB.avwHasError()) {
// すでにエラー状態であればエラーを表示しない
return;
......@@ -819,11 +820,11 @@ AVWEB.showSystemError = function(textId) {
// エラー状態にセット
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>';
......@@ -839,12 +840,12 @@ AVWEB.showSystemError = function(textId) {
'background': '#999',
'z-index': 90000
});
// resize error page
// resize error page
$(window).resize(function() {
$('#avw-sys-error').css( {
'width': $(window).width(),
'height': $(window).height()
});
});
});
// show error messages
$().toastmessage({ position: 'middle-center' });
......@@ -870,7 +871,7 @@ AVWEB.showSystemError = function(textId) {
sticky: true,
text: errMes,
close: function() { isShowErrorMessage = false; }
});
});
*/
};
/* エラー状態を取得 */
......@@ -900,7 +901,7 @@ AVWEB.avwClearError = function() {
AVWEB.avwSetLogoutNortice = function() {
window.onbeforeunload = function(event) {
//DHカスタム
if( ClientData.serviceOpt_daihatsu() == 'Y'){
if( "CONTENTVIEW_GENERAL" in window ){
......@@ -910,7 +911,7 @@ AVWEB.avwSetLogoutNortice = function() {
}
}
} else {
if(ClientData.isGetitsMode() || ClientData.isStreamingMode()){
if(ClientData.isGetitsMode()){
COMMON.SetEndLog(CONTENTVIEW_GENERAL.contentID);
......@@ -923,7 +924,7 @@ AVWEB.avwSetLogoutNortice = function() {
var e = event || window.event;
if(e) {
e.returnValue = message;
}
}
return message;
}
}
......@@ -934,7 +935,7 @@ AVWEB.avwScreenMove = function(url) {
window.onbeforeunload = null;
window.location = url;
};
/* Debug Log */
/* Debug Log */
AVWEB.avwLog = function(msg) {
if(AVWEB.avwSysSetting().debug) {
console.log(msg);
......@@ -966,21 +967,21 @@ AVWEB.getApiUrl = function(accountPath) {
apiUrl = AVWEB.format(apiUrl, accountPath);
}
return apiUrl;
};
/* 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;
return url;
};
......
......@@ -569,12 +569,15 @@ COMMON.operateData = function(args, strKey, returnDefaultData) {
LocalStorageUtils.set(strKey, data);
SessionStorageUtils.set(strKey, JSON.stringify(data));
} else {
console.log("getUniqueId : " + LocalStorageUtils.getUniqueId());
LocalStorageUtils.remove(strKey);
SessionStorageUtils.remove(strKey);
if (strKey == COMMON.Keys.ContentLogData) {
LocalStorageUtils.remove(strKey);
SessionStorageUtils.remove(strKey);
} else {
LocalStorageUtils.set(strKey, data);
SessionStorageUtils.set(strKey, JSON.stringify(data));
}
}
} else {
if (SessionStorageUtils.get(strKey) != 'undefined'
&& SessionStorageUtils.get(strKey) != undefined
&& SessionStorageUtils.get(strKey) != ''
......
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