Skip to content

Commit

Permalink
Merge 3c79af1 into f16ece7
Browse files Browse the repository at this point in the history
  • Loading branch information
peuter committed Oct 20, 2017
2 parents f16ece7 + 3c79af1 commit c49ce90
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 86 deletions.
74 changes: 8 additions & 66 deletions Gruntfile.js
@@ -1,5 +1,4 @@
// requires
var qx = require("./external/qooxdoo/tool/grunt");
var path = require('path');
var fs = require('fs');

Expand Down Expand Up @@ -92,57 +91,6 @@ module.exports = function(grunt) {

var config = {

generator_config: {
let: {
}
},

common: {
"APPLICATION" : "cv",
"QOOXDOO_PATH" : "./external/qooxdoo",
"LOCALES": ["en", "de"],
"QXTHEME": "cv.theme.Theme"
},

'http-server': {

'dev': {

// the server root directory
root: ".",

// the server port
// can also be written as a function, e.g.
// port: function() { return 8282; }
port: 9999,

// the host ip address
// If specified to, for example, "127.0.0.1" the server will
// only be available on that ip.
// Specify "0.0.0.0" to be available everywhere
host: "127.0.0.1",

showDir : true,
autoIndex: true,

// server default file extension
ext: "html",

// specify a logger function. By default the requests are
// sent to stdout.
// logFn: function(req, res, error) {},

// Proxies all requests which can't be resolved locally to the given url
// Note this this will disable 'showDir'
// proxy: "http://mybackendserver.com",

// Tell grunt task to open the browser
openBrowser : true

}

},

// license header adding
usebanner: {
dist: {
Expand Down Expand Up @@ -530,6 +478,12 @@ module.exports = function(grunt) {
'rm -rf release',
'mv build release'
].join('&&')
},
lint: {
command: './generate.py lint'
},
build: {
command: './generate.py build'
}
},

Expand Down Expand Up @@ -567,19 +521,7 @@ module.exports = function(grunt) {
}
}
};

var mergedConf = qx.config.mergeConfig(config);
grunt.initConfig(mergedConf);

qx.task.registerTasks(grunt);

// // 3. Where we tell Grunt we plan to use this plug-in.
// grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-http-server');

// // 4. Where we tell Grunt what to do when we type "grunt" into the terminal.
// grunt.registerTask('default', ['concat']);
grunt.registerTask('source-server-nodejs', ['http-server:dev']);
grunt.initConfig(config);

// custom task to update the version in the releases demo config
grunt.registerTask('update-demo-config', function() {
Expand Down Expand Up @@ -668,7 +610,7 @@ module.exports = function(grunt) {
grunt.registerTask('buildicons', ['clean:iconcache', 'svgmin', 'svgstore', 'handle-kuf-svg']);
grunt.registerTask('release-build', [ 'release-cv', 'release-client' ]);
grunt.registerTask('release-cv', [
'updateicons', 'lint', 'clean', 'file-creator', 'buildicons', 'build',
'updateicons', 'shell:lint', 'clean', 'file-creator', 'buildicons', 'shell:build',
'update-demo-config', 'chmod', 'shell:buildToRelease', 'compress:tar', 'compress:zip' ]);

grunt.registerTask('release-client', ['shell:buildClient', 'rename-client-build']);
Expand Down
2 changes: 1 addition & 1 deletion external/qooxdoo
Submodule qooxdoo updated 214 files
44 changes: 25 additions & 19 deletions source/class/cv/plugins/diagram/AbstractDiagram.js
Expand Up @@ -195,35 +195,39 @@ qx.Class.define('cv.plugins.diagram.AbstractDiagram', {
this.cache[ key ].waitingCallbacks.push( [ callback, callbackParameter ] );

if( this.cache[ key ].waitingCallbacks.length === 1 ) {
if (this.cache[ key ].xhr) {
this.cache[ key ].xhr.dispose();
}
var xhr = new qx.io.request.Xhr(url);
xhr.set({
accept: "application/json"
});
xhr.addListener("success", function( ev ) {
var rrddata = ev.getTarget().getResponse();
if (rrddata !== null) {
// calculate timestamp offset and scaling
var millisOffset = (rrd.offset ? rrd.offset * 1000 : 0);
for (var j = 0; j < rrddata.length; j++) {
rrddata[j][0] = rrddata[j][0] + millisOffset;
rrddata[j][1] = parseFloat(rrddata[j][1][rrd.dsIndex]) * rrd.scaling;
}
}
this.cache[key].data = rrddata;
this.cache[key].timestamp = Date.now();

this.cache[key].waitingCallbacks.forEach(function (waitingCallback) {
waitingCallback[0](this.cache[key].data, waitingCallback[1]);
}, this);
this.cache[key].waitingCallbacks.length = 0; // empty array)
}, this);

xhr.addListener("success", qx.lang.Function.curry(this._onSuccess, rrd, key), this);
this.cache[ key ].xhr = xhr;
xhr.send();
}
} else {
callback( this.cache[key].data, callbackParameter );
}
},

_onSuccess: function(rrd, key, ev) {
var rrddata = ev.getTarget().getResponse();
if (rrddata !== null) {
// calculate timestamp offset and scaling
var millisOffset = (rrd.offset ? rrd.offset * 1000 : 0);
for (var j = 0; j < rrddata.length; j++) {
rrddata[j][0] = rrddata[j][0] + millisOffset;
rrddata[j][1] = parseFloat(rrddata[j][1][rrd.dsIndex]) * rrd.scaling;
}
}
this.cache[key].data = rrddata;
this.cache[key].timestamp = Date.now();

this.cache[key].waitingCallbacks.forEach(function (waitingCallback) {
waitingCallback[0](rrddata, waitingCallback[1]);
}, this);
this.cache[key].waitingCallbacks.length = 0; // empty array)
}
},

Expand Down Expand Up @@ -633,6 +637,8 @@ qx.Class.define('cv.plugins.diagram.AbstractDiagram', {
plot.setData(fulldata);
plot.setupGrid();
plot.draw();

loadedData = [];
}

}.bind(this));
Expand Down

0 comments on commit c49ce90

Please sign in to comment.