Phedenskog has uploaded a new change for review.

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

Change subject: Hide Performance Inspector link if Javascript is turned off
......................................................................

Hide Performance Inspector link if Javascript is turned off

Bug: T143994
Bug: T143770
Change-Id: I20f64fd7e33a2457cea791bb0b22768084b952b9
---
M PerformanceInspector.hooks.php
M extension.json
A modules/css/ext.PerformanceInspector.noscript.css
3 files changed, 6 insertions(+), 0 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/PerformanceInspector 
refs/changes/20/306920/1

diff --git a/PerformanceInspector.hooks.php b/PerformanceInspector.hooks.php
index ee3990a..0ccb588 100644
--- a/PerformanceInspector.hooks.php
+++ b/PerformanceInspector.hooks.php
@@ -13,6 +13,7 @@
                $isEdit = ( $action === 'edit' );
                $title = $out->getTitle();
                if ( $title->inNamespace( NS_MAIN ) /*&& $isEdit*/ ) {
+                       $out->addModuleStyles( [ 
'ext.PerformanceInspector.noscript' ] );
                        $out->addModules( array( 
'ext.PerformanceInspector.startup' ) );
                }
                return true;
diff --git a/extension.json b/extension.json
index f394ff3..39a914f 100644
--- a/extension.json
+++ b/extension.json
@@ -19,6 +19,10 @@
                        "scripts": "ext.PerformanceInspector.startup.js",
                        "messages": "performanceinspector-portlet-link"
                },
+               "ext.PerformanceInspector.noscript": {
+                       "position": "top",
+                       "styles": "css/ext.PerformanceInspector.noscript.css"
+               },
                "ext.PerformanceInspector.analyze": {
                        "scripts": [
                                "ext.PerformanceInspector.setup.js",
diff --git a/modules/css/ext.PerformanceInspector.noscript.css 
b/modules/css/ext.PerformanceInspector.noscript.css
new file mode 100644
index 0000000..ad08fda
--- /dev/null
+++ b/modules/css/ext.PerformanceInspector.noscript.css
@@ -0,0 +1 @@
+.client-nojs #t-performanceinspector { display: none; }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I20f64fd7e33a2457cea791bb0b22768084b952b9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/PerformanceInspector
Gerrit-Branch: master
Gerrit-Owner: Phedenskog <[email protected]>

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

Reply via email to