r107641 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107640‎ | r107641 | r107642 >
Date:18:31, 30 December 2011
Author:krinkle
Status:ok
Tags:
Comment:
[UploadWizard] Uncaught ReferenceError: wgSiteName is not defined
Modified paths:
  • /trunk/extensions/UploadWizard/UploadWizardPage.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/test/jasmine/spec/mw.Api.edit.spec.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/test/jasmine/spec/mw.Api.edit.spec.js
@@ -9,20 +9,20 @@
1010 dataType: 'json'
1111 };
1212
13 - describe( "mw.Api", function() {
 13+ describe( 'mw.Api', function() {
1414
1515 var MAX_DELAY = 1000; // ms
1616
1717 // typical globals made available
1818 // TODO this only works for me (NeilK)
19 - var wgScriptPath = '/w';
 19+ mw.config.set( 'wgScriptPath', '/w' );
2020
2121 var pageUri = new mw.Uri( window.location );
2222
2323 var apiUrl = new mw.Uri( {
2424 protocol: pageUri.protocol,
2525 host: pageUri.host,
26 - path: wgScriptPath + '/api.php'
 26+ path: mw.config.get( 'wgScriptPath' ) + '/api.php'
2727 } );
2828
2929 describe( "edit token", function() {
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -51,7 +51,7 @@
5252
5353 // load list of languages so we'll have it ready when description interfaces are created
5454 // XXX replace this code once any of the following bugs are fixed: 25845, 27535, 27561
55 - var languageHandlerUrl = wgServer + wgScript + '?' + $.param( { 'title': 'MediaWiki:LanguageHandler.js', 'action': 'raw', 'ctype': 'text/javascript' } );
 55+ var languageHandlerUrl = mw.util.wikiScript() + '?' + $.param( { 'title': 'MediaWiki:LanguageHandler.js', 'action': 'raw', 'ctype': 'text/javascript' } );
5656 mw.loader.load( languageHandlerUrl );
5757
5858 // remove first spinner
Index: trunk/extensions/UploadWizard/UploadWizardPage.js
@@ -7,9 +7,9 @@
88 */
99
1010 // Create UploadWizard
11 -( function( mw, $, undefined ) {
 11+( function ( $, mw, undefined ) {
1212
13 -mw.UploadWizardPage = function() {
 13+mw.UploadWizardPage = function () {
1414
1515 var config = mw.config.get( 'UploadWizardConfig' );
1616 if ( !config.debug ) {
@@ -21,9 +21,9 @@
2222
2323 };
2424
25 -jQuery( document ).ready( function() {
 25+$( document ).ready( function () {
2626 // add "magic" to Language template parser for keywords
27 - var options = { magic: { 'SITENAME' : wgSiteName } };
 27+ var options = { magic: { 'SITENAME' : mw.config.get( 'wgSiteName' ) } };
2828
2929 // these functions may exist already, but we want them to also know about our magic
3030 // (the interface for this needs to change; add magic on the fly?)
@@ -34,4 +34,4 @@
3535 mw.UploadWizardPage();
3636 } );
3737
38 -} )( window.mediaWiki, jQuery );
 38+} )( jQuery, mediaWiki );

Follow-up revisions

RevisionCommit summaryAuthorDate
r112253* (bug 34652) Fix regression in UploadWizard custom language list...brion22:26, 23 February 2012

Status & tagging log