From 7cdd083ed6bbc1c37eb8b8badb6abfd4851db2a0 Mon Sep 17 00:00:00 2001
From: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
Date: Sat, 23 Jan 2016 14:21:05 +0000
Subject: [PATCH] Shink printable logo. Fixes #51.

---
 README.md             | 2 +-
 build/index.php       | 3 ++-
 core.php              | 2 +-
 settings.fragment.php | 1 +
 4 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index c713a35..4be53ef 100644
--- a/README.md
+++ b/README.md
@@ -82,7 +82,7 @@ Key				| Value			| Explanation
 `sitename`		| string		| The site's name. Used all over the place. Note that by default the session cookie is prefixed with a variant of the sitename, so changing this will log everyone out!
 `logo_url`		| url			| A url that points to the site's logo. Leave blank to disable. When enabled, the logo will be inserted next to the site name on every page.
 `logo_postition`| left|right	| The side of the site name at which the logo should be placed. Only has an effect if the above is not set to an empty string.
-`updateurl`		| url			| The url from which to fetch updates. Defaults to the master (development) branch. If there is sufficient demand, a separate stable branch will be created. Note that if you use the automatic updater currently it won't save your module choices. **MAKE SURE THAT THIS POINTS TO A *HTTPS* URL, OTHERWISE SOMEONE COULD INJECT A VIRUS INTO YOUR WIKI**
+`updateurl`		| url			| The url from which to fetch updates. Defaults to the master (development) branch. If there is sufficient demand, a separate stable branch will be created. Note that if you use the automatic updater currently it won't save your module choices. **MAKE SURE THAT THIS POINTS TO A *HTTPS* URL, OTHERWISE SOMEONE COULD INJECT A VIRUS INTO YOUR WIKI!**
 `sitesecret`	| string		| The secret key used to perform 'dangerous' actions, like updating the wiki. It is strongly advised that you change this!
 `editing`		| boolean		| Determines whether editing is enabled. Set to false to disable disting for all users (anonymous or otherwise).
 `maxpagesize`	| integer		| The maximum number of characters allowed on a single page. The default is 135,000 characters, which is about 50 pages.
diff --git a/build/index.php b/build/index.php
index b37ae9f..f7d42f8 100644
--- a/build/index.php
+++ b/build/index.php
@@ -313,6 +313,7 @@ input[type=button], input[type=submit] { cursor: pointer; }
 h1 { text-align: center; }
 .sitename { margin-top: 5rem; margin-bottom: 3rem; font-size: 2.5rem; }
 .logo { max-width: 4rem; max-height: 4rem; vertical-align: middle; }
+.logo.small { max-width: 2rem; max-height: 2rem; }
 main:not(.printable) { padding: 2rem; background: #faf8fb; box-shadow: 0 0.1rem 1rem 0.3rem rgba(50, 50, 50, 0.5); }
 
 .search-result { position: relative; }
@@ -1006,7 +1007,7 @@ class page_renderer
 		if(strlen($settings->logo_url) > 0)
 		{
 			// A logo url has been specified
-			$logo_html = "<img class='logo' src='$settings->logo_url' />";
+			$logo_html = "<img class='logo" . (isset($_GET["printable"]) ? " small" : "") . "' src='$settings->logo_url' />";
 			switch($settings->logo_position)
 			{
 				case "left":
diff --git a/core.php b/core.php
index f175de4..9fde643 100644
--- a/core.php
+++ b/core.php
@@ -637,7 +637,7 @@ class page_renderer
 		if(strlen($settings->logo_url) > 0)
 		{
 			// A logo url has been specified
-			$logo_html = "<img class='logo' src='$settings->logo_url' />";
+			$logo_html = "<img class='logo" . (isset($_GET["printable"]) ? " small" : "") . "' src='$settings->logo_url' />";
 			switch($settings->logo_position)
 			{
 				case "left":
diff --git a/settings.fragment.php b/settings.fragment.php
index 46dbd37..59c73d9 100644
--- a/settings.fragment.php
+++ b/settings.fragment.php
@@ -302,6 +302,7 @@ input[type=button], input[type=submit] { cursor: pointer; }
 h1 { text-align: center; }
 .sitename { margin-top: 5rem; margin-bottom: 3rem; font-size: 2.5rem; }
 .logo { max-width: 4rem; max-height: 4rem; vertical-align: middle; }
+.logo.small { max-width: 2rem; max-height: 2rem; }
 main:not(.printable) { padding: 2rem; background: #faf8fb; box-shadow: 0 0.1rem 1rem 0.3rem rgba(50, 50, 50, 0.5); }
 
 .search-result { position: relative; }
