jenkins-bot has submitted this change and it was merged.

Change subject: Simplify editor switcher to match VE implementation
......................................................................


Simplify editor switcher to match VE implementation

Just show the alternative editor, and change the label
to 'Switch to (visual|source) editing'.

Use OOUI icons.

Change-Id: I12513a994d434ed2d5d2ce988dc35b0dfd4fe13a
---
M i18n/en.json
M i18n/qqq.json
D images/icons/editSourceNormal.svg
D images/icons/editToggle.svg
D images/icons/editVeNormal.svg
M includes/Resources.php
M resources/mobile.editor.common/EditorOverlayBase.js
M resources/mobile.editor.common/editor.less
D resources/mobile.editor.common/images/editToggle.svg
M resources/mobile.editor.overlay/EditorOverlay.js
10 files changed, 14 insertions(+), 133 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 321a113..9a0c928 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -121,7 +121,6 @@
        "mobile-frontend-editor-previewing-page": 
"<span><strong>Previewing</strong> $1</span>",
        "mobile-frontend-editor-redirect-title": "Redirecting to editor...",
        "mobile-frontend-editor-save": "Save",
-       "mobile-frontend-editor-source-editor": "Edit source",
        "mobile-frontend-editor-success": "Success! Your edit was saved.",
        "mobile-frontend-editor-success-landmark-1": "Congratulations, you are 
now a {{SITENAME}} editor!",
        "mobile-frontend-editor-success-new-page": "Congratulations on creating 
a new page!",
@@ -130,6 +129,7 @@
        "mobile-frontend-editor-summary": "Summary:",
        "mobile-frontend-editor-switch-confirm": "You must save your edit 
before switching to another editing mode.",
        "mobile-frontend-editor-switch-editor": "Switch editor",
+       "mobile-frontend-editor-switch-visual-editor": "Switch to visual 
editing",
        "mobile-frontend-editor-tutorial-cancel": "No, thanks",
        "mobile-frontend-editor-tutorial-confirm": "Start editing",
        "mobile-frontend-editor-tutorial-summary": "Try improving the $1 
page.<br />Don't be scared of markup.",
@@ -137,7 +137,6 @@
        "mobile-frontend-editor-undo-unsupported": "Undo is not currently 
supported on mobile devices.",
        "mobile-frontend-editor-uploadenable": "Please upload a photo first to 
enable editing.",
        "mobile-frontend-editor-viewing-source-page": "<strong>Viewing source 
of</strong><span> $1</span>",
-       "mobile-frontend-editor-visual-editor": "Edit",
        "mobile-frontend-editor-wait": "Saving edit, please wait.",
        "mobile-frontend-editor-redlink-leave": "No, thanks.",
        "mobile-frontend-editor-redlink-explain": "This page has not yet been 
created on {{SITENAME}}.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 8a07ff6..822739c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -117,7 +117,6 @@
        "mobile-frontend-editor-previewing-page": "A heading saying what page 
is being previewed after editing. All text should be wrapped in a STRONG tag 
except the page title itself.\n\nParameters:\n* $1 - page 
title\n{{Related|Mobile-frontend-editor-page}}",
        "mobile-frontend-editor-redirect-title": "Shown as a user is redirected 
to the JavaScript editor after browsing to a URL with action=edit.\n\nUsed as 
page title.",
        "mobile-frontend-editor-save": "Caption for save button on edit 
form.\n\nShould be consistent with the following message:\n* 
{{msg-mw|mobile-frontend-editor-license}}\n{{Identical|Save}}",
-       "mobile-frontend-editor-source-editor": "Label for button that switches 
to the 'source editor' (a WikiText editing interface). Appears near 
{{msg-mw|mobile-frontend-editor-visual-editor}}.\n{{Identical|Edit source}}",
        "mobile-frontend-editor-success": "Text that displays when a page edit 
has been successfully saved.\n\nUsed as \"toast\" message.\n\nSee also:\n* 
{{msg-mw|Mobile-frontend-editor-success-landmark-1}}",
        "mobile-frontend-editor-success-landmark-1": "Special save success 
