2
0
Эх сурвалжийг харах

reworking the namespace and pagetitles

Garrick van Buren 12 жил өмнө
parent
commit
8d85033191

+ 1 - 1
Foreground.skin.php

@@ -126,7 +126,7 @@ class foregroundTemplate extends BaseTemplate {
 							<?php wfRunHooks( SkinTemplateToolboxEnd, array( &$this, true ) );  ?>
 						</ul>
 					<?php endif; ?>
-					<h4 class="namespace"><?php print $this->getSkin()->getTitle()->getNsText(); ?></h4>
+					<h4 class="namespace label"><?php print $this->getSkin()->getTitle()->getNsText(); ?></h4>
 					<h2 class="title"><?php $this->html('title') ?></h2>
 					<?php if ( $this->data['isarticle'] ) { ?><h3 id="siteSub"><?php $this->msg( 'tagline' ) ?></h3><?php } ?>
 					<h5 class="subtitle"><?php $this->html('subtitle') ?></h5>

+ 6 - 3
assets/scripts/foreground.js

@@ -24,9 +24,12 @@ jQuery(document).ready(function() {
 
 
 
-  // If We're not in ns-0, split the namespace title into a title and a label
-  //var $title = jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").text().split(":");
-  //jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").html('<small class="label">' + $title[0] + '</small><span>' + $title[1] + '</span>');
+  // Remove Namespaces from Pages Titles
+  if ( jQuery("h4.namespace").length) {
+    var $namespace = jQuery("h4.namespace").text() + ":";
+    jQuery('h2.title').text( jQuery('h2.title').text().replace($namespace,'') );
+  }
+
 
   // Turn categories into labels
   jQuery('#mw-normal-catlinks ul li a').addClass('label');

+ 1 - 1
assets/stylesheets/foreground.css

@@ -36,7 +36,7 @@ small {
   font-size: 80%;
 }
 
-h2 small.label {
+h4.namespace.label {
   font-size: small;
   display:inline-block;
 }