Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -135,7 +135,7 @@ |
136 | 136 | array( |
137 | 137 | 'src' => 'js/plugins/jquery.wikiEditor.js', |
138 | 138 | 'class' => 'j.wikiEditor', |
139 | | - 'version' => 68 |
| 139 | + 'version' => 69 |
140 | 140 | ), |
141 | 141 | array( |
142 | 142 | 'src' => 'js/plugins/jquery.wikiEditor.highlight.js', |
— | — | @@ -173,10 +173,10 @@ |
174 | 174 | 'version' => 1 ), |
175 | 175 | ), |
176 | 176 | 'combined' => array( |
177 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 179 ), |
| 177 | + array( 'src' => 'js/plugins.combined.js', 'version' => 180 ), |
178 | 178 | ), |
179 | 179 | 'minified' => array( |
180 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 179 ), |
| 180 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 180 ), |
181 | 181 | ), |
182 | 182 | ), |
183 | 183 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -938,6 +938,13 @@ |
939 | 939 | context.$textarea.attr( 'disabled', false ); |
940 | 940 | context.$textarea.val( context.$textarea.textSelection( 'getContents' ) ); |
941 | 941 | } ); |
| 942 | + /* FIXME: This was taken from EditWarning.js - maybe we could do a jquery plugin for this? */ |
| 943 | + // Attach our own handler for onbeforeunload which respects the current one |
| 944 | + context.fallbackWindowOnBeforeUnload = window.onbeforeunload; |
| 945 | + window.onbeforeunload = function() { |
| 946 | + context.$textarea.val( context.$textarea.textSelection( 'getContents' ) ); |
| 947 | + return context.fallbackWindowOnBeforeUnload ? context.fallbackWindowOnBeforeUnload() : null; |
| 948 | + } |
942 | 949 | } |
943 | 950 | |
944 | 951 | /* API Execution */ |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -7300,6 +7300,13 @@ |
7301 | 7301 | context.$textarea.attr( 'disabled', false ); |
7302 | 7302 | context.$textarea.val( context.$textarea.textSelection( 'getContents' ) ); |
7303 | 7303 | } ); |
| 7304 | + /* FIXME: This was taken from EditWarning.js - maybe we could do a jquery plugin for this? */ |
| 7305 | + // Attach our own handler for onbeforeunload which respects the current one |
| 7306 | + context.fallbackWindowOnBeforeUnload = window.onbeforeunload; |
| 7307 | + window.onbeforeunload = function() { |
| 7308 | + context.$textarea.val( context.$textarea.textSelection( 'getContents' ) ); |
| 7309 | + return context.fallbackWindowOnBeforeUnload ? context.fallbackWindowOnBeforeUnload() : null; |
| 7310 | + } |
7304 | 7311 | } |
7305 | 7312 | |
7306 | 7313 | /* API Execution */ |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -486,7 +486,7 @@ |
487 | 487 | context.$content=$(context.$iframe[0].contentWindow.document.body);var html=context.$textarea.val().replace(/\</g,'<').replace(/\>/g,'>');if($.browser.msie){if($.browser.versionNumber<=7){html=html.replace(/ /g," ");}else{html=html.replace(/(^|\n) /g,"$1 ");} |
488 | 488 | html=html.replace(/\t/g,'<span class="wikiEditor-tab"></span>');} |
489 | 489 | context.$content.html(html.replace(/\r?\n/g,'<br />'));if($('body').is('.rtl')){context.$content.addClass('rtl').attr('dir','rtl');} |
490 | | -context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('change',event);}).delayedBind(250,'keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});} |
| 490 | +context.$textarea.attr('disabled',true);context.$textarea.hide();context.$iframe.show();context.fn.trigger('ready');$(context.$iframe[0].contentWindow.document).bind('keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('change',event);}).delayedBind(250,'keyup mouseup paste cut encapsulateSelection',function(event){context.fn.trigger('delayedChange',event);});});context.$textarea.closest('form').submit(function(){context.$textarea.attr('disabled',false);context.$textarea.val(context.$textarea.textSelection('getContents'));});context.fallbackWindowOnBeforeUnload=window.onbeforeunload;window.onbeforeunload=function(){context.$textarea.val(context.$textarea.textSelection('getContents'));return context.fallbackWindowOnBeforeUnload?context.fallbackWindowOnBeforeUnload():null;}} |
491 | 491 | arguments=$.makeArray(arguments);if(arguments.length>0){var call=arguments.shift();if(call in context.api){context.api[call](context,typeof arguments[0]=='undefined'?{}:arguments[0]);}} |
492 | 492 | return $(this).data('wikiEditor-context',context);};})(jQuery);RegExp.escape=function(s){return s.replace(/([.*+?^${}()|\/\\[\]])/g,'\\$1');};(function($){$.wikiEditor.modules.dialogs={api:{addDialog:function(context,data){$.wikiEditor.modules.dialogs.fn.create(context,data)},openDialog:function(context,module){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('open');}},closeDialog:function(context,data){if(module in $.wikiEditor.modules.dialogs.modules){$('#'+$.wikiEditor.modules.dialogs.modules[module].id).dialog('close');}}},fn:{create:function(context,config){for(module in config){$.wikiEditor.modules.dialogs.modules[module]=config[module];} |
493 | 493 | mw.load(['$j.ui','$j.ui.dialog','$j.ui.draggable','$j.ui.resizable'],function(){for(module in $.wikiEditor.modules.dialogs.modules){var module=$.wikiEditor.modules.dialogs.modules[module];if($('#'+module.id).size()==0){var configuration=module.dialog;configuration.bgiframe=true;configuration.autoOpen=false;configuration.modal=true;configuration.title=$.wikiEditor.autoMsg(module,'title');configuration.newButtons={};for(msg in configuration.buttons) |