r72919 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72918‎ | r72919 | r72920 >
Date:18:08, 13 September 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
UsabilityInitiative: (bug 24181) Don't be too lax about showing "invalid title" in the link dialog
Modified paths:
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -17,16 +17,16 @@
1818 array( 'src' => 'Modules/PreviewDialog/PreviewDialog.js', 'version' => 2 ),
1919 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
2020 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 10 ),
21 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 105 ),
 21+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 106 ),
2222 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
2323 array( 'src' => 'Modules/Templates/Templates.js', 'version' => 1 ),
2424 array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ),
2525 ),
2626 'combined' => array(
27 - array( 'src' => 'WikiEditor.combined.js', 'version' => 121 ),
 27+ array( 'src' => 'WikiEditor.combined.js', 'version' => 122 ),
2828 ),
2929 'minified' => array(
30 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 121 ),
 30+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 122 ),
3131 ),
3232 );
3333 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1194,13 +1194,10 @@
11951195 'format': 'json'
11961196 },
11971197 success: function( data ) {
1198 - if ( !data ) {
1199 - // This happens in some weird cases
1200 - return;
1201 - }
12021198 var status;
1203 - if ( typeof data.query == 'undefined' ) {
1204 - status = 'invalid';
 1199+ if ( !data || typeof data.query == 'undefined' ) {
 1200+ // This happens in some weird cases
 1201+ status = false;
12051202 } else {
12061203 var page = data.query.pages[data.query.pageids[0]];
12071204 status = 'exists';
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -35,8 +35,7 @@
3636 if(target.replace(/^\s+$/,'')==''){updateWidget(false);return;}
3737 if(!internal&&isExternalLink(target)){updateWidget('external');return;}
3838 if(target.indexOf('|')!=-1){updateWidget('invalid');return;}
39 -updateWidget('loading');$j('#wikieditor-toolbar-link-int-target-status').data('request',$j.ajax({url:wgScriptPath+'/api.php',dataType:'json',data:{'action':'query','indexpageids':'','titles':target,'converttitles':'','format':'json'},success:function(data){if(!data){return;}
40 -var status;if(typeof data.query=='undefined'){status='invalid';}else{var page=data.query.pages[data.query.pageids[0]];status='exists';if(typeof page.missing!='undefined')
 39+updateWidget('loading');$j('#wikieditor-toolbar-link-int-target-status').data('request',$j.ajax({url:wgScriptPath+'/api.php',dataType:'json',data:{'action':'query','indexpageids':'','titles':target,'converttitles':'','format':'json'},success:function(data){var status;if(!data||typeof data.query=='undefined'){status=false;}else{var page=data.query.pages[data.query.pageids[0]];status='exists';if(typeof page.missing!='undefined')
4140 status='notexists';else if(typeof page.invalid!='undefined')
4241 status='invalid';}
4342 if(!internal)cache[target]=status;updateWidget(status);}}));}
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1140,13 +1140,10 @@
11411141 'format': 'json'
11421142 },
11431143 success: function( data ) {
1144 - if ( !data ) {
1145 - // This happens in some weird cases
1146 - return;
1147 - }
11481144 var status;
1149 - if ( typeof data.query == 'undefined' ) {
1150 - status = 'invalid';
 1145+ if ( !data || typeof data.query == 'undefined' ) {
 1146+ // This happens in some weird cases
 1147+ status = false;
11511148 } else {
11521149 var page = data.query.pages[data.query.pageids[0]];
11531150 status = 'exists';

Follow-up revisions

RevisionCommit summaryAuthorDate
r729201.16wmf4: MFT r72919catrope18:13, 13 September 2010

Comments

#Comment by Trevor Parscal (WMF) (talk | contribs)   23:22, 24 September 2010

This has been deployed and confirmed working.

Status & tagging log