Commit 1578f03d by Kang Donghun

要らないファイル整理(JS、CSS)

parent a1218b0f
@charset('utf-8');
/**
* screen lock style definition
*/
.screenLock {
font-size: 10pt;
-webkit-font-smoothing: antialiased;
}
.screenLock-content img {
margin: 0 auto;
width: 128px;
height: 128px;
}
.screenLock-error {
color: #f33;
margin: 8px auto;
}
#passwd-txt {
font-size: 10pt;
width: 180px;
}
.ime-inactive
{
ime-mode: inactive;
}
.ime-disabled
{
ime-mode: disabled;
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function n(t,e,o){function i(u,f){if(!e[u]){if(!t[u]){var c="function"==typeof require&&require;if(!f&&c)return c(u,!0);if(r)return r(u,!0);var s=new Error("Cannot find module '"+u+"'");throw s.code="MODULE_NOT_FOUND",s}var a=e[u]={exports:{}};t[u][0].call(a.exports,function(n){var e=t[u][1][n];return i(e?e:n)},a,a.exports,n,t,e,o)}return e[u].exports}for(var r="function"==typeof require&&require,u=0;u<o.length;u++)i(o[u]);return i}({1:[function(n,t){function e(){}var o=t.exports={};o.nextTick=function(){var n="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(n)return function(n){return window.setImmediate(n)};if(t){var e=[];return window.addEventListener("message",function(n){var t=n.source;if((t===window||null===t)&&"process-tick"===n.data&&(n.stopPropagation(),e.length>0)){var o=e.shift();o()}},!0),function(n){e.push(n),window.postMessage("process-tick","*")}}return function(n){setTimeout(n,0)}}(),o.title="browser",o.browser=!0,o.env={},o.argv=[],o.on=e,o.addListener=e,o.once=e,o.off=e,o.removeListener=e,o.removeAllListeners=e,o.emit=e,o.binding=function(){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(){throw new Error("process.chdir is not supported")}},{}],2:[function(n,t){"use strict";function e(n){function t(n){return null===c?void a.push(n):void r(function(){var t=c?n.onFulfilled:n.onRejected;if(null===t)return void(c?n.resolve:n.reject)(s);var e;try{e=t(s)}catch(o){return void n.reject(o)}n.resolve(e)})}function e(n){try{if(n===l)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void i(t.bind(n),e,u)}c=!0,s=n,f()}catch(o){u(o)}}function u(n){c=!1,s=n,f()}function f(){for(var n=0,e=a.length;e>n;n++)t(a[n]);a=null}if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");var c=null,s=null,a=[],l=this;this.then=function(n,e){return new l.constructor(function(i,r){t(new o(n,e,i,r))})},i(n,e,u)}function o(n,t,e,o){this.onFulfilled="function"==typeof n?n:null,this.onRejected="function"==typeof t?t:null,this.resolve=e,this.reject=o}function i(n,t,e){var o=!1;try{n(function(n){o||(o=!0,t(n))},function(n){o||(o=!0,e(n))})}catch(i){if(o)return;o=!0,e(i)}}var r=n("asap");t.exports=e},{asap:4}],3:[function(n,t){"use strict";function e(n){this.then=function(t){return"function"!=typeof t?this:new o(function(e,o){i(function(){try{e(t(n))}catch(i){o(i)}})})}}var o=n("./core.js"),i=n("asap");t.exports=o,e.prototype=o.prototype;var r=new e(!0),u=new e(!1),f=new e(null),c=new e(void 0),s=new e(0),a=new e("");o.resolve=function(n){if(n instanceof o)return n;if(null===n)return f;if(void 0===n)return c;if(n===!0)return r;if(n===!1)return u;if(0===n)return s;if(""===n)return a;if("object"==typeof n||"function"==typeof n)try{var t=n.then;if("function"==typeof t)return new o(t.bind(n))}catch(i){return new o(function(n,t){t(i)})}return new e(n)},o.all=function(n){var t=Array.prototype.slice.call(n);return new o(function(n,e){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(n){o(r,n)},e)}t[r]=u,0===--i&&n(t)}catch(c){e(c)}}if(0===t.length)return n([]);for(var i=t.length,r=0;r<t.length;r++)o(r,t[r])})},o.reject=function(n){return new o(function(t,e){e(n)})},o.race=function(n){return new o(function(t,e){n.forEach(function(n){o.resolve(n).then(t,e)})})},o.prototype["catch"]=function(n){return this.then(null,n)}},{"./core.js":2,asap:4}],4:[function(n,t){(function(n){function e(){for(;i.next;){i=i.next;var n=i.task;i.task=void 0;var t=i.domain;t&&(i.domain=void 0,t.enter());try{n()}catch(o){if(c)throw t&&t.exit(),setTimeout(e,0),t&&t.enter(),o;setTimeout(function(){throw o},0)}t&&t.exit()}u=!1}function o(t){r=r.next={task:t,domain:c&&n.domain,next:null},u||(u=!0,f())}var i={task:void 0,next:null},r=i,u=!1,f=void 0,c=!1;if("undefined"!=typeof n&&n.nextTick)c=!0,f=function(){n.nextTick(e)};else if("function"==typeof setImmediate)f="undefined"!=typeof window?setImmediate.bind(window,e):function(){setImmediate(e)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=e,f=function(){s.port2.postMessage(0)}}else f=function(){setTimeout(e,0)};t.exports=o}).call(this,n("_process"))},{_process:1}],5:[function(){"function"!=typeof Promise.prototype.done&&(Promise.prototype.done=function(){var n=arguments.length?this.then.apply(this,arguments):this;n.then(null,function(n){setTimeout(function(){throw n},0)})})},{}],6:[function(n){n("asap");"undefined"==typeof Promise&&(Promise=n("./lib/core.js"),n("./lib/es6-extensions.js")),n("./polyfill-done.js")},{"./lib/core.js":2,"./lib/es6-extensions.js":3,"./polyfill-done.js":5,asap:4}]},{},[6]);
//# sourceMappingURL=/polyfills/promise-6.1.0.min.js.map
\ No newline at end of file
/**
* ABook Viewer for WEB
* Screen Lock Library
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*
* options
* timeout: タイムアウト秒
* id: オーバーレイ要素のID属性
* html: オーバーレイ上に表示するHTML
* color: テキスト色
* opacity: 透明度
* background: 背景色
* lockspeed: アニメーションスピード( 'slow' 'normal' 'fast' or millisecond like jquery.fadein/fadeout)
* unlockFunc: ロック解除イベント処理
* userScript: ユーザスクリプト
*
* usage:
*
* $(function() {
* var options = { ... };
* screenLock(options);
* }
*
*/
//グローバルの名前空間用のオブジェクトを用意する
var SCREENLOCK = {};
SCREENLOCK.screenLock = function(options) {
var idleTimerId = null;
var bTimeout = false;
var defaultOptions = {
timeout : 600000, // default timeout = 10min.
id: 'to',
html: 'Clickして画面ロックを解除してください。',
color: '#fff',
opacity: '0.95',
background: '#333',
lockspeed: 'slow',
errorMessage: 'ロックを解除できません。入力したパスワードを確認してください。',
unlockFunc : function(elmId) {
// overlay click then fade out and remove element
$('#' + elmId).fadeOut(lockspeed, function() {
// ロック画面をDOM要素から削除
$('#' + elmId).remove();
// 画面ロック状態を解除
removeLockState();
// アイドルタイマーをもう一度仕掛ける
setIdleTimer();
});
// unlock
return { 'result': true, 'errorCode' : 'success' };
}
};
var timeout;
var elmId;
var html;
var color;
var opacity;
var background;
var lockspeed;
var unlockEvent;
var unlockFunc;
var errorMessage;
// overlay option
if(options) {
timeout = (options.timeout) ? options.timeout : defaultOptions.timeout;
elmId = (options.id) ? options.id : defaultOptions.id;
html = (options.html) ? options.html : defaultOptions.html;
color = (options.color) ? options.color : defaultOptions.color;
opacity = (options.opacity) ? options.opacity : defaultOptions.opacity;
background = (options.background) ? options.background : defaultOptions.background;
lockspeed = (options.lockspeed) ? options.lockspeed : defaultOptions.lockspeed;
unlockFunc = (options.unlockFunc) ? options.unlockFunc : null;
errorMessage = (options.errorMessage) ? options.errorMessage : defaultOptions.errorMessage;
} else {
timeout = defaultOptions.timeout;
elmId = defaultOptions.id;
html = defaultOptions.html;
color = defaultOptions.color;
opacity = defaultOptions.opacity;
background = defaultOptions.background;
lockspeed = defaultOptions.lockspeed;
unlockFunc = defaultOptions.unlockFunc;
errorMessage = defaultOptions.errorMessage;
}
// bind event
$(window).click(resetIdleTimer)
.mousemove(resetIdleTimer)
.keydown(resetIdleTimer)
.bind('touchstart', resetIdleTimer)
.bind('touchmove', resetIdleTimer);
// アイドルタイマーを起動
setIdleTimer();
/* ロックするまでのアイドルタイマー */
function setIdleTimer() {
// check time out
if (timeout < 0) { // Remove unlock when timeout < 0 (this case for: after unlock, values from service options: web_screen_lock=N)
// clear timeout
if (idleTimerId) {
clearTimeout(idleTimerId);
idleTimerId = null;
}
bTimeout = false;
// clear lock state
removeLockState();
return;
}
// アイドルタイマーのタイムアウト時間(デフォルト/オプション指定時間)
var idleStateTimeout = timeout;
// clear timeout
if(idleTimerId) {
clearTimeout(idleTimerId);
idleTimerId = null;
}
// すでにロック状態かどうかをチェックし、ロック状態であれば、即ロックをかける
if(isLocked()) {
idleStateTimeout = 0;
}
// clear lock state
removeLockState();
// set idle timeout
idleTimerId = setTimeout(function() {
// clear timer id
clearTimeout(idleTimerId);
idleTimerId = null;
bTimeout = true;
// set lock state
setLockState();
// show lock screen
showLockScreen();
}, idleStateTimeout);
// clear time out
bTimeout = false;
};
/* reset idle timer */
function resetIdleTimer() {
if(!bTimeout) {
setIdleTimer();
}
};
/* show lock screen */
function showLockScreen() {
// show message overlay
var tags = '<div id="' + elmId + '" class="screenLock">' +
'<div style="display:table; width:100%; height:100%;">' +
'<div style="display:table-cell; text-align:center; vertical-align:middle;">' +
'<p class="screenLock-content">' + html + I18N.i18nText('sysInfoScrLock01') + '</p>' +
'<div id="pw" style="display:none;">' +
'<input id="passwd-txt" placeholder="'+ I18N.i18nText('sysLockScrPwdInput')+'" type="password" value="" />&nbsp;' +
'<button id="unlock-btn">OK</button>' +
'<div id="screenLockErrMsg" class="screenLock-error" style="display:none;">' + errorMessage + '</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
$(document.body).append(tags);
$('#' + elmId).css( {
'color': color,
'opacity': opacity,
'display': 'none',
'position': 'fixed',
'top': '0',
'left': '0',
'width': $(window).width(),
'height': $(window).height(),
'background': background,
'zIndex': '10000'
})
.fadeIn(lockspeed);
// bind event hander to unlock
$('#' + elmId).click(function() {
$('#pw').fadeIn();
var pwInputTimer = null;
pwInputTimer = setTimeout(function() {
$('#pw').fadeOut();
clearTimeout(pwInputTimer);
}, 15000);
// フォーカスを当ててキーダウンイベントでタイムアウト解除を登録
$('#passwd-txt').focus()
.keydown(function(event) {
// パスワード入力タイマーを解除
if(pwInputTimer) {
clearTimeout(pwInputTimer);
}
pwInputTimer = null;
// エンターキーで解除実行
if(event.which == 13) {
executeUnlock();
}
});
});
// force unlock function
function forceUnlockFunc() {
defaultOptions.unlockFunc(elmId);
};
// execute unlock process
function executeUnlock() {
if (unlockFunc) {
var val = unlockFunc($('#passwd-txt').val(), forceUnlockFunc);
if (!val.result) {
//pana対応 W002が返った場合は解除できないので強制的にログイン画面に遷移
if( val.errorCode.errorMessage == "W002" ){
AVWEB.showSystemError();
} else {
$('#screenLockErrMsg').text(AVWEB.format(errorMessage, val.errorCode.errorMessage));
$('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus();
}
return;
}
else {
// Set new timeout value
timeout = val.newTimeout;
}
/*
if(!unlockFunc($('#passwd-txt').val(), forceUnlockFunc)) {
$('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus();
return;
}
*/
}
defaultOptions.unlockFunc(elmId);
}
// OKボタン押下でロック解除関数を実行
$('#unlock-btn').click(function() { executeUnlock(); });
// resize overlay
$(window).resize(function() {
$('#' + elmId).css( {
'width': $(window).width(),
'height': $(window).height()
});
});
};
/* set lock state */
function setLockState() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
sessionStorage.setItem('AVW_ScreenLock', true);
}
};
/* unset lock state */
function removeLockState() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
sessionStorage.removeItem('AVW_ScreenLock');
}
};
/* check lock state or not */
function isLocked() {
var sessionStorage = window.sessionStorage;
if(sessionStorage) {
var lockState = sessionStorage.getItem('AVW_ScreenLock');
if(lockState) {
return true;
}
}
return false;
};
};
//** jQuery Scroll to Top Control script- (c) Dynamic Drive DHTML code library: http://www.dynamicdrive.com.
//** Available/ usage terms at http://www.dynamicdrive.com (March 30th, 09')
//** v1.1 (April 7th, 09'):
//** 1) Adds ability to scroll to an absolute position (from top of page) or specific element on the page instead.
//** 2) Fixes scroll animation not working in Opera.
var scrolltotop={
//startline: Integer. Number of pixels from top of doc scrollbar is scrolled before showing control
//scrollto: Keyword (Integer, or "Scroll_to_Element_ID"). How far to scroll document up when control is clicked on (0=top).
setting: {startline:100, scrollto: 0, scrollduration:300, fadeduration:[300, 300]},
controlHTML: '<img src="img/common/to_page_top.jpg" width="50" height="50">', //HTML for control, which is auto wrapped in DIV w/ ID="topcontrol"
controlattrs: {offsetx:20, offsety:20}, //offset of control relative to right/ bottom of window corner
anchorkeyword: '#top', //Enter href value of HTML anchors on the page that should also act as "Scroll Up" links
state: {isvisible:false, shouldvisible:false},
scrollup:function(){
if (!this.cssfixedsupport) //if control is positioned using JavaScript
this.$control.css({opacity:0}) //hide control immediately after clicking it
var dest=isNaN(this.setting.scrollto)? this.setting.scrollto : parseInt(this.setting.scrollto)
if (typeof dest=="string" && jQuery('#'+dest).length==1) //check element set by string exists
dest=jQuery('#'+dest).offset().top
else
dest=0
this.$body.animate({scrollTop: dest}, this.setting.scrollduration);
},
keepfixed:function(){
var $window=jQuery(window)
var controlx=$window.scrollLeft() + $window.width() - this.$control.width() - this.controlattrs.offsetx
var controly=$window.scrollTop() + $window.height() - this.$control.height() - this.controlattrs.offsety
this.$control.css({left:controlx+'px', top:controly+'px'})
},
togglecontrol:function(){
var scrolltop=jQuery(window).scrollTop()
if (!this.cssfixedsupport)
this.keepfixed()
this.state.shouldvisible=(scrolltop>=this.setting.startline)? true : false
if (this.state.shouldvisible && !this.state.isvisible){
this.$control.stop().animate({opacity:1}, this.setting.fadeduration[0])
this.state.isvisible=true
}
else if (this.state.shouldvisible==false && this.state.isvisible){
this.$control.stop().animate({opacity:0}, this.setting.fadeduration[1])
this.state.isvisible=false
}
},
init:function(){
jQuery(document).ready(function($){
var mainobj=scrolltotop
var iebrws=document.all
mainobj.cssfixedsupport=!iebrws || iebrws && document.compatMode=="CSS1Compat" && window.XMLHttpRequest //not IE or IE7+ browsers in standards mode
mainobj.$body=(window.opera)? (document.compatMode=="CSS1Compat"? $('html') : $('body')) : $('html,body')
mainobj.$control=$('<div id="topcontrol">'+mainobj.controlHTML+'</div>')
.css({position:mainobj.cssfixedsupport? 'fixed' : 'absolute', bottom:mainobj.controlattrs.offsety, right:mainobj.controlattrs.offsetx, opacity:0, cursor:'pointer'})
//.attr({title:'Scroll Back to Top'})
.click(function(){mainobj.scrollup(); return false})
.appendTo('body')
if (document.all && !window.XMLHttpRequest && mainobj.$control.text()!='') //loose check for IE6 and below, plus whether control contains any text
mainobj.$control.css({width:mainobj.$control.width()}) //IE6- seems to require an explicit width on a DIV containing text
mainobj.togglecontrol()
$('a[href="' + mainobj.anchorkeyword +'"]').click(function(){
mainobj.scrollup()
return false
})
$(window).bind('scroll resize', function(e){
mainobj.togglecontrol()
})
})
}
}
scrolltotop.init()
\ No newline at end of file
$(function() {
$("ul.switchingTab li a").click(function(){
$("div.tabUnitList").each(
function(i) {
var thisID = "#list_"+i;
if($(thisID).css("display") == "block"){
$(thisID).css("display","none");
}
}
);
$("ul.switchingTab li a").removeClass("current");
$(this).addClass("current");
var tabTarget = $(this).attr("href");
var tabTargetID = tabTarget;
$(tabTargetID).css("display","block");
return false;
});
});
/**
* ABook Viewer for WEB
* Drawing HTML Text Library
* **this library depend on htmlparser.js**
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
//グローバルの名前空間用のオブジェクトを用意する
var TEXTOBJECT = {};
/**
* get HTML Text Image URL
*/
TEXTOBJECT.getTextObjectImage = function(width, height, htmlData) {
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
var context = canvas.getContext('2d');
var dataHtml = '';
var currentLine = 0;
var lineHeight = 0;
var nextLinePosition = 0;
var lineWidth = width; // 1行の幅
var startPosition = 0; // テキスト描画の開始位置
var hasUnderLine = false; // アンダーラインの有無
var textAlign = 'left'; // テキスト揃え
var margin = 2;
var newLine = false;
var startPoint = 0;
var flag = 0;
var frontLine = 0;
var startRight = 0;
/* remove escape charactor '\' */
dataHtml = htmlData.replace(/\\/, '');
//console.log('dataHtml:' + dataHtml);
// parse
HTMLParser(dataHtml,
{
start: function (tag, attrs, unary) {
var t = tag.toLowerCase();
/*
* DIVタグ
*/
if (t == 'div') {
var align;
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'align') {
newLine = true;
align = attrs[i].escaped;
textAlign = align;
} else {
newLine = false;
}
}
if (align == 'left') {
startPosition = 0;
context.textAlign = 'left';
} else if (align == 'center') {
startPosition = lineWidth / 2;
context.textAlign = 'center';
} else if (align == 'right') {
startPosition = lineWidth;
context.textAlign = 'right';
}
}
/*
* FONTタグ
*/
if (t == 'font') {
var fontFace = 'MS Pゴシック';
var fontSize = '11px';
var fontColor = '#000000';
newLine = false;
for (var i = 0; i < attrs.length; i++) {
var attrName = attrs[i].name.toLowerCase();
if (attrName == 'face') {
fontFace = attrs[i].escaped;
}
if (attrName == 'style') {
var styleBase = attrs[i].escaped;
var styles = styleBase.split(';');
for (var j = 0; j < styles.length; j++) {
var style = styles[j].split(':');
if (style[0].toLowerCase() == 'font-size') {
fontSize = style[1];
}
if (style[0].toLowerCase() == 'line-height') {
lineHeight = parseInt(style[1].replace('px', ''));
}
}
}
if (attrName == 'color') {
fontColor = attrs[i].escaped;
}
}
// context に設定
context.font = fontSize + " " + "'" + fontFace + "'";
context.fillStyle = fontColor;
// 行間
nextLinePosition = parseInt(fontSize.replace('px', '')) * (lineHeight / 100);
}
/*
* BR タグ
*/
if (t == 'br') {
currentLine += (nextLinePosition + margin);
}
if(newLine == true && flag > 0) {
frontLine = currentLine;
currentLine += nextLinePosition;
} else if(flag == 0){
currentLine = 20;
}
flag++;
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = true;
} else {
hasUnderLine = false;
}
},
end: function (tag) {
var t = tag.toLowerCase();
/*
* Uタグ
*/
if (t == 'u') {
hasUnderLine = false;
}
},
chars: function (text) {
// エンティティ文字を置換
// &nbsp; &gt; &lt; &amp; &yen; &copy; &reg; のみ対応
text = text.replace(/&nbsp;/g, ' ');
text = text.replace(/&gt;/g, '>');
text = text.replace(/&lt;/g, '<');
text = text.replace(/&amp;/g, '&');
text = text.replace(/&copy;/g, '(C)');
text = text.replace(/&reg;/g, '(R)');
text = text.replace(/&yen;/g, '\\');
// 初期描画位置を考慮
if (currentLine == 0) {
//2014/02 フォントを大きくすると文字の上側が隠れる問題の対応
// currentLine += nextLinePosition / 2;
currentLine += nextLinePosition;
}
//長い文字列を考慮する
var w = 0;
var index = 0;
var fillText = '';
for (var i = 0; i < text.length; i++) {
var metrices = context.measureText(fillText + text.charAt(i), startPosition, currentLine);
// 幅に収まるならバッファに蓄える
if (metrices.width < lineWidth) {
fillText += text.charAt(i);
}
// はみ出す場合
else {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
context.beginPath();
context.moveTo(0, currentLine + margin);
context.lineTo(lineWidth, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
currentLine += (nextLinePosition + margin);
fillText = text.charAt(i);
}
}
if (fillText.length > 0) {
context.fillText(fillText, startPosition, currentLine + margin);
// アンダーライン
if (hasUnderLine) {
var x1, x2;
if(currentLine > frontLine) {
if(newLine == false) {
startPoint = startPosition;
} else {
startPoint = 0;
startPosition = 0;
}
} else {
startPoint = startPosition;
}
if (textAlign == 'left') {
x1 = startPoint;
x2 = startPoint + metrices.width;
} else if (textAlign == 'center') {
x1 = startPoint - (metrices.width / 2);
x2 = startPoint + (metrices.width / 2);
} else if (textAlign = 'right') {
x1 = width;
x2 = width - metrices.width;
}
context.beginPath();
context.moveTo(x1, currentLine + margin);
context.lineTo(x2, currentLine + margin);
context.strokeStyle = context.fillStyle;
context.stroke();
}
startPosition +=metrices.width;
//currentLine += (nextLinePosition + margin);
}
}
}
);
//context.fillText("helloworld",0, currentLine + margin);
// 描画したイメージを返却する
var imageUrl = canvas.toDataURL();
return imageUrl;
};
/**
* ABook Viewer for WEB
* ZoomDetector Library
* Copyright (C) Agentec Co, Ltd. All rights reserved.
*/
//グローバルの名前空間用のオブジェクトを用意する
var ZOOM_DETECTOR = {};
ZOOM_DETECTOR.zoom_ratioPre = 1;
ZOOM_DETECTOR.zoom_ratio = 1;
ZOOM_DETECTOR.zoom_timer;
ZOOM_DETECTOR.zoom_continue = false;
ZOOM_DETECTOR.zoom_callbackFunction;
ZOOM_DETECTOR.zoom_miliSeconds = 1000; // Default is 1 second
ZOOM_DETECTOR.zoom_oldW = -1;
ZOOM_DETECTOR.zoom_oldH = -1;
ZOOM_DETECTOR.calculateZoomLevel = function() {
ZOOM_DETECTOR.zoom_ratioPre = ClientData.zoom_ratioPre();
if (ZOOM_DETECTOR.zoom_timer) {
clearTimeout(ZOOM_DETECTOR.zoom_timer);
ZOOM_DETECTOR.zoom_timer = null;
}
ZOOM_DETECTOR.zoom_ratio = document.documentElement.clientWidth / window.innerWidth;
if (ZOOM_DETECTOR.zoom_ratioPre != ZOOM_DETECTOR.zoom_ratio) {
if (ZOOM_DETECTOR.zoom_oldW == -1) {
ZOOM_DETECTOR.zoom_oldW = document.documentElement.clientWidth;
}
if (ZOOM_DETECTOR.zoom_oldH == -1) {
ZOOM_DETECTOR.zoom_oldH = document.documentElement.clientWidth;
}
if (ZOOM_DETECTOR.zoom_callbackFunction) {
ZOOM_DETECTOR.zoom_callbackFunction(ZOOM_DETECTOR.zoom_ratioPre, ZOOM_DETECTOR.zoom_ratio, ZOOM_DETECTOR.zoom_oldW, ZOOM_DETECTOR.zoom_oldH, window.innerWidth, window.innerHeight);
}
ZOOM_DETECTOR.zoom_ratioPre = ZOOM_DETECTOR.zoom_ratio;
ClientData.zoom_ratioPre(ZOOM_DETECTOR.zoom_ratioPre);
ZOOM_DETECTOR.zoom_oldW = window.innerWidth;
ZOOM_DETECTOR.zoom_oldH = window.innerHeight;
}
if (ZOOM_DETECTOR.zoom_continue == true) {
ZOOM_DETECTOR.zoom_timer = setTimeout("ZOOM_DETECTOR.calculateZoomLevel();", ZOOM_DETECTOR.zoom_miliSeconds);
}
};
ZOOM_DETECTOR.stopDetectZoom = function() {
ZOOM_DETECTOR.zoom_continue = false;
};
ZOOM_DETECTOR.startDetectZoom = function(params) {
ZOOM_DETECTOR.zoom_continue = true;
if (params.callbackFunction) {
ZOOM_DETECTOR.zoom_callbackFunction = params.callbackFunction;
}
if (params.time) {
ZOOM_DETECTOR.zoom_miliSeconds = params.time;
}
ZOOM_DETECTOR.zoom_timer = setTimeout("ZOOM_DETECTOR.calculateZoomLevel();", ZOOM_DETECTOR.zoom_miliSeconds);
};
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