git://git.onelab.eu
/
unfold.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
escape_id moves into plugin.js
[unfold.git]
/
manifold
/
static
/
js
/
plugin.js
diff --git
a/manifold/static/js/plugin.js
b/manifold/static/js/plugin.js
index
3745f64
..
07ba9b7
100644
(file)
--- 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) {
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
},
// 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,"-");
},
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)
id_from_record: function(method, record) {
var keys = manifold.metadata.get_key(method);
if (!keys)