diff --git a/extension.json b/extension.json index 721dc6178a..551f59f331 100644 --- a/extension.json +++ b/extension.json @@ -1578,12 +1578,10 @@ "modules/ve-mw/themes/wikimediaui.css" ], "vector": [ - "modules/ve-mw/themes/wikimediaui.css", - "modules/ve-mw/ui/styles/tools/ve.ui.MWTargetWidget-vector.less" + "modules/ve-mw/themes/wikimediaui.css" ], "vector-2022": [ - "modules/ve-mw/themes/wikimediaui.css", - "modules/ve-mw/ui/styles/tools/ve.ui.MWTargetWidget-vector.less" + "modules/ve-mw/themes/wikimediaui.css" ], "monobook": [ "modules/ve-mw/themes/apex.css" diff --git a/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-monobook.less b/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-monobook.less index b2da521b8b..ba890745ed 100644 --- a/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-monobook.less +++ b/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-monobook.less @@ -5,11 +5,6 @@ * @license The MIT License (MIT); see LICENSE.txt */ -/* Global overlay is outside the #globalWrapper so apply the font size fix */ -.ve-ui-overlay-global { - font-size: 1.28em; /* 0.8em / x-small */ -} - /* stylelint-disable-next-line selector-class-pattern */ .mw-body a.external.ve-ce-linkAnnotation.ve-ce-annotation-active { /* Monobook sets a background:url(); rule which overrides the colour. TODO: Fix upstream */ diff --git a/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-vector.less b/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-vector.less index 7b07319b13..5cdae1ba92 100644 --- a/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-vector.less +++ b/modules/ve-mw/init/styles/ve.init.mw.DesktopTarget-vector.less @@ -15,11 +15,6 @@ } } -.ve-ui-overlay-global { - /* Same as main content font-size in Vector */ - font-size: 0.875em; -} - /* Slug animation needs more specific rules and skin-specific target margins */ .mw-body-content p.ve-ce-branchNode-newSlug { margin: -0.3em 0 -0.1em 0; @@ -36,10 +31,3 @@ color: #72777d; } } - -.ve-ui-overlay .mw-body-content { - /* Fix font-size for surfaces inside UI overlays */ - /* Increase specificity to deal with :not selector hack in core's typography.less */ - /* stylelint-disable-next-line declaration-no-important */ - font-size: 1em !important; -} diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js index bc03f9f318..bc395229c3 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.js @@ -352,7 +352,7 @@ ve.init.mw.DesktopArticleTarget.prototype.loadSuccess = function () { $( '#ca-edit' ).removeClass( 'visualeditor-showtabdialog' ); // Set up a temporary window manager var windowManager = new OO.ui.WindowManager(); - $( document.body ).append( windowManager.$element ); + $( OO.ui.getTeleportTarget() ).append( windowManager.$element ); this.editingTabDialog = new mw.libs.ve.EditingTabDialog(); windowManager.addWindows( [ this.editingTabDialog ] ); windowManager.openWindow( this.editingTabDialog ) diff --git a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js index d2cc1c89e0..313a5a3a42 100644 --- a/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js @@ -1490,7 +1490,7 @@ $( '#ca-edit' ).removeClass( 'visualeditor-showtabdialog' ); // Set up a temporary window manager windowManager = new OO.ui.WindowManager(); - $( document.body ).append( windowManager.$element ); + $( OO.ui.getTeleportTarget() ).append( windowManager.$element ); editingTabDialog = new mw.libs.ve.EditingTabDialog(); windowManager.addWindows( [ editingTabDialog ] ); windowManager.openWindow( editingTabDialog ) @@ -1541,7 +1541,7 @@ } windowManager = new OO.ui.WindowManager(); welcomeDialog = new mw.libs.ve.WelcomeDialog(); - $( document.body ).append( windowManager.$element ); + $( OO.ui.getTeleportTarget() ).append( windowManager.$element ); windowManager.addWindows( [ welcomeDialog ] ); windowManager.openWindow( welcomeDialog, diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWConfirmationDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWConfirmationDialog.js index c6477c10e0..6921f2e662 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWConfirmationDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWConfirmationDialog.js @@ -41,7 +41,7 @@ ve.ui.MWConfirmationDialog.static.size = 'small'; */ ve.ui.MWConfirmationDialog.static.confirm = function ( prompt, successCmd ) { var windowManager = new OO.ui.WindowManager(); - $( document.body ).append( windowManager.$element ); + $( OO.ui.getTeleportTarget() ).append( windowManager.$element ); var dialog = new ve.ui.MWConfirmationDialog(); windowManager.addWindows( [ dialog ] ); windowManager.openWindow( dialog, { diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js index 5d2f2bc90d..a5005e7938 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js @@ -137,8 +137,6 @@ ve.ui.MWSaveDialog.prototype.setDiffAndReview = function ( wikitextDiffPromise, diffElement.$document.addClass( [ 'mw-body-content', 'mw-parser-output', - // HACK: T287733 - mw.config.get( 'skin' ) === 'vector' || mw.config.get( 'skin' ) === 'vector-2022' ? 'vector-body' : null, 'mw-content-' + visualDiff.newDoc.getDir() ] ); ve.targetLinksToNewWindow( diffElement.$document[ 0 ] ); @@ -645,9 +643,7 @@ ve.ui.MWSaveDialog.prototype.initialize = function () { this.$previewHeading = $( '

' ).addClass( 'firstHeading' ); this.$previewViewer = $( '
' ).addClass( [ 'mw-body-content', - 'mw-parser-output', - // HACK: T287733 - mw.config.get( 'skin' ) === 'vector' || mw.config.get( 'skin' ) === 'vector-2022' ? 'vector-body' : null + 'mw-parser-output' ] ); this.previewPanel.$element // Make focusable for keyboard accessible scrolling diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js index f84791b8ac..298ec44940 100644 --- a/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js +++ b/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js @@ -37,7 +37,7 @@ ve.ui.MWTemplateDialog = function VeUiMWTemplateDialog( config ) { this.preventReselection = false; this.confirmDialogs = new ve.ui.WindowManager( { factory: ve.ui.windowFactory, isolate: true } ); - $( document.body ).append( this.confirmDialogs.$element ); + $( OO.ui.getTeleportTarget() ).append( this.confirmDialogs.$element ); }; /* Inheritance */ diff --git a/modules/ve-mw/ui/elements/ve.ui.MWFloatingHelpElement.js b/modules/ve-mw/ui/elements/ve.ui.MWFloatingHelpElement.js index 3093ec1d4b..f285a65c2a 100644 --- a/modules/ve-mw/ui/elements/ve.ui.MWFloatingHelpElement.js +++ b/modules/ve-mw/ui/elements/ve.ui.MWFloatingHelpElement.js @@ -39,7 +39,7 @@ ve.ui.MWFloatingHelpElement = function VeUiMWFloatingHelpElement( config ) { this.windowManager.$element.addClass( 've-ui-mwFloatingHelpElement-windowManager' ); if ( OO.ui.isMobile() ) { - $( document.body ).append( this.windowManager.$element ); + $( OO.ui.getTeleportTarget() ).append( this.windowManager.$element ); } else { this.$element.append( this.windowManager.$element ); } diff --git a/modules/ve-mw/ui/pages/ve.ui.MWTemplatesUsedPage.js b/modules/ve-mw/ui/pages/ve.ui.MWTemplatesUsedPage.js index 59b477ca30..42124f2995 100644 --- a/modules/ve-mw/ui/pages/ve.ui.MWTemplatesUsedPage.js +++ b/modules/ve-mw/ui/pages/ve.ui.MWTemplatesUsedPage.js @@ -30,9 +30,7 @@ ve.ui.MWTemplatesUsedPage = function VeUiMWTemplatesUsedPage() { } ); this.templatesUsedFieldset.$group.addClass( [ - 'mw-body-content', - // HACK: T287733 - mw.config.get( 'skin' ) === 'vector' || mw.config.get( 'skin' ) === 'vector-2022' ? 'vector-body' : null + 'mw-body-content' ] ); target.getContentApi().get( { diff --git a/modules/ve-mw/ui/styles/tools/ve.ui.MWTargetWidget-vector.less b/modules/ve-mw/ui/styles/tools/ve.ui.MWTargetWidget-vector.less deleted file mode 100644 index 24c4645e90..0000000000 --- a/modules/ve-mw/ui/styles/tools/ve.ui.MWTargetWidget-vector.less +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * VisualEditor MediaWiki Vector-specific MWTargetWidget styles. - * - * @copyright 2011-2022 VisualEditor Team and others; see AUTHORS.txt - * @license The MIT License (MIT); see LICENSE.txt - */ - -/* stylelint-disable-next-line selector-class-pattern */ -.ve-ui-mwTargetWidget .ve-ui-surface.vector-body { - // Suppress the stacking context usually established by .vector-body (T314230). - // We wouldn't need to do this if the context menus and inspectors were appended to an overlay (T266521). - z-index: auto; -} - -.ve-ui-mwTargetWidget > .ve-init-target > .mw-body-content { - // Remove top margin used by Vector 2022 in main content - margin-top: 0; -} diff --git a/modules/ve-mw/ui/widgets/ve.ui.MWTargetWidget.js b/modules/ve-mw/ui/widgets/ve.ui.MWTargetWidget.js index 164100560e..c03a1cca14 100644 --- a/modules/ve-mw/ui/widgets/ve.ui.MWTargetWidget.js +++ b/modules/ve-mw/ui/widgets/ve.ui.MWTargetWidget.js @@ -19,13 +19,6 @@ ve.ui.MWTargetWidget = function VeUiMWTargetWidget( config ) { this.surfaceClasses = ve.copy( config.surfaceClasses ) || []; - // HACK: T287733 - // This assumes the target widget is being shown outside of vector-body, otherwise this - // will apply the class a second time and cause problems. - if ( mw.config.get( 'skin' ) === 'vector' || mw.config.get( 'skin' ) === 'vector-2022' ) { - this.surfaceClasses.push( 'vector-body' ); - } - // Parent constructor ve.ui.MWTargetWidget.super.apply( this, arguments );