mirror of https://github.com/mue/mue.git
Codacy
This commit is contained in:
parent
6ed2abc3b4
commit
8d8831f64b
|
@ -17,13 +17,13 @@ Fast, open and free-to-use new tab page for most modern browsers
|
|||
### Chrome
|
||||
<a href='https://chrome.google.com/webstore/detail/mue/bngmbednanpcfochchhgbkookpiaiaid'><img src='assets/chrome.png' target='_blank'></a>
|
||||
|
||||
Link: https://chrome.google.com/webstore/detail/mue/bngmbednanpcfochchhgbkookpiaiaid
|
||||
Link: [Chrome Web Store](https://chrome.google.com/webstore/detail/mue/bngmbednanpcfochchhgbkookpiaiaid)
|
||||
|
||||
Development: Read the [Development](#development) section
|
||||
### Firefox
|
||||
<a href='https://addons.mozilla.org/firefox/addon/mue'><img src='assets/firefox.png' target='_blank'></a>
|
||||
|
||||
Link: https://addons.mozilla.org/firefox/addon/mue
|
||||
Link: [Firefox Add-ons](https://addons.mozilla.org/firefox/addon/mue)
|
||||
|
||||
Development: Read the [Development](#development) section
|
||||
### Opera/Other
|
||||
|
|
|
@ -123,4 +123,4 @@ module.exports = class Message {
|
|||
else if (hour > 18) time = 'Dod eftermiddag'; // If it's before 6pm, set the time string to "Good afternoon"
|
||||
setHTMLContent('.greeting', time); // Write the string contents to the HTML
|
||||
}
|
||||
}
|
||||
};
|
|
@ -20,22 +20,22 @@ module.exports = class Util {
|
|||
// format time
|
||||
static formatTimeUnit(unit) {
|
||||
return unit < 10 ? '0' + unit : unit;
|
||||
};
|
||||
}
|
||||
|
||||
// setHTMLContent is the kind of function that is referred to as a 'wrapper'
|
||||
static setHTMLContent(selector, content) {
|
||||
return document.querySelector(selector).innerHTML = content;
|
||||
};
|
||||
}
|
||||
|
||||
// get random item
|
||||
static getRandIndex(array) {
|
||||
return Math.floor(Math.random() * (array.length - 1));
|
||||
};
|
||||
}
|
||||
|
||||
// pick random from array
|
||||
static pickFromArray(array) {
|
||||
return array[Math.floor(Math.random() * (array.length - 1))];
|
||||
};
|
||||
}
|
||||
|
||||
static contains(needle) {
|
||||
let findNaN = needle !== needle;
|
||||
|
|
Loading…
Reference in New Issue