X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerycode%2Fquerycode.js;h=3574b30e9a7bb8672ccb763118e5c6bf94bf9fe0;hb=20835fc7deb0d149293351f032af6e5d9e4a1952;hp=e8719c3a9d5db49440dd518d4d52b58df3fdd24d;hpb=a2ae7986853adb271361957a08effd0c9537e7a3;p=unfold.git diff --git a/plugins/querycode/querycode.js b/plugins/querycode/querycode.js index e8719c3a..3574b30e 100644 --- a/plugins/querycode/querycode.js +++ b/plugins/querycode/querycode.js @@ -76,10 +76,11 @@ var lang=$plugindiv.find(".querycode-lang").val(); var dom=$plugindiv.find(".querycode-viz"); - var query = $plugindiv.data().QueryCode.options.query; + var query_uuid = $plugindiv.data().QueryCode.options.query_uuid; + var query=manifold.find_query(query_uuid); funname="translate_query_as_" + lang; fun=eval(funname); - if ( ! fun) { + if (! fun) { console.log("Cannot find translator function for lang " + lang); return; } @@ -125,7 +126,7 @@ }); ofs = '[' + ofs + ']'; - output += 'pp srv.call("' + mixed_case(query.action) +'", auth, "' + query.method + '", "' + query.timestamp + '", ' + ifs + ', ' + ofs + ')'; + output += 'pp srv.call("' + mixed_case(query.action) +'", auth, "' + query.subject + '", "' + query.timestamp + '", ' + ifs + ', ' + ofs + ')'; var output = '
' + output + "
"; return output; @@ -158,7 +159,7 @@ }); ofs = '[' + ofs + ']'; - output += 'srv.' + mixed_case(query.action) + '(auth, "' + query.method + '", ' + ifs + ', {}, ' + ofs + ')'; + output += 'srv.' + mixed_case(query.action) + '(auth, "' + query.subject + '", ' + ifs + ', {}, ' + ofs + ')'; var output = '
' + output + "
"; return output; }