Skip to content
Snippets Groups Projects
Commit d4f18a53 authored by Rico van Endern's avatar Rico van Endern
Browse files

Merged in dev (pull request #37)

Dev
parents a52678be a70a38f3
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,11 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) { ...@@ -69,7 +69,11 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) {
for (var i = 1; i <= panels.length; i++) { for (var i = 1; i <= panels.length; i++) {
var j = (i + panelIdx) % panels.length; var j = (i + panelIdx) % panels.length;
var panelDuration = panels[j].inner.checkShowCondition(); var panelDuration = panels[j].inner.checkShowCondition();
if (panelDuration >= 0) { if (panelDuration == 0) {
console.log("Layout: Panel skipped");
} else if(panelDuration < 0){
// TODO access default Duration
} else if (panelDuration > 0) {
gefunden = true; gefunden = true;
panels[panelIdx].inner.hide(); panels[panelIdx].inner.hide();
...@@ -83,13 +87,13 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) { ...@@ -83,13 +87,13 @@ layout.createCycler = function (dom, panels, duration_, forceDuration) {
var realDuration = (realForceDuration || (panelDuration == 0)) ? (panels[j].inner.json.duration || this.duration) : panelDuration; var realDuration = (realForceDuration || (panelDuration == 0)) ? (panels[j].inner.json.duration || this.duration) : panelDuration;
panels[panelIdx].inner.show(realDuration); panels[panelIdx].inner.show(realDuration);
console.log(realDuration); console.log("Layout: Panelduration " + realDuration);
interval = setTimeout(doTick.bind(c), realDuration * 1000); interval = setTimeout(doTick.bind(c), realDuration * 1000);
break; break;
} }
} }
if (!gefunden) { if (!gefunden) {
layout.error("no panel found to show in cycler D: search again in " + layout.defaultCycleTime + " seconds"); console.error("Layout: No panel found to show in cycler. Try again in " + layout.defaultCycleTime + " seconds.");
interval = setTimeout(doTick.bind(c), layout.defaultCycleTime * 1000); interval = setTimeout(doTick.bind(c), layout.defaultCycleTime * 1000);
} }
...@@ -184,7 +188,7 @@ layout.processLayout = function (json, container) { ...@@ -184,7 +188,7 @@ layout.processLayout = function (json, container) {
$(container).append(dom); $(container).append(dom);
json.panels.forEach(function (subpanel) { json.panels.forEach(function (subpanel) {
console.log(subpanel); console.log("Layout: Subpanel "+ subpanel);
var subcont = $("<div>").attr("data-container", "cycleContainer"); var subcont = $("<div>").attr("data-container", "cycleContainer");
$(dom).append(subcont); $(dom).append(subcont);
var subsubpanel = layout.processLayout(subpanel, subcont); var subsubpanel = layout.processLayout(subpanel, subcont);
...@@ -200,7 +204,7 @@ layout.processLayout = function (json, container) { ...@@ -200,7 +204,7 @@ layout.processLayout = function (json, container) {
return thisCycler; return thisCycler;
case "panel": case "panel":
if (json.name == "") { if (json.name == "") {
layout.error(json); console.error("Layout: " + json);
} }
var innerDOM = $("<div>") var innerDOM = $("<div>")
...@@ -216,7 +220,7 @@ layout.processLayout = function (json, container) { ...@@ -216,7 +220,7 @@ layout.processLayout = function (json, container) {
return panelWrapper; return panelWrapper;
default: default:
layout.error(json); console.error("Layout: " + json);
break; break;
} }
} }
...@@ -267,7 +271,7 @@ layout.insertTemplate = function (wrap) { ...@@ -267,7 +271,7 @@ layout.insertTemplate = function (wrap) {
try { try {
panel.js.hide.call(panel.js); panel.js.hide.call(panel.js);
} catch (ex) { } catch (ex) {
console.log("Layout: exception when running hide for " + panel.name + "\n" + ex); console.log("Layout: Exception when running hide for " + panel.name + "\n" + ex);
} }
} }
//show function //show function
...@@ -334,12 +338,12 @@ layout.insertTemplate = function (wrap) { ...@@ -334,12 +338,12 @@ layout.insertTemplate = function (wrap) {
} }
var n = this.name; var n = this.name;
$.get("panels/" + n + "/template.html", function (k) { $.get("panels/" + n + "/template.html", function (k) {
console.log("get success of template " + n) console.log("Layout: Get success for template " + n + ".")
e.template = k; e.template = k;
doMore(); doMore();
}, "text") }, "text")
.fail(function () { .fail(function () {
layout.error("get fail of template " + n); console.error("Layout: Get failed for template " + n + ".");
}); });
...@@ -347,26 +351,26 @@ layout.insertTemplate = function (wrap) { ...@@ -347,26 +351,26 @@ layout.insertTemplate = function (wrap) {
t.css.on("load", function () { t.css.on("load", function () {
console.log("get success of style " + n); console.log("Layout: Get success for style " + n + ".");
e.css = t.css; e.css = t.css;
doMore(); doMore();
}); });
/*.fail(function() { /*.fail(function() {
layout.error("get fail of style " + n); console.error("Layout: Get fail for style " + n + ".");
});*/ });*/
$("head").append(t.css); $("head").append(t.css);
$.get("panels/" + n + "/script.js", function (k) { $.get("panels/" + n + "/script.js", function (k) {
console.log("get success of script " + n) console.log("Layout: Get success for script " + n + ".")
e.js = k; e.js = k;
doMore(); doMore();
}, "text") }, "text")
.fail(function (e) { .fail(function (e) {
layout.error("get fail of script " + n); console.error("Layout: Get fail for script " + n + ".");
console.log(e); console.log("Layout: " + e);
}); });
} }
...@@ -376,7 +380,7 @@ layout.insertTemplate = function (wrap) { ...@@ -376,7 +380,7 @@ layout.insertTemplate = function (wrap) {
layout.loadLayout = function (layoutname) { layout.loadLayout = function (layoutname) {
var w = "config/layouts/" + layoutname + ".json"; var w = "config/layouts/" + layoutname + ".json";
console.log(w); console.log("Layout: " + w);
$.get(w, function (e) { $.get(w, function (e) {
var mainLayout = layout.processLayout(e, $("[data-container=main]")); var mainLayout = layout.processLayout(e, $("[data-container=main]"));
...@@ -391,11 +395,6 @@ layout.loadLayout = function (layoutname) { ...@@ -391,11 +395,6 @@ layout.loadLayout = function (layoutname) {
} }
}).fail(function () { }).fail(function () {
layout.error("get fail"); console.error("Layout: Get fail");
}); });
} }
layout.error = function (e) {
console.error("Layout: Error " + e);
}
...@@ -292,7 +292,6 @@ this.loaded = function(panel, config) { ...@@ -292,7 +292,6 @@ this.loaded = function(panel, config) {
renderAnalBackground = function() { renderAnalBackground = function() {
abgc.fillStyle = bgColor; abgc.fillStyle = bgColor;
console.log(analBGImg);
var var
bc = document.createElement('canvas'), bc = document.createElement('canvas'),
steps = Math.ceil(Math.log(analBGImg.width / (analogRad * 2)) / Math.log(2)) - 1, steps = Math.ceil(Math.log(analBGImg.width / (analogRad * 2)) / Math.log(2)) - 1,
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
*/ */
this.loaded = function(panel, config) { this.loaded = function(panel, config) {
console.log("departures: register with config [" + config + "]"); console.log("Departure: register with config [" + config + "]");
// TODO load config // TODO load config
var var
tplDeparture = $(panel).find('template[data-departure]').html(), tplDeparture = $(panel).find('template[data-departure]').html(),
...@@ -61,10 +61,10 @@ this.loaded = function(panel, config) { ...@@ -61,10 +61,10 @@ this.loaded = function(panel, config) {
} }
var update = function(config, fields) { var update = function(config, fields) {
console.log("departures: get data [" + config + "]"); console.log("Departure: get data [" + config + "]");
$.get("panels/departure/departures.php?config=" + config , function(decodedData) { $.get("panels/departure/departures.php?config=" + config , function(decodedData) {
console.log("departures: check vrrf errors [" + config + "]"); console.log("Departure: check vrrf errors [" + config + "]");
if (!!decodedData.errors) { if (!!decodedData.errors) {
var msg = ""; var msg = "";
for (var i in decodedData.errors) { for (var i in decodedData.errors) {
...@@ -80,7 +80,7 @@ var update = function(config, fields) { ...@@ -80,7 +80,7 @@ var update = function(config, fields) {
$(fields.vrrf.msge).css("display", "none"); $(fields.vrrf.msge).css("display", "none");
} }
console.log("departures: check error [" + config + "]"); console.log("Departure: check error [" + config + "]");
if (!!decodedData.error) { if (!!decodedData.error) {
$(fields.erro.ttle).html('InfoBoard - Error'); $(fields.erro.ttle).html('InfoBoard - Error');
$(fields.erro.msge).html(decodedData.error); $(fields.erro.msge).html(decodedData.error);
...@@ -90,7 +90,7 @@ var update = function(config, fields) { ...@@ -90,7 +90,7 @@ var update = function(config, fields) {
$(fields.erro.msge).css("display", "none"); $(fields.erro.msge).css("display", "none");
} }
console.log("departures: check information [" + config + "]"); console.log("Departure: check information [" + config + "]");
if (!!decodedData.info) { if (!!decodedData.info) {
$(fields.info.ttle).html('Information'); $(fields.info.ttle).html('Information');
$(fields.info.msge).html(decodedData.info); $(fields.info.msge).html(decodedData.info);
...@@ -101,7 +101,7 @@ var update = function(config, fields) { ...@@ -101,7 +101,7 @@ var update = function(config, fields) {
//$(fields.info.msge).css("display", "none"); //$(fields.info.msge).css("display", "none");
} }
console.log("departures: updating elements [" + config + "]"); console.log("Departure: updating elements [" + config + "]");
if (!!decodedData.lines) { if (!!decodedData.lines) {
for (var i = 0; i < 20; ++i) { for (var i = 0; i < 20; ++i) {
var var
...@@ -211,7 +211,7 @@ var getStringWidth = function(fontSize, string) { ...@@ -211,7 +211,7 @@ var getStringWidth = function(fontSize, string) {
} }
var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg) { var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg) {
console.log("departures: generating structure [" + config + "]"); console.log("Departure: generating structure [" + config + "]");
var var
buffer = null, buffer = null,
fields = { fields = {
...@@ -279,7 +279,7 @@ var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg ...@@ -279,7 +279,7 @@ var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg
} }
var buildDOM = function(config, fields) { var buildDOM = function(config, fields) {
console.log("departures: building dom [" + config + "]"); console.log("Departure: building dom [" + config + "]");
var elements = []; var elements = [];
elements.push(fields.info.self); elements.push(fields.info.self);
elements.push(fields.erro.self); elements.push(fields.erro.self);
......
...@@ -14,7 +14,7 @@ this.checkShowCondition = function() { ...@@ -14,7 +14,7 @@ this.checkShowCondition = function() {
return 0; return 0;
} else { } else {
console.log("LSF-View: Out Of Time"); console.log("LSF-View: Out Of Time");
return 0; //Skip Panel? return 0; //Skip Panel
} }
} }
...@@ -31,7 +31,7 @@ this.loaded = function(panel, config) { ...@@ -31,7 +31,7 @@ this.loaded = function(panel, config) {
fillTable(lsfViewJson); fillTable(lsfViewJson);
}).fail(function(jqxhr, textStatus, error) { }).fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error; var err = textStatus + ", " + error;
console.log("Request Failed: " + err); console.error("LSF-View: Request Failed: " + err);
}); });
} }
......
...@@ -43,7 +43,7 @@ this.loaded = function(panel, config) { ...@@ -43,7 +43,7 @@ this.loaded = function(panel, config) {
fillTable(json); fillTable(json);
}).fail(function(jqxhr, textStatus, error) { }).fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error; var err = textStatus + ", " + error;
console.log("Request Failed: " + err); console.error("MensaPlan: Request Failed: " + err);
}); });
} }
......
...@@ -55,7 +55,7 @@ this.show=function() { ...@@ -55,7 +55,7 @@ this.show=function() {
film = semester[film]; film = semester[film];
if (new Date(film.date).getTime() > now) { if (new Date(film.date).getTime() > now) {
nextMovie = film; nextMovie = film;
console.log(film); console.log("UFC: " + film);
break; break;
} }
} }
......
...@@ -36,7 +36,6 @@ this.checkShowCondition = function() { ...@@ -36,7 +36,6 @@ this.checkShowCondition = function() {
setNextWerbung() setNextWerbung()
} }
while(nextWerbung != werbungOriginalNext){ while(nextWerbung != werbungOriginalNext){
console.log("Werbung: IN LOOP");
enddateEl = werbung_config.files[nextWerbung].enddate.split("."); enddateEl = werbung_config.files[nextWerbung].enddate.split(".");
if(Date.now() <= Date.UTC(enddateEl[2], enddateEl[1], enddateEl[0])) { if(Date.now() <= Date.UTC(enddateEl[2], enddateEl[1], enddateEl[0])) {
return 20; return 20;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment