a:48:{s:9:"#provides";s:24:"dojox.dtl.filter.strings";s:9:"#resource";s:21:"dtl/filter/strings.js";s:9:"#requires";a:3:{i:0;a:2:{i:0;s:6:"common";i:1;s:28:"dojox.dtl.filter.htmlstrings";}i:1;a:2:{i:0;s:6:"common";i:1;s:20:"dojox.string.sprintf";}i:2;a:2:{i:0;s:6:"common";i:1;s:21:"dojox.string.tokenize";}}s:34:"dojox.dtl.filter.strings._urlquote";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"url";a:1:{s:4:"type";s:6:"String";}s:4:"safe";a:2:{s:8:"optional";b:1;s:4:"type";s:6:"String";}}s:6:"source";s:292:" if(!safe){ safe = "/"; } return dojox.string.tokenize(url, /([^\w-_.])/g, function(token){ if(safe.indexOf(token) == -1){ if(token == " "){ return "+"; }else{ return "%" + token.charCodeAt(0).toString(16).toUpperCase(); } } return token; }).join("");";s:7:"private";b:1;s:7:"summary";s:0:"";}s:35:"dojox.dtl.filter.strings.addslashes";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:80:" return value.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/'/g, "\\'");";s:7:"summary";s:69:"Adds slashes - useful for passing strings to JavaScript, for example.";}s:33:"dojox.dtl.filter.strings.capfirst";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:82:" value = "" + value; return value.charAt(0).toUpperCase() + value.substring(1);";s:7:"summary";s:44:"Capitalizes the first character of the value";}s:31:"dojox.dtl.filter.strings.center";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:227:" arg = arg || value.length; value = value + ""; var diff = arg - value.length; if(diff % 2){ value = value + " "; diff -= 1; } for(var i = 0; i < diff; i += 2){ value = " " + value + " "; } return value;";s:7:"summary";s:45:"Centers the value in a field of a given width";}s:28:"dojox.dtl.filter.strings.cut";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:95:" arg = arg + "" || ""; value = value + ""; return value.replace(new RegExp(arg, "g"), "");";s:7:"summary";s:47:"Removes all values of arg from the given string";}s:40:"dojox.dtl.filter.strings._fix_ampersands";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:39:"dojox.dtl.filter.strings.fix_ampersands";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:74:" return value.replace(dojox.dtl.filter.strings._fix_ampersands, "&");";s:7:"summary";s:47:"Replaces ampersands with ``&amp;`` entities";}s:36:"dojox.dtl.filter.strings.floatformat";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:242:" arg = parseInt(arg || -1, 10); value = parseFloat(value); var m = value - value.toFixed(0); if(!m && arg < 0){ return value.toFixed(); } value = value.toFixed(Math.abs(arg)); return (arg < 0) ? parseFloat(value) + "" : value;";s:7:"summary";s:32:"Format a number according to arg";s:11:"description";s:320:"If called without an argument, displays a floating point number as 34.2 -- but only if there's a point to be displayed. With a positive numeric argument, it displays that many decimal places always. With a negative numeric argument, it will display that many decimal places -- but only if there's places to be displayed.";}s:34:"dojox.dtl.filter.strings.iriencode";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:70:" return dojox.dtl.filter.strings._urlquote(value, "/#%[]=:;$&()+,!");";s:7:"summary";s:0:"";}s:36:"dojox.dtl.filter.strings.linenumbers";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:307:" var df = dojox.dtl.filter; var lines = value.split("\n"); var output = []; var width = (lines.length + "").length; for(var i = 0, line; i < lines.length; i++){ line = lines[i]; output.push(df.strings.ljust(i + 1, width) + ". " + dojox.dtl._base.escape(line)); } return output.join("\n");";s:7:"summary";s:31:"Displays text with line numbers";}s:30:"dojox.dtl.filter.strings.ljust";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:121:" value = value + ""; arg = parseInt(arg, 10); while(value.length < arg){ value = value + " "; } return value;";s:7:"summary";s:0:"";}s:30:"dojox.dtl.filter.strings.lower";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:36:" return (value + "").toLowerCase();";s:7:"summary";s:36:"Converts a string into all lowercase";}s:34:"dojox.dtl.filter.strings.make_list";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:327:" var output = []; if(typeof value == "number"){ value = value + ""; } if(value.charAt){ for(var i = 0; i < value.length; i++){ output.push(value.charAt(i)); } return output; } if(typeof value == "object"){ for(var key in value){ output.push(value[key]); } return output; } return [];";s:7:"summary";s:117:"Returns the value turned into a list. For an integer, it's a list of digits. For a string, it's a list of characters.";}s:30:"dojox.dtl.filter.strings.rjust";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:121:" value = value + ""; arg = parseInt(arg, 10); while(value.length < arg){ value = " " + value; } return value;";s:7:"summary";s:0:"";}s:32:"dojox.dtl.filter.strings.slugify";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:96:" value = value.replace(/[^\w\s-]/g, "").toLowerCase(); return value.replace(/[\-\s]+/g, "-");";s:7:"summary";s:77:"Converts to lowercase, removes non-alpha chars and converts spaces to hyphens";}s:33:"dojox.dtl.filter.strings._strings";a:3:{s:4:"type";s:6:"Object";s:7:"private";b:1;s:7:"summary";s:0:"";}s:37:"dojox.dtl.filter.strings.stringformat";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:195:" arg = "" + arg; var strings = dojox.dtl.filter.strings._strings; if(!strings[arg]){ strings[arg] = new dojox.string.sprintf.Formatter("%" + arg); } return strings[arg].format(value);";s:7:"summary";s:192:"Formats the variable according to the argument, a string formatting specifier. This specifier uses Python string formating syntax, with the exception that the leading "%" is dropped.";}s:30:"dojox.dtl.filter.strings.title";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:290:" var last, title = ""; for(var i = 0, current; i < value.length; i++){ current = value.charAt(i); if(last == " " || last == "\n" || last == "\t" || !last){ title += current.toUpperCase(); }else{ title += current.toLowerCase(); } last = current; } return title;";s:7:"summary";s:32:"Converts a string into titlecase";}s:39:"dojox.dtl.filter.strings._truncatewords";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:38:"dojox.dtl.filter.strings.truncatewords";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:2:{s:4:"type";s:7:"Integer";s:7:"summary";s:33:"Number of words to truncate after";}}s:6:"source";s:513:" arg = parseInt(arg, 10); if(!arg){ return value; } for(var i = 0, j = value.length, count = 0, current, last; i < value.length; i++){ current = value.charAt(i); if(dojox.dtl.filter.strings._truncatewords.test(last)){ if(!dojox.dtl.filter.strings._truncatewords.test(current)){ ++count; if(count == arg){ return value.substring(0, j + 1); } } }else if(!dojox.dtl.filter.strings._truncatewords.test(current)){ j = i; } last = current; } return value;";s:7:"summary";s:50:"Truncates a string after a certain number of words";}s:40:"dojox.dtl.filter.strings._truncate_words";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:38:"dojox.dtl.filter.strings._truncate_tag";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:43:"dojox.dtl.filter.strings._truncate_singlets";a:3:{s:4:"type";s:6:"Object";s:7:"private";b:1;s:7:"summary";s:0:"";}s:46:"dojox.dtl.filter.strings._truncate_singlets.br";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:47:"dojox.dtl.filter.strings._truncate_singlets.col";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:48:"dojox.dtl.filter.strings._truncate_singlets.link";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:48:"dojox.dtl.filter.strings._truncate_singlets.base";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:47:"dojox.dtl.filter.strings._truncate_singlets.img";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:49:"dojox.dtl.filter.strings._truncate_singlets.param";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:48:"dojox.dtl.filter.strings._truncate_singlets.area";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:46:"dojox.dtl.filter.strings._truncate_singlets.hr";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:49:"dojox.dtl.filter.strings._truncate_singlets.input";a:2:{s:14:"private_parent";b:1;s:7:"summary";s:0:"";}s:43:"dojox.dtl.filter.strings.truncatewords_html";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1057:" arg = parseInt(arg, 10); if(arg <= 0){ return ""; } var strings = dojox.dtl.filter.strings; var words = 0; var open = []; var output = dojox.string.tokenize(value, strings._truncate_words, function(all, word){ if(word){ // It's an actual non-HTML word ++words; if(words < arg){ return word; }else if(words == arg){ return word + " ..."; } } // Check for tag var tag = all.match(strings._truncate_tag); if(!tag || words >= arg){ // Don't worry about non tags or tags after our truncate point return; } var closing = tag[1]; var tagname = tag[2].toLowerCase(); var selfclosing = tag[3]; if(closing || strings._truncate_singlets[tagname]){ }else if(closing){ var i = dojo.indexOf(open, tagname); if(i != -1){ open = open.slice(i + 1); } }else{ open.unshift(tagname); } return all; }).join(""); output = output.replace(/\s+$/g, ""); for(var i = 0, tag; tag = open[i]; i++){ output += ""; } return output;";s:7:"summary";s:0:"";}s:30:"dojox.dtl.filter.strings.upper";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:29:" return value.toUpperCase();";s:7:"summary";s:0:"";}s:34:"dojox.dtl.filter.strings.urlencode";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:51:" return dojox.dtl.filter.strings._urlquote(value);";s:7:"summary";s:0:"";}s:32:"dojox.dtl.filter.strings._urlize";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:33:"dojox.dtl.filter.strings._urlize2";a:2:{s:7:"private";b:1;s:7:"summary";s:0:"";}s:31:"dojox.dtl.filter.strings.urlize";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:53:" return dojox.dtl.filter.strings.urlizetrunc(value);";s:7:"summary";s:0:"";}s:36:"dojox.dtl.filter.strings.urlizetrunc";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:1252:" arg = parseInt(arg); return dojox.string.tokenize(value, /(\S+)/g, function(word){ var matches = dojox.dtl.filter.strings._urlize.exec(word); if(!matches){ return word; } var lead = matches[1]; var middle = matches[2]; var trail = matches[3]; var startsWww = middle.indexOf("www.") == 0; var hasAt = middle.indexOf("@") != -1; var hasColon = middle.indexOf(":") != -1; var startsHttp = middle.indexOf("http://") == 0; var startsHttps = middle.indexOf("https://") == 0; var firstAlpha = /[a-zA-Z0-9]/.test(middle.charAt(0)); var last4 = middle.substring(middle.length - 4); var trimmed = middle; if(arg > 3){ trimmed = trimmed.substring(0, arg - 3) + "..."; } if(startsWww || (!hasAt && !startsHttp && middle.length && firstAlpha && (last4 == ".org" || last4 == ".net" || last4 == ".com"))){ return '' + trimmed + ''; }else if(startsHttp || startsHttps){ return '' + trimmed + ''; }else if(hasAt && !startsWww && !hasColon && dojox.dtl.filter.strings._urlize2.test(middle)){ return '' + middle + ''; } return word; }).join("");";s:7:"returns";s:52:"' + middle + '" rel="nofollow">' + trimmed + '';";s:7:"summary";s:0:"";}s:34:"dojox.dtl.filter.strings.wordcount";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:5:"value";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:90:" value = dojo.trim(value); if(!value){ return 0; } return value.split(/\s+/g).length;";s:7:"summary";s:0:"";}s:33:"dojox.dtl.filter.strings.wordwrap";a:4:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:5:"value";a:1:{s:4:"type";s:0:"";}s:3:"arg";a:1:{s:4:"type";s:0:"";}}s:6:"source";s:729:" arg = parseInt(arg); // summary: Wraps words at specified line length var output = []; var parts = value.split(/\s+/g); if(parts.length){ var word = parts.shift(); output.push(word); var pos = word.length - word.lastIndexOf("\n") - 1; for(var i = 0; i < parts.length; i++){ word = parts[i]; if(word.indexOf("\n") != -1){ var lines = word.split(/\n/g); }else{ var lines = [word]; } pos += lines[0].length + 1; if(arg && pos > arg){ output.push("\n"); pos = lines[lines.length - 1].length; }else{ output.push(" "); if(lines.length > 1){ pos = lines[lines.length - 1].length; } } output.push(word); } } return output.join("");";s:7:"summary";s:0:"";}s:24:"dojox.dtl.filter.strings";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:16:"dojox.dtl.filter";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:9:"dojox.dtl";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}