Change 'mediawiki.Title' to use 'packageFiles'
[lhc/web/wiklou.git] / resources / src / mediawiki.Title / Title.js
index 6bb3bce..78ae135 100644 (file)
@@ -34,6 +34,8 @@
        var
                mwString = require( 'mediawiki.String' ),
 
+               toUpperMapping = require( './phpCharToUpper.json' ),
+
                namespaceIds = mw.config.get( 'wgNamespaceIds' ),
 
                /**
                }
        };
 
+       /**
+        * PHP's strtoupper differs from String.toUpperCase in a number of cases (T147646).
+        *
+        * @param {string} chr Unicode character
+        * @return {string} Unicode character, in upper case, according to the same rules as in PHP
+        */
+       Title.phpCharToUpper = function ( chr ) {
+               var mapped = toUpperMapping[ chr ];
+               return mapped || chr.toUpperCase();
+       };
+
        /* Public members */
 
        Title.prototype = {
                        ) {
                                return this.title;
                        }
-                       // PHP's strtoupper differs from String.toUpperCase in a number of cases
-                       // Bug: T147646
                        return mw.Title.phpCharToUpper( this.title[ 0 ] ) + this.title.slice( 1 );
                },