message shown to users on their 1st edit.\n\nSee also:\n* 
{{msg-mw|Mobile-frontend-editor-success}}",
        "mobile-frontend-editor-success-new-page": "Text that displays when a 
new page has been successfully saved.\n\nUsed as \"toast\" message.",
@@ -126,6 +125,7 @@
        "mobile-frontend-editor-summary": "The Summary text, in plain text, 
beside the edit summary field.\nPlain text version of 
{{msg-mw|summary}}\n{{Identical|Summary}}",
        "mobile-frontend-editor-switch-confirm": "Warning message telling the 
user they must save their changes before switching to a different editing 
interface.",
        "mobile-frontend-editor-switch-editor": "Label for button that allows 
the user to switch between two different editing interfaces",
+       "mobile-frontend-editor-switch-visual-editor": "Label for button that 
switches to the \"visual editor\" (a WYSIWYG editing interface). Appears near 
{{msg-mw|mobile-frontend-editor-source-edit}}. See 
http://www.mediawiki.org/wiki/VisualEditor.";,
        "mobile-frontend-editor-tutorial-cancel": "Label for button that user 
can click if they do not want to edit.\n{{Identical|No thanks}}",
        "mobile-frontend-editor-tutorial-confirm": "Text for the button a user 
clicks after they have read the editing tutorial and are ready to edit the 
page.\n\nSee also:\n* {{msg-mw|Mobile-frontend-editor-tutorial-summary}}",
        "mobile-frontend-editor-tutorial-summary": "Text for tutorial overlay 
presented to a user the first time they try to edit a page.\n\nParameters:\n* 
$1 - page title\nSee also:\n* 
{{msg-mw|Mobile-frontend-editor-tutorial-alt-summary}}",
@@ -133,7 +133,6 @@
        "mobile-frontend-editor-undo-unsupported": "Shown when user attempts to 
do an undo which is currently not supported.",
        "mobile-frontend-editor-uploadenable": "Shown when try to edit a new 
file page.",
        "mobile-frontend-editor-viewing-source-page": "A heading saying which 
page's source code is being viewed. All text should be wrapped in a STRONG tag 
except the page title itself.\n\nParameters:\n* $1 - page 
title\n{{Related|Mobile-frontend-editor-page}}",
-       "mobile-frontend-editor-visual-editor": "Label for button that switches 
to the \"visual editor\" (a WYSIWYG editing interface). Appears near 
{{msg-mw|mobile-frontend-editor-source-edit}}. See 
http://www.mediawiki.org/wiki/VisualEditor.\n{{Identical|Edit}}",
        "mobile-frontend-editor-wait": "Text that displays while a page edit is 
being saved.",
        "mobile-frontend-editor-redlink-leave": "Used as a message for a link, 
that the user doesn't want to edit a page, that does not exist 
yet.\n{{Identical|No thanks}}",
        "mobile-frontend-editor-redlink-explain": "Question for the user, if he 
want to edit a page, which link he clicked and that does not exist yet, or 
not.",
diff --git a/images/icons/editSourceNormal.svg 
b/images/icons/editSourceNormal.svg
deleted file mode 100644
index e4d3c9b..0000000
--- a/images/icons/editSourceNormal.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 32 32" 
enable-background="new 0 0 40 40">
-    <g fill="#575757">
-        <path d="M22.496 
11.403c-.057-1.1-.57-2.167-1.328-3.01-.776-.865-1.84-1.53-2.99-1.717l-14.825 
13.3.01.006-.008-.004-1.188 5.346 
5.48-.604.002.003.003-.003h.006l-.003-.004c2.963-2.657 11.472-10.293 
14.84-13.313zM6.056 21.528c-.42-.423-.778-.683-1.27-1.02l13.316-12.04c.45.14 
1.073.502 1.264 1.022L6.056 21.528zM21.61 
17.58v1.317h-1.435v8.09h1.435V28.3h-3.104v-10.72h3.104zm5.12 
10.72v-1.315h1.434v-8.09H26.73V17.58h3.103V28.3H26.73z"/>
-    </g>
-</svg>
diff --git a/images/icons/editToggle.svg b/images/icons/editToggle.svg
deleted file mode 100644
index d2a0350..0000000
--- a/images/icons/editToggle.svg
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg"; width="639.614" height="415.001" 
viewBox="2.5 791.5 639.61402 415.00101" enable-background="new 2.5 791.5 
606.667 606.667">
-    <path d="M417.5 
1037.04v-76.08l-46.687-7.783c-3.46-12.536-8.646-24.64-14.7-35.447l27.236-38.474-53.605-54.037-38.475
 27.234c-11.238-6.053-22.91-11.24-35.447-14.7L248.04 791.5h-76.08l-7.783 
