feat(app): allow opening files from web server.

With URL param 'bpmndoc' a filename of a document can be specified that will be loaded from the server and then rendered.
This commit is contained in:
jdotzki 2014-04-08 19:16:11 +02:00
parent 90e0d458b3
commit 46d60f9d64
2 changed files with 3707 additions and 0 deletions

View File

@ -110,6 +110,33 @@
createNewDiagram();
});
//Special debug modus to open a file from web servers root.
(function loadFromServer() {
var bpmnDoc = getQueryVariable('bpmndoc');
if(bpmnDoc) {
var client = new XMLHttpRequest();
client.open('GET', bpmnDoc);
client.onreadystatechange = function () {
console.log('Opening: ' + bpmnDoc);
openDiagram(client.responseText);
}
client.send();
}
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] === variable) {
return pair[1];
}
}
return(false);
}
})();
var downloadLink = $('#js-download-diagram');
var downloadSvgLink = $('#js-download-svg');

3680
example/complex.bpmn Normal file

File diff suppressed because it is too large Load Diff