Initial fix for defect #162.

This commit is contained in:
knsv
2015-05-29 08:23:13 +02:00
parent ca99a30b71
commit 6864652b80
15 changed files with 399 additions and 9530 deletions

View File

@@ -18,7 +18,8 @@ var funs = [];
* @param style
*/
exports.addVertex = function (id, text, type, style) {
var txt;
if(typeof id === 'undefined'){
return;
}
@@ -30,7 +31,14 @@ exports.addVertex = function (id, text, type, style) {
vertices[id] = {id: id, styles: [], classes:[]};
}
if (typeof text !== 'undefined') {
vertices[id].text = text.trim();
txt = text.trim();
// strip quotes if string starts and exnds with a quote
if(txt[0] === '"' && txt[txt.length-1] === '"'){
txt = txt.substring(1,txt.length-1);
}
vertices[id].text = txt;
}
if (typeof type !== 'undefined') {
vertices[id].type = type;
@@ -61,6 +69,11 @@ exports.addLink = function (start, end, type, linktext) {
if (typeof linktext !== 'undefined') {
edge.text = linktext.trim();
// strip quotes if string starts and exnds with a quote
if(edge.text[0] === '"' && edge.text[edge.text.length-1] === '"'){
edge.text = edge.text.substring(1,edge.text.length-1);
}
}
if (typeof type !== 'undefined') {