ResourcesSelected Plugin working with URNs - http://trac.myslice.info/ticket/36
authorLoic Baron <loic.baron@lip6.fr>
Fri, 18 Oct 2013 17:26:45 +0000 (19:26 +0200)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 18 Oct 2013 17:26:45 +0000 (19:26 +0200)
plugins/hazelnut/static/js/hazelnut.js
plugins/resources_selected/static/js/resources_selected.js
portal/static/js/common.functions.js

index bdb2de7..21b23f5 100644 (file)
 
 
             var checkbox_id = this.flat_id(this.id('checkbox', key_value));
-            checkbox_id = '#' + checkbox_id;
+            // function escape_id(myid) is defined in portal/static/js/common.functions.js
+            checkbox_id = escape_id(checkbox_id);
                // using dataTables's $ to search also in nodes that are not currently displayed
             var element = this.table.$(checkbox_id);
                if (debug) messages.debug("set_checkbox checked=" + checked + " id=" + checkbox_id + " matches=" + element.length);
index d64d717..9a06447 100644 (file)
         // - Key and confirmation could be sufficient, or key and record state
         // XXX move record state to the manifold plugin API
 
-        on_field_state_changed: function(request, key, value, status)
+        on_field_state_changed: function(result)
         {
-            this.set_state(request, key, value, status);
+            console.log(result)
+            /* this.set_state(result.request, result.key, result.value, result.status); */
+            this.set_state(result);
         },
 
         // XXX we will have the requests for change
index 2414216..56b02ca 100644 (file)
@@ -1,6 +1,10 @@
 /*
  * This file is included in tophat_render.php
  */
+// Escape special characters in jQuery Selector
+function escape_id( myid ) {
+    return "#" + myid.replace( /(:|\.|\[|\])/g, "\\$1" );
+}
 
 function getKeySplitId(id,separator){
     // id of elements must respect this rule