var tokenId = null; function Pager() { this.initialize.apply(this, arguments); tokenId = ""; } Pager.prototype = { initialize : function() { // 現在のページID this.pageId = null; this.pageInfo = null; this.scrollTarget = null; this.dateObj = new Date(); this.htmlFile = ''; this.skipFlg = null; }, execApi : function(url, params, callback) { var self = this; params['HIDDEN_SESSION'] = ''; params['_'] = new Date().getTime(); params['TOKEN_ID'] = tokenId; $.ajax({ cache : false, type : 'POST', url : Settings.webapi_path + url, dataType : 'json', data : params, traditional: true, timeout : Settings.timeout * 1000, success : function(response) { if ("A" != response.pageInfo.elm_errorKBN) { tokenId = response.pageInfo.checkSession; } if (response.error) { // 202211 start switch (response.errorInfo[0].errorCd) { case "SKSAS050012": commonPopup.on(2,response); indicator.off(); return; case "SKSAS050014": case "SKSAS050015": case "SKSAS050019": commonPopup.on(1,response); indicator.off(); return; } // 202211 end commonError.execute(response.errorInfo, response.pageInfo.elm_errorKBN); self.pageId && self.scrollTo(); indicator.off(); return; } $('#sysTimeJa').text(response.pageInfo.elm_systemTimeJa); callback(response); }, error : commonError.connectError }); }, getHtml : function(filename, callback) { var self = this; var qp = "?20250212"; $.ajax({ cache : true, type : 'GET', url : Settings.html_file_path + '/' + filename + qp, timeout : Settings.timeout * 1000, contentType : "text/html; charset=utf-8", success : function(html) { self.htmlFile = filename; self.pageId && self.scrollTo(); $('#elmContainer').get(0).innerHTML = ''; location.hash = filename.replace(/(\_[0-9]+\.html|\.html)/, ''); if (filename == 'KSS0010.html') { $('#top_header_info').show(); } else { $('#top_header_info').hide(); } $('#errorPage').hide(); $('#elmContainer').css('visibility', 'hidden'); $('#elmContainer').hide().html(html).ready(function() { callback(); $('#messages').hide(); $('#elmContainer').css('visibility', 'visible'); imgSwitch(self.skipFlg); /* 20170210 ADD START */ var agent = window.navigator.userAgent.toLowerCase(); if (agent.indexOf('ipad') != -1 || agent.indexOf('iphone') != -1) { $('.box_btn_area').addClass('ios_hover'); $('.box_info_top').addClass('ios_hover'); } /* 20170210 ADD END */ $('#elmContainer').show(); $("input[type='radio']").change(); }); }, error : commonError.connectError, beforeSend: function(xhr){ xhr.overrideMimeType("text/html;charset=utf-8"); } }); }, scrollTo : function(target, speed) { setTimeout(function() { var body = 'body'; if (navigator.userAgent.match(/MSIE/)||navigator.userAgent.match(/Trident/)||navigator.userAgent.match(/Firefox/)) { /*IE6.7.8.9.10 + FF*/ body = 'html'; } if (target) { $(body).animate({scrollTop : target.offset().top }, speed || 0, 'swing'); } else { $(body).scrollTop(0); } }, 30); }, setScrollTarget: function(target) { this.scrollTarget = target || ''; }, getScrollTarget: function() { return this.scrollTarget; }, };