jenkins-bot has submitted this change and it was merged.
Change subject: Delete the editWarning feature
......................................................................
Delete the editWarning feature
Moved to MediaWiki core in I7bdbd09f4.
Bug: 46514
Change-Id: I164f17255bc92796e162a0c3da42b28c01809bdc
---
M Vector.hooks.php
M Vector.i18n.php
M Vector.php
D modules/ext.vector.editWarning.js
4 files changed, 0 insertions(+), 79 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/Vector.hooks.php b/Vector.hooks.php
index 8d28f61..50cec46 100644
--- a/Vector.hooks.php
+++ b/Vector.hooks.php
@@ -31,20 +31,6 @@
'collapsibletabs' => array(
'modules' => array( 'ext.vector.collapsibleTabs' ),
),
- 'editwarning' => array(
- 'preferences' => array(
- // Ideally this would be 'vector-editwarning'
- 'useeditwarning' => array(
- 'type' => 'toggle',
- 'label-message' =>
'vector-editwarning-preference',
- 'section' => 'editing/advancedediting',
- ),
- ),
- 'requirements' => array(
- 'useeditwarning' => true,
- ),
- 'modules' => array( 'ext.vector.editWarning' ),
- ),
'expandablesearch' => array(
'requirements' => array( 'vector-simplesearch' => true
),
'modules' => array( 'ext.vector.expandableSearch' ),
diff --git a/Vector.i18n.php b/Vector.i18n.php
index 0fa7b48..a4ad25b 100644
--- a/Vector.i18n.php
+++ b/Vector.i18n.php
@@ -16,9 +16,6 @@
'vector-desc' => 'Enhances the user interface when using the Vector
skin',
'vector-collapsiblenav-preference' => 'Enable collapsing of items in
the sidebar in Vector skin',
'vector-collapsiblenav-more' => 'More languages',
- 'vector-editwarning-warning' => 'Leaving this page may cause you to
lose any changes you have made.
-If you are logged in, you can disable this warning in the "Editing" section of
your preferences.',
- 'vector-editwarning-preference' => 'Warn me when I leave an edit page
with unsaved changes',
'vector-simplesearch-search' => 'Search',
'vector-simplesearch-containing' => 'containing...',
'vector-noexperiments-preference' => 'Exclude me from feature
experiments',
diff --git a/Vector.php b/Vector.php
index f99584c..595b023 100644
--- a/Vector.php
+++ b/Vector.php
@@ -19,7 +19,6 @@
$wgVectorFeatures = array(
'collapsiblenav' => array( 'global' => true, 'user' => true ),
'collapsibletabs' => array( 'global' => true, 'user' => false ),
- 'editwarning' => array( 'global' => false, 'user' => true ),
// The follwing are experimental and likely unstable - use at your own
risk
'expandablesearch' => array( 'global' => false, 'user' => false ),
'footercleanup' => array( 'global' => false, 'user' => false ),
@@ -90,12 +89,6 @@
'dependencies' => array(
'jquery.collapsibleTabs',
'jquery.delayedBind',
- ),
- ),
- 'ext.vector.editWarning' => $vectorResourceTemplate + array(
- 'scripts' => 'ext.vector.editWarning.js',
- 'messages' => array(
- 'vector-editwarning-warning',
),
),
'ext.vector.expandableSearch' => $vectorResourceTemplate + array(
diff --git a/modules/ext.vector.editWarning.js
b/modules/ext.vector.editWarning.js
deleted file mode 100644
index e128fd4..0000000
--- a/modules/ext.vector.editWarning.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Edit warning for Vector
- */
-( function ( mw, $ ) {
- $(document).ready( function () {
- // Check if EditWarning is enabled and if we need it
- if ( $( '#wpTextbox1' ).length === 0 ) {
- return true;
- }
- // Get the original values of some form elements
- $( '#wpTextbox1, #wpSummary' ).each( function () {
- $(this).data( 'origtext', $(this).val() );
- });
- var savedWindowOnBeforeUnload;
- $( window )
- .on( 'beforeunload.editwarning', function () {
- var retval;
-
- // Check if the current values of some form
elements are the same as
- // the original values
- if (
- mw.config.get( 'wgAction' ) == 'submit'
||
- $( '#wpTextbox1' ).data(
'origtext' ) != $( '#wpTextbox1' ).val() ||
- $( '#wpSummary' ).data(
'origtext' ) != $( '#wpSummary' ).val()
- ) {
- // Return our message
- retval = mw.msg(
'vector-editwarning-warning' );
- }
-
- // Unset the onbeforeunload handler so we don't
break page caching in Firefox
- savedWindowOnBeforeUnload =
window.onbeforeunload;
- window.onbeforeunload = null;
- if ( retval !== undefined ) {
- // ...but if the user chooses not to
leave the page, we need to rebind it
- setTimeout( function () {
- window.onbeforeunload =
savedWindowOnBeforeUnload;
- }, 1 );
- return retval;
- }
- } )
- .on( 'pageshow.editwarning', function () {
- // Re-add onbeforeunload handler
- if ( window.onbeforeunload == null ) {
- window.onbeforeunload =
savedWindowOnBeforeUnload;
- }
- } );
-
- // Add form submission handler
- $( '#editform' ).submit( function () {
- // Unbind our handlers
- $( window ).off( '.editwarning' );
- });
- });
-
-}( mediaWiki, jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/57320
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I164f17255bc92796e162a0c3da42b28c01809bdc
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/Vector
Gerrit-Branch: master
Gerrit-Owner: Rahul21 <[email protected]>
Gerrit-Reviewer: Isarra <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Matmarex <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits