X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=blobdiff_plain;f=manifold%2Fstatic%2Fjs%2Fplugin.js;h=07ba9b7133750bd93c13f1140a6ca4f49f4276b4;hp=3745f649c3463b1694279468a32cd9d5a87077e4;hb=4722ee62bd16b68846ecfc19e19e62b5bc769c01;hpb=66e63a3a8dbd1c2a47668b0479ea1ff361269f64 diff --git a/manifold/static/js/plugin.js b/manifold/static/js/plugin.js index 3745f649..07ba9b71 100644 --- a/manifold/static/js/plugin.js +++ b/manifold/static/js/plugin.js @@ -189,7 +189,7 @@ var Plugin = Class.extend({ 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 @@ -205,6 +205,15 @@ var Plugin = Class.extend({ 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)