////////PROTOTYPES/////must execute after jQuery, but before everything else //add limit method to string object // String.prototype.limit = function (limit) { var lim = 10; if (limit && typeof(limit)==='number') { lim = limit; } return $.trim(this.substr(0,lim)); }; //add trim method to string object // String.prototype.trim = function () { return $.trim(this); }; /// /// light version of pd_nou, won't strip character with accent /// /// String fixed up with no Unicode characters /// /// Replacement for std.js pd_noul() global function. /// String.prototype.pd_noul = function() { return this.replace(/\u2013/g,'-').replace(/\u2014/g,'-').replace(/\u2018/g,'\'').replace(/\u2019/g,'\'').replace(/\u201C/g,'"').replace(/\u201D/g,'"'); }; /// /// Helper function that removes Unicode chars from strings /// /// String fixed up with no Unicode characters /// /// Replacement for Std.js pd_nou() global function. /// String.prototype.pd_nou = function() { return this.pd_noul().replace(/[^\x20-\x7F]/g,'_'); };