id_from_key: function(key_field, value) {
- return key_field + manifold.separator + unfold.escape_id(value).replace(/\\/g, '');
+ return key_field + manifold.separator + this.escape_id(value).replace(/\\/g, '');
},
// we do not need to carry around all the nonsense about backslashing dots in hrns
return id_in.replace(/\\\./g,"-").replace(/\\/g,"-").replace(/\./g,"-");
},
+ // escape (read: backslashes) some meta-chars in input
+ escape_id: function(id) {
+ if( id !== undefined){
+ return id.replace( /(:|\.|\[|\])/g, "\\$1" );
+ }else{
+ return "undefined-id";
+ }
+ },
+
id_from_record: function(method, record) {
var keys = manifold.metadata.get_key(method);
if (!keys)
return array[arguments.length + 1];
},
+ // TOGGLE
+ // plugin-helper.js is about managing toggled state
+ // it would be beneficial to merge it in here
+ toggle_on: function () { return this.toggle("true"); },
+ toggle_off: function () { return this.toggle("false"); },
+ toggle: function (status) {
+ messages.debug("toggle domid="+this.options.plugin_uuid);
+ plugin_helper.set_toggle_status (this.options.plugin_uuid,status);
+ },
+
/* SPIN */
spin: function() {