X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fmediawiki%2Fmediawiki.Title.js;h=dad6021906514243786c09be8d80233ce1556cad;hb=7dcf4e29e7bf1c4324cfb446113ba4508a6b6af8;hp=6b6e58686d7f9e8e11bd48a930348c01ad81f46d;hpb=9d173afad638bd26214db079a12a36f57adbe355;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/mediawiki/mediawiki.Title.js b/resources/mediawiki/mediawiki.Title.js index 6b6e58686d..dad6021906 100644 --- a/resources/mediawiki/mediawiki.Title.js +++ b/resources/mediawiki/mediawiki.Title.js @@ -35,6 +35,11 @@ } var + /** + * Public methods (defined later) + */ + fn, + /** * Strip some illegal chars: control chars, colon, less than, greater than, * brackets, braces, pipe, whitespace and normal spaces. This still leaves some insanity @@ -127,12 +132,12 @@ var setAll = function ( title, s ) { // In normal browsers the match-array contains null/undefined if there's no match, // IE returns an empty string. - var matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w{1,5}))?$/ ), - ns_match = getNsIdByName( matches[1] ); + var matches = s.match( /^(?:([^:]+):)?(.*?)(?:\.(\w+))?$/ ), + nsMatch = getNsIdByName( matches[1] ); // Namespace must be valid, and title must be a non-empty string. - if ( ns_match && typeof matches[2] === 'string' && matches[2] !== '' ) { - title.ns = ns_match; + if ( nsMatch && typeof matches[2] === 'string' && matches[2] !== '' ) { + title.ns = nsMatch; title.name = fixName( matches[2] ); if ( typeof matches[3] === 'string' && matches[3] !== '' ) { title.ext = fixExt( matches[3] ); @@ -155,7 +160,7 @@ var setNameAndExtension = function ( title, raw ) { // In normal browsers the match-array contains null/undefined if there's no match, // IE returns an empty string. - var matches = raw.match( /^(?:)?(.*?)(?:\.(\w{1,5}))?$/ ); + var matches = raw.match( /^(?:)?(.*?)(?:\.(\w+))?$/ ); // Title must be a non-empty string. if ( typeof matches[1] === 'string' && matches[1] !== '' ) { @@ -221,7 +226,7 @@ var /* Public methods */ - var fn = { + fn = { constructor: Title, /**