Commit 1da5c4e9 by Masaru Abe

screenLock.jsリファクタリング

parent 6ba272bc
...@@ -2057,7 +2057,7 @@ COMMON.LockScreen = function() { ...@@ -2057,7 +2057,7 @@ COMMON.LockScreen = function() {
var timeWaitLockScreen = COMMON.getTimeWaitLockScreen(); var timeWaitLockScreen = COMMON.getTimeWaitLockScreen();
if (timeWaitLockScreen > 0) { if (timeWaitLockScreen > 0) {
//var message = I18N.i18nText("sysInfoScrLock01"); //var message = I18N.i18nText("sysInfoScrLock01");
screenLock({ SCREENLOCK.screenLock({
timeout: timeWaitLockScreen, timeout: timeWaitLockScreen,
html: '<img src="img/1222.png" alt="Screen Lock" /><br />', //+ message, html: '<img src="img/1222.png" alt="Screen Lock" /><br />', //+ message,
unlockFunc: COMMON.unlockFunction, unlockFunc: COMMON.unlockFunction,
......
...@@ -22,7 +22,11 @@ ...@@ -22,7 +22,11 @@
* } * }
* *
*/ */
function screenLock(options) {
//グローバルの名前空間用のオブジェクトを用意する
var SCREENLOCK = {};
SCREENLOCK.screenLock = function(options) {
var idleTimerId = null; var idleTimerId = null;
var bTimeout = false; var bTimeout = false;
...@@ -54,7 +58,16 @@ function screenLock(options) { ...@@ -54,7 +58,16 @@ function screenLock(options) {
} }
}; };
var timeout, elmId, html, color, opacity, background, lockspeed, unlockEvent, unlockFunc, errorMessage; var timeout;
var elmId;
var html;
var color;
var opacity;
var background;
var lockspeed;
var unlockEvent;
var unlockFunc;
var errorMessage;
// overlay option // overlay option
if(options) { if(options) {
...@@ -121,11 +134,10 @@ function screenLock(options) { ...@@ -121,11 +134,10 @@ function screenLock(options) {
// すでにロック状態かどうかをチェックし、ロック状態であれば、即ロックをかける // すでにロック状態かどうかをチェックし、ロック状態であれば、即ロックをかける
if(isLocked()) { if(isLocked()) {
idleStateTimeout = 0; idleStateTimeout = 0;
}
}
// clear lock state // clear lock state
removeLockState(); removeLockState();
// set idle timeout // set idle timeout
idleTimerId = setTimeout(function() { idleTimerId = setTimeout(function() {
...@@ -222,7 +234,6 @@ removeLockState(); ...@@ -222,7 +234,6 @@ removeLockState();
$('#screenLockErrMsg').text(AVWEB.format(errorMessage, val.errorCode.errorMessage)); $('#screenLockErrMsg').text(AVWEB.format(errorMessage, val.errorCode.errorMessage));
$('#screenLockErrMsg').fadeIn(); $('#screenLockErrMsg').fadeIn();
$('#passwd-txt').focus(); $('#passwd-txt').focus();
return; return;
} }
else { else {
......
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