aboutsummaryrefslogtreecommitdiffstats
path: root/jsaccess
diff options
context:
space:
mode:
authorLaurent Ghigonis <laurent@p1sec.com>2013-06-18 15:45:50 +0200
committerLaurent Ghigonis <laurent@p1sec.com>2013-06-18 15:45:50 +0200
commita79ab8e2868cd61e96349ec53f25db6f9e1a6636 (patch)
treeceaed5e9f9191c1955ec2fa88e0cb0b0db0cd6cf /jsaccess
parentjsaccess: rsync fix (diff)
downloadlaurent-tools-a79ab8e2868cd61e96349ec53f25db6f9e1a6636.tar.xz
laurent-tools-a79ab8e2868cd61e96349ec53f25db6f9e1a6636.zip
jsaccess: add banner system
Diffstat (limited to 'jsaccess')
-rw-r--r--jsaccess/README.txt7
-rw-r--r--jsaccess/jsa/banner/README.txt6
-rw-r--r--jsaccess/jsa/index.html1
-rw-r--r--jsaccess/jsa/jsa.css6
-rw-r--r--jsaccess/jsa/jsa.js36
5 files changed, 55 insertions, 1 deletions
diff --git a/jsaccess/README.txt b/jsaccess/README.txt
index 7d7292b..9345102 100644
--- a/jsaccess/README.txt
+++ b/jsaccess/README.txt
@@ -95,6 +95,13 @@ On the web user machine:
* Tested with Firefox 21 and Chrome 27
+Banner
+======
+
+You can set your own banner image / link / text without modifying html.
+See jsa/banner/README.txt
+
+
Git content
===========
diff --git a/jsaccess/jsa/banner/README.txt b/jsaccess/jsa/banner/README.txt
new file mode 100644
index 0000000..a9db7ac
--- /dev/null
+++ b/jsaccess/jsa/banner/README.txt
@@ -0,0 +1,6 @@
+Create files in this directory to set you own banner image / link / text,
+without having to modify the html.
+
+banner.png - banner image
+banner-png-href.txt - banner image link
+banner.txt - banner text
diff --git a/jsaccess/jsa/index.html b/jsaccess/jsa/index.html
index 7ac95e4..87d3b1b 100644
--- a/jsaccess/jsa/index.html
+++ b/jsaccess/jsa/index.html
@@ -14,6 +14,7 @@
</HEAD>
<BODY onLoad="jsainit()">
<div id="header">
+ <div id="banner"><a href=""><img/></a></div>
<h1>Restricted access</h1>
</div>
<div id="content">
diff --git a/jsaccess/jsa/jsa.css b/jsaccess/jsa/jsa.css
index 3803bfb..2df63e9 100644
--- a/jsaccess/jsa/jsa.css
+++ b/jsaccess/jsa/jsa.css
@@ -18,6 +18,12 @@ input {
margin-right: 10px;
}
+#banner {
+ position: absolute;
+ top: 20px;
+ left: 20px;
+}
+
#content {
margin-left: auto;
margin-right: auto;
diff --git a/jsaccess/jsa/jsa.js b/jsaccess/jsa/jsa.js
index 259899c..806ed49 100644
--- a/jsaccess/jsa/jsa.js
+++ b/jsaccess/jsa/jsa.js
@@ -24,11 +24,45 @@
/* Called on "body" load */
function jsainit() {
+ /* Focus password field */
$("input:text:visible:first").focus();
+
+ /* Banner text */
+ $.ajax({
+ url: "banner/banner.txt",
+ beforeSend: function ( xhr ) {
+ xhr.overrideMimeType("text/plain");
+ },
+ success: function (data) {
+ $('#header h1').html(data);
+ }
+ });
+ /* Banner image */
+ $.ajax({
+ url: "banner/banner.png",
+ beforeSend: function ( xhr ) {
+ xhr.overrideMimeType("image/png");
+ },
+ success: function (data) {
+ $('#banner img').attr('src', "banner/banner.png");
+ /* Banner image link */
+ $.ajax({
+ url: "banner/banner-png-href.txt",
+ beforeSend: function ( xhr ) {
+ xhr.overrideMimeType("text/plain");
+ },
+ success: function (data) {
+ $('#banner a').attr('href', data);
+ }
+ });
+ },
+ error: function (data) {
+ $('#banner img').remove();
+ }
+ });
}
/* Called on "Get files list" click */
-
function jsagetlist() {
var pass = document.getElementById('password').value;
var RMD160 = new Hashes.RMD160;