Skip to content

Commit

Permalink
Merge b762e5b into 16c9f70
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMayer committed Mar 3, 2019
2 parents 16c9f70 + b762e5b commit b7cca02
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 80 deletions.
28 changes: 28 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@
0.11.0
======

### v0.11.0-RC4 (2019/03/02 14:12 +00:00)
- [#886](https://github.com/CometVisu/CometVisu/pull/886) disable caching for schema and config files in text editor. Fixes pro… (@peuter)
- [#884](https://github.com/CometVisu/CometVisu/pull/884) include inobounce script from https://github.com/lazd/iNoBounce to di… (@peuter)
- [#883](https://github.com/CometVisu/CometVisu/pull/883) delay backdrop validation when this.width === this.height === 0. Fixe… (@peuter)
- [#882](https://github.com/CometVisu/CometVisu/pull/882) fix wrong overflow declaration (which broke the scrolling behaviour o… (@peuter)
- [#879](https://github.com/CometVisu/CometVisu/pull/879) no undefined checks because the values might be null, fixes error whe… (@peuter)
- [#881](https://github.com/CometVisu/CometVisu/pull/881) add filter to allow sentry.io XHR requests in mockup mode. (@peuter)
- [#878](https://github.com/CometVisu/CometVisu/pull/878) Fix template parser (@peuter)
- [#880](https://github.com/CometVisu/CometVisu/pull/880) enable sentry reports in demo-source (@ChristianMayer, @peuter)
- [#877](https://github.com/CometVisu/CometVisu/pull/877) do not override grid settings when tooltip is enabled (@peuter)

### v0.11.0-RC3 (2019/02/18 21:29 +00:00)
- [#875](https://github.com/CometVisu/CometVisu/pull/875) Make sure elements are correctly positioned after page switch (@ChristianMayer)
- [#872](https://github.com/CometVisu/CometVisu/pull/872) update version hints in demo mode (@peuter)
- [#871](https://github.com/CometVisu/CometVisu/pull/871) update version hints in demo mode (@peuter)
- [#870](https://github.com/CometVisu/CometVisu/pull/870) Place RSSLOG database file in the config/media directory (@ChristianMayer)
- [#869](https://github.com/CometVisu/CometVisu/pull/869) init active state on load (@peuter)
- [#867](https://github.com/CometVisu/CometVisu/pull/867) fix doc version path links if they differ from the real version name (@peuter)
- [#868](https://github.com/CometVisu/CometVisu/pull/868) Feature close popups (@peuter)
- [#866](https://github.com/CometVisu/CometVisu/pull/866) fix the listener id generation and the update listeners callback para… (@peuter)
- [#865](https://github.com/CometVisu/CometVisu/pull/865) close popups when the corresponding page is left. (@peuter)
- [#863](https://github.com/CometVisu/CometVisu/pull/863) Fix demo flat (@ChristianMayer)
- [#861](https://github.com/CometVisu/CometVisu/pull/861) Sync Develop with Release 0.11.0-RC1 (@peuter, @ChristianMayer)

### v0.11.0-RC2 (2019/02/16 18:19 +00:00)
- [#859](https://github.com/CometVisu/CometVisu/pull/859) fix address regex (@peuter)
- [#860](https://github.com/CometVisu/CometVisu/pull/860) make sure that record logs are not confused with console debug log messages (@peuter)

### 0.11.0-RC1 (2019/02/07 06:47 +00:00)
- [#858](https://github.com/CometVisu/CometVisu/pull/858) Better handling of version tags (@ChristianMayer)
- [#856](https://github.com/CometVisu/CometVisu/pull/856) Prepare 0.11.0 release: change log and icons (@ChristianMayer)
Expand Down
16 changes: 16 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"source",
"source-all",
"source-hybrid",
"source-hybrid-error",
"source-server",
"source-error",
"source-server-reload",
Expand Down Expand Up @@ -134,6 +135,9 @@
},
{
"uri" : "resource/libs/favico.js"
},
{
"uri" : "resource/libs/inobounce.min.js"
}
],
"copy-files" :
Expand All @@ -151,6 +155,7 @@
"resource/libs/strftime.js",
"resource/libs/favico.js",
"resource/sentry/bundle.min.js",
"resource/libs/inobounce.min.js",
"editor",
"upgrade",
"check_config.php",
Expand Down Expand Up @@ -315,6 +320,17 @@
"extend" : [ "parts-config" ]
},

"source-hybrid-error" :
{
"extend" : [ "source-hybrid" ],
"environment" :
{
"cv.build": "source",
"cv.sentry": true,
"qx.globalErrorHandling": true
}
},

"update-version": {
"shell" :
{
Expand Down
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.12.0-dev",
"version": "0.11.0-RC4",
"repository": {
"type": "git",
"url": "https://github.com/cometvisu/cometvisu.git"
Expand Down
34 changes: 34 additions & 0 deletions source/class/cv/io/Mockup.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,40 @@ qx.Class.define('cv.io.Mockup', {
i: new Date().getTime(),
d: cv.Config.initialDemoData.states
});
if (cv.Config.initialDemoData.xhr) {
this.__xhr = cv.Config.initialDemoData.xhr;
// configure server
qx.dev.FakeServer.getInstance().addFilter(function (method, url) {
return url.startsWith('https://sentry.io');
}, this);
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));
}

if (cv.Config.initialDemoData.sequence) {
this.__sequence = cv.Config.initialDemoData.sequence;
this._startSequence();
Expand Down
6 changes: 4 additions & 2 deletions source/class/cv/parser/WidgetParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ qx.Class.define('cv.parser.WidgetParser', {
}, this);

if (this.__templates.hasOwnProperty(templateName)) {
var renderedString = qx.bom.Template.render(this.__templates[templateName], variables);
var renderedString = qx.bom.Template.render(this.__templates[templateName], variables).replace('\n', '').trim();
var div = document.createElement('div');
qx.bom.element.Attribute.set(div, 'html', renderedString.substring(6, renderedString.length - 7).trim());
// replace existing element with the rendered template (without <root> </root>)
elem.outerHTML = renderedString.substring(6, renderedString.length - 7);
elem.parentNode.replaceChild(div.firstChild, elem);
}
}, this);
},
Expand Down
2 changes: 1 addition & 1 deletion source/class/cv/plugins/OpenweatherMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @since 0.9.0
* @asset(plugins/openweathermap/owm_core.js,
* plugins/openweathermap/owm_basic_style.css,
* plugins/openweathermap/owm_weather_icon.css)
* plugins/openweathermap/owm_weathericon.css)
*/
qx.Class.define('cv.plugins.OpenweatherMap', {
extend: cv.ui.structure.AbstractBasicWidget,
Expand Down
3 changes: 2 additions & 1 deletion source/class/cv/plugins/diagram/AbstractDiagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ qx.Class.define('cv.plugins.diagram.AbstractDiagram', {
});
}
if (this.getTooltip()) {
qx.lang.Object.mergeWith(options, {grid: {hoverable: true, clickable: true}});
options.grid.hoverable = true;
options.grid.clickable = true;
}

if (!isPopup && !this.getPreviewlabels()) {
Expand Down
153 changes: 85 additions & 68 deletions source/class/cv/ui/layout/ResizeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ qx.Class.define('cv.ui.layout.ResizeHandler', {
height: 0,
__initial: true,

__backdropRetries: 0,

validationQueue: [],

reset: function() {
Expand Down Expand Up @@ -120,84 +122,99 @@ qx.Class.define('cv.ui.layout.ResizeHandler', {
if ('2d' === page.getPageType()) {
var
cssPosRegEx = /(\d*)(.*)/,
backdrop = qx.bom.Selector.query("div > "+page.getBackdropType(), page.getDomElement())[0],
backdropSVG = page.getBackdropType() === 'embed' ? backdrop.getSVGDocument() : null,
backdropBBox = backdropSVG ? backdropSVG.children[0].getBBox() : {},
backdropNWidth = backdrop.naturalWidth || backdropBBox.width || this.width,
backdropNHeight = backdrop.naturalHeight || backdropBBox.height || this.height,
backdropScale = Math.min(this.width / backdropNWidth, this.height / backdropNHeight),
backdropWidth = backdropNWidth * backdropScale,
backdropHeight = backdropNHeight * backdropScale,
backdropPos = page.getBackdropAlign().split(' '),
backdropLeftRaw = backdropPos[0].match(cssPosRegEx),
backdropTopRaw = backdropPos[1].match(cssPosRegEx),
backdropLeft = backdropLeftRaw[2] === '%' ? (this.width > backdropWidth ? ((this.width - backdropWidth ) * (+backdropLeftRaw[1]) / 100) : 0) : +backdropLeftRaw[1],
backdropTop = backdropTopRaw[2] === '%' ? (this.height > backdropHeight ? ((this.height - backdropHeight) * (+backdropTopRaw[1] ) / 100) : 0) : +backdropTopRaw[1],
uagent = navigator.userAgent.toLowerCase();

if (backdrop.complete === false || (page.getBackdropType() === 'embed' && backdropSVG === null)) {
// backdrop not available yet - reload
qx.event.Timer.once(this.invalidateBackdrop, this, 100);
return;
}
backdrop = qx.bom.Selector.query("div > "+page.getBackdropType(), page.getDomElement())[0];
try {
var backdropSVG = page.getBackdropType() === 'embed' ? backdrop.getSVGDocument() : null;
var backdropBBox = backdropSVG ? backdropSVG.children[0].getBBox() : {},
backdropNWidth = backdrop.naturalWidth || backdropBBox.width || this.width,
backdropNHeight = backdrop.naturalHeight || backdropBBox.height || this.height,
backdropScale = Math.min(this.width / backdropNWidth, this.height / backdropNHeight),
backdropWidth = backdropNWidth * backdropScale,
backdropHeight = backdropNHeight * backdropScale,
backdropPos = page.getBackdropAlign().split(' '),
backdropLeftRaw = backdropPos[0].match(cssPosRegEx),
backdropTopRaw = backdropPos[1].match(cssPosRegEx),
backdropLeft = backdropLeftRaw[2] === '%' ? (this.width > backdropWidth ? ((this.width - backdropWidth ) * (+backdropLeftRaw[1]) / 100) : 0) : +backdropLeftRaw[1],
backdropTop = backdropTopRaw[2] === '%' ? (this.height > backdropHeight ? ((this.height - backdropHeight) * (+backdropTopRaw[1] ) / 100) : 0) : +backdropTopRaw[1],
uagent = navigator.userAgent.toLowerCase();

if (backdrop.complete === false ||
(page.getBackdropType() === 'embed' && backdropSVG === null) ||
(backdropBBox.width === 0 && backdropBBox.height === 0) ||
(this.width === 0 && this.height === 0)
) {
// backdrop not available yet - reload
qx.event.Timer.once(this.invalidateBackdrop, this, 100);
return;
}

// Note 1: this here is a work around for older browsers that can't use
// the object-fit property yet.
// Currently (26.05.16) only Safari is known to not support
// object-position although object-fit itself does work
// Note 2: The embed element allways needs it
if (
page.getBackdropType() === 'embed' ||
( uagent.indexOf('safari') !== -1 && uagent.indexOf('chrome') === -1 )
) {
qx.bom.element.Style.setStyles(backdrop, {
width: backdropWidth + 'px',
height: backdropHeight + 'px',
left: backdropLeft + 'px',
top: backdropTop + 'px'
});
}
// Note 1: this here is a work around for older browsers that can't use
// the object-fit property yet.
// Currently (26.05.16) only Safari is known to not support
// object-position although object-fit itself does work
// Note 2: The embed element allways needs it
if (
page.getBackdropType() === 'embed' ||
( uagent.indexOf('safari') !== -1 && uagent.indexOf('chrome') === -1 )
) {
qx.bom.element.Style.setStyles(backdrop, {
width: backdropWidth + 'px',
height: backdropHeight + 'px',
left: backdropLeft + 'px',
top: backdropTop + 'px'
});
}

qx.bom.Selector.query('.widget_container', page.getDomElement()).forEach(function (widgetContainer) {
var widget = cv.ui.structure.WidgetFactory.getInstanceById(widgetContainer.id);
var value;
var layout = widget.getResponsiveLayout();
var scale = backdropScale;
if (layout) {
// this assumes that a .widget_container has only one child and this
// is the .widget itself
var style = widgetContainer.children[0].style;
if (layout.scale === 'false') {
scale = 1.0;
}
qx.bom.Selector.query('.widget_container', page.getDomElement()).forEach(function (widgetContainer) {
var widget = cv.ui.structure.WidgetFactory.getInstanceById(widgetContainer.id);
var value;
var layout = widget.getResponsiveLayout();
var scale = backdropScale;
if (layout) {
// this assumes that a .widget_container has only one child and this
// is the .widget itself
var style = widgetContainer.children[0].style;
if (layout.scale === 'false') {
scale = 1.0;
}

if ('x' in layout) {
value = layout.x.match(cssPosRegEx);
if ('px' === value[2]) {
style.left = (backdropLeft + value[1] * scale) + 'px';
} else {
style.left = layout.x;
if ('x' in layout) {
value = layout.x.match(cssPosRegEx);
if ('px' === value[2]) {
style.left = (backdropLeft + value[1] * scale) + 'px';
} else {
style.left = layout.x;
}
}
}

if ('y' in layout) {
value = layout.y.match(cssPosRegEx);
if ('px' === value[2]) {
style.top = (backdropTop + value[1] * scale) + 'px';
} else {
style.top = layout.y;
if ('y' in layout) {
value = layout.y.match(cssPosRegEx);
if ('px' === value[2]) {
style.top = (backdropTop + value[1] * scale) + 'px';
} else {
style.top = layout.y;
}
}
}

if ('width' in layout) {
style.width = layout.width;
}
if ('width' in layout) {
style.width = layout.width;
}

if ('height' in layout) {
style.height = layout.height;
if ('height' in layout) {
style.height = layout.height;
}
}
}, this);
this.__backdropRetries = 0;
} catch (e) {
if (e.name === 'NotSupportedError') {
if (this.__backdropRetries <= 5) {
qx.bom.AnimationFrame.request(this.__makeBackdropValid, this);
this.__backdropRetries++;
}
}
}, this);
qx.log.Logger.error(this, e);
}
}

this.states.setBackdropInvalid(false);
Expand Down
4 changes: 2 additions & 2 deletions source/class/cv/ui/structure/pure/PageJump.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ qx.Class.define('cv.ui.structure.pure.PageJump', {
var markPageJumps = function(parentName, elem) {
var data = model.getWidgetDataByElement(elem);
if (parentName === data.target || (data.activeScope === "path" && (
data.path !== undefined && data.path.match(parentName + "$") ||
data.targetPath !== undefined && data.targetPath.match(parentName + "$"))
qx.lang.Type.isString(data.path) && data.path.match(parentName + "$") ||
qx.lang.Type.isString(data.targetPath) && data.targetPath.match(parentName + "$"))
)) {
qx.bom.element.Class.add(elem, 'active_ancestor');
}
Expand Down
5 changes: 3 additions & 2 deletions source/editor/text/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@
configSuffix = "_"+parts[1];
}
});
var noCacheSuffix = '?' + Date.now();

require([
'xml!*../../resource/visu_config.xsd',
'xml!*../../resource/config/visu_config'+configSuffix+'.xml',
'xml!*../../resource/visu_config.xsd' + noCacheSuffix,
'xml!*../../resource/config/visu_config'+configSuffix+'.xml' + noCacheSuffix,
'vs/editor/editor.main'], function(schema, code) {

worker.postMessage(["openFile", {
Expand Down
3 changes: 2 additions & 1 deletion source/resource/designs/metal/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,8 @@ body br
#pages > .page
{
float:left;
overflow: hidden auto;
overflow-y: auto;
overflow-x: hidden;
position: relative;
padding-left: 1px;
}
Expand Down
11 changes: 11 additions & 0 deletions source/resource/libs/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
inobounce.min.js license:

Copyright (c) 2013, Lawrence Davis
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Loading

0 comments on commit b7cca02

Please sign in to comment.