Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Add google analytics to the header, optionally add another CSS file i…
Browse files Browse the repository at this point in the history
…f defined in the config file. Minor css updates.
  • Loading branch information
aaronpk committed Sep 26, 2011
1 parent 72358dc commit 29875b5
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 2 deletions.
25 changes: 24 additions & 1 deletion Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class BootstrapTemplate extends QuickTemplate {
* @access private
*/
function execute() {
global $wgUser, $wgSitename, $wgCopyrightLink, $wgCopyright, $wgBootstrap, $wgArticlePath;
global $wgUser, $wgSitename, $wgCopyrightLink, $wgCopyright, $wgBootstrap, $wgArticlePath, $wgGoogleAnalyticsID, $wgSiteCSS;

$this->skin = $this->data['skin'];

Expand All @@ -67,7 +67,30 @@ function execute() {
<script type="text/javascript" src="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/js/bootstrap-tabs.js"></script>
<script type="text/javascript" src="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/js/bootstrap-dropdown.js"></script>
<script type="text/javascript" src="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/site.js"></script>
<?php if(isset($wgSiteCSS)) { ?>
<link rel="stylesheet" type="text/css" href="<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/<?php echo $wgSiteCSS ?>" />
<?php } ?>
<?php $this->html('headlinks') ?>
<?php

if(isset($wgGoogleAnalyticsID)) { ?>

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo $wgGoogleAnalyticsID; ?>']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();

</script>
<?php
}
?>
</head>
<body class="<?=Sanitizer::escapeClass('page-' . $this->data['title'])?>">

Expand Down
91 changes: 90 additions & 1 deletion bootstrap/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ b {
font-weight: bold;
}

.topbar {
font-size: 13px;
}

.home h2 {
border-bottom: 3px #bbb solid;
Expand All @@ -57,7 +60,6 @@ h2 {
line-height: 1.3em;
}
h3 {
font-size: 15px;
margin-bottom: 6px;
}
h3, h4, h5, h6 {
Expand All @@ -66,6 +68,14 @@ h3, h4, h5, h6 {
}


body, p {
font-size: 16px;
}

body, p, li {
line-height: 24px;
}

#search .mw-search-formheader, .searchresults .mw-search-createlink {
display: none;
}
Expand All @@ -75,6 +85,9 @@ h3, h4, h5, h6 {
footer {
border-top: 1px solid #aaa;
}
footer p {
font-size: 12px;
}

.tocnumber {
display: none;
Expand All @@ -90,6 +103,26 @@ footer {
}


/**
Styles for image alignment
**/
.center {
text-align: center;
}
.floatright {
float: right;
margin: 0 .5em .5em 0;
}
.floatleft {
float: left;
margin: 0 .5em .5em 0;
}
.thumbcaption {
font-size: 0.9em;
}



/**
Styles for editing page form
**/
Expand Down Expand Up @@ -134,6 +167,62 @@ footer {
}


/**
MediaWiki table of contents
**/
table#toc {
width: auto;
}

#toc, .toc, .mw-warning {
font-size: 100%;
border: 1px solid #AAAAAA;
background-color: #F5F5F5;
padding: .5em;
margin-bottom: 1.2em;
}

.toc {
float: right;
margin-left: 20px;
}

#toc h2, .toc h2 {
font-size: 110%;
border: none;
margin: 0; /* fix toc top margin */
padding-right: .2em; /* margin between title and hide/show link */
display: inline; /* display the hide/show link after Contents */
}

#toc #toctitle,
.toc #toctitle,
#toc .toctitle,
.toc .toctitle {
text-align: left; /* left adjust of title */
}

#toc ul, .toc ul {
list-style-type: none;
list-style-image: none;
margin: 0;
padding: .3em 0 0 .7em; /* margin of the item list */
text-align: left;
}
#toc ul ul, .toc ul ul,
#toc ul ul ul, .toc ul ul ul {
margin: 0 0 0 .7em; /* toclevel-2 margin */
}

#toc .tocindent { margin-left: 1em; }
#toc .tocline { margin-bottom: 0; }
#toc p { margin: 0 }
#toc .toctoggle { font-size: 90%; }

#toc .editsection {
margin-top: .3em;
font-size: 90%;
}



Expand Down

0 comments on commit 29875b5

Please sign in to comment.