Skip to content

Commit

Permalink
Merge branch 'develop' into release-0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMayer committed Mar 2, 2019
2 parents 3a5283f + 16c9f70 commit 799157f
Show file tree
Hide file tree
Showing 20 changed files with 2,320 additions and 680 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "CometVisu",
"description": "The CometVisu is an interactive, realtime, web based visualization. It can be used to access the KNX bus or with the OpenHAB backend everything in the OpenHAB world.",
"version": "0.11.0-RC4",
"version": "0.12.0-dev",
"repository": {
"type": "git",
"url": "https://github.com/cometvisu/cometvisu.git"
Expand Down
31 changes: 31 additions & 0 deletions source/class/cv/io/Mockup.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,37 @@ qx.Class.define('cv.io.Mockup', {
window._getWidgetDataModel = model.getWidgetDataModel.bind(model);
window.writeHistory = [];

if (qx.core.Environment.get('cv.testMode') && cv.Config.initialDemoData && cv.Config.initialDemoData.xhr) {
this.__xhr = cv.Config.initialDemoData.xhr;
// configure server
var server = qx.dev.FakeServer.getInstance().getFakeServer();
server.respondWith(function (request) {
var url = cv.report.Record.normalizeUrl(request.url);
if (url.indexOf("nocache=") >= 0) {
url = url.replace(/[\?|&]nocache=[0-9]+/, "");
}
if (!this.__xhr[url] || this.__xhr[url].length === 0) {
qx.log.Logger.error(this, "404: no logged responses for URI " + url + " found");
} else {
qx.log.Logger.debug(this, "faking response for " + url);
var response = "";
if (this.__xhr[url].length === 1) {
response = this.__xhr[url][0];
} else {
// multiple responses recorded use them as LIFO stack
response = this.__xhr[url].shift();
}

if (request.readyState === 4 && request.status === 404) {
// This is a hack, sometimes the request has a 404 status and send readystate
// the respond would fail if we do not override it here
request.readyState = 1;
}
request.respond(response.status, response.headers, qx.lang.Json.stringify(response.body));
}
}.bind(this));
}

this.addresses = [];
},

Expand Down
36 changes: 30 additions & 6 deletions source/class/cv/plugins/OpenweatherMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
* This plugins integrates OpenWeatherMap data.
*
* @author Stefan Borchert (stefan@borchert.cc)
* @author Matthias
* @since 0.9.0
* @asset(plugins/openweathermap/owm/jquery.owm.js,plugins/openweathermap/openweathermap.css)
* @asset(plugins/openweathermap/owm_core.js,
* plugins/openweathermap/owm_basic_style.css,
* plugins/openweathermap/owm_weather_icon.css)
*/
qx.Class.define('cv.plugins.OpenweatherMap', {
extend: cv.ui.structure.AbstractBasicWidget,
Expand Down Expand Up @@ -75,14 +78,18 @@ qx.Class.define('cv.plugins.OpenweatherMap', {
return {
'class': { target: 'cssClass' },
'lang': { },
'owID': { },
'q': { },
'lat': { },
'lon': { },
'units': { },
'type': { },
'forecastItems': { },
'forecast24hItems': { },
'forecastDailyItems': { },
'detailItems': { },
'appid': { }
'showSunrise': { },
'appid': { },
'description': { }
};
}
},
Expand All @@ -101,6 +108,10 @@ qx.Class.define('cv.plugins.OpenweatherMap', {
check: "String",
nullable: true
},
owID: {
check: "String",
nullable: true
},
q: {
check: "String",
nullable: true
Expand All @@ -121,7 +132,15 @@ qx.Class.define('cv.plugins.OpenweatherMap', {
check: "String",
nullable: true
},
forecastItems: {
forecast24hItems: {
check: "String",
nullable: true
},
forecastDailyhItems: {
check: "String",
nullable: true
},
showSunrise: {
check: "String",
nullable: true
},
Expand All @@ -132,6 +151,10 @@ qx.Class.define('cv.plugins.OpenweatherMap', {
appid: {
check: "String",
nullable: true
},
description: {
check: "String",
nullable: true
}
},

Expand Down Expand Up @@ -166,8 +189,9 @@ qx.Class.define('cv.plugins.OpenweatherMap', {

defer: function(statics) {
var loader = cv.util.ScriptLoader.getInstance();
loader.addStyles('plugins/openweathermap/openweathermap.css');
loader.addScripts('plugins/openweathermap/owm/jquery.owm.js');
loader.addStyles('plugins/openweathermap/owm_basic_style.css');
loader.addStyles('plugins/openweathermap/owm_weathericon.css');
loader.addScripts('plugins/openweathermap/owm_core.js');
// register the parser
cv.parser.WidgetParser.addHandler("openweathermap", cv.plugins.OpenweatherMap);
cv.ui.structure.WidgetFactory.registerClass("openweathermap", statics);
Expand Down
9 changes: 9 additions & 0 deletions source/resource/demo/media/demo_testmode_data.json

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion source/resource/demo/media/testmode.css
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,19 @@ html .page .widget.multitrigger.custom_one-line .actor_container {
margin-bottom: -1px;
}

.page.type_text .clearfix.weather-forecast .clearfix {
display: block !important;
}

.page.type_text .clearfix.weather-forecast .clearfix .widget_container.jowm .weather-forecast {
margin: 0 .5rem;
}

.page.type_text > .clearfix > .widget_container[data-type="navbar"] {
display: none;
}

.page.type_text > .clearfix .widget_container {
.page.type_text > .clearfix .widget_container:not(.jowm) {
float: none;
width: auto !important;
}
Expand All @@ -188,6 +196,10 @@ html .page .widget.multitrigger.custom_one-line .actor_container {
grid-column-end: span 12;
}

.page.type_text > .clearfix .widget_container.width-75 {
grid-column-end: span 9;
}

.page.type_text > .clearfix .widget_container.width-50 {
grid-column-end: span 6;
}
Expand Down
Loading

0 comments on commit 799157f

Please sign in to comment.