From e4b1bc88a1e0fc88a8769860a32ccd342e278fb1 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 1 Mar 2010 19:47:27 +0100 Subject: webif. icons, storage.to fix --- module/plugins/hoster/StorageTo.py | 14 +++++++++++--- module/web/ServerThread.py | 1 - module/web/media/default/css/default.css | 5 ++++- module/web/media/default/img/reconnect.png | Bin 0 -> 755 bytes module/web/templates/default/base.html | 21 ++++++++++++++++++++- 5 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 module/web/media/default/img/reconnect.png (limited to 'module') diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py index dbff844ad..a9b1ec4c2 100644 --- a/module/plugins/hoster/StorageTo.py +++ b/module/plugins/hoster/StorageTo.py @@ -48,7 +48,12 @@ class StorageTo(Plugin): pyfile.status.waituntil = self.time_plus_wait pyfile.status.want_reconnect = self.want_reconnect - thread.wait(self.parent) + while self.want_reconnect: + thread.wait(self.parent) + self.download_api_data() + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect pyfile.status.url = self.get_file_url() @@ -73,7 +78,10 @@ class StorageTo(Plugin): self.download_api_data() if self.api_data["state"] == "wait": self.want_reconnect = True - self.time_plus_wait = time() + int(self.api_data["countdown"]) + else: + self.want_reconnect = False + + self.time_plus_wait = time() + int(self.api_data["countdown"]) + 3 @@ -98,7 +106,7 @@ class StorageTo(Plugin): if not self.html: self.download_html() file_name_pattern = r"Downloading:(.*?)(.*?)" - return re.search(file_name_pattern, self.html).group(1) + return re.search(file_name_pattern, self.html).group(1).strip() def proceed(self, url, location): self.req.download(url, location, cookies=True) diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 7efcc0b75..ffd6a2d35 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -7,7 +7,6 @@ from subprocess import Popen from subprocess import call from sys import version_info import threading -from time import sleep class WebServer(threading.Thread): def __init__(self, pycore): diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 986e9a4bc..24bb9febf 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -968,7 +968,7 @@ a.urlextern { background:transparent url(/media/default/img/external-10.2.png) no-repeat scroll right center; padding:0 13px 0 0; } -a[href^="http://www.pyload.org"]:after, a.noextlink:after { +a[href="http://www.pyload.org"]:after, a.noextlink:after { background:none; padding:0; } @@ -1008,6 +1008,9 @@ a.play { a.time { background:transparent url(/media/default/img/status_None.png) 0px 1px no-repeat; } +a.reconnect { + background:transparent url(/media/default/img/reconnect.png) 0px 1px no-repeat; +} a.play:hover { background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat; } diff --git a/module/web/media/default/img/reconnect.png b/module/web/media/default/img/reconnect.png new file mode 100644 index 000000000..49b269145 Binary files /dev/null and b/module/web/media/default/img/reconnect.png differ diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 82581da45..27a50a018 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -76,6 +76,24 @@ 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.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 show(){ add_bg.set('opacity', 0); @@ -180,7 +198,8 @@ function AddBox() {% if perms.pyload.can_see_dl %}