Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -17,16 +17,16 @@ |
18 | 18 | array( 'src' => 'Modules/PreviewDialog/PreviewDialog.js', 'version' => 2 ), |
19 | 19 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
20 | 20 | 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 ), |
22 | 22 | array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ), |
23 | 23 | array( 'src' => 'Modules/Templates/Templates.js', 'version' => 1 ), |
24 | 24 | array( 'src' => 'Modules/AddMediaWizard/AddMediaWizard.js', 'version' => 6 ), |
25 | 25 | ), |
26 | 26 | 'combined' => array( |
27 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 121 ), |
| 27 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 122 ), |
28 | 28 | ), |
29 | 29 | 'minified' => array( |
30 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 121 ), |
| 30 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 122 ), |
31 | 31 | ), |
32 | 32 | ); |
33 | 33 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1194,13 +1194,10 @@ |
1195 | 1195 | 'format': 'json' |
1196 | 1196 | }, |
1197 | 1197 | success: function( data ) { |
1198 | | - if ( !data ) { |
1199 | | - // This happens in some weird cases |
1200 | | - return; |
1201 | | - } |
1202 | 1198 | 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; |
1205 | 1202 | } else { |
1206 | 1203 | var page = data.query.pages[data.query.pageids[0]]; |
1207 | 1204 | status = 'exists'; |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -35,8 +35,7 @@ |
36 | 36 | if(target.replace(/^\s+$/,'')==''){updateWidget(false);return;} |
37 | 37 | if(!internal&&isExternalLink(target)){updateWidget('external');return;} |
38 | 38 | 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') |
41 | 40 | status='notexists';else if(typeof page.invalid!='undefined') |
42 | 41 | status='invalid';} |
43 | 42 | if(!internal)cache[target]=status;updateWidget(status);}}));} |
Index: trunk/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'; |