Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins/jquery.textSelection.js |
— | — | @@ -386,7 +386,7 @@ |
387 | 387 | break; |
388 | 388 | } |
389 | 389 | var context = $(this).data( 'wikiEditor-context' ); |
390 | | - var hasIframe = context !== undefined && context.$iframe !== undefined; |
| 390 | + var hasIframe = typeof context === 'object' && context && typeof context.$iframe !== 'undefined'; |
391 | 391 | |
392 | 392 | // IE selection restore voodoo |
393 | 393 | var needSave = false; |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -1802,7 +1802,7 @@ |
1803 | 1803 | break; |
1804 | 1804 | } |
1805 | 1805 | var context = $(this).data( 'wikiEditor-context' ); |
1806 | | - var hasIframe = context !== undefined && context.$iframe !== undefined; |
| 1806 | + var hasIframe = typeof context === 'object' && context && typeof context.$iframe !== 'undefined'; |
1807 | 1807 | |
1808 | 1808 | // IE selection restore voodoo |
1809 | 1809 | var needSave = false; |
Index: branches/wmf/1.16wmf4/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | $(this).trigger('scrollToPosition');});}};switch(command){case'encapsulateSelection':options=$.extend({'pre':'','peri':'','post':'','ownline':false,'replace':false,'selectPeri':true},options);break;case'getCaretPosition':options=$.extend({'startAndEnd':false},options);break;case'setSelection':options=$.extend({'start':undefined,'end':undefined,'startContainer':undefined,'endContainer':undefined},options);if(options.end===undefined) |
118 | 118 | options.end=options.start;if(options.endContainer==undefined) |
119 | 119 | options.endContainer=options.startContainer;break;case'scrollToCaretPosition':options=$.extend({'force':false},options);break;} |
120 | | -var context=$(this).data('wikiEditor-context');var hasIframe=context!==undefined&&context.$iframe!==undefined;var needSave=false;if(hasIframe&&context.savedSelection!==null){context.fn.restoreSelection();needSave=true;} |
| 120 | +var context=$(this).data('wikiEditor-context');var hasIframe=typeof context==='object'&&context&&typeof context.$iframe!=='undefined';var needSave=false;if(hasIframe&&context.savedSelection!==null){context.fn.restoreSelection();needSave=true;} |
121 | 121 | retval=(hasIframe?context.fn:fn)[command].call(this,options);if(hasIframe&&needSave){context.fn.saveSelection();} |
122 | 122 | return retval;};})(jQuery);(function($){$.wikiEditor={'modules':{},'instances':[],'browsers':{'ltr':{'msie':[['>=',7]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]],'netscape':[['>=',9]],'blackberry':false,'ipod':false,'iphone':false},'rtl':{'msie':[['>=',8]],'firefox':[['>=',2]],'opera':[['>=',9.6]],'safari':[['>=',3]],'chrome':[['>=',3]],'netscape':[['>=',9]],'blackberry':false,'ipod':false,'iphone':false}},'imgPath':wgScriptPath+'/extensions/UsabilityInitiative/images/wikiEditor/','isSupported':function(module){if(module&&typeof module.name!='undefined'&&(module.name=='toc'||module.name=='highlight')&&typeof wgReallyGiveMeTOC=='undefined'){return module.supported=false;} |
123 | 123 | var mod=module&&'browsers'in module?module:$.wikiEditor;if(typeof mod.supported!=='undefined'){return mod.supported;} |