r72920 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72919‎ | r72920 | r72921 >
Date:18:13, 13 September 2010
Author:catrope
Status:deferred
Tags:
Comment:
1.16wmf4: MFT r72919
Modified paths:
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.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';
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -31,8 +31,7 @@
3232 if(target.replace(/^\s+$/,'')==''){updateWidget(false);return;}
3333 if(!internal&&isExternalLink(target)){updateWidget('external');return;}
3434 if(target.indexOf('|')!=-1){updateWidget('invalid');return;}
35 -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;}
36 -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')
 35+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')
3736 status='notexists';else if(typeof page.invalid!='undefined')
3837 status='invalid';}
3938 if(!internal)cache[target]=status;updateWidget(status);}}));}
Index: branches/wmf/1.16wmf4/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';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r72919UsabilityInitiative: (bug 24181) Don't be too lax about showing "invalid titl...catrope18:08, 13 September 2010

Status & tagging log