Fixed code formatting issues

This commit is contained in:
Thomas Bachmann 2017-01-04 11:01:07 +01:00
parent 0099b6d4a2
commit 6251b77b28

View File

@ -152,21 +152,21 @@ Module.register("newsfeed",{
} }
} }
if(!this.config.showFullArticle){ if(!this.config.showFullArticle){
var title = document.createElement("div"); var title = document.createElement("div");
title.className = "bright medium light"; title.className = "bright medium light";
title.innerHTML = this.newsItems[this.activeItem].title; title.innerHTML = this.newsItems[this.activeItem].title;
wrapper.appendChild(title); wrapper.appendChild(title);
} }
if (this.config.showDescription) { if (this.config.showDescription) {
var description = document.createElement("div"); var description = document.createElement("div");
description.className = "small light"; description.className = "small light";
description.innerHTML = this.newsItems[this.activeItem].description; description.innerHTML = this.newsItems[this.activeItem].description;
wrapper.appendChild(description); wrapper.appendChild(description);
} }
if (this.config.showFullArticle) { if (this.config.showFullArticle) {
var fullArticle = document.createElement("iframe"); var fullArticle = document.createElement("iframe");
fullArticle.className = ""; fullArticle.className = "";
@ -176,8 +176,8 @@ Module.register("newsfeed",{
fullArticle.src = this.newsItems[this.activeItem].url; fullArticle.src = this.newsItems[this.activeItem].url;
wrapper.appendChild(fullArticle); wrapper.appendChild(fullArticle);
} }
} else { } else {
wrapper.innerHTML = this.translate("LOADING"); wrapper.innerHTML = this.translate("LOADING");
@ -287,14 +287,14 @@ Module.register("newsfeed",{
capitalizeFirstLetter: function(string) { capitalizeFirstLetter: function(string) {
return string.charAt(0).toUpperCase() + string.slice(1); return string.charAt(0).toUpperCase() + string.slice(1);
}, },
notificationReceived: function(notification, payload, sender) { notificationReceived: function(notification, payload, sender) {
Log.info(this.name + " - received event"); Log.info(this.name + " - received event");
if(notification == 'GESTURE'){ if(notification == "GESTURE"){
Log.info(this.name + " - received gesture"); Log.info(this.name + " - received gesture");
var gesture = payload.gesture; var gesture = payload.gesture;
// actually RIGHT, because gesture sensor is built in upside down // actually RIGHT, because gesture sensor is built in upside down
if(gesture == 'LEFT'){ if(gesture == "LEFT"){
Log.info(this.name + " - received right"); Log.info(this.name + " - received right");
var before = this.activeItem; var before = this.activeItem;
this.activeItem++; this.activeItem++;
@ -310,7 +310,7 @@ Module.register("newsfeed",{
this.updateDom(100); this.updateDom(100);
} }
// actually LEFT, because gesture sensor is built in upside down // actually LEFT, because gesture sensor is built in upside down
else if(gesture == 'RIGHT'){ else if(gesture == "RIGHT"){
Log.info(this.name + " - received left"); Log.info(this.name + " - received left");
var before = this.activeItem; var before = this.activeItem;
this.activeItem--; this.activeItem--;
@ -326,7 +326,7 @@ Module.register("newsfeed",{
this.updateDom(100); this.updateDom(100);
} }
// actually UP, because gesture sensor is built in upside down // actually UP, because gesture sensor is built in upside down
else if(gesture == 'DOWN' && !this.config.showDescription){ else if(gesture == "DOWN" && !this.config.showDescription){
Log.info(this.name + " - received up"); Log.info(this.name + " - received up");
this.config.showDescription = true; this.config.showDescription = true;
this.config.showFullArticle = false; this.config.showFullArticle = false;
@ -335,7 +335,7 @@ Module.register("newsfeed",{
this.updateDom(100); this.updateDom(100);
} }
// actually DOWN, because gesture sensor is built in upside down // actually DOWN, because gesture sensor is built in upside down
else if(gesture == 'UP'){ else if(gesture == "UP"){
Log.info(this.name + " - received down"); Log.info(this.name + " - received down");
this.config.showDescription = false; this.config.showDescription = false;
this.config.showFullArticle = false; this.config.showFullArticle = false;
@ -345,7 +345,7 @@ Module.register("newsfeed",{
this.updateDom(100); this.updateDom(100);
} }
// actually UP, because gesture sensor is built in upside down // actually UP, because gesture sensor is built in upside down
else if(gesture == 'DOWN' && this.config.showDescription){ else if(gesture == "DOWN" && this.config.showDescription){
Log.info(this.name + " - received up again"); Log.info(this.name + " - received up again");
this.config.showFullArticle = true; this.config.showFullArticle = true;
this.config.showDescription = false; this.config.showDescription = false;