// > "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
},
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
// create a checkbox <input> 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
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'";
// (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);
},