https://bugzilla.wikimedia.org/show_bug.cgi?id=30803
--- Comment #1 from darklama <[email protected]> 2011-09-07 17:35:39 UTC --- Comment on attachment 9023 --> https://bugzilla.wikimedia.org/attachment.cgi?id=9023 patch for passing query string --- mediawiki.util.js 2011-09-07 11:10:17.000000000 -0500 +++ mediawiki-new.util.js 2011-09-07 12:04:26.000000000 -0500 @@ -124,12 +124,24 @@ /** * Get the link to a page name (relative to wgServer) * - * @param str string Page name to get the link for. - * @return string Location for a page with name of 'str' or boolean false on error. + * @param page {String} Page name to get the link for. + * @param [params] {Object} Parameters to pass with page. + * @return {String} Relative URL for page. */ - 'wikiGetlink' : function( str ) { - return mw.config.get( 'wgArticlePath' ).replace( '$1', - this.wikiUrlencode( str || mw.config.get( 'wgPageName' ) ) ); + 'wikiGetlink' : function( page, params ) { + if ( $.isPlainObject( page ) ) { + params = page; + page = params.title || mw.config.get( 'wgPageName' ); + } else if ( !page ) { + page = mw.config.get( 'wgPageName' ); + } + if ( 'title' in params ) { + delete params.title; + } + if ( $.isEmptyObject( params ) ) { + return mw.config.get( 'wgArticlePath' ).replace( '$1', this.wikiUrlencode( page ) ); + } + return mw.config.get( 'wgScript' ) + '?title=' + this.wikiUrlencode( page ) + $.param( params ); }, /** -- Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/wikibugs-l
