Run prettier over ALL files once

No other changes done in this commit
This commit is contained in:
Veeck
2020-05-11 22:22:32 +02:00
parent 3a5a29efc0
commit abb5dc5739
160 changed files with 2369 additions and 2210 deletions

View File

@@ -5,7 +5,6 @@
* MIT Licensed.
*/
Module.register("updatenotification", {
defaults: {
updateInterval: 10 * 60 * 1000, // every 10 minutes
refreshInterval: 24 * 60 * 60 * 1000, // one day
@@ -18,7 +17,10 @@ Module.register("updatenotification", {
start: function () {
var self = this;
Log.log("Start updatenotification");
setInterval( () => { self.moduleList = {};self.updateDom(2); } , self.config.refreshInterval);
setInterval(() => {
self.moduleList = {};
self.updateDom(2);
}, self.config.refreshInterval);
},
notificationReceived: function (notification, payload, sender) {
@@ -39,16 +41,15 @@ Module.register("updatenotification", {
var self = this;
if (payload && payload.behind > 0) {
// if we haven't seen info for this module
if(this.moduleList[payload.module] === undefined){
if (this.moduleList[payload.module] === undefined) {
// save it
this.moduleList[payload.module]=payload;
this.moduleList[payload.module] = payload;
self.updateDom(2);
}
//self.show(1000, { lockString: self.identifier });
} else if (payload && payload.behind === 0){
} else if (payload && payload.behind === 0) {
// if the module WAS in the list, but shouldn't be
if(this.moduleList[payload.module] !== undefined){
if (this.moduleList[payload.module] !== undefined) {
// remove it
delete this.moduleList[payload.module];
self.updateDom(2);
@@ -56,23 +57,18 @@ Module.register("updatenotification", {
}
},
diffLink: function(module, text) {
diffLink: function (module, text) {
var localRef = module.hash;
var remoteRef = module.tracking.replace(/.*\//, "");
return "<a href=\"https://github.com/MichMich/MagicMirror/compare/"+localRef+"..."+remoteRef+"\" "+
"class=\"xsmall dimmed\" "+
"style=\"text-decoration: none;\" "+
"target=\"_blank\" >" +
text +
"</a>";
return '<a href="https://github.com/MichMich/MagicMirror/compare/' + localRef + "..." + remoteRef + '" ' + 'class="xsmall dimmed" ' + 'style="text-decoration: none;" ' + 'target="_blank" >' + text + "</a>";
},
// Override dom generator.
getDom: function () {
var wrapper = document.createElement("div");
if(this.suspended === false){
if (this.suspended === false) {
// process the hash of module info found
for(var key of Object.keys(this.moduleList)){
for (var key of Object.keys(this.moduleList)) {
let m = this.moduleList[key];
var message = document.createElement("div");
@@ -93,7 +89,7 @@ Module.register("updatenotification", {
var text = document.createElement("span");
if (m.module === "default") {
text.innerHTML = this.translate("UPDATE_NOTIFICATION");
subtextHtml = this.diffLink(m,subtextHtml);
subtextHtml = this.diffLink(m, subtextHtml);
} else {
text.innerHTML = this.translate("UPDATE_NOTIFICATION_MODULE", {
MODULE_NAME: m.module
@@ -112,11 +108,11 @@ Module.register("updatenotification", {
return wrapper;
},
suspend: function() {
this.suspended=true;
suspend: function () {
this.suspended = true;
},
resume: function() {
this.suspended=false;
resume: function () {
this.suspended = false;
this.updateDom(2);
}
});