http://www.mediawiki.org/wiki/Special:Code/MediaWiki/94646
Revision: 94646 Author: catrope Date: 2011-08-16 15:32:08 +0000 (Tue, 16 Aug 2011) Log Message: ----------- Fix some indentation and comments in mediawiki.Title, and make it depend on mediawiki.util Modified Paths: -------------- trunk/phase3/resources/Resources.php trunk/phase3/resources/mediawiki/mediawiki.title.js Modified: trunk/phase3/resources/Resources.php =================================================================== --- trunk/phase3/resources/Resources.php 2011-08-16 15:31:28 UTC (rev 94645) +++ trunk/phase3/resources/Resources.php 2011-08-16 15:32:08 UTC (rev 94646) @@ -463,6 +463,7 @@ ), 'mediawiki.Title' => array( 'scripts' => 'resources/mediawiki/mediawiki.title.js', + 'dependencies' => 'mediawiki.util', ), 'mediawiki.Uri' => array( 'scripts' => 'resources/mediawiki/mediawiki.uri.js', Modified: trunk/phase3/resources/mediawiki/mediawiki.title.js =================================================================== --- trunk/phase3/resources/mediawiki/mediawiki.title.js 2011-08-16 15:31:28 UTC (rev 94645) +++ trunk/phase3/resources/mediawiki/mediawiki.title.js 2011-08-16 15:32:08 UTC (rev 94646) @@ -21,17 +21,17 @@ * @return {Title} this */ var Title = function( title, namespace ) { - this._ns = 0; // integer namespace id - this._name = null; // name in canonical 'database' form - this._ext = null; // extension + this._ns = 0; // integer namespace id + this._name = null; // name in canonical 'database' form + this._ext = null; // extension - if ( arguments.length === 2 ) { - setNameAndExtension( this, title ); - this._ns = fixNsId( namespace ); - } else if ( arguments.length === 1 ) { - setAll( this, title ); - } - return this; + if ( arguments.length === 2 ) { + setNameAndExtension( this, title ); + this._ns = fixNsId( namespace ); + } else if ( arguments.length === 1 ) { + setAll( this, title ); + } + return this; }, /** @@ -168,12 +168,12 @@ /* Static space */ /** - * Wether this title exists on the wiki. + * Whether this title exists on the wiki. * @param title {mixed} prefixed db-key name (string) or instance of Title * @return {mixed} Boolean true/false if the information is available. Otherwise null. */ Title.exists = function( title ) { - var type = $.type( title ), obj = Title.exist.pages, match; + var type = $.type( title ), obj = Title.exist.pages, match; if ( type === 'string' ) { match = obj[title]; } else if ( type === 'object' && title instanceof Title ) { @@ -206,7 +206,7 @@ set: function( titles, state ) { titles = $.isArray( titles ) ? titles : [titles]; state = state === undefined ? true : !!state; - var pages = this.pages, i, len = titles.length; + var pages = this.pages, i, len = titles.length; for ( i = 0; i < len; i++ ) { pages[ titles[i] ] = state; } @@ -313,7 +313,7 @@ }, /** - * Wether this title exists on the wiki. + * Whether this title exists on the wiki. * @return {mixed} Boolean true/false if the information is available. Otherwise null. */ exists: function() { _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs