Simplify by using mw.util.getUrl() instead of mw.util.wikiScript()
authorFomafix <fomafix@googlemail.com>
Tue, 5 Apr 2016 13:37:55 +0000 (13:37 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Tue, 5 Apr 2016 13:37:55 +0000 (13:37 +0000)
Change-Id: Ie10a5ee79846a4f1465fea7ce1b47da13b0787b7

resources/Resources.php
resources/src/mediawiki/page/image-pagination.js
resources/src/mediawiki/page/watch.js

index 6992de1..b206ba3 100644 (file)
@@ -1680,7 +1680,6 @@ return [
        'mediawiki.page.image.pagination' => [
                'scripts' => 'resources/src/mediawiki/page/image-pagination.js',
                'dependencies' => [
-                       'mediawiki.Uri',
                        'mediawiki.util',
                        'jquery.spinner',
                ],
index a097b17..02bc1de 100644 (file)
 
        function bindPageNavigation( $container ) {
                $container.find( '.multipageimagenavbox' ).one( 'click', 'a', function ( e ) {
-                       var page, uri;
+                       var page, url;
 
                        // Generate the same URL on client side as the one generated in ImagePage::openShowImage.
                        // We avoid using the URL in the link directly since it could have been manipulated (bug 66608)
                        page = Number( mw.util.getParamValue( 'page', this.href ) );
-                       uri = new mw.Uri( mw.util.wikiScript() )
-                               .extend( { title: mw.config.get( 'wgPageName' ), page: page } )
-                               .toString();
+                       url = mw.util.getUrl( mw.config.get( 'wgPageName' ), { page: page } );
 
-                       switchPage( uri );
+                       switchPage( url );
                        e.preventDefault();
                } );
 
index 578c846..a57d5c7 100644 (file)
                        .text( mw.msg( msgKey ) )
                        .attr( 'title', mw.msg( 'tooltip-ca-' + action ) )
                        .updateTooltipAccessKeys()
-                       .attr( 'href', mw.util.wikiScript() + '?' + $.param( {
-                                       title: title,
-                                       action: action
-                               } )
-                       );
+                       .attr( 'href', mw.util.getUrl( title, { action: action } ) );
 
                // Most common ID style
                if ( $li.prop( 'id' ) === 'ca-' + otherAction ) {