jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/328391 )
Change subject: Load main CSS quicker
......................................................................
Load main CSS quicker
Most of the CSS now loaded with addModuleStyles() that will include it
earlier in the code and load it quicker to avoid flickering of the
layout.
The CSS for the check icons are loaded with the rest of the scripts to
compute the mixins. The 'preview' icons are also loaded a bit later and
might still flicker a bit.
Change-Id: I09485646351860054a490e4b29c916d5e70729d6
---
M extension.json
R modules/ext.ElectronPdfService.special.css
A modules/ext.ElectronPdfService.special.images.less
M specials/SpecialElectronPdf.php
4 files changed, 28 insertions(+), 17 deletions(-)
Approvals:
Tobias Gritschacher: Looks good to me, approved
jenkins-bot: Verified
diff --git a/extension.json b/extension.json
index 8a98267..ca249fb 100644
--- a/extension.json
+++ b/extension.json
@@ -35,12 +35,17 @@
"modules/ext.ElectronPdfService.special.js"
],
"styles": [
- "modules/ext.ElectronPdfService.special.less"
+
"modules/ext.ElectronPdfService.special.images.less"
],
"dependencies": [
"ext.ElectronPdfService.special.selectionImages"
]
},
+ "ext.ElectronPdfService.special.styles": {
+ "styles": [
+ "modules/ext.ElectronPdfService.special.css"
+ ]
+ },
"ext.ElectronPdfService.special.selectionImages": {
"class": "ResourceLoaderImageModule",
"selector": ".mw-electronPdfService-selection-{name}",
diff --git a/modules/ext.ElectronPdfService.special.less
b/modules/ext.ElectronPdfService.special.css
similarity index 84%
rename from modules/ext.ElectronPdfService.special.less
rename to modules/ext.ElectronPdfService.special.css
index fcc5f7f..c2f6173 100644
--- a/modules/ext.ElectronPdfService.special.less
+++ b/modules/ext.ElectronPdfService.special.css
@@ -1,5 +1,3 @@
-@import 'mediawiki.mixins';
-
.mw-electronPdfService-selection-header {
font-weight: bold;
font-size: 15px;
@@ -55,17 +53,6 @@
margin-bottom: 5px;
}
-/* normally there is no OOUI check icon for the radio box */
-.mw-electronPdfService-selection-form .oo-ui-radioInputWidget
[type="radio"]:checked + span {
- /* Hardcoded this to avoid adding a class with JS. images taken from:
-
https://doc.wikimedia.org/oojs-ui/master/demos/dist/themes/mediawiki/images/icons/
*/
- .background-image-svg( '../resources/icons/check-invert.svg',
'../resources/icons/check-invert.png' );
- background-size: 150%;
- background-position: center;
- background-color: #36c;
- border-color: #36c;
-}
-
label.mw-electronPdfService-selection-form-selected {
background-color: #eaf3ff;
border: 1px solid #36c;
@@ -76,3 +63,11 @@
margin-top: 15px;
text-align: right;
}
+
+/* normally there is no OOUI check icon for the radio box */
+.mw-electronPdfService-selection-form .oo-ui-radioInputWidget
[type="radio"]:checked + span {
+ background-size: 150%;
+ background-position: center;
+ background-color: #36c;
+ border-color: #36c;
+}
\ No newline at end of file
diff --git a/modules/ext.ElectronPdfService.special.images.less
b/modules/ext.ElectronPdfService.special.images.less
new file mode 100644
index 0000000..86d23a5
--- /dev/null
+++ b/modules/ext.ElectronPdfService.special.images.less
@@ -0,0 +1,8 @@
+@import 'mediawiki.mixins';
+
+/* normally there is no OOUI check icon for the radio box */
+.mw-electronPdfService-selection-form .oo-ui-radioInputWidget
[type="radio"]:checked + span {
+ /* Hardcoded this to avoid adding a class with JS. images taken from:
+
https://doc.wikimedia.org/oojs-ui/master/demos/dist/themes/mediawiki/images/icons/
*/
+ .background-image-svg( '../resources/icons/check-invert.svg',
'../resources/icons/check-invert.png' );
+}
diff --git a/specials/SpecialElectronPdf.php b/specials/SpecialElectronPdf.php
index 4c394e9..af37df0 100644
--- a/specials/SpecialElectronPdf.php
+++ b/specials/SpecialElectronPdf.php
@@ -159,10 +159,13 @@
protected function addModules() {
$out = $this->getOutput();
$rl = $out->getResourceLoader();
- $specialModuleName = 'ext.ElectronPdfService.special';
- if ( $rl->isModuleRegistered( $specialModuleName ) ) {
- $out->addModules( $specialModuleName );
+ if (
+ $rl->isModuleRegistered(
'ext.ElectronPdfService.special.styles' )
+ && $rl->isModuleRegistered(
'ext.ElectronPdfService.special' )
+ ) {
+ $out->addModuleStyles(
'ext.ElectronPdfService.special.styles' );
+ $out->addModules( 'ext.ElectronPdfService.special' );
}
}
--
To view, visit https://gerrit.wikimedia.org/r/328391
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I09485646351860054a490e4b29c916d5e70729d6
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/ElectronPdfService
Gerrit-Branch: master
Gerrit-Owner: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: Addshore <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
Gerrit-Reviewer: Tobias Gritschacher <[email protected]>
Gerrit-Reviewer: WMDE-Fisch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits