Kaldari has uploaded a new change for review. https://gerrit.wikimedia.org/r/132124
Change subject: Only create editor switcher from wikitext editor if VE is usable ...................................................................... Only create editor switcher from wikitext editor if VE is usable Prevents creation of the editor switcher from the wikitext editor if: * VE is diabled for current namespace * Page is output of Page Translation feature * Page doesn't use wikitext content model Also improving comment about save warning. Bug: 64681 Change-Id: Ib39e76d0e59328c18b1937157d0c9d11efa16eda --- M javascripts/modules/editor/EditorOverlay.js 1 file changed, 8 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/24/132124/1 diff --git a/javascripts/modules/editor/EditorOverlay.js b/javascripts/modules/editor/EditorOverlay.js index 771e678..6ffb1a8 100644 --- a/javascripts/modules/editor/EditorOverlay.js +++ b/javascripts/modules/editor/EditorOverlay.js @@ -4,8 +4,12 @@ schema = M.require( 'loggingSchemas/mobileWebEditing' ), MobileWebClickTracking = M.require( 'loggingSchemas/MobileWebClickTracking' ), inBetaOrAlpha = M.isBetaGroupMember(), - isVisualEditorEnabled = M.isWideScreen() && M.isAlphaGroupMember() && - mw.config.get( 'wgVisualEditorConfig' ), + isVisualEditorEnabled = M.isWideScreen() && + M.isAlphaGroupMember() && + mw.config.get( 'wgVisualEditorConfig' ) && + mw.config.get( 'wgVisualEditorConfig' ).namespaces.indexOf( mw.config.get( 'wgNamespaceNumber' ) ) > -1 && + mw.config.get( 'wgTranslatePageTranslation' ) !== 'translation' && + mw.config.get( 'wgPageContentModel' ) === 'wikitext', inKeepGoingCampaign = M.query.campaign === 'mobile-keepgoing', inNavSignupCampaign = M.query.campaign === 'leftNavSignup', Section = M.require( 'Section' ), @@ -75,9 +79,10 @@ // make license links open in separate tabs this.$( '.license a' ).attr( 'target', '_blank' ); + // If the user tries to switch to the VisualEditor, check if any changes have + // been made, and if so, tell the user they have to save first. if ( isVisualEditorEnabled ) { this.$( '.visual-editor' ).on( 'click', function() { - // If changes have been made tell the user they have to save first if ( !self.api.hasChanged ) { MobileWebClickTracking.log( 'editor-switch-to-visual', options.title ); self._switchToVisualEditor( options ); -- To view, visit https://gerrit.wikimedia.org/r/132124 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib39e76d0e59328c18b1937157d0c9d11efa16eda Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Kaldari <rkald...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits