X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerycode%2Fquerycode.js;h=65c6d0dc6f5ec54acbf36002e66fa9e8790b598f;hb=d89d22bf3efa4cee1897668189f2deacf83bb19c;hp=e8719c3a9d5db49440dd518d4d52b58df3fdd24d;hpb=a2ae7986853adb271361957a08effd0c9537e7a3;p=unfold.git diff --git a/plugins/querycode/querycode.js b/plugins/querycode/querycode.js index e8719c3a..65c6d0dc 100644 --- a/plugins/querycode/querycode.js +++ b/plugins/querycode/querycode.js @@ -28,7 +28,7 @@ var methods = { init : function (options) { - console.log("temporarily turned off SyntaxHighlighter ..."); + if (debug) console.log("temporarily turned off SyntaxHighlighter ..."); // SyntaxHighlighter.all(); return this.each(function() { var $this=$(this); @@ -76,16 +76,17 @@ 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; } html_code=fun(query); dom.html(html_code); - console.log("turned off SyntaxHighlighter.highlight"); + if (debug) console.log("turned off SyntaxHighlighter.highlight"); // SyntaxHighlighter.highlight() } @@ -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; }