Bugfix after Travis CI error (redeclaring variables)

This commit is contained in:
Johan Alvinger 2020-11-30 16:48:07 +01:00
parent 260bc9664e
commit 97f3514677

View File

@ -174,6 +174,8 @@ Module.register("calendar", {
var currentFadeStep = 0; var currentFadeStep = 0;
var lastSeenDate = ""; var lastSeenDate = "";
var ev;
var needle;
for (var e in events) { for (var e in events) {
var event = events[e]; var event = events[e];
@ -221,8 +223,6 @@ Module.register("calendar", {
var symbols = this.symbolsForEvent(event); var symbols = this.symbolsForEvent(event);
// If symbols are displayed and custom symbol is set, replace event symbol // If symbols are displayed and custom symbol is set, replace event symbol
if (this.config.displaySymbol && this.config.customEvents.length > 0) { if (this.config.displaySymbol && this.config.customEvents.length > 0) {
var ev;
var needle;
for (ev in this.config.customEvents) { for (ev in this.config.customEvents) {
if (typeof this.config.customEvents[ev].symbol !== "undefined" && this.config.customEvents[ev].symbol !== "") { if (typeof this.config.customEvents[ev].symbol !== "undefined" && this.config.customEvents[ev].symbol !== "") {
needle = new RegExp(this.config.customEvents[ev].keyword, "gi"); needle = new RegExp(this.config.customEvents[ev].keyword, "gi");
@ -266,9 +266,9 @@ Module.register("calendar", {
// Color events if custom color is specified // Color events if custom color is specified
if (this.config.customEvents.length > 0) { if (this.config.customEvents.length > 0) {
for (var ev in this.config.customEvents) { for (ev in this.config.customEvents) {
if (typeof this.config.customEvents[ev].color !== "undefined" && this.config.customEvents[ev].color !== "") { if (typeof this.config.customEvents[ev].color !== "undefined" && this.config.customEvents[ev].color !== "") {
var needle = new RegExp(this.config.customEvents[ev].keyword, "gi"); needle = new RegExp(this.config.customEvents[ev].keyword, "gi");
if (needle.test(event.title)) { if (needle.test(event.title)) {
eventWrapper.style.cssText = "color:" + this.config.customEvents[ev].color; eventWrapper.style.cssText = "color:" + this.config.customEvents[ev].color;
titleWrapper.style.cssText = "color:" + this.config.customEvents[ev].color; titleWrapper.style.cssText = "color:" + this.config.customEvents[ev].color;