X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=unfold%2Fjs%2Funfold-helper.js;h=8d75cc3e0973efbcf1a6a280482e088f6bbce0d1;hb=99a0fe1c929e2934795fb53d0d45de7f2e49cff1;hp=0d3a54d82c8091d471166f6412da6c61024b4587;hpb=ee1403fe15f21c08fcd97f770f64ef44122e2c23;p=myslice.git diff --git a/unfold/js/unfold-helper.js b/unfold/js/unfold-helper.js index 0d3a54d8..8d75cc3e 100644 --- a/unfold/js/unfold-helper.js +++ b/unfold/js/unfold-helper.js @@ -4,11 +4,11 @@ var unfold = { if (maxdepth===undefined) maxdepth=5; var up=null, counter=0; while (true) { - console.log(counter+" "+msg+" id='"+dom.id+"' ["+dom.classList+"]"); + messages.debug(counter+" "+msg+" id='"+dom.id+"' ["+dom.classList+"]"); up=dom.parentNode; counter += 1; if ( (up == null) || (up === dom)) break; - if (counter >= maxdepth) { console.log(counter+" "+msg+" -> ..."); break; } + if (counter >= maxdepth) { messages.debug(counter+" "+msg+" -> ..."); break; } dom=up; } }, @@ -22,17 +22,20 @@ var unfold = { errorDisplay : function (error) { return '
Notice
  • ' + error + '
'; - return out; }, get_value: function (value) { - //if(typeof(jQuery(value).attr('value'))!="undefined"){ - if (/.*<\/span>/i.test(value)) { - return jQuery(value).attr('value'); - } else { - return value; + //if(typeof(jQuery(value).attr('value'))!="undefined"){ + if (/.*<\/span>/i.test(value)) { + return jQuery(value).attr('value'); + } else { + return value; + } + }, + + escape_id: function(id) { + return id.replace( /(:|\.|\[|\])/g, "\\$1" ); } -} } // global unfold