Glaisher has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248352

Change subject: Split ext.newsletter module into a separate CSS module and a JS 
module
......................................................................

Split ext.newsletter module into a separate CSS module and a JS module

The CSS which colors the subscribe/unsubscribe link is not loaded when
JavaScript is disabled but we should colorize them even when JavaScript is
disabled so split these into two modules. This also allows us to load the
JavaSript module at the bottom.

Change-Id: I2a024ec91eed474c87dc0181294c621b54b464a4
---
M extension.json
M includes/specials/SpecialNewsletters.php
2 files changed, 7 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Newsletter 
refs/changes/52/248352/1

diff --git a/extension.json b/extension.json
index b534111..fe8722d 100644
--- a/extension.json
+++ b/extension.json
@@ -54,8 +54,7 @@
        "ResourceModules": {
                "ext.newsletter": {
                        "scripts": "ext.newsletter.js",
-                       "styles": "ext.newsletter.css",
-                       "position": "top",
+                       "position": "bottom",
                        "dependencies": [
                                "mediawiki.api"
                        ],
@@ -68,6 +67,10 @@
                                "newsletter-unsubscribe-success"
                        ]
                },
+               "ext.newsletter.styles": {
+                       "position": "top",
+                       "styles": "ext.newsletter.css"
+               },
                "ext.newslettermanage": {
                        "scripts": "ext.newslettermanage.js",
                        "dependencies": [
diff --git a/includes/specials/SpecialNewsletters.php 
b/includes/specials/SpecialNewsletters.php
index 17ead7c..4743f0d 100644
--- a/includes/specials/SpecialNewsletters.php
+++ b/includes/specials/SpecialNewsletters.php
@@ -18,7 +18,8 @@
 
                $out = $this->getOutput();
                if ( $this->getUser()->isLoggedIn() ) {
-                       // IPs cannot subscribe and this module is only used 
for subscription functionality.
+                       // IPs cannot subscribe and these modules are only used 
for subscription functionality.
+                       $out->addModuleStyles( 'ext.newsletter.styles' );
                        $out->addModules( 'ext.newsletter' );
                }
                $out->setSubtitle( LinksGenerator::getSubtitleLinks() );

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2a024ec91eed474c87dc0181294c621b54b464a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Newsletter
Gerrit-Branch: master
Gerrit-Owner: Glaisher <[email protected]>

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

Reply via email to