diff options
Diffstat (limited to 'module/web/templates/default/base.html')
-rw-r--r-- | module/web/templates/default/base.html | 202 |
1 files changed, 102 insertions, 100 deletions
diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 2ed21d1fc..7e0f0e2b4 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -22,7 +22,12 @@ document.addEvent("domready", function(){ add_bg = new Fx.Tween($('add_bg'));
add_box = new Fx.Tween($('add_box'));
- cap_box = new Fx.Tween($('cap_box'))
+ cap_box = new Fx.Tween($('cap_box'));
+
+ add_bg.set("opacity", 0);
+ add_box.set("opacity", 0);
+ cap_box.set("opacity", 0);
+
$('add_form').onsubmit=function() {
$('add_form').target = 'upload_target';
@@ -32,7 +37,7 @@ document.addEvent("domready", function(){ }else{
out();
}
- }
+ };
$('add_reset').addEvent('click', function(){
out();
@@ -46,7 +51,7 @@ document.addEvent("domready", function(){ initialDelay: 0,
delay: 4000,
limit: 30000
- })
+ });
$('action_play').addEvent('click', function(){
new Request({method: 'get', url: '/json/unpause'}).send();
@@ -58,135 +63,132 @@ document.addEvent("domready", function(){ });
- $('action_stop').addEvent('click', function(){
- new Request({method: 'get', url: '/json/pause'}).send();
- });
+ $('action_stop').addEvent('click', function(){
+ new Request({method: 'get', url: '/json/pause'}).send();
+ });
- $('cap_info').addEvent('click', function(){
- load_cap("get", "");
- show_cap();
- });
+ $('cap_info').addEvent('click', function(){
+ load_cap("get", "");
+ show_cap();
+ });
- $('cap_reset').addEvent('click', function(){
- hide_cap()
- });
+ $('cap_reset').addEvent('click', function(){
+ hide_cap()
+ });
- $('cap_form').addEvent('submit', function(e){
- submit_cap();
- e.stop()
- });
+ $('cap_form').addEvent('submit', function(e){
+ submit_cap();
+ e.stop()
+ });
+
+ jsonStatus.startTimer();
- jsonStatus.startTimer();
-
});
function LoadJsonToContent(data)
{
- $("speed").set('text', Math.round(data.speed*100)/100);
- $("aktiv").set('text', data.activ);
- $("aktiv_from").set('text', data.queue);
-
- if (data.captcha){
- $("cap_info").setStyle('display', 'inline');
- }else{
- $("cap_info").setStyle('display', 'none');
- }
+ $("speed").set('text', Math.round(data.speed*100)/100);
+ $("aktiv").set('text', data.activ);
+ $("aktiv_from").set('text', data.queue);
+
+ if (data.captcha){
+ $("cap_info").setStyle('display', 'inline');
+ }else{
+ $("cap_info").setStyle('display', 'none');
+ }
- if (data.download) {
- $("time").set('text', " {% trans "on" %}");
- $("time").setStyle('background-color', "#8ffc25");
-
- }else{
- $("time").set('text', " {% trans "off" %}");
- $("time").setStyle('background-color', "#fc6e26");
- }
-
- if (data.reconnect){
- $("reconnect").set('text', " {% trans "on" %}");
- $("reconnect").setStyle('background-color', "#8ffc25");
- }
- else{
- $("reconnect").set('text', " {% trans "off" %}");
- $("reconnect").setStyle('background-color', "#fc6e26");
- }
+ if (data.download) {
+ $("time").set('text', " {% trans "on" %}");
+ $("time").setStyle('background-color', "#8ffc25");
+
+ }else{
+ $("time").set('text', " {% trans "off" %}");
+ $("time").setStyle('background-color', "#fc6e26");
+ }
+
+ if (data.reconnect){
+ $("reconnect").set('text', " {% trans "on" %}");
+ $("reconnect").setStyle('background-color', "#8ffc25");
+ }
+ else{
+ $("reconnect").set('text', " {% trans "off" %}");
+ $("reconnect").setStyle('background-color', "#fc6e26");
+ }
}
function bg_show(){
- add_bg.set('opacity', 0);
- $("add_bg").setStyle('display', 'block');
- add_bg.start('opacity',0.8);
+ $("add_bg").setStyle('display', 'block');
+ add_bg.start('opacity',0.8);
}
function bg_hide(){
- add_bg.start('opacity',0).chain(function(){
- $('add_bg').setStyle('display', 'none');
- });
+ add_bg.start('opacity',0).chain(function(){
+ $('add_bg').setStyle('display', 'none');
+ });
}
function show(){
- bg_show()
- add_box.set('opacity', 0)
- $("add_box").setStyle('display', 'block');
- add_box.start('opacity',1)
+ bg_show();
+ $("add_box").setStyle('display', 'block');
+ add_box.start('opacity',1)
}
function out(){
- bg_hide()
- add_box.start('opacity',0).chain(function(){
- $('add_box').setStyle('display', 'none');
- });
+ bg_hide();
+ add_box.start('opacity',0).chain(function(){
+ $('add_box').setStyle('display', 'none');
+ });
}
function show_cap(){
- bg_show()
- cap_box.set('opacity', 0)
- $("cap_box").setStyle('display', 'block');
- cap_box.start('opacity',1)
+ bg_show();
+ $("cap_box").setStyle('display', 'block');
+ cap_box.start('opacity',1)
}
function hide_cap(){
- bg_hide()
- cap_box.start('opacity',0).chain(function(){
- $('cap_box').setStyle('display', 'none');
- });
+ bg_hide();
+ cap_box.start('opacity',0).chain(function(){
+ $('cap_box').setStyle('display', 'none');
+ });
}
function load_cap(method, post){
- new Request.JSON({
- url: "/json/set_captcha",
- onSuccess: function(data){
- if (data.captcha){
- $('cap_img').set('src', data.src);
- $('cap_span').setStyle('display', 'block');
- $$('#cap_form p')[0].set('text', '{% trans "Please read the text on the captcha." %}');
- $('cap_id').set('value', data.id);
- } else{
- $('cap_img').set('src', '');
- $('cap_span').setStyle('display', 'none');
- $$('#cap_form p')[0].set('text', '{% trans "No Captchas to read." %}');
- }
- },
- secure: false,
- async: true,
- method: method
- }).send(post);
+ new Request.JSON({
+ url: "/json/set_captcha",
+ onSuccess: function(data){
+ if (data.captcha){
+ $('cap_img').set('src', data.src);
+ $('cap_span').setStyle('display', 'block');
+ $$('#cap_form p')[0].set('text', '{% trans "Please read the text on the captcha." %}');
+ $('cap_id').set('value', data.id);
+ } else{
+ $('cap_img').set('src', '');
+ $('cap_span').setStyle('display', 'none');
+ $$('#cap_form p')[0].set('text', '{% trans "No Captchas to read." %}');
+ }
+ },
+ secure: false,
+ async: true,
+ method: method
+ }).send(post);
}
function submit_cap(){
- load_cap("post", "cap_id="+ $('cap_id').get('value') +"&cap_text=" + $('cap_text').get('value') );
- $('cap_text').set('value', '');
- return false;
+ load_cap("post", "cap_id="+ $('cap_id').get('value') +"&cap_text=" + $('cap_text').get('value') );
+ $('cap_text').set('value', '');
+ return false;
}
function AddBox()
{
- if ($("add_box").getStyle("display") == "hidden" || $("add_box").getStyle("display") == "none" || $("add_box").getStyle("opacity" == 0))
- {
- show();
- }
- else
- {
- out();
- }
+ if ($("add_box").getStyle("display") == "hidden" || $("add_box").getStyle("display") == "none" || $("add_box").getStyle("opacity" == 0))
+ {
+ show();
+ }
+ else
+ {
+ out();
+ }
}
</script>
@@ -194,18 +196,18 @@ function AddBox() {% block head %}
{% endblock %}
</head>
- <body>
+<body>
<a class="anchor" name="top" id="top"></a>
<div id="head-panel">
-<div id="head-search-and-login">
+ <div id="head-search-and-login">
-{% if user.is_authenticated %}
+ {% if user.is_authenticated %}
<span id="cap_info" style="display: {% if captcha %}inline{%else%}none{% endif %}">
<img src="{{ MEDIA_URL }}img/images.png" alt="Captcha:" style="vertical-align:middle; margin:2px" />
-<font style="font-weight: bold; cursor: pointer; margin-right: 2px;">{% trans "Captcha waiting" %}</font>
+<span style="font-weight: bold; cursor: pointer; margin-right: 2px;">{% trans "Captcha waiting" %}</span>
</span>
<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span>
|