/**
- * MySlice QueryCode plugin
- * URL: http://trac.myslice.info
* Description: display code for a target query in python or ruby
- * Author: The MySlice Team
* Copyright (c) 2012 UPMC Sorbonne Universite - INRIA
* License: GPLv3
*/
var methods = {
init : function (options) {
- if (debug) console.log("SyntaxHighlighter.all ...");
+ if (debug) messages.debug("SyntaxHighlighter.all ...");
SyntaxHighlighter.all();
return this.each(function() {
var $this=$(this);
var channel='/results/' + options.query_uuid + '/updated';
/* passing $this as 2nd arg: callbacks will retrieve $this as e.data */
$.subscribe(channel, $this, update_plugin);
- if (debug) console.log('subscribing to ' + channel);
+ if (debug) messages.debug('subscribing to ' + channel);
$this.data('QueryCode', {options: options});
// react to changes to the language selector
$this.find(".querycode-lang").change(change_language);
},
// destroy : function( ) {
-// if (debug) console.log("QueryCode.destroy...");
+// if (debug) messages.debug("QueryCode.destroy...");
// },
// update : function( content ) {
-// if (debug) console.log("QueryCode.update...");
+// if (debug) messages.debug("QueryCode.update...");
// },
} // methods
funname="translate_query_as_" + lang;
fun=eval(funname);
if (! fun) {
- console.log("Cannot find translator function for lang " + lang);
+ messages.debug("Cannot find translator function for lang " + lang);
return;
}
html_code=fun(query);
dom.html(html_code);
- if (debug) console.log("SyntaxHighlighter.highlight");
+ if (debug) messages.debug("SyntaxHighlighter.highlight");
SyntaxHighlighter.highlight()
}
});
ofs = '[' + ofs + ']';
- output += 'pp srv.call("' + mixed_case(query.action) +'", auth, "' + query.subject + '", "' + query.timestamp + '", ' + ifs + ', ' + ofs + ')';
+ output += 'pp srv.call("' + mixed_case(query.action) +'", auth, "' + query.object + '", "' + query.timestamp + '", ' + ifs + ', ' + ofs + ')';
var output = '<pre class="brush: ruby; toolbar: false;">' + output + "</pre>";
return output;
});
ofs = '[' + ofs + ']';
- output += 'srv.' + mixed_case(query.action) + '(auth, "' + query.subject + '", ' + ifs + ', {}, ' + ofs + ')';
+ output += 'srv.' + mixed_case(query.action) + '(auth, "' + query.object + '", ' + ifs + ', {}, ' + ofs + ')';
var output = '<pre class="brush: python; toolbar: false;">' + output + "</pre>";
return output;
}