46.688c-12.536 3.458-24.64 8.646-35.447 14.698l-38.474-27.234-54.037 53.604 
27.234 38.474c-6.053 11.24-11.24 22.91-14.7 35.88L2.5 960.96v76.082l46.255 
7.782c3.458 12.536 8.646 24.64 14.7 35.88l-27.236 38.474 53.603 53.605 
38.474-27.235c11.24 6.052 22.91 11.24 35.88 14.697l7.782 
46.256h76.08l7.783-46.686c12.536-3.46 24.64-8.646 35.447-14.7l38.475 27.236 
53.604-53.604-27.236-38.475c6.053-11.237 11.24-22.91 
14.7-35.88l46.686-7.35zm-207.5 41.5c-44.094 0-79.54-35.878-79.54-79.54 0-44.094 
35.878-79.54 79.54-79.54 43.662 0 79.54 35.446 79.54 79.54 0 44.095-35.445 
79.54-79.54 79.54z" id="path4" fill="#555"/>
-    <path d="M574.97 1059.195L642.114 944.6H507.807z" id="path6" 
fill="#414141" fill-rule="evenodd"/>
-</svg>
diff --git a/images/icons/editVeNormal.svg b/images/icons/editVeNormal.svg
deleted file mode 100644
index 5f7d6fc..0000000
--- a/images/icons/editVeNormal.svg
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 32 32" 
enable-background="new 0 0 40 40">
-    <path d="M26.164 
11.403c-.057-1.1-.57-2.167-1.328-3.01-.776-.865-1.84-1.53-2.99-1.717l-14.825 
13.3.01.006-.007-.004-1.188 5.346 
5.48-.604.002.003.004-.003h.007l-.002-.004c2.963-2.657 11.472-10.293 
14.84-13.313zM9.724 21.528c-.42-.423-.778-.683-1.27-1.02L21.77 8.468c.45.14 
1.073.502 1.264 1.022L9.724 21.528z" fill="#575757"/>
-</svg>
diff --git a/includes/Resources.php b/includes/Resources.php
index db01a10..58a8138 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -160,11 +160,6 @@
                        'addimage' => 'images/icons/uploadLocked.svg',
                        'addimage-enabled' => 'images/icons/upload.svg',
 
-                       // Editor
-                       'edit-source' => 'images/icons/editSourceNormal.svg',
-                       'edit-ve' => 'images/icons/editVeNormal.svg',
-                       'edit-switch' => 'images/icons/editToggle.svg',
-
                        // TOC
                        'toc' => 'images/icons/contents-ltr.svg',
 
@@ -639,9 +634,8 @@
                        'mobile-frontend-editor-editing-page',
                        'mobile-frontend-editor-previewing-page',
                        'mobile-frontend-editor-switch-confirm',
-                       'mobile-frontend-editor-visual-editor',
-                       'mobile-frontend-editor-source-editor',
                        'mobile-frontend-editor-switch-editor',
+                       'mobile-frontend-editor-switch-visual-editor',
                        'mobile-frontend-editor-anonwarning',
                ),
        ),
