Add powered by footer, set warn cookie using javascript, w3c validation
This commit is contained in:
@ -1,27 +0,0 @@
|
||||
function alert_version(last_version){
|
||||
jQuery(function( $ ){
|
||||
$("#alert-version").click(function( e ){
|
||||
e.preventDefault();
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(10*365*24*60*60*1000));
|
||||
var expires = "; expires="+date.toGMTString();
|
||||
document.cookie = "cas-alert-version=" + last_version + expires + "; path=/";
|
||||
});
|
||||
|
||||
var nameEQ="cas-alert-version=";
|
||||
var ca = document.cookie.split(";");
|
||||
var value;
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while(c.charAt(0) === " "){
|
||||
c = c.substring(1,c.length);
|
||||
}
|
||||
if(c.indexOf(nameEQ) === 0){
|
||||
value = c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
}
|
||||
if(value === last_version){
|
||||
$("#alert-version").parent().hide();
|
||||
}
|
||||
});
|
||||
}
|
40
cas_server/static/cas_server/functions.js
Normal file
40
cas_server/static/cas_server/functions.js
Normal file
@ -0,0 +1,40 @@
|
||||
function createCookie(name, value, days) {
|
||||
if (days) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime()+(days*24*60*60*1000));
|
||||
var expires = "; expires="+date.toGMTString();
|
||||
}
|
||||
else var expires = "";
|
||||
document.cookie = name + "=" + value + expires + "; path=/";
|
||||
}
|
||||
|
||||
function readCookie(name) {
|
||||
var nameEQ = name + "=";
|
||||
var ca = document.cookie.split(";");
|
||||
for(var i=0;i < ca.length;i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0)==" "){
|
||||
c = c.substring(1,c.length);
|
||||
}
|
||||
if (c.indexOf(nameEQ) == 0){
|
||||
return c.substring(nameEQ.length,c.length);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function eraseCookie(name) {
|
||||
createCookie(name,"",-1);
|
||||
}
|
||||
|
||||
function alert_version(last_version){
|
||||
jQuery(function( $ ){
|
||||
$("#alert-version").click(function( e ){
|
||||
e.preventDefault();
|
||||
createCookie("cas-alert-version", last_version, 10*365)
|
||||
});
|
||||
if(readCookie("cas-alert-version") === last_version){
|
||||
$("#alert-version").parent().hide();
|
||||
}
|
||||
});
|
||||
}
|
@ -1,6 +1,9 @@
|
||||
html, body {
|
||||
height: 100%;
|
||||
}
|
||||
body {
|
||||
padding-top: 40px;
|
||||
padding-bottom: 40px;
|
||||
padding-bottom: 0px;
|
||||
background-color: #eee;
|
||||
}
|
||||
|
||||
@ -41,6 +44,22 @@ body {
|
||||
width:110px;
|
||||
}
|
||||
|
||||
/* Wrapper for page content to push down footer */
|
||||
#wrap {
|
||||
min-height: 100%;
|
||||
height: auto !important;
|
||||
height: 100%;
|
||||
/* Negative indent footer by it's height */
|
||||
margin: 0 auto -40px;
|
||||
}
|
||||
#footer {
|
||||
height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
#footer p {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 680px) {
|
||||
#app-name {
|
||||
margin: 0;
|
||||
|
Reference in New Issue
Block a user