- Code cleanup
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/lib/cron'
|
||||
], ($, Init, Util, Cron) => {
|
||||
], ($, Util, Cron) => {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
|
||||
@@ -68,14 +68,18 @@ define([
|
||||
return this._name;
|
||||
}
|
||||
|
||||
get precision(){
|
||||
return this._config.precision;
|
||||
}
|
||||
|
||||
get task(){
|
||||
return this._task;
|
||||
}
|
||||
|
||||
get runCount(){
|
||||
return this._runCount;
|
||||
}
|
||||
|
||||
get precision(){
|
||||
return this._config.precision;
|
||||
}
|
||||
|
||||
set task(task){
|
||||
if(task instanceof Function){
|
||||
this._task = task;
|
||||
|
||||
@@ -8,8 +8,7 @@ define([
|
||||
'pnotify.desktop',
|
||||
//'pnotify.history',
|
||||
'pnotify.callbacks'
|
||||
], function($, Init, PNotify){
|
||||
|
||||
], ($, Init, PNotify) => {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
@@ -76,7 +75,7 @@ define([
|
||||
* @param customConfig
|
||||
* @param settings
|
||||
*/
|
||||
let showNotify = function(customConfig, settings){
|
||||
let showNotify = (customConfig, settings) => {
|
||||
customConfig = $.extend(true, {}, config, customConfig );
|
||||
|
||||
// desktop notification
|
||||
@@ -149,7 +148,7 @@ define([
|
||||
* change document.title and make the browsers tab blink
|
||||
* @param blinkTitle
|
||||
*/
|
||||
let startTabBlink = function(blinkTitle){
|
||||
let startTabBlink = blinkTitle => {
|
||||
let initBlink = (function(blinkTitle){
|
||||
|
||||
// count blinks if tab is currently active
|
||||
@@ -174,7 +173,7 @@ define([
|
||||
blinkTimer = setInterval(blink, 1000);
|
||||
}
|
||||
};
|
||||
}( blinkTitle ));
|
||||
}(blinkTitle));
|
||||
|
||||
initBlink();
|
||||
};
|
||||
@@ -182,7 +181,7 @@ define([
|
||||
/**
|
||||
* stop blinking document.title
|
||||
*/
|
||||
let stopTabBlink = function(){
|
||||
let stopTabBlink = () => {
|
||||
if(blinkTimer){
|
||||
clearInterval(blinkTimer);
|
||||
document.title = initialPageTitle;
|
||||
|
||||
@@ -43,7 +43,6 @@ define([], () => {
|
||||
constructor(callback, timeout = 6000){
|
||||
let timer;
|
||||
let promise = callback[Symbol.toStringTag] === 'Promise' ? callback : new Promise(callback);
|
||||
//let promise = new Promise(callback);
|
||||
|
||||
let wrapperPromise = Promise.race([
|
||||
promise,
|
||||
@@ -63,7 +62,6 @@ define([], () => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -4,7 +4,7 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/console',
|
||||
'app/lib/console',
|
||||
'conf/system_effect',
|
||||
'conf/signature_type',
|
||||
'bootbox',
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/util',
|
||||
'app/lib/cron'
|
||||
], ($, Init, Util, Cron) => {
|
||||
], ($, Util, Cron) => {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
|
||||
@@ -68,14 +68,18 @@ define([
|
||||
return this._name;
|
||||
}
|
||||
|
||||
get precision(){
|
||||
return this._config.precision;
|
||||
}
|
||||
|
||||
get task(){
|
||||
return this._task;
|
||||
}
|
||||
|
||||
get runCount(){
|
||||
return this._runCount;
|
||||
}
|
||||
|
||||
get precision(){
|
||||
return this._config.precision;
|
||||
}
|
||||
|
||||
set task(task){
|
||||
if(task instanceof Function){
|
||||
this._task = task;
|
||||
|
||||
@@ -8,8 +8,7 @@ define([
|
||||
'pnotify.desktop',
|
||||
//'pnotify.history',
|
||||
'pnotify.callbacks'
|
||||
], function($, Init, PNotify){
|
||||
|
||||
], ($, Init, PNotify) => {
|
||||
'use strict';
|
||||
|
||||
let config = {
|
||||
@@ -76,7 +75,7 @@ define([
|
||||
* @param customConfig
|
||||
* @param settings
|
||||
*/
|
||||
let showNotify = function(customConfig, settings){
|
||||
let showNotify = (customConfig, settings) => {
|
||||
customConfig = $.extend(true, {}, config, customConfig );
|
||||
|
||||
// desktop notification
|
||||
@@ -149,7 +148,7 @@ define([
|
||||
* change document.title and make the browsers tab blink
|
||||
* @param blinkTitle
|
||||
*/
|
||||
let startTabBlink = function(blinkTitle){
|
||||
let startTabBlink = blinkTitle => {
|
||||
let initBlink = (function(blinkTitle){
|
||||
|
||||
// count blinks if tab is currently active
|
||||
@@ -174,7 +173,7 @@ define([
|
||||
blinkTimer = setInterval(blink, 1000);
|
||||
}
|
||||
};
|
||||
}( blinkTitle ));
|
||||
}(blinkTitle));
|
||||
|
||||
initBlink();
|
||||
};
|
||||
@@ -182,7 +181,7 @@ define([
|
||||
/**
|
||||
* stop blinking document.title
|
||||
*/
|
||||
let stopTabBlink = function(){
|
||||
let stopTabBlink = () => {
|
||||
if(blinkTimer){
|
||||
clearInterval(blinkTimer);
|
||||
document.title = initialPageTitle;
|
||||
|
||||
@@ -43,7 +43,6 @@ define([], () => {
|
||||
constructor(callback, timeout = 6000){
|
||||
let timer;
|
||||
let promise = callback[Symbol.toStringTag] === 'Promise' ? callback : new Promise(callback);
|
||||
//let promise = new Promise(callback);
|
||||
|
||||
let wrapperPromise = Promise.race([
|
||||
promise,
|
||||
@@ -63,7 +62,6 @@ define([], () => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
};
|
||||
});
|
||||
@@ -4,7 +4,7 @@
|
||||
define([
|
||||
'jquery',
|
||||
'app/init',
|
||||
'app/console',
|
||||
'app/lib/console',
|
||||
'conf/system_effect',
|
||||
'conf/signature_type',
|
||||
'bootbox',
|
||||
|
||||
Reference in New Issue
Block a user