Browse Source

Descriptive "Post Failure" pages; countdown to redirect

The Javascript is just cosmetic ^-<
yumi 8 months ago
parent
commit
7a21a0053c

+ 8
- 2
template/PostFailure.php View File

@@ -6,8 +6,14 @@
6 6
 </head>
7 7
 <body>
8 8
 <div id=message>
9
-	<h1>Post Failure</h1>
10
-	<span>Page redirects in a few seconds...</span>
9
+	<h1>Post Failure</h1><?php
10
+	if ($reason) print <<<REASON
11
+	<em>$reason</em><br />
12
+
13
+REASON;
14
+?>	<span>Page redirects <a href="<?php print $page?>">here</a>
15
+	in <span id=countdown><?php print $until?></span>...</span>
11 16
 </div>
17
+<script src="<?php print CONFIG_WEBROOT; ?>js/countdown.js"></script>
12 18
 </body>
13 19
 </HTML>

+ 3
- 1
template/PostSuccess.php View File

@@ -7,7 +7,9 @@
7 7
 <body>
8 8
 <div id=message>
9 9
 	<h1>Post Success!</h1>
10
-	<span>Page redirects in a few seconds...</span>
10
+	<span>Page redirects <a href="<?php print $page?>">here</a>
11
+	in <span id=countdown><?php print $until?></span>...</span>
11 12
 </div>
13
+<script src="<?php print CONFIG_WEBROOT; ?>js/countdown.js"></script>
12 14
 </body>
13 15
 </HTML>

+ 3
- 1
template/ThemeChange.php View File

@@ -7,7 +7,9 @@
7 7
 <body>
8 8
 <div id=message>
9 9
 	<h1>Configuration Updated</h1>
10
-	<span>Page redirects in a few seconds...</span>
10
+	<span>Page redirects <a href="<?php print $page?>">here</a>
11
+	in <span id=countdown><?php print $until?></span>...</span>
11 12
 </div>
13
+<script src="<?php print CONFIG_WEBROOT; ?>js/countdown.js"></script>
12 14
 </body>
13 15
 </HTML>

+ 5
- 5
www/composer.php View File

@@ -26,21 +26,22 @@ if (@$_POST['post'] && @$_POST['robocheckid']) {
26 26
 	$id = $_POST['robocheckid'];
27 27
 	$answer = $_POST['robocheckanswer'];
28 28
 	$page = $iterator->resolve();
29
+	$until = 3;
29 30
 	if (!isset($id, $answer)) {
30
-		header("Refresh: 0; url=$page");
31 31
 		$reason = "Did you forget to verify your humanity?";
32
+		header("Refresh: $until; url=$page");
32 33
 		include "{$ROOT}template/PostFailure.php";
33 34
 	} else if (!check_robocheck($id, $answer)) {
34
-		header("Refresh: 0; url=$page");
35 35
 		$reason = "You failed the humanity check!";
36
+		header("Refresh: $until; url=$page");
36 37
 		include "{$ROOT}template/PostFailure.php";
37 38
 	} else if (empty(@$_POST['content'])) {
38
-		header("Refresh: 0; url=$page");
39 39
 		$reason = "Just what are you trying to do?";
40
+		header("Refresh: $until; url=$page");
40 41
 		include "{$ROOT}template/PostFailure.php";
41 42
 	} else {
42 43
 		$iterator->post($_POST['content']);
43
-		header("Refresh: 0; url=$page");
44
+		header("Refresh: $until; url=$page");
44 45
 		include "{$ROOT}template/PostSuccess.php";
45 46
 	} die;
46 47
 }
