Index: trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js |
— | — | @@ -14,6 +14,7 @@ |
15 | 15 | var ourWindowOnBeforeUnload = function() { |
16 | 16 | var fallbackResult = undefined; |
17 | 17 | var retval = undefined; |
| 18 | + var thisFunc = arguments.callee; |
18 | 19 | // Check if someone already set on onbeforeunload hook |
19 | 20 | if ( fallbackWindowOnBeforeUnload ) { |
20 | 21 | // Get the result of their onbeforeunload hook |
— | — | @@ -39,6 +40,10 @@ |
40 | 41 | // Unset the onbeforeunload handler so we don't break page caching in Firefox |
41 | 42 | window.onbeforeunload = null; |
42 | 43 | if ( retval !== undefined ) { |
| 44 | + // ...but if the user chooses not to leave the page, we need to rebind it |
| 45 | + setTimeout( function() { |
| 46 | + window.onbeforeunload = thisFunc; |
| 47 | + } ); |
43 | 48 | return retval; |
44 | 49 | } |
45 | 50 | }; |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -15,15 +15,15 @@ |
16 | 16 | array( 'src' => 'Modules/CollapsibleNav/CollapsibleNav.js', 'version' => 28 ), |
17 | 17 | array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 8 ), |
18 | 18 | array( 'src' => 'Modules/ExpandableSearch/ExpandableSearch.js', 'version' => 5 ), |
19 | | - array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 9 ), |
| 19 | + array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 10 ), |
20 | 20 | array( 'src' => 'Modules/FooterCleanup/FooterCleanup.js', 'version' => 5 ), |
21 | 21 | array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 21 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'Vector.combined.js', 'version' => 63 ), |
| 24 | + array( 'src' => 'Vector.combined.js', 'version' => 64 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'Vector.combined.min.js', 'version' => 64 ), |
| 27 | + array( 'src' => 'Vector.combined.min.js', 'version' => 65 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $modules = array( |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js |
— | — | @@ -312,6 +312,7 @@ |
313 | 313 | var ourWindowOnBeforeUnload = function() { |
314 | 314 | var fallbackResult = undefined; |
315 | 315 | var retval = undefined; |
| 316 | + var thisFunc = arguments.callee; |
316 | 317 | // Check if someone already set on onbeforeunload hook |
317 | 318 | if ( fallbackWindowOnBeforeUnload ) { |
318 | 319 | // Get the result of their onbeforeunload hook |
— | — | @@ -337,6 +338,10 @@ |
338 | 339 | // Unset the onbeforeunload handler so we don't break page caching in Firefox |
339 | 340 | window.onbeforeunload = null; |
340 | 341 | if ( retval !== undefined ) { |
| 342 | + // ...but if the user chooses not to leave the page, we need to rebind it |
| 343 | + setTimeout( function() { |
| 344 | + window.onbeforeunload = thisFunc; |
| 345 | + } ); |
341 | 346 | return retval; |
342 | 347 | } |
343 | 348 | }; |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js |
— | — | @@ -15,9 +15,9 @@ |
16 | 16 | var rtl=$j('body').is('.rtl');$j.collapsibleTabs.moveToCollapsed=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var target=data.collapsedContainer;$moving.css("position","relative").css((rtl?'left':'right'),0).animate({width:'1px'},"normal",function(){$j(this).hide();$j('<span class="placeholder" style="display:none;"></span>').insertAfter(this);$j(this).remove().prependTo(target).data('collapsibleTabsSettings',data);$j(this).attr('style','display:list-item;');$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($j(ele)).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();});};$j.collapsibleTabs.moveToExpanded=function(ele){var $moving=$j(ele);$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=true;var data=$j.collapsibleTabs.getSettings($moving);var $target=$j(data.expandedContainer).find('span.placeholder:first');var expandedWidth=data.expandedWidth;$moving.css("position","relative").css((rtl?'right':'left'),0).css('width','1px');$target.replaceWith($moving.remove().css('width','1px').data('collapsibleTabsSettings',data).animate({width:expandedWidth+"px"},"normal",function(){$j(this).attr('style','display:block;');$j.collapsibleTabs.getSettings($j($j.collapsibleTabs.getSettings($moving).expandedContainer)).shifting=false;$j.collapsibleTabs.handleResize();}));};$j('#p-views ul').bind("beforeTabCollapse",function(){if($j('#p-cactions').css('display')=='none') |
17 | 17 | $j("#p-cactions").addClass("filledPortlet").removeClass("emptyPortlet").find('h5').css('width','1px').animate({'width':'26px'},390);}).bind("beforeTabExpand",function(){if($j('#p-cactions li').length==1) |
18 | 18 | $j("#p-cactions h5").animate({'width':'1px'},370,function(){$j(this).attr('style','').parent().addClass("emptyPortlet").removeClass("filledPortlet");});}).collapsibleTabs({expandCondition:function(eleWidth){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width()+1)<($j('#left-navigation').position().left-eleWidth);}else{return($j('#left-navigation').position().left+$j('#left-navigation').width()+1)<($j('#right-navigation').position().left-eleWidth);}},collapseCondition:function(){if(rtl){return($j('#right-navigation').position().left+$j('#right-navigation').width())>$j('#left-navigation').position().left;}else{return($j('#left-navigation').position().left+$j('#left-navigation').width())>$j('#right-navigation').position().left;}}});});$j(document).ready(function(){if(!wgVectorEnabledModules.editwarning||$j('#wpTextbox1').size()==0){return true;} |
19 | | -$j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});var fallbackWindowOnBeforeUnload=window.onbeforeunload;var ourWindowOnBeforeUnload=function(){var fallbackResult=undefined;var retval=undefined;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();} |
| 19 | +$j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});var fallbackWindowOnBeforeUnload=window.onbeforeunload;var ourWindowOnBeforeUnload=function(){var fallbackResult=undefined;var retval=undefined;var thisFunc=arguments.callee;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();} |
20 | 20 | if(fallbackResult!==undefined){retval=fallbackResult;}else{if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){retval=mw.usability.getMsg('vector-editwarning-warning');}} |
21 | | -window.onbeforeunload=null;if(retval!==undefined){return retval;}};var pageShowHandler=function(){window.onbeforeunload=ourWindowOnBeforeUnload;};pageShowHandler();if(window.addEventListener){window.addEventListener('pageshow',pageShowHandler,false);}else if(window.attachEvent){window.attachEvent('pageshow',pageShowHandler);} |
| 21 | +window.onbeforeunload=null;if(retval!==undefined){setTimeout(function(){window.onbeforeunload=thisFunc;});return retval;}};var pageShowHandler=function(){window.onbeforeunload=ourWindowOnBeforeUnload;};pageShowHandler();if(window.addEventListener){window.addEventListener('pageshow',pageShowHandler,false);}else if(window.attachEvent){window.attachEvent('pageshow',pageShowHandler);} |
22 | 22 | $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;$j(document).ready(function(){if(!wgVectorEnabledModules.expandablesearch||skin!='vector'){return true;} |
23 | 23 | var map={'ltr':{'msie':[['>=',8]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false},'rtl':{'msie':[['>=',8]],'blackberry':false,'ipod':false,'iphone':false,'ps3':false}};if(!mw.usability.testBrowser(map)){return true;} |
24 | 24 | $j('#searchInput').expandableField({'beforeExpand':function(context){$j(this).parent().animate({'borderTopColor':'#a0d8ff','borderLeftColor':'#a0d8ff','borderRightColor':'#a0d8ff','borderBottomColor':'#a0d8ff'},'fast');},'beforeCondense':function(context){$j(this).parent().animate({'borderTopColor':'#aaaaaa','borderLeftColor':'#aaaaaa','borderRightColor':'#aaaaaa','borderBottomColor':'#aaaaaa'},'fast');},'afterExpand':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'afterCondense':function(context){if(typeof $j.collapsibleTabs!='undefined'){$j.collapsibleTabs.handleResize();}},'expandToLeft':!$j('body').is('.rtl')}).css('float',$j('body').is('.rtl')?'right':'left').siblings('button').css('float',$j('body').is('.rtl')?'right':'left');});$j(document).ready(function(){if(!wgVectorEnabledModules.footercleanup){return true;} |