Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / resources / src / mediawiki / mediawiki.Title.js
index 253e0ef..53cbd60 100644 (file)
                        },
                        // brackets, greater than
                        {
-                               pattern: /[\]\}>]/g,
+                               pattern: /[}\]>]/g,
                                replace: ')',
                                generalRule: true
                        },
                        // brackets, lower than
                        {
-                               pattern: /[\[\{<]/g,
+                               pattern: /[{[<]/g,
                                replace: '(',
                                generalRule: true
                        },
                trimFileNameToByteLength = function ( name, extension ) {
                        // There is a special byte limit for file names and ... remember the dot
                        return trimToByteLength( name, FILENAME_MAX_BYTES - extension.length - 1 ) + '.' + extension;
-               },
-
-               // Polyfill for ES5 Object.create
-               createObject = Object.create || ( function () {
-                       return function ( o ) {
-                               function Title() {}
-                               if ( o !== Object( o ) ) {
-                                       throw new Error( 'Cannot inherit from a non-object' );
-                               }
-                               Title.prototype = o;
-                               return new Title();
-                       };
-               }() );
+               };
 
        /* Static members */
 
                        return null;
                }
 
-               t = createObject( Title.prototype );
+               t = Object.create( Title.prototype );
                t.namespace = parsed.namespace;
                t.title = parsed.title;
                t.ext = parsed.ext;
                }
 
                // Any remaining initial :s are illegal.
-               title = title.replace( /^\:+/, '' );
+               title = title.replace( /^:+/, '' );
 
                return Title.newFromText( title, namespace );
        };
                        thumbPhpRegex = /thumb\.php/,
                        regexes = [
                                // Thumbnails
-                               /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)\/[^\s\/]+-[^\s\/]*$/,
+                               /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s/]+)\/[^\s/]+-[^\s/]*$/,
 
                                // Full size images
-                               /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s\/]+)$/,
+                               /\/[a-f0-9]\/[a-f0-9]{2}\/([^\s/]+)$/,
 
                                // Thumbnails in non-hashed upload directories
-                               /\/([^\s\/]+)\/[^\s\/]+-(?:\1|thumbnail)[^\s\/]*$/,
+                               /\/([^\s/]+)\/[^\s/]+-(?:\1|thumbnail)[^\s/]*$/,
 
                                // Full-size images in non-hashed upload directories
-                               /\/([^\s\/]+)$/
+                               /\/([^\s/]+)$/
                        ],
 
                        recount = regexes.length;