From f9149595c9a1344be54193e70d66a6fa0ecc49e7 Mon Sep 17 00:00:00 2001
From: rugk <rugk@posteo.de>
Date: Mon, 31 Oct 2016 12:20:07 +0100
Subject: [PATCH] Change alert to loading info message

---
 css/bootstrap/privatebin.css | 4 ++++
 css/privatebin.css           | 6 +++++-
 js/privatebin.js             | 5 -----
 tpl/bootstrap-compact.php    | 2 +-
 tpl/bootstrap-dark-page.php  | 2 +-
 tpl/bootstrap-dark.php       | 2 +-
 tpl/bootstrap-page.php       | 2 +-
 tpl/bootstrap.php            | 9 +++++++--
 tpl/page.php                 | 2 +-
 9 files changed, 21 insertions(+), 13 deletions(-)

diff --git a/css/bootstrap/privatebin.css b/css/bootstrap/privatebin.css
index b26421b4..e63e63fe 100644
--- a/css/bootstrap/privatebin.css
+++ b/css/bootstrap/privatebin.css
@@ -98,6 +98,10 @@ body.navbar-spacing {
 	margin-bottom: 10px;
 }
 
+.smallErrorText {
+	font-size: 80%;
+}
+
 .comment {
 	border-left: 1px solid #ccc;
 	padding: 5px 0 5px 10px;
diff --git a/css/privatebin.css b/css/privatebin.css
index fa97c89c..0fa76234 100644
--- a/css/privatebin.css
+++ b/css/privatebin.css
@@ -117,7 +117,7 @@ h3.title {
 #pasteresult { 
 	background-color: #1F2833;
 	color: #fff;
-	padding: 4px 12px; 
+	padding: 4px 12px;
 	clear: both;
 	-moz-box-shadow: inset 0 2px 2px #000;
 	-webkit-box-shadow: inset 0 2px 2px #000;
@@ -285,6 +285,10 @@ input {
 	color:#ff0;
 }
 
+.smallErrorText {
+	font-size: 80%;
+}
+
 /* --- discussion related CSS ------- */
 
 #discussion {  /* Discussion container */
diff --git a/js/privatebin.js b/js/privatebin.js
index b6d104dc..faf09602 100644
--- a/js/privatebin.js
+++ b/js/privatebin.js
@@ -20,11 +20,6 @@
 /** global: showdown */
 /** global: sjcl */
 
-$(document).ready(function() {
-    // hide "no javascript" message as early as possible
-    $('#noscript').hide();
-})
-
 // Immediately start random number generator collector.
 sjcl.random.startCollectors();
 
diff --git a/tpl/bootstrap-compact.php b/tpl/bootstrap-compact.php
index b4790be7..657b5788 100644
--- a/tpl/bootstrap-compact.php
+++ b/tpl/bootstrap-compact.php
@@ -52,7 +52,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
diff --git a/tpl/bootstrap-dark-page.php b/tpl/bootstrap-dark-page.php
index 14676c01..b57e880e 100644
--- a/tpl/bootstrap-dark-page.php
+++ b/tpl/bootstrap-dark-page.php
@@ -52,7 +52,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
diff --git a/tpl/bootstrap-dark.php b/tpl/bootstrap-dark.php
index 2da3d02f..9ceb15f7 100644
--- a/tpl/bootstrap-dark.php
+++ b/tpl/bootstrap-dark.php
@@ -52,7 +52,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
diff --git a/tpl/bootstrap-page.php b/tpl/bootstrap-page.php
index 235f4877..fe49a3fd 100644
--- a/tpl/bootstrap-page.php
+++ b/tpl/bootstrap-page.php
@@ -52,7 +52,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
diff --git a/tpl/bootstrap.php b/tpl/bootstrap.php
index cd9a787a..2eade554 100644
--- a/tpl/bootstrap.php
+++ b/tpl/bootstrap.php
@@ -52,7 +52,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->
@@ -280,7 +280,6 @@ if (!strlen($ERROR)):
 endif;
 ?>alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo htmlspecialchars($ERROR); ?></div>
 			<noscript><div id="noscript" role="alert" class="nonworking alert alert-warning"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('JavaScript is required for PrivateBin to work.<br />Sorry for the inconvenience.'); ?></div></noscript>
-			<div id="noscript" role="alert" class="nonworking alert alert-warning noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span> <?php echo I18n::_('The required JavaScripts for PrivateBin could not be loaded. This might <br />Please see <a href="">this FAQ for more information</a>.'); ?></div>
 			<noscript><link type="text/css" rel="stylesheet" href="css/noscript.css" /></noscript>
 			<div id="oldienotice" role="alert" class="hidden nonworking alert alert-danger"><span class="glyphicon glyphicon-alert" aria-hidden="true"></span> <?php echo I18n::_('PrivateBin requires a modern browser to work.'); ?></div>
 			<div id="ienotice" role="alert" class="hidden alert alert-warning"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> <?php echo I18n::_('Still using Internet Explorer? Do yourself a favor, switch to a modern browser:'), PHP_EOL; ?>
@@ -325,6 +324,12 @@ endif;
 				<div id="comments"></div>
 			</div>
 		</section>
+        <section class="container">
+            <div id="noscript" role="alert" class="nonworking alert alert-info noscript-hide"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true">
+                <span> <?php echo I18n::_('Loading...'); ?></span><br>
+                <span class="smallErrorText"><?php echo I18n::_('In case this message never disappears please have a look at <a href="">this FAQ for information to troubleshoot</a>.'); ?></span>
+            </div>
+        </section>
 		<footer class="container">
 			<div class="row">
 				<h4 class="col-md-5 col-xs-8"><?php echo I18n::_('PrivateBin'); ?> <small>- <?php echo I18n::_('Because ignorance is bliss'); ?></small></h4>
diff --git a/tpl/page.php b/tpl/page.php
index b48db34e..b4d12322 100644
--- a/tpl/page.php
+++ b/tpl/page.php
@@ -47,7 +47,7 @@ if ($MARKDOWN):
 <?php
 endif;
 ?>
-		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-tnG2Ai1USFqZM26ChISDXXq5YCpc4ae760JPSoN1wFLcu8wgu1VuOeZztWme9naCTgWRpOHSlg2PnvQbgoCjIg==" crossorigin="anonymous"></script>
+		<script type="text/javascript" src="js/privatebin.js?<?php echo rawurlencode($VERSION); ?>" integrity="sha512-h/cw2lgocVvgjmYWShhbnz5nSzyUv4rVY1JgN7vmkZq8VJX9KVXPoC7oYX+YGFk+0FYw+c/uofVW9yyU5TJv+w==" crossorigin="anonymous"></script>
 		<!--[if lt IE 10]>
 		<style type="text/css">body {padding-left:60px;padding-right:60px;} #ienotice {display:block;} #oldienotice {display:block;}</style>
 		<![endif]-->