@@ -650,6 +644,7 @@
                'dependencies' => array(
                        'mobile.editor.common',
                        'mobile.microAutoSize',
+                       'oojs-ui.styles.icons-editing-core',
                ),
                'scripts' => array(
                        'resources/mobile.editor.overlay/EditorOverlay.js',
diff --git a/resources/mobile.editor.common/EditorOverlayBase.js 
b/resources/mobile.editor.common/EditorOverlayBase.js
index 9b3c48c..850a570 100644
--- a/resources/mobile.editor.common/EditorOverlayBase.js
+++ b/resources/mobile.editor.common/EditorOverlayBase.js
@@ -22,38 +22,13 @@
        OO.inheritClass( EditVeTool, OO.ui.Tool );
 
        EditVeTool.static.name = 'editVe';
-       EditVeTool.static.icon = 'edit-ve';
+       EditVeTool.static.icon = 'edit';
        EditVeTool.static.group = 'editorSwitcher';
-       EditVeTool.static.title = mw.msg( 
'mobile-frontend-editor-visual-editor' );
+       EditVeTool.static.title = mw.msg( 
'mobile-frontend-editor-switch-visual-editor' );
        /**
         * click handler
         */
        EditVeTool.prototype.onSelect = function () {
-               // will be overridden later
-       };
-
-       /**
-        * 'Edit source' button
-        * @param {OO.ui.ToolGroup} toolGroup
-        * @param {Object} config
-        * @ignore
-        */
-       function EditSourceTool( toolGroup, config ) {
-               config = config || {};
-               config.classes = [ 'source-editor' ];
-               EditSourceTool.super.call( this, toolGroup, config );
-       }
-
-       OO.inheritClass( EditSourceTool, OO.ui.Tool );
-
-       EditSourceTool.static.name = 'editSource';
-       EditSourceTool.static.icon = 'edit-source';
-       EditSourceTool.static.group = 'editorSwitcher';
-       EditSourceTool.static.title = mw.msg( 
'mobile-frontend-editor-source-editor' );
-       /**
-        * click handler
-        */
-       EditSourceTool.prototype.onSelect = function () {
                // will be overridden later
        };
 
@@ -323,15 +298,13 @@
                                classes: [ 'editor-switcher' ]
                        } );
                        toolFactory.register( EditVeTool );
-                       toolFactory.register( EditSourceTool );
 
                        toolbar.setup( [
                                {
-                                       icon: 'editor-switcher',
+                                       icon: 'advanced',
+                                       indicator: 'down',
                                        type: 'list',
-                                       include: [ {
-                                               group: 'editorSwitcher'
-                                       } ]
+                                       include: [ { group: 'editorSwitcher' } ]
                                }
                        ] );
 
diff --git a/resources/mobile.editor.common/editor.less 
b/resources/mobile.editor.common/editor.less
index c86c21e..f030e7a 100644
--- a/resources/mobile.editor.common/editor.less
+++ b/resources/mobile.editor.common/editor.less
@@ -32,15 +32,11 @@
                }
        }
 
