Catrope has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394405 )

Change subject: Respect "Always use VE" and "Always use source editor" 
preferences
......................................................................

Respect "Always use VE" and "Always use source editor" preferences

If the user has their editor preference set to always use one editor or
the other, start with that one. If it's set to "remember last editor",
use the editor they used most recently *in Flow* (tracked separately
from VE's own tracking for this).

If the user's preference is "show me both tabs", there's no good way to
do that in Flow, so we treat that the same as "remember last editor".

Bug: T178719
Change-Id: Ief5d9873502dd487d4c50534b7448afa70e60ce4
---
M modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
1 file changed, 9 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/05/394405/1

diff --git a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js 
b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
index 74d8b35..3263607 100644
--- a/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
+++ b/modules/flow/ui/widgets/editor/mw.flow.ui.EditorWidget.js
@@ -397,6 +397,15 @@
         * @return {string} 'html' or 'wikitext'
         */
        mw.flow.ui.EditorWidget.prototype.getPreferredFormat = function () {
+               // If the user has their editor preference set to "always VE" 
or "always source", respect that
+               var vePref = mw.user.options.get( 'visualeditor-tabs' );
+               if ( vePref === 'prefer-wt' ) {
+                       return 'wikitext';
+               }
+               if ( vePref === 'prefer-ve' ) {
+                       return 'html';
+               }
+               // Otherwise, use the last-used editor
                return mw.user.options.get( 'flow-editor' ) === 'visualeditor' 
? 'html' : 'wikitext';
        };
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief5d9873502dd487d4c50534b7448afa70e60ce4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>

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

Reply via email to