Moved inline - javascript to external file in preparation of X-Content-Security-Policy (also, the code looks cleaner, yay)

Signed-off-by: Florian Aders (EleRas) <eleras@froxlor.org>
This commit is contained in:
Florian Aders (EleRas)
2011-06-16 18:59:16 +02:00
parent b9bb1a1286
commit 3e21cb0298
10 changed files with 87 additions and 45 deletions

View File

@@ -0,0 +1,25 @@
$(document).ready(function() {
// make rel="external" links open in a new window
$("a[rel='external']").attr('target', '_blank');
// set focus on username-field if on loginpage
if ($(".loginpage").length != 0) {
$("#loginname").focus();
}
// Auto-select next field in configfile - wizard
$('#config_distribution').change(function (){
window.location.href=window.location.href + '&distribution=' + this.options[ this.selectedIndex ].value;
});
$('#config_service').change(function (){
window.location.href=window.location.href + '&service=' + this.options[ this.selectedIndex ].value;
});
$('#config_daemon').change(function (){
window.location.href=window.location.href + '&daemon=' + this.options[ this.selectedIndex ].value;
});
// Back-button
$('#yesnobutton').click(function() {
history.back();
});
});