Henning Snater has uploaded a new change for review.

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


Change subject: Table of contents style adjustments
......................................................................

Table of contents style adjustments

(bug 44876)
Adjusting the css for the table of contents to the need and general styles of 
Wikibase.

Change-Id: Iad92ebd390837181eb323115066d71a9017435d2
---
M lib/resources/templates.php
M lib/resources/wikibase.css
M repo/includes/EntityView.php
M repo/resources/Resources.php
A repo/resources/themes/default/wikibase.toc.css
5 files changed, 52 insertions(+), 17 deletions(-)


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

diff --git a/lib/resources/templates.php b/lib/resources/templates.php
index f96e5df..5fdc123 100644
--- a/lib/resources/templates.php
+++ b/lib/resources/templates.php
@@ -54,7 +54,6 @@
 <<<HTML
 <li class="toclevel-1 tocsection-$1">
        <a href="#$2">
-               <span class="tocnumber">$1</span>
                <span class="toctext">$3</span>
        </a>
 </li>
diff --git a/lib/resources/wikibase.css b/lib/resources/wikibase.css
index b37a6e9..95fd6b2 100644
--- a/lib/resources/wikibase.css
+++ b/lib/resources/wikibase.css
@@ -156,11 +156,6 @@
        width: auto;
 }
 
-.wb-toc {
-       margin-top: 1.8em;
-       float: left;
-}
-
 /********** /BASIC LAYOUT **********/
 
 
diff --git a/repo/includes/EntityView.php b/repo/includes/EntityView.php
index 3df2b44..91ae138 100644
--- a/repo/includes/EntityView.php
+++ b/repo/includes/EntityView.php
@@ -204,16 +204,11 @@
 
                $languageTerms = $this->getHtmlForLanguageTerms( 
$entityRevision->getEntity(), $lang, $editable );
 
-               $tocHtml = '';
-               if ( defined( 'WB_EXPERIMENTAL_FEATURES' ) && 
WB_EXPERIMENTAL_FEATURES ) {
-                       $tocHtml = $this->getHtmlForToc( $lang );
-               }
-
                $html = wfTemplate( 'wb-entity-content',
                        $this->getHtmlForLabel( $entityRevision->getEntity(), 
$lang, $editable ),
                        $this->getHtmlForDescription( 
$entityRevision->getEntity(), $lang, $editable ),
                        $this->getHtmlForAliases( $entityRevision->getEntity(), 
$lang, $editable ),
-                       $tocHtml,
+                       $this->getHtmlForToc( $lang ),
                        $languageTerms,
                        $claims
                );
@@ -333,6 +328,7 @@
                // make css available for JavaScript-less browsers
                $pout->addModuleStyles( array(
                        'wikibase.common',
+                       'wikibase.toc',
                        'jquery.ui.core',
                        'jquery.wikibase.statementview',
                        'jquery.wikibase.toolbar',
diff --git a/repo/resources/Resources.php b/repo/resources/Resources.php
index 79531c8..b4f6e6c 100644
--- a/repo/resources/Resources.php
+++ b/repo/resources/Resources.php
@@ -1,15 +1,12 @@
 <?php
 /**
- * File for Wikibase resourceloader modules.
- * When included this returns an array with all the modules introduced by 
Wikibase.
+ * Wikibase Repo ResourceLoader modules
  *
  * @since 0.1
  *
- * @file
- * @ingroup WikibaseRepo
- *
  * @licence GNU GPL v2+
  * @author Daniel Werner
+ * @author H. Snater < mediaw...@snater.com >
  *
  * @codeCoverageIgnoreStart
  */
@@ -106,6 +103,12 @@
                                'jquery.ui.suggester'
                        )
                ),
+
+               'wikibase.toc' => $moduleTemplate + array(
+                       'styles' => array(
+                               'themes/default/wikibase.toc.css',
+                       ),
+               ),
        );
 
        if ( defined( 'ULS_VERSION' ) ) {
diff --git a/repo/resources/themes/default/wikibase.toc.css 
b/repo/resources/themes/default/wikibase.toc.css
new file mode 100644
index 0000000..b81f8a2
--- /dev/null
+++ b/repo/resources/themes/default/wikibase.toc.css
@@ -0,0 +1,42 @@
+/**
+ * CSS for table of contents.
+ *
+ * @licence GNU GPL v2+
+ * @author H. Snater < mediaw...@snater.com >
+ */
+
+.wb-entity #toc {
+       background-color: #f8f8f8;
+       border-collapse: collapse;
+       border-color: #c9c9c9;
+       float: left;
+       margin-top: 1.8em;
+       width: 100%;
+}
+
+.wb-entity #toc #toctitle {
+       display: none;
+}
+
+.wb-entity #toc ul {
+       clear: both;
+       color: #c9c9c9;
+       float: left;
+       margin: 0;
+       padding: 0.4em 10px;
+}
+
+.wb-entity #toc li {
+       float: left;
+       margin-bottom: 0;
+       white-space: nowrap;
+}
+
+.wb-entity #toc li:after {
+       content: '\020|';
+       padding: 0 0.25em 0 0;
+}
+
+.wb-entity #toc li:last-child:after {
+       content: '';
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad92ebd390837181eb323115066d71a9017435d2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Henning Snater <henning.sna...@wikimedia.de>

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

Reply via email to