-       .overlay-header {
-               .oo-ui-icon-editor-switcher {
-                       .background-image( 'images/editToggle.svg' );
-               }
-               .oo-ui-icon-edit-source {
-                       .background-image( 'images/editSourceNormal.svg' );
-               }
-               .oo-ui-icon-edit-ve {
-                       .background-image( 'images/editVeNormal.svg' );
+       .editor-switcher {
+               .oo-ui-toolbar-bar {
+                       border-collapse: separate;
+                       border: 0;
+                       box-shadow: none;
                }
        }
 }
diff --git a/resources/mobile.editor.common/images/editToggle.svg 
b/resources/mobile.editor.common/images/editToggle.svg
deleted file mode 100644
index 5ba65cf..0000000
--- a/resources/mobile.editor.common/images/editToggle.svg
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/";
-   xmlns:cc="http://creativecommons.org/ns#";
-   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-   xmlns:svg="http://www.w3.org/2000/svg";
-   xmlns="http://www.w3.org/2000/svg";
-   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
-   width="24"
-   height="15.571919"
-   viewBox="2.5 791.5 24 15.571919"
-   enable-background="new 2.5 791.5 606.667 606.667"
-   id="svg2"
-   version="1.1"
-   inkscape:version="0.48.5 r10040"
-   sodipodi:docname="editToggle.svg">
-  <metadata
-     id="metadata12">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
-      </cc:Work>
-    </rdf:RDF>
-  </metadata>
-  <defs
-     id="defs10" />
-  <sodipodi:namedview
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="1"
-     objecttolerance="10"
-     gridtolerance="10"
-     guidetolerance="10"
-     inkscape:pageopacity="0"
-     inkscape:pageshadow="2"
-     inkscape:window-width="1280"
-     inkscape:window-height="751"
-     id="namedview8"
-     showgrid="false"
-     inkscape:zoom="12.348235"
-     inkscape:cx="11.892736"
-     inkscape:cy="4.9315231"
-     inkscape:window-x="0"
-     inkscape:window-y="0"
-     inkscape:window-maximized="1"
-     inkscape:current-layer="svg2"
-     fit-margin-top="0"
-     fit-margin-left="0"
-     fit-margin-right="0"
-     fit-margin-bottom="0" />
-  <path
-     d="m 18.071889,800.71332 v -2.85478 l -1.751816,-0.292 c 
-0.129831,-0.47038 -0.324422,-0.92456 -0.551545,-1.33006 l 1.021928,-1.44365 
-2.011362,-2.02761 -1.443686,1.02193 c -0.421675,-0.22712 -0.85968,-0.42175 
-1.330064,-0.55155 L 11.713345,791.5 H 8.8585505 l -0.292006,1.75185 c 
-0.470383,0.12975 -0.924557,0.32442 -1.330064,0.55151 l -1.443641,-1.02189 
-2.027614,2.01136 1.021927,1.44365 c -0.227123,0.42172 -0.421752,0.85968 
-0.551544,1.34631 L 2.5,797.85858 v 2.85481 l 1.7356085,0.29197 c 
0.129753,0.4704 0.324421,0.92458 0.551544,1.34632 l -1.021927,1.44365 
2.011361,2.01138 1.443648,-1.02191 c 0.421753,0.22709 0.859681,0.42174 
1.34631,0.5515 l 0.292006,1.73562 h 2.8547945 l 0.291999,-1.75184 c 
0.470383,-0.12983 0.924558,-0.32441 1.330064,-0.5515 l 1.443686,1.0219 
2.011362,-2.01137 -1.021928,-1.44365 c 0.227123,-0.42167 0.421714,-0.8597 
0.551545,-1.34632 l 1.751816,-0.27582 z m -7.785945,1.55719 c -1.6545235,0 
-2.9845865,-1.34625 -2.9845865,-2.98457 0,-1.65452 1.346278,-2.98459 
2.9845865,-2.98459 1.638316,0 2.984587,1.33007 2.984587,2.98459 0,1.65454 
-1.330024,2.98457 -2.984587,2.98457 z"
-     id="path4"
-     inkscape:connector-curvature="0"
-     style="fill:#555555" />
-  <path
-     d="M 23.980579,801.5446 26.5,797.24471 h -5.039556 z"
-     id="path6"
-     inkscape:connector-curvature="0"
-     style="fill:#414141;fill-rule:evenodd" />
-</svg>
diff --git a/resources/mobile.editor.overlay/EditorOverlay.js 
b/resources/mobile.editor.overlay/EditorOverlay.js
index 60a67d4..9088169 100644
--- a/resources/mobile.editor.overlay/EditorOverlay.js
+++ b/resources/mobile.editor.overlay/EditorOverlay.js
@@ -129,7 +129,6 @@
 
                        if ( this.isVisualEditorEnabled() ) {
                                this.initializeSwitcher();
-                               
this.switcherToolbar.tools.editSource.setActive( true );
                                /**
                                 * 'Edit' button handler
                                 */

-- 
To view, visit https://gerrit.wikimedia.org/r/232475
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I12513a994d434ed2d5d2ce988dc35b0dfd4fe13a
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: Florianschmidtwelzow <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to