@@ -58,7 +59,6 @@ if (@$_POST['post'] && @$_POST['robocheckid']) {
58 59
 <body>
59 60
 <?php $iterator->renderHeader(); ?>
60 61
 <div class=main><main>
61
-<?php include CONFIG_LOCALROOT . "template/Feelies.php" ?><hr />
62 62
 <article><?php if (@$_POST['preview'] && !empty(@$_POST['content'])) {
63 63
 	$iterator->renderRobocheck($_POST['content']);
64 64
 } else { $iterator->renderComposer(@$_POST['content']);

+ 4
- 2
www/config.php View File

@@ -13,8 +13,10 @@ $iterator = new RAL\ContinuityIterator($RM);
13 13
 if (isset($_POST['Theme'])) {
14 14
 	setcookie('Theme', $_POST['Theme']);
15 15
 	$_COOKIE['Theme'] = $_POST['Theme'];
16
-	$page = CONFIG_WEBROOT;
17
-	header("Refresh: 0; url=$page");
16
+	if (CONFIG_CLEAN_URL) $page = CONFIG_WEBROOT . 'config';
17
+	else $page = CONFIG_WEBROOT . 'config.php';
18
+	$until = 3;
19
+	header("Refresh: $until; url=$page");
18 20
 	include "{$ROOT}template/ThemeChange.php";
19 21
 	die;
20 22
 }

+ 1
- 3
www/css/Base.css View File

@@ -223,9 +223,7 @@ article .content > * {
223 223
 	cursor: pointer;
224 224
 	color: inherit;
225 225
 }
226
-.textarea {
227
-	width: 100%;
228
-}
226
+.textarea { width: calc(100% - 20px); }
229 227
 textarea {
230 228
 	margin: 0;
231 229
 	padding: 5px;

+ 4
- 22
www/css/Result.css View File

@@ -6,36 +6,18 @@ body {
6 6
 	margin: 0;
7 7
 	height: 100%;
8 8
 }
9
-#video video {
10
-	position: absolute;
11
-	top: 0;
12
-	left: 0;
13
-	width: 100%;
14
-	height: 100%;
15
-}
16
-@media (min-aspect-ratio: 4/3) {
17
-	#video video {
18
-		height: 300%;
19
-		top: -100%;
20
-	}
21
-}
22
-
23
-@media (max-aspect-ratio: 4/3) {
24
-	#video video{
25
-		width: 300%;
26
-		left: -100%;
27
-	}
28
-}
29 9
 #message {
30 10
 	text-align: center;
31
-	white-space: nowrap;
32
-	position: absolute;
33 11
 	border: 3px double;
34 12
 	border-radius: 5px 0;
35 13
 	padding: 10px;
36 14
 	margin: 10px;
37 15
 	background-color: White;
38 16
 	color: Black;
17
+	margin: 10px auto;
18
+	width: 50%;
19
+	min-width: 250px;
20
+	max-width: 100%;
39 21
 }
40 22
 h1 {
41 23
 	font-weight: lighter;

+ 10
- 0
www/js/countdown.js View File

@@ -0,0 +1,10 @@
1
+window.setTimeout(downOne, 1000);
2
+
3
+function downOne() {
4
+	var countdown = document.getElementById('countdown')
5
+	var currUntil = countdown.firstChild.nodeValue;
6
+	var nextUntil = currUntil - 1;
7
+	countdown.removeChild(countdown.firstChild);
8
+	countdown.appendChild(document.createTextNode(nextUntil));
9
+	if (nextUntil > 0) window.setTimeout(downOne, 1000);
10
+}

+ 2
- 2
www/search.php View File

@@ -48,9 +48,9 @@ $iterator->selectSearch($query, $continuity, $year, $topic);
48 48
 <div class=main><main>
49 49
 <?php
50 50
 if (empty($query)) {
51
-	print "You didn't search anything!";
51
+	print "<p>You didn't search anything!</p>";
52 52
 } else if ($iterator->render() === false)
53
-	print "Nobody's talking about {$query}!";
53
+	print "<p>Nobody's talking about {$query}!</p>";
54 54
 ?>
55 55
 </main></div>
56 56
 <div class=discovery>