Move $.byteLength and $.trimByteLength to new module 'mediawiki.String'
[lhc/web/wiklou.git] / resources / src / mediawiki.rcfilters / mw.rcfilters.Controller.js
index 4b78175..dcce92d 100644 (file)
@@ -1,4 +1,7 @@
 ( function ( mw, $ ) {
+
+       var byteLength = require( 'mediawiki.String' ).byteLength;
+
        /* eslint no-underscore-dangle: "off" */
        /**
         * Controller for the filters in Recent Changes
                // Stringify state
                stringified = JSON.stringify( state );
 
-               if ( $.byteLength( stringified ) > 65535 ) {
+               if ( byteLength( stringified ) > 65535 ) {
                        // Sanity check, since the preference can only hold that.
                        return;
                }