Index: trunk/extensions/UsabilityInitiative/Vector/Modules/EditWarning/EditWarning.js |
— | — | @@ -26,9 +26,9 @@ |
27 | 27 | // Check if the current values of some form elements are the same as |
28 | 28 | // the original values |
29 | 29 | if( |
30 | | - $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val() |
31 | | - || $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val() |
32 | | - || $j( '#wikiPreview' ).is( ':visible' ) |
| 30 | + wgAction == 'submit' || |
| 31 | + $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val() || |
| 32 | + $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val() |
33 | 33 | ) { |
34 | 34 | // Return our message |
35 | 35 | return gM( 'vector-editwarning-warning' ); |
— | — | @@ -41,4 +41,4 @@ |
42 | 42 | }); |
43 | 43 | }); |
44 | 44 | //Global storage of fallback for onbeforeunload hook |
45 | | -var fallbackWindowOnBeforeUnload = null; |
\ No newline at end of file |
| 45 | +var fallbackWindowOnBeforeUnload = null; |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.hooks.php |
— | — | @@ -13,14 +13,14 @@ |
14 | 14 | static $scripts = array( |
15 | 15 | 'raw' => array( |
16 | 16 | array( 'src' => 'Modules/CollapsibleTabs/CollapsibleTabs.js', 'version' => 4 ), |
17 | | - array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 1 ), |
| 17 | + array( 'src' => 'Modules/EditWarning/EditWarning.js', 'version' => 2 ), |
18 | 18 | array( 'src' => 'Modules/SimpleSearch/SimpleSearch.js', 'version' => 2 ), |
19 | 19 | ), |
20 | 20 | 'combined' => array( |
21 | | - array( 'src' => 'Vector.combined.js', 'version' => 4 ), |
| 21 | + array( 'src' => 'Vector.combined.js', 'version' => 5 ), |
22 | 22 | ), |
23 | 23 | 'minified' => array( |
24 | | - array( 'src' => 'Vector.combined.min.js', 'version' => 4 ), |
| 24 | + array( 'src' => 'Vector.combined.min.js', 'version' => 5 ), |
25 | 25 | ), |
26 | 26 | ); |
27 | 27 | static $modules = array( |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.js |
— | — | @@ -103,9 +103,9 @@ |
104 | 104 | // Check if the current values of some form elements are the same as |
105 | 105 | // the original values |
106 | 106 | if( |
107 | | - $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val() |
108 | | - || $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val() |
109 | | - || $j( '#wikiPreview' ).is( ':visible' ) |
| 107 | + wgAction == 'submit' || |
| 108 | + $j( '#wpTextbox1' ).data( 'origtext' ) != $j( '#wpTextbox1' ).val() || |
| 109 | + $j( '#wpSummary' ).data( 'origtext' ) != $j( '#wpSummary' ).val() |
110 | 110 | ) { |
111 | 111 | // Return our message |
112 | 112 | return gM( 'vector-editwarning-warning' ); |
— | — | @@ -118,7 +118,8 @@ |
119 | 119 | }); |
120 | 120 | }); |
121 | 121 | //Global storage of fallback for onbeforeunload hook |
122 | | -var fallbackWindowOnBeforeUnload = null;/* JavaScript for SimpleSearch extension */ |
| 122 | +var fallbackWindowOnBeforeUnload = null; |
| 123 | +/* JavaScript for SimpleSearch extension */ |
123 | 124 | |
124 | 125 | // Disable mwsuggest.js on searchInput |
125 | 126 | if ( typeof os_autoload_inputs !== 'undefined' && os_autoload_forms !== 'undefined' ) { |
Index: trunk/extensions/UsabilityInitiative/Vector/Vector.combined.min.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | $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;}}});});js2AddOnloadHook(function(){if(!wgVectorPreferences||!(wgVectorPreferences.editwarning&&wgVectorPreferences.editwarning.enable)){return true;} |
6 | 6 | $j('#wpTextbox1, #wpSummary').each(function(){$j(this).data('origtext',$j(this).val());});fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){var fallbackResult=null;if(fallbackWindowOnBeforeUnload){fallbackResult=fallbackWindowOnBeforeUnload();} |
7 | 7 | if(fallbackResult!==null){return fallbackResult;} |
8 | | -if($j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()||$j('#wikiPreview').is(':visible')){return gM('vector-editwarning-warning');}} |
| 8 | +if(wgAction=='submit'||$j('#wpTextbox1').data('origtext')!=$j('#wpTextbox1').val()||$j('#wpSummary').data('origtext')!=$j('#wpSummary').val()){return gM('vector-editwarning-warning');}} |
9 | 9 | $j('form').submit(function(){window.onbeforeunload=fallbackWindowOnBeforeUnload;});});var fallbackWindowOnBeforeUnload=null;if(typeof os_autoload_inputs!=='undefined'&&os_autoload_forms!=='undefined'){os_autoload_inputs=[];os_autoload_forms=[];} |
10 | 10 | js2AddOnloadHook(function(){if(skin!='vector'){return;} |
11 | 11 | $j('div#simpleSearch > input#searchInput').each(function(){$j('<label></label>').text(gM('vector-simplesearch-search')).css({'display':'none','position':'absolute','bottom':0,'padding':'0.25em','color':'#999999','cursor':'text'}).css(($j('body').is('.rtl')?'right':'left'),0).click(function(){$j(this).parent().find('input#searchInput').focus();}).appendTo($j(this).parent());if($j(this).val()==''){$j(this).parent().find('label').show();}}).focus(function(){$j(this).parent().find('label').hide();}).blur(function(){if($j(this).val()==''){$j(this).parent().find('label').show();}});$j('#searchInput, #searchInput2, #powerSearchText, #searchText').suggestions({fetch:function(query){var $this=$j(this);var request=$j.ajax({url:wgScriptPath+'/api.php',data:{'action':'opensearch','search':query,'namespace':0,'suggest':''},dataType:'json',success:function(data){$this.suggestions('suggestions',data[1]);}});$j(this).data('request',request);},cancel:function(){var request=$j(this).data('request');if(request&&typeof request.abort=='function'){request.abort();$j(this).removeData('request');}},result:{select:function($textbox){$textbox.closest('form').submit();}},delay:120});$j('#searchInput').suggestions({result:{select:function($textbox){$textbox.closest('form').submit();}},special:{render:function(query){var perfectMatch=false;$j(this).closest('.suggestions').find('.suggestions-results div').each(function(){if($j(this).data('text')==query){perfectMatch=true;}});if(perfectMatch){if($j(this).children().size()==0){$j(this).show();$label=$j('<div />').addClass('special-label').text(gM('vector-simplesearch-containing')).appendTo($j(this));$query=$j('<div />').addClass('special-query').text(query).appendTo($j(this));$query.autoEllipse();}else{$j(this).find('.special-query').empty().text(query).autoEllipse();}}else{$j(this).hide();$j(this).empty();}},select:function($textbox){$textbox.closest('form').append($j('<input />').attr({'type':'hidden','name':'fulltext','value':1}));$textbox.closest('form').submit();}},$region:$j('#simpleSearch')});}); |
\ No newline at end of file |