Robert Vogel has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/368350 )

Change subject: BSExtensions: Fixed HideTitle breaking javascript with inline 
script
......................................................................

BSExtensions: Fixed HideTitle breaking javascript with inline script

PatchSet2:
* Completley removed the removal of the dom element .firstHeader, as it
is not really needed

Change-Id: If32f5a28096c90dd7d5e4e16be363a349fd16749
---
M HideTitle/HideTitle.class.php
M HideTitle/extension.json
A HideTitle/resources/bluespice.hideTitle.css
3 files changed, 18 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BlueSpiceExtensions 
refs/changes/50/368350/1

diff --git a/HideTitle/HideTitle.class.php b/HideTitle/HideTitle.class.php
index 823ae3f..7022a0d 100644
--- a/HideTitle/HideTitle.class.php
+++ b/HideTitle/HideTitle.class.php
@@ -25,7 +25,7 @@
  * @author     Markus Glaser <gla...@hallowelt.com>
  * @version    2.23.1
  * @package    BlueSpice_Extensions
- * @subpackage StateBar
+ * @subpackage HideTitle
  * @copyright  Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
  * @license    http://www.gnu.org/copyleft/gpl.html GNU Public License v2 or 
later
  * @filesource
@@ -35,7 +35,7 @@
 
        protected $bHideTitle = false;
 
-        protected function initExt() {
+       protected function initExt() {
                wfProfileIn( 'BS::'.__METHOD__ );
                // Hooks
                $this->setHook( 'BeforePageDisplay' );
@@ -56,7 +56,7 @@
                $sHideTitlePageProp = BsArticleHelper::getInstance( $oTitle 
)->getPageProp( 'bs_hidetitle' );
                if( $sHideTitlePageProp === '' ) {
                        $oOutputPage->mPagetitle = '';
-                       $oOutputPage->addInlineScript( 
"$('.firstHeading').remove()" );
+                       $oOutputPage->addModuleStyles( 
'ext.bluespice.hidetitle.styles' );
                }
 
                return true;
diff --git a/HideTitle/extension.json b/HideTitle/extension.json
index d17c601..62181ef 100644
--- a/HideTitle/extension.json
+++ b/HideTitle/extension.json
@@ -22,5 +22,16 @@
        "AutoloadClasses": {
                "HideTitle": "HideTitle.class.php"
        },
+       "ResourceModules": {
+               "ext.bluespice.hidetitle.styles": {
+                       "styles": "bluespice.hideTitle.css",
+                       "position": "top",
+                       "targets": [ "desktop", "mobile" ]
+               }
+       },
+       "ResourceFileModulePaths": {
+               "localBasePath": "resources",
+               "remoteExtPath": "BlueSpiceExtensions/HideTitle/resources"
+       },
        "manifest_version": 1
 }
diff --git a/HideTitle/resources/bluespice.hideTitle.css 
b/HideTitle/resources/bluespice.hideTitle.css
new file mode 100644
index 0000000..ef6ec38
--- /dev/null
+++ b/HideTitle/resources/bluespice.hideTitle.css
@@ -0,0 +1,4 @@
+
+#content h1.firstHeading {
+       display: none;
+}
\ No newline at end of file

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If32f5a28096c90dd7d5e4e16be363a349fd16749
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/BlueSpiceExtensions
Gerrit-Branch: REL1_27
Gerrit-Owner: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to