From: Thierry Parmentelat Date: Thu, 12 Dec 2013 21:19:56 +0000 (+0100) Subject: more fixes to the googlemap - querytable - queryupdater trio X-Git-Tag: myslice-0.3-0~89^2^2~3 X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=commitdiff_plain;h=354c5d2314bfd73dfc3520d2ef9845dd4c6e6200 more fixes to the googlemap - querytable - queryupdater trio changes in the googlemap should now properly propagate to querytable --- diff --git a/manifold/static/js/plugin.js b/manifold/static/js/plugin.js index e2781295..ce5be64d 100644 --- a/manifold/static/js/plugin.js +++ b/manifold/static/js/plugin.js @@ -201,8 +201,11 @@ var Plugin = Class.extend({ // > "ple.aluiple.host147-82-static\.93-94-b\.business\.telecomitalia\.it" // flat_id(input) // "ple-aluiple-host147-82-static-93-94-b-business-telecomitalia-it" + // input="urn:publicid:IDN+ple:nicta+node+planetlab2-research-nicta-com-au" + // flat_id(input) + // urn-publicid-IDN-ple-nicta-node-planetlab2-research-nicta-com-au flat_id : function (id_in) { - return id_in.replace(/\\\./g,"-").replace(/\\/g,"-").replace(/\./g,"-"); + return id_in.replace(/\\\./g,"-").replace(/\\/g,"-").replace(/\./g,"-").replace(/:/g,'-').replace(/\+/g,'-'); }, // escape (read: backslashes) some meta-chars in input diff --git a/plugins/googlemap/static/js/googlemap.js b/plugins/googlemap/static/js/googlemap.js index 2feb424c..764f1b49 100644 --- a/plugins/googlemap/static/js/googlemap.js +++ b/plugins/googlemap/static/js/googlemap.js @@ -157,10 +157,9 @@ }, set_checkbox_from_data: function(id, checked) { - var id=record [this.canonical_key]; var checkbox = this.by_id [ id ]; if (checkbox) checkbox.prop('checked',checked); - else this.warning(record, "googlemap.set_checkbox_from_data - not found "+init_id); + else messages.warning("googlemap.set_checkbox_from_data - id not found "+id); }, // this record is *in* the slice diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index ebfb833d..410a0825 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -168,7 +168,7 @@ // create a checkbox tag // computes 'id' attribute from canonical_key (using flat_id) - // computes 'common_id' from init_key for initialization phase + // computes 'init_id' from init_key for initialization phase checkbox_html : function (record) { var result=""; // Prefix id with plugin_uuid @@ -180,11 +180,11 @@ id = this.flat_id(id) // if (debug) messages.debug("checkbox_html, id="+id); result += " id='" + id + "'"; - // compute common_id too - var common_id=record[this.init_key]; - common_id=this.flat_id(common_id); + // compute init_id too + var init_id=record[this.init_key]; + init_id=this.flat_id(init_id); // wrap up - result += "common_id='" + common_id + "'"; + result += "init_id='" + init_id + "'"; // set value for posting events upon user's clicks result += " value='"+record[this.canonical_key]+"'"; result += " type='checkbox'"; @@ -271,9 +271,9 @@ // (because the argument record, if it comes from query, might not have canonical_key set set_checkbox_from_record: function (record, checked) { if (checked === undefined) checked = true; - var common_id = this.flat_id(record[this.init_key]); - if (debug) messages.debug("set_checkbox_from_record, common_id="+common_id); - var element = this.table.$('[common_id="'+common_id+'"]'); + var init_id = this.flat_id(record[this.init_key]); + if (debug) messages.debug("set_checkbox_from_record, init_id="+init_id); + var element = this.table.$('[init_id="'+init_id+'"]'); element.attr('checked',checked); },