X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fquerycode%2Fquerycode.js;h=0898e4a68e7eb724e4c74842b763eb35a8f98d5b;hb=00c607ef9000811b027330152e09b4da8c46ad02;hp=e8719c3a9d5db49440dd518d4d52b58df3fdd24d;hpb=a2ae7986853adb271361957a08effd0c9537e7a3;p=unfold.git diff --git a/plugins/querycode/querycode.js b/plugins/querycode/querycode.js index e8719c3a..0898e4a6 100644 --- a/plugins/querycode/querycode.js +++ b/plugins/querycode/querycode.js @@ -7,9 +7,6 @@ * License: GPLv3 */ -// xxx TODO -// . turn back on syntax highlighting - (function($) { var debug=false; @@ -28,8 +25,8 @@ var methods = { init : function (options) { - console.log("temporarily turned off SyntaxHighlighter ..."); -// SyntaxHighlighter.all(); + if (debug) console.log("SyntaxHighlighter.all ..."); + SyntaxHighlighter.all(); return this.each(function() { var $this=$(this); var data=$this.data('QueryCode'); @@ -76,18 +73,18 @@ 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"); -// SyntaxHighlighter.highlight() - + if (debug) console.log("SyntaxHighlighter.highlight"); + SyntaxHighlighter.highlight() } @@ -125,7 +122,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 +155,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; }