fields++;
last = i + 1;
- }
+ }
}
return (fields == 8);
}
}
- if (entry.parent) {
+ if (entry && entry.parent) {
cbi_t_update();
}
}
function cbi_t_update() {
+ var hl_tabs = [ ];
+
for( var sid in cbi_t )
for( var tid in cbi_t[sid] )
if( cbi_c[cbi_t[sid][tid].cid] == 0 ) {
cbi_t[sid][tid].tab.style.display = '';
var t = cbi_t[sid][tid].tab;
- window.setTimeout(function() { t.className = t.className.replace(/ cbi-tab-highlighted/g, '') }, 750);
- cbi_t[sid][tid].tab.className += ' cbi-tab-highlighted';
+ t.className += ' cbi-tab-highlighted';
+ hl_tabs.push(t);
}
+
+ if( hl_tabs.length > 0 )
+ window.setTimeout(function() {
+ for( var i = 0; i < hl_tabs.length; i++ )
+ hl_tabs[i].className = hl_tabs[i].className.replace(/ cbi-tab-highlighted/g, '');
+ }, 750);
}
}
}
+if( ! String.serialize )
+ String.serialize = function(o)
+ {
+ switch(typeof(o))
+ {
+ case 'object':
+ // null
+ if( o == null )
+ {
+ return 'null';
+ }
+
+ // array
+ else if( o.length )
+ {
+ var i, s = '';
+
+ for( var i = 0; i < o.length; i++ )
+ s += (s ? ', ' : '') + String.serialize(o[i]);
+
+ return '[ ' + s + ' ]';
+ }
+
+ // object
+ else
+ {
+ var k, s = '';
+
+ for( k in o )
+ s += (s ? ', ' : '') + k + ': ' + String.serialize(o[k]);
+
+ return '{ ' + s + ' }';
+ }
+
+ break;
+
+ case 'string':
+ // complex string
+ if( o.match(/[^a-zA-Z0-9_,.: -]/) )
+ return 'decodeURIComponent("' + encodeURIComponent(o) + '")';
+
+ // simple string
+ else
+ return '"' + o + '"';
+
+ break;
+
+ default:
+ return o.toString();
+ }
+ }
+
+
+if( ! String.format )
+ String.format = function()
+ {
+ if (!arguments || arguments.length < 1 || !RegExp)
+ return;
+
+ var html_esc = [/&/g, '&', /"/g, '"', /'/g, ''', /</g, '<', />/g, '>'];
+ var quot_esc = [/"/g, '"', /'/g, '''];
+
+ function esc(s, r) {
+ for( var i = 0; i < r.length; i += 2 )
+ s = s.replace(r[i], r[i+1]);
+ return s;
+ }
+
+ var str = arguments[0];
+ var out = '';
+ var re = /^(([^%]*)%('.|0|\x20)?(-)?(\d+)?(\.\d+)?(%|b|c|d|u|f|o|s|x|X|q|h|j))/;
+ var a = b = [], numSubstitutions = 0, numMatches = 0;
+
+ while( a = re.exec(str) )
+ {
+ var m = a[1];
+ var leftpart = a[2], pPad = a[3], pJustify = a[4], pMinLength = a[5];
+ var pPrecision = a[6], pType = a[7];
+
+ numMatches++;
+
+ if (pType == '%')
+ {
+ subst = '%';
+ }
+ else
+ {
+ if (numSubstitutions++ < arguments.length)
+ {
+ var param = arguments[numSubstitutions];
+
+ var pad = '';
+ if (pPad && pPad.substr(0,1) == "'")
+ pad = leftpart.substr(1,1);
+ else if (pPad)
+ pad = pPad;
+
+ var justifyRight = true;
+ if (pJustify && pJustify === "-")
+ justifyRight = false;
+
+ var minLength = -1;
+ if (pMinLength)
+ minLength = parseInt(pMinLength);
+
+ var precision = -1;
+ if (pPrecision && pType == 'f')
+ precision = parseInt(pPrecision.substring(1));
+
+ var subst = param;
+
+ switch(pType)
+ {
+ case 'b':
+ subst = (parseInt(param) || 0).toString(2);
+ break;
+
+ case 'c':
+ subst = String.fromCharCode(parseInt(param) || 0);
+ break;
+
+ case 'd':
+ subst = (parseInt(param) || 0);
+ break;
+
+ case 'u':
+ subst = Math.abs(parseInt(param) || 0);
+ break;
+
+ case 'f':
+ subst = (precision > -1)
+ ? Math.round((parseFloat(param) || 0.0) * Math.pow(10, precision)) / Math.pow(10, precision)
+ : (parseFloat(param) || 0.0);
+ break;
+
+ case 'o':
+ subst = (parseInt(param) || 0).toString(8);
+ break;
+
+ case 's':
+ subst = param;
+ break;
+
+ case 'x':
+ subst = ('' + (parseInt(param) || 0).toString(16)).toLowerCase();
+ break;
+
+ case 'X':
+ subst = ('' + (parseInt(param) || 0).toString(16)).toUpperCase();
+ break;
+
+ case 'h':
+ subst = esc(param, html_esc);
+ break;
+
+ case 'q':
+ subst = esc(param, quot_esc);
+ break;
+
+ case 'j':
+ subst = String.serialize(param);
+ break;
+ }
+ }
+ }
+
+ out += leftpart + subst;
+ str = str.substr(m.length);
+ }
+
+ return out + str;
+ }