X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fsrc%2Fjquery%2Fjquery.byteLength.js;h=7fe25ee30c607f9122c167531b7e965fa0db133b;hb=b170b4a14a94fb509c4b15ca4c5717c6976a32cc;hp=398937e6c099fbb38a7dbe3534b982fcac5d2494;hpb=bc1cd69a5950c516e9f34d50d0ce6b1547d9f060;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/jquery/jquery.byteLength.js b/resources/src/jquery/jquery.byteLength.js index 398937e6c0..7fe25ee30c 100644 --- a/resources/src/jquery/jquery.byteLength.js +++ b/resources/src/jquery/jquery.byteLength.js @@ -1,14 +1,19 @@ /** - * jQuery.byteLength - * - * Calculate the byte length of a string (accounting for UTF-8). - * + * @class jQuery.plugin.byteLength * @author Jan Paul Posma, 2011 * @author Timo Tijhof, 2012 * @author David Chan, 2013 */ -jQuery.byteLength = function ( str ) { +/** + * Calculate the byte length of a string (accounting for UTF-8). + * + * @static + * @inheritable + * @param {string} str + * @return {string} + */ +jQuery.byteLength = function ( str ) { // This basically figures out how many bytes a UTF-16 string (which is what js sees) // will take in UTF-8 by replacing a 2 byte character with 2 *'s, etc, and counting that. // Note, surrogate (\uD800-\uDFFF) characters are counted as 2 bytes, since there's two of them @@ -27,5 +32,9 @@ jQuery.byteLength = function ( str ) { .replace( /[\u0080-\u07FF\uD800-\uDFFF]/g, '**' ) .replace( /[\u0800-\uD7FF\uE000-\uFFFF]/g, '***' ) .length; - }; + +/** + * @class jQuery + * @mixins jQuery.plugin.byteLength + */