From 8eee12bd6b44ded244aa7e72e5bcf5f5d2552fba Mon Sep 17 00:00:00 2001
From: Isabeau Kisler <ikisler@csumb.edu>
Date: Sun, 2 Jul 2017 13:14:50 -0700
Subject: [PATCH] Add page preview functionality -- more tweaks Change order of
 save and preview buttons, tweak HTML and styling for preview message.

---
 build/index.php       | 5 +++--
 modules/page-edit.php | 2 +-
 theme_default.css     | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/build/index.php b/build/index.php
index a37e4fa..d03740e 100644
--- a/build/index.php
+++ b/build/index.php
@@ -260,7 +260,7 @@ figcaption { text-align: center; }
 
 .printable { padding: 2rem; }
 
-h1, h4 { text-align: center; }
+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; }
@@ -289,6 +289,7 @@ textarea, textarea[name=content] + pre, textarea ~ input[type=submit], #search-b
 textarea ~ input[type=submit] { margin: 0.5rem 0; padding: 0.5rem; font-weight: bolder; }
 .editform input[type=text] { width: calc(100% - 0.3rem); box-sizing: border-box; }
 input.edit-page-button[type='submit'] { width: 49.5%; box-sizing: border-box; }
+.preview-message { text-align: center; }
 .jump-to-comments { position: relative; top: -2.5em; display: block; text-align: right; pointer-events: none; }
 .jump-to-comments > a { pointer-events: all; }
 
@@ -5245,8 +5246,8 @@ register_module([
 					<pre class='fit-text-mirror'></pre>
 					<input type='text' name='tags' value='$page_tags' placeholder='Enter some tags for the page here. Separate them with commas.' title='Enter some tags for the page here. Separate them with commas.' tabindex='2' />
 					<p class='editing-message'>$settings->editing_message</p>
-					<input name='submit-edit' class='edit-page-button' type='submit' value='Save Page' tabindex='3' />
 					<input name='preview-edit' class='edit-page-button' type='submit' value='Preview Changes' tabindex='4' />
+					<input name='submit-edit' class='edit-page-button' type='submit' value='Save Page' tabindex='3' />
 					</form>";
 			// Allow tab characters in the page editor
 			page_renderer::AddJSSnippet("window.addEventListener('load', function(event) {
diff --git a/modules/page-edit.php b/modules/page-edit.php
index 4a358c1..64be01f 100755
--- a/modules/page-edit.php
+++ b/modules/page-edit.php
@@ -177,8 +177,8 @@ register_module([
 					<pre class='fit-text-mirror'></pre>
 					<input type='text' name='tags' value='$page_tags' placeholder='Enter some tags for the page here. Separate them with commas.' title='Enter some tags for the page here. Separate them with commas.' tabindex='2' />
 					<p class='editing-message'>$settings->editing_message</p>
-					<input name='submit-edit' class='edit-page-button' type='submit' value='Save Page' tabindex='3' />
 					<input name='preview-edit' class='edit-page-button' type='submit' value='Preview Changes' tabindex='4' />
+					<input name='submit-edit' class='edit-page-button' type='submit' value='Save Page' tabindex='3' />
 					</form>";
 			// Allow tab characters in the page editor
 			page_renderer::AddJSSnippet("window.addEventListener('load', function(event) {
diff --git a/theme_default.css b/theme_default.css
index 69d12da..68d21aa 100644
--- a/theme_default.css
+++ b/theme_default.css
@@ -45,7 +45,7 @@ figcaption { text-align: center; }
 
 .printable { padding: 2rem; }
 
-h1, h4 { text-align: center; }
+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; }
@@ -74,6 +74,7 @@ textarea, textarea[name=content] + pre, textarea ~ input[type=submit], #search-b
 textarea ~ input[type=submit] { margin: 0.5rem 0; padding: 0.5rem; font-weight: bolder; }
 .editform input[type=text] { width: calc(100% - 0.3rem); box-sizing: border-box; }
 input.edit-page-button[type='submit'] { width: 49.5%; box-sizing: border-box; }
+.preview-message { text-align: center; }
 .jump-to-comments { position: relative; top: -2.5em; display: block; text-align: right; pointer-events: none; }
 .jump-to-comments > a { pointer-events: all; }
 
