- Code cleanup

This commit is contained in:
Mark Friedrich
2019-11-23 09:34:11 +01:00
parent e59a6c8b59
commit 81c21d07ef
12 changed files with 30 additions and 30 deletions

View File

@@ -1,9 +1,8 @@
define([
'jquery',
'app/init',
'app/util',
'app/lib/cron'
], ($, Init, Util, Cron) => {
], ($, Util, Cron) => {
'use strict';
let config = {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
});
});
}
};
});

View File

@@ -4,7 +4,7 @@
define([
'jquery',
'app/init',
'app/console',
'app/lib/console',
'conf/system_effect',
'conf/signature_type',
'bootbox',

View File

@@ -1,9 +1,8 @@
define([
'jquery',
'app/init',
'app/util',
'app/lib/cron'
], ($, Init, Util, Cron) => {
], ($, Util, Cron) => {
'use strict';
let config = {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
});
});
}
};
});

View File

@@ -4,7 +4,7 @@
define([
'jquery',
'app/init',
'app/console',
'app/lib/console',
'conf/system_effect',
'conf/signature_type',
'bootbox',