Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1140,13 +1140,10 @@ |
1141 | 1141 | 'format': 'json' |
1142 | 1142 | }, |
1143 | 1143 | success: function( data ) { |
1144 | | - if ( !data ) { |
1145 | | - // This happens in some weird cases |
1146 | | - return; |
1147 | | - } |
1148 | 1144 | 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; |
1151 | 1148 | } else { |
1152 | 1149 | var page = data.query.pages[data.query.pageids[0]]; |
1153 | 1150 | status = 'exists'; |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -31,8 +31,7 @@ |
32 | 32 | if(target.replace(/^\s+$/,'')==''){updateWidget(false);return;} |
33 | 33 | if(!internal&&isExternalLink(target)){updateWidget('external');return;} |
34 | 34 | 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') |
37 | 36 | status='notexists';else if(typeof page.invalid!='undefined') |
38 | 37 | status='invalid';} |
39 | 38 | if(!internal)cache[target]=status;updateWidget(status);}}));} |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -1140,13 +1140,10 @@ |
1141 | 1141 | 'format': 'json' |
1142 | 1142 | }, |
1143 | 1143 | success: function( data ) { |
1144 | | - if ( !data ) { |
1145 | | - // This happens in some weird cases |
1146 | | - return; |
1147 | | - } |
1148 | 1144 | 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; |
1151 | 1148 | } else { |
1152 | 1149 | var page = data.query.pages[data.query.pageids[0]]; |
1153 | 1150 | status = 'exists'; |