From bab62cfb3e8bd2769ad19ed5e9d70d4d407d95ed Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 13 Mar 2013 19:13:52 +0100 Subject: [PATCH] querycode a bit better - still has a zombie spinner and no highlighting --- plugins/static/js/querycode.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/plugins/static/js/querycode.js b/plugins/static/js/querycode.js index a48ff37b..b4165cb1 100644 --- a/plugins/static/js/querycode.js +++ b/plugins/static/js/querycode.js @@ -16,10 +16,16 @@ function debug_object (msg, o) { console.log (msg + " Keys : " + keys); } +// xxx TODO +// . the spinner is still turning after the first refresh - find a means to shut it down completely +// . turn back on syntax highlighting + (function($) { var methods = { init : function (options) { + console.log("temporarily turned off SyntaxHighlighter ..."); +// SyntaxHighlighter.all(); return this.each(function() { var $this=$(this); var data=$this.data('QueryCode'); @@ -32,11 +38,11 @@ function debug_object (msg, o) { $this.data('QueryCode', {options: options}); // react to changes to the language selector $this.find(".querycode-lang").change(change_language); + // publish so we refresh ourselves + $.publish(channel,"please_init_yourself"); } }); - console.log("temporarily turned off SyntaxHighlighter ..."); -// SyntaxHighlighter.all(); }, @@ -46,11 +52,6 @@ function debug_object (msg, o) { // update : function( content ) { // if (querycode_debug) console.log("QueryCode.update..."); // }, - trigger : function () { - var channel='/results/' + $(this).data.QueryCode.options.query_uuid + '/updated'; - publish(channel,"trigger"); - } - } // methods @@ -175,11 +176,5 @@ function debug_object (msg, o) { return output; } - - - // get these plugins to update their contents upon loading - // manually publishing on the right channel -// $(function () { $(".QueryCode").each(function () { this.trigger(); })}) - })(jQuery); // end closure wrapper -- 2.43.0