Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/68128
Change subject: Replace alpha notice with beta label hiding the feedback link
......................................................................
Replace alpha notice with beta label hiding the feedback link
Bug: 48428
Change-Id: I725beec4e76dadfb1ccca873758f8f37b7f58a73
---
M VisualEditor.i18n.php
M VisualEditor.php
M modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
4 files changed, 92 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/28/68128/1
diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index d89b6ef..5712cb1 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -51,6 +51,8 @@
'visualeditor-savedialog-label-restore' => 'Restore page',
'visualeditor-editnotices-tool' => '$1 {{PLURAL:$1|notice|notices}}',
'visualeditor-feedback-tool' => 'Leave feedback',
+ 'visualeditor-beta-label' => 'beta',
+ 'visualeditor-beta-warning' => 'VisualEditor is in \'beta\' and so may
not let you edit everything yet.',
'visualeditor-meta-tool' => 'Page settings',
'visualeditor-window-title' => 'Inspect',
'visualeditor-linkinspector-title' => 'Hyperlink',
@@ -107,7 +109,6 @@
'visualeditor-problem' => 'Describe what went wrong with the wikitext
serialization',
'visualeditor-aliennode-tooltip' => 'Sorry, this element cannot be
edited using the VisualEditor',
'visualeditor-descriptionpagelink' => 'Project:VisualEditor',
- 'visualeditor-alphawarning' => 'You are using an alpha version of the
[[{{MediaWiki:Visualeditor-descriptionpagelink}}|VisualEditor]]. It may be slow
and make erroneous changes—please check each edit that you make.',
'visualeditor-browserwarning' => 'You are using a browser which is not
officially supported by VisualEditor.',
'visualeditor-report-notice' => 'I understand that by clicking "Report
problem" I will transmit my changes and my feedback, which will be stored for
analysis. I agree to provide feedback in accordance with the
[[{{MediaWiki:Visualeditor-report-link}}|Terms of Use]].',
'visualeditor-report-link' => 'foundation:Terms of Use',
@@ -201,6 +202,8 @@
'visualeditor-savedialog-label-restore' => 'Label text for save button
when the user is editing a previous revision',
'visualeditor-editnotices-tool' => 'Text of tool in the toolbar that
shows edit notices (such as [[MediaWiki:editnotice-0]] and
[[MediaWiki:editnotice-8/en]]) as a pop-up',
'visualeditor-feedback-tool' => 'Text of tool in the toolbar that lets
users provide feedback',
+ 'visualeditor-beta-label' => 'Text of tool in the toolbar that
highlights that VisualEditor is still in beta',
+ 'visualeditor-beta-warning' => 'Note shown when user clicks on \'beta\'
label in VisualEditor, warning users that the software may have issues',
'visualeditor-meta-tool' => 'Text of tool in the toolbar the lets users
set categories, language links and other page settings.
{{Identical|Page settings}}',
'visualeditor-window-title' => 'Title of an unnamed inspector',
@@ -275,7 +278,6 @@
'visualeditor-aliennode-tooltip' => 'Tooltip for items that the
VisualEditor cannot edit',
'visualeditor-descriptionpagelink' => 'Name of a page describing the
use of the VisualEditor in this project.
{{doc-important|Do not translate "Project"; it is automatically converted to
the wiki\'s project namespace.}}',
- 'visualeditor-alphawarning' => 'Edit notice shown when the VisualEditor
loads, warning users that the software may have issues',
'visualeditor-browserwarning' => 'Edit notice shown when the
VisualEditor loads, warning users that their browser is not officially
supported',
'visualeditor-report-notice' => 'Notice to user that their data will be
sent for analysis.
Link is in {{msg-mw|Visualeditor-report-link}}.
diff --git a/VisualEditor.php b/VisualEditor.php
index 58262ba..b717e31 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -60,8 +60,6 @@
'group' => 'ext.visualEditor',
);
-$wgVisualEditorEditNotices = array( 'visualeditor-alphawarning' );
-
$wgVisualEditorEnableSectionEditLinks = false;
$wgResourceModules += array(
@@ -167,6 +165,8 @@
'visualeditor-problem',
'visualeditor-editnotices-tool',
'visualeditor-feedback-tool',
+ 'visualeditor-beta-label',
+ 'visualeditor-beta-warning',
'visualeditor-meta-tool',
'visualeditor-restore-page',
'visualeditor-create-page',
diff --git a/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css
b/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css
index f48ee4f..f821833 100644
--- a/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css
+++ b/modules/ve/init/mw/styles/ve.init.mw.ViewPageTarget.css
@@ -34,6 +34,24 @@
margin-top: 0.2em;
}
+/* Beta notices */
+
+.ve-init-mw-viewPageTarget-toolbar-betaNotice {
+ display: none;
+ position: absolute;
+ right: -0.5em;
+ top: 30px;
+ width: 11em;
+ font-family: sans-serif;
+ border: solid 1px #ccc;
+ padding: 0.5em 1.25em 0 1.25em;
+ border-radius: 0.25em;
+ background-color: #fff;
+ box-shadow: 0 0.15em 0.5em 0 rgba(0, 0, 0, 0.2);
+ z-index: 3;
+ line-height: 1.5em;
+}
+
/* Edit notices */
.ve-init-mw-viewPageTarget-toolbar-editNotices {
@@ -44,7 +62,7 @@
width: 29em;
font-family: sans-serif;
border: solid 1px #ccc;
- padding: 0 0.75em 0 0.75em;
+ padding: 0 1.75em 0 0.75em;
border-radius: 0.25em;
background-color: #fff;
box-shadow: 0 0.15em 0.5em 0 rgba(0, 0, 0, 0.2);
@@ -76,6 +94,12 @@
color: #555555;
}
+.ve-init-mw-viewPageTarget-tool-beta-label {
+ color: #aaaaaa;
+ font-size: 120%;
+ font-variant: small-caps;
+}
+
.ve-init-mw-viewPageTarget-tool:hover .ve-init-mw-viewPageTarget-tool-label {
text-decoration: underline;
}
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index e74710f..fa127c5 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -39,17 +39,24 @@
this.saveDialogSaveButton = null;
this.saveDialogReviewGoodButton = null;
- this.$toolbarEditNotices = $( '<div>' ).addClass(
- 've-init-mw-viewPageTarget-toolbar-editNotices'
- );
- this.$toolbarEditNoticesTool = $( '<div>' ).addClass(
- 've-init-mw-viewPageTarget-tool'
- );
- this.$toolbarFeedbackTool = $( '<div>' ).addClass(
- 've-init-mw-viewPageTarget-tool'
- );
- this.$toolbarMwMetaButton = $( '<div>' ).addClass(
've-init-mw-viewPageTarget-tool' );
- this.$saveDialog = $( '<div>' ).addClass(
've-init-mw-viewPageTarget-saveDialog' );
+ this.$toolbarEditNotices = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-toolbar-editNotices' );
+ this.$toolbarEditNoticesTool = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-tool' );
+
+ this.$toolbarFeedbackTool = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-tool' );
+
+ this.$toolbarBetaNotice = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-toolbar-betaNotice' );
+ this.$toolbarBetaNoticeTool = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-tool' );
+
+ this.$toolbarMwMetaButton = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-tool' );
+ this.$saveDialog = $( '<div>' )
+ .addClass( 've-init-mw-viewPageTarget-saveDialog' );
+
this.onBeforeUnloadFallback = null;
this.onBeforeUnloadHandler = null;
this.active = false;
@@ -309,6 +316,7 @@
this.doc = doc;
this.setUpSurface( doc );
this.setupToolbarEditNotices();
+ this.setupToolbarBetaNotice();
this.setupToolbarButtons();
this.setupSaveDialog();
this.attachToolbarButtons();
@@ -586,6 +594,19 @@
*/
ve.init.mw.ViewPageTarget.prototype.onToolbarEditNoticesToolClick = function
() {
this.$toolbarEditNotices.fadeToggle( 'fast' );
+ this.$toolbarBetaNotice.fadeOut( 'fast' );
+ this.$document.focus();
+};
+
+/**
+ * Handle clicks on the beta notices tool in the toolbar.
+ *
+ * @method
+ * @param {jQuery.Event} e Mouse click event
+ */
+ve.init.mw.ViewPageTarget.prototype.onToolbarBetaNoticeToolClick = function ()
{
+ this.$toolbarBetaNotice.fadeToggle( 'fast' );
+ this.$toolbarEditNotices.fadeOut( 'fast' );
this.$document.focus();
};
@@ -736,10 +757,9 @@
};
/**
- * Get a list of edit notices.
+ * Set up the list of edit notices.
*
* @method
- * @returns {string[]} HTML strings for each edit notice
*/
ve.init.mw.ViewPageTarget.prototype.setupToolbarEditNotices = function () {
var key;
@@ -747,6 +767,18 @@
for ( key in this.editNotices ) {
this.$toolbarEditNotices.append( this.editNotices[key] );
}
+};
+
+/**
+ * Set up the beta notices panel.
+ *
+ * @method
+ * @returns {string[]} HTML strings for each edit notice
+ */
+ve.init.mw.ViewPageTarget.prototype.setupToolbarBetaNotice = function () {
+ this.$toolbarBetaNotice.empty();
+ this.$toolbarBetaNotice
+ .append( $( '<span>' ).text( ve.msg(
'visualeditor-beta-warning' ) ) );
};
/**
@@ -965,6 +997,16 @@
.click( ve.bind( this.onToolbarEditNoticesToolClick,
this ) );
this.$toolbarEditNotices.fadeIn( 'fast' );
}
+
+ this.$toolbarBetaNoticeTool
+ .append(
+ $( '<span>' )
+ .addClass(
've-init-mw-viewPageTarget-tool-label
ve-init-mw-viewPageTarget-tool-beta-label' )
+ .text( ve.msg( 'visualeditor-beta-label' ) )
+ )
+ .append( this.$toolbarBetaNotice )
+ .click( ve.bind( this.onToolbarBetaNoticeToolClick, this ) );
+
this.$toolbarFeedbackTool
.addClass( 've-ui-icon-comment' )
.append(
@@ -985,6 +1027,7 @@
this.toolbarSaveButton.disconnect( this );
this.$toolbarMwMetaButton.empty().off( 'click' );
this.$toolbarEditNoticesTool.empty().off( 'click' );
+ this.$toolbarBetaNoticeTool.empty().off( 'click' );
this.$toolbarFeedbackTool.empty().off( 'click' );
};
@@ -995,7 +1038,9 @@
*/
ve.init.mw.ViewPageTarget.prototype.attachToolbarButtons = function () {
var $target = this.toolbar.$actions;
- $target.append( this.$toolbarFeedbackTool );
+ $target.append( this.$toolbarBetaNoticeTool );
+ this.$toolbarBetaNotice.append( this.$toolbarFeedbackTool );
+
if ( !ve.isEmptyObject( this.editNotices ) ) {
$target.append( this.$toolbarEditNoticesTool );
}
@@ -1017,6 +1062,7 @@
this.$toolbarMwMetaButton.detach();
this.$toolbarEditNoticesTool.detach();
this.$toolbarFeedbackTool.detach();
+ this.$toolbarBetaNoticeTool.detach();
};
/**
@@ -1214,6 +1260,7 @@
viewPage.surface.disable();
+ viewPage.$toolbarBetaNotice.fadeOut( 'fast' );
viewPage.$toolbarEditNotices.fadeOut( 'fast' );
viewPage.swapSaveDialog( 'save' );
--
To view, visit https://gerrit.wikimedia.org/r/68128
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I725beec4e76dadfb1ccca873758f8f37b7f58a73
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits