Merge "Recalculate user default options for each test"
[lhc/web/wiklou.git] / resources / src / mediawiki.Title / Title.js
index ff7a40f..78ae135 100644 (file)
@@ -34,6 +34,8 @@
        var
                mwString = require( 'mediawiki.String' ),
 
+               toUpperMapping = require( './phpCharToUpper.json' ),
+
                namespaceIds = mw.config.get( 'wgNamespaceIds' ),
 
                /**
         * @return {boolean} Namespace is a signature namespace
         */
        Title.wantSignaturesNamespace = function ( namespaceId ) {
-               return this.isTalkNamespace( namespaceId ) ||
+               return Title.isTalkNamespace( namespaceId ) ||
                        mw.config.get( 'wgExtraSignatureNamespaces' ).indexOf( namespaceId ) !== -1;
        };
 
                }
        };
 
+       /**
+        * 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 );
                },