From fd11206fe002e46119dd58f31e526a8e85a9a1a1 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 16 Nov 2009 17:43:33 +0100 Subject: added lastEffectiveURL --- module/network/Request.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index eb67da95d..9f27af4ec 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -47,6 +47,7 @@ class Request: self.abort = False + self.lastEffectiveURL = None self.lastURL = None self.auth = False @@ -138,6 +139,7 @@ class Request: self.pycurl.perform() + self.lastEffectiveURL = self.pycurl.getinfo(pycurl.EFFECTIVE_URL) self.lastURL = url header = self.get_header() @@ -165,6 +167,7 @@ class Request: if rep.headers["content-encoding"] == "gzip": output = GzipFile('', 'r', 0, StringIO(output)).read() + self.lastEffectiveURL = rep.geturl() self.lastURL = url return output -- cgit v1.2.3 From 900964358d3c5328292e8af73730c3bc25e75406 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 16 Nov 2009 18:22:29 +0100 Subject: relink.us fix --- module/plugins/RelinkUs.py | 50 +++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 14 deletions(-) (limited to 'module') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 4bfa5a18b..840497413 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -2,8 +2,9 @@ # -*- coding: utf-8 -*- import re +import time -from module.Plugin import Plugin +from Plugin import Plugin class RelinkUs(Plugin): @@ -12,14 +13,15 @@ class RelinkUs(Plugin): props = {} props['name'] = "RelinkUs" props['type'] = "container" - props['pattern'] = r"http://(www\.)?relink.us/go.php" - props['version'] = "0.1" + props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" + props['version'] = "0.2" props['description'] = """Relink.us Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") + props['author_name'] = ("Sleeper-") + props['author_mail'] = ("@nonymous") self.props = props self.parent = parent self.html = None + self.multi_dl = False def file_exists(self): """ returns True or False @@ -27,13 +29,33 @@ class RelinkUs(Plugin): return True def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - container_id = url.split("id=")[-1] + container_id = self.parent.url.split("/")[-1].split("id=")[-1] + url = "http://relink.us/view.php?id="+container_id + self.html = self.req.load(url, cookies=True) temp_links = [] - link_number = len(re.findall(r"test_\d+", self.html)) - for number in range(0, link_number): - new_link = re.search("src='(.*)'></iframe>", self.req.load("http://relink.us/f/%s/1/%i" % (container_id, number))).group(1) - temp_links.append(new_link) - print temp_links - self.links = temp_links + + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) + + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + + for link_string in link_strings: + self.req.lastURL = url + + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + + new_link = self.req.lastEffectiveURL + + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) + + print new_link + temp_links.append(new_link) + + self.links = temp_links -- cgit v1.2.3 From 737345718371b5faae703b7ed3f4e9725abf5158 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 16 Nov 2009 18:32:37 +0100 Subject: indentation fix --- module/plugins/RelinkUs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 840497413..9ca209be3 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -34,28 +34,28 @@ class RelinkUs(Plugin): self.html = self.req.load(url, cookies=True) temp_links = [] - # Download Ad-Frames, otherwise we aren't enabled for download - iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - for link_string in link_strings: - self.req.lastURL = url + for link_string in link_strings: + self.req.lastURL = url - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - new_link = self.req.lastEffectiveURL + new_link = self.req.lastEffectiveURL - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) - print new_link - temp_links.append(new_link) + print new_link + temp_links.append(new_link) - self.links = temp_links + self.links = temp_links -- cgit v1.2.3 From 2599ae0c23fd9f0766ba22a1741d458a08985823 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 16 Nov 2009 18:38:16 +0100 Subject: indentation fix, 2nd try -.- --- module/plugins/RelinkUs.py | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'module') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 9ca209be3..1700beb2b 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -34,28 +34,28 @@ class RelinkUs(Plugin): self.html = self.req.load(url, cookies=True) temp_links = [] - # Download Ad-Frames, otherwise we aren't enabled for download - iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - for link_string in link_strings: - self.req.lastURL = url + for link_string in link_strings: + self.req.lastURL = url - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - new_link = self.req.lastEffectiveURL + new_link = self.req.lastEffectiveURL - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) - print new_link - temp_links.append(new_link) + print new_link + temp_links.append(new_link) - self.links = temp_links + self.links = temp_links -- cgit v1.2.3 From ec73cb69f724da8594acad320e0ff1cf9543d131 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 16 Nov 2009 18:40:28 +0100 Subject: indentation fix, 3nd try.. --- module/plugins/RelinkUs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 1700beb2b..786733558 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -50,10 +50,10 @@ class RelinkUs(Plugin): new_link = self.req.lastEffectiveURL if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) print new_link temp_links.append(new_link) -- cgit v1.2.3 From 7579e0750c7bd81c916012e2842c8a96ad8fa414 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 22 Nov 2009 15:04:30 +0100 Subject: secure xmlrpc --- module/file_list.py | 2 +- module/remote/SecureXMLRPCServer.py | 103 ++++++++++++++++++++++++++++++++++++ module/remote/SocketServer.py | 84 ----------------------------- module/thread_list.py | 2 +- 4 files changed, 105 insertions(+), 86 deletions(-) create mode 100644 module/remote/SecureXMLRPCServer.py delete mode 100644 module/remote/SocketServer.py (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index c55ce5bc6..1701b801b 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -113,7 +113,7 @@ class File_List(object): output = open('links.pkl', 'wb') cPickle.dump(self.data, output, -1) - self.inform_client() + #self.inform_client() self.lock.release() diff --git a/module/remote/SecureXMLRPCServer.py b/module/remote/SecureXMLRPCServer.py new file mode 100644 index 000000000..fb666b4ab --- /dev/null +++ b/module/remote/SecureXMLRPCServer.py @@ -0,0 +1,103 @@ +# Source: http://sources.gentoo.org/viewcvs.py/gimli/server/SecureXMLRPCServer.py?view=markup +# which seems to be based on http://www.sabren.net/code/python/SecureXMLRPCServer.py +# +# Changes: +# 2007-01-06 Christian Hoffmann <ch@hoffie.info> +# * Bugfix: replaced getattr by hasattr in the conditional +# (lead to an error otherwise) +# * SecureXMLRPCServer: added self.instance = None, otherwise a "wrong" +# exception is raised when calling unknown methods via xmlrpc +# * Added HTTP Basic authentication support +# +# Modified for the Sceradon project +# +# This code is in the public domain +# and is provided AS-IS WITH NO WARRANTY WHATSOEVER. +# $Id: SecureXMLRPCServer.py 5 2007-01-06 17:54:13Z hoffie $ + +from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler +from OpenSSL import SSL +import SocketServer +import socket +import base64 + +class SecureSocketServer(SocketServer.TCPServer, SocketServer.ThreadingMixIn): + def __init__(self, addr, cert, key, requestHandler, verify_cert_func=None): + SocketServer.TCPServer.__init__(self, addr, requestHandler) + ctx = SSL.Context(SSL.SSLv23_METHOD) + if not verify_cert_func and hasattr(self, 'verify_client_cert'): + verify_cert_func = getattr(self, 'verify_client_cert') + if verify_cert_func: + ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify_cert_func) + ctx.use_privatekey_file(key) + ctx.use_certificate_file(cert) + + tmpConnection = SSL.Connection(ctx, socket.socket(socket.AF_INET, socket.SOCK_STREAM)) + self.socket = SecureSocketConnection(tmpConnection) + + self.server_bind() + self.server_activate() + + def finish_request(self, request, client_address): + """Finish one request by instantiating RequestHandlerClass.""" + self.RequestHandlerClass(request, client_address, self) + + +class SecureXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): + def __init__(self, request, client_address, server, client_digest=None): + self.authMap = server.getAuthenticationMap() + SimpleXMLRPCRequestHandler.__init__(self, request, client_address, server) + self.client_digest = client_digest + + def setup(self): + self.connection = self.request + self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) + self.wfile = socket._fileobject(self.request, "wb", self.wbufsize) + + def do_POST(self): + # authentication + if self.authMap != None: # explicit None! + if self.headers.has_key('authorization') and self.headers['authorization'].startswith('Basic '): + authenticationString = base64.b64decode(self.headers['authorization'].split(' ')[1]) + if authenticationString.find(':') != -1: + username, password = authenticationString.split(':', 1) + if self.authMap.has_key(username) and self.verifyPassword(username, password): + return SimpleXMLRPCRequestHandler.do_POST(self) + self.send_response(401) + self.end_headers() + return False + return SimpleXMLRPCRequestHandler.do_POST(self) + + def verifyPassword(self, username, givenPassword): + return self.authMap[username] == givenPassword + + +class SecureXMLRPCServer(SecureSocketServer, SimpleXMLRPCServer): + def __init__(self, address, cert, key, authenticationMap = None, handler=SecureXMLRPCRequestHandler, verify_cert_func=None): + self.logRequests = False + SecureSocketServer.__init__(self, address, cert, key, handler, verify_cert_func) + # This comes from SimpleXMLRPCServer.__init__()->SimpleXMLRPCDispatcher.__init__() + self.funcs = {} + self.instance = None + self.authenticationMap = authenticationMap + + def getAuthenticationMap(self): + return self.authenticationMap + + +class SecureSocketConnection: + def __init__(self, connection): + self.__dict__["connection"] = connection + + def __getattr__(self, name): + return getattr(self.__dict__["connection"], name) + + def __setattr__(self, name, value): + setattr(self.__dict__["connection"], name, value) + + def shutdown(self, how=1): + self.__dict__["connection"].shutdown() + + def accept(self): + connection, address = self.__dict__["connection"].accept() + return (SecureSocketConnection(connection), address) diff --git a/module/remote/SocketServer.py b/module/remote/SocketServer.py deleted file mode 100644 index 2edd1d9f3..000000000 --- a/module/remote/SocketServer.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -authored by: RaNaN - -This modul class handels all incoming and outgoing data between server and gui - -""" -import asynchat -import asyncore -import socket -import threading -import time - -from RequestHandler import RequestHandler - - -class ServerThread(threading.Thread): - def __init__(self, pycore): - threading.Thread.__init__(self) - self.setDaemon(True) - self.server = MainServerSocket(int(pycore.config['remote']['port']), pycore) - - def run(self): - asyncore.loop() - print "loop closed" - - def sockets(self): - """returns all connected sockets in a list""" - sockets = [] - for value in asyncore.socket_map.values(): - if SecondaryServerSocket == value.__class__: - sockets.append(value) - - return sockets - - def push_all(self, obj): - """push obj to all sockets""" - for socket in self.sockets(): - socket.push_obj(obj) - - -class MainServerSocket(asyncore.dispatcher): - def __init__(self, port, pycore): - asyncore.dispatcher.__init__(self) - pycore.logger.info('initing Remote-Server') - self.pycore = pycore - try: - self.create_socket(socket.AF_INET, socket.SOCK_STREAM) - self.bind(('', port)) - self.listen(5) - except: - raise Exception("Can't create socket") - def handle_accept(self): - newSocket, address = self.accept() - self.pycore.logger.info("Connected from " + str(address)) - SecondaryServerSocket(newSocket, self.pycore) - def handle_close(self): - print "going to close" - self.close() - - -class SecondaryServerSocket(asynchat.async_chat): - def __init__(self, socket, pycore): - asynchat.async_chat.__init__(self, socket) - self.pycore = pycore - self.handler = RequestHandler(pycore) - self.set_terminator('\n') - self.data = "" - def collect_incoming_data(self, data): - self.data += data - def found_terminator(self): - time.sleep(0.2) # if response is received to fast client gets an error O_o ?!?!? - rep = self.handler.proceed(self.data) - self.push(rep) - self.data = "" - #having fun with the data - def handle_close(self): - self.pycore.logger.info("Disconnected from "+ str(self.getpeername())) - self.close() - def push_obj(self, obj): - obj = self.handler.encrypt(obj) - self.push(obj) diff --git a/module/thread_list.py b/module/thread_list.py index d4f2dac97..da13afba6 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -60,7 +60,7 @@ class Thread_List(object): def get_job(self): """return job if suitable, otherwise send thread idle""" - if not self.parent.is_dltime() or self.pause or self.reconnecting or not self.list.files: #conditions when threads dont download + if not self.parent.is_time_download() or self.pause or self.reconnecting or not self.list.files: #conditions when threads dont download return None self.init_reconnect() -- cgit v1.2.3 From 293b957ce40bf3318f1c605887c2755ebd9b3e09 Mon Sep 17 00:00:00 2001 From: sitacuisses <sitacuisses77@yahoo.de> Date: Wed, 18 Nov 2009 00:47:28 +0100 Subject: user: sitacuisses <sitacuisses77@yahoo.de> branch 'default' added module/plugins/FilesmonsterCom.py --- module/plugins/FilesmonsterCom.py | 94 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 module/plugins/FilesmonsterCom.py (limited to 'module') diff --git a/module/plugins/FilesmonsterCom.py b/module/plugins/FilesmonsterCom.py new file mode 100644 index 000000000..27c687363 --- /dev/null +++ b/module/plugins/FilesmonsterCom.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Plugin for www.filesmonster.com +# this plugin isn't fully implemented yet,but it does download +# todo: +# detect, if reconnect is necessary +# download-error handling +# postpone download, if speed is below a set limit +# implement premium-access +# optional replace blanks in filename with underscores + +import re +import urllib +import time +from Plugin import Plugin + +class FilesmonsterCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilesmonsterCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www.)??filesmonster.com/download.php" + props['version'] = "0.1" + props['description'] = """Filesmonster.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + self.filerequest = None + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) # get the start page + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() # the complex work is done here + file_url = self.htmlwithlink + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"File\sname:\s<span\sclass=\"em\">(.*?)</span>", self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def get_download_page(self): + herewego = re.findall(r"<form\sid=\'slowdownload\'\smethod=\"post\"\saction=\"http://filesmonster.com/get/free/\">\s*\n\s*<input\stype=\"hidden\"\sname=\"(\S*?)\"\svalue=\"(\S*?)\"\s*>", self.html) + the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) + temporary_filtered = re.search(r"</div><form\sid=\'rtForm\'\sname=\"rtForm\"\smethod=\"post\">\s*\n(\s*<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'>\s*\n)*?\s*</form>", the_download_page).group(0) + all_the_tuples = re.findall(r"<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'", temporary_filtered) + time.sleep(30) + herewego = None + herewego = self.req.load('http://filesmonster.com/ajax.php', None, all_the_tuples) + ticket_number = re.search(r"\"text\":\"(.*?)\"\,\"error\"", herewego).group(1) + herewego = None + herewego = self.req.load('http://filesmonster.com/ajax.php', None, {'act': 'getdl', 'data': ticket_number}) + ticket_number = None + ticket_number = re.search(r"\"url\":\"(.*?)\"", herewego).group(1) + the_download_page = re.sub(r"\\/", r"/", ticket_number) + ticket_number = urllib.quote(the_download_page.encode('utf8')) + self.htmlwithlink = re.sub("http%3A", "http:", ticket_number) + self.filerequest = re.search(r"\"file_request\":\"(.*?)\"", herewego).group(1) + + def proceed(self, url, location): + + self.req.download(url, location, None, {"X-File-Request": self.filerequest}) -- cgit v1.2.3 From 9945533387cc58c2019fa7615dbccd4a35e4c59d Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Mon, 16 Nov 2009 18:56:44 +0100 Subject: Fixed DLC Plugin for new Plugin System --- module/plugins/DLC.pyc | Bin 3692 -> 2228 bytes module/plugins/UploadedTo.py | 3 +-- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 5d4809178..3adddec00 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py index bcb0a7008..4bddbd6f1 100644 --- a/module/plugins/UploadedTo.py +++ b/module/plugins/UploadedTo.py @@ -69,8 +69,7 @@ class UploadedTo(Plugin): tries += 1 if tries > 5: - raise Exception, "Error while preparing DL, HTML dump: %s" % self.html - + raise Exception, "Error while preparing DL" return True def download_api_data(self): -- cgit v1.2.3 From 8afd72d4a918108a081a6a94ccc72f4c2d275897 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Mon, 16 Nov 2009 20:28:33 +0100 Subject: Fixed DLC Plugin --- module/plugins/DLC.pyc | Bin 2228 -> 2231 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 3adddec00..980dd8ace 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ -- cgit v1.2.3 From b391a5b9061d7d41bf1ae7df71f5a5e64b8491e8 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 22 Nov 2009 17:44:03 +0100 Subject: fixed SecureXMLRPCServer --- module/remote/SecureXMLRPCServer.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module') diff --git a/module/remote/SecureXMLRPCServer.py b/module/remote/SecureXMLRPCServer.py index fb666b4ab..158e44863 100644 --- a/module/remote/SecureXMLRPCServer.py +++ b/module/remote/SecureXMLRPCServer.py @@ -75,6 +75,9 @@ class SecureXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): class SecureXMLRPCServer(SecureSocketServer, SimpleXMLRPCServer): def __init__(self, address, cert, key, authenticationMap = None, handler=SecureXMLRPCRequestHandler, verify_cert_func=None): self.logRequests = False + self._send_traceback_header = False + self.encoding = "utf-8" + self.allow_none = True SecureSocketServer.__init__(self, address, cert, key, handler, verify_cert_func) # This comes from SimpleXMLRPCServer.__init__()->SimpleXMLRPCDispatcher.__init__() self.funcs = {} -- cgit v1.2.3 From 419a93755b6180bbab69aaf973cd99f49b4a2268 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 22 Nov 2009 18:51:14 +0100 Subject: Webinterface with XMLRPC --- module/web/WebServer.py | 354 ++++++++++-------------------------------------- module/web/main.html | 29 ++++ module/web/main.js | 42 ++++++ 3 files changed, 139 insertions(+), 286 deletions(-) create mode 100644 module/web/main.html create mode 100644 module/web/main.js (limited to 'module') diff --git a/module/web/WebServer.py b/module/web/WebServer.py index 8cef0de2f..0712f1dce 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -1,290 +1,72 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -#Copyright (C) 2009 RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### +import sys +from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +from xmlrpclib import ServerProxy +from time import time +import re -import random -import threading -import time - -import bottle -from bottle import abort -from bottle import redirect -from bottle import request -from bottle import response -from bottle import route -from bottle import run -from bottle import send_file -from bottle import template -from bottle import validate - - -core = None - -PATH = "./module/web/" -TIME = time.strftime("%a, %d %b %Y 00:00:00 +0000", time.localtime()) #set time to current day -USERS = {} - -@route('/login', method='POST') -def do_login(): - #print request.GET - - - username = core.config['webinterface']['username'] - pw = core.config['webinterface']['password'] - - if request.POST['u'] == username and request.POST['p'] == pw: - - id = int(random.getrandbits(16)) - ua = request.HEADER("HTTP_USER_AGENT") - ip = request.HEADER("REMOTE_ADDR") - - auth = {} - - auth['ua'] = ua - auth['ip'] = ip - auth['user'] = username - - USERS[id] = auth - - response.COOKIES['user'] = username - response.COOKIES['id'] = id - - return template('default', page='loggedin', user=username) - else: - return template('default', page='login') - -@route('/login') -def login(): - - if check_auth(request): - redirect("/") - - return template('default', page='login') - -@route('/logout') -def logout(): - try: - del USERS[int(request.COOKIES.get('id'))] - except: - pass +class Handler(BaseHTTPRequestHandler): - redirect("/login") - -@route('/') -def home(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - dls = core.get_downloads() - - for dl in dls: - dl['eta'] = str(core.format_time(dl['eta'])) - dl['wait_until'] = str(core.format_time(dl['wait_until'] - time.time())) - - - return template('default', page='home', links=dls, user=username, status=core.server_status()) - -@route('/queue') -def queue(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='queue', links=core.get_links(), user=username, status=core.server_status()) - -@route('/downloads') -def downloads(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='downloads', links=core.get_downloads(), user=username, status=core.server_status()) - - -@route('/logs') -def logs(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='logs', links=core.get_downloads(), user=username, status=core.server_status()) - -@route('/json/links') -def get_links(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - json = '{ "downloads": [' - - downloads = core.get_downloads() - ids = [] - - for dl in downloads: - ids.append(dl['id']) - json += '{' - json += '"id": %s, "name": "%s", "speed": %s, "eta": "%s", "kbleft": %s, "size": %s, "percent": %s, "wait": "%s", "status": "%s"'\ - % (str(dl['id']), str(dl['name']), str(int(dl['speed'])), str(core.format_time(dl['eta'])), dl['kbleft'], dl['size'], dl['percent'], str(core.format_time(dl['wait_until'] - time.time())), dl['status']) - - json += "}," - - if json.endswith(","): json = json[:-1] - - json += '], "ids": %s }' % str(ids) - - return json - -@route('/json/status') -def get_status(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - data = core.server_status() - - if data['pause']: - status = "paused" - else: - status = "running" - - json = '{ "status": "%s", "speed": "%s", "queue": "%s" }' % (status, str(int(data['speed'])), str(data['queue'])) - - return json - -@route('/json/addlinks', method='POST') -def add_links(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - links = request.POST['links'].split('\n') - - core.add_links(links) - - return "{}" - -@route('/json/pause') -def pause(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - core.thread_list.pause = True - - return "{}" - - -@route('/json/play') -def play(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - core.thread_list.pause = False - - return "{}" - -@route('/favicon.ico') -def favicon(): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - - send_file('favicon.ico', root=(PATH + 'static/')) - -@route('static/:section/:filename') -def static_folder(section, filename): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - send_file(filename, root=(PATH + 'static/' + section)) - -@route('/static/:filename') -def static_file(filename): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - send_file(filename, root=(PATH + 'static/')) - - -def check_auth(req): - - try: - user = req.COOKIES.get('user') - id = int(req.COOKIES.get('id')) - ua = req.HEADER("HTTP_USER_AGENT") - ip = req.HEADER("REMOTE_ADDR") - - if USERS[id]['user'] == user and USERS[id]['ua'] == ua and USERS[id]['ip'] == ip: - return True - except: - return False - - return False - - -class WebServer(threading.Thread): - def __init__(self, pycore): - threading.Thread.__init__(self) - - global core, TIME - core = pycore - self.core = pycore - self.setDaemon(True) - - if pycore.config['general']['debug_mode']: - bottle.debug(True) - TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) + def do_GET(self): + global coreserver + stdout = sys.stdout + sys.stdout = self.wfile + if self.path == "/": + print "Server Runs" + elif self.path == "/downloads": + print self.get_downloads() + elif re.search("/add=.?", self.path): + if re.match(is_url, self.path.split("/add=")[1]): + coreserver.add_urls([self.path.split("/add=")[1]]) + print "Link Added" else: - bottle.debug(False) - - #@TODO remove - #TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) - - bottle.TEMPLATE_PATH.append('./module/web/templates/%s.tpl') - - def run(self): - self.core.logger.info("Starting Webinterface on %s port %s" % (self.core.config['webinterface']['listenaddr'],self.core.config['webinterface']['port'])) + try: + print open(self.path[1:], 'r').read() + except IOError: + self.send_error(404) + + def format_size(self, size): + return str(size / 1024) + " MiB" + + def format_time(self,seconds): + seconds = int(seconds) + hours, seconds = divmod(seconds, 3600) + minutes, seconds = divmod(seconds, 60) + return "%.2i:%.2i:%.2i" % (hours, minutes, seconds) + + def get_downloads(self): + data = coreserver.status_downloads() + for download in data: + print "<h3>%s</h3>" % download["name"] + if download["status"] == "downloading": + percent = download["percent"] + z = percent / 4 + print "<h3>%s</h3>" % dl_name + print "<font face='font-family:Fixedsys,Courier,monospace;'>[" + z * "#" + (25-z) * " " + "]</font>" + str(percent) + "%<br />" + print "Speed: " + str(int(download['speed'])) + " kb/s" + print "Size: " + self.format_size(download['size']) + print "Finished in: " + self.format_time(download['eta']) + print "ID: " + str(download['id']) + dl_status = "[" + z * "#" + (25-z) * " " + "] " + str(percent) + "%" + " Speed: " + str(int(download['speed'])) + " kb/s" + " Size: " + self.format_size(download['size']) + " Finished in: " + self.format_time(download['eta']) + " ID: " + str(download['id']) + if download["status"] == "waiting": + print "waiting: " + self.format_time(download["wait_until"]- time()) + +is_url = re.compile("^(((https?|ftp)\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$",re.IGNORECASE) + +coreserver = None + +class WebServer(): + + def start(self): try: - run(host=self.core.config['webinterface']['listenaddr'], port=int(self.core.config['webinterface']['port']), quiet=True) - except: - self.core.logger.error("Failed starting webserver, no webinterface available: Can't create socket") - exit() + global coreserver + coreserver = ServerProxy("https://testuser:testpw@localhost:1337", allow_none=True) + webserver = HTTPServer(('',8080),Handler) + print 'server started at port 8080' + webserver.serve_forever() + except KeyboardInterrupt: + webserver.socket.close() + +if __name__ == "__main__": + web = WebServer() + web.start() + diff --git a/module/web/main.html b/module/web/main.html new file mode 100644 index 000000000..87f0d7408 --- /dev/null +++ b/module/web/main.html @@ -0,0 +1,29 @@ +<title>pyLoad - Webinterface</title> +<?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> + <head> + <title>pyLoad - Webinterface</title> + <script src="main.js" type="text/javascript"></script> + </head> + <body> + <h1>pyLoad - Webinterface</h1> + <div name="status_server"> + Status: running Speed: 600kb/s Files in queue: 0 + </div> + <div name="actions"> + <div id="add_urls"> + <form name="add_urls_form"> + <input type="text" name="new_url" /> + <input type="button" value="Add Link" onclick="addUrl(document.add_urls_form.new_url.value)" > + </form> + </div> + (START) (PAUSE) (ADD) + </div> + <h2>Downloads</h2> + <div id="downloads"> + Lade Downloads + </div> + </body> +</html> + diff --git a/module/web/main.js b/module/web/main.js new file mode 100644 index 000000000..a286df991 --- /dev/null +++ b/module/web/main.js @@ -0,0 +1,42 @@ +function getXmlHttpRequestObject() { + if (window.XMLHttpRequest) { + return new XMLHttpRequest(); //Not IE + } else if(window.ActiveXObject) { + return new ActiveXObject("Microsoft.XMLHTTP"); //IE + } else { + alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox."); + } +} +var req = getXmlHttpRequestObject(); + +function getDownloads() { + req.onreadystatechange = function() { + if (req.readyState == 4) { + if(req.status==200) { + document.getElementById('downloads').innerHTML = req.responseText; + } else { + alert("Fehler:\nHTTP-Status: "+req.status+"\nHTTP-Statustext: "+req.statusText); + } + }; + } + req.open("GET", '/downloads', true); + req.send(null); +} + +function addUrl(new_url) { + req.onreadystatechange = function() { + if (req.readyState == 4) { + if(req.status==200) { + document.getElementById('add_urls').innerHTML = req.responseText; + } else { + alert("Fehler:\nHTTP-Status: "+req.status+"\nHTTP-Statustext: "+req.statusText); + } + }; + } + url = "/add=" + new_url + req.open("GET", url, true); + req.send(null); +} + +window.setInterval("getDownloads()", 1000); + -- cgit v1.2.3 From 523e2857c47cdef1da6b43523bcf7871ed9e1d63 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 26 Nov 2009 22:05:11 +0100 Subject: complete new file_list, cleaned up --- module/file_list.py | 379 ++++++++++++++++++++++++++-------------- module/remote/ClientHandler.py | 24 --- module/remote/ClientSocket.py | 63 ------- module/remote/RequestHandler.py | 64 ------- module/remote/RequestObject.py | 18 -- module/thread_list.py | 25 +-- 6 files changed, 257 insertions(+), 316 deletions(-) delete mode 100644 module/remote/ClientHandler.py delete mode 100644 module/remote/ClientSocket.py delete mode 100644 module/remote/RequestHandler.py delete mode 100644 module/remote/RequestObject.py (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 1701b801b..6e1984704 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -1,159 +1,274 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# -#Copyright (C) 2009 RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### -LIST_VERSION = 3 +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @author: RaNaN + @version: v0.3 + @list-version: v4 +""" + +LIST_VERSION = 4 from threading import RLock from download_thread import Status import cPickle import re -from module.remote.RequestObject import RequestObject import module.Plugin +class NoSuchElementException(Exception): + pass + class File_List(object): def __init__(self, core): self.core = core - self.files = [] - self.data = {'version': LIST_VERSION, 'order': []} self.lock = RLock() - self.load() - - def new_pyfile(self, url, folder): - url = url.replace("\n", "") - pyfile = PyLoadFile(self.core, url) - pyfile.download_folder = self.core.config['general']['download_folder'] - pyfile.id = self.get_id() - pyfile.folder = folder - - return pyfile - - def append(self, url, folder=""): - if not url: - return False - #@TODO: filter non existence and invalid links - #re.compile("https?://[-a-z0-9\.]{4,}(?::\d+)?/[^#?]+(?:#\S+)?",re.IGNORECASE) - new_file = self.new_pyfile(url, folder) - self.files.append(new_file) - self.data[new_file.id] = Data(url, folder) - self.data['order'].append(int(new_file.id)) - - def extend(self, urls): - for url in urls: - self.append(url) - - def remove(self, pyfile): - if not self.core.config['general']['debug_mode']: - if pyfile in self.files: - self.files.remove(pyfile) - - self.data['order'].remove(pyfile.id) - del self.data[pyfile.id] - - def remove_id(self, pyid): - #also abort download - pyid = int(pyid) - found = False - for pyfile in self.files: - if pyfile.id == pyid: - self.files.remove(pyfile) - found = True - break - - if not found: - for pyfile in self.core.thread_list.py_downloading: - if pyfile.id == pyid: - pyfile.plugin.req.abort = True - break - return False - - self.data['order'].remove(pyid) - del self.data[pyid] - - def get_id(self): - """return a free id""" - id = 1 - while id in self.data.keys(): - id += 1 - - return id - - def move(self, id, offset=-1): - - for pyfile in self.files: - if pyfile.id == id: - index = self.files.index(pyfile) - pyfile = self.files.pop(index) - self.files.insert(index + offset, pyfile) - break - - index = self.data['order'].index(id) - pyfile = self.data['order'].pop(index) - self.data['order'].insert(index + offset, pyfile) - - def save(self): - self.lock.acquire() - - output = open('links.pkl', 'wb') - cPickle.dump(self.data, output, -1) - - #self.inform_client() + self.download_folder = self.core.config['general']['download_folder'] + self.collector = self.pyLoadCollector(self) + self.packager = self.pyLoadPackager(self) + + self.data = { + "version": LIST_VERSION, + "queue": [], + "packages": [], + "collector": [] + } - self.lock.release() - def load(self): + self.lock.acquire() try: pkl_file = open('links.pkl', 'rb') obj = cPickle.load(pkl_file) except: - obj = {'version': LIST_VERSION, 'order': []} - - if obj['version'] < LIST_VERSION: - obj = {'version': LIST_VERSION, 'order': []} - - for i in obj['order']: - self.append(obj[i].url, obj[i].folder) - - self.core.logger.info("Links loaded: " + str(int(len(obj) - 2))) - - def inform_client(self): - obj = RequestObject() - obj.command = "file_list" - obj.data = self.data + obj = False + if obj['version'] == LIST_VERSION and obj: + self.data = obj + self.lock.release() + + if len(self.data["collector"]) > 0: + self.core.logger.info("Found %s links in linkcollector" % len(self.data["collector"])) + if len(self.data["packages"]) > 0: + self.core.logger.info("Found %s unqueued packages" % len(self.data["packages"])) + if len(self.data["queue"]) > 0: + self.core.logger.info("Added %s packages to queue" % len(self.data["queue"])) + + def save(self): + self.lock.acquire() - self.core.server.push_all(obj) + output = open('links.pkl', 'wb') + cPickle.dump(self.data, output, -1) + + self.lock.release() + + def queueEmpty(self): + return (self.data["queue"] == []) + + def getDownloadList(self): + """ + for thread_list only + """ + files = [] + for pypack in self.data["queue"]: + for pyfile in pypack.files: + if pyfile.status.type == "reconnected" or pyfile.status.type == None: + files.append(pyfile) + return files + + class pyLoadCollector(): + def __init__(collector, file_list): + collector.file_list = file_list + + def _getFileFromID(collector, id): + """ + returns PyLoadFile instance and position in collector with given id + """ + for n, pyfile in enumerate(collector.file_list.data["collector"]): + if pyfile.id == id: + return (n, pyfile) + raise NoSuchElementException() + + def _getFreeID(collector): + """ + returns a free id + """ + ids = [] + for pyfile in collector.file_list.data["collector"]: + ids.append(pyfile.id) + id = 1 + while id in ids: + id += 1 + return id + + def getFile(collector, id): + """ + returns PyLoadFile instance from given id + """ + return collector._getFileFromID(id)[1] + + def popFile(collector, id): + """ + returns PyLoadFile instance given id and remove it from the collector + """ + collector.file_list.lock.acquire() + try: + n, pyfile = collector._getFileFromID(id) + del collector.file_list.data["collector"][n] + collector.file_list.lock.release() + except: + collector.file_list.lock.release() + else: + return pyfile + + def addLink(collector, url): + """ + appends a new PyLoadFile instance to the end of the collector + """ + pyfile = PyLoadFile(url) + pyfile.id = collector._getFreeID() + pyfile.download_folder = collector.file_list.download_folder + collector.file_list.lock.acquire() + collector.file_list.data["collector"].append(pyfile) + collector.file_list.lock.release() + return pyfile.id + + def removeFile(collector, id): + """ + removes PyLoadFile instance with the given id from collector + """ + collector.popFile(id) + + def replaceFile(collector, newpyfile): + """ + replaces PyLoadFile instance with the given PyLoadFile instance at the given id + """ + collector.file_list.lock.acquire() + try: + n, pyfile = collector._getFileFromID(newpyfile.id) + collector.file_list.data["collector"][n] = newpyfile + finally: + collector.file_list.lock.release() + + class pyLoadPackager(): + def __init__(packager, file_list): + packager.file_list = file_list + + def _getFreeID(packager): + """ + returns a free id + """ + ids = [] + for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): + ids.append(pypack.id) + id = 1 + while id in ids: + id += 1 + return id + + def _getPackageFromID(packager, id): + """ + returns PyLoadPackage instance and position with given id + """ + for n, pypack in enumerate(packager.file_list.data["packages"]): + if pypack.id == id: + return ("packages", n, pypack) + for n, pypack in enumerate(packager.file_list.data["queue"]): + if pypack.id == id: + return ("queue", n, pypack) + raise NoSuchElementException() + + def addNewPackage(packager, package_name=None): + pypack = PyLoadPackage() + pypack.id = packager._getFreeID() + if package_name is not None: + pypack.data["package_name"] = package_name + packager.file_list.data["packages"].append(pypack) + return pypack.id + + def removePackage(packager, id): + packager.file_list.lock.acquire() + try: + key, n, pypack = packager._getPackageFromID(id) + del packager.file_list.data[key][n] + finally: + packager.file_list.lock.release() + + def pushPackage2Queue(packager, id): + packager.file_list.lock.acquire() + try: + key, n, pypack = packager._getPackageFromID(id) + if key == "packages": + del packager.file_list.data["packages"][n] + packager.file_list.data["queue"].append(pypack) + finally: + packager.file_list.lock.release() + + def pullOutPackage(packager, id): + packager.file_list.lock.acquire() + try: + key, n, pypack = packager._getPackageFromID(id) + if key == "queue": + del packager.file_list.data["queue"][n] + packager.file_list.data["packages"].append(pypack) + finally: + packager.file_list.lock.release() + + def setPackageData(packager, id, package_name=None, folder=None): + packager.file_list.lock.acquire() + try: + key, n, pypack = packager._getPackageFromID(id) + if package_name is not None: + pypack.data["package_name"] = package_name + if folder is not None: + pypack.data["folder"] = folder + packager.file_list.data[key][n] = pypack + finally: + packager.file_list.lock.release() + + def addFileToPackage(packager, id, pyfile): + key, n, pypack = packager._getPackageFromID(id) + pyfile.package = pypack + pypack.files.append(pyfile) + packager.file_list.data[key][n] = pypack + + def removeFileFromPackage(packager, id, pid): + key, n, pypack = packager._getPackageFromID(pid) + for k, pyfile in enumerate(pypack.files): + if id == pyfile.id: + del pypack.files[k] + return True + raise NoSuchElementException() -class Data(): - def __init__(self, url, folder=""): - self.url = url - self.folder = folder +class PyLoadPackage(): + def __init__(self): + self.files = [] + self.data = { + "id": None, + "package_name": "", + "folder": "" + } -class PyLoadFile: - """ represents the url or file - """ - def __init__(self, parent, url): - self.parent = parent +class PyLoadFile(): + def __init__(self, url): self.id = None self.url = url self.folder = None + self.package = None self.filename = "filename" self.download_folder = "" + self.active = False pluginName = self._get_my_plugin() if pluginName: self.modul = __import__(pluginName) @@ -163,18 +278,12 @@ class PyLoadFile: pluginClass = module.Plugin.Plugin self.plugin = pluginClass(self) self.status = Status(self) + def _get_my_plugin(self): - - """ searches the right plugin for an url - """ for plugin, plugin_pattern in self.parent.plugins_avaible.items(): if re.match(plugin_pattern, self.url) != None: return plugin def init_download(self): - if self.parent.config['proxy']['activated']: self.plugin.req.add_proxy(self.parent.config['proxy']['protocol'], self.parent.config['proxy']['adress']) - - #@TODO: check dependicies, ocr etc - diff --git a/module/remote/ClientHandler.py b/module/remote/ClientHandler.py deleted file mode 100644 index 9653db9ae..000000000 --- a/module/remote/ClientHandler.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -authored by: RaNaN - -this module handels the incoming requests - -""" -import hashlib - -from Crypto.Cipher import Blowfish -from RequestHandler import RequestHandler - -class ClientHandler(RequestHandler): - def __init__(self, client, pw): - self.client = client - key = hashlib.sha256(pw) - self.bf = Blowfish.new(key.hexdigest(), Blowfish.MODE_ECB) - - def proceed(self, data): - obj = self.decrypt(data) - - self.client.data_arrived(obj) \ No newline at end of file diff --git a/module/remote/ClientSocket.py b/module/remote/ClientSocket.py deleted file mode 100644 index 0e6a5ed53..000000000 --- a/module/remote/ClientSocket.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -authored by: RaNaN - -socket for connecting to the core's server - -""" -import asynchat -import asyncore -import socket -import threading - -from ClientHandler import ClientHandler -from RequestObject import RequestObject - -class SocketThread(threading.Thread): - def __init__(self, adress, port, pw, client): - threading.Thread.__init__(self) - self.setDaemon(True) - sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sock.connect((adress, port)) - self.socket = ClientSocket(sock, pw, client) - self.start() - - def run(self): - asyncore.loop() - print "loop closed" - - def push_exec(self, function, args=[]): - obj = RequestObject() - obj.command = "exec" - obj.function = function - obj.args = args - self.push(obj) - - def push(self, obj): - self.socket.push_obj(obj) - - -class ClientSocket(asynchat.async_chat): - def __init__(self, sock, pw, client): - asynchat.async_chat.__init__(self, sock) - self.data = "" - self.handler = ClientHandler(client, pw) - self.set_terminator("\n") - #self.create_socket(socket.AF_INET, socket.SOCK_STREAM) - - def handle_close(self): - print "Disconnected from", self.getpeername() - self.close() - - def collect_incoming_data(self, data): - self.data += data - - def found_terminator(self): - self.handler.proceed(self.data) - self.data = "" - - def push_obj(self, obj): - string = self.handler.encrypt(obj) - self.push(string) \ No newline at end of file diff --git a/module/remote/RequestHandler.py b/module/remote/RequestHandler.py deleted file mode 100644 index a879d2297..000000000 --- a/module/remote/RequestHandler.py +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -authored by: RaNaN - -this module handels the incoming requests - -""" - -import base64 -import hashlib -import random -import string - -import cPickle -from Crypto.Cipher import Blowfish -from RequestObject import RequestObject - - -class RequestHandler: - def __init__(self, core): - self.core = core - key = hashlib.sha256(core.config['remote']['password']) - self.bf = Blowfish.new(key.hexdigest(), Blowfish.MODE_ECB) - - def proceed(self, data): - obj = self.decrypt(data) - - if obj.command == "exec": - func = getattr(self.core, obj.function) - obj.data = func( * obj.args) - else: - obj.data = "error happend" - - return self.encrypt(obj) - - - def decrypt(self, dec_str): - try: - dec_str = base64.standard_b64decode(dec_str) - dec_str = self.bf.decrypt(dec_str) - - dec_str = dec_str[:-(int(dec_str[-1], 16) + 1)] - obj = cPickle.loads(dec_str) - except: - obj = RequestObject() - - return obj - - def encrypt(self, obj): - enc_str = cPickle.dumps(obj, 1) - padding = len(enc_str) % 16 - padding = 16 - padding - - p_str = "" - for i in range(padding - 1): - p_str += random.choice(string.letters + string.digits + string.punctuation) - p_str += hex(len(p_str)).replace("0x", "") - enc_str += p_str - - enc_str = self.bf.encrypt(enc_str) - enc_str = base64.standard_b64encode(enc_str) - return enc_str + "\n" diff --git a/module/remote/RequestObject.py b/module/remote/RequestObject.py deleted file mode 100644 index 54ea837a6..000000000 --- a/module/remote/RequestObject.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -""" -authored by: RaNaN - -represents the object for interaction - -""" -class RequestObject(object): - def __init__(self): - self.version = 0 - self.sender = "ip" - self.status = {} - self.command = None - self.function = "" - self.args = [] - self.data = None diff --git a/module/thread_list.py b/module/thread_list.py index da13afba6..aa50a654f 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -60,7 +60,7 @@ class Thread_List(object): def get_job(self): """return job if suitable, otherwise send thread idle""" - if not self.parent.is_time_download() or self.pause or self.reconnecting or not self.list.files: #conditions when threads dont download + if not self.parent.is_time_download() or self.pause or self.reconnecting or self.list.queueEmpty(): #conditions when threads dont download return None self.init_reconnect() @@ -68,15 +68,16 @@ class Thread_List(object): self.lock.acquire() pyfile = None - for i in range(len(self.list.files)): - if not self.list.files[i].modul.__name__ in self.occ_plugins: - pyfile = self.list.files.pop(i) + for f in self.list.getDownloadList(): + if not f.modul.__name__ in self.occ_plugins: + pyfile = f break if pyfile: self.py_downloading.append(pyfile) if not pyfile.plugin.multi_dl: self.occ_plugins.append(pyfile.modul.__name__) + pyfile.active = True self.parent.logger.info('Download starts: ' + pyfile.url) self.lock.release() @@ -89,6 +90,8 @@ class Thread_List(object): if not pyfile.plugin.multi_dl: self.occ_plugins.remove(pyfile.modul.__name__) + + pyfile.active = False if pyfile.plugin.req.curl and not pyfile.status == "reconnected": try: @@ -101,25 +104,23 @@ class Thread_List(object): if pyfile.status.type == "finished": self.parent.logger.info('Download finished: ' + pyfile.url + ' @' + str(pyfile.status.get_speed()) + 'kb/s') - self.list.remove(pyfile) - if pyfile.plugin.props['type'] == "container": - self.list.extend(pyfile.plugin.links) - + self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.id) + for link in pyfile.plugin.links: + id = self.list.collector.addLink(link) + pyfile.packager.pullOutPackage(pyfile.package.id) + pyfile.packager.addFileToPackage(pyfile.package.id, pyfile.collector.popFile(id)) - elif pyfile.status.type == "reconnected":#put it back in queque + elif pyfile.status.type == "reconnected": pyfile.plugin.req.init_curl() - self.list.files.insert(0, pyfile) elif pyfile.status.type == "failed": self.parent.logger.warning("Download failed: " + pyfile.url+ " | " + pyfile.status.error) with open(self.parent.config['general']['failed_file'], 'a') as f: f.write(pyfile.url + "\n") - self.list.remove(pyfile) elif pyfile.status.type == "aborted": self.parent.logger.info("Download aborted: " + pyfile.url) - self.list.remove(pyfile) self.list.save() -- cgit v1.2.3 From 80cd07afb67746a0279d6f194102e0d52bdbba29 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Fri, 27 Nov 2009 16:55:55 +0100 Subject: fixed file_list --- module/file_list.py | 124 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 113 insertions(+), 11 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 6e1984704..f3bfc0b8a 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -28,6 +28,7 @@ from download_thread import Status import cPickle import re import module.Plugin +import traceback class NoSuchElementException(Exception): pass @@ -46,6 +47,7 @@ class File_List(object): "packages": [], "collector": [] } + self.load() def load(self): self.lock.acquire() @@ -54,7 +56,26 @@ class File_List(object): obj = cPickle.load(pkl_file) except: obj = False - if obj['version'] == LIST_VERSION and obj: + traceback.print_exc() + if obj['version'] == LIST_VERSION and obj != False: + packages = [] + queue = [] + collector = [] + for n, pd in enumerate(obj["packages"]): + p = PyLoadPackage() + pd.get(p) + packages.append(p) + for pd in obj["queue"]: + p = PyLoadPackage() + pd.get(p) + queue.append(p) + for fd in obj["collector"]: + f = PyLoadFile("", self) + fd.get(f) + collector.append(f) + obj["packages"] = packages + obj["queue"] = queue + obj["collector"] = collector self.data = obj self.lock.release() @@ -67,9 +88,34 @@ class File_List(object): def save(self): self.lock.acquire() - + + pdata = { + "version": LIST_VERSION, + "queue": [], + "packages": [], + "collector": [] + } + packages = [] + queue = [] + collector = [] + for p in self.data["packages"]: + pd = PyLoadPackageData() + pd.set(p) + packages.append(pd) + for p in self.data["queue"]: + pd = PyLoadPackageData() + pd.set(p) + queue.append(pd) + for f in self.data["collector"]: + fd = PyLoadFileData() + fd.set(f) + collector.append(fd) + pdata["packages"] = packages + pdata["queue"] = queue + pdata["collector"] = collector + output = open('links.pkl', 'wb') - cPickle.dump(self.data, output, -1) + cPickle.dump(pdata, output, -1) self.lock.release() @@ -83,7 +129,7 @@ class File_List(object): files = [] for pypack in self.data["queue"]: for pyfile in pypack.files: - if pyfile.status.type == "reconnected" or pyfile.status.type == None: + if (pyfile.status.type == "reconnected" or pyfile.status.type == None) and not pyfile.active: files.append(pyfile) return files @@ -136,7 +182,7 @@ class File_List(object): """ appends a new PyLoadFile instance to the end of the collector """ - pyfile = PyLoadFile(url) + pyfile = PyLoadFile(url, collector.file_list) pyfile.id = collector._getFreeID() pyfile.download_folder = collector.file_list.download_folder collector.file_list.lock.acquire() @@ -256,15 +302,17 @@ class PyLoadPackage(): self.files = [] self.data = { "id": None, - "package_name": "", - "folder": "" + "package_name": "new_package", + "folder": None } class PyLoadFile(): - def __init__(self, url): + def __init__(self, url, file_list): self.id = None self.url = url self.folder = None + self.file_list = file_list + self.core = file_list.core self.package = None self.filename = "filename" self.download_folder = "" @@ -280,10 +328,64 @@ class PyLoadFile(): self.status = Status(self) def _get_my_plugin(self): - for plugin, plugin_pattern in self.parent.plugins_avaible.items(): + for plugin, plugin_pattern in self.core.plugins_avaible.items(): if re.match(plugin_pattern, self.url) != None: return plugin def init_download(self): - if self.parent.config['proxy']['activated']: - self.plugin.req.add_proxy(self.parent.config['proxy']['protocol'], self.parent.config['proxy']['adress']) + if self.core.config['proxy']['activated']: + self.plugin.req.add_proxy(self.core.config['proxy']['protocol'], self.core.config['proxy']['adress']) + +class PyLoadFileData(): + def __init__(self): + self.id = None + self.url = None + self.folder = None + self.pack_id = None + self.filename = None + self.status_type = None + self.status_url = None + + def set(self, pyfile): + self.id = pyfile.id + self.url = pyfile.url + self.folder = pyfile.folder + self.parsePackage(pyfile.package) + self.filename = pyfile.filename + self.status_type = pyfile.status.type + self.status_url = pyfile.status.url + self.status_filename = pyfile.status.filename + self.status_error = pyfile.status.error + + def get(self, pyfile): + pyfile.id = self.id + pyfile.url = self.url + pyfile.folder = self.folder + pyfile.filename = self.filename + pyfile.status.type = self.status_type + pyfile.status.url = self.status_url + pyfile.status.filename = self.status_filename + pyfile.status.error = self.status_error + + def parsePackage(self, pack): + if pack: + self.pack_id = pack.id + +class PyLoadPackageData(): + def __init__(self): + self.data = None + self.links = [] + + def set(self, pypack): + self.data = pypack.data + for pyfile in pypack.links: + fdata = PyLoadFileData() + fdata.set(pyfile) + self.links.append(fdata) + + def get(self, pypack): + for fdata in self.links: + pyfile = PyLoadFile() + fdata.get(pyfile) + pyfile.package = pypack + pypack.links.append(pyfile) -- cgit v1.2.3 From 7fb23f31ac129442f35d2d98a5ef3f0b387dc8e2 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Fri, 27 Nov 2009 23:51:44 +0100 Subject: updated xmlrpc methods --- module/file_list.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index f3bfc0b8a..1bcfb8580 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -151,6 +151,9 @@ class File_List(object): returns a free id """ ids = [] + for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): + for pyf in pypack.links: + ids.append(pyf.id) for pyfile in collector.file_list.data["collector"]: ids.append(pyfile.id) id = 1 @@ -235,6 +238,20 @@ class File_List(object): return ("queue", n, pypack) raise NoSuchElementException() + def _getFileFromID(packager, id): + """ + returns PyLoadFile instance and position with given id + """ + for n, pypack in enumerate(packager.file_list.data["packages"]): + for pyfile in pypack.files: + if pyfile.id == id: + return ("packages", n, pyfile, pypack, pid) + for n, pypack in enumerate(packager.file_list.data["queue"]): + for pyfile in pypack.files: + if pyfile.id == id: + return ("queue", n, pyfile, pypack, pid) + raise NoSuchElementException() + def addNewPackage(packager, package_name=None): pypack = PyLoadPackage() pypack.id = packager._getFreeID() @@ -251,6 +268,17 @@ class File_List(object): finally: packager.file_list.lock.release() + def removeFile(packager, id): + """ + removes PyLoadFile instance with the given id from package + """ + packager.file_list.lock.acquire() + try: + key, n, pyfile, pypack, pid = self._getFileFromID() + del pypack.files[n] + finally: + packager.file_list.lock.release() + def pushPackage2Queue(packager, id): packager.file_list.lock.acquire() try: -- cgit v1.2.3 From 54b787dd2a35b51952fdcb26df51cb18a0c97060 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 28 Nov 2009 14:17:28 +0100 Subject: cleaned and fixed --- module/file_list.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 1bcfb8580..7b886cc2c 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -28,7 +28,6 @@ from download_thread import Status import cPickle import re import module.Plugin -import traceback class NoSuchElementException(Exception): pass @@ -56,8 +55,7 @@ class File_List(object): obj = cPickle.load(pkl_file) except: obj = False - traceback.print_exc() - if obj['version'] == LIST_VERSION and obj != False: + if obj != False and obj['version'] == LIST_VERSION: packages = [] queue = [] collector = [] @@ -151,7 +149,7 @@ class File_List(object): returns a free id """ ids = [] - for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): + for pypack in (collector.file_list.data["packages"] + collector.file_list.data["queue"]): for pyf in pypack.links: ids.append(pyf.id) for pyfile in collector.file_list.data["collector"]: -- cgit v1.2.3 From 8effa6e3712a11104835aa031242b39a29f291a0 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 29 Nov 2009 15:18:18 +0100 Subject: links.pkl now in module, nicer terminal kill --- module/file_list.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 7b886cc2c..c95eefcec 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -28,6 +28,7 @@ from download_thread import Status import cPickle import re import module.Plugin +from os import sep class NoSuchElementException(Exception): pass @@ -51,7 +52,7 @@ class File_List(object): def load(self): self.lock.acquire() try: - pkl_file = open('links.pkl', 'rb') + pkl_file = open('module' + sep + 'links.pkl', 'rb') obj = cPickle.load(pkl_file) except: obj = False @@ -112,7 +113,7 @@ class File_List(object): pdata["queue"] = queue pdata["collector"] = collector - output = open('links.pkl', 'wb') + output = open('module' + sep + 'links.pkl', 'wb') cPickle.dump(pdata, output, -1) self.lock.release() -- cgit v1.2.3 From f7563727e1ccb8d764904806cb9e262ba555f824 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Mon, 30 Nov 2009 15:18:04 +0100 Subject: Cleaned XMLRPC in Core --- module/network/Request.py | 4 +- module/plugins/FreakshareNet.py | 144 ++++++++++++++++++++++++++++++++++++++++ module/thread_list.py | 2 +- 3 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 module/plugins/FreakshareNet.py (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index 9f27af4ec..b80ea44da 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -51,7 +51,7 @@ class Request: self.lastURL = None self.auth = False - self.timeout = 5*3600 + self.timeout = 5 try: if pycurl: self.curl = True @@ -94,7 +94,7 @@ class Request: self.pycurl = pycurl.Curl() self.pycurl.setopt(pycurl.FOLLOWLOCATION, 1) self.pycurl.setopt(pycurl.MAXREDIRS, 5) - self.pycurl.setopt(pycurl.TIMEOUT, self.timeout) + self.pycurl.setopt(pycurl.TIMEOUT, (self.timeout*3600)) self.pycurl.setopt(pycurl.CONNECTTIMEOUT, 30) self.pycurl.setopt(pycurl.NOSIGNAL, 1) self.pycurl.setopt(pycurl.NOPROGRESS, 0) diff --git a/module/plugins/FreakshareNet.py b/module/plugins/FreakshareNet.py new file mode 100644 index 000000000..0768b5476 --- /dev/null +++ b/module/plugins/FreakshareNet.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +import httplib +from module.Plugin import Plugin +from time import time + + +class FreakshareNet(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FreakshareNet" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?freakshare\.net/files/\S*?/" + props['version'] = "0.1" + props['description'] = """Freakshare.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.req_opts = list() + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + self.get_waiting_time() + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + thread.wait(self.parent) + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.req_opts = self.get_download_options() # get the Post options for the Request + file_url = self.parent.url + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center\;\">(.*?)<\/h1>", self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) + if timestring: + sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off + else: + sec = 0 + self.time_plus_wait = time() + sec + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: + return False + else: + return True + + def get_download_options(self): + re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", self.html).group(0) #get the whole request + to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) + request_options = list() + for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them + request_options.append((item[1], item[0])) + herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page + to_sort = None + to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) + request_options = list() + for item in to_sort: #Same as above + request_options.append((item[1], item[0])) + return request_options + + def proceed(self, url, location): + """ + request.download doesn't handle the 302 redirect correctly + that's why the data are posted "manually" via httplib + and the redirect-url is read from the header. + Important: The cookies may not be posted to the download-url + otherwise the downloaded file only contains "bad try" + Need to come up with a better idea to handle the redirect, + help is appreciated. + """ + temp_options = urllib.urlencode(self.req_opts) + temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name + temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot + cookie_list = "" + for temp_cookie in self.req.cookies: #prepare cookies + cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" + temp_headers = [ #create the additional header fields + ["Content-type", "application/x-www-form-urlencoded"], #this is very important + ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], + ["Accept-Encoding", "deflate"], + ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], + ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], + ["Connection", "keep-alive"], + ["Keep-Alive", "300"], + ["Referer", self.req.lastURL], + ["Cookie", cookie_list]] + temp_conn = httplib.HTTPConnection(temp_url) + temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) + temp_response = temp_conn.getresponse() + new_url = temp_response.getheader("Location") # we need the Location-header + temp_conn.close + self.req.download(new_url, location, None, None, cookies=False) diff --git a/module/thread_list.py b/module/thread_list.py index aa50a654f..fc886e4b4 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -60,7 +60,7 @@ class Thread_List(object): def get_job(self): """return job if suitable, otherwise send thread idle""" - if not self.parent.is_time_download() or self.pause or self.reconnecting or self.list.queueEmpty(): #conditions when threads dont download + if not self.parent.server_methods.is_time_download() or self.pause or self.reconnecting or self.list.queueEmpty(): #conditions when threads dont download return None self.init_reconnect() -- cgit v1.2.3 From f3c2e597ebb63094c43ec39acb67a23a1cc2c141 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 30 Nov 2009 17:47:42 +0100 Subject: added xmlrpc auth without ssl --- module/remote/SecureXMLRPCServer.py | 186 ++++++++++++++++++++---------------- 1 file changed, 105 insertions(+), 81 deletions(-) (limited to 'module') diff --git a/module/remote/SecureXMLRPCServer.py b/module/remote/SecureXMLRPCServer.py index 158e44863..9dacd7b26 100644 --- a/module/remote/SecureXMLRPCServer.py +++ b/module/remote/SecureXMLRPCServer.py @@ -2,12 +2,12 @@ # which seems to be based on http://www.sabren.net/code/python/SecureXMLRPCServer.py # # Changes: -# 2007-01-06 Christian Hoffmann <ch@hoffie.info> -# * Bugfix: replaced getattr by hasattr in the conditional -# (lead to an error otherwise) -# * SecureXMLRPCServer: added self.instance = None, otherwise a "wrong" -# exception is raised when calling unknown methods via xmlrpc -# * Added HTTP Basic authentication support +# 2007-01-06 Christian Hoffmann <ch@hoffie.info> +# * Bugfix: replaced getattr by hasattr in the conditional +# (lead to an error otherwise) +# * SecureXMLRPCServer: added self.instance = None, otherwise a "wrong" +# exception is raised when calling unknown methods via xmlrpc +# * Added HTTP Basic authentication support # # Modified for the Sceradon project # @@ -21,86 +21,110 @@ import SocketServer import socket import base64 + +class SecureSocketConnection: + def __init__(self, connection): + self.__dict__["connection"] = connection + + def __getattr__(self, name): + return getattr(self.__dict__["connection"], name) + + def __setattr__(self, name, value): + setattr(self.__dict__["connection"], name, value) + + def shutdown(self, how=1): + self.__dict__["connection"].shutdown() + + def accept(self): + connection, address = self.__dict__["connection"].accept() + return (SecureSocketConnection(connection), address) + class SecureSocketServer(SocketServer.TCPServer, SocketServer.ThreadingMixIn): - def __init__(self, addr, cert, key, requestHandler, verify_cert_func=None): - SocketServer.TCPServer.__init__(self, addr, requestHandler) - ctx = SSL.Context(SSL.SSLv23_METHOD) - if not verify_cert_func and hasattr(self, 'verify_client_cert'): - verify_cert_func = getattr(self, 'verify_client_cert') - if verify_cert_func: - ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify_cert_func) - ctx.use_privatekey_file(key) - ctx.use_certificate_file(cert) - - tmpConnection = SSL.Connection(ctx, socket.socket(socket.AF_INET, socket.SOCK_STREAM)) - self.socket = SecureSocketConnection(tmpConnection) - - self.server_bind() - self.server_activate() + def __init__(self, addr, cert, key, requestHandler, verify_cert_func=None): + SocketServer.TCPServer.__init__(self, addr, requestHandler) + ctx = SSL.Context(SSL.SSLv23_METHOD) + if not verify_cert_func and hasattr(self, 'verify_client_cert'): + verify_cert_func = getattr(self, 'verify_client_cert') + if verify_cert_func: + ctx.set_verify(SSL.VERIFY_PEER|SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verify_cert_func) + ctx.use_privatekey_file(key) + ctx.use_certificate_file(cert) + + tmpConnection = SSL.Connection(ctx, socket.socket(socket.AF_INET, socket.SOCK_STREAM)) + self.socket = SecureSocketConnection(tmpConnection) + + self.server_bind() + self.server_activate() - def finish_request(self, request, client_address): - """Finish one request by instantiating RequestHandlerClass.""" - self.RequestHandlerClass(request, client_address, self) + def finish_request(self, request, client_address): + """Finish one request by instantiating RequestHandlerClass.""" + self.RequestHandlerClass(request, client_address, self) + +####################################### +########### Request Handler ########### +####################################### +class AuthXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): + def __init__(self, request, client_address, server): + self.authMap = server.getAuthenticationMap() + SimpleXMLRPCRequestHandler.__init__(self, request, client_address, server) + + def setup(self): + self.connection = self.request + self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) + self.wfile = socket._fileobject(self.request, "wb", self.wbufsize) + + def do_POST(self): + # authentication + if self.authMap != None: # explicit None! + if self.headers.has_key('authorization') and self.headers['authorization'].startswith('Basic '): + authenticationString = base64.b64decode(self.headers['authorization'].split(' ')[1]) + if authenticationString.find(':') != -1: + username, password = authenticationString.split(':', 1) + if self.authMap.has_key(username) and self.verifyPassword(username, password): + return SimpleXMLRPCRequestHandler.do_POST(self) + self.send_response(401) + self.end_headers() + return False + return SimpleXMLRPCRequestHandler.do_POST(self) + + def verifyPassword(self, username, givenPassword): + return self.authMap[username] == givenPassword -class SecureXMLRPCRequestHandler(SimpleXMLRPCRequestHandler): - def __init__(self, request, client_address, server, client_digest=None): - self.authMap = server.getAuthenticationMap() - SimpleXMLRPCRequestHandler.__init__(self, request, client_address, server) - self.client_digest = client_digest - - def setup(self): - self.connection = self.request - self.rfile = socket._fileobject(self.request, "rb", self.rbufsize) - self.wfile = socket._fileobject(self.request, "wb", self.wbufsize) - - def do_POST(self): - # authentication - if self.authMap != None: # explicit None! - if self.headers.has_key('authorization') and self.headers['authorization'].startswith('Basic '): - authenticationString = base64.b64decode(self.headers['authorization'].split(' ')[1]) - if authenticationString.find(':') != -1: - username, password = authenticationString.split(':', 1) - if self.authMap.has_key(username) and self.verifyPassword(username, password): - return SimpleXMLRPCRequestHandler.do_POST(self) - self.send_response(401) - self.end_headers() - return False - return SimpleXMLRPCRequestHandler.do_POST(self) - - def verifyPassword(self, username, givenPassword): - return self.authMap[username] == givenPassword +class SecureXMLRPCRequestHandler(AuthXMLRPCRequestHandler): + def __init__(self, request, client_address, server, client_digest=None): + self.authMap = server.getAuthenticationMap() + SimpleXMLRPCRequestHandler.__init__(self, request, client_address, server) + self.client_digest = client_digest -class SecureXMLRPCServer(SecureSocketServer, SimpleXMLRPCServer): - def __init__(self, address, cert, key, authenticationMap = None, handler=SecureXMLRPCRequestHandler, verify_cert_func=None): - self.logRequests = False - self._send_traceback_header = False - self.encoding = "utf-8" - self.allow_none = True - SecureSocketServer.__init__(self, address, cert, key, handler, verify_cert_func) - # This comes from SimpleXMLRPCServer.__init__()->SimpleXMLRPCDispatcher.__init__() - self.funcs = {} - self.instance = None - self.authenticationMap = authenticationMap - - def getAuthenticationMap(self): - return self.authenticationMap +##################################### +########### XMLRPC Server ########### +##################################### +class AuthXMLRPCServer(SimpleXMLRPCServer): + def __init__(self, address, authenticationMap = None, handler=AuthXMLRPCRequestHandler): + SimpleXMLRPCServer.__init__(self, address, requestHandler=handler) + self.logRequests = False + self._send_traceback_header = False + self.encoding = "utf-8" + self.allow_none = True + self.authenticationMap = authenticationMap + + def getAuthenticationMap(self): + return self.authenticationMap -class SecureSocketConnection: - def __init__(self, connection): - self.__dict__["connection"] = connection - - def __getattr__(self, name): - return getattr(self.__dict__["connection"], name) - - def __setattr__(self, name, value): - setattr(self.__dict__["connection"], name, value) - - def shutdown(self, how=1): - self.__dict__["connection"].shutdown() - - def accept(self): - connection, address = self.__dict__["connection"].accept() - return (SecureSocketConnection(connection), address) +class SecureXMLRPCServer(AuthXMLRPCServer, SecureSocketServer): + def __init__(self, address, cert, key, authenticationMap = None, handler=SecureXMLRPCRequestHandler, verify_cert_func=None): + self.logRequests = False + self._send_traceback_header = False + self.encoding = "utf-8" + self.allow_none = True + SecureSocketServer.__init__(self, address, cert, key, handler, verify_cert_func) + # This comes from SimpleXMLRPCServer.__init__()->SimpleXMLRPCDispatcher.__init__() + self.funcs = {} + self.instance = None + self.authenticationMap = authenticationMap + + def getAuthenticationMap(self): + return self.authenticationMap -- cgit v1.2.3 From 0511d85691e8cf1c0c70045cf23e8abc6fc7cf40 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 30 Nov 2009 19:24:07 +0100 Subject: WIP: package system for cli --- module/file_list.py | 52 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index c95eefcec..1b9526eb8 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -132,6 +132,22 @@ class File_List(object): files.append(pyfile) return files + def getFileInfo(self, id): + try: + n, pyfile = self.collector._getFileFromID(id) + except NoSuchElementException: + key, n, pyfile, pypack, pid = self.packager._getFileFromID() + info = {} + info["id"] = pyfile.id + info["url"] = pyfile.url + info["folder"] = pyfile.folder + info["filename"] = pyfile.filename + info["status_type"] = pyfile.status.type + info["status_url"] = pyfile.status.url + info["status_filename"] = pyfile.status.filename + info["status_error"] = pyfile.status.error + return info + class pyLoadCollector(): def __init__(collector, file_list): collector.file_list = file_list @@ -151,7 +167,7 @@ class File_List(object): """ ids = [] for pypack in (collector.file_list.data["packages"] + collector.file_list.data["queue"]): - for pyf in pypack.links: + for pyf in pypack.files: ids.append(pyf.id) for pyfile in collector.file_list.data["collector"]: ids.append(pyfile.id) @@ -219,7 +235,7 @@ class File_List(object): """ ids = [] for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): - ids.append(pypack.id) + ids.append(pypack.data["id"]) id = 1 while id in ids: id += 1 @@ -230,10 +246,10 @@ class File_List(object): returns PyLoadPackage instance and position with given id """ for n, pypack in enumerate(packager.file_list.data["packages"]): - if pypack.id == id: + if pypack.data["id"] == id: return ("packages", n, pypack) for n, pypack in enumerate(packager.file_list.data["queue"]): - if pypack.id == id: + if pypack.data["id"] == id: return ("queue", n, pypack) raise NoSuchElementException() @@ -253,11 +269,11 @@ class File_List(object): def addNewPackage(packager, package_name=None): pypack = PyLoadPackage() - pypack.id = packager._getFreeID() + pypack.data["id"] = packager._getFreeID() if package_name is not None: pypack.data["package_name"] = package_name packager.file_list.data["packages"].append(pypack) - return pypack.id + return pypack.data["id"] def removePackage(packager, id): packager.file_list.lock.acquire() @@ -310,6 +326,17 @@ class File_List(object): finally: packager.file_list.lock.release() + def getPackageData(packager, id): + key, n, pypack = packager._getPackageFromID(id) + return pypack.data + + def getPackageFiles(packager, id): + key, n, pypack = packager._getPackageFromID(id) + ids = [] + for pyfile in pypack: + ids.append(pyfile.id) + return ids + def addFileToPackage(packager, id, pyfile): key, n, pypack = packager._getPackageFromID(id) pyfile.package = pypack @@ -396,23 +423,24 @@ class PyLoadFileData(): def parsePackage(self, pack): if pack: - self.pack_id = pack.id + self.pack_id = pack.data["id"] class PyLoadPackageData(): def __init__(self): self.data = None - self.links = [] + self.files = [] def set(self, pypack): self.data = pypack.data - for pyfile in pypack.links: + for pyfile in pypack.files: fdata = PyLoadFileData() fdata.set(pyfile) - self.links.append(fdata) + self.files.append(fdata) def get(self, pypack): - for fdata in self.links: + pypack.data = self.data + for fdata in self.files: pyfile = PyLoadFile() fdata.get(pyfile) pyfile.package = pypack - pypack.links.append(pyfile) + pypack.files.append(pyfile) -- cgit v1.2.3 From 7caec14b0a307df9f2bd9ea6a9db6977a836145b Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 30 Nov 2009 21:25:33 +0100 Subject: WIP: package system second draft - unstable --- module/file_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 1b9526eb8..585c58ddf 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -333,7 +333,7 @@ class File_List(object): def getPackageFiles(packager, id): key, n, pypack = packager._getPackageFromID(id) ids = [] - for pyfile in pypack: + for pyfile in pypack.files: ids.append(pyfile.id) return ids -- cgit v1.2.3 From b3c1f830aaba0c22de22693e6b8cd81fe392f21a Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 30 Nov 2009 22:00:04 +0100 Subject: fixed file_list --- module/file_list.py | 8 ++++---- module/plugins/RapidshareCom.py | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 585c58ddf..f66567e0f 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -62,11 +62,11 @@ class File_List(object): collector = [] for n, pd in enumerate(obj["packages"]): p = PyLoadPackage() - pd.get(p) + pd.get(p, self) packages.append(p) for pd in obj["queue"]: p = PyLoadPackage() - pd.get(p) + pd.get(p, self) queue.append(p) for fd in obj["collector"]: f = PyLoadFile("", self) @@ -437,10 +437,10 @@ class PyLoadPackageData(): fdata.set(pyfile) self.files.append(fdata) - def get(self, pypack): + def get(self, pypack, fl): pypack.data = self.data for fdata in self.files: - pyfile = PyLoadFile() + pyfile = PyLoadFile(fdata.url, fl) fdata.get(pyfile) pyfile.package = pypack pypack.files.append(pyfile) diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 275fa761c..29e9a7c1f 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -6,6 +6,7 @@ from time import time from module.Plugin import Plugin import hashlib +import logging class RapidshareCom(Plugin): @@ -26,6 +27,7 @@ class RapidshareCom(Plugin): self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False self.no_slots = True + self.logger = logging.getLogger("log") self.read_config() if self.config['premium']: self.multi_dl = True @@ -141,7 +143,7 @@ class RapidshareCom(Plugin): except: if re.search(r"(Currently a lot of users|There are no more download slots)", self.html[1], re.I) != None: self.time_plus_wait = time() + 130 - self.parent.parent.logger.info("Rapidshare: No free slots!") + self.logger.info("Rapidshare: No free slots!") self.no_slots = True return True self.no_slots = False -- cgit v1.2.3 From dcf9df576d0e30e016bb6ecb9fb67decc04d2761 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Mon, 30 Nov 2009 23:31:37 +0100 Subject: Fixed EOL Errors, beautified js --- module/web/static/default/home.js | 95 ++++++++++++++++++--------------------- 1 file changed, 44 insertions(+), 51 deletions(-) (limited to 'module') diff --git a/module/web/static/default/home.js b/module/web/static/default/home.js index 0d74aa17a..025dcfcc7 100644 --- a/module/web/static/default/home.js +++ b/module/web/static/default/home.js @@ -6,12 +6,12 @@ var dwProgressBar = new Class({ //options options: { container: $$('body')[0], - boxID:'', - percentageID:'', - displayID:'', + boxID: '', + percentageID: '', + displayID: '', startPercentage: 0, displayText: false, - speed:10 + speed: 10 }, //initialization @@ -25,20 +25,20 @@ var dwProgressBar = new Class({ //creates the box and percentage elements createElements: function() { var box = new Element('div', { - id:this.options.boxID + this.options.id, - 'class' : this.options.boxID + id: this.options.boxID + this.options.id, + 'class': this.options.boxID }); var perc = new Element('div', { - id:this.options.percentageID + this.options.id, - 'style':'width:0px;', - 'class' : this.options.percentageID + id: this.options.percentageID + this.options.id, + 'style': 'width:0px;', + 'class': this.options.percentageID }); perc.inject(box); box.inject(this.options.container); - if(this.options.displayText) { + if (this.options.displayText) { var text = new Element('div', { - id:this.options.displayID + this.options.id, - 'class' : this.options.displayID + id: this.options.displayID + this.options.id, + 'class': this.options.displayID }); text.inject(this.options.container); } @@ -47,19 +47,19 @@ var dwProgressBar = new Class({ //calculates width in pixels from percentage calculate: function(percentage) { - return (document.id(this.options.boxID+ this.options.id).getStyle('width').replace('px','') * (percentage / 100)).toInt(); + return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); }, //animates the change in percentage animate: function(to) { - document.id(this.options.percentageID+ this.options.id).set('morph', { + document.id(this.options.percentageID + this.options.id).set('morph', { duration: this.options.speed, - link:'cancel' + link: 'cancel' }).morph({ - width:this.calculate(to.toInt()) + width: this.calculate(to.toInt()) }); - if(this.options.displayText) { - document.id(this.options.displayID+ this.options.id).set('text', to.toInt() + '%'); + if (this.options.displayText) { + document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); } }, @@ -70,7 +70,6 @@ var dwProgressBar = new Class({ }); - req = new Request.JSON({ onSuccess: renderTable, method: 'get', @@ -80,48 +79,46 @@ req = new Request.JSON({ limit: 20000 }); - var dls = [] var pbs = [] -function renderTable(data){ +function renderTable(data) { - data.downloads.each(function(dl){ + data.downloads.each(function(dl) { - if (dls.contains(dl.id)){ + if (dls.contains(dl.id)) { - var div = $('dl'+dl.id) + var div = $('dl' + dl.id) pbs[dl.id].set(dl.percent) div.getChildren("b")[0].textContent = dl.name - if (dl.status == "downloading"){ + if (dl.status == "downloading") { - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - speed = Math.round(dl.speed) + " kb/s" - eta = dl.eta - + size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; + speed = Math.round(dl.speed) + " kb/s"; + eta = dl.eta; - }else if (dl.status == "waiting"){ + } else if (dl.status == "waiting") { - size = "waiting "+ dl.wait - speed = "" - eta = "" + size = "waiting " + dl.wait; + speed = ""; + eta = ""; } - div.getChildren(".dlsize")[0].textContent = size - div.getChildren(".dlspeed")[0].textContent = speed - div.getChildren(".dltime")[0].textContent = eta + div.getChildren(".dlsize")[0].textContent = size; + div.getChildren(".dlspeed")[0].textContent = speed; + div.getChildren(".dltime")[0].textContent = eta; - }else{ + } else { dls.push(dl.id) container = $("dlcontainer") dldiv = new Element('div', { - 'id' : 'dl'+dl.id, + 'id': 'dl' + dl.id, 'class': 'download', 'styles': { 'display': 'None' @@ -158,28 +155,27 @@ function renderTable(data){ 'class': 'dlspeed', 'html': Math.round(dl.speed) + " kb/s" }).inject(dldiv) - + new Element('div', { 'class': 'dltime', 'html': dl.eta }).inject(dldiv) //dldiv.dissolve({duration : 0}) - dldiv.reveal() } }) - dls.each(function(id, index){ + dls.each(function(id, index) { - if (data.ids.contains(id)){ + if (data.ids.contains(id)) { - }else{ +} else { //$("dl"+id).reveal() - dls.erase(id) - $('dl'+id).nix() + dls.erase(id); + $('dl' + id).nix() } @@ -187,7 +183,8 @@ function renderTable(data){ } -window.addEvent('domready', function(){ +window.addEvent('domready', +function() { /* //create the progress bar for example 1 @@ -205,8 +202,4 @@ pb = new dwProgressBar({ req.startTimer(); - -}); - - - +}); \ No newline at end of file -- cgit v1.2.3 From 9ecbb58e7ea06cb604745e25627e2fb4709fa442 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 2 Dec 2009 15:37:25 +0100 Subject: New Update Function, pycurl able to just load headers, little fixes --- module/Unzip.py | 50 +++++++++++++++++++++++++++++++++++++++++++++++ module/network/Request.py | 9 ++++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 module/Unzip.py (limited to 'module') diff --git a/module/Unzip.py b/module/Unzip.py new file mode 100644 index 000000000..f56fbe751 --- /dev/null +++ b/module/Unzip.py @@ -0,0 +1,50 @@ +import zipfile +import os + +class Unzip: + def __init__(self): + pass + + def extract(self, file, dir): + if not dir.endswith(':') and not os.path.exists(dir): + os.mkdir(dir) + + zf = zipfile.ZipFile(file) + + # create directory structure to house files + self._createstructure(file, dir) + + # extract files to directory structure + for i, name in enumerate(zf.namelist()): + + if not name.endswith('/') and not name.endswith("config"): + print "extracting", name.replace("pyload/","") + outfile = open(os.path.join(dir, name.replace("pyload/","")), 'wb') + outfile.write(zf.read(name)) + outfile.flush() + outfile.close() + + def _createstructure(self, file, dir): + self._makedirs(self._listdirs(file), dir) + + def _makedirs(self, directories, basedir): + """ Create any directories that don't currently exist """ + for dir in directories: + curdir = os.path.join(basedir, dir) + if not os.path.exists(curdir): + os.mkdir(curdir) + + def _listdirs(self, file): + """ Grabs all the directories in the zip structure + This is necessary to create the structure before trying + to extract the file to it. """ + zf = zipfile.ZipFile(file) + + dirs = [] + + for name in zf.namelist(): + if name.endswith('/'): + dirs.append(name.replace("pyload/","")) + + dirs.sort() + return dirs diff --git a/module/network/Request.py b/module/network/Request.py index b80ea44da..cda8e50f1 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -110,7 +110,7 @@ class Request: "Connection: keep-alive", "Keep-Alive: 300"]) - def load(self, url, get={}, post={}, ref=True, cookies=False): + def load(self, url, get={}, post={}, ref=True, cookies=False, just_header=False): if post: post = urllib.urlencode(post) @@ -136,6 +136,13 @@ class Request: if ref and self.lastURL is not None: self.pycurl.setopt(pycurl.REFERER, self.lastURL) + if just_header: + self.pycurl.setopt(pycurl.NOPROGRESS, 1) + self.pycurl.setopt(pycurl.NOBODY, 1) + self.pycurl.perform() + self.pycurl.setopt(pycurl.NOPROGRESS, 0) + self.pycurl.setopt(pycurl.NOBODY, 0) + return self.header self.pycurl.perform() -- cgit v1.2.3 From 106e79456886563e4ee4ed43027bc69984f65928 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 2 Dec 2009 20:36:43 +0100 Subject: new bottle.py, re implemented webserver(not ready yet) --- module/web/WebServer.py | 428 +++++++++++++++++++++++----- module/web/bottle.py | 727 +++++++++++++++++++++++++++++++++++------------- 2 files changed, 896 insertions(+), 259 deletions(-) (limited to 'module') diff --git a/module/web/WebServer.py b/module/web/WebServer.py index 0712f1dce..29b0aafe8 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -1,72 +1,364 @@ -import sys -from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler -from xmlrpclib import ServerProxy -from time import time -import re +#import sys +#from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler +#from xmlrpclib import ServerProxy +#from time import time +#import re +# +#class Handler(BaseHTTPRequestHandler): +# +# def do_GET(self): +# global coreserver +# stdout = sys.stdout +# sys.stdout = self.wfile +# if self.path == "/": +# print "Server Runs" +# elif self.path == "/downloads": +# print self.get_downloads() +# elif re.search("/add=.?", self.path): +# if re.match(is_url, self.path.split("/add=")[1]): +# coreserver.add_urls([self.path.split("/add=")[1]]) +# print "Link Added" +# else: +# try: +# print open(self.path[1:], 'r').read() +# except IOError: +# self.send_error(404) +# +# def format_size(self, size): +# return str(size / 1024) + " MiB" +# +# def format_time(self,seconds): +# seconds = int(seconds) +# hours, seconds = divmod(seconds, 3600) +# minutes, seconds = divmod(seconds, 60) +# return "%.2i:%.2i:%.2i" % (hours, minutes, seconds) +# +# def get_downloads(self): +# data = coreserver.status_downloads() +# for download in data: +# print "<h3>%s</h3>" % download["name"] +# if download["status"] == "downloading": +# percent = download["percent"] +# z = percent / 4 +# print "<h3>%s</h3>" % dl_name +# print "<font face='font-family:Fixedsys,Courier,monospace;'>[" + z * "#" + (25-z) * " " + "]</font>" + str(percent) + "%<br />" +# print "Speed: " + str(int(download['speed'])) + " kb/s" +# print "Size: " + self.format_size(download['size']) +# print "Finished in: " + self.format_time(download['eta']) +# print "ID: " + str(download['id']) +# dl_status = "[" + z * "#" + (25-z) * " " + "] " + str(percent) + "%" + " Speed: " + str(int(download['speed'])) + " kb/s" + " Size: " + self.format_size(download['size']) + " Finished in: " + self.format_time(download['eta']) + " ID: " + str(download['id']) +# if download["status"] == "waiting": +# print "waiting: " + self.format_time(download["wait_until"]- time()) +# +#is_url = re.compile("^(((https?|ftp)\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$",re.IGNORECASE) +# +#coreserver = None +# +#class WebServer(): +# +# def start(self): +# try: +# global coreserver +# coreserver = ServerProxy("https://testuser:testpw@localhost:1337", allow_none=True) +# webserver = HTTPServer(('',8080),Handler) +# print 'server started at port 8080' +# webserver.serve_forever() +# except KeyboardInterrupt: +# webserver.socket.close() +# +#if __name__ == "__main__": +# web = WebServer() +# web.start() -class Handler(BaseHTTPRequestHandler): + +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +#Copyright (C) 2009 RaNaN +# +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, +#or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +### +import random +import threading +import time + +import bottle +from bottle import abort +from bottle import redirect +from bottle import request +from bottle import response +from bottle import route +from bottle import run +from bottle import send_file +from bottle import template +from bottle import validate + + +core = None +core_methods = None + +PATH = "./module/web/" +TIME = time.strftime("%a, %d %b %Y 00:00:00 +0000", time.localtime()) #set time to current day +USERS = {} +# TODO: Implement new server methods +@route('/login', method='POST') +def do_login(): + #print request.GET + + + username = core.config['webinterface']['username'] + pw = core.config['webinterface']['password'] + + if request.POST['u'] == username and request.POST['p'] == pw: + + id = int(random.getrandbits(16)) + ua = request.HEADER("HTTP_USER_AGENT") + ip = request.HEADER("REMOTE_ADDR") + + auth = {} + + auth['ua'] = ua + auth['ip'] = ip + auth['user'] = username + + USERS[id] = auth + + response.COOKIES['user'] = username + response.COOKIES['id'] = id + + return template('default', page='loggedin', user=username) + else: + return template('default', page='login') + +@route('/login') +def login(): + + if check_auth(request): + redirect("/") + + return template('default', page='login') + +@route('/logout') +def logout(): + try: + del USERS[int(request.COOKIES.get('id'))] + except: + pass - def do_GET(self): - global coreserver - stdout = sys.stdout - sys.stdout = self.wfile - if self.path == "/": - print "Server Runs" - elif self.path == "/downloads": - print self.get_downloads() - elif re.search("/add=.?", self.path): - if re.match(is_url, self.path.split("/add=")[1]): - coreserver.add_urls([self.path.split("/add=")[1]]) - print "Link Added" + redirect("/login") + +@route('/') +def home(): + + if not check_auth(request): + redirect("/login") + + username = request.COOKIES.get('user') + + dls = core_methods.status_downloads() + + for dl in dls: + dl['eta'] = str(core.format_time(dl['eta'])) + dl['wait_until'] = str(core.format_time(dl['wait_until'] - time.time())) + + + return template('default', page='home', links=dls, user=username, status=core_methods.status_server()) + +@route('/queue') +def queue(): + + if not check_auth(request): + redirect("/login") + + username = request.COOKIES.get('user') + + return template('default', page='queue', links=core.get_links(), user=username, status=core_methods.status_server()) + +@route('/downloads') +def downloads(): + + if not check_auth(request): + redirect("/login") + + username = request.COOKIES.get('user') + + return template('default', page='downloads', links=core_methods.status_downloads(), user=username, status=core_methods.status_server()) + + +@route('/logs') +def logs(): + + if not check_auth(request): + redirect("/login") + + username = request.COOKIES.get('user') + + return template('default', page='logs', links=core_methods.status_downloads(), user=username, status=core_methods.status_server()) + +@route('/json/links') +def get_links(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + json = '{ "downloads": [' + + downloads = core_methods.status_downloads() + ids = [] + + for dl in downloads: + ids.append(dl['id']) + json += '{' + json += '"id": %s, "name": "%s", "speed": %s, "eta": "%s", "kbleft": %s, "size": %s, "percent": %s, "wait": "%s", "status": "%s"'\ + % (str(dl['id']), str(dl['name']), str(int(dl['speed'])), str(core.format_time(dl['eta'])), dl['kbleft'], dl['size'], dl['percent'], str(core.format_time(dl['wait_until'] - time.time())), dl['status']) + + json += "}," + + if json.endswith(","): json = json[:-1] + + json += '], "ids": %s }' % str(ids) + + return json + +@route('/json/status') +def get_status(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + data = core_methods.status_server() + + if data['pause']: + status = "paused" + else: + status = "running" + + json = '{ "status": "%s", "speed": "%s", "queue": "%s" }' % (status, str(int(data['speed'])), str(data['queue'])) + + return json + +@route('/json/addlinks', method='POST') +def add_links(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + links = request.POST['links'].split('\n') + + core.add_links(links) + + return "{}" + +@route('/json/pause') +def pause(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + core.thread_list.pause = True + + return "{}" + + +@route('/json/play') +def play(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + core.thread_list.pause = False + + return "{}" + +@route('/favicon.ico') +def favicon(): + + if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") + + response.header['Last-Modified'] = TIME + + send_file('favicon.ico', root=(PATH + 'static/')) + +@route('static/:section/:filename') +def static_folder(section, filename): + + if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") + + response.header['Last-Modified'] = TIME + send_file(filename, root=(PATH + 'static/' + section)) + +@route('/static/:filename') +def static_file(filename): + + if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") + + response.header['Last-Modified'] = TIME + send_file(filename, root=(PATH + 'static/')) + + +def check_auth(req): + + try: + user = req.COOKIES.get('user') + id = int(req.COOKIES.get('id')) + ua = req.HEADER("HTTP_USER_AGENT") + ip = req.HEADER("REMOTE_ADDR") + + if USERS[id]['user'] == user and USERS[id]['ua'] == ua and USERS[id]['ip'] == ip: + return True + except: + return False + + return False + + +class WebServer(threading.Thread): + def __init__(self, pycore): + threading.Thread.__init__(self) + + global core, core_methods, TIME + core = pycore + core_methods = pycore.server_methods + self.core = pycore + self.setDaemon(True) + + if pycore.config['general']['debug_mode']: + bottle.debug(True) + TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) else: - try: - print open(self.path[1:], 'r').read() - except IOError: - self.send_error(404) - - def format_size(self, size): - return str(size / 1024) + " MiB" - - def format_time(self,seconds): - seconds = int(seconds) - hours, seconds = divmod(seconds, 3600) - minutes, seconds = divmod(seconds, 60) - return "%.2i:%.2i:%.2i" % (hours, minutes, seconds) - - def get_downloads(self): - data = coreserver.status_downloads() - for download in data: - print "<h3>%s</h3>" % download["name"] - if download["status"] == "downloading": - percent = download["percent"] - z = percent / 4 - print "<h3>%s</h3>" % dl_name - print "<font face='font-family:Fixedsys,Courier,monospace;'>[" + z * "#" + (25-z) * " " + "]</font>" + str(percent) + "%<br />" - print "Speed: " + str(int(download['speed'])) + " kb/s" - print "Size: " + self.format_size(download['size']) - print "Finished in: " + self.format_time(download['eta']) - print "ID: " + str(download['id']) - dl_status = "[" + z * "#" + (25-z) * " " + "] " + str(percent) + "%" + " Speed: " + str(int(download['speed'])) + " kb/s" + " Size: " + self.format_size(download['size']) + " Finished in: " + self.format_time(download['eta']) + " ID: " + str(download['id']) - if download["status"] == "waiting": - print "waiting: " + self.format_time(download["wait_until"]- time()) - -is_url = re.compile("^(((https?|ftp)\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$",re.IGNORECASE) - -coreserver = None - -class WebServer(): - - def start(self): - try: - global coreserver - coreserver = ServerProxy("https://testuser:testpw@localhost:1337", allow_none=True) - webserver = HTTPServer(('',8080),Handler) - print 'server started at port 8080' - webserver.serve_forever() - except KeyboardInterrupt: - webserver.socket.close() - -if __name__ == "__main__": - web = WebServer() - web.start() + bottle.debug(False) + + #@TODO remove + #TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) + bottle.TEMPLATE_PATH.append('./module/web/templates/') + + def run(self): + self.core.logger.info("Starting Webinterface on %s port %s" % (self.core.config['webinterface']['listenaddr'],self.core.config['webinterface']['port'])) + try: + run(host=self.core.config['webinterface']['listenaddr'], port=int(self.core.config['webinterface']['port']), quiet=True) + except: + self.core.logger.error("Failed starting webserver, no webinterface available: Can't create socket") + exit() \ No newline at end of file diff --git a/module/web/bottle.py b/module/web/bottle.py index 66ceb527f..41a8c8fc0 100644 --- a/module/web/bottle.py +++ b/module/web/bottle.py @@ -1,15 +1,15 @@ # -*- coding: utf-8 -*- """ -Bottle is a fast and simple mirco-framework for small web-applications. It -offers request dispatching (Routes) with url parameter support, Templates, -key/value Databases, a build-in HTTP Server and adapters for many third party -WSGI/HTTP-server and template engines. All in a single file and with no +Bottle is a fast and simple micro-framework for small web applications. It +offers request dispatching (Routes) with url parameter support, templates, +key/value databases, a built-in HTTP Server and adapters for many third party +WSGI/HTTP-server and template engines - all in a single file and with no dependencies other than the Python Standard Library. Homepage and documentation: http://wiki.github.com/defnull/bottle Special thanks to Stefan Matthias Aust [http://github.com/sma] - for his contribution to SimpelTemplate + for his contribution to SimpleTemplate Licence (MIT) ------------- @@ -62,9 +62,10 @@ Example """ __author__ = 'Marcel Hellkamp' -__version__ = '0.5.7' +__version__ = '0.6.4' __license__ = 'MIT' +import types import sys import cgi import mimetypes @@ -75,26 +76,31 @@ import re import random import threading import time +import warnings +import email.utils from wsgiref.headers import Headers as HeaderWrapper from Cookie import SimpleCookie import anydbm as dbm +import subprocess +import thread + try: from urlparse import parse_qs -except ImportError: +except ImportError: # pragma: no cover from cgi import parse_qs try: import cPickle as pickle -except ImportError: +except ImportError: # pragma: no cover import pickle as pickle try: try: from json import dumps as json_dumps - except ImportError: + except ImportError: # pragma: no cover from simplejson import dumps as json_dumps -except ImportError: +except ImportError: # pragma: no cover json_dumps = None @@ -105,38 +111,37 @@ except ImportError: # Exceptions and Events class BottleException(Exception): - """ A base class for exceptions used by bottle.""" + """ A base class for exceptions used by bottle. """ pass class HTTPError(BottleException): - """ A way to break the execution and instantly jump to an error handler. """ + """ + A way to break the execution and instantly jump to an error handler. + """ def __init__(self, status, text): self.output = text self.http_status = int(status) + BottleException.__init__(self, status, text) def __repr__(self): - return "HTTPError(%d,%s)" % (self.http_status, repr(self.output)) + return 'HTTPError(%d,%s)' % (self.http_status, repr(self.output)) def __str__(self): - out = [] - status = self.http_status - name = HTTP_CODES.get(status,'Unknown').title() - url = request.path - out.append('<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">') - out.append('<html><head><title>Error %d: %s</title>' % (status, name)) - out.append('</head><body><h1>Error %d: %s</h1>' % (status, name)) - out.append('<p>Sorry, the requested URL "%s" caused an error.</p>' % url) - out.append(''.join(list(self.output))) - out.append('</body></html>') - return "\n".join(out) + return HTTP_ERROR_TEMPLATE % { + 'status' : self.http_status, + 'url' : request.path, + 'error_name' : HTTP_CODES.get(self.http_status, 'Unknown').title(), + 'error_message' : ''.join(self.output) + } class BreakTheBottle(BottleException): - """ Not an exception, but a straight jump out of the controller code. - + """ + Not an exception, but a straight jump out of the controller code. Causes the Bottle to instantly call start_response() and return the - content of output """ + content of output + """ def __init__(self, output): self.output = output @@ -149,8 +154,10 @@ class BreakTheBottle(BottleException): _default_app = None def default_app(newapp = None): - ''' Returns the current default app or sets a new one. - Defaults to an instance of Bottle ''' + """ + Returns the current default app or sets a new one. + Defaults to an instance of Bottle + """ global _default_app if newapp: _default_app = newapp @@ -161,17 +168,20 @@ def default_app(newapp = None): class Bottle(object): - def __init__(self, catchall=True, debug=False, optimize=False, autojson=True): + def __init__(self, catchall=True, optimize=False, autojson=True): self.simple_routes = {} self.regexp_routes = {} + self.default_route = None self.error_handler = {} self.optimize = optimize - self.debug = debug self.autojson = autojson self.catchall = catchall + self.serve = True def match_url(self, url, method='GET'): - """Returns the first matching handler and a parameter dict or (None, None) """ + """ + Returns the first matching handler and a parameter dict or (None, None) + """ url = url.strip().lstrip("/ ") # Search for static routes first route = self.simple_routes.get(method,{}).get(url,None) @@ -186,47 +196,116 @@ class Bottle(object): if i > 0 and self.optimize and random.random() <= 0.001: routes[i-1], routes[i] = routes[i], routes[i-1] return (handler, match.groupdict()) - return (None, None) - - def add_route(self, route, handler, method='GET', simple=False): + if self.default_route: + return (self.default_route, {}) + if method == 'HEAD': # Fall back to GET + return self.match_url(url) + else: + return (None, None) + + def add_controller(self, route, controller, **kargs): + """ Adds a controller class or object """ + if '{action}' not in route and 'action' not in kargs: + raise BottleException("Routes to controller classes or object MUST" + " contain an {action} placeholder or use the action-parameter") + for action in (m for m in dir(controller) if not m.startswith('_')): + handler = getattr(controller, action) + if callable(handler) and action == kargs.get('action', action): + self.add_route(route.replace('{action}', action), handler, **kargs) + + def add_route(self, route, handler, method='GET', simple=False, **kargs): """ Adds a new route to the route mappings. """ + if isinstance(handler, type) and issubclass(handler, BaseController): + handler = handler() + if isinstance(handler, BaseController): + self.add_controller(route, handler, method=method, simple=simple, **kargs) + return method = method.strip().upper() route = route.strip().lstrip('$^/ ').rstrip('$^ ') if re.match(r'^(\w+/)*\w*$', route) or simple: self.simple_routes.setdefault(method, {})[route] = handler else: - route = re.sub(r':([a-zA-Z_]+)(?P<uniq>[^\w/])(?P<re>.+?)(?P=uniq)',r'(?P<\1>\g<re>)',route) - route = re.sub(r':([a-zA-Z_]+)',r'(?P<\1>[^/]+)', route) + route = re.sub(r':([a-zA-Z_]+)(?P<uniq>[^\w/])(?P<re>.+?)(?P=uniq)', + r'(?P<\1>\g<re>)',route) + route = re.sub(r':([a-zA-Z_]+)', r'(?P<\1>[^/]+)', route) route = re.compile('^%s$' % route) self.regexp_routes.setdefault(method, []).append([route, handler]) def route(self, url, **kargs): - """ Decorator for request handler. Same as add_route(url, handler, **kargs).""" + """ + Decorator for request handler. + Same as add_route(url, handler, **kargs). + """ def wrapper(handler): self.add_route(url, handler, **kargs) return handler return wrapper + def set_default(self, handler): + self.default_route = handler + + def default(self): + """ Decorator for request handler. Same as add_defroute( handler ).""" + def wrapper(handler): + self.set_default(handler) + return handler + return wrapper + def set_error_handler(self, code, handler): """ Adds a new error handler. """ - code = int(code) - self.error_handler[code] = handler + self.error_handler[int(code)] = handler def error(self, code=500): - """ Decorator for error handler. Same as set_error_handler(code, handler).""" + """ + Decorator for error handler. + Same as set_error_handler(code, handler). + """ def wrapper(handler): self.set_error_handler(code, handler) return handler return wrapper + def cast(self, out): + """ + Cast the output to an iterable of strings or something WSGI can handle. + Set Content-Type and Content-Length when possible. Then clear output + on HEAD requests. + Supports: False, str, unicode, list(unicode), dict(), open() + """ + if not out: + out = [] + response.header['Content-Length'] = '0' + elif isinstance(out, types.StringType): + out = [out] + elif isinstance(out, unicode): + out = [out.encode(response.charset)] + elif isinstance(out, list) and isinstance(out[0], unicode): + out = map(lambda x: x.encode(response.charset), out) + elif self.autojson and json_dumps and isinstance(out, dict): + out = [json_dumps(out)] + response.content_type = 'application/json' + elif hasattr(out, 'read'): + out = request.environ.get('wsgi.file_wrapper', + lambda x: iter(lambda: x.read(8192), ''))(out) + if isinstance(out, list) and len(out) == 1: + response.header['Content-Length'] = str(len(out[0])) + if not hasattr(out, '__iter__'): + raise TypeError('Request handler for route "%s" returned [%s] ' + 'which is not iterable.' % (request.path, type(out).__name__)) + return out + + def __call__(self, environ, start_response): - """ The bottle WSGI-interface .""" + """ The bottle WSGI-interface. """ request.bind(environ) response.bind() try: # Unhandled Exceptions try: # Bottle Error Handling + if not self.serve: + abort(503, "Server stopped") handler, args = self.match_url(request.path, request.method) - if not handler: raise HTTPError(404, "Not found") + if not handler: + raise HTTPError(404, "Not found") output = handler(**args) db.close() except BreakTheBottle, e: @@ -234,26 +313,18 @@ class Bottle(object): except HTTPError, e: response.status = e.http_status output = self.error_handler.get(response.status, str)(e) - # output casting - if hasattr(output, 'read'): - output = environ.get('wsgi.file_wrapper', lambda x: iter(lambda: x.read(8192), ''))(output) - elif self.autojson and json_dumps and isinstance(output, dict): - output = json_dumps(output) - response.content_type = 'application/json' - if isinstance(output, str): - response.header['Content-Length'] = str(len(output)) - output = [output] + output = self.cast(output) + if response.status in (100, 101, 204, 304) or request.method == 'HEAD': + output = [] # rfc2616 section 4.3 except (KeyboardInterrupt, SystemExit, MemoryError): raise except Exception, e: response.status = 500 if self.catchall: err = "Unhandled Exception: %s\n" % (repr(e)) - if self.debug: - err += "<h2>Traceback:</h2>\n<pre>\n" - err += traceback.format_exc(10) - err += "\n</pre>" - output = str(HTTPError(500, err)) + if DEBUG: + err += TRACEBACK_TEMPLATE % traceback.format_exc(10) + output = [str(HTTPError(500, err))] request._environ['wsgi.errors'].write(err) else: raise @@ -267,8 +338,11 @@ class Request(threading.local): """ Represents a single request using thread-local namespace. """ def bind(self, environ): - """ Binds the enviroment of the current request to this request handler """ + """ + Binds the enviroment of the current request to this request handler + """ self._environ = environ + self.environ = self._environ self._GET = None self._POST = None self._GETPOST = None @@ -279,25 +353,25 @@ class Request(threading.local): @property def method(self): - ''' Returns the request method (GET,POST,PUT,DELETE,...) ''' + """ Get the request method (GET,POST,PUT,DELETE,...) """ return self._environ.get('REQUEST_METHOD', 'GET').upper() @property def query_string(self): - ''' Content of QUERY_STRING ''' + """ Get content of QUERY_STRING """ return self._environ.get('QUERY_STRING', '') @property def input_length(self): - ''' Content of CONTENT_LENGTH ''' + """ Get content of CONTENT_LENGTH """ try: - return int(self._environ.get('CONTENT_LENGTH', '0')) + return max(0,int(self._environ.get('CONTENT_LENGTH', '0'))) except ValueError: return 0 @property def GET(self): - """Returns a dict with GET parameters.""" + """ Get a dict with GET parameters. """ if self._GET is None: data = parse_qs(self.query_string, keep_blank_values=True) self._GET = {} @@ -310,9 +384,10 @@ class Request(threading.local): @property def POST(self): - """Returns a dict with parsed POST or PUT data.""" + """ Get a dict with parsed POST or PUT data. """ if self._POST is None: - data = cgi.FieldStorage(fp=self._environ['wsgi.input'], environ=self._environ, keep_blank_values=True) + data = cgi.FieldStorage(fp=self._environ['wsgi.input'], + environ=self._environ, keep_blank_values=True) self._POST = {} for item in data.list: name = item.name @@ -326,7 +401,7 @@ class Request(threading.local): @property def params(self): - ''' Returns a mix of GET and POST data. POST overwrites GET ''' + """ Returns a mix of GET and POST data. POST overwrites GET """ if self._GETPOST is None: self._GETPOST = dict(self.GET) self._GETPOST.update(dict(self.POST)) @@ -334,7 +409,7 @@ class Request(threading.local): @property def COOKIES(self): - """Returns a dict with COOKIES.""" + """ Returns a dict with COOKIES. """ if self._COOKIES is None: raw_dict = SimpleCookie(self._environ.get('HTTP_COOKIE','')) self._COOKIES = {} @@ -357,6 +432,7 @@ class Response(threading.local): self.header = HeaderWrapper(self.header_list) self.content_type = 'text/html' self.error = None + self.charset = 'utf8' def wsgiheaders(self): ''' Returns a wsgi conform list of header/value pairs ''' @@ -371,19 +447,33 @@ class Response(threading.local): return self._COOKIES def set_cookie(self, key, value, **kargs): - """ Sets a Cookie. Optional settings: expires, path, comment, domain, max-age, secure, version, httponly """ + """ + Sets a Cookie. Optional settings: + expires, path, comment, domain, max-age, secure, version, httponly + """ self.COOKIES[key] = value - for k in kargs: - self.COOKIES[key][k] = kargs[k] + for k, v in kargs.iteritems(): + self.COOKIES[key][k] = v def get_content_type(self): - '''Gives access to the 'Content-Type' header and defaults to 'text/html'.''' + """ Get the current 'Content-Type' header. """ return self.header['Content-Type'] def set_content_type(self, value): + if 'charset=' in value: + self.charset = value.split('charset=')[-1].split(';')[0].strip() self.header['Content-Type'] = value - - content_type = property(get_content_type, set_content_type, None, get_content_type.__doc__) + + content_type = property(get_content_type, set_content_type, None, + get_content_type.__doc__) + + +class BaseController(object): + _singleton = None + def __new__(cls, *a, **k): + if not cls._singleton: + cls._singleton = object.__new__(cls, *a, **k) + return cls._singleton def abort(code=500, text='Unknown Error: Appliction stopped.'): @@ -398,12 +488,11 @@ def redirect(url, code=307): raise BreakTheBottle("") -def send_file(filename, root, guessmime = True, mimetype = 'text/plain'): +def send_file(filename, root, guessmime = True, mimetype = None): """ Aborts execution and sends a static files as response. """ - root = os.path.abspath(root) + '/' - filename = os.path.normpath(filename).strip('/') - filename = os.path.join(root, filename) - + root = os.path.abspath(root) + os.sep + filename = os.path.abspath(os.path.join(root, filename.strip('/\\'))) + if not filename.startswith(root): abort(401, "Access denied.") if not os.path.exists(filename) or not os.path.isfile(filename): @@ -411,25 +500,41 @@ def send_file(filename, root, guessmime = True, mimetype = 'text/plain'): if not os.access(filename, os.R_OK): abort(401, "You do not have permission to access this file.") - if guessmime: - guess = mimetypes.guess_type(filename)[0] - if guess: - response.content_type = guess - elif mimetype: - response.content_type = mimetype - elif mimetype: - response.content_type = mimetype + if guessmime and not mimetype: + mimetype = mimetypes.guess_type(filename)[0] + if not mimetype: mimetype = 'text/plain' + response.content_type = mimetype stats = os.stat(filename) - # TODO: HTTP_IF_MODIFIED_SINCE -> 304 (Thu, 02 Jul 2009 23:16:31 CEST) - if 'Content-Length' not in response.header: - response.header['Content-Length'] = stats.st_size if 'Last-Modified' not in response.header: - ts = time.gmtime(stats.st_mtime) - ts = time.strftime("%a, %d %b %Y %H:%M:%S +0000", ts) - response.header['Last-Modified'] = ts + lm = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(stats.st_mtime)) + response.header['Last-Modified'] = lm + if 'HTTP_IF_MODIFIED_SINCE' in request.environ: + ims = request.environ['HTTP_IF_MODIFIED_SINCE'] + # IE sends "<date>; length=146" + ims = ims.split(";")[0].strip() + ims = parse_date(ims) + if ims is not None and ims >= stats.st_mtime: + abort(304, "Not modified") + if 'Content-Length' not in response.header: + response.header['Content-Length'] = str(stats.st_size) + raise BreakTheBottle(open(filename, 'rb')) + - raise BreakTheBottle(open(filename, 'r')) +def parse_date(ims): + """ + Parses date strings usually found in HTTP header and returns UTC epoch. + Understands rfc1123, rfc850 and asctime. + """ + try: + ts = email.utils.parsedate_tz(ims) + if ts is not None: + if ts[9] is None: + return time.mktime(ts[:8] + (0,)) - time.timezone + else: + return time.mktime(ts[:8] + (0,)) - ts[9] - time.timezone + except (ValueError, IndexError): + return None @@ -439,15 +544,17 @@ def send_file(filename, root, guessmime = True, mimetype = 'text/plain'): # Decorators def validate(**vkargs): - ''' Validates and manipulates keyword arguments by user defined callables - and handles ValueError and missing arguments by raising HTTPError(403) ''' + """ + Validates and manipulates keyword arguments by user defined callables. + Handles ValueError and missing arguments by raising HTTPError(403). + """ def decorator(func): def wrapper(**kargs): - for key in vkargs: + for key, value in vkargs.iteritems(): if key not in kargs: abort(403, 'Missing parameter: %s' % key) try: - kargs[key] = vkargs[key](kargs[key]) + kargs[key] = value(kargs[key]) except ValueError, e: abort(403, 'Wrong parameter format for: %s' % key) return func(**kargs) @@ -456,12 +563,21 @@ def validate(**vkargs): def route(url, **kargs): - """ Decorator for request handler. Same as add_route(url, handler, **kargs).""" + """ + Decorator for request handler. Same as add_route(url, handler, **kargs). + """ return default_app().route(url, **kargs) +def default(): + """ + Decorator for request handler. Same as set_default(handler). + """ + return default_app().default() def error(code=500): - """ Decorator for error handler. Same as set_error_handler(code, handler).""" + """ + Decorator for error handler. Same as set_error_handler(code, handler). + """ return default_app().error(code) @@ -471,8 +587,23 @@ def error(code=500): # Server adapter -class ServerAdapter(object): +class WSGIAdapter(object): + def run(self, handler): # pragma: no cover + pass + + def __repr__(self): + return "%s()" % (self.__class__.__name__) + + +class CGIServer(WSGIAdapter): + def run(self, handler): + from wsgiref.handlers import CGIHandler + CGIHandler().run(handler) + + +class ServerAdapter(WSGIAdapter): def __init__(self, host='127.0.0.1', port=8080, **kargs): + WSGIAdapter.__init__(self) self.host = host self.port = int(port) self.options = kargs @@ -480,9 +611,6 @@ class ServerAdapter(object): def __repr__(self): return "%s (%s:%d)" % (self.__class__.__name__, self.host, self.port) - def run(self, handler): - pass - class WSGIRefServer(ServerAdapter): def run(self, handler): @@ -513,12 +641,14 @@ class PasteServer(ServerAdapter): class FapwsServer(ServerAdapter): - """ Extreamly fast Webserver using libev (see http://william-os4y.livejournal.com/) - Experimental ... """ + """ + Extremly fast webserver using libev. + See http://william-os4y.livejournal.com/ + Experimental ... + """ def run(self, handler): import fapws._evwsgi as evwsgi from fapws import base - import sys evwsgi.start(self.host, self.port) evwsgi.set_base_module(base) def app(environ, start_response): @@ -528,35 +658,75 @@ class FapwsServer(ServerAdapter): evwsgi.run() -def run(app=None, server=WSGIRefServer, host='127.0.0.1', port=8080, **kargs): - """ Runs bottle as a web server, using Python's built-in wsgiref implementation by default. - - You may choose between WSGIRefServer, CherryPyServer, FlupServer and - PasteServer or write your own server adapter. - """ +def run(app=None, server=WSGIRefServer, host='127.0.0.1', port=8080, + interval=1, reloader=False, **kargs): + """ Runs bottle as a web server. """ if not app: app = default_app() - quiet = bool('quiet' in kargs and kargs['quiet']) - - # Instanciate server, if it is a class instead of an instance - if isinstance(server, type) and issubclass(server, ServerAdapter): - server = server(host=host, port=port, **kargs) + quiet = bool(kargs.get('quiet', False)) - if not isinstance(server, ServerAdapter): - raise RuntimeError("Server must be a subclass of ServerAdapter") + # Instantiate server, if it is a class instead of an instance + if isinstance(server, type): + if issubclass(server, CGIServer): + server = server() + elif issubclass(server, ServerAdapter): + server = server(host=host, port=port, **kargs) - if not quiet: - print 'Bottle server starting up (using %s)...' % repr(server) - print 'Listening on http://%s:%d/' % (server.host, server.port) - print 'Use Ctrl-C to quit.' - print + if not isinstance(server, WSGIAdapter): + raise RuntimeError("Server must be a subclass of WSGIAdapter") + + if not quiet and isinstance(server, ServerAdapter): # pragma: no cover + if not reloader or os.environ.get('BOTTLE_CHILD') == 'true': + print "Bottle server starting up (using %s)..." % repr(server) + print "Listening on http://%s:%d/" % (server.host, server.port) + print "Use Ctrl-C to quit." + print + else: + print "Bottle auto reloader starting up..." try: - server.run(app) + if reloader and interval: + reloader_run(server, app, interval) + else: + server.run(app) except KeyboardInterrupt: - print "Shuting down..." - + if not quiet: # pragma: no cover + print "Shutting Down..." + + +#TODO: If the parent process is killed (with SIGTERM) the childs survive... +def reloader_run(server, app, interval): + if os.environ.get('BOTTLE_CHILD') == 'true': + # We are a child process + files = dict() + for module in sys.modules.values(): + file_path = getattr(module, '__file__', None) + if file_path and os.path.isfile(file_path): + file_split = os.path.splitext(file_path) + if file_split[1] in ('.py', '.pyc', '.pyo'): + file_path = file_split[0] + '.py' + files[file_path] = os.stat(file_path).st_mtime + thread.start_new_thread(server.run, (app,)) + while True: + time.sleep(interval) + for file_path, file_mtime in files.iteritems(): + if not os.path.exists(file_path): + print "File changed: %s (deleted)" % file_path + elif os.stat(file_path).st_mtime > file_mtime: + print "File changed: %s (modified)" % file_path + else: continue + print "Restarting..." + app.serve = False + time.sleep(interval) # be nice and wait for running requests + sys.exit(3) + while True: + args = [sys.executable] + sys.argv + environ = os.environ.copy() + environ['BOTTLE_CHILD'] = 'true' + exit_status = subprocess.call(args, env=environ) + if exit_status != 3: + sys.exit(exit_status) @@ -564,89 +734,183 @@ def run(app=None, server=WSGIRefServer, host='127.0.0.1', port=8080, **kargs): # Templates +class TemplateError(HTTPError): + def __init__(self, message): + HTTPError.__init__(self, 500, message) + class BaseTemplate(object): - def __init__(self, template='', filename=None): - self.source = filename - if self.source: - fp = open(filename) - template = fp.read() - fp.close() - self.parse(template) - - def parse(self, template): raise NotImplementedError - def render(self, **args): raise NotImplementedError - - @classmethod - def find(cls, name): - for path in TEMPLATE_PATH: - if os.path.isfile(path % name): - return cls(filename = path % name) - return None + def __init__(self, template='', name=None, filename=None, lookup=[]): + """ + Create a new template. + If a name is provided, but no filename and no template string, the + filename is guessed using the lookup path list. + Subclasses can assume that either self.template or self.filename is set. + If both are present, self.template should be used. + """ + self.name = name + self.filename = filename + self.template = template + self.lookup = lookup + if self.name and not self.filename: + for path in self.lookup: + fpath = os.path.join(path, self.name+'.tpl') + if os.path.isfile(fpath): + self.filename = fpath + if not self.template and not self.filename: + raise TemplateError('Template (%s) not found.' % self.name) + self.prepare() + + def prepare(self): + """ + Run preparatios (parsing, caching, ...). + It should be possible to call this multible times to refresh a template. + """ + raise NotImplementedError + + def render(self, **args): + """ + Render the template with the specified local variables and return an + iterator of strings (bytes). This must be thread save! + """ + raise NotImplementedError class MakoTemplate(BaseTemplate): - def parse(self, template): + output_encoding=None + input_encoding=None + default_filters=None + global_variables={} + + def prepare(self): from mako.template import Template - self.tpl = Template(template) + from mako.lookup import TemplateLookup + #TODO: This is a hack... http://github.com/defnull/bottle/issues#issue/8 + mylookup = TemplateLookup(directories=map(os.path.abspath, self.lookup)+['./']) + if self.template: + self.tpl = Template(self.template, + lookup=mylookup, + output_encoding=MakoTemplate.output_encoding, + input_encoding=MakoTemplate.input_encoding, + default_filters=MakoTemplate.default_filters + ) + else: + self.tpl = Template(filename=self.filename, + lookup=mylookup, + output_encoding=MakoTemplate.output_encoding, + input_encoding=MakoTemplate.input_encoding, + default_filters=MakoTemplate.default_filters + ) def render(self, **args): - return self.tpl.render(**args) + _defaults = MakoTemplate.global_variables.copy() + _defaults.update(args) + return self.tpl.render(**_defaults) class CheetahTemplate(BaseTemplate): - def parse(self, template): + def prepare(self): from Cheetah.Template import Template self.context = threading.local() self.context.vars = {} - self.tpl = Template(source = template, searchList=[self.context.vars]) + if self.template: + self.tpl = Template(source=self.template, searchList=[self.context.vars]) + else: + self.tpl = Template(file=self.filename, searchList=[self.context.vars]) def render(self, **args): self.context.vars.update(args) out = str(self.tpl) self.context.vars.clear() - return out + return [out] + + +class Jinja2Template(BaseTemplate): + env = None # hopefully, a Jinja environment is actually thread-safe + + def prepare(self): + if not self.env: + from jinja2 import Environment, FunctionLoader + self.env = Environment(line_statement_prefix="#", loader=FunctionLoader(self.loader)) + if self.template: + self.tpl = self.env.from_string(self.template) + else: + self.tpl = self.env.get_template(self.filename) + + def render(self, **args): + return self.tpl.render(**args).encode("utf-8") + + def loader(self, name): + if not name.endswith(".tpl"): + for path in self.lookup: + fpath = os.path.join(path, name+'.tpl') + if os.path.isfile(fpath): + name = fpath + break + f = open(name) + try: return f.read() + finally: f.close() class SimpleTemplate(BaseTemplate): - re_python = re.compile(r'^\s*%\s*(?:(if|elif|else|try|except|finally|for|while|with|def|class)|(include)|(end)|(.*))') + re_python = re.compile(r'^\s*%\s*(?:(if|elif|else|try|except|finally|for|' + 'while|with|def|class)|(include|rebase)|(end)|(.*))') re_inline = re.compile(r'\{\{(.*?)\}\}') dedent_keywords = ('elif', 'else', 'except', 'finally') + def prepare(self): + if self.template: + code = self.translate(self.template) + self.co = compile(code, '<string>', 'exec') + else: + code = self.translate(open(self.filename).read()) + self.co = compile(code, self.filename, 'exec') + def translate(self, template): indent = 0 strbuffer = [] code = [] - self.subtemplates = {} + self.includes = dict() class PyStmt(str): def __repr__(self): return 'str(' + self + ')' def flush(allow_nobreak=False): if len(strbuffer): if allow_nobreak and strbuffer[-1].endswith("\\\\\n"): strbuffer[-1]=strbuffer[-1][:-3] - code.append(" " * indent + "stdout.append(%s)" % repr(''.join(strbuffer))) - code.append((" " * indent + "\n") * len(strbuffer)) # to preserve line numbers + code.append(' ' * indent + "_stdout.append(%s)" % repr(''.join(strbuffer))) + code.append((' ' * indent + '\n') * len(strbuffer)) # to preserve line numbers del strbuffer[:] for line in template.splitlines(True): m = self.re_python.match(line) if m: flush(allow_nobreak=True) - keyword, include, end, statement = m.groups() + keyword, subtpl, end, statement = m.groups() if keyword: if keyword in self.dedent_keywords: indent -= 1 code.append(" " * indent + line[m.start(1):]) indent += 1 - elif include: + elif subtpl: tmp = line[m.end(2):].strip().split(None, 1) - name = tmp[0] - args = tmp[1:] and tmp[1] or '' - self.subtemplates[name] = SimpleTemplate.find(name) - code.append(" " * indent + "stdout.append(_subtemplates[%s].render(%s))\n" % (repr(name), args)) + if not tmp: + code.append(' ' * indent + "_stdout.extend(_base)\n") + else: + name = tmp[0] + args = tmp[1:] and tmp[1] or '' + if name not in self.includes: + self.includes[name] = SimpleTemplate(name=name, lookup=self.lookup) + if subtpl == 'include': + code.append(' ' * indent + + "_ = _includes[%s].execute(_stdout, %s)\n" + % (repr(name), args)) + else: + code.append(' ' * indent + + "_tpl['_rebase'] = (_includes[%s], dict(%s))\n" + % (repr(name), args)) elif end: indent -= 1 - code.append(" " * indent + '#' + line[m.start(3):]) + code.append(' ' * indent + '#' + line[m.start(3):]) elif statement: - code.append(" " * indent + line[m.start(4):]) + code.append(' ' * indent + line[m.start(4):]) else: splits = self.re_inline.split(line) # text, (expr, text)* if len(splits) == 1: @@ -656,40 +920,86 @@ class SimpleTemplate(BaseTemplate): for i in range(1, len(splits), 2): splits[i] = PyStmt(splits[i]) splits = [x for x in splits if bool(x)] - code.append(" " * indent + "stdout.extend(%s)\n" % repr(splits)) + code.append(' ' * indent + "_stdout.extend(%s)\n" % repr(splits)) flush() return ''.join(code) - def parse(self, template): - code = self.translate(template) - self.co = compile(code, self.source or '<template>', 'exec') - - def render(self, **args): - ''' Returns the rendered template using keyword arguments as local variables. ''' - args['stdout'] = [] - args['_subtemplates'] = self.subtemplates + def execute(self, stdout, **args): + args['_stdout'] = stdout + args['_includes'] = self.includes + args['_tpl'] = args eval(self.co, args) - return ''.join(args['stdout']) + if '_rebase' in args: + subtpl, args = args['_rebase'] + args['_base'] = stdout[:] #copy stdout + del stdout[:] # clear stdout + return subtpl.execute(stdout, **args) + return args + def render(self, **args): + """ Render the template using keyword arguments as local variables. """ + stdout = [] + self.execute(stdout, **args) + return stdout + -def template(template, template_adapter=SimpleTemplate, **args): - ''' Returns a string from a template ''' - if template not in TEMPLATES: - if template.find("\n") == template.find("{") == template.find("%") == -1: - TEMPLATES[template] = template_adapter.find(template) +def template(tpl, template_adapter=SimpleTemplate, **args): + ''' + Get a rendered template as a string iterator. + You can use a name, a filename or a template string as first parameter. + ''' + lookup = args.get('template_lookup', TEMPLATE_PATH) + if tpl not in TEMPLATES or DEBUG: + if "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl: + TEMPLATES[tpl] = template_adapter(template=tpl, lookup=lookup) + elif '.' in tpl: + TEMPLATES[tpl] = template_adapter(filename=tpl, lookup=lookup) else: - TEMPLATES[template] = template_adapter(template) - if not TEMPLATES[template]: - abort(500, 'Template not found') + TEMPLATES[tpl] = template_adapter(name=tpl, lookup=lookup) + if not TEMPLATES[tpl]: + abort(500, 'Template (%s) not found' % tpl) args['abort'] = abort args['request'] = request args['response'] = response - return TEMPLATES[template].render(**args) + return TEMPLATES[tpl].render(**args) + + +def mako_template(tpl_name, **kargs): + kargs['template_adapter'] = MakoTemplate + return template(tpl_name, **kargs) + +def cheetah_template(tpl_name, **kargs): + kargs['template_adapter'] = CheetahTemplate + return template(tpl_name, **kargs) + +def jinja2_template(tpl_name, **kargs): + kargs['template_adapter'] = Jinja2Template + return template(tpl_name, **kargs) +def view(tpl_name, **defaults): + ''' Decorator: Rendes a template for a handler. + Return a dict of template vars to fill out the template. + ''' + def decorator(func): + def wrapper(**kargs): + out = func(**kargs) + defaults.update(out) + return template(tpl_name, **defaults) + return wrapper + return decorator + +def mako_view(tpl_name, **kargs): + kargs['template_adapter'] = MakoTemplate + return view(tpl_name, **kargs) + +def cheetah_view(tpl_name, **kargs): + kargs['template_adapter'] = CheetahTemplate + return view(tpl_name, **kargs) -def mako_template(template_name, **args): return template(template_name, template_adapter=MakoTemplate, **args) +def jinja2_view(tpl_name, **kargs): + kargs['template_adapter'] = Jinja2Template + return view(tpl_name, **kargs) -def cheetah_template(template_name, **args): return template(template_name, template_adapter=CheetahTemplate, **args) @@ -698,8 +1008,8 @@ def cheetah_template(template_name, **args): return template(template_name, temp # Database -class BottleBucket(object): - '''Memory-caching wrapper around anydbm''' +class BottleBucket(object): # pragma: no cover + """ Memory-caching wrapper around anydbm """ def __init__(self, name): self.__dict__['name'] = name self.__dict__['db'] = dbm.open(DB_PATH + '/%s.db' % name, 'c') @@ -711,6 +1021,7 @@ class BottleBucket(object): return self.mmap[key] def __setitem__(self, key, value): + if not isinstance(key, str): raise TypeError("Bottle keys must be strings") self.mmap[key] = value def __delitem__(self, key): @@ -754,7 +1065,10 @@ class BottleBucket(object): if key not in self.db or pvalue != self.db[key]: self.db[key] = pvalue self.mmap.clear() - self.db.close() + if hasattr(self.db, 'sync'): + self.db.sync() + if hasattr(self.db, 'close'): + self.db.close() def clear(self): for key in self.db: @@ -773,12 +1087,13 @@ class BottleBucket(object): raise -class BottleDB(threading.local): - '''Holds multible BottleBucket instances in a thread-local way.''' +class BottleDB(threading.local): # pragma: no cover + """ Holds multible BottleBucket instances in a thread-local way. """ def __init__(self): self.__dict__['open'] = {} def __getitem__(self, key): + warnings.warn("Please do not use bottle.db anymore. This feature is deprecated. You may use anydb directly.", DeprecationWarning) if key not in self.open and not key.startswith('_'): self.open[key] = BottleBucket(key) return self.open[key] @@ -829,8 +1144,9 @@ class BottleDB(threading.local): # Modul initialization and configuration DB_PATH = './' -TEMPLATE_PATH = ['./%s.tpl', './views/%s.tpl'] +TEMPLATE_PATH = ['./', './views/'] TEMPLATES = {} +DEBUG = False HTTP_CODES = { 100: 'CONTINUE', 101: 'SWITCHING PROTOCOLS', @@ -875,12 +1191,41 @@ HTTP_CODES = { 505: 'HTTP VERSION NOT SUPPORTED', } +HTTP_ERROR_TEMPLATE = """ +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> +<html> + <head> + <title>Error %(status)d: %(error_name)s</title> + </head> + <body> + <h1>Error %(status)d: %(error_name)s</h1> + <p>Sorry, the requested URL <tt>%(url)s</tt> caused an error:</p> + <pre> + %(error_message)s + </pre> + </body> +</html> +""" + +TRACEBACK_TEMPLATE = """ +<h2>Traceback:</h2> +<pre> +%s +</pre> +""" + request = Request() response = Response() db = BottleDB() local = threading.local() -def debug(mode=True): default_app().debug = bool(mode) -def optimize(mode=True): default_app().optimize = bool(mode) +#TODO: Global and app local configuration (debug, defaults, ...) is a mess + +def debug(mode=True): + global DEBUG + DEBUG = bool(mode) + +def optimize(mode=True): + default_app().optimize = bool(mode) -- cgit v1.2.3 From a649d73a1bd2a9b45eb35d535d40e2454238417c Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 3 Dec 2009 18:10:48 +0100 Subject: little webinterface fixes --- module/web/WebServer.py | 13 ++++++++++++- module/web/static/default/status.js | 4 ++-- module/web/templates/default.tpl | 6 +++--- 3 files changed, 17 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/web/WebServer.py b/module/web/WebServer.py index 29b0aafe8..3486bf7cb 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -184,7 +184,7 @@ def queue(): username = request.COOKIES.get('user') - return template('default', page='queue', links=core.get_links(), user=username, status=core_methods.status_server()) + return template('default', page='queue', links=core_methods.get_queue(), user=username, status=core_methods.status_server()) @route('/downloads') def downloads(): @@ -252,6 +252,17 @@ def get_status(): json = '{ "status": "%s", "speed": "%s", "queue": "%s" }' % (status, str(int(data['speed'])), str(data['queue'])) return json +@route('json/addpackage', method='POST') +def add_package(): + response.header['Cache-Control'] = 'no-cache, must-revalidate' + response.content_type = 'application/json' + + if not check_auth(request): + abort(404, "No Access") + + links = request.POST['links'].split('\n') + name = request.POST['name'] + core_methods.add_package(name, links) @route('/json/addlinks', method='POST') def add_links(): diff --git a/module/web/static/default/status.js b/module/web/static/default/status.js index 31a4e0032..3923e80ca 100644 --- a/module/web/static/default/status.js +++ b/module/web/static/default/status.js @@ -39,11 +39,11 @@ window.addEvent('domready', function(){ new Request({ method: 'post', - url: '/json/addlinks', + url: '/json/addpackage', onSuccess: function(){ document.id('linkarea').value = "" } - }).send('links='+document.id('linkarea').value) + }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) }) diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl index 13be260b6..3f5e8d8e8 100644 --- a/module/web/templates/default.tpl +++ b/module/web/templates/default.tpl @@ -11,7 +11,7 @@ %include header title=header, use_js=js, use_css=['default.css','window.css'], redirect=red -%include window id="addlinks", width=400, caption="Add links", body="<textarea rows=10 style='width: 345px;' id='linkarea'></textarea>", button="Add" +%include window id="addlinks", width=400, caption="Add links", body="<input id='pname' type='text' style='width: 345px;' value='Package'/><textarea rows=10 style='width: 345px;' id='linkarea'></textarea>", button="Add" <a class="anchor" name="top" id="top"></a> @@ -199,9 +199,9 @@ this.morph({'color': '#000'}); <ul> -%for id in links['order']: +%for package in links: -<li>{{links[id].url}}</li> +<li>{{package.name}}</li> %end -- cgit v1.2.3 From f98a9eea978ccf56d41f4ce355f2b514fc9e4af1 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 3 Dec 2009 23:33:46 +0100 Subject: Convert read_url_list to new Plugin --- module/plugins/CCF.py | 2 +- module/plugins/LinkList.py | 44 +++++++++++++++++++++++++++++++++++++++++ module/plugins/RSDF.py | 40 +++++++++++++++++-------------------- module/plugins/RapidshareCom.py | 2 +- module/thread_list.py | 30 +++++++++++++++++++++------- 5 files changed, 87 insertions(+), 31 deletions(-) create mode 100644 module/plugins/LinkList.py (limited to 'module') diff --git a/module/plugins/CCF.py b/module/plugins/CCF.py index ba5b1c77d..7b6e3397f 100644 --- a/module/plugins/CCF.py +++ b/module/plugins/CCF.py @@ -17,7 +17,7 @@ class CCF(Plugin): props = {} props['name'] = "CCF" props['type'] = "container" - props['pattern'] = r".*\.ccf" + props['pattern'] = r"(?!http://).*\.ccf" props['version'] = "0.1" props['description'] = """CCF Container Convert Plugin""" props['author_name'] = ("Willnix") diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py new file mode 100644 index 000000000..e496f2a57 --- /dev/null +++ b/module/plugins/LinkList.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class LinkList(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LinkList" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.txt" + props['version'] = "0.1" + props['description'] = """Read Link Lists in txt format""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, linkList, location): + tmpLinks = [] + txt = open(linkList, 'r') + links = txt.readlines() + for link in links: + if link != "\n": + tmpLinks.append(link) + txt.close() + + txt = open(linkList, 'w') + txt.write("") + txt.close() + #may delete read txt file? + + self.links = tmpLinks diff --git a/module/plugins/RSDF.py b/module/plugins/RSDF.py index 50fca9b1f..5ce8fd716 100644 --- a/module/plugins/RSDF.py +++ b/module/plugins/RSDF.py @@ -13,7 +13,7 @@ class RSDF(Plugin): props = {} props['name'] = "RSDF" props['type'] = "container" - props['pattern'] = r".*\.rsdf" + props['pattern'] = r"(?!http://).*\.rsdf" props['version'] = "0.2" props['description'] = """RSDF Container Decode Plugin""" props['author_name'] = ("RaNaN", "spoob") @@ -29,31 +29,27 @@ class RSDF(Plugin): return True def proceed(self, url, location): - try: - from Crypto.Cipher import AES + from Crypto.Cipher import AES - infile = url.replace("\n", "") - Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') + infile = url.replace("\n", "") + Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') - IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') - IV_Cipher = AES.new(Key, AES.MODE_ECB) - IV = IV_Cipher.encrypt(IV) + IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + IV_Cipher = AES.new(Key, AES.MODE_ECB) + IV = IV_Cipher.encrypt(IV) - obj = AES.new(Key, AES.MODE_CFB, IV) + obj = AES.new(Key, AES.MODE_CFB, IV) - rsdf = open(infile, 'r') + rsdf = open(infile, 'r') - data = rsdf.read() - data = binascii.unhexlify(''.join(data.split())) - data = data.splitlines() + data = rsdf.read() + data = binascii.unhexlify(''.join(data.split())) + data = data.splitlines() - for link in data: - link = base64.b64decode(link) - link = obj.decrypt(link) - decryptedUrl = link.replace('CCF: ', '') - self.links.append(decryptedUrl) + for link in data: + link = base64.b64decode(link) + link = obj.decrypt(link) + decryptedUrl = link.replace('CCF: ', '') + self.links.append(decryptedUrl) - rsdf.close() - - except: - print "Kein Crypto installiert, RSDF Plugin kann nicht genutzt werden" + rsdf.close() diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 29e9a7c1f..7daff3f8f 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -27,7 +27,7 @@ class RapidshareCom(Plugin): self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False self.no_slots = True - self.logger = logging.getLogger("log") + #~ self.logger = logging.getLogger("log") self.read_config() if self.config['premium']: self.multi_dl = True diff --git a/module/thread_list.py b/module/thread_list.py index fc886e4b4..55f237544 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -78,7 +78,10 @@ class Thread_List(object): if not pyfile.plugin.multi_dl: self.occ_plugins.append(pyfile.modul.__name__) pyfile.active = True - self.parent.logger.info('Download starts: ' + pyfile.url) + if pyfile.plugin.props['type'] == "container": + self.parent.logger.info('Get links from: ' + pyfile.url) + else: + self.parent.logger.info('Download starts: ' + pyfile.url) self.lock.release() return pyfile @@ -102,14 +105,27 @@ class Thread_List(object): self.py_downloading.remove(pyfile) if pyfile.status.type == "finished": - self.parent.logger.info('Download finished: ' + pyfile.url + ' @' + str(pyfile.status.get_speed()) + 'kb/s') - if pyfile.plugin.props['type'] == "container": - self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.id) + #works(!) but adds many packs to queue + newLinks = 0 + newPackager = self.list.packager.addNewPackage(pyfile.status.filename) for link in pyfile.plugin.links: - id = self.list.collector.addLink(link) - pyfile.packager.pullOutPackage(pyfile.package.id) - pyfile.packager.addFileToPackage(pyfile.package.id, pyfile.collector.popFile(id)) + newFile = self.list.collector.addLink(link) + self.list.packager.addFileToPackage(newPackager, self.list.collector.popFile(newFile)) + newLinks += 1 + self.list.packager.pushPackage2Queue(newPackager) + + if newLinks: + self.parent.logger.info("Parsed link from %s: %i" % (pyfile.status.filename, newLinks)) + else: + self.parent.logger.info("No links in %s" % pyfile.status.filename) + #~ self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.id) + #~ for link in pyfile.plugin.links: + #~ id = self.list.collector.addLink(link) + #~ pyfile.packager.pullOutPackage(pyfile.package.id) + #~ pyfile.packager.addFileToPackage(pyfile.package.id, pyfile.collector.popFile(id)) + else: + self.parent.logger.info("Download finished: %s" % pyfile.url) elif pyfile.status.type == "reconnected": pyfile.plugin.req.init_curl() -- cgit v1.2.3 From 78f061eed59e084f001f8a0cd9c5b585f6fc0ce0 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Fri, 4 Dec 2009 20:01:17 +0100 Subject: fixes, minimal gui changes --- module/Plugin.py | 5 ++++- module/file_list.py | 16 ++++++++++++---- module/plugins/RapidshareCom.py | 7 +++++++ module/thread_list.py | 16 +++++++++------- 4 files changed, 32 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 7b726c3ac..f343dc62f 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -89,7 +89,10 @@ class Plugin(): return self.parent.url def get_file_name(self): - return re.findall("([^\/=]+)", self.parent.url)[-1] + try: + return re.findall("([^\/=]+)", self.parent.url)[-1] + except: + return "no_name" def wait_until(self): if self.html != None: diff --git a/module/file_list.py b/module/file_list.py index f66567e0f..2bfe37298 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -136,7 +136,7 @@ class File_List(object): try: n, pyfile = self.collector._getFileFromID(id) except NoSuchElementException: - key, n, pyfile, pypack, pid = self.packager._getFileFromID() + key, n, pyfile, pypack, pid = self.packager._getFileFromID(id) info = {} info["id"] = pyfile.id info["url"] = pyfile.url @@ -146,6 +146,7 @@ class File_List(object): info["status_url"] = pyfile.status.url info["status_filename"] = pyfile.status.filename info["status_error"] = pyfile.status.error + info["active"] = pyfile.active return info class pyLoadCollector(): @@ -260,11 +261,11 @@ class File_List(object): for n, pypack in enumerate(packager.file_list.data["packages"]): for pyfile in pypack.files: if pyfile.id == id: - return ("packages", n, pyfile, pypack, pid) + return ("packages", n, pyfile, pypack, pypack.data["id"]) for n, pypack in enumerate(packager.file_list.data["queue"]): for pyfile in pypack.files: if pyfile.id == id: - return ("queue", n, pyfile, pypack, pid) + return ("queue", n, pyfile, pypack, pypack.data["id"]) raise NoSuchElementException() def addNewPackage(packager, package_name=None): @@ -291,6 +292,8 @@ class File_List(object): try: key, n, pyfile, pypack, pid = self._getFileFromID() del pypack.files[n] + if not pypack.files: + packager.removePackage(pid) finally: packager.file_list.lock.release() @@ -343,11 +346,14 @@ class File_List(object): pypack.files.append(pyfile) packager.file_list.data[key][n] = pypack + #oooops, duplicate? def removeFileFromPackage(packager, id, pid): key, n, pypack = packager._getPackageFromID(pid) for k, pyfile in enumerate(pypack.files): if id == pyfile.id: del pypack.files[k] + if not pypack.files: + packager.removePackage(pid) return True raise NoSuchElementException() @@ -368,7 +374,7 @@ class PyLoadFile(): self.file_list = file_list self.core = file_list.core self.package = None - self.filename = "filename" + self.filename = "n/a" self.download_folder = "" self.active = False pluginName = self._get_my_plugin() @@ -380,6 +386,8 @@ class PyLoadFile(): pluginClass = module.Plugin.Plugin self.plugin = pluginClass(self) self.status = Status(self) + if self.plugin.file_exists(): + self.filename = self.plugin.get_file_name() def _get_my_plugin(self): for plugin, plugin_pattern in self.core.plugins_avaible.items(): diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 7daff3f8f..f7bcb5de8 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -27,6 +27,7 @@ class RapidshareCom(Plugin): self.time_plus_wait = None #time() + wait in seconds self.want_reconnect = False self.no_slots = True + self.api_data = None #~ self.logger = logging.getLogger("log") self.read_config() if self.config['premium']: @@ -153,6 +154,8 @@ class RapidshareCom(Plugin): def file_exists(self): """ returns True or False """ + if self.html[0] == None: + self.download_html() if re.search("The file could not be found|This limit is reached| \ is momentarily not available|removed this file| \ contain illegal content", self.html[0], re.I) != None: @@ -190,6 +193,10 @@ class RapidshareCom(Plugin): #raise Exception, "Error when retrieving download url" def get_file_name(self): + if self.html[0] == None: + self.download_html() + if self.api_data == None: + self.download_api_data() if self.api_data and self.api_data["filename"]: return self.api_data["filename"] file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" diff --git a/module/thread_list.py b/module/thread_list.py index 55f237544..3c69121c2 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -107,14 +107,16 @@ class Thread_List(object): if pyfile.status.type == "finished": if pyfile.plugin.props['type'] == "container": #works(!) but adds many packs to queue + self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"]) newLinks = 0 - newPackager = self.list.packager.addNewPackage(pyfile.status.filename) - for link in pyfile.plugin.links: - newFile = self.list.collector.addLink(link) - self.list.packager.addFileToPackage(newPackager, self.list.collector.popFile(newFile)) - newLinks += 1 - self.list.packager.pushPackage2Queue(newPackager) - + if pyfile.plugin.links: + newPackager = self.list.packager.addNewPackage(pyfile.status.filename) + for link in pyfile.plugin.links: + newFile = self.list.collector.addLink(link) + self.list.packager.addFileToPackage(newPackager, self.list.collector.popFile(newFile)) + newLinks += 1 + self.list.packager.pushPackage2Queue(newPackager) + if newLinks: self.parent.logger.info("Parsed link from %s: %i" % (pyfile.status.filename, newLinks)) else: -- cgit v1.2.3 From a223bbe47dc8f93a7bfa53a144edb17fb906e84a Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 5 Dec 2009 16:33:48 +0100 Subject: linksave.in captcha test --- module/captcha/LinksaveIn.py | 46 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 module/captcha/LinksaveIn.py (limited to 'module') diff --git a/module/captcha/LinksaveIn.py b/module/captcha/LinksaveIn.py new file mode 100644 index 000000000..cd4e97f87 --- /dev/null +++ b/module/captcha/LinksaveIn.py @@ -0,0 +1,46 @@ +from captcha import OCR +import Image + +class LinksaveIn(OCR): + def __init__(self): + OCR.__init__(self) + + def load_image(self, image): + im = Image.open(image) + frame_nr = 0 + + lut = im.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + new = Image.new("RGB", im.size) + npix = new.load() + while True: + try: + im.seek(frame_nr) + except EOFError: + break + frame = im.copy() + pix = frame.load() + for x in range(frame.size[0]): + for y in range(frame.size[1]): + if lut[pix[x, y]] != (0,0,0): + npix[x, y] = lut[pix[x, y]] + frame_nr += 1 + self.image = new.copy() + self.pixels = self.image.load() + self.result_captcha = '' + + def get_captcha(self, image): + self.load_image(image) + self.run_tesser() + + return self.result_captcha + +if __name__ == '__main__': + import urllib + ocr = LinksaveIn() + testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D" + urllib.urlretrieve(testurl, "captcha.gif") + + print ocr.get_captcha('captcha.gif') -- cgit v1.2.3 From a6c7715dfb4946a4a25edd4f8bc3cc2e2249e4f9 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 5 Dec 2009 20:31:00 +0100 Subject: No OpenSSL needed to run --- module/remote/SecureXMLRPCServer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/remote/SecureXMLRPCServer.py b/module/remote/SecureXMLRPCServer.py index 9dacd7b26..7a60f6c90 100644 --- a/module/remote/SecureXMLRPCServer.py +++ b/module/remote/SecureXMLRPCServer.py @@ -16,7 +16,6 @@ # $Id: SecureXMLRPCServer.py 5 2007-01-06 17:54:13Z hoffie $ from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler -from OpenSSL import SSL import SocketServer import socket import base64 @@ -41,6 +40,7 @@ class SecureSocketConnection: class SecureSocketServer(SocketServer.TCPServer, SocketServer.ThreadingMixIn): def __init__(self, addr, cert, key, requestHandler, verify_cert_func=None): + SSL = __import__("OpenSSL", globals(), locals(), "SSL", -1).SSL SocketServer.TCPServer.__init__(self, addr, requestHandler) ctx = SSL.Context(SSL.SSLv23_METHOD) if not verify_cert_func and hasattr(self, 'verify_client_cert'): -- cgit v1.2.3 From 8ee17f2be2576dc9f8be17aadc44a8014edbb1ab Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 5 Dec 2009 22:36:19 +0100 Subject: linksave captcha 2nd try --- module/captcha/LinksaveIn.py | 113 +++++++++++++++++++++- module/captcha/LinksaveIn/bg/flecken_1.gif | Bin 0 -> 10744 bytes module/captcha/LinksaveIn/bg/flecken_2.gif | Bin 0 -> 11076 bytes module/captcha/LinksaveIn/bg/gewebe_fein.gif | Bin 0 -> 10504 bytes module/captcha/LinksaveIn/bg/gewebe_grob.gif | Bin 0 -> 10127 bytes module/captcha/LinksaveIn/bg/gitter.gif | Bin 0 -> 8151 bytes module/captcha/LinksaveIn/bg/mauer_horizontal.gif | Bin 0 -> 9105 bytes module/captcha/LinksaveIn/bg/mauer_vertikal.gif | Bin 0 -> 10830 bytes module/captcha/LinksaveIn/bg/scheckig.gif | Bin 0 -> 10214 bytes module/captcha/LinksaveIn/bg/wellen.gif | Bin 0 -> 10041 bytes module/captcha/LinksaveIn/cleaned_pass1.png | Bin 0 -> 1979 bytes module/captcha/LinksaveIn/cleaned_pass2.png | Bin 0 -> 1162 bytes module/captcha/LinksaveIn/tesser_conf | 1 + module/captcha/LinksaveIn/unblacked.png | Bin 0 -> 10488 bytes 14 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 module/captcha/LinksaveIn/bg/flecken_1.gif create mode 100644 module/captcha/LinksaveIn/bg/flecken_2.gif create mode 100644 module/captcha/LinksaveIn/bg/gewebe_fein.gif create mode 100644 module/captcha/LinksaveIn/bg/gewebe_grob.gif create mode 100644 module/captcha/LinksaveIn/bg/gitter.gif create mode 100644 module/captcha/LinksaveIn/bg/mauer_horizontal.gif create mode 100644 module/captcha/LinksaveIn/bg/mauer_vertikal.gif create mode 100644 module/captcha/LinksaveIn/bg/scheckig.gif create mode 100644 module/captcha/LinksaveIn/bg/wellen.gif create mode 100644 module/captcha/LinksaveIn/cleaned_pass1.png create mode 100644 module/captcha/LinksaveIn/cleaned_pass2.png create mode 100644 module/captcha/LinksaveIn/tesser_conf create mode 100644 module/captcha/LinksaveIn/unblacked.png (limited to 'module') diff --git a/module/captcha/LinksaveIn.py b/module/captcha/LinksaveIn.py index cd4e97f87..4219f03b5 100644 --- a/module/captcha/LinksaveIn.py +++ b/module/captcha/LinksaveIn.py @@ -1,9 +1,17 @@ from captcha import OCR import Image +from os import sep +from os.path import dirname +from os.path import abspath +from glob import glob +import tempfile + +from pprint import pprint class LinksaveIn(OCR): def __init__(self): OCR.__init__(self) + self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep def load_image(self, image): im = Image.open(image) @@ -27,12 +35,115 @@ class LinksaveIn(OCR): if lut[pix[x, y]] != (0,0,0): npix[x, y] = lut[pix[x, y]] frame_nr += 1 + new.save(self.data_dir+"unblacked.png") self.image = new.copy() self.pixels = self.image.load() self.result_captcha = '' + + def get_bg(self): + stat = {} + cstat = {} + img = self.image.convert("P") + for bgpath in glob(self.data_dir+"bg/*.gif"): + stat[bgpath] = 0 + bg = Image.open(bgpath) + + bglut = bg.resize((256, 1)) + bglut.putdata(range(256)) + bglut = list(bglut.convert("RGB").getdata()) + + lut = img.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + bgpix = bg.load() + pix = img.load() + for x in range(bg.size[0]): + for y in range(bg.size[1]): + rgb_bg = bglut[bgpix[x, y]] + rgb_c = lut[pix[x, y]] + try: + cstat[rgb_c] += 1 + except: + cstat[rgb_c] = 1 + if rgb_bg == rgb_c: + stat[bgpath] += 1 + max_p = 0 + bg = "" + for bgpath, value in stat.items(): + if max_p < value: + bg = bgpath + max_p = value + return bg + + def substract_bg(self, bgpath): + bg = Image.open(bgpath) + img = self.image.convert("P") + + bglut = bg.resize((256, 1)) + bglut.putdata(range(256)) + bglut = list(bglut.convert("RGB").getdata()) + + lut = img.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + bgpix = bg.load() + pix = img.load() + orgpix = self.image.load() + for x in range(bg.size[0]): + for y in range(bg.size[1]): + rgb_bg = bglut[bgpix[x, y]] + rgb_c = lut[pix[x, y]] + if rgb_c == rgb_bg: + orgpix[x, y] = (255,255,255) + + def eval_black_white(self): + new = Image.new("RGB", (140, 75)) + pix = new.load() + orgpix = self.image.load() + thresh = 4 + for x in range(new.size[0]): + for y in range(new.size[1]): + rgb = orgpix[x, y] + r, g, b = rgb + pix[x, y] = (255,255,255) + if r > max(b, g)+thresh: + pix[x, y] = (0,0,0) + if g < min(r, b): + pix[x, y] = (0,0,0) + if g > max(r, b)+thresh: + pix[x, y] = (0,0,0) + if b > max(r, g)+thresh: + pix[x, y] = (0,0,0) + self.image = new + self.pixels = self.image.load() + + def run_tesser(self): + self.logger.debug("create tmp tif") + tmp = tempfile.NamedTemporaryFile(suffix=".tif") + self.logger.debug("create tmp txt") + tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") + self.logger.debug("save tiff") + self.image.save(tmp.name, 'TIFF') + self.logger.debug("run tesseract") + self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", ""), "nobatch", self.data_dir+"tesser_conf"]) + self.logger.debug("read txt") + + with open(tmpTxt.name, 'r') as f: + self.result_captcha = f.read().replace("\n", "") def get_captcha(self, image): self.load_image(image) + bg = self.get_bg() + self.substract_bg(bg) + self.eval_black_white() + self.to_greyscale() + self.image.save(self.data_dir+"cleaned_pass1.png") + self.clean(6) + self.image.save(self.data_dir+"cleaned_pass2.png") + letters = self.split_captcha_letters() + self.run_tesser() return self.result_captcha @@ -42,5 +153,5 @@ if __name__ == '__main__': ocr = LinksaveIn() testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D" urllib.urlretrieve(testurl, "captcha.gif") - + print ocr.get_captcha('captcha.gif') diff --git a/module/captcha/LinksaveIn/bg/flecken_1.gif b/module/captcha/LinksaveIn/bg/flecken_1.gif new file mode 100644 index 000000000..df2f51217 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/flecken_1.gif differ diff --git a/module/captcha/LinksaveIn/bg/flecken_2.gif b/module/captcha/LinksaveIn/bg/flecken_2.gif new file mode 100644 index 000000000..838276188 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/flecken_2.gif differ diff --git a/module/captcha/LinksaveIn/bg/gewebe_fein.gif b/module/captcha/LinksaveIn/bg/gewebe_fein.gif new file mode 100644 index 000000000..502f18cc4 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/gewebe_fein.gif differ diff --git a/module/captcha/LinksaveIn/bg/gewebe_grob.gif b/module/captcha/LinksaveIn/bg/gewebe_grob.gif new file mode 100644 index 000000000..e66a365ad Binary files /dev/null and b/module/captcha/LinksaveIn/bg/gewebe_grob.gif differ diff --git a/module/captcha/LinksaveIn/bg/gitter.gif b/module/captcha/LinksaveIn/bg/gitter.gif new file mode 100644 index 000000000..ec52ef68d Binary files /dev/null and b/module/captcha/LinksaveIn/bg/gitter.gif differ diff --git a/module/captcha/LinksaveIn/bg/mauer_horizontal.gif b/module/captcha/LinksaveIn/bg/mauer_horizontal.gif new file mode 100644 index 000000000..3d75fafa8 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/mauer_horizontal.gif differ diff --git a/module/captcha/LinksaveIn/bg/mauer_vertikal.gif b/module/captcha/LinksaveIn/bg/mauer_vertikal.gif new file mode 100644 index 000000000..2ada6fdae Binary files /dev/null and b/module/captcha/LinksaveIn/bg/mauer_vertikal.gif differ diff --git a/module/captcha/LinksaveIn/bg/scheckig.gif b/module/captcha/LinksaveIn/bg/scheckig.gif new file mode 100644 index 000000000..8bfb45c56 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/scheckig.gif differ diff --git a/module/captcha/LinksaveIn/bg/wellen.gif b/module/captcha/LinksaveIn/bg/wellen.gif new file mode 100644 index 000000000..a181ebe74 Binary files /dev/null and b/module/captcha/LinksaveIn/bg/wellen.gif differ diff --git a/module/captcha/LinksaveIn/cleaned_pass1.png b/module/captcha/LinksaveIn/cleaned_pass1.png new file mode 100644 index 000000000..f0cc0ae47 Binary files /dev/null and b/module/captcha/LinksaveIn/cleaned_pass1.png differ diff --git a/module/captcha/LinksaveIn/cleaned_pass2.png b/module/captcha/LinksaveIn/cleaned_pass2.png new file mode 100644 index 000000000..fb2ef44cd Binary files /dev/null and b/module/captcha/LinksaveIn/cleaned_pass2.png differ diff --git a/module/captcha/LinksaveIn/tesser_conf b/module/captcha/LinksaveIn/tesser_conf new file mode 100644 index 000000000..34ca8fa02 --- /dev/null +++ b/module/captcha/LinksaveIn/tesser_conf @@ -0,0 +1 @@ +tessedit_char_whitelist 0123456789 diff --git a/module/captcha/LinksaveIn/unblacked.png b/module/captcha/LinksaveIn/unblacked.png new file mode 100644 index 000000000..4fa056d3d Binary files /dev/null and b/module/captcha/LinksaveIn/unblacked.png differ -- cgit v1.2.3 From 0efe5e5cea1ce7658256d1826ab12c3ceb9a8e83 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 9 Dec 2009 22:14:56 +0100 Subject: DLC fixed --- module/plugins/DLC.pyc | Bin 2231 -> 5829 bytes module/plugins/LinkList.py | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 980dd8ace..879e679fc 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index e496f2a57..c934ca464 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -35,10 +35,11 @@ class LinkList(Plugin): if link != "\n": tmpLinks.append(link) txt.close() - - txt = open(linkList, 'w') - txt.write("") - txt.close() - #may delete read txt file? + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #may delete read txt file? self.links = tmpLinks -- cgit v1.2.3 From 93efe4b3ab66ef1deca2a7a8dfe04bcf3b3a7875 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 9 Dec 2009 22:44:30 +0100 Subject: incomplete: gui model-view stuff --- module/captcha/LinksaveIn.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/captcha/LinksaveIn.py b/module/captcha/LinksaveIn.py index 4219f03b5..15ccdb1ac 100644 --- a/module/captcha/LinksaveIn.py +++ b/module/captcha/LinksaveIn.py @@ -140,18 +140,24 @@ class LinksaveIn(OCR): self.eval_black_white() self.to_greyscale() self.image.save(self.data_dir+"cleaned_pass1.png") - self.clean(6) + self.clean(4) + self.clean(4) self.image.save(self.data_dir+"cleaned_pass2.png") letters = self.split_captcha_letters() + org = self.image + final = "" + for n, letter in enumerate(letters): + self.image = letter + self.image.save(ocr.data_dir+"letter%d.png" % n) + self.run_tesser() + final += self.result_captcha - self.run_tesser() - - return self.result_captcha + return final if __name__ == '__main__': import urllib ocr = LinksaveIn() testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D" - urllib.urlretrieve(testurl, "captcha.gif") + urllib.urlretrieve(testurl, ocr.data_dir+"captcha.gif") - print ocr.get_captcha('captcha.gif') + print ocr.get_captcha(ocr.data_dir+'captcha.gif') -- cgit v1.2.3 From 2c7203032324820c122b1e7b77604212391f75f9 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 10 Dec 2009 15:44:37 +0100 Subject: cleaned some code, pyLoad Script Support (closed #16) --- module/captcha/LinksaveIn.py | 2 -- module/network/Keepalive.py | 1 - module/plugins/HotfileCom.py | 1 - module/plugins/LinkList.py | 1 - module/plugins/RapidshareCom.py | 1 - module/thread_list.py | 26 ++++++++++++++++++++++---- module/web/WebServer.py | 1 - 7 files changed, 22 insertions(+), 11 deletions(-) (limited to 'module') diff --git a/module/captcha/LinksaveIn.py b/module/captcha/LinksaveIn.py index 15ccdb1ac..d6f61e362 100644 --- a/module/captcha/LinksaveIn.py +++ b/module/captcha/LinksaveIn.py @@ -6,7 +6,6 @@ from os.path import abspath from glob import glob import tempfile -from pprint import pprint class LinksaveIn(OCR): def __init__(self): @@ -144,7 +143,6 @@ class LinksaveIn(OCR): self.clean(4) self.image.save(self.data_dir+"cleaned_pass2.png") letters = self.split_captcha_letters() - org = self.image final = "" for n, letter in enumerate(letters): self.image = letter diff --git a/module/network/Keepalive.py b/module/network/Keepalive.py index 2443f5bbf..0ab3431ad 100644 --- a/module/network/Keepalive.py +++ b/module/network/Keepalive.py @@ -609,7 +609,6 @@ def test(url, N=10): test_timeout(url) if __name__ == '__main__': - import time import sys try: N = int(sys.argv[1]) diff --git a/module/plugins/HotfileCom.py b/module/plugins/HotfileCom.py index 7ae432c78..a046cb6b1 100644 --- a/module/plugins/HotfileCom.py +++ b/module/plugins/HotfileCom.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import re -import urllib from time import time from module.Plugin import Plugin diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index c934ca464..dba78ffd2 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -1,7 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -import re from module.Plugin import Plugin diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index f7bcb5de8..778383338 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -6,7 +6,6 @@ from time import time from module.Plugin import Plugin import hashlib -import logging class RapidshareCom(Plugin): diff --git a/module/thread_list.py b/module/thread_list.py index 3c69121c2..2faec1581 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -18,12 +18,12 @@ # ### from __future__ import with_statement +from os.path import exists import re import subprocess +from threading import RLock import time import urllib2 -from os.path import exists -from threading import RLock from download_thread import Download_Thread @@ -75,6 +75,7 @@ class Thread_List(object): if pyfile: self.py_downloading.append(pyfile) + self.scripts_download_preparing(pyfile.modul.__name__, pyfile.url) if not pyfile.plugin.multi_dl: self.occ_plugins.append(pyfile.modul.__name__) pyfile.active = True @@ -133,7 +134,7 @@ class Thread_List(object): pyfile.plugin.req.init_curl() elif pyfile.status.type == "failed": - self.parent.logger.warning("Download failed: " + pyfile.url+ " | " + pyfile.status.error) + self.parent.logger.warning("Download failed: " + pyfile.url + " | " + pyfile.status.error) with open(self.parent.config['general']['failed_file'], 'a') as f: f.write(pyfile.url + "\n") @@ -142,6 +143,8 @@ class Thread_List(object): self.list.save() + self.scripts_download_finished(pyfile.modul.__name__, pyfile.url, pyfile.status.filename, pyfile.download_folder) + self.lock.release() return True @@ -186,7 +189,7 @@ class Thread_List(object): return False def reconnect(self): - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method']) + reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'], stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" @@ -197,3 +200,18 @@ class Thread_List(object): ip = "" time.sleep(1) self.parent.logger.info("Reconnected, new IP: " + ip) + + + def scripts_download_preparing(self, pluginname, url): + for script in self.parent.scripts['download_preparing']: + out = subprocess.Popen([script, pluginname, url], stdout=subprocess.PIPE) + out.wait() + + def scripts_download_finished(self, pluginname, url, filename, location): + map(lambda script: subprocess.Popen([script, pluginname, url, filename, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + + def scripts_package_finished(self, name, location): #@TODO Implement! + map(lambda script: subprocess.Popen([script, name, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + + def scripts_reconnected(self, ip): + map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) diff --git a/module/web/WebServer.py b/module/web/WebServer.py index 3486bf7cb..15541676b 100644 --- a/module/web/WebServer.py +++ b/module/web/WebServer.py @@ -103,7 +103,6 @@ from bottle import route from bottle import run from bottle import send_file from bottle import template -from bottle import validate core = None -- cgit v1.2.3 From 6fdfdd1f85b0e2d95bdc8955459c0465833831d6 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 10 Dec 2009 21:38:03 +0100 Subject: create automatic script folders --- module/thread_list.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index 2faec1581..8c1695f38 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -199,13 +199,14 @@ class Thread_List(object): except: ip = "" time.sleep(1) + scripts_reconnected(ip) self.parent.logger.info("Reconnected, new IP: " + ip) def scripts_download_preparing(self, pluginname, url): - for script in self.parent.scripts['download_preparing']: - out = subprocess.Popen([script, pluginname, url], stdout=subprocess.PIPE) - out.wait() + for script in self.parent.scripts['download_preparing']: + out = subprocess.Popen([script, pluginname, url], stdout=subprocess.PIPE) + out.wait() def scripts_download_finished(self, pluginname, url, filename, location): map(lambda script: subprocess.Popen([script, pluginname, url, filename, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) -- cgit v1.2.3 From 95d09b338ac7aed2b387bf143a5cfd1c4b29f612 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Tue, 15 Dec 2009 17:48:30 +0100 Subject: new Django webinterface(in development), small fixes --- module/web/ServerThread.py | 15 + module/web/WebServer.py | 374 ------ module/web/__init__.py | 0 module/web/ajax/__init__.py | 0 module/web/ajax/models.py | 3 + module/web/ajax/tests.py | 23 + module/web/ajax/urls.py | 0 module/web/ajax/views.py | 1 + module/web/bottle.py | 1231 -------------------- module/web/main.html | 29 - module/web/main.js | 42 - module/web/manage.py | 12 + module/web/media/css/default.css | 145 +++ module/web/media/css/window.css | 17 + module/web/media/img/Button-Add-grey.png | Bin 0 -> 2112 bytes module/web/media/img/Button-Add.png | Bin 0 -> 2110 bytes module/web/media/img/Button-Pause-grey.png | Bin 0 -> 1932 bytes module/web/media/img/Button-Pause.png | Bin 0 -> 2146 bytes module/web/media/img/Button-Play-grey.png | Bin 0 -> 1938 bytes module/web/media/img/Button-Play.png | Bin 0 -> 2023 bytes module/web/media/img/big_button.gif | Bin 0 -> 1905 bytes module/web/media/img/big_button_over.gif | Bin 0 -> 728 bytes module/web/media/img/body.png | Bin 0 -> 402 bytes module/web/media/img/closebtn.gif | Bin 0 -> 254 bytes module/web/media/img/drag_corner.gif | Bin 0 -> 76 bytes module/web/media/img/full.png | Bin 0 -> 3543 bytes module/web/media/img/head-login.png | Bin 0 -> 1288 bytes module/web/media/img/head-menu-development.png | Bin 0 -> 1324 bytes module/web/media/img/head-menu-download.png | Bin 0 -> 721 bytes module/web/media/img/head-menu-home.png | Bin 0 -> 920 bytes module/web/media/img/head-menu-index.png | Bin 0 -> 482 bytes module/web/media/img/head-menu-news.png | Bin 0 -> 628 bytes module/web/media/img/head-menu-recent.png | Bin 0 -> 932 bytes module/web/media/img/head-menu-wiki.png | Bin 0 -> 1204 bytes module/web/media/img/head-search-noshadow.png | Bin 0 -> 1187 bytes module/web/media/img/head_bg1.png | Bin 0 -> 125 bytes module/web/media/img/page-tools-backlinks.png | Bin 0 -> 540 bytes module/web/media/img/page-tools-edit.png | Bin 0 -> 574 bytes module/web/media/img/page-tools-revisions.png | Bin 0 -> 603 bytes module/web/media/img/progress-bar-back.gif | Bin 0 -> 10819 bytes module/web/media/img/progress-bar.gif | Bin 0 -> 10819 bytes .../img/pyload-logo-edited3.5-new-font-small.png | Bin 0 -> 8457 bytes module/web/media/img/tab-background.png | Bin 0 -> 179 bytes module/web/media/img/tabs-border-bottom.png | Bin 0 -> 163 bytes module/web/media/img/user-actions-logout.png | Bin 0 -> 799 bytes module/web/media/img/user-actions-profile.png | Bin 0 -> 628 bytes module/web/media/js/home.js | 205 ++++ module/web/media/js/mootools-1.2.3-core.js | 335 ++++++ module/web/media/js/mootools-1.2.3.1-more.js | 76 ++ module/web/media/js/status.js | 100 ++ module/web/pyload.db | Bin 0 -> 32768 bytes module/web/pyload/__init__.py | 0 module/web/pyload/admin.py | 1 + module/web/pyload/models.py | 21 + module/web/pyload/tests.py | 23 + module/web/pyload/urls.py | 7 + module/web/pyload/views.py | 80 ++ module/web/settings.py | 127 ++ module/web/static/default.css | 189 --- module/web/static/default/Button-Add-grey.png | Bin 2112 -> 0 bytes module/web/static/default/Button-Add.png | Bin 2110 -> 0 bytes module/web/static/default/Button-Pause-grey.png | Bin 1932 -> 0 bytes module/web/static/default/Button-Pause.png | Bin 2146 -> 0 bytes module/web/static/default/Button-Play-grey.png | Bin 1938 -> 0 bytes module/web/static/default/Button-Play.png | Bin 2023 -> 0 bytes module/web/static/default/head-login.png | Bin 1288 -> 0 bytes .../web/static/default/head-menu-development.png | Bin 1324 -> 0 bytes module/web/static/default/head-menu-download.png | Bin 721 -> 0 bytes module/web/static/default/head-menu-home.png | Bin 920 -> 0 bytes module/web/static/default/head-menu-index.png | Bin 482 -> 0 bytes module/web/static/default/head-menu-news.png | Bin 628 -> 0 bytes module/web/static/default/head-menu-recent.png | Bin 932 -> 0 bytes module/web/static/default/head-menu-wiki.png | Bin 1204 -> 0 bytes module/web/static/default/head-search-noshadow.png | Bin 1187 -> 0 bytes module/web/static/default/head_bg1.png | Bin 125 -> 0 bytes module/web/static/default/home.js | 205 ---- module/web/static/default/page-tools-backlinks.png | Bin 540 -> 0 bytes module/web/static/default/page-tools-edit.png | Bin 574 -> 0 bytes module/web/static/default/page-tools-revisions.png | Bin 603 -> 0 bytes module/web/static/default/progress-bar-back.gif | Bin 10819 -> 0 bytes module/web/static/default/progress-bar.gif | Bin 10819 -> 0 bytes .../pyload-logo-edited3.5-new-font-small.png | Bin 8457 -> 0 bytes module/web/static/default/status.js | 100 -- module/web/static/default/tab-background.png | Bin 179 -> 0 bytes module/web/static/default/tabs-border-bottom.png | Bin 163 -> 0 bytes module/web/static/default/user-actions-logout.png | Bin 799 -> 0 bytes module/web/static/default/user-actions-profile.png | Bin 628 -> 0 bytes module/web/static/favicon.ico | Bin 7206 -> 0 bytes module/web/static/mootools-1.2.3-core.js | 335 ------ module/web/static/mootools-1.2.3.1-more.js | 76 -- module/web/static/window.css | 17 - module/web/static/window/big_button.gif | Bin 1905 -> 0 bytes module/web/static/window/big_button_over.gif | Bin 728 -> 0 bytes module/web/static/window/body.png | Bin 402 -> 0 bytes module/web/static/window/closebtn.gif | Bin 254 -> 0 bytes module/web/static/window/drag_corner.gif | Bin 76 -> 0 bytes module/web/static/window/full.png | Bin 3543 -> 0 bytes module/web/templates/default.tpl | 230 ---- module/web/templates/default/base.html | 99 ++ module/web/templates/default/downloads.html | 16 + module/web/templates/default/home.html | 1 + module/web/templates/default/login.html | 35 + module/web/templates/default/logout.html | 9 + module/web/templates/default/logs.html | 16 + module/web/templates/default/queue.html | 16 + module/web/templates/default/window.html | 28 + module/web/templates/footer.tpl | 6 - module/web/templates/header.tpl | 24 - module/web/templates/window.tpl | 28 - module/web/urls.py | 30 + 110 files changed, 1441 insertions(+), 2886 deletions(-) create mode 100644 module/web/ServerThread.py delete mode 100644 module/web/WebServer.py delete mode 100644 module/web/__init__.py create mode 100644 module/web/ajax/__init__.py create mode 100644 module/web/ajax/models.py create mode 100644 module/web/ajax/tests.py create mode 100644 module/web/ajax/urls.py create mode 100644 module/web/ajax/views.py delete mode 100644 module/web/bottle.py delete mode 100644 module/web/main.html delete mode 100644 module/web/main.js create mode 100644 module/web/manage.py create mode 100644 module/web/media/css/default.css create mode 100644 module/web/media/css/window.css create mode 100644 module/web/media/img/Button-Add-grey.png create mode 100644 module/web/media/img/Button-Add.png create mode 100644 module/web/media/img/Button-Pause-grey.png create mode 100644 module/web/media/img/Button-Pause.png create mode 100644 module/web/media/img/Button-Play-grey.png create mode 100644 module/web/media/img/Button-Play.png create mode 100644 module/web/media/img/big_button.gif create mode 100644 module/web/media/img/big_button_over.gif create mode 100644 module/web/media/img/body.png create mode 100644 module/web/media/img/closebtn.gif create mode 100644 module/web/media/img/drag_corner.gif create mode 100644 module/web/media/img/full.png create mode 100644 module/web/media/img/head-login.png create mode 100644 module/web/media/img/head-menu-development.png create mode 100644 module/web/media/img/head-menu-download.png create mode 100644 module/web/media/img/head-menu-home.png create mode 100644 module/web/media/img/head-menu-index.png create mode 100644 module/web/media/img/head-menu-news.png create mode 100644 module/web/media/img/head-menu-recent.png create mode 100644 module/web/media/img/head-menu-wiki.png create mode 100644 module/web/media/img/head-search-noshadow.png create mode 100644 module/web/media/img/head_bg1.png create mode 100644 module/web/media/img/page-tools-backlinks.png create mode 100644 module/web/media/img/page-tools-edit.png create mode 100644 module/web/media/img/page-tools-revisions.png create mode 100644 module/web/media/img/progress-bar-back.gif create mode 100644 module/web/media/img/progress-bar.gif create mode 100644 module/web/media/img/pyload-logo-edited3.5-new-font-small.png create mode 100644 module/web/media/img/tab-background.png create mode 100644 module/web/media/img/tabs-border-bottom.png create mode 100644 module/web/media/img/user-actions-logout.png create mode 100644 module/web/media/img/user-actions-profile.png create mode 100644 module/web/media/js/home.js create mode 100644 module/web/media/js/mootools-1.2.3-core.js create mode 100644 module/web/media/js/mootools-1.2.3.1-more.js create mode 100644 module/web/media/js/status.js create mode 100644 module/web/pyload.db create mode 100644 module/web/pyload/__init__.py create mode 100644 module/web/pyload/admin.py create mode 100644 module/web/pyload/models.py create mode 100644 module/web/pyload/tests.py create mode 100644 module/web/pyload/urls.py create mode 100644 module/web/pyload/views.py create mode 100644 module/web/settings.py delete mode 100644 module/web/static/default.css delete mode 100644 module/web/static/default/Button-Add-grey.png delete mode 100644 module/web/static/default/Button-Add.png delete mode 100644 module/web/static/default/Button-Pause-grey.png delete mode 100644 module/web/static/default/Button-Pause.png delete mode 100644 module/web/static/default/Button-Play-grey.png delete mode 100644 module/web/static/default/Button-Play.png delete mode 100644 module/web/static/default/head-login.png delete mode 100644 module/web/static/default/head-menu-development.png delete mode 100644 module/web/static/default/head-menu-download.png delete mode 100644 module/web/static/default/head-menu-home.png delete mode 100644 module/web/static/default/head-menu-index.png delete mode 100644 module/web/static/default/head-menu-news.png delete mode 100644 module/web/static/default/head-menu-recent.png delete mode 100644 module/web/static/default/head-menu-wiki.png delete mode 100644 module/web/static/default/head-search-noshadow.png delete mode 100644 module/web/static/default/head_bg1.png delete mode 100644 module/web/static/default/home.js delete mode 100644 module/web/static/default/page-tools-backlinks.png delete mode 100644 module/web/static/default/page-tools-edit.png delete mode 100644 module/web/static/default/page-tools-revisions.png delete mode 100644 module/web/static/default/progress-bar-back.gif delete mode 100644 module/web/static/default/progress-bar.gif delete mode 100644 module/web/static/default/pyload-logo-edited3.5-new-font-small.png delete mode 100644 module/web/static/default/status.js delete mode 100644 module/web/static/default/tab-background.png delete mode 100644 module/web/static/default/tabs-border-bottom.png delete mode 100644 module/web/static/default/user-actions-logout.png delete mode 100644 module/web/static/default/user-actions-profile.png delete mode 100644 module/web/static/favicon.ico delete mode 100644 module/web/static/mootools-1.2.3-core.js delete mode 100644 module/web/static/mootools-1.2.3.1-more.js delete mode 100644 module/web/static/window.css delete mode 100644 module/web/static/window/big_button.gif delete mode 100644 module/web/static/window/big_button_over.gif delete mode 100644 module/web/static/window/body.png delete mode 100644 module/web/static/window/closebtn.gif delete mode 100644 module/web/static/window/drag_corner.gif delete mode 100644 module/web/static/window/full.png delete mode 100644 module/web/templates/default.tpl create mode 100644 module/web/templates/default/base.html create mode 100644 module/web/templates/default/downloads.html create mode 100644 module/web/templates/default/home.html create mode 100644 module/web/templates/default/login.html create mode 100644 module/web/templates/default/logout.html create mode 100644 module/web/templates/default/logs.html create mode 100644 module/web/templates/default/queue.html create mode 100644 module/web/templates/default/window.html delete mode 100644 module/web/templates/footer.tpl delete mode 100644 module/web/templates/header.tpl delete mode 100644 module/web/templates/window.tpl create mode 100644 module/web/urls.py (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py new file mode 100644 index 000000000..803dc5dc5 --- /dev/null +++ b/module/web/ServerThread.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import threading +import os +from os.path import join + +class WebServer(threading.Thread): + def __init__(self, pycore): + threading.Thread.__init__(self) + self.pycore = pycore + self.setDaemon(True) + + def run(self): + self.pycore.logger.info("Starting Webserver @ Port 8000") + os.system("python " + join(self.pycore.path,"module","web","manage.py runserver")) + #@TODO: really bad approach, better would be real python code, or subprocess \ No newline at end of file diff --git a/module/web/WebServer.py b/module/web/WebServer.py deleted file mode 100644 index 15541676b..000000000 --- a/module/web/WebServer.py +++ /dev/null @@ -1,374 +0,0 @@ -#import sys -#from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler -#from xmlrpclib import ServerProxy -#from time import time -#import re -# -#class Handler(BaseHTTPRequestHandler): -# -# def do_GET(self): -# global coreserver -# stdout = sys.stdout -# sys.stdout = self.wfile -# if self.path == "/": -# print "Server Runs" -# elif self.path == "/downloads": -# print self.get_downloads() -# elif re.search("/add=.?", self.path): -# if re.match(is_url, self.path.split("/add=")[1]): -# coreserver.add_urls([self.path.split("/add=")[1]]) -# print "Link Added" -# else: -# try: -# print open(self.path[1:], 'r').read() -# except IOError: -# self.send_error(404) -# -# def format_size(self, size): -# return str(size / 1024) + " MiB" -# -# def format_time(self,seconds): -# seconds = int(seconds) -# hours, seconds = divmod(seconds, 3600) -# minutes, seconds = divmod(seconds, 60) -# return "%.2i:%.2i:%.2i" % (hours, minutes, seconds) -# -# def get_downloads(self): -# data = coreserver.status_downloads() -# for download in data: -# print "<h3>%s</h3>" % download["name"] -# if download["status"] == "downloading": -# percent = download["percent"] -# z = percent / 4 -# print "<h3>%s</h3>" % dl_name -# print "<font face='font-family:Fixedsys,Courier,monospace;'>[" + z * "#" + (25-z) * " " + "]</font>" + str(percent) + "%<br />" -# print "Speed: " + str(int(download['speed'])) + " kb/s" -# print "Size: " + self.format_size(download['size']) -# print "Finished in: " + self.format_time(download['eta']) -# print "ID: " + str(download['id']) -# dl_status = "[" + z * "#" + (25-z) * " " + "] " + str(percent) + "%" + " Speed: " + str(int(download['speed'])) + " kb/s" + " Size: " + self.format_size(download['size']) + " Finished in: " + self.format_time(download['eta']) + " ID: " + str(download['id']) -# if download["status"] == "waiting": -# print "waiting: " + self.format_time(download["wait_until"]- time()) -# -#is_url = re.compile("^(((https?|ftp)\:\/\/)?([\w\.\-]+(\:[\w\.\&%\$\-]+)*@)?((([^\s\(\)\<\>\\\"\.\[\]\,@;:]+)(\.[^\s\(\)\<\>\\\"\.\[\]\,@;:]+)*(\.[a-zA-Z]{2,4}))|((([01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}([01]?\d{1,2}|2[0-4]\d|25[0-5])))(\b\:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{0,3}|0)\b)?((\/[^\/][\w\.\,\?\'\\\/\+&%\$#\=~_\-@]*)*[^\.\,\?\"\'\(\)\[\]!;<>{}\s\x7F-\xFF])?)$",re.IGNORECASE) -# -#coreserver = None -# -#class WebServer(): -# -# def start(self): -# try: -# global coreserver -# coreserver = ServerProxy("https://testuser:testpw@localhost:1337", allow_none=True) -# webserver = HTTPServer(('',8080),Handler) -# print 'server started at port 8080' -# webserver.serve_forever() -# except KeyboardInterrupt: -# webserver.socket.close() -# -#if __name__ == "__main__": -# web = WebServer() -# web.start() - - -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -#Copyright (C) 2009 RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### -import random -import threading -import time - -import bottle -from bottle import abort -from bottle import redirect -from bottle import request -from bottle import response -from bottle import route -from bottle import run -from bottle import send_file -from bottle import template - - -core = None -core_methods = None - -PATH = "./module/web/" -TIME = time.strftime("%a, %d %b %Y 00:00:00 +0000", time.localtime()) #set time to current day -USERS = {} -# TODO: Implement new server methods -@route('/login', method='POST') -def do_login(): - #print request.GET - - - username = core.config['webinterface']['username'] - pw = core.config['webinterface']['password'] - - if request.POST['u'] == username and request.POST['p'] == pw: - - id = int(random.getrandbits(16)) - ua = request.HEADER("HTTP_USER_AGENT") - ip = request.HEADER("REMOTE_ADDR") - - auth = {} - - auth['ua'] = ua - auth['ip'] = ip - auth['user'] = username - - USERS[id] = auth - - response.COOKIES['user'] = username - response.COOKIES['id'] = id - - return template('default', page='loggedin', user=username) - else: - return template('default', page='login') - -@route('/login') -def login(): - - if check_auth(request): - redirect("/") - - return template('default', page='login') - -@route('/logout') -def logout(): - try: - del USERS[int(request.COOKIES.get('id'))] - except: - pass - - redirect("/login") - -@route('/') -def home(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - dls = core_methods.status_downloads() - - for dl in dls: - dl['eta'] = str(core.format_time(dl['eta'])) - dl['wait_until'] = str(core.format_time(dl['wait_until'] - time.time())) - - - return template('default', page='home', links=dls, user=username, status=core_methods.status_server()) - -@route('/queue') -def queue(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='queue', links=core_methods.get_queue(), user=username, status=core_methods.status_server()) - -@route('/downloads') -def downloads(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='downloads', links=core_methods.status_downloads(), user=username, status=core_methods.status_server()) - - -@route('/logs') -def logs(): - - if not check_auth(request): - redirect("/login") - - username = request.COOKIES.get('user') - - return template('default', page='logs', links=core_methods.status_downloads(), user=username, status=core_methods.status_server()) - -@route('/json/links') -def get_links(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - json = '{ "downloads": [' - - downloads = core_methods.status_downloads() - ids = [] - - for dl in downloads: - ids.append(dl['id']) - json += '{' - json += '"id": %s, "name": "%s", "speed": %s, "eta": "%s", "kbleft": %s, "size": %s, "percent": %s, "wait": "%s", "status": "%s"'\ - % (str(dl['id']), str(dl['name']), str(int(dl['speed'])), str(core.format_time(dl['eta'])), dl['kbleft'], dl['size'], dl['percent'], str(core.format_time(dl['wait_until'] - time.time())), dl['status']) - - json += "}," - - if json.endswith(","): json = json[:-1] - - json += '], "ids": %s }' % str(ids) - - return json - -@route('/json/status') -def get_status(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - data = core_methods.status_server() - - if data['pause']: - status = "paused" - else: - status = "running" - - json = '{ "status": "%s", "speed": "%s", "queue": "%s" }' % (status, str(int(data['speed'])), str(data['queue'])) - - return json -@route('json/addpackage', method='POST') -def add_package(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - links = request.POST['links'].split('\n') - name = request.POST['name'] - core_methods.add_package(name, links) - -@route('/json/addlinks', method='POST') -def add_links(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - links = request.POST['links'].split('\n') - - core.add_links(links) - - return "{}" - -@route('/json/pause') -def pause(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - core.thread_list.pause = True - - return "{}" - - -@route('/json/play') -def play(): - response.header['Cache-Control'] = 'no-cache, must-revalidate' - response.content_type = 'application/json' - - if not check_auth(request): - abort(404, "No Access") - - core.thread_list.pause = False - - return "{}" - -@route('/favicon.ico') -def favicon(): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - - send_file('favicon.ico', root=(PATH + 'static/')) - -@route('static/:section/:filename') -def static_folder(section, filename): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - send_file(filename, root=(PATH + 'static/' + section)) - -@route('/static/:filename') -def static_file(filename): - - if request.HEADER("HTTP_IF_MODIFIED_SINCE") == TIME: abort(304, "Not Modified") - - response.header['Last-Modified'] = TIME - send_file(filename, root=(PATH + 'static/')) - - -def check_auth(req): - - try: - user = req.COOKIES.get('user') - id = int(req.COOKIES.get('id')) - ua = req.HEADER("HTTP_USER_AGENT") - ip = req.HEADER("REMOTE_ADDR") - - if USERS[id]['user'] == user and USERS[id]['ua'] == ua and USERS[id]['ip'] == ip: - return True - except: - return False - - return False - - -class WebServer(threading.Thread): - def __init__(self, pycore): - threading.Thread.__init__(self) - - global core, core_methods, TIME - core = pycore - core_methods = pycore.server_methods - self.core = pycore - self.setDaemon(True) - - if pycore.config['general']['debug_mode']: - bottle.debug(True) - TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) - else: - bottle.debug(False) - - #@TODO remove - #TIME = time.strftime("%a, %d %b %Y %H:%M:%S +0000", time.localtime()) - - bottle.TEMPLATE_PATH.append('./module/web/templates/') - - def run(self): - self.core.logger.info("Starting Webinterface on %s port %s" % (self.core.config['webinterface']['listenaddr'],self.core.config['webinterface']['port'])) - try: - run(host=self.core.config['webinterface']['listenaddr'], port=int(self.core.config['webinterface']['port']), quiet=True) - except: - self.core.logger.error("Failed starting webserver, no webinterface available: Can't create socket") - exit() \ No newline at end of file diff --git a/module/web/__init__.py b/module/web/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/module/web/ajax/__init__.py b/module/web/ajax/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/web/ajax/models.py b/module/web/ajax/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/module/web/ajax/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/module/web/ajax/tests.py b/module/web/ajax/tests.py new file mode 100644 index 000000000..2247054b3 --- /dev/null +++ b/module/web/ajax/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py new file mode 100644 index 000000000..60f00ef0e --- /dev/null +++ b/module/web/ajax/views.py @@ -0,0 +1 @@ +# Create your views here. diff --git a/module/web/bottle.py b/module/web/bottle.py deleted file mode 100644 index 41a8c8fc0..000000000 --- a/module/web/bottle.py +++ /dev/null @@ -1,1231 +0,0 @@ -# -*- coding: utf-8 -*- -""" -Bottle is a fast and simple micro-framework for small web applications. It -offers request dispatching (Routes) with url parameter support, templates, -key/value databases, a built-in HTTP Server and adapters for many third party -WSGI/HTTP-server and template engines - all in a single file and with no -dependencies other than the Python Standard Library. - -Homepage and documentation: http://wiki.github.com/defnull/bottle - -Special thanks to Stefan Matthias Aust [http://github.com/sma] - for his contribution to SimpleTemplate - -Licence (MIT) -------------- - - Copyright (c) 2009, Marcel Hellkamp. - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - - -Example -------- - - from bottle import route, run, request, response, send_file, abort - - @route('/') - def hello_world(): - return 'Hello World!' - - @route('/hello/:name') - def hello_name(name): - return 'Hello %s!' % name - - @route('/hello', method='POST') - def hello_post(): - name = request.POST['name'] - return 'Hello %s!' % name - - @route('/static/:filename#.*#') - def static_file(filename): - send_file(filename, root='/path/to/static/files/') - - run(host='localhost', port=8080) - -""" - -__author__ = 'Marcel Hellkamp' -__version__ = '0.6.4' -__license__ = 'MIT' - -import types -import sys -import cgi -import mimetypes -import os -import os.path -import traceback -import re -import random -import threading -import time -import warnings -import email.utils -from wsgiref.headers import Headers as HeaderWrapper -from Cookie import SimpleCookie -import anydbm as dbm -import subprocess -import thread - - -try: - from urlparse import parse_qs -except ImportError: # pragma: no cover - from cgi import parse_qs - -try: - import cPickle as pickle -except ImportError: # pragma: no cover - import pickle as pickle - -try: - try: - from json import dumps as json_dumps - except ImportError: # pragma: no cover - from simplejson import dumps as json_dumps -except ImportError: # pragma: no cover - json_dumps = None - - - - - - -# Exceptions and Events - -class BottleException(Exception): - """ A base class for exceptions used by bottle. """ - pass - - -class HTTPError(BottleException): - """ - A way to break the execution and instantly jump to an error handler. - """ - def __init__(self, status, text): - self.output = text - self.http_status = int(status) - BottleException.__init__(self, status, text) - - def __repr__(self): - return 'HTTPError(%d,%s)' % (self.http_status, repr(self.output)) - - def __str__(self): - return HTTP_ERROR_TEMPLATE % { - 'status' : self.http_status, - 'url' : request.path, - 'error_name' : HTTP_CODES.get(self.http_status, 'Unknown').title(), - 'error_message' : ''.join(self.output) - } - - -class BreakTheBottle(BottleException): - """ - Not an exception, but a straight jump out of the controller code. - Causes the Bottle to instantly call start_response() and return the - content of output - """ - def __init__(self, output): - self.output = output - - - - - - -# WSGI abstraction: Request and response management - -_default_app = None -def default_app(newapp = None): - """ - Returns the current default app or sets a new one. - Defaults to an instance of Bottle - """ - global _default_app - if newapp: - _default_app = newapp - if not _default_app: - _default_app = Bottle() - return _default_app - - -class Bottle(object): - - def __init__(self, catchall=True, optimize=False, autojson=True): - self.simple_routes = {} - self.regexp_routes = {} - self.default_route = None - self.error_handler = {} - self.optimize = optimize - self.autojson = autojson - self.catchall = catchall - self.serve = True - - def match_url(self, url, method='GET'): - """ - Returns the first matching handler and a parameter dict or (None, None) - """ - url = url.strip().lstrip("/ ") - # Search for static routes first - route = self.simple_routes.get(method,{}).get(url,None) - if route: - return (route, {}) - - routes = self.regexp_routes.get(method,[]) - for i in range(len(routes)): - match = routes[i][0].match(url) - if match: - handler = routes[i][1] - if i > 0 and self.optimize and random.random() <= 0.001: - routes[i-1], routes[i] = routes[i], routes[i-1] - return (handler, match.groupdict()) - if self.default_route: - return (self.default_route, {}) - if method == 'HEAD': # Fall back to GET - return self.match_url(url) - else: - return (None, None) - - def add_controller(self, route, controller, **kargs): - """ Adds a controller class or object """ - if '{action}' not in route and 'action' not in kargs: - raise BottleException("Routes to controller classes or object MUST" - " contain an {action} placeholder or use the action-parameter") - for action in (m for m in dir(controller) if not m.startswith('_')): - handler = getattr(controller, action) - if callable(handler) and action == kargs.get('action', action): - self.add_route(route.replace('{action}', action), handler, **kargs) - - def add_route(self, route, handler, method='GET', simple=False, **kargs): - """ Adds a new route to the route mappings. """ - if isinstance(handler, type) and issubclass(handler, BaseController): - handler = handler() - if isinstance(handler, BaseController): - self.add_controller(route, handler, method=method, simple=simple, **kargs) - return - method = method.strip().upper() - route = route.strip().lstrip('$^/ ').rstrip('$^ ') - if re.match(r'^(\w+/)*\w*$', route) or simple: - self.simple_routes.setdefault(method, {})[route] = handler - else: - route = re.sub(r':([a-zA-Z_]+)(?P<uniq>[^\w/])(?P<re>.+?)(?P=uniq)', - r'(?P<\1>\g<re>)',route) - route = re.sub(r':([a-zA-Z_]+)', r'(?P<\1>[^/]+)', route) - route = re.compile('^%s$' % route) - self.regexp_routes.setdefault(method, []).append([route, handler]) - - def route(self, url, **kargs): - """ - Decorator for request handler. - Same as add_route(url, handler, **kargs). - """ - def wrapper(handler): - self.add_route(url, handler, **kargs) - return handler - return wrapper - - def set_default(self, handler): - self.default_route = handler - - def default(self): - """ Decorator for request handler. Same as add_defroute( handler ).""" - def wrapper(handler): - self.set_default(handler) - return handler - return wrapper - - def set_error_handler(self, code, handler): - """ Adds a new error handler. """ - self.error_handler[int(code)] = handler - - def error(self, code=500): - """ - Decorator for error handler. - Same as set_error_handler(code, handler). - """ - def wrapper(handler): - self.set_error_handler(code, handler) - return handler - return wrapper - - def cast(self, out): - """ - Cast the output to an iterable of strings or something WSGI can handle. - Set Content-Type and Content-Length when possible. Then clear output - on HEAD requests. - Supports: False, str, unicode, list(unicode), dict(), open() - """ - if not out: - out = [] - response.header['Content-Length'] = '0' - elif isinstance(out, types.StringType): - out = [out] - elif isinstance(out, unicode): - out = [out.encode(response.charset)] - elif isinstance(out, list) and isinstance(out[0], unicode): - out = map(lambda x: x.encode(response.charset), out) - elif self.autojson and json_dumps and isinstance(out, dict): - out = [json_dumps(out)] - response.content_type = 'application/json' - elif hasattr(out, 'read'): - out = request.environ.get('wsgi.file_wrapper', - lambda x: iter(lambda: x.read(8192), ''))(out) - if isinstance(out, list) and len(out) == 1: - response.header['Content-Length'] = str(len(out[0])) - if not hasattr(out, '__iter__'): - raise TypeError('Request handler for route "%s" returned [%s] ' - 'which is not iterable.' % (request.path, type(out).__name__)) - return out - - - def __call__(self, environ, start_response): - """ The bottle WSGI-interface. """ - request.bind(environ) - response.bind() - try: # Unhandled Exceptions - try: # Bottle Error Handling - if not self.serve: - abort(503, "Server stopped") - handler, args = self.match_url(request.path, request.method) - if not handler: - raise HTTPError(404, "Not found") - output = handler(**args) - db.close() - except BreakTheBottle, e: - output = e.output - except HTTPError, e: - response.status = e.http_status - output = self.error_handler.get(response.status, str)(e) - output = self.cast(output) - if response.status in (100, 101, 204, 304) or request.method == 'HEAD': - output = [] # rfc2616 section 4.3 - except (KeyboardInterrupt, SystemExit, MemoryError): - raise - except Exception, e: - response.status = 500 - if self.catchall: - err = "Unhandled Exception: %s\n" % (repr(e)) - if DEBUG: - err += TRACEBACK_TEMPLATE % traceback.format_exc(10) - output = [str(HTTPError(500, err))] - request._environ['wsgi.errors'].write(err) - else: - raise - status = '%d %s' % (response.status, HTTP_CODES[response.status]) - start_response(status, response.wsgiheaders()) - return output - - - -class Request(threading.local): - """ Represents a single request using thread-local namespace. """ - - def bind(self, environ): - """ - Binds the enviroment of the current request to this request handler - """ - self._environ = environ - self.environ = self._environ - self._GET = None - self._POST = None - self._GETPOST = None - self._COOKIES = None - self.path = self._environ.get('PATH_INFO', '/').strip() - if not self.path.startswith('/'): - self.path = '/' + self.path - - @property - def method(self): - """ Get the request method (GET,POST,PUT,DELETE,...) """ - return self._environ.get('REQUEST_METHOD', 'GET').upper() - - @property - def query_string(self): - """ Get content of QUERY_STRING """ - return self._environ.get('QUERY_STRING', '') - - @property - def input_length(self): - """ Get content of CONTENT_LENGTH """ - try: - return max(0,int(self._environ.get('CONTENT_LENGTH', '0'))) - except ValueError: - return 0 - - @property - def GET(self): - """ Get a dict with GET parameters. """ - if self._GET is None: - data = parse_qs(self.query_string, keep_blank_values=True) - self._GET = {} - for key, value in data.iteritems(): - if len(value) == 1: - self._GET[key] = value[0] - else: - self._GET[key] = value - return self._GET - - @property - def POST(self): - """ Get a dict with parsed POST or PUT data. """ - if self._POST is None: - data = cgi.FieldStorage(fp=self._environ['wsgi.input'], - environ=self._environ, keep_blank_values=True) - self._POST = {} - for item in data.list: - name = item.name - if not item.filename: - item = item.value - self._POST.setdefault(name, []).append(item) - for key in self._POST: - if len(self._POST[key]) == 1: - self._POST[key] = self._POST[key][0] - return self._POST - - @property - def params(self): - """ Returns a mix of GET and POST data. POST overwrites GET """ - if self._GETPOST is None: - self._GETPOST = dict(self.GET) - self._GETPOST.update(dict(self.POST)) - return self._GETPOST - - @property - def COOKIES(self): - """ Returns a dict with COOKIES. """ - if self._COOKIES is None: - raw_dict = SimpleCookie(self._environ.get('HTTP_COOKIE','')) - self._COOKIES = {} - for cookie in raw_dict.itervalues(): - self._COOKIES[cookie.key] = cookie.value - return self._COOKIES - - def HEADER(self, header): - """Returns HTTP header""" - return self._environ.get(header, '') - -class Response(threading.local): - """ Represents a single response using thread-local namespace. """ - - def bind(self): - """ Clears old data and creates a brand new Response object """ - self._COOKIES = None - self.status = 200 - self.header_list = [] - self.header = HeaderWrapper(self.header_list) - self.content_type = 'text/html' - self.error = None - self.charset = 'utf8' - - def wsgiheaders(self): - ''' Returns a wsgi conform list of header/value pairs ''' - for c in self.COOKIES.itervalues(): - self.header.add_header('Set-Cookie', c.OutputString()) - return [(h.title(), str(v)) for h, v in self.header.items()] - - @property - def COOKIES(self): - if not self._COOKIES: - self._COOKIES = SimpleCookie() - return self._COOKIES - - def set_cookie(self, key, value, **kargs): - """ - Sets a Cookie. Optional settings: - expires, path, comment, domain, max-age, secure, version, httponly - """ - self.COOKIES[key] = value - for k, v in kargs.iteritems(): - self.COOKIES[key][k] = v - - def get_content_type(self): - """ Get the current 'Content-Type' header. """ - return self.header['Content-Type'] - - def set_content_type(self, value): - if 'charset=' in value: - self.charset = value.split('charset=')[-1].split(';')[0].strip() - self.header['Content-Type'] = value - - content_type = property(get_content_type, set_content_type, None, - get_content_type.__doc__) - - -class BaseController(object): - _singleton = None - def __new__(cls, *a, **k): - if not cls._singleton: - cls._singleton = object.__new__(cls, *a, **k) - return cls._singleton - - -def abort(code=500, text='Unknown Error: Appliction stopped.'): - """ Aborts execution and causes a HTTP error. """ - raise HTTPError(code, text) - - -def redirect(url, code=307): - """ Aborts execution and causes a 307 redirect """ - response.status = code - response.header['Location'] = url - raise BreakTheBottle("") - - -def send_file(filename, root, guessmime = True, mimetype = None): - """ Aborts execution and sends a static files as response. """ - root = os.path.abspath(root) + os.sep - filename = os.path.abspath(os.path.join(root, filename.strip('/\\'))) - - if not filename.startswith(root): - abort(401, "Access denied.") - if not os.path.exists(filename) or not os.path.isfile(filename): - abort(404, "File does not exist.") - if not os.access(filename, os.R_OK): - abort(401, "You do not have permission to access this file.") - - if guessmime and not mimetype: - mimetype = mimetypes.guess_type(filename)[0] - if not mimetype: mimetype = 'text/plain' - response.content_type = mimetype - - stats = os.stat(filename) - if 'Last-Modified' not in response.header: - lm = time.strftime("%a, %d %b %Y %H:%M:%S GMT", time.gmtime(stats.st_mtime)) - response.header['Last-Modified'] = lm - if 'HTTP_IF_MODIFIED_SINCE' in request.environ: - ims = request.environ['HTTP_IF_MODIFIED_SINCE'] - # IE sends "<date>; length=146" - ims = ims.split(";")[0].strip() - ims = parse_date(ims) - if ims is not None and ims >= stats.st_mtime: - abort(304, "Not modified") - if 'Content-Length' not in response.header: - response.header['Content-Length'] = str(stats.st_size) - raise BreakTheBottle(open(filename, 'rb')) - - -def parse_date(ims): - """ - Parses date strings usually found in HTTP header and returns UTC epoch. - Understands rfc1123, rfc850 and asctime. - """ - try: - ts = email.utils.parsedate_tz(ims) - if ts is not None: - if ts[9] is None: - return time.mktime(ts[:8] + (0,)) - time.timezone - else: - return time.mktime(ts[:8] + (0,)) - ts[9] - time.timezone - except (ValueError, IndexError): - return None - - - - - - -# Decorators - -def validate(**vkargs): - """ - Validates and manipulates keyword arguments by user defined callables. - Handles ValueError and missing arguments by raising HTTPError(403). - """ - def decorator(func): - def wrapper(**kargs): - for key, value in vkargs.iteritems(): - if key not in kargs: - abort(403, 'Missing parameter: %s' % key) - try: - kargs[key] = value(kargs[key]) - except ValueError, e: - abort(403, 'Wrong parameter format for: %s' % key) - return func(**kargs) - return wrapper - return decorator - - -def route(url, **kargs): - """ - Decorator for request handler. Same as add_route(url, handler, **kargs). - """ - return default_app().route(url, **kargs) - -def default(): - """ - Decorator for request handler. Same as set_default(handler). - """ - return default_app().default() - -def error(code=500): - """ - Decorator for error handler. Same as set_error_handler(code, handler). - """ - return default_app().error(code) - - - - - - -# Server adapter - -class WSGIAdapter(object): - def run(self, handler): # pragma: no cover - pass - - def __repr__(self): - return "%s()" % (self.__class__.__name__) - - -class CGIServer(WSGIAdapter): - def run(self, handler): - from wsgiref.handlers import CGIHandler - CGIHandler().run(handler) - - -class ServerAdapter(WSGIAdapter): - def __init__(self, host='127.0.0.1', port=8080, **kargs): - WSGIAdapter.__init__(self) - self.host = host - self.port = int(port) - self.options = kargs - - def __repr__(self): - return "%s (%s:%d)" % (self.__class__.__name__, self.host, self.port) - - -class WSGIRefServer(ServerAdapter): - def run(self, handler): - from wsgiref.simple_server import make_server - srv = make_server(self.host, self.port, handler) - srv.serve_forever() - - -class CherryPyServer(ServerAdapter): - def run(self, handler): - from cherrypy import wsgiserver - server = wsgiserver.CherryPyWSGIServer((self.host, self.port), handler) - server.start() - - -class FlupServer(ServerAdapter): - def run(self, handler): - from flup.server.fcgi import WSGIServer - WSGIServer(handler, bindAddress=(self.host, self.port)).run() - - -class PasteServer(ServerAdapter): - def run(self, handler): - from paste import httpserver - from paste.translogger import TransLogger - app = TransLogger(handler) - httpserver.serve(app, host=self.host, port=str(self.port)) - - -class FapwsServer(ServerAdapter): - """ - Extremly fast webserver using libev. - See http://william-os4y.livejournal.com/ - Experimental ... - """ - def run(self, handler): - import fapws._evwsgi as evwsgi - from fapws import base - evwsgi.start(self.host, self.port) - evwsgi.set_base_module(base) - def app(environ, start_response): - environ['wsgi.multiprocess'] = False - return handler(environ, start_response) - evwsgi.wsgi_cb(('',app)) - evwsgi.run() - - -def run(app=None, server=WSGIRefServer, host='127.0.0.1', port=8080, - interval=1, reloader=False, **kargs): - """ Runs bottle as a web server. """ - if not app: - app = default_app() - - quiet = bool(kargs.get('quiet', False)) - - # Instantiate server, if it is a class instead of an instance - if isinstance(server, type): - if issubclass(server, CGIServer): - server = server() - elif issubclass(server, ServerAdapter): - server = server(host=host, port=port, **kargs) - - if not isinstance(server, WSGIAdapter): - raise RuntimeError("Server must be a subclass of WSGIAdapter") - - if not quiet and isinstance(server, ServerAdapter): # pragma: no cover - if not reloader or os.environ.get('BOTTLE_CHILD') == 'true': - print "Bottle server starting up (using %s)..." % repr(server) - print "Listening on http://%s:%d/" % (server.host, server.port) - print "Use Ctrl-C to quit." - print - else: - print "Bottle auto reloader starting up..." - - try: - if reloader and interval: - reloader_run(server, app, interval) - else: - server.run(app) - except KeyboardInterrupt: - if not quiet: # pragma: no cover - print "Shutting Down..." - - -#TODO: If the parent process is killed (with SIGTERM) the childs survive... -def reloader_run(server, app, interval): - if os.environ.get('BOTTLE_CHILD') == 'true': - # We are a child process - files = dict() - for module in sys.modules.values(): - file_path = getattr(module, '__file__', None) - if file_path and os.path.isfile(file_path): - file_split = os.path.splitext(file_path) - if file_split[1] in ('.py', '.pyc', '.pyo'): - file_path = file_split[0] + '.py' - files[file_path] = os.stat(file_path).st_mtime - thread.start_new_thread(server.run, (app,)) - while True: - time.sleep(interval) - for file_path, file_mtime in files.iteritems(): - if not os.path.exists(file_path): - print "File changed: %s (deleted)" % file_path - elif os.stat(file_path).st_mtime > file_mtime: - print "File changed: %s (modified)" % file_path - else: continue - print "Restarting..." - app.serve = False - time.sleep(interval) # be nice and wait for running requests - sys.exit(3) - while True: - args = [sys.executable] + sys.argv - environ = os.environ.copy() - environ['BOTTLE_CHILD'] = 'true' - exit_status = subprocess.call(args, env=environ) - if exit_status != 3: - sys.exit(exit_status) - - - - - -# Templates - -class TemplateError(HTTPError): - def __init__(self, message): - HTTPError.__init__(self, 500, message) - -class BaseTemplate(object): - def __init__(self, template='', name=None, filename=None, lookup=[]): - """ - Create a new template. - If a name is provided, but no filename and no template string, the - filename is guessed using the lookup path list. - Subclasses can assume that either self.template or self.filename is set. - If both are present, self.template should be used. - """ - self.name = name - self.filename = filename - self.template = template - self.lookup = lookup - if self.name and not self.filename: - for path in self.lookup: - fpath = os.path.join(path, self.name+'.tpl') - if os.path.isfile(fpath): - self.filename = fpath - if not self.template and not self.filename: - raise TemplateError('Template (%s) not found.' % self.name) - self.prepare() - - def prepare(self): - """ - Run preparatios (parsing, caching, ...). - It should be possible to call this multible times to refresh a template. - """ - raise NotImplementedError - - def render(self, **args): - """ - Render the template with the specified local variables and return an - iterator of strings (bytes). This must be thread save! - """ - raise NotImplementedError - - -class MakoTemplate(BaseTemplate): - output_encoding=None - input_encoding=None - default_filters=None - global_variables={} - - def prepare(self): - from mako.template import Template - from mako.lookup import TemplateLookup - #TODO: This is a hack... http://github.com/defnull/bottle/issues#issue/8 - mylookup = TemplateLookup(directories=map(os.path.abspath, self.lookup)+['./']) - if self.template: - self.tpl = Template(self.template, - lookup=mylookup, - output_encoding=MakoTemplate.output_encoding, - input_encoding=MakoTemplate.input_encoding, - default_filters=MakoTemplate.default_filters - ) - else: - self.tpl = Template(filename=self.filename, - lookup=mylookup, - output_encoding=MakoTemplate.output_encoding, - input_encoding=MakoTemplate.input_encoding, - default_filters=MakoTemplate.default_filters - ) - - def render(self, **args): - _defaults = MakoTemplate.global_variables.copy() - _defaults.update(args) - return self.tpl.render(**_defaults) - - -class CheetahTemplate(BaseTemplate): - def prepare(self): - from Cheetah.Template import Template - self.context = threading.local() - self.context.vars = {} - if self.template: - self.tpl = Template(source=self.template, searchList=[self.context.vars]) - else: - self.tpl = Template(file=self.filename, searchList=[self.context.vars]) - - def render(self, **args): - self.context.vars.update(args) - out = str(self.tpl) - self.context.vars.clear() - return [out] - - -class Jinja2Template(BaseTemplate): - env = None # hopefully, a Jinja environment is actually thread-safe - - def prepare(self): - if not self.env: - from jinja2 import Environment, FunctionLoader - self.env = Environment(line_statement_prefix="#", loader=FunctionLoader(self.loader)) - if self.template: - self.tpl = self.env.from_string(self.template) - else: - self.tpl = self.env.get_template(self.filename) - - def render(self, **args): - return self.tpl.render(**args).encode("utf-8") - - def loader(self, name): - if not name.endswith(".tpl"): - for path in self.lookup: - fpath = os.path.join(path, name+'.tpl') - if os.path.isfile(fpath): - name = fpath - break - f = open(name) - try: return f.read() - finally: f.close() - - -class SimpleTemplate(BaseTemplate): - re_python = re.compile(r'^\s*%\s*(?:(if|elif|else|try|except|finally|for|' - 'while|with|def|class)|(include|rebase)|(end)|(.*))') - re_inline = re.compile(r'\{\{(.*?)\}\}') - dedent_keywords = ('elif', 'else', 'except', 'finally') - - def prepare(self): - if self.template: - code = self.translate(self.template) - self.co = compile(code, '<string>', 'exec') - else: - code = self.translate(open(self.filename).read()) - self.co = compile(code, self.filename, 'exec') - - def translate(self, template): - indent = 0 - strbuffer = [] - code = [] - self.includes = dict() - class PyStmt(str): - def __repr__(self): return 'str(' + self + ')' - def flush(allow_nobreak=False): - if len(strbuffer): - if allow_nobreak and strbuffer[-1].endswith("\\\\\n"): - strbuffer[-1]=strbuffer[-1][:-3] - code.append(' ' * indent + "_stdout.append(%s)" % repr(''.join(strbuffer))) - code.append((' ' * indent + '\n') * len(strbuffer)) # to preserve line numbers - del strbuffer[:] - for line in template.splitlines(True): - m = self.re_python.match(line) - if m: - flush(allow_nobreak=True) - keyword, subtpl, end, statement = m.groups() - if keyword: - if keyword in self.dedent_keywords: - indent -= 1 - code.append(" " * indent + line[m.start(1):]) - indent += 1 - elif subtpl: - tmp = line[m.end(2):].strip().split(None, 1) - if not tmp: - code.append(' ' * indent + "_stdout.extend(_base)\n") - else: - name = tmp[0] - args = tmp[1:] and tmp[1] or '' - if name not in self.includes: - self.includes[name] = SimpleTemplate(name=name, lookup=self.lookup) - if subtpl == 'include': - code.append(' ' * indent + - "_ = _includes[%s].execute(_stdout, %s)\n" - % (repr(name), args)) - else: - code.append(' ' * indent + - "_tpl['_rebase'] = (_includes[%s], dict(%s))\n" - % (repr(name), args)) - elif end: - indent -= 1 - code.append(' ' * indent + '#' + line[m.start(3):]) - elif statement: - code.append(' ' * indent + line[m.start(4):]) - else: - splits = self.re_inline.split(line) # text, (expr, text)* - if len(splits) == 1: - strbuffer.append(line) - else: - flush() - for i in range(1, len(splits), 2): - splits[i] = PyStmt(splits[i]) - splits = [x for x in splits if bool(x)] - code.append(' ' * indent + "_stdout.extend(%s)\n" % repr(splits)) - flush() - return ''.join(code) - - def execute(self, stdout, **args): - args['_stdout'] = stdout - args['_includes'] = self.includes - args['_tpl'] = args - eval(self.co, args) - if '_rebase' in args: - subtpl, args = args['_rebase'] - args['_base'] = stdout[:] #copy stdout - del stdout[:] # clear stdout - return subtpl.execute(stdout, **args) - return args - def render(self, **args): - """ Render the template using keyword arguments as local variables. """ - stdout = [] - self.execute(stdout, **args) - return stdout - - - -def template(tpl, template_adapter=SimpleTemplate, **args): - ''' - Get a rendered template as a string iterator. - You can use a name, a filename or a template string as first parameter. - ''' - lookup = args.get('template_lookup', TEMPLATE_PATH) - if tpl not in TEMPLATES or DEBUG: - if "\n" in tpl or "{" in tpl or "%" in tpl or '$' in tpl: - TEMPLATES[tpl] = template_adapter(template=tpl, lookup=lookup) - elif '.' in tpl: - TEMPLATES[tpl] = template_adapter(filename=tpl, lookup=lookup) - else: - TEMPLATES[tpl] = template_adapter(name=tpl, lookup=lookup) - if not TEMPLATES[tpl]: - abort(500, 'Template (%s) not found' % tpl) - args['abort'] = abort - args['request'] = request - args['response'] = response - return TEMPLATES[tpl].render(**args) - - -def mako_template(tpl_name, **kargs): - kargs['template_adapter'] = MakoTemplate - return template(tpl_name, **kargs) - -def cheetah_template(tpl_name, **kargs): - kargs['template_adapter'] = CheetahTemplate - return template(tpl_name, **kargs) - -def jinja2_template(tpl_name, **kargs): - kargs['template_adapter'] = Jinja2Template - return template(tpl_name, **kargs) - -def view(tpl_name, **defaults): - ''' Decorator: Rendes a template for a handler. - Return a dict of template vars to fill out the template. - ''' - def decorator(func): - def wrapper(**kargs): - out = func(**kargs) - defaults.update(out) - return template(tpl_name, **defaults) - return wrapper - return decorator - -def mako_view(tpl_name, **kargs): - kargs['template_adapter'] = MakoTemplate - return view(tpl_name, **kargs) - -def cheetah_view(tpl_name, **kargs): - kargs['template_adapter'] = CheetahTemplate - return view(tpl_name, **kargs) - -def jinja2_view(tpl_name, **kargs): - kargs['template_adapter'] = Jinja2Template - return view(tpl_name, **kargs) - - - - - - - -# Database - -class BottleBucket(object): # pragma: no cover - """ Memory-caching wrapper around anydbm """ - def __init__(self, name): - self.__dict__['name'] = name - self.__dict__['db'] = dbm.open(DB_PATH + '/%s.db' % name, 'c') - self.__dict__['mmap'] = {} - - def __getitem__(self, key): - if key not in self.mmap: - self.mmap[key] = pickle.loads(self.db[key]) - return self.mmap[key] - - def __setitem__(self, key, value): - if not isinstance(key, str): raise TypeError("Bottle keys must be strings") - self.mmap[key] = value - - def __delitem__(self, key): - if key in self.mmap: - del self.mmap[key] - del self.db[key] - - def __getattr__(self, key): - try: return self[key] - except KeyError: raise AttributeError(key) - - def __setattr__(self, key, value): - self[key] = value - - def __delattr__(self, key): - try: del self[key] - except KeyError: raise AttributeError(key) - - def __iter__(self): - return iter(self.ukeys()) - - def __contains__(self, key): - return key in self.ukeys() - - def __len__(self): - return len(self.ukeys()) - - def keys(self): - return list(self.ukeys()) - - def ukeys(self): - return set(self.db.keys()) | set(self.mmap.keys()) - - def save(self): - self.close() - self.__init__(self.name) - - def close(self): - for key in self.mmap: - pvalue = pickle.dumps(self.mmap[key], pickle.HIGHEST_PROTOCOL) - if key not in self.db or pvalue != self.db[key]: - self.db[key] = pvalue - self.mmap.clear() - if hasattr(self.db, 'sync'): - self.db.sync() - if hasattr(self.db, 'close'): - self.db.close() - - def clear(self): - for key in self.db: - del self.db[key] - self.mmap.clear() - - def update(self, other): - self.mmap.update(other) - - def get(self, key, default=None): - try: - return self[key] - except KeyError: - if default: - return default - raise - - -class BottleDB(threading.local): # pragma: no cover - """ Holds multible BottleBucket instances in a thread-local way. """ - def __init__(self): - self.__dict__['open'] = {} - - def __getitem__(self, key): - warnings.warn("Please do not use bottle.db anymore. This feature is deprecated. You may use anydb directly.", DeprecationWarning) - if key not in self.open and not key.startswith('_'): - self.open[key] = BottleBucket(key) - return self.open[key] - - def __setitem__(self, key, value): - if isinstance(value, BottleBucket): - self.open[key] = value - elif hasattr(value, 'items'): - if key not in self.open: - self.open[key] = BottleBucket(key) - self.open[key].clear() - for k, v in value.iteritems(): - self.open[key][k] = v - else: - raise ValueError("Only dicts and BottleBuckets are allowed.") - - def __delitem__(self, key): - if key not in self.open: - self.open[key].clear() - self.open[key].save() - del self.open[key] - - def __getattr__(self, key): - try: return self[key] - except KeyError: raise AttributeError(key) - - def __setattr__(self, key, value): - self[key] = value - - def __delattr__(self, key): - try: del self[key] - except KeyError: raise AttributeError(key) - - def save(self): - self.close() - self.__init__() - - def close(self): - for db in self.open: - self.open[db].close() - self.open.clear() - - - - - - -# Modul initialization and configuration - -DB_PATH = './' -TEMPLATE_PATH = ['./', './views/'] -TEMPLATES = {} -DEBUG = False -HTTP_CODES = { - 100: 'CONTINUE', - 101: 'SWITCHING PROTOCOLS', - 200: 'OK', - 201: 'CREATED', - 202: 'ACCEPTED', - 203: 'NON-AUTHORITATIVE INFORMATION', - 204: 'NO CONTENT', - 205: 'RESET CONTENT', - 206: 'PARTIAL CONTENT', - 300: 'MULTIPLE CHOICES', - 301: 'MOVED PERMANENTLY', - 302: 'FOUND', - 303: 'SEE OTHER', - 304: 'NOT MODIFIED', - 305: 'USE PROXY', - 306: 'RESERVED', - 307: 'TEMPORARY REDIRECT', - 400: 'BAD REQUEST', - 401: 'UNAUTHORIZED', - 402: 'PAYMENT REQUIRED', - 403: 'FORBIDDEN', - 404: 'NOT FOUND', - 405: 'METHOD NOT ALLOWED', - 406: 'NOT ACCEPTABLE', - 407: 'PROXY AUTHENTICATION REQUIRED', - 408: 'REQUEST TIMEOUT', - 409: 'CONFLICT', - 410: 'GONE', - 411: 'LENGTH REQUIRED', - 412: 'PRECONDITION FAILED', - 413: 'REQUEST ENTITY TOO LARGE', - 414: 'REQUEST-URI TOO LONG', - 415: 'UNSUPPORTED MEDIA TYPE', - 416: 'REQUESTED RANGE NOT SATISFIABLE', - 417: 'EXPECTATION FAILED', - 500: 'INTERNAL SERVER ERROR', - 501: 'NOT IMPLEMENTED', - 502: 'BAD GATEWAY', - 503: 'SERVICE UNAVAILABLE', - 504: 'GATEWAY TIMEOUT', - 505: 'HTTP VERSION NOT SUPPORTED', -} - -HTTP_ERROR_TEMPLATE = """ -<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> -<html> - <head> - <title>Error %(status)d: %(error_name)s</title> - </head> - <body> - <h1>Error %(status)d: %(error_name)s</h1> - <p>Sorry, the requested URL <tt>%(url)s</tt> caused an error:</p> - <pre> - %(error_message)s - </pre> - </body> -</html> -""" - -TRACEBACK_TEMPLATE = """ -<h2>Traceback:</h2> -<pre> -%s -</pre> -""" - -request = Request() -response = Response() -db = BottleDB() -local = threading.local() - -#TODO: Global and app local configuration (debug, defaults, ...) is a mess - -def debug(mode=True): - global DEBUG - DEBUG = bool(mode) - -def optimize(mode=True): - default_app().optimize = bool(mode) - - diff --git a/module/web/main.html b/module/web/main.html deleted file mode 100644 index 87f0d7408..000000000 --- a/module/web/main.html +++ /dev/null @@ -1,29 +0,0 @@ -<title>pyLoad - Webinterface</title> -<?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de"> - <head> - <title>pyLoad - Webinterface</title> - <script src="main.js" type="text/javascript"></script> - </head> - <body> - <h1>pyLoad - Webinterface</h1> - <div name="status_server"> - Status: running Speed: 600kb/s Files in queue: 0 - </div> - <div name="actions"> - <div id="add_urls"> - <form name="add_urls_form"> - <input type="text" name="new_url" /> - <input type="button" value="Add Link" onclick="addUrl(document.add_urls_form.new_url.value)" > - </form> - </div> - (START) (PAUSE) (ADD) - </div> - <h2>Downloads</h2> - <div id="downloads"> - Lade Downloads - </div> - </body> -</html> - diff --git a/module/web/main.js b/module/web/main.js deleted file mode 100644 index a286df991..000000000 --- a/module/web/main.js +++ /dev/null @@ -1,42 +0,0 @@ -function getXmlHttpRequestObject() { - if (window.XMLHttpRequest) { - return new XMLHttpRequest(); //Not IE - } else if(window.ActiveXObject) { - return new ActiveXObject("Microsoft.XMLHTTP"); //IE - } else { - alert("Your browser doesn't support the XmlHttpRequest object. Better upgrade to Firefox."); - } -} -var req = getXmlHttpRequestObject(); - -function getDownloads() { - req.onreadystatechange = function() { - if (req.readyState == 4) { - if(req.status==200) { - document.getElementById('downloads').innerHTML = req.responseText; - } else { - alert("Fehler:\nHTTP-Status: "+req.status+"\nHTTP-Statustext: "+req.statusText); - } - }; - } - req.open("GET", '/downloads', true); - req.send(null); -} - -function addUrl(new_url) { - req.onreadystatechange = function() { - if (req.readyState == 4) { - if(req.status==200) { - document.getElementById('add_urls').innerHTML = req.responseText; - } else { - alert("Fehler:\nHTTP-Status: "+req.status+"\nHTTP-Statustext: "+req.statusText); - } - }; - } - url = "/add=" + new_url - req.open("GET", url, true); - req.send(null); -} - -window.setInterval("getDownloads()", 1000); - diff --git a/module/web/manage.py b/module/web/manage.py new file mode 100644 index 000000000..ae9495854 --- /dev/null +++ b/module/web/manage.py @@ -0,0 +1,12 @@ +#!/usr/bin/env python +from django.core.management import execute_manager + +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + +if __name__ == "__main__": + execute_manager(settings) diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css new file mode 100644 index 000000000..b5701cf43 --- /dev/null +++ b/module/web/media/css/default.css @@ -0,0 +1,145 @@ +div.no{display:inline;margin:0;padding:0;}.hidden{display:none;} +div.error{background:#fcc url(media/img/error.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #faa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} +div.info{background:#ccf url(static/default/info.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #aaf;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} +div.success{background:#cfc url(static/default/success.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #afa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} +div.notify{background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #ffa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} +.medialeft{float:left;}.mediaright{float:right;} +.mediacenter{display:block;margin-left:auto;margin-right:auto;} +.leftalign{text-align:left;} +.centeralign{text-align:center;} +.rightalign{text-align:right;} +em.u{font-style:normal;text-decoration:underline;} +em em.u{font-style:italic;} +.code .br0{color:#6c6;} +.code .co1{color:#808080;font-style:italic;} +.code .co2{color:#808080;font-style:italic;} +.code .co3{color:#808080;} +.code .coMULTI{color:#808080;font-style:italic;} +.code .es0{color:#009;font-weight:bold;}.code .kw1{color:#b1b100;} +.code .kw2{color:#000;font-weight:bold;}.code .kw3{color:#006;} +.code .kw4{color:#933;}.code .kw5{color:#00f;}.code .me1{color:#060;}.code .me2{color:#060;} +.code .nu0{color:#c6c;}.code .re0{color:#00f;}.code .re1{color:#00f;}.code .re2{color:#00f;}.code .re3{color:#f33;font-weight:bold;}.code .re4{color:#099;}.code .st0{color:#f00;}.code .sy0{color:#6c6;} +div.dokuwiki table.pagelist,div.dokuwiki table.ul{border:0;padding:0;border-spacing:0;margin-bottom:1em;border-collapse:collapse;} +div.dokuwiki table.pagelist tr{border-top:1px solid #8cacbb;border-bottom:1px solid #8cacbb;} +div.dokuwiki table.pagelist th,div.dokuwiki table.pagelist td{padding:1px 1em 1px 0;} +div.dokuwiki table.ul th,div.dokuwiki table.ul td{padding:0 1em 0 0;} +div.dokuwiki table.ul ul{margin:0 0 0 1.5em;} +div.dokuwiki table.pagelist th,div.dokuwiki table.ul th{background-color:#dee7ec;} +div.dokuwiki th.page,div.dokuwiki th.date,div.dokuwiki th.user,div.dokuwiki th.desc,div.dokuwiki th.comments,div.dokuwiki th.linkbacks,div.dokuwiki th.tags,div.dokuwiki td.date,div.dokuwiki td.user,div.dokuwiki td.desc,div.dokuwiki td.comments,div.dokuwiki td.linkbacks,div.dokuwiki td.tags{color:#666;font-size:80%;} +div.dokuwiki td.date{text-align:right;}div.dokuwiki div.include div.secedit{float:right;margin-left:1em;margin-top:-18px;} +div.dokuwiki div.inclmeta{border-top:1px dotted #8cacbb;padding-top:0.2em;color:#666;font-size:80%;line-height:1.25;margin-top:0.5em;margin-bottom:2em;} +div.dokuwiki div.inclmeta a.permalink{background:transparent url(media/img/link.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} +div.dokuwiki div.inclmeta abbr.published{background:transparent url(media/img/date.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;border-bottom:0;} +div.dokuwiki div.inclmeta span.author{background:transparent url(media/img/user.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} +div.dokuwiki div.inclmeta span.comment{background:transparent url(media/img/comment.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} +div.dokuwiki div.inclmeta div.tags{border-top:0;font-size:100%;float:right;clear:none;}#plugin__manager{}#plugin__manager h2{margin-left:0;} +#plugin__manager form{display:block;margin:0;padding:0;} +#plugin__manager legend{display:none;} +#plugin__manager fieldset{width:auto;} +#plugin__manager .button{margin:0;} +#plugin__manager p,#plugin__manager label{text-align:left;} +#plugin__manager .hidden{display:none;}#plugin__manager .new{background:#dee7ec;} +#plugin__manager input[disabled]{color:#ccc;border-color:#ccc;} +#plugin__manager .pm_menu,#plugin__manager .pm_info{margin-left:0;text-align:left;} +#plugin__manager .pm_menu{float:left;width:48%;} +#plugin__manager .pm_info{float:right;width:50%;} +#plugin__manager .common{}#plugin__manager .common form{} +#plugin__manager .common fieldset{margin:0;padding:0 0 1.0em 0;text-align:left;border:none;} +#plugin__manager .common label{padding:0 0 0.5em 0;} +#plugin__manager .common input{} +#plugin__manager .common input.edit{width:24em;margin:0.5em;} +#plugin__manager .common .button{} +#plugin__manager form.plugins{} +#plugin__manager .plugins fieldset{color:#000;background:#fff;text-align:right;border-top:none;border-right:none;border-left:none;} +#plugin__manager .plugins fieldset.protected{background:#fdd;color:#000;} +#plugin__manager .plugins fieldset.disabled{background:#e0e0e0;color:#a8a8a8;} +#plugin__manager .plugins .legend{color:#000;background:inherit;display:block;margin:0;padding:0;font-size:1em;line-height:1.4em;font-weight:normal;text-align:left;float:left;padding:0;clear:none;} +#plugin__manager .plugins .button{font-size:95%;}#plugin__manager .plugins fieldset.buttons{border:none;} +#plugin__manager .plugins fieldset.buttons .button{float:left;} +#plugin__manager .pm_info h3{margin-left:0;}#plugin__manager .pm_info dl{margin:1em 0;padding:0;} +#plugin__manager .pm_info dt{width:6em;float:left;clear:left;margin:0;padding:0;} +#plugin__manager .pm_info dd{margin:0 0 0 7em;padding:0;background:none;} +#plugin__manager .plugins .enable{float:left;width:auto;margin-right:0.5em;} +#config__manager div.success,#config__manager div.error,#config__manager div.info{background-position:0.5em;padding:0.5em;text-align:center;} +#config__manager fieldset{margin:1em;width:auto;margin-bottom:2em;background-color:#dee7ec;color:#000;padding:0 1em;} +#config__manager legend{font-size:1.25em;} +#config__manager form{}#config__manager table{margin:1em 0;width:100%;}#config__manager fieldset td{text-align:left;} +#config__manager fieldset td.value{width:31em;}#config__manager td.label{padding:0.8em 0 0.6em 1em;vertical-align:top; +}#config__manager td.label label{clear:left;display:block;} +#config__manager td.label img{padding:0 10px;vertical-align:middle;float:right;} +#config__manager td.label span.outkey{font-size:70%;margin-top:-1.7em;margin-left:-1em;display:block;background-color:#fff;color:#666;float:left;padding:0 0.1em;position:relative;z-index:1;} +#config__manager td input.edit{width:30em;}#config__manager td .input{width:30.8em;} +#config__manager td select.edit{}#config__manager td textarea.edit{width:27.5em;height:4em;} +#config__manager tr .input,#config__manager tr input,#config__manager tr textarea,#config__manager tr select{background-color:#fff;color:#000;} +#config__manager tr.default .input,#config__manager tr.default input,#config__manager tr.default textarea,#config__manager tr.default select,#config__manager .selectiondefault{background-color:#cdf;color:#000;} +#config__manager tr.protected .input,#config__manager tr.protected input,#config__manager tr.protected textarea,#config__manager tr.protected select,#config__manager tr.protected .selection{background-color:#fcc!important;color:#000 !important;} +#config__manager td.error{background-color:red;color:#000;}#config__manager .selection{width:14.8em;float:left;margin:0 0.3em 2px 0;}#config__manager .selection label{float:right;width:14em;font-size:90%;} +* html #config__manager .selection label{padding-top:2px;} +#config__manager .selection input.checkbox{padding-left:0.7em;} +#config__manager .other{clear:both;padding-top:0.5em;} +#config__manager .other label{padding-left:2px;font-size:90%;}.dokuwiki div.plugin_translation{float:right;font-size:95%;} +.dokuwiki div.plugin_translation ul{display:inline;padding:0;margin:0;} +.dokuwiki div.plugin_translation ul li{float:left;list-style-type:none;padding:0;margin:0;} +.dokuwiki div.plugin_translation ul li a.wikilink1:link,.dokuwiki div.plugin_translation ul li a.wikilink1:hover,.dokuwiki div.plugin_translation ul li a.wikilink1:active,.dokuwiki div.plugin_translation ul li a.wikilink1:visited{background-color:#000080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} +.dokuwiki div.plugin_translation ul li a.wikilink2:link,.dokuwiki div.plugin_translation ul li a.wikilink2:hover,.dokuwiki div.plugin_translation ul li a.wikilink2:active,.dokuwiki div.plugin_translation ul li a.wikilink2:visited{background-color:#808080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} +.dokuwiki div.plugin_translation ul li a img{opacity:0.5;border:0;} +.dokuwiki div.plugin_translation ul li a.wikilink2 img{}.dokuwiki div.plugin_translation span.curid a img{opacity:1.0;height:15px;} +.dokuwiki div.plugin_translation ul li a:hover img{opacity:1.0;height:15px;}#user__manager tr.disabled{color:#6f6f6f;background:#e4e4e4;} +#user__manager tr.user_info{vertical-align:top;} +#user__manager div.edit_user{width:46%;float:left;}#user__manager table{margin-bottom:1em;}#user__manager input.button[disabled]{color:#ccc!important;border-color:#ccc!important;}div.dokuwiki div.newentry_form{clear:both;text-align:center;margin-bottom:1em;} +div.dokuwiki #blog__newentry_form input.edit{width:95%;}div.dokuwiki tr.draft,div.dokuwiki div.draft{opacity:0.5;} +div.dokuwiki div.autoarchive_selector ul{list-style-type:none;clear:left;margin:0 0.5em 0 0;} +div.dokuwiki div.autoarchive_selector ul div.li{float:left;margin:0 1em 0 0;} +div.dokuwiki div.autoarchive_selector ul ul{float:left;clear:none;}div.dokuwiki div.autoarchive_selector ul ul div.li{margin:0;}div#acl_manager div#acl__tree{font-size:90%;width:25%;height:300px;float:left;overflow:auto;border:1px solid #8cacbb;text-align:left;} +div#acl_manager div#acl__tree a.cur{background-color:#ff9;font-weight:bold;} +div#acl_manager div#acl__tree ul{list-style-type:none;margin:0;padding:0;}div#acl_manager div#acl__tree li{padding-left:1em;}div#acl_manager div#acl__tree ul img{margin-right:0.25em;cursor:pointer;} +div#acl_manager div#acl__detail{width:73%;height:300px;float:right;overflow:auto;} +div#acl_manager div#acl__detail fieldset{width:90%;} +div#acl_manager div#acl__detail div#acl__user{border:1px solid #8cacbb;padding:0.5em;margin-bottom:0.6em;} +div#acl_manager table.inline{width:100%;margin:0;} +div#acl_manager .aclgroup{background:transparent url(media/img/group.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} +div#acl_manager .acluser{background:transparent url(media/img/user.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} +div#acl_manager .aclpage{background:transparent url(media/img/page.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} +div#acl_manager .aclns{background:transparent url(media/img/ns.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} +div#acl_manager label.disabled{color:#666!important;} +#acl_manager label{text-align:left;font-weight:normal;display:inline;} +#acl_manager table{margin-left:10%;width:80%;}#acl_manager table tr{background-color:inherit;} +#acl_manager table tr:hover{background-color:#dee7ec;} + + +a.interwiki{background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat;padding-left:16px;} +a.iw_wp{background-image:url(/media/img/wp.gif)} +a.iw_wpde{background-image:url(/media/img/wpde.gif)} +a.iw_wpmeta{background-image:url(/media/img/wpmeta.gif)} +a.iw_doku{background-image:url(/media/img/doku.gif)} +a.iw_dokubug{background-image:url(/media/img/dokubug.gif)} +a.iw_amazon{background-image:url(/media/img/amazon.gif)} +a.iw_amazon_de{background-image:url(/media/img/amazon.de.gif)} +a.iw_amazon_uk{background-image:url(/media/img/amazon.uk.gif)} +a.iw_phpfn{background-image:url(/media/img/phpfn.gif)} +a.iw_coral{background-image:url(/media/img/coral.gif)} +a.iw_sb{background-image:url(/media/img/sb.gif)} +a.iw_google{background-image:url(/media/img/google.gif)} +a.iw_meatball{background-image:url(/media/img/meatball.gif)} +a.iw_wiki{background-image:url(/media/img/wiki.gif)} +a.mediafile{background:transparent url(/media/img/file.png) 0px 1px no-repeat;padding-left:18px;padding-bottom:1px;}a.mf_jpg{background-image:url(/media/img/jpg.png)}a.mf_jpeg{background-image:url(/media/img/jpeg.png)}a.mf_gif{background-image:url(/media/img/gif.png)}a.mf_png{background-image:url(/media/img/png.png)}a.mf_tgz{background-image:url(/media/img/tgz.png)}a.mf_tar{background-image:url(/media/img/tar.png)}a.mf_gz{background-image:url(/media/img/gz.png)}a.mf_bz2{background-image:url(/media/img/bz2.png)} +a.mf_zip{background-image:url(/media/img/zip.png)}a.mf_rar{background-image:url(/media/img/rar.png)}a.mf_pdf{background-image:url(/media/img/pdf.png)}a.mf_ps{background-image:url(/media/img/ps.png)}a.mf_doc{background-image:url(/media/img/doc.png)}a.mf_xls{background-image:url(/media/img/xls.png)}a.mf_ppt{background-image:url(/media/img/ppt.png)}a.mf_rtf{background-image:url(/media/img/rtf.png)}a.mf_swf{background-image:url(/media/img/swf.png)}a.mf_rpm{background-image:url(/media/img/rpm.png)}a.mf_deb{background-image:url(/media/img/deb.png)}a.mf_sxw{background-image:url(/media/img/sxw.png)}a.mf_sxc{background-image:url(/media/img/sxc.png)}a.mf_sxi{background-image:url(/media/img/sxi.png)}a.mf_sxd{background-image:url(/media/img/sxd.png)}a.mf_odc{background-image:url(/media/img/odc.png)}a.mf_odf{background-image:url(/media/img/odf.png)}a.mf_odg{background-image:url(/media/img/odg.png)} +a.mf_odi{background-image:url(/media/img/odi.png)}a.mf_odp{background-image:url(/media/img/odp.png)}a.mf_ods{background-image:url(/media/img/ods.png)}a.mf_odt{background-image:url(/media/img/odt.png)}body{margin:0px;padding:0px;background-color:white;color:black;font-size:12px;font-family:Verdana,Helvetica,"Lucida Grande",Lucida,Arial,sans-serif;font-family:sans-serif;font-size:99,96%;font-size-adjust:none;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;}hr{border-width:0px;border-bottom:1px #aaa dotted;}img{border:none;}form{margin:0px;padding:0px;border:none;display:inline;background:transparent;}ul li{margin:5px;}textarea{font-family:monospace;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}a{color:#3465a4;text-decoration:none;}a:hover{text-decoration:underline;} +a.wikilink2{color:#a40000 !important;}.dokuwiki h1 a,.dokuwiki h2 a,.dokuwiki h3 a,.dokuwiki h4 a,.dokuwiki h5 a,.dokuwiki a.nolink{color:#000 !important;text-decoration:none !important;} +option{border:0px none #fff;}strong.highlight{background-color:#fc9;padding:1pt;}#pagebottom{clear:both;}hr{height:1px;color:#c0c0c0;background-color:#c0c0c0;border:none;margin:.2em 0 .2em 0;}pre{padding:0.5em;font-family:courier,monospace;border:1px solid #c0c0c0;background:#F0ECE6;white-space:pre;white-space:pre-wrap;word-wrap:break-word;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;}.invisible{margin:0px;border:0px;padding:0px;height:0px;visibility:hidden;}.left{float:left !important;}.right{float:right !important;}.center{text-align:center;}div#body-wrapper{padding:40px 40px 10px 40px;font-size:127%;} +div#content{margin-top:-20px;padding:0;font-size:14px;color:black;line-height:1.5em;}h1,h2,h3,h4,h5,h6{background:transparent none repeat scroll 0 0;border-bottom:1px solid #aaa;color:black;font-weight:normal;margin:0;padding:0;padding-bottom:0.17em;padding-top:0.5em;}h1{font-size:188%;line-height:1.2em;margin-bottom:0.1em;padding-bottom:0;}h2{font-size:150%;}h3,h4,h5,h6{border-bottom:none;font-weight:bold;}h3{font-size:132%;}h4{font-size:116%;}h5{font-size:100%;}h6{font-size:80%;}ul#page-actions{float:right;margin:10px 10px 0 10px;padding:6px;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:5px;}ul#user-actions{padding:5px;margin:0;display:inline;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:3px;}ul#page-actions li,ul#user-actions li{display:inline;}ul#page-actions a,ul#user-actions a{text-decoration:none;color:black;display:inline;margin:0 3px;padding:2px 0px 2px 18px;} +ul#page-actions a:hover,ul#page-actions a:focus,ul#user-actions a:hover,ul#user-actions a:focus{text-decoration:underline;}.hidden{display:none;}a.urlextern{color:#36B;background:transparent url(/media/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{background:none;padding:0;}a.action.index{background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat;}a.action.recent{background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat;}a.logout{background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat;} +a.admin{background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat;}a.profile{background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat;}a.create,a.edit{background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat;}a.source,a.show{background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat;}a.revisions{background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat;}a.subscribe,a.unsubscribe{background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat;}a.backlink{background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat;}#head-panel{background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x;}#head-panel h1{display:none;margin:0;text-decoration:none;padding-top:0.8em;padding-left:3.3em;font-size:2.6em;color:#eeeeec;}#head-panel #head-logo{float:left;margin:5px 0 -15px 5px;padding:0;overflow:visible;}#head-menu{background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x;width:100%;float:left;margin:0;padding:0;padding-top:0.8em;} +#head-menu ul{list-style:none;margin:0 1em 0 2em;}#head-menu ul li{float:left;margin:0;margin-left:0.3em;font-size:14px;margin-bottom:4px;}#head-menu ul li.selected,#head-menu ul li:hover{margin-bottom:0px;}#head-menu ul li a img{height:22px;width:22px;vertical-align:middle;}#head-menu ul li a,#head-menu ul li a:link{float:left;text-decoration:none;color:#555;background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x;padding:3px 7px 3px 7px;border:2px solid #ccc;border-bottom:0px solid transparent;padding-bottom:3px;-moz-border-radius:5px;}#head-menu ul li a:hover,#head-menu ul li a:focus{color:#111;padding-bottom:7px;border-bottom:0px none transparent;outline:none;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li a:focus{margin-bottom:-4px;}#head-menu ul li.selected a{color:#3566A5;background:#fff;padding-bottom:7px;border-bottom:0px none transparent;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li.selected a:hover,#head-menu ul li.selected a:focus{color:#111;}div#head-search-and-login{float:right;margin:0 1em 0 0;background-color:#222;padding:4px;color:white;-moz-border-radius-bottomright:6px;-moz-border-radius-bottomleft:6px;}div#head-search-and-login form{display:inline;padding:0 3px;}div#head-search-and-login form input{border:2px solid #888;background:#eee;font-size:14px;padding:2px;-moz-border-radius:3px;}div#head-search-and-login form input:focus{background:#fff;}#head-search{font-size:14px;}#head-username,#head-password{width:80px;font-size:14px;}#pageinfo{clear:both;color:#888;padding:0.6em 0;margin:0;}#foot{font-style:normal;color:#888;text-align:center;}#foot a{color:#aaf;}#foot img{vertical-align:middle;}ul.toc{padding:0;padding-left:20px;margin-left:0;margin-right:10px;list-style:none;}ul.toc li{list-style:circle;}ul.toc li a{text-decoration:none;color:black;}ul.toc li a:hover{text-decoration:underline;}div.toc{border:1px dotted #888;background:#f0f0f0;margin:1em 0 1em 1em;float:right;font-size:95%;}div.toc .tocheader{font-weight:bold;margin:0.5em 1em;}div.toc ol{margin:1em 0.5em 1em 1em;padding:0;}div.toc ol li{margin:0;padding:0;margin-left:1em;}div.toc ol ol{margin:0.5em 0.5em 0.5em 1em;padding:0;}div.recentchanges table{clear:both;}div#editor-help{font-size:90%;border:1px dotted #888;padding:0ex 1ex 1ex 1ex;background:#f7f6f2;}div#preview{margin-top:1em;}label.block{display:block;text-align:right;font-weight:bold;}label.simple{display:block;text-align:left;font-weight:normal;}label.block input.edit{width:50%;}fieldset{width:300px;text-align:center;padding:0.5em;margin:auto;}div.editor{margin:0 0 0 0;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}td p{margin:0;padding:0;}.u{text-decoration:underline;}.footnotes ul{padding:0 2em;margin:0 0 1em;}.footnotes li{list-style:none;}.recentchanges p{margin:0.25em;}.recentchanges td{vertical-align:top;border:none;border-bottom:1pt solid #F0ECE6;background:#F7F6F2;}.rcdaybreak td{background:#729fcf;border:none;}.rcdaybreak td a{font-size:0.88em;}.rcicon1,.rcicon2{text-align:center;}.rcpagelink{width:33%;}.rctime{font-size:0.88em;white-space:nowrap;}.rceditor{white-space:nowrap;font-size:0.88em;}.rccomment{width:66%;color:gray;font-size:0.88em;}.rcrss{float:right;}.recentchanges[dir="rtl"] .rcrss{float:left;}.userpref table,.userpref td{border:none;}div.codearea{margin:0.5em 0;padding:0;border:1pt solid #AEBDCC;background-color:#F3F5F7;color:black;}div.codearea pre{margin:0;padding:10pt;border:none;}a.codenumbers{margin:0 10pt;font-size:0.85em;color:gray;}div.codearea pre span.LineNumber{color:gray;}div.codearea pre span.ID{color:#000;}div.codearea pre span.Operator{color:#0000c0;}div.codearea pre span.Char{color:#004080;}div.codearea pre span.Comment{color:#008000;}div.codearea pre span.Number{color:#0080c0;}div.codearea pre span.String{color:#004080;}div.codearea pre span.SPChar{color:#0000c0;}div.codearea pre span.ResWord{color:#a00000;}div.codearea pre span.ConsWord{color:#008080;font-weight:bold;}div.codearea pre span.Error{color:#ff8080;border:solid 1.5pt #f00;}div.codearea pre span.ResWord2{color:#0080ff;font-weight:bold;}div.codearea pre span.Special{color:#00f;}div.codearea pre span.Preprc{color:#803999;}#message{clear:both;padding:5px 10px;background-color:#eee;border-bottom:2px solid #ccc;}#message p{margin:5px 0;padding:0;font-weight:bold;}#message div.buttons{font-weight:normal;}.diff{width:99%;}.diff-title{background-color:#C0C0C0;}.searchresult dd span{font-weight:bold;}.diff{width:100%;border:none;}.diff-blockheader{font-weight:bold;background:#e5e5e5;font-size:1.2em;border-top:2px solid #444;padding:5px;}.diff th{font-size:120%;width:50%;font-weight:normal;text-align:left;padding-bottom:3px;}.diff td{font-family:monospace;font-size:100%;border:none;}.diff-addedline{background-color:#dfd;}.diff-deletedline{background-color:#ffb;}.diff-context{color:#888;}.diff-addedline{background-color:#E0FFE0;vertical-align:sub;}.diff-deletedline{background-color:#FFFFE0;background-color:#f4cece;vertical-align:sub;} +.diff-addedline strong{background-color:#80FF80;background-color:#8ae234;} +.diff-deletedline strong{background-color:#FFFF80;background-color:#ef2929;background-color:#d78383;} + + + +.box{ background:url(/media/img/progress-bar-back.gif) right center no-repeat; width:200px; height:20px; float:left; } +.perc{ background:url(/media/img/progress-bar.gif) right center no-repeat; height:20px; } +.boxtext{ font-family:tahoma, arial, sans-serif; font-size:11px; color:#000; float:none; padding:3px 0 0 10px; } +.statusbutton{width:32px;height:32px;float:left;margin-left:-32px;margin-right:5px;opacity:0;cursor:pointer} + +.dlsize{float:left; padding-right: 8px;} +.dlspeed{float:left; padding-right: 8px;} \ No newline at end of file diff --git a/module/web/media/css/window.css b/module/web/media/css/window.css new file mode 100644 index 000000000..aaccae082 --- /dev/null +++ b/module/web/media/css/window.css @@ -0,0 +1,17 @@ +.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} +.SWclearfix {display: inline-table;} +* html .SWclearfix {height: 1%;} +.SWclearfix {display: block;} + +div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;} +div.DefaultStickyWin div.top_ul{background:url(/static/window/full.png) top left no-repeat; height:30px; width:15px; float:left} +div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(/static/window/full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px} +div.DefaultStickyWin h1.caption{clear: none !important; margin:0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;} +div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(/static/window/body.png) top left repeat-y; margin:0px 20px 0px 0px !important; margin-bottom: -3px; position: relative; top: 0px !important; top: -3px;} +div.DefaultStickyWin div.body{background:url(/static/window/body.png) top right repeat-y; padding:8px 30px 8px 0px !important; margin-left:5px !important; position:relative; right:-20px !important;} +div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(/static/window/full.png) bottom left no-repeat; width:15px; height:15px; float:left} +div.DefaultStickyWin div.bottom_lr{background:url(/static/window/full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px} +div.DefaultStickyWin div.closeButtons{text-align: center; background:url(/static/window/body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px} +div.DefaultStickyWin a.button:hover{background:url(/static/window/big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(/static/window/big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;} +div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(/static/window/closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer;top:0px} +div.DefaultStickyWin div.dragHandle { width: 11px; height: 25px; position: relative; top: 5px; left: -3px; cursor: move; background: url(/static/window/drag_corner.gif); float: left;} \ No newline at end of file diff --git a/module/web/media/img/Button-Add-grey.png b/module/web/media/img/Button-Add-grey.png new file mode 100644 index 000000000..6659e230e Binary files /dev/null and b/module/web/media/img/Button-Add-grey.png differ diff --git a/module/web/media/img/Button-Add.png b/module/web/media/img/Button-Add.png new file mode 100644 index 000000000..602da4131 Binary files /dev/null and b/module/web/media/img/Button-Add.png differ diff --git a/module/web/media/img/Button-Pause-grey.png b/module/web/media/img/Button-Pause-grey.png new file mode 100644 index 000000000..d1017e974 Binary files /dev/null and b/module/web/media/img/Button-Pause-grey.png differ diff --git a/module/web/media/img/Button-Pause.png b/module/web/media/img/Button-Pause.png new file mode 100644 index 000000000..68f3ffc3a Binary files /dev/null and b/module/web/media/img/Button-Pause.png differ diff --git a/module/web/media/img/Button-Play-grey.png b/module/web/media/img/Button-Play-grey.png new file mode 100644 index 000000000..9f44c2289 Binary files /dev/null and b/module/web/media/img/Button-Play-grey.png differ diff --git a/module/web/media/img/Button-Play.png b/module/web/media/img/Button-Play.png new file mode 100644 index 000000000..1ce1ed913 Binary files /dev/null and b/module/web/media/img/Button-Play.png differ diff --git a/module/web/media/img/big_button.gif b/module/web/media/img/big_button.gif new file mode 100644 index 000000000..7680490ea Binary files /dev/null and b/module/web/media/img/big_button.gif differ diff --git a/module/web/media/img/big_button_over.gif b/module/web/media/img/big_button_over.gif new file mode 100644 index 000000000..2e3ee10d2 Binary files /dev/null and b/module/web/media/img/big_button_over.gif differ diff --git a/module/web/media/img/body.png b/module/web/media/img/body.png new file mode 100644 index 000000000..7ff1043e0 Binary files /dev/null and b/module/web/media/img/body.png differ diff --git a/module/web/media/img/closebtn.gif b/module/web/media/img/closebtn.gif new file mode 100644 index 000000000..3e27e6030 Binary files /dev/null and b/module/web/media/img/closebtn.gif differ diff --git a/module/web/media/img/drag_corner.gif b/module/web/media/img/drag_corner.gif new file mode 100644 index 000000000..befb1adf1 Binary files /dev/null and b/module/web/media/img/drag_corner.gif differ diff --git a/module/web/media/img/full.png b/module/web/media/img/full.png new file mode 100644 index 000000000..fea52af76 Binary files /dev/null and b/module/web/media/img/full.png differ diff --git a/module/web/media/img/head-login.png b/module/web/media/img/head-login.png new file mode 100644 index 000000000..b59b7cbbf Binary files /dev/null and b/module/web/media/img/head-login.png differ diff --git a/module/web/media/img/head-menu-development.png b/module/web/media/img/head-menu-development.png new file mode 100644 index 000000000..8ef08e2e5 Binary files /dev/null and b/module/web/media/img/head-menu-development.png differ diff --git a/module/web/media/img/head-menu-download.png b/module/web/media/img/head-menu-download.png new file mode 100644 index 000000000..98c5da9db Binary files /dev/null and b/module/web/media/img/head-menu-download.png differ diff --git a/module/web/media/img/head-menu-home.png b/module/web/media/img/head-menu-home.png new file mode 100644 index 000000000..9d62109aa Binary files /dev/null and b/module/web/media/img/head-menu-home.png differ diff --git a/module/web/media/img/head-menu-index.png b/module/web/media/img/head-menu-index.png new file mode 100644 index 000000000..44d631064 Binary files /dev/null and b/module/web/media/img/head-menu-index.png differ diff --git a/module/web/media/img/head-menu-news.png b/module/web/media/img/head-menu-news.png new file mode 100644 index 000000000..43950ebc9 Binary files /dev/null and b/module/web/media/img/head-menu-news.png differ diff --git a/module/web/media/img/head-menu-recent.png b/module/web/media/img/head-menu-recent.png new file mode 100644 index 000000000..fc9b0497f Binary files /dev/null and b/module/web/media/img/head-menu-recent.png differ diff --git a/module/web/media/img/head-menu-wiki.png b/module/web/media/img/head-menu-wiki.png new file mode 100644 index 000000000..07cf0102d Binary files /dev/null and b/module/web/media/img/head-menu-wiki.png differ diff --git a/module/web/media/img/head-search-noshadow.png b/module/web/media/img/head-search-noshadow.png new file mode 100644 index 000000000..aafdae015 Binary files /dev/null and b/module/web/media/img/head-search-noshadow.png differ diff --git a/module/web/media/img/head_bg1.png b/module/web/media/img/head_bg1.png new file mode 100644 index 000000000..f2848c3cc Binary files /dev/null and b/module/web/media/img/head_bg1.png differ diff --git a/module/web/media/img/page-tools-backlinks.png b/module/web/media/img/page-tools-backlinks.png new file mode 100644 index 000000000..3eb6a9ce3 Binary files /dev/null and b/module/web/media/img/page-tools-backlinks.png differ diff --git a/module/web/media/img/page-tools-edit.png b/module/web/media/img/page-tools-edit.png new file mode 100644 index 000000000..188e1c12b Binary files /dev/null and b/module/web/media/img/page-tools-edit.png differ diff --git a/module/web/media/img/page-tools-revisions.png b/module/web/media/img/page-tools-revisions.png new file mode 100644 index 000000000..5c3b8587f Binary files /dev/null and b/module/web/media/img/page-tools-revisions.png differ diff --git a/module/web/media/img/progress-bar-back.gif b/module/web/media/img/progress-bar-back.gif new file mode 100644 index 000000000..0c8f68211 Binary files /dev/null and b/module/web/media/img/progress-bar-back.gif differ diff --git a/module/web/media/img/progress-bar.gif b/module/web/media/img/progress-bar.gif new file mode 100644 index 000000000..746f77175 Binary files /dev/null and b/module/web/media/img/progress-bar.gif differ diff --git a/module/web/media/img/pyload-logo-edited3.5-new-font-small.png b/module/web/media/img/pyload-logo-edited3.5-new-font-small.png new file mode 100644 index 000000000..2443cd8b1 Binary files /dev/null and b/module/web/media/img/pyload-logo-edited3.5-new-font-small.png differ diff --git a/module/web/media/img/tab-background.png b/module/web/media/img/tab-background.png new file mode 100644 index 000000000..29a5d1991 Binary files /dev/null and b/module/web/media/img/tab-background.png differ diff --git a/module/web/media/img/tabs-border-bottom.png b/module/web/media/img/tabs-border-bottom.png new file mode 100644 index 000000000..02440f428 Binary files /dev/null and b/module/web/media/img/tabs-border-bottom.png differ diff --git a/module/web/media/img/user-actions-logout.png b/module/web/media/img/user-actions-logout.png new file mode 100644 index 000000000..0010931e2 Binary files /dev/null and b/module/web/media/img/user-actions-logout.png differ diff --git a/module/web/media/img/user-actions-profile.png b/module/web/media/img/user-actions-profile.png new file mode 100644 index 000000000..46573fff6 Binary files /dev/null and b/module/web/media/img/user-actions-profile.png differ diff --git a/module/web/media/js/home.js b/module/web/media/js/home.js new file mode 100644 index 000000000..025dcfcc7 --- /dev/null +++ b/module/web/media/js/home.js @@ -0,0 +1,205 @@ +var dwProgressBar = new Class({ + + //implements + Implements: [Options], + + //options + options: { + container: $$('body')[0], + boxID: '', + percentageID: '', + displayID: '', + startPercentage: 0, + displayText: false, + speed: 10 + }, + + //initialization + initialize: function(options) { + //set options + this.setOptions(options); + //create elements + this.createElements(); + }, + + //creates the box and percentage elements + createElements: function() { + var box = new Element('div', { + id: this.options.boxID + this.options.id, + 'class': this.options.boxID + }); + var perc = new Element('div', { + id: this.options.percentageID + this.options.id, + 'style': 'width:0px;', + 'class': this.options.percentageID + }); + perc.inject(box); + box.inject(this.options.container); + if (this.options.displayText) { + var text = new Element('div', { + id: this.options.displayID + this.options.id, + 'class': this.options.displayID + }); + text.inject(this.options.container); + } + this.set(this.options.startPercentage); + }, + + //calculates width in pixels from percentage + calculate: function(percentage) { + return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); + }, + + //animates the change in percentage + animate: function(to) { + document.id(this.options.percentageID + this.options.id).set('morph', { + duration: this.options.speed, + link: 'cancel' + }).morph({ + width: this.calculate(to.toInt()) + }); + if (this.options.displayText) { + document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); + } + }, + + //sets the percentage from its current state to desired percentage + set: function(to) { + this.animate(to); + } + +}); + +req = new Request.JSON({ + onSuccess: renderTable, + method: 'get', + url: '/json/links', + initialDelay: 0, + delay: 1000, + limit: 20000 +}); + +var dls = [] +var pbs = [] + +function renderTable(data) { + + data.downloads.each(function(dl) { + + if (dls.contains(dl.id)) { + + var div = $('dl' + dl.id) + + pbs[dl.id].set(dl.percent) + + div.getChildren("b")[0].textContent = dl.name + + if (dl.status == "downloading") { + + size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; + speed = Math.round(dl.speed) + " kb/s"; + eta = dl.eta; + + } else if (dl.status == "waiting") { + + size = "waiting " + dl.wait; + speed = ""; + eta = ""; + + } + div.getChildren(".dlsize")[0].textContent = size; + div.getChildren(".dlspeed")[0].textContent = speed; + div.getChildren(".dltime")[0].textContent = eta; + + } else { + + dls.push(dl.id) + + container = $("dlcontainer") + + dldiv = new Element('div', { + 'id': 'dl' + dl.id, + 'class': 'download', + 'styles': { + 'display': 'None' + } + }) + + new Element('p').inject(dldiv) + + new Element('b', { + 'html': dl.name + }).inject(dldiv) + + new Element('br').inject(dldiv) + + dldiv.inject(container) + + pbs[dl.id] = new dwProgressBar({ + container: $(dldiv), + startPercentage: 0, + speed: 1000, + id: dl.id, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' + }); + + new Element('div', { + 'class': 'dlsize', + 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" + }).inject(dldiv) + + new Element('div', { + 'class': 'dlspeed', + 'html': Math.round(dl.speed) + " kb/s" + }).inject(dldiv) + + new Element('div', { + 'class': 'dltime', + 'html': dl.eta + }).inject(dldiv) + + //dldiv.dissolve({duration : 0}) + dldiv.reveal() + + } + }) + + dls.each(function(id, index) { + + if (data.ids.contains(id)) { + +} else { + + //$("dl"+id).reveal() + dls.erase(id); + $('dl' + id).nix() + + } + + }) + +} + +window.addEvent('domready', +function() { + + /* +//create the progress bar for example 1 +pb = new dwProgressBar({ + container: $$('.level1 p')[0], + startPercentage: 25, + speed: 1000, + id: 1, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' +}); +*/ + + req.startTimer(); + +}); \ No newline at end of file diff --git a/module/web/media/js/mootools-1.2.3-core.js b/module/web/media/js/mootools-1.2.3-core.js new file mode 100644 index 000000000..25f1f9d03 --- /dev/null +++ b/module/web/media/js/mootools-1.2.3-core.js @@ -0,0 +1,335 @@ +//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License. + +var MooTools={version:"1.2.3",build:"4980aa0fb74d2f6eb80bcd9f5b8e1fd6fbb8f607"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; +var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; +if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; +}if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); +}}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); +}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); +return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); +};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true}); +}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]}; +for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean()); +}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this); +}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++; +}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each"); +function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; +};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); +((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; +}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments); +a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; +}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; +b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); +return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a; +b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name; +}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; +}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); +}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); +},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); +},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; +Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true; +break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP"); +});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description; +},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; +})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); +a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; +var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); +if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}; +}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; +new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0]; +a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true); +});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null; +});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}}; +new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; +},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); +},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; +for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; +}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; +for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1; +},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; +},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; +},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; +for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]); +}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")"; +},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16); +b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; +b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); +}var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return $try(e); +}return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); +},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})(); +},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})(); +}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0; +a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each"); +(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a); +})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this); +},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); +},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); +});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); +},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); +return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; +var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); +}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; +});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; +},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); +},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; +},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); +return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); +},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; +}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; +Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; +Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; +});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); +var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; +var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; +if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; +var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; +if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; +break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; +}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); +}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; +}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); +a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); +}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); +break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; +},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); +}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); +}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); +if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; +if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; +this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); +}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); +},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; +},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; +this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); +if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); +if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); +}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); +}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); +if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); +delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); +if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; +if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); +if(g){g=($type(f)=="element");}}return(g)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined}); +var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); +c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); +new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype);}e.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow; +});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); +f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; +}e.push(d);}f=e;}return(b.cash)?$extend(f,this):f;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a); +}:a,b));}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;}a+=" "+c+'="'+b[c]+'"'; +if(c!="checked"){delete b[c];}});a="<"+a+">";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); +},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; +},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); +}return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; +};})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); +}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true)); +}}return new Elements(f);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b); +},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; +},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; +var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); +n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; +}}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); +}if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); +}q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; +var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; +b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); +}},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); +},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); +return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); +}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); +return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); +return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); +return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); +return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; +(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); +}return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); +},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); +},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); +l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); +},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); +},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); +},getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); +},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; +},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; +}}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; +}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; +this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; +}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); +}});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); +v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; +if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); +},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); +});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; +}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); +},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; +n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); +}return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; +},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; +return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; +},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); +}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]}; +a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; +for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; +}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); +}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; +}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); +}return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); +if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; +}var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); +}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; +},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; +}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; +},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); +},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); +}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); +};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); +})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; +}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; +}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); +},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; +}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; +}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); +case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; +}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); +if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; +b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; +}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); +}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; +var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; +f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); +}else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; +}return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; +}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var m=this.getBoundingClientRect(),k=document.id(this.getDocument().documentElement),i=k.getScroll(),n=(d(this,"position")=="fixed"); +return{x:parseInt(m.left,10)+((n)?0:i.x)-k.clientLeft,y:parseInt(m.top,10)+((n)?0:i.y)-k.clientTop};}var j=this,h={x:0,y:0};if(b(this)){return h;}while(j&&!b(j)){h.x+=j.offsetLeft; +h.y+=j.offsetTop;if(Browser.Engine.gecko){if(!f(j)){h.x+=c(j);h.y+=g(j);}var l=j.parentNode;if(l&&d(l,"overflow")!="visible"){h.x+=c(l);h.y+=g(l);}}else{if(j!=this&&Browser.Engine.webkit){h.x+=c(j); +h.y+=g(j);}}j=j.offsetParent;}if(Browser.Engine.gecko&&!f(this)){h.x-=c(this);h.y-=g(this);}return h;},getPosition:function(k){if(b(this)){return{x:0,y:0}; +}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}; +},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y}; +k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; +},setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); +return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); +return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; +},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; +}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); +}function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; +}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; +},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; +},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; +}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e); +if(d!=0&&f.item){f=$A(f);}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f);}return new Elements(c,{ddup:(h.length>1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; +}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); +return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; +Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; +}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; +if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; +break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; +break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; +}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); +}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); +}}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; +}return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; +},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; +d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; +if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); +return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); +return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y); +continue;}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r);}else{var d={},g=[];for(var x=0,w=p.length; +x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d);}p=g;}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A); +}}p=e;}}return p;}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f); +}}return h;},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b); +}}return h;},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}break;}}return c;},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b)); +},byClass:function(b,a){return(b.className&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d); +if(!a){return(b=="!=");}if(!b||e==undefined){return true;}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); +case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; +}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a); +},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this; +while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false; +}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g); +if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e);}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this; +while((b=b.previousSibling)){if(b.nodeType!=1){continue;}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break;}}e.positions[d]=f;}return(e.positions[d]%c.a==c.b); +},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); +},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); +}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; +window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll(); +return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); +})();}else{window.addEvent("load",b);document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); +},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; +case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); +case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; +}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; +this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; +}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); +this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a); +},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); +return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition(); +this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel(); +}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject); +}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer(); +return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false; +}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c; +};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; +b[0]=d.getStyle(e);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a); +return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return;}var d=f.parse(c);if($chk(d)){b={value:d,parser:f};}}); +b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser}); +});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b)); +});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href; +if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return;}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase(); +}):null;if(!h||!h.test("^"+a+"$")){return;}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k; +});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true); +}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a)); +});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}}); +Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b; +b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; +}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); +}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a)); +},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options"))); +}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; +c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1); +e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); +a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); +b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); +},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; +for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; +for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph"); +if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a); +}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a); +return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":"); +a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(b,a){a=$splat(a); +return $extend(b,{easeIn:function(c){return b(c,a);},easeOut:function(c){return 1-b(1-c,a);},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2; +}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6); +},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2); +},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2); +break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]); +});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); +this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; +}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; +this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); +},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); +},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); +return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; +}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=k.url,a=k.method.toLowerCase(); +switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; +g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; +this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; +}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); +this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); +}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; +}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; +["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); +return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); +}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); +}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); +b.send({data:this,url:a||b.options.url});return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a); +this.headers.extend({Accept:"application/json","X-Request":"JSON"});},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a); +}}); \ No newline at end of file diff --git a/module/web/media/js/mootools-1.2.3.1-more.js b/module/web/media/js/mootools-1.2.3.1-more.js new file mode 100644 index 000000000..f3e4b4121 --- /dev/null +++ b/module/web/media/js/mootools-1.2.3.1-more.js @@ -0,0 +1,76 @@ +//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. + +MooTools.More={version:"1.2.3.1"};Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d];if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous; +this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;});}else{b.implement(d,e);}});return b;};Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth); +};if(g(this)){return e.apply(this);}var d=this.getParent(),b=[],f=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); +var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; +this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); +var d={};var c=function(f,e){return(e.computeSize)?f.getComputedSize(e):f.getSize();};if(this.getStyle("display")=="none"){d=this.measure(function(){return c(this,a); +});}else{try{d=c(this,a);}catch(b){}}return $chk(d.x)?$extend(d,{width:d.x,height:d.y}):$extend(d,{x:d.width,y:d.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); +var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; +break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; +b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=0;c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; +b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); +c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; +c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();},hide:function(){var b;try{if("none"!=this.getStyle("display")){b=this.getStyle("display"); +}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none");},show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block"); +},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); +this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; +},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this; +}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j); +}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; +this.showing=false;this.hidden=true;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var g=(this.element.style.height===""||this.element.style.height=="auto"); +this.element.setStyle("display","block");if(this.options.transitionOpacity){d.opacity=1;}var b={};$each(d,function(h,e){b[e]=[h,0];},this);var f=this.element.getStyle("overflow"); +this.element.setStyle("overflow","hidden");var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false; +$each(d,function(h,e){d[e]=h;},this);this.element.setStyles($merge({display:"none",overflow:f},d));if(g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; +}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(a){a.setStyle("visibility","visible");}}this.fireEvent("hide",this.element); +this.callChain();}.bind(this));if(a){a.setStyle("visibility","hidden");}this.start(b);}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this));}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel(); +this.dissolve();}}}}catch(c){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}return this;},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true; +this.hiding=false;this.hidden=false;var g,d;this.element.measure(function(){g=(this.element.style.height===""||this.element.style.height=="auto");d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +}.bind(this));$each(d,function(h,e){d[e]=h;});if($chk(this.options.heightOverride)){d.height=this.options.heightOverride.toInt();}if($chk(this.options.widthOverride)){d.width=this.options.widthOverride.toInt(); +}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=1;}var b={height:0,display:this.options.display};$each(d,function(h,e){b[e]=0; +});var f=this.element.getStyle("overflow");this.element.setStyles($merge(b,{overflow:"hidden"}));var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null; +if(a){a.setStyle("visibility","hidden");}this.start(d);this.$chain.unshift(function(){this.element.setStyle("overflow",f);if(!this.options.heightOverride&&g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; +}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(!this.hidden){this.showing=false;}if(a){a.setStyle("visibility","visible"); +}this.callChain();this.fireEvent("show",this.element);}.bind(this));}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element); +}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal(); +}}}}catch(c){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("show",this.element);}return this;},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal(); +}else{this.dissolve();}return this;}});Element.Properties.reveal={set:function(a){var b=this.retrieve("reveal");if(b){b.cancel();}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},a)); +},get:function(a){if(a||!this.retrieve("reveal")){if(a||!this.retrieve("reveal:options")){this.set("reveal",a);}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options"))); +}return this.retrieve("reveal");}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal",a).reveal(); +return this;},dissolve:function(a){this.get("reveal",a).dissolve();return this;},nix:function(){var a=Array.link(arguments,{destroy:Boolean.type,options:Object.type}); +this.get("reveal",a.options).dissolve().chain(function(){this[a.destroy?"destroy":"dispose"]();}.bind(this));return this;},wink:function(){var b=Array.link(arguments,{duration:Number.type,options:Object.type}); +var a=this.get("reveal",b.options);a.reveal().chain(function(){(function(){a.dissolve();}).delay(b.duration||2000);});}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0); +if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(b);this.parent(a);var c=this.element.retrieve("wrapper"); +this.wrapper=c||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0); +this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left"; +this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]); +return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this; +}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]]; +var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a); +},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode](); +this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide"); +if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a); +}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,e){d=d||"toggle"; +var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); +this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(b,a){this.parent(b,a); +this.elements.each(function(c){if(c.getStyle("position")=="static"){c.setStyle("position","relative");}});this.setDefaultOrder();},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(b,a){return a; +});},sort:function(e){if($type(e)!="array"){return false;}var i=0;var a=0;var h={};var d=this.options.mode=="vertical";var f=this.elements.map(function(m,j){var l=m.getComputedSize({styles:["border","padding","margin"]}); +var n;if(d){n={top:i,margin:l["margin-top"],height:l.totalHeight};i+=n.height-l["margin-top"];}else{n={left:a,margin:l["margin-left"],width:l.totalWidth}; +a+=n.width;}var k=d?"top":"left";h[j]={};var o=m.getStyle(k).toInt();h[j][k]=o||0;return n;},this);this.set(h);e=e.map(function(j){return j.toInt();}); +if(e.length!=this.elements.length){this.currentOrder.each(function(j){if(!e.contains(j)){e.push(j);}});if(e.length>this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); +}}i=0;a=0;var b=0;var c={};e.each(function(l,j){var k={};if(d){k.top=i-f[l].top-b;i+=f[l].height;}else{k.left=a-f[l].left;a+=f[l].width;}b=b+f[l].margin; +c[l]=k;},this);var g={};$A(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; +var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); +},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; +});},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());},reverse:function(){return this.sort(this.currentOrder.reverse()); +},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b);},this));},swap:function(c,b){if($type(c)=="element"){c=this.elements.indexOf(c); +}if($type(b)=="element"){b=this.elements.indexOf(b);}var a=$A(this.currentOrder);a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;this.sort(a); +}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=(function(){if(!this.running){this.send({data:b}); +}});this.timer=a.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(c){$clear(this.timer);if(c){this.lastDelay=this.options.delay; +}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit);}this.timer=a.delay(this.lastDelay,this);};this.addEvent("complete",this.completeCheck); +return this;},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this;}}); \ No newline at end of file diff --git a/module/web/media/js/status.js b/module/web/media/js/status.js new file mode 100644 index 000000000..3923e80ca --- /dev/null +++ b/module/web/media/js/status.js @@ -0,0 +1,100 @@ +/* hover! */ +Element.implement({ + 'hover': function(fn1,fn2) { + return this.addEvents({ + 'mouseenter': function(e) { + fn1.attempt(e,this); + }, + 'mouseleave': function(e) { + fn2.attempt(e,this); + } + }) + } +}); + +function updateStatus(data){ + + document.id("status").textContent = "Status: "+ data.status; + document.id("speed").textContent = "Speed: "+ data.speed +" kb/s"; + document.id("queue").textContent = "Files in queue: "+ data.queue; + +} + + +status_req = new Request.JSON({ + onSuccess: updateStatus, + method: 'get', + url: '/json/status', + initialDelay: 0, + delay: 2000, + limit: 20000 +}); + +window.addEvent('domready', function(){ + + status_req.startTimer(); + + + document.id("btAdd").addEvent("click", function(e){ + + new Request({ + method: 'post', + url: '/json/addpackage', + onSuccess: function(){ + document.id('linkarea').value = "" + } + }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) + + + }) + + $$('.statusbutton').each(function(item){ + + item.hover(function(e){ + this.tween('opacity',1) + },function(e){ + this.tween('opacity',0.01) + } + ) + }) + + fx_reveal = new Fx.Reveal($('addlinks')); + //fx_reveal.dissolve() + + + $$('#addlinks .closeSticky').each(function(el){ + + el.addEvent('click',function(e){ + + fx_reveal.dissolve(); + + }); + + }); + + $$('.statusbutton')[2].addEvent('click',function(e){ + + $('addlinks').setStyle('top', e.page.y + 5) + $('addlinks').setStyle('left', e.page.x + 5) + + fx_reveal.reveal() + + }); + + $$('.statusbutton')[0].addEvent('click', function(e){ + + new Request({ + 'url' : '/json/play', + 'method' : 'get' + }).send() + }) + + $$('.statusbutton')[1].addEvent('click', function(e){ + + new Request({ + 'url' : '/json/pause', + 'method' : 'get' + }).send() + }) + +}); \ No newline at end of file diff --git a/module/web/pyload.db b/module/web/pyload.db new file mode 100644 index 000000000..8d34ef89c Binary files /dev/null and b/module/web/pyload.db differ diff --git a/module/web/pyload/__init__.py b/module/web/pyload/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/web/pyload/admin.py b/module/web/pyload/admin.py new file mode 100644 index 000000000..40a96afc6 --- /dev/null +++ b/module/web/pyload/admin.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py new file mode 100644 index 000000000..293c01109 --- /dev/null +++ b/module/web/pyload/models.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +from django.db import models +#from django.contrib.auth.models.User import User as UserProfile +# Create your models here. + + +class Perm(models.Model): + """ extended pyLoad user Profile """ + + #user = models.ForeignKey(UserProfile, unique=True) + #template = models.CharField(maxlength=30) + + class Meta: + permissions = ( + ("can_see_dl", "Can see Downloads"), + ("can_add", "Can add Downloads"), + ("can_delete", "Can delete Downloads"), + ("can_download", "Can download Files"), + ("can_see_logs", "Can see logs"), + ("can_change_status", "Can change status"), + ) \ No newline at end of file diff --git a/module/web/pyload/tests.py b/module/web/pyload/tests.py new file mode 100644 index 000000000..2247054b3 --- /dev/null +++ b/module/web/pyload/tests.py @@ -0,0 +1,23 @@ +""" +This file demonstrates two different styles of tests (one doctest and one +unittest). These will both pass when you run "manage.py test". + +Replace these with more appropriate tests for your application. +""" + +from django.test import TestCase + +class SimpleTest(TestCase): + def test_basic_addition(self): + """ + Tests that 1 + 1 always equals 2. + """ + self.failUnlessEqual(1 + 1, 2) + +__test__ = {"doctest": """ +Another way to test that 1 + 1 is equal to 2. + +>>> 1 + 1 == 2 +True +"""} + diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py new file mode 100644 index 000000000..9c7942492 --- /dev/null +++ b/module/web/pyload/urls.py @@ -0,0 +1,7 @@ +from django.conf.urls.defaults import * + +urlpatterns = patterns('', + (r'^login/$', 'pyload.views.login'), + (r'^home/$', 'pyload.views.home'), + (r'^test/$', 'pyload.views.home'), +) diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py new file mode 100644 index 000000000..c42511ede --- /dev/null +++ b/module/web/pyload/views.py @@ -0,0 +1,80 @@ +# Create your views here. +from django.http import HttpResponse +from django.http import HttpResponseRedirect +from django.http import HttpResponseGone +from django.conf import settings +from django.shortcuts import render_to_response +from django.template import RequestContext +from django.contrib.auth.decorators import login_required +from os.path import join + + +def check_server(function): + def _dec(view_func): + def _view(request, *args, **kwargs): + try: + version = settings.PYLOAD.get_server_version() + return view_func(request, *args, **kwargs) + except Exception, e: + return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + if function is None: + return _dec + else: + return _dec(function) + + +def permission(perm): + def _dec(view_func): + def _view(request, *args, **kwargs): + if request.user.has_perm(perm): + return view_func(request, *args, **kwargs) + else: + return base(request, messages=['You don\'t have permission to view this page.']) + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + return _dec + + +def base(request, messages): + return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) + +@login_required +#@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( +@check_server +def home(request): + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.perm.can_see_dl') +@check_server +def queue(request): + return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.user.can_download') +@check_server +def downloads(request): + return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) + + +@login_required +#@permission('pyload.user.can_see_logs') +@check_server +def logs(request): + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) + + \ No newline at end of file diff --git a/module/web/settings.py b/module/web/settings.py new file mode 100644 index 000000000..0dc86d699 --- /dev/null +++ b/module/web/settings.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +# Django settings for pyload project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +import ConfigParser +import os.path +from os import chdir +from os.path import dirname +from os.path import abspath +from os import sep +import xmlrpclib + +SERVER_VERSION = "0.3" + +PROJECT_DIR = os.path.dirname(__file__) + +#chdir(dirname(abspath(__file__)) + sep) +config = ConfigParser.SafeConfigParser() +config.read(os.path.join(PROJECT_DIR,"..","..","config")) + +ssl = "" + +if config.get("ssl", "activated") == "True": + ssl = "s" + +server_url = "http%s://%s:%s@%s:%s/" % ( + ssl, + config.get("remote", "username"), + config.get("remote", "password"), + config.get("remote", "listenaddr"), + config.get("remote", "port") + ) + +PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) + +TEMPLATE = config.get('webinterface','template') + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), + ) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = 'pyload.db' # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'America/Chicago' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join(PROJECT_DIR, "media/") + + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" + +#MEDIA_URL = 'http://localhost:8000/media' +MEDIA_URL = '/media/' +#MEDIA_URL = os.path.join(PROJECT_DIR, "media/") + +LOGIN_REDIRECT_URL = "/" + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '+u%%1t&c7!e$0$*gu%w2$@to)h0!&x-r*9e+-=wa4*zxat%x^t' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', + # 'django.template.loaders.eggs.load_template_source', + ) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + ) + +ROOT_URLCONF = 'urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(PROJECT_DIR, "templates"), + ) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + #'django.contrib.sites', + 'django.contrib.admin', + 'pyload', + 'ajax', + ) + + +AUTH_PROFILE_MODULE = 'pyload.User' +LOGIN_URL = '/login' \ No newline at end of file diff --git a/module/web/static/default.css b/module/web/static/default.css deleted file mode 100644 index fd2e85eb9..000000000 --- a/module/web/static/default.css +++ /dev/null @@ -1,189 +0,0 @@ -a.interwiki{background:transparent url(static/default/interwiki.png) 0px 1px no-repeat;padding-left:16px;} -a.iw_wp{background-image:url(static/default/interwiki/wp.gif)} -a.iw_wpde{background-image:url(static/default/interwiki/wpde.gif)} -a.iw_wpmeta{background-image:url(static/default/interwiki/wpmeta.gif)} -a.iw_doku{background-image:url(static/default/interwiki/doku.gif)} -a.iw_dokubug{background-image:url(static/default/interwiki/dokubug.gif)} -a.iw_amazon{background-image:url(static/default/interwiki/amazon.gif)} -a.iw_amazon_de{background-image:url(static/default/interwiki/amazon.de.gif)} -a.iw_amazon_uk{background-image:url(static/default/interwiki/amazon.uk.gif)} -a.iw_phpfn{background-image:url(static/default/interwiki/phpfn.gif)} -a.iw_coral{background-image:url(static/default/interwiki/coral.gif)} -a.iw_sb{background-image:url(static/default/interwiki/sb.gif)} -a.iw_google{background-image:url(static/default/interwiki/google.gif)} -a.iw_meatball{background-image:url(static/default/interwiki/meatball.gif)} -a.iw_wiki{background-image:url(static/default/interwiki/wiki.gif)} -a.mediafile{background:transparent url(static/default/file.png) 0px 1px no-repeat;padding-left:18px;padding-bottom:1px;} -a.mf_jpg{background-image:url(static/default/jpg.png)} -a.mf_jpeg{background-image:url(static/default/jpeg.png)} -a.mf_gif{background-image:url(static/default/gif.png)} -a.mf_png{background-image:url(static/default/png.png)} -a.mf_tgz{background-image:url(static/default/tgz.png)} -a.mf_tar{background-image:url(static/default/tar.png)} -a.mf_gz{background-image:url(static/default/gz.png)} -a.mf_bz2{background-image:url(static/default/bz2.png)} -a.mf_zip{background-image:url(static/default/zip.png)} -a.mf_rar{background-image:url(static/default/rar.png)} -a.mf_pdf{background-image:url(static/default/pdf.png)} -a.mf_ps{background-image:url(static/default/ps.png)} -a.mf_doc{background-image:url(static/default/doc.png)} -a.mf_xls{background-image:url(static/default/xls.png)} -a.mf_ppt{background-image:url(static/default/ppt.png)} -a.mf_rtf{background-image:url(static/default/rtf.png)} -a.mf_swf{background-image:url(static/default/swf.png)} -a.mf_rpm{background-image:url(static/default/rpm.png)} -a.mf_deb{background-image:url(static/default/deb.png)} -a.mf_sxw{background-image:url(static/default/sxw.png)} -a.mf_sxc{background-image:url(static/default/sxc.png)} -a.mf_sxi{background-image:url(static/default/sxi.png)} -a.mf_sxd{background-image:url(static/default/sxd.png)} -a.mf_odc{background-image:url(static/default/odc.png)} -a.mf_odf{background-image:url(static/default/odf.png)} -a.mf_odg{background-image:url(static/default/odg.png)}a.mf_odi{background-image:url(static/default/odi.png)} -a.mf_odp{background-image:url(static/default/odp.png)}a.mf_ods{background-image:url(static/default/ods.png)} -a.mf_odt{background-image:url(static/default/odt.png)}div.clearer{clear:both;line-height:0;height:0;overflow:hidden;} -div.no{display:inline;margin:0;padding:0;}.hidden{display:none;} -div.error{background:#fcc url(static/default/error.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #faa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.info{background:#ccf url(static/default/info.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #aaf;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.success{background:#cfc url(static/default/success.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #afa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.notify{background:#ffc url(static/default/notify.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #ffa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -.medialeft{float:left;}.mediaright{float:right;} -.mediacenter{display:block;margin-left:auto;margin-right:auto;} -.leftalign{text-align:left;} -.centeralign{text-align:center;} -.rightalign{text-align:right;} -em.u{font-style:normal;text-decoration:underline;} -em em.u{font-style:italic;} -.code .br0{color:#6c6;} -.code .co1{color:#808080;font-style:italic;} -.code .co2{color:#808080;font-style:italic;} -.code .co3{color:#808080;} -.code .coMULTI{color:#808080;font-style:italic;} -.code .es0{color:#009;font-weight:bold;}.code .kw1{color:#b1b100;} -.code .kw2{color:#000;font-weight:bold;}.code .kw3{color:#006;} -.code .kw4{color:#933;}.code .kw5{color:#00f;}.code .me1{color:#060;}.code .me2{color:#060;} -.code .nu0{color:#c6c;}.code .re0{color:#00f;}.code .re1{color:#00f;}.code .re2{color:#00f;}.code .re3{color:#f33;font-weight:bold;}.code .re4{color:#099;}.code .st0{color:#f00;}.code .sy0{color:#6c6;} -div.dokuwiki table.pagelist,div.dokuwiki table.ul{border:0;padding:0;border-spacing:0;margin-bottom:1em;border-collapse:collapse;} -div.dokuwiki table.pagelist tr{border-top:1px solid #8cacbb;border-bottom:1px solid #8cacbb;} -div.dokuwiki table.pagelist th,div.dokuwiki table.pagelist td{padding:1px 1em 1px 0;} -div.dokuwiki table.ul th,div.dokuwiki table.ul td{padding:0 1em 0 0;} -div.dokuwiki table.ul ul{margin:0 0 0 1.5em;} -div.dokuwiki table.pagelist th,div.dokuwiki table.ul th{background-color:#dee7ec;} -div.dokuwiki th.page,div.dokuwiki th.date,div.dokuwiki th.user,div.dokuwiki th.desc,div.dokuwiki th.comments,div.dokuwiki th.linkbacks,div.dokuwiki th.tags,div.dokuwiki td.date,div.dokuwiki td.user,div.dokuwiki td.desc,div.dokuwiki td.comments,div.dokuwiki td.linkbacks,div.dokuwiki td.tags{color:#666;font-size:80%;} -div.dokuwiki td.date{text-align:right;}div.dokuwiki div.include div.secedit{float:right;margin-left:1em;margin-top:-18px;} -div.dokuwiki div.inclmeta{border-top:1px dotted #8cacbb;padding-top:0.2em;color:#666;font-size:80%;line-height:1.25;margin-top:0.5em;margin-bottom:2em;} -div.dokuwiki div.inclmeta a.permalink{background:transparent url(static/default/link.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta abbr.published{background:transparent url(static/default/date.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;border-bottom:0;} -div.dokuwiki div.inclmeta span.author{background:transparent url(static/default/user.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta span.comment{background:transparent url(static/default/comment.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta div.tags{border-top:0;font-size:100%;float:right;clear:none;}#plugin__manager{}#plugin__manager h2{margin-left:0;} -#plugin__manager form{display:block;margin:0;padding:0;} -#plugin__manager legend{display:none;} -#plugin__manager fieldset{width:auto;} -#plugin__manager .button{margin:0;} -#plugin__manager p,#plugin__manager label{text-align:left;} -#plugin__manager .hidden{display:none;}#plugin__manager .new{background:#dee7ec;} -#plugin__manager input[disabled]{color:#ccc;border-color:#ccc;} -#plugin__manager .pm_menu,#plugin__manager .pm_info{margin-left:0;text-align:left;} -#plugin__manager .pm_menu{float:left;width:48%;} -#plugin__manager .pm_info{float:right;width:50%;} -#plugin__manager .common{}#plugin__manager .common form{} -#plugin__manager .common fieldset{margin:0;padding:0 0 1.0em 0;text-align:left;border:none;} -#plugin__manager .common label{padding:0 0 0.5em 0;} -#plugin__manager .common input{} -#plugin__manager .common input.edit{width:24em;margin:0.5em;} -#plugin__manager .common .button{} -#plugin__manager form.plugins{} -#plugin__manager .plugins fieldset{color:#000;background:#fff;text-align:right;border-top:none;border-right:none;border-left:none;} -#plugin__manager .plugins fieldset.protected{background:#fdd;color:#000;} -#plugin__manager .plugins fieldset.disabled{background:#e0e0e0;color:#a8a8a8;} -#plugin__manager .plugins .legend{color:#000;background:inherit;display:block;margin:0;padding:0;font-size:1em;line-height:1.4em;font-weight:normal;text-align:left;float:left;padding:0;clear:none;} -#plugin__manager .plugins .button{font-size:95%;}#plugin__manager .plugins fieldset.buttons{border:none;} -#plugin__manager .plugins fieldset.buttons .button{float:left;} -#plugin__manager .pm_info h3{margin-left:0;}#plugin__manager .pm_info dl{margin:1em 0;padding:0;} -#plugin__manager .pm_info dt{width:6em;float:left;clear:left;margin:0;padding:0;} -#plugin__manager .pm_info dd{margin:0 0 0 7em;padding:0;background:none;} -#plugin__manager .plugins .enable{float:left;width:auto;margin-right:0.5em;} -#config__manager div.success,#config__manager div.error,#config__manager div.info{background-position:0.5em;padding:0.5em;text-align:center;} -#config__manager fieldset{margin:1em;width:auto;margin-bottom:2em;background-color:#dee7ec;color:#000;padding:0 1em;} -#config__manager legend{font-size:1.25em;} -#config__manager form{}#config__manager table{margin:1em 0;width:100%;}#config__manager fieldset td{text-align:left;} -#config__manager fieldset td.value{width:31em;}#config__manager td.label{padding:0.8em 0 0.6em 1em;vertical-align:top; -}#config__manager td.label label{clear:left;display:block;} -#config__manager td.label img{padding:0 10px;vertical-align:middle;float:right;} -#config__manager td.label span.outkey{font-size:70%;margin-top:-1.7em;margin-left:-1em;display:block;background-color:#fff;color:#666;float:left;padding:0 0.1em;position:relative;z-index:1;} -#config__manager td input.edit{width:30em;}#config__manager td .input{width:30.8em;} -#config__manager td select.edit{}#config__manager td textarea.edit{width:27.5em;height:4em;} -#config__manager tr .input,#config__manager tr input,#config__manager tr textarea,#config__manager tr select{background-color:#fff;color:#000;} -#config__manager tr.default .input,#config__manager tr.default input,#config__manager tr.default textarea,#config__manager tr.default select,#config__manager .selectiondefault{background-color:#cdf;color:#000;} -#config__manager tr.protected .input,#config__manager tr.protected input,#config__manager tr.protected textarea,#config__manager tr.protected select,#config__manager tr.protected .selection{background-color:#fcc!important;color:#000 !important;} -#config__manager td.error{background-color:red;color:#000;}#config__manager .selection{width:14.8em;float:left;margin:0 0.3em 2px 0;}#config__manager .selection label{float:right;width:14em;font-size:90%;} -* html #config__manager .selection label{padding-top:2px;} -#config__manager .selection input.checkbox{padding-left:0.7em;} -#config__manager .other{clear:both;padding-top:0.5em;} -#config__manager .other label{padding-left:2px;font-size:90%;}.dokuwiki div.plugin_translation{float:right;font-size:95%;} -.dokuwiki div.plugin_translation ul{display:inline;padding:0;margin:0;} -.dokuwiki div.plugin_translation ul li{float:left;list-style-type:none;padding:0;margin:0;} -.dokuwiki div.plugin_translation ul li a.wikilink1:link,.dokuwiki div.plugin_translation ul li a.wikilink1:hover,.dokuwiki div.plugin_translation ul li a.wikilink1:active,.dokuwiki div.plugin_translation ul li a.wikilink1:visited{background-color:#000080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} -.dokuwiki div.plugin_translation ul li a.wikilink2:link,.dokuwiki div.plugin_translation ul li a.wikilink2:hover,.dokuwiki div.plugin_translation ul li a.wikilink2:active,.dokuwiki div.plugin_translation ul li a.wikilink2:visited{background-color:#808080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} -.dokuwiki div.plugin_translation ul li a img{opacity:0.5;border:0;} -.dokuwiki div.plugin_translation ul li a.wikilink2 img{}.dokuwiki div.plugin_translation span.curid a img{opacity:1.0;height:15px;} -.dokuwiki div.plugin_translation ul li a:hover img{opacity:1.0;height:15px;}#user__manager tr.disabled{color:#6f6f6f;background:#e4e4e4;} -#user__manager tr.user_info{vertical-align:top;} -#user__manager div.edit_user{width:46%;float:left;}#user__manager table{margin-bottom:1em;}#user__manager input.button[disabled]{color:#ccc!important;border-color:#ccc!important;}div.dokuwiki div.newentry_form{clear:both;text-align:center;margin-bottom:1em;} -div.dokuwiki #blog__newentry_form input.edit{width:95%;}div.dokuwiki tr.draft,div.dokuwiki div.draft{opacity:0.5;} -div.dokuwiki div.autoarchive_selector ul{list-style-type:none;clear:left;margin:0 0.5em 0 0;} -div.dokuwiki div.autoarchive_selector ul div.li{float:left;margin:0 1em 0 0;} -div.dokuwiki div.autoarchive_selector ul ul{float:left;clear:none;}div.dokuwiki div.autoarchive_selector ul ul div.li{margin:0;}div#acl_manager div#acl__tree{font-size:90%;width:25%;height:300px;float:left;overflow:auto;border:1px solid #8cacbb;text-align:left;} -div#acl_manager div#acl__tree a.cur{background-color:#ff9;font-weight:bold;} -div#acl_manager div#acl__tree ul{list-style-type:none;margin:0;padding:0;}div#acl_manager div#acl__tree li{padding-left:1em;}div#acl_manager div#acl__tree ul img{margin-right:0.25em;cursor:pointer;} -div#acl_manager div#acl__detail{width:73%;height:300px;float:right;overflow:auto;} -div#acl_manager div#acl__detail fieldset{width:90%;} -div#acl_manager div#acl__detail div#acl__user{border:1px solid #8cacbb;padding:0.5em;margin-bottom:0.6em;} -div#acl_manager table.inline{width:100%;margin:0;} -div#acl_manager .aclgroup{background:transparent url(static/default/group.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .acluser{background:transparent url(static/default/user.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .aclpage{background:transparent url(static/default/page.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .aclns{background:transparent url(static/default/ns.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager label.disabled{color:#666!important;} -#acl_manager label{text-align:left;font-weight:normal;display:inline;} -#acl_manager table{margin-left:10%;width:80%;}#acl_manager table tr{background-color:inherit;} -#acl_manager table tr:hover{background-color:#dee7ec;} - - -a.interwiki{background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat;padding-left:16px;} -a.iw_wp{background-image:url(/static/default/wp.gif)} -a.iw_wpde{background-image:url(/static/default/wpde.gif)} -a.iw_wpmeta{background-image:url(/static/default/wpmeta.gif)} -a.iw_doku{background-image:url(/static/default/doku.gif)} -a.iw_dokubug{background-image:url(/static/default/dokubug.gif)} -a.iw_amazon{background-image:url(/static/default/amazon.gif)} -a.iw_amazon_de{background-image:url(/static/default/amazon.de.gif)} -a.iw_amazon_uk{background-image:url(/static/default/amazon.uk.gif)} -a.iw_phpfn{background-image:url(/static/default/phpfn.gif)} -a.iw_coral{background-image:url(/static/default/coral.gif)} -a.iw_sb{background-image:url(/static/default/sb.gif)} -a.iw_google{background-image:url(/static/default/google.gif)} -a.iw_meatball{background-image:url(/static/default/meatball.gif)} -a.iw_wiki{background-image:url(/static/default/wiki.gif)} -a.mediafile{background:transparent url(/static/default/file.png) 0px 1px no-repeat;padding-left:18px;padding-bottom:1px;}a.mf_jpg{background-image:url(/static/default/jpg.png)}a.mf_jpeg{background-image:url(/static/default/jpeg.png)}a.mf_gif{background-image:url(/static/default/gif.png)}a.mf_png{background-image:url(/static/default/png.png)}a.mf_tgz{background-image:url(/static/default/tgz.png)}a.mf_tar{background-image:url(/static/default/tar.png)}a.mf_gz{background-image:url(/static/default/gz.png)}a.mf_bz2{background-image:url(/static/default/bz2.png)} -a.mf_zip{background-image:url(/static/default/zip.png)}a.mf_rar{background-image:url(/static/default/rar.png)}a.mf_pdf{background-image:url(/static/default/pdf.png)}a.mf_ps{background-image:url(/static/default/ps.png)}a.mf_doc{background-image:url(/static/default/doc.png)}a.mf_xls{background-image:url(/static/default/xls.png)}a.mf_ppt{background-image:url(/static/default/ppt.png)}a.mf_rtf{background-image:url(/static/default/rtf.png)}a.mf_swf{background-image:url(/static/default/swf.png)}a.mf_rpm{background-image:url(/static/default/rpm.png)}a.mf_deb{background-image:url(/static/default/deb.png)}a.mf_sxw{background-image:url(/static/default/sxw.png)}a.mf_sxc{background-image:url(/static/default/sxc.png)}a.mf_sxi{background-image:url(/static/default/sxi.png)}a.mf_sxd{background-image:url(/static/default/sxd.png)}a.mf_odc{background-image:url(/static/default/odc.png)}a.mf_odf{background-image:url(/static/default/odf.png)}a.mf_odg{background-image:url(/static/default/odg.png)} -a.mf_odi{background-image:url(/static/default/odi.png)}a.mf_odp{background-image:url(/static/default/odp.png)}a.mf_ods{background-image:url(/static/default/ods.png)}a.mf_odt{background-image:url(/static/default/odt.png)}body{margin:0px;padding:0px;background-color:white;color:black;font-size:12px;font-family:Verdana,Helvetica,"Lucida Grande",Lucida,Arial,sans-serif;font-family:sans-serif;font-size:99,96%;font-size-adjust:none;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;}hr{border-width:0px;border-bottom:1px #aaa dotted;}img{border:none;}form{margin:0px;padding:0px;border:none;display:inline;background:transparent;}ul li{margin:5px;}textarea{font-family:monospace;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}a{color:#3465a4;text-decoration:none;}a:hover{text-decoration:underline;} -a.wikilink2{color:#a40000 !important;}.dokuwiki h1 a,.dokuwiki h2 a,.dokuwiki h3 a,.dokuwiki h4 a,.dokuwiki h5 a,.dokuwiki a.nolink{color:#000 !important;text-decoration:none !important;} -option{border:0px none #fff;}strong.highlight{background-color:#fc9;padding:1pt;}#pagebottom{clear:both;}hr{height:1px;color:#c0c0c0;background-color:#c0c0c0;border:none;margin:.2em 0 .2em 0;}pre{padding:0.5em;font-family:courier,monospace;border:1px solid #c0c0c0;background:#F0ECE6;white-space:pre;white-space:pre-wrap;word-wrap:break-word;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;}.invisible{margin:0px;border:0px;padding:0px;height:0px;visibility:hidden;}.left{float:left !important;}.right{float:right !important;}.center{text-align:center;}div#body-wrapper{padding:40px 40px 10px 40px;font-size:127%;} -div#content{margin-top:-20px;padding:0;font-size:14px;color:black;line-height:1.5em;}h1,h2,h3,h4,h5,h6{background:transparent none repeat scroll 0 0;border-bottom:1px solid #aaa;color:black;font-weight:normal;margin:0;padding:0;padding-bottom:0.17em;padding-top:0.5em;}h1{font-size:188%;line-height:1.2em;margin-bottom:0.1em;padding-bottom:0;}h2{font-size:150%;}h3,h4,h5,h6{border-bottom:none;font-weight:bold;}h3{font-size:132%;}h4{font-size:116%;}h5{font-size:100%;}h6{font-size:80%;}ul#page-actions{float:right;margin:10px 10px 0 10px;padding:6px;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:5px;}ul#user-actions{padding:5px;margin:0;display:inline;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:3px;}ul#page-actions li,ul#user-actions li{display:inline;}ul#page-actions a,ul#user-actions a{text-decoration:none;color:black;display:inline;margin:0 3px;padding:2px 0px 2px 18px;} -ul#page-actions a:hover,ul#page-actions a:focus,ul#user-actions a:hover,ul#user-actions a:focus{text-decoration:underline;}.hidden{display:none;}a.urlextern{color:#36B;background:transparent url(/static/default/external-10.2.png) no-repeat scroll right center;padding:0 13px 0 0;}a[href^="http://www.pyload.org"]:after,a.noextlink:after{background:none;padding:0;}a.action.index{background:transparent url(/static/default/wiki-tools-index.png) 0px 1px no-repeat;}a.action.recent{background:transparent url(/static/default/wiki-tools-recent.png) 0px 1px no-repeat;}a.logout{background:transparent url(/static/default/user-actions-logout.png) 0px 1px no-repeat;} -a.admin{background:transparent url(/static/default/user-actions-admin.png) 0px 1px no-repeat;}a.profile{background:transparent url(/static/default/user-actions-profile.png) 0px 1px no-repeat;}a.create,a.edit{background:transparent url(/static/default/page-tools-edit.png) 0px 1px no-repeat;}a.source,a.show{background:transparent url(/static/default/page-tools-source.png) 0px 1px no-repeat;}a.revisions{background:transparent url(/static/default/page-tools-revisions.png) 0px 1px no-repeat;}a.subscribe,a.unsubscribe{background:transparent url(/static/default/page-tools-subscribe.png) 0px 1px no-repeat;}a.backlink{background:transparent url(/static/default/page-tools-backlinks.png) 0px 1px no-repeat;}#head-panel{background:#525252 url(/static/default/head_bg1.png) bottom left repeat-x;}#head-panel h1{display:none;margin:0;text-decoration:none;padding-top:0.8em;padding-left:3.3em;font-size:2.6em;color:#eeeeec;}#head-panel #head-logo{float:left;margin:5px 0 -15px 5px;padding:0;overflow:visible;}#head-menu{background:transparent url(/static/default/tabs-border-bottom.png) 0 100% repeat-x;width:100%;float:left;margin:0;padding:0;padding-top:0.8em;} -#head-menu ul{list-style:none;margin:0 1em 0 2em;}#head-menu ul li{float:left;margin:0;margin-left:0.3em;font-size:14px;margin-bottom:4px;}#head-menu ul li.selected,#head-menu ul li:hover{margin-bottom:0px;}#head-menu ul li a img{height:22px;width:22px;vertical-align:middle;}#head-menu ul li a,#head-menu ul li a:link{float:left;text-decoration:none;color:#555;background:#eaeaea url(/static/default/tab-background.png) 0 100% repeat-x;padding:3px 7px 3px 7px;border:2px solid #ccc;border-bottom:0px solid transparent;padding-bottom:3px;-moz-border-radius:5px;}#head-menu ul li a:hover,#head-menu ul li a:focus{color:#111;padding-bottom:7px;border-bottom:0px none transparent;outline:none;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li a:focus{margin-bottom:-4px;}#head-menu ul li.selected a{color:#3566A5;background:#fff;padding-bottom:7px;border-bottom:0px none transparent;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li.selected a:hover,#head-menu ul li.selected a:focus{color:#111;}div#head-search-and-login{float:right;margin:0 1em 0 0;background-color:#222;padding:4px;color:white;-moz-border-radius-bottomright:6px;-moz-border-radius-bottomleft:6px;}div#head-search-and-login form{display:inline;padding:0 3px;}div#head-search-and-login form input{border:2px solid #888;background:#eee;font-size:14px;padding:2px;-moz-border-radius:3px;}div#head-search-and-login form input:focus{background:#fff;}#head-search{font-size:14px;}#head-username,#head-password{width:80px;font-size:14px;}#pageinfo{clear:both;color:#888;padding:0.6em 0;margin:0;}#foot{font-style:normal;color:#888;text-align:center;}#foot a{color:#aaf;}#foot img{vertical-align:middle;}ul.toc{padding:0;padding-left:20px;margin-left:0;margin-right:10px;list-style:none;}ul.toc li{list-style:circle;}ul.toc li a{text-decoration:none;color:black;}ul.toc li a:hover{text-decoration:underline;}div.toc{border:1px dotted #888;background:#f0f0f0;margin:1em 0 1em 1em;float:right;font-size:95%;}div.toc .tocheader{font-weight:bold;margin:0.5em 1em;}div.toc ol{margin:1em 0.5em 1em 1em;padding:0;}div.toc ol li{margin:0;padding:0;margin-left:1em;}div.toc ol ol{margin:0.5em 0.5em 0.5em 1em;padding:0;}div.recentchanges table{clear:both;}div#editor-help{font-size:90%;border:1px dotted #888;padding:0ex 1ex 1ex 1ex;background:#f7f6f2;}div#preview{margin-top:1em;}label.block{display:block;text-align:right;font-weight:bold;}label.simple{display:block;text-align:left;font-weight:normal;}label.block input.edit{width:50%;}fieldset{width:300px;text-align:center;padding:0.5em;margin:auto;}div.editor{margin:0 0 0 0;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}td p{margin:0;padding:0;}.u{text-decoration:underline;}.footnotes ul{padding:0 2em;margin:0 0 1em;}.footnotes li{list-style:none;}.recentchanges p{margin:0.25em;}.recentchanges td{vertical-align:top;border:none;border-bottom:1pt solid #F0ECE6;background:#F7F6F2;}.rcdaybreak td{background:#729fcf;border:none;}.rcdaybreak td a{font-size:0.88em;}.rcicon1,.rcicon2{text-align:center;}.rcpagelink{width:33%;}.rctime{font-size:0.88em;white-space:nowrap;}.rceditor{white-space:nowrap;font-size:0.88em;}.rccomment{width:66%;color:gray;font-size:0.88em;}.rcrss{float:right;}.recentchanges[dir="rtl"] .rcrss{float:left;}.userpref table,.userpref td{border:none;}div.codearea{margin:0.5em 0;padding:0;border:1pt solid #AEBDCC;background-color:#F3F5F7;color:black;}div.codearea pre{margin:0;padding:10pt;border:none;}a.codenumbers{margin:0 10pt;font-size:0.85em;color:gray;}div.codearea pre span.LineNumber{color:gray;}div.codearea pre span.ID{color:#000;}div.codearea pre span.Operator{color:#0000c0;}div.codearea pre span.Char{color:#004080;}div.codearea pre span.Comment{color:#008000;}div.codearea pre span.Number{color:#0080c0;}div.codearea pre span.String{color:#004080;}div.codearea pre span.SPChar{color:#0000c0;}div.codearea pre span.ResWord{color:#a00000;}div.codearea pre span.ConsWord{color:#008080;font-weight:bold;}div.codearea pre span.Error{color:#ff8080;border:solid 1.5pt #f00;}div.codearea pre span.ResWord2{color:#0080ff;font-weight:bold;}div.codearea pre span.Special{color:#00f;}div.codearea pre span.Preprc{color:#803999;}#message{clear:both;padding:5px 10px;background-color:#eee;border-bottom:2px solid #ccc;}#message p{margin:5px 0;padding:0;font-weight:bold;}#message div.buttons{font-weight:normal;}.diff{width:99%;}.diff-title{background-color:#C0C0C0;}.searchresult dd span{font-weight:bold;}.diff{width:100%;border:none;}.diff-blockheader{font-weight:bold;background:#e5e5e5;font-size:1.2em;border-top:2px solid #444;padding:5px;}.diff th{font-size:120%;width:50%;font-weight:normal;text-align:left;padding-bottom:3px;}.diff td{font-family:monospace;font-size:100%;border:none;}.diff-addedline{background-color:#dfd;}.diff-deletedline{background-color:#ffb;}.diff-context{color:#888;}.diff-addedline{background-color:#E0FFE0;vertical-align:sub;}.diff-deletedline{background-color:#FFFFE0;background-color:#f4cece;vertical-align:sub;} -.diff-addedline strong{background-color:#80FF80;background-color:#8ae234;} -.diff-deletedline strong{background-color:#FFFF80;background-color:#ef2929;background-color:#d78383;} - - - -.box{ background:url(/static/default/progress-bar-back.gif) right center no-repeat; width:200px; height:20px; float:left; } -.perc{ background:url(/static/default/progress-bar.gif) right center no-repeat; height:20px; } -.boxtext{ font-family:tahoma, arial, sans-serif; font-size:11px; color:#000; float:none; padding:3px 0 0 10px; } -.statusbutton{width:32px;height:32px;float:left;margin-left:-32px;margin-right:5px;opacity:0;cursor:pointer} - -.dlsize{float:left; padding-right: 8px;} -.dlspeed{float:left; padding-right: 8px;} \ No newline at end of file diff --git a/module/web/static/default/Button-Add-grey.png b/module/web/static/default/Button-Add-grey.png deleted file mode 100644 index 6659e230e..000000000 Binary files a/module/web/static/default/Button-Add-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Add.png b/module/web/static/default/Button-Add.png deleted file mode 100644 index 602da4131..000000000 Binary files a/module/web/static/default/Button-Add.png and /dev/null differ diff --git a/module/web/static/default/Button-Pause-grey.png b/module/web/static/default/Button-Pause-grey.png deleted file mode 100644 index d1017e974..000000000 Binary files a/module/web/static/default/Button-Pause-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Pause.png b/module/web/static/default/Button-Pause.png deleted file mode 100644 index 68f3ffc3a..000000000 Binary files a/module/web/static/default/Button-Pause.png and /dev/null differ diff --git a/module/web/static/default/Button-Play-grey.png b/module/web/static/default/Button-Play-grey.png deleted file mode 100644 index 9f44c2289..000000000 Binary files a/module/web/static/default/Button-Play-grey.png and /dev/null differ diff --git a/module/web/static/default/Button-Play.png b/module/web/static/default/Button-Play.png deleted file mode 100644 index 1ce1ed913..000000000 Binary files a/module/web/static/default/Button-Play.png and /dev/null differ diff --git a/module/web/static/default/head-login.png b/module/web/static/default/head-login.png deleted file mode 100644 index b59b7cbbf..000000000 Binary files a/module/web/static/default/head-login.png and /dev/null differ diff --git a/module/web/static/default/head-menu-development.png b/module/web/static/default/head-menu-development.png deleted file mode 100644 index 8ef08e2e5..000000000 Binary files a/module/web/static/default/head-menu-development.png and /dev/null differ diff --git a/module/web/static/default/head-menu-download.png b/module/web/static/default/head-menu-download.png deleted file mode 100644 index 98c5da9db..000000000 Binary files a/module/web/static/default/head-menu-download.png and /dev/null differ diff --git a/module/web/static/default/head-menu-home.png b/module/web/static/default/head-menu-home.png deleted file mode 100644 index 9d62109aa..000000000 Binary files a/module/web/static/default/head-menu-home.png and /dev/null differ diff --git a/module/web/static/default/head-menu-index.png b/module/web/static/default/head-menu-index.png deleted file mode 100644 index 44d631064..000000000 Binary files a/module/web/static/default/head-menu-index.png and /dev/null differ diff --git a/module/web/static/default/head-menu-news.png b/module/web/static/default/head-menu-news.png deleted file mode 100644 index 43950ebc9..000000000 Binary files a/module/web/static/default/head-menu-news.png and /dev/null differ diff --git a/module/web/static/default/head-menu-recent.png b/module/web/static/default/head-menu-recent.png deleted file mode 100644 index fc9b0497f..000000000 Binary files a/module/web/static/default/head-menu-recent.png and /dev/null differ diff --git a/module/web/static/default/head-menu-wiki.png b/module/web/static/default/head-menu-wiki.png deleted file mode 100644 index 07cf0102d..000000000 Binary files a/module/web/static/default/head-menu-wiki.png and /dev/null differ diff --git a/module/web/static/default/head-search-noshadow.png b/module/web/static/default/head-search-noshadow.png deleted file mode 100644 index aafdae015..000000000 Binary files a/module/web/static/default/head-search-noshadow.png and /dev/null differ diff --git a/module/web/static/default/head_bg1.png b/module/web/static/default/head_bg1.png deleted file mode 100644 index f2848c3cc..000000000 Binary files a/module/web/static/default/head_bg1.png and /dev/null differ diff --git a/module/web/static/default/home.js b/module/web/static/default/home.js deleted file mode 100644 index 025dcfcc7..000000000 --- a/module/web/static/default/home.js +++ /dev/null @@ -1,205 +0,0 @@ -var dwProgressBar = new Class({ - - //implements - Implements: [Options], - - //options - options: { - container: $$('body')[0], - boxID: '', - percentageID: '', - displayID: '', - startPercentage: 0, - displayText: false, - speed: 10 - }, - - //initialization - initialize: function(options) { - //set options - this.setOptions(options); - //create elements - this.createElements(); - }, - - //creates the box and percentage elements - createElements: function() { - var box = new Element('div', { - id: this.options.boxID + this.options.id, - 'class': this.options.boxID - }); - var perc = new Element('div', { - id: this.options.percentageID + this.options.id, - 'style': 'width:0px;', - 'class': this.options.percentageID - }); - perc.inject(box); - box.inject(this.options.container); - if (this.options.displayText) { - var text = new Element('div', { - id: this.options.displayID + this.options.id, - 'class': this.options.displayID - }); - text.inject(this.options.container); - } - this.set(this.options.startPercentage); - }, - - //calculates width in pixels from percentage - calculate: function(percentage) { - return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); - }, - - //animates the change in percentage - animate: function(to) { - document.id(this.options.percentageID + this.options.id).set('morph', { - duration: this.options.speed, - link: 'cancel' - }).morph({ - width: this.calculate(to.toInt()) - }); - if (this.options.displayText) { - document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); - } - }, - - //sets the percentage from its current state to desired percentage - set: function(to) { - this.animate(to); - } - -}); - -req = new Request.JSON({ - onSuccess: renderTable, - method: 'get', - url: '/json/links', - initialDelay: 0, - delay: 1000, - limit: 20000 -}); - -var dls = [] -var pbs = [] - -function renderTable(data) { - - data.downloads.each(function(dl) { - - if (dls.contains(dl.id)) { - - var div = $('dl' + dl.id) - - pbs[dl.id].set(dl.percent) - - div.getChildren("b")[0].textContent = dl.name - - if (dl.status == "downloading") { - - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; - speed = Math.round(dl.speed) + " kb/s"; - eta = dl.eta; - - } else if (dl.status == "waiting") { - - size = "waiting " + dl.wait; - speed = ""; - eta = ""; - - } - div.getChildren(".dlsize")[0].textContent = size; - div.getChildren(".dlspeed")[0].textContent = speed; - div.getChildren(".dltime")[0].textContent = eta; - - } else { - - dls.push(dl.id) - - container = $("dlcontainer") - - dldiv = new Element('div', { - 'id': 'dl' + dl.id, - 'class': 'download', - 'styles': { - 'display': 'None' - } - }) - - new Element('p').inject(dldiv) - - new Element('b', { - 'html': dl.name - }).inject(dldiv) - - new Element('br').inject(dldiv) - - dldiv.inject(container) - - pbs[dl.id] = new dwProgressBar({ - container: $(dldiv), - startPercentage: 0, - speed: 1000, - id: dl.id, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' - }); - - new Element('div', { - 'class': 'dlsize', - 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - }).inject(dldiv) - - new Element('div', { - 'class': 'dlspeed', - 'html': Math.round(dl.speed) + " kb/s" - }).inject(dldiv) - - new Element('div', { - 'class': 'dltime', - 'html': dl.eta - }).inject(dldiv) - - //dldiv.dissolve({duration : 0}) - dldiv.reveal() - - } - }) - - dls.each(function(id, index) { - - if (data.ids.contains(id)) { - -} else { - - //$("dl"+id).reveal() - dls.erase(id); - $('dl' + id).nix() - - } - - }) - -} - -window.addEvent('domready', -function() { - - /* -//create the progress bar for example 1 -pb = new dwProgressBar({ - container: $$('.level1 p')[0], - startPercentage: 25, - speed: 1000, - id: 1, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); -*/ - - req.startTimer(); - -}); \ No newline at end of file diff --git a/module/web/static/default/page-tools-backlinks.png b/module/web/static/default/page-tools-backlinks.png deleted file mode 100644 index 3eb6a9ce3..000000000 Binary files a/module/web/static/default/page-tools-backlinks.png and /dev/null differ diff --git a/module/web/static/default/page-tools-edit.png b/module/web/static/default/page-tools-edit.png deleted file mode 100644 index 188e1c12b..000000000 Binary files a/module/web/static/default/page-tools-edit.png and /dev/null differ diff --git a/module/web/static/default/page-tools-revisions.png b/module/web/static/default/page-tools-revisions.png deleted file mode 100644 index 5c3b8587f..000000000 Binary files a/module/web/static/default/page-tools-revisions.png and /dev/null differ diff --git a/module/web/static/default/progress-bar-back.gif b/module/web/static/default/progress-bar-back.gif deleted file mode 100644 index 0c8f68211..000000000 Binary files a/module/web/static/default/progress-bar-back.gif and /dev/null differ diff --git a/module/web/static/default/progress-bar.gif b/module/web/static/default/progress-bar.gif deleted file mode 100644 index 746f77175..000000000 Binary files a/module/web/static/default/progress-bar.gif and /dev/null differ diff --git a/module/web/static/default/pyload-logo-edited3.5-new-font-small.png b/module/web/static/default/pyload-logo-edited3.5-new-font-small.png deleted file mode 100644 index 2443cd8b1..000000000 Binary files a/module/web/static/default/pyload-logo-edited3.5-new-font-small.png and /dev/null differ diff --git a/module/web/static/default/status.js b/module/web/static/default/status.js deleted file mode 100644 index 3923e80ca..000000000 --- a/module/web/static/default/status.js +++ /dev/null @@ -1,100 +0,0 @@ -/* hover! */ -Element.implement({ - 'hover': function(fn1,fn2) { - return this.addEvents({ - 'mouseenter': function(e) { - fn1.attempt(e,this); - }, - 'mouseleave': function(e) { - fn2.attempt(e,this); - } - }) - } -}); - -function updateStatus(data){ - - document.id("status").textContent = "Status: "+ data.status; - document.id("speed").textContent = "Speed: "+ data.speed +" kb/s"; - document.id("queue").textContent = "Files in queue: "+ data.queue; - -} - - -status_req = new Request.JSON({ - onSuccess: updateStatus, - method: 'get', - url: '/json/status', - initialDelay: 0, - delay: 2000, - limit: 20000 -}); - -window.addEvent('domready', function(){ - - status_req.startTimer(); - - - document.id("btAdd").addEvent("click", function(e){ - - new Request({ - method: 'post', - url: '/json/addpackage', - onSuccess: function(){ - document.id('linkarea').value = "" - } - }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) - - - }) - - $$('.statusbutton').each(function(item){ - - item.hover(function(e){ - this.tween('opacity',1) - },function(e){ - this.tween('opacity',0.01) - } - ) - }) - - fx_reveal = new Fx.Reveal($('addlinks')); - //fx_reveal.dissolve() - - - $$('#addlinks .closeSticky').each(function(el){ - - el.addEvent('click',function(e){ - - fx_reveal.dissolve(); - - }); - - }); - - $$('.statusbutton')[2].addEvent('click',function(e){ - - $('addlinks').setStyle('top', e.page.y + 5) - $('addlinks').setStyle('left', e.page.x + 5) - - fx_reveal.reveal() - - }); - - $$('.statusbutton')[0].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/play', - 'method' : 'get' - }).send() - }) - - $$('.statusbutton')[1].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/pause', - 'method' : 'get' - }).send() - }) - -}); \ No newline at end of file diff --git a/module/web/static/default/tab-background.png b/module/web/static/default/tab-background.png deleted file mode 100644 index 29a5d1991..000000000 Binary files a/module/web/static/default/tab-background.png and /dev/null differ diff --git a/module/web/static/default/tabs-border-bottom.png b/module/web/static/default/tabs-border-bottom.png deleted file mode 100644 index 02440f428..000000000 Binary files a/module/web/static/default/tabs-border-bottom.png and /dev/null differ diff --git a/module/web/static/default/user-actions-logout.png b/module/web/static/default/user-actions-logout.png deleted file mode 100644 index 0010931e2..000000000 Binary files a/module/web/static/default/user-actions-logout.png and /dev/null differ diff --git a/module/web/static/default/user-actions-profile.png b/module/web/static/default/user-actions-profile.png deleted file mode 100644 index 46573fff6..000000000 Binary files a/module/web/static/default/user-actions-profile.png and /dev/null differ diff --git a/module/web/static/favicon.ico b/module/web/static/favicon.ico deleted file mode 100644 index 58b1f4b89..000000000 Binary files a/module/web/static/favicon.ico and /dev/null differ diff --git a/module/web/static/mootools-1.2.3-core.js b/module/web/static/mootools-1.2.3-core.js deleted file mode 100644 index 25f1f9d03..000000000 --- a/module/web/static/mootools-1.2.3-core.js +++ /dev/null @@ -1,335 +0,0 @@ -//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License. - -var MooTools={version:"1.2.3",build:"4980aa0fb74d2f6eb80bcd9f5b8e1fd6fbb8f607"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; -var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; -if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; -}if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); -}}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); -}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); -return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); -};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true}); -}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]}; -for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean()); -}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this); -}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++; -}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each"); -function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; -};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); -((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; -}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments); -a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; -}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; -b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); -return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a; -b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name; -}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; -}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); -}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); -},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); -},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; -Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true; -break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP"); -});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description; -},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; -})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); -a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; -var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); -if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}; -}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; -new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0]; -a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true); -});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null; -});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}}; -new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; -},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); -},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; -for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; -}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; -for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1; -},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; -},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; -},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; -for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]); -}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")"; -},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16); -b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; -b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); -}var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return $try(e); -}return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); -},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})(); -},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})(); -}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0; -a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each"); -(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a); -})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this); -},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); -},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); -});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); -},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); -return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; -var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); -}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; -});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; -},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); -},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; -},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); -return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); -},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; -}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; -Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; -Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; -});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); -var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; -var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; -if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; -var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; -if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; -break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; -}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); -}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); -},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); -}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; -}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); -a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); -}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); -break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; -},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); -}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); -}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); -if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; -if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; -this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); -}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); -},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; -},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; -this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); -if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); -if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); -}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); -}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); -if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); -delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); -if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; -if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); -if(g){g=($type(f)=="element");}}return(g)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined}); -var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); -c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); -new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype);}e.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow; -});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); -f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; -}e.push(d);}f=e;}return(b.cash)?$extend(f,this):f;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a); -}:a,b));}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;}a+=" "+c+'="'+b[c]+'"'; -if(c!="checked"){delete b[c];}});a="<"+a+">";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); -},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; -},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); -}return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; -};})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); -}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true)); -}}return new Elements(f);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b); -},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; -},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; -var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); -n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; -}}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); -}if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); -}q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; -var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; -b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); -}},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); -},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); -return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); -}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); -return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); -return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); -return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); -return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; -(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; -},hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); -}return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); -},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); -},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); -l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); -},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); -},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); -},getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); -},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; -},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; -}}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; -}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; -this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; -}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); -}});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); -v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; -if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); -},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); -});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; -}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); -},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; -n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); -}return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; -},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; -return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; -},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); -}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]}; -a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; -for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; -}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); -}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; -}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); -}return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); -if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; -}var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); -}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; -},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; -}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; -},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); -},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); -}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; -(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); -};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); -})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; -}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; -}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); -},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; -}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; -}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); -case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; -}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); -if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; -b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; -}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); -}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); -Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; -var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; -f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); -}else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; -},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); -}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; -}return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; -}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var m=this.getBoundingClientRect(),k=document.id(this.getDocument().documentElement),i=k.getScroll(),n=(d(this,"position")=="fixed"); -return{x:parseInt(m.left,10)+((n)?0:i.x)-k.clientLeft,y:parseInt(m.top,10)+((n)?0:i.y)-k.clientTop};}var j=this,h={x:0,y:0};if(b(this)){return h;}while(j&&!b(j)){h.x+=j.offsetLeft; -h.y+=j.offsetTop;if(Browser.Engine.gecko){if(!f(j)){h.x+=c(j);h.y+=g(j);}var l=j.parentNode;if(l&&d(l,"overflow")!="visible"){h.x+=c(l);h.y+=g(l);}}else{if(j!=this&&Browser.Engine.webkit){h.x+=c(j); -h.y+=g(j);}}j=j.offsetParent;}if(Browser.Engine.gecko&&!f(this)){h.x-=c(this);h.y-=g(this);}return h;},getPosition:function(k){if(b(this)){return{x:0,y:0}; -}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}; -},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y}; -k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; -},setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); -return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); -return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; -},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; -}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); -}function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; -}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; -},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; -},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; -}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e); -if(d!=0&&f.item){f=$A(f);}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f);}return new Elements(c,{ddup:(h.length>1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; -}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); -return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; -Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; -}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; -if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; -break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; -break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; -}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); -}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); -}}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; -}return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; -},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; -d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; -if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); -return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); -return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y); -continue;}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r);}else{var d={},g=[];for(var x=0,w=p.length; -x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d);}p=g;}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A); -}}p=e;}}return p;}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f); -}}return h;},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b); -}}return h;},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); -}break;}}return c;},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); -}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b)); -},byClass:function(b,a){return(b.className&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d); -if(!a){return(b=="!=");}if(!b||e==undefined){return true;}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); -case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; -}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a); -},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this; -while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false; -}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g); -if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e);}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this; -while((b=b.previousSibling)){if(b.nodeType!=1){continue;}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break;}}e.positions[d]=f;}return(e.positions[d]%c.a==c.b); -},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); -},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); -}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; -window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll(); -return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); -})();}else{window.addEvent("load",b);document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); -},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; -case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); -case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; -}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; -this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; -}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); -this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a); -},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); -return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition(); -this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel(); -}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject); -}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer(); -return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false; -}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c; -};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; -b[0]=d.getStyle(e);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a); -return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return;}var d=f.parse(c);if($chk(d)){b={value:d,parser:f};}}); -b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser}); -});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b)); -});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href; -if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return;}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase(); -}):null;if(!h||!h.test("^"+a+"$")){return;}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k; -});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true); -}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a)); -});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}}); -Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b; -b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; -}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); -}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a)); -},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options"))); -}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; -c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1); -e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); -a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); -b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); -},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; -for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; -for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph"); -if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a); -}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a); -return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":"); -a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(b,a){a=$splat(a); -return $extend(b,{easeIn:function(c){return b(c,a);},easeOut:function(c){return 1-b(1-c,a);},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2; -}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6); -},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2); -},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2); -break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]); -});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); -this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; -}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; -this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); -},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); -},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); -},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); -return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; -}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; -}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=k.url,a=k.method.toLowerCase(); -switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; -g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; -this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; -}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); -this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); -}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; -}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; -["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); -return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); -}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); -}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); -b.send({data:this,url:a||b.options.url});return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a); -this.headers.extend({Accept:"application/json","X-Request":"JSON"});},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a); -}}); \ No newline at end of file diff --git a/module/web/static/mootools-1.2.3.1-more.js b/module/web/static/mootools-1.2.3.1-more.js deleted file mode 100644 index f3e4b4121..000000000 --- a/module/web/static/mootools-1.2.3.1-more.js +++ /dev/null @@ -1,76 +0,0 @@ -//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. - -MooTools.More={version:"1.2.3.1"};Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d];if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous; -this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;});}else{b.implement(d,e);}});return b;};Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth); -};if(g(this)){return e.apply(this);}var d=this.getParent(),b=[],f=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); -var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; -this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); -var d={};var c=function(f,e){return(e.computeSize)?f.getComputedSize(e):f.getSize();};if(this.getStyle("display")=="none"){d=this.measure(function(){return c(this,a); -});}else{try{d=c(this,a);}catch(b){}}return $chk(d.x)?$extend(d,{width:d.x,height:d.y}):$extend(d,{x:d.width,y:d.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); -var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; -break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; -b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=0;c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; -b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); -c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; -c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; -},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();},hide:function(){var b;try{if("none"!=this.getStyle("display")){b=this.getStyle("display"); -}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none");},show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block"); -},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); -this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; -},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this; -}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j); -}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; -this.showing=false;this.hidden=true;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var g=(this.element.style.height===""||this.element.style.height=="auto"); -this.element.setStyle("display","block");if(this.options.transitionOpacity){d.opacity=1;}var b={};$each(d,function(h,e){b[e]=[h,0];},this);var f=this.element.getStyle("overflow"); -this.element.setStyle("overflow","hidden");var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false; -$each(d,function(h,e){d[e]=h;},this);this.element.setStyles($merge({display:"none",overflow:f},d));if(g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; -}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(a){a.setStyle("visibility","visible");}}this.fireEvent("hide",this.element); -this.callChain();}.bind(this));if(a){a.setStyle("visibility","hidden");}this.start(b);}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this));}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel(); -this.dissolve();}}}}catch(c){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("hide",this.element);}return this;},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true; -this.hiding=false;this.hidden=false;var g,d;this.element.measure(function(){g=(this.element.style.height===""||this.element.style.height=="auto");d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); -}.bind(this));$each(d,function(h,e){d[e]=h;});if($chk(this.options.heightOverride)){d.height=this.options.heightOverride.toInt();}if($chk(this.options.widthOverride)){d.width=this.options.widthOverride.toInt(); -}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=1;}var b={height:0,display:this.options.display};$each(d,function(h,e){b[e]=0; -});var f=this.element.getStyle("overflow");this.element.setStyles($merge(b,{overflow:"hidden"}));var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null; -if(a){a.setStyle("visibility","hidden");}this.start(d);this.$chain.unshift(function(){this.element.setStyle("overflow",f);if(!this.options.heightOverride&&g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; -}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(!this.hidden){this.showing=false;}if(a){a.setStyle("visibility","visible"); -}this.callChain();this.fireEvent("show",this.element);}.bind(this));}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element); -}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal(); -}}}}catch(c){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("show",this.element);}return this;},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal(); -}else{this.dissolve();}return this;}});Element.Properties.reveal={set:function(a){var b=this.retrieve("reveal");if(b){b.cancel();}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},a)); -},get:function(a){if(a||!this.retrieve("reveal")){if(a||!this.retrieve("reveal:options")){this.set("reveal",a);}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options"))); -}return this.retrieve("reveal");}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal",a).reveal(); -return this;},dissolve:function(a){this.get("reveal",a).dissolve();return this;},nix:function(){var a=Array.link(arguments,{destroy:Boolean.type,options:Object.type}); -this.get("reveal",a.options).dissolve().chain(function(){this[a.destroy?"destroy":"dispose"]();}.bind(this));return this;},wink:function(){var b=Array.link(arguments,{duration:Number.type,options:Object.type}); -var a=this.get("reveal",b.options);a.reveal().chain(function(){(function(){a.dissolve();}).delay(b.duration||2000);});}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0); -if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(b);this.parent(a);var c=this.element.retrieve("wrapper"); -this.wrapper=c||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0); -this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left"; -this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]); -return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this; -}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]]; -var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a); -},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode](); -this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide"); -if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a); -}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,e){d=d||"toggle"; -var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); -this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(b,a){this.parent(b,a); -this.elements.each(function(c){if(c.getStyle("position")=="static"){c.setStyle("position","relative");}});this.setDefaultOrder();},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(b,a){return a; -});},sort:function(e){if($type(e)!="array"){return false;}var i=0;var a=0;var h={};var d=this.options.mode=="vertical";var f=this.elements.map(function(m,j){var l=m.getComputedSize({styles:["border","padding","margin"]}); -var n;if(d){n={top:i,margin:l["margin-top"],height:l.totalHeight};i+=n.height-l["margin-top"];}else{n={left:a,margin:l["margin-left"],width:l.totalWidth}; -a+=n.width;}var k=d?"top":"left";h[j]={};var o=m.getStyle(k).toInt();h[j][k]=o||0;return n;},this);this.set(h);e=e.map(function(j){return j.toInt();}); -if(e.length!=this.elements.length){this.currentOrder.each(function(j){if(!e.contains(j)){e.push(j);}});if(e.length>this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); -}}i=0;a=0;var b=0;var c={};e.each(function(l,j){var k={};if(d){k.top=i-f[l].top-b;i+=f[l].height;}else{k.left=a-f[l].left;a+=f[l].width;}b=b+f[l].margin; -c[l]=k;},this);var g={};$A(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; -var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); -},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; -});},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());},reverse:function(){return this.sort(this.currentOrder.reverse()); -},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b);},this));},swap:function(c,b){if($type(c)=="element"){c=this.elements.indexOf(c); -}if($type(b)=="element"){b=this.elements.indexOf(b);}var a=$A(this.currentOrder);a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;this.sort(a); -}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=(function(){if(!this.running){this.send({data:b}); -}});this.timer=a.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(c){$clear(this.timer);if(c){this.lastDelay=this.options.delay; -}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit);}this.timer=a.delay(this.lastDelay,this);};this.addEvent("complete",this.completeCheck); -return this;},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this;}}); \ No newline at end of file diff --git a/module/web/static/window.css b/module/web/static/window.css deleted file mode 100644 index aaccae082..000000000 --- a/module/web/static/window.css +++ /dev/null @@ -1,17 +0,0 @@ -.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} -.SWclearfix {display: inline-table;} -* html .SWclearfix {height: 1%;} -.SWclearfix {display: block;} - -div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;} -div.DefaultStickyWin div.top_ul{background:url(/static/window/full.png) top left no-repeat; height:30px; width:15px; float:left} -div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(/static/window/full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px} -div.DefaultStickyWin h1.caption{clear: none !important; margin:0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;} -div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(/static/window/body.png) top left repeat-y; margin:0px 20px 0px 0px !important; margin-bottom: -3px; position: relative; top: 0px !important; top: -3px;} -div.DefaultStickyWin div.body{background:url(/static/window/body.png) top right repeat-y; padding:8px 30px 8px 0px !important; margin-left:5px !important; position:relative; right:-20px !important;} -div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(/static/window/full.png) bottom left no-repeat; width:15px; height:15px; float:left} -div.DefaultStickyWin div.bottom_lr{background:url(/static/window/full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px} -div.DefaultStickyWin div.closeButtons{text-align: center; background:url(/static/window/body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px} -div.DefaultStickyWin a.button:hover{background:url(/static/window/big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(/static/window/big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;} -div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(/static/window/closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer;top:0px} -div.DefaultStickyWin div.dragHandle { width: 11px; height: 25px; position: relative; top: 5px; left: -3px; cursor: move; background: url(/static/window/drag_corner.gif); float: left;} \ No newline at end of file diff --git a/module/web/static/window/big_button.gif b/module/web/static/window/big_button.gif deleted file mode 100644 index 7680490ea..000000000 Binary files a/module/web/static/window/big_button.gif and /dev/null differ diff --git a/module/web/static/window/big_button_over.gif b/module/web/static/window/big_button_over.gif deleted file mode 100644 index 2e3ee10d2..000000000 Binary files a/module/web/static/window/big_button_over.gif and /dev/null differ diff --git a/module/web/static/window/body.png b/module/web/static/window/body.png deleted file mode 100644 index 7ff1043e0..000000000 Binary files a/module/web/static/window/body.png and /dev/null differ diff --git a/module/web/static/window/closebtn.gif b/module/web/static/window/closebtn.gif deleted file mode 100644 index 3e27e6030..000000000 Binary files a/module/web/static/window/closebtn.gif and /dev/null differ diff --git a/module/web/static/window/drag_corner.gif b/module/web/static/window/drag_corner.gif deleted file mode 100644 index befb1adf1..000000000 Binary files a/module/web/static/window/drag_corner.gif and /dev/null differ diff --git a/module/web/static/window/full.png b/module/web/static/window/full.png deleted file mode 100644 index fea52af76..000000000 Binary files a/module/web/static/window/full.png and /dev/null differ diff --git a/module/web/templates/default.tpl b/module/web/templates/default.tpl deleted file mode 100644 index 3f5e8d8e8..000000000 --- a/module/web/templates/default.tpl +++ /dev/null @@ -1,230 +0,0 @@ -%header = 'pyLoad Webinterface' -%js = ['mootools-1.2.3-core.js','mootools-1.2.3.1-more.js'] - -%if page== "home": js.append('default/home.js') -%end -%if page== "loggedin": red=True -%else: red=False -%end -%if page != "loggedin" and page != "login": js.append('default/status.js') -%end - -%include header title=header, use_js=js, use_css=['default.css','window.css'], redirect=red - -%include window id="addlinks", width=400, caption="Add links", body="<input id='pname' type='text' style='width: 345px;' value='Package'/><textarea rows=10 style='width: 345px;' id='linkarea'></textarea>", button="Add" - -<a class="anchor" name="top" id="top"></a> - -<div id="head-panel"> - - - <div id="head-search-and-login"> - -%if page != "login": - <img src="static/default/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user}}</span> - <ul id="user-actions"> - <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li> - <li></li> - <li></li> - </ul> -%else: - <span style="padding-right: 2px;">Please Login!</span> - - -%end - </div> - - <a href="/"><img id="head-logo" src="/static/default/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a> - - <div id="head-menu"> - <ul> - <li class=" - %if page == "home" or page == "login": - selected - %endif - "><a href="/" title=""><img src="static/default/head-menu-home.png" alt="" /> Home</a></li> - <li class=" - %if page == "queue": - selected - %endif - "><a href="/queue" title=""><img src="static/default/head-menu-download.png" alt="" /> Queue</a></li> - <li class=" - %if page == "downloads": - selected - %endif - "><a href="/downloads" title=""><img src="static/default/head-menu-development.png" alt="" /> Downloads</a></li> - <li class="right"><a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="static/default/head-menu-index.png" alt="" />Logs</a></li> </ul> - </div> - - <div style="clear:both;"></div> -</div> - -<ul id="page-actions"> - <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> - -</ul> - -<div id="body-wrapper" class="dokuwiki"> - - <div id="content" lang="en" dir="ltr"> - - -<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> -</h1> - - -%if page != "loggedin" and page != "login": - -<div id="statusbar"> - <div id="status" style="float: left;padding: 8px;"> -Status: -</div> - <div id="speed" style="float: left;padding: 8px"> -Speed: -</div> - - <div id="queue" style="float: left;padding: 8px"> -Files in queue: -</div> - -<div style="padding-top:2px"> - -<div style="background-image:url(static/default/Button-Play.png);width:32px;height:32px;float:left"></div> -<div class= "statusbutton" style="background-image:url(static/default/Button-Play-grey.png); visibility: visible; opacity: 0.01"></div> -<div style="background-image:url(static/default/Button-Pause.png);width:32px;height:32px;float:left"></div> -<div class= "statusbutton" style="background-image:url(static/default/Button-Pause-grey.png); visibility: visible; opacity: 0.01"></div> -<div style="background-image:url(static/default/Button-Add.png);width:32px;height:32px;float:left"></div> -<div class= "statusbutton" style="background-image:url(static/default/Button-Add-grey.png); visibility: visible; opacity: 0.01"></div> - - -</div> - -</div> - -%end - - -<br> - -<div class="level1" style="clear:both"> - -%if page == "login": - -</div> -<div class="centeralign"> -<form action="" method="post" accept-charset="utf-8" id="login"><div class="no"> -<input type="hidden" name="do" value="login" /><fieldset ><legend>Login</legend> -<label class="block" for="focus__this"><span>Username</span> <input type="text" id="focus__this" name="u" class="edit" /></label><br /> -<label class="block"><span>Password</span> <input type="password" name="p" class="edit" /></label><br /> -<input type="submit" value="Login" class="button" /> -</fieldset> -</div></form> -</div> -<br> - -%elif page== "home": -<h2>Downloads:</h2> - -<div id="dlcontainer"> - -% for link in links: - - -<div class="download" id="dl{{link['id']}}" style="color: #000"> -<p></p> - -<b>{{link['name']}}</b> -<br> -<script type="text/javascript"> -pbs[{{link['id']}}] = new dwProgressBar({ - container: document.id('dl{{link['id']}}'), - startPercentage: {{link['percent']}}, - speed: 1000, - id: {{link['id']}}, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); - -dls.push({{link['id']}}) - -</script> - - -<div class="dlsize"> -{{int((link['size'] - link['kbleft']) / 1024)}}/{{int(link['size']) / 1024}} MB -</div> - - -<div class="dlspeed"> -{{int(link['speed'])}} kb/s -</div> - - -<div class="dltime"> -{{link['eta']}} -</div> - - -</div> - - -<script type="text/javascript"> -$$("#dl{{link['id']}}")[0].hover(function(e){ - -this.morph({'color': '#f00'}); - -}, function(e){ - -this.morph({'color': '#000'}); - -}); - - -</script> - - -%end - -</div> - - -%elif page=="loggedin": - - -<b>You were successfully logged in</b> - -%elif page=="queue": - -<ul> - -%for package in links: - -<li>{{package.name}}</li> - -%end - -</ul> - -Currently in Development - -%elif page=="downloads": - -Currently in Development - - -%end - <hr style="clear: both;" /> - -<div id="foot">© 2008-2009 the pyLoad Team - - <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br /> - <!--<div class="breadcrumbs"></div>--> - - -</div> - -</div> - -%include footer use_js=[] \ No newline at end of file diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html new file mode 100644 index 000000000..096692a3c --- /dev/null +++ b/module/web/templates/default/base.html @@ -0,0 +1,99 @@ +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> +{% block head %} +{% endblock %} +<title>{% block title %}pyLoad Webinterface{% endblock %}</title> +</head> + +<a class="anchor" name="top" id="top"></a> + +<div id="head-panel"> + +<div id="head-search-and-login"> + +{% if user.is_authenticated %} +<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span> + <ul id="user-actions"> + <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li> + {% if user.is_staff %} + <li><a href="/admin" class="action profile" rel="nofollow">Administrate</a></li> + {% endif %} + <li></li> + <li></li> + </ul> +{% else %} + <span style="padding-right: 2px;">Please Login!</span> +{% endif %} + + </div> + + <a href="/"><img id="head-logo" src="{{ MEDIA_URL }}img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a> + + <div id="head-menu"> + <ul> + + {% block menu %} + <li class="selected"> + <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + </li> + <li> + <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <li> + <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <li class="right"> + <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + </li> + {% endblock %} + + </ul> + </div> + + <div style="clear:both;"></div> +</div> + +<ul id="page-actions"> + <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> + +</ul> + +<div id="body-wrapper" class="dokuwiki"> + +<div id="content" lang="en" dir="ltr"> + +<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> +</h1> + +{% block statusbar %} +{% endblock %} + + +<br> + +<div class="level1" style="clear:both"> +</div> + +{% for message in messages %} + <b><p>{{message}}</p></b> +{% endfor %} + +{% block content %} +{% endblock content %} + + <hr style="clear: both;" /> + +<div id="foot">© 2008-2010 the pyLoad Team + + <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br /> + <!--<div class="breadcrumbs"></div>--> + + +</div> +</div> +</head> +<body> diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html new file mode 100644 index 000000000..3c9bb5df4 --- /dev/null +++ b/module/web/templates/default/downloads.html @@ -0,0 +1,16 @@ +{% extends 'default/base.html' %} + +{% block title %}Downloads - {{block.super}} {% endblock %} + +{% block menu %} +<li> + <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> +</li> +<li> + <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> +<li class="selected"> + <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> +<li class="right"> + <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> +</li> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html new file mode 100644 index 000000000..895302e61 --- /dev/null +++ b/module/web/templates/default/home.html @@ -0,0 +1 @@ +{% extends 'default/base.html' %} \ No newline at end of file diff --git a/module/web/templates/default/login.html b/module/web/templates/default/login.html new file mode 100644 index 000000000..851802c4f --- /dev/null +++ b/module/web/templates/default/login.html @@ -0,0 +1,35 @@ +{% extends 'default/base.html' %} + +{% block title %}Login - {{block.super}} {% endblock %} + +{% block content %} + +<div class="centeralign"> +<form action="" method="post" accept-charset="utf-8" id="login"> + <div class="no"> + <input type="hidden" name="do" value="login" /> + <fieldset> + <legend>Login</legend> + <label class="block" for="focus__this"> + <span>Username</span> + {{ form.username }} + </label> + <br /> + <label class="block"> + <span>Password</span> + {{ form.password }} + </label> + <br /> + <input type="submit" value="Login" class="button" /> + </fieldset> + </div> +</form> + +{% if form.errors %} +<p>Your username and password didn't match. Please try again.</p> +{% endif %} + +</div> +<br> + +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/logout.html b/module/web/templates/default/logout.html new file mode 100644 index 000000000..4d00bf6d5 --- /dev/null +++ b/module/web/templates/default/logout.html @@ -0,0 +1,9 @@ +{% extends 'default/base.html' %} + +{% block head %} +<meta http-equiv="refresh" content="3; url=/"> +{% endblock %} + +{% block content %} +<p><b>You were successfully logged out.</b></p> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html new file mode 100644 index 000000000..d6f392f58 --- /dev/null +++ b/module/web/templates/default/logs.html @@ -0,0 +1,16 @@ +{% extends 'default/base.html' %} + +{% block title %}Logs - {{block.super}} {% endblock %} + +{% block menu %} +<li> + <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> +</li> +<li> + <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> +<li> + <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> +<li class="right" class="selected"> + <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> +</li> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html new file mode 100644 index 000000000..b6a185b19 --- /dev/null +++ b/module/web/templates/default/queue.html @@ -0,0 +1,16 @@ +{% extends 'default/base.html' %} + +{% block title %}Queue - {{block.super}} {% endblock %} + +{% block menu %} +<li> + <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> +</li> +<li class="selected"> + <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> +<li> + <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> +<li class="right"> + <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> +</li> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html new file mode 100644 index 000000000..f756c4352 --- /dev/null +++ b/module/web/templates/default/window.html @@ -0,0 +1,28 @@ +<div id="{{id}}" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> +<div class="DefaultStickyWin" style="width: {{width}}px;"> + +<div class="top"> +<div class="top_ul"></div> +<div class="top_ur"><h1 class="caption dragHandle">{{caption}}</h1> +</div></div> + +<div class="middle"> +<div class="body">{{body}} +</div></div> + +<div class="closeBody"> +<div class="closeButtons"> +<a class="closeSticky button" id="bt{{button}}">{{button}}</a><a class="closeSticky button">Close</a> +</div> +</div> + +<div class="bottom"> +<div class="bottom_ll"> +</div> + +<div class="bottom_lr"></div> +</div> +<div class="closeButton closeSticky"></div> + +</div> +</div> \ No newline at end of file diff --git a/module/web/templates/footer.tpl b/module/web/templates/footer.tpl deleted file mode 100644 index a59b414bf..000000000 --- a/module/web/templates/footer.tpl +++ /dev/null @@ -1,6 +0,0 @@ -%for item in use_js: -<script type="text/javascript" src="static/{{item}}"></script> -%end - -</body> -</html> diff --git a/module/web/templates/header.tpl b/module/web/templates/header.tpl deleted file mode 100644 index 22c252e3c..000000000 --- a/module/web/templates/header.tpl +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - -%for item in use_js: -<script type="text/javascript" src="static/{{item}}"></script> -%end - -%for item in use_css: -<link rel="stylesheet" type="text/css" href="static/{{item}}"> -%end - -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - -%if redirect: -<meta http-equiv="refresh" content="3; url=/"> -%end - -<title>{{title}}</title> - -</head> -<body> diff --git a/module/web/templates/window.tpl b/module/web/templates/window.tpl deleted file mode 100644 index f756c4352..000000000 --- a/module/web/templates/window.tpl +++ /dev/null @@ -1,28 +0,0 @@ -<div id="{{id}}" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> -<div class="DefaultStickyWin" style="width: {{width}}px;"> - -<div class="top"> -<div class="top_ul"></div> -<div class="top_ur"><h1 class="caption dragHandle">{{caption}}</h1> -</div></div> - -<div class="middle"> -<div class="body">{{body}} -</div></div> - -<div class="closeBody"> -<div class="closeButtons"> -<a class="closeSticky button" id="bt{{button}}">{{button}}</a><a class="closeSticky button">Close</a> -</div> -</div> - -<div class="bottom"> -<div class="bottom_ll"> -</div> - -<div class="bottom_lr"></div> -</div> -<div class="closeButton closeSticky"></div> - -</div> -</div> \ No newline at end of file diff --git a/module/web/urls.py b/module/web/urls.py new file mode 100644 index 000000000..3e573aa95 --- /dev/null +++ b/module/web/urls.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +from django.conf.urls.defaults import * +from django.contrib import admin +from django.conf import settings + +from os.path import join + +admin.autodiscover() + +urlpatterns = patterns('', + # Example: + # (r'^pyload/', include('pyload.foo.urls')), + + # Uncomment the admin/doc line below and add 'django.contrib.admindocs' + # to INSTALLED_APPS to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + (r'^admin/', include(admin.site.urls)), + #(r'^json/', include(ajax.urls)), + (r'^media/(?P<path>.*)$', 'django.views.static.serve', + {'document_root': settings.MEDIA_ROOT}), + (r'^login/$', 'django.contrib.auth.views.login', {'template_name': join(settings.TEMPLATE,'login.html')}), + (r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': join(settings.TEMPLATE,'logout.html')}), + (r'^home/$', 'pyload.views.home'), + (r'^downloads/$', 'pyload.views.downloads'), + (r'^queue/$', 'pyload.views.queue'), + (r'^logs/$', 'pyload.views.logs'), + (r'^$', 'pyload.views.home'), + ) -- cgit v1.2.3 From 4e86c166dc20a8f4d1000e65120508c425f5b794 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 15 Dec 2009 22:47:26 +0100 Subject: Fixed LinkList.py and .part renaming --- module/network/Request.py | 53 +++++++++++++++++++++++----------------------- module/plugins/LinkList.py | 2 +- 2 files changed, 28 insertions(+), 27 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index cda8e50f1..f9a5cce0f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -222,7 +222,7 @@ class Request: self.opener.add_handler(handler) self.downloader.add_handler(handler) - def download(self, url, file_name, folder="", get={}, post={}, ref=True, cookies=False): + def download(self, url, file_name, get={}, post={}, ref=True, cookies=False): if post: post = urllib.urlencode(post) @@ -236,8 +236,7 @@ class Request: get = "" if self.curl: - - file_temp = file_name + ".part" + file_temp = self.get_free_name(file_name + ".part") fp = open(file_temp, 'wb') self.init_curl() @@ -261,30 +260,19 @@ class Request: self.dl = True self.pycurl.perform() - if "..." in file_name: - download_folder = dirname(file_name) + sep - headers = self.get_header() - file_name_search = re.search('filename=(?P<quote>\")?(.+)(?(quote)\")', headers) - if file_name_search: - file_name = file_name_search.group(2) - if "?=" in file_name[-3:]: - file_name = file_name.replace("=?UTF-8?B?", "").replace("?=", "==") - file_name = b64decode(file_name) - file_name = download_folder + sep + file_name + #~ if "..." in file_name: + #~ download_folder = dirname(file_name) + sep + #~ headers = self.get_header() + #~ file_name_search = re.search('filename=(?P<quote>\")?(.+)(?(quote)\")', headers) + #~ if file_name_search: + #~ file_name = file_name_search.group(2) + #~ if "?=" in file_name[-3:]: + #~ file_name = file_name.replace("=?UTF-8?B?", "").replace("?=", "==") + #~ file_name = b64decode(file_name) + #~ file_name = download_folder + sep + file_name - file_count = 0 - while exists(file_name): - file_count += 1 - if "." in file_name: - file_split = file_name.split(".") - temp_name = "%s-%i.%s" % (".".join(file_split[:-1]), file_count, file_split[-1]) - else: - temp_name = "%s-%i" % (file_name, file_count) - if not exists(temp_name): - file_name = temp_name - - rename(file_temp, file_name) - + rename(file_temp, self.get_free_name(file_name)) + self.dl = False self.dl_finished = time.time() @@ -362,6 +350,19 @@ class Request: self.dl_arrived = int(dl_d) self.dl_size = int(dl_t) + def get_free_name(self, file_name): + file_count = 0 + while exists(file_name): + file_count += 1 + if "." in file_name: + file_split = file_name.split(".") + temp_name = "%s-%i.%s" % (".".join(file_split[:-1]), file_count, file_split[-1]) + else: + temp_name = "%s-%i" % (file_name, file_count) + if not exists(temp_name): + file_name = temp_name + return file_name + if __name__ == "__main__": import doctest doctest.testmod() diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index dba78ffd2..092e3ef10 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -32,7 +32,7 @@ class LinkList(Plugin): links = txt.readlines() for link in links: if link != "\n": - tmpLinks.append(link) + tmpLinks.append(link.replace("\n", "")) txt.close() if not self.parent.core.config['general']['debug_mode']: -- cgit v1.2.3 From 13328322307cde0c9fdd62bfccbcf4a78404164b Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Tue, 15 Dec 2009 23:09:09 +0100 Subject: incomplete: stable gui O.o, folder fix --- module/download_thread.py | 2 +- module/file_list.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index 539f3e62f..be7896b5f 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -127,7 +127,7 @@ class Download_Thread(threading.Thread): status.type = "downloading" - local_file = pyfile.download_folder + "/" + status.filename + local_file = pyfile.folder + "/" + status.filename pyfile.plugin.proceed(status.url, local_file) status.type = "checking" diff --git a/module/file_list.py b/module/file_list.py index 2bfe37298..ea4fd5767 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -203,7 +203,7 @@ class File_List(object): """ pyfile = PyLoadFile(url, collector.file_list) pyfile.id = collector._getFreeID() - pyfile.download_folder = collector.file_list.download_folder + pyfile.folder = collector.file_list.download_folder collector.file_list.lock.acquire() collector.file_list.data["collector"].append(pyfile) collector.file_list.lock.release() @@ -363,19 +363,18 @@ class PyLoadPackage(): self.data = { "id": None, "package_name": "new_package", - "folder": None + "folder": "" } class PyLoadFile(): def __init__(self, url, file_list): self.id = None self.url = url - self.folder = None + self.folder = "" self.file_list = file_list self.core = file_list.core self.package = None self.filename = "n/a" - self.download_folder = "" self.active = False pluginName = self._get_my_plugin() if pluginName: -- cgit v1.2.3 From 3937e57e93be49142b5b6347aa80a390cacd474a Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 15 Dec 2009 23:14:12 +0100 Subject: Fixed web/init, download script --- module/thread_list.py | 2 +- module/web/_init_.py | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 module/web/_init_.py (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index 8c1695f38..c486ad8ee 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -143,7 +143,7 @@ class Thread_List(object): self.list.save() - self.scripts_download_finished(pyfile.modul.__name__, pyfile.url, pyfile.status.filename, pyfile.download_folder) + self.scripts_download_finished(pyfile.modul.__name__, pyfile.url, pyfile.status.filename, pyfile.folder) self.lock.release() return True diff --git a/module/web/_init_.py b/module/web/_init_.py new file mode 100644 index 000000000..e69de29bb -- cgit v1.2.3 From 607171fa1355a6a2e59320665887769fcd741191 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 15 Dec 2009 23:19:06 +0100 Subject: RS fixedhg --- module/plugins/RapidshareCom.py | 104 ++++++++++------------------------------ module/web/__init__.py | 0 module/web/_init_.py | 0 3 files changed, 26 insertions(+), 78 deletions(-) create mode 100644 module/web/__init__.py delete mode 100644 module/web/_init_.py (limited to 'module') diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 778383338..2fd65c706 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -15,7 +15,7 @@ class RapidshareCom(Plugin): props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" - props['version'] = "0.5" + props['version'] = "0.9" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN", "mkaay") props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") @@ -27,7 +27,7 @@ class RapidshareCom(Plugin): self.want_reconnect = False self.no_slots = True self.api_data = None - #~ self.logger = logging.getLogger("log") + self.url = self.parent.url self.read_config() if self.config['premium']: self.multi_dl = True @@ -41,53 +41,34 @@ class RapidshareCom(Plugin): self.want_reconnect = False - tries = 0 - - while not self.start_dl or not pyfile.status.url: - - self.req.clear_cookies() - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - self.download_api_data() - - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: + self.download_api_data() + if self.api_data["status"] == "1": + pyfile.status.exists = self.get_file_name() + if self.config["premium"]: pyfile.status.url = self.parent.url return True + self.download_html() while self.no_slots: self.download_serverhtml() pyfile.status.waituntil = self.time_plus_wait pyfile.status.want_reconnect = self.want_reconnect - thread.wait(pyfile) pyfile.status.url = self.get_file_url() - - if self.no_slots: - raise Exception, "No free slots!" + self.logger.info("Rapidshare: Download starts!") - tries += 1 - if tries > 5: - raise Exception, "Error while preparing, HTML dump:"+ str(self.html[0]) + str(self.html[1]) - - return True + return True + else: + raise Exception, "The file was not found on the server." def download_api_data(self): """ http://images.rapidshare.com/apidoc.txt """ - url = self.parent.url api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" api_param = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} - m = re.compile(self.props['pattern']).search(url) + m = re.compile(self.props['pattern']).search(self.url) if m: api_param["files"] = m.group(1) api_param["filenames"] = m.group(2) @@ -119,8 +100,7 @@ class RapidshareCom(Plugin): def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) + self.html[0] = self.req.load(self.url, cookies=True) self.html_old = time() def download_serverhtml(self): @@ -130,9 +110,7 @@ class RapidshareCom(Plugin): self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) self.html_old = time() - self.get_wait_time() - def get_wait_time(self): if re.search(r"is already downloading", self.html[1]) != None: self.time_plus_wait = time() + 10 * 60 self.no_slots = False @@ -150,56 +128,26 @@ class RapidshareCom(Plugin): wait_seconds = re.search(r"var c=(.*);.*", self.html[1]).group(1) self.time_plus_wait = time() + int(wait_seconds) + 5 - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search("The file could not be found|This limit is reached| \ - is momentarily not available|removed this file| \ - contain illegal content", self.html[0], re.I) != None: - return False - else: - return True - def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.config['premium']: - self.start_dl = True - if self.api_data and self.api_data["mirror"]: - return self.api_data["mirror"] - return self.parent.url - - #if (self.html_old + 5 * 60) < time(): # nach einiger zeit ist die file_url nicht mehr aktuell - # self.download_serverhtml() - - try: - if self.no_slots: - self.start_dl = False - return False - if self.config['server'] == "": - file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" - else: - file_url_pattern = '(http://rs.*)\';" /> %s<br />' % self.config['server'] + if self.config['server'] == "": + file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" + else: + file_url_pattern = '(http://rs.*)\';" /> %s<br />' % self.config['server'] - self.start_dl = True - return re.search(file_url_pattern, self.html[1]).group(1) - except Exception, e: - self.start_dl = False - return False - #print self.html[1] #test print - #raise Exception, "Error when retrieving download url" + return re.search(file_url_pattern, self.html[1]).group(1) def get_file_name(self): - if self.html[0] == None: - self.download_html() - if self.api_data == None: - self.download_api_data() if self.api_data and self.api_data["filename"]: return self.api_data["filename"] - file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" - return re.findall(file_name_pattern, self.html[0])[0] + elif self.html: + file_name_pattern = "<p class=\"downloadlink\">.+/(.+) <font" + file_name_search = re.search(file_name_pattern, self.html): + if file_name_search: + return file_name_search.group(1) + else: + return self.url.split("/")[-1] def proceed(self, url, location): if self.config['premium']: @@ -218,4 +166,4 @@ class RapidshareCom(Plugin): else: return (False, 1) else: - return (True, 5) + return (True, 5) diff --git a/module/web/__init__.py b/module/web/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/web/_init_.py b/module/web/_init_.py deleted file mode 100644 index e69de29bb..000000000 -- cgit v1.2.3 From de5a37e0ffc97bc5893077f935429ba32a9b8f6c Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 15 Dec 2009 23:37:20 +0100 Subject: Incomplete: Rapidshare Folder --- module/Plugin.py | 4 ++-- module/download_thread.py | 10 ++++------ module/plugins/RapidshareCom.py | 9 ++++----- 3 files changed, 10 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index f343dc62f..14a480e3b 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -99,8 +99,8 @@ class Plugin(): self.download_html() return self.time_plus_wait - def proceed(self, url, location, folder=""): - self.req.download(url, location, folder) + def proceed(self, url, location): + self.req.download(url, location) def set_config(self): pass diff --git a/module/download_thread.py b/module/download_thread.py index be7896b5f..3ec49218d 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -19,6 +19,7 @@ ### import threading import traceback +from os.path import join from time import sleep, time from module.network.Request import AbortDownload @@ -122,17 +123,14 @@ class Download_Thread(threading.Thread): pyfile.plugin.prepare(self) pyfile.plugin.req.set_timeout(self.parent.parent.config['general']['max_download_time']) - if status.url == "": - status.url = pyfile.plugin.get_file_url() - status.type = "downloading" - local_file = pyfile.folder + "/" + status.filename - pyfile.plugin.proceed(status.url, local_file) + location = join(pyfile.folder, status.filename) + pyfile.plugin.proceed(status.url, location) status.type = "checking" - check, code = pyfile.plugin.check_file(local_file) + check, code = pyfile.plugin.check_file(location) """ return codes: 0 - checksum ok diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 2fd65c706..714bbf825 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -141,13 +141,12 @@ class RapidshareCom(Plugin): def get_file_name(self): if self.api_data and self.api_data["filename"]: return self.api_data["filename"] - elif self.html: - file_name_pattern = "<p class=\"downloadlink\">.+/(.+) <font" - file_name_search = re.search(file_name_pattern, self.html): + elif self.html[0]: + file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" + file_name_search = re.search(file_name_pattern, self.html[0]) if file_name_search: return file_name_search.group(1) - else: - return self.url.split("/")[-1] + return self.url.split("/")[-1] def proceed(self, url, location): if self.config['premium']: -- cgit v1.2.3 From eaacfaf05e5209e07a8dd73e750f0adbabf20def Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 16 Dec 2009 11:24:25 +0100 Subject: Fixed Rapidshare.com --- module/network/Request.py | 1 - module/plugins/RapidshareCom.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index f9a5cce0f..c6127c20b 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -152,7 +152,6 @@ class Request: return self.get_rep() - else: req = urllib2.Request(url, data=post) diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 714bbf825..c80e95864 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -43,7 +43,7 @@ class RapidshareCom(Plugin): self.download_api_data() if self.api_data["status"] == "1": - pyfile.status.exists = self.get_file_name() + pyfile.status.filename = self.get_file_name() if self.config["premium"]: pyfile.status.url = self.parent.url return True -- cgit v1.2.3 From 2601f37ad2435b0255f17c0d8f6fb5fc53f4a410 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 16 Dec 2009 14:31:58 +0100 Subject: better Rapidshare Premium, fixed #44 --- module/plugins/RapidshareCom.py | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index c80e95864..3e3934888 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -15,7 +15,7 @@ class RapidshareCom(Plugin): props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" - props['version'] = "0.9" + props['version'] = "0.9.9" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN", "mkaay") props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") @@ -30,6 +30,7 @@ class RapidshareCom(Plugin): self.url = self.parent.url self.read_config() if self.config['premium']: + self.multi_dl = True else: self.multi_dl = False @@ -43,8 +44,10 @@ class RapidshareCom(Plugin): self.download_api_data() if self.api_data["status"] == "1": + pyfile.status.filename = self.get_file_name() if self.config["premium"]: + self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) pyfile.status.url = self.parent.url return True @@ -56,7 +59,6 @@ class RapidshareCom(Plugin): thread.wait(pyfile) pyfile.status.url = self.get_file_url() - self.logger.info("Rapidshare: Download starts!") return True else: @@ -67,12 +69,12 @@ class RapidshareCom(Plugin): http://images.rapidshare.com/apidoc.txt """ api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" - api_param = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} + api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} m = re.compile(self.props['pattern']).search(self.url) if m: - api_param["files"] = m.group(1) - api_param["filenames"] = m.group(2) - src = self.req.load(api_url_base, cookies=False, get=api_param) + api_param_file["files"] = m.group(1) + api_param_file["filenames"] = m.group(2) + src = self.req.load(api_url_base, cookies=False, get=api_param_file) if src.startswith("ERROR"): return fields = src.split(",") @@ -97,6 +99,22 @@ class RapidshareCom(Plugin): self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data + if self.config["premium"]: + api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", \ + "login": self.config['username'], "password": self.config['password']} + src = self.req.load(api_url_base, cookies=False, get=api_param_prem) + if src.startswith("ERROR"): + self.config["premium"] = False + self.logger.info("Rapidshare: Login faild") + return + fields = src.split("\n") + premkbleft = int(fields[19].split("=")[1]) + if premkbleft < int(self.api_data["size"][0:-3]): + self.logger.info("Rapidshare: Not enough traffic left") + self.config["premium"] = False + + self.props["premkbleft"] = premkbleft + def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ -- cgit v1.2.3 From eb1de8d5c9a5beaa58347d839e4666bdcea57c1e Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 16 Dec 2009 14:51:31 +0100 Subject: Fixed Rapidshare Traffic Share Bug --- module/plugins/RapidshareCom.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 3e3934888..ee1d84a75 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -30,7 +30,6 @@ class RapidshareCom(Plugin): self.url = self.parent.url self.read_config() if self.config['premium']: - self.multi_dl = True else: self.multi_dl = False @@ -44,7 +43,6 @@ class RapidshareCom(Plugin): self.download_api_data() if self.api_data["status"] == "1": - pyfile.status.filename = self.get_file_name() if self.config["premium"]: self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) @@ -60,6 +58,11 @@ class RapidshareCom(Plugin): pyfile.status.url = self.get_file_url() + return True + elif self.api_data["status"] == "2": + self.logger.info("Rapidshare: Traffic Share (direct download)") + pyfile.status.filename = self.get_file_name() + pyfile.status.url = self.parent.url return True else: raise Exception, "The file was not found on the server." -- cgit v1.2.3 From 851559594effc57c9cfd4194703f1783fd3fed82 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 16 Dec 2009 16:14:34 +0100 Subject: Checksum fixed --- module/download_thread.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index 3ec49218d..89a10533a 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -148,7 +148,7 @@ class Download_Thread(threading.Thread): elif code == 10: self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) if not check: - raise Checksum(code, local_file) + raise Checksum(code, location) #print "checksum check returned: %s, %s" % (check, code) status.type = "finished" -- cgit v1.2.3 From fe85f003f3adfb568c8b1a650035128c183a739d Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 16 Dec 2009 17:09:14 +0100 Subject: some Webinterface Json Code --- module/web/ajax/urls.py | 19 ++++++++ module/web/ajax/views.py | 69 ++++++++++++++++++++++++++++ module/web/pyload.db | Bin 32768 -> 34816 bytes module/web/pyload/admin.py | 14 ++++++ module/web/pyload/models.py | 26 ++++------- module/web/pyload/urls.py | 22 +++++++-- module/web/pyload/views.py | 4 +- module/web/settings.py | 5 +- module/web/templates/default/base.html | 9 ++-- module/web/templates/default/downloads.html | 8 ++-- module/web/templates/default/logs.html | 8 ++-- module/web/templates/default/queue.html | 8 ++-- module/web/urls.py | 13 ++---- 13 files changed, 155 insertions(+), 50 deletions(-) (limited to 'module') diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index e69de29bb..0db240578 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from django.conf.urls.defaults import * +from django.conf import settings + + +urlpatterns = patterns('ajax', + # Example: + # (r'^pyload/', include('pyload.foo.urls')), + + # Uncomment the admin/doc line below and add 'django.contrib.admindocs' + # to INSTALLED_APPS to enable admin documentation: + # (r'^admin/doc/', include('django.contrib.admindocs.urls')), + + # Uncomment the next line to enable the admin: + (r'^add_package$', 'views.add_package'), + (r'^status$', 'views.status'), + (r'^links$', 'views.links'), + (r'^queue$', 'views.queue'), + ) \ No newline at end of file diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 60f00ef0e..d883376e7 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -1 +1,70 @@ # Create your views here. +from django.http import HttpResponse +from django.http import HttpResponseForbidden +from django.http import HttpResponseServerError +from django.conf import settings +from django.shortcuts import render_to_response +from django.utils import simplejson +from django.core.serializers import json + +def check_server(function): + def _dec(view_func): + def _view(request, *args, **kwargs): + try: + version = settings.PYLOAD.get_server_version() + return view_func(request, *args, **kwargs) + except Exception, e: + return HttpResponseServerError() + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + if function is None: + return _dec + else: + return _dec(function) + +def permission(perm): + def _dec(view_func): + def _view(request, *args, **kwargs): + if request.user.has_perm(perm) and request.user.is_authenticated: + return view_func(request, *args, **kwargs) + else: + return HttpResponseForbidden() + + _view.__name__ = view_func.__name__ + _view.__dict__ = view_func.__dict__ + _view.__doc__ = view_func.__doc__ + + return _view + + return _dec + +class JsonResponse(HttpResponse): + def __init__(self, object): + content = simplejson.dumps( + object, indent=2, cls=json.DjangoJSONEncoder, + ensure_ascii=False) + super(JsonResponse, self).__init__( + content)#, content_type='application/json') + self['Cache-Control'] = 'no-cache, must-revalidate' + + + +def add_package(request): + a = {'b' : [1,2,3], 'dsfsd' : "sadd"} + return JsonResponse(a) + +# @TODO: Auth + Auth + +def status(request): + return JsonResponse(settings.PYLOAD.status_server()) + +def links(request): + return JsonResponse(settings.PYLOAD.status_downloads()) + +def queue(request): + return JsonResponse(settings.PYLOAD.get_queue()) \ No newline at end of file diff --git a/module/web/pyload.db b/module/web/pyload.db index 8d34ef89c..45f55284e 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/pyload/admin.py b/module/web/pyload/admin.py index 40a96afc6..11f325200 100644 --- a/module/web/pyload/admin.py +++ b/module/web/pyload/admin.py @@ -1 +1,15 @@ # -*- coding: utf-8 -*- +from django.contrib import admin +from models import UserProfile +from django.contrib.auth.models import User +from django.contrib.auth.admin import UserAdmin as RealUserAdmin + + +class UserProfileInline(admin.StackedInline): + model = UserProfile + +class UserAdmin(RealUserAdmin): + inlines = [ UserProfileInline ] + +admin.site.unregister(User) +admin.site.register(User, UserAdmin) \ No newline at end of file diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py index 293c01109..d3d99febc 100644 --- a/module/web/pyload/models.py +++ b/module/web/pyload/models.py @@ -1,21 +1,15 @@ # -*- coding: utf-8 -*- from django.db import models -#from django.contrib.auth.models.User import User as UserProfile +from django.contrib.auth.models import User # Create your models here. - -class Perm(models.Model): - """ extended pyLoad user Profile """ - - #user = models.ForeignKey(UserProfile, unique=True) - #template = models.CharField(maxlength=30) +class UserProfile(models.Model): + """ Permissions setting """ - class Meta: - permissions = ( - ("can_see_dl", "Can see Downloads"), - ("can_add", "Can add Downloads"), - ("can_delete", "Can delete Downloads"), - ("can_download", "Can download Files"), - ("can_see_logs", "Can see logs"), - ("can_change_status", "Can change status"), - ) \ No newline at end of file + user = models.ForeignKey(User, unique=True) + template = models.CharField(max_length=30, default='default', null=False, blank=False) + +def user_post_save(sender, instance, **kwargs): + profile, new = UserProfile.objects.get_or_create(user=instance) + +models.signals.post_save.connect(user_post_save, User) \ No newline at end of file diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py index 9c7942492..667a4ed3d 100644 --- a/module/web/pyload/urls.py +++ b/module/web/pyload/urls.py @@ -1,7 +1,19 @@ + +from os.path import join + +from django.conf import settings from django.conf.urls.defaults import * -urlpatterns = patterns('', - (r'^login/$', 'pyload.views.login'), - (r'^home/$', 'pyload.views.home'), - (r'^test/$', 'pyload.views.home'), -) + +urlpatterns = patterns('pyload', + (r'^home/$', 'views.home'), + (r'^downloads/$', 'views.downloads',{},'downloads'), + (r'^queue/$', 'views.queue',{}, 'queue'), + (r'^logs/$', 'views.logs',{}, 'logs'), + (r'^$', 'views.home',{}, 'home'), + ) + +urlpatterns += patterns('django.contrib.auth', + (r'^login/$', 'views.login', {'template_name': join(settings.TEMPLATE, 'login.html')}), + (r'^logout/$', 'views.logout', {'template_name': join(settings.TEMPLATE, 'logout.html')}, 'logout'), +) \ No newline at end of file diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index c42511ede..6c2954555 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,7 +1,6 @@ # Create your views here. from django.http import HttpResponse from django.http import HttpResponseRedirect -from django.http import HttpResponseGone from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext @@ -14,9 +13,9 @@ def check_server(function): def _view(request, *args, **kwargs): try: version = settings.PYLOAD.get_server_version() - return view_func(request, *args, **kwargs) except Exception, e: return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) + return view_func(request, *args, **kwargs) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ @@ -54,6 +53,7 @@ def base(request, messages): #@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( @check_server def home(request): + print request.user.get_all_permissions() return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) diff --git a/module/web/settings.py b/module/web/settings.py index 0dc86d699..00395b328 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -97,7 +97,10 @@ TEMPLATE_LOADERS = ( # 'django.template.loaders.eggs.load_template_source', ) + MIDDLEWARE_CLASSES = ( + 'django.middleware.gzip.GZipMiddleware', + 'django.middleware.http.ConditionalGetMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -123,5 +126,5 @@ INSTALLED_APPS = ( ) -AUTH_PROFILE_MODULE = 'pyload.User' +AUTH_PROFILE_MODULE = 'pyload.UserProfile' LOGIN_URL = '/login' \ No newline at end of file diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 096692a3c..27aa72b9f 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -6,6 +6,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> +<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon"> {% block head %} {% endblock %} <title>{% block title %}pyLoad Webinterface{% endblock %}</title> @@ -40,14 +41,14 @@ {% block menu %} <li class="selected"> - <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li> <li> - <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> <li> - <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right"> - <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> {% endblock %} diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html index 3c9bb5df4..202965b3c 100644 --- a/module/web/templates/default/downloads.html +++ b/module/web/templates/default/downloads.html @@ -4,13 +4,13 @@ {% block menu %} <li> - <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li> <li> - <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> <li class="selected"> - <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right"> - <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html index d6f392f58..39f4b8660 100644 --- a/module/web/templates/default/logs.html +++ b/module/web/templates/default/logs.html @@ -4,13 +4,13 @@ {% block menu %} <li> - <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li> <li> - <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> <li> - <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right" class="selected"> - <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index b6a185b19..8c582c5d0 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -4,13 +4,13 @@ {% block menu %} <li> - <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li> <li class="selected"> - <a href="/queue" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> <li> - <a href="/downloads" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right"> - <a href="/logs" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> {% endblock %} \ No newline at end of file diff --git a/module/web/urls.py b/module/web/urls.py index 3e573aa95..4f47fc281 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -9,22 +9,15 @@ admin.autodiscover() urlpatterns = patterns('', # Example: - # (r'^pyload/', include('pyload.foo.urls')), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - # Uncomment the next line to enable the admin: (r'^admin/', include(admin.site.urls)), - #(r'^json/', include(ajax.urls)), + (r'^json/', include('ajax.urls')), + (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT}), - (r'^login/$', 'django.contrib.auth.views.login', {'template_name': join(settings.TEMPLATE,'login.html')}), - (r'^logout/$', 'django.contrib.auth.views.logout', {'template_name': join(settings.TEMPLATE,'logout.html')}), - (r'^home/$', 'pyload.views.home'), - (r'^downloads/$', 'pyload.views.downloads'), - (r'^queue/$', 'pyload.views.queue'), - (r'^logs/$', 'pyload.views.logs'), - (r'^$', 'pyload.views.home'), + (r'^', include('pyload.urls')), ) -- cgit v1.2.3 From f89a0fcfbcca01067175ba7a67c14eb95bd60d6f Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 16 Dec 2009 17:13:46 +0100 Subject: gui server status --- module/file_list.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index ea4fd5767..ae168900b 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -132,6 +132,9 @@ class File_List(object): files.append(pyfile) return files + def countDownloads(self): + return len(self.getDownloadList()) + def getFileInfo(self, id): try: n, pyfile = self.collector._getFileFromID(id) @@ -147,6 +150,7 @@ class File_List(object): info["status_filename"] = pyfile.status.filename info["status_error"] = pyfile.status.error info["active"] = pyfile.active + info["plugin"] = pyfile.plugin.props['name'] return info class pyLoadCollector(): -- cgit v1.2.3 From ce746b8d0ee022b8926538ceed6ec19d4e3ee8e8 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 16 Dec 2009 22:03:32 +0100 Subject: add some class's --- module/web/media/css/default.css | 1593 +++++++++++++++++++++++++++++--- module/web/templates/default/base.html | 211 +++-- module/web/urls.py | 2 +- 3 files changed, 1560 insertions(+), 246 deletions(-) (limited to 'module') diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css index b5701cf43..40832efe0 100644 --- a/module/web/media/css/default.css +++ b/module/web/media/css/default.css @@ -1,145 +1,1448 @@ -div.no{display:inline;margin:0;padding:0;}.hidden{display:none;} -div.error{background:#fcc url(media/img/error.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #faa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.info{background:#ccf url(static/default/info.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #aaf;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.success{background:#cfc url(static/default/success.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #afa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -div.notify{background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat;color:#000;border-bottom:1px solid #ffa;font-size:90%;margin:0;padding-left:3em;overflow:hidden;} -.medialeft{float:left;}.mediaright{float:right;} -.mediacenter{display:block;margin-left:auto;margin-right:auto;} -.leftalign{text-align:left;} -.centeralign{text-align:center;} -.rightalign{text-align:right;} -em.u{font-style:normal;text-decoration:underline;} -em em.u{font-style:italic;} -.code .br0{color:#6c6;} -.code .co1{color:#808080;font-style:italic;} -.code .co2{color:#808080;font-style:italic;} -.code .co3{color:#808080;} -.code .coMULTI{color:#808080;font-style:italic;} -.code .es0{color:#009;font-weight:bold;}.code .kw1{color:#b1b100;} -.code .kw2{color:#000;font-weight:bold;}.code .kw3{color:#006;} -.code .kw4{color:#933;}.code .kw5{color:#00f;}.code .me1{color:#060;}.code .me2{color:#060;} -.code .nu0{color:#c6c;}.code .re0{color:#00f;}.code .re1{color:#00f;}.code .re2{color:#00f;}.code .re3{color:#f33;font-weight:bold;}.code .re4{color:#099;}.code .st0{color:#f00;}.code .sy0{color:#6c6;} -div.dokuwiki table.pagelist,div.dokuwiki table.ul{border:0;padding:0;border-spacing:0;margin-bottom:1em;border-collapse:collapse;} -div.dokuwiki table.pagelist tr{border-top:1px solid #8cacbb;border-bottom:1px solid #8cacbb;} -div.dokuwiki table.pagelist th,div.dokuwiki table.pagelist td{padding:1px 1em 1px 0;} -div.dokuwiki table.ul th,div.dokuwiki table.ul td{padding:0 1em 0 0;} -div.dokuwiki table.ul ul{margin:0 0 0 1.5em;} -div.dokuwiki table.pagelist th,div.dokuwiki table.ul th{background-color:#dee7ec;} -div.dokuwiki th.page,div.dokuwiki th.date,div.dokuwiki th.user,div.dokuwiki th.desc,div.dokuwiki th.comments,div.dokuwiki th.linkbacks,div.dokuwiki th.tags,div.dokuwiki td.date,div.dokuwiki td.user,div.dokuwiki td.desc,div.dokuwiki td.comments,div.dokuwiki td.linkbacks,div.dokuwiki td.tags{color:#666;font-size:80%;} -div.dokuwiki td.date{text-align:right;}div.dokuwiki div.include div.secedit{float:right;margin-left:1em;margin-top:-18px;} -div.dokuwiki div.inclmeta{border-top:1px dotted #8cacbb;padding-top:0.2em;color:#666;font-size:80%;line-height:1.25;margin-top:0.5em;margin-bottom:2em;} -div.dokuwiki div.inclmeta a.permalink{background:transparent url(media/img/link.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta abbr.published{background:transparent url(media/img/date.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;border-bottom:0;} -div.dokuwiki div.inclmeta span.author{background:transparent url(media/img/user.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta span.comment{background:transparent url(media/img/comment.gif) 0px 1px no-repeat;padding:1px 0px 1px 16px;} -div.dokuwiki div.inclmeta div.tags{border-top:0;font-size:100%;float:right;clear:none;}#plugin__manager{}#plugin__manager h2{margin-left:0;} -#plugin__manager form{display:block;margin:0;padding:0;} -#plugin__manager legend{display:none;} -#plugin__manager fieldset{width:auto;} -#plugin__manager .button{margin:0;} -#plugin__manager p,#plugin__manager label{text-align:left;} -#plugin__manager .hidden{display:none;}#plugin__manager .new{background:#dee7ec;} -#plugin__manager input[disabled]{color:#ccc;border-color:#ccc;} -#plugin__manager .pm_menu,#plugin__manager .pm_info{margin-left:0;text-align:left;} -#plugin__manager .pm_menu{float:left;width:48%;} -#plugin__manager .pm_info{float:right;width:50%;} -#plugin__manager .common{}#plugin__manager .common form{} -#plugin__manager .common fieldset{margin:0;padding:0 0 1.0em 0;text-align:left;border:none;} -#plugin__manager .common label{padding:0 0 0.5em 0;} -#plugin__manager .common input{} -#plugin__manager .common input.edit{width:24em;margin:0.5em;} -#plugin__manager .common .button{} -#plugin__manager form.plugins{} -#plugin__manager .plugins fieldset{color:#000;background:#fff;text-align:right;border-top:none;border-right:none;border-left:none;} -#plugin__manager .plugins fieldset.protected{background:#fdd;color:#000;} -#plugin__manager .plugins fieldset.disabled{background:#e0e0e0;color:#a8a8a8;} -#plugin__manager .plugins .legend{color:#000;background:inherit;display:block;margin:0;padding:0;font-size:1em;line-height:1.4em;font-weight:normal;text-align:left;float:left;padding:0;clear:none;} -#plugin__manager .plugins .button{font-size:95%;}#plugin__manager .plugins fieldset.buttons{border:none;} -#plugin__manager .plugins fieldset.buttons .button{float:left;} -#plugin__manager .pm_info h3{margin-left:0;}#plugin__manager .pm_info dl{margin:1em 0;padding:0;} -#plugin__manager .pm_info dt{width:6em;float:left;clear:left;margin:0;padding:0;} -#plugin__manager .pm_info dd{margin:0 0 0 7em;padding:0;background:none;} -#plugin__manager .plugins .enable{float:left;width:auto;margin-right:0.5em;} -#config__manager div.success,#config__manager div.error,#config__manager div.info{background-position:0.5em;padding:0.5em;text-align:center;} -#config__manager fieldset{margin:1em;width:auto;margin-bottom:2em;background-color:#dee7ec;color:#000;padding:0 1em;} -#config__manager legend{font-size:1.25em;} -#config__manager form{}#config__manager table{margin:1em 0;width:100%;}#config__manager fieldset td{text-align:left;} -#config__manager fieldset td.value{width:31em;}#config__manager td.label{padding:0.8em 0 0.6em 1em;vertical-align:top; -}#config__manager td.label label{clear:left;display:block;} -#config__manager td.label img{padding:0 10px;vertical-align:middle;float:right;} -#config__manager td.label span.outkey{font-size:70%;margin-top:-1.7em;margin-left:-1em;display:block;background-color:#fff;color:#666;float:left;padding:0 0.1em;position:relative;z-index:1;} -#config__manager td input.edit{width:30em;}#config__manager td .input{width:30.8em;} -#config__manager td select.edit{}#config__manager td textarea.edit{width:27.5em;height:4em;} -#config__manager tr .input,#config__manager tr input,#config__manager tr textarea,#config__manager tr select{background-color:#fff;color:#000;} -#config__manager tr.default .input,#config__manager tr.default input,#config__manager tr.default textarea,#config__manager tr.default select,#config__manager .selectiondefault{background-color:#cdf;color:#000;} -#config__manager tr.protected .input,#config__manager tr.protected input,#config__manager tr.protected textarea,#config__manager tr.protected select,#config__manager tr.protected .selection{background-color:#fcc!important;color:#000 !important;} -#config__manager td.error{background-color:red;color:#000;}#config__manager .selection{width:14.8em;float:left;margin:0 0.3em 2px 0;}#config__manager .selection label{float:right;width:14em;font-size:90%;} -* html #config__manager .selection label{padding-top:2px;} -#config__manager .selection input.checkbox{padding-left:0.7em;} -#config__manager .other{clear:both;padding-top:0.5em;} -#config__manager .other label{padding-left:2px;font-size:90%;}.dokuwiki div.plugin_translation{float:right;font-size:95%;} -.dokuwiki div.plugin_translation ul{display:inline;padding:0;margin:0;} -.dokuwiki div.plugin_translation ul li{float:left;list-style-type:none;padding:0;margin:0;} -.dokuwiki div.plugin_translation ul li a.wikilink1:link,.dokuwiki div.plugin_translation ul li a.wikilink1:hover,.dokuwiki div.plugin_translation ul li a.wikilink1:active,.dokuwiki div.plugin_translation ul li a.wikilink1:visited{background-color:#000080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} -.dokuwiki div.plugin_translation ul li a.wikilink2:link,.dokuwiki div.plugin_translation ul li a.wikilink2:hover,.dokuwiki div.plugin_translation ul li a.wikilink2:active,.dokuwiki div.plugin_translation ul li a.wikilink2:visited{background-color:#808080;color:#fff !important;text-decoration:none;padding:0 0.2em;margin:0.1em 0.2em;border:none !important;} -.dokuwiki div.plugin_translation ul li a img{opacity:0.5;border:0;} -.dokuwiki div.plugin_translation ul li a.wikilink2 img{}.dokuwiki div.plugin_translation span.curid a img{opacity:1.0;height:15px;} -.dokuwiki div.plugin_translation ul li a:hover img{opacity:1.0;height:15px;}#user__manager tr.disabled{color:#6f6f6f;background:#e4e4e4;} -#user__manager tr.user_info{vertical-align:top;} -#user__manager div.edit_user{width:46%;float:left;}#user__manager table{margin-bottom:1em;}#user__manager input.button[disabled]{color:#ccc!important;border-color:#ccc!important;}div.dokuwiki div.newentry_form{clear:both;text-align:center;margin-bottom:1em;} -div.dokuwiki #blog__newentry_form input.edit{width:95%;}div.dokuwiki tr.draft,div.dokuwiki div.draft{opacity:0.5;} -div.dokuwiki div.autoarchive_selector ul{list-style-type:none;clear:left;margin:0 0.5em 0 0;} -div.dokuwiki div.autoarchive_selector ul div.li{float:left;margin:0 1em 0 0;} -div.dokuwiki div.autoarchive_selector ul ul{float:left;clear:none;}div.dokuwiki div.autoarchive_selector ul ul div.li{margin:0;}div#acl_manager div#acl__tree{font-size:90%;width:25%;height:300px;float:left;overflow:auto;border:1px solid #8cacbb;text-align:left;} -div#acl_manager div#acl__tree a.cur{background-color:#ff9;font-weight:bold;} -div#acl_manager div#acl__tree ul{list-style-type:none;margin:0;padding:0;}div#acl_manager div#acl__tree li{padding-left:1em;}div#acl_manager div#acl__tree ul img{margin-right:0.25em;cursor:pointer;} -div#acl_manager div#acl__detail{width:73%;height:300px;float:right;overflow:auto;} -div#acl_manager div#acl__detail fieldset{width:90%;} -div#acl_manager div#acl__detail div#acl__user{border:1px solid #8cacbb;padding:0.5em;margin-bottom:0.6em;} -div#acl_manager table.inline{width:100%;margin:0;} -div#acl_manager .aclgroup{background:transparent url(media/img/group.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .acluser{background:transparent url(media/img/user.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .aclpage{background:transparent url(media/img/page.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager .aclns{background:transparent url(media/img/ns.png) 0px 1px no-repeat;padding:1px 0px 1px 18px;} -div#acl_manager label.disabled{color:#666!important;} -#acl_manager label{text-align:left;font-weight:normal;display:inline;} -#acl_manager table{margin-left:10%;width:80%;}#acl_manager table tr{background-color:inherit;} -#acl_manager table tr:hover{background-color:#dee7ec;} - - -a.interwiki{background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat;padding-left:16px;} -a.iw_wp{background-image:url(/media/img/wp.gif)} -a.iw_wpde{background-image:url(/media/img/wpde.gif)} -a.iw_wpmeta{background-image:url(/media/img/wpmeta.gif)} -a.iw_doku{background-image:url(/media/img/doku.gif)} -a.iw_dokubug{background-image:url(/media/img/dokubug.gif)} -a.iw_amazon{background-image:url(/media/img/amazon.gif)} -a.iw_amazon_de{background-image:url(/media/img/amazon.de.gif)} -a.iw_amazon_uk{background-image:url(/media/img/amazon.uk.gif)} -a.iw_phpfn{background-image:url(/media/img/phpfn.gif)} -a.iw_coral{background-image:url(/media/img/coral.gif)} -a.iw_sb{background-image:url(/media/img/sb.gif)} -a.iw_google{background-image:url(/media/img/google.gif)} -a.iw_meatball{background-image:url(/media/img/meatball.gif)} -a.iw_wiki{background-image:url(/media/img/wiki.gif)} -a.mediafile{background:transparent url(/media/img/file.png) 0px 1px no-repeat;padding-left:18px;padding-bottom:1px;}a.mf_jpg{background-image:url(/media/img/jpg.png)}a.mf_jpeg{background-image:url(/media/img/jpeg.png)}a.mf_gif{background-image:url(/media/img/gif.png)}a.mf_png{background-image:url(/media/img/png.png)}a.mf_tgz{background-image:url(/media/img/tgz.png)}a.mf_tar{background-image:url(/media/img/tar.png)}a.mf_gz{background-image:url(/media/img/gz.png)}a.mf_bz2{background-image:url(/media/img/bz2.png)} -a.mf_zip{background-image:url(/media/img/zip.png)}a.mf_rar{background-image:url(/media/img/rar.png)}a.mf_pdf{background-image:url(/media/img/pdf.png)}a.mf_ps{background-image:url(/media/img/ps.png)}a.mf_doc{background-image:url(/media/img/doc.png)}a.mf_xls{background-image:url(/media/img/xls.png)}a.mf_ppt{background-image:url(/media/img/ppt.png)}a.mf_rtf{background-image:url(/media/img/rtf.png)}a.mf_swf{background-image:url(/media/img/swf.png)}a.mf_rpm{background-image:url(/media/img/rpm.png)}a.mf_deb{background-image:url(/media/img/deb.png)}a.mf_sxw{background-image:url(/media/img/sxw.png)}a.mf_sxc{background-image:url(/media/img/sxc.png)}a.mf_sxi{background-image:url(/media/img/sxi.png)}a.mf_sxd{background-image:url(/media/img/sxd.png)}a.mf_odc{background-image:url(/media/img/odc.png)}a.mf_odf{background-image:url(/media/img/odf.png)}a.mf_odg{background-image:url(/media/img/odg.png)} -a.mf_odi{background-image:url(/media/img/odi.png)}a.mf_odp{background-image:url(/media/img/odp.png)}a.mf_ods{background-image:url(/media/img/ods.png)}a.mf_odt{background-image:url(/media/img/odt.png)}body{margin:0px;padding:0px;background-color:white;color:black;font-size:12px;font-family:Verdana,Helvetica,"Lucida Grande",Lucida,Arial,sans-serif;font-family:sans-serif;font-size:99,96%;font-size-adjust:none;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;}hr{border-width:0px;border-bottom:1px #aaa dotted;}img{border:none;}form{margin:0px;padding:0px;border:none;display:inline;background:transparent;}ul li{margin:5px;}textarea{font-family:monospace;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}a{color:#3465a4;text-decoration:none;}a:hover{text-decoration:underline;} -a.wikilink2{color:#a40000 !important;}.dokuwiki h1 a,.dokuwiki h2 a,.dokuwiki h3 a,.dokuwiki h4 a,.dokuwiki h5 a,.dokuwiki a.nolink{color:#000 !important;text-decoration:none !important;} -option{border:0px none #fff;}strong.highlight{background-color:#fc9;padding:1pt;}#pagebottom{clear:both;}hr{height:1px;color:#c0c0c0;background-color:#c0c0c0;border:none;margin:.2em 0 .2em 0;}pre{padding:0.5em;font-family:courier,monospace;border:1px solid #c0c0c0;background:#F0ECE6;white-space:pre;white-space:pre-wrap;word-wrap:break-word;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;}.invisible{margin:0px;border:0px;padding:0px;height:0px;visibility:hidden;}.left{float:left !important;}.right{float:right !important;}.center{text-align:center;}div#body-wrapper{padding:40px 40px 10px 40px;font-size:127%;} -div#content{margin-top:-20px;padding:0;font-size:14px;color:black;line-height:1.5em;}h1,h2,h3,h4,h5,h6{background:transparent none repeat scroll 0 0;border-bottom:1px solid #aaa;color:black;font-weight:normal;margin:0;padding:0;padding-bottom:0.17em;padding-top:0.5em;}h1{font-size:188%;line-height:1.2em;margin-bottom:0.1em;padding-bottom:0;}h2{font-size:150%;}h3,h4,h5,h6{border-bottom:none;font-weight:bold;}h3{font-size:132%;}h4{font-size:116%;}h5{font-size:100%;}h6{font-size:80%;}ul#page-actions{float:right;margin:10px 10px 0 10px;padding:6px;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:5px;}ul#user-actions{padding:5px;margin:0;display:inline;color:black;background-color:#ececec;list-style-type:none;-moz-border-radius:3px;}ul#page-actions li,ul#user-actions li{display:inline;}ul#page-actions a,ul#user-actions a{text-decoration:none;color:black;display:inline;margin:0 3px;padding:2px 0px 2px 18px;} -ul#page-actions a:hover,ul#page-actions a:focus,ul#user-actions a:hover,ul#user-actions a:focus{text-decoration:underline;}.hidden{display:none;}a.urlextern{color:#36B;background:transparent url(/media/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{background:none;padding:0;}a.action.index{background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat;}a.action.recent{background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat;}a.logout{background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat;} -a.admin{background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat;}a.profile{background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat;}a.create,a.edit{background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat;}a.source,a.show{background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat;}a.revisions{background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat;}a.subscribe,a.unsubscribe{background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat;}a.backlink{background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat;}#head-panel{background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x;}#head-panel h1{display:none;margin:0;text-decoration:none;padding-top:0.8em;padding-left:3.3em;font-size:2.6em;color:#eeeeec;}#head-panel #head-logo{float:left;margin:5px 0 -15px 5px;padding:0;overflow:visible;}#head-menu{background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x;width:100%;float:left;margin:0;padding:0;padding-top:0.8em;} -#head-menu ul{list-style:none;margin:0 1em 0 2em;}#head-menu ul li{float:left;margin:0;margin-left:0.3em;font-size:14px;margin-bottom:4px;}#head-menu ul li.selected,#head-menu ul li:hover{margin-bottom:0px;}#head-menu ul li a img{height:22px;width:22px;vertical-align:middle;}#head-menu ul li a,#head-menu ul li a:link{float:left;text-decoration:none;color:#555;background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x;padding:3px 7px 3px 7px;border:2px solid #ccc;border-bottom:0px solid transparent;padding-bottom:3px;-moz-border-radius:5px;}#head-menu ul li a:hover,#head-menu ul li a:focus{color:#111;padding-bottom:7px;border-bottom:0px none transparent;outline:none;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li a:focus{margin-bottom:-4px;}#head-menu ul li.selected a{color:#3566A5;background:#fff;padding-bottom:7px;border-bottom:0px none transparent;-moz-border-radius-bottomright:0px;-moz-border-radius-bottomleft:0px;}#head-menu ul li.selected a:hover,#head-menu ul li.selected a:focus{color:#111;}div#head-search-and-login{float:right;margin:0 1em 0 0;background-color:#222;padding:4px;color:white;-moz-border-radius-bottomright:6px;-moz-border-radius-bottomleft:6px;}div#head-search-and-login form{display:inline;padding:0 3px;}div#head-search-and-login form input{border:2px solid #888;background:#eee;font-size:14px;padding:2px;-moz-border-radius:3px;}div#head-search-and-login form input:focus{background:#fff;}#head-search{font-size:14px;}#head-username,#head-password{width:80px;font-size:14px;}#pageinfo{clear:both;color:#888;padding:0.6em 0;margin:0;}#foot{font-style:normal;color:#888;text-align:center;}#foot a{color:#aaf;}#foot img{vertical-align:middle;}ul.toc{padding:0;padding-left:20px;margin-left:0;margin-right:10px;list-style:none;}ul.toc li{list-style:circle;}ul.toc li a{text-decoration:none;color:black;}ul.toc li a:hover{text-decoration:underline;}div.toc{border:1px dotted #888;background:#f0f0f0;margin:1em 0 1em 1em;float:right;font-size:95%;}div.toc .tocheader{font-weight:bold;margin:0.5em 1em;}div.toc ol{margin:1em 0.5em 1em 1em;padding:0;}div.toc ol li{margin:0;padding:0;margin-left:1em;}div.toc ol ol{margin:0.5em 0.5em 0.5em 1em;padding:0;}div.recentchanges table{clear:both;}div#editor-help{font-size:90%;border:1px dotted #888;padding:0ex 1ex 1ex 1ex;background:#f7f6f2;}div#preview{margin-top:1em;}label.block{display:block;text-align:right;font-weight:bold;}label.simple{display:block;text-align:left;font-weight:normal;}label.block input.edit{width:50%;}fieldset{width:300px;text-align:center;padding:0.5em;margin:auto;}div.editor{margin:0 0 0 0;}table{margin:0.5em 0;border-collapse:collapse;}td{padding:0.25em;border:1pt solid #ADB9CC;}td p{margin:0;padding:0;}.u{text-decoration:underline;}.footnotes ul{padding:0 2em;margin:0 0 1em;}.footnotes li{list-style:none;}.recentchanges p{margin:0.25em;}.recentchanges td{vertical-align:top;border:none;border-bottom:1pt solid #F0ECE6;background:#F7F6F2;}.rcdaybreak td{background:#729fcf;border:none;}.rcdaybreak td a{font-size:0.88em;}.rcicon1,.rcicon2{text-align:center;}.rcpagelink{width:33%;}.rctime{font-size:0.88em;white-space:nowrap;}.rceditor{white-space:nowrap;font-size:0.88em;}.rccomment{width:66%;color:gray;font-size:0.88em;}.rcrss{float:right;}.recentchanges[dir="rtl"] .rcrss{float:left;}.userpref table,.userpref td{border:none;}div.codearea{margin:0.5em 0;padding:0;border:1pt solid #AEBDCC;background-color:#F3F5F7;color:black;}div.codearea pre{margin:0;padding:10pt;border:none;}a.codenumbers{margin:0 10pt;font-size:0.85em;color:gray;}div.codearea pre span.LineNumber{color:gray;}div.codearea pre span.ID{color:#000;}div.codearea pre span.Operator{color:#0000c0;}div.codearea pre span.Char{color:#004080;}div.codearea pre span.Comment{color:#008000;}div.codearea pre span.Number{color:#0080c0;}div.codearea pre span.String{color:#004080;}div.codearea pre span.SPChar{color:#0000c0;}div.codearea pre span.ResWord{color:#a00000;}div.codearea pre span.ConsWord{color:#008080;font-weight:bold;}div.codearea pre span.Error{color:#ff8080;border:solid 1.5pt #f00;}div.codearea pre span.ResWord2{color:#0080ff;font-weight:bold;}div.codearea pre span.Special{color:#00f;}div.codearea pre span.Preprc{color:#803999;}#message{clear:both;padding:5px 10px;background-color:#eee;border-bottom:2px solid #ccc;}#message p{margin:5px 0;padding:0;font-weight:bold;}#message div.buttons{font-weight:normal;}.diff{width:99%;}.diff-title{background-color:#C0C0C0;}.searchresult dd span{font-weight:bold;}.diff{width:100%;border:none;}.diff-blockheader{font-weight:bold;background:#e5e5e5;font-size:1.2em;border-top:2px solid #444;padding:5px;}.diff th{font-size:120%;width:50%;font-weight:normal;text-align:left;padding-bottom:3px;}.diff td{font-family:monospace;font-size:100%;border:none;}.diff-addedline{background-color:#dfd;}.diff-deletedline{background-color:#ffb;}.diff-context{color:#888;}.diff-addedline{background-color:#E0FFE0;vertical-align:sub;}.diff-deletedline{background-color:#FFFFE0;background-color:#f4cece;vertical-align:sub;} -.diff-addedline strong{background-color:#80FF80;background-color:#8ae234;} -.diff-deletedline strong{background-color:#FFFF80;background-color:#ef2929;background-color:#d78383;} - - - -.box{ background:url(/media/img/progress-bar-back.gif) right center no-repeat; width:200px; height:20px; float:left; } -.perc{ background:url(/media/img/progress-bar.gif) right center no-repeat; height:20px; } -.boxtext{ font-family:tahoma, arial, sans-serif; font-size:11px; color:#000; float:none; padding:3px 0 0 10px; } -.statusbutton{width:32px;height:32px;float:left;margin-left:-32px;margin-right:5px;opacity:0;cursor:pointer} - -.dlsize{float:left; padding-right: 8px;} -.dlspeed{float:left; padding-right: 8px;} \ No newline at end of file +div.no { + display:inline; + margin:0; + padding:0; +} +.hidden { + display:none; +} +div.error { + background:#fcc url(media/img/error.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #faa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.info { + background:#ccf url(static/default/info.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #aaf; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.success { + background:#cfc url(static/default/success.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #afa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.notify { + background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #ffa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +.medialeft { + float:left; +} +.mediaright { + float:right; +} +.mediacenter { + display:block; + margin-left:auto; + margin-right:auto; +} +.leftalign { + text-align:left; +} +.centeralign { + text-align:center; +} +.rightalign { + text-align:right; +} +em.u { + font-style:normal; + text-decoration:underline; +} +em em.u { + font-style:italic; +} +.code .br0 { + color:#6c6; +} +.code .co1 { + color:#808080; + font-style:italic; +} +.code .co2 { + color:#808080; + font-style:italic; +} +.code .co3 { + color:#808080; +} +.code .coMULTI { + color:#808080; + font-style:italic; +} +.code .es0 { + color:#009; + font-weight:bold; +} +.code .kw1 { + color:#b1b100; +} +.code .kw2 { + color:#000; + font-weight:bold; +} +.code .kw3 { + color:#006; +} +.code .kw4 { + color:#933; +} +.code .kw5 { + color:#00f; +} +.code .me1 { + color:#060; +} +.code .me2 { + color:#060; +} +.code .nu0 { + color:#c6c; +} +.code .re0 { + color:#00f; +} +.code .re1 { + color:#00f; +} +.code .re2 { + color:#00f; +} +.code .re3 { + color:#f33; + font-weight:bold; +} +.code .re4 { + color:#099; +} +.code .st0 { + color:#f00; +} +.code .sy0 { + color:#6c6; +} +div.dokuwiki table.pagelist, div.dokuwiki table.ul { + border:0; + padding:0; + border-spacing:0; + margin-bottom:1em; + border-collapse:collapse; +} +div.dokuwiki table.pagelist tr { + border-top:1px solid #8cacbb; + border-bottom:1px solid #8cacbb; +} +div.dokuwiki table.pagelist th, div.dokuwiki table.pagelist td { + padding:1px 1em 1px 0; +} +div.dokuwiki table.ul th, div.dokuwiki table.ul td { + padding:0 1em 0 0; +} +div.dokuwiki table.ul ul { + margin:0 0 0 1.5em; +} +div.dokuwiki table.pagelist th, div.dokuwiki table.ul th { + background-color:#dee7ec; +} +div.dokuwiki th.page, div.dokuwiki th.date, div.dokuwiki th.user, div.dokuwiki th.desc, div.dokuwiki th.comments, div.dokuwiki th.linkbacks, div.dokuwiki th.tags, div.dokuwiki td.date, div.dokuwiki td.user, div.dokuwiki td.desc, div.dokuwiki td.comments, div.dokuwiki td.linkbacks, div.dokuwiki td.tags { + color:#666; + font-size:80%; +} +div.dokuwiki td.date { + text-align:right; +} +div.dokuwiki div.include div.secedit { + float:right; + margin-left:1em; + margin-top:-18px; +} +div.dokuwiki div.inclmeta { + border-top:1px dotted #8cacbb; + padding-top:0.2em; + color:#666; + font-size:80%; + line-height:1.25; + margin-top:0.5em; + margin-bottom:2em; +} +div.dokuwiki div.inclmeta a.permalink { + background:transparent url(media/img/link.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta abbr.published { + background:transparent url(media/img/date.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; + border-bottom:0; +} +div.dokuwiki div.inclmeta span.author { + background:transparent url(media/img/user.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta span.comment { + background:transparent url(media/img/comment.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta div.tags { + border-top:0; + font-size:100%; + float:right; + clear:none; +} +#plugin__manager { +} +#plugin__manager h2 { + margin-left:0; +} +#plugin__manager form { + display:block; + margin:0; + padding:0; +} +#plugin__manager legend { + display:none; +} +#plugin__manager fieldset { + width:auto; +} +#plugin__manager .button { + margin:0; +} +#plugin__manager p, #plugin__manager label { + text-align:left; +} +#plugin__manager .hidden { + display:none; +} +#plugin__manager .new { + background:#dee7ec; +} +#plugin__manager input[disabled] { + color:#ccc; + border-color:#ccc; +} +#plugin__manager .pm_menu, #plugin__manager .pm_info { + margin-left:0; + text-align:left; +} +#plugin__manager .pm_menu { + float:left; + width:48%; +} +#plugin__manager .pm_info { + float:right; + width:50%; +} +#plugin__manager .common { +} +#plugin__manager .common form { +} +#plugin__manager .common fieldset { + margin:0; + padding:0 0 1.0em 0; + text-align:left; + border:none; +} +#plugin__manager .common label { + padding:0 0 0.5em 0; +} +#plugin__manager .common input { +} +#plugin__manager .common input.edit { + width:24em; + margin:0.5em; +} +#plugin__manager .common .button { +} +#plugin__manager form.plugins { +} +#plugin__manager .plugins fieldset { + color:#000; + background:#fff; + text-align:right; + border-top:none; + border-right:none; + border-left:none; +} +#plugin__manager .plugins fieldset.protected { + background:#fdd; + color:#000; +} +#plugin__manager .plugins fieldset.disabled { + background:#e0e0e0; + color:#a8a8a8; +} +#plugin__manager .plugins .legend { + color:#000; + background:inherit; + display:block; + margin:0; + padding:0; + font-size:1em; + line-height:1.4em; + font-weight:normal; + text-align:left; + float:left; + padding:0; + clear:none; +} +#plugin__manager .plugins .button { + font-size:95%; +} +#plugin__manager .plugins fieldset.buttons { + border:none; +} +#plugin__manager .plugins fieldset.buttons .button { + float:left; +} +#plugin__manager .pm_info h3 { + margin-left:0; +} +#plugin__manager .pm_info dl { + margin:1em 0; + padding:0; +} +#plugin__manager .pm_info dt { + width:6em; + float:left; + clear:left; + margin:0; + padding:0; +} +#plugin__manager .pm_info dd { + margin:0 0 0 7em; + padding:0; + background:none; +} +#plugin__manager .plugins .enable { + float:left; + width:auto; + margin-right:0.5em; +} +#config__manager div.success, #config__manager div.error, #config__manager div.info { + background-position:0.5em; + padding:0.5em; + text-align:center; +} +#config__manager fieldset { + margin:1em; + width:auto; + margin-bottom:2em; + background-color:#dee7ec; + color:#000; + padding:0 1em; +} +#config__manager legend { + font-size:1.25em; +} +#config__manager form { +} +#config__manager table { + margin:1em 0; + width:100%; +} +#config__manager fieldset td { + text-align:left; +} +#config__manager fieldset td.value { + width:31em; +} +#config__manager td.label { + padding:0.8em 0 0.6em 1em; + vertical-align:top; +} +#config__manager td.label label { + clear:left; + display:block; +} +#config__manager td.label img { + padding:0 10px; + vertical-align:middle; + float:right; +} +#config__manager td.label span.outkey { + font-size:70%; + margin-top:-1.7em; + margin-left:-1em; + display:block; + background-color:#fff; + color:#666; + float:left; + padding:0 0.1em; + position:relative; + z-index:1; +} +#config__manager td input.edit { + width:30em; +} +#config__manager td .input { + width:30.8em; +} +#config__manager td select.edit { +} +#config__manager td textarea.edit { + width:27.5em; + height:4em; +} +#config__manager tr .input, #config__manager tr input, #config__manager tr textarea, #config__manager tr select { + background-color:#fff; + color:#000; +} +#config__manager tr.default .input, #config__manager tr.default input, #config__manager tr.default textarea, #config__manager tr.default select, #config__manager .selectiondefault { + background-color:#cdf; + color:#000; +} +#config__manager tr.protected .input, #config__manager tr.protected input, #config__manager tr.protected textarea, #config__manager tr.protected select, #config__manager tr.protected .selection { + background-color:#fcc!important; + color:#000 !important; +} +#config__manager td.error { + background-color:red; + color:#000; +} +#config__manager .selection { + width:14.8em; + float:left; + margin:0 0.3em 2px 0; +} +#config__manager .selection label { + float:right; + width:14em; + font-size:90%; +} +* html #config__manager .selection label { + padding-top:2px; +} +#config__manager .selection input.checkbox { + padding-left:0.7em; +} +#config__manager .other { + clear:both; + padding-top:0.5em; +} +#config__manager .other label { + padding-left:2px; + font-size:90%; +} +.dokuwiki div.plugin_translation { + float:right; + font-size:95%; +} +.dokuwiki div.plugin_translation ul { + display:inline; + padding:0; + margin:0; +} +.dokuwiki div.plugin_translation ul li { + float:left; + list-style-type:none; + padding:0; + margin:0; +} +.dokuwiki div.plugin_translation ul li a.wikilink1:link, .dokuwiki div.plugin_translation ul li a.wikilink1:hover, .dokuwiki div.plugin_translation ul li a.wikilink1:active, .dokuwiki div.plugin_translation ul li a.wikilink1:visited { + background-color:#000080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} +.dokuwiki div.plugin_translation ul li a.wikilink2:link, .dokuwiki div.plugin_translation ul li a.wikilink2:hover, .dokuwiki div.plugin_translation ul li a.wikilink2:active, .dokuwiki div.plugin_translation ul li a.wikilink2:visited { + background-color:#808080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} +.dokuwiki div.plugin_translation ul li a img { + opacity:0.5; + border:0; +} +.dokuwiki div.plugin_translation ul li a.wikilink2 img { +} +.dokuwiki div.plugin_translation span.curid a img { + opacity:1.0; + height:15px; +} +.dokuwiki div.plugin_translation ul li a:hover img { + opacity:1.0; + height:15px; +} +#user__manager tr.disabled { + color:#6f6f6f; + background:#e4e4e4; +} +#user__manager tr.user_info { + vertical-align:top; +} +#user__manager div.edit_user { + width:46%; + float:left; +} +#user__manager table { + margin-bottom:1em; +} +#user__manager input.button[disabled] { + color:#ccc!important; + border-color:#ccc!important; +} +div.dokuwiki div.newentry_form { + clear:both; + text-align:center; + margin-bottom:1em; +} +div.dokuwiki #blog__newentry_form input.edit { + width:95%; +} +div.dokuwiki tr.draft, div.dokuwiki div.draft { + opacity:0.5; +} +div.dokuwiki div.autoarchive_selector ul { + list-style-type:none; + clear:left; + margin:0 0.5em 0 0; +} +div.dokuwiki div.autoarchive_selector ul div.li { + float:left; + margin:0 1em 0 0; +} +div.dokuwiki div.autoarchive_selector ul ul { + float:left; + clear:none; +} +div.dokuwiki div.autoarchive_selector ul ul div.li { + margin:0; +} +div#acl_manager div#acl__tree { + font-size:90%; + width:25%; + height:300px; + float:left; + overflow:auto; + border:1px solid #8cacbb; + text-align:left; +} +div#acl_manager div#acl__tree a.cur { + background-color:#ff9; + font-weight:bold; +} +div#acl_manager div#acl__tree ul { + list-style-type:none; + margin:0; + padding:0; +} +div#acl_manager div#acl__tree li { + padding-left:1em; +} +div#acl_manager div#acl__tree ul img { + margin-right:0.25em; + cursor:pointer; +} +div#acl_manager div#acl__detail { + width:73%; + height:300px; + float:right; + overflow:auto; +} +div#acl_manager div#acl__detail fieldset { + width:90%; +} +div#acl_manager div#acl__detail div#acl__user { + border:1px solid #8cacbb; + padding:0.5em; + margin-bottom:0.6em; +} +div#acl_manager table.inline { + width:100%; + margin:0; +} +div#acl_manager .aclgroup { + background:transparent url(media/img/group.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .acluser { + background:transparent url(media/img/user.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .aclpage { + background:transparent url(media/img/page.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .aclns { + background:transparent url(media/img/ns.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager label.disabled { + color:#666!important; +} +#acl_manager label { + text-align:left; + font-weight:normal; + display:inline; +} +#acl_manager table { + margin-left:10%; + width:80%; +} +#acl_manager table tr { + background-color:inherit; +} +#acl_manager table tr:hover { + background-color:#dee7ec; +} +a.interwiki { + background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat; + padding-left:16px; +} +a.iw_wp { + background-image:url(/media/img/wp.gif) +} +a.iw_wpde { + background-image:url(/media/img/wpde.gif) +} +a.iw_wpmeta { + background-image:url(/media/img/wpmeta.gif) +} +a.iw_doku { + background-image:url(/media/img/doku.gif) +} +a.iw_dokubug { + background-image:url(/media/img/dokubug.gif) +} +a.iw_amazon { + background-image:url(/media/img/amazon.gif) +} +a.iw_amazon_de { + background-image:url(/media/img/amazon.de.gif) +} +a.iw_amazon_uk { + background-image:url(/media/img/amazon.uk.gif) +} +a.iw_phpfn { + background-image:url(/media/img/phpfn.gif) +} +a.iw_coral { + background-image:url(/media/img/coral.gif) +} +a.iw_sb { + background-image:url(/media/img/sb.gif) +} +a.iw_google { + background-image:url(/media/img/google.gif) +} +a.iw_meatball { + background-image:url(/media/img/meatball.gif) +} +a.iw_wiki { + background-image:url(/media/img/wiki.gif) +} +a.mediafile { + background:transparent url(/media/img/file.png) 0px 1px no-repeat; + padding-left:18px; + padding-bottom:1px; +} +a.mf_jpg { + background-image:url(/media/img/jpg.png) +} +a.mf_jpeg { + background-image:url(/media/img/jpeg.png) +} +a.mf_gif { + background-image:url(/media/img/gif.png) +} +a.mf_png { + background-image:url(/media/img/png.png) +} +a.mf_tgz { + background-image:url(/media/img/tgz.png) +} +a.mf_tar { + background-image:url(/media/img/tar.png) +} +a.mf_gz { + background-image:url(/media/img/gz.png) +} +a.mf_bz2 { + background-image:url(/media/img/bz2.png) +} +a.mf_zip { + background-image:url(/media/img/zip.png) +} +a.mf_rar { + background-image:url(/media/img/rar.png) +} +a.mf_pdf { + background-image:url(/media/img/pdf.png) +} +a.mf_ps { + background-image:url(/media/img/ps.png) +} +a.mf_doc { + background-image:url(/media/img/doc.png) +} +a.mf_xls { + background-image:url(/media/img/xls.png) +} +a.mf_ppt { + background-image:url(/media/img/ppt.png) +} +a.mf_rtf { + background-image:url(/media/img/rtf.png) +} +a.mf_swf { + background-image:url(/media/img/swf.png) +} +a.mf_rpm { + background-image:url(/media/img/rpm.png) +} +a.mf_deb { + background-image:url(/media/img/deb.png) +} +a.mf_sxw { + background-image:url(/media/img/sxw.png) +} +a.mf_sxc { + background-image:url(/media/img/sxc.png) +} +a.mf_sxi { + background-image:url(/media/img/sxi.png) +} +a.mf_sxd { + background-image:url(/media/img/sxd.png) +} +a.mf_odc { + background-image:url(/media/img/odc.png) +} +a.mf_odf { + background-image:url(/media/img/odf.png) +} +a.mf_odg { + background-image:url(/media/img/odg.png) +} +a.mf_odi { + background-image:url(/media/img/odi.png) +} +a.mf_odp { + background-image:url(/media/img/odp.png) +} +a.mf_ods { + background-image:url(/media/img/ods.png) +} +a.mf_odt { + background-image:url(/media/img/odt.png) +} +body { + margin:0px; + padding:0px; + background-color:white; + color:black; + font-size:12px; + font-family:Verdana, Helvetica, "Lucida Grande", Lucida, Arial, sans-serif; + font-family:sans-serif; + font-size:99, 96%; + font-size-adjust:none; + font-style:normal; + font-variant:normal; + font-weight:normal; + line-height:normal; +} +hr { + border-width:0px; + border-bottom:1px #aaa dotted; +} +img { + border:none; +} +form { + margin:0px; + padding:0px; + border:none; + display:inline; + background:transparent; +} +ul li { + margin:5px; +} +textarea { + font-family:monospace; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +a { + color:#3465a4; + text-decoration:none; +} +a:hover { + text-decoration:underline; +} +a.wikilink2 { + color:#a40000 !important; +} +.dokuwiki h1 a, .dokuwiki h2 a, .dokuwiki h3 a, .dokuwiki h4 a, .dokuwiki h5 a, .dokuwiki a.nolink { + color:#000 !important; + text-decoration:none !important; +} +option { + border:0px none #fff; +} +strong.highlight { + background-color:#fc9; + padding:1pt; +} +#pagebottom { + clear:both; +} +hr { + height:1px; + color:#c0c0c0; + background-color:#c0c0c0; + border:none; + margin:.2em 0 .2em 0; +} +pre { + padding:0.5em; + font-family:courier, monospace; + border:1px solid #c0c0c0; + background:#F0ECE6; + white-space:pre; + white-space:pre-wrap; + word-wrap:break-word; + white-space:-moz-pre-wrap; + white-space:-pre-wrap; + white-space:-o-pre-wrap; +} +.invisible { + margin:0px; + border:0px; + padding:0px; + height:0px; + visibility:hidden; +} +.left { + float:left !important; +} +.right { + float:right !important; +} +.center { + text-align:center; +} +div#body-wrapper { + padding:40px 40px 10px 40px; + font-size:127%; +} +div#content { + margin-top:-20px; + padding:0; + font-size:14px; + color:black; + line-height:1.5em; +} +h1, h2, h3, h4, h5, h6 { + background:transparent none repeat scroll 0 0; + border-bottom:1px solid #aaa; + color:black; + font-weight:normal; + margin:0; + padding:0; + padding-bottom:0.17em; + padding-top:0.5em; +} +h1 { + font-size:188%; + line-height:1.2em; + margin-bottom:0.1em; + padding-bottom:0; +} +h2 { + font-size:150%; +} +h3, h4, h5, h6 { + border-bottom:none; + font-weight:bold; +} +h3 { + font-size:132%; +} +h4 { + font-size:116%; +} +h5 { + font-size:100%; +} +h6 { + font-size:80%; +} +ul#page-actions { + float:right; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:5px; +} +ul#user-actions { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:3px; +} +ul#page-actions li, ul#user-actions li { + display:inline; +} +ul#page-actions a, ul#user-actions a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { + text-decoration:underline; +} +/***************************/ +ul#page-actions2 { + float:left; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:5px; +} +ul#user-actions2 { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:3px; +} +ul#page-actions2 li, ul#user-actions2 li { + display:inline; +} +ul#page-actions2 a, ul#user-actions2 a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-action2s a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus { + text-decoration:underline; +} +/****************************/ +.hidden { + display:none; +} +a.urlextern { + color:#36B; + background:transparent url(/media/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 { +background:none; +padding:0; +} +a.action.index { + background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat; +} +a.action.recent { + background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat; +} +a.logout { + background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat; +} +a.admin { + background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat; +} +a.profile { + background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat; +} +a.create, a.edit { + background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat; +} +a.source, a.show { + background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat; +} +a.revisions { + background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat; +} +a.subscribe, a.unsubscribe { + background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat; +} +a.backlink { + background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat; +} +a.play { + background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; +} +a.pause { + background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; +} +a.cog { + background:transparent url(/media/img/cog.png) 0px 1px no-repeat; +} +#head-panel { + background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x; +} +#head-panel h1 { + display:none; + margin:0; + text-decoration:none; + padding-top:0.8em; + padding-left:3.3em; + font-size:2.6em; + color:#eeeeec; +} +#head-panel #head-logo { + float:left; + margin:5px 0 -15px 5px; + padding:0; + overflow:visible; +} +#head-menu { + background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x; + width:100%; + float:left; + margin:0; + padding:0; + padding-top:0.8em; +} +#head-menu ul { + list-style:none; + margin:0 1em 0 2em; +} +#head-menu ul li { + float:left; + margin:0; + margin-left:0.3em; + font-size:14px; + margin-bottom:4px; +} +#head-menu ul li.selected, #head-menu ul li:hover { + margin-bottom:0px; +} +#head-menu ul li a img { + height:22px; + width:22px; + vertical-align:middle; +} +#head-menu ul li a, #head-menu ul li a:link { + float:left; + text-decoration:none; + color:#555; + background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x; + padding:3px 7px 3px 7px; + border:2px solid #ccc; + border-bottom:0px solid transparent; + padding-bottom:3px; + -moz-border-radius:5px; +} +#head-menu ul li a:hover, #head-menu ul li a:focus { + color:#111; + padding-bottom:7px; + border-bottom:0px none transparent; + outline:none; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li a:focus { + margin-bottom:-4px; +} +#head-menu ul li.selected a { + color:#3566A5; + background:#fff; + padding-bottom:7px; + border-bottom:0px none transparent; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li.selected a:hover, #head-menu ul li.selected a:focus { + color:#111; +} +div#head-search-and-login { + float:right; + margin:0 1em 0 0; + background-color:#222; + padding:4px; + color:white; + -moz-border-radius-bottomright:6px; + -moz-border-radius-bottomleft:6px; +} +div#head-search-and-login form { + display:inline; + padding:0 3px; +} +div#head-search-and-login form input { + border:2px solid #888; + background:#eee; + font-size:14px; + padding:2px; + -moz-border-radius:3px; +} +div#head-search-and-login form input:focus { + background:#fff; +} +#head-search { + font-size:14px; +} +#head-username, #head-password { + width:80px; + font-size:14px; +} +#pageinfo { + clear:both; + color:#888; + padding:0.6em 0; + margin:0; +} +#foot { + font-style:normal; + color:#888; + text-align:center; +} +#foot a { + color:#aaf; +} +#foot img { + vertical-align:middle; +} +ul.toc { + padding:0; + padding-left:20px; + margin-left:0; + margin-right:10px; + list-style:none; +} +ul.toc li { + list-style:circle; +} +ul.toc li a { + text-decoration:none; + color:black; +} +ul.toc li a:hover { + text-decoration:underline; +} +div.toc { + border:1px dotted #888; + background:#f0f0f0; + margin:1em 0 1em 1em; + float:right; + font-size:95%; +} +div.toc .tocheader { + font-weight:bold; + margin:0.5em 1em; +} +div.toc ol { + margin:1em 0.5em 1em 1em; + padding:0; +} +div.toc ol li { + margin:0; + padding:0; + margin-left:1em; +} +div.toc ol ol { + margin:0.5em 0.5em 0.5em 1em; + padding:0; +} +div.recentchanges table { + clear:both; +} +div#editor-help { + font-size:90%; + border:1px dotted #888; + padding:0ex 1ex 1ex 1ex; + background:#f7f6f2; +} +div#preview { + margin-top:1em; +} +label.block { + display:block; + text-align:right; + font-weight:bold; +} +label.simple { + display:block; + text-align:left; + font-weight:normal; +} +label.block input.edit { + width:50%; +} +fieldset { + width:300px; + text-align:center; + padding:0.5em; + margin:auto; +} +div.editor { + margin:0 0 0 0; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +td p { + margin:0; + padding:0; +} +.u { + text-decoration:underline; +} +.footnotes ul { + padding:0 2em; + margin:0 0 1em; +} +.footnotes li { + list-style:none; +} +.recentchanges p { + margin:0.25em; +} +.recentchanges td { + vertical-align:top; + border:none; + border-bottom:1pt solid #F0ECE6; + background:#F7F6F2; +} +.rcdaybreak td { + background:#729fcf; + border:none; +} +.rcdaybreak td a { + font-size:0.88em; +} +.rcicon1, .rcicon2 { + text-align:center; +} +.rcpagelink { + width:33%; +} +.rctime { + font-size:0.88em; + white-space:nowrap; +} +.rceditor { + white-space:nowrap; + font-size:0.88em; +} +.rccomment { + width:66%; + color:gray; + font-size:0.88em; +} +.rcrss { + float:right; +} +.recentchanges[dir="rtl"] .rcrss { + float:left; +} +.userpref table, .userpref td { + border:none; +} +div.codearea { + margin:0.5em 0; + padding:0; + border:1pt solid #AEBDCC; + background-color:#F3F5F7; + color:black; +} +div.codearea pre { + margin:0; + padding:10pt; + border:none; +} +a.codenumbers { + margin:0 10pt; + font-size:0.85em; + color:gray; +} +div.codearea pre span.LineNumber { + color:gray; +} +div.codearea pre span.ID { + color:#000; +} +div.codearea pre span.Operator { + color:#0000c0; +} +div.codearea pre span.Char { + color:#004080; +} +div.codearea pre span.Comment { + color:#008000; +} +div.codearea pre span.Number { + color:#0080c0; +} +div.codearea pre span.String { + color:#004080; +} +div.codearea pre span.SPChar { + color:#0000c0; +} +div.codearea pre span.ResWord { + color:#a00000; +} +div.codearea pre span.ConsWord { + color:#008080; + font-weight:bold; +} +div.codearea pre span.Error { + color:#ff8080; + border:solid 1.5pt #f00; +} +div.codearea pre span.ResWord2 { + color:#0080ff; + font-weight:bold; +} +div.codearea pre span.Special { + color:#00f; +} +div.codearea pre span.Preprc { + color:#803999; +} +#message { + clear:both; + padding:5px 10px; + background-color:#eee; + border-bottom:2px solid #ccc; +} +#message p { + margin:5px 0; + padding:0; + font-weight:bold; +} +#message div.buttons { + font-weight:normal; +} +.diff { + width:99%; +} +.diff-title { + background-color:#C0C0C0; +} +.searchresult dd span { + font-weight:bold; +} +.diff { + width:100%; + border:none; +} +.diff-blockheader { + font-weight:bold; + background:#e5e5e5; + font-size:1.2em; + border-top:2px solid #444; + padding:5px; +} +.diff th { + font-size:120%; + width:50%; + font-weight:normal; + text-align:left; + padding-bottom:3px; +} +.diff td { + font-family:monospace; + font-size:100%; + border:none; +} +.diff-addedline { + background-color:#dfd; +} +.diff-deletedline { + background-color:#ffb; +} +.diff-context { + color:#888; +} +.diff-addedline { + background-color:#E0FFE0; + vertical-align:sub; +} +.diff-deletedline { + background-color:#FFFFE0; + background-color:#f4cece; + vertical-align:sub; +} +.diff-addedline strong { + background-color:#80FF80; + background-color:#8ae234; +} +.diff-deletedline strong { + background-color:#FFFF80; + background-color:#ef2929; + background-color:#d78383; +} +.box { + background:url(/media/img/progress-bar-back.gif) right center no-repeat; + width:200px; + height:20px; + float:left; +} +.perc { + background:url(/media/img/progress-bar.gif) right center no-repeat; + height:20px; +} +.boxtext { + font-family:tahoma, arial, sans-serif; + font-size:11px; + color:#000; + float:none; + padding:3px 0 0 10px; +} +.statusbutton { + width:32px; + height:32px; + float:left; + margin-left:-32px; + margin-right:5px; + opacity:0; + cursor:pointer +} +.dlsize { + float:left; + padding-right: 8px; +} +.dlspeed { + float:left; + padding-right: 8px; +} diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 27aa72b9f..9095d802a 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -1,100 +1,111 @@ -<?xml version="1.0" ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> - -<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> -<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> -<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon"> -{% block head %} -{% endblock %} -<title>{% block title %}pyLoad Webinterface{% endblock %}</title> -</head> - -<a class="anchor" name="top" id="top"></a> - -<div id="head-panel"> - -<div id="head-search-and-login"> - -{% if user.is_authenticated %} -<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span> - <ul id="user-actions"> - <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li> - {% if user.is_staff %} - <li><a href="/admin" class="action profile" rel="nofollow">Administrate</a></li> - {% endif %} - <li></li> - <li></li> - </ul> -{% else %} - <span style="padding-right: 2px;">Please Login!</span> -{% endif %} - - </div> - - <a href="/"><img id="head-logo" src="{{ MEDIA_URL }}img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a> - - <div id="head-menu"> - <ul> - - {% block menu %} - <li class="selected"> - <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> - </li> - <li> - <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> - <li> - <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> - <li class="right"> - <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> - </li> - {% endblock %} - - </ul> - </div> - - <div style="clear:both;"></div> -</div> - -<ul id="page-actions"> - <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> - -</ul> - -<div id="body-wrapper" class="dokuwiki"> - -<div id="content" lang="en" dir="ltr"> - -<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> -</h1> - -{% block statusbar %} -{% endblock %} - - -<br> - -<div class="level1" style="clear:both"> -</div> - -{% for message in messages %} - <b><p>{{message}}</p></b> -{% endfor %} - -{% block content %} -{% endblock content %} - - <hr style="clear: both;" /> - -<div id="foot">© 2008-2010 the pyLoad Team - - <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br /> - <!--<div class="breadcrumbs"></div>--> - - -</div> -</div> -</head> -<body> +<?xml version="1.0" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + +<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> +<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> +<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> +{% block head %} +{% endblock %} +<title>{% block title %}pyLoad Webinterface{% endblock %}</title> +<script type="text/javascript"> +$(document).ready(function(){ + $.getJSON('/json/statuss', LoadJsonToContent ); +}); +</script> +</head> + +<a class="anchor" name="top" id="top"></a> + +<div id="head-panel"> + +<div id="head-search-and-login"> + +{% if user.is_authenticated %} +<img src="{{ MEDIA_URL }}img/head-login.png" alt="User:" style="vertical-align:middle; margin:2px" /><span style="padding-right: 2px;">{{user.username}}</span> + <ul id="user-actions"> + <li><a href="/logout" class="action logout" rel="nofollow">Logout</a></li> + {% if user.is_staff %} + <li><a href="/admin" class="action profile" rel="nofollow">Administrate</a></li> + {% endif %} + <li></li> + <li></li> + </ul> +{% else %} + <span style="padding-right: 2px;">Please Login!</span> +{% endif %} + + </div> + + <a href="/"><img id="head-logo" src="{{ MEDIA_URL }}img/pyload-logo-edited3.5-new-font-small.png" alt="pyLoad" /></a> + + <div id="head-menu"> + <ul> + + {% block menu %} + <li class="selected"> + <a href="/" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> + </li> + <li> + <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <li> + <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> + <li class="right"> + <a href="/logs/" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> + </li> + {% endblock %} + + </ul> + </div> + + <div style="clear:both;"></div> +</div> + +<ul id="page-actions2"> + <li><a href="" class="action play" accesskey="o" rel="nofollow">Play</a></li> + <li><a href="" class="action pause" accesskey="o" rel="nofollow">Pause</a></li> +</ul> + +<ul id="page-actions"> + <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">485</b> kb/s</a></li> + <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">1</b> / <b id="aktiv_from">4</b></a></li> + <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> +</ul> + +<!--div id="body-wrapper" class="dokuwiki"> + +<div id="content" lang="en" dir="ltr"> + +<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> +</h1--> + +{% block statusbar %} +{% endblock %} + + +<br> + +<div class="level1" style="clear:both"> +</div> + +{% for message in messages %} + <b><p>{{message}}</p></b> +{% endfor %} + +{% block content %} +{% endblock content %} + + <hr style="clear: both;" /> + +<div id="foot">© 2008-2010 the pyLoad Team + + <a href="#top" class="action top" accesskey="x"><span>Back to top</span></a><br /> + <!--<div class="breadcrumbs"></div>--> + + +</div> +</div> +</head> +<body> diff --git a/module/web/urls.py b/module/web/urls.py index 4f47fc281..6bec8dfba 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -14,7 +14,7 @@ urlpatterns = patterns('', # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - (r'^admin/', include(admin.site.urls)), + # (r'^admin/', include(admin.site.urls)), (r'^json/', include('ajax.urls')), (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', -- cgit v1.2.3 From fd401cc004ed1ce52bf63048583dbc338aad6363 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 16 Dec 2009 22:21:57 +0100 Subject: new images --- module/web/media/img/cog.png | Bin 0 -> 512 bytes module/web/media/img/control_pause.png | Bin 0 -> 598 bytes module/web/media/img/control_play_blue.png | Bin 0 -> 717 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 module/web/media/img/cog.png create mode 100644 module/web/media/img/control_pause.png create mode 100644 module/web/media/img/control_play_blue.png (limited to 'module') diff --git a/module/web/media/img/cog.png b/module/web/media/img/cog.png new file mode 100644 index 000000000..67de2c6cc Binary files /dev/null and b/module/web/media/img/cog.png differ diff --git a/module/web/media/img/control_pause.png b/module/web/media/img/control_pause.png new file mode 100644 index 000000000..2d9ce9c4e Binary files /dev/null and b/module/web/media/img/control_pause.png differ diff --git a/module/web/media/img/control_play_blue.png b/module/web/media/img/control_play_blue.png new file mode 100644 index 000000000..f8c8ec683 Binary files /dev/null and b/module/web/media/img/control_play_blue.png differ -- cgit v1.2.3 From 9fd8d0c20d4495319b72bd2faa7275c75a7fcacc Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 16 Dec 2009 22:28:57 +0100 Subject: Fixed Relink.us, Uploaded.to Name Bug --- module/download_thread.py | 17 ++++++----------- module/file_list.py | 5 ++--- module/plugins/RelinkUs.py | 9 ++++----- module/plugins/UploadedTo.py | 12 +++--------- 4 files changed, 15 insertions(+), 28 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index 89a10533a..401d6f943 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -140,22 +140,17 @@ class Download_Thread(threading.Thread): 20 - unknown error """ if code == 0: - self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) + self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) elif code == 1: - self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) + self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) elif code == 5: - self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) + self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) elif code == 10: - self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) + self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) if not check: - raise Checksum(code, location) - #print "checksum check returned: %s, %s" % (check, code) - - status.type = "finished" + raise Checksum(code, location) - #startet downloader - #urllib.urlretrieve(status.url, pyfile.download_folder + "/" + status.filename, status) - #self.shutdown = True + status.type = "finished" def wait(self, pyfile): pyfile.status.type = "waiting" diff --git a/module/file_list.py b/module/file_list.py index ae168900b..1cd069de7 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -144,7 +144,7 @@ class File_List(object): info["id"] = pyfile.id info["url"] = pyfile.url info["folder"] = pyfile.folder - info["filename"] = pyfile.filename + info["filename"] = pyfile.status.filename info["status_type"] = pyfile.status.type info["status_url"] = pyfile.status.url info["status_filename"] = pyfile.status.filename @@ -389,8 +389,7 @@ class PyLoadFile(): pluginClass = module.Plugin.Plugin self.plugin = pluginClass(self) self.status = Status(self) - if self.plugin.file_exists(): - self.filename = self.plugin.get_file_name() + self.status.filename = self.url def _get_my_plugin(self): for plugin, plugin_pattern in self.core.plugins_avaible.items(): diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py index 786733558..71b441116 100644 --- a/module/plugins/RelinkUs.py +++ b/module/plugins/RelinkUs.py @@ -4,7 +4,7 @@ import re import time -from Plugin import Plugin +from module.Plugin import Plugin class RelinkUs(Plugin): @@ -14,10 +14,10 @@ class RelinkUs(Plugin): props['name'] = "RelinkUs" props['type'] = "container" props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" - props['version'] = "0.2" + props['version'] = "1" props['description'] = """Relink.us Container Plugin""" - props['author_name'] = ("Sleeper-") - props['author_mail'] = ("@nonymous") + props['author_name'] = ("Sleeper-", "spoob") + props['author_mail'] = ("@nonymous", "spoob@pyload.org") self.props = props self.parent = parent self.html = None @@ -55,7 +55,6 @@ class RelinkUs(Plugin): # Wait some secs for relink.us server... time.sleep(5) - print new_link temp_links.append(new_link) self.links = temp_links diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py index 4bddbd6f1..bb623b4e6 100644 --- a/module/plugins/UploadedTo.py +++ b/module/plugins/UploadedTo.py @@ -21,7 +21,6 @@ class UploadedTo(Plugin): self.props = props self.parent = parent self.html = None - self.html_old = None #time() where loaded the HTML self.time_plus_wait = None #time() + wait in seconds self.api_data = None self.want_reconnect = False @@ -35,12 +34,11 @@ class UploadedTo(Plugin): def prepare(self, thread): pyfile = self.parent - + self.want_reconnect = False tries = 0 while not pyfile.status.url: - self.req.clear_cookies() self.download_html() @@ -84,7 +82,7 @@ class UploadedTo(Plugin): self.api_data["filename"] = lines[0] self.api_data["size"] = lines[1] # in kbytes self.api_data["checksum"] = lines[2] #sha1 - + def download_html(self): if self.config['premium']: self.config['username'], self.config['password'] @@ -107,7 +105,6 @@ class UploadedTo(Plugin): if self.config['premium']: self.start_dl = True return self.parent.url - try: file_url_pattern = r".*<form name=\"download_form\" method=\"post\" action=\"(.*)\">" return re.search(file_url_pattern, self.html).group(1) @@ -124,12 +121,9 @@ class UploadedTo(Plugin): return file_name return file_name + file_suffix.group(1) except: - self.parent.status.url = None return self.parent.url def file_exists(self): - """ returns True or False - """ if re.search(r"(File doesn't exist .*)", self.html) != None: return False else: @@ -153,4 +147,4 @@ class UploadedTo(Plugin): else: return (False, 1) else: - return (True, 5) + return (True, 5) -- cgit v1.2.3 From 3db583f5f10a72e53ecd8d282ec5db1e3f4cd4dd Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 16 Dec 2009 22:49:20 +0100 Subject: Webinterface authsystem --- module/web/ajax/views.py | 33 +++++++++++++++++++++++---------- module/web/pyload.db | Bin 34816 -> 39936 bytes module/web/pyload/admin.py | 4 ++-- module/web/pyload/models.py | 22 +++++++++++++++++++--- module/web/pyload/views.py | 9 ++++----- module/web/templates/default/base.html | 10 +++++++--- module/web/templates/default/home.html | 6 +++++- module/web/urls.py | 2 +- 8 files changed, 61 insertions(+), 25 deletions(-) (limited to 'module') diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index d883376e7..c4395a659 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -12,9 +12,10 @@ def check_server(function): def _view(request, *args, **kwargs): try: version = settings.PYLOAD.get_server_version() - return view_func(request, *args, **kwargs) except Exception, e: return HttpResponseServerError() + + return view_func(request, *args, **kwargs) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ @@ -30,7 +31,7 @@ def check_server(function): def permission(perm): def _dec(view_func): def _view(request, *args, **kwargs): - if request.user.has_perm(perm) and request.user.is_authenticated: + if request.user.has_perm(perm) and request.user.is_authenticated(): return view_func(request, *args, **kwargs) else: return HttpResponseForbidden() @@ -57,14 +58,26 @@ class JsonResponse(HttpResponse): def add_package(request): a = {'b' : [1,2,3], 'dsfsd' : "sadd"} return JsonResponse(a) - -# @TODO: Auth + Auth - + + +@permission('pyload.can_see_dl') def status(request): - return JsonResponse(settings.PYLOAD.status_server()) - + try: + return JsonResponse(settings.PYLOAD.status_server()) + except: + return HttpResponseServerError() + +@permission('pyload.can_see_dl') def links(request): - return JsonResponse(settings.PYLOAD.status_downloads()) - + try: + return JsonResponse(settings.PYLOAD.status_downloads()) + except: + return HttpResponseServerError() + +@permission('pyload.can_see_dl') def queue(request): - return JsonResponse(settings.PYLOAD.get_queue()) \ No newline at end of file + try: + return JsonResponse(settings.PYLOAD.get_queue()) + + except: + return HttpResponseServerError() \ No newline at end of file diff --git a/module/web/pyload.db b/module/web/pyload.db index 45f55284e..08a6dbcaf 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/pyload/admin.py b/module/web/pyload/admin.py index 11f325200..99cb28836 100644 --- a/module/web/pyload/admin.py +++ b/module/web/pyload/admin.py @@ -1,12 +1,12 @@ # -*- coding: utf-8 -*- from django.contrib import admin -from models import UserProfile +from models import Prefs from django.contrib.auth.models import User from django.contrib.auth.admin import UserAdmin as RealUserAdmin class UserProfileInline(admin.StackedInline): - model = UserProfile + model = Prefs class UserAdmin(RealUserAdmin): inlines = [ UserProfileInline ] diff --git a/module/web/pyload/models.py b/module/web/pyload/models.py index d3d99febc..86962f23c 100644 --- a/module/web/pyload/models.py +++ b/module/web/pyload/models.py @@ -3,13 +3,29 @@ from django.db import models from django.contrib.auth.models import User # Create your models here. -class UserProfile(models.Model): +class Prefs(models.Model): """ Permissions setting """ user = models.ForeignKey(User, unique=True) - template = models.CharField(max_length=30, default='default', null=False, blank=False) + template = models.CharField(max_length=30, default='default', null=False, blank=False) #@TODO: currently unused + + class Meta: + permissions = ( + ('can_see_dl', 'User can see Downloads'), + ('can_change_status', 'User can change Status'), + ('can_download', 'User can download'), + ('can_add', 'User can add Links'), + ('can_delete', 'User can delete Links'), + ('can_see_logs', 'User can see Logs'), + ) + verbose_name = "Preferences" + verbose_name_plural = "Preferences" + + def __unicode__(self): + return "Preferences for %s" % self.user + def user_post_save(sender, instance, **kwargs): - profile, new = UserProfile.objects.get_or_create(user=instance) + profile, new = Prefs.objects.get_or_create(user=instance) models.signals.post_save.connect(user_post_save, User) \ No newline at end of file diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 6c2954555..405bd2753 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -50,29 +50,28 @@ def base(request, messages): return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) @login_required -#@permission('perm.permissions.can_see_dl') @TODO: Permissions not working :( +@permission('pyload.can_see_dl') @check_server def home(request): - print request.user.get_all_permissions() return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) @login_required -#@permission('pyload.perm.can_see_dl') +@permission('pyload.can_see_dl') @check_server def queue(request): return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) @login_required -#@permission('pyload.user.can_download') +@permission('pyload.can_download') @check_server def downloads(request): return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) @login_required -#@permission('pyload.user.can_see_logs') +@permission('pyload.user.can_see_logs') @check_server def logs(request): return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 9095d802a..5d79e8b6a 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -12,7 +12,7 @@ <title>{% block title %}pyLoad Webinterface{% endblock %}</title> <script type="text/javascript"> $(document).ready(function(){ - $.getJSON('/json/statuss', LoadJsonToContent ); + $.getJSON('/json/status', LoadJsonToContent ); }); </script> </head> @@ -63,23 +63,27 @@ $(document).ready(function(){ <div style="clear:both;"></div> </div> +{% if perms.pyload.can_change_status %} <ul id="page-actions2"> <li><a href="" class="action play" accesskey="o" rel="nofollow">Play</a></li> <li><a href="" class="action pause" accesskey="o" rel="nofollow">Pause</a></li> </ul> +{% endif %} +{% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">485</b> kb/s</a></li> <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">1</b> / <b id="aktiv_from">4</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul> +{% endif %} -<!--div id="body-wrapper" class="dokuwiki"> +<div id="body-wrapper" class="dokuwiki"> <div id="content" lang="en" dir="ltr"> <h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> -</h1--> +</h1 {% block statusbar %} {% endblock %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 895302e61..40f124712 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1 +1,5 @@ -{% extends 'default/base.html' %} \ No newline at end of file +{% extends 'default/base.html' %} + +{% block content %} + +{% endblock %} \ No newline at end of file diff --git a/module/web/urls.py b/module/web/urls.py index 6bec8dfba..3d3295efd 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -14,7 +14,7 @@ urlpatterns = patterns('', # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - # (r'^admin/', include(admin.site.urls)), + # (r'^admin/', include(admin.site.urls)), # django 1.0 not working (r'^json/', include('ajax.urls')), (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', -- cgit v1.2.3 From aea618c1bffe9ea6eb44b8555f17349b39dfe22b Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 16 Dec 2009 23:45:21 +0100 Subject: new functions for interacting with core --- module/web/ajax/urls.py | 2 ++ module/web/ajax/views.py | 43 ++++++++++++++++++++----------------------- 2 files changed, 22 insertions(+), 23 deletions(-) (limited to 'module') diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 0db240578..d1c90aa21 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -16,4 +16,6 @@ urlpatterns = patterns('ajax', (r'^status$', 'views.status'), (r'^links$', 'views.links'), (r'^queue$', 'views.queue'), + (r'^pause$', 'views.pause'), + (r'^unpause$', 'views.unpause'), ) \ No newline at end of file diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index c4395a659..05c91597f 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -6,28 +6,7 @@ from django.conf import settings from django.shortcuts import render_to_response from django.utils import simplejson from django.core.serializers import json - -def check_server(function): - def _dec(view_func): - def _view(request, *args, **kwargs): - try: - version = settings.PYLOAD.get_server_version() - except Exception, e: - return HttpResponseServerError() - - return view_func(request, *args, **kwargs) - - _view.__name__ = view_func.__name__ - _view.__dict__ = view_func.__dict__ - _view.__doc__ = view_func.__doc__ - - return _view - - if function is None: - return _dec - else: - return _dec(function) - + def permission(perm): def _dec(view_func): def _view(request, *args, **kwargs): @@ -80,4 +59,22 @@ def queue(request): return JsonResponse(settings.PYLOAD.get_queue()) except: - return HttpResponseServerError() \ No newline at end of file + return HttpResponseServerError() + + +@permission('pyload.can_change_satus') +def pause(request): + try: + return JsonResponse(settings.PYLOAD.pause_server()) + + except: + return HttpResponseServerError() + + +@permission('pyload.can_change_status') +def unpause(request): + try: + return JsonResponse(settings.PYLOAD.unpause_server()) + + except: + return HttpResponseServerError() -- cgit v1.2.3 From 3b9367da01986e3b5d83ca35773517abbce5171c Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Thu, 17 Dec 2009 00:25:59 +0100 Subject: new images, status ajax, add jquery --- module/web/media/css/default.css | 12 +++ module/web/media/img/control_pause_blue.png | Bin 0 -> 721 bytes module/web/media/img/control_play.png | Bin 0 -> 592 bytes module/web/media/img/control_stop.png | Bin 0 -> 403 bytes module/web/media/img/control_stop_blue.png | Bin 0 -> 695 bytes module/web/media/js/jquery-1.3.2.min.js | 19 ++++ module/web/media/js/jquery.timers-1.2.js | 138 ++++++++++++++++++++++++++++ module/web/pyload.db | Bin 39936 -> 39936 bytes module/web/templates/default/base.html | 57 +++++++++--- 9 files changed, 213 insertions(+), 13 deletions(-) create mode 100644 module/web/media/img/control_pause_blue.png create mode 100644 module/web/media/img/control_play.png create mode 100644 module/web/media/img/control_stop.png create mode 100644 module/web/media/img/control_stop_blue.png create mode 100644 module/web/media/js/jquery-1.3.2.min.js create mode 100644 module/web/media/js/jquery.timers-1.2.js (limited to 'module') diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css index 40832efe0..fbfc34d22 100644 --- a/module/web/media/css/default.css +++ b/module/web/media/css/default.css @@ -1003,11 +1003,23 @@ a.backlink { background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat; } a.play { + background:transparent url(/media/img/control_play.png) 0px 1px no-repeat; +} +a.play:hover { background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; } a.pause { background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; } +a.pause:hover { + background:transparent url(/media/img/control_pause_blue.png) 0px 1px no-repeat; +} +a.stop { + background:transparent url(/media/img/control_stop.png) 0px 1px no-repeat; +} +a.stop:hover { + background:transparent url(/media/img/control_stop_blue.png) 0px 1px no-repeat; +} a.cog { background:transparent url(/media/img/cog.png) 0px 1px no-repeat; } diff --git a/module/web/media/img/control_pause_blue.png b/module/web/media/img/control_pause_blue.png new file mode 100644 index 000000000..ec61099b0 Binary files /dev/null and b/module/web/media/img/control_pause_blue.png differ diff --git a/module/web/media/img/control_play.png b/module/web/media/img/control_play.png new file mode 100644 index 000000000..0846555d0 Binary files /dev/null and b/module/web/media/img/control_play.png differ diff --git a/module/web/media/img/control_stop.png b/module/web/media/img/control_stop.png new file mode 100644 index 000000000..893bb60e5 Binary files /dev/null and b/module/web/media/img/control_stop.png differ diff --git a/module/web/media/img/control_stop_blue.png b/module/web/media/img/control_stop_blue.png new file mode 100644 index 000000000..e6f75d232 Binary files /dev/null and b/module/web/media/img/control_stop_blue.png differ diff --git a/module/web/media/js/jquery-1.3.2.min.js b/module/web/media/js/jquery-1.3.2.min.js new file mode 100644 index 000000000..b1ae21d8b --- /dev/null +++ b/module/web/media/js/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/module/web/media/js/jquery.timers-1.2.js b/module/web/media/js/jquery.timers-1.2.js new file mode 100644 index 000000000..ad22e93ce --- /dev/null +++ b/module/web/media/js/jquery.timers-1.2.js @@ -0,0 +1,138 @@ +/** + * jQuery.timers - Timer abstractions for jQuery + * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) + * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). + * Date: 2009/10/16 + * + * @author Blair Mitchelmore + * @version 1.2 + * + **/ + +jQuery.fn.extend({ + everyTime: function(interval, label, fn, times) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, times); + }); + }, + oneTime: function(interval, label, fn) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, 1); + }); + }, + stopTime: function(label, fn) { + return this.each(function() { + jQuery.timer.remove(this, label, fn); + }); + } +}); + +jQuery.extend({ + timer: { + global: [], + guid: 1, + dataKey: "jQuery.timer", + regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, + powers: { + // Yeah this is major overkill... + 'ms': 1, + 'cs': 10, + 'ds': 100, + 's': 1000, + 'das': 10000, + 'hs': 100000, + 'ks': 1000000 + }, + timeParse: function(value) { + if (value == undefined || value == null) + return null; + var result = this.regex.exec(jQuery.trim(value.toString())); + if (result[2]) { + var num = parseFloat(result[1]); + var mult = this.powers[result[2]] || 1; + return num * mult; + } else { + return value; + } + }, + add: function(element, interval, label, fn, times) { + var counter = 0; + + if (jQuery.isFunction(label)) { + if (!times) + times = fn; + fn = label; + label = interval; + } + + interval = jQuery.timer.timeParse(interval); + + if (typeof interval != 'number' || isNaN(interval) || interval < 0) + return; + + if (typeof times != 'number' || isNaN(times) || times < 0) + times = 0; + + times = times || 0; + + var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); + + if (!timers[label]) + timers[label] = {}; + + fn.timerID = fn.timerID || this.guid++; + + var handler = function() { + if ((++counter > times && times !== 0) || fn.call(element, counter) === false) + jQuery.timer.remove(element, label, fn); + }; + + handler.timerID = fn.timerID; + + if (!timers[label][fn.timerID]) + timers[label][fn.timerID] = window.setInterval(handler,interval); + + this.global.push( element ); + + }, + remove: function(element, label, fn) { + var timers = jQuery.data(element, this.dataKey), ret; + + if ( timers ) { + + if (!label) { + for ( label in timers ) + this.remove(element, label, fn); + } else if ( timers[label] ) { + if ( fn ) { + if ( fn.timerID ) { + window.clearInterval(timers[label][fn.timerID]); + delete timers[label][fn.timerID]; + } + } else { + for ( var fn in timers[label] ) { + window.clearInterval(timers[label][fn]); + delete timers[label][fn]; + } + } + + for ( ret in timers[label] ) break; + if ( !ret ) { + ret = null; + delete timers[label]; + } + } + + for ( ret in timers ) break; + if ( !ret ) + jQuery.removeData(element, this.dataKey); + } + } + } +}); + +jQuery(window).bind("unload", function() { + jQuery.each(jQuery.timer.global, function(index, item) { + jQuery.timer.remove(item); + }); +}); \ No newline at end of file diff --git a/module/web/pyload.db b/module/web/pyload.db index 08a6dbcaf..5993a9515 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 5d79e8b6a..ef2685a83 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -6,13 +6,48 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> -<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> +<script src="{{ MEDIA_URL }}/js/jquery-1.3.2.min.js"></script> {% block head %} {% endblock %} <title>{% block title %}pyLoad Webinterface{% endblock %}</title> <script type="text/javascript"> +function LoadJsonToContent(data) +{ + JSONDATA = data; + $("#speed").text(Math.round(data.speed/0.01)*0.01); + $("#aktiv").text(data.queue); + $("#aktiv_from").text(data.total); + + /*if( data.pause == false ) + { + $("#action_play").hide(); + $("#action_pause").show(); + } + else + { + $("#action_play").show(); + $("#action_pause").hide(); + }*/ +} + $(document).ready(function(){ - $.getJSON('/json/status', LoadJsonToContent ); + //$('#action_pause').hide(); + + + /*$("#play").hover( + function() + { // mouseover + $(this).attr("id", "highlight"); + }, + function() + { // mouseout + $(this).attr("id", ""); + });*/ + var refreshId = setInterval(function() + { + $.getJSON('/json/status', LoadJsonToContent ); + }, 1000); + }); </script> </head> @@ -63,27 +98,23 @@ $(document).ready(function(){ <div style="clear:both;"></div> </div> -{% if perms.pyload.can_change_status %} <ul id="page-actions2"> - <li><a href="" class="action play" accesskey="o" rel="nofollow">Play</a></li> - <li><a href="" class="action pause" accesskey="o" rel="nofollow">Pause</a></li> + <li id="action_play"><a href="/json/unpause" class="action play" accesskey="o" rel="nofollow">Play</a></li> + <li id="action_stop"><a href="" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> + <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow" name="Stop after ending last one" alt="Stop after ending last one">SAELO</a></li> </ul> -{% endif %} -{% if perms.pyload.can_see_dl %} <ul id="page-actions"> - <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">485</b> kb/s</a></li> - <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">1</b> / <b id="aktiv_from">4</b></a></li> + <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">0</b> kb/s</a></li> + <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">0</b> / <b id="aktiv_from">0</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> -</ul> -{% endif %} +</ul><br /> <div id="body-wrapper" class="dokuwiki"> <div id="content" lang="en" dir="ltr"> -<h1><a name="pyload_download_manager_for_1_click_hoster" id="pyload_download_manager_for_1_click_hoster">pyLoad — Webinterface</a> -</h1 +<h1>Queue</h1> {% block statusbar %} {% endblock %} -- cgit v1.2.3 From 502a9567941d562883a9464555a64a40590d7eed Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 17 Dec 2009 15:30:25 +0100 Subject: Little Rapidshare Fix --- module/plugins/LinkList.py | 10 +++++----- module/plugins/RapidshareCom.py | 8 +++++--- 2 files changed, 10 insertions(+), 8 deletions(-) (limited to 'module') diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index 092e3ef10..210451af9 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -35,10 +35,10 @@ class LinkList(Plugin): tmpLinks.append(link.replace("\n", "")) txt.close() - if not self.parent.core.config['general']['debug_mode']: - txt = open(linkList, 'w') - txt.write("") - txt.close() - #may delete read txt file? + #~ if not self.parent.core.config['general']['debug_mode']: + #~ txt = open(linkList, 'w') + #~ txt.write("") + #~ txt.close() + #~ #may delete read txt file? self.links = tmpLinks diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index ee1d84a75..c4e1f8ef9 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -115,8 +115,8 @@ class RapidshareCom(Plugin): if premkbleft < int(self.api_data["size"][0:-3]): self.logger.info("Rapidshare: Not enough traffic left") self.config["premium"] = False - - self.props["premkbleft"] = premkbleft + else: + self.props["premkbleft"] = premkbleft def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses @@ -133,7 +133,9 @@ class RapidshareCom(Plugin): self.html_old = time() if re.search(r"is already downloading", self.html[1]) != None: - self.time_plus_wait = time() + 10 * 60 + self.logger.info("Rapidshare: Already downloading, wait 30 minutes") + self.time_plus_wait = time() + 10 * 30 + return False self.no_slots = False try: wait_minutes = re.search(r"Or try again in about (\d+) minute", self.html[1]).group(1) -- cgit v1.2.3 From 511ae48877f8f3fae2a3ba282d979c33f2ea5491 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 17 Dec 2009 16:14:26 +0100 Subject: webinterface: config working, downloadable files --- module/web/ServerThread.py | 13 ++++-- module/web/pyload.db | Bin 39936 -> 39936 bytes module/web/pyload/urls.py | 2 + module/web/pyload/views.py | 67 +++++++++++++++++++++++++--- module/web/settings.py | 11 +++-- module/web/templates/default/base.html | 6 ++- module/web/templates/default/downloads.html | 28 ++++++++++++ module/web/templates/default/home.html | 6 ++- 8 files changed, 120 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 803dc5dc5..790ac152b 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -2,6 +2,7 @@ import threading import os from os.path import join +import subprocess class WebServer(threading.Thread): def __init__(self, pycore): @@ -10,6 +11,12 @@ class WebServer(threading.Thread): self.setDaemon(True) def run(self): - self.pycore.logger.info("Starting Webserver @ Port 8000") - os.system("python " + join(self.pycore.path,"module","web","manage.py runserver")) - #@TODO: really bad approach, better would be real python code, or subprocess \ No newline at end of file + host = self.pycore.config['webinterface']['host'] + port = self.pycore.config['webinterface']['port'] + self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) + try: + subprocess.call(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True) + except Exception, e: + print e + #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) + #@TODO: better would be real python code \ No newline at end of file diff --git a/module/web/pyload.db b/module/web/pyload.db index 5993a9515..bd9c5b257 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py index 667a4ed3d..63badeb25 100644 --- a/module/web/pyload/urls.py +++ b/module/web/pyload/urls.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from os.path import join @@ -8,6 +9,7 @@ from django.conf.urls.defaults import * urlpatterns = patterns('pyload', (r'^home/$', 'views.home'), (r'^downloads/$', 'views.downloads',{},'downloads'), + (r'^download/(?P<path>[a-zA-z\.0-9\-/_%]+)$', 'views.download',{},'download'), (r'^queue/$', 'views.queue',{}, 'queue'), (r'^logs/$', 'views.logs',{}, 'logs'), (r'^$', 'views.home',{}, 'home'), diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 405bd2753..0cdc87873 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,11 +1,17 @@ # Create your views here. +import mimetypes from django.http import HttpResponse from django.http import HttpResponseRedirect +from django.http import HttpResponseNotFound from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext from django.contrib.auth.decorators import login_required from os.path import join +from os.path import isdir +from os.path import isfile +from os import listdir +from os import stat def check_server(function): @@ -67,13 +73,64 @@ def queue(request): @permission('pyload.can_download') @check_server def downloads(request): - return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request)) - + if not isdir(settings.DL_ROOT): + return base(request, ['Download directory not found.']) + data = { + 'folder': [], + 'files': [] + } + + for item in listdir(settings.DL_ROOT): + if isdir(join(settings.DL_ROOT, item)): + folder = { + 'name' : item, + 'files' : [] + } + for file in listdir(join(settings.DL_ROOT, item)): + if isfile(join(settings.DL_ROOT, item, file)): + folder['files'].append(file) + + data['folder'].append(folder) + elif isfile(join(settings.DL_ROOT, item)): + data['files'].append(item) + + + return render_to_response(join(settings.TEMPLATE,'downloads.html'), {'files': data}, RequestContext(request)) + +@login_required +@permission('pyload.user.can_download') +@check_server +def download(request,path): + path = path.split("/") + + dir = join(settings.DL_ROOT, path[1].replace('..','')) + if isdir(dir) or isfile(dir): + if isdir(dir): filepath = join(dir, path[2]) + elif isfile(dir): filepath = dir + + print filepath + if isfile(filepath): + try: + type, encoding = mimetypes.guess_type(filepath) + if type is None: + type = 'application/octet-stream' + + response = HttpResponse(mimetype=type) + response['Content-Length'] = str(stat(filepath).st_size) + + if encoding is not None: + response['Content-Encoding'] = encoding + + response.write(file(filepath, "rb").read()) + return response + + except Exception, e: + return HttpResponseNotFound("File not Found. %s" % str(e)) + + return HttpResponseNotFound("File not Found.") @login_required @permission('pyload.user.can_see_logs') @check_server def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) - - \ No newline at end of file + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) \ No newline at end of file diff --git a/module/web/settings.py b/module/web/settings.py index 00395b328..2695b0648 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -18,7 +18,10 @@ PROJECT_DIR = os.path.dirname(__file__) #chdir(dirname(abspath(__file__)) + sep) config = ConfigParser.SafeConfigParser() -config.read(os.path.join(PROJECT_DIR,"..","..","config")) + +PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") + +config.read(os.path.join(PYLOAD_DIR,"config")) ssl = "" @@ -36,6 +39,8 @@ server_url = "http%s://%s:%s@%s:%s/" % ( PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) TEMPLATE = config.get('webinterface','template') +DL_ROOT = os.path.join(PYLOAD_DIR, config.get('general','download_folder')) + ADMINS = ( # ('Your Name', 'your_email@domain.com'), @@ -44,7 +49,7 @@ ADMINS = ( MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = 'pyload.db' # Or path to database file if using sqlite3. +DATABASE_NAME = os.path.join(PROJECT_DIR, 'pyload.db') # Or path to database file if using sqlite3. DATABASE_USER = '' # Not used with sqlite3. DATABASE_PASSWORD = '' # Not used with sqlite3. DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. @@ -55,7 +60,7 @@ DATABASE_PORT = '' # Set to empty string for default. Not used with # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. -TIME_ZONE = 'America/Chicago' +TIME_ZONE = 'Europe' # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index ef2685a83..46e9caa11 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -98,23 +98,27 @@ $(document).ready(function(){ <div style="clear:both;"></div> </div> +{% if perms.pyload.can_change_status %} <ul id="page-actions2"> <li id="action_play"><a href="/json/unpause" class="action play" accesskey="o" rel="nofollow">Play</a></li> <li id="action_stop"><a href="" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow" name="Stop after ending last one" alt="Stop after ending last one">SAELO</a></li> </ul> +{% endif %} +{% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">0</b> kb/s</a></li> <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">0</b> / <b id="aktiv_from">0</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> +{% endif %} <div id="body-wrapper" class="dokuwiki"> <div id="content" lang="en" dir="ltr"> -<h1>Queue</h1> +<h1>{% block subtitle %}pyLoad - Webinterface{% endblock %}</h1> {% block statusbar %} {% endblock %} diff --git a/module/web/templates/default/downloads.html b/module/web/templates/default/downloads.html index 202965b3c..3f07bec47 100644 --- a/module/web/templates/default/downloads.html +++ b/module/web/templates/default/downloads.html @@ -13,4 +13,32 @@ <li class="right"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> +{% endblock %} + +{% block subtitle %} +Downloads +{% endblock %} + +{% block content %} + +It's recommend not to download Files bigger than ~10MB from here. + +<ul> + {% for folder in files.folder %} + <li> + {{ folder.name }} + <ul> + {% for file in folder.files %} + <li><a href='{% url download 'get/' %}{{ folder.name }}/{{ file }}'>{{ file }}</a></li> + {% endfor %} + </ul> + </li> + {% endfor %} + + {% for file in files.files %} + <li> <a href={% url download 'get/' %}{{ file }}>{{ file }}</a></li> + {% endfor %} + +</ul> + {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 40f124712..fac4b6e63 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1,5 +1,9 @@ {% extends 'default/base.html' %} -{% block content %} +{% block subtitle %} +Active Downloads +{% endblock %} + +{% block content %} {% endblock %} \ No newline at end of file -- cgit v1.2.3 From 79c8e28802a133049bdad5fb93672ec8964031c4 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 17 Dec 2009 16:28:27 +0100 Subject: changed LinkList.py --- module/plugins/LinkList.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index 210451af9..ff99b0968 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -35,10 +35,10 @@ class LinkList(Plugin): tmpLinks.append(link.replace("\n", "")) txt.close() - #~ if not self.parent.core.config['general']['debug_mode']: - #~ txt = open(linkList, 'w') - #~ txt.write("") - #~ txt.close() - #~ #may delete read txt file? + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #@TODO: maybe delete read txt file? self.links = tmpLinks -- cgit v1.2.3 From ddd93d0e571edbe1a62f928436ea79818466e940 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 17 Dec 2009 17:47:41 +0100 Subject: splited gui file, extended .hgignore --- module/gui/ConnectionManager.py | 225 +++++++++++++++++++++++++++++++++++ module/gui/MainWindow.py | 95 +++++++++++++++ module/gui/PWInputWindow.py | 47 ++++++++ module/gui/Queue.py | 252 ++++++++++++++++++++++++++++++++++++++++ module/gui/XMLParser.py | 70 +++++++++++ module/gui/__init__.py | 1 + module/gui/connector.py | 146 +++++++++++++++++++++++ 7 files changed, 836 insertions(+) create mode 100644 module/gui/ConnectionManager.py create mode 100644 module/gui/MainWindow.py create mode 100644 module/gui/PWInputWindow.py create mode 100644 module/gui/Queue.py create mode 100644 module/gui/XMLParser.py create mode 100644 module/gui/__init__.py create mode 100644 module/gui/connector.py (limited to 'module') diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py new file mode 100644 index 000000000..a7f2aaf38 --- /dev/null +++ b/module/gui/ConnectionManager.py @@ -0,0 +1,225 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class ConnectionManager(QWidget): + def __init__(self): + QWidget.__init__(self) + + mainLayout = QHBoxLayout() + buttonLayout = QVBoxLayout() + + connList = QListWidget() + + new = QPushButton("New") + edit = QPushButton("Edit") + remove = QPushButton("Remove") + connect = QPushButton("Connect") + + mainLayout.addWidget(connList) + mainLayout.addLayout(buttonLayout) + + buttonLayout.addWidget(new) + buttonLayout.addWidget(edit) + buttonLayout.addWidget(remove) + buttonLayout.addStretch() + buttonLayout.addWidget(connect) + + self.setLayout(mainLayout) + + self.new = new + self.connectb = connect + self.remove = remove + self.editb = edit + self.connList = connList + self.edit = self.EditWindow() + self.connectSignals() + + def connectSignals(self): + self.connect(self, SIGNAL("setConnections(connections)"), self.setConnections) + self.connect(self.new, SIGNAL("clicked()"), self.slotNew) + self.connect(self.editb, SIGNAL("clicked()"), self.slotEdit) + self.connect(self.remove, SIGNAL("clicked()"), self.slotRemove) + self.connect(self.connectb, SIGNAL("clicked()"), self.slotConnect) + self.connect(self.edit, SIGNAL("save"), self.slotSave) + + def setConnections(self, connections): + self.connList.clear() + for conn in connections: + item = QListWidgetItem() + item.setData(Qt.DisplayRole, QVariant(conn["name"])) + item.setData(Qt.UserRole, QVariant(conn)) + self.connList.addItem(item) + if conn["default"]: + self.connList.setCurrentItem(item) + + def slotNew(self): + data = {"id":uuid().hex, "type":"remote", "default":False, "name":"", "host":"", "ssl":False, "port":"7227", "user":"admin"} + self.edit.setData(data) + self.edit.show() + + def slotEdit(self): + item = self.connList.currentItem() + data = item.data(Qt.UserRole).toPyObject() + tmp = {} + for k, d in data.items(): + tmp[str(k)] = d + data = tmp + self.edit.setData(data) + self.edit.show() + + def slotRemove(self): + item = self.connList.currentItem() + data = item.data(Qt.UserRole).toPyObject() + tmp = {} + for k, d in data.items(): + tmp[str(k)] = d + data = tmp + self.emit(SIGNAL("removeConnection"), data) + + def slotConnect(self): + item = self.connList.currentItem() + data = item.data(Qt.UserRole).toPyObject() + tmp = {} + for k, d in data.items(): + tmp[str(k)] = d + data = tmp + self.emit(SIGNAL("connect"), data) + + def slotSave(self, data): + self.emit(SIGNAL("saveConnection"), data) + + class EditWindow(QWidget): + def __init__(self): + QWidget.__init__(self) + + grid = QGridLayout() + + nameLabel = QLabel("Name:") + hostLabel = QLabel("Host:") + sslLabel = QLabel("SSL:") + localLabel = QLabel("Local:") + userLabel = QLabel("User:") + portLabel = QLabel("Port:") + + name = QLineEdit() + host = QLineEdit() + ssl = QCheckBox() + local = QCheckBox() + user = QLineEdit() + port = QSpinBox() + port.setRange(1,10000) + + save = QPushButton("Save") + cancel = QPushButton("Cancel") + + grid.addWidget(nameLabel, 0, 0) + grid.addWidget(name, 0, 1) + grid.addWidget(localLabel, 1, 0) + grid.addWidget(local, 1, 1) + grid.addWidget(hostLabel, 2, 0) + grid.addWidget(host, 2, 1) + grid.addWidget(sslLabel, 4, 0) + grid.addWidget(ssl, 4, 1) + grid.addWidget(userLabel, 5, 0) + grid.addWidget(user, 5, 1) + grid.addWidget(portLabel, 3, 0) + grid.addWidget(port, 3, 1) + grid.addWidget(cancel, 6, 0) + grid.addWidget(save, 6, 1) + + self.setLayout(grid) + self.controls = {} + self.controls["name"] = name + self.controls["host"] = host + self.controls["ssl"] = ssl + self.controls["local"] = local + self.controls["user"] = user + self.controls["port"] = port + self.controls["save"] = save + self.controls["cancel"] = cancel + + self.connect(cancel, SIGNAL("clicked()"), self.hide) + self.connect(save, SIGNAL("clicked()"), self.slotDone) + self.connect(local, SIGNAL("stateChanged(int)"), self.slotLocalChanged) + + self.id = None + self.default = None + + def setData(self, data): + self.id = data["id"] + self.default = data["default"] + self.controls["name"].setText(data["name"]) + if data["type"] == "local": + data["local"] = True + else: + data["local"] = False + self.controls["local"].setChecked(data["local"]) + if not data["local"]: + self.controls["ssl"].setChecked(data["ssl"]) + self.controls["user"].setText(data["user"]) + self.controls["port"].setValue(int(data["port"])) + self.controls["host"].setText(data["host"]) + self.controls["ssl"].setDisabled(False) + self.controls["user"].setDisabled(False) + self.controls["port"].setDisabled(False) + self.controls["host"].setDisabled(False) + else: + self.controls["ssl"].setChecked(False) + self.controls["user"].setText("") + self.controls["port"].setValue(1) + self.controls["host"].setText("") + self.controls["ssl"].setDisabled(True) + self.controls["user"].setDisabled(True) + self.controls["port"].setDisabled(True) + self.controls["host"].setDisabled(True) + + def slotLocalChanged(self, val): + if val == 2: + self.controls["ssl"].setDisabled(True) + self.controls["user"].setDisabled(True) + self.controls["port"].setDisabled(True) + self.controls["host"].setDisabled(True) + elif val == 0: + self.controls["ssl"].setDisabled(False) + self.controls["user"].setDisabled(False) + self.controls["port"].setDisabled(False) + self.controls["host"].setDisabled(False) + + def getData(self): + d = {} + d["id"] = self.id + d["default"] = self.default + d["name"] = self.controls["name"].text() + d["local"] = self.controls["local"].isChecked() + d["ssl"] = str(self.controls["ssl"].isChecked()) + d["user"] = self.controls["user"].text() + d["host"] = self.controls["host"].text() + d["port"] = self.controls["port"].value() + if d["local"]: + d["type"] = "local" + else: + d["type"] = "remote" + return d + + def slotDone(self): + data = self.getData() + self.hide() + self.emit(SIGNAL("save"), data) diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py new file mode 100644 index 000000000..fad98d9da --- /dev/null +++ b/module/gui/MainWindow.py @@ -0,0 +1,95 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class MainWindow(QMainWindow): + def __init__(self): + """ + set up main window + """ + QMainWindow.__init__(self) + #window stuff + self.setWindowTitle("pyLoad Client") + self.setWindowIcon(QIcon("icons/logo.png")) + self.resize(750,500) + + #central widget, layout + self.masterlayout = QVBoxLayout() + lw = QWidget() + lw.setLayout(self.masterlayout) + self.setCentralWidget(lw) + + #set menubar and statusbar + self.menubar = self.menuBar() + self.statusbar = self.statusBar() + self.serverStatus = QLabel("Status: Not Connected") + self.statusbar.addPermanentWidget(self.serverStatus) + + #menu + self.menus = {} + self.menus["file"] = self.menubar.addMenu("&File") + self.menus["connections"] = self.menubar.addMenu("&Connections") + + #menu actions + self.mactions = {} + self.mactions["exit"] = QAction("Exit", self.menus["file"]) + self.mactions["manager"] = QAction("Connection manager", self.menus["connections"]) + + #add menu actions + self.menus["file"].addAction(self.mactions["exit"]) + self.menus["connections"].addAction(self.mactions["manager"]) + + #tabs + self.tabw = QTabWidget() + self.tabs = {} + self.tabs["queue"] = {"w":QWidget()} + self.tabs["collector_packages"] = {"w":QWidget()} + self.tabs["collector_links"] = {"w":QWidget()} + self.tabw.addTab(self.tabs["queue"]["w"], "Queue") + self.tabw.addTab(self.tabs["collector_packages"]["w"], "Package collector") + self.tabw.addTab(self.tabs["collector_links"]["w"], "Link collector") + + #init tabs + self.init_tabs() + + #layout + self.masterlayout.addWidget(self.tabw) + + def init_tabs(self): + """ + create tabs + """ + #queue + self.tabs["queue"]["l"] = QGridLayout() + self.tabs["queue"]["w"].setLayout(self.tabs["queue"]["l"]) + self.tabs["queue"]["view"] = QTreeWidget() + self.tabs["queue"]["l"].addWidget(self.tabs["queue"]["view"]) + + #collector_packages + self.tabs["collector_packages"]["l"] = QGridLayout() + self.tabs["collector_packages"]["w"].setLayout(self.tabs["collector_packages"]["l"]) + self.tabs["collector_packages"]["treewidget"] = QTreeWidget() + self.tabs["collector_packages"]["l"].addWidget(self.tabs["collector_packages"]["treewidget"]) + + #collector_links + self.tabs["collector_links"]["l"] = QGridLayout() + self.tabs["collector_links"]["w"].setLayout(self.tabs["collector_links"]["l"]) + self.tabs["collector_links"]["listwidget"] = QListWidget() + self.tabs["collector_links"]["l"].addWidget(self.tabs["collector_links"]["listwidget"]) diff --git a/module/gui/PWInputWindow.py b/module/gui/PWInputWindow.py new file mode 100644 index 000000000..4fc834c4f --- /dev/null +++ b/module/gui/PWInputWindow.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class PWInputWindow(QWidget): + def __init__(self): + QWidget.__init__(self) + self.input = QLineEdit() + self.input.setEchoMode(QLineEdit.Password) + label = QLabel("Password:") + ok = QPushButton("OK") + cancel = QPushButton("Cancel") + grid = QGridLayout() + grid.addWidget(label, 0, 0, 1, 2) + grid.addWidget(self.input, 1, 0, 1, 2) + grid.addWidget(cancel, 2, 0) + grid.addWidget(ok, 2, 1) + self.setLayout(grid) + + self.connect(ok, SIGNAL("clicked()"), self.slotOK) + self.connect(cancel, SIGNAL("clicked()"), self.slotCancel) + self.connect(self.input, SIGNAL("returnPressed()"), self.slotOK) + + def slotOK(self): + self.hide() + self.emit(SIGNAL("ok"), self.input.text()) + + def slotCancel(self): + self.hide() + self.emit(SIGNAL("cancel")) diff --git a/module/gui/Queue.py b/module/gui/Queue.py new file mode 100644 index 000000000..7e63e6180 --- /dev/null +++ b/module/gui/Queue.py @@ -0,0 +1,252 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +from time import sleep + +class Queue(QThread): + def __init__(self, view, connector): + QThread.__init__(self) + self.view = view + self.connector = connector + self.statusMap = { + "finished": 0, + "checking": 1, + "waiting": 2, + "reconnected": 3, + "downloading": 4, + "failed": 5, + "aborted": 6, + } + self.statusMapReverse = dict((v,k) for k, v in self.statusMap.iteritems()) + self.queue = [] + self.interval = 2 + self.running = True + self.mutex = QMutex() + + def run(self): + while self.running: + self.update() + sleep(self.interval) + + def update(self): + locker = QMutexLocker(self.mutex) + packs = self.connector.getPackageQueue() + downloading_raw = self.connector.getDownloadQueue() + downloading = {} + for d in downloading: + did = d["id"] + del d["id"] + del d["name"] + del d["status"] + downloading[did] = d + for data in packs: + pack = self.getPack(data["id"]) + if not pack: + pack = self.QueuePack(self) + pack.setData(data) + self.addPack(data["id"], pack) + files = self.connector.getPackageFiles(data["id"]) + for fid in files: + info = self.connector.getLinkInfo(fid) + child = pack.getChild(fid) + if not child: + child = self.QueueFile(self, pack) + try: + info["downloading"] = downloading[data["id"]] + except: + info["downloading"] = None + child.setData(info) + pack.addChild(fid, child) + + def addPack(self, pid, newPack): + pos = None + try: + for k, pack in enumerate(self.queue): + if pack.getData()["id"] == pid: + pos = k + break + if pos == None: + raise Exception() + self.queue[pos] = newPack + except: + self.queue.append(newPack) + pos = self.queue.index(newPack) + item = self.view.topLevelItem(pos) + if not item: + item = QTreeWidgetItem() + self.view.insertTopLevelItem(pos, item) + item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) + status = -1 + for child in newPack.getChildren(): + if self.statusMap.has_key(child.data["status_type"]) and self.statusMap[child.data["status_type"]] > status: + status = self.statusMap[child.data["status_type"]] + if status >= 0: + item.setData(1, Qt.DisplayRole, QVariant(self.statusMapReverse[status])) + item.setData(0, Qt.UserRole, QVariant(pid)) + item.setData(2, Qt.UserRole, QVariant(newPack)) + + def getPack(self, pid): + for k, pack in enumerate(self.queue): + if pack.getData()["id"] == pid: + return pack + return None + + def getProgress(self, q): + locker = QMutexLocker(self.mutex) + if isinstance(q, self.QueueFile): + data = q.getData() + if data["downloading"]: + return int(data["downloading"]["percent"]) + if data["status_type"] == "finished" or \ + data["status_type"] == "failed" or \ + data["status_type"] == "aborted": + return 100 + elif isinstance(q, self.QueuePack): + children = q.getChildren() + count = len(children) + perc_sum = 0 + for child in children: + val = 0 + data = child.getData() + if data["downloading"]: + val = int(data["downloading"]["percent"]) + elif child.data["status_type"] == "finished" or \ + child.data["status_type"] == "failed" or \ + child.data["status_type"] == "aborted": + val = 100 + perc_sum += val + if count == 0: + return 0 + return perc_sum/count + return 0 + + def getSpeed(self, q): + locker = QMutexLocker(self.mutex) + if isinstance(q, self.QueueFile): + data = q.getData() + if data["downloading"]: + return int(data["downloading"]["speed"]) + elif isinstance(q, self.QueuePack): + children = q.getChildren() + count = len(children) + speed_sum = 0 + for child in children: + val = 0 + data = child.getData() + running = False + if data["downloading"]: + val = int(data["downloading"]["speed"]) + running = True + speed_sum += val + if count == 0 or not running: + return None + return speed_sum + return None + + class QueuePack(): + def __init__(self, queue): + self.queue = queue + self.data = [] + self.children = [] + + def addChild(self, cid, newChild): + pos = None + try: + for k, child in enumerate(self.getChildren()): + if child.getData()["id"] == cid: + pos = k + break + if pos == None: + raise Exception() + self.children[pos] = newChild + except: + self.children.append(newChild) + pos = self.children.index(newChild) + ppos = self.queue.queue.index(self) + parent = self.queue.view.topLevelItem(ppos) + item = parent.child(pos) + if not item: + item = QTreeWidgetItem() + parent.insertChild(pos, item) + status = "%s (%s)" % (newChild.getData()["status_type"], newChild.getData()["plugin"]) + item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) + item.setData(1, Qt.DisplayRole, QVariant(status)) + item.setData(0, Qt.UserRole, QVariant(cid)) + item.setData(2, Qt.UserRole, QVariant(newChild)) + + def getChildren(self): + return self.children + + def getChild(self, cid): + try: + return self.children[cid] + except: + return None + + def hasChildren(self, data): + return (len(self.children) > 0) + + def setData(self, data): + self.data = data + + def getData(self): + return self.data + + class QueueFile(): + def __init__(self, queue, pack): + self.queue = queue + self.pack = pack + + def getData(self): + return self.data + + def setData(self, data): + self.data = data + + def getPack(self): + return self.pack + +class QueueProgressBarDelegate(QItemDelegate): + def __init__(self, parent, queue): + QItemDelegate.__init__(self, parent) + self.queue = queue + + def paint(self, painter, option, index): + if index.column() == 2: + qe = index.data(Qt.UserRole).toPyObject() + progress = self.queue.getProgress(qe) + opts = QStyleOptionProgressBarV2() + opts.maximum = 100 + opts.minimum = 0 + opts.progress = progress + opts.rect = option.rect + opts.rect.setRight(option.rect.right()-1) + opts.rect.setHeight(option.rect.height()-1) + opts.textVisible = True + opts.textAlignment = Qt.AlignCenter + speed = self.queue.getSpeed(qe) + if speed == None: + opts.text = QString.number(opts.progress) + "%" + else: + opts.text = QString("%s kb/s - %s" % (speed, opts.progress)) + "%" + QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter) + return + QItemDelegate.paint(self, painter, option, index) diff --git a/module/gui/XMLParser.py b/module/gui/XMLParser.py new file mode 100644 index 000000000..0e3b4e59f --- /dev/null +++ b/module/gui/XMLParser.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * +from PyQt4.QtXml import * + +import os + +class XMLParser(): + def __init__(self, data, dfile=""): + self.mutex = QMutex() + self.mutex.lock() + self.xml = QDomDocument() + self.file = data + self.dfile = dfile + self.mutex.unlock() + self.loadData() + self.root = self.xml.documentElement() + + def loadData(self): + self.mutex.lock() + f = self.file + if not os.path.exists(f): + f = self.dfile + with open(f, 'r') as fh: + content = fh.read() + self.xml.setContent(content) + self.mutex.unlock() + + def saveData(self): + self.mutex.lock() + content = self.xml.toString() + with open(self.file, 'w') as fh: + fh.write(content) + self.mutex.unlock() + return content + + def parseNode(self, node, ret_type="list"): + if ret_type == "dict": + childNodes = {} + else: + childNodes = [] + child = node.firstChild() + while True: + n = child.toElement() + if n.isNull(): + break + else: + if ret_type == "dict": + childNodes[str(n.tagName())] = n + else: + childNodes.append(n) + child = child.nextSibling() + return childNodes diff --git a/module/gui/__init__.py b/module/gui/__init__.py new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/module/gui/__init__.py @@ -0,0 +1 @@ + diff --git a/module/gui/connector.py b/module/gui/connector.py new file mode 100644 index 000000000..e4fd4770c --- /dev/null +++ b/module/gui/connector.py @@ -0,0 +1,146 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +SERVER_VERSION = "0.3" + +from time import sleep + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +from xmlrpclib import ServerProxy + +class connector(QThread): + def __init__(self): + """ + init thread + """ + QThread.__init__(self) + self.mutex = QMutex() + self.running = True + self.proxy = None + self.addr = None + + def setAddr(self, addr): + self.mutex.lock() + self.addr = addr + self.mutex.unlock() + + def run(self): + """ + start thread + (called from thread.start()) + """ + self.connectProxy(self.addr) + while self.running: + sleep(1) + + def stop(self): + """ + stop thread + """ + self.running = False + + def connectProxy(self, addr): + """ + connect to remote server + """ + self.proxy = ServerProxy(addr, allow_none=True) + server_version = self.proxy.get_server_version() + if not server_version == SERVER_VERSION: + self.emit(SIGNAL("error_box"), "server is version %s client accepts version %s" % (server_version, SERVER_VERSION)) + + def getLinkCollector(self): + """ + grab links from collector and return the ids + """ + self.mutex.lock() + try: + return self.proxy.get_collector_files() + finally: + self.mutex.unlock() + + def getPackageCollector(self): + """ + grab packages from collector and return the data + """ + self.mutex.lock() + try: + return self.proxy.get_collector_packages() + finally: + self.mutex.unlock() + + def getLinkInfo(self, id): + """ + grab file info for the given id and return it + """ + self.mutex.lock() + try: + return self.proxy.get_file_info(id) + finally: + self.mutex.unlock() + + def getPackageInfo(self, id): + """ + grab package info for the given id and return it + """ + self.mutex.lock() + try: + return self.proxy.get_package_data(id) + finally: + self.mutex.unlock() + + def getPackageQueue(self): + """ + grab queue return the data + """ + self.mutex.lock() + try: + return self.proxy.get_queue() + finally: + self.mutex.unlock() + + def getPackageFiles(self, id): + """ + grab package files and return ids + """ + self.mutex.lock() + try: + return self.proxy.get_package_files(id) + finally: + self.mutex.unlock() + + def getDownloadQueue(self): + """ + grab files that are currently downloading and return info + """ + self.mutex.lock() + try: + return self.proxy.status_downloads() + finally: + self.mutex.unlock() + + def getServerStatus(self): + """ + return server status + """ + self.mutex.lock() + try: + return self.proxy.status_server() + finally: + self.mutex.unlock() -- cgit v1.2.3 From d63ba825e039fbfd78d87b07efb7fdff0fdebeeb Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 17 Dec 2009 18:47:06 +0100 Subject: fixed QueueManager --- module/gui/ConnectionManager.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module') diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index a7f2aaf38..c997eee19 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -19,6 +19,8 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * +from uuid import uuid4 as uuid + class ConnectionManager(QWidget): def __init__(self): QWidget.__init__(self) -- cgit v1.2.3 From d39d51044b8b36a0dae2bda3214f5be554654b9a Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 17 Dec 2009 19:12:25 +0100 Subject: Fixed Megaupload, need better captcha detection --- module/plugins/MegauploadCom.py | 18 +++++++++++++++--- module/plugins/RapidshareCom.py | 4 +--- 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/plugins/MegauploadCom.py b/module/plugins/MegauploadCom.py index 3736503c0..db1859db7 100644 --- a/module/plugins/MegauploadCom.py +++ b/module/plugins/MegauploadCom.py @@ -4,6 +4,7 @@ import os import re import tempfile +from time import time from module.Plugin import Plugin @@ -21,6 +22,8 @@ class MegauploadCom(Plugin): props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent + self.time_plus_wait = None #time() + wait in seconds + self.html = [None, None] self.want_reconnect = False self.init_ocr() @@ -31,18 +34,24 @@ class MegauploadCom(Plugin): captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name - for i in range(5): + got_captcha = False + + for i in range(10): self.html[0] = self.req.load(url, cookies=True) url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) self.req.download(url_captcha_html, captcha_image, cookies=True) captcha = self.ocr.get_captcha(captcha_image) + os.remove(captcha_image) captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1) megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1) self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) if re.search(r"Waiting time before each download begins", self.html[1]) != None: + got_captcha = True break + self.time_plus_wait = time() + 45 + if not got_captcha: + raise "Fuckin captcha to hard" - os.remove(captcha_image) def get_file_url(self): """ returns the absolute downloadable filepath @@ -52,7 +61,7 @@ class MegauploadCom(Plugin): if not self.want_reconnect: file_url_pattern = 'id="downloadlink"><a href="(.*)" onclick="' search = re.search(file_url_pattern, self.html[1]) - return search.group(1) + return search.group(1).replace(" ", "%20") else: return False @@ -75,3 +84,6 @@ class MegauploadCom(Plugin): return False else: return True + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index c4e1f8ef9..615dda521 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -38,9 +38,7 @@ class RapidshareCom(Plugin): def prepare(self, thread): pyfile = self.parent - - self.want_reconnect = False - + self.download_api_data() if self.api_data["status"] == "1": pyfile.status.filename = self.get_file_name() -- cgit v1.2.3 From a9ca2d6f303f38bd2d8171b6d801b20df8cc609f Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 17 Dec 2009 19:50:28 +0100 Subject: better Megaupload captcha detection, fixed #38 --- module/captcha/MegauploadCom.py | 1 - module/plugins/MegauploadCom.py | 8 +------- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'module') diff --git a/module/captcha/MegauploadCom.py b/module/captcha/MegauploadCom.py index 40939c792..374bcd678 100644 --- a/module/captcha/MegauploadCom.py +++ b/module/captcha/MegauploadCom.py @@ -6,7 +6,6 @@ class MegauploadCom(OCR): def get_captcha(self, image): self.load_image(image) - self.threshold(2.8) self.run_tesser() return self.result_captcha diff --git a/module/plugins/MegauploadCom.py b/module/plugins/MegauploadCom.py index db1859db7..3eb21a591 100644 --- a/module/plugins/MegauploadCom.py +++ b/module/plugins/MegauploadCom.py @@ -33,10 +33,8 @@ class MegauploadCom(Plugin): url = self.parent.url captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name - - got_captcha = False - for i in range(10): + for i in range(5): self.html[0] = self.req.load(url, cookies=True) url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) self.req.download(url_captcha_html, captcha_image, cookies=True) @@ -46,12 +44,8 @@ class MegauploadCom(Plugin): megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1) self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) if re.search(r"Waiting time before each download begins", self.html[1]) != None: - got_captcha = True break self.time_plus_wait = time() + 45 - if not got_captcha: - raise "Fuckin captcha to hard" - def get_file_url(self): """ returns the absolute downloadable filepath -- cgit v1.2.3 From d08271cbb66f3ccbd8f3c5cf707008388ff4297e Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 17 Dec 2009 21:33:13 +0100 Subject: new xml config for core --- module/XMLConfigParser.py | 92 +++++++++++++++++++++++++++++++++++++++++++ module/config/core.xml | 58 +++++++++++++++++++++++++++ module/config/gui_default.xml | 7 ++++ module/web/settings.py | 9 +++-- 4 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 module/XMLConfigParser.py create mode 100644 module/config/core.xml create mode 100644 module/config/gui_default.xml (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py new file mode 100644 index 000000000..1bd5e3417 --- /dev/null +++ b/module/XMLConfigParser.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from xml.dom.minidom import parse + +class XMLConfigParser(): + def __init__(self, data): + self.xml = None + self.file = data + self.config = {} + self.loadData() + self.root = None + + def loadData(self): + with open(self.file, 'r') as fh: + self.xml = parse(fh) + self._read_config() + + def saveData(self): + with open(self.file, 'w') as fh: + self.xml.writexml(fh) + + def _read_config(self): + def format(val): + if val.lower() == "true": + return True + elif val.lower() == "false": + return False + else: + return val + root = self.xml.documentElement + self.root = root + config = {} + for node in root.childNodes: + if node.nodeType == node.ELEMENT_NODE: + section = node.tagName + config[section] = {} + for opt in node.childNodes: + if opt.nodeType == opt.ELEMENT_NODE: + config[section][opt.tagName] = format(opt.firstChild.data) + self.config = config + + def get(self, section, option, default=None): + try: + return self.config[section][option] + except: + return default + + def getConfig(self): + return self.config + + def set(self, section, option, value): + root = self.root + replace = False + sectionNode = False + for node in root.childNodes: + if node.nodeType == node.ELEMENT_NODE: + if section == node.tagName: + sectionNode = node + for opt in node.childNodes: + if opt.nodeType == opt.ELEMENT_NODE: + if option == opt.tagName: + replace = opt + text = self.createTextNode(value) + if replace: + replace.replaceChild(text, replace.firstChild) + else: + newNode = self.createElement(option) + newNode.appendChild(text) + if sectionNode: + sectionNode.appendChild(newNode) + else: + newSection = self.createElement(section) + newSection.appendChild(newNode) + root.appendChild(newSection) + self.saveData() + self.loadData() diff --git a/module/config/core.xml b/module/config/core.xml new file mode 100644 index 000000000..891856c00 --- /dev/null +++ b/module/config/core.xml @@ -0,0 +1,58 @@ +<config> + <remote> + <port>7227</port> + <listenaddr>0.0.0.0</listenaddr> + <username>admin</username> + <password>pwhere</password> + </remote> + <ssl> + <activated>False</activated> + <cert>ssl.srt</cert> + <key>ssl.key</key> + </ssl> + <webinterface> + <activated>True</activated> + <host>127.0.0.1</host> + <port>8000</port> + <template>default</template> + <local>True</local> + <ssl>None</ssl> + <username>None</username> + <adress>None</adress> + <extport>None</extport> + <pw>None</pw> + </webinterface> + <log> + <file_log>True</file_log> + <log_folder>Logs</log_folder> + <log_count>5</log_count> + </log> + <general> + <language>de</language> + <download_folder>Downloads</download_folder> + <max_downloads>3</max_downloads> + <use_reconnect>False</use_reconnect> + <link_file>links.txt</link_file> + <failed_file>failed_links.txt</failed_file> + <reconnect_method>reconnect_method</reconnect_method> + <debug_mode>False</debug_mode> + <max_download_time>5</max_download_time> + </general> + <updates> + <search_updates>True</search_updates> + <install_updates>False</install_updates> + </updates> + <reconnectTime> + <start>0:00</start> + <end>0:00</end> + </reconnectTime> + <downloadTime> + <start>0:00</start> + <end>0:00</end> + </downloadTime> + <proxy> + <activated>False</activated> + <adress>http://localhost:8080</adress> + <protocol>http</protocol> + </proxy> +</config> diff --git a/module/config/gui_default.xml b/module/config/gui_default.xml new file mode 100644 index 000000000..af38eda4c --- /dev/null +++ b/module/config/gui_default.xml @@ -0,0 +1,7 @@ +<root> + <connections> + <connection default="True" type="local" id="33965310e19b4a869112c43b39a16440"> + <name>Local</name> + </connection> + </connections> +</root> diff --git a/module/web/settings.py b/module/web/settings.py index 2695b0648..2c7f4ecd8 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -4,8 +4,8 @@ DEBUG = True TEMPLATE_DEBUG = DEBUG -import ConfigParser import os.path +import sys from os import chdir from os.path import dirname from os.path import abspath @@ -17,11 +17,12 @@ SERVER_VERSION = "0.3" PROJECT_DIR = os.path.dirname(__file__) #chdir(dirname(abspath(__file__)) + sep) -config = ConfigParser.SafeConfigParser() PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") -config.read(os.path.join(PYLOAD_DIR,"config")) +sys.path.append(os.path.join(PYLOAD_DIR, "module")) +from XMLConfigParser import XMLConfigParser +config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml")) ssl = "" @@ -132,4 +133,4 @@ INSTALLED_APPS = ( AUTH_PROFILE_MODULE = 'pyload.UserProfile' -LOGIN_URL = '/login' \ No newline at end of file +LOGIN_URL = '/login' -- cgit v1.2.3 From e17c410d4c0fcd6c9c59368e1472cdc524617dc1 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 17 Dec 2009 21:53:59 +0100 Subject: fixed with statement (python2.5) --- module/XMLConfigParser.py | 1 + module/gui/XMLParser.py | 1 + 2 files changed, 2 insertions(+) (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 1bd5e3417..b46f9c959 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -15,6 +15,7 @@ @author: mkaay """ +from __future__ import with_statement from xml.dom.minidom import parse diff --git a/module/gui/XMLParser.py b/module/gui/XMLParser.py index 0e3b4e59f..5e3b7bf65 100644 --- a/module/gui/XMLParser.py +++ b/module/gui/XMLParser.py @@ -15,6 +15,7 @@ @author: mkaay """ +from __future__ import with_statement from PyQt4.QtCore import * from PyQt4.QtGui import * -- cgit v1.2.3 From 5fea358c45d2f04ca7dcec3521f3b7cddeccf3ee Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Thu, 17 Dec 2009 22:14:36 +0100 Subject: webinterface host for everyone --- module/config/core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/config/core.xml b/module/config/core.xml index 891856c00..6da85cf32 100644 --- a/module/config/core.xml +++ b/module/config/core.xml @@ -12,7 +12,7 @@ </ssl> <webinterface> <activated>True</activated> - <host>127.0.0.1</host> + <host>0.0.0.0</host> <port>8000</port> <template>default</template> <local>True</local> -- cgit v1.2.3 From 76d7aa1a4586db944353f613a52a790e0d97316b Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Thu, 17 Dec 2009 22:25:30 +0100 Subject: I have now django 1.1.1 ^^ --- module/web/pyload.db | Bin 39936 -> 41984 bytes module/web/urls.py | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/web/pyload.db b/module/web/pyload.db index bd9c5b257..b2b4206b0 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/urls.py b/module/web/urls.py index 3d3295efd..2145a8dd4 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -14,7 +14,7 @@ urlpatterns = patterns('', # to INSTALLED_APPS to enable admin documentation: # (r'^admin/doc/', include('django.contrib.admindocs.urls')), - # (r'^admin/', include(admin.site.urls)), # django 1.0 not working + (r'^admin/', include(admin.site.urls)), # django 1.0 not working (r'^json/', include('ajax.urls')), (r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': '/media/img/favicon.ico'}), (r'^media/(?P<path>.*)$', 'django.views.static.serve', -- cgit v1.2.3 From 70cd6a9f822308a416fefb051c4bbb83e6fd37e4 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 17 Dec 2009 22:56:56 +0100 Subject: create only one links.txt package --- module/thread_list.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index c486ad8ee..1020f9ce1 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -107,16 +107,14 @@ class Thread_List(object): if pyfile.status.type == "finished": if pyfile.plugin.props['type'] == "container": - #works(!) but adds many packs to queue - self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"]) newLinks = 0 if pyfile.plugin.links: - newPackager = self.list.packager.addNewPackage(pyfile.status.filename) for link in pyfile.plugin.links: newFile = self.list.collector.addLink(link) - self.list.packager.addFileToPackage(newPackager, self.list.collector.popFile(newFile)) + self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile)) newLinks += 1 - self.list.packager.pushPackage2Queue(newPackager) + self.list.packager.pushPackage2Queue(pyfile.package.data["id"]) + self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"]) if newLinks: self.parent.logger.info("Parsed link from %s: %i" % (pyfile.status.filename, newLinks)) -- cgit v1.2.3 From 2f3cc86bc06d55abc4f6fb55ee38eb5b83366335 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 17 Dec 2009 23:10:14 +0100 Subject: Removed prints --- module/config/core.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/config/core.xml b/module/config/core.xml index 6da85cf32..392309e1c 100644 --- a/module/config/core.xml +++ b/module/config/core.xml @@ -11,7 +11,7 @@ <key>ssl.key</key> </ssl> <webinterface> - <activated>True</activated> + <activated>False</activated> <host>0.0.0.0</host> <port>8000</port> <template>default</template> -- cgit v1.2.3 From a9a0ab594e4ea05532ff089b8eee7bf20ea571be Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 17 Dec 2009 23:52:22 +0100 Subject: new web JSON functions --- module/web/ajax/urls.py | 5 ++++- module/web/ajax/views.py | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index d1c90aa21..9849004d1 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -14,8 +14,11 @@ urlpatterns = patterns('ajax', # Uncomment the next line to enable the admin: (r'^add_package$', 'views.add_package'), (r'^status$', 'views.status'), - (r'^links$', 'views.links'), + (r'^links$', 'views.links'), #currently active links (r'^queue$', 'views.queue'), (r'^pause$', 'views.pause'), (r'^unpause$', 'views.unpause'), + (r'^packages$', 'views.packages'), + (r'^package/(\d+)$', 'views.package'), + (r'^link/(\d+)$', 'views.link'), ) \ No newline at end of file diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 05c91597f..584ad1a0e 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -78,3 +78,42 @@ def unpause(request): except: return HttpResponseServerError() + + + +@permission('pyload.can_see_dl') +def packages(request): + try: + data = settings.PYLOAD.get_queue() + + for package in data: + package['links'] = [] + for file in settings.PYLOAD.get_package_files(package['id']): + package['links'].append(settings.PYLOAD.get_file_info(file)) + + return JsonResponse(data) + + except: + return HttpResponseServerError() + +@permission('pyload.can_see_dl') +def package(request,id): + try: + data = settings.PYLOAD.get_package_data(int(id)) + data['links'] = [] + for file in settings.PYLOAD.get_package_files(data['id']): + data['links'].append(settings.PYLOAD.get_file_info(file)) + + return JsonResponse(data) + + except: + return HttpResponseServerError() + +@permission('pyload.can_see_dl') +def link(request,id): + try: + data = settings.PYLOAD.get_file_info(int(id)) + return JsonResponse(data) + + except: + return HttpResponseServerError() -- cgit v1.2.3 From 1d7dc2ca5db0119e01547cd7b01fb77720450d1c Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 19 Dec 2009 00:26:38 +0100 Subject: cleaned --- module/network/Request.py | 5 +---- module/plugins/FilefactoryCom.py | 1 - module/web/ServerThread.py | 3 +-- module/web/ajax/models.py | 1 - module/web/ajax/urls.py | 1 - module/web/ajax/views.py | 1 - module/web/pyload/views.py | 1 - module/web/settings.py | 4 ---- module/web/urls.py | 1 - 9 files changed, 2 insertions(+), 16 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index c6127c20b..7cdae7c0f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -5,16 +5,13 @@ """ authored by: RaNaN, Spoob """ -import os import base64 import cookielib from gzip import GzipFile import time -import re from os import sep, rename -from os.path import dirname, exists +from os.path import exists import urllib -from base64 import b64decode from cStringIO import StringIO try: diff --git a/module/plugins/FilefactoryCom.py b/module/plugins/FilefactoryCom.py index ff069b20f..5b7db301d 100644 --- a/module/plugins/FilefactoryCom.py +++ b/module/plugins/FilefactoryCom.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import re -import urllib from module.Plugin import Plugin from time import time diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 790ac152b..6113ac297 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import threading -import os from os.path import join import subprocess @@ -19,4 +18,4 @@ class WebServer(threading.Thread): except Exception, e: print e #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) - #@TODO: better would be real python code \ No newline at end of file + #@TODO: better would be real python code diff --git a/module/web/ajax/models.py b/module/web/ajax/models.py index 71a836239..35e0d6486 100644 --- a/module/web/ajax/models.py +++ b/module/web/ajax/models.py @@ -1,3 +1,2 @@ -from django.db import models # Create your models here. diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 9849004d1..2a7e109c3 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- from django.conf.urls.defaults import * -from django.conf import settings urlpatterns = patterns('ajax', diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 584ad1a0e..b09a80581 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -3,7 +3,6 @@ from django.http import HttpResponse from django.http import HttpResponseForbidden from django.http import HttpResponseServerError from django.conf import settings -from django.shortcuts import render_to_response from django.utils import simplejson from django.core.serializers import json diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 0cdc87873..904e312e7 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,7 +1,6 @@ # Create your views here. import mimetypes from django.http import HttpResponse -from django.http import HttpResponseRedirect from django.http import HttpResponseNotFound from django.conf import settings from django.shortcuts import render_to_response diff --git a/module/web/settings.py b/module/web/settings.py index 2c7f4ecd8..894583aa4 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -6,10 +6,6 @@ TEMPLATE_DEBUG = DEBUG import os.path import sys -from os import chdir -from os.path import dirname -from os.path import abspath -from os import sep import xmlrpclib SERVER_VERSION = "0.3" diff --git a/module/web/urls.py b/module/web/urls.py index 2145a8dd4..1392b827a 100644 --- a/module/web/urls.py +++ b/module/web/urls.py @@ -3,7 +3,6 @@ from django.conf.urls.defaults import * from django.contrib import admin from django.conf import settings -from os.path import join admin.autodiscover() -- cgit v1.2.3 From adcc953b4dd2dce1f91bd7cd11105e9f0653f704 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 19 Dec 2009 15:13:10 +0100 Subject: fixed reconnect --- module/config/core.xml | 2 +- module/thread_list.py | 1 + module/web/pyload/views.py | 13 +++++++++---- module/web/templates/default/base.html | 4 ++-- 4 files changed, 13 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/config/core.xml b/module/config/core.xml index 392309e1c..6da85cf32 100644 --- a/module/config/core.xml +++ b/module/config/core.xml @@ -11,7 +11,7 @@ <key>ssl.key</key> </ssl> <webinterface> - <activated>False</activated> + <activated>True</activated> <host>0.0.0.0</host> <port>8000</port> <template>default</template> diff --git a/module/thread_list.py b/module/thread_list.py index 1020f9ce1..52d06aae4 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -110,6 +110,7 @@ class Thread_List(object): newLinks = 0 if pyfile.plugin.links: for link in pyfile.plugin.links: + print link newFile = self.list.collector.addLink(link) self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile)) newLinks += 1 diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 904e312e7..a51a9c4dc 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -51,6 +51,11 @@ def permission(perm): return _dec + +def status_proc(request): + return {'status': settings.PYLOAD.status_server()} + + def base(request, messages): return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) @@ -58,14 +63,14 @@ def base(request, messages): @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{},[status_proc])) @login_required @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request,{},[status_proc])) @login_required @@ -94,7 +99,7 @@ def downloads(request): data['files'].append(item) - return render_to_response(join(settings.TEMPLATE,'downloads.html'), {'files': data}, RequestContext(request)) + return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request,{'files': data},[status_proc])) @login_required @permission('pyload.user.can_download') @@ -132,4 +137,4 @@ def download(request,path): @permission('pyload.user.can_see_logs') @check_server def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request)) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{},[status_proc])) \ No newline at end of file diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 46e9caa11..307dd821a 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -108,8 +108,8 @@ $(document).ready(function(){ {% if perms.pyload.can_see_dl %} <ul id="page-actions"> - <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">0</b> kb/s</a></li> - <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">0</b> / <b id="aktiv_from">0</b></a></li> + <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> + <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} -- cgit v1.2.3 From c521e6445bc8e6b91440813b90d1fdedd76c9721 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 19 Dec 2009 15:25:50 +0100 Subject: real reconnect fix ;-) --- module/thread_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index 52d06aae4..6a42898be 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -149,7 +149,7 @@ class Thread_List(object): def init_reconnect(self): """initialise a reonnect""" - if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.is_reconnect_time(): + if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return False if not exists(self.parent.config['general']['reconnect_method']): -- cgit v1.2.3 From 2b6db7950916f29eea39224104fed284ad4222c7 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sat, 19 Dec 2009 17:14:05 +0100 Subject: active download list 40% --- module/web/pyload.db | Bin 41984 -> 41984 bytes module/web/templates/default/base.html | 151 +++++++++++++++++++++++++++++++-- module/web/templates/default/home.html | 29 +++++-- 3 files changed, 166 insertions(+), 14 deletions(-) (limited to 'module') diff --git a/module/web/pyload.db b/module/web/pyload.db index b2b4206b0..3305b02ef 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 307dd821a..f9ea8c3a2 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -11,10 +11,133 @@ {% endblock %} <title>{% block title %}pyLoad Webinterface{% endblock %}</title> <script type="text/javascript"> +sprintfWrapper = { + + init : function () { + + if (typeof arguments == "undefined") { return null; } + if (arguments.length < 1) { return null; } + if (typeof arguments[0] != "string") { return null; } + if (typeof RegExp == "undefined") { return null; } + + var string = arguments[0]; + var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); + var matches = new Array(); + var strings = new Array(); + var convCount = 0; + var stringPosStart = 0; + var stringPosEnd = 0; + var matchPosEnd = 0; + var newString = ''; + var match = null; + + while (match = exp.exec(string)) { + if (match[9]) { convCount += 1; } + + stringPosStart = matchPosEnd; + stringPosEnd = exp.lastIndex - match[0].length; + strings[strings.length] = string.substring(stringPosStart, stringPosEnd); + + matchPosEnd = exp.lastIndex; + matches[matches.length] = { + match: match[0], + left: match[3] ? true : false, + sign: match[4] || '', + pad: match[5] || ' ', + min: match[6] || 0, + precision: match[8], + code: match[9] || '%', + negative: parseInt(arguments[convCount]) < 0 ? true : false, + argument: String(arguments[convCount]) + }; + } + strings[strings.length] = string.substring(matchPosEnd); + + if (matches.length == 0) { return string; } + if ((arguments.length - 1) < convCount) { return null; } + + var code = null; + var match = null; + var i = null; + + for (i=0; i<matches.length; i++) { + + if (matches[i].code == '%') { substitution = '%' } + else if (matches[i].code == 'b') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'c') { + matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'd') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'f') { + matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'o') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 's') { + matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'x') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'X') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); + } + else { + substitution = matches[i].match; + } + + newString += strings[i]; + newString += substitution; + + } + newString += strings[i]; + + return newString; + + }, + + convert : function(match, nosign){ + if (nosign) { + match.sign = ''; + } else { + match.sign = match.negative ? '-' : match.sign; + } + var l = match.min - match.argument.length + 1 - match.sign.length; + var pad = new Array(l < 0 ? 0 : l).join(match.pad); + if (!match.left) { + if (match.pad == "0" || nosign) { + return match.sign + pad + match.argument; + } else { + return pad + match.sign + match.argument; + } + } else { + if (match.pad == "0" || nosign) { + return match.sign + match.argument + pad.replace(/0/g, ' '); + } else { + return match.sign + match.argument + pad; + } + } + } +} + +sprintf = sprintfWrapper.init; function LoadJsonToContent(data) { JSONDATA = data; - $("#speed").text(Math.round(data.speed/0.01)*0.01); + $("#speed").text(Math.round(data.speed*100)/100); $("#aktiv").text(data.queue); $("#aktiv_from").text(data.total); @@ -28,6 +151,25 @@ function LoadJsonToContent(data) $("#action_play").show(); $("#action_pause").hide(); }*/ + setTimeout(function() + { + $.getJSON('/json/status', LoadJsonToContent ); + }, 2000); +} +function LinksToContent(data) +{ + $("#LinksAktiv").text(''); + $.each(data, function(i,item) + { + $("#LinksAktiv").append('<tr><td>'+item.name+'</td><td>'+item.status+'</td><td>'+Math.round(item.speed*100)/100+'@'+SecToRightTime(item.eta)+'</td><td>'+item.size+' MB</td><td>'+item.percent+'% / '+item.kbleft+' MB</td></tr>'); + }); + +} +function SecToRightTime(sek) +{ + vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : ''; + vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 ); + return vreturn; } $(document).ready(function(){ @@ -43,11 +185,8 @@ $(document).ready(function(){ { // mouseout $(this).attr("id", ""); });*/ - var refreshId = setInterval(function() - { - $.getJSON('/json/status', LoadJsonToContent ); - }, 1000); - + $.getJSON('/json/links', LinksToContent ); + $.getJSON('/json/status', LoadJsonToContent ); }); </script> </head> diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index fac4b6e63..ac9c5d25c 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1,9 +1,22 @@ -{% extends 'default/base.html' %} - -{% block subtitle %} -Active Downloads -{% endblock %} - - -{% block content %} +{% extends 'default/base.html' %} + +{% block subtitle %} +Active Downloads +{% endblock %} + + + +{% block content %} +<table> +<tbody id="LinksAktiv"> + <tr> + <td></td> + <td></td> + <td></td> + <td></td> + <td></td> + </tr> +<tbody> +</table> + {% endblock %} \ No newline at end of file -- cgit v1.2.3 From f7f83692039997e1988cc6fae53676856668444b Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 19 Dec 2009 19:07:17 +0100 Subject: Fixed Netload, no Premium --- module/config/core.xml | 2 +- module/plugins/NetloadIn.py | 136 +++++++++++++++++++++------------------- module/plugins/RapidshareCom.py | 14 +++-- module/thread_list.py | 1 - 4 files changed, 81 insertions(+), 72 deletions(-) (limited to 'module') diff --git a/module/config/core.xml b/module/config/core.xml index 6da85cf32..392309e1c 100644 --- a/module/config/core.xml +++ b/module/config/core.xml @@ -11,7 +11,7 @@ <key>ssl.key</key> </ssl> <webinterface> - <activated>True</activated> + <activated>False</activated> <host>0.0.0.0</host> <port>8000</port> <template>default</template> diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py index b9fb4cfed..e90124f10 100644 --- a/module/plugins/NetloadIn.py +++ b/module/plugins/NetloadIn.py @@ -37,46 +37,30 @@ class NetloadIn(Plugin): def prepare(self, thread): pyfile = self.parent + self.req.clear_cookies() - self.want_reconnect = False - - tries = 0 - - while not pyfile.status.url: - - self.req.clear_cookies() - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - self.download_api_data() - + self.download_api_data() + if self.file_exists(): pyfile.status.filename = self.get_file_name() - + if self.config['premium']: + self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url + #@TODO: premium?? return True - - self.download_html2() - - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - pyfile.status.url = self.get_file_url() - - tries += 1 - if tries > 3: - raise Exception, "Error while preparing DL, HTML dump: %s %s" % (self.html[0], self.html[1]) + self.download_html() + while not pyfile.status.url: + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + thread.wait(self.parent) + + pyfile.status.url = self.get_file_url() - return True - + else: + raise Exception, "The file was not found on the server." + def download_api_data(self): url = self.parent.url id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)") @@ -85,20 +69,43 @@ class NetloadIn(Plugin): apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} - lines = src.split(";") - self.api_data["fileid"] = lines[0] - self.api_data["filename"] = lines[1] - self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') - self.api_data["status"] = lines[3] - self.api_data["checksum"] = lines[4] - + if src != "unknown file_data": + lines = src.split(";") + self.api_data["exists"] = True + self.api_data["fileid"] = lines[0] + self.api_data["filename"] = lines[1] + self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') + self.api_data["status"] = lines[3] + self.api_data["checksum"] = lines[4].replace("\n", "") + else: + self.api_data["exists"] = False def download_html(self): - if self.config['premium']: - self.config['username'], self.config['password'] - self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) + #~ if self.config['premium']: + #~ self.config['username'], self.config['password'] + #~ self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) + self.html[0] = self.req.load(self.parent.url, cookies=True) + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") + for i in range(6): + self.html[1] = self.req.load(url_captcha_html, cookies=True) + try: + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + except: + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") + self.html[1] = self.req.load(url_captcha_html, cookies=True) + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + + file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', self.html[1]).group(1) + captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name + self.req.download(captcha_url, captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + os.remove(captcha_image) + self.logger.debug("Captcha %s: %s" % (i, captcha)) + sleep(5) + self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) + + if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: + break def download_html2(self): @@ -141,42 +148,43 @@ class NetloadIn(Plugin): return None def get_wait_time(self): - wait = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) - self.time_plus_wait = time() + wait / 100 - if re.search(r"We had a reqeust with the IP", self.html[2]): - self.want_reconnect = True + self.time_plus_wait = time() + 10 * 30 + return + + wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 100 + self.time_plus_wait = time() + wait_seconds def get_file_name(self): - try: - if self.api_data and self.api_data["filename"]: - return self.api_data["filename"] + if self.api_data["filename"]: + return self.api_data["filename"] + elif self.html[0]: file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">' - return re.search(file_name_pattern, self.html[0]).group(1) - except: - return self.parent.url + file_name_search = re.search(file_name_pattern, self.html[0]) + if file_name_search: + return file_name_search.group(1) + return self.parent.url def file_exists(self): - """ returns True or False - """ - if re.search(r"The file has been deleted", self.html[0]) != None: - return False - else: + if self.api_data["exists"]: + return self.api_data["exists"] + elif self.html[0] and re.search(r"The file has been deleted", self.html[0]) == None: return True + return False def proceed(self, url, location): - self.req.download(url, location, cookies=True) def check_file(self, local_file): if self.api_data and self.api_data["checksum"]: h = hashlib.md5() - with open(local_file, "rb") as f: - h.update(f.read()) + f = open(local_file, "rb") + h.update(f.read()) + f.close() hexd = h.hexdigest() if hexd == self.api_data["checksum"]: return (True, 0) else: return (False, 1) else: - return (True, 5) + return (True, 5) diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 615dda521..96d526d73 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -38,10 +38,12 @@ class RapidshareCom(Plugin): def prepare(self, thread): pyfile = self.parent - + self.req.clear_cookies() + self.download_api_data() if self.api_data["status"] == "1": pyfile.status.filename = self.get_file_name() + if self.config["premium"]: self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) pyfile.status.url = self.parent.url @@ -49,7 +51,7 @@ class RapidshareCom(Plugin): self.download_html() while self.no_slots: - self.download_serverhtml() + self.get_wait_time() pyfile.status.waituntil = self.time_plus_wait pyfile.status.want_reconnect = self.want_reconnect thread.wait(pyfile) @@ -122,7 +124,7 @@ class RapidshareCom(Plugin): self.html[0] = self.req.load(self.url, cookies=True) self.html_old = time() - def download_serverhtml(self): + def get_wait_time(self): """downloads html with the important informations """ file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) @@ -130,10 +132,10 @@ class RapidshareCom(Plugin): self.html_old = time() - if re.search(r"is already downloading", self.html[1]) != None: + if re.search(r"is already downloading", self.html[1]): self.logger.info("Rapidshare: Already downloading, wait 30 minutes") self.time_plus_wait = time() + 10 * 30 - return False + return self.no_slots = False try: wait_minutes = re.search(r"Or try again in about (\d+) minute", self.html[1]).group(1) @@ -160,7 +162,7 @@ class RapidshareCom(Plugin): return re.search(file_url_pattern, self.html[1]).group(1) def get_file_name(self): - if self.api_data and self.api_data["filename"]: + if self.api_data["filename"]: return self.api_data["filename"] elif self.html[0]: file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" diff --git a/module/thread_list.py b/module/thread_list.py index 6a42898be..d78a9b95c 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -110,7 +110,6 @@ class Thread_List(object): newLinks = 0 if pyfile.plugin.links: for link in pyfile.plugin.links: - print link newFile = self.list.collector.addLink(link) self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile)) newLinks += 1 -- cgit v1.2.3 From fc5ae79bf0e0fc2c43b9b748c4d00037077f21a6 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sat, 19 Dec 2009 19:27:42 +0100 Subject: webinterface - activ Downloads List - Code completed --- module/web/templates/default/base.html | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index f9ea8c3a2..73846b0d6 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -132,8 +132,25 @@ sprintfWrapper = { } } } - sprintf = sprintfWrapper.init; + +//var SetInver = new Array(); + +function HumanFileSize(size) +{ + var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); + var loga = Math.log(size)/Math.log(1024); + var i = Math.floor(loga); + var a = Math.pow(1024, i); + return Math.round( size / a , 2) + " " + filesizename[i]; +} + +/*function UpdateLinks( SetInver, index ) +{ + $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1) + setTimeout( UpdateLinks( SetInver, index+1 ), SetInver[index]*1000); +}*/ + function LoadJsonToContent(data) { JSONDATA = data; @@ -161,8 +178,15 @@ function LinksToContent(data) $("#LinksAktiv").text(''); $.each(data, function(i,item) { - $("#LinksAktiv").append('<tr><td>'+item.name+'</td><td>'+item.status+'</td><td>'+Math.round(item.speed*100)/100+'@'+SecToRightTime(item.eta)+'</td><td>'+item.size+' MB</td><td>'+item.percent+'% / '+item.kbleft+' MB</td></tr>'); + $("#LinksAktiv").append('<tr id="link_'+item.id+'"><td>'+item.name+'</td><td>'+item.status+'</td><td>'+Math.round(item.speed*100)/100+'@'+SecToRightTime(item.eta)+'</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); + //SetInver[i] = (item.size / 100 ) / item.speed ; + //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); }); + //UpdateLinks(SetInver, 0); + setTimeout(function() + { + $.getJSON('/json/links', LinksToContent ); + }, 4000); } function SecToRightTime(sek) @@ -248,7 +272,7 @@ $(document).ready(function(){ {% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> - <li><a href="" class="action cog" accesskey="o" rel="nofollow">Aktiv: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> + <li><a href="" class="action cog" accesskey="o" rel="nofollow">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} -- cgit v1.2.3 From ed14601a9a83439ce096441ad7ca7a8c4d9b13f8 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 19 Dec 2009 20:50:26 +0100 Subject: Fixed file_exists function for local files --- module/Plugin.py | 13 +++++++++---- module/config/core.xml | 2 +- module/plugins/CCF.py | 5 ----- module/plugins/LinkList.py | 5 ----- module/plugins/RSDF.py | 5 ----- module/plugins/RapidshareCom.py | 4 ++-- 6 files changed, 12 insertions(+), 22 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 14a480e3b..8e5bbcfe8 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -20,6 +20,8 @@ import ConfigParser import logging import re +from os.path import exists + from module.network.Request import Request @@ -54,7 +56,7 @@ class Plugin(): pyfile.status.exists = self.file_exists() if not pyfile.status.exists: - raise Exception, "The file was not found on the server." + raise Exception, "File not found" return False pyfile.status.filename = self.get_file_name() @@ -75,12 +77,15 @@ class Plugin(): def download_html(self): """ gets the url from self.parent.url saves html in self.html and parses """ - html = "" - self.html = html + self.html = "" def file_exists(self): """ returns True or False """ + if re.search(r"(?!http://).*\.(dlc|ccf|rsdf|txt)", self.parent.url): + return exists(self.parent.url) + elif re.search(r"Not Found", self.parent.url): + return False return True def get_file_url(self): @@ -92,7 +97,7 @@ class Plugin(): try: return re.findall("([^\/=]+)", self.parent.url)[-1] except: - return "no_name" + return self.parent.url[:20] def wait_until(self): if self.html != None: diff --git a/module/config/core.xml b/module/config/core.xml index 392309e1c..6da85cf32 100644 --- a/module/config/core.xml +++ b/module/config/core.xml @@ -11,7 +11,7 @@ <key>ssl.key</key> </ssl> <webinterface> - <activated>False</activated> + <activated>True</activated> <host>0.0.0.0</host> <port>8000</port> <template>default</template> diff --git a/module/plugins/CCF.py b/module/plugins/CCF.py index 7b6e3397f..88b567904 100644 --- a/module/plugins/CCF.py +++ b/module/plugins/CCF.py @@ -27,11 +27,6 @@ class CCF(Plugin): self.multi_dl = True self.links = [] - def file_exists(self): - """ returns True or False - """ - return True - def proceed(self, url, location): infile = url.replace("\n", "") diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index ff99b0968..92508ce29 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -21,11 +21,6 @@ class LinkList(Plugin): self.html = None self.read_config() - def file_exists(self): - """ returns True or False - """ - return True - def proceed(self, linkList, location): tmpLinks = [] txt = open(linkList, 'r') diff --git a/module/plugins/RSDF.py b/module/plugins/RSDF.py index 5ce8fd716..0b6a63722 100644 --- a/module/plugins/RSDF.py +++ b/module/plugins/RSDF.py @@ -23,11 +23,6 @@ class RSDF(Plugin): self.multi_dl = True self.links = [] - def file_exists(self): - """ returns True or False - """ - return True - def proceed(self, url, location): from Crypto.Cipher import AES diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 96d526d73..2ce9a2f6f 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -15,7 +15,7 @@ class RapidshareCom(Plugin): props['name'] = "RapidshareCom" props['type'] = "hoster" props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" - props['version'] = "0.9.9" + props['version'] = "1.0" props['description'] = """Rapidshare.com Download Plugin""" props['author_name'] = ("spoob", "RaNaN", "mkaay") props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") @@ -42,7 +42,7 @@ class RapidshareCom(Plugin): self.download_api_data() if self.api_data["status"] == "1": - pyfile.status.filename = self.get_file_name() + pyfile.status.filename = self.api_data["filename"] if self.config["premium"]: self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) -- cgit v1.2.3 From 73ce2440528681c713085c2ffb1947718e9022c5 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 19 Dec 2009 22:23:29 +0100 Subject: Fixed normal hoster file_exists function --- module/Plugin.py | 3 ++- module/plugins/DLC.pyc | Bin 5829 -> 5663 bytes module/plugins/LinkList.py | 10 +++++----- module/plugins/RapidshareCom.py | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 8e5bbcfe8..3285ae8dd 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -84,7 +84,8 @@ class Plugin(): """ if re.search(r"(?!http://).*\.(dlc|ccf|rsdf|txt)", self.parent.url): return exists(self.parent.url) - elif re.search(r"Not Found", self.parent.url): + header = self.req.load(self.parent.url, just_header=True) + if re.search(r"HTTP/1.1 404 Not Found", header): return False return True diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 879e679fc..93d2bec7f 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index 92508ce29..fc737e8c5 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -29,11 +29,11 @@ class LinkList(Plugin): if link != "\n": tmpLinks.append(link.replace("\n", "")) txt.close() - - if not self.parent.core.config['general']['debug_mode']: - txt = open(linkList, 'w') - txt.write("") - txt.close() +#~ + #~ if not self.parent.core.config['general']['debug_mode']: + #~ txt = open(linkList, 'w') + #~ txt.write("") + #~ txt.close() #@TODO: maybe delete read txt file? self.links = tmpLinks diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py index 2ce9a2f6f..973e28470 100644 --- a/module/plugins/RapidshareCom.py +++ b/module/plugins/RapidshareCom.py @@ -42,7 +42,7 @@ class RapidshareCom(Plugin): self.download_api_data() if self.api_data["status"] == "1": - pyfile.status.filename = self.api_data["filename"] + pyfile.status.filename = self.get_file_name() if self.config["premium"]: self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) -- cgit v1.2.3 From da1e726d6d4ece84c94af4a9a766fb5a39325eab Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 20 Dec 2009 01:12:27 +0100 Subject: Checksum for Shareonline.biz --- module/plugins/DLC.pyc | Bin 5663 -> 5740 bytes module/plugins/LinkList.py | 10 +++--- module/plugins/ShareonlineBiz.py | 72 +++++++++++++++++++++++++++------------ 3 files changed, 55 insertions(+), 27 deletions(-) (limited to 'module') diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc index 93d2bec7f..235e46e1a 100644 Binary files a/module/plugins/DLC.pyc and b/module/plugins/DLC.pyc differ diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index fc737e8c5..92508ce29 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -29,11 +29,11 @@ class LinkList(Plugin): if link != "\n": tmpLinks.append(link.replace("\n", "")) txt.close() -#~ - #~ if not self.parent.core.config['general']['debug_mode']: - #~ txt = open(linkList, 'w') - #~ txt.write("") - #~ txt.close() + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() #@TODO: maybe delete read txt file? self.links = tmpLinks diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py index a798ccefa..1b1eb6e27 100644 --- a/module/plugins/ShareonlineBiz.py +++ b/module/plugins/ShareonlineBiz.py @@ -26,14 +26,48 @@ class ShareonlineBiz(Plugin): self.html = [None, None] self.want_reconnect = False self.init_ocr() + self.url = self.parent.url + self.read_config() if self.config['premium']: self.multi_dl = True else: self.multi_dl = False + def prepare(self, thread): + pyfile = self.parent + + self.download_api_data() + if self.api_data["status"]: + self.download_html() + pyfile.status.filename = self.api_data["filename"] + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + else: + raise Exception, "File not found" + return False + + def download_api_data(self): + """ + http://images.rapidshare.com/apidoc.txt + """ + api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php?md5=1" + api_param_file = {"links": self.url} + src = self.req.load(api_url_base, cookies=False, post=api_param_file) + + fields = src.split(";") + self.api_data = {} + self.api_data["fileid"] = fields[0] + self.api_data["status"] = fields[1] + if self.api_data["status"] == "NOTFOUND": + return + self.api_data["filename"] = fields[2] + self.api_data["size"] = fields[3] # in bytes + self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 + def download_html(self): if self.config['premium']: - post_vars = {"act": "login", + post_vars = {ct": "login", "location": "service.php", "dieseid": "", "user": self.config['username'], @@ -47,11 +81,12 @@ class ShareonlineBiz(Plugin): if not self.config['premium']: captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - for i in range(5): + for i in range(10): self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) captcha = self.ocr.get_captcha(captcha_image) + self.logger.debug("Captcha %s: %s" % (i, captcha)) self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) - if re.search(r"Der Download ist Ihnen zu langsam?", self.html[1]) != None: + if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]) != None: self.time_plus_wait = time() + 15 break @@ -60,29 +95,22 @@ class ShareonlineBiz(Plugin): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html[0] == None: - self.download_html() if not self.want_reconnect: file_url_pattern = 'loadfilelink\.decode\("(.*)\); document' return b64decode(re.search(file_url_pattern, self.html[1]).group(1)) else: return False - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name_pattern = 'class="locatedActive">Download (.*)</span>' - return re.search(file_name_pattern, self.html[1]).group(1) - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"nicht zum Download bereitgestellt werden", self.html[0]) != None: - return False + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.md5() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) else: - return True + return (True, 5) -- cgit v1.2.3 From 5a9540d6ee0c81fadf1895df457d3e4a169ca240 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 17:13:01 +0100 Subject: gui toolbar with dummy actions --- module/gui/MainWindow.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index fad98d9da..5878d18d4 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -56,6 +56,10 @@ class MainWindow(QMainWindow): self.menus["file"].addAction(self.mactions["exit"]) self.menus["connections"].addAction(self.mactions["manager"]) + #toolbar + self.actions = {} + self.init_toolbar() + #tabs self.tabw = QTabWidget() self.tabs = {} @@ -72,6 +76,24 @@ class MainWindow(QMainWindow): #layout self.masterlayout.addWidget(self.tabw) + def init_toolbar(self): + self.toolbar = self.addToolBar("main") + self.toolbar.setIconSize(QSize(40,40)) + self.actions["toggle_status"] = self.toolbar.addAction("Toggle Pause/Resume") + pricon = QIcon() + pricon.addFile("icons/gui/toolbar_start.png", QSize(), QIcon.Normal, QIcon.Off) + pricon.addFile("icons/gui/toolbar_pause.png", QSize(), QIcon.Normal, QIcon.On) + self.actions["toggle_status"].setIcon(pricon) + self.actions["toggle_status"].setCheckable(True) + self.actions["status_stop"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_stop.png"), "Stop") + self.toolbar.addSeparator() + self.actions["add"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_add.png"), "Add") + #self.toolbar.addAction(QIcon("icons/gui/toolbar_remove.png"), "Remove") + + self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) + self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop) + self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) + def init_tabs(self): """ create tabs @@ -93,3 +115,12 @@ class MainWindow(QMainWindow): self.tabs["collector_links"]["w"].setLayout(self.tabs["collector_links"]["l"]) self.tabs["collector_links"]["listwidget"] = QListWidget() self.tabs["collector_links"]["l"].addWidget(self.tabs["collector_links"]["listwidget"]) + + def slotToggleStatus(self, status): + print "toggle status", status + + def slotStatusStop(self): + print "stop!" + + def slotAdd(self): + print "add" -- cgit v1.2.3 From ab5d907f48a8879f717e0c6482695ef1afe280a0 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 18:25:19 +0100 Subject: gui can return to connection manager, new collector --- module/gui/MainWindow.py | 35 ++++++++++++++++++++--------------- module/gui/Queue.py | 3 +++ 2 files changed, 23 insertions(+), 15 deletions(-) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 5878d18d4..f9d2d0fb8 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -64,17 +64,17 @@ class MainWindow(QMainWindow): self.tabw = QTabWidget() self.tabs = {} self.tabs["queue"] = {"w":QWidget()} - self.tabs["collector_packages"] = {"w":QWidget()} - self.tabs["collector_links"] = {"w":QWidget()} + self.tabs["collector"] = {"w":QWidget()} self.tabw.addTab(self.tabs["queue"]["w"], "Queue") - self.tabw.addTab(self.tabs["collector_packages"]["w"], "Package collector") - self.tabw.addTab(self.tabs["collector_links"]["w"], "Link collector") + self.tabw.addTab(self.tabs["collector"]["w"], "Collector") #init tabs self.init_tabs() #layout self.masterlayout.addWidget(self.tabw) + + self.connect(self.mactions["manager"], SIGNAL("triggered()"), self.slotShowConnector) def init_toolbar(self): self.toolbar = self.addToolBar("main") @@ -104,17 +104,19 @@ class MainWindow(QMainWindow): self.tabs["queue"]["view"] = QTreeWidget() self.tabs["queue"]["l"].addWidget(self.tabs["queue"]["view"]) - #collector_packages - self.tabs["collector_packages"]["l"] = QGridLayout() - self.tabs["collector_packages"]["w"].setLayout(self.tabs["collector_packages"]["l"]) - self.tabs["collector_packages"]["treewidget"] = QTreeWidget() - self.tabs["collector_packages"]["l"].addWidget(self.tabs["collector_packages"]["treewidget"]) - - #collector_links - self.tabs["collector_links"]["l"] = QGridLayout() - self.tabs["collector_links"]["w"].setLayout(self.tabs["collector_links"]["l"]) - self.tabs["collector_links"]["listwidget"] = QListWidget() - self.tabs["collector_links"]["l"].addWidget(self.tabs["collector_links"]["listwidget"]) + #collector + groupPackage = QGroupBox("Packages") + groupLinks = QGroupBox("Links") + groupPackage.setLayout(QVBoxLayout()) + groupLinks.setLayout(QVBoxLayout()) + self.tabs["collector"]["l"] = QGridLayout() + self.tabs["collector"]["w"].setLayout(self.tabs["collector"]["l"]) + self.tabs["collector"]["package_view"] = QTreeWidget() + self.tabs["collector"]["link_view"] = QListWidget() + groupPackage.layout().addWidget(self.tabs["collector"]["package_view"]) + groupLinks.layout().addWidget(self.tabs["collector"]["link_view"]) + self.tabs["collector"]["l"].addWidget(groupPackage, 0, 0) + self.tabs["collector"]["l"].addWidget(groupLinks, 0, 1) def slotToggleStatus(self, status): print "toggle status", status @@ -124,3 +126,6 @@ class MainWindow(QMainWindow): def slotAdd(self): print "add" + + def slotShowConnector(self): + self.emit(SIGNAL("connector")) diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 7e63e6180..52f11fd8c 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -46,6 +46,9 @@ class Queue(QThread): self.update() sleep(self.interval) + def stop(self): + self.running = False + def update(self): locker = QMutexLocker(self.mutex) packs = self.connector.getPackageQueue() -- cgit v1.2.3 From 39546a4c7738eda3e56117e138ca2a4baa8e49c0 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 20 Dec 2009 18:32:23 +0100 Subject: fixed shareonline, netload premium --- module/plugins/NetloadIn.py | 4 +--- module/plugins/ShareonlineBiz.py | 2 +- module/web/pyload.db | Bin 41984 -> 45056 bytes 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py index e90124f10..72f45e542 100644 --- a/module/plugins/NetloadIn.py +++ b/module/plugins/NetloadIn.py @@ -44,6 +44,7 @@ class NetloadIn(Plugin): pyfile.status.filename = self.get_file_name() if self.config['premium']: + self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url #@TODO: premium?? @@ -81,9 +82,6 @@ class NetloadIn(Plugin): self.api_data["exists"] = False def download_html(self): - #~ if self.config['premium']: - #~ self.config['username'], self.config['password'] - #~ self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) self.html[0] = self.req.load(self.parent.url, cookies=True) url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") for i in range(6): diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py index 1b1eb6e27..b9a9accef 100644 --- a/module/plugins/ShareonlineBiz.py +++ b/module/plugins/ShareonlineBiz.py @@ -67,7 +67,7 @@ class ShareonlineBiz(Plugin): def download_html(self): if self.config['premium']: - post_vars = {ct": "login", + post_vars = {"act": "login", "location": "service.php", "dieseid": "", "user": self.config['username'], diff --git a/module/web/pyload.db b/module/web/pyload.db index 3305b02ef..57d9bc73c 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ -- cgit v1.2.3 From 6e08bed3589f3600697f72b654243e0f45b05ea9 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 20 Dec 2009 19:06:22 +0100 Subject: cleaned netload --- module/plugins/NetloadIn.py | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'module') diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py index 72f45e542..bc755fb58 100644 --- a/module/plugins/NetloadIn.py +++ b/module/plugins/NetloadIn.py @@ -105,37 +105,6 @@ class NetloadIn(Plugin): if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: break - def download_html2(self): - - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") - - for i in range(6): - self.html[1] = self.req.load(url_captcha_html, cookies=True) - - try: - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - except: - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") - self.html[1] = self.req.load(url_captcha_html, cookies=True) - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - - file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', self.html[1]).group(1) - - captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name - - self.req.download(captcha_url, captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.logger.debug("Captcha %s: %s" % (i, captcha)) - sleep(5) - self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) - - os.remove(captcha_image) - - if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: - return True - - raise Exception, "Captcha reading failed" - def get_file_url(self): """ returns the absolute downloadable filepath """ -- cgit v1.2.3 From 04c80ef15db0f553d330c3bd760956c5debc7833 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sun, 20 Dec 2009 19:35:02 +0100 Subject: webinterface - activ download - design 60% --- module/web/media/css/default.css | 24 ++++++++++++++++++++++++ module/web/pyload.db | Bin 45056 -> 43008 bytes module/web/templates/default/base.html | 13 +++++++------ module/web/templates/default/home.html | 19 +++++++++---------- 4 files changed, 40 insertions(+), 16 deletions(-) (limited to 'module') diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css index fbfc34d22..a0e82238e 100644 --- a/module/web/media/css/default.css +++ b/module/web/media/css/default.css @@ -1008,6 +1008,12 @@ a.play { a.play:hover { background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; } +a.cancel { + background:transparent url(/media/img/control_cancel.png) 0px 1px no-repeat; +} +a.cancel:hover { + background:transparent url(/media/img/control_cancel_blue.png) 0px 1px no-repeat; +} a.pause { background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; } @@ -1458,3 +1464,21 @@ div.codearea pre span.Preprc { float:left; padding-right: 8px; } +.queue { + + border: none; +} +.queue tr td { + border: none; +} +.header, .header th { + text-align: left; + font-weight: normal; + background-color:#ececec; + -moz-border-radius:5px; +} +.progress_bar { + background: #0C0; + height: 5px; + +} diff --git a/module/web/pyload.db b/module/web/pyload.db index 57d9bc73c..097ea4d3a 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 73846b0d6..4036180bf 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -156,7 +156,7 @@ function LoadJsonToContent(data) JSONDATA = data; $("#speed").text(Math.round(data.speed*100)/100); $("#aktiv").text(data.queue); - $("#aktiv_from").text(data.total); + $("#queue").text(data.total); /*if( data.pause == false ) { @@ -178,9 +178,10 @@ function LinksToContent(data) $("#LinksAktiv").text(''); $.each(data, function(i,item) { - $("#LinksAktiv").append('<tr id="link_'+item.id+'"><td>'+item.name+'</td><td>'+item.status+'</td><td>'+Math.round(item.speed*100)/100+'@'+SecToRightTime(item.eta)+'</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); + $("#LinksAktiv").append('<tr id="link_'+item.id+'"><td>'+item.name+'</td><td>'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); //SetInver[i] = (item.size / 100 ) / item.speed ; //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); + $("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); }); //UpdateLinks(SetInver, 0); setTimeout(function() @@ -264,15 +265,15 @@ $(document).ready(function(){ {% if perms.pyload.can_change_status %} <ul id="page-actions2"> <li id="action_play"><a href="/json/unpause" class="action play" accesskey="o" rel="nofollow">Play</a></li> - <li id="action_stop"><a href="" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> - <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow" name="Stop after ending last one" alt="Stop after ending last one">SAELO</a></li> + <li id="action_stop"><a href="" class="action cancel" accesskey="o" rel="nofollow">Cancel</a></li> + <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> </ul> {% endif %} {% if perms.pyload.can_see_dl %} <ul id="page-actions"> - <li><a href="" class="action backlink" accesskey="o" rel="nofollow">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> - <li><a href="" class="action cog" accesskey="o" rel="nofollow">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> + <li><a class="action backlink">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> + <li><a class="action cog">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index ac9c5d25c..8124902db 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -7,16 +7,15 @@ Active Downloads {% block content %} -<table> -<tbody id="LinksAktiv"> - <tr> - <td></td> - <td></td> - <td></td> - <td></td> - <td></td> +<table width="100%" class="queue"> + <tr class="header"> + <th>Name</th> + <th>Status</th> + <th>Infos</th> + <th>Size</th> + <th>Progress</th> </tr> -<tbody> + <tbody id="LinksAktiv"> + <tbody> </table> - {% endblock %} \ No newline at end of file -- cgit v1.2.3 From 18651c3ef02fecc0c1754bec81722625d22f44b4 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sun, 20 Dec 2009 19:36:28 +0100 Subject: webinterface - add new button icons --- module/web/media/img/control_cancel.png | Bin 0 -> 3349 bytes module/web/media/img/control_cancel_blue.png | Bin 0 -> 787 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 module/web/media/img/control_cancel.png create mode 100644 module/web/media/img/control_cancel_blue.png (limited to 'module') diff --git a/module/web/media/img/control_cancel.png b/module/web/media/img/control_cancel.png new file mode 100644 index 000000000..7b9bc3fba Binary files /dev/null and b/module/web/media/img/control_cancel.png differ diff --git a/module/web/media/img/control_cancel_blue.png b/module/web/media/img/control_cancel_blue.png new file mode 100644 index 000000000..0c5c96ce3 Binary files /dev/null and b/module/web/media/img/control_cancel_blue.png differ -- cgit v1.2.3 From 14f5966246fb22959f1d280f14683b8bf4c6c005 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 19:51:12 +0100 Subject: fixed file removing? --- module/file_list.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 1cd069de7..efe45c044 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -195,11 +195,10 @@ class File_List(object): try: n, pyfile = collector._getFileFromID(id) del collector.file_list.data["collector"][n] - collector.file_list.lock.release() - except: - collector.file_list.lock.release() else: return pyfile + finally: + collector.file_list.lock.release() def addLink(collector, url): """ -- cgit v1.2.3 From ff9a9560fef2d4a977a994d967e2848c1b62d206 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 20:00:40 +0100 Subject: fixed file_list, clean exit? --- module/file_list.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index efe45c044..9d4c090d1 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -195,6 +195,8 @@ class File_List(object): try: n, pyfile = collector._getFileFromID(id) del collector.file_list.data["collector"][n] + except Exception, e: + raise Exception, e else: return pyfile finally: -- cgit v1.2.3 From 8be39a4ac3563b3ac4abd8824ac775710fd4c4f6 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sun, 20 Dec 2009 20:20:52 +0100 Subject: webinterface - design 70% --- module/web/media/css/default.css | 7 ++++--- module/web/templates/default/base.html | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css index a0e82238e..0d8e0428f 100644 --- a/module/web/media/css/default.css +++ b/module/web/media/css/default.css @@ -925,7 +925,7 @@ ul#page-actions a, ul#user-actions a { padding:2px 0px 2px 18px; } ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { - text-decoration:underline; + /*text-decoration:underline;*/ } /***************************/ ul#page-actions2 { @@ -956,8 +956,8 @@ ul#page-actions2 a, ul#user-actions2 a { margin:0 3px; padding:2px 0px 2px 18px; } -ul#page-action2s a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus { - text-decoration:underline; +ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus { + color: #4e7bb4; } /****************************/ .hidden { @@ -1019,6 +1019,7 @@ a.pause { } a.pause:hover { background:transparent url(/media/img/control_pause_blue.png) 0px 1px no-repeat; + font-weight: bold; } a.stop { background:transparent url(/media/img/control_stop.png) 0px 1px no-repeat; diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 4036180bf..c43d5223c 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -182,6 +182,7 @@ function LinksToContent(data) //SetInver[i] = (item.size / 100 ) / item.speed ; //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); $("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); + $(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); }); //UpdateLinks(SetInver, 0); setTimeout(function() -- cgit v1.2.3 From c003c8a342cbe9609f8e6b21669a8b4a90a213bf Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 20:54:30 +0100 Subject: fixed file_list again, webserver terminates correctly when killing pyload over xmlrpc --- module/web/ServerThread.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 6113ac297..2279296d8 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,21 +1,27 @@ #!/usr/bin/env python import threading from os.path import join -import subprocess +from subprocess import Popen, PIPE, STDOUT +from time import sleep +from signal import SIGINT class WebServer(threading.Thread): def __init__(self, pycore): threading.Thread.__init__(self) self.pycore = pycore + self.running = True self.setDaemon(True) def run(self): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - try: - subprocess.call(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True) - except Exception, e: - print e + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=True) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code + while self.running: + sleep(1) + + def quit(self): + self.p.terminate() + self.running = False -- cgit v1.2.3 From 77ebea73401f00f9150299317bdddaa24beddd2a Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 23:22:46 +0100 Subject: file_list fix, webinterface termination fix AGAIN -.-' --- module/file_list.py | 2 +- module/web/ServerThread.py | 8 ++++++-- module/web/manage.py | 27 ++++++++++++++++++--------- module/web/pyload.db | Bin 43008 -> 43008 bytes 4 files changed, 25 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 9d4c090d1..67ae447bb 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -295,7 +295,7 @@ class File_List(object): """ packager.file_list.lock.acquire() try: - key, n, pyfile, pypack, pid = self._getFileFromID() + key, n, pyfile, pypack, pid = packager._getFileFromID() del pypack.files[n] if not pypack.files: packager.removePackage(pid) diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 2279296d8..d9f0f8cdc 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -4,6 +4,7 @@ from os.path import join from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT +import os class WebServer(threading.Thread): def __init__(self, pycore): @@ -16,12 +17,15 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=True) + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code + sleep(1) + with open("webserver.pid", "r") as f: + self.pid = int(f.read().strip()) while self.running: sleep(1) def quit(self): - self.p.terminate() + os.kill(self.pid, SIGINT) self.running = False diff --git a/module/web/manage.py b/module/web/manage.py index ae9495854..782f6fbe0 100644 --- a/module/web/manage.py +++ b/module/web/manage.py @@ -1,12 +1,21 @@ #!/usr/bin/env python -from django.core.management import execute_manager -try: - import settings # Assumed to be in the same directory. -except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) +import os -if __name__ == "__main__": - execute_manager(settings) +pid = os.fork() + +if pid: + with open("webserver.pid", "w") as f: + f.write(str(pid)) +else: + from django.core.management import execute_manager + + try: + import settings # Assumed to be in the same directory. + except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + + if __name__ == "__main__": + execute_manager(settings) diff --git a/module/web/pyload.db b/module/web/pyload.db index 097ea4d3a..44b0dbe23 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ -- cgit v1.2.3 From b22eaf5d8b1e472eaaebb176234843f38d97e102 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 23:30:43 +0100 Subject: python 2.5 compatibility --- module/web/ServerThread.py | 1 + module/web/manage.py | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index d9f0f8cdc..2ac39c2c8 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +from __future__ import with_statement import threading from os.path import join from subprocess import Popen, PIPE, STDOUT diff --git a/module/web/manage.py b/module/web/manage.py index 782f6fbe0..6a00ab565 100644 --- a/module/web/manage.py +++ b/module/web/manage.py @@ -1,9 +1,8 @@ #!/usr/bin/env python - +from __future__ import with_statement import os pid = os.fork() - if pid: with open("webserver.pid", "w") as f: f.write(str(pid)) -- cgit v1.2.3 From 62965d0668e81fc801c4be2d61c1a0b64b0edca8 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 20 Dec 2009 23:43:21 +0100 Subject: cli + web fixes --- module/web/pyload/views.py | 2 +- module/web/templates/default/base.html | 2 +- module/web/templates/default/home.html | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index a51a9c4dc..1fa9d45b7 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -63,7 +63,7 @@ def base(request, messages): @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{},[status_proc])) + return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{'content': settings.PYLOAD.status_downloads()},[status_proc])) @login_required diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index c43d5223c..657bdcf09 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -274,7 +274,7 @@ $(document).ready(function(){ {% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a class="action backlink">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> - <li><a class="action cog">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> + <li><a class="action cog">Active: <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 8124902db..43cf16ae0 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -16,6 +16,21 @@ Active Downloads <th>Progress</th> </tr> <tbody id="LinksAktiv"> + + {% for link in content %} + <tr id="link_{{ link.id }}"> + <td id="link_{{ link.id }}_name">{{ link.name }}</td> + <td id="link_{{ link.id }}_status">{{ link.status }}</td> + <td id="link_{{ link.id }}_eta">{{ content.eta }} @ {{content.speed }}</td> + <td id="link_{{ link.id }}_kbleft">{{ link.kbleft }}</td> + <td id="link_{{ link.id }}_percent"><font id="aktiv_percent">{{ link.percent }}</font>% / {{ link.size }}</td> + </tr> + <tr> + <td colspan="5"> + <div id="link_{{ link.id }}_pgb" class="progress_bar" style="overflow: hidden; width: {{ link.percent }}%; display: block;"> </div> + </td> + </tr> + {% endfor %} <tbody> </table> {% endblock %} \ No newline at end of file -- cgit v1.2.3 From 91b1ff7e83a4576ade65792b9c402e2f970c5ef5 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 20 Dec 2009 23:45:18 +0100 Subject: fixed zippyshare --- module/plugins/LinkList.py | 10 +++++----- module/plugins/ZippyshareCom.py | 13 +++++-------- 2 files changed, 10 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index 92508ce29..fc737e8c5 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -29,11 +29,11 @@ class LinkList(Plugin): if link != "\n": tmpLinks.append(link.replace("\n", "")) txt.close() - - if not self.parent.core.config['general']['debug_mode']: - txt = open(linkList, 'w') - txt.write("") - txt.close() +#~ + #~ if not self.parent.core.config['general']['debug_mode']: + #~ txt = open(linkList, 'w') + #~ txt.write("") + #~ txt.close() #@TODO: maybe delete read txt file? self.links = tmpLinks diff --git a/module/plugins/ZippyshareCom.py b/module/plugins/ZippyshareCom.py index 0c638087b..bec7f8c65 100644 --- a/module/plugins/ZippyshareCom.py +++ b/module/plugins/ZippyshareCom.py @@ -30,14 +30,11 @@ class ZippyshareCom(Plugin): def get_file_url(self): """ returns the absolute downloadable filepath """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url = urllib.unquote(re.search("var \w* = 'fck(.*)';", self.html).group(1)) - return file_url - else: - return False - + file_url_pattern = r"var \w* = '(http%.*?)';" + file_url_search = re.search(file_url_pattern, self.html).group(1) + file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) + return file_url + def get_file_name(self): if self.html == None: self.download_html() -- cgit v1.2.3 From a401b34f9835bd402e7cc43b6975d049984fabca Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 20 Dec 2009 23:50:36 +0100 Subject: file_list... --- module/file_list.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 67ae447bb..1d3b1a68f 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -295,7 +295,7 @@ class File_List(object): """ packager.file_list.lock.acquire() try: - key, n, pyfile, pypack, pid = packager._getFileFromID() + key, n, pyfile, pypack, pid = packager._getFileFromID(id) del pypack.files[n] if not pypack.files: packager.removePackage(pid) -- cgit v1.2.3 From 39969ffd4b5a6db766ca07d52b870055f76e4d9e Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 20 Dec 2009 23:58:28 +0100 Subject: Normal linklist plugin --- module/plugins/LinkList.py | 10 +++++----- module/web/pyload.db | Bin 43008 -> 44032 bytes 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py index fc737e8c5..92508ce29 100644 --- a/module/plugins/LinkList.py +++ b/module/plugins/LinkList.py @@ -29,11 +29,11 @@ class LinkList(Plugin): if link != "\n": tmpLinks.append(link.replace("\n", "")) txt.close() -#~ - #~ if not self.parent.core.config['general']['debug_mode']: - #~ txt = open(linkList, 'w') - #~ txt.write("") - #~ txt.close() + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() #@TODO: maybe delete read txt file? self.links = tmpLinks diff --git a/module/web/pyload.db b/module/web/pyload.db index 44b0dbe23..013c8607d 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ -- cgit v1.2.3 From 9f342ea3f73148154054515c4a3d3fa8ab35bf51 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 00:41:08 +0100 Subject: GUI: new docks --- module/gui/MainWindow.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index f9d2d0fb8..9c972dea1 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -19,6 +19,9 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * +from module.gui.PackageDock import * +from module.gui.LinkDock import * + class MainWindow(QMainWindow): def __init__(self): """ @@ -30,6 +33,11 @@ class MainWindow(QMainWindow): self.setWindowIcon(QIcon("icons/logo.png")) self.resize(750,500) + self.newPackDock = NewPackageDock() + self.addDockWidget(Qt.RightDockWidgetArea, self.newPackDock) + self.newLinkDock = NewLinkDock() + self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) + #central widget, layout self.masterlayout = QVBoxLayout() lw = QWidget() @@ -92,7 +100,12 @@ class MainWindow(QMainWindow): self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop) + self.addMenu = QMenu() + packageAction = self.addMenu.addAction("Package") + linkAction = self.addMenu.addAction("Links") self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) + self.connect(packageAction, SIGNAL("triggered()"), self.slotAddPackage) + self.connect(linkAction, SIGNAL("triggered()"), self.slotAddLinks) def init_tabs(self): """ @@ -125,7 +138,15 @@ class MainWindow(QMainWindow): print "stop!" def slotAdd(self): - print "add" + self.addMenu.exec_(QCursor.pos()) + + def slotAddPackage(self): + self.tabw.setCurrentIndex(1) + self.newPackDock.show() + + def slotAddLinks(self): + self.tabw.setCurrentIndex(1) + self.newLinkDock.show() def slotShowConnector(self): self.emit(SIGNAL("connector")) -- cgit v1.2.3 From 20f7c0e65607f2fb8607ed0e5e96181a36be76ca Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 14:24:51 +0100 Subject: new update threads, link dock works now --- module/gui/Collector.py | 210 ++++++++++++++++++++++++++++++++++++++++++++++ module/gui/LinkDock.py | 53 ++++++++++++ module/gui/MainWindow.py | 15 ++-- module/gui/PackageDock.py | 49 +++++++++++ module/gui/connector.py | 10 +++ 5 files changed, 332 insertions(+), 5 deletions(-) create mode 100644 module/gui/Collector.py create mode 100644 module/gui/LinkDock.py create mode 100644 module/gui/PackageDock.py (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py new file mode 100644 index 000000000..0dbccab1f --- /dev/null +++ b/module/gui/Collector.py @@ -0,0 +1,210 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +from time import sleep + +class PackageCollector(QThread): + def __init__(self, view, connector): + QThread.__init__(self) + self.view = view + self.connector = connector + self.collector = [] + self.interval = 2 + self.running = True + self.mutex = QMutex() + + def run(self): + while self.running: + self.update() + sleep(self.interval) + + def stop(self): + self.running = False + + def update(self): + locker = QMutexLocker(self.mutex) + packs = self.connector.getPackageCollector() + for data in packs: + pack = self.getPack(data["id"]) + if not pack: + pack = self.PackageCollectorPack(self) + pack.setData(data) + self.addPack(data["id"], pack) + files = self.connector.getPackageFiles(data["id"]) + for fid in files: + info = self.connector.getLinkInfo(fid) + child = pack.getChild(fid) + if not child: + child = self.PackageCollectorFile(self, pack) + child.setData(info) + pack.addChild(fid, child) + + def addPack(self, pid, newPack): + pos = None + try: + for k, pack in enumerate(self.collector): + if pack.getData()["id"] == pid: + pos = k + break + if pos == None: + raise Exception() + self.collector[pos] = newPack + except: + self.collector.append(newPack) + pos = self.collector.index(newPack) + item = self.view.topLevelItem(pos) + if not item: + item = QTreeWidgetItem() + self.view.insertTopLevelItem(pos, item) + item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) + item.setData(0, Qt.UserRole, QVariant(pid)) + + def getPack(self, pid): + for k, pack in enumerate(self.collector): + if pack.getData()["id"] == pid: + return pack + return None + + class PackageCollectorPack(): + def __init__(self, collector): + self.collector = collector + self.data = [] + self.children = [] + + def addChild(self, cid, newChild): + pos = None + try: + for k, child in enumerate(self.getChildren()): + if child.getData()["id"] == cid: + pos = k + break + if pos == None: + raise Exception() + self.children[pos] = newChild + except: + self.children.append(newChild) + pos = self.children.index(newChild) + ppos = self.queue.queue.index(self) + parent = self.queue.view.topLevelItem(ppos) + item = parent.child(pos) + if not item: + item = QTreeWidgetItem() + parent.insertChild(pos, item) + status = "%s (%s)" % (newChild.getData()["status_type"], newChild.getData()["plugin"]) + item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) + item.setData(0, Qt.UserRole, QVariant(cid)) + + def getChildren(self): + return self.children + + def getChild(self, cid): + try: + return self.children[cid] + except: + return None + + def hasChildren(self, data): + return (len(self.children) > 0) + + def setData(self, data): + self.data = data + + def getData(self): + return self.data + + class PackageCollectorFile(): + def __init__(self, collector, pack): + self.collector = collector + self.pack = pack + + def getData(self): + return self.data + + def setData(self, data): + self.data = data + + def getPack(self): + return self.pack + +class LinkCollector(QThread): + def __init__(self, view, connector): + QThread.__init__(self) + self.view = view + self.connector = connector + self.collector = [] + self.interval = 2 + self.running = True + self.mutex = QMutex() + + def run(self): + while self.running: + self.update() + sleep(self.interval) + + def stop(self): + self.running = False + + def update(self): + locker = QMutexLocker(self.mutex) + ids = self.connector.getLinkCollector() + for id in ids: + data = self.connector.getLinkInfo(id) + file = self.getFile(id) + if not file: + file = self.LinkCollectorFile(self) + file.setData(data) + self.addFile(id, file) + + def addFile(self, pid, newFile): + pos = None + try: + for k, file in enumerate(self.collector): + if file.getData()["id"] == pid: + pos = k + break + if pos == None: + raise Exception() + self.collector[pos] = newFile + except: + self.collector.append(newFile) + pos = self.collector.index(newFile) + item = self.view.topLevelItem(pos) + if not item: + item = QTreeWidgetItem() + self.view.insertTopLevelItem(pos, item) + item.setData(0, Qt.DisplayRole, QVariant(newFile.getData()["filename"])) + item.setData(0, Qt.UserRole, QVariant(pid)) + + def getFile(self, pid): + for k, file in enumerate(self.collector): + if file.getData()["id"] == pid: + return file + return None + + class LinkCollectorFile(): + def __init__(self, collector): + self.collector = collector + + def getData(self): + return self.data + + def setData(self, data): + self.data = data diff --git a/module/gui/LinkDock.py b/module/gui/LinkDock.py new file mode 100644 index 000000000..01a0cc193 --- /dev/null +++ b/module/gui/LinkDock.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class NewLinkDock(QDockWidget): + def __init__(self): + QDockWidget.__init__(self, "New Links") + self.widget = NewLinkWindow(self) + self.setWidget(self.widget) + self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) + self.hide() + + def slotDone(self): + text = str(self.widget.box.toPlainText()) + lines = text.splitlines() + self.emit(SIGNAL("done"), lines) + self.widget.box.clear() + self.hide() + +class NewLinkWindow(QWidget): + def __init__(self, dock): + QWidget.__init__(self) + self.dock = dock + self.setLayout(QVBoxLayout()) + layout = self.layout() + + boxLabel = QLabel("Paste URLs here:") + self.box = QTextEdit() + + save = QPushButton("Add") + + layout.addWidget(boxLabel) + layout.addWidget(self.box) + layout.addWidget(save) + + self.connect(save, SIGNAL("clicked()"), self.dock.slotDone) diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 9c972dea1..ccca6b697 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -33,10 +33,12 @@ class MainWindow(QMainWindow): self.setWindowIcon(QIcon("icons/logo.png")) self.resize(750,500) + #init docks self.newPackDock = NewPackageDock() self.addDockWidget(Qt.RightDockWidgetArea, self.newPackDock) self.newLinkDock = NewLinkDock() self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) + self.connect(self.newLinkDock, SIGNAL("done"), self.slotAddLinks) #central widget, layout self.masterlayout = QVBoxLayout() @@ -104,8 +106,8 @@ class MainWindow(QMainWindow): packageAction = self.addMenu.addAction("Package") linkAction = self.addMenu.addAction("Links") self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) - self.connect(packageAction, SIGNAL("triggered()"), self.slotAddPackage) - self.connect(linkAction, SIGNAL("triggered()"), self.slotAddLinks) + self.connect(packageAction, SIGNAL("triggered()"), self.slotShowAddPackage) + self.connect(linkAction, SIGNAL("triggered()"), self.slotShowAddLinks) def init_tabs(self): """ @@ -125,7 +127,7 @@ class MainWindow(QMainWindow): self.tabs["collector"]["l"] = QGridLayout() self.tabs["collector"]["w"].setLayout(self.tabs["collector"]["l"]) self.tabs["collector"]["package_view"] = QTreeWidget() - self.tabs["collector"]["link_view"] = QListWidget() + self.tabs["collector"]["link_view"] = QTreeWidget() groupPackage.layout().addWidget(self.tabs["collector"]["package_view"]) groupLinks.layout().addWidget(self.tabs["collector"]["link_view"]) self.tabs["collector"]["l"].addWidget(groupPackage, 0, 0) @@ -140,13 +142,16 @@ class MainWindow(QMainWindow): def slotAdd(self): self.addMenu.exec_(QCursor.pos()) - def slotAddPackage(self): + def slotShowAddPackage(self): self.tabw.setCurrentIndex(1) self.newPackDock.show() - def slotAddLinks(self): + def slotShowAddLinks(self): self.tabw.setCurrentIndex(1) self.newLinkDock.show() def slotShowConnector(self): self.emit(SIGNAL("connector")) + + def slotAddLinks(self, links): + self.emit(SIGNAL("addLinks"), links) diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py new file mode 100644 index 000000000..c97e9d645 --- /dev/null +++ b/module/gui/PackageDock.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class NewPackageDock(QDockWidget): + def __init__(self): + QDockWidget.__init__(self, "New Package") + self.widget = NewPackageWindow(self) + self.setWidget(self.widget) + self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) + self.hide() + +class NewPackageWindow(QWidget): + def __init__(self, dock): + QWidget.__init__(self) + self.dock = dock + self.setLayout(QGridLayout()) + layout = self.layout() + + nameLabel = QLabel("Name") + nameInput = QLineEdit() + + linksLabel = QLabel("Links in this Package") + linkView = QListWidget() + + save = QPushButton("Create") + + layout.addWidget(nameLabel, 0, 0) + layout.addWidget(nameInput, 0, 1) + layout.addWidget(linksLabel, 1, 0, 1, 2) + layout.addWidget(linkView, 2, 0, 1, 2) + layout.addWidget(save, 3, 0, 1, 2) diff --git a/module/gui/connector.py b/module/gui/connector.py index e4fd4770c..3627545ba 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -144,3 +144,13 @@ class connector(QThread): return self.proxy.status_server() finally: self.mutex.unlock() + + def addURLs(self, links): + """ + add links to collector + """ + self.mutex.lock() + try: + self.proxy.add_urls(links) + finally: + self.mutex.unlock() -- cgit v1.2.3 From 4c98db9a0eb0ca1ca70c4886b907e79682bfad82 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 14:41:23 +0100 Subject: pause/start button works --- module/gui/MainWindow.py | 3 ++- module/gui/connector.py | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index ccca6b697..6d68f4d7a 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -85,6 +85,7 @@ class MainWindow(QMainWindow): self.masterlayout.addWidget(self.tabw) self.connect(self.mactions["manager"], SIGNAL("triggered()"), self.slotShowConnector) + self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close) def init_toolbar(self): self.toolbar = self.addToolBar("main") @@ -134,7 +135,7 @@ class MainWindow(QMainWindow): self.tabs["collector"]["l"].addWidget(groupLinks, 0, 1) def slotToggleStatus(self, status): - print "toggle status", status + self.emit(SIGNAL("setDownloadStatus"), status) def slotStatusStop(self): print "stop!" diff --git a/module/gui/connector.py b/module/gui/connector.py index 3627545ba..32da29bba 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -154,3 +154,26 @@ class connector(QThread): self.proxy.add_urls(links) finally: self.mutex.unlock() + + def togglePause(self): + """ + toogle pause + """ + self.mutex.lock() + try: + return self.proxy.toggle_pause() + finally: + self.mutex.unlock() + + def setPause(self, pause): + """ + set pause + """ + self.mutex.lock() + try: + if pause: + self.proxy.pause_server() + else: + self.proxy.unpause_server() + finally: + self.mutex.unlock() -- cgit v1.2.3 From ff7fa4a0d1aa1c09e563d2086704aa7e2acea716 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 17:07:16 +0100 Subject: package creation works --- module/gui/Collector.py | 21 +++++++++++++++++++-- module/gui/MainWindow.py | 4 ++++ module/gui/PackageDock.py | 28 +++++++++++++++++++++++++++- module/gui/connector.py | 20 ++++++++++++++++++++ 4 files changed, 70 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 0dbccab1f..28cac097b 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -102,8 +102,8 @@ class PackageCollector(QThread): except: self.children.append(newChild) pos = self.children.index(newChild) - ppos = self.queue.queue.index(self) - parent = self.queue.view.topLevelItem(ppos) + ppos = self.collector.collector.index(self) + parent = self.collector.view.topLevelItem(ppos) item = parent.child(pos) if not item: item = QTreeWidgetItem() @@ -172,6 +172,7 @@ class LinkCollector(QThread): file = self.LinkCollectorFile(self) file.setData(data) self.addFile(id, file) + self.clear(ids) def addFile(self, pid, newFile): pos = None @@ -192,12 +193,28 @@ class LinkCollector(QThread): self.view.insertTopLevelItem(pos, item) item.setData(0, Qt.DisplayRole, QVariant(newFile.getData()["filename"])) item.setData(0, Qt.UserRole, QVariant(pid)) + flags = Qt.ItemIsSelectable | Qt.ItemIsDragEnabled | Qt.ItemIsEnabled + item.setFlags(flags) def getFile(self, pid): for k, file in enumerate(self.collector): if file.getData()["id"] == pid: return file return None + + def clear(self, ids): + toremove = [] + for k, file in enumerate(self.collector): + id = file.getData()["id"] + if not id in ids: + toremove.append(k) + if not toremove: + return + toremove.sort() + toremove.reverse() + for pos in toremove: + del self.collector[k] + self.view.takeTopLevelItem(k) class LinkCollectorFile(): def __init__(self, collector): diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 6d68f4d7a..63ffb86a0 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -39,6 +39,7 @@ class MainWindow(QMainWindow): self.newLinkDock = NewLinkDock() self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) self.connect(self.newLinkDock, SIGNAL("done"), self.slotAddLinks) + self.connect(self.newPackDock, SIGNAL("done"), self.slotAddPackage) #central widget, layout self.masterlayout = QVBoxLayout() @@ -156,3 +157,6 @@ class MainWindow(QMainWindow): def slotAddLinks(self, links): self.emit(SIGNAL("addLinks"), links) + + def slotAddPackage(self, name, ids): + self.emit(SIGNAL("addPackage"), name, ids) diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py index c97e9d645..7367efda4 100644 --- a/module/gui/PackageDock.py +++ b/module/gui/PackageDock.py @@ -26,6 +26,18 @@ class NewPackageDock(QDockWidget): self.setWidget(self.widget) self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) self.hide() + + def slotDone(self): + view = self.widget.view + count = view.topLevelItemCount() + ids = [] + for i in range(count): + item = view.topLevelItem(i) + if item: + ids.append(item.data(0, Qt.UserRole).toInt()[0]) + self.emit(SIGNAL("done"), self.widget.nameInput.text(), ids) + view.clear() + self.hide() class NewPackageWindow(QWidget): def __init__(self, dock): @@ -38,7 +50,19 @@ class NewPackageWindow(QWidget): nameInput = QLineEdit() linksLabel = QLabel("Links in this Package") - linkView = QListWidget() + linkView = QTreeWidget() + linkView.setSelectionBehavior(QAbstractItemView.SelectRows) + linkView.setSelectionMode(QAbstractItemView.SingleSelection) + linkView.setColumnCount(1) + linkView.setHeaderLabels(["Name"]) + linkView.setDragEnabled(True) + linkView.setDragDropMode(QAbstractItemView.DragDrop) + linkView.setDropIndicatorShown(True) + linkView.setAcceptDrops(True) + linkView.setDragDropOverwriteMode(True) + + self.view = linkView + self.nameInput = nameInput save = QPushButton("Create") @@ -47,3 +71,5 @@ class NewPackageWindow(QWidget): layout.addWidget(linksLabel, 1, 0, 1, 2) layout.addWidget(linkView, 2, 0, 1, 2) layout.addWidget(save, 3, 0, 1, 2) + + self.connect(save, SIGNAL("clicked()"), self.dock.slotDone) diff --git a/module/gui/connector.py b/module/gui/connector.py index 32da29bba..e7a151c5e 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -177,3 +177,23 @@ class connector(QThread): self.proxy.unpause_server() finally: self.mutex.unlock() + + def newPackage(self, name): + """ + create a new package and return id + """ + self.mutex.lock() + try: + return self.proxy.new_package(name) + finally: + self.mutex.unlock() + + def addFileToPackage(self, fileid, packid): + """ + add a file from collector to package + """ + self.mutex.lock() + try: + self.proxy.move_file_2_package(fileid, packid) + finally: + self.mutex.unlock() -- cgit v1.2.3 From 59eaacc4228707f715be147350adb0a670de6985 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 17:57:17 +0100 Subject: save window state --- module/config/gui_default.xml | 4 ++++ module/gui/LinkDock.py | 1 + module/gui/MainWindow.py | 27 ++++++++++++++++++++++++++- module/gui/PackageDock.py | 1 + 4 files changed, 32 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/config/gui_default.xml b/module/config/gui_default.xml index af38eda4c..9b6d75936 100644 --- a/module/config/gui_default.xml +++ b/module/config/gui_default.xml @@ -4,4 +4,8 @@ <name>Local</name> </connection> </connections> + <mainWindow> + <state></state> + <geometry></geometry> + </mainWindow> </root> diff --git a/module/gui/LinkDock.py b/module/gui/LinkDock.py index 01a0cc193..99429d04b 100644 --- a/module/gui/LinkDock.py +++ b/module/gui/LinkDock.py @@ -22,6 +22,7 @@ from PyQt4.QtGui import * class NewLinkDock(QDockWidget): def __init__(self): QDockWidget.__init__(self, "New Links") + self.setObjectName("New Links Dock") self.widget = NewLinkWindow(self) self.setWidget(self.widget) self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 63ffb86a0..4f92f68a9 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -33,6 +33,9 @@ class MainWindow(QMainWindow): self.setWindowIcon(QIcon("icons/logo.png")) self.resize(750,500) + #layout version + self.version = 1 + #init docks self.newPackDock = NewPackageDock() self.addDockWidget(Qt.RightDockWidgetArea, self.newPackDock) @@ -89,7 +92,8 @@ class MainWindow(QMainWindow): self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close) def init_toolbar(self): - self.toolbar = self.addToolBar("main") + self.toolbar = self.addToolBar("Main Toolbar") + self.toolbar.setObjectName("Main Toolbar") self.toolbar.setIconSize(QSize(40,40)) self.actions["toggle_status"] = self.toolbar.addAction("Toggle Pause/Resume") pricon = QIcon() @@ -160,3 +164,24 @@ class MainWindow(QMainWindow): def slotAddPackage(self, name, ids): self.emit(SIGNAL("addPackage"), name, ids) + + def closeEvent(self, event): + state_raw = self.saveState(self.version) + geo_raw = self.saveGeometry() + + state = str(state_raw.toBase64()) + geo = str(geo_raw.toBase64()) + + self.emit(SIGNAL("saveMainWindow"), state, geo) + event.accept() + + def restoreWindow(self, state, geo): + state = QByteArray(state) + geo = QByteArray(geo) + + state_raw = QByteArray.fromBase64(state) + geo_raw = QByteArray.fromBase64(geo) + + self.restoreState(state_raw, self.version) + self.restoreGeometry(geo_raw) + diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py index 7367efda4..b90e3533d 100644 --- a/module/gui/PackageDock.py +++ b/module/gui/PackageDock.py @@ -22,6 +22,7 @@ from PyQt4.QtGui import * class NewPackageDock(QDockWidget): def __init__(self): QDockWidget.__init__(self, "New Package") + self.setObjectName("New Package Dock") self.widget = NewPackageWindow(self) self.setWidget(self.widget) self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) -- cgit v1.2.3 From 7dd0c96037b0f91f761126d20e477e0e83e20825 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Mon, 21 Dec 2009 18:15:56 +0100 Subject: total progressbar bullshit --- module/web/ServerThread.py | 10 +- module/web/ServerThread.py.orig | 27 ++ module/web/media/css/jquery-ui-1.7.2.custom.css | 406 ++++++++++++++++++++++ module/web/media/img/progressbar.gif | Bin 0 -> 120 bytes module/web/media/img/progressbg_black.gif | Bin 0 -> 1626 bytes module/web/media/img/progressbg_green.gif | Bin 0 -> 1308 bytes module/web/media/img/progressbg_orange.gif | Bin 0 -> 1308 bytes module/web/media/img/progressbg_red.gif | Bin 0 -> 1308 bytes module/web/media/img/progressbg_yellow.gif | Bin 0 -> 1308 bytes module/web/media/js/funktions.js | 16 + module/web/media/js/jquery-ui-1.7.2.custom.min.js | 298 ++++++++++++++++ module/web/media/js/jquery.progressbar.js | 183 ++++++++++ module/web/media/js/sprintf.js | 123 +++++++ module/web/templates/default/add.html | 12 + module/web/templates/default/base.html | 198 ++--------- module/web/templates/default/home.html | 10 +- 16 files changed, 1101 insertions(+), 182 deletions(-) create mode 100644 module/web/ServerThread.py.orig create mode 100644 module/web/media/css/jquery-ui-1.7.2.custom.css create mode 100644 module/web/media/img/progressbar.gif create mode 100644 module/web/media/img/progressbg_black.gif create mode 100644 module/web/media/img/progressbg_green.gif create mode 100644 module/web/media/img/progressbg_orange.gif create mode 100644 module/web/media/img/progressbg_red.gif create mode 100644 module/web/media/img/progressbg_yellow.gif create mode 100644 module/web/media/js/funktions.js create mode 100644 module/web/media/js/jquery-ui-1.7.2.custom.min.js create mode 100644 module/web/media/js/jquery.progressbar.js create mode 100644 module/web/media/js/sprintf.js create mode 100644 module/web/templates/default/add.html (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 2ac39c2c8..cebf0ce2f 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,11 +1,9 @@ #!/usr/bin/env python -from __future__ import with_statement import threading from os.path import join from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT -import os class WebServer(threading.Thread): def __init__(self, pycore): @@ -18,15 +16,13 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=False) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code - sleep(1) - with open("webserver.pid", "r") as f: - self.pid = int(f.read().strip()) while self.running: sleep(1) def quit(self): - os.kill(self.pid, SIGINT) + self.p.terminate() self.running = False + diff --git a/module/web/ServerThread.py.orig b/module/web/ServerThread.py.orig new file mode 100644 index 000000000..d092f9348 --- /dev/null +++ b/module/web/ServerThread.py.orig @@ -0,0 +1,27 @@ +#!/usr/bin/env python +import threading +from os.path import join +from subprocess import Popen, PIPE, STDOUT +from time import sleep +from signal import SIGINT + +class WebServer(threading.Thread): + def __init__(self, pycore): + threading.Thread.__init__(self) + self.pycore = pycore + self.running = True + self.setDaemon(True) + + def run(self): + host = self.pycore.config['webinterface']['host'] + port = self.pycore.config['webinterface']['port'] + self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=False) + #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) + #@TODO: better would be real python code + while self.running: + sleep(1) + + def quit(self): + self.p.terminate() + self.running = False diff --git a/module/web/media/css/jquery-ui-1.7.2.custom.css b/module/web/media/css/jquery-ui-1.7.2.custom.css new file mode 100644 index 000000000..62589261a --- /dev/null +++ b/module/web/media/css/jquery-ui-1.7.2.custom.css @@ -0,0 +1,406 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-active .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(ui-lightness/images/ui-icons_228ef1_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffd27a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #666666 url(ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } +.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(ui-lightness/images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/module/web/media/img/progressbar.gif b/module/web/media/img/progressbar.gif new file mode 100644 index 000000000..abe588c15 Binary files /dev/null and b/module/web/media/img/progressbar.gif differ diff --git a/module/web/media/img/progressbg_black.gif b/module/web/media/img/progressbg_black.gif new file mode 100644 index 000000000..74fd1f9b3 Binary files /dev/null and b/module/web/media/img/progressbg_black.gif differ diff --git a/module/web/media/img/progressbg_green.gif b/module/web/media/img/progressbg_green.gif new file mode 100644 index 000000000..f3f3bf681 Binary files /dev/null and b/module/web/media/img/progressbg_green.gif differ diff --git a/module/web/media/img/progressbg_orange.gif b/module/web/media/img/progressbg_orange.gif new file mode 100644 index 000000000..808cac7cf Binary files /dev/null and b/module/web/media/img/progressbg_orange.gif differ diff --git a/module/web/media/img/progressbg_red.gif b/module/web/media/img/progressbg_red.gif new file mode 100644 index 000000000..54dfa135f Binary files /dev/null and b/module/web/media/img/progressbg_red.gif differ diff --git a/module/web/media/img/progressbg_yellow.gif b/module/web/media/img/progressbg_yellow.gif new file mode 100644 index 000000000..fdb0dfc98 Binary files /dev/null and b/module/web/media/img/progressbg_yellow.gif differ diff --git a/module/web/media/js/funktions.js b/module/web/media/js/funktions.js new file mode 100644 index 000000000..ed1471595 --- /dev/null +++ b/module/web/media/js/funktions.js @@ -0,0 +1,16 @@ +// JavaScript Document +function SecToRightTime(sek) +{ + vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : ''; + vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 ); + return vreturn; +} + +function HumanFileSize(size) +{ + var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); + var loga = Math.log(size)/Math.log(1024); + var i = Math.floor(loga); + var a = Math.pow(1024, i); + return Math.round( size / a , 2) + " " + filesizename[i]; +} \ No newline at end of file diff --git a/module/web/media/js/jquery-ui-1.7.2.custom.min.js b/module/web/media/js/jquery-ui-1.7.2.custom.min.js new file mode 100644 index 000000000..cf19f30a9 --- /dev/null +++ b/module/web/media/js/jquery-ui-1.7.2.custom.min.js @@ -0,0 +1,298 @@ +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/* + * jQuery UI Droppable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * ui.core.js + * ui.draggable.js + */ +(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/* + * jQuery UI Resizable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + */ +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* + * jQuery UI Selectable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/* + * jQuery UI Sortable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Accordion 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* + * jQuery UI Dialog 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + */ +(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/* + * jQuery UI Slider 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* + * jQuery UI Tabs 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading…</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/* + * jQuery UI Datepicker 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Datepicker + * + * Depends: + * ui.core.js + */ +(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* + * jQuery UI Progressbar 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/* + * jQuery UI Effects Blind 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Blind + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Bounce 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Bounce + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Clip 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Clip + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Drop 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Drop + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Explode 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Explode + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* + * jQuery UI Effects Fold 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Highlight 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Pulsate 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Scale 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Scale + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Shake 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Shake + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Slide 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Slide + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Transfer 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Transfer + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/module/web/media/js/jquery.progressbar.js b/module/web/media/js/jquery.progressbar.js new file mode 100644 index 000000000..93a12d59a --- /dev/null +++ b/module/web/media/js/jquery.progressbar.js @@ -0,0 +1,183 @@ +/* + * jQuery Progress Bar plugin + * Version 2.0 (06/22/2009) + * @requires jQuery v1.2.1 or later + * + * Copyright (c) 2008 Gary Teo + * http://t.wits.sg + +USAGE: + $(".someclass").progressBar(); + $("#progressbar").progressBar(); + $("#progressbar").progressBar(45); // percentage + $("#progressbar").progressBar({showText: false }); // percentage with config + $("#progressbar").progressBar(45, {showText: false }); // percentage with config +*/ +(function($) { + $.extend({ + progressBar: new function() { + + this.defaults = { + steps : 1, // steps taken to reach target + step_duration : 1, + max : 100, // Upon 100% i'd assume, but configurable + showText : true, // show text with percentage in next to the progressbar? - default : true + textFormat : 'percentage', // Or otherwise, set to 'fraction' + width : '100%', // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' + height : 12, // Height of the progressbar - don't forget to adjust your image too!!! + callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc + /*boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar + barImage : { + 0: '/media/img/progressbg_red.gif', + 30: '/media/img/progressbg_orange.gif', + 70: '/media/img/progressbg_green.gif' + }, + + */ + // Internal use + running_value : 0, + value : 0, + image : null + }; + + /* public methods */ + this.construct = function(arg1, arg2) { + var argvalue = null; + var argconfig = null; + + if (arg1 != null) { + if (!isNaN(arg1)) { + argvalue = arg1; + if (arg2 != null) { + argconfig = arg2; + } + } else { + argconfig = arg1; + } + } + + return this.each(function(child) { + var pb = this; + var config = this.config; + + if (argvalue != null && this.bar != null && this.config != null) { + this.config.value = argvalue + if (argconfig != null) + pb.config = $.extend(this.config, argconfig); + config = pb.config; + } else { + var $this = $(this); + var config = $.extend({}, $.progressBar.defaults, argconfig); + config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided + + if (argvalue == null) + argvalue = $this.html().replace("%","") // parse percentage + + config.value = argvalue; + config.running_value = 0; + config.image = getBarImage(config); + + $this.html(""); + var bar = document.createElement('img'); + var text = document.createElement('span'); + var $bar = $(bar); + var $text = $(text); + pb.bar = $bar; + + $bar.attr('id', config.id + "_pbImage"); + $text.attr('id', config.id + "_pbText"); + $text.html(getText(config)); + $bar.attr('title', getText(config)); + $bar.attr('alt', getText(config)); + $bar.attr('src', config.boxImage); + $bar.attr('width', config.width); + $bar.css("width", config.width + "px"); + $bar.css("height", config.height + "px"); + $bar.css("background-image", "url(" + config.image + ")"); + $bar.css("background-position", ((config.width * -1)) + 'px 50%'); + $bar.css("padding", "0"); + $bar.css("margin", "0"); + $this.append($bar); + $this.append($text); + } + + function getPercentage(config) { + return config.running_value * 100 / config.max; + } + + function getBarImage(config) { + var image = config.barImage; + if (typeof(config.barImage) == 'object') { + for (var i in config.barImage) { + if (config.running_value >= parseInt(i)) { + image = config.barImage[i]; + } else { break; } + } + } + return image; + } + + function getText(config) { + if (config.showText) { + if (config.textFormat == 'percentage') { + return " " + Math.round(config.running_value) + "%"; + } else if (config.textFormat == 'fraction') { + return " " + config.running_value + '/' + config.max; + } + } + } + + config.increment = Math.round((config.value - config.running_value)/config.steps); + if (config.increment < 0) + config.increment *= -1; + if (config.increment < 1) + config.increment = 1; + + var t = setInterval(function() { + var pixels = config.width / 100; // Define how many pixels go into 1% + var stop = false; + + if (config.running_value > config.value) { + if (config.running_value - config.increment < config.value) { + config.running_value = config.value; + } else { + config.running_value -= config.increment; + } + } + else if (config.running_value < config.value) { + if (config.running_value + config.increment > config.value) { + config.running_value = config.value; + } else { + config.running_value += config.increment; + } + } + + if (config.running_value == config.value) + clearInterval(t); + + var $bar = $("#" + config.id + "_pbImage"); + var $text = $("#" + config.id + "_pbText"); + var image = getBarImage(config); + if (image != config.image) { + $bar.css("background-image", "url(" + image + ")"); + config.image = image; + } + $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); + $bar.attr('title', getText(config)); + $text.html(getText(config)); + + if (config.callback != null && typeof(config.callback) == 'function') + config.callback(config); + + pb.config = config; + }, config.step_duration); + }); + }; + } + }); + + $.fn.extend({ + progressBar: $.progressBar.construct + }); + +})(jQuery); \ No newline at end of file diff --git a/module/web/media/js/sprintf.js b/module/web/media/js/sprintf.js new file mode 100644 index 000000000..30d9046de --- /dev/null +++ b/module/web/media/js/sprintf.js @@ -0,0 +1,123 @@ +// JavaScript Document +sprintfWrapper = { + + init : function () { + + if (typeof arguments == "undefined") { return null; } + if (arguments.length < 1) { return null; } + if (typeof arguments[0] != "string") { return null; } + if (typeof RegExp == "undefined") { return null; } + + var string = arguments[0]; + var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); + var matches = new Array(); + var strings = new Array(); + var convCount = 0; + var stringPosStart = 0; + var stringPosEnd = 0; + var matchPosEnd = 0; + var newString = ''; + var match = null; + + while (match = exp.exec(string)) { + if (match[9]) { convCount += 1; } + + stringPosStart = matchPosEnd; + stringPosEnd = exp.lastIndex - match[0].length; + strings[strings.length] = string.substring(stringPosStart, stringPosEnd); + + matchPosEnd = exp.lastIndex; + matches[matches.length] = { + match: match[0], + left: match[3] ? true : false, + sign: match[4] || '', + pad: match[5] || ' ', + min: match[6] || 0, + precision: match[8], + code: match[9] || '%', + negative: parseInt(arguments[convCount]) < 0 ? true : false, + argument: String(arguments[convCount]) + }; + } + strings[strings.length] = string.substring(matchPosEnd); + + if (matches.length == 0) { return string; } + if ((arguments.length - 1) < convCount) { return null; } + + var code = null; + var match = null; + var i = null; + + for (i=0; i<matches.length; i++) { + + if (matches[i].code == '%') { substitution = '%' } + else if (matches[i].code == 'b') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'c') { + matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'd') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'f') { + matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'o') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 's') { + matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'x') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'X') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); + } + else { + substitution = matches[i].match; + } + + newString += strings[i]; + newString += substitution; + + } + newString += strings[i]; + + return newString; + + }, + + convert : function(match, nosign){ + if (nosign) { + match.sign = ''; + } else { + match.sign = match.negative ? '-' : match.sign; + } + var l = match.min - match.argument.length + 1 - match.sign.length; + var pad = new Array(l < 0 ? 0 : l).join(match.pad); + if (!match.left) { + if (match.pad == "0" || nosign) { + return match.sign + pad + match.argument; + } else { + return pad + match.sign + match.argument; + } + } else { + if (match.pad == "0" || nosign) { + return match.sign + match.argument + pad.replace(/0/g, ' '); + } else { + return match.sign + match.argument + pad; + } + } + } +} +sprintf = sprintfWrapper.init; \ No newline at end of file diff --git a/module/web/templates/default/add.html b/module/web/templates/default/add.html new file mode 100644 index 000000000..525cb99bd --- /dev/null +++ b/module/web/templates/default/add.html @@ -0,0 +1,12 @@ +{% extends 'default/base.html' %} + +{% block subtitle %} +Add Links / Container +{% endblock %} + + + +{% block content %} +<textarea rows="5" style=" width: 100%;"></textarea> +<input type="file" /> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 657bdcf09..94d8c3dd2 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -6,144 +6,23 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> -<script src="{{ MEDIA_URL }}/js/jquery-1.3.2.min.js"></script> +<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css"> +<script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script> +<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script> +<script src="{{ MEDIA_URL }}js/sprintf.js"></script> +<script src="{{ MEDIA_URL }}js/funktions.js"></script> +<script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script> {% block head %} {% endblock %} <title>{% block title %}pyLoad Webinterface{% endblock %}</title> +</head> <script type="text/javascript"> -sprintfWrapper = { - - init : function () { - - if (typeof arguments == "undefined") { return null; } - if (arguments.length < 1) { return null; } - if (typeof arguments[0] != "string") { return null; } - if (typeof RegExp == "undefined") { return null; } - - var string = arguments[0]; - var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); - var matches = new Array(); - var strings = new Array(); - var convCount = 0; - var stringPosStart = 0; - var stringPosEnd = 0; - var matchPosEnd = 0; - var newString = ''; - var match = null; - - while (match = exp.exec(string)) { - if (match[9]) { convCount += 1; } - - stringPosStart = matchPosEnd; - stringPosEnd = exp.lastIndex - match[0].length; - strings[strings.length] = string.substring(stringPosStart, stringPosEnd); - - matchPosEnd = exp.lastIndex; - matches[matches.length] = { - match: match[0], - left: match[3] ? true : false, - sign: match[4] || '', - pad: match[5] || ' ', - min: match[6] || 0, - precision: match[8], - code: match[9] || '%', - negative: parseInt(arguments[convCount]) < 0 ? true : false, - argument: String(arguments[convCount]) - }; - } - strings[strings.length] = string.substring(matchPosEnd); - - if (matches.length == 0) { return string; } - if ((arguments.length - 1) < convCount) { return null; } - - var code = null; - var match = null; - var i = null; - - for (i=0; i<matches.length; i++) { - - if (matches[i].code == '%') { substitution = '%' } - else if (matches[i].code == 'b') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'c') { - matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'd') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'f') { - matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'o') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 's') { - matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'x') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'X') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); - substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); - } - else { - substitution = matches[i].match; - } - - newString += strings[i]; - newString += substitution; - - } - newString += strings[i]; - - return newString; - - }, - - convert : function(match, nosign){ - if (nosign) { - match.sign = ''; - } else { - match.sign = match.negative ? '-' : match.sign; - } - var l = match.min - match.argument.length + 1 - match.sign.length; - var pad = new Array(l < 0 ? 0 : l).join(match.pad); - if (!match.left) { - if (match.pad == "0" || nosign) { - return match.sign + pad + match.argument; - } else { - return pad + match.sign + match.argument; - } - } else { - if (match.pad == "0" || nosign) { - return match.sign + match.argument + pad.replace(/0/g, ' '); - } else { - return match.sign + match.argument + pad; - } - } - } -} -sprintf = sprintfWrapper.init; +$(document).ready(function(){ + $.getJSON('/json/links', LinksToContent ); + $.getJSON('/json/status', LoadJsonToContent ); +}); -//var SetInver = new Array(); -function HumanFileSize(size) -{ - var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); - var loga = Math.log(size)/Math.log(1024); - var i = Math.floor(loga); - var a = Math.pow(1024, i); - return Math.round( size / a , 2) + " " + filesizename[i]; -} /*function UpdateLinks( SetInver, index ) { @@ -158,16 +37,6 @@ function LoadJsonToContent(data) $("#aktiv").text(data.queue); $("#queue").text(data.total); - /*if( data.pause == false ) - { - $("#action_play").hide(); - $("#action_pause").show(); - } - else - { - $("#action_play").show(); - $("#action_pause").hide(); - }*/ setTimeout(function() { $.getJSON('/json/status', LoadJsonToContent ); @@ -175,14 +44,24 @@ function LoadJsonToContent(data) } function LinksToContent(data) { - $("#LinksAktiv").text(''); + $.each(data, function(i,item) { - $("#LinksAktiv").append('<tr id="link_'+item.id+'"><td>'+item.name+'</td><td>'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); + //$("#LinksAktiv").append('<tr id="link_'+item.id+'"><td id="link_'+item.id+'_name">'+item.name+'</td><td id="link_'+item.id+'_status">'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); //SetInver[i] = (item.size / 100 ) / item.speed ; //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); - $("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); - $(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); + //$("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); + //$(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); + //var width = (100/item.size)*(item.size-item.kbleft); + //alert(width); + //$(".link_"+item.id+"_pgb").animate({ width: +"%"}, /*(item.size / item.speed)*1000*/1500, "linear" ); + //$("#link_"+item.id+"_pgb").fadeIn(); + /*$("#link_"+item.id+"_pgb").progressBar(); + $("#link_"+item.id+"_pgb").progressBar('option' , 'width' , '100%'); + $("#link_"+item.id+"_pgb").progressBar('option' , 'showText' , true); + $("#link_"+item.id+"_pgb").progressBar('option' , 'textFormat' , 'percentage');*/ + $("#link_"+item.id+"_pgb").progressBar((100/item.size)*(item.size-item.kbleft)); + }); //UpdateLinks(SetInver, 0); setTimeout(function() @@ -191,29 +70,6 @@ function LinksToContent(data) }, 4000); } -function SecToRightTime(sek) -{ - vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : ''; - vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 ); - return vreturn; -} - -$(document).ready(function(){ - //$('#action_pause').hide(); - - - /*$("#play").hover( - function() - { // mouseover - $(this).attr("id", "highlight"); - }, - function() - { // mouseout - $(this).attr("id", ""); - });*/ - $.getJSON('/json/links', LinksToContent ); - $.getJSON('/json/status', LoadJsonToContent ); -}); </script> </head> @@ -250,6 +106,8 @@ $(document).ready(function(){ </li> <li> <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> + <li> + <a href="/add/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" />Add</a></li> <li> <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right"> @@ -274,7 +132,7 @@ $(document).ready(function(){ {% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a class="action backlink">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> - <li><a class="action cog">Active: <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li> + <li><a class="action cog">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 43cf16ae0..acc185444 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -21,13 +21,13 @@ Active Downloads <tr id="link_{{ link.id }}"> <td id="link_{{ link.id }}_name">{{ link.name }}</td> <td id="link_{{ link.id }}_status">{{ link.status }}</td> - <td id="link_{{ link.id }}_eta">{{ content.eta }} @ {{content.speed }}</td> - <td id="link_{{ link.id }}_kbleft">{{ link.kbleft }}</td> - <td id="link_{{ link.id }}_percent"><font id="aktiv_percent">{{ link.percent }}</font>% / {{ link.size }}</td> + <td id="link_{{ link.id }}_info">{{ link.info }}</td> + <td id="link_{{ link.id }}_kbleft">{{ link.size }}</td> + <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#link_{{ link.id }}_pgb').progressBar(50);">load</a></td> </tr> <tr> - <td colspan="5"> - <div id="link_{{ link.id }}_pgb" class="progress_bar" style="overflow: hidden; width: {{ link.percent }}%; display: block;"> </div> + <td colspan="5" class="ui-progressbar ui-widget ui-widget-content ui-corner-all"> + <div id="link_{{ link.id }}_pgb" class="ui-progressbar-value ui-widget-header ui-corner-left" style="overflow: hidden; width: {{ link.percent }}%; display: block;"> </div> </td> </tr> {% endfor %} -- cgit v1.2.3 From 3b51c365eb34c6da317bab588d9567b1695883c8 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 18:51:31 +0100 Subject: merged Wugy --- module/web/pyload.db | Bin 44032 -> 44032 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module') diff --git a/module/web/pyload.db b/module/web/pyload.db index 013c8607d..e5e224850 100644 Binary files a/module/web/pyload.db and b/module/web/pyload.db differ -- cgit v1.2.3 From 63d4273065f475719e63e5785abdbf11be43dae3 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 21 Dec 2009 19:19:28 +0100 Subject: reverted files, pyload.db fix --- module/web/ServerThread.py | 10 +++++++--- module/web/ServerThread.py.orig | 27 --------------------------- module/web/pyload.db | Bin 44032 -> 0 bytes module/web/pyload_default.db | Bin 0 -> 44032 bytes 4 files changed, 7 insertions(+), 30 deletions(-) delete mode 100644 module/web/ServerThread.py.orig delete mode 100644 module/web/pyload.db create mode 100644 module/web/pyload_default.db (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index cebf0ce2f..2ac39c2c8 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -1,9 +1,11 @@ #!/usr/bin/env python +from __future__ import with_statement import threading from os.path import join from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT +import os class WebServer(threading.Thread): def __init__(self, pycore): @@ -16,13 +18,15 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=False) + self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code + sleep(1) + with open("webserver.pid", "r") as f: + self.pid = int(f.read().strip()) while self.running: sleep(1) def quit(self): - self.p.terminate() + os.kill(self.pid, SIGINT) self.running = False - diff --git a/module/web/ServerThread.py.orig b/module/web/ServerThread.py.orig deleted file mode 100644 index d092f9348..000000000 --- a/module/web/ServerThread.py.orig +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env python -import threading -from os.path import join -from subprocess import Popen, PIPE, STDOUT -from time import sleep -from signal import SIGINT - -class WebServer(threading.Thread): - def __init__(self, pycore): - threading.Thread.__init__(self) - self.pycore = pycore - self.running = True - self.setDaemon(True) - - def run(self): - host = self.pycore.config['webinterface']['host'] - port = self.pycore.config['webinterface']['port'] - self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE, shell=False) - #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) - #@TODO: better would be real python code - while self.running: - sleep(1) - - def quit(self): - self.p.terminate() - self.running = False diff --git a/module/web/pyload.db b/module/web/pyload.db deleted file mode 100644 index e5e224850..000000000 Binary files a/module/web/pyload.db and /dev/null differ diff --git a/module/web/pyload_default.db b/module/web/pyload_default.db new file mode 100644 index 000000000..cd39d0ca8 Binary files /dev/null and b/module/web/pyload_default.db differ -- cgit v1.2.3 From 9453269684b8d17411d8bbc4ecd0c7958670ff42 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Mon, 21 Dec 2009 19:59:59 +0100 Subject: log view, progressbar test --- module/web/media/js/jquery.progressbar.js | 10 +++++----- module/web/pyload/urls.py | 1 + module/web/pyload/views.py | 13 +++++++++++-- module/web/settings.py | 5 ++++- module/web/templates/default/base.html | 4 ++-- module/web/templates/default/home.html | 7 +++++-- module/web/templates/default/logs.html | 9 +++++++++ 7 files changed, 37 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/web/media/js/jquery.progressbar.js b/module/web/media/js/jquery.progressbar.js index 93a12d59a..7ddf4a558 100644 --- a/module/web/media/js/jquery.progressbar.js +++ b/module/web/media/js/jquery.progressbar.js @@ -18,22 +18,22 @@ USAGE: progressBar: new function() { this.defaults = { - steps : 1, // steps taken to reach target - step_duration : 1, + steps : 20, // steps taken to reach target + step_duration : 20, max : 100, // Upon 100% i'd assume, but configurable showText : true, // show text with percentage in next to the progressbar? - default : true textFormat : 'percentage', // Or otherwise, set to 'fraction' - width : '100%', // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' + width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' height : 12, // Height of the progressbar - don't forget to adjust your image too!!! callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc - /*boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar + boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar barImage : { 0: '/media/img/progressbg_red.gif', 30: '/media/img/progressbg_orange.gif', 70: '/media/img/progressbg_green.gif' }, - */ + // Internal use running_value : 0, value : 0, diff --git a/module/web/pyload/urls.py b/module/web/pyload/urls.py index 63badeb25..73ba08c21 100644 --- a/module/web/pyload/urls.py +++ b/module/web/pyload/urls.py @@ -12,6 +12,7 @@ urlpatterns = patterns('pyload', (r'^download/(?P<path>[a-zA-z\.0-9\-/_%]+)$', 'views.download',{},'download'), (r'^queue/$', 'views.queue',{}, 'queue'), (r'^logs/$', 'views.logs',{}, 'logs'), + (r'^logs/(?P<page>\d+)$', 'views.logs',{}, 'logs'), (r'^$', 'views.home',{}, 'home'), ) diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 1fa9d45b7..e38a0abf5 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Create your views here. import mimetypes from django.http import HttpResponse @@ -136,5 +138,12 @@ def download(request,path): @login_required @permission('pyload.user.can_see_logs') @check_server -def logs(request): - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{},[status_proc])) \ No newline at end of file +def logs(request, page=0): + + log = file(join(settings.LOG_ROOT, "log.txt")).readlines() + data = [] + page = int(page) + for i in range(page, page+20): + data.append({'line': i+1 , 'content' :log[i]}) + + return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{'log': data, 'next': str(page+20) , 'prev': 0 if page-20 < 0 else page-20},[status_proc])) \ No newline at end of file diff --git a/module/web/settings.py b/module/web/settings.py index 894583aa4..13452b4d0 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -20,6 +20,9 @@ sys.path.append(os.path.join(PYLOAD_DIR, "module")) from XMLConfigParser import XMLConfigParser config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml")) +#DEBUG = config.get("general","debug") + + ssl = "" if config.get("ssl", "activated") == "True": @@ -37,7 +40,7 @@ PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) TEMPLATE = config.get('webinterface','template') DL_ROOT = os.path.join(PYLOAD_DIR, config.get('general','download_folder')) - +LOG_ROOT = os.path.join(PYLOAD_DIR, config.get('log','log_folder')) ADMINS = ( # ('Your Name', 'your_email@domain.com'), diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 94d8c3dd2..98858b9df 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -8,7 +8,7 @@ <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css"> <script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script> -<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script> +<!--<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script>--> <script src="{{ MEDIA_URL }}js/sprintf.js"></script> <script src="{{ MEDIA_URL }}js/funktions.js"></script> <script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script> @@ -67,7 +67,7 @@ function LinksToContent(data) setTimeout(function() { $.getJSON('/json/links', LinksToContent ); - }, 4000); + }, 1000); } </script> diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index acc185444..58c2c5c79 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -26,11 +26,14 @@ Active Downloads <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#link_{{ link.id }}_pgb').progressBar(50);">load</a></td> </tr> <tr> - <td colspan="5" class="ui-progressbar ui-widget ui-widget-content ui-corner-all"> - <div id="link_{{ link.id }}_pgb" class="ui-progressbar-value ui-widget-header ui-corner-left" style="overflow: hidden; width: {{ link.percent }}%; display: block;"> </div> + <td colspan="5"> + </td> </tr> {% endfor %} + + <span id="pb1" class="progressBar">75%</span> + <tbody> </table> {% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/logs.html b/module/web/templates/default/logs.html index 39f4b8660..f9b0504d9 100644 --- a/module/web/templates/default/logs.html +++ b/module/web/templates/default/logs.html @@ -13,4 +13,13 @@ <li class="right" class="selected"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> +{% endblock %} + +{% block content %} +<ul> +{% for line in log %} + <li>{{line.line}}: {{line.content}}</li> +{% endfor %} +</ul> +<a href="{% url logs %}"><< Start</a> <a href="{% url logs prev %}">< prev</a> <a href="{% url logs next %}">next ></a> {% endblock %} \ No newline at end of file -- cgit v1.2.3 From f6af404831d166412f2aa507636ed2825e0e4c0d Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Mon, 21 Dec 2009 23:03:12 +0100 Subject: webserver for win --- module/web/ServerThread.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 2ac39c2c8..0d6044562 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -17,16 +17,27 @@ class WebServer(threading.Thread): def run(self): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] + command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)] self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) - self.p = Popen(['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)], close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) - #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) - #@TODO: better would be real python code - sleep(1) - with open("webserver.pid", "r") as f: - self.pid = int(f.read().strip()) - while self.running: + + if os.name == 'posix': + self.p = Popen(command, close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) + #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) + #@TODO: better would be real python code sleep(1) + with open("webserver.pid", "r") as f: + self.pid = int(f.read().strip()) + while self.running: + sleep(1) + else: + self.p = Popen(command, stderr=PIPE, stdin=PIPE, stdout=PIPE) + while self.running: + sleep(1) def quit(self): - os.kill(self.pid, SIGINT) + if os.name == 'posix': + os.kill(self.pid, SIGINT) + else: + self.p.kill() + self.running = False -- cgit v1.2.3 From ed36dd5988907019cc9cc5b98265f00a52462c85 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Tue, 22 Dec 2009 17:07:35 +0100 Subject: more docstrings, small design changes --- module/gui/Collector.py | 34 +++++++++++++++ module/gui/MainWindow.py | 107 ++++++++++++++++++++++++++++++++++++++++++++++- module/gui/Queue.py | 79 ++++++++++++++++++++++++++-------- module/gui/connector.py | 13 ++++++ 4 files changed, 214 insertions(+), 19 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 28cac097b..1d622b006 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -42,7 +42,9 @@ class PackageCollector(QThread): def update(self): locker = QMutexLocker(self.mutex) packs = self.connector.getPackageCollector() + ids = [] for data in packs: + ids.append(data["id"]) pack = self.getPack(data["id"]) if not pack: pack = self.PackageCollectorPack(self) @@ -56,6 +58,8 @@ class PackageCollector(QThread): child = self.PackageCollectorFile(self, pack) child.setData(info) pack.addChild(fid, child) + #pack.clear(files) + self.clear(ids) def addPack(self, pid, newPack): pos = None @@ -83,6 +87,18 @@ class PackageCollector(QThread): return pack return None + def clear(self, ids): + toremove = [] + for k, pack in enumerate(self.collector): + id = pack.getData()["id"] + if not id in ids: + toremove.append(k) + if not toremove: + return + self.collector = [] + #self.view.clear() + self.view.emit(SIGNAL("clear")) + class PackageCollectorPack(): def __init__(self, collector): self.collector = collector @@ -111,6 +127,8 @@ class PackageCollector(QThread): status = "%s (%s)" % (newChild.getData()["status_type"], newChild.getData()["plugin"]) item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) item.setData(0, Qt.UserRole, QVariant(cid)) + flags = Qt.ItemIsEnabled + item.setFlags(flags) def getChildren(self): return self.children @@ -129,6 +147,22 @@ class PackageCollector(QThread): def getData(self): return self.data + + def clear(self, ids): + toremove = [] + for k, file in enumerate(self.getChildren()): + id = file.getData()["id"] + if not id in ids: + toremove.append(k) + if not toremove: + return + ppos = self.collector.collector.index(self) + parent = self.collector.view.topLevelItem(ppos) + toremove.sort() + toremove.reverse() + for pos in toremove: + del self.children[k] + parent.takeChild(k) class PackageCollectorFile(): def __init__(self, collector, pack): diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 4f92f68a9..f72ad97de 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -31,7 +31,7 @@ class MainWindow(QMainWindow): #window stuff self.setWindowTitle("pyLoad Client") self.setWindowIcon(QIcon("icons/logo.png")) - self.resize(750,500) + self.resize(850,500) #layout version self.version = 1 @@ -85,13 +85,24 @@ class MainWindow(QMainWindow): #init tabs self.init_tabs() + #context menus + self.init_context() + #layout self.masterlayout.addWidget(self.tabw) + #signals.. self.connect(self.mactions["manager"], SIGNAL("triggered()"), self.slotShowConnector) self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close) + + self.connect(self.tabs["queue"]["view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotQueueContextMenu) + self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotPackageCollectorContextMenu) + self.connect(self.tabs["collector"]["link_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotLinkCollectorContextMenu) def init_toolbar(self): + """ + create toolbar + """ self.toolbar = self.addToolBar("Main Toolbar") self.toolbar.setObjectName("Main Toolbar") self.toolbar.setIconSize(QSize(40,40)) @@ -130,42 +141,102 @@ class MainWindow(QMainWindow): groupLinks = QGroupBox("Links") groupPackage.setLayout(QVBoxLayout()) groupLinks.setLayout(QVBoxLayout()) + toQueue = QPushButton("Push selected packages to queue") self.tabs["collector"]["l"] = QGridLayout() self.tabs["collector"]["w"].setLayout(self.tabs["collector"]["l"]) self.tabs["collector"]["package_view"] = QTreeWidget() + self.connect(self.tabs["collector"]["package_view"], SIGNAL("clear"), self.tabs["collector"]["package_view"].clear) self.tabs["collector"]["link_view"] = QTreeWidget() groupPackage.layout().addWidget(self.tabs["collector"]["package_view"]) + groupPackage.layout().addWidget(toQueue) groupLinks.layout().addWidget(self.tabs["collector"]["link_view"]) self.tabs["collector"]["l"].addWidget(groupPackage, 0, 0) self.tabs["collector"]["l"].addWidget(groupLinks, 0, 1) + self.connect(toQueue, SIGNAL("clicked()"), self.slotPushPackageToQueue) + + def init_context(self): + """ + create context menus + """ + self.queueContext = QMenu() + self.queueContext.buttons = {} + self.queueContext.buttons["remove"] = QAction("Remove", self.queueContext) + self.queueContext.addAction(self.queueContext.buttons["remove"]) def slotToggleStatus(self, status): + """ + pause/start toggle (toolbar) + """ self.emit(SIGNAL("setDownloadStatus"), status) def slotStatusStop(self): + """ + stop button (toolbar) + + dummy + """ print "stop!" def slotAdd(self): + """ + add button (toolbar) + show context menu (choice: links/package) + """ self.addMenu.exec_(QCursor.pos()) def slotShowAddPackage(self): + """ + action from add-menu + show new-package dock + """ self.tabw.setCurrentIndex(1) self.newPackDock.show() def slotShowAddLinks(self): + """ + action from add-menu + show new-links dock + """ self.tabw.setCurrentIndex(1) self.newLinkDock.show() def slotShowConnector(self): + """ + connectionmanager action triggered + let main to the stuff + """ self.emit(SIGNAL("connector")) def slotAddLinks(self, links): + """ + new links + let main to the stuff + """ self.emit(SIGNAL("addLinks"), links) def slotAddPackage(self, name, ids): + """ + new package + let main to the stuff + """ self.emit(SIGNAL("addPackage"), name, ids) - def closeEvent(self, event): + def slotPushPackageToQueue(self): + """ + push collector pack to queue + get child ids + let main to the rest + """ + items = self.tabs["collector"]["package_view"].selectedItems() + for item in items: + id = item.data(0, Qt.UserRole).toPyObject() + self.emit(SIGNAL("pushPackageToQueue"), id) + + def saveWindow(self): + """ + get window state/geometry + pass data to main + """ state_raw = self.saveState(self.version) geo_raw = self.saveGeometry() @@ -173,9 +244,19 @@ class MainWindow(QMainWindow): geo = str(geo_raw.toBase64()) self.emit(SIGNAL("saveMainWindow"), state, geo) + + def closeEvent(self, event): + """ + somebody wants to close me! + let me first save my state + """ + self.saveWindow() event.accept() def restoreWindow(self, state, geo): + """ + restore window state/geometry + """ state = QByteArray(state) geo = QByteArray(geo) @@ -184,4 +265,26 @@ class MainWindow(QMainWindow): self.restoreState(state_raw, self.version) self.restoreGeometry(geo_raw) + + def slotQueueContextMenu(self, pos): + """ + custom context menu in queue view requested + """ + globalPos = self.tabs["queue"]["view"].mapToGlobal(pos) + i = self.tabs["queue"]["view"].itemAt(pos) + i.setSelected(True) + self.addFav.setData(QVariant(i)) + self.showContext.exec_(globalPos) + + def slotPackageCollectorContextMenu(self, pos): + """ + custom context menu in package collector view requested + """ + pass + + def slotLinkCollectorContextMenu(self, pos): + """ + custom context menu in link collector view requested + """ + pass diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 52f11fd8c..c9a3e858b 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -19,7 +19,7 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * -from time import sleep +from time import sleep, time class Queue(QThread): def __init__(self, view, connector): @@ -37,8 +37,9 @@ class Queue(QThread): } self.statusMapReverse = dict((v,k) for k, v in self.statusMap.iteritems()) self.queue = [] - self.interval = 2 + self.interval = 1 self.running = True + self.wait_dict = {} self.mutex = QMutex() def run(self): @@ -54,7 +55,7 @@ class Queue(QThread): packs = self.connector.getPackageQueue() downloading_raw = self.connector.getDownloadQueue() downloading = {} - for d in downloading: + for d in downloading_raw: did = d["id"] del d["id"] del d["name"] @@ -73,7 +74,7 @@ class Queue(QThread): if not child: child = self.QueueFile(self, pack) try: - info["downloading"] = downloading[data["id"]] + info["downloading"] = downloading[info["id"]] except: info["downloading"] = None child.setData(info) @@ -98,13 +99,22 @@ class Queue(QThread): self.view.insertTopLevelItem(pos, item) item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) status = -1 + speed = self.getSpeed(newPack) + plugins = [] for child in newPack.getChildren(): if self.statusMap.has_key(child.data["status_type"]) and self.statusMap[child.data["status_type"]] > status: status = self.statusMap[child.data["status_type"]] + if not child.data["plugin"] in plugins: + plugins.append(child.data["plugin"]) if status >= 0: - item.setData(1, Qt.DisplayRole, QVariant(self.statusMapReverse[status])) + if speed == None: + statustxt = self.statusMapReverse[status] + else: + statustxt = "%s (%s KB/s)" % (self.statusMapReverse[status], speed) + item.setData(2, Qt.DisplayRole, QVariant(statustxt)) + item.setData(1, Qt.DisplayRole, QVariant(", ".join(plugins))) item.setData(0, Qt.UserRole, QVariant(pid)) - item.setData(2, Qt.UserRole, QVariant(newPack)) + item.setData(3, Qt.UserRole, QVariant(newPack)) def getPack(self, pid): for k, pack in enumerate(self.queue): @@ -112,6 +122,27 @@ class Queue(QThread): return pack return None + def getWaitingProgress(self, q): + locker = QMutexLocker(self.mutex) + if isinstance(q, self.QueueFile): + data = q.getData() + if data["status_type"] == "waiting" and data["downloading"]: + until = float(data["downloading"]["wait_until"]) + try: + since, until_old = self.wait_dict[data["id"]] + if not until == until_old: + raise Exception + except: + since = time() + self.wait_dict[data["id"]] = since, until + since = float(since) + max_wait = float(until-since) + rest = int(until-time()) + res = 100/max_wait + perc = rest*res + return perc, rest + return None + def getProgress(self, q): locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): @@ -142,7 +173,7 @@ class Queue(QThread): return 0 def getSpeed(self, q): - locker = QMutexLocker(self.mutex) + #locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): data = q.getData() if data["downloading"]: @@ -151,15 +182,18 @@ class Queue(QThread): children = q.getChildren() count = len(children) speed_sum = 0 + all_waiting = True for child in children: val = 0 data = child.getData() running = False if data["downloading"]: + if not data["status_type"] == "waiting": + all_waiting = False val = int(data["downloading"]["speed"]) running = True speed_sum += val - if count == 0 or not running: + if count == 0 or not running or all_waiting: return None return speed_sum return None @@ -189,11 +223,16 @@ class Queue(QThread): if not item: item = QTreeWidgetItem() parent.insertChild(pos, item) - status = "%s (%s)" % (newChild.getData()["status_type"], newChild.getData()["plugin"]) + speed = self.queue.getSpeed(newChild) + if speed == None: + status = newChild.getData()["status_type"] + else: + status = "%s (%s KB/s)" % (newChild.getData()["status_type"], speed) item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) - item.setData(1, Qt.DisplayRole, QVariant(status)) + item.setData(2, Qt.DisplayRole, QVariant(status)) + item.setData(1, Qt.DisplayRole, QVariant(newChild.getData()["plugin"])) item.setData(0, Qt.UserRole, QVariant(cid)) - item.setData(2, Qt.UserRole, QVariant(newChild)) + item.setData(3, Qt.UserRole, QVariant(newChild)) def getChildren(self): return self.children @@ -217,6 +256,7 @@ class Queue(QThread): def __init__(self, queue, pack): self.queue = queue self.pack = pack + self.wait_since = None def getData(self): return self.data @@ -233,9 +273,15 @@ class QueueProgressBarDelegate(QItemDelegate): self.queue = queue def paint(self, painter, option, index): - if index.column() == 2: + if index.column() == 3: qe = index.data(Qt.UserRole).toPyObject() - progress = self.queue.getProgress(qe) + w = self.queue.getWaitingProgress(qe) + wait = None + if w: + progress = w[0] + wait = w[1] + else: + progress = self.queue.getProgress(qe) opts = QStyleOptionProgressBarV2() opts.maximum = 100 opts.minimum = 0 @@ -245,11 +291,10 @@ class QueueProgressBarDelegate(QItemDelegate): opts.rect.setHeight(option.rect.height()-1) opts.textVisible = True opts.textAlignment = Qt.AlignCenter - speed = self.queue.getSpeed(qe) - if speed == None: - opts.text = QString.number(opts.progress) + "%" + if not wait == None: + opts.text = QString("waiting %d seconds" % (wait,)) else: - opts.text = QString("%s kb/s - %s" % (speed, opts.progress)) + "%" + opts.text = QString.number(opts.progress) + "%" QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter) return QItemDelegate.paint(self, painter, option, index) diff --git a/module/gui/connector.py b/module/gui/connector.py index e7a151c5e..2a1ce511e 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -37,6 +37,9 @@ class connector(QThread): self.addr = None def setAddr(self, addr): + """ + set new address + """ self.mutex.lock() self.addr = addr self.mutex.unlock() @@ -197,3 +200,13 @@ class connector(QThread): self.proxy.move_file_2_package(fileid, packid) finally: self.mutex.unlock() + + def pushPackageToQueue(self, packid): + """ + push a package to queue + """ + self.mutex.lock() + try: + self.proxy.push_package_2_queue(packid) + finally: + self.mutex.unlock() -- cgit v1.2.3 From a5ff0482ede8bd7bd932482887f2f7cdae5039d9 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 23 Dec 2009 00:04:36 +0100 Subject: core: downloadlimit is not far away ;) gui: restart download action --- module/Plugin.py | 7 ++- module/file_list.py | 12 +++++ module/gui/MainWindow.py | 19 ++++++- module/gui/connector.py | 20 +++++++ module/network/Request.py | 130 +++++++++++++++++++++++++++++++++++++++------- 5 files changed, 164 insertions(+), 24 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 3285ae8dd..7e6ca4e35 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -85,8 +85,11 @@ class Plugin(): if re.search(r"(?!http://).*\.(dlc|ccf|rsdf|txt)", self.parent.url): return exists(self.parent.url) header = self.req.load(self.parent.url, just_header=True) - if re.search(r"HTTP/1.1 404 Not Found", header): - return False + try: + if re.search(r"HTTP/1.1 404 Not Found", header): + return False + except: + pass return True def get_file_url(self): diff --git a/module/file_list.py b/module/file_list.py index 1d3b1a68f..f156e2c0d 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -350,6 +350,15 @@ class File_List(object): pyfile.package = pypack pypack.files.append(pyfile) packager.file_list.data[key][n] = pypack + + def resetFileStatus(packager, fileid): + packager.file_list.lock.acquire() + try: + key, n, pyfile, pypack, pid = packager._getFileFromID(fileid) + pyfile.init() + pyfile.status.type = None + finally: + packager.file_list.lock.release() #oooops, duplicate? def removeFileFromPackage(packager, id, pid): @@ -380,6 +389,9 @@ class PyLoadFile(): self.core = file_list.core self.package = None self.filename = "n/a" + self.init() + + def init(self): self.active = False pluginName = self._get_my_plugin() if pluginName: diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index f72ad97de..837125263 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -153,6 +153,9 @@ class MainWindow(QMainWindow): self.tabs["collector"]["l"].addWidget(groupPackage, 0, 0) self.tabs["collector"]["l"].addWidget(groupLinks, 0, 1) self.connect(toQueue, SIGNAL("clicked()"), self.slotPushPackageToQueue) + self.tabs["collector"]["package_view"].setContextMenuPolicy(Qt.CustomContextMenu) + self.tabs["collector"]["link_view"].setContextMenuPolicy(Qt.CustomContextMenu) + self.tabs["queue"]["view"].setContextMenuPolicy(Qt.CustomContextMenu) def init_context(self): """ @@ -160,8 +163,12 @@ class MainWindow(QMainWindow): """ self.queueContext = QMenu() self.queueContext.buttons = {} + self.queueContext.item = (None, None) self.queueContext.buttons["remove"] = QAction("Remove", self.queueContext) + self.queueContext.buttons["restart"] = QAction("Restart", self.queueContext) self.queueContext.addAction(self.queueContext.buttons["remove"]) + self.queueContext.addAction(self.queueContext.buttons["restart"]) + self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload) def slotToggleStatus(self, status): """ @@ -273,8 +280,8 @@ class MainWindow(QMainWindow): globalPos = self.tabs["queue"]["view"].mapToGlobal(pos) i = self.tabs["queue"]["view"].itemAt(pos) i.setSelected(True) - self.addFav.setData(QVariant(i)) - self.showContext.exec_(globalPos) + self.queueContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) + self.queueContext.exec_(globalPos) def slotPackageCollectorContextMenu(self, pos): """ @@ -287,4 +294,12 @@ class MainWindow(QMainWindow): custom context menu in link collector view requested """ pass + + def slotRestartDownload(self): + """ + restart download action is triggered + """ + id, isTopLevel = self.queueContext.item + if not id == None: + self.emit(SIGNAL("restartDownload"), id, isTopLevel) diff --git a/module/gui/connector.py b/module/gui/connector.py index 2a1ce511e..75781ebb1 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -210,3 +210,23 @@ class connector(QThread): self.proxy.push_package_2_queue(packid) finally: self.mutex.unlock() + + def restartPackage(self, packid): + """ + restart a package + """ + self.mutex.lock() + try: + self.proxy.restart_package(packid) + finally: + self.mutex.unlock() + + def restartFile(self, fileid): + """ + restart a file + """ + self.mutex.lock() + try: + self.proxy.restart_file(fileid) + finally: + self.mutex.unlock() diff --git a/module/network/Request.py b/module/network/Request.py index 7cdae7c0f..ab90044d3 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -15,7 +15,8 @@ import urllib from cStringIO import StringIO try: - import pycurl + #import pycurl + raise Exception except: import urllib2 from Keepalive import HTTPHandler @@ -49,12 +50,22 @@ class Request: self.auth = False self.timeout = 5 - + + bufferBase = 1024 + bufferMulti = 2 + self.bufferSize = bufferBase*bufferMulti + self.canContinue = False + + self.dl_speed = 0.0 + + self.speedLimitActive = False + self.maxSpeed = 100 * 1024 + try: if pycurl: self.curl = True except: self.curl = False - + if self.curl: self.init_curl() @@ -98,6 +109,7 @@ class Request: self.pycurl.setopt(pycurl.PROGRESSFUNCTION, self.progress) self.pycurl.setopt(pycurl.AUTOREFERER, 1) self.pycurl.setopt(pycurl.HEADERFUNCTION, self.write_header) + self.pycurl.setopt(pycurl.BUFFERSIZE, self.bufferSize) self.pycurl.setopt(pycurl.USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10") @@ -150,6 +162,7 @@ class Request: return self.get_rep() else: + req = urllib2.Request(url, data=post) if ref and self.lastURL is not None: @@ -159,12 +172,13 @@ class Request: self.add_cookies(req) #add cookies - rep = self.opener.open(req) + rep = self.opener.open(req, timeout=2) for cookie in self.cj.make_cookies(rep, req): self.cookies.append(cookie) - - output = rep.read() + + if not just_header: + output = rep.read() if rep.headers.has_key("content-encoding"): if rep.headers["content-encoding"] == "gzip": @@ -172,6 +186,9 @@ class Request: self.lastEffectiveURL = rep.geturl() self.lastURL = url + + if just_header: + return rep.headers return output @@ -232,13 +249,16 @@ class Request: get = "" if self.curl: - file_temp = self.get_free_name(file_name + ".part") - fp = open(file_temp, 'wb') + file_temp = self.get_free_name(file_name) + ".part" + self.fp = open(file_temp, 'wb') + if not self.canContinue: + self.fp.truncate() + partSize = self.fp.tell() self.init_curl() self.pycurl.setopt(pycurl.URL, url) - self.pycurl.setopt(pycurl.WRITEDATA, fp) + #self.pycurl.setopt(pycurl.WRITEDATA, fp) if cookies: self.curl_enable_cookies() @@ -254,7 +274,45 @@ class Request: self.dl_arrived = 0 self.dl_time = time.time() self.dl = True - + + self.chunkSize = 0 # only for loop to start + self.chunkRead = 0 + self.subStartTime = 0 + self.maxChunkSize = 0 + + def restLimit(): + subTime = time.time() - self.subStartTime + if subTime <= 1: + if self.speedLimitActive: + return self.maxChunkSize + else: + return -1 + else: + self.dl_speed = float(self.chunkRead/1024) / subTime + + self.subStartTime = time.time() + self.chunkRead = 0 + if self.maxSpeed > 0: + self.maxChunkSize = self.maxSpeed + else: + self.maxChunkSize = 0 + return 0 + + def writefunc(buf): + if self.abort: + raise AbortDownload + chunkSize = len(buf) + while chunkSize > restLimit() > -1: + time.sleep(0.05) + self.maxChunkSize -= chunkSize + self.fp.write(buf) + self.chunkRead += chunkSize + self.dl_arrived += chunkSize + + + self.pycurl.setopt(pycurl.WRITEFUNCTION, writefunc) + + self.pycurl.perform() #~ if "..." in file_name: #~ download_folder = dirname(file_name) + sep @@ -266,14 +324,17 @@ class Request: #~ file_name = file_name.replace("=?UTF-8?B?", "").replace("?=", "==") #~ file_name = b64decode(file_name) #~ file_name = download_folder + sep + file_name - + + self.fp.close() + + if self.abort: + raise AbortDownload + rename(file_temp, self.get_free_name(file_name)) self.dl = False self.dl_finished = time.time() - fp.close() - return True else: @@ -290,10 +351,15 @@ class Request: for cookie in self.cj.make_cookies(rep, req): self.cookies.append(cookie) - + + self.dl = False if not self.dl: self.dl = True - file = open(file_name, 'wb') + file_temp = self.get_free_name(file_name) + ".part" + file = open(file_temp, 'wb') + if not self.canContinue: + file.truncate() + partSize = file.tell() conn = self.downloader.open(req, post) if conn.headers.has_key("content-length"): @@ -302,14 +368,37 @@ class Request: self.dl_size = 0 self.dl_arrived = 0 self.dl_time = time.time() - for chunk in conn: - if self.abort: raise AbortDownload - self.dl_arrived += len(chunk) - file.write(chunk) + + chunkSize = 1 + while chunkSize > 0: + if self.abort: + break + chunkRead = 0 + if not self.speedLimitActive: + maxChunkSize = -1 + elif self.maxSpeed > 0: + maxChunkSize = self.maxSpeed + else: + maxChunkSize = 0 + subStartTime = time.time() + while (time.time() - subStartTime) <= 1: + if maxChunkSize == -1 or chunkRead <= maxChunkSize: + chunk = conn.read(self.bufferSize) + chunkSize = len(chunk) + file.write(chunk) + self.dl_arrived += chunkSize + chunkRead += chunkSize + else: + time.sleep(0.05) + subTime = time.time() - subStartTime + self.dl_speed = float(chunkRead/1024) / subTime file.close() + if self.abort: + raise AbortDownload self.dl = False self.dl_finished = time.time() + rename(file_temp, self.get_free_name(file_name)) return True def write_header(self, string): @@ -328,7 +417,8 @@ class Request: def get_speed(self): try: - return (self.dl_arrived / ((time.time() if self.dl else self.dl_finished) - self.dl_time)) / 1024 + #return (self.dl_arrived / ((time.time() if self.dl else self.dl_finished) - self.dl_time)) / 1024 + return self.dl_speed except: return 0 -- cgit v1.2.3 From e069eb9d6e201aedf16917781649fa05203562eb Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 23 Dec 2009 00:05:46 +0100 Subject: oops --- module/network/Request.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index ab90044d3..4aca935dc 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -15,8 +15,7 @@ import urllib from cStringIO import StringIO try: - #import pycurl - raise Exception + import pycurl except: import urllib2 from Keepalive import HTTPHandler -- cgit v1.2.3 From 5ee3579572b60bb8f9e6475a517d69462b0cfe29 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 23 Dec 2009 21:04:06 +0100 Subject: download speed limit --- module/XMLConfigParser.py | 10 ++++- module/config/core.xml | 58 -------------------------- module/config/core_default.xml | 59 +++++++++++++++++++++++++++ module/network/Request.py | 34 ++++++++++++--- module/thread_list.py | 93 ++++++++++++++++++++++++++++++++++++++++-- 5 files changed, 184 insertions(+), 70 deletions(-) delete mode 100644 module/config/core.xml create mode 100644 module/config/core_default.xml (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index b46f9c959..51741fdfd 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -17,18 +17,24 @@ """ from __future__ import with_statement +from os.path import exists + from xml.dom.minidom import parse class XMLConfigParser(): - def __init__(self, data): + def __init__(self, data, default_data=None): self.xml = None self.file = data + self.file_default = default_data self.config = {} self.loadData() self.root = None def loadData(self): - with open(self.file, 'r') as fh: + file = self.file + if not exists(self.file): + file = self.file_default + with open(file, 'r') as fh: self.xml = parse(fh) self._read_config() diff --git a/module/config/core.xml b/module/config/core.xml deleted file mode 100644 index 6da85cf32..000000000 --- a/module/config/core.xml +++ /dev/null @@ -1,58 +0,0 @@ -<config> - <remote> - <port>7227</port> - <listenaddr>0.0.0.0</listenaddr> - <username>admin</username> - <password>pwhere</password> - </remote> - <ssl> - <activated>False</activated> - <cert>ssl.srt</cert> - <key>ssl.key</key> - </ssl> - <webinterface> - <activated>True</activated> - <host>0.0.0.0</host> - <port>8000</port> - <template>default</template> - <local>True</local> - <ssl>None</ssl> - <username>None</username> - <adress>None</adress> - <extport>None</extport> - <pw>None</pw> - </webinterface> - <log> - <file_log>True</file_log> - <log_folder>Logs</log_folder> - <log_count>5</log_count> - </log> - <general> - <language>de</language> - <download_folder>Downloads</download_folder> - <max_downloads>3</max_downloads> - <use_reconnect>False</use_reconnect> - <link_file>links.txt</link_file> - <failed_file>failed_links.txt</failed_file> - <reconnect_method>reconnect_method</reconnect_method> - <debug_mode>False</debug_mode> - <max_download_time>5</max_download_time> - </general> - <updates> - <search_updates>True</search_updates> - <install_updates>False</install_updates> - </updates> - <reconnectTime> - <start>0:00</start> - <end>0:00</end> - </reconnectTime> - <downloadTime> - <start>0:00</start> - <end>0:00</end> - </downloadTime> - <proxy> - <activated>False</activated> - <adress>http://localhost:8080</adress> - <protocol>http</protocol> - </proxy> -</config> diff --git a/module/config/core_default.xml b/module/config/core_default.xml new file mode 100644 index 000000000..56ac2825c --- /dev/null +++ b/module/config/core_default.xml @@ -0,0 +1,59 @@ +<config> + <remote> + <port>7227</port> + <listenaddr>0.0.0.0</listenaddr> + <username>admin</username> + <password>pwhere</password> + </remote> + <ssl> + <activated>False</activated> + <cert>ssl.srt</cert> + <key>ssl.key</key> + </ssl> + <webinterface> + <activated>True</activated> + <host>0.0.0.0</host> + <port>8000</port> + <template>default</template> + <local>True</local> + <ssl>None</ssl> + <username>None</username> + <adress>None</adress> + <extport>None</extport> + <pw>None</pw> + </webinterface> + <log> + <file_log>True</file_log> + <log_folder>Logs</log_folder> + <log_count>5</log_count> + </log> + <general> + <language>de</language> + <download_folder>Downloads</download_folder> + <max_downloads>3</max_downloads> + <use_reconnect>False</use_reconnect> + <link_file>links.txt</link_file> + <failed_file>failed_links.txt</failed_file> + <reconnect_method>reconnect_method</reconnect_method> + <debug_mode>False</debug_mode> + <max_download_time>5</max_download_time> + <download_speed_limit>0</download_speed_limit> + </general> + <updates> + <search_updates>True</search_updates> + <install_updates>False</install_updates> + </updates> + <reconnectTime> + <start>0:00</start> + <end>0:00</end> + </reconnectTime> + <downloadTime> + <start>0:00</start> + <end>0:00</end> + </downloadTime> + <proxy> + <activated>False</activated> + <adress>http://localhost:8080</adress> + <protocol>http</protocol> + </proxy> +</config> diff --git a/module/network/Request.py b/module/network/Request.py index 4aca935dc..752c16f04 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -51,14 +51,19 @@ class Request: self.timeout = 5 bufferBase = 1024 - bufferMulti = 2 + bufferMulti = 4 self.bufferSize = bufferBase*bufferMulti self.canContinue = False self.dl_speed = 0.0 + self.averageSpeed = 0.0 + self.averageSpeeds = [] + self.averageSpeedTime = 0.0 + self.averageSpeedCount = 0.0 self.speedLimitActive = False - self.maxSpeed = 100 * 1024 + self.maxSpeed = 0 + self.isSlow = False try: if pycurl: self.curl = True @@ -171,7 +176,7 @@ class Request: self.add_cookies(req) #add cookies - rep = self.opener.open(req, timeout=2) + rep = self.opener.open(req) for cookie in self.cj.make_cookies(rep, req): self.cookies.append(cookie) @@ -287,7 +292,7 @@ class Request: else: return -1 else: - self.dl_speed = float(self.chunkRead/1024) / subTime + self.updateCurrentSpeed(float(self.chunkRead/1024) / subTime) self.subStartTime = time.time() self.chunkRead = 0 @@ -390,7 +395,7 @@ class Request: else: time.sleep(0.05) subTime = time.time() - subStartTime - self.dl_speed = float(chunkRead/1024) / subTime + self.updateCurrentSpeed(float(chunkRead/1024) / subTime) file.close() if self.abort: @@ -399,7 +404,24 @@ class Request: self.dl_finished = time.time() rename(file_temp, self.get_free_name(file_name)) return True - + + def updateCurrentSpeed(self, speed): + self.dl_speed = speed + if self.averageSpeedTime + 10 < time.time(): + self.averageSpeeds = [] + self.averageSpeeds.append(self.averageSpeed) + self.averageSpeeds.append(speed) + self.averageSpeed = (speed + self.averageSpeed)/2 + self.averageSpeedTime = time.time() + self.averageSpeedCount = 2 + else: + self.averageSpeeds.append(speed) + self.averageSpeedCount += 1 + allspeed = 0.0 + for s in self.averageSpeeds: + allspeed += s + self.averageSpeed = allspeed / self.averageSpeedCount + def write_header(self, string): self.header += string diff --git a/module/thread_list.py b/module/thread_list.py index d78a9b95c..9cdb5fc8f 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -21,7 +21,7 @@ from __future__ import with_statement from os.path import exists import re import subprocess -from threading import RLock +from threading import RLock, Thread import time import urllib2 @@ -40,6 +40,7 @@ class Thread_List(object): self.reconnecting = False self.select_thread() + self.speedManager = self.SpeedManager(self) def create_thread(self): """ creates thread for Py_Load_File and append thread to self.threads @@ -207,10 +208,94 @@ class Thread_List(object): out.wait() def scripts_download_finished(self, pluginname, url, filename, location): - map(lambda script: subprocess.Popen([script, pluginname, url, filename, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + map(lambda script: subprocess.Popen([script, pluginname, url, filename, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) def scripts_package_finished(self, name, location): #@TODO Implement! - map(lambda script: subprocess.Popen([script, name, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + map(lambda script: subprocess.Popen([script, name, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) def scripts_reconnected(self, ip): - map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + + class SpeedManager(Thread): + def __init__(self, parent): + Thread.__init__(self) + self.parent = parent + self.running = True + self.lastSlowCheck = 0.0 + + stat = {} + stat["slow_downloads"] = None + stat["each_speed"] = None + stat["each_speed_optimized"] = None + self.stat = stat + + self.slowCheckInterval = 60 + self.slowCheckTestTime = 25 + + self.logger = self.parent.parent.logger + self.start() + + def run(self): + while self.running: + time.sleep(1) + self.manageSpeed() + + def getMaxSpeed(self): + return self.parent.parent.getMaxSpeed() + + def manageSpeed(self): + maxSpeed = self.getMaxSpeed() + if maxSpeed <= 0: + for thread in self.parent.py_downloading: + thread.plugin.req.speedLimitActive = False + return + threads = self.parent.py_downloading + threadCount = len(threads) + if threadCount <= 0: + return + eachSpeed = maxSpeed/threadCount + + currentOverallSpeed = 0 + restSpeed = maxSpeed - currentOverallSpeed + speeds = [] + for thread in threads: + currentOverallSpeed += thread.plugin.req.dl_speed + speeds.append((thread.plugin.req.dl_speed, thread.plugin.req.averageSpeed, thread)) + thread.plugin.req.speedLimitActive = True + + if currentOverallSpeed+50 < maxSpeed: + for thread in self.parent.py_downloading: + thread.plugin.req.speedLimitActive = False + return + + print "-----" + + slowCount = 0 + slowSpeed = 0 + if self.lastSlowCheck + self.slowCheckInterval + self.slowCheckTestTime < time.time(): + self.lastSlowCheck = time.time() + if self.lastSlowCheck + self.slowCheckInterval < time.time() < self.lastSlowCheck + self.slowCheckInterval + self.slowCheckTestTime: + for speed in speeds: + speed[2].plugin.req.isSlow = False + else: + for speed in speeds: + if speed[0] <= eachSpeed-7: + if speed[1] < eachSpeed-15: + if speed[2].plugin.req.dl_time > 0 and speed[2].plugin.req.dl_time+30 < time.time(): + speed[2].plugin.req.isSlow = True + if not speed[1]-5 < speed[2].plugin.req.maxSpeed/1024 < speed[1]+5: + speed[2].plugin.req.maxSpeed = (speed[1]+10)*1024 + if speed[2].plugin.req.isSlow: + slowCount += 1 + slowSpeed += speed[2].plugin.req.maxSpeed/1024 + + stat["slow_downloads"] = slowCount + stat["each_speed"] = eachSpeed + eachSpeed = (maxSpeed - slowSpeed) / (threadCount - slowCount) + stat["each_speed_optimized"] = eachSpeed + for speed in speeds: + if speed[2].plugin.req.isSlow: + continue + speed[2].plugin.req.maxSpeed = eachSpeed*1024 + print "max", speed[2].plugin.req.maxSpeed, "current", speed[2].plugin.req.dl_speed + -- cgit v1.2.3 From ea04c11ce1fb52895449a56e862eff5448ea456a Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 24 Dec 2009 01:28:08 +0100 Subject: downloads are now aborted correctly, gui: remove downloads, new icons --- module/file_list.py | 6 ++++++ module/gui/Collector.py | 55 ++++++++++++++++++++--------------------------- module/gui/MainWindow.py | 20 ++++++++++++++--- module/gui/Queue.py | 30 ++++++++++++++++++++++++-- module/gui/connector.py | 20 +++++++++++++++++ module/network/Request.py | 14 +++++++----- module/thread_list.py | 2 -- 7 files changed, 103 insertions(+), 44 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index f156e2c0d..9d7260889 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -29,6 +29,7 @@ import cPickle import re import module.Plugin from os import sep +from time import sleep class NoSuchElementException(Exception): pass @@ -285,6 +286,9 @@ class File_List(object): packager.file_list.lock.acquire() try: key, n, pypack = packager._getPackageFromID(id) + for pyfile in pypack.files: + pyfile.plugin.req.abort = True + sleep(0.1) del packager.file_list.data[key][n] finally: packager.file_list.lock.release() @@ -296,6 +300,8 @@ class File_List(object): packager.file_list.lock.acquire() try: key, n, pyfile, pypack, pid = packager._getFileFromID(id) + pyfile.plugin.req.abort = True + sleep(0.1) del pypack.files[n] if not pypack.files: packager.removePackage(pid) diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 1d622b006..1f89670ce 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -58,7 +58,7 @@ class PackageCollector(QThread): child = self.PackageCollectorFile(self, pack) child.setData(info) pack.addChild(fid, child) - #pack.clear(files) + pack.clear(files) self.clear(ids) def addPack(self, pid, newPack): @@ -88,15 +88,14 @@ class PackageCollector(QThread): return None def clear(self, ids): - toremove = [] - for k, pack in enumerate(self.collector): - id = pack.getData()["id"] - if not id in ids: - toremove.append(k) - if not toremove: + clear = False + for pack in self.collector: + if not pack.getData()["id"] in ids: + clear = True + break + if not clear: return self.collector = [] - #self.view.clear() self.view.emit(SIGNAL("clear")) class PackageCollectorPack(): @@ -149,20 +148,15 @@ class PackageCollector(QThread): return self.data def clear(self, ids): - toremove = [] - for k, file in enumerate(self.getChildren()): - id = file.getData()["id"] - if not id in ids: - toremove.append(k) - if not toremove: + clear = False + for file in self.getChildren(): + if not file.getData()["id"] in ids: + clear = True + break + if not clear: return - ppos = self.collector.collector.index(self) - parent = self.collector.view.topLevelItem(ppos) - toremove.sort() - toremove.reverse() - for pos in toremove: - del self.children[k] - parent.takeChild(k) + self.collector.collector = [] + self.collector.view.emit(SIGNAL("clear")) class PackageCollectorFile(): def __init__(self, collector, pack): @@ -237,18 +231,15 @@ class LinkCollector(QThread): return None def clear(self, ids): - toremove = [] - for k, file in enumerate(self.collector): - id = file.getData()["id"] - if not id in ids: - toremove.append(k) - if not toremove: + clear = False + for pack in self.collector: + if not pack.getData()["id"] in ids: + clear = True + break + if not clear: return - toremove.sort() - toremove.reverse() - for pos in toremove: - del self.collector[k] - self.view.takeTopLevelItem(k) + self.collector = [] + self.view.emit(SIGNAL("clear")) class LinkCollectorFile(): def __init__(self, collector): diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 837125263..53de8cd54 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -147,6 +147,7 @@ class MainWindow(QMainWindow): self.tabs["collector"]["package_view"] = QTreeWidget() self.connect(self.tabs["collector"]["package_view"], SIGNAL("clear"), self.tabs["collector"]["package_view"].clear) self.tabs["collector"]["link_view"] = QTreeWidget() + self.connect(self.tabs["collector"]["link_view"], SIGNAL("clear"), self.tabs["collector"]["link_view"].clear) groupPackage.layout().addWidget(self.tabs["collector"]["package_view"]) groupPackage.layout().addWidget(toQueue) groupLinks.layout().addWidget(self.tabs["collector"]["link_view"]) @@ -164,10 +165,11 @@ class MainWindow(QMainWindow): self.queueContext = QMenu() self.queueContext.buttons = {} self.queueContext.item = (None, None) - self.queueContext.buttons["remove"] = QAction("Remove", self.queueContext) - self.queueContext.buttons["restart"] = QAction("Restart", self.queueContext) + self.queueContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.queueContext) + self.queueContext.buttons["restart"] = QAction(QIcon("icons/gui/refresh_small.png"), "Restart", self.queueContext) self.queueContext.addAction(self.queueContext.buttons["remove"]) self.queueContext.addAction(self.queueContext.buttons["restart"]) + self.connect(self.queueContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload) def slotToggleStatus(self, status): @@ -279,9 +281,13 @@ class MainWindow(QMainWindow): """ globalPos = self.tabs["queue"]["view"].mapToGlobal(pos) i = self.tabs["queue"]["view"].itemAt(pos) + if not i: + return i.setSelected(True) self.queueContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) - self.queueContext.exec_(globalPos) + menuPos = QCursor.pos() + menuPos.setX(menuPos.x()+2) + self.queueContext.exec_(menuPos) def slotPackageCollectorContextMenu(self, pos): """ @@ -302,4 +308,12 @@ class MainWindow(QMainWindow): id, isTopLevel = self.queueContext.item if not id == None: self.emit(SIGNAL("restartDownload"), id, isTopLevel) + + def slotRemoveDownload(self): + """ + remove download action is triggered + """ + id, isTopLevel = self.queueContext.item + if not id == None: + self.emit(SIGNAL("removeDownload"), id, isTopLevel) diff --git a/module/gui/Queue.py b/module/gui/Queue.py index c9a3e858b..35e1163b9 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -61,8 +61,10 @@ class Queue(QThread): del d["name"] del d["status"] downloading[did] = d + ids = [] for data in packs: pack = self.getPack(data["id"]) + ids.append(data["id"]) if not pack: pack = self.QueuePack(self) pack.setData(data) @@ -73,12 +75,15 @@ class Queue(QThread): child = pack.getChild(fid) if not child: child = self.QueueFile(self, pack) + info["downloading"] = None try: info["downloading"] = downloading[info["id"]] except: - info["downloading"] = None + pass child.setData(info) pack.addChild(fid, child) + pack.clear(files) + self.clear(ids) def addPack(self, pid, newPack): pos = None @@ -122,6 +127,17 @@ class Queue(QThread): return pack return None + def clear(self, ids): + clear = False + for pack in self.queue: + if not pack.getData()["id"] in ids: + clear = True + break + if not clear: + return + self.queue = [] + self.view.emit(SIGNAL("clear")) + def getWaitingProgress(self, q): locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): @@ -173,7 +189,6 @@ class Queue(QThread): return 0 def getSpeed(self, q): - #locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): data = q.getData() if data["downloading"]: @@ -251,6 +266,17 @@ class Queue(QThread): def getData(self): return self.data + + def clear(self, ids): + clear = False + for file in self.getChildren(): + if not file.getData()["id"] in ids: + clear = True + break + if not clear: + return + self.queue.queue = [] + self.queue.view.emit(SIGNAL("clear")) class QueueFile(): def __init__(self, queue, pack): diff --git a/module/gui/connector.py b/module/gui/connector.py index 75781ebb1..4d3af0d61 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -230,3 +230,23 @@ class connector(QThread): self.proxy.restart_file(fileid) finally: self.mutex.unlock() + + def removePackage(self, packid): + """ + remove a package + """ + self.mutex.lock() + try: + self.proxy.del_packages([packid,]) + finally: + self.mutex.unlock() + + def removeFile(self, fileid): + """ + remove a file + """ + self.mutex.lock() + try: + self.proxy.del_links([fileid,]) + finally: + self.mutex.unlock() diff --git a/module/network/Request.py b/module/network/Request.py index 752c16f04..651553a0f 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -304,7 +304,7 @@ class Request: def writefunc(buf): if self.abort: - raise AbortDownload + return False chunkSize = len(buf) while chunkSize > restLimit() > -1: time.sleep(0.05) @@ -316,8 +316,12 @@ class Request: self.pycurl.setopt(pycurl.WRITEFUNCTION, writefunc) - - self.pycurl.perform() + try: + self.pycurl.perform() + except Exception, e: + code, msg = e + if not code == 23: + raise Exception, e #~ if "..." in file_name: #~ download_folder = dirname(file_name) + sep #~ headers = self.get_header() @@ -438,7 +442,6 @@ class Request: def get_speed(self): try: - #return (self.dl_arrived / ((time.time() if self.dl else self.dl_finished) - self.dl_time)) / 1024 return self.dl_speed except: return 0 @@ -453,7 +456,8 @@ class Request: return (self.dl_size - self.dl_arrived) / 1024 def progress(self, dl_t, dl_d, up_t, up_d): - if self.abort: raise AbortDownload + if self.abort: + return False self.dl_arrived = int(dl_d) self.dl_size = int(dl_t) diff --git a/module/thread_list.py b/module/thread_list.py index 9cdb5fc8f..966157b91 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -267,8 +267,6 @@ class Thread_List(object): for thread in self.parent.py_downloading: thread.plugin.req.speedLimitActive = False return - - print "-----" slowCount = 0 slowSpeed = 0 -- cgit v1.2.3 From 5c7e9f0f1325523347a52869cebbf03463550bca Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 24 Dec 2009 01:41:13 +0100 Subject: clean shutdown --- module/thread_list.py | 4 ++++ module/web/ServerThread.py | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index 966157b91..fc4160a6d 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -216,6 +216,10 @@ class Thread_List(object): def scripts_reconnected(self, ip): map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) + def stopAllDownloads(self): + for pyfile in self.py_downloading: + pyfile.plugin.req.abort = True + class SpeedManager(Thread): def __init__(self, parent): Thread.__init__(self) diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 0d6044562..069cabafe 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -36,7 +36,10 @@ class WebServer(threading.Thread): def quit(self): if os.name == 'posix': - os.kill(self.pid, SIGINT) + try: + os.kill(self.pid, SIGINT) + except: + pass else: self.p.kill() -- cgit v1.2.3 From 504b313112be6a82d6eee418ae059646ecfc4b30 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 26 Dec 2009 20:18:11 +0100 Subject: fixed ddl-music, cleaned up, new status (starting), some more fixes --- module/download_thread.py | 1 + module/gui/Queue.py | 15 ++++++++++-- module/gui/connector.py | 54 +++++++++++++++++++++++++++++++++++++++++++ module/network/Request.py | 21 +++++------------ module/plugins/DDLMusicOrg.py | 6 +++-- 5 files changed, 78 insertions(+), 19 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index 401d6f943..be6ff6bf0 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -117,6 +117,7 @@ class Download_Thread(threading.Thread): def download(self, pyfile): status = pyfile.status + status.type = "starting" pyfile.init_download() diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 35e1163b9..f542c9a6b 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -198,10 +198,10 @@ class Queue(QThread): count = len(children) speed_sum = 0 all_waiting = True + running = False for child in children: val = 0 data = child.getData() - running = False if data["downloading"]: if not data["status_type"] == "waiting": all_waiting = False @@ -239,7 +239,7 @@ class Queue(QThread): item = QTreeWidgetItem() parent.insertChild(pos, item) speed = self.queue.getSpeed(newChild) - if speed == None: + if speed == None or newChild.getData()["status_type"] == "starting": status = newChild.getData()["status_type"] else: status = "%s (%s KB/s)" % (newChild.getData()["status_type"], speed) @@ -269,12 +269,23 @@ class Queue(QThread): def clear(self, ids): clear = False + children = {} for file in self.getChildren(): if not file.getData()["id"] in ids: clear = True break + try: + children[file.getData()["id"]] + clear = True + except: + children[file.getData()["id"]] = True + if not clear: return + ppos = self.queue.queue.index(self) + parent = self.queue.view.topLevelItem(ppos) + parent.takeChildren() + self.children = [] self.queue.queue = [] self.queue.view.emit(SIGNAL("clear")) diff --git a/module/gui/connector.py b/module/gui/connector.py index 4d3af0d61..4ac635200 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -35,6 +35,8 @@ class connector(QThread): self.running = True self.proxy = None self.addr = None + self.errorQueue = [] + self.connect(self, SIGNAL("proxy_error"), self._proxyError) def setAddr(self, addr): """ @@ -52,6 +54,7 @@ class connector(QThread): self.connectProxy(self.addr) while self.running: sleep(1) + self.getError() def stop(self): """ @@ -68,6 +71,21 @@ class connector(QThread): if not server_version == SERVER_VERSION: self.emit(SIGNAL("error_box"), "server is version %s client accepts version %s" % (server_version, SERVER_VERSION)) + def _proxyError(self, func): + """ + formats proxy error msg + """ + msg = "proxy error in '%s'" % (func,) + self.errorQueue.append(msg) + + def getError(self): + self.mutex.lock() + if len(self.errorQueue) > 0: + err = self.errorQueue.pop() + print err + self.emit(SIGNAL("error_box"), err) + self.mutex.unlock() + def getLinkCollector(self): """ grab links from collector and return the ids @@ -75,6 +93,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_collector_files() + except: + self.emit(SIGNAL("proxy_error"), "getLinkCollector") finally: self.mutex.unlock() @@ -85,6 +105,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_collector_packages() + except: + self.emit(SIGNAL("proxy_error"), "getPackageCollector") finally: self.mutex.unlock() @@ -95,6 +117,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_file_info(id) + except: + self.emit(SIGNAL("proxy_error"), "getLinkInfo") finally: self.mutex.unlock() @@ -105,6 +129,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_package_data(id) + except: + self.emit(SIGNAL("proxy_error"), "getPackageInfo") finally: self.mutex.unlock() @@ -115,6 +141,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_queue() + except: + self.emit(SIGNAL("proxy_error"), "getPackageQueue") finally: self.mutex.unlock() @@ -125,6 +153,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_package_files(id) + except: + self.emit(SIGNAL("proxy_error"), "getPackageFiles") finally: self.mutex.unlock() @@ -135,6 +165,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.status_downloads() + except: + self.emit(SIGNAL("proxy_error"), "getDownloadQueue") finally: self.mutex.unlock() @@ -145,6 +177,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.status_server() + except: + self.emit(SIGNAL("proxy_error"), "getServerStatus") finally: self.mutex.unlock() @@ -155,6 +189,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.add_urls(links) + except: + self.emit(SIGNAL("proxy_error"), "addURLs") finally: self.mutex.unlock() @@ -165,6 +201,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.toggle_pause() + except: + self.emit(SIGNAL("proxy_error"), "togglePause") finally: self.mutex.unlock() @@ -178,6 +216,8 @@ class connector(QThread): self.proxy.pause_server() else: self.proxy.unpause_server() + except: + self.emit(SIGNAL("proxy_error"), "setPause") finally: self.mutex.unlock() @@ -188,6 +228,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.new_package(name) + except: + self.emit(SIGNAL("proxy_error"), "newPackage") finally: self.mutex.unlock() @@ -198,6 +240,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.move_file_2_package(fileid, packid) + except: + self.emit(SIGNAL("proxy_error"), "addFileToPackage") finally: self.mutex.unlock() @@ -208,6 +252,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.push_package_2_queue(packid) + except: + self.emit(SIGNAL("proxy_error"), "pushPackageToQueue") finally: self.mutex.unlock() @@ -218,6 +264,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.restart_package(packid) + except: + self.emit(SIGNAL("proxy_error"), "restartPackage") finally: self.mutex.unlock() @@ -228,6 +276,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.restart_file(fileid) + except: + self.emit(SIGNAL("proxy_error"), "restartFile") finally: self.mutex.unlock() @@ -238,6 +288,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.del_packages([packid,]) + except: + self.emit(SIGNAL("proxy_error"), "removePackage") finally: self.mutex.unlock() @@ -248,5 +300,7 @@ class connector(QThread): self.mutex.lock() try: self.proxy.del_links([fileid,]) + except: + self.emit(SIGNAL("proxy_error"), "removeFile") finally: self.mutex.unlock() diff --git a/module/network/Request.py b/module/network/Request.py index 651553a0f..c6d6f0901 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -144,7 +144,8 @@ class Request: if cookies: self.curl_enable_cookies() - if post: self.pycurl.setopt(pycurl.POSTFIELDS, post) + if post: + self.pycurl.setopt(pycurl.POSTFIELDS, post) if ref and self.lastURL is not None: self.pycurl.setopt(pycurl.REFERER, self.lastURL) @@ -158,7 +159,7 @@ class Request: return self.header self.pycurl.perform() - + self.lastEffectiveURL = self.pycurl.getinfo(pycurl.EFFECTIVE_URL) self.lastURL = url header = self.get_header() @@ -262,12 +263,12 @@ class Request: self.init_curl() self.pycurl.setopt(pycurl.URL, url) - #self.pycurl.setopt(pycurl.WRITEDATA, fp) if cookies: self.curl_enable_cookies() - if post: self.pycurl.setopt(pycurl.POSTFIELDS, post) + if post: + self.pycurl.setopt(pycurl.POSTFIELDS, post) if self.auth: self.add_auth(self.user, self.pw) @@ -279,7 +280,7 @@ class Request: self.dl_time = time.time() self.dl = True - self.chunkSize = 0 # only for loop to start + self.chunkSize = 0 self.chunkRead = 0 self.subStartTime = 0 self.maxChunkSize = 0 @@ -322,16 +323,6 @@ class Request: code, msg = e if not code == 23: raise Exception, e - #~ if "..." in file_name: - #~ download_folder = dirname(file_name) + sep - #~ headers = self.get_header() - #~ file_name_search = re.search('filename=(?P<quote>\")?(.+)(?(quote)\")', headers) - #~ if file_name_search: - #~ file_name = file_name_search.group(2) - #~ if "?=" in file_name[-3:]: - #~ file_name = file_name.replace("=?UTF-8?B?", "").replace("?=", "==") - #~ file_name = b64decode(file_name) - #~ file_name = download_folder + sep + file_name self.fp.close() diff --git a/module/plugins/DDLMusicOrg.py b/module/plugins/DDLMusicOrg.py index e34e6fbde..c927d261c 100644 --- a/module/plugins/DDLMusicOrg.py +++ b/module/plugins/DDLMusicOrg.py @@ -21,6 +21,7 @@ class DDLMusicOrg(Plugin): self.props = props self.parent = parent self.html = None + self.multi_dl = False def download_html(self): url = self.parent.url @@ -29,7 +30,8 @@ class DDLMusicOrg(Plugin): def file_exists(self): """ returns True or False """ - self.download_html() + if not self.html: + self.download_html() if re.search(r"Wer dies nicht rechnen kann", self.html) != None: return True return False @@ -48,7 +50,7 @@ class DDLMusicOrg(Plugin): else: solve = int(math.group(1)) - int(math.group(3)) sleep(3) - htmlwithlink = self.req.load("http://ddl-music.org%s" % posturl, cookies=True, post={"calc0":solve, "send0":"Send", "id":id, "linknr":linknr}) + htmlwithlink = self.req.load("http://ddl-music.org%s" % posturl, cookies=True, post={"calc%s" % linknr:solve, "send%s" % linknr:"Send", "id":id, "linknr":linknr}) m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) if m: self.links = [m.group(1)] -- cgit v1.2.3 From 8888b714d748398e99f7425fa861f4e165579da6 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 26 Dec 2009 20:46:36 +0100 Subject: fixed view update --- module/gui/Collector.py | 32 ++++++++++++++++++++++---------- module/gui/Queue.py | 20 ++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 1f89670ce..bf0e50349 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -29,6 +29,7 @@ class PackageCollector(QThread): self.collector = [] self.interval = 2 self.running = True + self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() def run(self): @@ -43,6 +44,9 @@ class PackageCollector(QThread): locker = QMutexLocker(self.mutex) packs = self.connector.getPackageCollector() ids = [] + for data in packs: + ids.append(data["id"]) + self.clear(ids) for data in packs: ids.append(data["id"]) pack = self.getPack(data["id"]) @@ -51,6 +55,7 @@ class PackageCollector(QThread): pack.setData(data) self.addPack(data["id"], pack) files = self.connector.getPackageFiles(data["id"]) + pack.clear(files) for fid in files: info = self.connector.getLinkInfo(fid) child = pack.getChild(fid) @@ -58,8 +63,6 @@ class PackageCollector(QThread): child = self.PackageCollectorFile(self, pack) child.setData(info) pack.addChild(fid, child) - pack.clear(files) - self.clear(ids) def addPack(self, pid, newPack): pos = None @@ -74,10 +77,10 @@ class PackageCollector(QThread): except: self.collector.append(newPack) pos = self.collector.index(newPack) - item = self.view.topLevelItem(pos) + item = self.rootItem.child(pos) if not item: item = QTreeWidgetItem() - self.view.insertTopLevelItem(pos, item) + self.rootItem.insertChild(pos, item) item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) item.setData(0, Qt.UserRole, QVariant(pid)) @@ -95,8 +98,8 @@ class PackageCollector(QThread): break if not clear: return - self.collector = [] - self.view.emit(SIGNAL("clear")) + self.queue = [] + self.rootItem.takeChildren() class PackageCollectorPack(): def __init__(self, collector): @@ -118,7 +121,7 @@ class PackageCollector(QThread): self.children.append(newChild) pos = self.children.index(newChild) ppos = self.collector.collector.index(self) - parent = self.collector.view.topLevelItem(ppos) + parent = self.collector.rootItem.child(ppos) item = parent.child(pos) if not item: item = QTreeWidgetItem() @@ -149,14 +152,23 @@ class PackageCollector(QThread): def clear(self, ids): clear = False + children = {} for file in self.getChildren(): if not file.getData()["id"] in ids: clear = True break + try: + children[file.getData()["id"]] + clear = True + except: + children[file.getData()["id"]] = True + if not clear: return - self.collector.collector = [] - self.collector.view.emit(SIGNAL("clear")) + ppos = self.collector.collector.index(self) + parent = self.collector.rootItem.child(ppos) + parent.takeChildren() + self.children = [] class PackageCollectorFile(): def __init__(self, collector, pack): @@ -193,6 +205,7 @@ class LinkCollector(QThread): def update(self): locker = QMutexLocker(self.mutex) ids = self.connector.getLinkCollector() + self.clear(ids) for id in ids: data = self.connector.getLinkInfo(id) file = self.getFile(id) @@ -200,7 +213,6 @@ class LinkCollector(QThread): file = self.LinkCollectorFile(self) file.setData(data) self.addFile(id, file) - self.clear(ids) def addFile(self, pid, newFile): pos = None diff --git a/module/gui/Queue.py b/module/gui/Queue.py index f542c9a6b..0def31bf6 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -40,6 +40,7 @@ class Queue(QThread): self.interval = 1 self.running = True self.wait_dict = {} + self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() def run(self): @@ -63,13 +64,16 @@ class Queue(QThread): downloading[did] = d ids = [] for data in packs: - pack = self.getPack(data["id"]) ids.append(data["id"]) + self.clear(ids) + for data in packs: + pack = self.getPack(data["id"]) if not pack: pack = self.QueuePack(self) pack.setData(data) self.addPack(data["id"], pack) files = self.connector.getPackageFiles(data["id"]) + pack.clear(files) for fid in files: info = self.connector.getLinkInfo(fid) child = pack.getChild(fid) @@ -82,8 +86,6 @@ class Queue(QThread): pass child.setData(info) pack.addChild(fid, child) - pack.clear(files) - self.clear(ids) def addPack(self, pid, newPack): pos = None @@ -98,10 +100,10 @@ class Queue(QThread): except: self.queue.append(newPack) pos = self.queue.index(newPack) - item = self.view.topLevelItem(pos) + item = self.rootItem.child(pos) if not item: item = QTreeWidgetItem() - self.view.insertTopLevelItem(pos, item) + self.rootItem.insertChild(pos, item) item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) status = -1 speed = self.getSpeed(newPack) @@ -136,7 +138,7 @@ class Queue(QThread): if not clear: return self.queue = [] - self.view.emit(SIGNAL("clear")) + self.rootItem.takeChildren() def getWaitingProgress(self, q): locker = QMutexLocker(self.mutex) @@ -233,7 +235,7 @@ class Queue(QThread): self.children.append(newChild) pos = self.children.index(newChild) ppos = self.queue.queue.index(self) - parent = self.queue.view.topLevelItem(ppos) + parent = self.queue.rootItem.child(ppos) item = parent.child(pos) if not item: item = QTreeWidgetItem() @@ -283,11 +285,9 @@ class Queue(QThread): if not clear: return ppos = self.queue.queue.index(self) - parent = self.queue.view.topLevelItem(ppos) + parent = self.queue.rootItem.child(ppos) parent.takeChildren() self.children = [] - self.queue.queue = [] - self.queue.view.emit(SIGNAL("clear")) class QueueFile(): def __init__(self, queue, pack): -- cgit v1.2.3 From 15841561a8e5650d88e4af477b8e4f8f96a81253 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 26 Dec 2009 21:17:45 +0100 Subject: pluginconfig now in xml --- module/Plugin.py | 23 ++++++++++++----------- module/XMLConfigParser.py | 5 ++++- module/config/plugin_default.xml | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 module/config/plugin_default.xml (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 7e6ca4e35..9390cbe07 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -20,15 +20,16 @@ import ConfigParser import logging import re -from os.path import exists +from os.path import exists, join from module.network.Request import Request +from module.XMLConfigParser import XMLConfigParser class Plugin(): def __init__(self, parent): - self.parser = ConfigParser.SafeConfigParser() + self.configparser = XMLConfigParser(join("module","config","plugin.xml"), join("module","config","plugin_default.xml")) self.config = {} props = {} props['name'] = "BasePlugin" @@ -112,19 +113,19 @@ class Plugin(): self.req.download(url, location) def set_config(self): - pass + for k, v in self.config: + self.configparser.set(self.props['name'], k, v) def get_config(self, value): - self.parser.read("pluginconfig") - return self.parser.get(self.props['name'], value) + self.configparser.loadData() + return self.configparser.get(self.props['name'], value) def read_config(self): - self.parser.read("pluginconfig") - - if self.parser.has_section(self.props['name']): - for option in self.parser.options(self.props['name']): - self.config[option] = self.parser.get(self.props['name'], option, raw=True) - self.config[option] = False if self.config[option].lower() == 'false' else self.config[option] + self.configparser.loadData() + try: + self.config = self.configparser.getConfig()[self.props['name']] + except: + pass def init_ocr(self): modul = __import__("module.captcha." + self.props['name'], fromlist=['captcha']) diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 51741fdfd..eedc00b67 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -59,7 +59,10 @@ class XMLConfigParser(): config[section] = {} for opt in node.childNodes: if opt.nodeType == opt.ELEMENT_NODE: - config[section][opt.tagName] = format(opt.firstChild.data) + try: + config[section][opt.tagName] = format(opt.firstChild.data) + except: + config[section][opt.tagName] = "" self.config = config def get(self, section, option, default=None): diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml new file mode 100644 index 000000000..01c0e7ed6 --- /dev/null +++ b/module/config/plugin_default.xml @@ -0,0 +1,39 @@ +<config> + <RapidshareCom> + <!-- possible: + Cogent, Deutsche Telekom, + Level(3), Level(3) #2, + GlobalCrossing, Level(3) #3, + Teleglobe, GlobalCrossing #2, + TeliaSonera #2, Teleglobe #2, + TeliaSonera #3, TeliaSonera + --> + <!-- leave empty for autmomatic selection --> + <server></server> + <premium>False</premium> + <username></username> + <password></password> + </RapidshareCom> + <NetloadIn> + <premium>False</premium> + <username></username> + <password></password> + </NetloadIn> + <UploadedTo> + <premium>False</premium> + <username></username> + <password></password> + </UploadedTo> + <ShareonlineBiz> + <premium>False</premium> + <username></username> + <password></password> + </ShareonlineBiz> + <YoutubeCom> + <high_quality>True</high_quality> + </YoutubeCom> + <YoutubeChannel> + <!-- False for no limitation --> + <max_videos>False</max_videos> + </YoutubeChannel> +</config> -- cgit v1.2.3 From b5d1c47ac2590fe4314d7e96d58443c30463746c Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 26 Dec 2009 22:35:20 +0100 Subject: gui contaoner upload, closes #39 --- module/gui/MainWindow.py | 11 +++++++++++ module/gui/connector.py | 13 +++++++++++++ 2 files changed, 24 insertions(+) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 53de8cd54..744518adb 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -122,9 +122,11 @@ class MainWindow(QMainWindow): self.addMenu = QMenu() packageAction = self.addMenu.addAction("Package") linkAction = self.addMenu.addAction("Links") + containerAction = self.addMenu.addAction("Container") self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) self.connect(packageAction, SIGNAL("triggered()"), self.slotShowAddPackage) self.connect(linkAction, SIGNAL("triggered()"), self.slotShowAddLinks) + self.connect(containerAction, SIGNAL("triggered()"), self.slotShowAddContainer) def init_tabs(self): """ @@ -230,6 +232,15 @@ class MainWindow(QMainWindow): """ self.emit(SIGNAL("addPackage"), name, ids) + def slotShowAddContainer(self): + """ + action from add-menu + show file selector, emit upload + """ + fileNames = QFileDialog.getOpenFileNames(self, "Container Öffnen", "", "All Container Types (*.dlc *.ccf *.rsdf *.txt);;DLC (*.dlc);;CCF (*.ccf);;RSDF (*.rsdf);;Text Files (*.txt)") + for name in fileNames: + self.emit(SIGNAL("addContainer"), str(name)) + def slotPushPackageToQueue(self): """ push collector pack to queue diff --git a/module/gui/connector.py b/module/gui/connector.py index 4ac635200..e52cf42ff 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -304,3 +304,16 @@ class connector(QThread): self.emit(SIGNAL("proxy_error"), "removeFile") finally: self.mutex.unlock() + + def uploadContainer(self, filename, type, content): + """ + upload a container + """ + self.mutex.lock() + try: + self.proxy.upload_container(filename, type, content) + except: + self.emit(SIGNAL("proxy_error"), "uploadContainer") + finally: + self.mutex.unlock() + -- cgit v1.2.3 From 4690417077a7374c99ed980430f44b829296ed26 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 26 Dec 2009 22:45:13 +0100 Subject: fixed rs auth (pycurl doesn't like unicode) --- module/network/Request.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index c6d6f0901..d1280f591 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -207,13 +207,14 @@ class Request: self.auth = True self.user = user self.pw = pw - + + upwstr = str("%s:%s" % (user,pw)) if self.curl: - self.pycurl.setopt(pycurl.HTTPHEADER, ['Authorization: Basic ' + base64.encodestring(user + ':' + pw)[:-1]]) - self.pycurl.setopt(pycurl.USERPWD, user + ":" + pw) + self.pycurl.setopt(pycurl.HTTPHEADER, ['Authorization: Basic ' + base64.encodestring(upwstr)[:-1]]) + self.pycurl.setopt(pycurl.USERPWD, upwstr) self.pycurl.setopt(pycurl.HTTPAUTH, pycurl.HTTPAUTH_ANY) else: - self.downloader.addheaders.append(['Authorization', 'Basic ' + base64.encodestring(user + ':' + pw)[:-1]]) + self.downloader.addheaders.append(['Authorization', 'Basic ' + base64.encodestring(upwstr)[:-1]]) def add_cookies(self, req): cookie_head = "" -- cgit v1.2.3 From 8e87787753b2e049917a5491727d285b1c5a7095 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 27 Dec 2009 00:20:21 +0100 Subject: closes #13 --- module/file_list.py | 8 +- module/plugins/BluehostTo.py | 71 ----------- module/plugins/CCF.py | 55 --------- module/plugins/DDLMusicOrg.py | 58 --------- module/plugins/DLC.pyc | Bin 5740 -> 0 bytes module/plugins/DepositfilesCom.py | 62 ---------- module/plugins/FilefactoryCom.py | 103 ---------------- module/plugins/FilesmonsterCom.py | 94 -------------- module/plugins/FourChanOrg.py | 41 ------- module/plugins/FreakshareNet.py | 144 ---------------------- module/plugins/GigasizeCom.py | 84 ------------- module/plugins/HoerbuchIn.py | 48 -------- module/plugins/HotfileCom.py | 110 ----------------- module/plugins/LinkList.py | 39 ------ module/plugins/LixIn.py | 36 ------ module/plugins/MegauploadCom.py | 83 ------------- module/plugins/MyvideoDe.py | 65 ---------- module/plugins/NetloadIn.py | 157 ------------------------ module/plugins/OneKhDe.py | 38 ------ module/plugins/RSDF.py | 50 -------- module/plugins/RSLayerCom.py | 39 ------ module/plugins/RapidshareCom.py | 191 ----------------------------- module/plugins/RelinkUs.py | 60 --------- module/plugins/ShareonlineBiz.py | 116 ------------------ module/plugins/ShragleCom.py | 72 ----------- module/plugins/StealthTo.py | 47 ------- module/plugins/StorageTo.py | 104 ---------------- module/plugins/UploadedTo.py | 150 ---------------------- module/plugins/XupIn.py | 69 ----------- module/plugins/YoupornCom.py | 62 ---------- module/plugins/YoutubeChannel.py | 49 -------- module/plugins/YoutubeCom.py | 63 ---------- module/plugins/ZippyshareCom.py | 59 --------- module/plugins/ZshareNet.py | 72 ----------- module/plugins/__init__.py | 1 - module/plugins/container/CCF.py | 55 +++++++++ module/plugins/container/DLC.pyc | Bin 0 -> 5740 bytes module/plugins/container/LinkList.py | 39 ++++++ module/plugins/container/RSDF.py | 50 ++++++++ module/plugins/container/__init__.py | 0 module/plugins/decrypter/DDLMusicOrg.py | 58 +++++++++ module/plugins/decrypter/FourChanOrg.py | 41 +++++++ module/plugins/decrypter/HoerbuchIn.py | 48 ++++++++ module/plugins/decrypter/LixIn.py | 36 ++++++ module/plugins/decrypter/OneKhDe.py | 38 ++++++ module/plugins/decrypter/RSLayerCom.py | 39 ++++++ module/plugins/decrypter/RelinkUs.py | 60 +++++++++ module/plugins/decrypter/StealthTo.py | 47 +++++++ module/plugins/decrypter/YoutubeChannel.py | 49 ++++++++ module/plugins/decrypter/__init__.py | 0 module/plugins/hoster/BluehostTo.py | 71 +++++++++++ module/plugins/hoster/DepositfilesCom.py | 62 ++++++++++ module/plugins/hoster/FilefactoryCom.py | 103 ++++++++++++++++ module/plugins/hoster/FilesmonsterCom.py | 94 ++++++++++++++ module/plugins/hoster/FreakshareNet.py | 144 ++++++++++++++++++++++ module/plugins/hoster/GigasizeCom.py | 84 +++++++++++++ module/plugins/hoster/HotfileCom.py | 110 +++++++++++++++++ module/plugins/hoster/MegauploadCom.py | 83 +++++++++++++ module/plugins/hoster/MyvideoDe.py | 65 ++++++++++ module/plugins/hoster/NetloadIn.py | 157 ++++++++++++++++++++++++ module/plugins/hoster/RapidshareCom.py | 191 +++++++++++++++++++++++++++++ module/plugins/hoster/ShareonlineBiz.py | 116 ++++++++++++++++++ module/plugins/hoster/ShragleCom.py | 72 +++++++++++ module/plugins/hoster/StorageTo.py | 104 ++++++++++++++++ module/plugins/hoster/UploadedTo.py | 150 ++++++++++++++++++++++ module/plugins/hoster/XupIn.py | 69 +++++++++++ module/plugins/hoster/YoupornCom.py | 62 ++++++++++ module/plugins/hoster/YoutubeCom.py | 63 ++++++++++ module/plugins/hoster/ZippyshareCom.py | 59 +++++++++ module/plugins/hoster/ZshareNet.py | 72 +++++++++++ module/plugins/hoster/__init__.py | 0 module/thread_list.py | 2 +- 72 files changed, 2498 insertions(+), 2495 deletions(-) delete mode 100644 module/plugins/BluehostTo.py delete mode 100644 module/plugins/CCF.py delete mode 100644 module/plugins/DDLMusicOrg.py delete mode 100644 module/plugins/DLC.pyc delete mode 100644 module/plugins/DepositfilesCom.py delete mode 100644 module/plugins/FilefactoryCom.py delete mode 100644 module/plugins/FilesmonsterCom.py delete mode 100644 module/plugins/FourChanOrg.py delete mode 100644 module/plugins/FreakshareNet.py delete mode 100644 module/plugins/GigasizeCom.py delete mode 100644 module/plugins/HoerbuchIn.py delete mode 100644 module/plugins/HotfileCom.py delete mode 100644 module/plugins/LinkList.py delete mode 100644 module/plugins/LixIn.py delete mode 100644 module/plugins/MegauploadCom.py delete mode 100644 module/plugins/MyvideoDe.py delete mode 100644 module/plugins/NetloadIn.py delete mode 100644 module/plugins/OneKhDe.py delete mode 100644 module/plugins/RSDF.py delete mode 100644 module/plugins/RSLayerCom.py delete mode 100644 module/plugins/RapidshareCom.py delete mode 100644 module/plugins/RelinkUs.py delete mode 100644 module/plugins/ShareonlineBiz.py delete mode 100644 module/plugins/ShragleCom.py delete mode 100644 module/plugins/StealthTo.py delete mode 100644 module/plugins/StorageTo.py delete mode 100644 module/plugins/UploadedTo.py delete mode 100644 module/plugins/XupIn.py delete mode 100644 module/plugins/YoupornCom.py delete mode 100644 module/plugins/YoutubeChannel.py delete mode 100644 module/plugins/YoutubeCom.py delete mode 100644 module/plugins/ZippyshareCom.py delete mode 100644 module/plugins/ZshareNet.py create mode 100644 module/plugins/container/CCF.py create mode 100644 module/plugins/container/DLC.pyc create mode 100644 module/plugins/container/LinkList.py create mode 100644 module/plugins/container/RSDF.py create mode 100644 module/plugins/container/__init__.py create mode 100644 module/plugins/decrypter/DDLMusicOrg.py create mode 100644 module/plugins/decrypter/FourChanOrg.py create mode 100644 module/plugins/decrypter/HoerbuchIn.py create mode 100644 module/plugins/decrypter/LixIn.py create mode 100644 module/plugins/decrypter/OneKhDe.py create mode 100644 module/plugins/decrypter/RSLayerCom.py create mode 100644 module/plugins/decrypter/RelinkUs.py create mode 100644 module/plugins/decrypter/StealthTo.py create mode 100644 module/plugins/decrypter/YoutubeChannel.py create mode 100644 module/plugins/decrypter/__init__.py create mode 100644 module/plugins/hoster/BluehostTo.py create mode 100644 module/plugins/hoster/DepositfilesCom.py create mode 100644 module/plugins/hoster/FilefactoryCom.py create mode 100644 module/plugins/hoster/FilesmonsterCom.py create mode 100644 module/plugins/hoster/FreakshareNet.py create mode 100644 module/plugins/hoster/GigasizeCom.py create mode 100644 module/plugins/hoster/HotfileCom.py create mode 100644 module/plugins/hoster/MegauploadCom.py create mode 100644 module/plugins/hoster/MyvideoDe.py create mode 100644 module/plugins/hoster/NetloadIn.py create mode 100644 module/plugins/hoster/RapidshareCom.py create mode 100644 module/plugins/hoster/ShareonlineBiz.py create mode 100644 module/plugins/hoster/ShragleCom.py create mode 100644 module/plugins/hoster/StorageTo.py create mode 100644 module/plugins/hoster/UploadedTo.py create mode 100644 module/plugins/hoster/XupIn.py create mode 100644 module/plugins/hoster/YoupornCom.py create mode 100644 module/plugins/hoster/YoutubeCom.py create mode 100644 module/plugins/hoster/ZippyshareCom.py create mode 100644 module/plugins/hoster/ZshareNet.py create mode 100644 module/plugins/hoster/__init__.py (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 9d7260889..bb04ae898 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -401,8 +401,12 @@ class PyLoadFile(): self.active = False pluginName = self._get_my_plugin() if pluginName: - self.modul = __import__(pluginName) - pluginClass = getattr(self.modul, self.modul.__name__) + for dir in ["hoster", "decrypter", "container"]: + try: + self.modul = __import__("%s.%s" % (dir, pluginName), globals(), locals(), [pluginName], -1) + except: + pass + pluginClass = getattr(self.modul, pluginName) else: self.modul = module.Plugin pluginClass = module.Plugin.Plugin diff --git a/module/plugins/BluehostTo.py b/module/plugins/BluehostTo.py deleted file mode 100644 index eff8ebcd8..000000000 --- a/module/plugins/BluehostTo.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.Plugin import Plugin - -class BluehostTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "BluehostTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?bluehost.to/file/" - props['version'] = "0.1" - props['description'] = """Bluehost Download PLugin""" - props['author_name'] = ("RaNaN") - props['author_mail'] = ("RaNaN@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - time.sleep(1.5) - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for i in inputs: - if re.search(r"name=\"BluehostVers2dl\"",i[0]): - self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"PHPSESSID\"",i[0]): - self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"DownloadV2Hash\"",i[0]): - self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"access\"",i[0]): - self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"download\"",i[0]): - url = re.search(r"action=\"([^\"]+)", i[0]).group(1) - - return url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r"<center><b>.+: (.+)<\/b><\/center>" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r"html", self.html) == None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access}) diff --git a/module/plugins/CCF.py b/module/plugins/CCF.py deleted file mode 100644 index 88b567904..000000000 --- a/module/plugins/CCF.py +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os.path -import random -import re -import tempfile -import urllib2 - -from module.Plugin import Plugin -from module.network.MultipartPostHandler import MultipartPostHandler - -class CCF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "CCF" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.ccf" - props['version'] = "0.1" - props['description'] = """CCF Container Convert Plugin""" - props['author_name'] = ("Willnix") - props['author_mail'] = ("Willnix@pyload.org") - self.props = props - self.parent = parent - self.multi_dl = True - self.links = [] - - def proceed(self, url, location): - infile = url.replace("\n", "") - - opener = urllib2.build_opener(MultipartPostHandler) - params = {"src": "ccf", - "filename": "test.ccf", - "upload": open(infile, "rb")} - tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() - - random.seed() - tempdir = tempfile.gettempdir() - if tempdir[0] == '/': - delim = '/' - else: - delim = '\\' - tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' - while os.path.exists(tempdlc_name): - tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' - - tempdlc = open(tempdlc_name, "w") - tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) - tempdlc.close - - self.links.append(tempdlc_name) - - return True diff --git a/module/plugins/DDLMusicOrg.py b/module/plugins/DDLMusicOrg.py deleted file mode 100644 index c927d261c..000000000 --- a/module/plugins/DDLMusicOrg.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import sleep - -from module.Plugin import Plugin - -class DDLMusicOrg(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "DDLMusicOrg" - props['type'] = "container" - props['pattern'] = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+" - props['version'] = "0.1" - props['description'] = """ddl-music.org Container Plugin""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def file_exists(self): - """ returns True or False - """ - if not self.html: - self.download_html() - if re.search(r"Wer dies nicht rechnen kann", self.html) != None: - return True - return False - - def proceed(self, url, location): - for i in range(5): - self.download_html() - posturl = re.search(r"id=\"captcha\" action=\"(/captcha/ddlm_cr\d\.php)\"", self.html).group(1) - math = re.search(r"(\d+) ([\+-]) (\d+) =\s+<inp", self.html) - id = re.search(r"name=\"id\" value=\"(\d+)\"", self.html).group(1) - linknr = re.search(r"name=\"linknr\" value=\"(\d+)\"", self.html).group(1) - - solve = "" - if math.group(2) == "+": - solve = int(math.group(1)) + int(math.group(3)) - else: - solve = int(math.group(1)) - int(math.group(3)) - sleep(3) - htmlwithlink = self.req.load("http://ddl-music.org%s" % posturl, cookies=True, post={"calc%s" % linknr:solve, "send%s" % linknr:"Send", "id":id, "linknr":linknr}) - m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) - if m: - self.links = [m.group(1)] - return - self.links = False diff --git a/module/plugins/DLC.pyc b/module/plugins/DLC.pyc deleted file mode 100644 index 235e46e1a..000000000 Binary files a/module/plugins/DLC.pyc and /dev/null differ diff --git a/module/plugins/DepositfilesCom.py b/module/plugins/DepositfilesCom.py deleted file mode 100644 index 6c5748096..000000000 --- a/module/plugins/DepositfilesCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.Plugin import Plugin - -class DepositfilesCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "DepositfilesCom" - props['type'] = "hoster" - props['pattern'] = r"http://depositfiles.com/.{2,}/files/" - props['version'] = "0.1" - props['description'] = """Depositfiles.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url = urllib.unquote(re.search('<form action="(http://.*\.depositfiles.com/.*)" method="get" onSubmit="download_started', self.html).group(1)) - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search('File name: <b title="(.*)">', self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - - self.req.download(url, location, cookies=True) diff --git a/module/plugins/FilefactoryCom.py b/module/plugins/FilefactoryCom.py deleted file mode 100644 index 5b7db301d..000000000 --- a/module/plugins/FilefactoryCom.py +++ /dev/null @@ -1,103 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin -from time import time - -class FilefactoryCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FilefactoryCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?filefactory\.com/file/" - props['version'] = "0.1" - props['description'] = """Filefactory.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob","mkaay") - props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.htmlwithlink = None - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - self.get_waiting_time() - - pyfile.status.filename = self.get_file_name() - - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - return True - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - tempurl = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.html).group(1) - self.htmlwithlink = self.req.load("http://www.filefactory.com"+tempurl, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.htmlwithlink).group(1) - #print file_url - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search('content=\"Download\ (\S*?)\ for\ free\.', self.html).group(1) - return file_name - else: - return self.parent.url - - def get_waiting_time(self): - if self.html == None: - self.download_html() - countdown_re = re.compile("countdown.*?>(\d+)") - m = countdown_re.search(self.htmlwithlink) - if m: - sec = int(m.group(1)) - else: - sec = 0 - self.time_plus_wait = time() + sec - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - - self.req.download(url, location, cookies=True) - diff --git a/module/plugins/FilesmonsterCom.py b/module/plugins/FilesmonsterCom.py deleted file mode 100644 index 27c687363..000000000 --- a/module/plugins/FilesmonsterCom.py +++ /dev/null @@ -1,94 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Plugin for www.filesmonster.com -# this plugin isn't fully implemented yet,but it does download -# todo: -# detect, if reconnect is necessary -# download-error handling -# postpone download, if speed is below a set limit -# implement premium-access -# optional replace blanks in filename with underscores - -import re -import urllib -import time -from Plugin import Plugin - -class FilesmonsterCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FilesmonsterCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www.)??filesmonster.com/download.php" - props['version'] = "0.1" - props['description'] = """Filesmonster.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob") - props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.htmlwithlink = None - self.url = None - self.filerequest = None - - def download_html(self): - self.url = self.parent.url - self.html = self.req.load(self.url) # get the start page - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.get_download_page() # the complex work is done here - file_url = self.htmlwithlink - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search(r"File\sname:\s<span\sclass=\"em\">(.*?)</span>", self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: - return False - else: - return True - - def get_download_page(self): - herewego = re.findall(r"<form\sid=\'slowdownload\'\smethod=\"post\"\saction=\"http://filesmonster.com/get/free/\">\s*\n\s*<input\stype=\"hidden\"\sname=\"(\S*?)\"\svalue=\"(\S*?)\"\s*>", self.html) - the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) - temporary_filtered = re.search(r"</div><form\sid=\'rtForm\'\sname=\"rtForm\"\smethod=\"post\">\s*\n(\s*<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'>\s*\n)*?\s*</form>", the_download_page).group(0) - all_the_tuples = re.findall(r"<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'", temporary_filtered) - time.sleep(30) - herewego = None - herewego = self.req.load('http://filesmonster.com/ajax.php', None, all_the_tuples) - ticket_number = re.search(r"\"text\":\"(.*?)\"\,\"error\"", herewego).group(1) - herewego = None - herewego = self.req.load('http://filesmonster.com/ajax.php', None, {'act': 'getdl', 'data': ticket_number}) - ticket_number = None - ticket_number = re.search(r"\"url\":\"(.*?)\"", herewego).group(1) - the_download_page = re.sub(r"\\/", r"/", ticket_number) - ticket_number = urllib.quote(the_download_page.encode('utf8')) - self.htmlwithlink = re.sub("http%3A", "http:", ticket_number) - self.filerequest = re.search(r"\"file_request\":\"(.*?)\"", herewego).group(1) - - def proceed(self, url, location): - - self.req.download(url, location, None, {"X-File-Request": self.filerequest}) diff --git a/module/plugins/FourChanOrg.py b/module/plugins/FourChanOrg.py deleted file mode 100644 index e3b00c1f7..000000000 --- a/module/plugins/FourChanOrg.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class FourChanOrg(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FourChanOrg" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" - props['version'] = "0.1" - props['description'] = """4chan.org Thread Download Plugin""" - props['author_name'] = ("Spoob") - props['author_mail'] = ("Spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - html = self.req.load(url) - link_pattern = "" - temp_links = [] - if "imagebord.html" in url: - link_pattern = '[<a href="(res/\d*\.html)">Reply</a>]' - temp_links = re.findall(link_pattern, html) - for link in re.findall(link_pattern, html): - temp_links.append(link) - else: - temp_links = re.findall('File : <a href="(http://(?:img\.)?(?:zip\.)?4chan\.org/\w{,3}/src/\d*\..{3})"', html) - self.links = temp_links diff --git a/module/plugins/FreakshareNet.py b/module/plugins/FreakshareNet.py deleted file mode 100644 index 0768b5476..000000000 --- a/module/plugins/FreakshareNet.py +++ /dev/null @@ -1,144 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -import httplib -from module.Plugin import Plugin -from time import time - - -class FreakshareNet(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "FreakshareNet" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?freakshare\.net/files/\S*?/" - props['version'] = "0.1" - props['description'] = """Freakshare.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob","mkaay") - props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.req_opts = list() - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - self.get_waiting_time() - - pyfile.status.filename = self.get_file_name() - - pyfile.status.waituntil = self.time_plus_wait - thread.wait(self.parent) - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - - return True - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.req_opts = self.get_download_options() # get the Post options for the Request - file_url = self.parent.url - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center\;\">(.*?)<\/h1>", self.html).group(1) - return file_name - else: - return self.parent.url - - def get_waiting_time(self): - if self.html == None: - self.download_html() - timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) - if timestring: - sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off - else: - sec = 0 - self.time_plus_wait = time() + sec - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: - return False - else: - return True - - def get_download_options(self): - re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", self.html).group(0) #get the whole request - to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) - request_options = list() - for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them - request_options.append((item[1], item[0])) - herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page - to_sort = None - to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) - request_options = list() - for item in to_sort: #Same as above - request_options.append((item[1], item[0])) - return request_options - - def proceed(self, url, location): - """ - request.download doesn't handle the 302 redirect correctly - that's why the data are posted "manually" via httplib - and the redirect-url is read from the header. - Important: The cookies may not be posted to the download-url - otherwise the downloaded file only contains "bad try" - Need to come up with a better idea to handle the redirect, - help is appreciated. - """ - temp_options = urllib.urlencode(self.req_opts) - temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name - temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot - cookie_list = "" - for temp_cookie in self.req.cookies: #prepare cookies - cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" - temp_headers = [ #create the additional header fields - ["Content-type", "application/x-www-form-urlencoded"], #this is very important - ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], - ["Accept-Encoding", "deflate"], - ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], - ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], - ["Connection", "keep-alive"], - ["Keep-Alive", "300"], - ["Referer", self.req.lastURL], - ["Cookie", cookie_list]] - temp_conn = httplib.HTTPConnection(temp_url) - temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) - temp_response = temp_conn.getresponse() - new_url = temp_response.getheader("Location") # we need the Location-header - temp_conn.close - self.req.download(new_url, location, None, None, cookies=False) diff --git a/module/plugins/GigasizeCom.py b/module/plugins/GigasizeCom.py deleted file mode 100644 index e22fe8593..000000000 --- a/module/plugins/GigasizeCom.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time - -from module.Plugin import Plugin - -class GigasizeCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "GigasizeCom" - props['type'] = "hoster" - props['pattern'] = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d=" - props['version'] = "0.1" - props['description'] = """Gigasize.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None] - self.want_reconnect = False - self.init_ocr() - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) - - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - - for i in range(5): - self.req.download("http://www.gigasize.com/randomImage.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.html[1] = self.req.load("http://www.gigasize.com/formdownload.php", None, {"txtNumber": captcha}, cookies=True) - - if re.search(r"Package features", self.html[1]) != None: - if re.search(r"YOU HAVE REACHED YOUR HOURLY LIMIT", self.html[1]) != None: - self.time_plus_wait = time() + 3600 #one hour - #self.time_plus_wait = time() + 60 - break - - os.remove(captcha_image) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = '<form action="(/getcgi.php\?t=.*)" method="post" id="formDownload">' - search = re.search(file_url_pattern, self.html[1]) - if search: - return "http://gigazise.com" + search.group(1) - return "" - else: - return False - - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name_pattern = "<p><strong>Name</strong>: <b>(.*)</b></p>" - return re.search(file_name_pattern, self.html[0]).group(1) - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"The file has been deleted", self.html[0]) != None: - return False - else: - return True - - def proceed(self, url, location): - print url - print self.req.load(url, cookies=True) diff --git a/module/plugins/HoerbuchIn.py b/module/plugins/HoerbuchIn.py deleted file mode 100644 index ae7ae9774..000000000 --- a/module/plugins/HoerbuchIn.py +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class HoerbuchIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "HoerbuchIn" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" - props['version'] = "0.3" - props['description'] = """Hoerbuch.in Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def file_exists(self): - """ returns True or False - """ - self.download_html() - if re.search(r"Download", self.html) != None: - return True - return False - - def proceed(self, url, location): - temp_links = [] - download_container = ("Download", "Mirror #1", "Mirror #2", "Mirror #3") - for container in download_container: - download_content = re.search("<BR><B>" + container + ":</B>(.*?)<BR><B>", self.html).group(1) - tmp = re.findall('<A HREF="http://www.hoerbuch.in/cj/out.php\?pct=\d+&url=(http://rs\.hoerbuch\.in/.+?)" TARGET="_blank">Part \d+</A>', download_content) - if tmp == []: continue - for link in tmp: - link_html = self.req.load(link, cookies=True) - temp_links.append(re.search('<FORM ACTION="(http://.*?)" METHOD="post"', link_html).group(1)) - break - - self.links = temp_links diff --git a/module/plugins/HotfileCom.py b/module/plugins/HotfileCom.py deleted file mode 100644 index a046cb6b1..000000000 --- a/module/plugins/HotfileCom.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time -from module.Plugin import Plugin - -class HotfileCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "HotfileCom" - props['type'] = "hoster" - props['pattern'] = r"http://hotfile.com/dl/" - props['version'] = "0.1" - props['description'] = """Hotfile.com Download Plugin""" - props['author_name'] = ("sitacuisses","spoob","mkaay") - props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - self.htmlwithlink = None - self.url = None - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - pyfile.status.filename = self.get_file_name() - - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - pyfile.status.url = self.get_file_url() - - return True - - def download_html(self): - self.url = self.parent.url - self.html = self.req.load(self.url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.get_download_page() - file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.htmlwithlink).group(1) - return file_url - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search('Downloading\s<b>(.*?)</b>', self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: - return False - else: - return True - - def get_wait_time(self): - free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") - matches = free_limit_pattern.findall(self.html) - if matches: - for match in matches: - if int(match) == 60000: - continue - if int(match) == 0: - continue - else: - self.time_plus_wait = time() + int(match)/1000 + 65 - self.want_reconnect = True - return True - self.time_plus_wait = time() + 65 - - def get_download_page(self): - herewego = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html).group(0) - all_the_tuples = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", herewego) - - self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) - - def proceed(self, url, location): - - self.req.download(url, location) - diff --git a/module/plugins/LinkList.py b/module/plugins/LinkList.py deleted file mode 100644 index 92508ce29..000000000 --- a/module/plugins/LinkList.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - - -from module.Plugin import Plugin - -class LinkList(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "LinkList" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.txt" - props['version'] = "0.1" - props['description'] = """Read Link Lists in txt format""" - props['author_name'] = ("Spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def proceed(self, linkList, location): - tmpLinks = [] - txt = open(linkList, 'r') - links = txt.readlines() - for link in links: - if link != "\n": - tmpLinks.append(link.replace("\n", "")) - txt.close() - - if not self.parent.core.config['general']['debug_mode']: - txt = open(linkList, 'w') - txt.write("") - txt.close() - #@TODO: maybe delete read txt file? - - self.links = tmpLinks diff --git a/module/plugins/LixIn.py b/module/plugins/LixIn.py deleted file mode 100644 index d7ef6521d..000000000 --- a/module/plugins/LixIn.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class LixIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "LixIn" - props['type'] = "container" - props['pattern'] = r"http://(www.)?lix.in/" - props['version'] = "0.1" - props['description'] = """Lix.in Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - new_link = "" - if not re.search("captcha_img.php", self.html): - new_link = re.search(r".*<iframe name=\"ifram\" src=\"(.*)\" marginwidth=\"0\".*", self.req.load(url, post={"submit" : "continue"})).group(1) - - self.links = [new_link] diff --git a/module/plugins/MegauploadCom.py b/module/plugins/MegauploadCom.py deleted file mode 100644 index 3eb21a591..000000000 --- a/module/plugins/MegauploadCom.py +++ /dev/null @@ -1,83 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time - -from module.Plugin import Plugin - -class MegauploadCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "MegauploadCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)megaupload.com/" - props['version'] = "0.1" - props['description'] = """Megaupload.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.time_plus_wait = None #time() + wait in seconds - - self.html = [None, None] - self.want_reconnect = False - self.init_ocr() - self.multi_dl = False - - def download_html(self): - url = self.parent.url - - captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name - - for i in range(5): - self.html[0] = self.req.load(url, cookies=True) - url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) - self.req.download(url_captcha_html, captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - os.remove(captcha_image) - captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1) - megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1) - self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) - if re.search(r"Waiting time before each download begins", self.html[1]) != None: - break - self.time_plus_wait = time() + 45 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = 'id="downloadlink"><a href="(.*)" onclick="' - search = re.search(file_url_pattern, self.html[1]) - return search.group(1).replace(" ", "%20") - else: - return False - - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name_pattern = 'id="downloadlink"><a href="(.*)" onclick="' - return re.search(file_name_pattern, self.html[1]).group(1).split("/")[-1] - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"Unfortunately, the link you have clicked is not available.", self.html[0]) != None or \ - re.search(r"Download limit exceeded", self.html[0]): - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, cookies=True) diff --git a/module/plugins/MyvideoDe.py b/module/plugins/MyvideoDe.py deleted file mode 100644 index 5e2eb0b39..000000000 --- a/module/plugins/MyvideoDe.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin - -class MyvideoDe(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "MyvideoDe" - props['type'] = "hoster" - props['pattern'] = r"http://(www\.)?myvideo.de/watch/" - props['version'] = "0.1" - props['description'] = """Youtube.com Video Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - videoId = re.search(r"addVariable\('_videoid','(.*)'\);p.addParam\('quality'", self.html).group(1) - videoServer = re.search("rel='image_src' href='(.*)thumbs/.*' />", self.html).group(1) - file_url = videoServer + videoId + ".flv" - print videoId - print videoServer - print file_url - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r"<h1 class='globalHd'>(.*)</h1>" - return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None: - return False - else: - return True diff --git a/module/plugins/NetloadIn.py b/module/plugins/NetloadIn.py deleted file mode 100644 index bc755fb58..000000000 --- a/module/plugins/NetloadIn.py +++ /dev/null @@ -1,157 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time -from time import sleep -import hashlib - -from module.Plugin import Plugin - -class NetloadIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "NetloadIn" - props['type'] = "hoster" - props['pattern'] = r"http://.*netload\.in/" - props['version'] = "0.1" - props['description'] = """Netload.in Download Plugin""" - props['author_name'] = ("spoob", "RaNaN") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None, None] - self.want_reconnect = False - self.multi_dl = False - self.api_data = None - self.init_ocr() - self.read_config() - if self.config['premium']: - self.multi_dl = True - else: - self.multi_dl = False - - def prepare(self, thread): - pyfile = self.parent - self.req.clear_cookies() - - self.download_api_data() - if self.file_exists(): - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: - self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) - self.logger.info("Netload: Use Premium Account") - pyfile.status.url = self.parent.url - #@TODO: premium?? - return True - - self.download_html() - while not pyfile.status.url: - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - thread.wait(self.parent) - - pyfile.status.url = self.get_file_url() - - else: - raise Exception, "The file was not found on the server." - - def download_api_data(self): - url = self.parent.url - id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)") - match = id_regex.search(url) - if match: - apiurl = "http://netload.in/share/fileinfos2.php" - src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) - self.api_data = {} - if src != "unknown file_data": - lines = src.split(";") - self.api_data["exists"] = True - self.api_data["fileid"] = lines[0] - self.api_data["filename"] = lines[1] - self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') - self.api_data["status"] = lines[3] - self.api_data["checksum"] = lines[4].replace("\n", "") - else: - self.api_data["exists"] = False - - def download_html(self): - self.html[0] = self.req.load(self.parent.url, cookies=True) - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") - for i in range(6): - self.html[1] = self.req.load(url_captcha_html, cookies=True) - try: - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - except: - url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") - self.html[1] = self.req.load(url_captcha_html, cookies=True) - captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) - - file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', self.html[1]).group(1) - captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name - self.req.download(captcha_url, captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - os.remove(captcha_image) - self.logger.debug("Captcha %s: %s" % (i, captcha)) - sleep(5) - self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) - - if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: - break - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - try: - file_url_pattern = r"<a class=\"Orange_Link\" href=\"(http://.+)\" >Click here" - return re.search(file_url_pattern, self.html[2]).group(1) - except: - return None - - def get_wait_time(self): - if re.search(r"We had a reqeust with the IP", self.html[2]): - self.time_plus_wait = time() + 10 * 30 - return - - wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 100 - self.time_plus_wait = time() + wait_seconds - - def get_file_name(self): - if self.api_data["filename"]: - return self.api_data["filename"] - elif self.html[0]: - file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">' - file_name_search = re.search(file_name_pattern, self.html[0]) - if file_name_search: - return file_name_search.group(1) - return self.parent.url - - def file_exists(self): - if self.api_data["exists"]: - return self.api_data["exists"] - elif self.html[0] and re.search(r"The file has been deleted", self.html[0]) == None: - return True - return False - - def proceed(self, url, location): - self.req.download(url, location, cookies=True) - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.md5() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/OneKhDe.py b/module/plugins/OneKhDe.py deleted file mode 100644 index 5f24b543a..000000000 --- a/module/plugins/OneKhDe.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from module.Plugin import Plugin - -class OneKhDe(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "OneKhDe" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?1kh.de/f/" - props['version'] = "0.1" - props['description'] = """1kh.de Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - temp_links = [] - link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html) - for id in link_ids: - new_link = unescape(re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1)) - temp_links.append(new_link) - self.links = temp_links diff --git a/module/plugins/RSDF.py b/module/plugins/RSDF.py deleted file mode 100644 index 0b6a63722..000000000 --- a/module/plugins/RSDF.py +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import base64 -import binascii - -from module.Plugin import Plugin - -class RSDF(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RSDF" - props['type'] = "container" - props['pattern'] = r"(?!http://).*\.rsdf" - props['version'] = "0.2" - props['description'] = """RSDF Container Decode Plugin""" - props['author_name'] = ("RaNaN", "spoob") - props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") - self.props = props - self.parent = parent - self.multi_dl = True - self.links = [] - - def proceed(self, url, location): - from Crypto.Cipher import AES - - infile = url.replace("\n", "") - Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') - - IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') - IV_Cipher = AES.new(Key, AES.MODE_ECB) - IV = IV_Cipher.encrypt(IV) - - obj = AES.new(Key, AES.MODE_CFB, IV) - - rsdf = open(infile, 'r') - - data = rsdf.read() - data = binascii.unhexlify(''.join(data.split())) - data = data.splitlines() - - for link in data: - link = base64.b64decode(link) - link = obj.decrypt(link) - decryptedUrl = link.replace('CCF: ', '') - self.links.append(decryptedUrl) - - rsdf.close() diff --git a/module/plugins/RSLayerCom.py b/module/plugins/RSLayerCom.py deleted file mode 100644 index 20cadbe18..000000000 --- a/module/plugins/RSLayerCom.py +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.unescape import unescape -from module.Plugin import Plugin - -class RSLayerCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RSLayerCom" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?rs-layer.com/directory-" - props['version'] = "0.1" - props['description'] = """RS-Layer.com Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url) - temp_links = [] - link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", self.html) - for id in link_ids: - new_link = unescape(re.search(r"name=\"file\" src=\"(.*)\"></frame>", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) - print new_link - temp_links.append(new_link) - self.links = temp_links diff --git a/module/plugins/RapidshareCom.py b/module/plugins/RapidshareCom.py deleted file mode 100644 index 973e28470..000000000 --- a/module/plugins/RapidshareCom.py +++ /dev/null @@ -1,191 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.Plugin import Plugin -import hashlib - -class RapidshareCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RapidshareCom" - props['type'] = "hoster" - props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" - props['version'] = "1.0" - props['description'] = """Rapidshare.com Download Plugin""" - props['author_name'] = ("spoob", "RaNaN", "mkaay") - props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = [None, None] - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.want_reconnect = False - self.no_slots = True - self.api_data = None - self.url = self.parent.url - self.read_config() - if self.config['premium']: - self.multi_dl = True - else: - self.multi_dl = False - - self.start_dl = False - - def prepare(self, thread): - pyfile = self.parent - self.req.clear_cookies() - - self.download_api_data() - if self.api_data["status"] == "1": - pyfile.status.filename = self.get_file_name() - - if self.config["premium"]: - self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) - pyfile.status.url = self.parent.url - return True - - self.download_html() - while self.no_slots: - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - thread.wait(pyfile) - - pyfile.status.url = self.get_file_url() - - return True - elif self.api_data["status"] == "2": - self.logger.info("Rapidshare: Traffic Share (direct download)") - pyfile.status.filename = self.get_file_name() - pyfile.status.url = self.parent.url - return True - else: - raise Exception, "The file was not found on the server." - - def download_api_data(self): - """ - http://images.rapidshare.com/apidoc.txt - """ - api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" - api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} - m = re.compile(self.props['pattern']).search(self.url) - if m: - api_param_file["files"] = m.group(1) - api_param_file["filenames"] = m.group(2) - src = self.req.load(api_url_base, cookies=False, get=api_param_file) - if src.startswith("ERROR"): - return - fields = src.split(",") - self.api_data = {} - self.api_data["fileid"] = fields[0] - self.api_data["filename"] = fields[1] - self.api_data["size"] = fields[2] # in bytes - self.api_data["serverid"] = fields[3] - self.api_data["status"] = fields[4] - """ - status codes: - 0=File not found - 1=File OK (Downloading possible without any logging) - 2=File OK (TrafficShare direct download without any logging) - 3=Server down - 4=File marked as illegal - 5=Anonymous file locked, because it has more than 10 downloads already - 6=File OK (TrafficShare direct download with enabled logging) - """ - self.api_data["shorthost"] = fields[5] - self.api_data["checksum"] = fields[6].strip().lower() # md5 - - self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data - - if self.config["premium"]: - api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", \ - "login": self.config['username'], "password": self.config['password']} - src = self.req.load(api_url_base, cookies=False, get=api_param_prem) - if src.startswith("ERROR"): - self.config["premium"] = False - self.logger.info("Rapidshare: Login faild") - return - fields = src.split("\n") - premkbleft = int(fields[19].split("=")[1]) - if premkbleft < int(self.api_data["size"][0:-3]): - self.logger.info("Rapidshare: Not enough traffic left") - self.config["premium"] = False - else: - self.props["premkbleft"] = premkbleft - - def download_html(self): - """ gets the url from self.parent.url saves html in self.html and parses - """ - self.html[0] = self.req.load(self.url, cookies=True) - self.html_old = time() - - def get_wait_time(self): - """downloads html with the important informations - """ - file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) - self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) - - self.html_old = time() - - if re.search(r"is already downloading", self.html[1]): - self.logger.info("Rapidshare: Already downloading, wait 30 minutes") - self.time_plus_wait = time() + 10 * 30 - return - self.no_slots = False - try: - wait_minutes = re.search(r"Or try again in about (\d+) minute", self.html[1]).group(1) - self.time_plus_wait = time() + 60 * int(wait_minutes) - self.want_reconnect = True - except: - if re.search(r"(Currently a lot of users|There are no more download slots)", self.html[1], re.I) != None: - self.time_plus_wait = time() + 130 - self.logger.info("Rapidshare: No free slots!") - self.no_slots = True - return True - self.no_slots = False - wait_seconds = re.search(r"var c=(.*);.*", self.html[1]).group(1) - self.time_plus_wait = time() + int(wait_seconds) + 5 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.config['server'] == "": - file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" - else: - file_url_pattern = '(http://rs.*)\';" /> %s<br />' % self.config['server'] - - return re.search(file_url_pattern, self.html[1]).group(1) - - def get_file_name(self): - if self.api_data["filename"]: - return self.api_data["filename"] - elif self.html[0]: - file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" - file_name_search = re.search(file_name_pattern, self.html[0]) - if file_name_search: - return file_name_search.group(1) - return self.url.split("/")[-1] - - def proceed(self, url, location): - if self.config['premium']: - self.req.add_auth(self.config['username'], self.config['password']) - self.req.download(url, location, cookies=True) - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.md5() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/RelinkUs.py b/module/plugins/RelinkUs.py deleted file mode 100644 index 71b441116..000000000 --- a/module/plugins/RelinkUs.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.Plugin import Plugin - -class RelinkUs(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "RelinkUs" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" - props['version'] = "1" - props['description'] = """Relink.us Container Plugin""" - props['author_name'] = ("Sleeper-", "spoob") - props['author_mail'] = ("@nonymous", "spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - container_id = self.parent.url.split("/")[-1].split("id=")[-1] - url = "http://relink.us/view.php?id="+container_id - self.html = self.req.load(url, cookies=True) - temp_links = [] - - # Download Ad-Frames, otherwise we aren't enabled for download - iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) - for iframe in iframes: - self.req.load("http://relink.us/"+iframe[0], cookies=True) - - link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) - - for link_string in link_strings: - self.req.lastURL = url - - # Set Download File - framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) - - new_link = self.req.lastEffectiveURL - - if re.match(r"http://(www\.)?relink.us/",new_link): - # Find iframe - new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) - # Wait some secs for relink.us server... - time.sleep(5) - - temp_links.append(new_link) - - self.links = temp_links diff --git a/module/plugins/ShareonlineBiz.py b/module/plugins/ShareonlineBiz.py deleted file mode 100644 index b9a9accef..000000000 --- a/module/plugins/ShareonlineBiz.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import os -import re -import tempfile -from time import time -from base64 import b64decode - -from module.Plugin import Plugin - -class ShareonlineBiz(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ShareonlineBiz" - props['type'] = "hoster" - props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id=" - props['version'] = "0.1" - props['description'] = """Shareonline.biz Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None] - self.want_reconnect = False - self.init_ocr() - self.url = self.parent.url - self.read_config() - if self.config['premium']: - self.multi_dl = True - else: - self.multi_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.download_api_data() - if self.api_data["status"]: - self.download_html() - pyfile.status.filename = self.api_data["filename"] - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - else: - raise Exception, "File not found" - return False - - def download_api_data(self): - """ - http://images.rapidshare.com/apidoc.txt - """ - api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php?md5=1" - api_param_file = {"links": self.url} - src = self.req.load(api_url_base, cookies=False, post=api_param_file) - - fields = src.split(";") - self.api_data = {} - self.api_data["fileid"] = fields[0] - self.api_data["status"] = fields[1] - if self.api_data["status"] == "NOTFOUND": - return - self.api_data["filename"] = fields[2] - self.api_data["size"] = fields[3] # in bytes - self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 - - def download_html(self): - if self.config['premium']: - post_vars = {"act": "login", - "location": "service.php", - "dieseid": "", - "user": self.config['username'], - "pass": self.config['password'], - "login":"Log+me+in", - "folder_autologin":"1"} - self.req.load("http://www.share-online.biz/login.php", cookies=True, post=post_vars) - url = self.parent.url - self.html[0] = self.req.load(url, cookies=True) - - if not self.config['premium']: - captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name - - for i in range(10): - self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) - captcha = self.ocr.get_captcha(captcha_image) - self.logger.debug("Captcha %s: %s" % (i, captcha)) - self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) - if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]) != None: - self.time_plus_wait = time() + 15 - break - - os.remove(captcha_image) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.want_reconnect: - file_url_pattern = 'loadfilelink\.decode\("(.*)\); document' - return b64decode(re.search(file_url_pattern, self.html[1]).group(1)) - else: - return False - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.md5() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/ShragleCom.py b/module/plugins/ShragleCom.py deleted file mode 100644 index c0cc9de72..000000000 --- a/module/plugins/ShragleCom.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.Plugin import Plugin - -class ShragleCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ShragleCom" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?shragle.com/files/" - props['version'] = "0.1" - props['description'] = """Shragle Download PLugin""" - props['author_name'] = ("RaNaN") - props['author_mail'] = ("RaNaN@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - self.time_plus_wait = time.time() + 10 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1) - self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1) - self.userID = "" - self.password = "" - self.lang = "de" - return "http://srv4.shragle.com/download.php" - - def get_file_name(self): - if self.html == None: - self.download_html() - - file_name_pattern = r"<\/div><h2>(.+)<\/h2" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r"html", self.html) == None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang}) diff --git a/module/plugins/StealthTo.py b/module/plugins/StealthTo.py deleted file mode 100644 index 855aae001..000000000 --- a/module/plugins/StealthTo.py +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class StealthTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "StealthTo" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?stealth.to/folder/" - props['version'] = "0.1" - props['description'] = """Stealth.to Container Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - temp_links = [] - ids = [] - ats = [] # authenticity_token - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for input in inputs: - if re.search(r"name=\"authenticity_token\"",input[0]): - ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - if re.search(r"name=\"id\"",input[0]): - ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) - - for i in range(0, len(ids)): - self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) - new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True) - temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) - - self.links = temp_links diff --git a/module/plugins/StorageTo.py b/module/plugins/StorageTo.py deleted file mode 100644 index dbff844ad..000000000 --- a/module/plugins/StorageTo.py +++ /dev/null @@ -1,104 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time - -from module.Plugin import Plugin - -class StorageTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "StorageTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www)?\.storage\.to/get/.*" - props['version'] = "0.1" - props['description'] = """Storage.to Download Plugin""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - self.props = props - self.parent = parent - self.time_plus_wait = None - self.want_reconnect = False - self.api_data = None - self.html = None - self.read_config() - self.multi_dl = False - - self.start_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.req.clear_cookies() - - self.want_reconnect = False - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - return False - - pyfile.status.filename = self.get_file_name() - - self.get_wait_time() - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - pyfile.status.url = self.get_file_url() - - return True - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def download_api_data(self): - url = self.parent.url - info_url = url.replace("/get/", "/getlink/") - src = self.req.load(info_url, cookies=True) - pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") - self.api_data = {} - for pair in pattern.findall(src): - self.api_data[pair[0]] = pair[1].strip("'") - print self.api_data - - def get_wait_time(self): - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "wait": - self.want_reconnect = True - self.time_plus_wait = time() + int(self.api_data["countdown"]) - - - - def file_exists(self): - """ returns True or False - """ - if not self.api_data: - self.download_api_data() - if self.api_data["state"] == "failed": - return False - else: - return True - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if not self.api_data: - self.download_api_data() - return self.api_data["link"] - - def get_file_name(self): - if not self.html: - self.download_html() - file_name_pattern = r"<span class=\"orange\">Downloading:</span>(.*?)<span class=\"light\">(.*?)</span>" - return re.search(file_name_pattern, self.html).group(1) - - def proceed(self, url, location): - self.req.download(url, location, cookies=True) diff --git a/module/plugins/UploadedTo.py b/module/plugins/UploadedTo.py deleted file mode 100644 index bb623b4e6..000000000 --- a/module/plugins/UploadedTo.py +++ /dev/null @@ -1,150 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from time import time -from module.Plugin import Plugin -import hashlib - -class UploadedTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "UploadedTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/)?(.*)" - props['version'] = "0.3" - props['description'] = """Uploaded.to Download Plugin""" - props['author_name'] = ("spoob", "mkaay") - props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") - self.props = props - self.parent = parent - self.html = None - self.time_plus_wait = None #time() + wait in seconds - self.api_data = None - self.want_reconnect = False - self.read_config() - if self.config['premium']: - self.multi_dl = True - else: - self.multi_dl = False - - self.start_dl = False - - def prepare(self, thread): - pyfile = self.parent - - self.want_reconnect = False - tries = 0 - - while not pyfile.status.url: - self.req.clear_cookies() - self.download_html() - - pyfile.status.exists = self.file_exists() - - if not pyfile.status.exists: - raise Exception, "The file was not found on the server." - - self.download_api_data() - - pyfile.status.filename = self.get_file_name() - - if self.config['premium']: - pyfile.status.url = self.parent.url - return True - - self.get_waiting_time() - - pyfile.status.waituntil = self.time_plus_wait - pyfile.status.url = self.get_file_url() - pyfile.status.want_reconnect = self.want_reconnect - - thread.wait(self.parent) - - pyfile.status.filename = self.get_file_name() - - tries += 1 - if tries > 5: - raise Exception, "Error while preparing DL" - return True - - def download_api_data(self): - url = self.parent.url - match = re.compile(self.props['pattern']).search(url) - if match: - src = self.req.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) - if not src.find("404 Not Found"): - return - self.api_data = {} - lines = src.splitlines() - self.api_data["filename"] = lines[0] - self.api_data["size"] = lines[1] # in kbytes - self.api_data["checksum"] = lines[2] #sha1 - - def download_html(self): - if self.config['premium']: - self.config['username'], self.config['password'] - self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}) - url = self.parent.url - self.html = self.req.load(url, cookies=False) - - def get_waiting_time(self): - try: - wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1) - if int(wait_minutes) < 0: wait_minutes = 1 - self.time_plus_wait = time() + 60 * int(wait_minutes) - self.want_reconnect = True - except: - self.time_plus_wait = 0 - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.config['premium']: - self.start_dl = True - return self.parent.url - try: - file_url_pattern = r".*<form name=\"download_form\" method=\"post\" action=\"(.*)\">" - return re.search(file_url_pattern, self.html).group(1) - except: - return None - - def get_file_name(self): - try: - if self.api_data and self.api_data["filename"]: - return self.api_data["filename"] - file_name = re.search(r"<td><b>\s+(.+)\s", self.html).group(1) - file_suffix = re.search(r"</td><td>(\..+)</td></tr>", self.html) - if not file_suffix: - return file_name - return file_name + file_suffix.group(1) - except: - return self.parent.url - - def file_exists(self): - if re.search(r"(File doesn't exist .*)", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - if self.config['premium']: - self.req.download(url, location, cookies=True) - else: - self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) - - def check_file(self, local_file): - if self.api_data and self.api_data["checksum"]: - h = hashlib.sha1() - f = open(local_file, "rb") - h.update(f.read()) - f.close() - hexd = h.hexdigest() - if hexd == self.api_data["checksum"]: - return (True, 0) - else: - return (False, 1) - else: - return (True, 5) diff --git a/module/plugins/XupIn.py b/module/plugins/XupIn.py deleted file mode 100644 index d044f2389..000000000 --- a/module/plugins/XupIn.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin - -class XupIn(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "XupIn" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?xup.in/" - props['version'] = "0.1" - props['description'] = """Xup.in Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.posts = {} - self.want_reconnect = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1) - self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_url_pattern = r".*<form action=\"(.*)\" method=\"post\">" - return re.search(file_url_pattern, self.html).group(1) - else: - return False - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - return self.parent.url.split('/')[-2] - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*<font color=\"#ff0000\">File does not exist</font>.*)", self.html, re.I) != None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, self.posts) - - def wait_until(self): - if self.html == None: - self.download_html() - return self.time_plus_wait diff --git a/module/plugins/YoupornCom.py b/module/plugins/YoupornCom.py deleted file mode 100644 index e501954da..000000000 --- a/module/plugins/YoupornCom.py +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin - -class YoupornCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoupornCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www\.)?youporn\.com/watch/.+" - props['version'] = "0.1" - props['description'] = """Youporn.com Video Download Plugin""" - props['author_name'] = ("willnix") - props['author_mail'] = ("willnix@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - file_url = re.search(r'(http://download.youporn.com/download/\d*/.*\?download=1&ll=1&t=dd)">', self.html).group(1) - print file_url - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r".*<title>(.*) - Free Porn Videos - YouPorn.com Lite \(BETA\)</title>.*" - return re.search(file_name_pattern, self.html).group(1) + '.flv' - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*invalid video_id.*)", self.html) != None: - return False - else: - return True diff --git a/module/plugins/YoutubeChannel.py b/module/plugins/YoutubeChannel.py deleted file mode 100644 index 27a4ff8a7..000000000 --- a/module/plugins/YoutubeChannel.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re - -from module.Plugin import Plugin - -class YoutubeChannel(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoutubeChannel" - props['type'] = "container" - props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" - props['version'] = "0.3" - props['description'] = """Youtube.com Channel Download Plugin""" - props['author_name'] = ("RaNaN", "Spoob") - props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def file_exists(self): - """ returns True or False - """ - return True - - def proceed(self, url, location): - self.user = re.search(r"/user/(.+)", self.parent.url).group(1) - max_videos = self.config['max_videos'] - if not max_videos: - max_videos = 1000 #max video a user can upload - page = 0 - temp_links = [] - for start_index in range(1, int(max_videos), 50): - max_results = max_videos - page * 50 - if max_results > 50: - max_results = 50 - url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&start-index=" + str(start_index) - rep = self.req.load(url) - new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) - if new_links != []: - temp_links.extend(new_links) - else: - break - page += 1 - self.links = temp_links diff --git a/module/plugins/YoutubeCom.py b/module/plugins/YoutubeCom.py deleted file mode 100644 index 38a4934df..000000000 --- a/module/plugins/YoutubeCom.py +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin - -class YoutubeCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "YoutubeCom" - props['type'] = "hoster" - props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" - props['version'] = "0.2" - props['description'] = """Youtube.com Video Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.read_config() - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - videoId = self.parent.url.split("v=")[1].split("&")[0] - videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) - quality = "" - if self.config['high_quality']: - quality = "&fmt=18" - file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - - file_name_pattern = r"'VIDEO_TITLE': '(.*)'," - file_suffix = ".flv" - if self.config['high_quality']: - file_suffix = ".mp4" - name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix - - name = name.replace("&", "&") - return name - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None: - return False - else: - return True diff --git a/module/plugins/ZippyshareCom.py b/module/plugins/ZippyshareCom.py deleted file mode 100644 index bec7f8c65..000000000 --- a/module/plugins/ZippyshareCom.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import urllib -from module.Plugin import Plugin - -class ZippyshareCom(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ZippyshareCom" - props['type'] = "hoster" - props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/" - props['version'] = "0.1" - props['description'] = """Zippyshare.com Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - file_url_pattern = r"var \w* = '(http%.*?)';" - file_url_search = re.search(file_url_pattern, self.html).group(1) - file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) - return file_url - - def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search("<strong>Name: </strong>(.*)</font><br />", self.html).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"HTTP Status 404", self.html) != None: - return False - else: - return True - - def proceed(self, url, location): - - self.req.download(url, location, cookies=True) diff --git a/module/plugins/ZshareNet.py b/module/plugins/ZshareNet.py deleted file mode 100644 index 08f28a35c..000000000 --- a/module/plugins/ZshareNet.py +++ /dev/null @@ -1,72 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -from module.Plugin import Plugin - -class ZshareNet(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "ZshareNet" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?zshare.net/" - props['version'] = "0.1" - props['description'] = """Zshare.net Download Plugin""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") - self.props = props - self.parent = parent - self.html = [None, None] - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - self.posts = {} - self.want_reconnect = False - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html[0] = self.req.load(url) - if "/video/" in url: - url = url.replace("/video/", "/download/") - elif "/audio/" in url: - url = url.replace("/audio/", "/download/") - elif "/image/" in url: - url = url.replace("/image/", "/download/") - self.html[1] = self.req.load(url, None, {"download": "1"}) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1))) - return file_url - else: - return False - - def get_file_name(self): - if self.html[0] == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search("<font color=\"#666666\">(.*)</font></td>", self.html[0]).group(1) - return file_name - else: - return self.parent.url - - def file_exists(self): - """ returns True or False - """ - if self.html[0] == None: - self.download_html() - if re.search(r"File Not Found", self.html[0]) != None: - return False - else: - return True - - def wait_until(self): - if self.html[0] == None: - self.download_html() - return self.time_plus_wait diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py index 8d1c8b69c..e69de29bb 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -1 +0,0 @@ - diff --git a/module/plugins/container/CCF.py b/module/plugins/container/CCF.py new file mode 100644 index 000000000..88b567904 --- /dev/null +++ b/module/plugins/container/CCF.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os.path +import random +import re +import tempfile +import urllib2 + +from module.Plugin import Plugin +from module.network.MultipartPostHandler import MultipartPostHandler + +class CCF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "CCF" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.ccf" + props['version'] = "0.1" + props['description'] = """CCF Container Convert Plugin""" + props['author_name'] = ("Willnix") + props['author_mail'] = ("Willnix@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def proceed(self, url, location): + infile = url.replace("\n", "") + + opener = urllib2.build_opener(MultipartPostHandler) + params = {"src": "ccf", + "filename": "test.ccf", + "upload": open(infile, "rb")} + tempdlc_content = opener.open('http://service.jdownloader.net/dlcrypt/getDLC.php', params).read() + + random.seed() + tempdir = tempfile.gettempdir() + if tempdir[0] == '/': + delim = '/' + else: + delim = '\\' + tempdlc_name = tempdir + delim + str(random.randint(0, 100)) + '-tmp.dlc' + while os.path.exists(tempdlc_name): + tempdlc_name = tempfile.gettempdir() + '/' + str(random.randint(0, 100)) + '-tmp.dlc' + + tempdlc = open(tempdlc_name, "w") + tempdlc.write(re.search(r'<dlc>(.*)</dlc>', tempdlc_content, re.DOTALL).group(1)) + tempdlc.close + + self.links.append(tempdlc_name) + + return True diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc new file mode 100644 index 000000000..235e46e1a Binary files /dev/null and b/module/plugins/container/DLC.pyc differ diff --git a/module/plugins/container/LinkList.py b/module/plugins/container/LinkList.py new file mode 100644 index 000000000..92508ce29 --- /dev/null +++ b/module/plugins/container/LinkList.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + + +from module.Plugin import Plugin + +class LinkList(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LinkList" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.txt" + props['version'] = "0.1" + props['description'] = """Read Link Lists in txt format""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def proceed(self, linkList, location): + tmpLinks = [] + txt = open(linkList, 'r') + links = txt.readlines() + for link in links: + if link != "\n": + tmpLinks.append(link.replace("\n", "")) + txt.close() + + if not self.parent.core.config['general']['debug_mode']: + txt = open(linkList, 'w') + txt.write("") + txt.close() + #@TODO: maybe delete read txt file? + + self.links = tmpLinks diff --git a/module/plugins/container/RSDF.py b/module/plugins/container/RSDF.py new file mode 100644 index 000000000..0b6a63722 --- /dev/null +++ b/module/plugins/container/RSDF.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import base64 +import binascii + +from module.Plugin import Plugin + +class RSDF(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSDF" + props['type'] = "container" + props['pattern'] = r"(?!http://).*\.rsdf" + props['version'] = "0.2" + props['description'] = """RSDF Container Decode Plugin""" + props['author_name'] = ("RaNaN", "spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.multi_dl = True + self.links = [] + + def proceed(self, url, location): + from Crypto.Cipher import AES + + infile = url.replace("\n", "") + Key = binascii.unhexlify('8C35192D964DC3182C6F84F3252239EB4A320D2500000000') + + IV = binascii.unhexlify('FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF') + IV_Cipher = AES.new(Key, AES.MODE_ECB) + IV = IV_Cipher.encrypt(IV) + + obj = AES.new(Key, AES.MODE_CFB, IV) + + rsdf = open(infile, 'r') + + data = rsdf.read() + data = binascii.unhexlify(''.join(data.split())) + data = data.splitlines() + + for link in data: + link = base64.b64decode(link) + link = obj.decrypt(link) + decryptedUrl = link.replace('CCF: ', '') + self.links.append(decryptedUrl) + + rsdf.close() diff --git a/module/plugins/container/__init__.py b/module/plugins/container/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/plugins/decrypter/DDLMusicOrg.py b/module/plugins/decrypter/DDLMusicOrg.py new file mode 100644 index 000000000..c927d261c --- /dev/null +++ b/module/plugins/decrypter/DDLMusicOrg.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import sleep + +from module.Plugin import Plugin + +class DDLMusicOrg(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "DDLMusicOrg" + props['type'] = "container" + props['pattern'] = r"http://[\w\.]*?ddl-music\.org/captcha/ddlm_cr\d\.php\?\d+\?\d+" + props['version'] = "0.1" + props['description'] = """ddl-music.org Container Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def file_exists(self): + """ returns True or False + """ + if not self.html: + self.download_html() + if re.search(r"Wer dies nicht rechnen kann", self.html) != None: + return True + return False + + def proceed(self, url, location): + for i in range(5): + self.download_html() + posturl = re.search(r"id=\"captcha\" action=\"(/captcha/ddlm_cr\d\.php)\"", self.html).group(1) + math = re.search(r"(\d+) ([\+-]) (\d+) =\s+<inp", self.html) + id = re.search(r"name=\"id\" value=\"(\d+)\"", self.html).group(1) + linknr = re.search(r"name=\"linknr\" value=\"(\d+)\"", self.html).group(1) + + solve = "" + if math.group(2) == "+": + solve = int(math.group(1)) + int(math.group(3)) + else: + solve = int(math.group(1)) - int(math.group(3)) + sleep(3) + htmlwithlink = self.req.load("http://ddl-music.org%s" % posturl, cookies=True, post={"calc%s" % linknr:solve, "send%s" % linknr:"Send", "id":id, "linknr":linknr}) + m = re.search(r"<form id=\"ff\" action=\"(.*?)\" method=\"post\">", htmlwithlink) + if m: + self.links = [m.group(1)] + return + self.links = False diff --git a/module/plugins/decrypter/FourChanOrg.py b/module/plugins/decrypter/FourChanOrg.py new file mode 100644 index 000000000..e3b00c1f7 --- /dev/null +++ b/module/plugins/decrypter/FourChanOrg.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class FourChanOrg(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FourChanOrg" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?(img\.)?(zip\.)?4chan.org/\w+/(res/|imgboard\.html)" + props['version'] = "0.1" + props['description'] = """4chan.org Thread Download Plugin""" + props['author_name'] = ("Spoob") + props['author_mail'] = ("Spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + html = self.req.load(url) + link_pattern = "" + temp_links = [] + if "imagebord.html" in url: + link_pattern = '[<a href="(res/\d*\.html)">Reply</a>]' + temp_links = re.findall(link_pattern, html) + for link in re.findall(link_pattern, html): + temp_links.append(link) + else: + temp_links = re.findall('File : <a href="(http://(?:img\.)?(?:zip\.)?4chan\.org/\w{,3}/src/\d*\..{3})"', html) + self.links = temp_links diff --git a/module/plugins/decrypter/HoerbuchIn.py b/module/plugins/decrypter/HoerbuchIn.py new file mode 100644 index 000000000..ae7ae9774 --- /dev/null +++ b/module/plugins/decrypter/HoerbuchIn.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class HoerbuchIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "HoerbuchIn" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" + props['version'] = "0.3" + props['description'] = """Hoerbuch.in Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def file_exists(self): + """ returns True or False + """ + self.download_html() + if re.search(r"Download", self.html) != None: + return True + return False + + def proceed(self, url, location): + temp_links = [] + download_container = ("Download", "Mirror #1", "Mirror #2", "Mirror #3") + for container in download_container: + download_content = re.search("<BR><B>" + container + ":</B>(.*?)<BR><B>", self.html).group(1) + tmp = re.findall('<A HREF="http://www.hoerbuch.in/cj/out.php\?pct=\d+&url=(http://rs\.hoerbuch\.in/.+?)" TARGET="_blank">Part \d+</A>', download_content) + if tmp == []: continue + for link in tmp: + link_html = self.req.load(link, cookies=True) + temp_links.append(re.search('<FORM ACTION="(http://.*?)" METHOD="post"', link_html).group(1)) + break + + self.links = temp_links diff --git a/module/plugins/decrypter/LixIn.py b/module/plugins/decrypter/LixIn.py new file mode 100644 index 000000000..d7ef6521d --- /dev/null +++ b/module/plugins/decrypter/LixIn.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class LixIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "LixIn" + props['type'] = "container" + props['pattern'] = r"http://(www.)?lix.in/" + props['version'] = "0.1" + props['description'] = """Lix.in Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url) + new_link = "" + if not re.search("captcha_img.php", self.html): + new_link = re.search(r".*<iframe name=\"ifram\" src=\"(.*)\" marginwidth=\"0\".*", self.req.load(url, post={"submit" : "continue"})).group(1) + + self.links = [new_link] diff --git a/module/plugins/decrypter/OneKhDe.py b/module/plugins/decrypter/OneKhDe.py new file mode 100644 index 000000000..5f24b543a --- /dev/null +++ b/module/plugins/decrypter/OneKhDe.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from module.Plugin import Plugin + +class OneKhDe(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "OneKhDe" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?1kh.de/f/" + props['version'] = "0.1" + props['description'] = """1kh.de Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url) + temp_links = [] + link_ids = re.findall(r"<a id=\"DownloadLink_(\d*)\" href=\"http://1kh.de/", self.html) + for id in link_ids: + new_link = unescape(re.search("width=\"100%\" src=\"(.*)\"></iframe>", self.req.load("http://1kh.de/l/" + id)).group(1)) + temp_links.append(new_link) + self.links = temp_links diff --git a/module/plugins/decrypter/RSLayerCom.py b/module/plugins/decrypter/RSLayerCom.py new file mode 100644 index 000000000..20cadbe18 --- /dev/null +++ b/module/plugins/decrypter/RSLayerCom.py @@ -0,0 +1,39 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.unescape import unescape +from module.Plugin import Plugin + +class RSLayerCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RSLayerCom" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?rs-layer.com/directory-" + props['version'] = "0.1" + props['description'] = """RS-Layer.com Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url) + temp_links = [] + link_ids = re.findall(r"onclick=\"getFile\(\'([0-9]{7}-.{8})\'\);changeBackgroundColor", self.html) + for id in link_ids: + new_link = unescape(re.search(r"name=\"file\" src=\"(.*)\"></frame>", self.req.load("http://rs-layer.com/link-" + id + ".html")).group(1)) + print new_link + temp_links.append(new_link) + self.links = temp_links diff --git a/module/plugins/decrypter/RelinkUs.py b/module/plugins/decrypter/RelinkUs.py new file mode 100644 index 000000000..71b441116 --- /dev/null +++ b/module/plugins/decrypter/RelinkUs.py @@ -0,0 +1,60 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from module.Plugin import Plugin + +class RelinkUs(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RelinkUs" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?relink.us/(f|((view|go).php))" + props['version'] = "1" + props['description'] = """Relink.us Container Plugin""" + props['author_name'] = ("Sleeper-", "spoob") + props['author_mail'] = ("@nonymous", "spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + container_id = self.parent.url.split("/")[-1].split("id=")[-1] + url = "http://relink.us/view.php?id="+container_id + self.html = self.req.load(url, cookies=True) + temp_links = [] + + # Download Ad-Frames, otherwise we aren't enabled for download + iframes = re.findall("src=['\"]([^'\"]*)['\"](.*)></iframe>", self.html) + for iframe in iframes: + self.req.load("http://relink.us/"+iframe[0], cookies=True) + + link_strings = re.findall(r"onclick=\"getFile\(\'([^)]*)\'\);changeBackgroundColor", self.html) + + for link_string in link_strings: + self.req.lastURL = url + + # Set Download File + framereq = self.req.load("http://relink.us/frame.php?"+link_string, cookies=True) + + new_link = self.req.lastEffectiveURL + + if re.match(r"http://(www\.)?relink.us/",new_link): + # Find iframe + new_link = re.search("src=['\"]([^'\"]*)['\"](.*)></iframe>", framereq).group(1) + # Wait some secs for relink.us server... + time.sleep(5) + + temp_links.append(new_link) + + self.links = temp_links diff --git a/module/plugins/decrypter/StealthTo.py b/module/plugins/decrypter/StealthTo.py new file mode 100644 index 000000000..855aae001 --- /dev/null +++ b/module/plugins/decrypter/StealthTo.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class StealthTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "StealthTo" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?stealth.to/folder/" + props['version'] = "0.1" + props['description'] = """Stealth.to Container Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + temp_links = [] + ids = [] + ats = [] # authenticity_token + inputs = re.findall(r"(<(input|form)[^>]+)", self.html) + for input in inputs: + if re.search(r"name=\"authenticity_token\"",input[0]): + ats.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) + if re.search(r"name=\"id\"",input[0]): + ids.append(re.search(r"value=\"([^\"]+)", input[0]).group(1)) + + for i in range(0, len(ids)): + self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": ("download_" + str(ids[i]))}, cookies=True) + new_html = self.req.load(url + "/web", post={"authenticity_token": ats[i], "id": str(ids[i]), "link": "1"}, cookies=True) + temp_links.append(re.search(r"iframe src=\"(.*)\" frameborder", new_html).group(1)) + + self.links = temp_links diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py new file mode 100644 index 000000000..27a4ff8a7 --- /dev/null +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -0,0 +1,49 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin + +class YoutubeChannel(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoutubeChannel" + props['type'] = "container" + props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" + props['version'] = "0.3" + props['description'] = """Youtube.com Channel Download Plugin""" + props['author_name'] = ("RaNaN", "Spoob") + props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def file_exists(self): + """ returns True or False + """ + return True + + def proceed(self, url, location): + self.user = re.search(r"/user/(.+)", self.parent.url).group(1) + max_videos = self.config['max_videos'] + if not max_videos: + max_videos = 1000 #max video a user can upload + page = 0 + temp_links = [] + for start_index in range(1, int(max_videos), 50): + max_results = max_videos - page * 50 + if max_results > 50: + max_results = 50 + url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&start-index=" + str(start_index) + rep = self.req.load(url) + new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) + if new_links != []: + temp_links.extend(new_links) + else: + break + page += 1 + self.links = temp_links diff --git a/module/plugins/decrypter/__init__.py b/module/plugins/decrypter/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/plugins/hoster/BluehostTo.py b/module/plugins/hoster/BluehostTo.py new file mode 100644 index 000000000..eff8ebcd8 --- /dev/null +++ b/module/plugins/hoster/BluehostTo.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from module.Plugin import Plugin + +class BluehostTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "BluehostTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?bluehost.to/file/" + props['version'] = "0.1" + props['description'] = """Bluehost Download PLugin""" + props['author_name'] = ("RaNaN") + props['author_mail'] = ("RaNaN@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + time.sleep(1.5) + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + inputs = re.findall(r"(<(input|form)[^>]+)", self.html) + for i in inputs: + if re.search(r"name=\"BluehostVers2dl\"",i[0]): + self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"PHPSESSID\"",i[0]): + self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"DownloadV2Hash\"",i[0]): + self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"access\"",i[0]): + self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1) + elif re.search(r"name=\"download\"",i[0]): + url = re.search(r"action=\"([^\"]+)", i[0]).group(1) + + return url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r"<center><b>.+: (.+)<\/b><\/center>" + return re.search(file_name_pattern, self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + + if re.search(r"html", self.html) == None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access}) diff --git a/module/plugins/hoster/DepositfilesCom.py b/module/plugins/hoster/DepositfilesCom.py new file mode 100644 index 000000000..6c5748096 --- /dev/null +++ b/module/plugins/hoster/DepositfilesCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.Plugin import Plugin + +class DepositfilesCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "DepositfilesCom" + props['type'] = "hoster" + props['pattern'] = r"http://depositfiles.com/.{2,}/files/" + props['version'] = "0.1" + props['description'] = """Depositfiles.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url = urllib.unquote(re.search('<form action="(http://.*\.depositfiles.com/.*)" method="get" onSubmit="download_started', self.html).group(1)) + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search('File name: <b title="(.*)">', self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) diff --git a/module/plugins/hoster/FilefactoryCom.py b/module/plugins/hoster/FilefactoryCom.py new file mode 100644 index 000000000..5b7db301d --- /dev/null +++ b/module/plugins/hoster/FilefactoryCom.py @@ -0,0 +1,103 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin +from time import time + +class FilefactoryCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilefactoryCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?filefactory\.com/file/" + props['version'] = "0.1" + props['description'] = """Filefactory.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + self.get_waiting_time() + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + tempurl = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.html).group(1) + self.htmlwithlink = self.req.load("http://www.filefactory.com"+tempurl, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url = re.search('a href=\"(.*?)\".*?button\.basic\.jpg', self.htmlwithlink).group(1) + #print file_url + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search('content=\"Download\ (\S*?)\ for\ free\.', self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + countdown_re = re.compile("countdown.*?>(\d+)") + m = countdown_re.search(self.htmlwithlink) + if m: + sec = int(m.group(1)) + else: + sec = 0 + self.time_plus_wait = time() + sec + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) + diff --git a/module/plugins/hoster/FilesmonsterCom.py b/module/plugins/hoster/FilesmonsterCom.py new file mode 100644 index 000000000..27c687363 --- /dev/null +++ b/module/plugins/hoster/FilesmonsterCom.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Plugin for www.filesmonster.com +# this plugin isn't fully implemented yet,but it does download +# todo: +# detect, if reconnect is necessary +# download-error handling +# postpone download, if speed is below a set limit +# implement premium-access +# optional replace blanks in filename with underscores + +import re +import urllib +import time +from Plugin import Plugin + +class FilesmonsterCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FilesmonsterCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www.)??filesmonster.com/download.php" + props['version'] = "0.1" + props['description'] = """Filesmonster.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + self.filerequest = None + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) # get the start page + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() # the complex work is done here + file_url = self.htmlwithlink + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"File\sname:\s<span\sclass=\"em\">(.*?)</span>", self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def get_download_page(self): + herewego = re.findall(r"<form\sid=\'slowdownload\'\smethod=\"post\"\saction=\"http://filesmonster.com/get/free/\">\s*\n\s*<input\stype=\"hidden\"\sname=\"(\S*?)\"\svalue=\"(\S*?)\"\s*>", self.html) + the_download_page = self.req.load("http://filesmonster.com/get/free/", None, herewego) + temporary_filtered = re.search(r"</div><form\sid=\'rtForm\'\sname=\"rtForm\"\smethod=\"post\">\s*\n(\s*<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'>\s*\n)*?\s*</form>", the_download_page).group(0) + all_the_tuples = re.findall(r"<input\stype=\'hidden\'\sname=\'(\S*?)\'\svalue=\'(\S*?)\'", temporary_filtered) + time.sleep(30) + herewego = None + herewego = self.req.load('http://filesmonster.com/ajax.php', None, all_the_tuples) + ticket_number = re.search(r"\"text\":\"(.*?)\"\,\"error\"", herewego).group(1) + herewego = None + herewego = self.req.load('http://filesmonster.com/ajax.php', None, {'act': 'getdl', 'data': ticket_number}) + ticket_number = None + ticket_number = re.search(r"\"url\":\"(.*?)\"", herewego).group(1) + the_download_page = re.sub(r"\\/", r"/", ticket_number) + ticket_number = urllib.quote(the_download_page.encode('utf8')) + self.htmlwithlink = re.sub("http%3A", "http:", ticket_number) + self.filerequest = re.search(r"\"file_request\":\"(.*?)\"", herewego).group(1) + + def proceed(self, url, location): + + self.req.download(url, location, None, {"X-File-Request": self.filerequest}) diff --git a/module/plugins/hoster/FreakshareNet.py b/module/plugins/hoster/FreakshareNet.py new file mode 100644 index 000000000..0768b5476 --- /dev/null +++ b/module/plugins/hoster/FreakshareNet.py @@ -0,0 +1,144 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +import httplib +from module.Plugin import Plugin +from time import time + + +class FreakshareNet(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "FreakshareNet" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?freakshare\.net/files/\S*?/" + props['version'] = "0.1" + props['description'] = """Freakshare.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yahoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.req_opts = list() + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + self.get_waiting_time() + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + thread.wait(self.parent) + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.req_opts = self.get_download_options() # get the Post options for the Request + file_url = self.parent.url + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search(r"<h1\sclass=\"box_heading\"\sstyle=\"text-align:center\;\">(.*?)<\/h1>", self.html).group(1) + return file_name + else: + return self.parent.url + + def get_waiting_time(self): + if self.html == None: + self.download_html() + timestring = re.search('\s*var\stime\s=\s(\d*?)\.\d*;', self.html).group(1) + if timestring: + sec = int(timestring) + 1 #add 1 sec as tenths of seconds are cut off + else: + sec = 0 + self.time_plus_wait = time() + sec + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Sorry, this Download doesnt exist anymore", self.html) != None: + return False + else: + return True + + def get_download_options(self): + re_envelope = re.search(r".*?value=\"Free\sDownload\".*?\n*?(.*?<.*?>\n*)*?\n*\s*?</form>", self.html).group(0) #get the whole request + to_sort = re.findall(r"<input\stype=\"hidden\"\svalue=\"(.*?)\"\sname=\"(.*?)\"\s\/>", re_envelope) + request_options = list() + for item in to_sort: #Name value pairs are output reversed from regex, so we reorder them + request_options.append((item[1], item[0])) + herewego = self.req.load(self.parent.url, None, request_options, cookies=True) # the actual download-Page + to_sort = None + to_sort = re.findall(r"<input\stype=\".*?\"\svalue=\"(\S*?)\".*?name=\"(\S*?)\"\s.*?\/>", herewego) + request_options = list() + for item in to_sort: #Same as above + request_options.append((item[1], item[0])) + return request_options + + def proceed(self, url, location): + """ + request.download doesn't handle the 302 redirect correctly + that's why the data are posted "manually" via httplib + and the redirect-url is read from the header. + Important: The cookies may not be posted to the download-url + otherwise the downloaded file only contains "bad try" + Need to come up with a better idea to handle the redirect, + help is appreciated. + """ + temp_options = urllib.urlencode(self.req_opts) + temp_url = re.match(r"http://(.*?)/.*", url).group(1) # get the server name + temp_extended = re.match(r"http://.*?(/.*)", url).group(1) # get the url relative to serverroot + cookie_list = "" + for temp_cookie in self.req.cookies: #prepare cookies + cookie_list += temp_cookie.name + "=" + temp_cookie.value +";" + temp_headers = [ #create the additional header fields + ["Content-type", "application/x-www-form-urlencoded"], #this is very important + ["User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.9.0.8) Gecko/2009032609 Firefox/3.0.10"], + ["Accept-Encoding", "deflate"], + ["Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"], + ["Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"], + ["Connection", "keep-alive"], + ["Keep-Alive", "300"], + ["Referer", self.req.lastURL], + ["Cookie", cookie_list]] + temp_conn = httplib.HTTPConnection(temp_url) + temp_conn.request("POST", temp_extended, temp_options, dict(temp_headers)) + temp_response = temp_conn.getresponse() + new_url = temp_response.getheader("Location") # we need the Location-header + temp_conn.close + self.req.download(new_url, location, None, None, cookies=False) diff --git a/module/plugins/hoster/GigasizeCom.py b/module/plugins/hoster/GigasizeCom.py new file mode 100644 index 000000000..e22fe8593 --- /dev/null +++ b/module/plugins/hoster/GigasizeCom.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time + +from module.Plugin import Plugin + +class GigasizeCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "GigasizeCom" + props['type'] = "hoster" + props['pattern'] = r"(?:http://)?(?:www.)?gigasize.com/get.php\?d=" + props['version'] = "0.1" + props['description'] = """Gigasize.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.want_reconnect = False + self.init_ocr() + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html[0] = self.req.load(url, cookies=True) + + captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name + + for i in range(5): + self.req.download("http://www.gigasize.com/randomImage.php", captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + self.html[1] = self.req.load("http://www.gigasize.com/formdownload.php", None, {"txtNumber": captcha}, cookies=True) + + if re.search(r"Package features", self.html[1]) != None: + if re.search(r"YOU HAVE REACHED YOUR HOURLY LIMIT", self.html[1]) != None: + self.time_plus_wait = time() + 3600 #one hour + #self.time_plus_wait = time() + 60 + break + + os.remove(captcha_image) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = '<form action="(/getcgi.php\?t=.*)" method="post" id="formDownload">' + search = re.search(file_url_pattern, self.html[1]) + if search: + return "http://gigazise.com" + search.group(1) + return "" + else: + return False + + def get_file_name(self): + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_name_pattern = "<p><strong>Name</strong>: <b>(.*)</b></p>" + return re.search(file_name_pattern, self.html[0]).group(1) + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html[0] == None: + self.download_html() + if re.search(r"The file has been deleted", self.html[0]) != None: + return False + else: + return True + + def proceed(self, url, location): + print url + print self.req.load(url, cookies=True) diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py new file mode 100644 index 000000000..a046cb6b1 --- /dev/null +++ b/module/plugins/hoster/HotfileCom.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from module.Plugin import Plugin + +class HotfileCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "HotfileCom" + props['type'] = "hoster" + props['pattern'] = r"http://hotfile.com/dl/" + props['version'] = "0.1" + props['description'] = """Hotfile.com Download Plugin""" + props['author_name'] = ("sitacuisses","spoob","mkaay") + props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + self.htmlwithlink = None + self.url = None + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + pyfile.status.filename = self.get_file_name() + + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + pyfile.status.url = self.get_file_url() + + return True + + def download_html(self): + self.url = self.parent.url + self.html = self.req.load(self.url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + self.get_download_page() + file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.htmlwithlink).group(1) + return file_url + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search('Downloading\s<b>(.*?)</b>', self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + return False + else: + return True + + def get_wait_time(self): + free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") + matches = free_limit_pattern.findall(self.html) + if matches: + for match in matches: + if int(match) == 60000: + continue + if int(match) == 0: + continue + else: + self.time_plus_wait = time() + int(match)/1000 + 65 + self.want_reconnect = True + return True + self.time_plus_wait = time() + 65 + + def get_download_page(self): + herewego = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html).group(0) + all_the_tuples = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", herewego) + + self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) + + def proceed(self, url, location): + + self.req.download(url, location) + diff --git a/module/plugins/hoster/MegauploadCom.py b/module/plugins/hoster/MegauploadCom.py new file mode 100644 index 000000000..3eb21a591 --- /dev/null +++ b/module/plugins/hoster/MegauploadCom.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time + +from module.Plugin import Plugin + +class MegauploadCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "MegauploadCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)megaupload.com/" + props['version'] = "0.1" + props['description'] = """Megaupload.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.time_plus_wait = None #time() + wait in seconds + + self.html = [None, None] + self.want_reconnect = False + self.init_ocr() + self.multi_dl = False + + def download_html(self): + url = self.parent.url + + captcha_image = tempfile.NamedTemporaryFile(suffix=".gif").name + + for i in range(5): + self.html[0] = self.req.load(url, cookies=True) + url_captcha_html = re.search('(http://www.{,3}\.megaupload\.com/gencap.php\?.*\.gif)', self.html[0]).group(1) + self.req.download(url_captcha_html, captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + os.remove(captcha_image) + captchacode = re.search('name="captchacode" value="(.*)"', self.html[0]).group(1) + megavar = re.search('name="megavar" value="(.*)">', self.html[0]).group(1) + self.html[1] = self.req.load(url, post={"captcha": captcha, "captchacode": captchacode, "megavar": megavar}, cookies=True) + if re.search(r"Waiting time before each download begins", self.html[1]) != None: + break + self.time_plus_wait = time() + 45 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = 'id="downloadlink"><a href="(.*)" onclick="' + search = re.search(file_url_pattern, self.html[1]) + return search.group(1).replace(" ", "%20") + else: + return False + + def get_file_name(self): + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_name_pattern = 'id="downloadlink"><a href="(.*)" onclick="' + return re.search(file_name_pattern, self.html[1]).group(1).split("/")[-1] + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html[0] == None: + self.download_html() + if re.search(r"Unfortunately, the link you have clicked is not available.", self.html[0]) != None or \ + re.search(r"Download limit exceeded", self.html[0]): + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py new file mode 100644 index 000000000..5e2eb0b39 --- /dev/null +++ b/module/plugins/hoster/MyvideoDe.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin + +class MyvideoDe(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "MyvideoDe" + props['type'] = "hoster" + props['pattern'] = r"http://(www\.)?myvideo.de/watch/" + props['version'] = "0.1" + props['description'] = """Youtube.com Video Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + videoId = re.search(r"addVariable\('_videoid','(.*)'\);p.addParam\('quality'", self.html).group(1) + videoServer = re.search("rel='image_src' href='(.*)thumbs/.*' />", self.html).group(1) + file_url = videoServer + videoId + ".flv" + print videoId + print videoServer + print file_url + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r"<h1 class='globalHd'>(.*)</h1>" + return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py new file mode 100644 index 000000000..bc755fb58 --- /dev/null +++ b/module/plugins/hoster/NetloadIn.py @@ -0,0 +1,157 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time +from time import sleep +import hashlib + +from module.Plugin import Plugin + +class NetloadIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "NetloadIn" + props['type'] = "hoster" + props['pattern'] = r"http://.*netload\.in/" + props['version'] = "0.1" + props['description'] = """Netload.in Download Plugin""" + props['author_name'] = ("spoob", "RaNaN") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None, None] + self.want_reconnect = False + self.multi_dl = False + self.api_data = None + self.init_ocr() + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + def prepare(self, thread): + pyfile = self.parent + self.req.clear_cookies() + + self.download_api_data() + if self.file_exists(): + pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) + self.logger.info("Netload: Use Premium Account") + pyfile.status.url = self.parent.url + #@TODO: premium?? + return True + + self.download_html() + while not pyfile.status.url: + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + thread.wait(self.parent) + + pyfile.status.url = self.get_file_url() + + else: + raise Exception, "The file was not found on the server." + + def download_api_data(self): + url = self.parent.url + id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)") + match = id_regex.search(url) + if match: + apiurl = "http://netload.in/share/fileinfos2.php" + src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) + self.api_data = {} + if src != "unknown file_data": + lines = src.split(";") + self.api_data["exists"] = True + self.api_data["fileid"] = lines[0] + self.api_data["filename"] = lines[1] + self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') + self.api_data["status"] = lines[3] + self.api_data["checksum"] = lines[4].replace("\n", "") + else: + self.api_data["exists"] = False + + def download_html(self): + self.html[0] = self.req.load(self.parent.url, cookies=True) + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[0]).group(1).replace("amp;", "") + for i in range(6): + self.html[1] = self.req.load(url_captcha_html, cookies=True) + try: + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + except: + url_captcha_html = "http://netload.in/" + re.search('(index.php\?id=10&.*&captcha=1)', self.html[1]).group(1).replace("amp;", "") + self.html[1] = self.req.load(url_captcha_html, cookies=True) + captcha_url = "http://netload.in/" + re.search('(share/includes/captcha.php\?t=\d*)', self.html[1]).group(1) + + file_id = re.search('<input name="file_id" type="hidden" value="(.*)" />', self.html[1]).group(1) + captcha_image = tempfile.NamedTemporaryFile(suffix=".png").name + self.req.download(captcha_url, captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + os.remove(captcha_image) + self.logger.debug("Captcha %s: %s" % (i, captcha)) + sleep(5) + self.html[2] = self.req.load("http://netload.in/index.php?id=10", post={"file_id": file_id, "captcha_check": captcha}, cookies=True) + + if re.search(r"(We will prepare your download..|We had a reqeust with the IP)", self.html[2]) != None: + break + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + try: + file_url_pattern = r"<a class=\"Orange_Link\" href=\"(http://.+)\" >Click here" + return re.search(file_url_pattern, self.html[2]).group(1) + except: + return None + + def get_wait_time(self): + if re.search(r"We had a reqeust with the IP", self.html[2]): + self.time_plus_wait = time() + 10 * 30 + return + + wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 100 + self.time_plus_wait = time() + wait_seconds + + def get_file_name(self): + if self.api_data["filename"]: + return self.api_data["filename"] + elif self.html[0]: + file_name_pattern = '\t\t\t(.+)<span style="color: #8d8d8d;">' + file_name_search = re.search(file_name_pattern, self.html[0]) + if file_name_search: + return file_name_search.group(1) + return self.parent.url + + def file_exists(self): + if self.api_data["exists"]: + return self.api_data["exists"] + elif self.html[0] and re.search(r"The file has been deleted", self.html[0]) == None: + return True + return False + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.md5() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py new file mode 100644 index 000000000..973e28470 --- /dev/null +++ b/module/plugins/hoster/RapidshareCom.py @@ -0,0 +1,191 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time + +from module.Plugin import Plugin +import hashlib + +class RapidshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "RapidshareCom" + props['type'] = "hoster" + props['pattern'] = r"http://[\w\.]*?rapidshare.com/files/(\d*?)/(.*)" + props['version'] = "1.0" + props['description'] = """Rapidshare.com Download Plugin""" + props['author_name'] = ("spoob", "RaNaN", "mkaay") + props['author_mail'] = ("spoob@pyload.org", "ranan@pyload.org", "mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = [None, None] + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.want_reconnect = False + self.no_slots = True + self.api_data = None + self.url = self.parent.url + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + self.start_dl = False + + def prepare(self, thread): + pyfile = self.parent + self.req.clear_cookies() + + self.download_api_data() + if self.api_data["status"] == "1": + pyfile.status.filename = self.get_file_name() + + if self.config["premium"]: + self.logger.info("Rapidshare: Use Premium Account (%sGB left)" % (self.props["premkbleft"]/1000000)) + pyfile.status.url = self.parent.url + return True + + self.download_html() + while self.no_slots: + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + thread.wait(pyfile) + + pyfile.status.url = self.get_file_url() + + return True + elif self.api_data["status"] == "2": + self.logger.info("Rapidshare: Traffic Share (direct download)") + pyfile.status.filename = self.get_file_name() + pyfile.status.url = self.parent.url + return True + else: + raise Exception, "The file was not found on the server." + + def download_api_data(self): + """ + http://images.rapidshare.com/apidoc.txt + """ + api_url_base = "http://api.rapidshare.com/cgi-bin/rsapi.cgi" + api_param_file = {"sub": "checkfiles_v1", "files": "", "filenames": "", "incmd5": "1"} + m = re.compile(self.props['pattern']).search(self.url) + if m: + api_param_file["files"] = m.group(1) + api_param_file["filenames"] = m.group(2) + src = self.req.load(api_url_base, cookies=False, get=api_param_file) + if src.startswith("ERROR"): + return + fields = src.split(",") + self.api_data = {} + self.api_data["fileid"] = fields[0] + self.api_data["filename"] = fields[1] + self.api_data["size"] = fields[2] # in bytes + self.api_data["serverid"] = fields[3] + self.api_data["status"] = fields[4] + """ + status codes: + 0=File not found + 1=File OK (Downloading possible without any logging) + 2=File OK (TrafficShare direct download without any logging) + 3=Server down + 4=File marked as illegal + 5=Anonymous file locked, because it has more than 10 downloads already + 6=File OK (TrafficShare direct download with enabled logging) + """ + self.api_data["shorthost"] = fields[5] + self.api_data["checksum"] = fields[6].strip().lower() # md5 + + self.api_data["mirror"] = "http://rs%(serverid)s%(shorthost)s.rapidshare.com/files/%(fileid)s/%(filename)s" % self.api_data + + if self.config["premium"]: + api_param_prem = {"sub": "getaccountdetails_v1", "type": "prem", \ + "login": self.config['username'], "password": self.config['password']} + src = self.req.load(api_url_base, cookies=False, get=api_param_prem) + if src.startswith("ERROR"): + self.config["premium"] = False + self.logger.info("Rapidshare: Login faild") + return + fields = src.split("\n") + premkbleft = int(fields[19].split("=")[1]) + if premkbleft < int(self.api_data["size"][0:-3]): + self.logger.info("Rapidshare: Not enough traffic left") + self.config["premium"] = False + else: + self.props["premkbleft"] = premkbleft + + def download_html(self): + """ gets the url from self.parent.url saves html in self.html and parses + """ + self.html[0] = self.req.load(self.url, cookies=True) + self.html_old = time() + + def get_wait_time(self): + """downloads html with the important informations + """ + file_server_url = re.search(r"<form action=\"(.*?)\"", self.html[0]).group(1) + self.html[1] = self.req.load(file_server_url, cookies=True, post={"dl.start": "Free"}) + + self.html_old = time() + + if re.search(r"is already downloading", self.html[1]): + self.logger.info("Rapidshare: Already downloading, wait 30 minutes") + self.time_plus_wait = time() + 10 * 30 + return + self.no_slots = False + try: + wait_minutes = re.search(r"Or try again in about (\d+) minute", self.html[1]).group(1) + self.time_plus_wait = time() + 60 * int(wait_minutes) + self.want_reconnect = True + except: + if re.search(r"(Currently a lot of users|There are no more download slots)", self.html[1], re.I) != None: + self.time_plus_wait = time() + 130 + self.logger.info("Rapidshare: No free slots!") + self.no_slots = True + return True + self.no_slots = False + wait_seconds = re.search(r"var c=(.*);.*", self.html[1]).group(1) + self.time_plus_wait = time() + int(wait_seconds) + 5 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.config['server'] == "": + file_url_pattern = r".*name=\"dlf\" action=\"(.*)\" method=.*" + else: + file_url_pattern = '(http://rs.*)\';" /> %s<br />' % self.config['server'] + + return re.search(file_url_pattern, self.html[1]).group(1) + + def get_file_name(self): + if self.api_data["filename"]: + return self.api_data["filename"] + elif self.html[0]: + file_name_pattern = r"<p class=\"downloadlink\">.+/(.+) <font" + file_name_search = re.search(file_name_pattern, self.html[0]) + if file_name_search: + return file_name_search.group(1) + return self.url.split("/")[-1] + + def proceed(self, url, location): + if self.config['premium']: + self.req.add_auth(self.config['username'], self.config['password']) + self.req.download(url, location, cookies=True) + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.md5() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py new file mode 100644 index 000000000..b9a9accef --- /dev/null +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -0,0 +1,116 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import os +import re +import tempfile +from time import time +from base64 import b64decode + +from module.Plugin import Plugin + +class ShareonlineBiz(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ShareonlineBiz" + props['type'] = "hoster" + props['pattern'] = r"(?:http://)?(?:www.)?share-online.biz/download.php\?id=" + props['version'] = "0.1" + props['description'] = """Shareonline.biz Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.want_reconnect = False + self.init_ocr() + self.url = self.parent.url + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.download_api_data() + if self.api_data["status"]: + self.download_html() + pyfile.status.filename = self.api_data["filename"] + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + else: + raise Exception, "File not found" + return False + + def download_api_data(self): + """ + http://images.rapidshare.com/apidoc.txt + """ + api_url_base = "http://www.share-online.biz/linkcheck/linkcheck.php?md5=1" + api_param_file = {"links": self.url} + src = self.req.load(api_url_base, cookies=False, post=api_param_file) + + fields = src.split(";") + self.api_data = {} + self.api_data["fileid"] = fields[0] + self.api_data["status"] = fields[1] + if self.api_data["status"] == "NOTFOUND": + return + self.api_data["filename"] = fields[2] + self.api_data["size"] = fields[3] # in bytes + self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 + + def download_html(self): + if self.config['premium']: + post_vars = {"act": "login", + "location": "service.php", + "dieseid": "", + "user": self.config['username'], + "pass": self.config['password'], + "login":"Log+me+in", + "folder_autologin":"1"} + self.req.load("http://www.share-online.biz/login.php", cookies=True, post=post_vars) + url = self.parent.url + self.html[0] = self.req.load(url, cookies=True) + + if not self.config['premium']: + captcha_image = tempfile.NamedTemporaryFile(suffix=".jpg").name + + for i in range(10): + self.req.download("http://www.share-online.biz/captcha.php", captcha_image, cookies=True) + captcha = self.ocr.get_captcha(captcha_image) + self.logger.debug("Captcha %s: %s" % (i, captcha)) + self.html[1] = self.req.load(url, post={"captchacode": captcha}, cookies=True) + if re.search(r"Der Download ist Ihnen zu langsam", self.html[1]) != None: + self.time_plus_wait = time() + 15 + break + + os.remove(captcha_image) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if not self.want_reconnect: + file_url_pattern = 'loadfilelink\.decode\("(.*)\); document' + return b64decode(re.search(file_url_pattern, self.html[1]).group(1)) + else: + return False + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.md5() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/ShragleCom.py b/module/plugins/hoster/ShragleCom.py new file mode 100644 index 000000000..c0cc9de72 --- /dev/null +++ b/module/plugins/hoster/ShragleCom.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import time + +from module.Plugin import Plugin + +class ShragleCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ShragleCom" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?shragle.com/files/" + props['version'] = "0.1" + props['description'] = """Shragle Download PLugin""" + props['author_name'] = ("RaNaN") + props['author_mail'] = ("RaNaN@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + self.time_plus_wait = time.time() + 10 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + self.fileID = re.search(r"name=\"fileID\" value=\"([^\"]+)", self.html).group(1) + self.dlSession = re.search(r"name=\"dlSession\" value=\"([^\"]+)", self.html).group(1) + self.userID = "" + self.password = "" + self.lang = "de" + return "http://srv4.shragle.com/download.php" + + def get_file_name(self): + if self.html == None: + self.download_html() + + file_name_pattern = r"<\/div><h2>(.+)<\/h2" + return re.search(file_name_pattern, self.html).group(1) + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + + if re.search(r"html", self.html) == None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, {'fileID': self.fileID, 'dlSession': self.dlSession, 'userID': self.userID, 'password': self.password, 'lang': self.lang}) diff --git a/module/plugins/hoster/StorageTo.py b/module/plugins/hoster/StorageTo.py new file mode 100644 index 000000000..dbff844ad --- /dev/null +++ b/module/plugins/hoster/StorageTo.py @@ -0,0 +1,104 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time + +from module.Plugin import Plugin + +class StorageTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "StorageTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www)?\.storage\.to/get/.*" + props['version'] = "0.1" + props['description'] = """Storage.to Download Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.parent = parent + self.time_plus_wait = None + self.want_reconnect = False + self.api_data = None + self.html = None + self.read_config() + self.multi_dl = False + + self.start_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.req.clear_cookies() + + self.want_reconnect = False + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + return False + + pyfile.status.filename = self.get_file_name() + + self.get_wait_time() + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + pyfile.status.url = self.get_file_url() + + return True + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def download_api_data(self): + url = self.parent.url + info_url = url.replace("/get/", "/getlink/") + src = self.req.load(info_url, cookies=True) + pattern = re.compile(r"'(\w+)' : (.*?)[,|\}]") + self.api_data = {} + for pair in pattern.findall(src): + self.api_data[pair[0]] = pair[1].strip("'") + print self.api_data + + def get_wait_time(self): + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "wait": + self.want_reconnect = True + self.time_plus_wait = time() + int(self.api_data["countdown"]) + + + + def file_exists(self): + """ returns True or False + """ + if not self.api_data: + self.download_api_data() + if self.api_data["state"] == "failed": + return False + else: + return True + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if not self.api_data: + self.download_api_data() + return self.api_data["link"] + + def get_file_name(self): + if not self.html: + self.download_html() + file_name_pattern = r"<span class=\"orange\">Downloading:</span>(.*?)<span class=\"light\">(.*?)</span>" + return re.search(file_name_pattern, self.html).group(1) + + def proceed(self, url, location): + self.req.download(url, location, cookies=True) diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py new file mode 100644 index 000000000..bb623b4e6 --- /dev/null +++ b/module/plugins/hoster/UploadedTo.py @@ -0,0 +1,150 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from time import time +from module.Plugin import Plugin +import hashlib + +class UploadedTo(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "UploadedTo" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/)?(.*)" + props['version'] = "0.3" + props['description'] = """Uploaded.to Download Plugin""" + props['author_name'] = ("spoob", "mkaay") + props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.time_plus_wait = None #time() + wait in seconds + self.api_data = None + self.want_reconnect = False + self.read_config() + if self.config['premium']: + self.multi_dl = True + else: + self.multi_dl = False + + self.start_dl = False + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + tries = 0 + + while not pyfile.status.url: + self.req.clear_cookies() + self.download_html() + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "The file was not found on the server." + + self.download_api_data() + + pyfile.status.filename = self.get_file_name() + + if self.config['premium']: + pyfile.status.url = self.parent.url + return True + + self.get_waiting_time() + + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + pyfile.status.filename = self.get_file_name() + + tries += 1 + if tries > 5: + raise Exception, "Error while preparing DL" + return True + + def download_api_data(self): + url = self.parent.url + match = re.compile(self.props['pattern']).search(url) + if match: + src = self.req.load("http://uploaded.to/api/file", cookies=False, get={"id": match.group(1).split("/")[0]}) + if not src.find("404 Not Found"): + return + self.api_data = {} + lines = src.splitlines() + self.api_data["filename"] = lines[0] + self.api_data["size"] = lines[1] # in kbytes + self.api_data["checksum"] = lines[2] #sha1 + + def download_html(self): + if self.config['premium']: + self.config['username'], self.config['password'] + self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}) + url = self.parent.url + self.html = self.req.load(url, cookies=False) + + def get_waiting_time(self): + try: + wait_minutes = re.search(r"Or wait ([\d\-]+) minutes", self.html).group(1) + if int(wait_minutes) < 0: wait_minutes = 1 + self.time_plus_wait = time() + 60 * int(wait_minutes) + self.want_reconnect = True + except: + self.time_plus_wait = 0 + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.config['premium']: + self.start_dl = True + return self.parent.url + try: + file_url_pattern = r".*<form name=\"download_form\" method=\"post\" action=\"(.*)\">" + return re.search(file_url_pattern, self.html).group(1) + except: + return None + + def get_file_name(self): + try: + if self.api_data and self.api_data["filename"]: + return self.api_data["filename"] + file_name = re.search(r"<td><b>\s+(.+)\s", self.html).group(1) + file_suffix = re.search(r"</td><td>(\..+)</td></tr>", self.html) + if not file_suffix: + return file_name + return file_name + file_suffix.group(1) + except: + return self.parent.url + + def file_exists(self): + if re.search(r"(File doesn't exist .*)", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + if self.config['premium']: + self.req.download(url, location, cookies=True) + else: + self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) + + def check_file(self, local_file): + if self.api_data and self.api_data["checksum"]: + h = hashlib.sha1() + f = open(local_file, "rb") + h.update(f.read()) + f.close() + hexd = h.hexdigest() + if hexd == self.api_data["checksum"]: + return (True, 0) + else: + return (False, 1) + else: + return (True, 5) diff --git a/module/plugins/hoster/XupIn.py b/module/plugins/hoster/XupIn.py new file mode 100644 index 000000000..d044f2389 --- /dev/null +++ b/module/plugins/hoster/XupIn.py @@ -0,0 +1,69 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin + +class XupIn(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "XupIn" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?xup.in/" + props['version'] = "0.1" + props['description'] = """Xup.in Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.posts = {} + self.want_reconnect = None + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + self.posts["vid"] = re.search('"hidden" value="(.*)" name="vid"', self.html).group(1) + self.posts["vtime"] = re.search('"hidden" value="(.*)" name="vtime"', self.html).group(1) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_url_pattern = r".*<form action=\"(.*)\" method=\"post\">" + return re.search(file_url_pattern, self.html).group(1) + else: + return False + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + return self.parent.url.split('/')[-2] + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*<font color=\"#ff0000\">File does not exist</font>.*)", self.html, re.I) != None: + return False + else: + return True + + def proceed(self, url, location): + self.req.download(url, location, self.posts) + + def wait_until(self): + if self.html == None: + self.download_html() + return self.time_plus_wait diff --git a/module/plugins/hoster/YoupornCom.py b/module/plugins/hoster/YoupornCom.py new file mode 100644 index 000000000..e501954da --- /dev/null +++ b/module/plugins/hoster/YoupornCom.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin + +class YoupornCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoupornCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www\.)?youporn\.com/watch/.+" + props['version'] = "0.1" + props['description'] = """Youporn.com Video Download Plugin""" + props['author_name'] = ("willnix") + props['author_mail'] = ("willnix@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + + def set_parent_status(self): + """ sets all available Statusinfos about a File in self.parent.status + """ + if self.html == None: + self.download_html() + self.parent.status.filename = self.get_file_name() + self.parent.status.url = self.get_file_url() + self.parent.status.wait = self.wait_until() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + file_url = re.search(r'(http://download.youporn.com/download/\d*/.*\?download=1&ll=1&t=dd)">', self.html).group(1) + print file_url + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + file_name_pattern = r".*<title>(.*) - Free Porn Videos - YouPorn.com Lite \(BETA\)</title>.*" + return re.search(file_name_pattern, self.html).group(1) + '.flv' + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*invalid video_id.*)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/hoster/YoutubeCom.py b/module/plugins/hoster/YoutubeCom.py new file mode 100644 index 000000000..38a4934df --- /dev/null +++ b/module/plugins/hoster/YoutubeCom.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin + +class YoutubeCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "YoutubeCom" + props['type'] = "hoster" + props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/watch\?v=.*" + props['version'] = "0.2" + props['description'] = """Youtube.com Video Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.read_config() + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html == None: + self.download_html() + + videoId = self.parent.url.split("v=")[1].split("&")[0] + videoHash = re.search(r', "t": "([^"]+)"', self.html).group(1) + quality = "" + if self.config['high_quality']: + quality = "&fmt=18" + file_url = 'http://youtube.com/get_video?video_id=' + videoId + '&t=' + videoHash + quality + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + + file_name_pattern = r"'VIDEO_TITLE': '(.*)'," + file_suffix = ".flv" + if self.config['high_quality']: + file_suffix = ".mp4" + name = re.search(file_name_pattern, self.html).group(1).replace("/", "") + file_suffix + + name = name.replace("&", "&") + return name + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"(.*eine fehlerhafte Video-ID\.)", self.html) != None: + return False + else: + return True diff --git a/module/plugins/hoster/ZippyshareCom.py b/module/plugins/hoster/ZippyshareCom.py new file mode 100644 index 000000000..bec7f8c65 --- /dev/null +++ b/module/plugins/hoster/ZippyshareCom.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +import urllib +from module.Plugin import Plugin + +class ZippyshareCom(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ZippyshareCom" + props['type'] = "hoster" + props['pattern'] = r"(http://)?www?\d{0,2}\.zippyshare.com/v/" + props['version'] = "0.1" + props['description'] = """Zippyshare.com Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = None + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html = self.req.load(url, cookies=True) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + file_url_pattern = r"var \w* = '(http%.*?)';" + file_url_search = re.search(file_url_pattern, self.html).group(1) + file_url = urllib.unquote(file_url_search.replace("nnn", "aaa").replace("unlg", "v").replace("serwus", "zippyshare")) + return file_url + + def get_file_name(self): + if self.html == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search("<strong>Name: </strong>(.*)</font><br />", self.html).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html == None: + self.download_html() + if re.search(r"HTTP Status 404", self.html) != None: + return False + else: + return True + + def proceed(self, url, location): + + self.req.download(url, location, cookies=True) diff --git a/module/plugins/hoster/ZshareNet.py b/module/plugins/hoster/ZshareNet.py new file mode 100644 index 000000000..08f28a35c --- /dev/null +++ b/module/plugins/hoster/ZshareNet.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +import re +from module.Plugin import Plugin + +class ZshareNet(Plugin): + + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "ZshareNet" + props['type'] = "hoster" + props['pattern'] = r"http://(?:www.)?zshare.net/" + props['version'] = "0.1" + props['description'] = """Zshare.net Download Plugin""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.parent = parent + self.html = [None, None] + self.html_old = None #time() where loaded the HTML + self.time_plus_wait = None #time() + wait in seconds + self.posts = {} + self.want_reconnect = False + self.multi_dl = False + + def download_html(self): + url = self.parent.url + self.html[0] = self.req.load(url) + if "/video/" in url: + url = url.replace("/video/", "/download/") + elif "/audio/" in url: + url = url.replace("/audio/", "/download/") + elif "/image/" in url: + url = url.replace("/image/", "/download/") + self.html[1] = self.req.load(url, None, {"download": "1"}) + + def get_file_url(self): + """ returns the absolute downloadable filepath + """ + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_url = "".join(eval(re.search("var link_enc=new Array(.*);link", self.html[1]).group(1))) + return file_url + else: + return False + + def get_file_name(self): + if self.html[0] == None: + self.download_html() + if not self.want_reconnect: + file_name = re.search("<font color=\"#666666\">(.*)</font></td>", self.html[0]).group(1) + return file_name + else: + return self.parent.url + + def file_exists(self): + """ returns True or False + """ + if self.html[0] == None: + self.download_html() + if re.search(r"File Not Found", self.html[0]) != None: + return False + else: + return True + + def wait_until(self): + if self.html[0] == None: + self.download_html() + return self.time_plus_wait diff --git a/module/plugins/hoster/__init__.py b/module/plugins/hoster/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/thread_list.py b/module/thread_list.py index fc4160a6d..719849585 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -188,7 +188,7 @@ class Thread_List(object): return False def reconnect(self): - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'], stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" -- cgit v1.2.3 From 48588a0d05492e46126776c3e7023397b9ad0b90 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 27 Dec 2009 02:40:56 +0100 Subject: Fixed reconnect loop (easy doing) --- module/download_thread.py | 3 +-- module/thread_list.py | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'module') diff --git a/module/download_thread.py b/module/download_thread.py index be6ff6bf0..3d4aa065d 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -77,7 +77,7 @@ class Download_Thread(threading.Thread): self.start() def run(self): - while (not self.shutdown): + while not self.shutdown: self.loadedPyFile = self.parent.get_job() if self.loadedPyFile: try: @@ -165,4 +165,3 @@ class Download_Thread(threading.Thread): sleep(1) pyfile.status.want_reconnect = False return True - diff --git a/module/thread_list.py b/module/thread_list.py index 719849585..ad0d0c8fb 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -188,17 +188,18 @@ class Thread_List(object): return False def reconnect(self): + self.parent.logger.info("Start reconnect") reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" - while ip == "": #solange versuch bis neue ip ausgelesen + while ip == "": try: ip = re.match(".*Current IP Address: (.*)</body>.*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) #versuchen neue ip aus zu lesen except: ip = "" time.sleep(1) - scripts_reconnected(ip) + self.scripts_reconnected(ip) self.parent.logger.info("Reconnected, new IP: " + ip) @@ -300,4 +301,3 @@ class Thread_List(object): continue speed[2].plugin.req.maxSpeed = eachSpeed*1024 print "max", speed[2].plugin.req.maxSpeed, "current", speed[2].plugin.req.dl_speed - -- cgit v1.2.3 From 757f025247d77b085b6168d5f625d2bbfa7c4c0d Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 27 Dec 2009 14:45:22 +0100 Subject: stop button works, closes #59 --- module/gui/MainWindow.py | 24 +++++++++++++++++++++--- module/gui/connector.py | 24 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 744518adb..74bf00b51 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -79,8 +79,13 @@ class MainWindow(QMainWindow): self.tabs = {} self.tabs["queue"] = {"w":QWidget()} self.tabs["collector"] = {"w":QWidget()} + self.tabs["settings"] = {"w":QWidget()} + self.tabs["log"] = {"w":QWidget()} self.tabw.addTab(self.tabs["queue"]["w"], "Queue") self.tabw.addTab(self.tabs["collector"]["w"], "Collector") + self.tabw.addTab(self.tabs["settings"]["w"], "Settings") + self.tabw.addTab(self.tabs["log"]["w"], "Log") + self.tabw.setTabEnabled(2, False) #init tabs self.init_tabs() @@ -159,6 +164,21 @@ class MainWindow(QMainWindow): self.tabs["collector"]["package_view"].setContextMenuPolicy(Qt.CustomContextMenu) self.tabs["collector"]["link_view"].setContextMenuPolicy(Qt.CustomContextMenu) self.tabs["queue"]["view"].setContextMenuPolicy(Qt.CustomContextMenu) + + #settings + self.tabs["settings"]["l"] = QGridLayout() + self.tabs["settings"]["w"].setLayout(self.tabs["settings"]["l"]) + #self.tabs["settings"]["view"] = QTreeWidget() + #self.tabs["settings"]["l"].addWidget(self.tabs["settings"]["view"]) + + #log + self.tabs["log"]["l"] = QGridLayout() + self.tabs["log"]["w"].setLayout(self.tabs["log"]["l"]) + self.tabs["log"]["text"] = QTextEdit() + self.tabs["log"]["text"].logOffset = 0 + self.tabs["log"]["text"].setReadOnly(True) + self.connect(self.tabs["log"]["text"], SIGNAL("append(QString)"), self.tabs["log"]["text"].append) + self.tabs["log"]["l"].addWidget(self.tabs["log"]["text"]) def init_context(self): """ @@ -183,10 +203,8 @@ class MainWindow(QMainWindow): def slotStatusStop(self): """ stop button (toolbar) - - dummy """ - print "stop!" + self.emit(SIGNAL("stopAllDownloads")) def slotAdd(self): """ diff --git a/module/gui/connector.py b/module/gui/connector.py index e52cf42ff..64c05ba8c 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -316,4 +316,28 @@ class connector(QThread): self.emit(SIGNAL("proxy_error"), "uploadContainer") finally: self.mutex.unlock() + + def getLog(self, offset): + """ + get log + """ + self.mutex.lock() + try: + return self.proxy.get_log(offset) + except: + self.emit(SIGNAL("proxy_error"), "getLog") + finally: + self.mutex.unlock() + + def stopAllDownloads(self): + """ + get log + """ + self.mutex.lock() + try: + self.proxy.stop_downloads() + except: + self.emit(SIGNAL("proxy_error"), "stopAllDownloads") + finally: + self.mutex.unlock() -- cgit v1.2.3 From ff7d4f1a13db0f4a9d6c427dcccbb0d1faf6c577 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 27 Dec 2009 15:26:33 +0100 Subject: closes #51 --- module/gui/MainWindow.py | 1 + module/gui/connector.py | 100 ++++++++++++++++++++++++++--------------------- 2 files changed, 57 insertions(+), 44 deletions(-) (limited to 'module') diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 74bf00b51..06df7447c 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -53,6 +53,7 @@ class MainWindow(QMainWindow): #set menubar and statusbar self.menubar = self.menuBar() self.statusbar = self.statusBar() + self.connect(self.statusbar, SIGNAL("showMsg"), self.statusbar.showMessage) self.serverStatus = QLabel("Status: Not Connected") self.statusbar.addPermanentWidget(self.serverStatus) diff --git a/module/gui/connector.py b/module/gui/connector.py index 64c05ba8c..8458d74b9 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -71,11 +71,11 @@ class connector(QThread): if not server_version == SERVER_VERSION: self.emit(SIGNAL("error_box"), "server is version %s client accepts version %s" % (server_version, SERVER_VERSION)) - def _proxyError(self, func): + def _proxyError(self, func, e): """ formats proxy error msg """ - msg = "proxy error in '%s'" % (func,) + msg = "proxy error in '%s':\n%s" % (func, e) self.errorQueue.append(msg) def getError(self): @@ -93,8 +93,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_collector_files() - except: - self.emit(SIGNAL("proxy_error"), "getLinkCollector") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getLinkCollector", e) finally: self.mutex.unlock() @@ -105,8 +105,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_collector_packages() - except: - self.emit(SIGNAL("proxy_error"), "getPackageCollector") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getPackageCollector", e) finally: self.mutex.unlock() @@ -117,8 +117,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_file_info(id) - except: - self.emit(SIGNAL("proxy_error"), "getLinkInfo") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getLinkInfo", e) finally: self.mutex.unlock() @@ -129,8 +129,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_package_data(id) - except: - self.emit(SIGNAL("proxy_error"), "getPackageInfo") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getPackageInfo", e) finally: self.mutex.unlock() @@ -141,8 +141,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_queue() - except: - self.emit(SIGNAL("proxy_error"), "getPackageQueue") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getPackageQueue", e) finally: self.mutex.unlock() @@ -153,8 +153,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_package_files(id) - except: - self.emit(SIGNAL("proxy_error"), "getPackageFiles") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getPackageFiles", e) finally: self.mutex.unlock() @@ -165,8 +165,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.status_downloads() - except: - self.emit(SIGNAL("proxy_error"), "getDownloadQueue") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getDownloadQueue", e) finally: self.mutex.unlock() @@ -177,8 +177,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.status_server() - except: - self.emit(SIGNAL("proxy_error"), "getServerStatus") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getServerStatus", e) finally: self.mutex.unlock() @@ -189,8 +189,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.add_urls(links) - except: - self.emit(SIGNAL("proxy_error"), "addURLs") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "addURLs", e) finally: self.mutex.unlock() @@ -201,8 +201,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.toggle_pause() - except: - self.emit(SIGNAL("proxy_error"), "togglePause") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "togglePause", e) finally: self.mutex.unlock() @@ -216,8 +216,8 @@ class connector(QThread): self.proxy.pause_server() else: self.proxy.unpause_server() - except: - self.emit(SIGNAL("proxy_error"), "setPause") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "setPause", e) finally: self.mutex.unlock() @@ -228,8 +228,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.new_package(name) - except: - self.emit(SIGNAL("proxy_error"), "newPackage") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "newPackage", e) finally: self.mutex.unlock() @@ -240,8 +240,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.move_file_2_package(fileid, packid) - except: - self.emit(SIGNAL("proxy_error"), "addFileToPackage") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "addFileToPackage", e) finally: self.mutex.unlock() @@ -252,8 +252,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.push_package_2_queue(packid) - except: - self.emit(SIGNAL("proxy_error"), "pushPackageToQueue") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "pushPackageToQueue", e) finally: self.mutex.unlock() @@ -264,8 +264,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.restart_package(packid) - except: - self.emit(SIGNAL("proxy_error"), "restartPackage") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "restartPackage", e) finally: self.mutex.unlock() @@ -276,8 +276,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.restart_file(fileid) - except: - self.emit(SIGNAL("proxy_error"), "restartFile") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "restartFile", e) finally: self.mutex.unlock() @@ -288,8 +288,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.del_packages([packid,]) - except: - self.emit(SIGNAL("proxy_error"), "removePackage") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "removePackage", e) finally: self.mutex.unlock() @@ -300,8 +300,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.del_links([fileid,]) - except: - self.emit(SIGNAL("proxy_error"), "removeFile") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "removeFile", e) finally: self.mutex.unlock() @@ -312,8 +312,8 @@ class connector(QThread): self.mutex.lock() try: self.proxy.upload_container(filename, type, content) - except: - self.emit(SIGNAL("proxy_error"), "uploadContainer") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "uploadContainer", e) finally: self.mutex.unlock() @@ -324,8 +324,8 @@ class connector(QThread): self.mutex.lock() try: return self.proxy.get_log(offset) - except: - self.emit(SIGNAL("proxy_error"), "getLog") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getLog", e) finally: self.mutex.unlock() @@ -336,8 +336,20 @@ class connector(QThread): self.mutex.lock() try: self.proxy.stop_downloads() - except: - self.emit(SIGNAL("proxy_error"), "stopAllDownloads") + except Exception, e: + self.emit(SIGNAL("proxy_error"), "stopAllDownloads", e) + finally: + self.mutex.unlock() + + def updateAvailable(self): + """ + update available + """ + self.mutex.lock() + try: + return self.proxy.update_available() + except Exception, e: + self.emit(SIGNAL("proxy_error"), "updateAvailable", e) finally: self.mutex.unlock() -- cgit v1.2.3 From 090c9d2abdac07025fe6d7351e376e85aabc0891 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 27 Dec 2009 22:16:51 +0100 Subject: fixed uploaded.to and netload.in, gui clipboard check --- module/file_list.py | 8 ++++++++ module/gui/MainWindow.py | 35 ++++++++++++++++++++++++++++++++--- module/gui/connector.py | 1 + module/plugins/hoster/NetloadIn.py | 2 +- module/plugins/hoster/UploadedTo.py | 4 +--- 5 files changed, 43 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index bb04ae898..d80310cdd 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -365,6 +365,14 @@ class File_List(object): pyfile.status.type = None finally: packager.file_list.lock.release() + + def abortFile(packager, fileid): + packager.file_list.lock.acquire() + try: + key, n, pyfile, pypack, pid = packager._getFileFromID(fileid) + pyfile.plugin.req.abort = True + finally: + packager.file_list.lock.release() #oooops, duplicate? def removeFileFromPackage(packager, id, pid): diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 06df7447c..1e769110b 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -121,9 +121,12 @@ class MainWindow(QMainWindow): self.actions["status_stop"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_stop.png"), "Stop") self.toolbar.addSeparator() self.actions["add"] = self.toolbar.addAction(QIcon("icons/gui/toolbar_add.png"), "Add") - #self.toolbar.addAction(QIcon("icons/gui/toolbar_remove.png"), "Remove") + self.toolbar.addSeparator() + self.actions["clipboard"] = self.toolbar.addAction(QIcon("icons/gui/clipboard.png"), "Check Clipboard") + self.actions["clipboard"].setCheckable(True) self.connect(self.actions["toggle_status"], SIGNAL("toggled(bool)"), self.slotToggleStatus) + self.connect(self.actions["clipboard"], SIGNAL("toggled(bool)"), self.slotToggleClipboard) self.connect(self.actions["status_stop"], SIGNAL("triggered()"), self.slotStatusStop) self.addMenu = QMenu() packageAction = self.addMenu.addAction("Package") @@ -185,6 +188,8 @@ class MainWindow(QMainWindow): """ create context menus """ + self.activeMenu = None + #queue self.queueContext = QMenu() self.queueContext.buttons = {} self.queueContext.item = (None, None) @@ -194,6 +199,14 @@ class MainWindow(QMainWindow): self.queueContext.addAction(self.queueContext.buttons["restart"]) self.connect(self.queueContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload) + + #package collector + self.packageCollectorContext = QMenu() + self.packageCollectorContext.buttons = {} + self.packageCollectorContext.item = (None, None) + self.packageCollectorContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.packageCollectorContext) + self.packageCollectorContext.addAction(self.packageCollectorContext.buttons["remove"]) + self.connect(self.packageCollectorContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) def slotToggleStatus(self, status): """ @@ -317,13 +330,23 @@ class MainWindow(QMainWindow): self.queueContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) menuPos = QCursor.pos() menuPos.setX(menuPos.x()+2) + self.activeMenu = self.queueContext self.queueContext.exec_(menuPos) def slotPackageCollectorContextMenu(self, pos): """ custom context menu in package collector view requested """ - pass + globalPos = self.tabs["collector"]["package_view"].mapToGlobal(pos) + i = self.tabs["collector"]["package_view"].itemAt(pos) + if not i: + return + i.setSelected(True) + self.packageCollectorContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) + menuPos = QCursor.pos() + menuPos.setX(menuPos.x()+2) + self.activeMenu = self.packageCollectorContext + self.packageCollectorContext.exec_(menuPos) def slotLinkCollectorContextMenu(self, pos): """ @@ -343,7 +366,13 @@ class MainWindow(QMainWindow): """ remove download action is triggered """ - id, isTopLevel = self.queueContext.item + id, isTopLevel = self.activeMenu.item if not id == None: self.emit(SIGNAL("removeDownload"), id, isTopLevel) + + def slotToggleClipboard(self, status): + """ + check clipboard (toolbar) + """ + self.emit(SIGNAL("setClipboardStatus"), status) diff --git a/module/gui/connector.py b/module/gui/connector.py index 8458d74b9..3f594d68e 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -335,6 +335,7 @@ class connector(QThread): """ self.mutex.lock() try: + self.proxy.pause_server() self.proxy.stop_downloads() except Exception, e: self.emit(SIGNAL("proxy_error"), "stopAllDownloads", e) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index bc755fb58..dc639df45 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -64,7 +64,7 @@ class NetloadIn(Plugin): def download_api_data(self): url = self.parent.url - id_regex = re.compile("http://netload.in/datei(.*?)(?:\.htm|/)") + id_regex = re.compile("http://.*netload.in/datei(.*?)(?:\.htm|/)") match = id_regex.search(url) if match: apiurl = "http://netload.in/share/fileinfos2.php" diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index bb623b4e6..0d487be46 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -84,9 +84,6 @@ class UploadedTo(Plugin): self.api_data["checksum"] = lines[2] #sha1 def download_html(self): - if self.config['premium']: - self.config['username'], self.config['password'] - self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}) url = self.parent.url self.html = self.req.load(url, cookies=False) @@ -131,6 +128,7 @@ class UploadedTo(Plugin): def proceed(self, url, location): if self.config['premium']: + self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}, cookies=True) self.req.download(url, location, cookies=True) else: self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) -- cgit v1.2.3 From ea1cbdf0a88216d128ed63ec62b1ff0f22123556 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 27 Dec 2009 23:29:51 +0100 Subject: Fixed Reconnect in Netload and Rapidshare --- module/plugins/hoster/NetloadIn.py | 3 +++ module/plugins/hoster/RapidshareCom.py | 1 + 2 files changed, 4 insertions(+) (limited to 'module') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index dc639df45..6941ad033 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -38,6 +38,8 @@ class NetloadIn(Plugin): def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() + self.want_reconnect = False + self.download_api_data() if self.file_exists(): @@ -116,6 +118,7 @@ class NetloadIn(Plugin): def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): + self.want_reconnect = True self.time_plus_wait = time() + 10 * 30 return diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 973e28470..5da9996fd 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -39,6 +39,7 @@ class RapidshareCom(Plugin): def prepare(self, thread): pyfile = self.parent self.req.clear_cookies() + self.want_reconnect = False self.download_api_data() if self.api_data["status"] == "1": -- cgit v1.2.3 From d47c551729d7c2c10b4a990015896ec201c5225b Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Mon, 28 Dec 2009 15:07:12 +0100 Subject: DLC Error Log --- module/plugins/container/DLC.pyc | Bin 5740 -> 5713 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module') diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc index 235e46e1a..dc9a92556 100644 Binary files a/module/plugins/container/DLC.pyc and b/module/plugins/container/DLC.pyc differ -- cgit v1.2.3 From ce2a8294b5aefe4497c88f24c817084868b8b1eb Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 15:32:06 +0100 Subject: gui now stable --- module/Plugin.py | 37 +++--- module/file_list.py | 6 + module/gui/Collector.py | 184 +++++++++++++--------------- module/gui/MainWindow.py | 6 +- module/gui/Queue.py | 217 ++++++++++++++++++--------------- module/plugins/hoster/RapidshareCom.py | 2 +- 6 files changed, 235 insertions(+), 217 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 9390cbe07..f3830595d 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -1,23 +1,22 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- -# -#Copyright (C) 2009 kingzero, RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### -import ConfigParser + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: RaNaN, spoob, mkaay +""" + import logging import re from os.path import exists, join diff --git a/module/file_list.py b/module/file_list.py index d80310cdd..21e084483 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -127,8 +127,14 @@ class File_List(object): for thread_list only """ files = [] + for pypack in self.data["queue"] + self.data["packages"]: + for pyfile in pypack.files: + if pyfile.plugin.props['type'] == "container" and not pyfile.active: + files.append(pyfile) for pypack in self.data["queue"]: for pyfile in pypack.files: + if pyfile in files: + continue if (pyfile.status.type == "reconnected" or pyfile.status.type == None) and not pyfile.active: files.append(pyfile) return files diff --git a/module/gui/Collector.py b/module/gui/Collector.py index bf0e50349..c2d167291 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -21,6 +21,8 @@ from PyQt4.QtGui import * from time import sleep +from module.gui.Queue import ItemIterator + class PackageCollector(QThread): def __init__(self, view, connector): QThread.__init__(self) @@ -52,7 +54,7 @@ class PackageCollector(QThread): pack = self.getPack(data["id"]) if not pack: pack = self.PackageCollectorPack(self) - pack.setData(data) + pack.setPackData(data) self.addPack(data["id"], pack) files = self.connector.getPackageFiles(data["id"]) pack.clear(files) @@ -61,125 +63,115 @@ class PackageCollector(QThread): child = pack.getChild(fid) if not child: child = self.PackageCollectorFile(self, pack) - child.setData(info) - pack.addChild(fid, child) + child.setFileData(info) + pack.addPackChild(fid, child) def addPack(self, pid, newPack): pos = None try: - for k, pack in enumerate(self.collector): - if pack.getData()["id"] == pid: - pos = k + for pack in ItemIterator(self.rootItem): + if pack.getPackData()["id"] == pid: + pos = self.rootItem.indexOfChild(pack) break if pos == None: raise Exception() - self.collector[pos] = newPack + item = self.rootItem.child(pos) + item.setPackData(newPack.getPackData()) except: - self.collector.append(newPack) - pos = self.collector.index(newPack) - item = self.rootItem.child(pos) - if not item: - item = QTreeWidgetItem() - self.rootItem.insertChild(pos, item) - item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) + self.rootItem.addChild(newPack) + item = newPack + item.setData(0, Qt.DisplayRole, QVariant(item.getPackData()["package_name"])) item.setData(0, Qt.UserRole, QVariant(pid)) def getPack(self, pid): - for k, pack in enumerate(self.collector): - if pack.getData()["id"] == pid: + for k, pack in enumerate(ItemIterator(self.rootItem)): + if pack.getPackData()["id"] == pid: return pack return None def clear(self, ids): clear = False - for pack in self.collector: - if not pack.getData()["id"] in ids: + for pack in ItemIterator(self.rootItem): + if not pack.getPackData()["id"] in ids: clear = True break if not clear: return - self.queue = [] self.rootItem.takeChildren() - class PackageCollectorPack(): + class PackageCollectorPack(QTreeWidgetItem): def __init__(self, collector): + QTreeWidgetItem.__init__(self) self.collector = collector - self.data = [] - self.children = [] + self._data = {} - def addChild(self, cid, newChild): + def addPackChild(self, cid, newChild): pos = None try: - for k, child in enumerate(self.getChildren()): + for child in ItemIterator(self): if child.getData()["id"] == cid: - pos = k + pos = self.indexOfChild(child) break if pos == None: raise Exception() - self.children[pos] = newChild + item = self.child(pos) + item.setFileData(newChild.getFileData()) except: - self.children.append(newChild) - pos = self.children.index(newChild) - ppos = self.collector.collector.index(self) - parent = self.collector.rootItem.child(ppos) - item = parent.child(pos) - if not item: - item = QTreeWidgetItem() - parent.insertChild(pos, item) - status = "%s (%s)" % (newChild.getData()["status_type"], newChild.getData()["plugin"]) - item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) + self.addChild(newChild) + item = newChild + item.setData(0, Qt.DisplayRole, QVariant(item.getFileData()["filename"])) item.setData(0, Qt.UserRole, QVariant(cid)) - flags = Qt.ItemIsEnabled - item.setFlags(flags) - def getChildren(self): - return self.children + def setPackData(self, data): + self._data = data - def getChild(self, cid): - try: - return self.children[cid] - except: - return None - - def hasChildren(self, data): - return (len(self.children) > 0) + def getPackData(self): + return self._data - def setData(self, data): - self.data = data + def getChildren(self): + ret = [] + for item in ItemIterator(self): + ret.append(item) + return ret - def getData(self): - return self.data + def getChild(self, cid): + for item in ItemIterator(self): + if item.getFileData()["id"] == cid: + return item + return None def clear(self, ids): clear = False - children = {} - for file in self.getChildren(): - if not file.getData()["id"] in ids: - clear = True - break - try: - children[file.getData()["id"]] - clear = True - except: - children[file.getData()["id"]] = True - - if not clear: + remove = [] + children = [] + for k, file in enumerate(self.getChildren()): + if not file.getFileData()["id"] in ids: + remove.append(file.getFileData()["id"]) + if file.getFileData()["id"] in children and not file.getFileData()["id"] in remove: + remove.append(file.getFileData()["id"]) + continue + children.append(file.getFileData()["id"]) + if not remove: return - ppos = self.collector.collector.index(self) - parent = self.collector.rootItem.child(ppos) - parent.takeChildren() - self.children = [] + remove.sort() + remove.reverse() + parent = self + for k in remove: + parent.takeChild(k) - class PackageCollectorFile(): + class PackageCollectorFile(QTreeWidgetItem): def __init__(self, collector, pack): + QTreeWidgetItem.__init__(self) self.collector = collector self.pack = pack + self._data = {} + self.wait_since = None - def getData(self): - return self.data + def getFileData(self): + return self._data - def setData(self, data): - self.data = data + def setFileData(self, data): + self._data = data def getPack(self): return self.pack @@ -189,9 +181,9 @@ class LinkCollector(QThread): QThread.__init__(self) self.view = view self.connector = connector - self.collector = [] self.interval = 2 self.running = True + self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() def run(self): @@ -211,54 +203,52 @@ class LinkCollector(QThread): file = self.getFile(id) if not file: file = self.LinkCollectorFile(self) - file.setData(data) + file.setFileData(data) self.addFile(id, file) def addFile(self, pid, newFile): pos = None try: - for k, file in enumerate(self.collector): - if file.getData()["id"] == pid: - pos = k + for pack in ItemIterator(self.rootItem): + if file.getFileData()["id"] == pid: + pos = self.rootItem.indexOfChild(file) break if pos == None: raise Exception() - self.collector[pos] = newFile + item = self.rootItem.child(pos) + item.setFileData(newFile.getPackData()) except: - self.collector.append(newFile) - pos = self.collector.index(newFile) - item = self.view.topLevelItem(pos) - if not item: - item = QTreeWidgetItem() - self.view.insertTopLevelItem(pos, item) - item.setData(0, Qt.DisplayRole, QVariant(newFile.getData()["filename"])) + self.rootItem.addChild(newFile) + item = newFile + item.setData(0, Qt.DisplayRole, QVariant(newFile.getFileData()["filename"])) item.setData(0, Qt.UserRole, QVariant(pid)) flags = Qt.ItemIsSelectable | Qt.ItemIsDragEnabled | Qt.ItemIsEnabled item.setFlags(flags) def getFile(self, pid): - for k, file in enumerate(self.collector): - if file.getData()["id"] == pid: + for file in ItemIterator(self.rootItem): + if file.getFileData()["id"] == pid: return file return None def clear(self, ids): clear = False - for pack in self.collector: - if not pack.getData()["id"] in ids: + for file in ItemIterator(self.rootItem): + if not file.getFileData()["id"] in ids: clear = True break if not clear: return - self.collector = [] - self.view.emit(SIGNAL("clear")) + self.rootItem.takeChildren() - class LinkCollectorFile(): + class LinkCollectorFile(QTreeWidgetItem): def __init__(self, collector): + QTreeWidgetItem.__init__(self) self.collector = collector + self._data = {} - def getData(self): - return self.data + def getFileData(self): + return self._data - def setData(self, data): - self.data = data + def setFileData(self, data): + self._data = data diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 1e769110b..76f60a5bd 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -281,7 +281,11 @@ class MainWindow(QMainWindow): """ items = self.tabs["collector"]["package_view"].selectedItems() for item in items: - id = item.data(0, Qt.UserRole).toPyObject() + try: + id = item.getFileData()["id"] + id = item.parent().getPackData()["id"] + except: + id = item.getPackData()["id"] self.emit(SIGNAL("pushPackageToQueue"), id) def saveWindow(self): diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 0def31bf6..c0f43c740 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -28,15 +28,16 @@ class Queue(QThread): self.connector = connector self.statusMap = { "finished": 0, - "checking": 1, - "waiting": 2, - "reconnected": 3, - "downloading": 4, - "failed": 5, - "aborted": 6, + "queued": 1, + "checking": 2, + "waiting": 3, + "reconnected": 4, + "starting": 5, + "downloading": 6, + "failed": 7, + "aborted": 8, } self.statusMapReverse = dict((v,k) for k, v in self.statusMap.iteritems()) - self.queue = [] self.interval = 1 self.running = True self.wait_dict = {} @@ -70,10 +71,10 @@ class Queue(QThread): pack = self.getPack(data["id"]) if not pack: pack = self.QueuePack(self) - pack.setData(data) - self.addPack(data["id"], pack) + pack.setPackData(data) files = self.connector.getPackageFiles(data["id"]) pack.clear(files) + self.addPack(data["id"], pack) for fid in files: info = self.connector.getLinkInfo(fid) child = pack.getChild(fid) @@ -84,35 +85,36 @@ class Queue(QThread): info["downloading"] = downloading[info["id"]] except: pass - child.setData(info) - pack.addChild(fid, child) + if not info["status_type"]: + info["status_type"] = "queued" + child.setFileData(info) + pack.addPackChild(fid, child) + self.addPack(data["id"], pack) def addPack(self, pid, newPack): pos = None try: - for k, pack in enumerate(self.queue): - if pack.getData()["id"] == pid: - pos = k + for pack in QueueIterator(self.rootItem): + if pack.getPackData()["id"] == pid: + pos = self.rootItem.indexOfChild(pack) break if pos == None: raise Exception() - self.queue[pos] = newPack + item = self.rootItem.child(pos) + item.setPackData(newPack.getPackData()) except: - self.queue.append(newPack) - pos = self.queue.index(newPack) - item = self.rootItem.child(pos) - if not item: - item = QTreeWidgetItem() - self.rootItem.insertChild(pos, item) - item.setData(0, Qt.DisplayRole, QVariant(newPack.getData()["package_name"])) + self.rootItem.addChild(newPack) + item = newPack + item.setData(0, Qt.DisplayRole, QVariant(item.getPackData()["package_name"])) status = -1 - speed = self.getSpeed(newPack) + speed = self.getSpeed(item) plugins = [] - for child in newPack.getChildren(): - if self.statusMap.has_key(child.data["status_type"]) and self.statusMap[child.data["status_type"]] > status: - status = self.statusMap[child.data["status_type"]] - if not child.data["plugin"] in plugins: - plugins.append(child.data["plugin"]) + for child in item.getChildren(): + data = child.getFileData() + if self.statusMap.has_key(data["status_type"]) and self.statusMap[data["status_type"]] > status: + status = self.statusMap[data["status_type"]] + if not data["plugin"] in plugins: + plugins.append(data["plugin"]) if status >= 0: if speed == None: statustxt = self.statusMapReverse[status] @@ -121,29 +123,28 @@ class Queue(QThread): item.setData(2, Qt.DisplayRole, QVariant(statustxt)) item.setData(1, Qt.DisplayRole, QVariant(", ".join(plugins))) item.setData(0, Qt.UserRole, QVariant(pid)) - item.setData(3, Qt.UserRole, QVariant(newPack)) + item.setData(3, Qt.UserRole, QVariant(item)) def getPack(self, pid): - for k, pack in enumerate(self.queue): - if pack.getData()["id"] == pid: + for k, pack in enumerate(ItemIterator(self.rootItem)): + if pack.getPackData()["id"] == pid: return pack return None def clear(self, ids): clear = False - for pack in self.queue: - if not pack.getData()["id"] in ids: + for pack in ItemIterator(self.rootItem): + if not pack.getPackData()["id"] in ids: clear = True break if not clear: return - self.queue = [] self.rootItem.takeChildren() def getWaitingProgress(self, q): locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): - data = q.getData() + data = q.getFileData() if data["status_type"] == "waiting" and data["downloading"]: until = float(data["downloading"]["wait_until"]) try: @@ -164,7 +165,7 @@ class Queue(QThread): def getProgress(self, q): locker = QMutexLocker(self.mutex) if isinstance(q, self.QueueFile): - data = q.getData() + data = q.getFileData() if data["downloading"]: return int(data["downloading"]["percent"]) if data["status_type"] == "finished" or \ @@ -177,12 +178,12 @@ class Queue(QThread): perc_sum = 0 for child in children: val = 0 - data = child.getData() + data = child.getFileData() if data["downloading"]: val = int(data["downloading"]["percent"]) - elif child.data["status_type"] == "finished" or \ - child.data["status_type"] == "failed" or \ - child.data["status_type"] == "aborted": + elif data["status_type"] == "finished" or \ + data["status_type"] == "failed" or \ + data["status_type"] == "aborted": val = 100 perc_sum += val if count == 0: @@ -192,7 +193,7 @@ class Queue(QThread): def getSpeed(self, q): if isinstance(q, self.QueueFile): - data = q.getData() + data = q.getFileData() if data["downloading"]: return int(data["downloading"]["speed"]) elif isinstance(q, self.QueuePack): @@ -203,7 +204,7 @@ class Queue(QThread): running = False for child in children: val = 0 - data = child.getData() + data = child.getFileData() if data["downloading"]: if not data["status_type"] == "waiting": all_waiting = False @@ -215,91 +216,87 @@ class Queue(QThread): return speed_sum return None - class QueuePack(): + class QueuePack(QTreeWidgetItem): def __init__(self, queue): + QTreeWidgetItem.__init__(self) self.queue = queue - self.data = [] - self.children = [] + self._data = {} - def addChild(self, cid, newChild): + def addPackChild(self, cid, newChild): pos = None try: - for k, child in enumerate(self.getChildren()): + for child in ItemIterator(self): if child.getData()["id"] == cid: - pos = k + pos = self.indexOfChild(child) break if pos == None: raise Exception() - self.children[pos] = newChild + item = self.child(pos) + item.setFileData(newChild.getFileData()) except: - self.children.append(newChild) - pos = self.children.index(newChild) - ppos = self.queue.queue.index(self) - parent = self.queue.rootItem.child(ppos) - item = parent.child(pos) - if not item: - item = QTreeWidgetItem() - parent.insertChild(pos, item) - speed = self.queue.getSpeed(newChild) - if speed == None or newChild.getData()["status_type"] == "starting": - status = newChild.getData()["status_type"] + self.addChild(newChild) + item = newChild + speed = self.queue.getSpeed(item) + if speed == None or item.getFileData()["status_type"] == "starting": + status = item.getFileData()["status_type"] else: - status = "%s (%s KB/s)" % (newChild.getData()["status_type"], speed) - item.setData(0, Qt.DisplayRole, QVariant(newChild.getData()["filename"])) + status = "%s (%s KB/s)" % (item.getFileData()["status_type"], speed) + item.setData(0, Qt.DisplayRole, QVariant(item.getFileData()["filename"])) item.setData(2, Qt.DisplayRole, QVariant(status)) - item.setData(1, Qt.DisplayRole, QVariant(newChild.getData()["plugin"])) + item.setData(1, Qt.DisplayRole, QVariant(item.getFileData()["plugin"])) item.setData(0, Qt.UserRole, QVariant(cid)) - item.setData(3, Qt.UserRole, QVariant(newChild)) - - def getChildren(self): - return self.children + item.setData(3, Qt.UserRole, QVariant(item)) - def getChild(self, cid): - try: - return self.children[cid] - except: - return None + def setPackData(self, data): + self._data = data - def hasChildren(self, data): - return (len(self.children) > 0) + def getPackData(self): + return self._data - def setData(self, data): - self.data = data + def getChildren(self): + ret = [] + for item in ItemIterator(self): + ret.append(item) + return ret - def getData(self): - return self.data + def getChild(self, cid): + for item in ItemIterator(self): + if item.getFileData()["id"] == cid: + return item + return None def clear(self, ids): clear = False - children = {} - for file in self.getChildren(): - if not file.getData()["id"] in ids: - clear = True - break - try: - children[file.getData()["id"]] - clear = True - except: - children[file.getData()["id"]] = True - - if not clear: + remove = [] + children = [] + for k, file in enumerate(self.getChildren()): + if not file.getFileData()["id"] in ids: + remove.append(file.getFileData()["id"]) + if file.getFileData()["id"] in children and not file.getFileData()["id"] in remove: + remove.append(file.getFileData()["id"]) + continue + children.append(file.getFileData()["id"]) + if not remove: return - ppos = self.queue.queue.index(self) - parent = self.queue.rootItem.child(ppos) - parent.takeChildren() - self.children = [] + remove.sort() + remove.reverse() + parent = self + for k in remove: + parent.takeChild(k) - class QueueFile(): + class QueueFile(QTreeWidgetItem): def __init__(self, queue, pack): + QTreeWidgetItem.__init__(self) self.queue = queue self.pack = pack + self._data = {} self.wait_since = None - def getData(self): - return self.data + def getFileData(self): + return self._data - def setData(self, data): - self.data = data + def setFileData(self, data): + self._data = data def getPack(self): return self.pack @@ -335,3 +332,25 @@ class QueueProgressBarDelegate(QItemDelegate): QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter) return QItemDelegate.paint(self, painter, option, index) + +class ItemIterator(): + def __init__(self, item): + self.item = item + self.current = -1 + + def __iadd__(self, val): + self.current += val + + def value(self): + return self.item.child(self.current) + + def next(self): + self.__iadd__(1) + value = self.value() + if value: + return self.value() + else: + raise StopIteration + + def __iter__(self): + return self diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 5da9996fd..754c885ef 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -109,7 +109,7 @@ class RapidshareCom(Plugin): src = self.req.load(api_url_base, cookies=False, get=api_param_prem) if src.startswith("ERROR"): self.config["premium"] = False - self.logger.info("Rapidshare: Login faild") + self.logger.info("Rapidshare: Login failed") return fields = src.split("\n") premkbleft = int(fields[19].split("=")[1]) -- cgit v1.2.3 From c93ba86ca5bdee6abe1dccabe25c02b462d435e2 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Mon, 28 Dec 2009 16:52:00 +0100 Subject: Fixed DLC --- module/plugins/container/DLC.pyc | Bin 5713 -> 5713 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module') diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc index dc9a92556..5dd89b5dd 100644 Binary files a/module/plugins/container/DLC.pyc and b/module/plugins/container/DLC.pyc differ -- cgit v1.2.3 From da359f8c770bac754234e0f899058b25126cd476 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 19:51:37 +0100 Subject: gui: easier package management --- module/gui/Collector.py | 26 +++++++++++++++++------- module/gui/MainWindow.py | 50 ++++++++++++++++++++++++----------------------- module/gui/PackageDock.py | 2 +- module/gui/Queue.py | 10 +++++++--- 4 files changed, 53 insertions(+), 35 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index c2d167291..07a5203e9 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -33,6 +33,12 @@ class PackageCollector(QThread): self.running = True self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() + item = self.PackageCollectorPack(self) + item.setPackData({"id":"fixed"}) + item.setData(0, Qt.DisplayRole, QVariant("Single Links")) + item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) + self.rootItem.addChild(item) + self.linkCollector = item def run(self): while self.running: @@ -78,10 +84,11 @@ class PackageCollector(QThread): item = self.rootItem.child(pos) item.setPackData(newPack.getPackData()) except: - self.rootItem.addChild(newPack) + self.rootItem.insertChild(self.rootItem.childCount()-1, newPack) item = newPack item.setData(0, Qt.DisplayRole, QVariant(item.getPackData()["package_name"])) item.setData(0, Qt.UserRole, QVariant(pid)) + item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) def getPack(self, pid): for k, pack in enumerate(ItemIterator(self.rootItem)): @@ -91,13 +98,17 @@ class PackageCollector(QThread): def clear(self, ids): clear = False - for pack in ItemIterator(self.rootItem): - if not pack.getPackData()["id"] in ids: + remove = [] + for k, pack in enumerate(ItemIterator(self.rootItem)): + if not pack.getPackData()["id"] in ids and not pack.getPackData()["id"] == "fixed": clear = True - break + remove.append(k) if not clear: return - self.rootItem.takeChildren() + remove.sort() + remove.reverse() + for k in remove: + self.rootItem.takeChild(k) class PackageCollectorPack(QTreeWidgetItem): def __init__(self, collector): @@ -121,6 +132,7 @@ class PackageCollector(QThread): item = newChild item.setData(0, Qt.DisplayRole, QVariant(item.getFileData()["filename"])) item.setData(0, Qt.UserRole, QVariant(cid)) + item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) def setPackData(self, data): self._data = data @@ -177,13 +189,13 @@ class PackageCollector(QThread): return self.pack class LinkCollector(QThread): - def __init__(self, view, connector): + def __init__(self, view, root, connector): QThread.__init__(self) self.view = view self.connector = connector self.interval = 2 self.running = True - self.rootItem = self.view.invisibleRootItem() + self.rootItem = root self.mutex = QMutex() def run(self): diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 76f60a5bd..610d8e840 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -102,8 +102,9 @@ class MainWindow(QMainWindow): self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close) self.connect(self.tabs["queue"]["view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotQueueContextMenu) - self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotPackageCollectorContextMenu) - self.connect(self.tabs["collector"]["link_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotLinkCollectorContextMenu) + self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotcollectorContextMenu) + + self.lastAddedID = None def init_toolbar(self): """ @@ -149,31 +150,21 @@ class MainWindow(QMainWindow): #collector groupPackage = QGroupBox("Packages") - groupLinks = QGroupBox("Links") groupPackage.setLayout(QVBoxLayout()) - groupLinks.setLayout(QVBoxLayout()) toQueue = QPushButton("Push selected packages to queue") self.tabs["collector"]["l"] = QGridLayout() self.tabs["collector"]["w"].setLayout(self.tabs["collector"]["l"]) self.tabs["collector"]["package_view"] = QTreeWidget() - self.connect(self.tabs["collector"]["package_view"], SIGNAL("clear"), self.tabs["collector"]["package_view"].clear) - self.tabs["collector"]["link_view"] = QTreeWidget() - self.connect(self.tabs["collector"]["link_view"], SIGNAL("clear"), self.tabs["collector"]["link_view"].clear) groupPackage.layout().addWidget(self.tabs["collector"]["package_view"]) groupPackage.layout().addWidget(toQueue) - groupLinks.layout().addWidget(self.tabs["collector"]["link_view"]) self.tabs["collector"]["l"].addWidget(groupPackage, 0, 0) - self.tabs["collector"]["l"].addWidget(groupLinks, 0, 1) self.connect(toQueue, SIGNAL("clicked()"), self.slotPushPackageToQueue) self.tabs["collector"]["package_view"].setContextMenuPolicy(Qt.CustomContextMenu) - self.tabs["collector"]["link_view"].setContextMenuPolicy(Qt.CustomContextMenu) self.tabs["queue"]["view"].setContextMenuPolicy(Qt.CustomContextMenu) #settings self.tabs["settings"]["l"] = QGridLayout() self.tabs["settings"]["w"].setLayout(self.tabs["settings"]["l"]) - #self.tabs["settings"]["view"] = QTreeWidget() - #self.tabs["settings"]["l"].addWidget(self.tabs["settings"]["view"]) #log self.tabs["log"]["l"] = QGridLayout() @@ -200,13 +191,16 @@ class MainWindow(QMainWindow): self.connect(self.queueContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload) - #package collector - self.packageCollectorContext = QMenu() - self.packageCollectorContext.buttons = {} - self.packageCollectorContext.item = (None, None) - self.packageCollectorContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.packageCollectorContext) - self.packageCollectorContext.addAction(self.packageCollectorContext.buttons["remove"]) - self.connect(self.packageCollectorContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) + #collector + self.collectorContext = QMenu() + self.collectorContext.buttons = {} + self.collectorContext.item = (None, None) + self.collectorContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.collectorContext) + self.collectorContext.buttons["push"] = QAction(QIcon("icons/gui/push_small.png"), "Push to queue", self.collectorContext) + self.collectorContext.addAction(self.collectorContext.buttons["push"]) + self.collectorContext.addAction(self.collectorContext.buttons["remove"]) + self.connect(self.collectorContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) + self.connect(self.collectorContext.buttons["push"], SIGNAL("triggered()"), self.slotPushPackageToQueue) def slotToggleStatus(self, status): """ @@ -282,10 +276,18 @@ class MainWindow(QMainWindow): items = self.tabs["collector"]["package_view"].selectedItems() for item in items: try: - id = item.getFileData()["id"] + item.getFileData() id = item.parent().getPackData()["id"] + pack = item.parent() except: id = item.getPackData()["id"] + pack = item + if id == "fixed": + ids = [] + for child in pack.getChildren(): + ids.append(child.getFileData()["id"]) + self.emit(SIGNAL("addPackage"), "Single Links", ids) + id = self.lastAddedID self.emit(SIGNAL("pushPackageToQueue"), id) def saveWindow(self): @@ -337,7 +339,7 @@ class MainWindow(QMainWindow): self.activeMenu = self.queueContext self.queueContext.exec_(menuPos) - def slotPackageCollectorContextMenu(self, pos): + def slotcollectorContextMenu(self, pos): """ custom context menu in package collector view requested """ @@ -346,11 +348,11 @@ class MainWindow(QMainWindow): if not i: return i.setSelected(True) - self.packageCollectorContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) + self.collectorContext.item = (i.data(0, Qt.UserRole).toPyObject(), i.parent() == None) menuPos = QCursor.pos() menuPos.setX(menuPos.x()+2) - self.activeMenu = self.packageCollectorContext - self.packageCollectorContext.exec_(menuPos) + self.activeMenu = self.collectorContext + self.collectorContext.exec_(menuPos) def slotLinkCollectorContextMenu(self, pos): """ diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py index b90e3533d..c81798935 100644 --- a/module/gui/PackageDock.py +++ b/module/gui/PackageDock.py @@ -53,7 +53,7 @@ class NewPackageWindow(QWidget): linksLabel = QLabel("Links in this Package") linkView = QTreeWidget() linkView.setSelectionBehavior(QAbstractItemView.SelectRows) - linkView.setSelectionMode(QAbstractItemView.SingleSelection) + linkView.setSelectionMode(QAbstractItemView.ExtendedSelection) linkView.setColumnCount(1) linkView.setHeaderLabels(["Name"]) linkView.setDragEnabled(True) diff --git a/module/gui/Queue.py b/module/gui/Queue.py index c0f43c740..499cb5199 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -133,13 +133,17 @@ class Queue(QThread): def clear(self, ids): clear = False - for pack in ItemIterator(self.rootItem): + remove = [] + for k, pack in enumerate(ItemIterator(self.rootItem)): if not pack.getPackData()["id"] in ids: clear = True - break + remove.append(k) if not clear: return - self.rootItem.takeChildren() + remove.sort() + remove.reverse() + for k in remove: + self.rootItem.takeChild(k) def getWaitingProgress(self, q): locker = QMutexLocker(self.mutex) -- cgit v1.2.3 From 035fd57b56b33463c933db15f4ee8a149ddc060f Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 20:03:11 +0100 Subject: tried to satisfy RaNaN --- module/file_list.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 21e084483..cc3b63006 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -160,6 +160,12 @@ class File_List(object): info["plugin"] = pyfile.plugin.props['name'] return info + def continueAborted(self): + for pypack in self.data["queue"]: + for pyfile in pypack.files: + if pyfile.status.type == "aborted": + self.packager.resetFileStatus(pyfile.id) + class pyLoadCollector(): def __init__(collector, file_list): collector.file_list = file_list -- cgit v1.2.3 From c225a31e70e85c6e400a7ed4407a1fa53de29689 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 20:44:49 +0100 Subject: you can now drop single links directly into a package --- module/gui/Collector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 07a5203e9..1b1a6b654 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -88,7 +88,7 @@ class PackageCollector(QThread): item = newPack item.setData(0, Qt.DisplayRole, QVariant(item.getPackData()["package_name"])) item.setData(0, Qt.UserRole, QVariant(pid)) - item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled) + item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDropEnabled) def getPack(self, pid): for k, pack in enumerate(ItemIterator(self.rootItem)): -- cgit v1.2.3 From 86949a6240bc6d5a5fd5e5677925e0d945686d3e Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 22:21:35 +0100 Subject: package renaming in collector works --- module/gui/Collector.py | 23 ++++++++++++++++++----- module/gui/MainWindow.py | 25 +++++++++++++++++++++++-- module/gui/connector.py | 12 ++++++++++++ 3 files changed, 53 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 1b1a6b654..8b421001e 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -39,6 +39,7 @@ class PackageCollector(QThread): item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) self.rootItem.addChild(item) self.linkCollector = item + self.pauseIDs = [] def run(self): while self.running: @@ -56,6 +57,8 @@ class PackageCollector(QThread): ids.append(data["id"]) self.clear(ids) for data in packs: + if data["id"] in self.pauseIDs: + continue ids.append(data["id"]) pack = self.getPack(data["id"]) if not pack: @@ -88,7 +91,7 @@ class PackageCollector(QThread): item = newPack item.setData(0, Qt.DisplayRole, QVariant(item.getPackData()["package_name"])) item.setData(0, Qt.UserRole, QVariant(pid)) - item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDropEnabled) + item.setFlags(Qt.ItemIsSelectable | Qt.ItemIsEnabled | Qt.ItemIsDropEnabled | Qt.ItemIsEditable) def getPack(self, pid): for k, pack in enumerate(ItemIterator(self.rootItem)): @@ -110,6 +113,16 @@ class PackageCollector(QThread): for k in remove: self.rootItem.takeChild(k) + def pauseItemUpdate(self, pid, pause=True): + locker = QMutexLocker(self.mutex) + if pause and not pid in self.pauseIDs: + self.pauseIDs.append(int(pid)) + else: + try: + self.pauseIDs.remove(int(pid)) + except: + pass + class PackageCollectorPack(QTreeWidgetItem): def __init__(self, collector): QTreeWidgetItem.__init__(self) @@ -210,13 +223,13 @@ class LinkCollector(QThread): locker = QMutexLocker(self.mutex) ids = self.connector.getLinkCollector() self.clear(ids) - for id in ids: - data = self.connector.getLinkInfo(id) - file = self.getFile(id) + for fid in ids: + data = self.connector.getLinkInfo(fid) + file = self.getFile(fid) if not file: file = self.LinkCollectorFile(self) file.setFileData(data) - self.addFile(id, file) + self.addFile(fid, file) def addFile(self, pid, newFile): pos = None diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 610d8e840..5237436f0 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -102,7 +102,8 @@ class MainWindow(QMainWindow): self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close) self.connect(self.tabs["queue"]["view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotQueueContextMenu) - self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotcollectorContextMenu) + self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotCollectorContextMenu) + self.connect(self.tabs["collector"]["package_view"].itemDelegate(), SIGNAL("closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint)"), self.slotCloseItemEditor) self.lastAddedID = None @@ -197,10 +198,13 @@ class MainWindow(QMainWindow): self.collectorContext.item = (None, None) self.collectorContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.collectorContext) self.collectorContext.buttons["push"] = QAction(QIcon("icons/gui/push_small.png"), "Push to queue", self.collectorContext) + self.collectorContext.buttons["edit"] = QAction(QIcon("icons/gui/edit_small.png"), "Edit Name", self.collectorContext) self.collectorContext.addAction(self.collectorContext.buttons["push"]) + self.collectorContext.addAction(self.collectorContext.buttons["edit"]) self.collectorContext.addAction(self.collectorContext.buttons["remove"]) self.connect(self.collectorContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) self.connect(self.collectorContext.buttons["push"], SIGNAL("triggered()"), self.slotPushPackageToQueue) + self.connect(self.collectorContext.buttons["edit"], SIGNAL("triggered()"), self.slotEditPackage) def slotToggleStatus(self, status): """ @@ -339,7 +343,7 @@ class MainWindow(QMainWindow): self.activeMenu = self.queueContext self.queueContext.exec_(menuPos) - def slotcollectorContextMenu(self, pos): + def slotCollectorContextMenu(self, pos): """ custom context menu in package collector view requested """ @@ -352,6 +356,10 @@ class MainWindow(QMainWindow): menuPos = QCursor.pos() menuPos.setX(menuPos.x()+2) self.activeMenu = self.collectorContext + if hasattr(i, "getPackData"): + self.collectorContext.buttons["edit"].setVisible(True) + else: + self.collectorContext.buttons["edit"].setVisible(False) self.collectorContext.exec_(menuPos) def slotLinkCollectorContextMenu(self, pos): @@ -381,4 +389,17 @@ class MainWindow(QMainWindow): check clipboard (toolbar) """ self.emit(SIGNAL("setClipboardStatus"), status) + + def slotEditPackage(self): + item = self.tabs["collector"]["package_view"].currentItem() + pid = self.tabs["collector"]["package_view"].currentItem().data(0, Qt.UserRole).toPyObject() + print type(pid) + self.emit(SIGNAL("pauseItemUpdate"), pid, True) + self.tabs["collector"]["package_view"].editItem(item, 0) + + def slotCloseItemEditor(self, editor, hint): + pid = self.tabs["collector"]["package_view"].currentItem().data(0, Qt.UserRole).toPyObject() + print type(pid) + self.emit(SIGNAL("changePackageName"), pid, editor.text()) + self.emit(SIGNAL("pauseItemUpdate"), pid, False) diff --git a/module/gui/connector.py b/module/gui/connector.py index 3f594d68e..8a2909c5e 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -353,4 +353,16 @@ class connector(QThread): self.emit(SIGNAL("proxy_error"), "updateAvailable", e) finally: self.mutex.unlock() + + def setPackageName(self, pid, name): + """ + set new package name + """ + self.mutex.lock() + try: + return self.proxy.set_package_name(pid, name) + except Exception, e: + self.emit(SIGNAL("proxy_error"), "setPackageName", e) + finally: + self.mutex.unlock() -- cgit v1.2.3 From 66c2411b04217a8ae5b9d5698e6d9d66cd997b42 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 22:25:53 +0100 Subject: checksum is now optional --- module/config/core_default.xml | 1 + module/download_thread.py | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 21 deletions(-) (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 56ac2825c..7f503ce18 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -38,6 +38,7 @@ <debug_mode>False</debug_mode> <max_download_time>5</max_download_time> <download_speed_limit>0</download_speed_limit> + <checksum>True</checksum> </general> <updates> <search_updates>True</search_updates> diff --git a/module/download_thread.py b/module/download_thread.py index 3d4aa065d..3c008d000 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -128,28 +128,28 @@ class Download_Thread(threading.Thread): location = join(pyfile.folder, status.filename) pyfile.plugin.proceed(status.url, location) - - status.type = "checking" - check, code = pyfile.plugin.check_file(location) - """ - return codes: - 0 - checksum ok - 1 - checksum wrong - 5 - can't get checksum - 10 - not implemented - 20 - unknown error - """ - if code == 0: - self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) - elif code == 1: - self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) - elif code == 5: - self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) - elif code == 10: - self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) - if not check: - raise Checksum(code, location) + if self.parent.parent.xmlconfig.get("general", "checksum", True): + status.type = "checking" + check, code = pyfile.plugin.check_file(location) + """ + return codes: + 0 - checksum ok + 1 - checksum wrong + 5 - can't get checksum + 10 - not implemented + 20 - unknown error + """ + if code == 0: + self.parent.parent.logger.info("Checksum ok ('%s')" % status.filename) + elif code == 1: + self.parent.parent.logger.info("Checksum not matched! ('%s')" % status.filename) + elif code == 5: + self.parent.parent.logger.debug("Can't get checksum for %s" % status.filename) + elif code == 10: + self.parent.parent.logger.debug("Checksum not implemented for %s" % status.filename) + if not check: + raise Checksum(code, location) status.type = "finished" -- cgit v1.2.3 From 9908e7c4841b3a109ee28575052c489728d59f0f Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 28 Dec 2009 23:00:57 +0100 Subject: UploadedTo indirect download fix --- module/network/Request.py | 1 + module/plugins/hoster/UploadedTo.py | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index d1280f591..9155185fd 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -154,6 +154,7 @@ class Request: self.pycurl.setopt(pycurl.NOPROGRESS, 1) self.pycurl.setopt(pycurl.NOBODY, 1) self.pycurl.perform() + self.lastEffectiveURL = self.pycurl.getinfo(pycurl.EFFECTIVE_URL) self.pycurl.setopt(pycurl.NOPROGRESS, 0) self.pycurl.setopt(pycurl.NOBODY, 0) return self.header diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 0d487be46..6079003bf 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -125,10 +125,21 @@ class UploadedTo(Plugin): return False else: return True - + + def cleanUrl(self, url): + url = url.replace("ul.to/", "uploaded.to/file/") + url = url.replace("/?id=", "/file/") + url = url.replace("?id=", "file/") + url = re.sub("/\?(.*?)&id=", "/file/", url, 1) + return url + def proceed(self, url, location): if self.config['premium']: self.req.load("http://uploaded.to/login", None, { "email" : self.config['username'], "password" : self.config['password']}, cookies=True) + self.req.load(url, cookies=True, just_header=True) + if self.cleanUrl(self.req.lastEffectiveURL) == self.cleanUrl(url): + self.logger.info("UploadedTo indirect download") + url = self.cleanUrl(url)+"?redirect" self.req.download(url, location, cookies=True) else: self.req.download(url, location, cookies=False, post={"download_submit": "Free Download"}) -- cgit v1.2.3 From fa9cce4987da585f5bf21274cfbe5f046f46f703 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Tue, 29 Dec 2009 16:50:13 +0100 Subject: : Bitte gib eine Versions-Meldung ein. Zeilen beginnend mit 'HG:' werden entfernt. --- module/gui/Collector.py | 9 +++++++++ module/gui/ConnectionManager.py | 42 +++++++++++++++++++++++++++++++---------- module/gui/MainWindow.py | 15 +++++++++++++++ module/gui/connector.py | 24 +++++++++++++++++++++-- 4 files changed, 78 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 8b421001e..356ab36ec 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -112,6 +112,15 @@ class PackageCollector(QThread): remove.reverse() for k in remove: self.rootItem.takeChild(k) + for pack in ItemIterator(self.rootItem): + if pack.getPackData()["id"] == "fixed": + return + item = self.PackageCollectorPack(self) + item.setPackData({"id":"fixed"}) + item.setData(0, Qt.DisplayRole, QVariant("Single Links")) + item.setFlags(Qt.ItemIsEnabled | Qt.ItemIsSelectable) + self.rootItem.addChild(item) + self.linkCollector = item def pauseItemUpdate(self, pid, pause=True): locker = QMutexLocker(self.mutex) diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index c997eee19..57aed3a18 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -53,6 +53,8 @@ class ConnectionManager(QWidget): self.connList = connList self.edit = self.EditWindow() self.connectSignals() + + self.defaultStates = {} def connectSignals(self): self.connect(self, SIGNAL("setConnections(connections)"), self.setConnections) @@ -61,6 +63,7 @@ class ConnectionManager(QWidget): self.connect(self.remove, SIGNAL("clicked()"), self.slotRemove) self.connect(self.connectb, SIGNAL("clicked()"), self.slotConnect) self.connect(self.edit, SIGNAL("save"), self.slotSave) + self.connect(self.connList, SIGNAL("itemDoubleClicked(QListWidgetItem *)"), self.slotItemDoubleClicked) def setConnections(self, connections): self.connList.clear() @@ -70,6 +73,7 @@ class ConnectionManager(QWidget): item.setData(Qt.UserRole, QVariant(conn)) self.connList.addItem(item) if conn["default"]: + item.setData(Qt.DisplayRole, QVariant("%s (Default)" % conn["name"])) self.connList.setCurrentItem(item) def slotNew(self): @@ -80,34 +84,51 @@ class ConnectionManager(QWidget): def slotEdit(self): item = self.connList.currentItem() data = item.data(Qt.UserRole).toPyObject() - tmp = {} - for k, d in data.items(): - tmp[str(k)] = d - data = tmp + data = self.cleanDict(data) self.edit.setData(data) self.edit.show() def slotRemove(self): item = self.connList.currentItem() data = item.data(Qt.UserRole).toPyObject() - tmp = {} - for k, d in data.items(): - tmp[str(k)] = d - data = tmp + data = self.cleanDict(data) self.emit(SIGNAL("removeConnection"), data) def slotConnect(self): item = self.connList.currentItem() data = item.data(Qt.UserRole).toPyObject() + data = self.cleanDict(data) + self.emit(SIGNAL("connect"), data) + + def cleanDict(self, data): tmp = {} for k, d in data.items(): tmp[str(k)] = d - data = tmp - self.emit(SIGNAL("connect"), data) + return tmp def slotSave(self, data): self.emit(SIGNAL("saveConnection"), data) + def slotItemDoubleClicked(self, defaultItem): + data = defaultItem.data(Qt.UserRole).toPyObject() + self.setDefault(data, True) + did = self.cleanDict(data)["id"] + allItems = self.connList.findItems("*", Qt.MatchWildcard) + count = self.connList.count() + for i in range(count): + item = self.connList.item(i) + data = item.data(Qt.UserRole).toPyObject() + if self.cleanDict(data)["id"] == did: + continue + self.setDefault(data, False) + + def setDefault(self, data, state): + data = self.cleanDict(data) + self.edit.setData(data) + data = self.edit.getData() + data["default"] = state + self.edit.emit(SIGNAL("save"), data) + class EditWindow(QWidget): def __init__(self): QWidget.__init__(self) @@ -225,3 +246,4 @@ class ConnectionManager(QWidget): data = self.getData() self.hide() self.emit(SIGNAL("save"), data) + diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 5237436f0..6daa0aa55 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -187,10 +187,13 @@ class MainWindow(QMainWindow): self.queueContext.item = (None, None) self.queueContext.buttons["remove"] = QAction(QIcon("icons/gui/remove_small.png"), "Remove", self.queueContext) self.queueContext.buttons["restart"] = QAction(QIcon("icons/gui/refresh_small.png"), "Restart", self.queueContext) + self.queueContext.buttons["pull"] = QAction(QIcon("icons/gui/pull_small.png"), "Pull out", self.queueContext) + self.queueContext.addAction(self.queueContext.buttons["pull"]) self.queueContext.addAction(self.queueContext.buttons["remove"]) self.queueContext.addAction(self.queueContext.buttons["restart"]) self.connect(self.queueContext.buttons["remove"], SIGNAL("triggered()"), self.slotRemoveDownload) self.connect(self.queueContext.buttons["restart"], SIGNAL("triggered()"), self.slotRestartDownload) + self.connect(self.queueContext.buttons["pull"], SIGNAL("triggered()"), self.slotPullOutPackage) #collector self.collectorContext = QMenu() @@ -341,6 +344,10 @@ class MainWindow(QMainWindow): menuPos = QCursor.pos() menuPos.setX(menuPos.x()+2) self.activeMenu = self.queueContext + if hasattr(i, "getPackData"): + self.queueContext.buttons["pull"].setVisible(True) + else: + self.queueContext.buttons["pull"].setVisible(False) self.queueContext.exec_(menuPos) def slotCollectorContextMenu(self, pos): @@ -402,4 +409,12 @@ class MainWindow(QMainWindow): print type(pid) self.emit(SIGNAL("changePackageName"), pid, editor.text()) self.emit(SIGNAL("pauseItemUpdate"), pid, False) + + def slotPullOutPackage(self): + """ + pull package out of the queue + """ + id, isTopLevel = self.activeMenu.item + if not id == None: + self.emit(SIGNAL("pullOutPackage"), id, isTopLevel) diff --git a/module/gui/connector.py b/module/gui/connector.py index 8a2909c5e..2915cf568 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -51,11 +51,14 @@ class connector(QThread): start thread (called from thread.start()) """ - self.connectProxy(self.addr) + self.canConnect() while self.running: sleep(1) self.getError() + def canConnect(self): + return self.connectProxy(self.addr) + def stop(self): """ stop thread @@ -67,9 +70,14 @@ class connector(QThread): connect to remote server """ self.proxy = ServerProxy(addr, allow_none=True) - server_version = self.proxy.get_server_version() + try: + server_version = self.proxy.get_server_version() + except: + return False if not server_version == SERVER_VERSION: self.emit(SIGNAL("error_box"), "server is version %s client accepts version %s" % (server_version, SERVER_VERSION)) + return False + return True def _proxyError(self, func, e): """ @@ -365,4 +373,16 @@ class connector(QThread): self.emit(SIGNAL("proxy_error"), "setPackageName", e) finally: self.mutex.unlock() + + def slotPullOutPackage(self, pid): + """ + pull out package + """ + self.mutex.lock() + try: + return self.proxy.pull_out_package(pid) + except Exception, e: + self.emit(SIGNAL("proxy_error"), "slotPullOutPackage", e) + finally: + self.mutex.unlock() -- cgit v1.2.3 From c1516088e4e7f76dddd68ef71f58c6413862e31c Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 30 Dec 2009 12:35:03 +0100 Subject: show captchas in gui, SerienjunkiesOrg plugin --- module/BeautifulSoup.py | 2000 ++++++++++++++++++++++++++ module/CaptchaManager.py | 112 ++ module/gui/CaptchaDock.py | 82 ++ module/gui/MainWindow.py | 5 +- module/gui/connector.py | 40 +- module/plugins/decrypter/SerienjunkiesOrg.py | 86 ++ 6 files changed, 2322 insertions(+), 3 deletions(-) create mode 100644 module/BeautifulSoup.py create mode 100644 module/CaptchaManager.py create mode 100644 module/gui/CaptchaDock.py create mode 100644 module/plugins/decrypter/SerienjunkiesOrg.py (limited to 'module') diff --git a/module/BeautifulSoup.py b/module/BeautifulSoup.py new file mode 100644 index 000000000..34204e740 --- /dev/null +++ b/module/BeautifulSoup.py @@ -0,0 +1,2000 @@ +"""Beautiful Soup +Elixir and Tonic +"The Screen-Scraper's Friend" +http://www.crummy.com/software/BeautifulSoup/ + +Beautiful Soup parses a (possibly invalid) XML or HTML document into a +tree representation. It provides methods and Pythonic idioms that make +it easy to navigate, search, and modify the tree. + +A well-formed XML/HTML document yields a well-formed data +structure. An ill-formed XML/HTML document yields a correspondingly +ill-formed data structure. If your document is only locally +well-formed, you can use this library to find and process the +well-formed part of it. + +Beautiful Soup works with Python 2.2 and up. It has no external +dependencies, but you'll have more success at converting data to UTF-8 +if you also install these three packages: + +* chardet, for auto-detecting character encodings + http://chardet.feedparser.org/ +* cjkcodecs and iconv_codec, which add more encodings to the ones supported + by stock Python. + http://cjkpython.i18n.org/ + +Beautiful Soup defines classes for two main parsing strategies: + + * BeautifulStoneSoup, for parsing XML, SGML, or your domain-specific + language that kind of looks like XML. + + * BeautifulSoup, for parsing run-of-the-mill HTML code, be it valid + or invalid. This class has web browser-like heuristics for + obtaining a sensible parse tree in the face of common HTML errors. + +Beautiful Soup also defines a class (UnicodeDammit) for autodetecting +the encoding of an HTML or XML document, and converting it to +Unicode. Much of this code is taken from Mark Pilgrim's Universal Feed Parser. + +For more than you ever wanted to know about Beautiful Soup, see the +documentation: +http://www.crummy.com/software/BeautifulSoup/documentation.html + +Here, have some legalese: + +Copyright (c) 2004-2009, Leonard Richardson + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of the the Beautiful Soup Consortium and All + Night Kosher Bakery nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE, DAMMIT. + +""" +from __future__ import generators + +__author__ = "Leonard Richardson (leonardr@segfault.org)" +__version__ = "3.1.0.1" +__copyright__ = "Copyright (c) 2004-2009 Leonard Richardson" +__license__ = "New-style BSD" + +import codecs +import markupbase +import types +import re +from HTMLParser import HTMLParser, HTMLParseError +try: + from htmlentitydefs import name2codepoint +except ImportError: + name2codepoint = {} +try: + set +except NameError: + from sets import Set as set + +#These hacks make Beautiful Soup able to parse XML with namespaces +markupbase._declname_match = re.compile(r'[a-zA-Z][-_.:a-zA-Z0-9]*\s*').match + +DEFAULT_OUTPUT_ENCODING = "utf-8" + +# First, the classes that represent markup elements. + +def sob(unicode, encoding): + """Returns either the given Unicode string or its encoding.""" + if encoding is None: + return unicode + else: + return unicode.encode(encoding) + +class PageElement: + """Contains the navigational information for some part of the page + (either a tag or a piece of text)""" + + def setup(self, parent=None, previous=None): + """Sets up the initial relations between this element and + other elements.""" + self.parent = parent + self.previous = previous + self.next = None + self.previousSibling = None + self.nextSibling = None + if self.parent and self.parent.contents: + self.previousSibling = self.parent.contents[-1] + self.previousSibling.nextSibling = self + + def replaceWith(self, replaceWith): + oldParent = self.parent + myIndex = self.parent.contents.index(self) + if hasattr(replaceWith, 'parent') and replaceWith.parent == self.parent: + # We're replacing this element with one of its siblings. + index = self.parent.contents.index(replaceWith) + if index and index < myIndex: + # Furthermore, it comes before this element. That + # means that when we extract it, the index of this + # element will change. + myIndex = myIndex - 1 + self.extract() + oldParent.insert(myIndex, replaceWith) + + def extract(self): + """Destructively rips this element out of the tree.""" + if self.parent: + try: + self.parent.contents.remove(self) + except ValueError: + pass + + #Find the two elements that would be next to each other if + #this element (and any children) hadn't been parsed. Connect + #the two. + lastChild = self._lastRecursiveChild() + nextElement = lastChild.next + + if self.previous: + self.previous.next = nextElement + if nextElement: + nextElement.previous = self.previous + self.previous = None + lastChild.next = None + + self.parent = None + if self.previousSibling: + self.previousSibling.nextSibling = self.nextSibling + if self.nextSibling: + self.nextSibling.previousSibling = self.previousSibling + self.previousSibling = self.nextSibling = None + return self + + def _lastRecursiveChild(self): + "Finds the last element beneath this object to be parsed." + lastChild = self + while hasattr(lastChild, 'contents') and lastChild.contents: + lastChild = lastChild.contents[-1] + return lastChild + + def insert(self, position, newChild): + if (isinstance(newChild, basestring) + or isinstance(newChild, unicode)) \ + and not isinstance(newChild, NavigableString): + newChild = NavigableString(newChild) + + position = min(position, len(self.contents)) + if hasattr(newChild, 'parent') and newChild.parent != None: + # We're 'inserting' an element that's already one + # of this object's children. + if newChild.parent == self: + index = self.find(newChild) + if index and index < position: + # Furthermore we're moving it further down the + # list of this object's children. That means that + # when we extract this element, our target index + # will jump down one. + position = position - 1 + newChild.extract() + + newChild.parent = self + previousChild = None + if position == 0: + newChild.previousSibling = None + newChild.previous = self + else: + previousChild = self.contents[position-1] + newChild.previousSibling = previousChild + newChild.previousSibling.nextSibling = newChild + newChild.previous = previousChild._lastRecursiveChild() + if newChild.previous: + newChild.previous.next = newChild + + newChildsLastElement = newChild._lastRecursiveChild() + + if position >= len(self.contents): + newChild.nextSibling = None + + parent = self + parentsNextSibling = None + while not parentsNextSibling: + parentsNextSibling = parent.nextSibling + parent = parent.parent + if not parent: # This is the last element in the document. + break + if parentsNextSibling: + newChildsLastElement.next = parentsNextSibling + else: + newChildsLastElement.next = None + else: + nextChild = self.contents[position] + newChild.nextSibling = nextChild + if newChild.nextSibling: + newChild.nextSibling.previousSibling = newChild + newChildsLastElement.next = nextChild + + if newChildsLastElement.next: + newChildsLastElement.next.previous = newChildsLastElement + self.contents.insert(position, newChild) + + def append(self, tag): + """Appends the given tag to the contents of this tag.""" + self.insert(len(self.contents), tag) + + def findNext(self, name=None, attrs={}, text=None, **kwargs): + """Returns the first item that matches the given criteria and + appears after this Tag in the document.""" + return self._findOne(self.findAllNext, name, attrs, text, **kwargs) + + def findAllNext(self, name=None, attrs={}, text=None, limit=None, + **kwargs): + """Returns all items that match the given criteria and appear + after this Tag in the document.""" + return self._findAll(name, attrs, text, limit, self.nextGenerator, + **kwargs) + + def findNextSibling(self, name=None, attrs={}, text=None, **kwargs): + """Returns the closest sibling to this Tag that matches the + given criteria and appears after this Tag in the document.""" + return self._findOne(self.findNextSiblings, name, attrs, text, + **kwargs) + + def findNextSiblings(self, name=None, attrs={}, text=None, limit=None, + **kwargs): + """Returns the siblings of this Tag that match the given + criteria and appear after this Tag in the document.""" + return self._findAll(name, attrs, text, limit, + self.nextSiblingGenerator, **kwargs) + fetchNextSiblings = findNextSiblings # Compatibility with pre-3.x + + def findPrevious(self, name=None, attrs={}, text=None, **kwargs): + """Returns the first item that matches the given criteria and + appears before this Tag in the document.""" + return self._findOne(self.findAllPrevious, name, attrs, text, **kwargs) + + def findAllPrevious(self, name=None, attrs={}, text=None, limit=None, + **kwargs): + """Returns all items that match the given criteria and appear + before this Tag in the document.""" + return self._findAll(name, attrs, text, limit, self.previousGenerator, + **kwargs) + fetchPrevious = findAllPrevious # Compatibility with pre-3.x + + def findPreviousSibling(self, name=None, attrs={}, text=None, **kwargs): + """Returns the closest sibling to this Tag that matches the + given criteria and appears before this Tag in the document.""" + return self._findOne(self.findPreviousSiblings, name, attrs, text, + **kwargs) + + def findPreviousSiblings(self, name=None, attrs={}, text=None, + limit=None, **kwargs): + """Returns the siblings of this Tag that match the given + criteria and appear before this Tag in the document.""" + return self._findAll(name, attrs, text, limit, + self.previousSiblingGenerator, **kwargs) + fetchPreviousSiblings = findPreviousSiblings # Compatibility with pre-3.x + + def findParent(self, name=None, attrs={}, **kwargs): + """Returns the closest parent of this Tag that matches the given + criteria.""" + # NOTE: We can't use _findOne because findParents takes a different + # set of arguments. + r = None + l = self.findParents(name, attrs, 1) + if l: + r = l[0] + return r + + def findParents(self, name=None, attrs={}, limit=None, **kwargs): + """Returns the parents of this Tag that match the given + criteria.""" + + return self._findAll(name, attrs, None, limit, self.parentGenerator, + **kwargs) + fetchParents = findParents # Compatibility with pre-3.x + + #These methods do the real heavy lifting. + + def _findOne(self, method, name, attrs, text, **kwargs): + r = None + l = method(name, attrs, text, 1, **kwargs) + if l: + r = l[0] + return r + + def _findAll(self, name, attrs, text, limit, generator, **kwargs): + "Iterates over a generator looking for things that match." + + if isinstance(name, SoupStrainer): + strainer = name + else: + # Build a SoupStrainer + strainer = SoupStrainer(name, attrs, text, **kwargs) + results = ResultSet(strainer) + g = generator() + while True: + try: + i = g.next() + except StopIteration: + break + if i: + found = strainer.search(i) + if found: + results.append(found) + if limit and len(results) >= limit: + break + return results + + #These Generators can be used to navigate starting from both + #NavigableStrings and Tags. + def nextGenerator(self): + i = self + while i: + i = i.next + yield i + + def nextSiblingGenerator(self): + i = self + while i: + i = i.nextSibling + yield i + + def previousGenerator(self): + i = self + while i: + i = i.previous + yield i + + def previousSiblingGenerator(self): + i = self + while i: + i = i.previousSibling + yield i + + def parentGenerator(self): + i = self + while i: + i = i.parent + yield i + + # Utility methods + def substituteEncoding(self, str, encoding=None): + encoding = encoding or "utf-8" + return str.replace("%SOUP-ENCODING%", encoding) + + def toEncoding(self, s, encoding=None): + """Encodes an object to a string in some encoding, or to Unicode. + .""" + if isinstance(s, unicode): + if encoding: + s = s.encode(encoding) + elif isinstance(s, str): + if encoding: + s = s.encode(encoding) + else: + s = unicode(s) + else: + if encoding: + s = self.toEncoding(str(s), encoding) + else: + s = unicode(s) + return s + +class NavigableString(unicode, PageElement): + + def __new__(cls, value): + """Create a new NavigableString. + + When unpickling a NavigableString, this method is called with + the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be + passed in to the superclass's __new__ or the superclass won't know + how to handle non-ASCII characters. + """ + if isinstance(value, unicode): + return unicode.__new__(cls, value) + return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING) + + def __getnewargs__(self): + return (unicode(self),) + + def __getattr__(self, attr): + """text.string gives you text. This is for backwards + compatibility for Navigable*String, but for CData* it lets you + get the string without the CData wrapper.""" + if attr == 'string': + return self + else: + raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__, attr) + + def encode(self, encoding=DEFAULT_OUTPUT_ENCODING): + return self.decode().encode(encoding) + + def decodeGivenEventualEncoding(self, eventualEncoding): + return self + +class CData(NavigableString): + + def decodeGivenEventualEncoding(self, eventualEncoding): + return u'<![CDATA[' + self + u']]>' + +class ProcessingInstruction(NavigableString): + + def decodeGivenEventualEncoding(self, eventualEncoding): + output = self + if u'%SOUP-ENCODING%' in output: + output = self.substituteEncoding(output, eventualEncoding) + return u'<?' + output + u'?>' + +class Comment(NavigableString): + def decodeGivenEventualEncoding(self, eventualEncoding): + return u'<!--' + self + u'-->' + +class Declaration(NavigableString): + def decodeGivenEventualEncoding(self, eventualEncoding): + return u'<!' + self + u'>' + +class Tag(PageElement): + + """Represents a found HTML tag with its attributes and contents.""" + + def _invert(h): + "Cheap function to invert a hash." + i = {} + for k,v in h.items(): + i[v] = k + return i + + XML_ENTITIES_TO_SPECIAL_CHARS = { "apos" : "'", + "quot" : '"', + "amp" : "&", + "lt" : "<", + "gt" : ">" } + + XML_SPECIAL_CHARS_TO_ENTITIES = _invert(XML_ENTITIES_TO_SPECIAL_CHARS) + + def _convertEntities(self, match): + """Used in a call to re.sub to replace HTML, XML, and numeric + entities with the appropriate Unicode characters. If HTML + entities are being converted, any unrecognized entities are + escaped.""" + x = match.group(1) + if self.convertHTMLEntities and x in name2codepoint: + return unichr(name2codepoint[x]) + elif x in self.XML_ENTITIES_TO_SPECIAL_CHARS: + if self.convertXMLEntities: + return self.XML_ENTITIES_TO_SPECIAL_CHARS[x] + else: + return u'&%s;' % x + elif len(x) > 0 and x[0] == '#': + # Handle numeric entities + if len(x) > 1 and x[1] == 'x': + return unichr(int(x[2:], 16)) + else: + return unichr(int(x[1:])) + + elif self.escapeUnrecognizedEntities: + return u'&%s;' % x + else: + return u'&%s;' % x + + def __init__(self, parser, name, attrs=None, parent=None, + previous=None): + "Basic constructor." + + # We don't actually store the parser object: that lets extracted + # chunks be garbage-collected + self.parserClass = parser.__class__ + self.isSelfClosing = parser.isSelfClosingTag(name) + self.name = name + if attrs == None: + attrs = [] + self.attrs = attrs + self.contents = [] + self.setup(parent, previous) + self.hidden = False + self.containsSubstitutions = False + self.convertHTMLEntities = parser.convertHTMLEntities + self.convertXMLEntities = parser.convertXMLEntities + self.escapeUnrecognizedEntities = parser.escapeUnrecognizedEntities + + def convert(kval): + "Converts HTML, XML and numeric entities in the attribute value." + k, val = kval + if val is None: + return kval + return (k, re.sub("&(#\d+|#x[0-9a-fA-F]+|\w+);", + self._convertEntities, val)) + self.attrs = map(convert, self.attrs) + + def get(self, key, default=None): + """Returns the value of the 'key' attribute for the tag, or + the value given for 'default' if it doesn't have that + attribute.""" + return self._getAttrMap().get(key, default) + + def has_key(self, key): + return self._getAttrMap().has_key(key) + + def __getitem__(self, key): + """tag[key] returns the value of the 'key' attribute for the tag, + and throws an exception if it's not there.""" + return self._getAttrMap()[key] + + def __iter__(self): + "Iterating over a tag iterates over its contents." + return iter(self.contents) + + def __len__(self): + "The length of a tag is the length of its list of contents." + return len(self.contents) + + def __contains__(self, x): + return x in self.contents + + def __nonzero__(self): + "A tag is non-None even if it has no contents." + return True + + def __setitem__(self, key, value): + """Setting tag[key] sets the value of the 'key' attribute for the + tag.""" + self._getAttrMap() + self.attrMap[key] = value + found = False + for i in range(0, len(self.attrs)): + if self.attrs[i][0] == key: + self.attrs[i] = (key, value) + found = True + if not found: + self.attrs.append((key, value)) + self._getAttrMap()[key] = value + + def __delitem__(self, key): + "Deleting tag[key] deletes all 'key' attributes for the tag." + for item in self.attrs: + if item[0] == key: + self.attrs.remove(item) + #We don't break because bad HTML can define the same + #attribute multiple times. + self._getAttrMap() + if self.attrMap.has_key(key): + del self.attrMap[key] + + def __call__(self, *args, **kwargs): + """Calling a tag like a function is the same as calling its + findAll() method. Eg. tag('a') returns a list of all the A tags + found within this tag.""" + return apply(self.findAll, args, kwargs) + + def __getattr__(self, tag): + #print "Getattr %s.%s" % (self.__class__, tag) + if len(tag) > 3 and tag.rfind('Tag') == len(tag)-3: + return self.find(tag[:-3]) + elif tag.find('__') != 0: + return self.find(tag) + raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__, tag) + + def __eq__(self, other): + """Returns true iff this tag has the same name, the same attributes, + and the same contents (recursively) as the given tag. + + NOTE: right now this will return false if two tags have the + same attributes in a different order. Should this be fixed?""" + if not hasattr(other, 'name') or not hasattr(other, 'attrs') or not hasattr(other, 'contents') or self.name != other.name or self.attrs != other.attrs or len(self) != len(other): + return False + for i in range(0, len(self.contents)): + if self.contents[i] != other.contents[i]: + return False + return True + + def __ne__(self, other): + """Returns true iff this tag is not identical to the other tag, + as defined in __eq__.""" + return not self == other + + def __repr__(self, encoding=DEFAULT_OUTPUT_ENCODING): + """Renders this tag as a string.""" + return self.decode(eventualEncoding=encoding) + + BARE_AMPERSAND_OR_BRACKET = re.compile("([<>]|" + + "&(?!#\d+;|#x[0-9a-fA-F]+;|\w+;)" + + ")") + + def _sub_entity(self, x): + """Used with a regular expression to substitute the + appropriate XML entity for an XML special character.""" + return "&" + self.XML_SPECIAL_CHARS_TO_ENTITIES[x.group(0)[0]] + ";" + + def __unicode__(self): + return self.decode() + + def __str__(self): + return self.encode() + + def encode(self, encoding=DEFAULT_OUTPUT_ENCODING, + prettyPrint=False, indentLevel=0): + return self.decode(prettyPrint, indentLevel, encoding).encode(encoding) + + def decode(self, prettyPrint=False, indentLevel=0, + eventualEncoding=DEFAULT_OUTPUT_ENCODING): + """Returns a string or Unicode representation of this tag and + its contents. To get Unicode, pass None for encoding.""" + + attrs = [] + if self.attrs: + for key, val in self.attrs: + fmt = '%s="%s"' + if isString(val): + if (self.containsSubstitutions + and eventualEncoding is not None + and '%SOUP-ENCODING%' in val): + val = self.substituteEncoding(val, eventualEncoding) + + # The attribute value either: + # + # * Contains no embedded double quotes or single quotes. + # No problem: we enclose it in double quotes. + # * Contains embedded single quotes. No problem: + # double quotes work here too. + # * Contains embedded double quotes. No problem: + # we enclose it in single quotes. + # * Embeds both single _and_ double quotes. This + # can't happen naturally, but it can happen if + # you modify an attribute value after parsing + # the document. Now we have a bit of a + # problem. We solve it by enclosing the + # attribute in single quotes, and escaping any + # embedded single quotes to XML entities. + if '"' in val: + fmt = "%s='%s'" + if "'" in val: + # TODO: replace with apos when + # appropriate. + val = val.replace("'", "&squot;") + + # Now we're okay w/r/t quotes. But the attribute + # value might also contain angle brackets, or + # ampersands that aren't part of entities. We need + # to escape those to XML entities too. + val = self.BARE_AMPERSAND_OR_BRACKET.sub(self._sub_entity, val) + if val is None: + # Handle boolean attributes. + decoded = key + else: + decoded = fmt % (key, val) + attrs.append(decoded) + close = '' + closeTag = '' + if self.isSelfClosing: + close = ' /' + else: + closeTag = '</%s>' % self.name + + indentTag, indentContents = 0, 0 + if prettyPrint: + indentTag = indentLevel + space = (' ' * (indentTag-1)) + indentContents = indentTag + 1 + contents = self.decodeContents(prettyPrint, indentContents, + eventualEncoding) + if self.hidden: + s = contents + else: + s = [] + attributeString = '' + if attrs: + attributeString = ' ' + ' '.join(attrs) + if prettyPrint: + s.append(space) + s.append('<%s%s%s>' % (self.name, attributeString, close)) + if prettyPrint: + s.append("\n") + s.append(contents) + if prettyPrint and contents and contents[-1] != "\n": + s.append("\n") + if prettyPrint and closeTag: + s.append(space) + s.append(closeTag) + if prettyPrint and closeTag and self.nextSibling: + s.append("\n") + s = ''.join(s) + return s + + def decompose(self): + """Recursively destroys the contents of this tree.""" + contents = [i for i in self.contents] + for i in contents: + if isinstance(i, Tag): + i.decompose() + else: + i.extract() + self.extract() + + def prettify(self, encoding=DEFAULT_OUTPUT_ENCODING): + return self.encode(encoding, True) + + def encodeContents(self, encoding=DEFAULT_OUTPUT_ENCODING, + prettyPrint=False, indentLevel=0): + return self.decodeContents(prettyPrint, indentLevel).encode(encoding) + + def decodeContents(self, prettyPrint=False, indentLevel=0, + eventualEncoding=DEFAULT_OUTPUT_ENCODING): + """Renders the contents of this tag as a string in the given + encoding. If encoding is None, returns a Unicode string..""" + s=[] + for c in self: + text = None + if isinstance(c, NavigableString): + text = c.decodeGivenEventualEncoding(eventualEncoding) + elif isinstance(c, Tag): + s.append(c.decode(prettyPrint, indentLevel, eventualEncoding)) + if text and prettyPrint: + text = text.strip() + if text: + if prettyPrint: + s.append(" " * (indentLevel-1)) + s.append(text) + if prettyPrint: + s.append("\n") + return ''.join(s) + + #Soup methods + + def find(self, name=None, attrs={}, recursive=True, text=None, + **kwargs): + """Return only the first child of this Tag matching the given + criteria.""" + r = None + l = self.findAll(name, attrs, recursive, text, 1, **kwargs) + if l: + r = l[0] + return r + findChild = find + + def findAll(self, name=None, attrs={}, recursive=True, text=None, + limit=None, **kwargs): + """Extracts a list of Tag objects that match the given + criteria. You can specify the name of the Tag and any + attributes you want the Tag to have. + + The value of a key-value pair in the 'attrs' map can be a + string, a list of strings, a regular expression object, or a + callable that takes a string and returns whether or not the + string matches for some custom definition of 'matches'. The + same is true of the tag name.""" + generator = self.recursiveChildGenerator + if not recursive: + generator = self.childGenerator + return self._findAll(name, attrs, text, limit, generator, **kwargs) + findChildren = findAll + + # Pre-3.x compatibility methods. Will go away in 4.0. + first = find + fetch = findAll + + def fetchText(self, text=None, recursive=True, limit=None): + return self.findAll(text=text, recursive=recursive, limit=limit) + + def firstText(self, text=None, recursive=True): + return self.find(text=text, recursive=recursive) + + # 3.x compatibility methods. Will go away in 4.0. + def renderContents(self, encoding=DEFAULT_OUTPUT_ENCODING, + prettyPrint=False, indentLevel=0): + if encoding is None: + return self.decodeContents(prettyPrint, indentLevel, encoding) + else: + return self.encodeContents(encoding, prettyPrint, indentLevel) + + + #Private methods + + def _getAttrMap(self): + """Initializes a map representation of this tag's attributes, + if not already initialized.""" + if not getattr(self, 'attrMap'): + self.attrMap = {} + for (key, value) in self.attrs: + self.attrMap[key] = value + return self.attrMap + + #Generator methods + def recursiveChildGenerator(self): + if not len(self.contents): + raise StopIteration + stopNode = self._lastRecursiveChild().next + current = self.contents[0] + while current is not stopNode: + yield current + current = current.next + + def childGenerator(self): + if not len(self.contents): + raise StopIteration + current = self.contents[0] + while current: + yield current + current = current.nextSibling + raise StopIteration + +# Next, a couple classes to represent queries and their results. +class SoupStrainer: + """Encapsulates a number of ways of matching a markup element (tag or + text).""" + + def __init__(self, name=None, attrs={}, text=None, **kwargs): + self.name = name + if isString(attrs): + kwargs['class'] = attrs + attrs = None + if kwargs: + if attrs: + attrs = attrs.copy() + attrs.update(kwargs) + else: + attrs = kwargs + self.attrs = attrs + self.text = text + + def __str__(self): + if self.text: + return self.text + else: + return "%s|%s" % (self.name, self.attrs) + + def searchTag(self, markupName=None, markupAttrs={}): + found = None + markup = None + if isinstance(markupName, Tag): + markup = markupName + markupAttrs = markup + callFunctionWithTagData = callable(self.name) \ + and not isinstance(markupName, Tag) + + if (not self.name) \ + or callFunctionWithTagData \ + or (markup and self._matches(markup, self.name)) \ + or (not markup and self._matches(markupName, self.name)): + if callFunctionWithTagData: + match = self.name(markupName, markupAttrs) + else: + match = True + markupAttrMap = None + for attr, matchAgainst in self.attrs.items(): + if not markupAttrMap: + if hasattr(markupAttrs, 'get'): + markupAttrMap = markupAttrs + else: + markupAttrMap = {} + for k,v in markupAttrs: + markupAttrMap[k] = v + attrValue = markupAttrMap.get(attr) + if not self._matches(attrValue, matchAgainst): + match = False + break + if match: + if markup: + found = markup + else: + found = markupName + return found + + def search(self, markup): + #print 'looking for %s in %s' % (self, markup) + found = None + # If given a list of items, scan it for a text element that + # matches. + if isList(markup) and not isinstance(markup, Tag): + for element in markup: + if isinstance(element, NavigableString) \ + and self.search(element): + found = element + break + # If it's a Tag, make sure its name or attributes match. + # Don't bother with Tags if we're searching for text. + elif isinstance(markup, Tag): + if not self.text: + found = self.searchTag(markup) + # If it's text, make sure the text matches. + elif isinstance(markup, NavigableString) or \ + isString(markup): + if self._matches(markup, self.text): + found = markup + else: + raise Exception, "I don't know how to match against a %s" \ + % markup.__class__ + return found + + def _matches(self, markup, matchAgainst): + #print "Matching %s against %s" % (markup, matchAgainst) + result = False + if matchAgainst == True and type(matchAgainst) == types.BooleanType: + result = markup != None + elif callable(matchAgainst): + result = matchAgainst(markup) + else: + #Custom match methods take the tag as an argument, but all + #other ways of matching match the tag name as a string. + if isinstance(markup, Tag): + markup = markup.name + if markup is not None and not isString(markup): + markup = unicode(markup) + #Now we know that chunk is either a string, or None. + if hasattr(matchAgainst, 'match'): + # It's a regexp object. + result = markup and matchAgainst.search(markup) + elif (isList(matchAgainst) + and (markup is not None or not isString(matchAgainst))): + result = markup in matchAgainst + elif hasattr(matchAgainst, 'items'): + result = markup.has_key(matchAgainst) + elif matchAgainst and isString(markup): + if isinstance(markup, unicode): + matchAgainst = unicode(matchAgainst) + else: + matchAgainst = str(matchAgainst) + + if not result: + result = matchAgainst == markup + return result + +class ResultSet(list): + """A ResultSet is just a list that keeps track of the SoupStrainer + that created it.""" + def __init__(self, source): + list.__init__([]) + self.source = source + +# Now, some helper functions. + +def isList(l): + """Convenience method that works with all 2.x versions of Python + to determine whether or not something is listlike.""" + return ((hasattr(l, '__iter__') and not isString(l)) + or (type(l) in (types.ListType, types.TupleType))) + +def isString(s): + """Convenience method that works with all 2.x versions of Python + to determine whether or not something is stringlike.""" + try: + return isinstance(s, unicode) or isinstance(s, basestring) + except NameError: + return isinstance(s, str) + +def buildTagMap(default, *args): + """Turns a list of maps, lists, or scalars into a single map. + Used to build the SELF_CLOSING_TAGS, NESTABLE_TAGS, and + NESTING_RESET_TAGS maps out of lists and partial maps.""" + built = {} + for portion in args: + if hasattr(portion, 'items'): + #It's a map. Merge it. + for k,v in portion.items(): + built[k] = v + elif isList(portion) and not isString(portion): + #It's a list. Map each item to the default. + for k in portion: + built[k] = default + else: + #It's a scalar. Map it to the default. + built[portion] = default + return built + +# Now, the parser classes. + +class HTMLParserBuilder(HTMLParser): + + def __init__(self, soup): + HTMLParser.__init__(self) + self.soup = soup + + # We inherit feed() and reset(). + + def handle_starttag(self, name, attrs): + if name == 'meta': + self.soup.extractCharsetFromMeta(attrs) + else: + self.soup.unknown_starttag(name, attrs) + + def handle_endtag(self, name): + self.soup.unknown_endtag(name) + + def handle_data(self, content): + self.soup.handle_data(content) + + def _toStringSubclass(self, text, subclass): + """Adds a certain piece of text to the tree as a NavigableString + subclass.""" + self.soup.endData() + self.handle_data(text) + self.soup.endData(subclass) + + def handle_pi(self, text): + """Handle a processing instruction as a ProcessingInstruction + object, possibly one with a %SOUP-ENCODING% slot into which an + encoding will be plugged later.""" + if text[:3] == "xml": + text = u"xml version='1.0' encoding='%SOUP-ENCODING%'" + self._toStringSubclass(text, ProcessingInstruction) + + def handle_comment(self, text): + "Handle comments as Comment objects." + self._toStringSubclass(text, Comment) + + def handle_charref(self, ref): + "Handle character references as data." + if self.soup.convertEntities: + data = unichr(int(ref)) + else: + data = '&#%s;' % ref + self.handle_data(data) + + def handle_entityref(self, ref): + """Handle entity references as data, possibly converting known + HTML and/or XML entity references to the corresponding Unicode + characters.""" + data = None + if self.soup.convertHTMLEntities: + try: + data = unichr(name2codepoint[ref]) + except KeyError: + pass + + if not data and self.soup.convertXMLEntities: + data = self.soup.XML_ENTITIES_TO_SPECIAL_CHARS.get(ref) + + if not data and self.soup.convertHTMLEntities and \ + not self.soup.XML_ENTITIES_TO_SPECIAL_CHARS.get(ref): + # TODO: We've got a problem here. We're told this is + # an entity reference, but it's not an XML entity + # reference or an HTML entity reference. Nonetheless, + # the logical thing to do is to pass it through as an + # unrecognized entity reference. + # + # Except: when the input is "&carol;" this function + # will be called with input "carol". When the input is + # "AT&T", this function will be called with input + # "T". We have no way of knowing whether a semicolon + # was present originally, so we don't know whether + # this is an unknown entity or just a misplaced + # ampersand. + # + # The more common case is a misplaced ampersand, so I + # escape the ampersand and omit the trailing semicolon. + data = "&%s" % ref + if not data: + # This case is different from the one above, because we + # haven't already gone through a supposedly comprehensive + # mapping of entities to Unicode characters. We might not + # have gone through any mapping at all. So the chances are + # very high that this is a real entity, and not a + # misplaced ampersand. + data = "&%s;" % ref + self.handle_data(data) + + def handle_decl(self, data): + "Handle DOCTYPEs and the like as Declaration objects." + self._toStringSubclass(data, Declaration) + + def parse_declaration(self, i): + """Treat a bogus SGML declaration as raw data. Treat a CDATA + declaration as a CData object.""" + j = None + if self.rawdata[i:i+9] == '<![CDATA[': + k = self.rawdata.find(']]>', i) + if k == -1: + k = len(self.rawdata) + data = self.rawdata[i+9:k] + j = k+3 + self._toStringSubclass(data, CData) + else: + try: + j = HTMLParser.parse_declaration(self, i) + except HTMLParseError: + toHandle = self.rawdata[i:] + self.handle_data(toHandle) + j = i + len(toHandle) + return j + + +class BeautifulStoneSoup(Tag): + + """This class contains the basic parser and search code. It defines + a parser that knows nothing about tag behavior except for the + following: + + You can't close a tag without closing all the tags it encloses. + That is, "<foo><bar></foo>" actually means + "<foo><bar></bar></foo>". + + [Another possible explanation is "<foo><bar /></foo>", but since + this class defines no SELF_CLOSING_TAGS, it will never use that + explanation.] + + This class is useful for parsing XML or made-up markup languages, + or when BeautifulSoup makes an assumption counter to what you were + expecting.""" + + SELF_CLOSING_TAGS = {} + NESTABLE_TAGS = {} + RESET_NESTING_TAGS = {} + QUOTE_TAGS = {} + PRESERVE_WHITESPACE_TAGS = [] + + MARKUP_MASSAGE = [(re.compile('(<[^<>]*)/>'), + lambda x: x.group(1) + ' />'), + (re.compile('<!\s+([^<>]*)>'), + lambda x: '<!' + x.group(1) + '>') + ] + + ROOT_TAG_NAME = u'[document]' + + HTML_ENTITIES = "html" + XML_ENTITIES = "xml" + XHTML_ENTITIES = "xhtml" + # TODO: This only exists for backwards-compatibility + ALL_ENTITIES = XHTML_ENTITIES + + # Used when determining whether a text node is all whitespace and + # can be replaced with a single space. A text node that contains + # fancy Unicode spaces (usually non-breaking) should be left + # alone. + STRIP_ASCII_SPACES = { 9: None, 10: None, 12: None, 13: None, 32: None, } + + def __init__(self, markup="", parseOnlyThese=None, fromEncoding=None, + markupMassage=True, smartQuotesTo=XML_ENTITIES, + convertEntities=None, selfClosingTags=None, isHTML=False, + builder=HTMLParserBuilder): + """The Soup object is initialized as the 'root tag', and the + provided markup (which can be a string or a file-like object) + is fed into the underlying parser. + + HTMLParser will process most bad HTML, and the BeautifulSoup + class has some tricks for dealing with some HTML that kills + HTMLParser, but Beautiful Soup can nonetheless choke or lose data + if your data uses self-closing tags or declarations + incorrectly. + + By default, Beautiful Soup uses regexes to sanitize input, + avoiding the vast majority of these problems. If the problems + don't apply to you, pass in False for markupMassage, and + you'll get better performance. + + The default parser massage techniques fix the two most common + instances of invalid HTML that choke HTMLParser: + + <br/> (No space between name of closing tag and tag close) + <! --Comment--> (Extraneous whitespace in declaration) + + You can pass in a custom list of (RE object, replace method) + tuples to get Beautiful Soup to scrub your input the way you + want.""" + + self.parseOnlyThese = parseOnlyThese + self.fromEncoding = fromEncoding + self.smartQuotesTo = smartQuotesTo + self.convertEntities = convertEntities + # Set the rules for how we'll deal with the entities we + # encounter + if self.convertEntities: + # It doesn't make sense to convert encoded characters to + # entities even while you're converting entities to Unicode. + # Just convert it all to Unicode. + self.smartQuotesTo = None + if convertEntities == self.HTML_ENTITIES: + self.convertXMLEntities = False + self.convertHTMLEntities = True + self.escapeUnrecognizedEntities = True + elif convertEntities == self.XHTML_ENTITIES: + self.convertXMLEntities = True + self.convertHTMLEntities = True + self.escapeUnrecognizedEntities = False + elif convertEntities == self.XML_ENTITIES: + self.convertXMLEntities = True + self.convertHTMLEntities = False + self.escapeUnrecognizedEntities = False + else: + self.convertXMLEntities = False + self.convertHTMLEntities = False + self.escapeUnrecognizedEntities = False + + self.instanceSelfClosingTags = buildTagMap(None, selfClosingTags) + self.builder = builder(self) + self.reset() + + if hasattr(markup, 'read'): # It's a file-type object. + markup = markup.read() + self.markup = markup + self.markupMassage = markupMassage + try: + self._feed(isHTML=isHTML) + except StopParsing: + pass + self.markup = None # The markup can now be GCed. + self.builder = None # So can the builder. + + def _feed(self, inDocumentEncoding=None, isHTML=False): + # Convert the document to Unicode. + markup = self.markup + if isinstance(markup, unicode): + if not hasattr(self, 'originalEncoding'): + self.originalEncoding = None + else: + dammit = UnicodeDammit\ + (markup, [self.fromEncoding, inDocumentEncoding], + smartQuotesTo=self.smartQuotesTo, isHTML=isHTML) + markup = dammit.unicode + self.originalEncoding = dammit.originalEncoding + self.declaredHTMLEncoding = dammit.declaredHTMLEncoding + if markup: + if self.markupMassage: + if not isList(self.markupMassage): + self.markupMassage = self.MARKUP_MASSAGE + for fix, m in self.markupMassage: + markup = fix.sub(m, markup) + # TODO: We get rid of markupMassage so that the + # soup object can be deepcopied later on. Some + # Python installations can't copy regexes. If anyone + # was relying on the existence of markupMassage, this + # might cause problems. + del(self.markupMassage) + self.builder.reset() + + self.builder.feed(markup) + # Close out any unfinished strings and close all the open tags. + self.endData() + while self.currentTag.name != self.ROOT_TAG_NAME: + self.popTag() + + def isSelfClosingTag(self, name): + """Returns true iff the given string is the name of a + self-closing tag according to this parser.""" + return self.SELF_CLOSING_TAGS.has_key(name) \ + or self.instanceSelfClosingTags.has_key(name) + + def reset(self): + Tag.__init__(self, self, self.ROOT_TAG_NAME) + self.hidden = 1 + self.builder.reset() + self.currentData = [] + self.currentTag = None + self.tagStack = [] + self.quoteStack = [] + self.pushTag(self) + + def popTag(self): + tag = self.tagStack.pop() + # Tags with just one string-owning child get the child as a + # 'string' property, so that soup.tag.string is shorthand for + # soup.tag.contents[0] + if len(self.currentTag.contents) == 1 and \ + isinstance(self.currentTag.contents[0], NavigableString): + self.currentTag.string = self.currentTag.contents[0] + + #print "Pop", tag.name + if self.tagStack: + self.currentTag = self.tagStack[-1] + return self.currentTag + + def pushTag(self, tag): + #print "Push", tag.name + if self.currentTag: + self.currentTag.contents.append(tag) + self.tagStack.append(tag) + self.currentTag = self.tagStack[-1] + + def endData(self, containerClass=NavigableString): + if self.currentData: + currentData = u''.join(self.currentData) + if (currentData.translate(self.STRIP_ASCII_SPACES) == '' and + not set([tag.name for tag in self.tagStack]).intersection( + self.PRESERVE_WHITESPACE_TAGS)): + if '\n' in currentData: + currentData = '\n' + else: + currentData = ' ' + self.currentData = [] + if self.parseOnlyThese and len(self.tagStack) <= 1 and \ + (not self.parseOnlyThese.text or \ + not self.parseOnlyThese.search(currentData)): + return + o = containerClass(currentData) + o.setup(self.currentTag, self.previous) + if self.previous: + self.previous.next = o + self.previous = o + self.currentTag.contents.append(o) + + + def _popToTag(self, name, inclusivePop=True): + """Pops the tag stack up to and including the most recent + instance of the given tag. If inclusivePop is false, pops the tag + stack up to but *not* including the most recent instqance of + the given tag.""" + #print "Popping to %s" % name + if name == self.ROOT_TAG_NAME: + return + + numPops = 0 + mostRecentTag = None + for i in range(len(self.tagStack)-1, 0, -1): + if name == self.tagStack[i].name: + numPops = len(self.tagStack)-i + break + if not inclusivePop: + numPops = numPops - 1 + + for i in range(0, numPops): + mostRecentTag = self.popTag() + return mostRecentTag + + def _smartPop(self, name): + + """We need to pop up to the previous tag of this type, unless + one of this tag's nesting reset triggers comes between this + tag and the previous tag of this type, OR unless this tag is a + generic nesting trigger and another generic nesting trigger + comes between this tag and the previous tag of this type. + + Examples: + <p>Foo<b>Bar *<p>* should pop to 'p', not 'b'. + <p>Foo<table>Bar *<p>* should pop to 'table', not 'p'. + <p>Foo<table><tr>Bar *<p>* should pop to 'tr', not 'p'. + + <li><ul><li> *<li>* should pop to 'ul', not the first 'li'. + <tr><table><tr> *<tr>* should pop to 'table', not the first 'tr' + <td><tr><td> *<td>* should pop to 'tr', not the first 'td' + """ + + nestingResetTriggers = self.NESTABLE_TAGS.get(name) + isNestable = nestingResetTriggers != None + isResetNesting = self.RESET_NESTING_TAGS.has_key(name) + popTo = None + inclusive = True + for i in range(len(self.tagStack)-1, 0, -1): + p = self.tagStack[i] + if (not p or p.name == name) and not isNestable: + #Non-nestable tags get popped to the top or to their + #last occurance. + popTo = name + break + if (nestingResetTriggers != None + and p.name in nestingResetTriggers) \ + or (nestingResetTriggers == None and isResetNesting + and self.RESET_NESTING_TAGS.has_key(p.name)): + + #If we encounter one of the nesting reset triggers + #peculiar to this tag, or we encounter another tag + #that causes nesting to reset, pop up to but not + #including that tag. + popTo = p.name + inclusive = False + break + p = p.parent + if popTo: + self._popToTag(popTo, inclusive) + + def unknown_starttag(self, name, attrs, selfClosing=0): + #print "Start tag %s: %s" % (name, attrs) + if self.quoteStack: + #This is not a real tag. + #print "<%s> is not real!" % name + attrs = ''.join(map(lambda(x, y): ' %s="%s"' % (x, y), attrs)) + self.handle_data('<%s%s>' % (name, attrs)) + return + self.endData() + + if not self.isSelfClosingTag(name) and not selfClosing: + self._smartPop(name) + + if self.parseOnlyThese and len(self.tagStack) <= 1 \ + and (self.parseOnlyThese.text or not self.parseOnlyThese.searchTag(name, attrs)): + return + + tag = Tag(self, name, attrs, self.currentTag, self.previous) + if self.previous: + self.previous.next = tag + self.previous = tag + self.pushTag(tag) + if selfClosing or self.isSelfClosingTag(name): + self.popTag() + if name in self.QUOTE_TAGS: + #print "Beginning quote (%s)" % name + self.quoteStack.append(name) + self.literal = 1 + return tag + + def unknown_endtag(self, name): + #print "End tag %s" % name + if self.quoteStack and self.quoteStack[-1] != name: + #This is not a real end tag. + #print "</%s> is not real!" % name + self.handle_data('</%s>' % name) + return + self.endData() + self._popToTag(name) + if self.quoteStack and self.quoteStack[-1] == name: + self.quoteStack.pop() + self.literal = (len(self.quoteStack) > 0) + + def handle_data(self, data): + self.currentData.append(data) + + def extractCharsetFromMeta(self, attrs): + self.unknown_starttag('meta', attrs) + + +class BeautifulSoup(BeautifulStoneSoup): + + """This parser knows the following facts about HTML: + + * Some tags have no closing tag and should be interpreted as being + closed as soon as they are encountered. + + * The text inside some tags (ie. 'script') may contain tags which + are not really part of the document and which should be parsed + as text, not tags. If you want to parse the text as tags, you can + always fetch it and parse it explicitly. + + * Tag nesting rules: + + Most tags can't be nested at all. For instance, the occurance of + a <p> tag should implicitly close the previous <p> tag. + + <p>Para1<p>Para2 + should be transformed into: + <p>Para1</p><p>Para2 + + Some tags can be nested arbitrarily. For instance, the occurance + of a <blockquote> tag should _not_ implicitly close the previous + <blockquote> tag. + + Alice said: <blockquote>Bob said: <blockquote>Blah + should NOT be transformed into: + Alice said: <blockquote>Bob said: </blockquote><blockquote>Blah + + Some tags can be nested, but the nesting is reset by the + interposition of other tags. For instance, a <tr> tag should + implicitly close the previous <tr> tag within the same <table>, + but not close a <tr> tag in another table. + + <table><tr>Blah<tr>Blah + should be transformed into: + <table><tr>Blah</tr><tr>Blah + but, + <tr>Blah<table><tr>Blah + should NOT be transformed into + <tr>Blah<table></tr><tr>Blah + + Differing assumptions about tag nesting rules are a major source + of problems with the BeautifulSoup class. If BeautifulSoup is not + treating as nestable a tag your page author treats as nestable, + try ICantBelieveItsBeautifulSoup, MinimalSoup, or + BeautifulStoneSoup before writing your own subclass.""" + + def __init__(self, *args, **kwargs): + if not kwargs.has_key('smartQuotesTo'): + kwargs['smartQuotesTo'] = self.HTML_ENTITIES + kwargs['isHTML'] = True + BeautifulStoneSoup.__init__(self, *args, **kwargs) + + SELF_CLOSING_TAGS = buildTagMap(None, + ['br' , 'hr', 'input', 'img', 'meta', + 'spacer', 'link', 'frame', 'base']) + + PRESERVE_WHITESPACE_TAGS = set(['pre', 'textarea']) + + QUOTE_TAGS = {'script' : None, 'textarea' : None} + + #According to the HTML standard, each of these inline tags can + #contain another tag of the same type. Furthermore, it's common + #to actually use these tags this way. + NESTABLE_INLINE_TAGS = ['span', 'font', 'q', 'object', 'bdo', 'sub', 'sup', + 'center'] + + #According to the HTML standard, these block tags can contain + #another tag of the same type. Furthermore, it's common + #to actually use these tags this way. + NESTABLE_BLOCK_TAGS = ['blockquote', 'div', 'fieldset', 'ins', 'del'] + + #Lists can contain other lists, but there are restrictions. + NESTABLE_LIST_TAGS = { 'ol' : [], + 'ul' : [], + 'li' : ['ul', 'ol'], + 'dl' : [], + 'dd' : ['dl'], + 'dt' : ['dl'] } + + #Tables can contain other tables, but there are restrictions. + NESTABLE_TABLE_TAGS = {'table' : [], + 'tr' : ['table', 'tbody', 'tfoot', 'thead'], + 'td' : ['tr'], + 'th' : ['tr'], + 'thead' : ['table'], + 'tbody' : ['table'], + 'tfoot' : ['table'], + } + + NON_NESTABLE_BLOCK_TAGS = ['address', 'form', 'p', 'pre'] + + #If one of these tags is encountered, all tags up to the next tag of + #this type are popped. + RESET_NESTING_TAGS = buildTagMap(None, NESTABLE_BLOCK_TAGS, 'noscript', + NON_NESTABLE_BLOCK_TAGS, + NESTABLE_LIST_TAGS, + NESTABLE_TABLE_TAGS) + + NESTABLE_TAGS = buildTagMap([], NESTABLE_INLINE_TAGS, NESTABLE_BLOCK_TAGS, + NESTABLE_LIST_TAGS, NESTABLE_TABLE_TAGS) + + # Used to detect the charset in a META tag; see start_meta + CHARSET_RE = re.compile("((^|;)\s*charset=)([^;]*)", re.M) + + def extractCharsetFromMeta(self, attrs): + """Beautiful Soup can detect a charset included in a META tag, + try to convert the document to that charset, and re-parse the + document from the beginning.""" + httpEquiv = None + contentType = None + contentTypeIndex = None + tagNeedsEncodingSubstitution = False + + for i in range(0, len(attrs)): + key, value = attrs[i] + key = key.lower() + if key == 'http-equiv': + httpEquiv = value + elif key == 'content': + contentType = value + contentTypeIndex = i + + if httpEquiv and contentType: # It's an interesting meta tag. + match = self.CHARSET_RE.search(contentType) + if match: + if (self.declaredHTMLEncoding is not None or + self.originalEncoding == self.fromEncoding): + # An HTML encoding was sniffed while converting + # the document to Unicode, or an HTML encoding was + # sniffed during a previous pass through the + # document, or an encoding was specified + # explicitly and it worked. Rewrite the meta tag. + def rewrite(match): + return match.group(1) + "%SOUP-ENCODING%" + newAttr = self.CHARSET_RE.sub(rewrite, contentType) + attrs[contentTypeIndex] = (attrs[contentTypeIndex][0], + newAttr) + tagNeedsEncodingSubstitution = True + else: + # This is our first pass through the document. + # Go through it again with the encoding information. + newCharset = match.group(3) + if newCharset and newCharset != self.originalEncoding: + self.declaredHTMLEncoding = newCharset + self._feed(self.declaredHTMLEncoding) + raise StopParsing + pass + tag = self.unknown_starttag("meta", attrs) + if tag and tagNeedsEncodingSubstitution: + tag.containsSubstitutions = True + + +class StopParsing(Exception): + pass + +class ICantBelieveItsBeautifulSoup(BeautifulSoup): + + """The BeautifulSoup class is oriented towards skipping over + common HTML errors like unclosed tags. However, sometimes it makes + errors of its own. For instance, consider this fragment: + + <b>Foo<b>Bar</b></b> + + This is perfectly valid (if bizarre) HTML. However, the + BeautifulSoup class will implicitly close the first b tag when it + encounters the second 'b'. It will think the author wrote + "<b>Foo<b>Bar", and didn't close the first 'b' tag, because + there's no real-world reason to bold something that's already + bold. When it encounters '</b></b>' it will close two more 'b' + tags, for a grand total of three tags closed instead of two. This + can throw off the rest of your document structure. The same is + true of a number of other tags, listed below. + + It's much more common for someone to forget to close a 'b' tag + than to actually use nested 'b' tags, and the BeautifulSoup class + handles the common case. This class handles the not-co-common + case: where you can't believe someone wrote what they did, but + it's valid HTML and BeautifulSoup screwed up by assuming it + wouldn't be.""" + + I_CANT_BELIEVE_THEYRE_NESTABLE_INLINE_TAGS = \ + ['em', 'big', 'i', 'small', 'tt', 'abbr', 'acronym', 'strong', + 'cite', 'code', 'dfn', 'kbd', 'samp', 'strong', 'var', 'b', + 'big'] + + I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGS = ['noscript'] + + NESTABLE_TAGS = buildTagMap([], BeautifulSoup.NESTABLE_TAGS, + I_CANT_BELIEVE_THEYRE_NESTABLE_BLOCK_TAGS, + I_CANT_BELIEVE_THEYRE_NESTABLE_INLINE_TAGS) + +class MinimalSoup(BeautifulSoup): + """The MinimalSoup class is for parsing HTML that contains + pathologically bad markup. It makes no assumptions about tag + nesting, but it does know which tags are self-closing, that + <script> tags contain Javascript and should not be parsed, that + META tags may contain encoding information, and so on. + + This also makes it better for subclassing than BeautifulStoneSoup + or BeautifulSoup.""" + + RESET_NESTING_TAGS = buildTagMap('noscript') + NESTABLE_TAGS = {} + +class BeautifulSOAP(BeautifulStoneSoup): + """This class will push a tag with only a single string child into + the tag's parent as an attribute. The attribute's name is the tag + name, and the value is the string child. An example should give + the flavor of the change: + + <foo><bar>baz</bar></foo> + => + <foo bar="baz"><bar>baz</bar></foo> + + You can then access fooTag['bar'] instead of fooTag.barTag.string. + + This is, of course, useful for scraping structures that tend to + use subelements instead of attributes, such as SOAP messages. Note + that it modifies its input, so don't print the modified version + out. + + I'm not sure how many people really want to use this class; let me + know if you do. Mainly I like the name.""" + + def popTag(self): + if len(self.tagStack) > 1: + tag = self.tagStack[-1] + parent = self.tagStack[-2] + parent._getAttrMap() + if (isinstance(tag, Tag) and len(tag.contents) == 1 and + isinstance(tag.contents[0], NavigableString) and + not parent.attrMap.has_key(tag.name)): + parent[tag.name] = tag.contents[0] + BeautifulStoneSoup.popTag(self) + +#Enterprise class names! It has come to our attention that some people +#think the names of the Beautiful Soup parser classes are too silly +#and "unprofessional" for use in enterprise screen-scraping. We feel +#your pain! For such-minded folk, the Beautiful Soup Consortium And +#All-Night Kosher Bakery recommends renaming this file to +#"RobustParser.py" (or, in cases of extreme enterprisiness, +#"RobustParserBeanInterface.class") and using the following +#enterprise-friendly class aliases: +class RobustXMLParser(BeautifulStoneSoup): + pass +class RobustHTMLParser(BeautifulSoup): + pass +class RobustWackAssHTMLParser(ICantBelieveItsBeautifulSoup): + pass +class RobustInsanelyWackAssHTMLParser(MinimalSoup): + pass +class SimplifyingSOAPParser(BeautifulSOAP): + pass + +###################################################### +# +# Bonus library: Unicode, Dammit +# +# This class forces XML data into a standard format (usually to UTF-8 +# or Unicode). It is heavily based on code from Mark Pilgrim's +# Universal Feed Parser. It does not rewrite the XML or HTML to +# reflect a new encoding: that happens in BeautifulStoneSoup.handle_pi +# (XML) and BeautifulSoup.start_meta (HTML). + +# Autodetects character encodings. +# Download from http://chardet.feedparser.org/ +try: + import chardet +# import chardet.constants +# chardet.constants._debug = 1 +except ImportError: + chardet = None + +# cjkcodecs and iconv_codec make Python know about more character encodings. +# Both are available from http://cjkpython.i18n.org/ +# They're built in if you use Python 2.4. +try: + import cjkcodecs.aliases +except ImportError: + pass +try: + import iconv_codec +except ImportError: + pass + +class UnicodeDammit: + """A class for detecting the encoding of a *ML document and + converting it to a Unicode string. If the source encoding is + windows-1252, can replace MS smart quotes with their HTML or XML + equivalents.""" + + # This dictionary maps commonly seen values for "charset" in HTML + # meta tags to the corresponding Python codec names. It only covers + # values that aren't in Python's aliases and can't be determined + # by the heuristics in find_codec. + CHARSET_ALIASES = { "macintosh" : "mac-roman", + "x-sjis" : "shift-jis" } + + def __init__(self, markup, overrideEncodings=[], + smartQuotesTo='xml', isHTML=False): + self.declaredHTMLEncoding = None + self.markup, documentEncoding, sniffedEncoding = \ + self._detectEncoding(markup, isHTML) + self.smartQuotesTo = smartQuotesTo + self.triedEncodings = [] + if markup == '' or isinstance(markup, unicode): + self.originalEncoding = None + self.unicode = unicode(markup) + return + + u = None + for proposedEncoding in overrideEncodings: + u = self._convertFrom(proposedEncoding) + if u: break + if not u: + for proposedEncoding in (documentEncoding, sniffedEncoding): + u = self._convertFrom(proposedEncoding) + if u: break + + # If no luck and we have auto-detection library, try that: + if not u and chardet and not isinstance(self.markup, unicode): + u = self._convertFrom(chardet.detect(self.markup)['encoding']) + + # As a last resort, try utf-8 and windows-1252: + if not u: + for proposed_encoding in ("utf-8", "windows-1252"): + u = self._convertFrom(proposed_encoding) + if u: break + + self.unicode = u + if not u: self.originalEncoding = None + + def _subMSChar(self, match): + """Changes a MS smart quote character to an XML or HTML + entity.""" + orig = match.group(1) + sub = self.MS_CHARS.get(orig) + if type(sub) == types.TupleType: + if self.smartQuotesTo == 'xml': + sub = '&#x'.encode() + sub[1].encode() + ';'.encode() + else: + sub = '&'.encode() + sub[0].encode() + ';'.encode() + else: + sub = sub.encode() + return sub + + def _convertFrom(self, proposed): + proposed = self.find_codec(proposed) + if not proposed or proposed in self.triedEncodings: + return None + self.triedEncodings.append(proposed) + markup = self.markup + + # Convert smart quotes to HTML if coming from an encoding + # that might have them. + if self.smartQuotesTo and proposed.lower() in("windows-1252", + "iso-8859-1", + "iso-8859-2"): + smart_quotes_re = "([\x80-\x9f])" + smart_quotes_compiled = re.compile(smart_quotes_re) + markup = smart_quotes_compiled.sub(self._subMSChar, markup) + + try: + # print "Trying to convert document to %s" % proposed + u = self._toUnicode(markup, proposed) + self.markup = u + self.originalEncoding = proposed + except Exception, e: + # print "That didn't work!" + # print e + return None + #print "Correct encoding: %s" % proposed + return self.markup + + def _toUnicode(self, data, encoding): + '''Given a string and its encoding, decodes the string into Unicode. + %encoding is a string recognized by encodings.aliases''' + + # strip Byte Order Mark (if present) + if (len(data) >= 4) and (data[:2] == '\xfe\xff') \ + and (data[2:4] != '\x00\x00'): + encoding = 'utf-16be' + data = data[2:] + elif (len(data) >= 4) and (data[:2] == '\xff\xfe') \ + and (data[2:4] != '\x00\x00'): + encoding = 'utf-16le' + data = data[2:] + elif data[:3] == '\xef\xbb\xbf': + encoding = 'utf-8' + data = data[3:] + elif data[:4] == '\x00\x00\xfe\xff': + encoding = 'utf-32be' + data = data[4:] + elif data[:4] == '\xff\xfe\x00\x00': + encoding = 'utf-32le' + data = data[4:] + newdata = unicode(data, encoding) + return newdata + + def _detectEncoding(self, xml_data, isHTML=False): + """Given a document, tries to detect its XML encoding.""" + xml_encoding = sniffed_xml_encoding = None + try: + if xml_data[:4] == '\x4c\x6f\xa7\x94': + # EBCDIC + xml_data = self._ebcdic_to_ascii(xml_data) + elif xml_data[:4] == '\x00\x3c\x00\x3f': + # UTF-16BE + sniffed_xml_encoding = 'utf-16be' + xml_data = unicode(xml_data, 'utf-16be').encode('utf-8') + elif (len(xml_data) >= 4) and (xml_data[:2] == '\xfe\xff') \ + and (xml_data[2:4] != '\x00\x00'): + # UTF-16BE with BOM + sniffed_xml_encoding = 'utf-16be' + xml_data = unicode(xml_data[2:], 'utf-16be').encode('utf-8') + elif xml_data[:4] == '\x3c\x00\x3f\x00': + # UTF-16LE + sniffed_xml_encoding = 'utf-16le' + xml_data = unicode(xml_data, 'utf-16le').encode('utf-8') + elif (len(xml_data) >= 4) and (xml_data[:2] == '\xff\xfe') and \ + (xml_data[2:4] != '\x00\x00'): + # UTF-16LE with BOM + sniffed_xml_encoding = 'utf-16le' + xml_data = unicode(xml_data[2:], 'utf-16le').encode('utf-8') + elif xml_data[:4] == '\x00\x00\x00\x3c': + # UTF-32BE + sniffed_xml_encoding = 'utf-32be' + xml_data = unicode(xml_data, 'utf-32be').encode('utf-8') + elif xml_data[:4] == '\x3c\x00\x00\x00': + # UTF-32LE + sniffed_xml_encoding = 'utf-32le' + xml_data = unicode(xml_data, 'utf-32le').encode('utf-8') + elif xml_data[:4] == '\x00\x00\xfe\xff': + # UTF-32BE with BOM + sniffed_xml_encoding = 'utf-32be' + xml_data = unicode(xml_data[4:], 'utf-32be').encode('utf-8') + elif xml_data[:4] == '\xff\xfe\x00\x00': + # UTF-32LE with BOM + sniffed_xml_encoding = 'utf-32le' + xml_data = unicode(xml_data[4:], 'utf-32le').encode('utf-8') + elif xml_data[:3] == '\xef\xbb\xbf': + # UTF-8 with BOM + sniffed_xml_encoding = 'utf-8' + xml_data = unicode(xml_data[3:], 'utf-8').encode('utf-8') + else: + sniffed_xml_encoding = 'ascii' + pass + except: + xml_encoding_match = None + xml_encoding_re = '^<\?.*encoding=[\'"](.*?)[\'"].*\?>'.encode() + xml_encoding_match = re.compile(xml_encoding_re).match(xml_data) + if not xml_encoding_match and isHTML: + meta_re = '<\s*meta[^>]+charset=([^>]*?)[;\'">]'.encode() + regexp = re.compile(meta_re, re.I) + xml_encoding_match = regexp.search(xml_data) + if xml_encoding_match is not None: + xml_encoding = xml_encoding_match.groups()[0].decode( + 'ascii').lower() + if isHTML: + self.declaredHTMLEncoding = xml_encoding + if sniffed_xml_encoding and \ + (xml_encoding in ('iso-10646-ucs-2', 'ucs-2', 'csunicode', + 'iso-10646-ucs-4', 'ucs-4', 'csucs4', + 'utf-16', 'utf-32', 'utf_16', 'utf_32', + 'utf16', 'u16')): + xml_encoding = sniffed_xml_encoding + return xml_data, xml_encoding, sniffed_xml_encoding + + + def find_codec(self, charset): + return self._codec(self.CHARSET_ALIASES.get(charset, charset)) \ + or (charset and self._codec(charset.replace("-", ""))) \ + or (charset and self._codec(charset.replace("-", "_"))) \ + or charset + + def _codec(self, charset): + if not charset: return charset + codec = None + try: + codecs.lookup(charset) + codec = charset + except (LookupError, ValueError): + pass + return codec + + EBCDIC_TO_ASCII_MAP = None + def _ebcdic_to_ascii(self, s): + c = self.__class__ + if not c.EBCDIC_TO_ASCII_MAP: + emap = (0,1,2,3,156,9,134,127,151,141,142,11,12,13,14,15, + 16,17,18,19,157,133,8,135,24,25,146,143,28,29,30,31, + 128,129,130,131,132,10,23,27,136,137,138,139,140,5,6,7, + 144,145,22,147,148,149,150,4,152,153,154,155,20,21,158,26, + 32,160,161,162,163,164,165,166,167,168,91,46,60,40,43,33, + 38,169,170,171,172,173,174,175,176,177,93,36,42,41,59,94, + 45,47,178,179,180,181,182,183,184,185,124,44,37,95,62,63, + 186,187,188,189,190,191,192,193,194,96,58,35,64,39,61,34, + 195,97,98,99,100,101,102,103,104,105,196,197,198,199,200, + 201,202,106,107,108,109,110,111,112,113,114,203,204,205, + 206,207,208,209,126,115,116,117,118,119,120,121,122,210, + 211,212,213,214,215,216,217,218,219,220,221,222,223,224, + 225,226,227,228,229,230,231,123,65,66,67,68,69,70,71,72, + 73,232,233,234,235,236,237,125,74,75,76,77,78,79,80,81, + 82,238,239,240,241,242,243,92,159,83,84,85,86,87,88,89, + 90,244,245,246,247,248,249,48,49,50,51,52,53,54,55,56,57, + 250,251,252,253,254,255) + import string + c.EBCDIC_TO_ASCII_MAP = string.maketrans( \ + ''.join(map(chr, range(256))), ''.join(map(chr, emap))) + return s.translate(c.EBCDIC_TO_ASCII_MAP) + + MS_CHARS = { '\x80' : ('euro', '20AC'), + '\x81' : ' ', + '\x82' : ('sbquo', '201A'), + '\x83' : ('fnof', '192'), + '\x84' : ('bdquo', '201E'), + '\x85' : ('hellip', '2026'), + '\x86' : ('dagger', '2020'), + '\x87' : ('Dagger', '2021'), + '\x88' : ('circ', '2C6'), + '\x89' : ('permil', '2030'), + '\x8A' : ('Scaron', '160'), + '\x8B' : ('lsaquo', '2039'), + '\x8C' : ('OElig', '152'), + '\x8D' : '?', + '\x8E' : ('#x17D', '17D'), + '\x8F' : '?', + '\x90' : '?', + '\x91' : ('lsquo', '2018'), + '\x92' : ('rsquo', '2019'), + '\x93' : ('ldquo', '201C'), + '\x94' : ('rdquo', '201D'), + '\x95' : ('bull', '2022'), + '\x96' : ('ndash', '2013'), + '\x97' : ('mdash', '2014'), + '\x98' : ('tilde', '2DC'), + '\x99' : ('trade', '2122'), + '\x9a' : ('scaron', '161'), + '\x9b' : ('rsaquo', '203A'), + '\x9c' : ('oelig', '153'), + '\x9d' : '?', + '\x9e' : ('#x17E', '17E'), + '\x9f' : ('Yuml', ''),} + +####################################################################### + + +#By default, act as an HTML pretty-printer. +if __name__ == '__main__': + import sys + soup = BeautifulSoup(sys.stdin) + print soup.prettify() diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py new file mode 100644 index 000000000..9fbff92a1 --- /dev/null +++ b/module/CaptchaManager.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from uuid import uuid4 as uuid +from threading import Lock + +class CaptchaManager(): + def __init__(self, core): + self.lock = Lock() + self.core = core + self.tasks = [] + + def newTask(self, plugin): + task = CaptchaTask(plugin, self) + self.lock.acquire() + self.tasks.append(task) + self.lock.release() + return task + + def removeTask(self, task): + self.lock.acquire() + self.tasks.remove(task) + self.lock.release() + + def getTask(self): + self.lock.acquire() + for task in self.tasks: + if task.getStatus() == "waiting": + self.lock.release() + return task + self.lock.release() + return None + + def getTaskFromID(self, tid): + self.lock.acquire() + for task in self.tasks: + if task.getID() == tid: + self.lock.release() + return task + self.lock.release() + return None + +class CaptchaTask(): + def __init__(self, plugin, manager): + self.lock = Lock() + self.plugin = plugin + self.manager = manager + self.captchaImg = None + self.captchaType = None + self.result = None + self.status = "preparing" + self.id = uuid().hex + + def setCaptcha(self, img, imgType): + self.lock.acquire() + self.captchaImg = img + self.captchaType = imgType + self.lock.release() + + def getCaptcha(self): + return self.captchaImg, self.captchaType + + def setResult(self, result): + self.lock.acquire() + self.result = result + self.lock.release() + + def getResult(self): + return self.result + + def getID(self): + return self.id + + def getStatus(self): + return self.status + + def setDone(self): + self.lock.acquire() + self.status = "done" + self.lock.release() + + def setWaiting(self): + self.lock.acquire() + self.status = "waiting" + self.lock.release() + + def setWatingForUser(self): + self.lock.acquire() + self.status = "user" + self.lock.release() + + def removeTask(self): + self.manager.removeTask(self) + + def __str__(self): + return "<CaptchaTask '%s'>" % (self.getID(),) diff --git a/module/gui/CaptchaDock.py b/module/gui/CaptchaDock.py new file mode 100644 index 000000000..193bac6fa --- /dev/null +++ b/module/gui/CaptchaDock.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay +""" + +from PyQt4.QtCore import * +from PyQt4.QtGui import * + +class CaptchaDock(QDockWidget): + def __init__(self): + QDockWidget.__init__(self, "Captcha") + self.setObjectName("Captcha Dock") + self.widget = CaptchaDockWidget(self) + self.setWidget(self.widget) + self.setAllowedAreas(Qt.BottomDockWidgetArea) + self.setFeatures(QDockWidget.NoDockWidgetFeatures) + self.hide() + self.processing = False + self.currentID = None + + def isFree(self): + return not self.processing + + def setTask(self, tid, img, imgType): + self.processing = True + data = QByteArray(img) + self.currentID = tid + self.widget.emit(SIGNAL("setImage"), data) + self.show() + +class CaptchaDockWidget(QWidget): + def __init__(self, dock): + QWidget.__init__(self) + self.dock = dock + self.setLayout(QHBoxLayout()) + layout = self.layout() + + imgLabel = QLabel() + captchaInput = QLineEdit() + okayButton = QPushButton("OK") + cancelButton = QPushButton("Cancel") + + layout.addWidget(imgLabel) + layout.addWidget(captchaInput) + layout.addWidget(okayButton) + layout.addWidget(cancelButton) + layout.addStretch() + + self.input = captchaInput + + self.connect(okayButton, SIGNAL("clicked()"), self.slotSubmit) + self.connect(captchaInput, SIGNAL("returnPressed()"), self.slotSubmit) + self.connect(self, SIGNAL("setImage"), self.setImg) + self.connect(self, SIGNAL("setPixmap(const QPixmap &)"), imgLabel, SLOT("setPixmap(const QPixmap &)")) + + def setImg(self, data): + pixmap = QPixmap() + pixmap.loadFromData(data) + self.emit(SIGNAL("setPixmap(const QPixmap &)"), pixmap) + + def slotSubmit(self): + text = self.input.text() + tid = self.dock.currentID + self.dock.currentID = None + self.dock.emit(SIGNAL("done"), tid, str(text)) + self.dock.hide() + self.dock.processing = False + diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 6daa0aa55..94ff63dda 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -21,6 +21,7 @@ from PyQt4.QtGui import * from module.gui.PackageDock import * from module.gui.LinkDock import * +from module.gui.CaptchaDock import CaptchaDock class MainWindow(QMainWindow): def __init__(self): @@ -34,7 +35,7 @@ class MainWindow(QMainWindow): self.resize(850,500) #layout version - self.version = 1 + self.version = 2 #init docks self.newPackDock = NewPackageDock() @@ -43,6 +44,8 @@ class MainWindow(QMainWindow): self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) self.connect(self.newLinkDock, SIGNAL("done"), self.slotAddLinks) self.connect(self.newPackDock, SIGNAL("done"), self.slotAddPackage) + self.captchaDock = CaptchaDock() + self.addDockWidget(Qt.BottomDockWidgetArea, self.captchaDock) #central widget, layout self.masterlayout = QVBoxLayout() diff --git a/module/gui/connector.py b/module/gui/connector.py index 2915cf568..432999161 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -374,7 +374,7 @@ class connector(QThread): finally: self.mutex.unlock() - def slotPullOutPackage(self, pid): + def pullOutPackage(self, pid): """ pull out package """ @@ -382,7 +382,43 @@ class connector(QThread): try: return self.proxy.pull_out_package(pid) except Exception, e: - self.emit(SIGNAL("proxy_error"), "slotPullOutPackage", e) + self.emit(SIGNAL("proxy_error"), "pullOutPackage", e) + finally: + self.mutex.unlock() + + def captchaWaiting(self): + """ + is the a captcha waiting? + """ + self.mutex.lock() + try: + return self.proxy.is_captcha_waiting() + except Exception, e: + self.emit(SIGNAL("proxy_error"), "captchaWaiting", e) + finally: + self.mutex.unlock() + + def getCaptcha(self): + """ + get captcha + """ + self.mutex.lock() + try: + return self.proxy.get_captcha_task() + except Exception, e: + self.emit(SIGNAL("proxy_error"), "getCaptcha", e) + finally: + self.mutex.unlock() + + def setCaptchaResult(self, cid, result): + """ + get captcha + """ + self.mutex.lock() + try: + return self.proxy.set_captcha_result(cid, result) + except Exception, e: + self.emit(SIGNAL("proxy_error"), "setCaptchaResult", e) finally: self.mutex.unlock() diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py new file mode 100644 index 000000000..407d14c53 --- /dev/null +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -0,0 +1,86 @@ +# -*- coding: utf-8 -*- + +import re +from time import sleep + +from module.Plugin import Plugin +from module.BeautifulSoup import BeautifulSoup + +class SerienjunkiesOrg(Plugin): + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "SerienjunkiesOrg" + props['type'] = "container" + props['pattern'] = r"http://.*?serienjunkies.org/.*?" + props['version'] = "0.1" + props['description'] = """serienjunkies.org Container Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def getSJSrc(self, url): + src = self.req.load(str(url)) + if not src.find("Enter Serienjunkies") == -1: + src = self.req.load(str(url)) + return src + + def file_exists(self): + return True + + def handleEpisode(self, url): + if not self.parent.core.isGUIConnected(): + return False + for i in range(3): + src = self.getSJSrc(url) + if not src.find("Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1: + self.logger.info("Downloadlimit reached") + return False + else: + soup = BeautifulSoup(src) + form = soup.find("form") + captchaTag = soup.find(attrs={"src":re.compile("^/secure/")}) + captchaUrl = "http://download.serienjunkies.org"+captchaTag["src"] + captchaData = self.req.load(str(captchaUrl)) + captchaManager = self.parent.core.captchaManager + task = captchaManager.newTask(self) + task.setCaptcha(captchaData, "png") + task.setWaiting() + while not task.getStatus() == "done": + if not self.parent.core.isGUIConnected(): + return False + sleep(1) + result = task.getResult() + url = "http://download.serienjunkies.org"+form["action"] + sinp = form.find(attrs={"name":"s"}) + + sj = self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'action': "Download"}) + + soup = BeautifulSoup(sj) + rawLinks = soup.findAll(attrs={"action": re.compile("^http://download.serienjunkies.org/")}) + + if not len(rawLinks) > 0: + continue + + links = [] + for link in rawLinks: + frameUrl = link["action"].replace("/go-", "/frame/go-") + links.append(self.handleFrame(frameUrl)) + return links + + def handleFrame(self, url): + self.req.load(str(url), cookies=False, just_header=True) + return self.req.lastEffectiveURL + + def proceed(self, url, location): + links = False + episodePattern = re.compile("^http://download.serienjunkies.org/f-.*?.html$") + framePattern = re.compile("^http://download.serienjunkies.org/frame/go-.*?/$") + if framePattern.match(url): + links = [self.handleFrame(url)] + elif episodePattern.match(url): + links = self.handleEpisode(url) + self.links = links -- cgit v1.2.3 From 08f12b089eb6fade689134b8170aa2b81218ddf7 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 30 Dec 2009 12:50:10 +0100 Subject: signal slot stuff --- module/gui/CaptchaDock.py | 2 ++ module/plugins/decrypter/SerienjunkiesOrg.py | 2 ++ 2 files changed, 4 insertions(+) (limited to 'module') diff --git a/module/gui/CaptchaDock.py b/module/gui/CaptchaDock.py index 193bac6fa..3dc9441a4 100644 --- a/module/gui/CaptchaDock.py +++ b/module/gui/CaptchaDock.py @@ -31,6 +31,7 @@ class CaptchaDock(QDockWidget): self.hide() self.processing = False self.currentID = None + self.connect(self, SIGNAL("setTask"), self.setTask) def isFree(self): return not self.processing @@ -54,6 +55,7 @@ class CaptchaDockWidget(QWidget): okayButton = QPushButton("OK") cancelButton = QPushButton("Cancel") + layout.addStretch() layout.addWidget(imgLabel) layout.addWidget(captchaInput) layout.addWidget(okayButton) diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 407d14c53..46f380857 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -51,9 +51,11 @@ class SerienjunkiesOrg(Plugin): task.setWaiting() while not task.getStatus() == "done": if not self.parent.core.isGUIConnected(): + task.removeTask() return False sleep(1) result = task.getResult() + task.removeTask() url = "http://download.serienjunkies.org"+form["action"] sinp = form.find(attrs={"name":"s"}) -- cgit v1.2.3 From 7c28259f92c2b3c608583ff128a5ae4134d4c48f Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 30 Dec 2009 17:33:14 +0100 Subject: moved captcha stuff, extended serienjunkies, some other stuff --- module/Plugin.py | 5 +- module/captcha/GigasizeCom.py | 15 -- module/captcha/LinksaveIn.py | 161 ------------ module/captcha/LinksaveIn/bg/flecken_1.gif | Bin 10744 -> 0 bytes module/captcha/LinksaveIn/bg/flecken_2.gif | Bin 11076 -> 0 bytes module/captcha/LinksaveIn/bg/gewebe_fein.gif | Bin 10504 -> 0 bytes module/captcha/LinksaveIn/bg/gewebe_grob.gif | Bin 10127 -> 0 bytes module/captcha/LinksaveIn/bg/gitter.gif | Bin 8151 -> 0 bytes module/captcha/LinksaveIn/bg/mauer_horizontal.gif | Bin 9105 -> 0 bytes module/captcha/LinksaveIn/bg/mauer_vertikal.gif | Bin 10830 -> 0 bytes module/captcha/LinksaveIn/bg/scheckig.gif | Bin 10214 -> 0 bytes module/captcha/LinksaveIn/bg/wellen.gif | Bin 10041 -> 0 bytes module/captcha/LinksaveIn/tesser_conf | 1 - module/captcha/MegauploadCom.py | 13 - module/captcha/NetloadIn.py | 25 -- module/captcha/ShareonlineBiz.py | 61 ----- module/captcha/__init__.py | 0 module/captcha/captcha.py | 295 ---------------------- module/config/plugin_default.xml | 3 + module/download_thread.py | 14 +- module/file_list.py | 8 +- module/gui/CaptchaDock.py | 1 + module/plugins/captcha/GigasizeCom.py | 15 ++ module/plugins/captcha/LinksaveIn.py | 161 ++++++++++++ module/plugins/captcha/MegauploadCom.py | 13 + module/plugins/captcha/NetloadIn.py | 25 ++ module/plugins/captcha/ShareonlineBiz.py | 61 +++++ module/plugins/captcha/__init__.py | 0 module/plugins/captcha/captcha.py | 295 ++++++++++++++++++++++ module/plugins/decrypter/SerienjunkiesOrg.py | 178 ++++++++++++- module/thread_list.py | 23 +- 31 files changed, 776 insertions(+), 597 deletions(-) delete mode 100644 module/captcha/GigasizeCom.py delete mode 100644 module/captcha/LinksaveIn.py delete mode 100644 module/captcha/LinksaveIn/bg/flecken_1.gif delete mode 100644 module/captcha/LinksaveIn/bg/flecken_2.gif delete mode 100644 module/captcha/LinksaveIn/bg/gewebe_fein.gif delete mode 100644 module/captcha/LinksaveIn/bg/gewebe_grob.gif delete mode 100644 module/captcha/LinksaveIn/bg/gitter.gif delete mode 100644 module/captcha/LinksaveIn/bg/mauer_horizontal.gif delete mode 100644 module/captcha/LinksaveIn/bg/mauer_vertikal.gif delete mode 100644 module/captcha/LinksaveIn/bg/scheckig.gif delete mode 100644 module/captcha/LinksaveIn/bg/wellen.gif delete mode 100644 module/captcha/LinksaveIn/tesser_conf delete mode 100644 module/captcha/MegauploadCom.py delete mode 100644 module/captcha/NetloadIn.py delete mode 100644 module/captcha/ShareonlineBiz.py delete mode 100644 module/captcha/__init__.py delete mode 100644 module/captcha/captcha.py create mode 100644 module/plugins/captcha/GigasizeCom.py create mode 100644 module/plugins/captcha/LinksaveIn.py create mode 100644 module/plugins/captcha/MegauploadCom.py create mode 100644 module/plugins/captcha/NetloadIn.py create mode 100644 module/plugins/captcha/ShareonlineBiz.py create mode 100644 module/plugins/captcha/__init__.py create mode 100644 module/plugins/captcha/captcha.py (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index f3830595d..c33e0d565 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -32,7 +32,7 @@ class Plugin(): self.config = {} props = {} props['name'] = "BasePlugin" - props['version'] = "0.2" + props['version'] = "0.3" props['pattern'] = None props['type'] = "hoster" props['description'] = """Base Plugin""" @@ -47,6 +47,7 @@ class Plugin(): self.multi_dl = True self.ocr = None #captcha reader instance self.logger = logging.getLogger("log") + self.decryptNow = True def prepare(self, thread): pyfile = self.parent @@ -127,7 +128,7 @@ class Plugin(): pass def init_ocr(self): - modul = __import__("module.captcha." + self.props['name'], fromlist=['captcha']) + modul = __import__("module.plugins.captcha." + self.props['name'], fromlist=['captcha']) captchaClass = getattr(modul, self.props['name']) self.ocr = captchaClass() diff --git a/module/captcha/GigasizeCom.py b/module/captcha/GigasizeCom.py deleted file mode 100644 index 136092181..000000000 --- a/module/captcha/GigasizeCom.py +++ /dev/null @@ -1,15 +0,0 @@ -from captcha import OCR - -class GigasizeCom(OCR): - def __init__(self): - OCR.__init__(self) - - def get_captcha(self, image): - self.load_image(image) - self.threshold(2.8) - self.run_gocr() - return self.result_captcha - -if __name__ == '__main__': - ocr = GigasizeCom() - print ocr.get_captcha('gigasize-com/7.jpg') diff --git a/module/captcha/LinksaveIn.py b/module/captcha/LinksaveIn.py deleted file mode 100644 index d6f61e362..000000000 --- a/module/captcha/LinksaveIn.py +++ /dev/null @@ -1,161 +0,0 @@ -from captcha import OCR -import Image -from os import sep -from os.path import dirname -from os.path import abspath -from glob import glob -import tempfile - - -class LinksaveIn(OCR): - def __init__(self): - OCR.__init__(self) - self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep - - def load_image(self, image): - im = Image.open(image) - frame_nr = 0 - - lut = im.resize((256, 1)) - lut.putdata(range(256)) - lut = list(lut.convert("RGB").getdata()) - - new = Image.new("RGB", im.size) - npix = new.load() - while True: - try: - im.seek(frame_nr) - except EOFError: - break - frame = im.copy() - pix = frame.load() - for x in range(frame.size[0]): - for y in range(frame.size[1]): - if lut[pix[x, y]] != (0,0,0): - npix[x, y] = lut[pix[x, y]] - frame_nr += 1 - new.save(self.data_dir+"unblacked.png") - self.image = new.copy() - self.pixels = self.image.load() - self.result_captcha = '' - - def get_bg(self): - stat = {} - cstat = {} - img = self.image.convert("P") - for bgpath in glob(self.data_dir+"bg/*.gif"): - stat[bgpath] = 0 - bg = Image.open(bgpath) - - bglut = bg.resize((256, 1)) - bglut.putdata(range(256)) - bglut = list(bglut.convert("RGB").getdata()) - - lut = img.resize((256, 1)) - lut.putdata(range(256)) - lut = list(lut.convert("RGB").getdata()) - - bgpix = bg.load() - pix = img.load() - for x in range(bg.size[0]): - for y in range(bg.size[1]): - rgb_bg = bglut[bgpix[x, y]] - rgb_c = lut[pix[x, y]] - try: - cstat[rgb_c] += 1 - except: - cstat[rgb_c] = 1 - if rgb_bg == rgb_c: - stat[bgpath] += 1 - max_p = 0 - bg = "" - for bgpath, value in stat.items(): - if max_p < value: - bg = bgpath - max_p = value - return bg - - def substract_bg(self, bgpath): - bg = Image.open(bgpath) - img = self.image.convert("P") - - bglut = bg.resize((256, 1)) - bglut.putdata(range(256)) - bglut = list(bglut.convert("RGB").getdata()) - - lut = img.resize((256, 1)) - lut.putdata(range(256)) - lut = list(lut.convert("RGB").getdata()) - - bgpix = bg.load() - pix = img.load() - orgpix = self.image.load() - for x in range(bg.size[0]): - for y in range(bg.size[1]): - rgb_bg = bglut[bgpix[x, y]] - rgb_c = lut[pix[x, y]] - if rgb_c == rgb_bg: - orgpix[x, y] = (255,255,255) - - def eval_black_white(self): - new = Image.new("RGB", (140, 75)) - pix = new.load() - orgpix = self.image.load() - thresh = 4 - for x in range(new.size[0]): - for y in range(new.size[1]): - rgb = orgpix[x, y] - r, g, b = rgb - pix[x, y] = (255,255,255) - if r > max(b, g)+thresh: - pix[x, y] = (0,0,0) - if g < min(r, b): - pix[x, y] = (0,0,0) - if g > max(r, b)+thresh: - pix[x, y] = (0,0,0) - if b > max(r, g)+thresh: - pix[x, y] = (0,0,0) - self.image = new - self.pixels = self.image.load() - - def run_tesser(self): - self.logger.debug("create tmp tif") - tmp = tempfile.NamedTemporaryFile(suffix=".tif") - self.logger.debug("create tmp txt") - tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") - self.logger.debug("save tiff") - self.image.save(tmp.name, 'TIFF') - self.logger.debug("run tesseract") - self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", ""), "nobatch", self.data_dir+"tesser_conf"]) - self.logger.debug("read txt") - - with open(tmpTxt.name, 'r') as f: - self.result_captcha = f.read().replace("\n", "") - - def get_captcha(self, image): - self.load_image(image) - bg = self.get_bg() - self.substract_bg(bg) - self.eval_black_white() - self.to_greyscale() - self.image.save(self.data_dir+"cleaned_pass1.png") - self.clean(4) - self.clean(4) - self.image.save(self.data_dir+"cleaned_pass2.png") - letters = self.split_captcha_letters() - final = "" - for n, letter in enumerate(letters): - self.image = letter - self.image.save(ocr.data_dir+"letter%d.png" % n) - self.run_tesser() - final += self.result_captcha - - return final - -if __name__ == '__main__': - import urllib - ocr = LinksaveIn() - testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D" - urllib.urlretrieve(testurl, ocr.data_dir+"captcha.gif") - - print ocr.get_captcha(ocr.data_dir+'captcha.gif') diff --git a/module/captcha/LinksaveIn/bg/flecken_1.gif b/module/captcha/LinksaveIn/bg/flecken_1.gif deleted file mode 100644 index df2f51217..000000000 Binary files a/module/captcha/LinksaveIn/bg/flecken_1.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/flecken_2.gif b/module/captcha/LinksaveIn/bg/flecken_2.gif deleted file mode 100644 index 838276188..000000000 Binary files a/module/captcha/LinksaveIn/bg/flecken_2.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/gewebe_fein.gif b/module/captcha/LinksaveIn/bg/gewebe_fein.gif deleted file mode 100644 index 502f18cc4..000000000 Binary files a/module/captcha/LinksaveIn/bg/gewebe_fein.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/gewebe_grob.gif b/module/captcha/LinksaveIn/bg/gewebe_grob.gif deleted file mode 100644 index e66a365ad..000000000 Binary files a/module/captcha/LinksaveIn/bg/gewebe_grob.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/gitter.gif b/module/captcha/LinksaveIn/bg/gitter.gif deleted file mode 100644 index ec52ef68d..000000000 Binary files a/module/captcha/LinksaveIn/bg/gitter.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/mauer_horizontal.gif b/module/captcha/LinksaveIn/bg/mauer_horizontal.gif deleted file mode 100644 index 3d75fafa8..000000000 Binary files a/module/captcha/LinksaveIn/bg/mauer_horizontal.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/mauer_vertikal.gif b/module/captcha/LinksaveIn/bg/mauer_vertikal.gif deleted file mode 100644 index 2ada6fdae..000000000 Binary files a/module/captcha/LinksaveIn/bg/mauer_vertikal.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/scheckig.gif b/module/captcha/LinksaveIn/bg/scheckig.gif deleted file mode 100644 index 8bfb45c56..000000000 Binary files a/module/captcha/LinksaveIn/bg/scheckig.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/bg/wellen.gif b/module/captcha/LinksaveIn/bg/wellen.gif deleted file mode 100644 index a181ebe74..000000000 Binary files a/module/captcha/LinksaveIn/bg/wellen.gif and /dev/null differ diff --git a/module/captcha/LinksaveIn/tesser_conf b/module/captcha/LinksaveIn/tesser_conf deleted file mode 100644 index 34ca8fa02..000000000 --- a/module/captcha/LinksaveIn/tesser_conf +++ /dev/null @@ -1 +0,0 @@ -tessedit_char_whitelist 0123456789 diff --git a/module/captcha/MegauploadCom.py b/module/captcha/MegauploadCom.py deleted file mode 100644 index 374bcd678..000000000 --- a/module/captcha/MegauploadCom.py +++ /dev/null @@ -1,13 +0,0 @@ -from captcha import OCR - -class MegauploadCom(OCR): - def __init__(self): - OCR.__init__(self) - - def get_captcha(self, image): - self.load_image(image) - self.run_tesser() - return self.result_captcha - -if __name__ == '__main__': - ocr = MegauploadCom() diff --git a/module/captcha/NetloadIn.py b/module/captcha/NetloadIn.py deleted file mode 100644 index 9799a6a2b..000000000 --- a/module/captcha/NetloadIn.py +++ /dev/null @@ -1,25 +0,0 @@ -from captcha import OCR - -class NetloadIn(OCR): - def __init__(self): - OCR.__init__(self) - - def get_captcha(self, image): - self.load_image(image) - self.to_greyscale() - self.clean(3) - self.clean(3) - self.run_tesser() - - self.correct({ - ("$", "g"): "5", - }) - - return self.result_captcha - -if __name__ == '__main__': - import urllib - ocr = NetloadIn() - urllib.urlretrieve("http://netload.in/share/includes/captcha.php", "captcha.png") - - print ocr.get_captcha('captcha.png') diff --git a/module/captcha/ShareonlineBiz.py b/module/captcha/ShareonlineBiz.py deleted file mode 100644 index 91124f181..000000000 --- a/module/captcha/ShareonlineBiz.py +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -#Copyright (C) 2009 kingzero, RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### -from captcha import OCR - -class ShareonlineBiz(OCR): - def __init__(self): - OCR.__init__(self) - - def get_captcha(self, image): - self.load_image(image) - self.to_greyscale() - self.image = self.image.resize((160, 50)) - self.pixels = self.image.load() - self.threshold(1.85) - #self.eval_black_white(240) - #self.derotate_by_average() - - letters = self.split_captcha_letters() - - final = "" - for letter in letters: - self.image = letter - self.run_tesser() - final += self.result_captcha - - #replace common errors - final = self.correct({ - "A": "4", - "‘5": "3", - ("‘1", "T"): "7", - ("‘L", "B", "'L"): "2", - "b": "6", - ("I", "X"): "1" - }, final) - - return final - - #tesseract at 60% - -if __name__ == '__main__': - import urllib - ocr = ShareonlineBiz() - urllib.urlretrieve("http://www.share-online.biz/captcha.php", "captcha.jpeg") - print ocr.get_captcha('captcha.jpeg') diff --git a/module/captcha/__init__.py b/module/captcha/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/module/captcha/captcha.py b/module/captcha/captcha.py deleted file mode 100644 index 283b171e0..000000000 --- a/module/captcha/captcha.py +++ /dev/null @@ -1,295 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# -#Copyright (C) 2009 kingzero, RaNaN -# -#This program is free software; you can redistribute it and/or modify -#it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 3 of the License, -#or (at your option) any later version. -# -#This program is distributed in the hope that it will be useful, -#but WITHOUT ANY WARRANTY; without even the implied warranty of -#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -#See the GNU General Public License for more details. -# -#You should have received a copy of the GNU General Public License -# along with this program; if not, see <http://www.gnu.org/licenses/>. -# -### -from __future__ import with_statement -import logging -import subprocess -import tempfile -import threading - -import Image - -class RunThread(threading.Thread): - def __init__(self): - threading.Thread.__init__(self) - - def e(self, command, inputdata=None): - """execute command """ - self.command = command - self.inputdata = inputdata - self.result = "" - self.start() - self.join(10) - return self.result - - def run(self): - """Run a command and return standard output""" - pipe = subprocess.PIPE - popen = subprocess.Popen(self.command, stdout=pipe, stderr=pipe) - outputdata, errdata = popen.communicate(self.inputdata) - assert (popen.returncode == 0), \ - "Error running: %s\n\n%s" % (self.command, errdata) - self.result = outputdata - -class OCR(object): - def __init__(self): - self.logger = logging.getLogger("log") - - def load_image(self, image): - self.image = Image.open(image) - self.pixels = self.image.load() - self.result_captcha = '' - - def unload(self): - """delete all tmp images""" - pass - - def threshold(self, value): - self.image = self.image.point(lambda a: a * value + 10) - - def run(self, command, inputdata=None): - """Run a command and return standard output""" - # OLD METHOD - # pipe = subprocess.PIPE - # popen = subprocess.Popen(command, stdout=pipe, stderr=pipe) - # outputdata, errdata = popen.communicate(inputdata) - # assert (popen.returncode == 0), \ - # "Error running: %s\n\n%s" % (command, errdata) - # return outputdata - - thread = RunThread() - result = thread.e(command, inputdata) - return result - - def run_gocr(self): - tmp = tempfile.NamedTemporaryFile(suffix=".jpg") - self.image.save(tmp) - self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "") - - def run_tesser(self): - self.logger.debug("create tmp tif") - tmp = tempfile.NamedTemporaryFile(suffix=".tif") - self.logger.debug("create tmp txt") - tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") - self.logger.debug("save tiff") - self.image.save(tmp.name, 'TIFF') - self.logger.debug("run tesseract") - self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")]) - self.logger.debug("read txt") - - with open(tmpTxt.name, 'r') as f: - self.result_captcha = f.read().replace("\n", "") - - def get_captcha(self): - raise NotImplementedError - - def to_greyscale(self): - if self.image.mode != 'L': - self.image = self.image.convert('L') - - self.pixels = self.image.load() - - def eval_black_white(self, limit): - self.pixels = self.image.load() - w, h = self.image.size - for x in xrange(w): - for y in xrange(h): - if self.pixels[x, y] > limit: - self.pixels[x, y] = 255 - else: - self.pixels[x, y] = 0 - - def clean(self, allowed): - pixels = self.pixels - - w, h = self.image.size - - for x in xrange(w): - for y in xrange(h): - if pixels[x, y] == 255: continue - # no point in processing white pixels since we only want to remove black pixel - count = 0 - - try: - if pixels[x-1, y-1] != 255: count += 1 - if pixels[x-1, y] != 255: count += 1 - if pixels[x-1, y + 1] != 255: count += 1 - if pixels[x, y + 1] != 255: count += 1 - if pixels[x + 1, y + 1] != 255: count += 1 - if pixels[x + 1, y] != 255: count += 1 - if pixels[x + 1, y-1] != 255: count += 1 - if pixels[x, y-1] != 255: count += 1 - except: - pass - - # not enough neighbors are dark pixels so mark this pixel - # to be changed to white - if count < allowed: - pixels[x, y] = 1 - - # second pass: this time set all 1's to 255 (white) - for x in xrange(w): - for y in xrange(h): - if pixels[x, y] == 1: pixels[x, y] = 255 - - self.pixels = pixels - - def derotate_by_average(self): - """rotate by checking each angle and guess most suitable""" - - w, h = self.image.size - pixels = self.pixels - - for x in xrange(w): - for y in xrange(h): - if pixels[x, y] == 0: - pixels[x, y] = 155 - - highest = {} - counts = {} - - for angle in range(-45, 45): - - tmpimage = self.image.rotate(angle) - - pixels = tmpimage.load() - - w, h = self.image.size - - for x in xrange(w): - for y in xrange(h): - if pixels[x, y] == 0: - pixels[x, y] = 255 - - - count = {} - - for x in xrange(w): - count[x] = 0 - for y in xrange(h): - if pixels[x, y] == 155: - count[x] += 1 - - sum = 0 - cnt = 0 - - for x in count.values(): - if x != 0: - sum += x - cnt += 1 - - avg = sum / cnt - counts[angle] = cnt - highest[angle] = 0 - for x in count.values(): - if x > highest[angle]: - highest[angle] = x - - highest[angle] = highest[angle] - avg - - hkey = 0 - hvalue = 0 - - for key, value in highest.iteritems(): - if value > hvalue: - hkey = key - hvalue = value - - self.image = self.image.rotate(hkey) - pixels = self.image.load() - - for x in xrange(w): - for y in xrange(h): - if pixels[x, y] == 0: - pixels[x, y] = 255 - - if pixels[x, y] == 155: - pixels[x, y] = 0 - - self.pixels = pixels - - def split_captcha_letters(self): - captcha = self.image - started = False - letters = [] - width, height = captcha.size - bottomY, topY = 0, height - pixels = captcha.load() - - for x in xrange(width): - black_pixel_in_col = False - for y in xrange(height): - if pixels[x, y] != 255: - if started == False: - started = True - firstX = x - lastX = x - - if y > bottomY: bottomY = y - if y < topY: topY = y - if x > lastX: lastX = x - - black_pixel_in_col = True - - if black_pixel_in_col == False and started == True: - rect = (firstX, topY, lastX, bottomY) - new_captcha = captcha.crop(rect) - - w, h = new_captcha.size - if w > 5 and h > 5: - letters.append(new_captcha) - - started = False - bottomY, topY = 0, height - - return letters - - def correct(self, values, var=None): - - if var: - result = var - else: - result = self.result_captcha - - for key, item in values.iteritems(): - - if key.__class__ == str: - result = result.replace(key, item) - else: - for expr in key: - result = result.replace(expr, item) - - if var: - return result - else: - self.result_captcha = result - - -if __name__ == '__main__': - ocr = OCR() - ocr.load_image("B.jpg") - ocr.to_greyscale() - ocr.eval_black_white(140) - ocr.derotate_by_avergage() - ocr.run_gocr() - print "GOCR", ocr.result_captcha - ocr.run_tesser() - print "Tesseract", ocr.result_captcha - ocr.image.save("derotated.jpg") - diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 01c0e7ed6..88628cb5e 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -36,4 +36,7 @@ <!-- False for no limitation --> <max_videos>False</max_videos> </YoutubeChannel> + <SerienjunkiesOrg> + <preferredHoster>RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom</preferredHoster> + </SerienjunkiesOrg> </config> diff --git a/module/download_thread.py b/module/download_thread.py index 3c008d000..a07f4511f 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -66,6 +66,9 @@ class Checksum(Exception): def getFile(self): return self.file +class CaptchaError(Exception): + pass + class Download_Thread(threading.Thread): def __init__(self, parent): threading.Thread.__init__(self) @@ -93,8 +96,10 @@ class Download_Thread(threading.Thread): f = open("%s.info" % e.getFile(), "w") f.write("Checksum not matched!") f.close() + except CaptchaError: + self.loadedPyFile.status.type = "failed" + self.loadedPyFile.status.error = "Can't solve captcha" except Exception, e: - try: if self.parent.parent.config['general']['debug_mode']: traceback.print_exc() @@ -123,8 +128,11 @@ class Download_Thread(threading.Thread): pyfile.plugin.prepare(self) pyfile.plugin.req.set_timeout(self.parent.parent.config['general']['max_download_time']) - - status.type = "downloading" + + if pyfile.plugin.props["type"] == "container": + status.type = "decrypting" + else: + status.type = "downloading" location = join(pyfile.folder, status.filename) pyfile.plugin.proceed(status.url, location) diff --git a/module/file_list.py b/module/file_list.py index cc3b63006..8af66d5ed 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -129,7 +129,11 @@ class File_List(object): files = [] for pypack in self.data["queue"] + self.data["packages"]: for pyfile in pypack.files: - if pyfile.plugin.props['type'] == "container" and not pyfile.active: + if pyfile.status.type == None and pyfile.plugin.props['type'] == "container" and not pyfile.active: + files.append(pyfile) + for pypack in self.data["packages"]: + for pyfile in pypack.files: + if pyfile.status.type == None and pyfile.plugin.props['type'] == "container" and pyfile.plugin.decryptNow and not pyfile.active: files.append(pyfile) for pypack in self.data["queue"]: for pyfile in pypack.files: @@ -424,7 +428,7 @@ class PyLoadFile(): for dir in ["hoster", "decrypter", "container"]: try: self.modul = __import__("%s.%s" % (dir, pluginName), globals(), locals(), [pluginName], -1) - except: + except Exception, e: pass pluginClass = getattr(self.modul, pluginName) else: diff --git a/module/gui/CaptchaDock.py b/module/gui/CaptchaDock.py index 3dc9441a4..8a7e8010e 100644 --- a/module/gui/CaptchaDock.py +++ b/module/gui/CaptchaDock.py @@ -41,6 +41,7 @@ class CaptchaDock(QDockWidget): data = QByteArray(img) self.currentID = tid self.widget.emit(SIGNAL("setImage"), data) + self.widget.input.setText("") self.show() class CaptchaDockWidget(QWidget): diff --git a/module/plugins/captcha/GigasizeCom.py b/module/plugins/captcha/GigasizeCom.py new file mode 100644 index 000000000..136092181 --- /dev/null +++ b/module/plugins/captcha/GigasizeCom.py @@ -0,0 +1,15 @@ +from captcha import OCR + +class GigasizeCom(OCR): + def __init__(self): + OCR.__init__(self) + + def get_captcha(self, image): + self.load_image(image) + self.threshold(2.8) + self.run_gocr() + return self.result_captcha + +if __name__ == '__main__': + ocr = GigasizeCom() + print ocr.get_captcha('gigasize-com/7.jpg') diff --git a/module/plugins/captcha/LinksaveIn.py b/module/plugins/captcha/LinksaveIn.py new file mode 100644 index 000000000..d6f61e362 --- /dev/null +++ b/module/plugins/captcha/LinksaveIn.py @@ -0,0 +1,161 @@ +from captcha import OCR +import Image +from os import sep +from os.path import dirname +from os.path import abspath +from glob import glob +import tempfile + + +class LinksaveIn(OCR): + def __init__(self): + OCR.__init__(self) + self.data_dir = dirname(abspath(__file__)) + sep + "LinksaveIn" + sep + + def load_image(self, image): + im = Image.open(image) + frame_nr = 0 + + lut = im.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + new = Image.new("RGB", im.size) + npix = new.load() + while True: + try: + im.seek(frame_nr) + except EOFError: + break + frame = im.copy() + pix = frame.load() + for x in range(frame.size[0]): + for y in range(frame.size[1]): + if lut[pix[x, y]] != (0,0,0): + npix[x, y] = lut[pix[x, y]] + frame_nr += 1 + new.save(self.data_dir+"unblacked.png") + self.image = new.copy() + self.pixels = self.image.load() + self.result_captcha = '' + + def get_bg(self): + stat = {} + cstat = {} + img = self.image.convert("P") + for bgpath in glob(self.data_dir+"bg/*.gif"): + stat[bgpath] = 0 + bg = Image.open(bgpath) + + bglut = bg.resize((256, 1)) + bglut.putdata(range(256)) + bglut = list(bglut.convert("RGB").getdata()) + + lut = img.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + bgpix = bg.load() + pix = img.load() + for x in range(bg.size[0]): + for y in range(bg.size[1]): + rgb_bg = bglut[bgpix[x, y]] + rgb_c = lut[pix[x, y]] + try: + cstat[rgb_c] += 1 + except: + cstat[rgb_c] = 1 + if rgb_bg == rgb_c: + stat[bgpath] += 1 + max_p = 0 + bg = "" + for bgpath, value in stat.items(): + if max_p < value: + bg = bgpath + max_p = value + return bg + + def substract_bg(self, bgpath): + bg = Image.open(bgpath) + img = self.image.convert("P") + + bglut = bg.resize((256, 1)) + bglut.putdata(range(256)) + bglut = list(bglut.convert("RGB").getdata()) + + lut = img.resize((256, 1)) + lut.putdata(range(256)) + lut = list(lut.convert("RGB").getdata()) + + bgpix = bg.load() + pix = img.load() + orgpix = self.image.load() + for x in range(bg.size[0]): + for y in range(bg.size[1]): + rgb_bg = bglut[bgpix[x, y]] + rgb_c = lut[pix[x, y]] + if rgb_c == rgb_bg: + orgpix[x, y] = (255,255,255) + + def eval_black_white(self): + new = Image.new("RGB", (140, 75)) + pix = new.load() + orgpix = self.image.load() + thresh = 4 + for x in range(new.size[0]): + for y in range(new.size[1]): + rgb = orgpix[x, y] + r, g, b = rgb + pix[x, y] = (255,255,255) + if r > max(b, g)+thresh: + pix[x, y] = (0,0,0) + if g < min(r, b): + pix[x, y] = (0,0,0) + if g > max(r, b)+thresh: + pix[x, y] = (0,0,0) + if b > max(r, g)+thresh: + pix[x, y] = (0,0,0) + self.image = new + self.pixels = self.image.load() + + def run_tesser(self): + self.logger.debug("create tmp tif") + tmp = tempfile.NamedTemporaryFile(suffix=".tif") + self.logger.debug("create tmp txt") + tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") + self.logger.debug("save tiff") + self.image.save(tmp.name, 'TIFF') + self.logger.debug("run tesseract") + self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", ""), "nobatch", self.data_dir+"tesser_conf"]) + self.logger.debug("read txt") + + with open(tmpTxt.name, 'r') as f: + self.result_captcha = f.read().replace("\n", "") + + def get_captcha(self, image): + self.load_image(image) + bg = self.get_bg() + self.substract_bg(bg) + self.eval_black_white() + self.to_greyscale() + self.image.save(self.data_dir+"cleaned_pass1.png") + self.clean(4) + self.clean(4) + self.image.save(self.data_dir+"cleaned_pass2.png") + letters = self.split_captcha_letters() + final = "" + for n, letter in enumerate(letters): + self.image = letter + self.image.save(ocr.data_dir+"letter%d.png" % n) + self.run_tesser() + final += self.result_captcha + + return final + +if __name__ == '__main__': + import urllib + ocr = LinksaveIn() + testurl = "http://linksave.in/captcha/cap.php?hsh=2229185&code=ZzHdhl3UffV3lXTH5U4b7nShXj%2Bwma1vyoNBcbc6lcc%3D" + urllib.urlretrieve(testurl, ocr.data_dir+"captcha.gif") + + print ocr.get_captcha(ocr.data_dir+'captcha.gif') diff --git a/module/plugins/captcha/MegauploadCom.py b/module/plugins/captcha/MegauploadCom.py new file mode 100644 index 000000000..374bcd678 --- /dev/null +++ b/module/plugins/captcha/MegauploadCom.py @@ -0,0 +1,13 @@ +from captcha import OCR + +class MegauploadCom(OCR): + def __init__(self): + OCR.__init__(self) + + def get_captcha(self, image): + self.load_image(image) + self.run_tesser() + return self.result_captcha + +if __name__ == '__main__': + ocr = MegauploadCom() diff --git a/module/plugins/captcha/NetloadIn.py b/module/plugins/captcha/NetloadIn.py new file mode 100644 index 000000000..9799a6a2b --- /dev/null +++ b/module/plugins/captcha/NetloadIn.py @@ -0,0 +1,25 @@ +from captcha import OCR + +class NetloadIn(OCR): + def __init__(self): + OCR.__init__(self) + + def get_captcha(self, image): + self.load_image(image) + self.to_greyscale() + self.clean(3) + self.clean(3) + self.run_tesser() + + self.correct({ + ("$", "g"): "5", + }) + + return self.result_captcha + +if __name__ == '__main__': + import urllib + ocr = NetloadIn() + urllib.urlretrieve("http://netload.in/share/includes/captcha.php", "captcha.png") + + print ocr.get_captcha('captcha.png') diff --git a/module/plugins/captcha/ShareonlineBiz.py b/module/plugins/captcha/ShareonlineBiz.py new file mode 100644 index 000000000..91124f181 --- /dev/null +++ b/module/plugins/captcha/ShareonlineBiz.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +#Copyright (C) 2009 kingzero, RaNaN +# +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, +#or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +### +from captcha import OCR + +class ShareonlineBiz(OCR): + def __init__(self): + OCR.__init__(self) + + def get_captcha(self, image): + self.load_image(image) + self.to_greyscale() + self.image = self.image.resize((160, 50)) + self.pixels = self.image.load() + self.threshold(1.85) + #self.eval_black_white(240) + #self.derotate_by_average() + + letters = self.split_captcha_letters() + + final = "" + for letter in letters: + self.image = letter + self.run_tesser() + final += self.result_captcha + + #replace common errors + final = self.correct({ + "A": "4", + "‘5": "3", + ("‘1", "T"): "7", + ("‘L", "B", "'L"): "2", + "b": "6", + ("I", "X"): "1" + }, final) + + return final + + #tesseract at 60% + +if __name__ == '__main__': + import urllib + ocr = ShareonlineBiz() + urllib.urlretrieve("http://www.share-online.biz/captcha.php", "captcha.jpeg") + print ocr.get_captcha('captcha.jpeg') diff --git a/module/plugins/captcha/__init__.py b/module/plugins/captcha/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/module/plugins/captcha/captcha.py b/module/plugins/captcha/captcha.py new file mode 100644 index 000000000..283b171e0 --- /dev/null +++ b/module/plugins/captcha/captcha.py @@ -0,0 +1,295 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +#Copyright (C) 2009 kingzero, RaNaN +# +#This program is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 3 of the License, +#or (at your option) any later version. +# +#This program is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +#See the GNU General Public License for more details. +# +#You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +### +from __future__ import with_statement +import logging +import subprocess +import tempfile +import threading + +import Image + +class RunThread(threading.Thread): + def __init__(self): + threading.Thread.__init__(self) + + def e(self, command, inputdata=None): + """execute command """ + self.command = command + self.inputdata = inputdata + self.result = "" + self.start() + self.join(10) + return self.result + + def run(self): + """Run a command and return standard output""" + pipe = subprocess.PIPE + popen = subprocess.Popen(self.command, stdout=pipe, stderr=pipe) + outputdata, errdata = popen.communicate(self.inputdata) + assert (popen.returncode == 0), \ + "Error running: %s\n\n%s" % (self.command, errdata) + self.result = outputdata + +class OCR(object): + def __init__(self): + self.logger = logging.getLogger("log") + + def load_image(self, image): + self.image = Image.open(image) + self.pixels = self.image.load() + self.result_captcha = '' + + def unload(self): + """delete all tmp images""" + pass + + def threshold(self, value): + self.image = self.image.point(lambda a: a * value + 10) + + def run(self, command, inputdata=None): + """Run a command and return standard output""" + # OLD METHOD + # pipe = subprocess.PIPE + # popen = subprocess.Popen(command, stdout=pipe, stderr=pipe) + # outputdata, errdata = popen.communicate(inputdata) + # assert (popen.returncode == 0), \ + # "Error running: %s\n\n%s" % (command, errdata) + # return outputdata + + thread = RunThread() + result = thread.e(command, inputdata) + return result + + def run_gocr(self): + tmp = tempfile.NamedTemporaryFile(suffix=".jpg") + self.image.save(tmp) + self.result_captcha = self.run(['gocr', tmp.name]).replace("\n", "") + + def run_tesser(self): + self.logger.debug("create tmp tif") + tmp = tempfile.NamedTemporaryFile(suffix=".tif") + self.logger.debug("create tmp txt") + tmpTxt = tempfile.NamedTemporaryFile(suffix=".txt") + self.logger.debug("save tiff") + self.image.save(tmp.name, 'TIFF') + self.logger.debug("run tesseract") + self.run(['tesseract', tmp.name, tmpTxt.name.replace(".txt", "")]) + self.logger.debug("read txt") + + with open(tmpTxt.name, 'r') as f: + self.result_captcha = f.read().replace("\n", "") + + def get_captcha(self): + raise NotImplementedError + + def to_greyscale(self): + if self.image.mode != 'L': + self.image = self.image.convert('L') + + self.pixels = self.image.load() + + def eval_black_white(self, limit): + self.pixels = self.image.load() + w, h = self.image.size + for x in xrange(w): + for y in xrange(h): + if self.pixels[x, y] > limit: + self.pixels[x, y] = 255 + else: + self.pixels[x, y] = 0 + + def clean(self, allowed): + pixels = self.pixels + + w, h = self.image.size + + for x in xrange(w): + for y in xrange(h): + if pixels[x, y] == 255: continue + # no point in processing white pixels since we only want to remove black pixel + count = 0 + + try: + if pixels[x-1, y-1] != 255: count += 1 + if pixels[x-1, y] != 255: count += 1 + if pixels[x-1, y + 1] != 255: count += 1 + if pixels[x, y + 1] != 255: count += 1 + if pixels[x + 1, y + 1] != 255: count += 1 + if pixels[x + 1, y] != 255: count += 1 + if pixels[x + 1, y-1] != 255: count += 1 + if pixels[x, y-1] != 255: count += 1 + except: + pass + + # not enough neighbors are dark pixels so mark this pixel + # to be changed to white + if count < allowed: + pixels[x, y] = 1 + + # second pass: this time set all 1's to 255 (white) + for x in xrange(w): + for y in xrange(h): + if pixels[x, y] == 1: pixels[x, y] = 255 + + self.pixels = pixels + + def derotate_by_average(self): + """rotate by checking each angle and guess most suitable""" + + w, h = self.image.size + pixels = self.pixels + + for x in xrange(w): + for y in xrange(h): + if pixels[x, y] == 0: + pixels[x, y] = 155 + + highest = {} + counts = {} + + for angle in range(-45, 45): + + tmpimage = self.image.rotate(angle) + + pixels = tmpimage.load() + + w, h = self.image.size + + for x in xrange(w): + for y in xrange(h): + if pixels[x, y] == 0: + pixels[x, y] = 255 + + + count = {} + + for x in xrange(w): + count[x] = 0 + for y in xrange(h): + if pixels[x, y] == 155: + count[x] += 1 + + sum = 0 + cnt = 0 + + for x in count.values(): + if x != 0: + sum += x + cnt += 1 + + avg = sum / cnt + counts[angle] = cnt + highest[angle] = 0 + for x in count.values(): + if x > highest[angle]: + highest[angle] = x + + highest[angle] = highest[angle] - avg + + hkey = 0 + hvalue = 0 + + for key, value in highest.iteritems(): + if value > hvalue: + hkey = key + hvalue = value + + self.image = self.image.rotate(hkey) + pixels = self.image.load() + + for x in xrange(w): + for y in xrange(h): + if pixels[x, y] == 0: + pixels[x, y] = 255 + + if pixels[x, y] == 155: + pixels[x, y] = 0 + + self.pixels = pixels + + def split_captcha_letters(self): + captcha = self.image + started = False + letters = [] + width, height = captcha.size + bottomY, topY = 0, height + pixels = captcha.load() + + for x in xrange(width): + black_pixel_in_col = False + for y in xrange(height): + if pixels[x, y] != 255: + if started == False: + started = True + firstX = x + lastX = x + + if y > bottomY: bottomY = y + if y < topY: topY = y + if x > lastX: lastX = x + + black_pixel_in_col = True + + if black_pixel_in_col == False and started == True: + rect = (firstX, topY, lastX, bottomY) + new_captcha = captcha.crop(rect) + + w, h = new_captcha.size + if w > 5 and h > 5: + letters.append(new_captcha) + + started = False + bottomY, topY = 0, height + + return letters + + def correct(self, values, var=None): + + if var: + result = var + else: + result = self.result_captcha + + for key, item in values.iteritems(): + + if key.__class__ == str: + result = result.replace(key, item) + else: + for expr in key: + result = result.replace(expr, item) + + if var: + return result + else: + self.result_captcha = result + + +if __name__ == '__main__': + ocr = OCR() + ocr.load_image("B.jpg") + ocr.to_greyscale() + ocr.eval_black_white(140) + ocr.derotate_by_avergage() + ocr.run_gocr() + print "GOCR", ocr.result_captcha + ocr.run_tesser() + print "Tesseract", ocr.result_captcha + ocr.image.save("derotated.jpg") + diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 46f380857..a73779dd3 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -6,6 +6,25 @@ from time import sleep from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup +from module.download_thread import CaptchaError + +from htmlentitydefs import name2codepoint as n2cp +def substitute_entity(match): + ent = match.group(2) + if match.group(1) == "#": + return unichr(int(ent)) + else: + cp = n2cp.get(ent) + if cp: + return unichr(cp) + else: + return match.group() + +def decode_htmlentities(string): + entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8});") + return entity_re.subn(substitute_entity, string)[0] + + class SerienjunkiesOrg(Plugin): def __init__(self, parent): Plugin.__init__(self, parent) @@ -13,7 +32,7 @@ class SerienjunkiesOrg(Plugin): props['name'] = "SerienjunkiesOrg" props['type'] = "container" props['pattern'] = r"http://.*?serienjunkies.org/.*?" - props['version'] = "0.1" + props['version'] = "0.2" props['description'] = """serienjunkies.org Container Plugin""" props['author_name'] = ("mkaay") props['author_mail'] = ("mkaay@mkaay.de") @@ -21,6 +40,43 @@ class SerienjunkiesOrg(Plugin): self.parent = parent self.html = None self.multi_dl = False + + self.hosterMap = { + "rc": "RapidshareCom", + "ff": "FilefactoryCom", + "ut": "UploadedTo", + "ul": "UploadedTo", + "nl": "NetloadIn", + "rs": "RapidshareDe" + } + self.hosterMapReverse = dict((v,k) for k, v in self.hosterMap.iteritems()) + episodePattern = re.compile("^http://download.serienjunkies.org/f-.*?.html$") + oldStyleLink = re.compile("^http://serienjunkies.org/safe/(.*)$") + if re.match(episodePattern, self.parent.url) or re.match(oldStyleLink, self.parent.url): + self.decryptNow = False + else: + self.decryptNow = True + + def prepare(self, thread): + pyfile = self.parent + + self.want_reconnect = False + + pyfile.status.exists = self.file_exists() + + if not pyfile.status.exists: + raise Exception, "File not found" + return False + + pyfile.status.filename = self.get_file_name() + + pyfile.status.waituntil = self.time_plus_wait + pyfile.status.url = self.get_file_url() + pyfile.status.want_reconnect = self.want_reconnect + + thread.wait(self.parent) + + return True def getSJSrc(self, url): src = self.req.load(str(url)) @@ -31,9 +87,88 @@ class SerienjunkiesOrg(Plugin): def file_exists(self): return True + def waitForCaptcha(self, captchaData, imgType): + captchaManager = self.parent.core.captchaManager + task = captchaManager.newTask(self) + task.setCaptcha(captchaData, imgType) + task.setWaiting() + while not task.getStatus() == "done": + if not self.parent.core.isGUIConnected(): + task.removeTask() + raise CaptchaError + sleep(1) + result = task.getResult() + task.removeTask() + return result + + def handleSeason(self, url): + src = self.getSJSrc(url) + soup = BeautifulSoup(src) + post = soup.find("div", attrs={"class": "post-content"}) + ps = post.findAll("p") + hosterPattern = re.compile("^http://download\.serienjunkies\.org/f-.*?/([rcfultns]{2})_.*?\.html$") + preferredHoster = self.get_config("preferredHoster").split(",") + self.logger.debug("Preferred hoster: %s" % ", ".join(preferredHoster)) + groups = {} + gid = -1 + seasonName = soup.find("a", attrs={"rel":"bookmark"}).string + for p in ps: + if re.search("<strong>Dauer|<strong>Sprache|<strong>Format", str(p)): + var = p.findAll("strong") + opts = {"Dauer": "", "Uploader": "", "Sprache": "", "Format": "", u"Größe": ""} + for v in var: + n = decode_htmlentities(v.string) + val = v.nextSibling + val = val.encode("utf-8") + val = decode_htmlentities(val) + val = val.replace(" |", "") + n = n.strip() + n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n) + val = val.strip() + val = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', val) + opts[n.strip()] = val.strip() + gid += 1 + groups[gid] = {} + groups[gid]["ep"] = [] + groups[gid]["opts"] = opts + elif re.search("<strong>Download:", str(p)): + links1 = p.findAll("a", attrs={"href": hosterPattern}) + links2 = p.findAll("a", attrs={"href": re.compile("^http://serienjunkies.org/safe/.*$")}) + for link in links1 + links2: + groups[gid]["ep"].append(link["href"]) + packages = {} + for g in groups.values(): + links = [] + linklist = g["ep"] + package = "%s (%s, %s)" % (seasonName, g["opts"]["Format"], g["opts"]["Sprache"]) + linkgroups = {} + for link in linklist: + key = re.sub("^http://download\.serienjunkies\.org/f-.*?/([rcfultns]{2})_", "", link) + if not linkgroups.has_key(key): + linkgroups[key] = [] + linkgroups[key].append(link) + for group in linkgroups.values(): + print "group", group + for pHoster in preferredHoster: + print "phoster", pHoster + hmatch = False + for link in group: + print "link", link + m = hosterPattern.match(link) + if m: + if pHoster == self.hosterMap[m.group(1)]: + links.append(link) + hmatch = True + print "match" + break + if hmatch: + break + packages[package] = links + return packages + def handleEpisode(self, url): if not self.parent.core.isGUIConnected(): - return False + raise CaptchaError for i in range(3): src = self.getSJSrc(url) if not src.find("Du hast das Download-Limit überschritten! Bitte versuche es später nocheinmal.") == -1: @@ -45,17 +180,7 @@ class SerienjunkiesOrg(Plugin): captchaTag = soup.find(attrs={"src":re.compile("^/secure/")}) captchaUrl = "http://download.serienjunkies.org"+captchaTag["src"] captchaData = self.req.load(str(captchaUrl)) - captchaManager = self.parent.core.captchaManager - task = captchaManager.newTask(self) - task.setCaptcha(captchaData, "png") - task.setWaiting() - while not task.getStatus() == "done": - if not self.parent.core.isGUIConnected(): - task.removeTask() - return False - sleep(1) - result = task.getResult() - task.removeTask() + result = self.waitForCaptcha(captchaData, "png") url = "http://download.serienjunkies.org"+form["action"] sinp = form.find(attrs={"name":"s"}) @@ -73,6 +198,27 @@ class SerienjunkiesOrg(Plugin): links.append(self.handleFrame(frameUrl)) return links + def handleOldStyleLink(self, url): + if not self.parent.core.isGUIConnected(): + raise CaptchaError + for i in range(3): + sj = self.req.load(str(url)) + soup = BeautifulSoup(sj) + form = soup.find("form", attrs={"action":re.compile("^http://serienjunkies.org")}) + captchaTag = form.find(attrs={"src":re.compile("^/safe/secure/")}) + captchaUrl = "http://serienjunkies.org"+captchaTag["src"] + captchaData = self.req.load(str(captchaUrl)) + result = self.waitForCaptcha(captchaData, "png") + url = form["action"] + sinp = form.find(attrs={"name":"s"}) + + self.req.load(str(url), post={'s': sinp["value"], 'c': result, 'dl.start': "Download"}, cookies=False, just_header=True) + decrypted = self.req.lastEffectiveURL + if decrypted == str(url): + continue + return [decrypted] + return False + def handleFrame(self, url): self.req.load(str(url), cookies=False, just_header=True) return self.req.lastEffectiveURL @@ -80,9 +226,15 @@ class SerienjunkiesOrg(Plugin): def proceed(self, url, location): links = False episodePattern = re.compile("^http://download.serienjunkies.org/f-.*?.html$") + oldStyleLink = re.compile("^http://serienjunkies.org/safe/(.*)$") framePattern = re.compile("^http://download.serienjunkies.org/frame/go-.*?/$") + seasonPattern = re.compile("^http://serienjunkies.org/\?p=.*?$") if framePattern.match(url): links = [self.handleFrame(url)] elif episodePattern.match(url): links = self.handleEpisode(url) + elif oldStyleLink.match(url): + links = self.handleOldStyleLink(url) + elif seasonPattern.match(url): + links = self.handleSeason(url) self.links = links diff --git a/module/thread_list.py b/module/thread_list.py index ad0d0c8fb..d3eb4d203 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -110,15 +110,26 @@ class Thread_List(object): if pyfile.plugin.props['type'] == "container": newLinks = 0 if pyfile.plugin.links: - for link in pyfile.plugin.links: - newFile = self.list.collector.addLink(link) - self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile)) - newLinks += 1 - self.list.packager.pushPackage2Queue(pyfile.package.data["id"]) + if isinstance(pyfile.plugin.links, dict): + packmap = {} + for packname in pyfile.plugin.links.keys(): + packmap[packname] = self.list.packager.addNewPackage(packname) + for packname, links in pyfile.plugin.links.items(): + pid = packmap[packname] + for link in links: + newFile = self.list.collector.addLink(link) + self.list.packager.addFileToPackage(pid, self.list.collector.popFile(newFile)) + newLinks += 1 + else: + for link in pyfile.plugin.links: + newFile = self.list.collector.addLink(link) + self.list.packager.addFileToPackage(pyfile.package.data["id"], self.list.collector.popFile(newFile)) + newLinks += 1 + #self.list.packager.pushPackage2Queue(pyfile.package.data["id"]) self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.data["id"]) if newLinks: - self.parent.logger.info("Parsed link from %s: %i" % (pyfile.status.filename, newLinks)) + self.parent.logger.info("Parsed links from %s: %i" % (pyfile.status.filename, newLinks)) else: self.parent.logger.info("No links in %s" % pyfile.status.filename) #~ self.list.packager.removeFileFromPackage(pyfile.id, pyfile.package.id) -- cgit v1.2.3 From 9a5ae6ebec9a82170d194c9dd5465bd489477f22 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 30 Dec 2009 17:49:46 +0100 Subject: removed prints --- module/plugins/decrypter/SerienjunkiesOrg.py | 4 ---- 1 file changed, 4 deletions(-) (limited to 'module') diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index a73779dd3..ce1721e92 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -148,18 +148,14 @@ class SerienjunkiesOrg(Plugin): linkgroups[key] = [] linkgroups[key].append(link) for group in linkgroups.values(): - print "group", group for pHoster in preferredHoster: - print "phoster", pHoster hmatch = False for link in group: - print "link", link m = hosterPattern.match(link) if m: if pHoster == self.hosterMap[m.group(1)]: links.append(link) hmatch = True - print "match" break if hmatch: break -- cgit v1.2.3 From 4f904bd9610795c36d9e896bdf44c263ff43f5fd Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Fri, 1 Jan 2010 17:13:43 +0100 Subject: fixed SerienjunkiesOrg, no more segfault in gui? --- module/file_list.py | 2 +- module/gui/Collector.py | 58 ++++++++++++++++++++-------- module/gui/MainWindow.py | 2 - module/gui/Queue.py | 38 ++++++++++++------ module/plugins/decrypter/SerienjunkiesOrg.py | 4 +- 5 files changed, 71 insertions(+), 33 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 8af66d5ed..232f2b7ea 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -127,7 +127,7 @@ class File_List(object): for thread_list only """ files = [] - for pypack in self.data["queue"] + self.data["packages"]: + for pypack in self.data["queue"]: for pyfile in pypack.files: if pyfile.status.type == None and pyfile.plugin.props['type'] == "container" and not pyfile.active: files.append(pyfile) diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 356ab36ec..112eb1cd5 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -23,14 +23,13 @@ from time import sleep from module.gui.Queue import ItemIterator -class PackageCollector(QThread): +class PackageCollector(QObject): def __init__(self, view, connector): - QThread.__init__(self) + QObject.__init__(self) self.view = view self.connector = connector self.collector = [] self.interval = 2 - self.running = True self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() item = self.PackageCollectorPack(self) @@ -40,14 +39,28 @@ class PackageCollector(QThread): self.rootItem.addChild(item) self.linkCollector = item self.pauseIDs = [] + self.updater = self.CollectorUpdater(self.interval) + self.connect(self.updater, SIGNAL("update()"), self.update) - def run(self): - while self.running: - self.update() - sleep(self.interval) + class CollectorUpdater(QThread): + def __init__(self, interval): + QThread.__init__(self) + self.interval = interval + self.running = True + + def run(self): + while self.running: + self.emit(SIGNAL("update()")) + self.sleep(self.interval) + + def start(self): + self.updater.start() + + def wait(self): + self.updater.wait() def stop(self): - self.running = False + self.updater.running = False def update(self): locker = QMutexLocker(self.mutex) @@ -210,23 +223,36 @@ class PackageCollector(QThread): def getPack(self): return self.pack -class LinkCollector(QThread): +class LinkCollector(QObject): def __init__(self, view, root, connector): - QThread.__init__(self) + QObject.__init__(self) self.view = view self.connector = connector self.interval = 2 - self.running = True self.rootItem = root self.mutex = QMutex() + self.updater = self.CollectorUpdater(self.interval) + self.connect(self.updater, SIGNAL("update()"), self.update) + + class CollectorUpdater(QThread): + def __init__(self, interval): + QThread.__init__(self) + self.interval = interval + self.running = True + + def run(self): + while self.running: + self.emit(SIGNAL("update()")) + self.sleep(self.interval) + + def start(self): + self.updater.start() - def run(self): - while self.running: - self.update() - sleep(self.interval) + def wait(self): + self.updater.wait() def stop(self): - self.running = False + self.updater.running = False def update(self): locker = QMutexLocker(self.mutex) diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 94ff63dda..250b701e4 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -403,13 +403,11 @@ class MainWindow(QMainWindow): def slotEditPackage(self): item = self.tabs["collector"]["package_view"].currentItem() pid = self.tabs["collector"]["package_view"].currentItem().data(0, Qt.UserRole).toPyObject() - print type(pid) self.emit(SIGNAL("pauseItemUpdate"), pid, True) self.tabs["collector"]["package_view"].editItem(item, 0) def slotCloseItemEditor(self, editor, hint): pid = self.tabs["collector"]["package_view"].currentItem().data(0, Qt.UserRole).toPyObject() - print type(pid) self.emit(SIGNAL("changePackageName"), pid, editor.text()) self.emit(SIGNAL("pauseItemUpdate"), pid, False) diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 499cb5199..ed1c0f0a1 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -21,9 +21,9 @@ from PyQt4.QtGui import * from time import sleep, time -class Queue(QThread): +class Queue(QObject): def __init__(self, view, connector): - QThread.__init__(self) + QObject.__init__(self) self.view = view self.connector = connector self.statusMap = { @@ -33,24 +33,38 @@ class Queue(QThread): "waiting": 3, "reconnected": 4, "starting": 5, - "downloading": 6, - "failed": 7, - "aborted": 8, + "failed": 6, + "aborted": 7, + "decrypting": 8, + "downloading": 9 } self.statusMapReverse = dict((v,k) for k, v in self.statusMap.iteritems()) self.interval = 1 - self.running = True self.wait_dict = {} self.rootItem = self.view.invisibleRootItem() self.mutex = QMutex() + self.updater = self.QueueUpdater(self.interval) + self.connect(self.updater, SIGNAL("update()"), self.update) - def run(self): - while self.running: - self.update() - sleep(self.interval) + class QueueUpdater(QThread): + def __init__(self, interval): + QThread.__init__(self) + self.interval = interval + self.running = True + + def run(self): + while self.running: + self.emit(SIGNAL("update()")) + self.sleep(self.interval) + + def start(self): + self.updater.start() + + def wait(self): + self.updater.wait() def stop(self): - self.running = False + self.updater.running = False def update(self): locker = QMutexLocker(self.mutex) @@ -241,7 +255,7 @@ class Queue(QThread): self.addChild(newChild) item = newChild speed = self.queue.getSpeed(item) - if speed == None or item.getFileData()["status_type"] == "starting": + if speed == None or item.getFileData()["status_type"] == "starting" or item.getFileData()["status_type"] == "decrypting": status = item.getFileData()["status_type"] else: status = "%s (%s KB/s)" % (item.getFileData()["status_type"], speed) diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index ce1721e92..2f77b81ae 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -52,7 +52,7 @@ class SerienjunkiesOrg(Plugin): self.hosterMapReverse = dict((v,k) for k, v in self.hosterMap.iteritems()) episodePattern = re.compile("^http://download.serienjunkies.org/f-.*?.html$") oldStyleLink = re.compile("^http://serienjunkies.org/safe/(.*)$") - if re.match(episodePattern, self.parent.url) or re.match(oldStyleLink, self.parent.url): + if episodePattern.match(self.parent.url) or oldStyleLink.match(self.parent.url): self.decryptNow = False else: self.decryptNow = True @@ -121,7 +121,7 @@ class SerienjunkiesOrg(Plugin): val = v.nextSibling val = val.encode("utf-8") val = decode_htmlentities(val) - val = val.replace(" |", "") + val = val.replace("|", "").strip() n = n.strip() n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n) val = val.strip() -- cgit v1.2.3 From d2ea03a068c9cbc43750d672aab7f2574ccfd9b4 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Fri, 1 Jan 2010 20:54:44 +0100 Subject: fixed netload.in premium --- module/gui/Queue.py | 2 +- module/plugins/hoster/NetloadIn.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/gui/Queue.py b/module/gui/Queue.py index ed1c0f0a1..be2170309 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -130,7 +130,7 @@ class Queue(QObject): if not data["plugin"] in plugins: plugins.append(data["plugin"]) if status >= 0: - if speed == None: + if speed == None or self.statusMapReverse[status] == "starting" or self.statusMapReverse[status] == "decrypting": statustxt = self.statusMapReverse[status] else: statustxt = "%s (%s KB/s)" % (self.statusMapReverse[status], speed) diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 6941ad033..1f7e7d011 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -46,7 +46,7 @@ class NetloadIn(Plugin): pyfile.status.filename = self.get_file_name() if self.config['premium']: - self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}) + self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url #@TODO: premium?? @@ -72,14 +72,15 @@ class NetloadIn(Plugin): apiurl = "http://netload.in/share/fileinfos2.php" src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} - if src != "unknown file_data": + if not src == "unknown file_data": + print "apidata:", src lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] self.api_data["filename"] = lines[1] self.api_data["size"] = lines[2] #@TODO formatting? (ex: '2.07 KB') self.api_data["status"] = lines[3] - self.api_data["checksum"] = lines[4].replace("\n", "") + self.api_data["checksum"] = lines[4].strip() else: self.api_data["exists"] = False -- cgit v1.2.3 From 4ead56475df252c3783701ddf27be9abbd410ad3 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 2 Jan 2010 15:32:29 +0100 Subject: new xmlparser --- module/XMLConfigParser.py | 36 +++++++++++++++++++ module/config/core_default.xml | 82 +++++++++++++++++++++--------------------- 2 files changed, 77 insertions(+), 41 deletions(-) (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index eedc00b67..444d45928 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -27,6 +27,8 @@ class XMLConfigParser(): self.file = data self.file_default = default_data self.config = {} + self.data = {} + self.types = {} self.loadData() self.root = None @@ -53,17 +55,27 @@ class XMLConfigParser(): root = self.xml.documentElement self.root = root config = {} + data = {} for node in root.childNodes: if node.nodeType == node.ELEMENT_NODE: section = node.tagName config[section] = {} + data[section] = {} + data[section]["options"] = {} + data[section]["name"] = node.getAttribute("name") for opt in node.childNodes: if opt.nodeType == opt.ELEMENT_NODE: + data[section]["options"][opt.tagName] = {} try: config[section][opt.tagName] = format(opt.firstChild.data) + data[section]["options"][opt.tagName]["value"] = format(opt.firstChild.data) except: config[section][opt.tagName] = "" + data[section]["options"][opt.tagName]["name"] = opt.getAttribute("name") + data[section]["options"][opt.tagName]["type"] = opt.getAttribute("type") + data[section]["options"][opt.tagName]["input"] = opt.getAttribute("input") self.config = config + self.data = data def get(self, section, option, default=None): try: @@ -100,3 +112,27 @@ class XMLConfigParser(): root.appendChild(newSection) self.saveData() self.loadData() + + def getType(self, section, option): + try: + return self.data[section]["options"][option]["type"] + except: + return "str" + + def getInputValues(self, section, option): + try: + return self.data[section]["options"][option]["input"].split(";") + except: + return [] + + def getDisplayName(self, section, option=None): + try: + if option: + return self.data[section]["options"][option]["name"] + else: + return self.data[section]["name"] + except: + if option: + return option + else: + return section diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 7f503ce18..58e5d1be2 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -1,60 +1,60 @@ <config> - <remote> - <port>7227</port> - <listenaddr>0.0.0.0</listenaddr> - <username>admin</username> - <password>pwhere</password> + <remote name="Remote"> + <port type="int" name="Port">7227</port> + <listenaddr type="ip" name="Adress">0.0.0.0</listenaddr> + <username type="str" name="Username">admin</username> + <password type="str" name="Password">pwhere</password> </remote> <ssl> - <activated>False</activated> - <cert>ssl.srt</cert> - <key>ssl.key</key> + <activated type="bool" name="">False</activated> + <cert type="str" name="Remote Port">ssl.srt</cert> + <key type="str" name="Remote Port">ssl.key</key> </ssl> <webinterface> - <activated>True</activated> - <host>0.0.0.0</host> - <port>8000</port> - <template>default</template> - <local>True</local> - <ssl>None</ssl> - <username>None</username> - <adress>None</adress> - <extport>None</extport> - <pw>None</pw> + <activated type="bool">True</activated> + <host type="ip">0.0.0.0</host> + <port type="int">8000</port> + <template type="str">default</template> + <local type="bool">True</local> + <ssl type="bool">False</ssl> + <username type="str">None</username> + <adress type="ip">None</adress> + <extport type="int">None</extport> + <pw type="str">None</pw> </webinterface> <log> - <file_log>True</file_log> - <log_folder>Logs</log_folder> - <log_count>5</log_count> + <file_log type="bool">True</file_log> + <log_folder type="str">Logs</log_folder> + <log_count type="int">5</log_count> </log> <general> - <language>de</language> - <download_folder>Downloads</download_folder> - <max_downloads>3</max_downloads> - <use_reconnect>False</use_reconnect> - <link_file>links.txt</link_file> - <failed_file>failed_links.txt</failed_file> - <reconnect_method>reconnect_method</reconnect_method> - <debug_mode>False</debug_mode> - <max_download_time>5</max_download_time> - <download_speed_limit>0</download_speed_limit> - <checksum>True</checksum> + <language type="str" input="en;de;fr">de</language> + <download_folder type="str">Downloads</download_folder> + <max_downloads type="int">3</max_downloads> + <use_reconnect type="bool">False</use_reconnect> + <link_file type="str">links.txt</link_file> + <failed_file type="str">failed_links.txt</failed_file> + <reconnect_method type="str">None</reconnect_method> + <debug_mode type="bool">False</debug_mode> + <max_download_time type="int">5</max_download_time> + <download_speed_limit type="int">0</download_speed_limit> + <checksum type="bool">True</checksum> </general> <updates> - <search_updates>True</search_updates> - <install_updates>False</install_updates> + <search_updates type="bool">True</search_updates> + <install_updates type="bool">False</install_updates> </updates> <reconnectTime> - <start>0:00</start> - <end>0:00</end> + <start type="time">0:00</start> + <end type="time">0:00</end> </reconnectTime> <downloadTime> - <start>0:00</start> - <end>0:00</end> + <start type="time">0:00</start> + <end type="time">0:00</end> </downloadTime> <proxy> - <activated>False</activated> - <adress>http://localhost:8080</adress> - <protocol>http</protocol> + <activated type="bool">False</activated> + <adress type="str">http://localhost:8080</adress> + <protocol type="str">http</protocol> </proxy> </config> -- cgit v1.2.3 From 3e3ba5240d20a5eb8df669272cb0f3d838d8fcfa Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 3 Jan 2010 14:58:28 +0100 Subject: Full Config File --- module/XMLConfigParser.py | 3 ++ module/config/core_default.xml | 86 ++++++++++++++++++++-------------------- module/config/plugin_default.xml | 2 +- 3 files changed, 47 insertions(+), 44 deletions(-) (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 444d45928..0d2094dae 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -85,6 +85,9 @@ class XMLConfigParser(): def getConfig(self): return self.config + + def getData(self): + return self.data def set(self, section, option, value): root = self.root diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 58e5d1be2..4c95d5386 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -1,60 +1,60 @@ -<config> +<config name="Configuration"> <remote name="Remote"> <port type="int" name="Port">7227</port> <listenaddr type="ip" name="Adress">0.0.0.0</listenaddr> <username type="str" name="Username">admin</username> <password type="str" name="Password">pwhere</password> </remote> - <ssl> - <activated type="bool" name="">False</activated> + <ssl name="SSL"> + <activated type="bool" name="Activated">False</activated> <cert type="str" name="Remote Port">ssl.srt</cert> <key type="str" name="Remote Port">ssl.key</key> </ssl> - <webinterface> - <activated type="bool">True</activated> - <host type="ip">0.0.0.0</host> - <port type="int">8000</port> - <template type="str">default</template> - <local type="bool">True</local> - <ssl type="bool">False</ssl> - <username type="str">None</username> - <adress type="ip">None</adress> - <extport type="int">None</extport> - <pw type="str">None</pw> + <webinterface name="Webinterface"> + <activated type="bool" name="Activated">True</activated> + <host type="ip" name="IP">0.0.0.0</host> + <port type="int" name="Port">8000</port> + <template type="str" name="Template">default</template> + <local type="bool" name="Local">True</local> + <ssl type="bool" name="SSL">False</ssl> + <username type="str" name="Username">None</username> + <adress type="ip" name="Adress">None</adress> + <extport type="int" name="Extern Port">None</extport> + <pw type="str" name="Password">None</pw> </webinterface> - <log> - <file_log type="bool">True</file_log> - <log_folder type="str">Logs</log_folder> - <log_count type="int">5</log_count> + <log name="Log"> + <file_log type="bool" name="File Log">True</file_log> + <log_folder type="str" name="Folder">Logs</log_folder> + <log_count type="int" name="Count">5</log_count> </log> - <general> - <language type="str" input="en;de;fr">de</language> - <download_folder type="str">Downloads</download_folder> - <max_downloads type="int">3</max_downloads> - <use_reconnect type="bool">False</use_reconnect> - <link_file type="str">links.txt</link_file> - <failed_file type="str">failed_links.txt</failed_file> - <reconnect_method type="str">None</reconnect_method> - <debug_mode type="bool">False</debug_mode> - <max_download_time type="int">5</max_download_time> - <download_speed_limit type="int">0</download_speed_limit> - <checksum type="bool">True</checksum> + <general name="General"> + <language type="str" input="en;de;fr" name="Language">de</language> + <download_folder type="str" name="Download Folder">Downloads</download_folder> + <max_downloads type="int" name="Max Parallel Downloads">3</max_downloads> + <use_reconnect type="bool" name="Use Reconnect">False</use_reconnect> + <link_file type="str" name="File For Links">links.txt</link_file> + <failed_file type="str" name="File For Failed Links">failed_links.txt</failed_file> + <reconnect_method type="str" name="Reconnect Method">None</reconnect_method> + <debug_mode type="bool" name="Debug Mode">False</debug_mode> + <max_download_time type="int" name="Max Download Time">5</max_download_time> + <download_speed_limit type="int" name="Download Speed Limit">0</download_speed_limit> + <checksum type="bool" name="Use Checksum">True</checksum> </general> - <updates> - <search_updates type="bool">True</search_updates> - <install_updates type="bool">False</install_updates> + <updates name="Updates"> + <search_updates type="bool" name="Search">True</search_updates> + <install_updates type="bool" name="Install">False</install_updates> </updates> - <reconnectTime> - <start type="time">0:00</start> - <end type="time">0:00</end> + <reconnectTime name="Reconnect Time"> + <start type="time" name="Start">0:00</start> + <end type="time" name="End">0:00</end> </reconnectTime> - <downloadTime> - <start type="time">0:00</start> - <end type="time">0:00</end> + <downloadTime name="Download Time"> + <start type="time" name="Start">0:00</start> + <end type="time" name="End">0:00</end> </downloadTime> - <proxy> - <activated type="bool">False</activated> - <adress type="str">http://localhost:8080</adress> - <protocol type="str">http</protocol> + <proxy name="Proxy"> + <activated type="bool" name="Activated">False</activated> + <adress type="str" name="Adress">http://localhost:8080</adress> + <protocol type="str" name="Protocol">http</protocol> </proxy> </config> diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 88628cb5e..76a873048 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -9,7 +9,7 @@ TeliaSonera #3, TeliaSonera --> <!-- leave empty for autmomatic selection --> - <server></server> + <server input=";Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera"></server> <premium>False</premium> <username></username> <password></password> -- cgit v1.2.3 From ae4f0dfc38c49e19ef2b290f0974df9923bf1b94 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 3 Jan 2010 16:21:53 +0100 Subject: SecuredIn plugin --- module/Plugin.py | 17 ++ module/file_list.py | 2 +- module/plugins/decrypter/SecuredIn.py | 335 +++++++++++++++++++++++++++ module/plugins/decrypter/SerienjunkiesOrg.py | 16 -- 4 files changed, 353 insertions(+), 17 deletions(-) create mode 100644 module/plugins/decrypter/SecuredIn.py (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index c33e0d565..7854aa66d 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -21,10 +21,13 @@ import logging import re from os.path import exists, join +from time import sleep from module.network.Request import Request from module.XMLConfigParser import XMLConfigParser +from module.download_thread import CaptchaError + class Plugin(): def __init__(self, parent): @@ -145,3 +148,17 @@ class Plugin(): 20 - unknown error """ return (True, 10) + + def waitForCaptcha(self, captchaData, imgType): + captchaManager = self.parent.core.captchaManager + task = captchaManager.newTask(self) + task.setCaptcha(captchaData, imgType) + task.setWaiting() + while not task.getStatus() == "done": + if not self.parent.core.isGUIConnected(): + task.removeTask() + raise CaptchaError + sleep(1) + result = task.getResult() + task.removeTask() + return result diff --git a/module/file_list.py b/module/file_list.py index 232f2b7ea..e7b80f26d 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -428,7 +428,7 @@ class PyLoadFile(): for dir in ["hoster", "decrypter", "container"]: try: self.modul = __import__("%s.%s" % (dir, pluginName), globals(), locals(), [pluginName], -1) - except Exception, e: + except ImportError: pass pluginClass = getattr(self.modul, pluginName) else: diff --git a/module/plugins/decrypter/SecuredIn.py b/module/plugins/decrypter/SecuredIn.py new file mode 100644 index 000000000..510d48b28 --- /dev/null +++ b/module/plugins/decrypter/SecuredIn.py @@ -0,0 +1,335 @@ +# -*- coding: utf-8 -*- + +import re + +from module.Plugin import Plugin +from module.BeautifulSoup import BeautifulSoup + +from math import ceil + +class SecuredIn(Plugin): + def __init__(self, parent): + Plugin.__init__(self, parent) + props = {} + props['name'] = "SecuredIn" + props['type'] = "container" + props['pattern'] = r"http://[\w\.]*?secured\.in/download-[\d]+-[\w]{8}\.html" + props['version'] = "0.1" + props['description'] = """secured.in Container Plugin""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.parent = parent + self.html = None + self.multi_dl = False + + def file_exists(self): + return True + + def proceed(self, url, location): + links = [] + ajaxUrl = "http://secured.in/ajax-handler.php" + src = self.req.load(url, cookies=True) + soup = BeautifulSoup(src) + img = soup.find("img", attrs={"id":"captcha_img"}) + for i in range(3): + form = soup.find("form", attrs={"id":"frm_captcha"}) + captchaHash = form.find("input", attrs={"id":"captcha_hash"})["value"] + captchaUrl = "http://secured.in/%s" % img["src"] + captchaData = self.req.load(str(captchaUrl), cookies=True) + result = self.waitForCaptcha(captchaData, "jpg") + src = self.req.load(url, cookies=True, post={"captcha_key":result, "captcha_hash":captchaHash}) + soup = BeautifulSoup(src) + img = soup.find("img", attrs={"id":"captcha_img"}) + if not img: + files = soup.findAll("tr", attrs={"id":re.compile("file-\d+")}) + dlIDPattern = re.compile("accessDownload\(\d, \d+, '(.*?)', \d\)") + cypher = self.Cypher() + for cfile in files: + m = dlIDPattern.search(cfile["onclick"]) + if m: + crypted = self.req.load(ajaxUrl, cookies=True, post={"cmd":"download", "download_id":m.group(1)}) + cypher.reset() + link = cypher.cypher(crypted) + links.append(link) + break + self.links = links + + class Cypher(): + def __init__(self): + self.reset() + + def reset(self): + self.iatwbfrd = [ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, + 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, + 0x9c30d539, 0x2af26013, 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, + 0xbd314b27, 0x78af2fda, 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, + 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1, + 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, + 0xf6e96c9a, 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, + 0x56c16aa6, 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, + 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, 0x68fb6faf, + 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, + 0xdb3222f8, 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, + 0x1a87562e, 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, + 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, + 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, + 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, + 0x80957705, 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, 0x207d5ba2, + 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, 0xd60f573f, 0xbc9bc6e4, + 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, 0x53b02d5d, + 0xa99f8fa1, 0x08ba4799, 0x6e85076a + ] + + self.olkemfjq = [ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, + 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b + ] + + self.oqlaoymh = 0 + self.oqmykrna = 0 + self.pqmyzkid = 0 + self.pldmjnde = 0 + self.ldiwkqly = 0 + + self.plkodnyq = [ + 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, + 0xc700c47b, 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, + 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, + 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, + 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, + 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, + 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, 0x3830dc8e, 0x379d5862, + 0x9320f991, 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, 0xa2ae0810, 0xdd6db224, + 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, + 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, + 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, + 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, 0x0339c32a, + 0xc6913667, 0x8df9317c, 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, + 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e, + 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, + 0xa6327623, 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, + 0xcd769c2b, 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, + 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, 0xb74e6132, + 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + ] + + self.pnjzokye = None + + self.thdlpsmy = [ + 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, + 0x500061af, 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, + 0x7fac6dd0, 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, + 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, + 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58, + 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, + 0xe4c66d22, 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, 0x3b240b62, + 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, 0x5449a36f, 0x877d48fa, + 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, 0xc67b5510, + 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, + 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, + 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, 0xd1fd8346, + 0xf6381fb0, 0x7745ae04, 0xd736fccc, 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, + 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, + 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, + 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, + 0xce591d76, 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, + 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, + 0x92638212, 0x670efa8e, 0x406000e0 + ] + + self.ybghjtik = [ + 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, + 0xc2b19ee1, 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, + 0x4d2d38e6, 0xf0255dc1, 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, + 0x52a0e286, 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, 0xc8b57634, + 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908, + 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, + 0x2e6b7124, 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, + 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, 0xeae96fb1, + 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, 0xc6150eba, + 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, + 0x5b6e2f84, 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, + 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, 0x40685a32, + 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054, 0x8fd948e4, + 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, + 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, + 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, 0xcbee7460, 0x4085f2a7, + 0xce77326e, 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, 0x9e447a2e, 0xc3453484, + 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, + 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 + ] + + def cypher(self, code): + return self.lskdqpyr(code, "") + + def lskdqpyr(self, alokfmth, yoaksjdh): + if self.pnjzokye == None or self.pnjzokye.lower() == yoaksjdh: + self.yoliukev(yoaksjdh) + self.pnjzokye = yoaksjdh + alokfmth = self.plaomtje(alokfmth) + ykaiumgp = "" + alokijuh = len(alokfmth) + lokimyas = self.ylomiktb(alokfmth[0:8]) + palsiuzt = lokimyas[0] + tzghbndf = lokimyas[1] + awsedrft = [None, None] + for kiujzhqa in range(8, alokijuh, 8): + lokimyas = self.ylomiktb(alokfmth[kiujzhqa:kiujzhqa+8]) + awsedrft[0] = lokimyas[0] + awsedrft[1] = lokimyas[1] + lokimyas = self.okaqnhlp(lokimyas[0], lokimyas[1]) + lokimyas[0] ^= palsiuzt + lokimyas[1] ^= tzghbndf + palsiuzt = awsedrft[0] + tzghbndf = awsedrft[1] + ykaiumgp += self.ykijmtkd(lokimyas) + return ykaiumgp + + def okaqnhlp(self, lahgrnvp, trenlpys): + ujhaqylw = 0 + for yalmhopr in range(17, 1, -1): + lahgrnvp ^= self.ldiwkqly[yalmhopr] + trenlpys ^= (self.oqlaoymh[lahgrnvp >> 24 & 0xff] + self.oqmykrna[lahgrnvp >> 16 & 0xff] ^ self.pqmyzkid[lahgrnvp >> 8 & 0xff]) + self.pldmjnde[lahgrnvp & 0xff] + ujhaqylw = lahgrnvp + lahgrnvp = trenlpys + trenlpys = ujhaqylw + ujhaqylw = lahgrnvp + lahgrnvp = trenlpys + trenlpys = ujhaqylw + trenlpys ^= self.ldiwkqly[1] + lahgrnvp ^= self.ldiwkqly[0] + return [lahgrnvp, trenlpys] + + def plaomtje(self, yoiumqpy): + qkailkzt = "" + xoliuzem = 0 + lyomiujt = 0 + yploemju = -1 + for i in range(0, len(yoiumqpy)): + yploamzu = ord(yoiumqpy[i]) + if ord('A') <= yploamzu and yploamzu <= ord('Z'): + xoliuzem = ord(yoiumqpy[i]) - 65 + elif ord('a') <= yploamzu and yploamzu <= ord('z'): + xoliuzem = ord(yoiumqpy[i]) - 97 + 26 + elif ord('0') <= yploamzu and yploamzu <= ord('9'): + xoliuzem = ord(yoiumqpy[i]) - 48 + 52 + elif yploamzu == ord('+'): + xoliuzem = 62 + elif yploamzu == ord('/'): + xoliuzem = 63 + else: + continue + yploemju += 1 + + lxkdmizj = 0 + switch = yploemju % 4 + if switch == 0: + lyomiujt = xoliuzem + continue + elif switch == 1: + lxkdmizj = lyomiujt << 2 | xoliuzem >> 4 + lyomiujt = xoliuzem & 0x0F + elif switch == 2: + lxkdmizj = lyomiujt << 4 | xoliuzem >> 2 + lyomiujt = xoliuzem & 0x03 + elif switch == 3: + lxkdmizj = lyomiujt << 6 | xoliuzem >> 0 + lyomiujt = xoliuzem & 0x00 + qkailkzt += unichr(lxkdmizj) + return qkailkzt + + def qmyjuila(self, oqlamykt, yalkionj): + dolizmvw = 0 + for iumswkya in range(0, 16): + oqlamykt ^= self.ldiwkqly[iumswkya] + yalkionj ^= (self.oqlaoymh[oqlamykt >> 24 & 0xff] + self.oqmykrna[oqlamykt >> 16 & 0xff] ^ self.pqmyzkid[oqlamykt >> 8 & 0xff]) + self.pldmjnde[oqlamykt & 0xff] + dolizmvw = oqlamykt + oqlamykt = yalkionj + yalkionj = dolizmvw + dolizmvw = oqlamykt + oqlamykt = yalkionj + yalkionj = dolizmvw + yalkionj ^= self.ldiwkqly[16] + oqlamykt ^= self.ldiwkqly[17] + return [oqlamykt, yalkionj] + + def ykijmtkd(self, yoirlkqw): + loipamyu = len(yoirlkqw) + yoirlkqwchar = [] + for ymujtnbq in range(0, loipamyu): + yoir = [yoirlkqw[ymujtnbq] >> 24 & 0xff, yoirlkqw[ymujtnbq] >> 16 & 0xff, yoirlkqw[ymujtnbq] >> 8 & 0xff, yoirlkqw[ymujtnbq] & 0xff] + for c in yoir: + yoirlkqwchar.append(chr(c)) + return "".join(yoirlkqwchar) + + def ylomiktb(self, lofiuzmq): + plokimqw = int(ceil(len(lofiuzmq) / 4.0)) + lopkisdq = [] + for ypoqlktz in range(0, plokimqw): + lopkisdq.append(ord(lofiuzmq[(ypoqlktz << 2) + 3]) + (ord(lofiuzmq[(ypoqlktz << 2) + 2]) << 8) + (ord(lofiuzmq[(ypoqlktz << 2) + 1]) << 16) + (ord(lofiuzmq[(ypoqlktz << 2)]) << 24)) + return lopkisdq + + def yoliukev(self, kaiumylq): + self.oqlaoymh = self.iatwbfrd + self.oqmykrna = self.ybghjtik + self.pqmyzkid = self.thdlpsmy + self.pldmjnde = self.plkodnyq + + yaqpolft = [0 for i in range(len(kaiumylq))] + + yaqwsedr = 0 + btzqwsay = 0 + while yaqwsedr < len(kaiumylq): + wlqoakmy = 0 + for lopiuztr in range(0, 4): + wlqoakmy = wlqoakmy << 8 | ord(kaiumylq[yaqwsedr % len(kaiumylq)]) + yaqwsedr += 1 + yaqpolft[btzqwsay] = wlqoakmy + btzqwsay += 1 + self.ldiwkqly = [] + for btzqwsay in range(0, 18): + self.ldiwkqly.append(self.olkemfjq[btzqwsay]) + yalopiuq = [0, 0] + for btzqwsay in range(0, 18, 2): + yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) + self.ldiwkqly[btzqwsay] = yalopiuq[0] + self.ldiwkqly[btzqwsay + 1] = yalopiuq[1] + for btzqwsay in range(0, 256, 2): + yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) + self.oqlaoymh[btzqwsay] = yalopiuq[0] + self.oqlaoymh[btzqwsay + 1] = yalopiuq[1] + for btzqwsay in range(0, 256, 2): + yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) + self.oqmykrna[btzqwsay] = yalopiuq[0] + self.oqmykrna[btzqwsay + 1] = yalopiuq[1] + for btzqwsay in range(0, 256, 2): + yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) + self.pqmyzkid[btzqwsay] = yalopiuq[0] + self.pqmyzkid[btzqwsay + 1] = yalopiuq[1] + for btzqwsay in range(0, 256, 2): + yalopiuq = self.qmyjuila(yalopiuq[0], yalopiuq[1]) + self.pldmjnde[btzqwsay] = yalopiuq[0] + self.pldmjnde[btzqwsay + 1] = yalopiuq[1] + diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 2f77b81ae..15bee52ac 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -6,8 +6,6 @@ from time import sleep from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup -from module.download_thread import CaptchaError - from htmlentitydefs import name2codepoint as n2cp def substitute_entity(match): ent = match.group(2) @@ -87,20 +85,6 @@ class SerienjunkiesOrg(Plugin): def file_exists(self): return True - def waitForCaptcha(self, captchaData, imgType): - captchaManager = self.parent.core.captchaManager - task = captchaManager.newTask(self) - task.setCaptcha(captchaData, imgType) - task.setWaiting() - while not task.getStatus() == "done": - if not self.parent.core.isGUIConnected(): - task.removeTask() - raise CaptchaError - sleep(1) - result = task.getResult() - task.removeTask() - return result - def handleSeason(self, url): src = self.getSJSrc(url) soup = BeautifulSoup(src) -- cgit v1.2.3 From e9dc8ea08452c1555e28f4ac1970b96315ec4376 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 3 Jan 2010 21:12:02 +0100 Subject: Cleaned Reconnect XML Config --- module/config/core_default.xml | 10 +++++----- module/plugins/__init__.py | 1 + module/plugins/hoster/NetloadIn.py | 3 --- module/thread_list.py | 10 +++++----- 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 4c95d5386..035b676f0 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -31,10 +31,8 @@ <language type="str" input="en;de;fr" name="Language">de</language> <download_folder type="str" name="Download Folder">Downloads</download_folder> <max_downloads type="int" name="Max Parallel Downloads">3</max_downloads> - <use_reconnect type="bool" name="Use Reconnect">False</use_reconnect> <link_file type="str" name="File For Links">links.txt</link_file> <failed_file type="str" name="File For Failed Links">failed_links.txt</failed_file> - <reconnect_method type="str" name="Reconnect Method">None</reconnect_method> <debug_mode type="bool" name="Debug Mode">False</debug_mode> <max_download_time type="int" name="Max Download Time">5</max_download_time> <download_speed_limit type="int" name="Download Speed Limit">0</download_speed_limit> @@ -44,9 +42,11 @@ <search_updates type="bool" name="Search">True</search_updates> <install_updates type="bool" name="Install">False</install_updates> </updates> - <reconnectTime name="Reconnect Time"> - <start type="time" name="Start">0:00</start> - <end type="time" name="End">0:00</end> + <reconnect name="Reconnect"> + <activated type="bool" name="Use Reconnect">False</activated> + <method type="str" name="Method">None</method> + <startTime type="time" name="Start">0:00</startTime> + <endTime type="time" name="End">0:00</endTime> </reconnectTime> <downloadTime name="Download Time"> <start type="time" name="Start">0:00</start> diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py index e69de29bb..8b1378917 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -0,0 +1 @@ + diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 1f7e7d011..0e5245e9e 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -40,7 +40,6 @@ class NetloadIn(Plugin): self.req.clear_cookies() self.want_reconnect = False - self.download_api_data() if self.file_exists(): pyfile.status.filename = self.get_file_name() @@ -49,7 +48,6 @@ class NetloadIn(Plugin): self.req.load("http://netload.in/index.php", None, { "txtuser" : self.config['username'], "txtpass" : self.config['password'], "txtcheck" : "login", "txtlogin" : ""}, cookies=True) self.logger.info("Netload: Use Premium Account") pyfile.status.url = self.parent.url - #@TODO: premium?? return True self.download_html() @@ -73,7 +71,6 @@ class NetloadIn(Plugin): src = self.req.load(apiurl, cookies=False, get={"file_id": match.group(1)}) self.api_data = {} if not src == "unknown file_data": - print "apidata:", src lines = src.split(";") self.api_data["exists"] = True self.api_data["fileid"] = lines[0] diff --git a/module/thread_list.py b/module/thread_list.py index d3eb4d203..5d0bcf53a 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -160,12 +160,12 @@ class Thread_List(object): def init_reconnect(self): """initialise a reonnect""" - if not self.parent.config['general']['use_reconnect'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): + if not self.parent.config['reconnect']['activated'] or self.reconnecting or not self.parent.server_methods.is_time_reconnect(): return False - if not exists(self.parent.config['general']['reconnect_method']): - self.parent.logger.info(self.parent.config['general']['reconnect_method'] + " not found") - self.parent.config['general']['use_reconnect'] = False + if not exists(self.parent.config['reconnect']['method']): + self.parent.logger.info(self.parent.config['reconnect']['method'] + " not found") + self.parent.config['reconnect']['activated'] = False return False self.lock.acquire() @@ -200,7 +200,7 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") - reconn = subprocess.Popen(self.parent.config['general']['reconnect_method'])#, stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" -- cgit v1.2.3 From 0ad60190af0ddad290120a491644e1882b12ff1a Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 3 Jan 2010 21:30:36 +0100 Subject: Fixed XML File --- module/config/core_default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 035b676f0..8e149a442 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -47,7 +47,7 @@ <method type="str" name="Method">None</method> <startTime type="time" name="Start">0:00</startTime> <endTime type="time" name="End">0:00</endTime> - </reconnectTime> + </reconnect> <downloadTime name="Download Time"> <start type="time" name="Start">0:00</start> <end type="time" name="End">0:00</end> -- cgit v1.2.3 From c58c228bbec2e59d3c208f85c0a9e7d205dfe050 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 3 Jan 2010 22:12:21 +0100 Subject: Better Uploaded Pattern --- module/config/plugin_default.xml | 9 --------- module/plugins/hoster/UploadedTo.py | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) (limited to 'module') diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 76a873048..1ad653251 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -1,14 +1,5 @@ <config> <RapidshareCom> - <!-- possible: - Cogent, Deutsche Telekom, - Level(3), Level(3) #2, - GlobalCrossing, Level(3) #3, - Teleglobe, GlobalCrossing #2, - TeliaSonera #2, Teleglobe #2, - TeliaSonera #3, TeliaSonera - --> - <!-- leave empty for autmomatic selection --> <server input=";Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera"></server> <premium>False</premium> <username></username> diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index 6079003bf..df7d577f9 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -13,7 +13,7 @@ class UploadedTo(Plugin): props = {} props['name'] = "UploadedTo" props['type'] = "hoster" - props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/)?(.*)" + props['pattern'] = r"http://(?:www\.)?u(?:p)?l(?:oaded)?\.to/(?:file/|\?id=)?(.+)" props['version'] = "0.3" props['description'] = """Uploaded.to Download Plugin""" props['author_name'] = ("spoob", "mkaay") -- cgit v1.2.3 From 013d1c2f9831bb53e74cbec31e3a752996b3f0b9 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 4 Jan 2010 17:54:56 +0100 Subject: fixed webserver --- module/web/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/web/settings.py b/module/web/settings.py index 13452b4d0..5a948ef55 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -18,7 +18,7 @@ PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") sys.path.append(os.path.join(PYLOAD_DIR, "module")) from XMLConfigParser import XMLConfigParser -config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml")) +config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml"), os.path.join(PYLOAD_DIR,"module","config","core_default.xml")) #DEBUG = config.get("general","debug") -- cgit v1.2.3 From 89acc0ff595f73956572c8892ccb860c06fba33a Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Mon, 4 Jan 2010 20:35:26 +0100 Subject: added hook system --- module/HookManager.py | 73 +++++++++++++++++++++++++++++++ module/plugins/hooks/ContainerDownload.py | 42 ++++++++++++++++++ module/plugins/hooks/Hook.py | 51 +++++++++++++++++++++ module/plugins/hooks/__init__.py | 1 + module/thread_list.py | 23 +++------- 5 files changed, 172 insertions(+), 18 deletions(-) create mode 100644 module/HookManager.py create mode 100644 module/plugins/hooks/ContainerDownload.py create mode 100644 module/plugins/hooks/Hook.py create mode 100644 module/plugins/hooks/__init__.py (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py new file mode 100644 index 000000000..a0caae728 --- /dev/null +++ b/module/HookManager.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" +import logging + +from os.path import basename, join +from glob import glob + +from threading import Lock + +class HookManager(): + def __init__(self, core): + self.core = core + self.logger = logging.getLogger("log") + self.plugins = [] + self.lock = Lock() + self.createIndex() + + def createIndex(self): + self.lock.acquire() + pluginFiles = glob(join(self.core.plugin_folder, "hooks", "*.py")) + plugins = [] + for pluginFile in pluginFiles: + pluginName = basename(pluginFile).replace(".py", "") + if pluginName == "Hook" or pluginName == "__init__": + continue + module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) + pluginClass = getattr(module, pluginName) + plugins.append(pluginClass(self.core)) + + self.logger.info("Installed Hook: %s" % pluginName) + self.plugins = plugins + self.lock.release() + + def downloadStarts(self, pyfile): + self.lock.acquire() + for plugin in self.plugins: + plugin.downloadStarts(pyfile) + self.lock.release() + + def downloadFinished(self, pyfile): + self.lock.acquire() + for plugin in self.plugins: + plugin.downloadFinished(pyfile) + self.lock.release() + + def beforeReconnecting(self, ip): + self.lock.acquire() + for plugin in self.plugins: + plugin.beforeReconnecting(ip) + self.lock.release() + + def afterReconnecting(self, ip): + self.lock.acquire() + for plugin in self.plugins: + plugin.afterReconnecting(ip) + self.lock.release() diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py new file mode 100644 index 000000000..d031cdf69 --- /dev/null +++ b/module/plugins/hooks/ContainerDownload.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" + +from module.plugins.hooks.Hook import Hook + +from os.path import join, abspath + +class ContainerDownload(Hook): + def __init__(self, core): + Hook.__init__(self, core) + props = {} + props['name'] = "ContainerDownload" + props['version'] = "0.1" + props['description'] = """add the downloaded container to current package""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + + def downloadFinished(self, pyfile): + filename = pyfile.status.filename + if filename.endswith(".dlc") or filename.endswith(".ccf") or filename.endswith(".rsdf"): + self.logger.info("ContainerDownload hook: adding container file") + location = abspath(join(pyfile.folder, filename)) + newFile = self.core.file_list.collector.addLink(location) + self.core.file_list.packager.addFileToPackage(pyfile.package.data["id"], self.core.file_list.collector.popFile(newFile)) diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py new file mode 100644 index 000000000..f02432718 --- /dev/null +++ b/module/plugins/hooks/Hook.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" + +import logging + +class Hook(): + def __init__(self, core): + self.logger = logging.getLogger("log") + props = {} + props['name'] = "Hook" + props['version'] = "0.1" + props['description'] = """interface for hook""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.core = core + + def downloadStarts(self, pyfile): + pass + + def downloadFinished(self, pyfile): + pass + + def packageFinished(self, pypack): + """ + not implemented! + """ + pass + + def beforeReconnecting(self, ip): + pass + + def afterReconnecting(self, ip): + pass diff --git a/module/plugins/hooks/__init__.py b/module/plugins/hooks/__init__.py new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/module/plugins/hooks/__init__.py @@ -0,0 +1 @@ + diff --git a/module/thread_list.py b/module/thread_list.py index 5d0bcf53a..55b21093f 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -76,7 +76,7 @@ class Thread_List(object): if pyfile: self.py_downloading.append(pyfile) - self.scripts_download_preparing(pyfile.modul.__name__, pyfile.url) + self.parent.hookManager.downloadStarts(pyfile) if not pyfile.plugin.multi_dl: self.occ_plugins.append(pyfile.modul.__name__) pyfile.active = True @@ -153,7 +153,7 @@ class Thread_List(object): self.list.save() - self.scripts_download_finished(pyfile.modul.__name__, pyfile.url, pyfile.status.filename, pyfile.folder) + self.parent.hookManager.downloadFinished(pyfile) self.lock.release() return True @@ -200,6 +200,8 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") + ip = re.match(".*Current IP Address: (.*)</body>.*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) + self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) @@ -210,23 +212,8 @@ class Thread_List(object): except: ip = "" time.sleep(1) - self.scripts_reconnected(ip) + self.parent.hookManager.afterReconnecting(ip) self.parent.logger.info("Reconnected, new IP: " + ip) - - - def scripts_download_preparing(self, pluginname, url): - for script in self.parent.scripts['download_preparing']: - out = subprocess.Popen([script, pluginname, url], stdout=subprocess.PIPE) - out.wait() - - def scripts_download_finished(self, pluginname, url, filename, location): - map(lambda script: subprocess.Popen([script, pluginname, url, filename, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) - - def scripts_package_finished(self, name, location): #@TODO Implement! - map(lambda script: subprocess.Popen([script, name, location], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) - - def scripts_reconnected(self, ip): - map(lambda script: subprocess.Popen([script, ip], stdout=subprocess.PIPE), self.parent.scripts['download_finished']) def stopAllDownloads(self): for pyfile in self.py_downloading: -- cgit v1.2.3 From 8e9353a2e42a2e98d93618af1b6435568c44fa0f Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 5 Jan 2010 23:18:53 +0100 Subject: fixed rapidshare slot wait --- module/plugins/__init__.py | 1 - module/plugins/hoster/BluehostTo.py | 71 ---------------------------------- module/plugins/hoster/RapidshareCom.py | 2 +- 3 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 module/plugins/hoster/BluehostTo.py (limited to 'module') diff --git a/module/plugins/__init__.py b/module/plugins/__init__.py index 8b1378917..e69de29bb 100644 --- a/module/plugins/__init__.py +++ b/module/plugins/__init__.py @@ -1 +0,0 @@ - diff --git a/module/plugins/hoster/BluehostTo.py b/module/plugins/hoster/BluehostTo.py deleted file mode 100644 index eff8ebcd8..000000000 --- a/module/plugins/hoster/BluehostTo.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import re -import time - -from module.Plugin import Plugin - -class BluehostTo(Plugin): - - def __init__(self, parent): - Plugin.__init__(self, parent) - props = {} - props['name'] = "BluehostTo" - props['type'] = "hoster" - props['pattern'] = r"http://(?:www.)?bluehost.to/file/" - props['version'] = "0.1" - props['description'] = """Bluehost Download PLugin""" - props['author_name'] = ("RaNaN") - props['author_mail'] = ("RaNaN@pyload.org") - self.props = props - self.parent = parent - self.html = None - self.multi_dl = False - - def download_html(self): - url = self.parent.url - self.html = self.req.load(url) - time.sleep(1.5) - self.html = self.req.load(url, cookies=True) - - def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - - inputs = re.findall(r"(<(input|form)[^>]+)", self.html) - for i in inputs: - if re.search(r"name=\"BluehostVers2dl\"",i[0]): - self.BluehostVers2dl = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"PHPSESSID\"",i[0]): - self.PHPSESSID = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"DownloadV2Hash\"",i[0]): - self.DownloadV2Hash = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"access\"",i[0]): - self.access = re.search(r"value=\"([^\"]+)", i[0]).group(1) - elif re.search(r"name=\"download\"",i[0]): - url = re.search(r"action=\"([^\"]+)", i[0]).group(1) - - return url - - def get_file_name(self): - if self.html == None: - self.download_html() - file_name_pattern = r"<center><b>.+: (.+)<\/b><\/center>" - return re.search(file_name_pattern, self.html).group(1) - - def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - - if re.search(r"html", self.html) == None: - return False - else: - return True - - def proceed(self, url, location): - self.req.download(url, location, {'BluehostVers2dl': self.BluehostVers2dl, 'DownloadV2Hash': self.DownloadV2Hash, 'PHPSESSID': self.PHPSESSID, 'access': self.access}) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 754c885ef..677916dcf 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -143,7 +143,7 @@ class RapidshareCom(Plugin): self.time_plus_wait = time() + 60 * int(wait_minutes) self.want_reconnect = True except: - if re.search(r"(Currently a lot of users|There are no more download slots)", self.html[1], re.I) != None: + if re.search(r"(currently a lot of users|no more download slots)", self.html[1], re.I) != None: self.time_plus_wait = time() + 130 self.logger.info("Rapidshare: No free slots!") self.no_slots = True -- cgit v1.2.3 From 5bd5ffbaf7de6436f8648591b9430dad1e3c1eef Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 6 Jan 2010 14:22:31 +0100 Subject: default Dir in module/web/media/ --- module/config/core_default.xml | 2 +- module/web/media/css/default.css | 1485 -------------------- module/web/media/css/jquery-ui-1.7.2.custom.css | 406 ------ module/web/media/css/window.css | 17 - module/web/media/default/css/default.css | 1485 ++++++++++++++++++++ .../media/default/css/jquery-ui-1.7.2.custom.css | 406 ++++++ module/web/media/default/css/window.css | 17 + module/web/media/default/img/Button-Add-grey.png | Bin 0 -> 2112 bytes module/web/media/default/img/Button-Add.png | Bin 0 -> 2110 bytes module/web/media/default/img/Button-Pause-grey.png | Bin 0 -> 1932 bytes module/web/media/default/img/Button-Pause.png | Bin 0 -> 2146 bytes module/web/media/default/img/Button-Play-grey.png | Bin 0 -> 1938 bytes module/web/media/default/img/Button-Play.png | Bin 0 -> 2023 bytes module/web/media/default/img/big_button.gif | Bin 0 -> 1905 bytes module/web/media/default/img/big_button_over.gif | Bin 0 -> 728 bytes module/web/media/default/img/body.png | Bin 0 -> 402 bytes module/web/media/default/img/closebtn.gif | Bin 0 -> 254 bytes module/web/media/default/img/cog.png | Bin 0 -> 512 bytes module/web/media/default/img/control_cancel.png | Bin 0 -> 3349 bytes .../web/media/default/img/control_cancel_blue.png | Bin 0 -> 787 bytes module/web/media/default/img/control_pause.png | Bin 0 -> 598 bytes .../web/media/default/img/control_pause_blue.png | Bin 0 -> 721 bytes module/web/media/default/img/control_play.png | Bin 0 -> 592 bytes module/web/media/default/img/control_play_blue.png | Bin 0 -> 717 bytes module/web/media/default/img/control_stop.png | Bin 0 -> 403 bytes module/web/media/default/img/control_stop_blue.png | Bin 0 -> 695 bytes module/web/media/default/img/drag_corner.gif | Bin 0 -> 76 bytes module/web/media/default/img/full.png | Bin 0 -> 3543 bytes module/web/media/default/img/head-login.png | Bin 0 -> 1288 bytes .../media/default/img/head-menu-development.png | Bin 0 -> 1324 bytes .../web/media/default/img/head-menu-download.png | Bin 0 -> 721 bytes module/web/media/default/img/head-menu-home.png | Bin 0 -> 920 bytes module/web/media/default/img/head-menu-index.png | Bin 0 -> 482 bytes module/web/media/default/img/head-menu-news.png | Bin 0 -> 628 bytes module/web/media/default/img/head-menu-recent.png | Bin 0 -> 932 bytes module/web/media/default/img/head-menu-wiki.png | Bin 0 -> 1204 bytes .../web/media/default/img/head-search-noshadow.png | Bin 0 -> 1187 bytes module/web/media/default/img/head_bg1.png | Bin 0 -> 125 bytes .../web/media/default/img/page-tools-backlinks.png | Bin 0 -> 540 bytes module/web/media/default/img/page-tools-edit.png | Bin 0 -> 574 bytes .../web/media/default/img/page-tools-revisions.png | Bin 0 -> 603 bytes module/web/media/default/img/progress-bar-back.gif | Bin 0 -> 10819 bytes module/web/media/default/img/progress-bar.gif | Bin 0 -> 10819 bytes module/web/media/default/img/progressbar.gif | Bin 0 -> 120 bytes module/web/media/default/img/progressbg_black.gif | Bin 0 -> 1626 bytes module/web/media/default/img/progressbg_green.gif | Bin 0 -> 1308 bytes module/web/media/default/img/progressbg_orange.gif | Bin 0 -> 1308 bytes module/web/media/default/img/progressbg_red.gif | Bin 0 -> 1308 bytes module/web/media/default/img/progressbg_yellow.gif | Bin 0 -> 1308 bytes .../img/pyload-logo-edited3.5-new-font-small.png | Bin 0 -> 8457 bytes module/web/media/default/img/tab-background.png | Bin 0 -> 179 bytes .../web/media/default/img/tabs-border-bottom.png | Bin 0 -> 163 bytes .../web/media/default/img/user-actions-logout.png | Bin 0 -> 799 bytes .../web/media/default/img/user-actions-profile.png | Bin 0 -> 628 bytes module/web/media/default/js/funktions.js | 16 + module/web/media/default/js/home.js | 205 +++ module/web/media/default/js/jquery-1.3.2.min.js | 19 + .../media/default/js/jquery-ui-1.7.2.custom.min.js | 298 ++++ module/web/media/default/js/jquery.progressbar.js | 183 +++ module/web/media/default/js/jquery.timers-1.2.js | 138 ++ module/web/media/default/js/mootools-1.2.3-core.js | 335 +++++ .../web/media/default/js/mootools-1.2.3.1-more.js | 76 + module/web/media/default/js/sprintf.js | 123 ++ module/web/media/default/js/status.js | 100 ++ module/web/media/img/Button-Add-grey.png | Bin 2112 -> 0 bytes module/web/media/img/Button-Add.png | Bin 2110 -> 0 bytes module/web/media/img/Button-Pause-grey.png | Bin 1932 -> 0 bytes module/web/media/img/Button-Pause.png | Bin 2146 -> 0 bytes module/web/media/img/Button-Play-grey.png | Bin 1938 -> 0 bytes module/web/media/img/Button-Play.png | Bin 2023 -> 0 bytes module/web/media/img/big_button.gif | Bin 1905 -> 0 bytes module/web/media/img/big_button_over.gif | Bin 728 -> 0 bytes module/web/media/img/body.png | Bin 402 -> 0 bytes module/web/media/img/closebtn.gif | Bin 254 -> 0 bytes module/web/media/img/cog.png | Bin 512 -> 0 bytes module/web/media/img/control_cancel.png | Bin 3349 -> 0 bytes module/web/media/img/control_cancel_blue.png | Bin 787 -> 0 bytes module/web/media/img/control_pause.png | Bin 598 -> 0 bytes module/web/media/img/control_pause_blue.png | Bin 721 -> 0 bytes module/web/media/img/control_play.png | Bin 592 -> 0 bytes module/web/media/img/control_play_blue.png | Bin 717 -> 0 bytes module/web/media/img/control_stop.png | Bin 403 -> 0 bytes module/web/media/img/control_stop_blue.png | Bin 695 -> 0 bytes module/web/media/img/drag_corner.gif | Bin 76 -> 0 bytes module/web/media/img/full.png | Bin 3543 -> 0 bytes module/web/media/img/head-login.png | Bin 1288 -> 0 bytes module/web/media/img/head-menu-development.png | Bin 1324 -> 0 bytes module/web/media/img/head-menu-download.png | Bin 721 -> 0 bytes module/web/media/img/head-menu-home.png | Bin 920 -> 0 bytes module/web/media/img/head-menu-index.png | Bin 482 -> 0 bytes module/web/media/img/head-menu-news.png | Bin 628 -> 0 bytes module/web/media/img/head-menu-recent.png | Bin 932 -> 0 bytes module/web/media/img/head-menu-wiki.png | Bin 1204 -> 0 bytes module/web/media/img/head-search-noshadow.png | Bin 1187 -> 0 bytes module/web/media/img/head_bg1.png | Bin 125 -> 0 bytes module/web/media/img/page-tools-backlinks.png | Bin 540 -> 0 bytes module/web/media/img/page-tools-edit.png | Bin 574 -> 0 bytes module/web/media/img/page-tools-revisions.png | Bin 603 -> 0 bytes module/web/media/img/progress-bar-back.gif | Bin 10819 -> 0 bytes module/web/media/img/progress-bar.gif | Bin 10819 -> 0 bytes module/web/media/img/progressbar.gif | Bin 120 -> 0 bytes module/web/media/img/progressbg_black.gif | Bin 1626 -> 0 bytes module/web/media/img/progressbg_green.gif | Bin 1308 -> 0 bytes module/web/media/img/progressbg_orange.gif | Bin 1308 -> 0 bytes module/web/media/img/progressbg_red.gif | Bin 1308 -> 0 bytes module/web/media/img/progressbg_yellow.gif | Bin 1308 -> 0 bytes .../img/pyload-logo-edited3.5-new-font-small.png | Bin 8457 -> 0 bytes module/web/media/img/tab-background.png | Bin 179 -> 0 bytes module/web/media/img/tabs-border-bottom.png | Bin 163 -> 0 bytes module/web/media/img/user-actions-logout.png | Bin 799 -> 0 bytes module/web/media/img/user-actions-profile.png | Bin 628 -> 0 bytes module/web/media/js/funktions.js | 16 - module/web/media/js/home.js | 205 --- module/web/media/js/jquery-1.3.2.min.js | 19 - module/web/media/js/jquery-ui-1.7.2.custom.min.js | 298 ---- module/web/media/js/jquery.progressbar.js | 183 --- module/web/media/js/jquery.timers-1.2.js | 138 -- module/web/media/js/mootools-1.2.3-core.js | 335 ----- module/web/media/js/mootools-1.2.3.1-more.js | 76 - module/web/media/js/sprintf.js | 123 -- module/web/media/js/status.js | 100 -- module/web/templates/default/home.html | 6 +- 122 files changed, 3405 insertions(+), 3405 deletions(-) delete mode 100644 module/web/media/css/default.css delete mode 100644 module/web/media/css/jquery-ui-1.7.2.custom.css delete mode 100644 module/web/media/css/window.css create mode 100644 module/web/media/default/css/default.css create mode 100644 module/web/media/default/css/jquery-ui-1.7.2.custom.css create mode 100644 module/web/media/default/css/window.css create mode 100644 module/web/media/default/img/Button-Add-grey.png create mode 100644 module/web/media/default/img/Button-Add.png create mode 100644 module/web/media/default/img/Button-Pause-grey.png create mode 100644 module/web/media/default/img/Button-Pause.png create mode 100644 module/web/media/default/img/Button-Play-grey.png create mode 100644 module/web/media/default/img/Button-Play.png create mode 100644 module/web/media/default/img/big_button.gif create mode 100644 module/web/media/default/img/big_button_over.gif create mode 100644 module/web/media/default/img/body.png create mode 100644 module/web/media/default/img/closebtn.gif create mode 100644 module/web/media/default/img/cog.png create mode 100644 module/web/media/default/img/control_cancel.png create mode 100644 module/web/media/default/img/control_cancel_blue.png create mode 100644 module/web/media/default/img/control_pause.png create mode 100644 module/web/media/default/img/control_pause_blue.png create mode 100644 module/web/media/default/img/control_play.png create mode 100644 module/web/media/default/img/control_play_blue.png create mode 100644 module/web/media/default/img/control_stop.png create mode 100644 module/web/media/default/img/control_stop_blue.png create mode 100644 module/web/media/default/img/drag_corner.gif create mode 100644 module/web/media/default/img/full.png create mode 100644 module/web/media/default/img/head-login.png create mode 100644 module/web/media/default/img/head-menu-development.png create mode 100644 module/web/media/default/img/head-menu-download.png create mode 100644 module/web/media/default/img/head-menu-home.png create mode 100644 module/web/media/default/img/head-menu-index.png create mode 100644 module/web/media/default/img/head-menu-news.png create mode 100644 module/web/media/default/img/head-menu-recent.png create mode 100644 module/web/media/default/img/head-menu-wiki.png create mode 100644 module/web/media/default/img/head-search-noshadow.png create mode 100644 module/web/media/default/img/head_bg1.png create mode 100644 module/web/media/default/img/page-tools-backlinks.png create mode 100644 module/web/media/default/img/page-tools-edit.png create mode 100644 module/web/media/default/img/page-tools-revisions.png create mode 100644 module/web/media/default/img/progress-bar-back.gif create mode 100644 module/web/media/default/img/progress-bar.gif create mode 100644 module/web/media/default/img/progressbar.gif create mode 100644 module/web/media/default/img/progressbg_black.gif create mode 100644 module/web/media/default/img/progressbg_green.gif create mode 100644 module/web/media/default/img/progressbg_orange.gif create mode 100644 module/web/media/default/img/progressbg_red.gif create mode 100644 module/web/media/default/img/progressbg_yellow.gif create mode 100644 module/web/media/default/img/pyload-logo-edited3.5-new-font-small.png create mode 100644 module/web/media/default/img/tab-background.png create mode 100644 module/web/media/default/img/tabs-border-bottom.png create mode 100644 module/web/media/default/img/user-actions-logout.png create mode 100644 module/web/media/default/img/user-actions-profile.png create mode 100644 module/web/media/default/js/funktions.js create mode 100644 module/web/media/default/js/home.js create mode 100644 module/web/media/default/js/jquery-1.3.2.min.js create mode 100644 module/web/media/default/js/jquery-ui-1.7.2.custom.min.js create mode 100644 module/web/media/default/js/jquery.progressbar.js create mode 100644 module/web/media/default/js/jquery.timers-1.2.js create mode 100644 module/web/media/default/js/mootools-1.2.3-core.js create mode 100644 module/web/media/default/js/mootools-1.2.3.1-more.js create mode 100644 module/web/media/default/js/sprintf.js create mode 100644 module/web/media/default/js/status.js delete mode 100644 module/web/media/img/Button-Add-grey.png delete mode 100644 module/web/media/img/Button-Add.png delete mode 100644 module/web/media/img/Button-Pause-grey.png delete mode 100644 module/web/media/img/Button-Pause.png delete mode 100644 module/web/media/img/Button-Play-grey.png delete mode 100644 module/web/media/img/Button-Play.png delete mode 100644 module/web/media/img/big_button.gif delete mode 100644 module/web/media/img/big_button_over.gif delete mode 100644 module/web/media/img/body.png delete mode 100644 module/web/media/img/closebtn.gif delete mode 100644 module/web/media/img/cog.png delete mode 100644 module/web/media/img/control_cancel.png delete mode 100644 module/web/media/img/control_cancel_blue.png delete mode 100644 module/web/media/img/control_pause.png delete mode 100644 module/web/media/img/control_pause_blue.png delete mode 100644 module/web/media/img/control_play.png delete mode 100644 module/web/media/img/control_play_blue.png delete mode 100644 module/web/media/img/control_stop.png delete mode 100644 module/web/media/img/control_stop_blue.png delete mode 100644 module/web/media/img/drag_corner.gif delete mode 100644 module/web/media/img/full.png delete mode 100644 module/web/media/img/head-login.png delete mode 100644 module/web/media/img/head-menu-development.png delete mode 100644 module/web/media/img/head-menu-download.png delete mode 100644 module/web/media/img/head-menu-home.png delete mode 100644 module/web/media/img/head-menu-index.png delete mode 100644 module/web/media/img/head-menu-news.png delete mode 100644 module/web/media/img/head-menu-recent.png delete mode 100644 module/web/media/img/head-menu-wiki.png delete mode 100644 module/web/media/img/head-search-noshadow.png delete mode 100644 module/web/media/img/head_bg1.png delete mode 100644 module/web/media/img/page-tools-backlinks.png delete mode 100644 module/web/media/img/page-tools-edit.png delete mode 100644 module/web/media/img/page-tools-revisions.png delete mode 100644 module/web/media/img/progress-bar-back.gif delete mode 100644 module/web/media/img/progress-bar.gif delete mode 100644 module/web/media/img/progressbar.gif delete mode 100644 module/web/media/img/progressbg_black.gif delete mode 100644 module/web/media/img/progressbg_green.gif delete mode 100644 module/web/media/img/progressbg_orange.gif delete mode 100644 module/web/media/img/progressbg_red.gif delete mode 100644 module/web/media/img/progressbg_yellow.gif delete mode 100644 module/web/media/img/pyload-logo-edited3.5-new-font-small.png delete mode 100644 module/web/media/img/tab-background.png delete mode 100644 module/web/media/img/tabs-border-bottom.png delete mode 100644 module/web/media/img/user-actions-logout.png delete mode 100644 module/web/media/img/user-actions-profile.png delete mode 100644 module/web/media/js/funktions.js delete mode 100644 module/web/media/js/home.js delete mode 100644 module/web/media/js/jquery-1.3.2.min.js delete mode 100644 module/web/media/js/jquery-ui-1.7.2.custom.min.js delete mode 100644 module/web/media/js/jquery.progressbar.js delete mode 100644 module/web/media/js/jquery.timers-1.2.js delete mode 100644 module/web/media/js/mootools-1.2.3-core.js delete mode 100644 module/web/media/js/mootools-1.2.3.1-more.js delete mode 100644 module/web/media/js/sprintf.js delete mode 100644 module/web/media/js/status.js (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 8e149a442..366197a61 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -13,7 +13,7 @@ <webinterface name="Webinterface"> <activated type="bool" name="Activated">True</activated> <host type="ip" name="IP">0.0.0.0</host> - <port type="int" name="Port">8000</port> + <port type="int" name="Port">8001</port> <template type="str" name="Template">default</template> <local type="bool" name="Local">True</local> <ssl type="bool" name="SSL">False</ssl> diff --git a/module/web/media/css/default.css b/module/web/media/css/default.css deleted file mode 100644 index 0d8e0428f..000000000 --- a/module/web/media/css/default.css +++ /dev/null @@ -1,1485 +0,0 @@ -div.no { - display:inline; - margin:0; - padding:0; -} -.hidden { - display:none; -} -div.error { - background:#fcc url(media/img/error.png) 0.5em 0px no-repeat; - color:#000; - border-bottom:1px solid #faa; - font-size:90%; - margin:0; - padding-left:3em; - overflow:hidden; -} -div.info { - background:#ccf url(static/default/info.png) 0.5em 0px no-repeat; - color:#000; - border-bottom:1px solid #aaf; - font-size:90%; - margin:0; - padding-left:3em; - overflow:hidden; -} -div.success { - background:#cfc url(static/default/success.png) 0.5em 0px no-repeat; - color:#000; - border-bottom:1px solid #afa; - font-size:90%; - margin:0; - padding-left:3em; - overflow:hidden; -} -div.notify { - background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat; - color:#000; - border-bottom:1px solid #ffa; - font-size:90%; - margin:0; - padding-left:3em; - overflow:hidden; -} -.medialeft { - float:left; -} -.mediaright { - float:right; -} -.mediacenter { - display:block; - margin-left:auto; - margin-right:auto; -} -.leftalign { - text-align:left; -} -.centeralign { - text-align:center; -} -.rightalign { - text-align:right; -} -em.u { - font-style:normal; - text-decoration:underline; -} -em em.u { - font-style:italic; -} -.code .br0 { - color:#6c6; -} -.code .co1 { - color:#808080; - font-style:italic; -} -.code .co2 { - color:#808080; - font-style:italic; -} -.code .co3 { - color:#808080; -} -.code .coMULTI { - color:#808080; - font-style:italic; -} -.code .es0 { - color:#009; - font-weight:bold; -} -.code .kw1 { - color:#b1b100; -} -.code .kw2 { - color:#000; - font-weight:bold; -} -.code .kw3 { - color:#006; -} -.code .kw4 { - color:#933; -} -.code .kw5 { - color:#00f; -} -.code .me1 { - color:#060; -} -.code .me2 { - color:#060; -} -.code .nu0 { - color:#c6c; -} -.code .re0 { - color:#00f; -} -.code .re1 { - color:#00f; -} -.code .re2 { - color:#00f; -} -.code .re3 { - color:#f33; - font-weight:bold; -} -.code .re4 { - color:#099; -} -.code .st0 { - color:#f00; -} -.code .sy0 { - color:#6c6; -} -div.dokuwiki table.pagelist, div.dokuwiki table.ul { - border:0; - padding:0; - border-spacing:0; - margin-bottom:1em; - border-collapse:collapse; -} -div.dokuwiki table.pagelist tr { - border-top:1px solid #8cacbb; - border-bottom:1px solid #8cacbb; -} -div.dokuwiki table.pagelist th, div.dokuwiki table.pagelist td { - padding:1px 1em 1px 0; -} -div.dokuwiki table.ul th, div.dokuwiki table.ul td { - padding:0 1em 0 0; -} -div.dokuwiki table.ul ul { - margin:0 0 0 1.5em; -} -div.dokuwiki table.pagelist th, div.dokuwiki table.ul th { - background-color:#dee7ec; -} -div.dokuwiki th.page, div.dokuwiki th.date, div.dokuwiki th.user, div.dokuwiki th.desc, div.dokuwiki th.comments, div.dokuwiki th.linkbacks, div.dokuwiki th.tags, div.dokuwiki td.date, div.dokuwiki td.user, div.dokuwiki td.desc, div.dokuwiki td.comments, div.dokuwiki td.linkbacks, div.dokuwiki td.tags { - color:#666; - font-size:80%; -} -div.dokuwiki td.date { - text-align:right; -} -div.dokuwiki div.include div.secedit { - float:right; - margin-left:1em; - margin-top:-18px; -} -div.dokuwiki div.inclmeta { - border-top:1px dotted #8cacbb; - padding-top:0.2em; - color:#666; - font-size:80%; - line-height:1.25; - margin-top:0.5em; - margin-bottom:2em; -} -div.dokuwiki div.inclmeta a.permalink { - background:transparent url(media/img/link.gif) 0px 1px no-repeat; - padding:1px 0px 1px 16px; -} -div.dokuwiki div.inclmeta abbr.published { - background:transparent url(media/img/date.gif) 0px 1px no-repeat; - padding:1px 0px 1px 16px; - border-bottom:0; -} -div.dokuwiki div.inclmeta span.author { - background:transparent url(media/img/user.gif) 0px 1px no-repeat; - padding:1px 0px 1px 16px; -} -div.dokuwiki div.inclmeta span.comment { - background:transparent url(media/img/comment.gif) 0px 1px no-repeat; - padding:1px 0px 1px 16px; -} -div.dokuwiki div.inclmeta div.tags { - border-top:0; - font-size:100%; - float:right; - clear:none; -} -#plugin__manager { -} -#plugin__manager h2 { - margin-left:0; -} -#plugin__manager form { - display:block; - margin:0; - padding:0; -} -#plugin__manager legend { - display:none; -} -#plugin__manager fieldset { - width:auto; -} -#plugin__manager .button { - margin:0; -} -#plugin__manager p, #plugin__manager label { - text-align:left; -} -#plugin__manager .hidden { - display:none; -} -#plugin__manager .new { - background:#dee7ec; -} -#plugin__manager input[disabled] { - color:#ccc; - border-color:#ccc; -} -#plugin__manager .pm_menu, #plugin__manager .pm_info { - margin-left:0; - text-align:left; -} -#plugin__manager .pm_menu { - float:left; - width:48%; -} -#plugin__manager .pm_info { - float:right; - width:50%; -} -#plugin__manager .common { -} -#plugin__manager .common form { -} -#plugin__manager .common fieldset { - margin:0; - padding:0 0 1.0em 0; - text-align:left; - border:none; -} -#plugin__manager .common label { - padding:0 0 0.5em 0; -} -#plugin__manager .common input { -} -#plugin__manager .common input.edit { - width:24em; - margin:0.5em; -} -#plugin__manager .common .button { -} -#plugin__manager form.plugins { -} -#plugin__manager .plugins fieldset { - color:#000; - background:#fff; - text-align:right; - border-top:none; - border-right:none; - border-left:none; -} -#plugin__manager .plugins fieldset.protected { - background:#fdd; - color:#000; -} -#plugin__manager .plugins fieldset.disabled { - background:#e0e0e0; - color:#a8a8a8; -} -#plugin__manager .plugins .legend { - color:#000; - background:inherit; - display:block; - margin:0; - padding:0; - font-size:1em; - line-height:1.4em; - font-weight:normal; - text-align:left; - float:left; - padding:0; - clear:none; -} -#plugin__manager .plugins .button { - font-size:95%; -} -#plugin__manager .plugins fieldset.buttons { - border:none; -} -#plugin__manager .plugins fieldset.buttons .button { - float:left; -} -#plugin__manager .pm_info h3 { - margin-left:0; -} -#plugin__manager .pm_info dl { - margin:1em 0; - padding:0; -} -#plugin__manager .pm_info dt { - width:6em; - float:left; - clear:left; - margin:0; - padding:0; -} -#plugin__manager .pm_info dd { - margin:0 0 0 7em; - padding:0; - background:none; -} -#plugin__manager .plugins .enable { - float:left; - width:auto; - margin-right:0.5em; -} -#config__manager div.success, #config__manager div.error, #config__manager div.info { - background-position:0.5em; - padding:0.5em; - text-align:center; -} -#config__manager fieldset { - margin:1em; - width:auto; - margin-bottom:2em; - background-color:#dee7ec; - color:#000; - padding:0 1em; -} -#config__manager legend { - font-size:1.25em; -} -#config__manager form { -} -#config__manager table { - margin:1em 0; - width:100%; -} -#config__manager fieldset td { - text-align:left; -} -#config__manager fieldset td.value { - width:31em; -} -#config__manager td.label { - padding:0.8em 0 0.6em 1em; - vertical-align:top; -} -#config__manager td.label label { - clear:left; - display:block; -} -#config__manager td.label img { - padding:0 10px; - vertical-align:middle; - float:right; -} -#config__manager td.label span.outkey { - font-size:70%; - margin-top:-1.7em; - margin-left:-1em; - display:block; - background-color:#fff; - color:#666; - float:left; - padding:0 0.1em; - position:relative; - z-index:1; -} -#config__manager td input.edit { - width:30em; -} -#config__manager td .input { - width:30.8em; -} -#config__manager td select.edit { -} -#config__manager td textarea.edit { - width:27.5em; - height:4em; -} -#config__manager tr .input, #config__manager tr input, #config__manager tr textarea, #config__manager tr select { - background-color:#fff; - color:#000; -} -#config__manager tr.default .input, #config__manager tr.default input, #config__manager tr.default textarea, #config__manager tr.default select, #config__manager .selectiondefault { - background-color:#cdf; - color:#000; -} -#config__manager tr.protected .input, #config__manager tr.protected input, #config__manager tr.protected textarea, #config__manager tr.protected select, #config__manager tr.protected .selection { - background-color:#fcc!important; - color:#000 !important; -} -#config__manager td.error { - background-color:red; - color:#000; -} -#config__manager .selection { - width:14.8em; - float:left; - margin:0 0.3em 2px 0; -} -#config__manager .selection label { - float:right; - width:14em; - font-size:90%; -} -* html #config__manager .selection label { - padding-top:2px; -} -#config__manager .selection input.checkbox { - padding-left:0.7em; -} -#config__manager .other { - clear:both; - padding-top:0.5em; -} -#config__manager .other label { - padding-left:2px; - font-size:90%; -} -.dokuwiki div.plugin_translation { - float:right; - font-size:95%; -} -.dokuwiki div.plugin_translation ul { - display:inline; - padding:0; - margin:0; -} -.dokuwiki div.plugin_translation ul li { - float:left; - list-style-type:none; - padding:0; - margin:0; -} -.dokuwiki div.plugin_translation ul li a.wikilink1:link, .dokuwiki div.plugin_translation ul li a.wikilink1:hover, .dokuwiki div.plugin_translation ul li a.wikilink1:active, .dokuwiki div.plugin_translation ul li a.wikilink1:visited { - background-color:#000080; - color:#fff !important; - text-decoration:none; - padding:0 0.2em; - margin:0.1em 0.2em; - border:none !important; -} -.dokuwiki div.plugin_translation ul li a.wikilink2:link, .dokuwiki div.plugin_translation ul li a.wikilink2:hover, .dokuwiki div.plugin_translation ul li a.wikilink2:active, .dokuwiki div.plugin_translation ul li a.wikilink2:visited { - background-color:#808080; - color:#fff !important; - text-decoration:none; - padding:0 0.2em; - margin:0.1em 0.2em; - border:none !important; -} -.dokuwiki div.plugin_translation ul li a img { - opacity:0.5; - border:0; -} -.dokuwiki div.plugin_translation ul li a.wikilink2 img { -} -.dokuwiki div.plugin_translation span.curid a img { - opacity:1.0; - height:15px; -} -.dokuwiki div.plugin_translation ul li a:hover img { - opacity:1.0; - height:15px; -} -#user__manager tr.disabled { - color:#6f6f6f; - background:#e4e4e4; -} -#user__manager tr.user_info { - vertical-align:top; -} -#user__manager div.edit_user { - width:46%; - float:left; -} -#user__manager table { - margin-bottom:1em; -} -#user__manager input.button[disabled] { - color:#ccc!important; - border-color:#ccc!important; -} -div.dokuwiki div.newentry_form { - clear:both; - text-align:center; - margin-bottom:1em; -} -div.dokuwiki #blog__newentry_form input.edit { - width:95%; -} -div.dokuwiki tr.draft, div.dokuwiki div.draft { - opacity:0.5; -} -div.dokuwiki div.autoarchive_selector ul { - list-style-type:none; - clear:left; - margin:0 0.5em 0 0; -} -div.dokuwiki div.autoarchive_selector ul div.li { - float:left; - margin:0 1em 0 0; -} -div.dokuwiki div.autoarchive_selector ul ul { - float:left; - clear:none; -} -div.dokuwiki div.autoarchive_selector ul ul div.li { - margin:0; -} -div#acl_manager div#acl__tree { - font-size:90%; - width:25%; - height:300px; - float:left; - overflow:auto; - border:1px solid #8cacbb; - text-align:left; -} -div#acl_manager div#acl__tree a.cur { - background-color:#ff9; - font-weight:bold; -} -div#acl_manager div#acl__tree ul { - list-style-type:none; - margin:0; - padding:0; -} -div#acl_manager div#acl__tree li { - padding-left:1em; -} -div#acl_manager div#acl__tree ul img { - margin-right:0.25em; - cursor:pointer; -} -div#acl_manager div#acl__detail { - width:73%; - height:300px; - float:right; - overflow:auto; -} -div#acl_manager div#acl__detail fieldset { - width:90%; -} -div#acl_manager div#acl__detail div#acl__user { - border:1px solid #8cacbb; - padding:0.5em; - margin-bottom:0.6em; -} -div#acl_manager table.inline { - width:100%; - margin:0; -} -div#acl_manager .aclgroup { - background:transparent url(media/img/group.png) 0px 1px no-repeat; - padding:1px 0px 1px 18px; -} -div#acl_manager .acluser { - background:transparent url(media/img/user.png) 0px 1px no-repeat; - padding:1px 0px 1px 18px; -} -div#acl_manager .aclpage { - background:transparent url(media/img/page.png) 0px 1px no-repeat; - padding:1px 0px 1px 18px; -} -div#acl_manager .aclns { - background:transparent url(media/img/ns.png) 0px 1px no-repeat; - padding:1px 0px 1px 18px; -} -div#acl_manager label.disabled { - color:#666!important; -} -#acl_manager label { - text-align:left; - font-weight:normal; - display:inline; -} -#acl_manager table { - margin-left:10%; - width:80%; -} -#acl_manager table tr { - background-color:inherit; -} -#acl_manager table tr:hover { - background-color:#dee7ec; -} -a.interwiki { - background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat; - padding-left:16px; -} -a.iw_wp { - background-image:url(/media/img/wp.gif) -} -a.iw_wpde { - background-image:url(/media/img/wpde.gif) -} -a.iw_wpmeta { - background-image:url(/media/img/wpmeta.gif) -} -a.iw_doku { - background-image:url(/media/img/doku.gif) -} -a.iw_dokubug { - background-image:url(/media/img/dokubug.gif) -} -a.iw_amazon { - background-image:url(/media/img/amazon.gif) -} -a.iw_amazon_de { - background-image:url(/media/img/amazon.de.gif) -} -a.iw_amazon_uk { - background-image:url(/media/img/amazon.uk.gif) -} -a.iw_phpfn { - background-image:url(/media/img/phpfn.gif) -} -a.iw_coral { - background-image:url(/media/img/coral.gif) -} -a.iw_sb { - background-image:url(/media/img/sb.gif) -} -a.iw_google { - background-image:url(/media/img/google.gif) -} -a.iw_meatball { - background-image:url(/media/img/meatball.gif) -} -a.iw_wiki { - background-image:url(/media/img/wiki.gif) -} -a.mediafile { - background:transparent url(/media/img/file.png) 0px 1px no-repeat; - padding-left:18px; - padding-bottom:1px; -} -a.mf_jpg { - background-image:url(/media/img/jpg.png) -} -a.mf_jpeg { - background-image:url(/media/img/jpeg.png) -} -a.mf_gif { - background-image:url(/media/img/gif.png) -} -a.mf_png { - background-image:url(/media/img/png.png) -} -a.mf_tgz { - background-image:url(/media/img/tgz.png) -} -a.mf_tar { - background-image:url(/media/img/tar.png) -} -a.mf_gz { - background-image:url(/media/img/gz.png) -} -a.mf_bz2 { - background-image:url(/media/img/bz2.png) -} -a.mf_zip { - background-image:url(/media/img/zip.png) -} -a.mf_rar { - background-image:url(/media/img/rar.png) -} -a.mf_pdf { - background-image:url(/media/img/pdf.png) -} -a.mf_ps { - background-image:url(/media/img/ps.png) -} -a.mf_doc { - background-image:url(/media/img/doc.png) -} -a.mf_xls { - background-image:url(/media/img/xls.png) -} -a.mf_ppt { - background-image:url(/media/img/ppt.png) -} -a.mf_rtf { - background-image:url(/media/img/rtf.png) -} -a.mf_swf { - background-image:url(/media/img/swf.png) -} -a.mf_rpm { - background-image:url(/media/img/rpm.png) -} -a.mf_deb { - background-image:url(/media/img/deb.png) -} -a.mf_sxw { - background-image:url(/media/img/sxw.png) -} -a.mf_sxc { - background-image:url(/media/img/sxc.png) -} -a.mf_sxi { - background-image:url(/media/img/sxi.png) -} -a.mf_sxd { - background-image:url(/media/img/sxd.png) -} -a.mf_odc { - background-image:url(/media/img/odc.png) -} -a.mf_odf { - background-image:url(/media/img/odf.png) -} -a.mf_odg { - background-image:url(/media/img/odg.png) -} -a.mf_odi { - background-image:url(/media/img/odi.png) -} -a.mf_odp { - background-image:url(/media/img/odp.png) -} -a.mf_ods { - background-image:url(/media/img/ods.png) -} -a.mf_odt { - background-image:url(/media/img/odt.png) -} -body { - margin:0px; - padding:0px; - background-color:white; - color:black; - font-size:12px; - font-family:Verdana, Helvetica, "Lucida Grande", Lucida, Arial, sans-serif; - font-family:sans-serif; - font-size:99, 96%; - font-size-adjust:none; - font-style:normal; - font-variant:normal; - font-weight:normal; - line-height:normal; -} -hr { - border-width:0px; - border-bottom:1px #aaa dotted; -} -img { - border:none; -} -form { - margin:0px; - padding:0px; - border:none; - display:inline; - background:transparent; -} -ul li { - margin:5px; -} -textarea { - font-family:monospace; -} -table { - margin:0.5em 0; - border-collapse:collapse; -} -td { - padding:0.25em; - border:1pt solid #ADB9CC; -} -a { - color:#3465a4; - text-decoration:none; -} -a:hover { - text-decoration:underline; -} -a.wikilink2 { - color:#a40000 !important; -} -.dokuwiki h1 a, .dokuwiki h2 a, .dokuwiki h3 a, .dokuwiki h4 a, .dokuwiki h5 a, .dokuwiki a.nolink { - color:#000 !important; - text-decoration:none !important; -} -option { - border:0px none #fff; -} -strong.highlight { - background-color:#fc9; - padding:1pt; -} -#pagebottom { - clear:both; -} -hr { - height:1px; - color:#c0c0c0; - background-color:#c0c0c0; - border:none; - margin:.2em 0 .2em 0; -} -pre { - padding:0.5em; - font-family:courier, monospace; - border:1px solid #c0c0c0; - background:#F0ECE6; - white-space:pre; - white-space:pre-wrap; - word-wrap:break-word; - white-space:-moz-pre-wrap; - white-space:-pre-wrap; - white-space:-o-pre-wrap; -} -.invisible { - margin:0px; - border:0px; - padding:0px; - height:0px; - visibility:hidden; -} -.left { - float:left !important; -} -.right { - float:right !important; -} -.center { - text-align:center; -} -div#body-wrapper { - padding:40px 40px 10px 40px; - font-size:127%; -} -div#content { - margin-top:-20px; - padding:0; - font-size:14px; - color:black; - line-height:1.5em; -} -h1, h2, h3, h4, h5, h6 { - background:transparent none repeat scroll 0 0; - border-bottom:1px solid #aaa; - color:black; - font-weight:normal; - margin:0; - padding:0; - padding-bottom:0.17em; - padding-top:0.5em; -} -h1 { - font-size:188%; - line-height:1.2em; - margin-bottom:0.1em; - padding-bottom:0; -} -h2 { - font-size:150%; -} -h3, h4, h5, h6 { - border-bottom:none; - font-weight:bold; -} -h3 { - font-size:132%; -} -h4 { - font-size:116%; -} -h5 { - font-size:100%; -} -h6 { - font-size:80%; -} -ul#page-actions { - float:right; - margin:10px 10px 0 10px; - padding:6px; - color:black; - background-color:#ececec; - list-style-type:none; - -moz-border-radius:5px; -} -ul#user-actions { - padding:5px; - margin:0; - display:inline; - color:black; - background-color:#ececec; - list-style-type:none; - -moz-border-radius:3px; -} -ul#page-actions li, ul#user-actions li { - display:inline; -} -ul#page-actions a, ul#user-actions a { - text-decoration:none; - color:black; - display:inline; - margin:0 3px; - padding:2px 0px 2px 18px; -} -ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { - /*text-decoration:underline;*/ -} -/***************************/ -ul#page-actions2 { - float:left; - margin:10px 10px 0 10px; - padding:6px; - color:black; - background-color:#ececec; - list-style-type:none; - -moz-border-radius:5px; -} -ul#user-actions2 { - padding:5px; - margin:0; - display:inline; - color:black; - background-color:#ececec; - list-style-type:none; - -moz-border-radius:3px; -} -ul#page-actions2 li, ul#user-actions2 li { - display:inline; -} -ul#page-actions2 a, ul#user-actions2 a { - text-decoration:none; - color:black; - display:inline; - margin:0 3px; - padding:2px 0px 2px 18px; -} -ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus { - color: #4e7bb4; -} -/****************************/ -.hidden { - display:none; -} -a.urlextern { - color:#36B; - background:transparent url(/media/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 { -background:none; -padding:0; -} -a.action.index { - background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat; -} -a.action.recent { - background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat; -} -a.logout { - background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat; -} -a.admin { - background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat; -} -a.profile { - background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat; -} -a.create, a.edit { - background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat; -} -a.source, a.show { - background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat; -} -a.revisions { - background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat; -} -a.subscribe, a.unsubscribe { - background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat; -} -a.backlink { - background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat; -} -a.play { - background:transparent url(/media/img/control_play.png) 0px 1px no-repeat; -} -a.play:hover { - background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; -} -a.cancel { - background:transparent url(/media/img/control_cancel.png) 0px 1px no-repeat; -} -a.cancel:hover { - background:transparent url(/media/img/control_cancel_blue.png) 0px 1px no-repeat; -} -a.pause { - background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; -} -a.pause:hover { - background:transparent url(/media/img/control_pause_blue.png) 0px 1px no-repeat; - font-weight: bold; -} -a.stop { - background:transparent url(/media/img/control_stop.png) 0px 1px no-repeat; -} -a.stop:hover { - background:transparent url(/media/img/control_stop_blue.png) 0px 1px no-repeat; -} -a.cog { - background:transparent url(/media/img/cog.png) 0px 1px no-repeat; -} -#head-panel { - background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x; -} -#head-panel h1 { - display:none; - margin:0; - text-decoration:none; - padding-top:0.8em; - padding-left:3.3em; - font-size:2.6em; - color:#eeeeec; -} -#head-panel #head-logo { - float:left; - margin:5px 0 -15px 5px; - padding:0; - overflow:visible; -} -#head-menu { - background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x; - width:100%; - float:left; - margin:0; - padding:0; - padding-top:0.8em; -} -#head-menu ul { - list-style:none; - margin:0 1em 0 2em; -} -#head-menu ul li { - float:left; - margin:0; - margin-left:0.3em; - font-size:14px; - margin-bottom:4px; -} -#head-menu ul li.selected, #head-menu ul li:hover { - margin-bottom:0px; -} -#head-menu ul li a img { - height:22px; - width:22px; - vertical-align:middle; -} -#head-menu ul li a, #head-menu ul li a:link { - float:left; - text-decoration:none; - color:#555; - background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x; - padding:3px 7px 3px 7px; - border:2px solid #ccc; - border-bottom:0px solid transparent; - padding-bottom:3px; - -moz-border-radius:5px; -} -#head-menu ul li a:hover, #head-menu ul li a:focus { - color:#111; - padding-bottom:7px; - border-bottom:0px none transparent; - outline:none; - -moz-border-radius-bottomright:0px; - -moz-border-radius-bottomleft:0px; -} -#head-menu ul li a:focus { - margin-bottom:-4px; -} -#head-menu ul li.selected a { - color:#3566A5; - background:#fff; - padding-bottom:7px; - border-bottom:0px none transparent; - -moz-border-radius-bottomright:0px; - -moz-border-radius-bottomleft:0px; -} -#head-menu ul li.selected a:hover, #head-menu ul li.selected a:focus { - color:#111; -} -div#head-search-and-login { - float:right; - margin:0 1em 0 0; - background-color:#222; - padding:4px; - color:white; - -moz-border-radius-bottomright:6px; - -moz-border-radius-bottomleft:6px; -} -div#head-search-and-login form { - display:inline; - padding:0 3px; -} -div#head-search-and-login form input { - border:2px solid #888; - background:#eee; - font-size:14px; - padding:2px; - -moz-border-radius:3px; -} -div#head-search-and-login form input:focus { - background:#fff; -} -#head-search { - font-size:14px; -} -#head-username, #head-password { - width:80px; - font-size:14px; -} -#pageinfo { - clear:both; - color:#888; - padding:0.6em 0; - margin:0; -} -#foot { - font-style:normal; - color:#888; - text-align:center; -} -#foot a { - color:#aaf; -} -#foot img { - vertical-align:middle; -} -ul.toc { - padding:0; - padding-left:20px; - margin-left:0; - margin-right:10px; - list-style:none; -} -ul.toc li { - list-style:circle; -} -ul.toc li a { - text-decoration:none; - color:black; -} -ul.toc li a:hover { - text-decoration:underline; -} -div.toc { - border:1px dotted #888; - background:#f0f0f0; - margin:1em 0 1em 1em; - float:right; - font-size:95%; -} -div.toc .tocheader { - font-weight:bold; - margin:0.5em 1em; -} -div.toc ol { - margin:1em 0.5em 1em 1em; - padding:0; -} -div.toc ol li { - margin:0; - padding:0; - margin-left:1em; -} -div.toc ol ol { - margin:0.5em 0.5em 0.5em 1em; - padding:0; -} -div.recentchanges table { - clear:both; -} -div#editor-help { - font-size:90%; - border:1px dotted #888; - padding:0ex 1ex 1ex 1ex; - background:#f7f6f2; -} -div#preview { - margin-top:1em; -} -label.block { - display:block; - text-align:right; - font-weight:bold; -} -label.simple { - display:block; - text-align:left; - font-weight:normal; -} -label.block input.edit { - width:50%; -} -fieldset { - width:300px; - text-align:center; - padding:0.5em; - margin:auto; -} -div.editor { - margin:0 0 0 0; -} -table { - margin:0.5em 0; - border-collapse:collapse; -} -td { - padding:0.25em; - border:1pt solid #ADB9CC; -} -td p { - margin:0; - padding:0; -} -.u { - text-decoration:underline; -} -.footnotes ul { - padding:0 2em; - margin:0 0 1em; -} -.footnotes li { - list-style:none; -} -.recentchanges p { - margin:0.25em; -} -.recentchanges td { - vertical-align:top; - border:none; - border-bottom:1pt solid #F0ECE6; - background:#F7F6F2; -} -.rcdaybreak td { - background:#729fcf; - border:none; -} -.rcdaybreak td a { - font-size:0.88em; -} -.rcicon1, .rcicon2 { - text-align:center; -} -.rcpagelink { - width:33%; -} -.rctime { - font-size:0.88em; - white-space:nowrap; -} -.rceditor { - white-space:nowrap; - font-size:0.88em; -} -.rccomment { - width:66%; - color:gray; - font-size:0.88em; -} -.rcrss { - float:right; -} -.recentchanges[dir="rtl"] .rcrss { - float:left; -} -.userpref table, .userpref td { - border:none; -} -div.codearea { - margin:0.5em 0; - padding:0; - border:1pt solid #AEBDCC; - background-color:#F3F5F7; - color:black; -} -div.codearea pre { - margin:0; - padding:10pt; - border:none; -} -a.codenumbers { - margin:0 10pt; - font-size:0.85em; - color:gray; -} -div.codearea pre span.LineNumber { - color:gray; -} -div.codearea pre span.ID { - color:#000; -} -div.codearea pre span.Operator { - color:#0000c0; -} -div.codearea pre span.Char { - color:#004080; -} -div.codearea pre span.Comment { - color:#008000; -} -div.codearea pre span.Number { - color:#0080c0; -} -div.codearea pre span.String { - color:#004080; -} -div.codearea pre span.SPChar { - color:#0000c0; -} -div.codearea pre span.ResWord { - color:#a00000; -} -div.codearea pre span.ConsWord { - color:#008080; - font-weight:bold; -} -div.codearea pre span.Error { - color:#ff8080; - border:solid 1.5pt #f00; -} -div.codearea pre span.ResWord2 { - color:#0080ff; - font-weight:bold; -} -div.codearea pre span.Special { - color:#00f; -} -div.codearea pre span.Preprc { - color:#803999; -} -#message { - clear:both; - padding:5px 10px; - background-color:#eee; - border-bottom:2px solid #ccc; -} -#message p { - margin:5px 0; - padding:0; - font-weight:bold; -} -#message div.buttons { - font-weight:normal; -} -.diff { - width:99%; -} -.diff-title { - background-color:#C0C0C0; -} -.searchresult dd span { - font-weight:bold; -} -.diff { - width:100%; - border:none; -} -.diff-blockheader { - font-weight:bold; - background:#e5e5e5; - font-size:1.2em; - border-top:2px solid #444; - padding:5px; -} -.diff th { - font-size:120%; - width:50%; - font-weight:normal; - text-align:left; - padding-bottom:3px; -} -.diff td { - font-family:monospace; - font-size:100%; - border:none; -} -.diff-addedline { - background-color:#dfd; -} -.diff-deletedline { - background-color:#ffb; -} -.diff-context { - color:#888; -} -.diff-addedline { - background-color:#E0FFE0; - vertical-align:sub; -} -.diff-deletedline { - background-color:#FFFFE0; - background-color:#f4cece; - vertical-align:sub; -} -.diff-addedline strong { - background-color:#80FF80; - background-color:#8ae234; -} -.diff-deletedline strong { - background-color:#FFFF80; - background-color:#ef2929; - background-color:#d78383; -} -.box { - background:url(/media/img/progress-bar-back.gif) right center no-repeat; - width:200px; - height:20px; - float:left; -} -.perc { - background:url(/media/img/progress-bar.gif) right center no-repeat; - height:20px; -} -.boxtext { - font-family:tahoma, arial, sans-serif; - font-size:11px; - color:#000; - float:none; - padding:3px 0 0 10px; -} -.statusbutton { - width:32px; - height:32px; - float:left; - margin-left:-32px; - margin-right:5px; - opacity:0; - cursor:pointer -} -.dlsize { - float:left; - padding-right: 8px; -} -.dlspeed { - float:left; - padding-right: 8px; -} -.queue { - - border: none; -} -.queue tr td { - border: none; -} -.header, .header th { - text-align: left; - font-weight: normal; - background-color:#ececec; - -moz-border-radius:5px; -} -.progress_bar { - background: #0C0; - height: 5px; - -} diff --git a/module/web/media/css/jquery-ui-1.7.2.custom.css b/module/web/media/css/jquery-ui-1.7.2.custom.css deleted file mode 100644 index 62589261a..000000000 --- a/module/web/media/css/jquery-ui-1.7.2.custom.css +++ /dev/null @@ -1,406 +0,0 @@ -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -*/ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - - -/* -* jQuery UI CSS Framework -* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) -* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. -* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px -*/ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } -.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(ui-lightness/images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffd27a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } -.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } -.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } -.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } -.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #666666 url(ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(ui-lightness/images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion -----------------------------------*/ -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } -.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker -----------------------------------*/ -.ui-datepicker { width: 17em; padding: .2em .2em 0; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/* Dialog -----------------------------------*/ -.ui-dialog { position: relative; padding: .2em; width: 300px; } -.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/* Progressbar -----------------------------------*/ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable -----------------------------------*/ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider -----------------------------------*/ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs -----------------------------------*/ -.ui-tabs { padding: .2em; zoom: 1; } -.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } -.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/module/web/media/css/window.css b/module/web/media/css/window.css deleted file mode 100644 index aaccae082..000000000 --- a/module/web/media/css/window.css +++ /dev/null @@ -1,17 +0,0 @@ -.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} -.SWclearfix {display: inline-table;} -* html .SWclearfix {height: 1%;} -.SWclearfix {display: block;} - -div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;} -div.DefaultStickyWin div.top_ul{background:url(/static/window/full.png) top left no-repeat; height:30px; width:15px; float:left} -div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(/static/window/full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px} -div.DefaultStickyWin h1.caption{clear: none !important; margin:0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;} -div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(/static/window/body.png) top left repeat-y; margin:0px 20px 0px 0px !important; margin-bottom: -3px; position: relative; top: 0px !important; top: -3px;} -div.DefaultStickyWin div.body{background:url(/static/window/body.png) top right repeat-y; padding:8px 30px 8px 0px !important; margin-left:5px !important; position:relative; right:-20px !important;} -div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(/static/window/full.png) bottom left no-repeat; width:15px; height:15px; float:left} -div.DefaultStickyWin div.bottom_lr{background:url(/static/window/full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px} -div.DefaultStickyWin div.closeButtons{text-align: center; background:url(/static/window/body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px} -div.DefaultStickyWin a.button:hover{background:url(/static/window/big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(/static/window/big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;} -div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(/static/window/closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer;top:0px} -div.DefaultStickyWin div.dragHandle { width: 11px; height: 25px; position: relative; top: 5px; left: -3px; cursor: move; background: url(/static/window/drag_corner.gif); float: left;} \ No newline at end of file diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css new file mode 100644 index 000000000..0d8e0428f --- /dev/null +++ b/module/web/media/default/css/default.css @@ -0,0 +1,1485 @@ +div.no { + display:inline; + margin:0; + padding:0; +} +.hidden { + display:none; +} +div.error { + background:#fcc url(media/img/error.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #faa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.info { + background:#ccf url(static/default/info.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #aaf; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.success { + background:#cfc url(static/default/success.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #afa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +div.notify { + background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat; + color:#000; + border-bottom:1px solid #ffa; + font-size:90%; + margin:0; + padding-left:3em; + overflow:hidden; +} +.medialeft { + float:left; +} +.mediaright { + float:right; +} +.mediacenter { + display:block; + margin-left:auto; + margin-right:auto; +} +.leftalign { + text-align:left; +} +.centeralign { + text-align:center; +} +.rightalign { + text-align:right; +} +em.u { + font-style:normal; + text-decoration:underline; +} +em em.u { + font-style:italic; +} +.code .br0 { + color:#6c6; +} +.code .co1 { + color:#808080; + font-style:italic; +} +.code .co2 { + color:#808080; + font-style:italic; +} +.code .co3 { + color:#808080; +} +.code .coMULTI { + color:#808080; + font-style:italic; +} +.code .es0 { + color:#009; + font-weight:bold; +} +.code .kw1 { + color:#b1b100; +} +.code .kw2 { + color:#000; + font-weight:bold; +} +.code .kw3 { + color:#006; +} +.code .kw4 { + color:#933; +} +.code .kw5 { + color:#00f; +} +.code .me1 { + color:#060; +} +.code .me2 { + color:#060; +} +.code .nu0 { + color:#c6c; +} +.code .re0 { + color:#00f; +} +.code .re1 { + color:#00f; +} +.code .re2 { + color:#00f; +} +.code .re3 { + color:#f33; + font-weight:bold; +} +.code .re4 { + color:#099; +} +.code .st0 { + color:#f00; +} +.code .sy0 { + color:#6c6; +} +div.dokuwiki table.pagelist, div.dokuwiki table.ul { + border:0; + padding:0; + border-spacing:0; + margin-bottom:1em; + border-collapse:collapse; +} +div.dokuwiki table.pagelist tr { + border-top:1px solid #8cacbb; + border-bottom:1px solid #8cacbb; +} +div.dokuwiki table.pagelist th, div.dokuwiki table.pagelist td { + padding:1px 1em 1px 0; +} +div.dokuwiki table.ul th, div.dokuwiki table.ul td { + padding:0 1em 0 0; +} +div.dokuwiki table.ul ul { + margin:0 0 0 1.5em; +} +div.dokuwiki table.pagelist th, div.dokuwiki table.ul th { + background-color:#dee7ec; +} +div.dokuwiki th.page, div.dokuwiki th.date, div.dokuwiki th.user, div.dokuwiki th.desc, div.dokuwiki th.comments, div.dokuwiki th.linkbacks, div.dokuwiki th.tags, div.dokuwiki td.date, div.dokuwiki td.user, div.dokuwiki td.desc, div.dokuwiki td.comments, div.dokuwiki td.linkbacks, div.dokuwiki td.tags { + color:#666; + font-size:80%; +} +div.dokuwiki td.date { + text-align:right; +} +div.dokuwiki div.include div.secedit { + float:right; + margin-left:1em; + margin-top:-18px; +} +div.dokuwiki div.inclmeta { + border-top:1px dotted #8cacbb; + padding-top:0.2em; + color:#666; + font-size:80%; + line-height:1.25; + margin-top:0.5em; + margin-bottom:2em; +} +div.dokuwiki div.inclmeta a.permalink { + background:transparent url(media/img/link.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta abbr.published { + background:transparent url(media/img/date.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; + border-bottom:0; +} +div.dokuwiki div.inclmeta span.author { + background:transparent url(media/img/user.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta span.comment { + background:transparent url(media/img/comment.gif) 0px 1px no-repeat; + padding:1px 0px 1px 16px; +} +div.dokuwiki div.inclmeta div.tags { + border-top:0; + font-size:100%; + float:right; + clear:none; +} +#plugin__manager { +} +#plugin__manager h2 { + margin-left:0; +} +#plugin__manager form { + display:block; + margin:0; + padding:0; +} +#plugin__manager legend { + display:none; +} +#plugin__manager fieldset { + width:auto; +} +#plugin__manager .button { + margin:0; +} +#plugin__manager p, #plugin__manager label { + text-align:left; +} +#plugin__manager .hidden { + display:none; +} +#plugin__manager .new { + background:#dee7ec; +} +#plugin__manager input[disabled] { + color:#ccc; + border-color:#ccc; +} +#plugin__manager .pm_menu, #plugin__manager .pm_info { + margin-left:0; + text-align:left; +} +#plugin__manager .pm_menu { + float:left; + width:48%; +} +#plugin__manager .pm_info { + float:right; + width:50%; +} +#plugin__manager .common { +} +#plugin__manager .common form { +} +#plugin__manager .common fieldset { + margin:0; + padding:0 0 1.0em 0; + text-align:left; + border:none; +} +#plugin__manager .common label { + padding:0 0 0.5em 0; +} +#plugin__manager .common input { +} +#plugin__manager .common input.edit { + width:24em; + margin:0.5em; +} +#plugin__manager .common .button { +} +#plugin__manager form.plugins { +} +#plugin__manager .plugins fieldset { + color:#000; + background:#fff; + text-align:right; + border-top:none; + border-right:none; + border-left:none; +} +#plugin__manager .plugins fieldset.protected { + background:#fdd; + color:#000; +} +#plugin__manager .plugins fieldset.disabled { + background:#e0e0e0; + color:#a8a8a8; +} +#plugin__manager .plugins .legend { + color:#000; + background:inherit; + display:block; + margin:0; + padding:0; + font-size:1em; + line-height:1.4em; + font-weight:normal; + text-align:left; + float:left; + padding:0; + clear:none; +} +#plugin__manager .plugins .button { + font-size:95%; +} +#plugin__manager .plugins fieldset.buttons { + border:none; +} +#plugin__manager .plugins fieldset.buttons .button { + float:left; +} +#plugin__manager .pm_info h3 { + margin-left:0; +} +#plugin__manager .pm_info dl { + margin:1em 0; + padding:0; +} +#plugin__manager .pm_info dt { + width:6em; + float:left; + clear:left; + margin:0; + padding:0; +} +#plugin__manager .pm_info dd { + margin:0 0 0 7em; + padding:0; + background:none; +} +#plugin__manager .plugins .enable { + float:left; + width:auto; + margin-right:0.5em; +} +#config__manager div.success, #config__manager div.error, #config__manager div.info { + background-position:0.5em; + padding:0.5em; + text-align:center; +} +#config__manager fieldset { + margin:1em; + width:auto; + margin-bottom:2em; + background-color:#dee7ec; + color:#000; + padding:0 1em; +} +#config__manager legend { + font-size:1.25em; +} +#config__manager form { +} +#config__manager table { + margin:1em 0; + width:100%; +} +#config__manager fieldset td { + text-align:left; +} +#config__manager fieldset td.value { + width:31em; +} +#config__manager td.label { + padding:0.8em 0 0.6em 1em; + vertical-align:top; +} +#config__manager td.label label { + clear:left; + display:block; +} +#config__manager td.label img { + padding:0 10px; + vertical-align:middle; + float:right; +} +#config__manager td.label span.outkey { + font-size:70%; + margin-top:-1.7em; + margin-left:-1em; + display:block; + background-color:#fff; + color:#666; + float:left; + padding:0 0.1em; + position:relative; + z-index:1; +} +#config__manager td input.edit { + width:30em; +} +#config__manager td .input { + width:30.8em; +} +#config__manager td select.edit { +} +#config__manager td textarea.edit { + width:27.5em; + height:4em; +} +#config__manager tr .input, #config__manager tr input, #config__manager tr textarea, #config__manager tr select { + background-color:#fff; + color:#000; +} +#config__manager tr.default .input, #config__manager tr.default input, #config__manager tr.default textarea, #config__manager tr.default select, #config__manager .selectiondefault { + background-color:#cdf; + color:#000; +} +#config__manager tr.protected .input, #config__manager tr.protected input, #config__manager tr.protected textarea, #config__manager tr.protected select, #config__manager tr.protected .selection { + background-color:#fcc!important; + color:#000 !important; +} +#config__manager td.error { + background-color:red; + color:#000; +} +#config__manager .selection { + width:14.8em; + float:left; + margin:0 0.3em 2px 0; +} +#config__manager .selection label { + float:right; + width:14em; + font-size:90%; +} +* html #config__manager .selection label { + padding-top:2px; +} +#config__manager .selection input.checkbox { + padding-left:0.7em; +} +#config__manager .other { + clear:both; + padding-top:0.5em; +} +#config__manager .other label { + padding-left:2px; + font-size:90%; +} +.dokuwiki div.plugin_translation { + float:right; + font-size:95%; +} +.dokuwiki div.plugin_translation ul { + display:inline; + padding:0; + margin:0; +} +.dokuwiki div.plugin_translation ul li { + float:left; + list-style-type:none; + padding:0; + margin:0; +} +.dokuwiki div.plugin_translation ul li a.wikilink1:link, .dokuwiki div.plugin_translation ul li a.wikilink1:hover, .dokuwiki div.plugin_translation ul li a.wikilink1:active, .dokuwiki div.plugin_translation ul li a.wikilink1:visited { + background-color:#000080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} +.dokuwiki div.plugin_translation ul li a.wikilink2:link, .dokuwiki div.plugin_translation ul li a.wikilink2:hover, .dokuwiki div.plugin_translation ul li a.wikilink2:active, .dokuwiki div.plugin_translation ul li a.wikilink2:visited { + background-color:#808080; + color:#fff !important; + text-decoration:none; + padding:0 0.2em; + margin:0.1em 0.2em; + border:none !important; +} +.dokuwiki div.plugin_translation ul li a img { + opacity:0.5; + border:0; +} +.dokuwiki div.plugin_translation ul li a.wikilink2 img { +} +.dokuwiki div.plugin_translation span.curid a img { + opacity:1.0; + height:15px; +} +.dokuwiki div.plugin_translation ul li a:hover img { + opacity:1.0; + height:15px; +} +#user__manager tr.disabled { + color:#6f6f6f; + background:#e4e4e4; +} +#user__manager tr.user_info { + vertical-align:top; +} +#user__manager div.edit_user { + width:46%; + float:left; +} +#user__manager table { + margin-bottom:1em; +} +#user__manager input.button[disabled] { + color:#ccc!important; + border-color:#ccc!important; +} +div.dokuwiki div.newentry_form { + clear:both; + text-align:center; + margin-bottom:1em; +} +div.dokuwiki #blog__newentry_form input.edit { + width:95%; +} +div.dokuwiki tr.draft, div.dokuwiki div.draft { + opacity:0.5; +} +div.dokuwiki div.autoarchive_selector ul { + list-style-type:none; + clear:left; + margin:0 0.5em 0 0; +} +div.dokuwiki div.autoarchive_selector ul div.li { + float:left; + margin:0 1em 0 0; +} +div.dokuwiki div.autoarchive_selector ul ul { + float:left; + clear:none; +} +div.dokuwiki div.autoarchive_selector ul ul div.li { + margin:0; +} +div#acl_manager div#acl__tree { + font-size:90%; + width:25%; + height:300px; + float:left; + overflow:auto; + border:1px solid #8cacbb; + text-align:left; +} +div#acl_manager div#acl__tree a.cur { + background-color:#ff9; + font-weight:bold; +} +div#acl_manager div#acl__tree ul { + list-style-type:none; + margin:0; + padding:0; +} +div#acl_manager div#acl__tree li { + padding-left:1em; +} +div#acl_manager div#acl__tree ul img { + margin-right:0.25em; + cursor:pointer; +} +div#acl_manager div#acl__detail { + width:73%; + height:300px; + float:right; + overflow:auto; +} +div#acl_manager div#acl__detail fieldset { + width:90%; +} +div#acl_manager div#acl__detail div#acl__user { + border:1px solid #8cacbb; + padding:0.5em; + margin-bottom:0.6em; +} +div#acl_manager table.inline { + width:100%; + margin:0; +} +div#acl_manager .aclgroup { + background:transparent url(media/img/group.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .acluser { + background:transparent url(media/img/user.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .aclpage { + background:transparent url(media/img/page.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager .aclns { + background:transparent url(media/img/ns.png) 0px 1px no-repeat; + padding:1px 0px 1px 18px; +} +div#acl_manager label.disabled { + color:#666!important; +} +#acl_manager label { + text-align:left; + font-weight:normal; + display:inline; +} +#acl_manager table { + margin-left:10%; + width:80%; +} +#acl_manager table tr { + background-color:inherit; +} +#acl_manager table tr:hover { + background-color:#dee7ec; +} +a.interwiki { + background:transparent url(/lib/images/interwiki.png) 0px 1px no-repeat; + padding-left:16px; +} +a.iw_wp { + background-image:url(/media/img/wp.gif) +} +a.iw_wpde { + background-image:url(/media/img/wpde.gif) +} +a.iw_wpmeta { + background-image:url(/media/img/wpmeta.gif) +} +a.iw_doku { + background-image:url(/media/img/doku.gif) +} +a.iw_dokubug { + background-image:url(/media/img/dokubug.gif) +} +a.iw_amazon { + background-image:url(/media/img/amazon.gif) +} +a.iw_amazon_de { + background-image:url(/media/img/amazon.de.gif) +} +a.iw_amazon_uk { + background-image:url(/media/img/amazon.uk.gif) +} +a.iw_phpfn { + background-image:url(/media/img/phpfn.gif) +} +a.iw_coral { + background-image:url(/media/img/coral.gif) +} +a.iw_sb { + background-image:url(/media/img/sb.gif) +} +a.iw_google { + background-image:url(/media/img/google.gif) +} +a.iw_meatball { + background-image:url(/media/img/meatball.gif) +} +a.iw_wiki { + background-image:url(/media/img/wiki.gif) +} +a.mediafile { + background:transparent url(/media/img/file.png) 0px 1px no-repeat; + padding-left:18px; + padding-bottom:1px; +} +a.mf_jpg { + background-image:url(/media/img/jpg.png) +} +a.mf_jpeg { + background-image:url(/media/img/jpeg.png) +} +a.mf_gif { + background-image:url(/media/img/gif.png) +} +a.mf_png { + background-image:url(/media/img/png.png) +} +a.mf_tgz { + background-image:url(/media/img/tgz.png) +} +a.mf_tar { + background-image:url(/media/img/tar.png) +} +a.mf_gz { + background-image:url(/media/img/gz.png) +} +a.mf_bz2 { + background-image:url(/media/img/bz2.png) +} +a.mf_zip { + background-image:url(/media/img/zip.png) +} +a.mf_rar { + background-image:url(/media/img/rar.png) +} +a.mf_pdf { + background-image:url(/media/img/pdf.png) +} +a.mf_ps { + background-image:url(/media/img/ps.png) +} +a.mf_doc { + background-image:url(/media/img/doc.png) +} +a.mf_xls { + background-image:url(/media/img/xls.png) +} +a.mf_ppt { + background-image:url(/media/img/ppt.png) +} +a.mf_rtf { + background-image:url(/media/img/rtf.png) +} +a.mf_swf { + background-image:url(/media/img/swf.png) +} +a.mf_rpm { + background-image:url(/media/img/rpm.png) +} +a.mf_deb { + background-image:url(/media/img/deb.png) +} +a.mf_sxw { + background-image:url(/media/img/sxw.png) +} +a.mf_sxc { + background-image:url(/media/img/sxc.png) +} +a.mf_sxi { + background-image:url(/media/img/sxi.png) +} +a.mf_sxd { + background-image:url(/media/img/sxd.png) +} +a.mf_odc { + background-image:url(/media/img/odc.png) +} +a.mf_odf { + background-image:url(/media/img/odf.png) +} +a.mf_odg { + background-image:url(/media/img/odg.png) +} +a.mf_odi { + background-image:url(/media/img/odi.png) +} +a.mf_odp { + background-image:url(/media/img/odp.png) +} +a.mf_ods { + background-image:url(/media/img/ods.png) +} +a.mf_odt { + background-image:url(/media/img/odt.png) +} +body { + margin:0px; + padding:0px; + background-color:white; + color:black; + font-size:12px; + font-family:Verdana, Helvetica, "Lucida Grande", Lucida, Arial, sans-serif; + font-family:sans-serif; + font-size:99, 96%; + font-size-adjust:none; + font-style:normal; + font-variant:normal; + font-weight:normal; + line-height:normal; +} +hr { + border-width:0px; + border-bottom:1px #aaa dotted; +} +img { + border:none; +} +form { + margin:0px; + padding:0px; + border:none; + display:inline; + background:transparent; +} +ul li { + margin:5px; +} +textarea { + font-family:monospace; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +a { + color:#3465a4; + text-decoration:none; +} +a:hover { + text-decoration:underline; +} +a.wikilink2 { + color:#a40000 !important; +} +.dokuwiki h1 a, .dokuwiki h2 a, .dokuwiki h3 a, .dokuwiki h4 a, .dokuwiki h5 a, .dokuwiki a.nolink { + color:#000 !important; + text-decoration:none !important; +} +option { + border:0px none #fff; +} +strong.highlight { + background-color:#fc9; + padding:1pt; +} +#pagebottom { + clear:both; +} +hr { + height:1px; + color:#c0c0c0; + background-color:#c0c0c0; + border:none; + margin:.2em 0 .2em 0; +} +pre { + padding:0.5em; + font-family:courier, monospace; + border:1px solid #c0c0c0; + background:#F0ECE6; + white-space:pre; + white-space:pre-wrap; + word-wrap:break-word; + white-space:-moz-pre-wrap; + white-space:-pre-wrap; + white-space:-o-pre-wrap; +} +.invisible { + margin:0px; + border:0px; + padding:0px; + height:0px; + visibility:hidden; +} +.left { + float:left !important; +} +.right { + float:right !important; +} +.center { + text-align:center; +} +div#body-wrapper { + padding:40px 40px 10px 40px; + font-size:127%; +} +div#content { + margin-top:-20px; + padding:0; + font-size:14px; + color:black; + line-height:1.5em; +} +h1, h2, h3, h4, h5, h6 { + background:transparent none repeat scroll 0 0; + border-bottom:1px solid #aaa; + color:black; + font-weight:normal; + margin:0; + padding:0; + padding-bottom:0.17em; + padding-top:0.5em; +} +h1 { + font-size:188%; + line-height:1.2em; + margin-bottom:0.1em; + padding-bottom:0; +} +h2 { + font-size:150%; +} +h3, h4, h5, h6 { + border-bottom:none; + font-weight:bold; +} +h3 { + font-size:132%; +} +h4 { + font-size:116%; +} +h5 { + font-size:100%; +} +h6 { + font-size:80%; +} +ul#page-actions { + float:right; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:5px; +} +ul#user-actions { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:3px; +} +ul#page-actions li, ul#user-actions li { + display:inline; +} +ul#page-actions a, ul#user-actions a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-actions a:hover, ul#page-actions a:focus, ul#user-actions a:hover, ul#user-actions a:focus { + /*text-decoration:underline;*/ +} +/***************************/ +ul#page-actions2 { + float:left; + margin:10px 10px 0 10px; + padding:6px; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:5px; +} +ul#user-actions2 { + padding:5px; + margin:0; + display:inline; + color:black; + background-color:#ececec; + list-style-type:none; + -moz-border-radius:3px; +} +ul#page-actions2 li, ul#user-actions2 li { + display:inline; +} +ul#page-actions2 a, ul#user-actions2 a { + text-decoration:none; + color:black; + display:inline; + margin:0 3px; + padding:2px 0px 2px 18px; +} +ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul#user-actions2 a:focus { + color: #4e7bb4; +} +/****************************/ +.hidden { + display:none; +} +a.urlextern { + color:#36B; + background:transparent url(/media/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 { +background:none; +padding:0; +} +a.action.index { + background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat; +} +a.action.recent { + background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat; +} +a.logout { + background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat; +} +a.admin { + background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat; +} +a.profile { + background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat; +} +a.create, a.edit { + background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat; +} +a.source, a.show { + background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat; +} +a.revisions { + background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat; +} +a.subscribe, a.unsubscribe { + background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat; +} +a.backlink { + background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat; +} +a.play { + background:transparent url(/media/img/control_play.png) 0px 1px no-repeat; +} +a.play:hover { + background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; +} +a.cancel { + background:transparent url(/media/img/control_cancel.png) 0px 1px no-repeat; +} +a.cancel:hover { + background:transparent url(/media/img/control_cancel_blue.png) 0px 1px no-repeat; +} +a.pause { + background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; +} +a.pause:hover { + background:transparent url(/media/img/control_pause_blue.png) 0px 1px no-repeat; + font-weight: bold; +} +a.stop { + background:transparent url(/media/img/control_stop.png) 0px 1px no-repeat; +} +a.stop:hover { + background:transparent url(/media/img/control_stop_blue.png) 0px 1px no-repeat; +} +a.cog { + background:transparent url(/media/img/cog.png) 0px 1px no-repeat; +} +#head-panel { + background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x; +} +#head-panel h1 { + display:none; + margin:0; + text-decoration:none; + padding-top:0.8em; + padding-left:3.3em; + font-size:2.6em; + color:#eeeeec; +} +#head-panel #head-logo { + float:left; + margin:5px 0 -15px 5px; + padding:0; + overflow:visible; +} +#head-menu { + background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x; + width:100%; + float:left; + margin:0; + padding:0; + padding-top:0.8em; +} +#head-menu ul { + list-style:none; + margin:0 1em 0 2em; +} +#head-menu ul li { + float:left; + margin:0; + margin-left:0.3em; + font-size:14px; + margin-bottom:4px; +} +#head-menu ul li.selected, #head-menu ul li:hover { + margin-bottom:0px; +} +#head-menu ul li a img { + height:22px; + width:22px; + vertical-align:middle; +} +#head-menu ul li a, #head-menu ul li a:link { + float:left; + text-decoration:none; + color:#555; + background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x; + padding:3px 7px 3px 7px; + border:2px solid #ccc; + border-bottom:0px solid transparent; + padding-bottom:3px; + -moz-border-radius:5px; +} +#head-menu ul li a:hover, #head-menu ul li a:focus { + color:#111; + padding-bottom:7px; + border-bottom:0px none transparent; + outline:none; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li a:focus { + margin-bottom:-4px; +} +#head-menu ul li.selected a { + color:#3566A5; + background:#fff; + padding-bottom:7px; + border-bottom:0px none transparent; + -moz-border-radius-bottomright:0px; + -moz-border-radius-bottomleft:0px; +} +#head-menu ul li.selected a:hover, #head-menu ul li.selected a:focus { + color:#111; +} +div#head-search-and-login { + float:right; + margin:0 1em 0 0; + background-color:#222; + padding:4px; + color:white; + -moz-border-radius-bottomright:6px; + -moz-border-radius-bottomleft:6px; +} +div#head-search-and-login form { + display:inline; + padding:0 3px; +} +div#head-search-and-login form input { + border:2px solid #888; + background:#eee; + font-size:14px; + padding:2px; + -moz-border-radius:3px; +} +div#head-search-and-login form input:focus { + background:#fff; +} +#head-search { + font-size:14px; +} +#head-username, #head-password { + width:80px; + font-size:14px; +} +#pageinfo { + clear:both; + color:#888; + padding:0.6em 0; + margin:0; +} +#foot { + font-style:normal; + color:#888; + text-align:center; +} +#foot a { + color:#aaf; +} +#foot img { + vertical-align:middle; +} +ul.toc { + padding:0; + padding-left:20px; + margin-left:0; + margin-right:10px; + list-style:none; +} +ul.toc li { + list-style:circle; +} +ul.toc li a { + text-decoration:none; + color:black; +} +ul.toc li a:hover { + text-decoration:underline; +} +div.toc { + border:1px dotted #888; + background:#f0f0f0; + margin:1em 0 1em 1em; + float:right; + font-size:95%; +} +div.toc .tocheader { + font-weight:bold; + margin:0.5em 1em; +} +div.toc ol { + margin:1em 0.5em 1em 1em; + padding:0; +} +div.toc ol li { + margin:0; + padding:0; + margin-left:1em; +} +div.toc ol ol { + margin:0.5em 0.5em 0.5em 1em; + padding:0; +} +div.recentchanges table { + clear:both; +} +div#editor-help { + font-size:90%; + border:1px dotted #888; + padding:0ex 1ex 1ex 1ex; + background:#f7f6f2; +} +div#preview { + margin-top:1em; +} +label.block { + display:block; + text-align:right; + font-weight:bold; +} +label.simple { + display:block; + text-align:left; + font-weight:normal; +} +label.block input.edit { + width:50%; +} +fieldset { + width:300px; + text-align:center; + padding:0.5em; + margin:auto; +} +div.editor { + margin:0 0 0 0; +} +table { + margin:0.5em 0; + border-collapse:collapse; +} +td { + padding:0.25em; + border:1pt solid #ADB9CC; +} +td p { + margin:0; + padding:0; +} +.u { + text-decoration:underline; +} +.footnotes ul { + padding:0 2em; + margin:0 0 1em; +} +.footnotes li { + list-style:none; +} +.recentchanges p { + margin:0.25em; +} +.recentchanges td { + vertical-align:top; + border:none; + border-bottom:1pt solid #F0ECE6; + background:#F7F6F2; +} +.rcdaybreak td { + background:#729fcf; + border:none; +} +.rcdaybreak td a { + font-size:0.88em; +} +.rcicon1, .rcicon2 { + text-align:center; +} +.rcpagelink { + width:33%; +} +.rctime { + font-size:0.88em; + white-space:nowrap; +} +.rceditor { + white-space:nowrap; + font-size:0.88em; +} +.rccomment { + width:66%; + color:gray; + font-size:0.88em; +} +.rcrss { + float:right; +} +.recentchanges[dir="rtl"] .rcrss { + float:left; +} +.userpref table, .userpref td { + border:none; +} +div.codearea { + margin:0.5em 0; + padding:0; + border:1pt solid #AEBDCC; + background-color:#F3F5F7; + color:black; +} +div.codearea pre { + margin:0; + padding:10pt; + border:none; +} +a.codenumbers { + margin:0 10pt; + font-size:0.85em; + color:gray; +} +div.codearea pre span.LineNumber { + color:gray; +} +div.codearea pre span.ID { + color:#000; +} +div.codearea pre span.Operator { + color:#0000c0; +} +div.codearea pre span.Char { + color:#004080; +} +div.codearea pre span.Comment { + color:#008000; +} +div.codearea pre span.Number { + color:#0080c0; +} +div.codearea pre span.String { + color:#004080; +} +div.codearea pre span.SPChar { + color:#0000c0; +} +div.codearea pre span.ResWord { + color:#a00000; +} +div.codearea pre span.ConsWord { + color:#008080; + font-weight:bold; +} +div.codearea pre span.Error { + color:#ff8080; + border:solid 1.5pt #f00; +} +div.codearea pre span.ResWord2 { + color:#0080ff; + font-weight:bold; +} +div.codearea pre span.Special { + color:#00f; +} +div.codearea pre span.Preprc { + color:#803999; +} +#message { + clear:both; + padding:5px 10px; + background-color:#eee; + border-bottom:2px solid #ccc; +} +#message p { + margin:5px 0; + padding:0; + font-weight:bold; +} +#message div.buttons { + font-weight:normal; +} +.diff { + width:99%; +} +.diff-title { + background-color:#C0C0C0; +} +.searchresult dd span { + font-weight:bold; +} +.diff { + width:100%; + border:none; +} +.diff-blockheader { + font-weight:bold; + background:#e5e5e5; + font-size:1.2em; + border-top:2px solid #444; + padding:5px; +} +.diff th { + font-size:120%; + width:50%; + font-weight:normal; + text-align:left; + padding-bottom:3px; +} +.diff td { + font-family:monospace; + font-size:100%; + border:none; +} +.diff-addedline { + background-color:#dfd; +} +.diff-deletedline { + background-color:#ffb; +} +.diff-context { + color:#888; +} +.diff-addedline { + background-color:#E0FFE0; + vertical-align:sub; +} +.diff-deletedline { + background-color:#FFFFE0; + background-color:#f4cece; + vertical-align:sub; +} +.diff-addedline strong { + background-color:#80FF80; + background-color:#8ae234; +} +.diff-deletedline strong { + background-color:#FFFF80; + background-color:#ef2929; + background-color:#d78383; +} +.box { + background:url(/media/img/progress-bar-back.gif) right center no-repeat; + width:200px; + height:20px; + float:left; +} +.perc { + background:url(/media/img/progress-bar.gif) right center no-repeat; + height:20px; +} +.boxtext { + font-family:tahoma, arial, sans-serif; + font-size:11px; + color:#000; + float:none; + padding:3px 0 0 10px; +} +.statusbutton { + width:32px; + height:32px; + float:left; + margin-left:-32px; + margin-right:5px; + opacity:0; + cursor:pointer +} +.dlsize { + float:left; + padding-right: 8px; +} +.dlspeed { + float:left; + padding-right: 8px; +} +.queue { + + border: none; +} +.queue tr td { + border: none; +} +.header, .header th { + text-align: left; + font-weight: normal; + background-color:#ececec; + -moz-border-radius:5px; +} +.progress_bar { + background: #0C0; + height: 5px; + +} diff --git a/module/web/media/default/css/jquery-ui-1.7.2.custom.css b/module/web/media/default/css/jquery-ui-1.7.2.custom.css new file mode 100644 index 000000000..62589261a --- /dev/null +++ b/module/web/media/default/css/jquery-ui-1.7.2.custom.css @@ -0,0 +1,406 @@ +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +*/ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute; left: -99999999px; } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + + +/* +* jQuery UI CSS Framework +* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) +* Dual licensed under the MIT (MIT-LICENSE.txt) and GPL (GPL-LICENSE.txt) licenses. +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +*/ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } +.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } +.ui-widget-content a { color: #333333; } +.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } +.ui-widget-header a { color: #ffffff; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; outline: none; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; outline: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; outline: none; } +.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; outline: none; } +.ui-state-active, .ui-widget-content .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; outline: none; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; outline: none; text-decoration: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a { color: #363636; } +.ui-state-error, .ui-widget-content .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text { color: #ffffff; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(ui-lightness/images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffffff_256x240.png); } +.ui-state-default .ui-icon { background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-active .ui-icon {background-image: url(ui-lightness/images/ui-icons_ef8c08_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(ui-lightness/images/ui-icons_228ef1_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(ui-lightness/images/ui-icons_ffd27a_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; } +.ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-top { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-right { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; } +.ui-corner-left { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; } +.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; } + +/* Overlays */ +.ui-widget-overlay { background: #666666 url(ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } +.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(ui-lightness/images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -webkit-border-radius: 5px; }/* Accordion +----------------------------------*/ +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; } +.ui-accordion .ui-accordion-content-active { display: block; }/* Datepicker +----------------------------------*/ +.ui-datepicker { width: 17em; padding: .2em .2em 0; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; } +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* Dialog +----------------------------------*/ +.ui-dialog { position: relative; padding: .2em; width: 300px; } +.ui-dialog .ui-dialog-titlebar { padding: .5em .3em .3em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 0 .2em; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* Progressbar +----------------------------------*/ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }/* Resizable +----------------------------------*/ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0px; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0px; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0px; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0px; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* Slider +----------------------------------*/ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* Tabs +----------------------------------*/ +.ui-tabs { padding: .2em; zoom: 1; } +.ui-tabs .ui-tabs-nav { list-style: none; position: relative; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { position: relative; float: left; border-bottom-width: 0 !important; margin: 0 .2em -1px 0; padding: 0; } +.ui-tabs .ui-tabs-nav li a { float: left; text-decoration: none; padding: .5em 1em; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 1px; border-bottom-width: 0; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { padding: 1em 1.4em; display: block; border-width: 0; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/module/web/media/default/css/window.css b/module/web/media/default/css/window.css new file mode 100644 index 000000000..aaccae082 --- /dev/null +++ b/module/web/media/default/css/window.css @@ -0,0 +1,17 @@ +.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} +.SWclearfix {display: inline-table;} +* html .SWclearfix {height: 1%;} +.SWclearfix {display: block;} + +div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;} +div.DefaultStickyWin div.top_ul{background:url(/static/window/full.png) top left no-repeat; height:30px; width:15px; float:left} +div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(/static/window/full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px} +div.DefaultStickyWin h1.caption{clear: none !important; margin:0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;} +div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(/static/window/body.png) top left repeat-y; margin:0px 20px 0px 0px !important; margin-bottom: -3px; position: relative; top: 0px !important; top: -3px;} +div.DefaultStickyWin div.body{background:url(/static/window/body.png) top right repeat-y; padding:8px 30px 8px 0px !important; margin-left:5px !important; position:relative; right:-20px !important;} +div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(/static/window/full.png) bottom left no-repeat; width:15px; height:15px; float:left} +div.DefaultStickyWin div.bottom_lr{background:url(/static/window/full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px} +div.DefaultStickyWin div.closeButtons{text-align: center; background:url(/static/window/body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px} +div.DefaultStickyWin a.button:hover{background:url(/static/window/big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(/static/window/big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;} +div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(/static/window/closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer;top:0px} +div.DefaultStickyWin div.dragHandle { width: 11px; height: 25px; position: relative; top: 5px; left: -3px; cursor: move; background: url(/static/window/drag_corner.gif); float: left;} \ No newline at end of file diff --git a/module/web/media/default/img/Button-Add-grey.png b/module/web/media/default/img/Button-Add-grey.png new file mode 100644 index 000000000..6659e230e Binary files /dev/null and b/module/web/media/default/img/Button-Add-grey.png differ diff --git a/module/web/media/default/img/Button-Add.png b/module/web/media/default/img/Button-Add.png new file mode 100644 index 000000000..602da4131 Binary files /dev/null and b/module/web/media/default/img/Button-Add.png differ diff --git a/module/web/media/default/img/Button-Pause-grey.png b/module/web/media/default/img/Button-Pause-grey.png new file mode 100644 index 000000000..d1017e974 Binary files /dev/null and b/module/web/media/default/img/Button-Pause-grey.png differ diff --git a/module/web/media/default/img/Button-Pause.png b/module/web/media/default/img/Button-Pause.png new file mode 100644 index 000000000..68f3ffc3a Binary files /dev/null and b/module/web/media/default/img/Button-Pause.png differ diff --git a/module/web/media/default/img/Button-Play-grey.png b/module/web/media/default/img/Button-Play-grey.png new file mode 100644 index 000000000..9f44c2289 Binary files /dev/null and b/module/web/media/default/img/Button-Play-grey.png differ diff --git a/module/web/media/default/img/Button-Play.png b/module/web/media/default/img/Button-Play.png new file mode 100644 index 000000000..1ce1ed913 Binary files /dev/null and b/module/web/media/default/img/Button-Play.png differ diff --git a/module/web/media/default/img/big_button.gif b/module/web/media/default/img/big_button.gif new file mode 100644 index 000000000..7680490ea Binary files /dev/null and b/module/web/media/default/img/big_button.gif differ diff --git a/module/web/media/default/img/big_button_over.gif b/module/web/media/default/img/big_button_over.gif new file mode 100644 index 000000000..2e3ee10d2 Binary files /dev/null and b/module/web/media/default/img/big_button_over.gif differ diff --git a/module/web/media/default/img/body.png b/module/web/media/default/img/body.png new file mode 100644 index 000000000..7ff1043e0 Binary files /dev/null and b/module/web/media/default/img/body.png differ diff --git a/module/web/media/default/img/closebtn.gif b/module/web/media/default/img/closebtn.gif new file mode 100644 index 000000000..3e27e6030 Binary files /dev/null and b/module/web/media/default/img/closebtn.gif differ diff --git a/module/web/media/default/img/cog.png b/module/web/media/default/img/cog.png new file mode 100644 index 000000000..67de2c6cc Binary files /dev/null and b/module/web/media/default/img/cog.png differ diff --git a/module/web/media/default/img/control_cancel.png b/module/web/media/default/img/control_cancel.png new file mode 100644 index 000000000..7b9bc3fba Binary files /dev/null and b/module/web/media/default/img/control_cancel.png differ diff --git a/module/web/media/default/img/control_cancel_blue.png b/module/web/media/default/img/control_cancel_blue.png new file mode 100644 index 000000000..0c5c96ce3 Binary files /dev/null and b/module/web/media/default/img/control_cancel_blue.png differ diff --git a/module/web/media/default/img/control_pause.png b/module/web/media/default/img/control_pause.png new file mode 100644 index 000000000..2d9ce9c4e Binary files /dev/null and b/module/web/media/default/img/control_pause.png differ diff --git a/module/web/media/default/img/control_pause_blue.png b/module/web/media/default/img/control_pause_blue.png new file mode 100644 index 000000000..ec61099b0 Binary files /dev/null and b/module/web/media/default/img/control_pause_blue.png differ diff --git a/module/web/media/default/img/control_play.png b/module/web/media/default/img/control_play.png new file mode 100644 index 000000000..0846555d0 Binary files /dev/null and b/module/web/media/default/img/control_play.png differ diff --git a/module/web/media/default/img/control_play_blue.png b/module/web/media/default/img/control_play_blue.png new file mode 100644 index 000000000..f8c8ec683 Binary files /dev/null and b/module/web/media/default/img/control_play_blue.png differ diff --git a/module/web/media/default/img/control_stop.png b/module/web/media/default/img/control_stop.png new file mode 100644 index 000000000..893bb60e5 Binary files /dev/null and b/module/web/media/default/img/control_stop.png differ diff --git a/module/web/media/default/img/control_stop_blue.png b/module/web/media/default/img/control_stop_blue.png new file mode 100644 index 000000000..e6f75d232 Binary files /dev/null and b/module/web/media/default/img/control_stop_blue.png differ diff --git a/module/web/media/default/img/drag_corner.gif b/module/web/media/default/img/drag_corner.gif new file mode 100644 index 000000000..befb1adf1 Binary files /dev/null and b/module/web/media/default/img/drag_corner.gif differ diff --git a/module/web/media/default/img/full.png b/module/web/media/default/img/full.png new file mode 100644 index 000000000..fea52af76 Binary files /dev/null and b/module/web/media/default/img/full.png differ diff --git a/module/web/media/default/img/head-login.png b/module/web/media/default/img/head-login.png new file mode 100644 index 000000000..b59b7cbbf Binary files /dev/null and b/module/web/media/default/img/head-login.png differ diff --git a/module/web/media/default/img/head-menu-development.png b/module/web/media/default/img/head-menu-development.png new file mode 100644 index 000000000..8ef08e2e5 Binary files /dev/null and b/module/web/media/default/img/head-menu-development.png differ diff --git a/module/web/media/default/img/head-menu-download.png b/module/web/media/default/img/head-menu-download.png new file mode 100644 index 000000000..98c5da9db Binary files /dev/null and b/module/web/media/default/img/head-menu-download.png differ diff --git a/module/web/media/default/img/head-menu-home.png b/module/web/media/default/img/head-menu-home.png new file mode 100644 index 000000000..9d62109aa Binary files /dev/null and b/module/web/media/default/img/head-menu-home.png differ diff --git a/module/web/media/default/img/head-menu-index.png b/module/web/media/default/img/head-menu-index.png new file mode 100644 index 000000000..44d631064 Binary files /dev/null and b/module/web/media/default/img/head-menu-index.png differ diff --git a/module/web/media/default/img/head-menu-news.png b/module/web/media/default/img/head-menu-news.png new file mode 100644 index 000000000..43950ebc9 Binary files /dev/null and b/module/web/media/default/img/head-menu-news.png differ diff --git a/module/web/media/default/img/head-menu-recent.png b/module/web/media/default/img/head-menu-recent.png new file mode 100644 index 000000000..fc9b0497f Binary files /dev/null and b/module/web/media/default/img/head-menu-recent.png differ diff --git a/module/web/media/default/img/head-menu-wiki.png b/module/web/media/default/img/head-menu-wiki.png new file mode 100644 index 000000000..07cf0102d Binary files /dev/null and b/module/web/media/default/img/head-menu-wiki.png differ diff --git a/module/web/media/default/img/head-search-noshadow.png b/module/web/media/default/img/head-search-noshadow.png new file mode 100644 index 000000000..aafdae015 Binary files /dev/null and b/module/web/media/default/img/head-search-noshadow.png differ diff --git a/module/web/media/default/img/head_bg1.png b/module/web/media/default/img/head_bg1.png new file mode 100644 index 000000000..f2848c3cc Binary files /dev/null and b/module/web/media/default/img/head_bg1.png differ diff --git a/module/web/media/default/img/page-tools-backlinks.png b/module/web/media/default/img/page-tools-backlinks.png new file mode 100644 index 000000000..3eb6a9ce3 Binary files /dev/null and b/module/web/media/default/img/page-tools-backlinks.png differ diff --git a/module/web/media/default/img/page-tools-edit.png b/module/web/media/default/img/page-tools-edit.png new file mode 100644 index 000000000..188e1c12b Binary files /dev/null and b/module/web/media/default/img/page-tools-edit.png differ diff --git a/module/web/media/default/img/page-tools-revisions.png b/module/web/media/default/img/page-tools-revisions.png new file mode 100644 index 000000000..5c3b8587f Binary files /dev/null and b/module/web/media/default/img/page-tools-revisions.png differ diff --git a/module/web/media/default/img/progress-bar-back.gif b/module/web/media/default/img/progress-bar-back.gif new file mode 100644 index 000000000..0c8f68211 Binary files /dev/null and b/module/web/media/default/img/progress-bar-back.gif differ diff --git a/module/web/media/default/img/progress-bar.gif b/module/web/media/default/img/progress-bar.gif new file mode 100644 index 000000000..746f77175 Binary files /dev/null and b/module/web/media/default/img/progress-bar.gif differ diff --git a/module/web/media/default/img/progressbar.gif b/module/web/media/default/img/progressbar.gif new file mode 100644 index 000000000..abe588c15 Binary files /dev/null and b/module/web/media/default/img/progressbar.gif differ diff --git a/module/web/media/default/img/progressbg_black.gif b/module/web/media/default/img/progressbg_black.gif new file mode 100644 index 000000000..74fd1f9b3 Binary files /dev/null and b/module/web/media/default/img/progressbg_black.gif differ diff --git a/module/web/media/default/img/progressbg_green.gif b/module/web/media/default/img/progressbg_green.gif new file mode 100644 index 000000000..f3f3bf681 Binary files /dev/null and b/module/web/media/default/img/progressbg_green.gif differ diff --git a/module/web/media/default/img/progressbg_orange.gif b/module/web/media/default/img/progressbg_orange.gif new file mode 100644 index 000000000..808cac7cf Binary files /dev/null and b/module/web/media/default/img/progressbg_orange.gif differ diff --git a/module/web/media/default/img/progressbg_red.gif b/module/web/media/default/img/progressbg_red.gif new file mode 100644 index 000000000..54dfa135f Binary files /dev/null and b/module/web/media/default/img/progressbg_red.gif differ diff --git a/module/web/media/default/img/progressbg_yellow.gif b/module/web/media/default/img/progressbg_yellow.gif new file mode 100644 index 000000000..fdb0dfc98 Binary files /dev/null and b/module/web/media/default/img/progressbg_yellow.gif differ diff --git a/module/web/media/default/img/pyload-logo-edited3.5-new-font-small.png b/module/web/media/default/img/pyload-logo-edited3.5-new-font-small.png new file mode 100644 index 000000000..2443cd8b1 Binary files /dev/null and b/module/web/media/default/img/pyload-logo-edited3.5-new-font-small.png differ diff --git a/module/web/media/default/img/tab-background.png b/module/web/media/default/img/tab-background.png new file mode 100644 index 000000000..29a5d1991 Binary files /dev/null and b/module/web/media/default/img/tab-background.png differ diff --git a/module/web/media/default/img/tabs-border-bottom.png b/module/web/media/default/img/tabs-border-bottom.png new file mode 100644 index 000000000..02440f428 Binary files /dev/null and b/module/web/media/default/img/tabs-border-bottom.png differ diff --git a/module/web/media/default/img/user-actions-logout.png b/module/web/media/default/img/user-actions-logout.png new file mode 100644 index 000000000..0010931e2 Binary files /dev/null and b/module/web/media/default/img/user-actions-logout.png differ diff --git a/module/web/media/default/img/user-actions-profile.png b/module/web/media/default/img/user-actions-profile.png new file mode 100644 index 000000000..46573fff6 Binary files /dev/null and b/module/web/media/default/img/user-actions-profile.png differ diff --git a/module/web/media/default/js/funktions.js b/module/web/media/default/js/funktions.js new file mode 100644 index 000000000..ed1471595 --- /dev/null +++ b/module/web/media/default/js/funktions.js @@ -0,0 +1,16 @@ +// JavaScript Document +function SecToRightTime(sek) +{ + vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : ''; + vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 ); + return vreturn; +} + +function HumanFileSize(size) +{ + var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); + var loga = Math.log(size)/Math.log(1024); + var i = Math.floor(loga); + var a = Math.pow(1024, i); + return Math.round( size / a , 2) + " " + filesizename[i]; +} \ No newline at end of file diff --git a/module/web/media/default/js/home.js b/module/web/media/default/js/home.js new file mode 100644 index 000000000..025dcfcc7 --- /dev/null +++ b/module/web/media/default/js/home.js @@ -0,0 +1,205 @@ +var dwProgressBar = new Class({ + + //implements + Implements: [Options], + + //options + options: { + container: $$('body')[0], + boxID: '', + percentageID: '', + displayID: '', + startPercentage: 0, + displayText: false, + speed: 10 + }, + + //initialization + initialize: function(options) { + //set options + this.setOptions(options); + //create elements + this.createElements(); + }, + + //creates the box and percentage elements + createElements: function() { + var box = new Element('div', { + id: this.options.boxID + this.options.id, + 'class': this.options.boxID + }); + var perc = new Element('div', { + id: this.options.percentageID + this.options.id, + 'style': 'width:0px;', + 'class': this.options.percentageID + }); + perc.inject(box); + box.inject(this.options.container); + if (this.options.displayText) { + var text = new Element('div', { + id: this.options.displayID + this.options.id, + 'class': this.options.displayID + }); + text.inject(this.options.container); + } + this.set(this.options.startPercentage); + }, + + //calculates width in pixels from percentage + calculate: function(percentage) { + return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); + }, + + //animates the change in percentage + animate: function(to) { + document.id(this.options.percentageID + this.options.id).set('morph', { + duration: this.options.speed, + link: 'cancel' + }).morph({ + width: this.calculate(to.toInt()) + }); + if (this.options.displayText) { + document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); + } + }, + + //sets the percentage from its current state to desired percentage + set: function(to) { + this.animate(to); + } + +}); + +req = new Request.JSON({ + onSuccess: renderTable, + method: 'get', + url: '/json/links', + initialDelay: 0, + delay: 1000, + limit: 20000 +}); + +var dls = [] +var pbs = [] + +function renderTable(data) { + + data.downloads.each(function(dl) { + + if (dls.contains(dl.id)) { + + var div = $('dl' + dl.id) + + pbs[dl.id].set(dl.percent) + + div.getChildren("b")[0].textContent = dl.name + + if (dl.status == "downloading") { + + size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; + speed = Math.round(dl.speed) + " kb/s"; + eta = dl.eta; + + } else if (dl.status == "waiting") { + + size = "waiting " + dl.wait; + speed = ""; + eta = ""; + + } + div.getChildren(".dlsize")[0].textContent = size; + div.getChildren(".dlspeed")[0].textContent = speed; + div.getChildren(".dltime")[0].textContent = eta; + + } else { + + dls.push(dl.id) + + container = $("dlcontainer") + + dldiv = new Element('div', { + 'id': 'dl' + dl.id, + 'class': 'download', + 'styles': { + 'display': 'None' + } + }) + + new Element('p').inject(dldiv) + + new Element('b', { + 'html': dl.name + }).inject(dldiv) + + new Element('br').inject(dldiv) + + dldiv.inject(container) + + pbs[dl.id] = new dwProgressBar({ + container: $(dldiv), + startPercentage: 0, + speed: 1000, + id: dl.id, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' + }); + + new Element('div', { + 'class': 'dlsize', + 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" + }).inject(dldiv) + + new Element('div', { + 'class': 'dlspeed', + 'html': Math.round(dl.speed) + " kb/s" + }).inject(dldiv) + + new Element('div', { + 'class': 'dltime', + 'html': dl.eta + }).inject(dldiv) + + //dldiv.dissolve({duration : 0}) + dldiv.reveal() + + } + }) + + dls.each(function(id, index) { + + if (data.ids.contains(id)) { + +} else { + + //$("dl"+id).reveal() + dls.erase(id); + $('dl' + id).nix() + + } + + }) + +} + +window.addEvent('domready', +function() { + + /* +//create the progress bar for example 1 +pb = new dwProgressBar({ + container: $$('.level1 p')[0], + startPercentage: 25, + speed: 1000, + id: 1, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' +}); +*/ + + req.startTimer(); + +}); \ No newline at end of file diff --git a/module/web/media/default/js/jquery-1.3.2.min.js b/module/web/media/default/js/jquery-1.3.2.min.js new file mode 100644 index 000000000..b1ae21d8b --- /dev/null +++ b/module/web/media/default/js/jquery-1.3.2.min.js @@ -0,0 +1,19 @@ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ +(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js b/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js new file mode 100644 index 000000000..cf19f30a9 --- /dev/null +++ b/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js @@ -0,0 +1,298 @@ +/* + * jQuery UI 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI + */ +jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* + * jQuery UI Draggable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/* + * jQuery UI Droppable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Droppables + * + * Depends: + * ui.core.js + * ui.draggable.js + */ +(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/* + * jQuery UI Resizable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Resizables + * + * Depends: + * ui.core.js + */ +(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* + * jQuery UI Selectable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/* + * jQuery UI Sortable 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Sortables + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* + * jQuery UI Accordion 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Accordion + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* + * jQuery UI Dialog 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * ui.core.js + * ui.draggable.js + * ui.resizable.js + */ +(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/* + * jQuery UI Slider 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Slider + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* + * jQuery UI Tabs 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading…</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/* + * jQuery UI Datepicker 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Datepicker + * + * Depends: + * ui.core.js + */ +(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* + * jQuery UI Progressbar 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * ui.core.js + */ +(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* + * jQuery UI Effects 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/* + * jQuery UI Effects Blind 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Blind + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Bounce 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Bounce + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Clip 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Clip + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Drop 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Drop + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Explode 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Explode + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* + * jQuery UI Effects Fold 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* + * jQuery UI Effects Highlight 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Pulsate 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Scale 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Scale + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Shake 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Shake + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* + * jQuery UI Effects Slide 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Slide + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* + * jQuery UI Effects Transfer 1.7.2 + * + * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT (MIT-LICENSE.txt) + * and GPL (GPL-LICENSE.txt) licenses. + * + * http://docs.jquery.com/UI/Effects/Transfer + * + * Depends: + * effects.core.js + */ +(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/module/web/media/default/js/jquery.progressbar.js b/module/web/media/default/js/jquery.progressbar.js new file mode 100644 index 000000000..7ddf4a558 --- /dev/null +++ b/module/web/media/default/js/jquery.progressbar.js @@ -0,0 +1,183 @@ +/* + * jQuery Progress Bar plugin + * Version 2.0 (06/22/2009) + * @requires jQuery v1.2.1 or later + * + * Copyright (c) 2008 Gary Teo + * http://t.wits.sg + +USAGE: + $(".someclass").progressBar(); + $("#progressbar").progressBar(); + $("#progressbar").progressBar(45); // percentage + $("#progressbar").progressBar({showText: false }); // percentage with config + $("#progressbar").progressBar(45, {showText: false }); // percentage with config +*/ +(function($) { + $.extend({ + progressBar: new function() { + + this.defaults = { + steps : 20, // steps taken to reach target + step_duration : 20, + max : 100, // Upon 100% i'd assume, but configurable + showText : true, // show text with percentage in next to the progressbar? - default : true + textFormat : 'percentage', // Or otherwise, set to 'fraction' + width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' + height : 12, // Height of the progressbar - don't forget to adjust your image too!!! + callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc + boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar + barImage : { + 0: '/media/img/progressbg_red.gif', + 30: '/media/img/progressbg_orange.gif', + 70: '/media/img/progressbg_green.gif' + }, + + + // Internal use + running_value : 0, + value : 0, + image : null + }; + + /* public methods */ + this.construct = function(arg1, arg2) { + var argvalue = null; + var argconfig = null; + + if (arg1 != null) { + if (!isNaN(arg1)) { + argvalue = arg1; + if (arg2 != null) { + argconfig = arg2; + } + } else { + argconfig = arg1; + } + } + + return this.each(function(child) { + var pb = this; + var config = this.config; + + if (argvalue != null && this.bar != null && this.config != null) { + this.config.value = argvalue + if (argconfig != null) + pb.config = $.extend(this.config, argconfig); + config = pb.config; + } else { + var $this = $(this); + var config = $.extend({}, $.progressBar.defaults, argconfig); + config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided + + if (argvalue == null) + argvalue = $this.html().replace("%","") // parse percentage + + config.value = argvalue; + config.running_value = 0; + config.image = getBarImage(config); + + $this.html(""); + var bar = document.createElement('img'); + var text = document.createElement('span'); + var $bar = $(bar); + var $text = $(text); + pb.bar = $bar; + + $bar.attr('id', config.id + "_pbImage"); + $text.attr('id', config.id + "_pbText"); + $text.html(getText(config)); + $bar.attr('title', getText(config)); + $bar.attr('alt', getText(config)); + $bar.attr('src', config.boxImage); + $bar.attr('width', config.width); + $bar.css("width", config.width + "px"); + $bar.css("height", config.height + "px"); + $bar.css("background-image", "url(" + config.image + ")"); + $bar.css("background-position", ((config.width * -1)) + 'px 50%'); + $bar.css("padding", "0"); + $bar.css("margin", "0"); + $this.append($bar); + $this.append($text); + } + + function getPercentage(config) { + return config.running_value * 100 / config.max; + } + + function getBarImage(config) { + var image = config.barImage; + if (typeof(config.barImage) == 'object') { + for (var i in config.barImage) { + if (config.running_value >= parseInt(i)) { + image = config.barImage[i]; + } else { break; } + } + } + return image; + } + + function getText(config) { + if (config.showText) { + if (config.textFormat == 'percentage') { + return " " + Math.round(config.running_value) + "%"; + } else if (config.textFormat == 'fraction') { + return " " + config.running_value + '/' + config.max; + } + } + } + + config.increment = Math.round((config.value - config.running_value)/config.steps); + if (config.increment < 0) + config.increment *= -1; + if (config.increment < 1) + config.increment = 1; + + var t = setInterval(function() { + var pixels = config.width / 100; // Define how many pixels go into 1% + var stop = false; + + if (config.running_value > config.value) { + if (config.running_value - config.increment < config.value) { + config.running_value = config.value; + } else { + config.running_value -= config.increment; + } + } + else if (config.running_value < config.value) { + if (config.running_value + config.increment > config.value) { + config.running_value = config.value; + } else { + config.running_value += config.increment; + } + } + + if (config.running_value == config.value) + clearInterval(t); + + var $bar = $("#" + config.id + "_pbImage"); + var $text = $("#" + config.id + "_pbText"); + var image = getBarImage(config); + if (image != config.image) { + $bar.css("background-image", "url(" + image + ")"); + config.image = image; + } + $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); + $bar.attr('title', getText(config)); + $text.html(getText(config)); + + if (config.callback != null && typeof(config.callback) == 'function') + config.callback(config); + + pb.config = config; + }, config.step_duration); + }); + }; + } + }); + + $.fn.extend({ + progressBar: $.progressBar.construct + }); + +})(jQuery); \ No newline at end of file diff --git a/module/web/media/default/js/jquery.timers-1.2.js b/module/web/media/default/js/jquery.timers-1.2.js new file mode 100644 index 000000000..ad22e93ce --- /dev/null +++ b/module/web/media/default/js/jquery.timers-1.2.js @@ -0,0 +1,138 @@ +/** + * jQuery.timers - Timer abstractions for jQuery + * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) + * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). + * Date: 2009/10/16 + * + * @author Blair Mitchelmore + * @version 1.2 + * + **/ + +jQuery.fn.extend({ + everyTime: function(interval, label, fn, times) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, times); + }); + }, + oneTime: function(interval, label, fn) { + return this.each(function() { + jQuery.timer.add(this, interval, label, fn, 1); + }); + }, + stopTime: function(label, fn) { + return this.each(function() { + jQuery.timer.remove(this, label, fn); + }); + } +}); + +jQuery.extend({ + timer: { + global: [], + guid: 1, + dataKey: "jQuery.timer", + regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, + powers: { + // Yeah this is major overkill... + 'ms': 1, + 'cs': 10, + 'ds': 100, + 's': 1000, + 'das': 10000, + 'hs': 100000, + 'ks': 1000000 + }, + timeParse: function(value) { + if (value == undefined || value == null) + return null; + var result = this.regex.exec(jQuery.trim(value.toString())); + if (result[2]) { + var num = parseFloat(result[1]); + var mult = this.powers[result[2]] || 1; + return num * mult; + } else { + return value; + } + }, + add: function(element, interval, label, fn, times) { + var counter = 0; + + if (jQuery.isFunction(label)) { + if (!times) + times = fn; + fn = label; + label = interval; + } + + interval = jQuery.timer.timeParse(interval); + + if (typeof interval != 'number' || isNaN(interval) || interval < 0) + return; + + if (typeof times != 'number' || isNaN(times) || times < 0) + times = 0; + + times = times || 0; + + var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); + + if (!timers[label]) + timers[label] = {}; + + fn.timerID = fn.timerID || this.guid++; + + var handler = function() { + if ((++counter > times && times !== 0) || fn.call(element, counter) === false) + jQuery.timer.remove(element, label, fn); + }; + + handler.timerID = fn.timerID; + + if (!timers[label][fn.timerID]) + timers[label][fn.timerID] = window.setInterval(handler,interval); + + this.global.push( element ); + + }, + remove: function(element, label, fn) { + var timers = jQuery.data(element, this.dataKey), ret; + + if ( timers ) { + + if (!label) { + for ( label in timers ) + this.remove(element, label, fn); + } else if ( timers[label] ) { + if ( fn ) { + if ( fn.timerID ) { + window.clearInterval(timers[label][fn.timerID]); + delete timers[label][fn.timerID]; + } + } else { + for ( var fn in timers[label] ) { + window.clearInterval(timers[label][fn]); + delete timers[label][fn]; + } + } + + for ( ret in timers[label] ) break; + if ( !ret ) { + ret = null; + delete timers[label]; + } + } + + for ( ret in timers ) break; + if ( !ret ) + jQuery.removeData(element, this.dataKey); + } + } + } +}); + +jQuery(window).bind("unload", function() { + jQuery.each(jQuery.timer.global, function(index, item) { + jQuery.timer.remove(item); + }); +}); \ No newline at end of file diff --git a/module/web/media/default/js/mootools-1.2.3-core.js b/module/web/media/default/js/mootools-1.2.3-core.js new file mode 100644 index 000000000..25f1f9d03 --- /dev/null +++ b/module/web/media/default/js/mootools-1.2.3-core.js @@ -0,0 +1,335 @@ +//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License. + +var MooTools={version:"1.2.3",build:"4980aa0fb74d2f6eb80bcd9f5b8e1fd6fbb8f607"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; +var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; +if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; +}if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); +}}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); +}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); +return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); +};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true}); +}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]}; +for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean()); +}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this); +}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++; +}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each"); +function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; +};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); +((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; +}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments); +a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; +}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; +b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); +return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a; +b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name; +}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; +}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); +}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); +},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); +},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; +Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true; +break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP"); +});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description; +},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; +})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); +a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; +var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); +if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}; +}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; +new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0]; +a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true); +});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null; +});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}}; +new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; +},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); +},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; +for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; +}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; +for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1; +},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; +},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; +},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; +for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]); +}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")"; +},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16); +b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; +b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); +}var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return $try(e); +}return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); +},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})(); +},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})(); +}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0; +a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each"); +(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a); +})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this); +},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); +},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); +});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); +},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); +return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; +var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); +}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; +});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; +},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); +},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; +},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); +return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); +},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; +}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; +Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; +Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; +});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); +var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; +var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; +if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; +var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; +if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; +break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; +}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); +}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; +}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); +a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); +}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); +break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; +},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); +}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); +}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); +if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; +if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; +this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); +}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); +},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; +},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; +this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); +if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); +if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); +}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); +}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); +if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); +delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); +if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; +if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); +if(g){g=($type(f)=="element");}}return(g)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined}); +var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); +c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); +new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype);}e.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow; +});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); +f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; +}e.push(d);}f=e;}return(b.cash)?$extend(f,this):f;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a); +}:a,b));}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;}a+=" "+c+'="'+b[c]+'"'; +if(c!="checked"){delete b[c];}});a="<"+a+">";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); +},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; +},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); +}return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; +};})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); +}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true)); +}}return new Elements(f);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b); +},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; +},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; +var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); +n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; +}}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); +}if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); +}q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; +var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; +b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); +}},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); +},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); +return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); +}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); +return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); +return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); +return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); +return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; +(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); +}return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); +},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); +},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); +l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); +},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); +},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); +},getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); +},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; +},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; +}}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; +}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; +this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; +}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); +}});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); +v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; +if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); +},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); +});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; +}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); +},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; +n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); +}return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; +},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; +return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; +},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); +}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]}; +a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; +for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; +}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); +}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; +}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); +}return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); +if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; +}var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); +}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; +},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; +}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; +},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); +},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); +}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); +};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); +})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; +}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; +}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); +},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; +}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; +}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); +case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; +}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); +if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; +b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; +}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); +}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; +var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; +f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); +}else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; +}return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; +}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var m=this.getBoundingClientRect(),k=document.id(this.getDocument().documentElement),i=k.getScroll(),n=(d(this,"position")=="fixed"); +return{x:parseInt(m.left,10)+((n)?0:i.x)-k.clientLeft,y:parseInt(m.top,10)+((n)?0:i.y)-k.clientTop};}var j=this,h={x:0,y:0};if(b(this)){return h;}while(j&&!b(j)){h.x+=j.offsetLeft; +h.y+=j.offsetTop;if(Browser.Engine.gecko){if(!f(j)){h.x+=c(j);h.y+=g(j);}var l=j.parentNode;if(l&&d(l,"overflow")!="visible"){h.x+=c(l);h.y+=g(l);}}else{if(j!=this&&Browser.Engine.webkit){h.x+=c(j); +h.y+=g(j);}}j=j.offsetParent;}if(Browser.Engine.gecko&&!f(this)){h.x-=c(this);h.y-=g(this);}return h;},getPosition:function(k){if(b(this)){return{x:0,y:0}; +}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}; +},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y}; +k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; +},setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); +return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); +return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; +},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; +}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); +}function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; +}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; +},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; +},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; +}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e); +if(d!=0&&f.item){f=$A(f);}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f);}return new Elements(c,{ddup:(h.length>1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; +}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); +return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; +Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; +}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; +if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; +break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; +break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; +}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); +}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); +}}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; +}return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; +},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; +d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; +if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); +return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); +return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y); +continue;}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r);}else{var d={},g=[];for(var x=0,w=p.length; +x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d);}p=g;}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A); +}}p=e;}}return p;}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f); +}}return h;},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b); +}}return h;},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}break;}}return c;},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b)); +},byClass:function(b,a){return(b.className&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d); +if(!a){return(b=="!=");}if(!b||e==undefined){return true;}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); +case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; +}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a); +},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this; +while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false; +}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g); +if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e);}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this; +while((b=b.previousSibling)){if(b.nodeType!=1){continue;}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break;}}e.positions[d]=f;}return(e.positions[d]%c.a==c.b); +},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); +},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); +}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; +window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll(); +return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); +})();}else{window.addEvent("load",b);document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); +},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; +case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); +case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; +}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; +this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; +}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); +this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a); +},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); +return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition(); +this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel(); +}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject); +}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer(); +return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false; +}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c; +};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; +b[0]=d.getStyle(e);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a); +return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return;}var d=f.parse(c);if($chk(d)){b={value:d,parser:f};}}); +b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser}); +});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b)); +});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href; +if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return;}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase(); +}):null;if(!h||!h.test("^"+a+"$")){return;}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k; +});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true); +}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a)); +});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}}); +Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b; +b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; +}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); +}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a)); +},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options"))); +}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; +c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1); +e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); +a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); +b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); +},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; +for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; +for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph"); +if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a); +}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a); +return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":"); +a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(b,a){a=$splat(a); +return $extend(b,{easeIn:function(c){return b(c,a);},easeOut:function(c){return 1-b(1-c,a);},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2; +}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6); +},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2); +},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2); +break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]); +});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); +this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; +}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; +this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); +},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); +},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); +return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; +}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=k.url,a=k.method.toLowerCase(); +switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; +g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; +this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; +}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); +this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); +}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; +}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; +["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); +return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); +}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); +}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); +b.send({data:this,url:a||b.options.url});return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a); +this.headers.extend({Accept:"application/json","X-Request":"JSON"});},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a); +}}); \ No newline at end of file diff --git a/module/web/media/default/js/mootools-1.2.3.1-more.js b/module/web/media/default/js/mootools-1.2.3.1-more.js new file mode 100644 index 000000000..f3e4b4121 --- /dev/null +++ b/module/web/media/default/js/mootools-1.2.3.1-more.js @@ -0,0 +1,76 @@ +//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. + +MooTools.More={version:"1.2.3.1"};Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d];if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous; +this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;});}else{b.implement(d,e);}});return b;};Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth); +};if(g(this)){return e.apply(this);}var d=this.getParent(),b=[],f=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); +var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; +this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); +var d={};var c=function(f,e){return(e.computeSize)?f.getComputedSize(e):f.getSize();};if(this.getStyle("display")=="none"){d=this.measure(function(){return c(this,a); +});}else{try{d=c(this,a);}catch(b){}}return $chk(d.x)?$extend(d,{width:d.x,height:d.y}):$extend(d,{x:d.width,y:d.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); +var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; +break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; +b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=0;c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; +b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); +c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; +c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();},hide:function(){var b;try{if("none"!=this.getStyle("display")){b=this.getStyle("display"); +}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none");},show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block"); +},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); +this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; +},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this; +}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j); +}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; +this.showing=false;this.hidden=true;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var g=(this.element.style.height===""||this.element.style.height=="auto"); +this.element.setStyle("display","block");if(this.options.transitionOpacity){d.opacity=1;}var b={};$each(d,function(h,e){b[e]=[h,0];},this);var f=this.element.getStyle("overflow"); +this.element.setStyle("overflow","hidden");var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false; +$each(d,function(h,e){d[e]=h;},this);this.element.setStyles($merge({display:"none",overflow:f},d));if(g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; +}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(a){a.setStyle("visibility","visible");}}this.fireEvent("hide",this.element); +this.callChain();}.bind(this));if(a){a.setStyle("visibility","hidden");}this.start(b);}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this));}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel(); +this.dissolve();}}}}catch(c){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}return this;},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true; +this.hiding=false;this.hidden=false;var g,d;this.element.measure(function(){g=(this.element.style.height===""||this.element.style.height=="auto");d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +}.bind(this));$each(d,function(h,e){d[e]=h;});if($chk(this.options.heightOverride)){d.height=this.options.heightOverride.toInt();}if($chk(this.options.widthOverride)){d.width=this.options.widthOverride.toInt(); +}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=1;}var b={height:0,display:this.options.display};$each(d,function(h,e){b[e]=0; +});var f=this.element.getStyle("overflow");this.element.setStyles($merge(b,{overflow:"hidden"}));var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null; +if(a){a.setStyle("visibility","hidden");}this.start(d);this.$chain.unshift(function(){this.element.setStyle("overflow",f);if(!this.options.heightOverride&&g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; +}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(!this.hidden){this.showing=false;}if(a){a.setStyle("visibility","visible"); +}this.callChain();this.fireEvent("show",this.element);}.bind(this));}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element); +}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal(); +}}}}catch(c){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("show",this.element);}return this;},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal(); +}else{this.dissolve();}return this;}});Element.Properties.reveal={set:function(a){var b=this.retrieve("reveal");if(b){b.cancel();}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},a)); +},get:function(a){if(a||!this.retrieve("reveal")){if(a||!this.retrieve("reveal:options")){this.set("reveal",a);}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options"))); +}return this.retrieve("reveal");}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal",a).reveal(); +return this;},dissolve:function(a){this.get("reveal",a).dissolve();return this;},nix:function(){var a=Array.link(arguments,{destroy:Boolean.type,options:Object.type}); +this.get("reveal",a.options).dissolve().chain(function(){this[a.destroy?"destroy":"dispose"]();}.bind(this));return this;},wink:function(){var b=Array.link(arguments,{duration:Number.type,options:Object.type}); +var a=this.get("reveal",b.options);a.reveal().chain(function(){(function(){a.dissolve();}).delay(b.duration||2000);});}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0); +if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(b);this.parent(a);var c=this.element.retrieve("wrapper"); +this.wrapper=c||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0); +this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left"; +this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]); +return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this; +}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]]; +var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a); +},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode](); +this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide"); +if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a); +}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,e){d=d||"toggle"; +var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); +this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(b,a){this.parent(b,a); +this.elements.each(function(c){if(c.getStyle("position")=="static"){c.setStyle("position","relative");}});this.setDefaultOrder();},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(b,a){return a; +});},sort:function(e){if($type(e)!="array"){return false;}var i=0;var a=0;var h={};var d=this.options.mode=="vertical";var f=this.elements.map(function(m,j){var l=m.getComputedSize({styles:["border","padding","margin"]}); +var n;if(d){n={top:i,margin:l["margin-top"],height:l.totalHeight};i+=n.height-l["margin-top"];}else{n={left:a,margin:l["margin-left"],width:l.totalWidth}; +a+=n.width;}var k=d?"top":"left";h[j]={};var o=m.getStyle(k).toInt();h[j][k]=o||0;return n;},this);this.set(h);e=e.map(function(j){return j.toInt();}); +if(e.length!=this.elements.length){this.currentOrder.each(function(j){if(!e.contains(j)){e.push(j);}});if(e.length>this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); +}}i=0;a=0;var b=0;var c={};e.each(function(l,j){var k={};if(d){k.top=i-f[l].top-b;i+=f[l].height;}else{k.left=a-f[l].left;a+=f[l].width;}b=b+f[l].margin; +c[l]=k;},this);var g={};$A(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; +var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); +},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; +});},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());},reverse:function(){return this.sort(this.currentOrder.reverse()); +},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b);},this));},swap:function(c,b){if($type(c)=="element"){c=this.elements.indexOf(c); +}if($type(b)=="element"){b=this.elements.indexOf(b);}var a=$A(this.currentOrder);a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;this.sort(a); +}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=(function(){if(!this.running){this.send({data:b}); +}});this.timer=a.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(c){$clear(this.timer);if(c){this.lastDelay=this.options.delay; +}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit);}this.timer=a.delay(this.lastDelay,this);};this.addEvent("complete",this.completeCheck); +return this;},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this;}}); \ No newline at end of file diff --git a/module/web/media/default/js/sprintf.js b/module/web/media/default/js/sprintf.js new file mode 100644 index 000000000..30d9046de --- /dev/null +++ b/module/web/media/default/js/sprintf.js @@ -0,0 +1,123 @@ +// JavaScript Document +sprintfWrapper = { + + init : function () { + + if (typeof arguments == "undefined") { return null; } + if (arguments.length < 1) { return null; } + if (typeof arguments[0] != "string") { return null; } + if (typeof RegExp == "undefined") { return null; } + + var string = arguments[0]; + var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); + var matches = new Array(); + var strings = new Array(); + var convCount = 0; + var stringPosStart = 0; + var stringPosEnd = 0; + var matchPosEnd = 0; + var newString = ''; + var match = null; + + while (match = exp.exec(string)) { + if (match[9]) { convCount += 1; } + + stringPosStart = matchPosEnd; + stringPosEnd = exp.lastIndex - match[0].length; + strings[strings.length] = string.substring(stringPosStart, stringPosEnd); + + matchPosEnd = exp.lastIndex; + matches[matches.length] = { + match: match[0], + left: match[3] ? true : false, + sign: match[4] || '', + pad: match[5] || ' ', + min: match[6] || 0, + precision: match[8], + code: match[9] || '%', + negative: parseInt(arguments[convCount]) < 0 ? true : false, + argument: String(arguments[convCount]) + }; + } + strings[strings.length] = string.substring(matchPosEnd); + + if (matches.length == 0) { return string; } + if ((arguments.length - 1) < convCount) { return null; } + + var code = null; + var match = null; + var i = null; + + for (i=0; i<matches.length; i++) { + + if (matches[i].code == '%') { substitution = '%' } + else if (matches[i].code == 'b') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'c') { + matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'd') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'f') { + matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'o') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 's') { + matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) + substitution = sprintfWrapper.convert(matches[i], true); + } + else if (matches[i].code == 'x') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]); + } + else if (matches[i].code == 'X') { + matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); + substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); + } + else { + substitution = matches[i].match; + } + + newString += strings[i]; + newString += substitution; + + } + newString += strings[i]; + + return newString; + + }, + + convert : function(match, nosign){ + if (nosign) { + match.sign = ''; + } else { + match.sign = match.negative ? '-' : match.sign; + } + var l = match.min - match.argument.length + 1 - match.sign.length; + var pad = new Array(l < 0 ? 0 : l).join(match.pad); + if (!match.left) { + if (match.pad == "0" || nosign) { + return match.sign + pad + match.argument; + } else { + return pad + match.sign + match.argument; + } + } else { + if (match.pad == "0" || nosign) { + return match.sign + match.argument + pad.replace(/0/g, ' '); + } else { + return match.sign + match.argument + pad; + } + } + } +} +sprintf = sprintfWrapper.init; \ No newline at end of file diff --git a/module/web/media/default/js/status.js b/module/web/media/default/js/status.js new file mode 100644 index 000000000..3923e80ca --- /dev/null +++ b/module/web/media/default/js/status.js @@ -0,0 +1,100 @@ +/* hover! */ +Element.implement({ + 'hover': function(fn1,fn2) { + return this.addEvents({ + 'mouseenter': function(e) { + fn1.attempt(e,this); + }, + 'mouseleave': function(e) { + fn2.attempt(e,this); + } + }) + } +}); + +function updateStatus(data){ + + document.id("status").textContent = "Status: "+ data.status; + document.id("speed").textContent = "Speed: "+ data.speed +" kb/s"; + document.id("queue").textContent = "Files in queue: "+ data.queue; + +} + + +status_req = new Request.JSON({ + onSuccess: updateStatus, + method: 'get', + url: '/json/status', + initialDelay: 0, + delay: 2000, + limit: 20000 +}); + +window.addEvent('domready', function(){ + + status_req.startTimer(); + + + document.id("btAdd").addEvent("click", function(e){ + + new Request({ + method: 'post', + url: '/json/addpackage', + onSuccess: function(){ + document.id('linkarea').value = "" + } + }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) + + + }) + + $$('.statusbutton').each(function(item){ + + item.hover(function(e){ + this.tween('opacity',1) + },function(e){ + this.tween('opacity',0.01) + } + ) + }) + + fx_reveal = new Fx.Reveal($('addlinks')); + //fx_reveal.dissolve() + + + $$('#addlinks .closeSticky').each(function(el){ + + el.addEvent('click',function(e){ + + fx_reveal.dissolve(); + + }); + + }); + + $$('.statusbutton')[2].addEvent('click',function(e){ + + $('addlinks').setStyle('top', e.page.y + 5) + $('addlinks').setStyle('left', e.page.x + 5) + + fx_reveal.reveal() + + }); + + $$('.statusbutton')[0].addEvent('click', function(e){ + + new Request({ + 'url' : '/json/play', + 'method' : 'get' + }).send() + }) + + $$('.statusbutton')[1].addEvent('click', function(e){ + + new Request({ + 'url' : '/json/pause', + 'method' : 'get' + }).send() + }) + +}); \ No newline at end of file diff --git a/module/web/media/img/Button-Add-grey.png b/module/web/media/img/Button-Add-grey.png deleted file mode 100644 index 6659e230e..000000000 Binary files a/module/web/media/img/Button-Add-grey.png and /dev/null differ diff --git a/module/web/media/img/Button-Add.png b/module/web/media/img/Button-Add.png deleted file mode 100644 index 602da4131..000000000 Binary files a/module/web/media/img/Button-Add.png and /dev/null differ diff --git a/module/web/media/img/Button-Pause-grey.png b/module/web/media/img/Button-Pause-grey.png deleted file mode 100644 index d1017e974..000000000 Binary files a/module/web/media/img/Button-Pause-grey.png and /dev/null differ diff --git a/module/web/media/img/Button-Pause.png b/module/web/media/img/Button-Pause.png deleted file mode 100644 index 68f3ffc3a..000000000 Binary files a/module/web/media/img/Button-Pause.png and /dev/null differ diff --git a/module/web/media/img/Button-Play-grey.png b/module/web/media/img/Button-Play-grey.png deleted file mode 100644 index 9f44c2289..000000000 Binary files a/module/web/media/img/Button-Play-grey.png and /dev/null differ diff --git a/module/web/media/img/Button-Play.png b/module/web/media/img/Button-Play.png deleted file mode 100644 index 1ce1ed913..000000000 Binary files a/module/web/media/img/Button-Play.png and /dev/null differ diff --git a/module/web/media/img/big_button.gif b/module/web/media/img/big_button.gif deleted file mode 100644 index 7680490ea..000000000 Binary files a/module/web/media/img/big_button.gif and /dev/null differ diff --git a/module/web/media/img/big_button_over.gif b/module/web/media/img/big_button_over.gif deleted file mode 100644 index 2e3ee10d2..000000000 Binary files a/module/web/media/img/big_button_over.gif and /dev/null differ diff --git a/module/web/media/img/body.png b/module/web/media/img/body.png deleted file mode 100644 index 7ff1043e0..000000000 Binary files a/module/web/media/img/body.png and /dev/null differ diff --git a/module/web/media/img/closebtn.gif b/module/web/media/img/closebtn.gif deleted file mode 100644 index 3e27e6030..000000000 Binary files a/module/web/media/img/closebtn.gif and /dev/null differ diff --git a/module/web/media/img/cog.png b/module/web/media/img/cog.png deleted file mode 100644 index 67de2c6cc..000000000 Binary files a/module/web/media/img/cog.png and /dev/null differ diff --git a/module/web/media/img/control_cancel.png b/module/web/media/img/control_cancel.png deleted file mode 100644 index 7b9bc3fba..000000000 Binary files a/module/web/media/img/control_cancel.png and /dev/null differ diff --git a/module/web/media/img/control_cancel_blue.png b/module/web/media/img/control_cancel_blue.png deleted file mode 100644 index 0c5c96ce3..000000000 Binary files a/module/web/media/img/control_cancel_blue.png and /dev/null differ diff --git a/module/web/media/img/control_pause.png b/module/web/media/img/control_pause.png deleted file mode 100644 index 2d9ce9c4e..000000000 Binary files a/module/web/media/img/control_pause.png and /dev/null differ diff --git a/module/web/media/img/control_pause_blue.png b/module/web/media/img/control_pause_blue.png deleted file mode 100644 index ec61099b0..000000000 Binary files a/module/web/media/img/control_pause_blue.png and /dev/null differ diff --git a/module/web/media/img/control_play.png b/module/web/media/img/control_play.png deleted file mode 100644 index 0846555d0..000000000 Binary files a/module/web/media/img/control_play.png and /dev/null differ diff --git a/module/web/media/img/control_play_blue.png b/module/web/media/img/control_play_blue.png deleted file mode 100644 index f8c8ec683..000000000 Binary files a/module/web/media/img/control_play_blue.png and /dev/null differ diff --git a/module/web/media/img/control_stop.png b/module/web/media/img/control_stop.png deleted file mode 100644 index 893bb60e5..000000000 Binary files a/module/web/media/img/control_stop.png and /dev/null differ diff --git a/module/web/media/img/control_stop_blue.png b/module/web/media/img/control_stop_blue.png deleted file mode 100644 index e6f75d232..000000000 Binary files a/module/web/media/img/control_stop_blue.png and /dev/null differ diff --git a/module/web/media/img/drag_corner.gif b/module/web/media/img/drag_corner.gif deleted file mode 100644 index befb1adf1..000000000 Binary files a/module/web/media/img/drag_corner.gif and /dev/null differ diff --git a/module/web/media/img/full.png b/module/web/media/img/full.png deleted file mode 100644 index fea52af76..000000000 Binary files a/module/web/media/img/full.png and /dev/null differ diff --git a/module/web/media/img/head-login.png b/module/web/media/img/head-login.png deleted file mode 100644 index b59b7cbbf..000000000 Binary files a/module/web/media/img/head-login.png and /dev/null differ diff --git a/module/web/media/img/head-menu-development.png b/module/web/media/img/head-menu-development.png deleted file mode 100644 index 8ef08e2e5..000000000 Binary files a/module/web/media/img/head-menu-development.png and /dev/null differ diff --git a/module/web/media/img/head-menu-download.png b/module/web/media/img/head-menu-download.png deleted file mode 100644 index 98c5da9db..000000000 Binary files a/module/web/media/img/head-menu-download.png and /dev/null differ diff --git a/module/web/media/img/head-menu-home.png b/module/web/media/img/head-menu-home.png deleted file mode 100644 index 9d62109aa..000000000 Binary files a/module/web/media/img/head-menu-home.png and /dev/null differ diff --git a/module/web/media/img/head-menu-index.png b/module/web/media/img/head-menu-index.png deleted file mode 100644 index 44d631064..000000000 Binary files a/module/web/media/img/head-menu-index.png and /dev/null differ diff --git a/module/web/media/img/head-menu-news.png b/module/web/media/img/head-menu-news.png deleted file mode 100644 index 43950ebc9..000000000 Binary files a/module/web/media/img/head-menu-news.png and /dev/null differ diff --git a/module/web/media/img/head-menu-recent.png b/module/web/media/img/head-menu-recent.png deleted file mode 100644 index fc9b0497f..000000000 Binary files a/module/web/media/img/head-menu-recent.png and /dev/null differ diff --git a/module/web/media/img/head-menu-wiki.png b/module/web/media/img/head-menu-wiki.png deleted file mode 100644 index 07cf0102d..000000000 Binary files a/module/web/media/img/head-menu-wiki.png and /dev/null differ diff --git a/module/web/media/img/head-search-noshadow.png b/module/web/media/img/head-search-noshadow.png deleted file mode 100644 index aafdae015..000000000 Binary files a/module/web/media/img/head-search-noshadow.png and /dev/null differ diff --git a/module/web/media/img/head_bg1.png b/module/web/media/img/head_bg1.png deleted file mode 100644 index f2848c3cc..000000000 Binary files a/module/web/media/img/head_bg1.png and /dev/null differ diff --git a/module/web/media/img/page-tools-backlinks.png b/module/web/media/img/page-tools-backlinks.png deleted file mode 100644 index 3eb6a9ce3..000000000 Binary files a/module/web/media/img/page-tools-backlinks.png and /dev/null differ diff --git a/module/web/media/img/page-tools-edit.png b/module/web/media/img/page-tools-edit.png deleted file mode 100644 index 188e1c12b..000000000 Binary files a/module/web/media/img/page-tools-edit.png and /dev/null differ diff --git a/module/web/media/img/page-tools-revisions.png b/module/web/media/img/page-tools-revisions.png deleted file mode 100644 index 5c3b8587f..000000000 Binary files a/module/web/media/img/page-tools-revisions.png and /dev/null differ diff --git a/module/web/media/img/progress-bar-back.gif b/module/web/media/img/progress-bar-back.gif deleted file mode 100644 index 0c8f68211..000000000 Binary files a/module/web/media/img/progress-bar-back.gif and /dev/null differ diff --git a/module/web/media/img/progress-bar.gif b/module/web/media/img/progress-bar.gif deleted file mode 100644 index 746f77175..000000000 Binary files a/module/web/media/img/progress-bar.gif and /dev/null differ diff --git a/module/web/media/img/progressbar.gif b/module/web/media/img/progressbar.gif deleted file mode 100644 index abe588c15..000000000 Binary files a/module/web/media/img/progressbar.gif and /dev/null differ diff --git a/module/web/media/img/progressbg_black.gif b/module/web/media/img/progressbg_black.gif deleted file mode 100644 index 74fd1f9b3..000000000 Binary files a/module/web/media/img/progressbg_black.gif and /dev/null differ diff --git a/module/web/media/img/progressbg_green.gif b/module/web/media/img/progressbg_green.gif deleted file mode 100644 index f3f3bf681..000000000 Binary files a/module/web/media/img/progressbg_green.gif and /dev/null differ diff --git a/module/web/media/img/progressbg_orange.gif b/module/web/media/img/progressbg_orange.gif deleted file mode 100644 index 808cac7cf..000000000 Binary files a/module/web/media/img/progressbg_orange.gif and /dev/null differ diff --git a/module/web/media/img/progressbg_red.gif b/module/web/media/img/progressbg_red.gif deleted file mode 100644 index 54dfa135f..000000000 Binary files a/module/web/media/img/progressbg_red.gif and /dev/null differ diff --git a/module/web/media/img/progressbg_yellow.gif b/module/web/media/img/progressbg_yellow.gif deleted file mode 100644 index fdb0dfc98..000000000 Binary files a/module/web/media/img/progressbg_yellow.gif and /dev/null differ diff --git a/module/web/media/img/pyload-logo-edited3.5-new-font-small.png b/module/web/media/img/pyload-logo-edited3.5-new-font-small.png deleted file mode 100644 index 2443cd8b1..000000000 Binary files a/module/web/media/img/pyload-logo-edited3.5-new-font-small.png and /dev/null differ diff --git a/module/web/media/img/tab-background.png b/module/web/media/img/tab-background.png deleted file mode 100644 index 29a5d1991..000000000 Binary files a/module/web/media/img/tab-background.png and /dev/null differ diff --git a/module/web/media/img/tabs-border-bottom.png b/module/web/media/img/tabs-border-bottom.png deleted file mode 100644 index 02440f428..000000000 Binary files a/module/web/media/img/tabs-border-bottom.png and /dev/null differ diff --git a/module/web/media/img/user-actions-logout.png b/module/web/media/img/user-actions-logout.png deleted file mode 100644 index 0010931e2..000000000 Binary files a/module/web/media/img/user-actions-logout.png and /dev/null differ diff --git a/module/web/media/img/user-actions-profile.png b/module/web/media/img/user-actions-profile.png deleted file mode 100644 index 46573fff6..000000000 Binary files a/module/web/media/img/user-actions-profile.png and /dev/null differ diff --git a/module/web/media/js/funktions.js b/module/web/media/js/funktions.js deleted file mode 100644 index ed1471595..000000000 --- a/module/web/media/js/funktions.js +++ /dev/null @@ -1,16 +0,0 @@ -// JavaScript Document -function SecToRightTime(sek) -{ - vreturn = sek > 86400 ? sprintf('%d Tag%s ', sek / 86400, Math.floor(sek / 86400) != 1 ? 'e':'') : ''; - vreturn += sprintf('%02d:%02d:%02d', sek / 3600 % 24, sek / 60 % 60, sek % 60 ); - return vreturn; -} - -function HumanFileSize(size) -{ - var filesizename = new Array("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"); - var loga = Math.log(size)/Math.log(1024); - var i = Math.floor(loga); - var a = Math.pow(1024, i); - return Math.round( size / a , 2) + " " + filesizename[i]; -} \ No newline at end of file diff --git a/module/web/media/js/home.js b/module/web/media/js/home.js deleted file mode 100644 index 025dcfcc7..000000000 --- a/module/web/media/js/home.js +++ /dev/null @@ -1,205 +0,0 @@ -var dwProgressBar = new Class({ - - //implements - Implements: [Options], - - //options - options: { - container: $$('body')[0], - boxID: '', - percentageID: '', - displayID: '', - startPercentage: 0, - displayText: false, - speed: 10 - }, - - //initialization - initialize: function(options) { - //set options - this.setOptions(options); - //create elements - this.createElements(); - }, - - //creates the box and percentage elements - createElements: function() { - var box = new Element('div', { - id: this.options.boxID + this.options.id, - 'class': this.options.boxID - }); - var perc = new Element('div', { - id: this.options.percentageID + this.options.id, - 'style': 'width:0px;', - 'class': this.options.percentageID - }); - perc.inject(box); - box.inject(this.options.container); - if (this.options.displayText) { - var text = new Element('div', { - id: this.options.displayID + this.options.id, - 'class': this.options.displayID - }); - text.inject(this.options.container); - } - this.set(this.options.startPercentage); - }, - - //calculates width in pixels from percentage - calculate: function(percentage) { - return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); - }, - - //animates the change in percentage - animate: function(to) { - document.id(this.options.percentageID + this.options.id).set('morph', { - duration: this.options.speed, - link: 'cancel' - }).morph({ - width: this.calculate(to.toInt()) - }); - if (this.options.displayText) { - document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); - } - }, - - //sets the percentage from its current state to desired percentage - set: function(to) { - this.animate(to); - } - -}); - -req = new Request.JSON({ - onSuccess: renderTable, - method: 'get', - url: '/json/links', - initialDelay: 0, - delay: 1000, - limit: 20000 -}); - -var dls = [] -var pbs = [] - -function renderTable(data) { - - data.downloads.each(function(dl) { - - if (dls.contains(dl.id)) { - - var div = $('dl' + dl.id) - - pbs[dl.id].set(dl.percent) - - div.getChildren("b")[0].textContent = dl.name - - if (dl.status == "downloading") { - - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; - speed = Math.round(dl.speed) + " kb/s"; - eta = dl.eta; - - } else if (dl.status == "waiting") { - - size = "waiting " + dl.wait; - speed = ""; - eta = ""; - - } - div.getChildren(".dlsize")[0].textContent = size; - div.getChildren(".dlspeed")[0].textContent = speed; - div.getChildren(".dltime")[0].textContent = eta; - - } else { - - dls.push(dl.id) - - container = $("dlcontainer") - - dldiv = new Element('div', { - 'id': 'dl' + dl.id, - 'class': 'download', - 'styles': { - 'display': 'None' - } - }) - - new Element('p').inject(dldiv) - - new Element('b', { - 'html': dl.name - }).inject(dldiv) - - new Element('br').inject(dldiv) - - dldiv.inject(container) - - pbs[dl.id] = new dwProgressBar({ - container: $(dldiv), - startPercentage: 0, - speed: 1000, - id: dl.id, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' - }); - - new Element('div', { - 'class': 'dlsize', - 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - }).inject(dldiv) - - new Element('div', { - 'class': 'dlspeed', - 'html': Math.round(dl.speed) + " kb/s" - }).inject(dldiv) - - new Element('div', { - 'class': 'dltime', - 'html': dl.eta - }).inject(dldiv) - - //dldiv.dissolve({duration : 0}) - dldiv.reveal() - - } - }) - - dls.each(function(id, index) { - - if (data.ids.contains(id)) { - -} else { - - //$("dl"+id).reveal() - dls.erase(id); - $('dl' + id).nix() - - } - - }) - -} - -window.addEvent('domready', -function() { - - /* -//create the progress bar for example 1 -pb = new dwProgressBar({ - container: $$('.level1 p')[0], - startPercentage: 25, - speed: 1000, - id: 1, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); -*/ - - req.startTimer(); - -}); \ No newline at end of file diff --git a/module/web/media/js/jquery-1.3.2.min.js b/module/web/media/js/jquery-1.3.2.min.js deleted file mode 100644 index b1ae21d8b..000000000 --- a/module/web/media/js/jquery-1.3.2.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/module/web/media/js/jquery-ui-1.7.2.custom.min.js b/module/web/media/js/jquery-ui-1.7.2.custom.min.js deleted file mode 100644 index cf19f30a9..000000000 --- a/module/web/media/js/jquery-ui-1.7.2.custom.min.js +++ /dev/null @@ -1,298 +0,0 @@ -/* - * jQuery UI 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* - * jQuery UI Draggable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/* - * jQuery UI Droppable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Droppables - * - * Depends: - * ui.core.js - * ui.draggable.js - */ -(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/* - * jQuery UI Resizable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * ui.core.js - */ -(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* - * jQuery UI Selectable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/* - * jQuery UI Sortable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* - * jQuery UI Accordion 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Accordion - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* - * jQuery UI Dialog 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * ui.core.js - * ui.draggable.js - * ui.resizable.js - */ -(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/* - * jQuery UI Slider 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Slider - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* - * jQuery UI Tabs 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading…</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/* - * jQuery UI Datepicker 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * ui.core.js - */ -(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* - * jQuery UI Progressbar 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* - * jQuery UI Effects 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/* - * jQuery UI Effects Blind 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Blind - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/* - * jQuery UI Effects Bounce 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Bounce - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Clip 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Clip - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Drop 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Drop - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Explode 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Explode - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* - * jQuery UI Effects Fold 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* - * jQuery UI Effects Highlight 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Pulsate 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Scale 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Scale - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Shake 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Shake - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Slide 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Slide - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Transfer 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Transfer - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/module/web/media/js/jquery.progressbar.js b/module/web/media/js/jquery.progressbar.js deleted file mode 100644 index 7ddf4a558..000000000 --- a/module/web/media/js/jquery.progressbar.js +++ /dev/null @@ -1,183 +0,0 @@ -/* - * jQuery Progress Bar plugin - * Version 2.0 (06/22/2009) - * @requires jQuery v1.2.1 or later - * - * Copyright (c) 2008 Gary Teo - * http://t.wits.sg - -USAGE: - $(".someclass").progressBar(); - $("#progressbar").progressBar(); - $("#progressbar").progressBar(45); // percentage - $("#progressbar").progressBar({showText: false }); // percentage with config - $("#progressbar").progressBar(45, {showText: false }); // percentage with config -*/ -(function($) { - $.extend({ - progressBar: new function() { - - this.defaults = { - steps : 20, // steps taken to reach target - step_duration : 20, - max : 100, // Upon 100% i'd assume, but configurable - showText : true, // show text with percentage in next to the progressbar? - default : true - textFormat : 'percentage', // Or otherwise, set to 'fraction' - width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' - height : 12, // Height of the progressbar - don't forget to adjust your image too!!! - callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc - boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar - barImage : { - 0: '/media/img/progressbg_red.gif', - 30: '/media/img/progressbg_orange.gif', - 70: '/media/img/progressbg_green.gif' - }, - - - // Internal use - running_value : 0, - value : 0, - image : null - }; - - /* public methods */ - this.construct = function(arg1, arg2) { - var argvalue = null; - var argconfig = null; - - if (arg1 != null) { - if (!isNaN(arg1)) { - argvalue = arg1; - if (arg2 != null) { - argconfig = arg2; - } - } else { - argconfig = arg1; - } - } - - return this.each(function(child) { - var pb = this; - var config = this.config; - - if (argvalue != null && this.bar != null && this.config != null) { - this.config.value = argvalue - if (argconfig != null) - pb.config = $.extend(this.config, argconfig); - config = pb.config; - } else { - var $this = $(this); - var config = $.extend({}, $.progressBar.defaults, argconfig); - config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided - - if (argvalue == null) - argvalue = $this.html().replace("%","") // parse percentage - - config.value = argvalue; - config.running_value = 0; - config.image = getBarImage(config); - - $this.html(""); - var bar = document.createElement('img'); - var text = document.createElement('span'); - var $bar = $(bar); - var $text = $(text); - pb.bar = $bar; - - $bar.attr('id', config.id + "_pbImage"); - $text.attr('id', config.id + "_pbText"); - $text.html(getText(config)); - $bar.attr('title', getText(config)); - $bar.attr('alt', getText(config)); - $bar.attr('src', config.boxImage); - $bar.attr('width', config.width); - $bar.css("width", config.width + "px"); - $bar.css("height", config.height + "px"); - $bar.css("background-image", "url(" + config.image + ")"); - $bar.css("background-position", ((config.width * -1)) + 'px 50%'); - $bar.css("padding", "0"); - $bar.css("margin", "0"); - $this.append($bar); - $this.append($text); - } - - function getPercentage(config) { - return config.running_value * 100 / config.max; - } - - function getBarImage(config) { - var image = config.barImage; - if (typeof(config.barImage) == 'object') { - for (var i in config.barImage) { - if (config.running_value >= parseInt(i)) { - image = config.barImage[i]; - } else { break; } - } - } - return image; - } - - function getText(config) { - if (config.showText) { - if (config.textFormat == 'percentage') { - return " " + Math.round(config.running_value) + "%"; - } else if (config.textFormat == 'fraction') { - return " " + config.running_value + '/' + config.max; - } - } - } - - config.increment = Math.round((config.value - config.running_value)/config.steps); - if (config.increment < 0) - config.increment *= -1; - if (config.increment < 1) - config.increment = 1; - - var t = setInterval(function() { - var pixels = config.width / 100; // Define how many pixels go into 1% - var stop = false; - - if (config.running_value > config.value) { - if (config.running_value - config.increment < config.value) { - config.running_value = config.value; - } else { - config.running_value -= config.increment; - } - } - else if (config.running_value < config.value) { - if (config.running_value + config.increment > config.value) { - config.running_value = config.value; - } else { - config.running_value += config.increment; - } - } - - if (config.running_value == config.value) - clearInterval(t); - - var $bar = $("#" + config.id + "_pbImage"); - var $text = $("#" + config.id + "_pbText"); - var image = getBarImage(config); - if (image != config.image) { - $bar.css("background-image", "url(" + image + ")"); - config.image = image; - } - $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); - $bar.attr('title', getText(config)); - $text.html(getText(config)); - - if (config.callback != null && typeof(config.callback) == 'function') - config.callback(config); - - pb.config = config; - }, config.step_duration); - }); - }; - } - }); - - $.fn.extend({ - progressBar: $.progressBar.construct - }); - -})(jQuery); \ No newline at end of file diff --git a/module/web/media/js/jquery.timers-1.2.js b/module/web/media/js/jquery.timers-1.2.js deleted file mode 100644 index ad22e93ce..000000000 --- a/module/web/media/js/jquery.timers-1.2.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * jQuery.timers - Timer abstractions for jQuery - * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com) - * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/). - * Date: 2009/10/16 - * - * @author Blair Mitchelmore - * @version 1.2 - * - **/ - -jQuery.fn.extend({ - everyTime: function(interval, label, fn, times) { - return this.each(function() { - jQuery.timer.add(this, interval, label, fn, times); - }); - }, - oneTime: function(interval, label, fn) { - return this.each(function() { - jQuery.timer.add(this, interval, label, fn, 1); - }); - }, - stopTime: function(label, fn) { - return this.each(function() { - jQuery.timer.remove(this, label, fn); - }); - } -}); - -jQuery.extend({ - timer: { - global: [], - guid: 1, - dataKey: "jQuery.timer", - regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, - powers: { - // Yeah this is major overkill... - 'ms': 1, - 'cs': 10, - 'ds': 100, - 's': 1000, - 'das': 10000, - 'hs': 100000, - 'ks': 1000000 - }, - timeParse: function(value) { - if (value == undefined || value == null) - return null; - var result = this.regex.exec(jQuery.trim(value.toString())); - if (result[2]) { - var num = parseFloat(result[1]); - var mult = this.powers[result[2]] || 1; - return num * mult; - } else { - return value; - } - }, - add: function(element, interval, label, fn, times) { - var counter = 0; - - if (jQuery.isFunction(label)) { - if (!times) - times = fn; - fn = label; - label = interval; - } - - interval = jQuery.timer.timeParse(interval); - - if (typeof interval != 'number' || isNaN(interval) || interval < 0) - return; - - if (typeof times != 'number' || isNaN(times) || times < 0) - times = 0; - - times = times || 0; - - var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); - - if (!timers[label]) - timers[label] = {}; - - fn.timerID = fn.timerID || this.guid++; - - var handler = function() { - if ((++counter > times && times !== 0) || fn.call(element, counter) === false) - jQuery.timer.remove(element, label, fn); - }; - - handler.timerID = fn.timerID; - - if (!timers[label][fn.timerID]) - timers[label][fn.timerID] = window.setInterval(handler,interval); - - this.global.push( element ); - - }, - remove: function(element, label, fn) { - var timers = jQuery.data(element, this.dataKey), ret; - - if ( timers ) { - - if (!label) { - for ( label in timers ) - this.remove(element, label, fn); - } else if ( timers[label] ) { - if ( fn ) { - if ( fn.timerID ) { - window.clearInterval(timers[label][fn.timerID]); - delete timers[label][fn.timerID]; - } - } else { - for ( var fn in timers[label] ) { - window.clearInterval(timers[label][fn]); - delete timers[label][fn]; - } - } - - for ( ret in timers[label] ) break; - if ( !ret ) { - ret = null; - delete timers[label]; - } - } - - for ( ret in timers ) break; - if ( !ret ) - jQuery.removeData(element, this.dataKey); - } - } - } -}); - -jQuery(window).bind("unload", function() { - jQuery.each(jQuery.timer.global, function(index, item) { - jQuery.timer.remove(item); - }); -}); \ No newline at end of file diff --git a/module/web/media/js/mootools-1.2.3-core.js b/module/web/media/js/mootools-1.2.3-core.js deleted file mode 100644 index 25f1f9d03..000000000 --- a/module/web/media/js/mootools-1.2.3-core.js +++ /dev/null @@ -1,335 +0,0 @@ -//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License. - -var MooTools={version:"1.2.3",build:"4980aa0fb74d2f6eb80bcd9f5b8e1fd6fbb8f607"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; -var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; -if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; -}if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); -}}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); -}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); -return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); -};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true}); -}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]}; -for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean()); -}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this); -}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++; -}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each"); -function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; -};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); -((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; -}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments); -a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; -}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; -b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); -return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a; -b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name; -}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; -}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); -}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); -},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?5:4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); -},gecko:function(){return(document.getBoxObjectFor==undefined)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; -Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true; -break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP"); -});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description; -},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; -})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); -a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; -var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); -if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}; -}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; -new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0]; -a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true); -});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null; -});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}}; -new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; -},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); -},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; -for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; -}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; -for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1; -},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; -},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; -},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; -for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]); -}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")"; -},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16); -b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; -b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); -}var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return $try(e); -}return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); -},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})(); -},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})(); -}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0; -a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each"); -(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a); -})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this); -},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); -},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); -});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); -},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); -return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; -var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); -}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; -});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; -},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); -},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; -},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); -return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); -},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; -}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; -Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; -Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; -});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); -var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; -var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; -if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; -var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; -if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; -break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; -}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); -}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); -},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); -}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; -}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); -a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); -}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); -break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; -},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); -}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); -}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); -if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; -if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; -this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); -}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); -},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; -},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; -this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); -if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); -if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); -}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); -}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); -if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); -delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); -if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; -if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); -if(g){g=($type(f)=="element");}}return(g)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined}); -var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); -c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); -new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype);}e.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow; -});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); -f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; -}e.push(d);}f=e;}return(b.cash)?$extend(f,this):f;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a); -}:a,b));}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;}a+=" "+c+'="'+b[c]+'"'; -if(c!="checked"){delete b[c];}});a="<"+a+">";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); -},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; -},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); -}return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; -};})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); -}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true)); -}}return new Elements(f);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b); -},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; -},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; -var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); -n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; -}}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); -}if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); -}q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; -var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; -b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); -}},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); -},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); -return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); -}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); -return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); -return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); -return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); -return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; -(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; -},hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); -}return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); -},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); -},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); -l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); -},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); -},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); -},getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); -},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; -},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; -}}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; -}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; -this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; -}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); -}});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); -v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; -if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); -},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); -});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; -}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); -},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; -n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); -}return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; -},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; -return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; -},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); -}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]}; -a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; -for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; -}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); -}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; -}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); -}return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); -if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; -}var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); -}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; -},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; -}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; -},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); -},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); -}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; -(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); -};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); -})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; -}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; -}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); -},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; -}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; -}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); -case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; -}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); -if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; -b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; -}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); -}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); -Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; -var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; -f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); -}else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; -},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); -}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; -}return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; -}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var m=this.getBoundingClientRect(),k=document.id(this.getDocument().documentElement),i=k.getScroll(),n=(d(this,"position")=="fixed"); -return{x:parseInt(m.left,10)+((n)?0:i.x)-k.clientLeft,y:parseInt(m.top,10)+((n)?0:i.y)-k.clientTop};}var j=this,h={x:0,y:0};if(b(this)){return h;}while(j&&!b(j)){h.x+=j.offsetLeft; -h.y+=j.offsetTop;if(Browser.Engine.gecko){if(!f(j)){h.x+=c(j);h.y+=g(j);}var l=j.parentNode;if(l&&d(l,"overflow")!="visible"){h.x+=c(l);h.y+=g(l);}}else{if(j!=this&&Browser.Engine.webkit){h.x+=c(j); -h.y+=g(j);}}j=j.offsetParent;}if(Browser.Engine.gecko&&!f(this)){h.x-=c(this);h.y-=g(this);}return h;},getPosition:function(k){if(b(this)){return{x:0,y:0}; -}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}; -},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y}; -k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; -},setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); -return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); -return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; -},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; -}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); -}function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; -}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; -},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; -},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; -}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e); -if(d!=0&&f.item){f=$A(f);}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f);}return new Elements(c,{ddup:(h.length>1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; -}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); -return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; -Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; -}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; -if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; -break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; -break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; -}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); -}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); -}}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; -}return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; -},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; -d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; -if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); -return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); -return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y); -continue;}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r);}else{var d={},g=[];for(var x=0,w=p.length; -x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d);}p=g;}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A); -}}p=e;}}return p;}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f); -}}return h;},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b); -}}return h;},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); -}break;}}return c;},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); -}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b)); -},byClass:function(b,a){return(b.className&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d); -if(!a){return(b=="!=");}if(!b||e==undefined){return true;}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); -case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; -}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a); -},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this; -while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false; -}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g); -if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e);}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this; -while((b=b.previousSibling)){if(b.nodeType!=1){continue;}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break;}}e.positions[d]=f;}return(e.positions[d]%c.a==c.b); -},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); -},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); -}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; -window.fireEvent("domready");document.fireEvent("domready");};if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll(); -return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); -})();}else{window.addEvent("load",b);document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); -},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; -case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); -case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; -}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; -this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; -}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); -this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a); -},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); -return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition(); -this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel(); -}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject); -}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer(); -return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false; -}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c; -};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; -b[0]=d.getStyle(e);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a); -return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return;}var d=f.parse(c);if($chk(d)){b={value:d,parser:f};}}); -b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser}); -});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b)); -});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href; -if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return;}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase(); -}):null;if(!h||!h.test("^"+a+"$")){return;}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k; -});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true); -}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a)); -});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}}); -Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b; -b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; -}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); -}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a)); -},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options"))); -}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; -c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1); -e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); -a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); -b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); -},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; -for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; -for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph"); -if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a); -}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a); -return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":"); -a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(b,a){a=$splat(a); -return $extend(b,{easeIn:function(c){return b(c,a);},easeOut:function(c){return 1-b(1-c,a);},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2; -}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6); -},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2); -},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2); -break;}}return e;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]); -});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); -this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; -}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; -this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); -},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); -},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); -},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); -return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; -}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; -}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=k.url,a=k.method.toLowerCase(); -switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; -g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; -this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; -}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); -this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); -}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; -}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; -["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); -return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); -}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); -}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); -b.send({data:this,url:a||b.options.url});return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a); -this.headers.extend({Accept:"application/json","X-Request":"JSON"});},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a); -}}); \ No newline at end of file diff --git a/module/web/media/js/mootools-1.2.3.1-more.js b/module/web/media/js/mootools-1.2.3.1-more.js deleted file mode 100644 index f3e4b4121..000000000 --- a/module/web/media/js/mootools-1.2.3.1-more.js +++ /dev/null @@ -1,76 +0,0 @@ -//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. - -MooTools.More={version:"1.2.3.1"};Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d];if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous; -this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g;});}else{b.implement(d,e);}});return b;};Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth); -};if(g(this)){return e.apply(this);}var d=this.getParent(),b=[],f=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); -var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; -this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); -var d={};var c=function(f,e){return(e.computeSize)?f.getComputedSize(e):f.getSize();};if(this.getStyle("display")=="none"){d=this.measure(function(){return c(this,a); -});}else{try{d=c(this,a);}catch(b){}}return $chk(d.x)?$extend(d,{width:d.x,height:d.y}):$extend(d,{x:d.width,y:d.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); -var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; -break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; -b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=0;c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; -b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); -c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; -c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; -},toggle:function(){return this[this.isDisplayed()?"hide":"show"]();},hide:function(){var b;try{if("none"!=this.getStyle("display")){b=this.getStyle("display"); -}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none");},show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block"); -},swapClass:function(a,b){return this.removeClass(a).addClass(b);}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b); -this.parent(a);},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j);}}return c; -},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this; -}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to;}}return this.parent(h,j); -}});Fx.Reveal=new Class({Extends:Fx.Morph,options:{styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; -this.showing=false;this.hidden=true;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});var g=(this.element.style.height===""||this.element.style.height=="auto"); -this.element.setStyle("display","block");if(this.options.transitionOpacity){d.opacity=1;}var b={};$each(d,function(h,e){b[e]=[h,0];},this);var f=this.element.getStyle("overflow"); -this.element.setStyle("overflow","hidden");var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false; -$each(d,function(h,e){d[e]=h;},this);this.element.setStyles($merge({display:"none",overflow:f},d));if(g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; -}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(a){a.setStyle("visibility","visible");}}this.fireEvent("hide",this.element); -this.callChain();}.bind(this));if(a){a.setStyle("visibility","hidden");}this.start(b);}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this));}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel(); -this.dissolve();}}}}catch(c){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("hide",this.element);}return this;},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true; -this.hiding=false;this.hidden=false;var g,d;this.element.measure(function(){g=(this.element.style.height===""||this.element.style.height=="auto");d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); -}.bind(this));$each(d,function(h,e){d[e]=h;});if($chk(this.options.heightOverride)){d.height=this.options.heightOverride.toInt();}if($chk(this.options.widthOverride)){d.width=this.options.widthOverride.toInt(); -}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=1;}var b={height:0,display:this.options.display};$each(d,function(h,e){b[e]=0; -});var f=this.element.getStyle("overflow");this.element.setStyles($merge(b,{overflow:"hidden"}));var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null; -if(a){a.setStyle("visibility","hidden");}this.start(d);this.$chain.unshift(function(){this.element.setStyle("overflow",f);if(!this.options.heightOverride&&g){if(["vertical","both"].contains(this.options.mode)){this.element.style.height=""; -}if(["width","both"].contains(this.options.mode)){this.element.style.width="";}}if(!this.hidden){this.showing=false;}if(a){a.setStyle("visibility","visible"); -}this.callChain();this.fireEvent("show",this.element);}.bind(this));}else{this.callChain();this.fireEvent("complete",this.element);this.fireEvent("show",this.element); -}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel();this.reveal(); -}}}}catch(c){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this);this.fireEvent("complete",this.element); -this.fireEvent("show",this.element);}return this;},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal(); -}else{this.dissolve();}return this;}});Element.Properties.reveal={set:function(a){var b=this.retrieve("reveal");if(b){b.cancel();}return this.eliminate("reveal").store("reveal:options",$extend({link:"cancel"},a)); -},get:function(a){if(a||!this.retrieve("reveal")){if(a||!this.retrieve("reveal:options")){this.set("reveal",a);}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options"))); -}return this.retrieve("reveal");}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal",a).reveal(); -return this;},dissolve:function(a){this.get("reveal",a).dissolve();return this;},nix:function(){var a=Array.link(arguments,{destroy:Boolean.type,options:Object.type}); -this.get("reveal",a.options).dissolve().chain(function(){this[a.destroy?"destroy":"dispose"]();}.bind(this));return this;},wink:function(){var b=Array.link(arguments,{duration:Number.type,options:Object.type}); -var a=this.get("reveal",b.options);a.reveal().chain(function(){(function(){a.dissolve();}).delay(b.duration||2000);});}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0); -if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(b);this.parent(a);var c=this.element.retrieve("wrapper"); -this.wrapper=c||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0); -this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left"; -this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]); -return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,e){if(!this.check(b,e)){return this; -}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]]; -var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g;}return this.parent(f[0],f[1]);},slideIn:function(a){return this.start("in",a); -},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode](); -this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide"); -if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a); -}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,e){d=d||"toggle"; -var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e); -this.store("slide:flag",!c);a=true;break;default:b.start(d,e);}if(!a){this.eliminate("slide:flag");}return this;}});Fx.Sort=new Class({Extends:Fx.Elements,options:{mode:"vertical"},initialize:function(b,a){this.parent(b,a); -this.elements.each(function(c){if(c.getStyle("position")=="static"){c.setStyle("position","relative");}});this.setDefaultOrder();},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(b,a){return a; -});},sort:function(e){if($type(e)!="array"){return false;}var i=0;var a=0;var h={};var d=this.options.mode=="vertical";var f=this.elements.map(function(m,j){var l=m.getComputedSize({styles:["border","padding","margin"]}); -var n;if(d){n={top:i,margin:l["margin-top"],height:l.totalHeight};i+=n.height-l["margin-top"];}else{n={left:a,margin:l["margin-left"],width:l.totalWidth}; -a+=n.width;}var k=d?"top":"left";h[j]={};var o=m.getStyle(k).toInt();h[j][k]=o||0;return n;},this);this.set(h);e=e.map(function(j){return j.toInt();}); -if(e.length!=this.elements.length){this.currentOrder.each(function(j){if(!e.contains(j)){e.push(j);}});if(e.length>this.elements.length){e.splice(this.elements.length-1,e.length-this.elements.length); -}}i=0;a=0;var b=0;var c={};e.each(function(l,j){var k={};if(d){k.top=i-f[l].top-b;i+=f[l].height;}else{k.left=a-f[l].left;a+=f[l].width;}b=b+f[l].margin; -c[l]=k;},this);var g={};$A(e).sort().each(function(j){g[j]=c[j];});this.start(g);this.currentOrder=e;return this;},rearrangeDOM:function(a){a=a||this.currentOrder; -var b=this.elements[0].getParent();var c=[];this.elements.setStyle("opacity",0);a.each(function(d){c.push(this.elements[d].inject(b).setStyles({top:0,left:0})); -},this);this.elements.setStyle("opacity",1);this.elements=$$(c);this.setDefaultOrder();return this;},getDefaultOrder:function(){return this.elements.map(function(b,a){return a; -});},forward:function(){return this.sort(this.getDefaultOrder());},backward:function(){return this.sort(this.getDefaultOrder().reverse());},reverse:function(){return this.sort(this.currentOrder.reverse()); -},sortByElements:function(a){return this.sort(a.map(function(b){return this.elements.indexOf(b);},this));},swap:function(c,b){if($type(c)=="element"){c=this.elements.indexOf(c); -}if($type(b)=="element"){b=this.elements.indexOf(b);}var a=$A(this.currentOrder);a[this.currentOrder.indexOf(c)]=b;a[this.currentOrder.indexOf(b)]=c;this.sort(a); -}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=(function(){if(!this.running){this.send({data:b}); -}});this.timer=a.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(c){$clear(this.timer);if(c){this.lastDelay=this.options.delay; -}else{this.lastDelay=(this.lastDelay+this.options.delay).min(this.options.limit);}this.timer=a.delay(this.lastDelay,this);};this.addEvent("complete",this.completeCheck); -return this;},stopTimer:function(){$clear(this.timer);this.removeEvent("complete",this.completeCheck);return this;}}); \ No newline at end of file diff --git a/module/web/media/js/sprintf.js b/module/web/media/js/sprintf.js deleted file mode 100644 index 30d9046de..000000000 --- a/module/web/media/js/sprintf.js +++ /dev/null @@ -1,123 +0,0 @@ -// JavaScript Document -sprintfWrapper = { - - init : function () { - - if (typeof arguments == "undefined") { return null; } - if (arguments.length < 1) { return null; } - if (typeof arguments[0] != "string") { return null; } - if (typeof RegExp == "undefined") { return null; } - - var string = arguments[0]; - var exp = new RegExp(/(%([%]|(\-)?(\+|\x20)?(0)?(\d+)?(\.(\d)?)?([bcdfosxX])))/g); - var matches = new Array(); - var strings = new Array(); - var convCount = 0; - var stringPosStart = 0; - var stringPosEnd = 0; - var matchPosEnd = 0; - var newString = ''; - var match = null; - - while (match = exp.exec(string)) { - if (match[9]) { convCount += 1; } - - stringPosStart = matchPosEnd; - stringPosEnd = exp.lastIndex - match[0].length; - strings[strings.length] = string.substring(stringPosStart, stringPosEnd); - - matchPosEnd = exp.lastIndex; - matches[matches.length] = { - match: match[0], - left: match[3] ? true : false, - sign: match[4] || '', - pad: match[5] || ' ', - min: match[6] || 0, - precision: match[8], - code: match[9] || '%', - negative: parseInt(arguments[convCount]) < 0 ? true : false, - argument: String(arguments[convCount]) - }; - } - strings[strings.length] = string.substring(matchPosEnd); - - if (matches.length == 0) { return string; } - if ((arguments.length - 1) < convCount) { return null; } - - var code = null; - var match = null; - var i = null; - - for (i=0; i<matches.length; i++) { - - if (matches[i].code == '%') { substitution = '%' } - else if (matches[i].code == 'b') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(2)); - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'c') { - matches[i].argument = String(String.fromCharCode(parseInt(Math.abs(parseInt(matches[i].argument))))); - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'd') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument))); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'f') { - matches[i].argument = String(Math.abs(parseFloat(matches[i].argument)).toFixed(matches[i].precision ? matches[i].precision : 6)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'o') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(8)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 's') { - matches[i].argument = matches[i].argument.substring(0, matches[i].precision ? matches[i].precision : matches[i].argument.length) - substitution = sprintfWrapper.convert(matches[i], true); - } - else if (matches[i].code == 'x') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); - substitution = sprintfWrapper.convert(matches[i]); - } - else if (matches[i].code == 'X') { - matches[i].argument = String(Math.abs(parseInt(matches[i].argument)).toString(16)); - substitution = sprintfWrapper.convert(matches[i]).toUpperCase(); - } - else { - substitution = matches[i].match; - } - - newString += strings[i]; - newString += substitution; - - } - newString += strings[i]; - - return newString; - - }, - - convert : function(match, nosign){ - if (nosign) { - match.sign = ''; - } else { - match.sign = match.negative ? '-' : match.sign; - } - var l = match.min - match.argument.length + 1 - match.sign.length; - var pad = new Array(l < 0 ? 0 : l).join(match.pad); - if (!match.left) { - if (match.pad == "0" || nosign) { - return match.sign + pad + match.argument; - } else { - return pad + match.sign + match.argument; - } - } else { - if (match.pad == "0" || nosign) { - return match.sign + match.argument + pad.replace(/0/g, ' '); - } else { - return match.sign + match.argument + pad; - } - } - } -} -sprintf = sprintfWrapper.init; \ No newline at end of file diff --git a/module/web/media/js/status.js b/module/web/media/js/status.js deleted file mode 100644 index 3923e80ca..000000000 --- a/module/web/media/js/status.js +++ /dev/null @@ -1,100 +0,0 @@ -/* hover! */ -Element.implement({ - 'hover': function(fn1,fn2) { - return this.addEvents({ - 'mouseenter': function(e) { - fn1.attempt(e,this); - }, - 'mouseleave': function(e) { - fn2.attempt(e,this); - } - }) - } -}); - -function updateStatus(data){ - - document.id("status").textContent = "Status: "+ data.status; - document.id("speed").textContent = "Speed: "+ data.speed +" kb/s"; - document.id("queue").textContent = "Files in queue: "+ data.queue; - -} - - -status_req = new Request.JSON({ - onSuccess: updateStatus, - method: 'get', - url: '/json/status', - initialDelay: 0, - delay: 2000, - limit: 20000 -}); - -window.addEvent('domready', function(){ - - status_req.startTimer(); - - - document.id("btAdd").addEvent("click", function(e){ - - new Request({ - method: 'post', - url: '/json/addpackage', - onSuccess: function(){ - document.id('linkarea').value = "" - } - }).send('links='+document.id('linkarea').value+"&name="+document.id('pname').value) - - - }) - - $$('.statusbutton').each(function(item){ - - item.hover(function(e){ - this.tween('opacity',1) - },function(e){ - this.tween('opacity',0.01) - } - ) - }) - - fx_reveal = new Fx.Reveal($('addlinks')); - //fx_reveal.dissolve() - - - $$('#addlinks .closeSticky').each(function(el){ - - el.addEvent('click',function(e){ - - fx_reveal.dissolve(); - - }); - - }); - - $$('.statusbutton')[2].addEvent('click',function(e){ - - $('addlinks').setStyle('top', e.page.y + 5) - $('addlinks').setStyle('left', e.page.x + 5) - - fx_reveal.reveal() - - }); - - $$('.statusbutton')[0].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/play', - 'method' : 'get' - }).send() - }) - - $$('.statusbutton')[1].addEvent('click', function(e){ - - new Request({ - 'url' : '/json/pause', - 'method' : 'get' - }).send() - }) - -}); \ No newline at end of file diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 58c2c5c79..bd2955038 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -23,16 +23,16 @@ Active Downloads <td id="link_{{ link.id }}_status">{{ link.status }}</td> <td id="link_{{ link.id }}_info">{{ link.info }}</td> <td id="link_{{ link.id }}_kbleft">{{ link.size }}</td> - <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#link_{{ link.id }}_pgb').progressBar(50);">load</a></td> + <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#pb1').progressBar(50);">load</a></td> </tr> <tr> <td colspan="5"> - + <span id="link_{{ link.id }}_pgb" class="progressBar" style="width: {{ link.percent }}%;"></span> </td> </tr> {% endfor %} - <span id="pb1" class="progressBar">75%</span> + <tbody> </table> -- cgit v1.2.3 From 464a571cb50a14ed7d31f7ea9cdabf38eada0ac8 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 6 Jan 2010 15:02:51 +0100 Subject: WWWWWWWAAAAAAAAAA RaNaN du macht mich wahnsinnig 93 zeilen und 4,5k zeichen --- module/web/settings.py | 270 ++++++++++++++++++++++++------------------------- 1 file changed, 135 insertions(+), 135 deletions(-) (limited to 'module') diff --git a/module/web/settings.py b/module/web/settings.py index 5a948ef55..6cdd89fa2 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -1,135 +1,135 @@ -# -*- coding: utf-8 -*- -# Django settings for pyload project. - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -import os.path -import sys -import xmlrpclib - -SERVER_VERSION = "0.3" - -PROJECT_DIR = os.path.dirname(__file__) - -#chdir(dirname(abspath(__file__)) + sep) - -PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") - -sys.path.append(os.path.join(PYLOAD_DIR, "module")) -from XMLConfigParser import XMLConfigParser -config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml"), os.path.join(PYLOAD_DIR,"module","config","core_default.xml")) - -#DEBUG = config.get("general","debug") - - -ssl = "" - -if config.get("ssl", "activated") == "True": - ssl = "s" - -server_url = "http%s://%s:%s@%s:%s/" % ( - ssl, - config.get("remote", "username"), - config.get("remote", "password"), - config.get("remote", "listenaddr"), - config.get("remote", "port") - ) - -PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) - -TEMPLATE = config.get('webinterface','template') -DL_ROOT = os.path.join(PYLOAD_DIR, config.get('general','download_folder')) -LOG_ROOT = os.path.join(PYLOAD_DIR, config.get('log','log_folder')) - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), - ) - -MANAGERS = ADMINS - -DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. -DATABASE_NAME = os.path.join(PROJECT_DIR, 'pyload.db') # Or path to database file if using sqlite3. -DATABASE_USER = '' # Not used with sqlite3. -DATABASE_PASSWORD = '' # Not used with sqlite3. -DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. -DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. - -# Local time zone for this installation. Choices can be found here: -# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name -# although not all choices may be available on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'Europe' - -# Language code for this installation. All choices can be found here: -# http://www.i18nguy.com/unicode/language-identifiers.html -LANGUAGE_CODE = 'en-us' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = os.path.join(PROJECT_DIR, "media/") - - -# URL that handles the media served from MEDIA_ROOT. Make sure to use a -# trailing slash if there is a path component (optional in other cases). -# Examples: "http://media.lawrence.com", "http://example.com/media/" - -#MEDIA_URL = 'http://localhost:8000/media' -MEDIA_URL = '/media/' -#MEDIA_URL = os.path.join(PROJECT_DIR, "media/") - -LOGIN_REDIRECT_URL = "/" - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/media/admin/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = '+u%%1t&c7!e$0$*gu%w2$@to)h0!&x-r*9e+-=wa4*zxat%x^t' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', - # 'django.template.loaders.eggs.load_template_source', - ) - - -MIDDLEWARE_CLASSES = ( - 'django.middleware.gzip.GZipMiddleware', - 'django.middleware.http.ConditionalGetMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - ) - -ROOT_URLCONF = 'urls' - -TEMPLATE_DIRS = ( - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - os.path.join(PROJECT_DIR, "templates"), - ) - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - #'django.contrib.sites', - 'django.contrib.admin', - 'pyload', - 'ajax', - ) - - -AUTH_PROFILE_MODULE = 'pyload.UserProfile' -LOGIN_URL = '/login' +# -*- coding: utf-8 -*- +# Django settings for pyload project. + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +import os.path +import sys +import xmlrpclib + +SERVER_VERSION = "0.3" + +PROJECT_DIR = os.path.dirname(__file__) + +#chdir(dirname(abspath(__file__)) + sep) + +PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") + +sys.path.append(os.path.join(PYLOAD_DIR, "module")) +from XMLConfigParser import XMLConfigParser +config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml"), os.path.join(PYLOAD_DIR,"module","config","core_default.xml")) + +#DEBUG = config.get("general","debug") + + +ssl = "" + +if config.get("ssl", "activated") == "True": + ssl = "s" + +server_url = "http%s://%s:%s@%s:%s/" % ( + ssl, + config.get("remote", "username"), + config.get("remote", "password"), + config.get("remote", "listenaddr"), + config.get("remote", "port") + ) + +PYLOAD = xmlrpclib.ServerProxy(server_url, allow_none=True) + +TEMPLATE = config.get('webinterface','template') +DL_ROOT = os.path.join(PYLOAD_DIR, config.get('general','download_folder')) +LOG_ROOT = os.path.join(PYLOAD_DIR, config.get('log','log_folder')) + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), + ) + +MANAGERS = ADMINS + +DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. +DATABASE_NAME = os.path.join(PROJECT_DIR, 'pyload.db') # Or path to database file if using sqlite3. +DATABASE_USER = '' # Not used with sqlite3. +DATABASE_PASSWORD = '' # Not used with sqlite3. +DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3. +DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. + +# Local time zone for this installation. Choices can be found here: +# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name +# although not all choices may be available on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe' + +# Language code for this installation. All choices can be found here: +# http://www.i18nguy.com/unicode/language-identifiers.html +LANGUAGE_CODE = 'en-us' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = os.path.join(PROJECT_DIR, "media/") + + +# URL that handles the media served from MEDIA_ROOT. Make sure to use a +# trailing slash if there is a path component (optional in other cases). +# Examples: "http://media.lawrence.com", "http://example.com/media/" + +#MEDIA_URL = 'http://localhost:8000/media' +MEDIA_URL = '/media/' + config.get('webinterface','template') + '/' +#MEDIA_URL = os.path.join(PROJECT_DIR, "media/") + +LOGIN_REDIRECT_URL = "/" + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/media/admin/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = '+u%%1t&c7!e$0$*gu%w2$@to)h0!&x-r*9e+-=wa4*zxat%x^t' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', + # 'django.template.loaders.eggs.load_template_source', + ) + + +MIDDLEWARE_CLASSES = ( + 'django.middleware.gzip.GZipMiddleware', + 'django.middleware.http.ConditionalGetMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + ) + +ROOT_URLCONF = 'urls' + +TEMPLATE_DIRS = ( + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(PROJECT_DIR, "templates"), + ) + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + #'django.contrib.sites', + 'django.contrib.admin', + 'pyload', + 'ajax', + ) + + +AUTH_PROFILE_MODULE = 'pyload.UserProfile' +LOGIN_URL = '/login' -- cgit v1.2.3 From a7f1ce4e269b0b4eacd56b4ffe0e4cc572ae5d81 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 6 Jan 2010 15:38:47 +0100 Subject: Webinterface --- module/web/media/default/css/default.css | 160 +++++++++++++++---------------- module/web/templates/default/home.html | 4 +- module/web/templates/default/queue.html | 19 +--- module/web/templates/default/window.html | 58 +++++------ 4 files changed, 116 insertions(+), 125 deletions(-) (limited to 'module') diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 0d8e0428f..2d10c569b 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -7,7 +7,7 @@ div.no { display:none; } div.error { - background:#fcc url(media/img/error.png) 0.5em 0px no-repeat; + background:#fcc url(media/img/default/error.png) 0.5em 0px no-repeat; color:#000; border-bottom:1px solid #faa; font-size:90%; @@ -34,7 +34,7 @@ div.success { overflow:hidden; } div.notify { - background:#ffc url(media/img/notify.png) 0.5em 0px no-repeat; + background:#ffc url(media/img/default/notify.png) 0.5em 0px no-repeat; color:#000; border-bottom:1px solid #ffa; font-size:90%; @@ -183,20 +183,20 @@ div.dokuwiki div.inclmeta { margin-bottom:2em; } div.dokuwiki div.inclmeta a.permalink { - background:transparent url(media/img/link.gif) 0px 1px no-repeat; + background:transparent url(media/img/default/link.gif) 0px 1px no-repeat; padding:1px 0px 1px 16px; } div.dokuwiki div.inclmeta abbr.published { - background:transparent url(media/img/date.gif) 0px 1px no-repeat; + background:transparent url(media/img/default/date.gif) 0px 1px no-repeat; padding:1px 0px 1px 16px; border-bottom:0; } div.dokuwiki div.inclmeta span.author { - background:transparent url(media/img/user.gif) 0px 1px no-repeat; + background:transparent url(media/img/default/user.gif) 0px 1px no-repeat; padding:1px 0px 1px 16px; } div.dokuwiki div.inclmeta span.comment { - background:transparent url(media/img/comment.gif) 0px 1px no-repeat; + background:transparent url(media/img/default/comment.gif) 0px 1px no-repeat; padding:1px 0px 1px 16px; } div.dokuwiki div.inclmeta div.tags { @@ -574,19 +574,19 @@ div#acl_manager table.inline { margin:0; } div#acl_manager .aclgroup { - background:transparent url(media/img/group.png) 0px 1px no-repeat; + background:transparent url(media/img/default/group.png) 0px 1px no-repeat; padding:1px 0px 1px 18px; } div#acl_manager .acluser { - background:transparent url(media/img/user.png) 0px 1px no-repeat; + background:transparent url(media/img/default/user.png) 0px 1px no-repeat; padding:1px 0px 1px 18px; } div#acl_manager .aclpage { - background:transparent url(media/img/page.png) 0px 1px no-repeat; + background:transparent url(media/img/default/page.png) 0px 1px no-repeat; padding:1px 0px 1px 18px; } div#acl_manager .aclns { - background:transparent url(media/img/ns.png) 0px 1px no-repeat; + background:transparent url(media/img/default/ns.png) 0px 1px no-repeat; padding:1px 0px 1px 18px; } div#acl_manager label.disabled { @@ -612,141 +612,141 @@ a.interwiki { padding-left:16px; } a.iw_wp { - background-image:url(/media/img/wp.gif) + background-image:url(/media/default/img/wp.gif) } a.iw_wpde { - background-image:url(/media/img/wpde.gif) + background-image:url(/media/default/img/wpde.gif) } a.iw_wpmeta { - background-image:url(/media/img/wpmeta.gif) + background-image:url(/media/default/img/wpmeta.gif) } a.iw_doku { - background-image:url(/media/img/doku.gif) + background-image:url(/media/default/img/doku.gif) } a.iw_dokubug { - background-image:url(/media/img/dokubug.gif) + background-image:url(/media/default/img/dokubug.gif) } a.iw_amazon { - background-image:url(/media/img/amazon.gif) + background-image:url(/media/default/img/amazon.gif) } a.iw_amazon_de { - background-image:url(/media/img/amazon.de.gif) + background-image:url(/media/default/img/amazon.de.gif) } a.iw_amazon_uk { - background-image:url(/media/img/amazon.uk.gif) + background-image:url(/media/default/img/amazon.uk.gif) } a.iw_phpfn { - background-image:url(/media/img/phpfn.gif) + background-image:url(/media/default/img/phpfn.gif) } a.iw_coral { - background-image:url(/media/img/coral.gif) + background-image:url(/media/default/img/coral.gif) } a.iw_sb { - background-image:url(/media/img/sb.gif) + background-image:url(/media/default/img/sb.gif) } a.iw_google { - background-image:url(/media/img/google.gif) + background-image:url(/media/default/img/google.gif) } a.iw_meatball { - background-image:url(/media/img/meatball.gif) + background-image:url(/media/default/img/meatball.gif) } a.iw_wiki { - background-image:url(/media/img/wiki.gif) + background-image:url(/media/default/img/wiki.gif) } a.mediafile { - background:transparent url(/media/img/file.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/file.png) 0px 1px no-repeat; padding-left:18px; padding-bottom:1px; } a.mf_jpg { - background-image:url(/media/img/jpg.png) + background-image:url(/media/default/img/jpg.png) } a.mf_jpeg { - background-image:url(/media/img/jpeg.png) + background-image:url(/media/default/img/jpeg.png) } a.mf_gif { - background-image:url(/media/img/gif.png) + background-image:url(/media/default/img/gif.png) } a.mf_png { - background-image:url(/media/img/png.png) + background-image:url(/media/default/img/png.png) } a.mf_tgz { - background-image:url(/media/img/tgz.png) + background-image:url(/media/default/img/tgz.png) } a.mf_tar { - background-image:url(/media/img/tar.png) + background-image:url(/media/default/img/tar.png) } a.mf_gz { - background-image:url(/media/img/gz.png) + background-image:url(/media/default/img/gz.png) } a.mf_bz2 { - background-image:url(/media/img/bz2.png) + background-image:url(/media/default/img/bz2.png) } a.mf_zip { - background-image:url(/media/img/zip.png) + background-image:url(/media/default/img/zip.png) } a.mf_rar { - background-image:url(/media/img/rar.png) + background-image:url(/media/default/img/rar.png) } a.mf_pdf { - background-image:url(/media/img/pdf.png) + background-image:url(/media/default/img/pdf.png) } a.mf_ps { - background-image:url(/media/img/ps.png) + background-image:url(/media/default/img/ps.png) } a.mf_doc { - background-image:url(/media/img/doc.png) + background-image:url(/media/default/img/doc.png) } a.mf_xls { - background-image:url(/media/img/xls.png) + background-image:url(/media/default/img/xls.png) } a.mf_ppt { - background-image:url(/media/img/ppt.png) + background-image:url(/media/default/img/ppt.png) } a.mf_rtf { - background-image:url(/media/img/rtf.png) + background-image:url(/media/default/img/rtf.png) } a.mf_swf { - background-image:url(/media/img/swf.png) + background-image:url(/media/default/img/swf.png) } a.mf_rpm { - background-image:url(/media/img/rpm.png) + background-image:url(/media/default/img/rpm.png) } a.mf_deb { - background-image:url(/media/img/deb.png) + background-image:url(/media/default/img/deb.png) } a.mf_sxw { - background-image:url(/media/img/sxw.png) + background-image:url(/media/default/img/sxw.png) } a.mf_sxc { - background-image:url(/media/img/sxc.png) + background-image:url(/media/default/img/sxc.png) } a.mf_sxi { - background-image:url(/media/img/sxi.png) + background-image:url(/media/default/img/sxi.png) } a.mf_sxd { - background-image:url(/media/img/sxd.png) + background-image:url(/media/default/img/sxd.png) } a.mf_odc { - background-image:url(/media/img/odc.png) + background-image:url(/media/default/img/odc.png) } a.mf_odf { - background-image:url(/media/img/odf.png) + background-image:url(/media/default/img/odf.png) } a.mf_odg { - background-image:url(/media/img/odg.png) + background-image:url(/media/default/img/odg.png) } a.mf_odi { - background-image:url(/media/img/odi.png) + background-image:url(/media/default/img/odi.png) } a.mf_odp { - background-image:url(/media/img/odp.png) + background-image:url(/media/default/img/odp.png) } a.mf_ods { - background-image:url(/media/img/ods.png) + background-image:url(/media/default/img/ods.png) } a.mf_odt { - background-image:url(/media/img/odt.png) + background-image:url(/media/default/img/odt.png) } body { margin:0px; @@ -965,7 +965,7 @@ ul#page-actions2 a:hover, ul#page-actions2 a:focus, ul#user-actions2 a:hover, ul } a.urlextern { color:#36B; - background:transparent url(/media/img/external-10.2.png) no-repeat scroll right center; + 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 { @@ -973,65 +973,65 @@ background:none; padding:0; } a.action.index { - background:transparent url(/media/img/wiki-tools-index.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/wiki-tools-index.png) 0px 1px no-repeat; } a.action.recent { - background:transparent url(/media/img/wiki-tools-recent.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/wiki-tools-recent.png) 0px 1px no-repeat; } a.logout { - background:transparent url(/media/img/user-actions-logout.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/user-actions-logout.png) 0px 1px no-repeat; } a.admin { - background:transparent url(/media/img/user-actions-admin.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/user-actions-admin.png) 0px 1px no-repeat; } a.profile { - background:transparent url(/media/img/user-actions-profile.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/user-actions-profile.png) 0px 1px no-repeat; } a.create, a.edit { - background:transparent url(/media/img/page-tools-edit.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/page-tools-edit.png) 0px 1px no-repeat; } a.source, a.show { - background:transparent url(/media/img/page-tools-source.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/page-tools-source.png) 0px 1px no-repeat; } a.revisions { - background:transparent url(/media/img/page-tools-revisions.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/page-tools-revisions.png) 0px 1px no-repeat; } a.subscribe, a.unsubscribe { - background:transparent url(/media/img/page-tools-subscribe.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/page-tools-subscribe.png) 0px 1px no-repeat; } a.backlink { - background:transparent url(/media/img/page-tools-backlinks.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/page-tools-backlinks.png) 0px 1px no-repeat; } a.play { - background:transparent url(/media/img/control_play.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_play.png) 0px 1px no-repeat; } a.play:hover { - background:transparent url(/media/img/control_play_blue.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_play_blue.png) 0px 1px no-repeat; } a.cancel { - background:transparent url(/media/img/control_cancel.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_cancel.png) 0px 1px no-repeat; } a.cancel:hover { - background:transparent url(/media/img/control_cancel_blue.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_cancel_blue.png) 0px 1px no-repeat; } a.pause { - background:transparent url(/media/img/control_pause.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_pause.png) 0px 1px no-repeat; } a.pause:hover { - background:transparent url(/media/img/control_pause_blue.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_pause_blue.png) 0px 1px no-repeat; font-weight: bold; } a.stop { - background:transparent url(/media/img/control_stop.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_stop.png) 0px 1px no-repeat; } a.stop:hover { - background:transparent url(/media/img/control_stop_blue.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/control_stop_blue.png) 0px 1px no-repeat; } a.cog { - background:transparent url(/media/img/cog.png) 0px 1px no-repeat; + background:transparent url(/media/default/img/cog.png) 0px 1px no-repeat; } #head-panel { - background:#525252 url(/media/img/head_bg1.png) bottom left repeat-x; + background:#525252 url(/media/default/img/head_bg1.png) bottom left repeat-x; } #head-panel h1 { display:none; @@ -1049,7 +1049,7 @@ a.cog { overflow:visible; } #head-menu { - background:transparent url(/media/img/tabs-border-bottom.png) 0 100% repeat-x; + background:transparent url(/media/default/img/tabs-border-bottom.png) 0 100% repeat-x; width:100%; float:left; margin:0; @@ -1079,7 +1079,7 @@ a.cog { float:left; text-decoration:none; color:#555; - background:#eaeaea url(/media/img/tab-background.png) 0 100% repeat-x; + background:#eaeaea url(/media/default/img/tab-background.png) 0 100% repeat-x; padding:3px 7px 3px 7px; border:2px solid #ccc; border-bottom:0px solid transparent; @@ -1432,13 +1432,13 @@ div.codearea pre span.Preprc { background-color:#d78383; } .box { - background:url(/media/img/progress-bar-back.gif) right center no-repeat; + background:url(/media/default/img/progress-bar-back.gif) right center no-repeat; width:200px; height:20px; float:left; } .perc { - background:url(/media/img/progress-bar.gif) right center no-repeat; + background:url(/media/default/img/progress-bar.gif) right center no-repeat; height:20px; } .boxtext { diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index bd2955038..16526341e 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -36,4 +36,6 @@ Active Downloads <tbody> </table> -{% endblock %} \ No newline at end of file +{% endblock %} + +{% include "default/window.html" %} \ No newline at end of file diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index 8c582c5d0..3995d0390 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -1,16 +1,3 @@ -{% extends 'default/base.html' %} - -{% block title %}Queue - {{block.super}} {% endblock %} - -{% block menu %} -<li> - <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> -</li> -<li class="selected"> - <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> -<li> - <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> -<li class="right"> - <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> -</li> -{% endblock %} \ No newline at end of file +{% extends 'default/base.html' %} + +{% block title %}Queue - {{block.super}} {% endblock %} diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index f756c4352..f364f2338 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,28 +1,30 @@ -<div id="{{id}}" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> -<div class="DefaultStickyWin" style="width: {{width}}px;"> - -<div class="top"> -<div class="top_ul"></div> -<div class="top_ur"><h1 class="caption dragHandle">{{caption}}</h1> -</div></div> - -<div class="middle"> -<div class="body">{{body}} -</div></div> - -<div class="closeBody"> -<div class="closeButtons"> -<a class="closeSticky button" id="bt{{button}}">{{button}}</a><a class="closeSticky button">Close</a> -</div> -</div> - -<div class="bottom"> -<div class="bottom_ll"> -</div> - -<div class="bottom_lr"></div> -</div> -<div class="closeButton closeSticky"></div> - -</div> -</div> \ No newline at end of file +{% block content %} +<div id="{{id}}" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> +<div class="DefaultStickyWin" style="width: {{width}}px;"> + +<div class="top"> +<div class="top_ul"></div> +<div class="top_ur"><h1 class="caption dragHandle">{{caption}}</h1> +</div></div> + +<div class="middle"> +<div class="body">{{body}} +</div></div> + +<div class="closeBody"> +<div class="closeButtons"> +<a class="closeSticky button" id="bt{{button}}">{{button}}</a><a class="closeSticky button">Close</a> +</div> +</div> + +<div class="bottom"> +<div class="bottom_ll"> +</div> + +<div class="bottom_lr"></div> +</div> +<div class="closeButton closeSticky"></div> + +</div> +</div> +{% block content %} \ No newline at end of file -- cgit v1.2.3 From f2d387f8a2915d7be11fe8741fe3b45a0252aa9d Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 6 Jan 2010 15:58:35 +0100 Subject: webinterface fix --- module/web/templates/default/base.html | 42 +++++-------------------- module/web/templates/default/home.html | 54 +++++++++++++++++++++++++++----- module/web/templates/default/queue.html | 13 ++++++++ module/web/templates/default/window.html | 14 ++++----- 4 files changed, 73 insertions(+), 50 deletions(-) (limited to 'module') diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 98858b9df..ecaec98f2 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -12,14 +12,12 @@ <script src="{{ MEDIA_URL }}js/sprintf.js"></script> <script src="{{ MEDIA_URL }}js/funktions.js"></script> <script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script> -{% block head %} -{% endblock %} + <title>{% block title %}pyLoad Webinterface{% endblock %}</title> -</head> + <script type="text/javascript"> $(document).ready(function(){ $.getJSON('/json/links', LinksToContent ); - $.getJSON('/json/status', LoadJsonToContent ); }); @@ -42,35 +40,10 @@ function LoadJsonToContent(data) $.getJSON('/json/status', LoadJsonToContent ); }, 2000); } -function LinksToContent(data) -{ - - $.each(data, function(i,item) - { - //$("#LinksAktiv").append('<tr id="link_'+item.id+'"><td id="link_'+item.id+'_name">'+item.name+'</td><td id="link_'+item.id+'_status">'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); - //SetInver[i] = (item.size / 100 ) / item.speed ; - //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); - //$("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); - //$(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); - //var width = (100/item.size)*(item.size-item.kbleft); - //alert(width); - //$(".link_"+item.id+"_pgb").animate({ width: +"%"}, /*(item.size / item.speed)*1000*/1500, "linear" ); - //$("#link_"+item.id+"_pgb").fadeIn(); - /*$("#link_"+item.id+"_pgb").progressBar(); - $("#link_"+item.id+"_pgb").progressBar('option' , 'width' , '100%'); - $("#link_"+item.id+"_pgb").progressBar('option' , 'showText' , true); - $("#link_"+item.id+"_pgb").progressBar('option' , 'textFormat' , 'percentage');*/ - $("#link_"+item.id+"_pgb").progressBar((100/item.size)*(item.size-item.kbleft)); - - }); - //UpdateLinks(SetInver, 0); - setTimeout(function() - { - $.getJSON('/json/links', LinksToContent ); - }, 1000); - -} </script> + +{% block head %} +{% endblock %} </head> <a class="anchor" name="top" id="top"></a> @@ -106,8 +79,6 @@ function LinksToContent(data) </li> <li> <a href="/queue/" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> - <li> - <a href="/add/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" />Add</a></li> <li> <a href="/downloads/" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> <li class="right"> @@ -169,5 +140,6 @@ function LinksToContent(data) </div> </div> -</head> + +{% include "default/window.html" %} <body> diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 16526341e..12fa55539 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -1,11 +1,55 @@ {% extends 'default/base.html' %} +{% block head %} + +<script type="text/javascript"> +$(document).ready(function(){ + $.getJSON('/json/links', LinksToContent ); +}); + + +/*function UpdateLinks( SetInver, index ) +{ + $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1) + setTimeout( UpdateLinks( SetInver, index+1 ), SetInver[index]*1000); +}*/ + +function LinksToContent(data) +{ + + $.each(data, function(i,item) + { + //$("#LinksAktiv").append('<tr id="link_'+item.id+'"><td id="link_'+item.id+'_name">'+item.name+'</td><td id="link_'+item.id+'_status">'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); + //SetInver[i] = (item.size / 100 ) / item.speed ; + //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); + //$("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); + //$(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); + //var width = (100/item.size)*(item.size-item.kbleft); + //alert(width); + //$(".link_"+item.id+"_pgb").animate({ width: +"%"}, /*(item.size / item.speed)*1000*/1500, "linear" ); + //$("#link_"+item.id+"_pgb").fadeIn(); + /*$("#link_"+item.id+"_pgb").progressBar(); + $("#link_"+item.id+"_pgb").progressBar('option' , 'width' , '100%'); + $("#link_"+item.id+"_pgb").progressBar('option' , 'showText' , true); + $("#link_"+item.id+"_pgb").progressBar('option' , 'textFormat' , 'percentage');*/ + $("#link_"+item.id+"_pgb").progressBar((100/item.size)*(item.size-item.kbleft)); + + }); + //UpdateLinks(SetInver, 0); + setTimeout(function() + { + $.getJSON('/json/links', LinksToContent ); + }, 1000); + +} +</script> + +{% endblock %} + {% block subtitle %} Active Downloads {% endblock %} - - {% block content %} <table width="100%" class="queue"> <tr class="header"> @@ -32,10 +76,6 @@ Active Downloads </tr> {% endfor %} - - <tbody> </table> -{% endblock %} - -{% include "default/window.html" %} \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index 3995d0390..b4f1cb278 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -1,3 +1,16 @@ {% extends 'default/base.html' %} {% block title %}Queue - {{block.super}} {% endblock %} + +{% block menu %} +<li> + <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> +</li> +<li class="selected"> + <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> +<li> + <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> +<li class="right"> + <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> +</li> +{% endblock %} \ No newline at end of file diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index f364f2338..602622719 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,19 +1,18 @@ -{% block content %} -<div id="{{id}}" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> -<div class="DefaultStickyWin" style="width: {{width}}px;"> +<div id="add_window" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> +<div class="DefaultStickyWin" style="width: 100px;"> <div class="top"> <div class="top_ul"></div> -<div class="top_ur"><h1 class="caption dragHandle">{{caption}}</h1> +<div class="top_ur"><h1 class="caption dragHandle">Title</h1> </div></div> <div class="middle"> -<div class="body">{{body}} +<div class="body">Body here </div></div> <div class="closeBody"> <div class="closeButtons"> -<a class="closeSticky button" id="bt{{button}}">{{button}}</a><a class="closeSticky button">Close</a> +<a class="closeSticky button" id="button_id">Button</a><a class="closeSticky button">Close</a> </div> </div> @@ -26,5 +25,4 @@ <div class="closeButton closeSticky"></div> </div> -</div> -{% block content %} \ No newline at end of file +</div> \ No newline at end of file -- cgit v1.2.3 From d56dcab5d48c8c4ec05f200f92bd35a1f977cd4f Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 6 Jan 2010 17:38:53 +0100 Subject: cli fix, webinterface db check --- module/web/ServerThread.py | 11 +++++++++++ module/web/manage.py | 0 module/web/pyload_default.db | Bin 44032 -> 0 bytes 3 files changed, 11 insertions(+) mode change 100644 => 100755 module/web/manage.py delete mode 100644 module/web/pyload_default.db (limited to 'module') diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 069cabafe..8be3892b5 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -2,6 +2,7 @@ from __future__ import with_statement import threading from os.path import join +from os.path import exists from subprocess import Popen, PIPE, STDOUT from time import sleep from signal import SIGINT @@ -18,6 +19,16 @@ class WebServer(threading.Thread): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)] + + if not exists(join(self.pycore.path,"module","web","pyload.db")): + print "########## IMPORTANT ###########" + print "### Database for Webinterface doesnt exitst, it will not be available." + print "### Please run: python %s syncdb" % join(self.pycore.path,"module","web","manage.py") + print "### You have to add at least one User, to gain access to webinterface: python %s createsuperuser" % join(self.pycore.path,"module","web","manage.py") + print "### Dont forget to restart pyLoad if you are done." + print "################################" + raise Exception, "Database doesnt exists, please use syncdb" + self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) if os.name == 'posix': diff --git a/module/web/manage.py b/module/web/manage.py old mode 100644 new mode 100755 diff --git a/module/web/pyload_default.db b/module/web/pyload_default.db deleted file mode 100644 index cd39d0ca8..000000000 Binary files a/module/web/pyload_default.db and /dev/null differ -- cgit v1.2.3 From d2aa3fceb9f896343b128d40f20a0465cf69efca Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 6 Jan 2010 22:11:24 +0100 Subject: small fixes, new hook stuff --- module/XMLConfigParser.py | 6 +++--- module/file_list.py | 7 +++++++ module/plugins/hooks/ContainerDownload.py | 2 ++ module/plugins/hooks/Hook.py | 16 ++++++++++++++++ 4 files changed, 28 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 0d2094dae..5b1966152 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -101,16 +101,16 @@ class XMLConfigParser(): if opt.nodeType == opt.ELEMENT_NODE: if option == opt.tagName: replace = opt - text = self.createTextNode(value) + text = self.xml.createTextNode(str(value)) if replace: replace.replaceChild(text, replace.firstChild) else: - newNode = self.createElement(option) + newNode = self.xml.createElement(option) newNode.appendChild(text) if sectionNode: sectionNode.appendChild(newNode) else: - newSection = self.createElement(section) + newSection = self.xml.createElement(section) newSection.appendChild(newNode) root.appendChild(newSection) self.saveData() diff --git a/module/file_list.py b/module/file_list.py index e7b80f26d..ef47df6d9 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -143,6 +143,13 @@ class File_List(object): files.append(pyfile) return files + def getAllFiles(self): + files = [] + for pypack in self.data["queue"] + self.data["packages"]: + for pyfile in pypack.files: + files.append(pyfile) + return files + def countDownloads(self): return len(self.getDownloadList()) diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py index d031cdf69..417b42ee8 100644 --- a/module/plugins/hooks/ContainerDownload.py +++ b/module/plugins/hooks/ContainerDownload.py @@ -35,6 +35,8 @@ class ContainerDownload(Hook): def downloadFinished(self, pyfile): filename = pyfile.status.filename + if not pyfile.url.startswith("http"): + return if filename.endswith(".dlc") or filename.endswith(".ccf") or filename.endswith(".rsdf"): self.logger.info("ContainerDownload hook: adding container file") location = abspath(join(pyfile.folder, filename)) diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py index f02432718..09b21ba49 100644 --- a/module/plugins/hooks/Hook.py +++ b/module/plugins/hooks/Hook.py @@ -19,10 +19,15 @@ """ import logging +from os.path import join + +from module.XMLConfigParser import XMLConfigParser class Hook(): def __init__(self, core): self.logger = logging.getLogger("log") + self.configParser = XMLConfigParser(join("module","config","plugin.xml"), join("module","config","plugin_default.xml")) + self.config = {} props = {} props['name'] = "Hook" props['version'] = "0.1" @@ -32,6 +37,17 @@ class Hook(): self.props = props self.core = core + def readConfig(self): + self.configParser.loadData() + section = self.props['name'] + try: + self.config = self.configParser.getConfig()[section] + except: + self.setup() + + def setup(self): + pass + def downloadStarts(self, pyfile): pass -- cgit v1.2.3 From 9dc2f58872b9f170621bd583f73f9fe144238972 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Wed, 6 Jan 2010 22:14:56 +0100 Subject: Webinterface - AddBox --- module/config/core_default.xml | 2 +- module/web/media/default/js/home.js | 409 +++++++++++----------- module/web/media/default/js/jquery.progressbar.js | 8 +- module/web/templates/default/base.html | 35 +- module/web/templates/default/home.html | 4 - module/web/templates/default/window.html | 37 +- 6 files changed, 253 insertions(+), 242 deletions(-) (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 366197a61..32ca6599c 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -30,7 +30,7 @@ <general name="General"> <language type="str" input="en;de;fr" name="Language">de</language> <download_folder type="str" name="Download Folder">Downloads</download_folder> - <max_downloads type="int" name="Max Parallel Downloads">3</max_downloads> + <max_downloads type="int" name="Max Parallel Downloads">1</max_downloads> <link_file type="str" name="File For Links">links.txt</link_file> <failed_file type="str" name="File For Failed Links">failed_links.txt</failed_file> <debug_mode type="bool" name="Debug Mode">False</debug_mode> diff --git a/module/web/media/default/js/home.js b/module/web/media/default/js/home.js index 025dcfcc7..61a1f60d0 100644 --- a/module/web/media/default/js/home.js +++ b/module/web/media/default/js/home.js @@ -1,205 +1,204 @@ -var dwProgressBar = new Class({ - - //implements - Implements: [Options], - - //options - options: { - container: $$('body')[0], - boxID: '', - percentageID: '', - displayID: '', - startPercentage: 0, - displayText: false, - speed: 10 - }, - - //initialization - initialize: function(options) { - //set options - this.setOptions(options); - //create elements - this.createElements(); - }, - - //creates the box and percentage elements - createElements: function() { - var box = new Element('div', { - id: this.options.boxID + this.options.id, - 'class': this.options.boxID - }); - var perc = new Element('div', { - id: this.options.percentageID + this.options.id, - 'style': 'width:0px;', - 'class': this.options.percentageID - }); - perc.inject(box); - box.inject(this.options.container); - if (this.options.displayText) { - var text = new Element('div', { - id: this.options.displayID + this.options.id, - 'class': this.options.displayID - }); - text.inject(this.options.container); - } - this.set(this.options.startPercentage); - }, - - //calculates width in pixels from percentage - calculate: function(percentage) { - return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); - }, - - //animates the change in percentage - animate: function(to) { - document.id(this.options.percentageID + this.options.id).set('morph', { - duration: this.options.speed, - link: 'cancel' - }).morph({ - width: this.calculate(to.toInt()) - }); - if (this.options.displayText) { - document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); - } - }, - - //sets the percentage from its current state to desired percentage - set: function(to) { - this.animate(to); - } - -}); - -req = new Request.JSON({ - onSuccess: renderTable, - method: 'get', - url: '/json/links', - initialDelay: 0, - delay: 1000, - limit: 20000 -}); - -var dls = [] -var pbs = [] - -function renderTable(data) { - - data.downloads.each(function(dl) { - - if (dls.contains(dl.id)) { - - var div = $('dl' + dl.id) - - pbs[dl.id].set(dl.percent) - - div.getChildren("b")[0].textContent = dl.name - - if (dl.status == "downloading") { - - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; - speed = Math.round(dl.speed) + " kb/s"; - eta = dl.eta; - - } else if (dl.status == "waiting") { - - size = "waiting " + dl.wait; - speed = ""; - eta = ""; - - } - div.getChildren(".dlsize")[0].textContent = size; - div.getChildren(".dlspeed")[0].textContent = speed; - div.getChildren(".dltime")[0].textContent = eta; - - } else { - - dls.push(dl.id) - - container = $("dlcontainer") - - dldiv = new Element('div', { - 'id': 'dl' + dl.id, - 'class': 'download', - 'styles': { - 'display': 'None' - } - }) - - new Element('p').inject(dldiv) - - new Element('b', { - 'html': dl.name - }).inject(dldiv) - - new Element('br').inject(dldiv) - - dldiv.inject(container) - - pbs[dl.id] = new dwProgressBar({ - container: $(dldiv), - startPercentage: 0, - speed: 1000, - id: dl.id, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' - }); - - new Element('div', { - 'class': 'dlsize', - 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - }).inject(dldiv) - - new Element('div', { - 'class': 'dlspeed', - 'html': Math.round(dl.speed) + " kb/s" - }).inject(dldiv) - - new Element('div', { - 'class': 'dltime', - 'html': dl.eta - }).inject(dldiv) - - //dldiv.dissolve({duration : 0}) - dldiv.reveal() - - } - }) - - dls.each(function(id, index) { - - if (data.ids.contains(id)) { - -} else { - - //$("dl"+id).reveal() - dls.erase(id); - $('dl' + id).nix() - - } - - }) - -} - -window.addEvent('domready', -function() { - - /* -//create the progress bar for example 1 -pb = new dwProgressBar({ - container: $$('.level1 p')[0], - startPercentage: 25, - speed: 1000, - id: 1, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); -*/ - - req.startTimer(); - -}); \ No newline at end of file +var dwProgressBar = new Class({ + + //implements + Implements: [Options], + + //options + options: { + container: $$('body')[0], + boxID: '', + percentageID: '', + displayID: '', + startPercentage: 0, + displayText: false, + speed: 10 + }, + + //initialization + initialize: function(options) { + //set options + this.setOptions(options); + //create elements + this.createElements(); + }, + + //creates the box and percentage elements + createElements: function() { + var box = new Element('div', { + id: this.options.boxID + this.options.id, + 'class': this.options.boxID + }); + var perc = new Element('div', { + id: this.options.percentageID + this.options.id, + 'style': 'width:0px;', + 'class': this.options.percentageID + }); + perc.inject(box); + box.inject(this.options.container); + if (this.options.displayText) { + var text = new Element('div', { + id: this.options.displayID + this.options.id, + 'class': this.options.displayID + }); + text.inject(this.options.container); + } + this.set(this.options.startPercentage); + }, + + //calculates width in pixels from percentage + calculate: function(percentage) { + return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); + }, + + //animates the change in percentage + animate: function(to) { + document.id(this.options.percentageID + this.options.id).set('morph', { + duration: this.options.speed, + link: 'cancel' + }).morph({ + width: this.calculate(to.toInt()) + }); + if (this.options.displayText) { + document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); + } + }, + + //sets the percentage from its current state to desired percentage + set: function(to) { + this.animate(to); + } + +}); +/* +req = new Request.JSON({ + onSuccess: renderTable, + method: 'get', + url: '/json/links', + initialDelay: 0, + delay: 1000, + limit: 20000 +}); +*/ +var dls = [] +var pbs = [] + +function renderTable(data) { + + data.downloads.each(function(dl) { + + if (dls.contains(dl.id)) { + + var div = $('dl' + dl.id) + + pbs[dl.id].set(dl.percent) + + div.getChildren("b")[0].textContent = dl.name + + if (dl.status == "downloading") { + + size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; + speed = Math.round(dl.speed) + " kb/s"; + eta = dl.eta; + + } else if (dl.status == "waiting") { + + size = "waiting " + dl.wait; + speed = ""; + eta = ""; + + } + div.getChildren(".dlsize")[0].textContent = size; + div.getChildren(".dlspeed")[0].textContent = speed; + div.getChildren(".dltime")[0].textContent = eta; + + } else { + + dls.push(dl.id) + + container = $("dlcontainer") + + dldiv = new Element('div', { + 'id': 'dl' + dl.id, + 'class': 'download', + 'styles': { + 'display': 'None' + } + }) + + new Element('p').inject(dldiv) + + new Element('b', { + 'html': dl.name + }).inject(dldiv) + + new Element('br').inject(dldiv) + + dldiv.inject(container) + + pbs[dl.id] = new dwProgressBar({ + container: $(dldiv), + startPercentage: 0, + speed: 1000, + id: dl.id, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' + }); + + new Element('div', { + 'class': 'dlsize', + 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" + }).inject(dldiv) + + new Element('div', { + 'class': 'dlspeed', + 'html': Math.round(dl.speed) + " kb/s" + }).inject(dldiv) + + new Element('div', { + 'class': 'dltime', + 'html': dl.eta + }).inject(dldiv) + + //dldiv.dissolve({duration : 0}) + dldiv.reveal() + + } + }) + + dls.each(function(id, index) { + + if (data.ids.contains(id)) { + +} else { + + //$("dl"+id).reveal() + dls.erase(id); + $('dl' + id).nix() + + } + + }) + +} + +window.addEvent('domready', +function() { + + /* +//create the progress bar for example 1 +pb = new dwProgressBar({ + container: $$('.level1 p')[0], + startPercentage: 25, + speed: 1000, + id: 1, + boxID: 'box', + percentageID: 'perc', + displayText: true, + displayID: 'boxtext' +}); +*/ +}); + + diff --git a/module/web/media/default/js/jquery.progressbar.js b/module/web/media/default/js/jquery.progressbar.js index 7ddf4a558..e240109b4 100644 --- a/module/web/media/default/js/jquery.progressbar.js +++ b/module/web/media/default/js/jquery.progressbar.js @@ -26,11 +26,11 @@ USAGE: width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' height : 12, // Height of the progressbar - don't forget to adjust your image too!!! callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc - boxImage : '/media/img/progressbar.gif', // boxImage : image around the progress bar + boxImage : '/media/default/img/progressbar.gif', // boxImage : image around the progress bar barImage : { - 0: '/media/img/progressbg_red.gif', - 30: '/media/img/progressbg_orange.gif', - 70: '/media/img/progressbg_green.gif' + 0: '/media/default/img/progressbg_red.gif', + 30: '/media/default/img/progressbg_orange.gif', + 70: '/media/default/img/progressbg_green.gif' }, diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index ecaec98f2..cd0b85903 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -17,6 +17,7 @@ <script type="text/javascript"> $(document).ready(function(){ + $.getJSON('/json/status', LoadJsonToContent ); $.getJSON('/json/links', LinksToContent ); }); @@ -38,7 +39,38 @@ function LoadJsonToContent(data) setTimeout(function() { $.getJSON('/json/status', LoadJsonToContent ); - }, 2000); + }, 4000); + req.startTimer(); + +} + +function AddBox() +{ + if (!$("#add_box").is(":hidden")) + { + $("#add_box").fadeOut(800); + $("#add_bg").fadeOut(800); + } + else + { + $("#add_box").fadeIn(800); + $("#add_bg").fadeIn(800); + } +} + +function AddSubmit() +{ + $("#add_form").submit(); + /* + $.post("/json/add_package", { links: $("#add_links").text() } ); + return false; + if( $("#add_cf").val() != "" ) + { + //$("#add_form").submit(); + } + */ + AddBox(); + } </script> @@ -97,6 +129,7 @@ function LoadJsonToContent(data) <li id="action_play"><a href="/json/unpause" class="action play" accesskey="o" rel="nofollow">Play</a></li> <li id="action_stop"><a href="" class="action cancel" accesskey="o" rel="nofollow">Cancel</a></li> <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> + <li id="action_add"><a href="javascript:AddBox();" class="action stop" accesskey="o" rel="nofollow" >Add</a></li> </ul> {% endif %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 12fa55539..49633f94a 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -3,10 +3,6 @@ {% block head %} <script type="text/javascript"> -$(document).ready(function(){ - $.getJSON('/json/links', LinksToContent ); -}); - /*function UpdateLinks( SetInver, index ) { diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index 602622719..ec4ca496a 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,28 +1,11 @@ -<div id="add_window" class="StickyWinInstance SWclearfix" style="overflow: visible;visibility: visible;display: none; position: absolute; z-index: 10000; opacity: 1; left: 0px; top: 0px;"> -<div class="DefaultStickyWin" style="width: 100px;"> - -<div class="top"> -<div class="top_ul"></div> -<div class="top_ur"><h1 class="caption dragHandle">Title</h1> -</div></div> - -<div class="middle"> -<div class="body">Body here -</div></div> - -<div class="closeBody"> -<div class="closeButtons"> -<a class="closeSticky button" id="button_id">Button</a><a class="closeSticky button">Close</a> +<div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:absolute; top:0px; left:0px; display:none;"> </div> +<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;"> + <div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div> + <h1>Add</h1> + <form id="add_form" action="" method="post" onsubmit="return AddSubmit();"> + <textarea rows="5" style="width: 890px;" name="add_links" id="add_links"></textarea> + <br /> + <input type="file" name="add_cf" id="add_cf" /> + <input type="submit" value="Add Links" /> + </form> </div> -</div> - -<div class="bottom"> -<div class="bottom_ll"> -</div> - -<div class="bottom_lr"></div> -</div> -<div class="closeButton closeSticky"></div> - -</div> -</div> \ No newline at end of file -- cgit v1.2.3 From 893194ce7294002a607d67b4d4d8d3a111cdf098 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 6 Jan 2010 22:17:21 +0100 Subject: reverted config --- module/config/core_default.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 32ca6599c..366197a61 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -30,7 +30,7 @@ <general name="General"> <language type="str" input="en;de;fr" name="Language">de</language> <download_folder type="str" name="Download Folder">Downloads</download_folder> - <max_downloads type="int" name="Max Parallel Downloads">1</max_downloads> + <max_downloads type="int" name="Max Parallel Downloads">3</max_downloads> <link_file type="str" name="File For Links">links.txt</link_file> <failed_file type="str" name="File For Failed Links">failed_links.txt</failed_file> <debug_mode type="bool" name="Debug Mode">False</debug_mode> -- cgit v1.2.3 From 1896a9faec5871f8051a8dfa407883cef46bb6df Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 7 Jan 2010 15:59:23 +0100 Subject: Better Rapidshare Slot Check thanks #66 --- module/plugins/hooks/ContainerDownload.py | 2 +- module/plugins/hoster/RapidshareCom.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py index 417b42ee8..c13a7f622 100644 --- a/module/plugins/hooks/ContainerDownload.py +++ b/module/plugins/hooks/ContainerDownload.py @@ -38,7 +38,7 @@ class ContainerDownload(Hook): if not pyfile.url.startswith("http"): return if filename.endswith(".dlc") or filename.endswith(".ccf") or filename.endswith(".rsdf"): - self.logger.info("ContainerDownload hook: adding container file") + self.logger.info("ContainerDownload: adding container file") location = abspath(join(pyfile.folder, filename)) newFile = self.core.file_list.collector.addLink(location) self.core.file_list.packager.addFileToPackage(pyfile.package.data["id"], self.core.file_list.collector.popFile(newFile)) diff --git a/module/plugins/hoster/RapidshareCom.py b/module/plugins/hoster/RapidshareCom.py index 677916dcf..10654e5c8 100644 --- a/module/plugins/hoster/RapidshareCom.py +++ b/module/plugins/hoster/RapidshareCom.py @@ -143,7 +143,7 @@ class RapidshareCom(Plugin): self.time_plus_wait = time() + 60 * int(wait_minutes) self.want_reconnect = True except: - if re.search(r"(currently a lot of users|no more download slots)", self.html[1], re.I) != None: + if re.search(r"(Currently a lot of users|no more download slots|servers are overloaded)", self.html[1], re.I) != None: self.time_plus_wait = time() + 130 self.logger.info("Rapidshare: No free slots!") self.no_slots = True -- cgit v1.2.3 From 205c200b94f3b4edf1220a9ffd5ebeab58aa098b Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 7 Jan 2010 19:05:42 +0100 Subject: Better ConfigParser --- module/Plugin.py | 2 +- module/XMLConfigParser.py | 34 ++++++++++++++++++++++++---------- module/config/core_default.xml | 2 +- module/config/plugin_default.xml | 2 +- module/plugins/hooks/Hook.py | 2 +- 5 files changed, 28 insertions(+), 14 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 7854aa66d..45371c3af 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -31,7 +31,7 @@ from module.download_thread import CaptchaError class Plugin(): def __init__(self, parent): - self.configparser = XMLConfigParser(join("module","config","plugin.xml"), join("module","config","plugin_default.xml")) + self.configparser = XMLConfigParser(join("module","config","plugin.xml")) self.config = {} props = {} props['name'] = "BasePlugin" diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 5b1966152..8105eb929 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - @author: mkaay + @author: mkaay, spoob """ from __future__ import with_statement @@ -21,11 +21,14 @@ from os.path import exists from xml.dom.minidom import parse +from shutil import copy + class XMLConfigParser(): - def __init__(self, data, default_data=None): + def __init__(self, data): self.xml = None + self.version = "0.1" self.file = data - self.file_default = default_data + self.file_default = self.file.replace(".xml", "_default.xml") self.config = {} self.data = {} self.types = {} @@ -35,15 +38,29 @@ class XMLConfigParser(): def loadData(self): file = self.file if not exists(self.file): - file = self.file_default + self._copyConfig() with open(file, 'r') as fh: self.xml = parse(fh) + if not self.xml.documentElement.getAttribute("version") == self.version: + self._copyConfig() + with open(file, 'r') as fh: + self.xml = parse(fh) + if not self.xml.documentElement.getAttribute("version") == self.version: + print "Cant Update %s" % self.file + exit() #ok? self._read_config() - + + def _copyConfig(self): + try: + copy(self.file_default, self.file) + except: + print "%s not found" % self.file_default + exit() #ok? + def saveData(self): with open(self.file, 'w') as fh: self.xml.writexml(fh) - + def _read_config(self): def format(val): if val.lower() == "true": @@ -85,10 +102,7 @@ class XMLConfigParser(): def getConfig(self): return self.config - - def getData(self): - return self.data - + def set(self, section, option, value): root = self.root replace = False diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 366197a61..07d4ddc1c 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -1,4 +1,4 @@ -<config name="Configuration"> +<config name="Configuration" version="0.1"> <remote name="Remote"> <port type="int" name="Port">7227</port> <listenaddr type="ip" name="Adress">0.0.0.0</listenaddr> diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 1ad653251..3f033fc04 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -1,4 +1,4 @@ -<config> +<config name="Configuration" version="0.1"> <RapidshareCom> <server input=";Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera"></server> <premium>False</premium> diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py index 09b21ba49..739af3200 100644 --- a/module/plugins/hooks/Hook.py +++ b/module/plugins/hooks/Hook.py @@ -26,7 +26,7 @@ from module.XMLConfigParser import XMLConfigParser class Hook(): def __init__(self, core): self.logger = logging.getLogger("log") - self.configParser = XMLConfigParser(join("module","config","plugin.xml"), join("module","config","plugin_default.xml")) + self.configParser = XMLConfigParser(join("module","config","plugin.xml")) self.config = {} props = {} props['name'] = "Hook" -- cgit v1.2.3 From 92d2362fe691c9e6f047b5a8db59ad3cb95a67e0 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 9 Jan 2010 15:47:39 +0100 Subject: Updated XML Config Changes --- module/web/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/web/settings.py b/module/web/settings.py index 6cdd89fa2..3b242164c 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -18,7 +18,7 @@ PYLOAD_DIR = os.path.join(PROJECT_DIR,"..","..") sys.path.append(os.path.join(PYLOAD_DIR, "module")) from XMLConfigParser import XMLConfigParser -config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml"), os.path.join(PYLOAD_DIR,"module","config","core_default.xml")) +config = XMLConfigParser(os.path.join(PYLOAD_DIR,"module","config","core.xml")) #DEBUG = config.get("general","debug") -- cgit v1.2.3 From a0fec87a584a029854fc7eec4773c1074bf21b80 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 9 Jan 2010 17:15:45 +0100 Subject: Hooks can set Attributes --- module/XMLConfigParser.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 8105eb929..5f58c834b 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -103,7 +103,7 @@ class XMLConfigParser(): def getConfig(self): return self.config - def set(self, section, option, value): + def set(self, section, data, value): root = self.root replace = False sectionNode = False @@ -113,13 +113,14 @@ class XMLConfigParser(): sectionNode = node for opt in node.childNodes: if opt.nodeType == opt.ELEMENT_NODE: - if option == opt.tagName: + if data["option"] == opt.tagName: replace = opt + self._setAttributes(node, data) text = self.xml.createTextNode(str(value)) if replace: - replace.replaceChild(text, replace.firstChild) + replace.replaceChild(text, replace.firstChild) else: - newNode = self.xml.createElement(option) + newNode = self.xml.createElement(data["option"]) newNode.appendChild(text) if sectionNode: sectionNode.appendChild(newNode) @@ -127,8 +128,19 @@ class XMLConfigParser(): newSection = self.xml.createElement(section) newSection.appendChild(newNode) root.appendChild(newSection) + self._setAttributes(newSection, data) self.saveData() self.loadData() + + def _setAttributes(self, node, data): + node.setAttribute("name", node.tagName) + option = node.getElementsByTagName(data["option"])[0] + option.setAttribute("name", data["name"]) + option.setAttribute("type", data["type"]) + try: + option.setAttribute("input", data["input"]) + except: + pass def getType(self, section, option): try: -- cgit v1.2.3 From ad532495edc4103129bf86b53dec81038babe063 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 9 Jan 2010 22:05:15 +0100 Subject: Hooks Config Incomplete --- module/HookManager.py | 19 ++++++++++++++++--- module/XMLConfigParser.py | 7 +++---- module/config/core_default.xml | 1 + module/config/gui_default.xml | 1 + module/config/plugin_default.xml | 1 + module/plugins/hooks/Hook.py | 8 ++++---- 6 files changed, 26 insertions(+), 11 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index a0caae728..d2196ec4f 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -24,9 +24,15 @@ from glob import glob from threading import Lock +from module.XMLConfigParser import XMLConfigParser + + class HookManager(): def __init__(self, core): self.core = core + self.configParser = XMLConfigParser(join("module","config","plugin.xml")) + self.configParser.loadData() + self.config = self.configParser.getConfig() self.logger = logging.getLogger("log") self.plugins = [] self.lock = Lock() @@ -39,10 +45,17 @@ class HookManager(): for pluginFile in pluginFiles: pluginName = basename(pluginFile).replace(".py", "") if pluginName == "Hook" or pluginName == "__init__": - continue - module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) + continue + if pluginName in self.config.keys(): + if not self.config[pluginName]["activated"]: + continue + else: + self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) + module = __import__("module.plugins.hooks." + pluginName, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) - plugins.append(pluginClass(self.core)) + pluginLoaded = pluginClass(self.core) + pluginLoaded.setup() + plugins.append(pluginLoaded) self.logger.info("Installed Hook: %s" % pluginName) self.plugins = plugins diff --git a/module/XMLConfigParser.py b/module/XMLConfigParser.py index 5f58c834b..678338b41 100644 --- a/module/XMLConfigParser.py +++ b/module/XMLConfigParser.py @@ -48,6 +48,7 @@ class XMLConfigParser(): if not self.xml.documentElement.getAttribute("version") == self.version: print "Cant Update %s" % self.file exit() #ok? + self.root = self.xml.documentElement self._read_config() def _copyConfig(self): @@ -115,7 +116,6 @@ class XMLConfigParser(): if opt.nodeType == opt.ELEMENT_NODE: if data["option"] == opt.tagName: replace = opt - self._setAttributes(node, data) text = self.xml.createTextNode(str(value)) if replace: replace.replaceChild(text, replace.firstChild) @@ -128,13 +128,12 @@ class XMLConfigParser(): newSection = self.xml.createElement(section) newSection.appendChild(newNode) root.appendChild(newSection) - self._setAttributes(newSection, data) + self._setAttributes(section, data) self.saveData() self.loadData() def _setAttributes(self, node, data): - node.setAttribute("name", node.tagName) - option = node.getElementsByTagName(data["option"])[0] + option = self.root.getElementsByTagName(node)[0].getElementsByTagName(data["option"])[0] option.setAttribute("name", data["name"]) option.setAttribute("type", data["type"]) try: diff --git a/module/config/core_default.xml b/module/config/core_default.xml index 07d4ddc1c..0d684890a 100644 --- a/module/config/core_default.xml +++ b/module/config/core_default.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" ?> <config name="Configuration" version="0.1"> <remote name="Remote"> <port type="int" name="Port">7227</port> diff --git a/module/config/gui_default.xml b/module/config/gui_default.xml index 9b6d75936..490af199e 100644 --- a/module/config/gui_default.xml +++ b/module/config/gui_default.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" ?> <root> <connections> <connection default="True" type="local" id="33965310e19b4a869112c43b39a16440"> diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 3f033fc04..773e4e46f 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" ?> <config name="Configuration" version="0.1"> <RapidshareCom> <server input=";Cogent;Deutsche Telekom;Level(3);Level(3) #2;GlobalCrossing;Level(3) #3;Teleglobe;GlobalCrossing #2;TeliaSonera #2;Teleglobe #2;TeliaSonera #3;TeliaSonera"></server> diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py index 739af3200..4b5f6751f 100644 --- a/module/plugins/hooks/Hook.py +++ b/module/plugins/hooks/Hook.py @@ -40,10 +40,10 @@ class Hook(): def readConfig(self): self.configParser.loadData() section = self.props['name'] - try: - self.config = self.configParser.getConfig()[section] - except: - self.setup() + #~ try: + #~ self.config = self.configParser.getConfig()[section] + #~ except: + #~ self.setup() def setup(self): pass -- cgit v1.2.3 From 5274c296dc13cf91df804a537b8e2109d62b3d98 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sat, 9 Jan 2010 22:22:07 +0100 Subject: better hook config --- module/HookManager.py | 22 ++++++---------------- module/plugins/hooks/Hook.py | 14 +++++++++----- 2 files changed, 15 insertions(+), 21 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index d2196ec4f..dc96d6d45 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -24,15 +24,9 @@ from glob import glob from threading import Lock -from module.XMLConfigParser import XMLConfigParser - - class HookManager(): def __init__(self, core): self.core = core - self.configParser = XMLConfigParser(join("module","config","plugin.xml")) - self.configParser.loadData() - self.config = self.configParser.getConfig() self.logger = logging.getLogger("log") self.plugins = [] self.lock = Lock() @@ -45,17 +39,13 @@ class HookManager(): for pluginFile in pluginFiles: pluginName = basename(pluginFile).replace(".py", "") if pluginName == "Hook" or pluginName == "__init__": - continue - if pluginName in self.config.keys(): - if not self.config[pluginName]["activated"]: - continue - else: - self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) - module = __import__("module.plugins.hooks." + pluginName, globals(), locals(), [pluginName], -1) + continue + module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) - pluginLoaded = pluginClass(self.core) - pluginLoaded.setup() - plugins.append(pluginLoaded) + plugin = pluginClass(self.core) + plugin.readConfig() + if plugin.isActivated(): + plugins.append(plugin) self.logger.info("Installed Hook: %s" % pluginName) self.plugins = plugins diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py index 4b5f6751f..1a7fba092 100644 --- a/module/plugins/hooks/Hook.py +++ b/module/plugins/hooks/Hook.py @@ -40,13 +40,17 @@ class Hook(): def readConfig(self): self.configParser.loadData() section = self.props['name'] - #~ try: - #~ self.config = self.configParser.getConfig()[section] - #~ except: - #~ self.setup() + try: + self.config = self.configParser.getConfig()[section] + except: + self.setup() def setup(self): - pass + self.configParser.set(self.props["name"], {"option": "activated", "type": "bool", "name": "Activated"}, True) + self.readConfig() + + def isActivated(self): + return self.config["activated"] def downloadStarts(self, pyfile): pass -- cgit v1.2.3 From a1c1d16ab515373c6111724393a0b242e9bf32a4 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 10 Jan 2010 03:22:04 +0100 Subject: dont import deactivated hooks --- module/HookManager.py | 24 +++++++++++++++++------- module/plugins/hooks/ContainerDownload.py | 2 +- module/plugins/hooks/__init__.py | 1 - 3 files changed, 18 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index dc96d6d45..57b766201 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -19,6 +19,8 @@ """ import logging +from module.XMLConfigParser import XMLConfigParser + from os.path import basename, join from glob import glob @@ -27,6 +29,9 @@ from threading import Lock class HookManager(): def __init__(self, core): self.core = core + self.configParser = XMLConfigParser(join("module","config","plugin.xml")) + self.configParser.loadData() + self.config = self.configParser.getConfig() self.logger = logging.getLogger("log") self.plugins = [] self.lock = Lock() @@ -38,16 +43,21 @@ class HookManager(): plugins = [] for pluginFile in pluginFiles: pluginName = basename(pluginFile).replace(".py", "") - if pluginName == "Hook" or pluginName == "__init__": - continue + if pluginName == "__init__": + continue + if pluginName in self.config.keys(): + if not self.config[pluginName]["activated"]: + self.logger.info("Deactivated %s" % pluginName) + continue + else: + self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) plugin = pluginClass(self.core) - plugin.readConfig() - if plugin.isActivated(): - plugins.append(plugin) - - self.logger.info("Installed Hook: %s" % pluginName) + plugin.setup() + plugins.append(plugin) + self.logger.info("Activated %s" % pluginName) + self.plugins = plugins self.lock.release() diff --git a/module/plugins/hooks/ContainerDownload.py b/module/plugins/hooks/ContainerDownload.py index c13a7f622..f520b705c 100644 --- a/module/plugins/hooks/ContainerDownload.py +++ b/module/plugins/hooks/ContainerDownload.py @@ -18,7 +18,7 @@ @interface-version: 0.1 """ -from module.plugins.hooks.Hook import Hook +from module.plugins.Hook import Hook from os.path import join, abspath diff --git a/module/plugins/hooks/__init__.py b/module/plugins/hooks/__init__.py index 8b1378917..e69de29bb 100644 --- a/module/plugins/hooks/__init__.py +++ b/module/plugins/hooks/__init__.py @@ -1 +0,0 @@ - -- cgit v1.2.3 From 3b9a34f69cfe6e0fe869b3649e24d5c69c321cee Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 10 Jan 2010 03:23:41 +0100 Subject: added youtube to mp3 converter --- module/plugins/hooks/Mp3Convert.py | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 module/plugins/hooks/Mp3Convert.py (limited to 'module') diff --git a/module/plugins/hooks/Mp3Convert.py b/module/plugins/hooks/Mp3Convert.py new file mode 100644 index 000000000..d70bb93f6 --- /dev/null +++ b/module/plugins/hooks/Mp3Convert.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" + +from module.plugins.Hook import Hook +from os.path import join, abspath +import subprocess +from os import remove + +class Mp3Convert(Hook): + def __init__(self, core): + Hook.__init__(self, core) + props = {} + props['name'] = "Mp3Convert" + props['version'] = "0.1" + props['description'] = """converts files like videos to mp3""" + props['author_name'] = ("spoob") + props['author_mail'] = ("spoob@pyload.org") + self.props = props + self.readConfig() + + def downloadFinished(self, pyfile): + plugin = pyfile.plugin.props['name'] + if plugin == "YoutubeCom": + filename = pyfile.status.filename[:-4] + cmd = ['ffmpeg -i "%s" -vn -ar 44100 -ac 2 -ab 192k "%s.mp3"' % (abspath(join(pyfile.folder, pyfile.status.filename)), abspath(join(pyfile.folder, filename)))] + converter = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + converter.wait() + if self.config["removeRegularFile"]: + remove(abspath(join(pyfile.folder, pyfile.status.filename))) + self.logger.info("Mp3Convert: Converterd %s to Mp3" % filename) + + def setup(self): + self.configParser.set(self.props["name"], {"option": "removeRegularFile", "type": "bool", "name": "Remove Regular Files"}, False) -- cgit v1.2.3 From 82fd9d8f649630000d69b559caa00ce9db8382a9 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 10 Jan 2010 03:26:08 +0100 Subject: moved Hooks.py --- module/plugins/Hook.py | 70 +++++++++++++++++++++++++++++++++++++++++++ module/plugins/hooks/Hook.py | 71 -------------------------------------------- 2 files changed, 70 insertions(+), 71 deletions(-) create mode 100644 module/plugins/Hook.py delete mode 100644 module/plugins/hooks/Hook.py (limited to 'module') diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py new file mode 100644 index 000000000..2d8ed0741 --- /dev/null +++ b/module/plugins/Hook.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" + +import logging +from os.path import join + +from module.XMLConfigParser import XMLConfigParser + +class Hook(): + def __init__(self, core): + self.logger = logging.getLogger("log") + self.configParser = XMLConfigParser(join("module","config","plugin.xml")) + self.config = {} + props = {} + props['name'] = "Hook" + props['version'] = "0.1" + props['description'] = """interface for hook""" + props['author_name'] = ("mkaay") + props['author_mail'] = ("mkaay@mkaay.de") + self.props = props + self.core = core + + def readConfig(self): + self.configParser.loadData() + section = self.props['name'] + try: + self.config = self.configParser.getConfig()[section] + except: + self.setup() + + def setup(self): + pass + + def isActivated(self): + return self.config["activated"] + + def downloadStarts(self, pyfile): + pass + + def downloadFinished(self, pyfile): + pass + + def packageFinished(self, pypack): + """ + not implemented! + """ + pass + + def beforeReconnecting(self, ip): + pass + + def afterReconnecting(self, ip): + pass diff --git a/module/plugins/hooks/Hook.py b/module/plugins/hooks/Hook.py deleted file mode 100644 index 1a7fba092..000000000 --- a/module/plugins/hooks/Hook.py +++ /dev/null @@ -1,71 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. - - @author: mkaay - @interface-version: 0.1 -""" - -import logging -from os.path import join - -from module.XMLConfigParser import XMLConfigParser - -class Hook(): - def __init__(self, core): - self.logger = logging.getLogger("log") - self.configParser = XMLConfigParser(join("module","config","plugin.xml")) - self.config = {} - props = {} - props['name'] = "Hook" - props['version'] = "0.1" - props['description'] = """interface for hook""" - props['author_name'] = ("mkaay") - props['author_mail'] = ("mkaay@mkaay.de") - self.props = props - self.core = core - - def readConfig(self): - self.configParser.loadData() - section = self.props['name'] - try: - self.config = self.configParser.getConfig()[section] - except: - self.setup() - - def setup(self): - self.configParser.set(self.props["name"], {"option": "activated", "type": "bool", "name": "Activated"}, True) - self.readConfig() - - def isActivated(self): - return self.config["activated"] - - def downloadStarts(self, pyfile): - pass - - def downloadFinished(self, pyfile): - pass - - def packageFinished(self, pypack): - """ - not implemented! - """ - pass - - def beforeReconnecting(self, ip): - pass - - def afterReconnecting(self, ip): - pass -- cgit v1.2.3 From 3d655ddbfbd96abecb9a9c9bebf6e43eb710ab12 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 10 Jan 2010 16:20:31 +0100 Subject: fixed manage.py, addBox working, some code formatted and cleaned --- module/gui/Collector.py | 2 - module/plugins/decrypter/SerienjunkiesOrg.py | 1 - module/web/ServerThread.py | 3 +- module/web/ajax/views.py | 52 ++- module/web/manage.py | 27 +- module/web/media/default/js/jquery.form.js | 660 +++++++++++++++++++++++++++ module/web/pyload/views.py | 49 +- module/web/run_unix.py | 21 + module/web/settings.py | 2 +- module/web/templates/default/base.html | 19 +- module/web/templates/default/home.html | 3 + module/web/templates/default/window.html | 7 +- 12 files changed, 768 insertions(+), 78 deletions(-) create mode 100644 module/web/media/default/js/jquery.form.js create mode 100755 module/web/run_unix.py (limited to 'module') diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 112eb1cd5..0aad5d1ba 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -19,8 +19,6 @@ from PyQt4.QtCore import * from PyQt4.QtGui import * -from time import sleep - from module.gui.Queue import ItemIterator class PackageCollector(QObject): diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 15bee52ac..7302f904e 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- import re -from time import sleep from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup diff --git a/module/web/ServerThread.py b/module/web/ServerThread.py index 8be3892b5..1276966ef 100644 --- a/module/web/ServerThread.py +++ b/module/web/ServerThread.py @@ -18,7 +18,6 @@ class WebServer(threading.Thread): def run(self): host = self.pycore.config['webinterface']['host'] port = self.pycore.config['webinterface']['port'] - command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)] if not exists(join(self.pycore.path,"module","web","pyload.db")): print "########## IMPORTANT ###########" @@ -32,6 +31,7 @@ class WebServer(threading.Thread): self.pycore.logger.info("Starting Webserver: %s:%s" % (host,port) ) if os.name == 'posix': + command = ['python',join(self.pycore.path,"module","web","run_unix.py"), "runserver", "%s:%s" % (host,port)] self.p = Popen(command, close_fds=True, stderr=PIPE, stdin=PIPE, stdout=PIPE) #os.system("python " + join(self.pycore.path,"module","web","manage.py runserver %s:%s" % (host,port))) #@TODO: better would be real python code @@ -41,6 +41,7 @@ class WebServer(threading.Thread): while self.running: sleep(1) else: + command = ['python',join(self.pycore.path,"module","web","manage.py"), "runserver", "%s:%s" % (host,port)] self.p = Popen(command, stderr=PIPE, stdin=PIPE, stdout=PIPE) while self.running: sleep(1) diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index b09a80581..952fbe2eb 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -1,16 +1,18 @@ # Create your views here. +from os.path import join + +from django.conf import settings +from django.core.serializers import json from django.http import HttpResponse from django.http import HttpResponseForbidden from django.http import HttpResponseServerError -from django.conf import settings from django.utils import simplejson -from django.core.serializers import json def permission(perm): def _dec(view_func): - def _view(request, *args, **kwargs): + def _view(request, * args, ** kwargs): if request.user.has_perm(perm) and request.user.is_authenticated(): - return view_func(request, *args, **kwargs) + return view_func(request, * args, ** kwargs) else: return HttpResponseForbidden() @@ -25,17 +27,39 @@ def permission(perm): class JsonResponse(HttpResponse): def __init__(self, object): content = simplejson.dumps( - object, indent=2, cls=json.DjangoJSONEncoder, - ensure_ascii=False) + object, indent=2, cls=json.DjangoJSONEncoder, + ensure_ascii=False) super(JsonResponse, self).__init__( - content)#, content_type='application/json') - self['Cache-Control'] = 'no-cache, must-revalidate' - + content)#, content_type='application/json') #@TODO uncomment + self['Cache-Control'] = 'no-cache, must-revalidate' +@permission('pyload.can_add') def add_package(request): - a = {'b' : [1,2,3], 'dsfsd' : "sadd"} - return JsonResponse(a) + + name = request.POST['add_name'] + + if name is None or "": + return HttpResponseServerError() + + links = request.POST['add_links'].split("\n") + + try: + f = request.FILES['add_file'] + fpath = join(settings.DL_ROOT, f.name) + destination = open(fpath, 'wb') + for chunk in f.chunks(): + destination.write(chunk) + destination.close() + links.insert(0, fpath) + except: + pass + + links = filter(lambda x: x is not "", links) + + settings.PYLOAD.add_package(name, links) + + return JsonResponse("success") @permission('pyload.can_see_dl') @@ -96,12 +120,12 @@ def packages(request): return HttpResponseServerError() @permission('pyload.can_see_dl') -def package(request,id): +def package(request, id): try: data = settings.PYLOAD.get_package_data(int(id)) data['links'] = [] for file in settings.PYLOAD.get_package_files(data['id']): - data['links'].append(settings.PYLOAD.get_file_info(file)) + data['links'].append(settings.PYLOAD.get_file_info(file)) return JsonResponse(data) @@ -109,7 +133,7 @@ def package(request,id): return HttpResponseServerError() @permission('pyload.can_see_dl') -def link(request,id): +def link(request, id): try: data = settings.PYLOAD.get_file_info(int(id)) return JsonResponse(data) diff --git a/module/web/manage.py b/module/web/manage.py index 6a00ab565..34b964ffc 100755 --- a/module/web/manage.py +++ b/module/web/manage.py @@ -1,20 +1,13 @@ #!/usr/bin/env python -from __future__ import with_statement -import os +# -*- coding: utf-8 -*- +from django.core.management import execute_manager -pid = os.fork() -if pid: - with open("webserver.pid", "w") as f: - f.write(str(pid)) -else: - from django.core.management import execute_manager +try: + import settings # Assumed to be in the same directory. +except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) - try: - import settings # Assumed to be in the same directory. - except ImportError: - import sys - sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) - sys.exit(1) - - if __name__ == "__main__": - execute_manager(settings) +if __name__ == "__main__": + execute_manager(settings) \ No newline at end of file diff --git a/module/web/media/default/js/jquery.form.js b/module/web/media/default/js/jquery.form.js new file mode 100644 index 000000000..dde394270 --- /dev/null +++ b/module/web/media/default/js/jquery.form.js @@ -0,0 +1,660 @@ +/* + * jQuery Form Plugin + * version: 2.36 (07-NOV-2009) + * @requires jQuery v1.2.6 or later + * + * Examples and documentation at: http://malsup.com/jquery/form/ + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ +;(function($) { + +/* + Usage Note: + ----------- + Do not use both ajaxSubmit and ajaxForm on the same form. These + functions are intended to be exclusive. Use ajaxSubmit if you want + to bind your own submit handler to the form. For example, + + $(document).ready(function() { + $('#myForm').bind('submit', function() { + $(this).ajaxSubmit({ + target: '#output' + }); + return false; // <-- important! + }); + }); + + Use ajaxForm when you want the plugin to manage all the event binding + for you. For example, + + $(document).ready(function() { + $('#myForm').ajaxForm({ + target: '#output' + }); + }); + + When using ajaxForm, the ajaxSubmit function will be invoked for you + at the appropriate time. +*/ + +/** + * ajaxSubmit() provides a mechanism for immediately submitting + * an HTML form using AJAX. + */ +$.fn.ajaxSubmit = function(options) { + // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) + if (!this.length) { + log('ajaxSubmit: skipping submit process - no element selected'); + return this; + } + + if (typeof options == 'function') + options = { success: options }; + + var url = $.trim(this.attr('action')); + if (url) { + // clean url (don't include hash vaue) + url = (url.match(/^([^#]+)/)||[])[1]; + } + url = url || window.location.href || ''; + + options = $.extend({ + url: url, + type: this.attr('method') || 'GET', + iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' + }, options || {}); + + // hook for manipulating the form data before it is extracted; + // convenient for use with rich editors like tinyMCE or FCKEditor + var veto = {}; + this.trigger('form-pre-serialize', [this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); + return this; + } + + // provide opportunity to alter form data before it is serialized + if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSerialize callback'); + return this; + } + + var a = this.formToArray(options.semantic); + if (options.data) { + options.extraData = options.data; + for (var n in options.data) { + if(options.data[n] instanceof Array) { + for (var k in options.data[n]) + a.push( { name: n, value: options.data[n][k] } ); + } + else + a.push( { name: n, value: options.data[n] } ); + } + } + + // give pre-submit callback an opportunity to abort the submit + if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { + log('ajaxSubmit: submit aborted via beforeSubmit callback'); + return this; + } + + // fire vetoable 'validate' event + this.trigger('form-submit-validate', [a, this, options, veto]); + if (veto.veto) { + log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); + return this; + } + + var q = $.param(a); + + if (options.type.toUpperCase() == 'GET') { + options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; + options.data = null; // data is null for 'get' + } + else + options.data = q; // data is the query string for 'post' + + var $form = this, callbacks = []; + if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); + if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); + + // perform a load on the target only if dataType is not provided + if (!options.dataType && options.target) { + var oldSuccess = options.success || function(){}; + callbacks.push(function(data) { + $(options.target).html(data).each(oldSuccess, arguments); + }); + } + else if (options.success) + callbacks.push(options.success); + + options.success = function(data, status) { + for (var i=0, max=callbacks.length; i < max; i++) + callbacks[i].apply(options, [data, status, $form]); + }; + + // are there files to upload? + var files = $('input:file', this).fieldValue(); + var found = false; + for (var j=0; j < files.length; j++) + if (files[j]) + found = true; + + var multipart = false; +// var mp = 'multipart/form-data'; +// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); + + // options.iframe allows user to force iframe mode + // 06-NOV-09: now defaulting to iframe mode if file input is detected + if ((files.length && options.iframe !== false) || options.iframe || found || multipart) { + // hack to fix Safari hang (thanks to Tim Molendijk for this) + // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d + if (options.closeKeepAlive) + $.get(options.closeKeepAlive, fileUpload); + else + fileUpload(); + } + else + $.ajax(options); + + // fire 'notify' event + this.trigger('form-submit-notify', [this, options]); + return this; + + + // private function for handling file uploads (hat tip to YAHOO!) + function fileUpload() { + var form = $form[0]; + + if ($(':input[name=submit]', form).length) { + alert('Error: Form elements must not be named "submit".'); + return; + } + + var opts = $.extend({}, $.ajaxSettings, options); + var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); + + var id = 'jqFormIO' + (new Date().getTime()); + var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ opts.iframeSrc +'" />'); + var io = $io[0]; + + $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); + + var xhr = { // mock object + aborted: 0, + responseText: null, + responseXML: null, + status: 0, + statusText: 'n/a', + getAllResponseHeaders: function() {}, + getResponseHeader: function() {}, + setRequestHeader: function() {}, + abort: function() { + this.aborted = 1; + $io.attr('src', opts.iframeSrc); // abort op in progress + } + }; + + var g = opts.global; + // trigger ajax global events so that activity/block indicators work like normal + if (g && ! $.active++) $.event.trigger("ajaxStart"); + if (g) $.event.trigger("ajaxSend", [xhr, opts]); + + if (s.beforeSend && s.beforeSend(xhr, s) === false) { + s.global && $.active--; + return; + } + if (xhr.aborted) + return; + + var cbInvoked = 0; + var timedOut = 0; + + // add submitting element to data if we know it + var sub = form.clk; + if (sub) { + var n = sub.name; + if (n && !sub.disabled) { + options.extraData = options.extraData || {}; + options.extraData[n] = sub.value; + if (sub.type == "image") { + options.extraData[name+'.x'] = form.clk_x; + options.extraData[name+'.y'] = form.clk_y; + } + } + } + + // take a breath so that pending repaints get some cpu time before the upload starts + setTimeout(function() { + // make sure form attrs are set + var t = $form.attr('target'), a = $form.attr('action'); + + // update form attrs in IE friendly way + form.setAttribute('target',id); + if (form.getAttribute('method') != 'POST') + form.setAttribute('method', 'POST'); + if (form.getAttribute('action') != opts.url) + form.setAttribute('action', opts.url); + + // ie borks in some cases when setting encoding + if (! options.skipEncodingOverride) { + $form.attr({ + encoding: 'multipart/form-data', + enctype: 'multipart/form-data' + }); + } + + // support timout + if (opts.timeout) + setTimeout(function() { timedOut = true; cb(); }, opts.timeout); + + // add "extra" data to form if provided in options + var extraInputs = []; + try { + if (options.extraData) + for (var n in options.extraData) + extraInputs.push( + $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />') + .appendTo(form)[0]); + + // add iframe to doc and submit the form + $io.appendTo('body'); + io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false); + form.submit(); + } + finally { + // reset attrs and remove "extra" input elements + form.setAttribute('action',a); + t ? form.setAttribute('target', t) : $form.removeAttr('target'); + $(extraInputs).remove(); + } + }, 10); + + var domCheckCount = 50; + + function cb() { + if (cbInvoked++) return; + + io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); + + var ok = true; + try { + if (timedOut) throw 'timeout'; + // extract the server response from the iframe + var data, doc; + + doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document; + + var isXml = opts.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); + log('isXml='+isXml); + if (!isXml && (doc.body == null || doc.body.innerHTML == '')) { + if (--domCheckCount) { + // in some browsers (Opera) the iframe DOM is not always traversable when + // the onload callback fires, so we loop a bit to accommodate + cbInvoked = 0; + setTimeout(cb, 100); + return; + } + log('Could not access iframe DOM after 50 tries.'); + return; + } + + xhr.responseText = doc.body ? doc.body.innerHTML : null; + xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; + xhr.getResponseHeader = function(header){ + var headers = {'content-type': opts.dataType}; + return headers[header]; + }; + + if (opts.dataType == 'json' || opts.dataType == 'script') { + // see if user embedded response in textarea + var ta = doc.getElementsByTagName('textarea')[0]; + if (ta) + xhr.responseText = ta.value; + else { + // account for browsers injecting pre around json response + var pre = doc.getElementsByTagName('pre')[0]; + if (pre) + xhr.responseText = pre.innerHTML; + } + } + else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) { + xhr.responseXML = toXml(xhr.responseText); + } + data = $.httpData(xhr, opts.dataType); + } + catch(e){ + ok = false; + $.handleError(opts, xhr, 'error', e); + } + + // ordering of these callbacks/triggers is odd, but that's how $.ajax does it + if (ok) { + opts.success(data, 'success'); + if (g) $.event.trigger("ajaxSuccess", [xhr, opts]); + } + if (g) $.event.trigger("ajaxComplete", [xhr, opts]); + if (g && ! --$.active) $.event.trigger("ajaxStop"); + if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error'); + + // clean up + setTimeout(function() { + $io.remove(); + xhr.responseXML = null; + }, 100); + }; + + function toXml(s, doc) { + if (window.ActiveXObject) { + doc = new ActiveXObject('Microsoft.XMLDOM'); + doc.async = 'false'; + doc.loadXML(s); + } + else + doc = (new DOMParser()).parseFromString(s, 'text/xml'); + return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null; + }; + }; +}; + +/** + * ajaxForm() provides a mechanism for fully automating form submission. + * + * The advantages of using this method instead of ajaxSubmit() are: + * + * 1: This method will include coordinates for <input type="image" /> elements (if the element + * is used to submit the form). + * 2. This method will include the submit element's name/value data (for the element that was + * used to submit the form). + * 3. This method binds the submit() method to the form for you. + * + * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely + * passes the options argument along after properly binding events for submit elements and + * the form itself. + */ +$.fn.ajaxForm = function(options) { + return this.ajaxFormUnbind().bind('submit.form-plugin', function() { + $(this).ajaxSubmit(options); + return false; + }).bind('click.form-plugin', function(e) { + var target = e.target; + var $el = $(target); + if (!($el.is(":submit,input:image"))) { + // is this a child element of the submit el? (ex: a span within a button) + var t = $el.closest(':submit'); + if (t.length == 0) + return; + target = t[0]; + } + var form = this; + form.clk = target; + if (target.type == 'image') { + if (e.offsetX != undefined) { + form.clk_x = e.offsetX; + form.clk_y = e.offsetY; + } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin + var offset = $el.offset(); + form.clk_x = e.pageX - offset.left; + form.clk_y = e.pageY - offset.top; + } else { + form.clk_x = e.pageX - target.offsetLeft; + form.clk_y = e.pageY - target.offsetTop; + } + } + // clear form vars + setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); + }); +}; + +// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm +$.fn.ajaxFormUnbind = function() { + return this.unbind('submit.form-plugin click.form-plugin'); +}; + +/** + * formToArray() gathers form element data into an array of objects that can + * be passed to any of the following ajax functions: $.get, $.post, or load. + * Each object in the array has both a 'name' and 'value' property. An example of + * an array for a simple login form might be: + * + * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] + * + * It is this array that is passed to pre-submit callback functions provided to the + * ajaxSubmit() and ajaxForm() methods. + */ +$.fn.formToArray = function(semantic) { + var a = []; + if (this.length == 0) return a; + + var form = this[0]; + var els = semantic ? form.getElementsByTagName('*') : form.elements; + if (!els) return a; + for(var i=0, max=els.length; i < max; i++) { + var el = els[i]; + var n = el.name; + if (!n) continue; + + if (semantic && form.clk && el.type == "image") { + // handle image inputs on the fly when semantic == true + if(!el.disabled && form.clk == el) { + a.push({name: n, value: $(el).val()}); + a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); + } + continue; + } + + var v = $.fieldValue(el, true); + if (v && v.constructor == Array) { + for(var j=0, jmax=v.length; j < jmax; j++) + a.push({name: n, value: v[j]}); + } + else if (v !== null && typeof v != 'undefined') + a.push({name: n, value: v}); + } + + if (!semantic && form.clk) { + // input type=='image' are not found in elements array! handle it here + var $input = $(form.clk), input = $input[0], n = input.name; + if (n && !input.disabled && input.type == 'image') { + a.push({name: n, value: $input.val()}); + a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); + } + } + return a; +}; + +/** + * Serializes form data into a 'submittable' string. This method will return a string + * in the format: name1=value1&name2=value2 + */ +$.fn.formSerialize = function(semantic) { + //hand off to jQuery.param for proper encoding + return $.param(this.formToArray(semantic)); +}; + +/** + * Serializes all field elements in the jQuery object into a query string. + * This method will return a string in the format: name1=value1&name2=value2 + */ +$.fn.fieldSerialize = function(successful) { + var a = []; + this.each(function() { + var n = this.name; + if (!n) return; + var v = $.fieldValue(this, successful); + if (v && v.constructor == Array) { + for (var i=0,max=v.length; i < max; i++) + a.push({name: n, value: v[i]}); + } + else if (v !== null && typeof v != 'undefined') + a.push({name: this.name, value: v}); + }); + //hand off to jQuery.param for proper encoding + return $.param(a); +}; + +/** + * Returns the value(s) of the element in the matched set. For example, consider the following form: + * + * <form><fieldset> + * <input name="A" type="text" /> + * <input name="A" type="text" /> + * <input name="B" type="checkbox" value="B1" /> + * <input name="B" type="checkbox" value="B2"/> + * <input name="C" type="radio" value="C1" /> + * <input name="C" type="radio" value="C2" /> + * </fieldset></form> + * + * var v = $(':text').fieldValue(); + * // if no values are entered into the text inputs + * v == ['',''] + * // if values entered into the text inputs are 'foo' and 'bar' + * v == ['foo','bar'] + * + * var v = $(':checkbox').fieldValue(); + * // if neither checkbox is checked + * v === undefined + * // if both checkboxes are checked + * v == ['B1', 'B2'] + * + * var v = $(':radio').fieldValue(); + * // if neither radio is checked + * v === undefined + * // if first radio is checked + * v == ['C1'] + * + * The successful argument controls whether or not the field element must be 'successful' + * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). + * The default value of the successful argument is true. If this value is false the value(s) + * for each element is returned. + * + * Note: This method *always* returns an array. If no valid value can be determined the + * array will be empty, otherwise it will contain one or more values. + */ +$.fn.fieldValue = function(successful) { + for (var val=[], i=0, max=this.length; i < max; i++) { + var el = this[i]; + var v = $.fieldValue(el, successful); + if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) + continue; + v.constructor == Array ? $.merge(val, v) : val.push(v); + } + return val; +}; + +/** + * Returns the value of the field element. + */ +$.fieldValue = function(el, successful) { + var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); + if (typeof successful == 'undefined') successful = true; + + if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || + (t == 'checkbox' || t == 'radio') && !el.checked || + (t == 'submit' || t == 'image') && el.form && el.form.clk != el || + tag == 'select' && el.selectedIndex == -1)) + return null; + + if (tag == 'select') { + var index = el.selectedIndex; + if (index < 0) return null; + var a = [], ops = el.options; + var one = (t == 'select-one'); + var max = (one ? index+1 : ops.length); + for(var i=(one ? index : 0); i < max; i++) { + var op = ops[i]; + if (op.selected) { + var v = op.value; + if (!v) // extra pain for IE... + v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; + if (one) return v; + a.push(v); + } + } + return a; + } + return el.value; +}; + +/** + * Clears the form data. Takes the following actions on the form's input fields: + * - input text fields will have their 'value' property set to the empty string + * - select elements will have their 'selectedIndex' property set to -1 + * - checkbox and radio inputs will have their 'checked' property set to false + * - inputs of type submit, button, reset, and hidden will *not* be effected + * - button elements will *not* be effected + */ +$.fn.clearForm = function() { + return this.each(function() { + $('input,select,textarea', this).clearFields(); + }); +}; + +/** + * Clears the selected form elements. + */ +$.fn.clearFields = $.fn.clearInputs = function() { + return this.each(function() { + var t = this.type, tag = this.tagName.toLowerCase(); + if (t == 'text' || t == 'password' || tag == 'textarea') + this.value = ''; + else if (t == 'checkbox' || t == 'radio') + this.checked = false; + else if (tag == 'select') + this.selectedIndex = -1; + }); +}; + +/** + * Resets the form data. Causes all form elements to be reset to their original value. + */ +$.fn.resetForm = function() { + return this.each(function() { + // guard against an input with the name of 'reset' + // note that IE reports the reset function as an 'object' + if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) + this.reset(); + }); +}; + +/** + * Enables or disables any matching elements. + */ +$.fn.enable = function(b) { + if (b == undefined) b = true; + return this.each(function() { + this.disabled = !b; + }); +}; + +/** + * Checks/unchecks any matching checkboxes or radio buttons and + * selects/deselects and matching option elements. + */ +$.fn.selected = function(select) { + if (select == undefined) select = true; + return this.each(function() { + var t = this.type; + if (t == 'checkbox' || t == 'radio') + this.checked = select; + else if (this.tagName.toLowerCase() == 'option') { + var $sel = $(this).parent('select'); + if (select && $sel[0] && $sel[0].type == 'select-one') { + // deselect all other options + $sel.find('option').selected(false); + } + this.selected = select; + } + }); +}; + +// helper fn for console logging +// set $.fn.ajaxSubmit.debug to true to enable debug logging +function log() { + if ($.fn.ajaxSubmit.debug && window.console && window.console.log) + window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,'')); +}; + +})(jQuery); diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index e38a0abf5..35d777020 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -2,27 +2,28 @@ # Create your views here. import mimetypes +from os import listdir +from os import stat +from os.path import isdir +from os.path import isfile +from os.path import join + +from django.conf import settings +from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import HttpResponseNotFound -from django.conf import settings from django.shortcuts import render_to_response from django.template import RequestContext -from django.contrib.auth.decorators import login_required -from os.path import join -from os.path import isdir -from os.path import isfile -from os import listdir -from os import stat def check_server(function): def _dec(view_func): - def _view(request, *args, **kwargs): + def _view(request, * args, ** kwargs): try: version = settings.PYLOAD.get_server_version() except Exception, e: - return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.',str(e)]) - return view_func(request, *args, **kwargs) + return base(request, messages=['Can\'t connect to pyLoad. Please check your configuration and make sure pyLoad is running.', str(e)]) + return view_func(request, * args, ** kwargs) _view.__name__ = view_func.__name__ _view.__dict__ = view_func.__dict__ @@ -38,9 +39,9 @@ def check_server(function): def permission(perm): def _dec(view_func): - def _view(request, *args, **kwargs): + def _view(request, * args, ** kwargs): if request.user.has_perm(perm): - return view_func(request, *args, **kwargs) + return view_func(request, * args, ** kwargs) else: return base(request, messages=['You don\'t have permission to view this page.']) @@ -59,20 +60,20 @@ def status_proc(request): def base(request, messages): - return render_to_response(join(settings.TEMPLATE,'base.html'), {'messages': messages},RequestContext(request)) + return render_to_response(join(settings.TEMPLATE, 'base.html'), {'messages': messages}, RequestContext(request)) @login_required @permission('pyload.can_see_dl') @check_server def home(request): - return render_to_response(join(settings.TEMPLATE,'home.html'), RequestContext(request,{'content': settings.PYLOAD.status_downloads()},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'home.html'), RequestContext(request, {'content': settings.PYLOAD.status_downloads()}, [status_proc])) @login_required @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE,'queue.html'), RequestContext(request,{},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {}, [status_proc])) @login_required @@ -89,8 +90,8 @@ def downloads(request): for item in listdir(settings.DL_ROOT): if isdir(join(settings.DL_ROOT, item)): folder = { - 'name' : item, - 'files' : [] + 'name': item, + 'files': [] } for file in listdir(join(settings.DL_ROOT, item)): if isfile(join(settings.DL_ROOT, item, file)): @@ -101,15 +102,15 @@ def downloads(request): data['files'].append(item) - return render_to_response(join(settings.TEMPLATE,'downloads.html'), RequestContext(request,{'files': data},[status_proc])) + return render_to_response(join(settings.TEMPLATE, 'downloads.html'), RequestContext(request, {'files': data}, [status_proc])) @login_required @permission('pyload.user.can_download') @check_server -def download(request,path): +def download(request, path): path = path.split("/") - dir = join(settings.DL_ROOT, path[1].replace('..','')) + dir = join(settings.DL_ROOT, path[1].replace('..', '')) if isdir(dir) or isfile(dir): if isdir(dir): filepath = join(dir, path[2]) elif isfile(dir): filepath = dir @@ -125,7 +126,7 @@ def download(request,path): response['Content-Length'] = str(stat(filepath).st_size) if encoding is not None: - response['Content-Encoding'] = encoding + response['Content-Encoding'] = encoding response.write(file(filepath, "rb").read()) return response @@ -143,7 +144,7 @@ def logs(request, page=0): log = file(join(settings.LOG_ROOT, "log.txt")).readlines() data = [] page = int(page) - for i in range(page, page+20): - data.append({'line': i+1 , 'content' :log[i]}) + for i in range(page, page + 20): + data.append({'line': i + 1, 'content':log[i]}) - return render_to_response(join(settings.TEMPLATE,'logs.html'), RequestContext(request,{'log': data, 'next': str(page+20) , 'prev': 0 if page-20 < 0 else page-20},[status_proc])) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) \ No newline at end of file diff --git a/module/web/run_unix.py b/module/web/run_unix.py new file mode 100755 index 000000000..09c67b282 --- /dev/null +++ b/module/web/run_unix.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +from __future__ import with_statement +import os + +pid = os.fork() +if pid: + with open("webserver.pid", "w") as f: + f.write(str(pid)) +else: + from django.core.management import execute_manager + + try: + import settings # Assumed to be in the same directory. + except ImportError: + import sys + sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) + sys.exit(1) + + if __name__ == "__main__": + execute_manager(settings) \ No newline at end of file diff --git a/module/web/settings.py b/module/web/settings.py index 3b242164c..dff1dc29d 100644 --- a/module/web/settings.py +++ b/module/web/settings.py @@ -132,4 +132,4 @@ INSTALLED_APPS = ( AUTH_PROFILE_MODULE = 'pyload.UserProfile' -LOGIN_URL = '/login' +LOGIN_URL = '/login' \ No newline at end of file diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index cd0b85903..7171a1f1c 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -12,13 +12,16 @@ <script src="{{ MEDIA_URL }}js/sprintf.js"></script> <script src="{{ MEDIA_URL }}js/funktions.js"></script> <script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script> +<script src="{{ MEDIA_URL }}js/jquery.form.js"></script> <title>{% block title %}pyLoad Webinterface{% endblock %}</title> <script type="text/javascript"> $(document).ready(function(){ $.getJSON('/json/status', LoadJsonToContent ); - $.getJSON('/json/links', LinksToContent ); + $('#add_form').ajaxForm(function() { + AddBox(); + }); }); @@ -58,20 +61,6 @@ function AddBox() } } -function AddSubmit() -{ - $("#add_form").submit(); - /* - $.post("/json/add_package", { links: $("#add_links").text() } ); - return false; - if( $("#add_cf").val() != "" ) - { - //$("#add_form").submit(); - } - */ - AddBox(); - -} </script> {% block head %} diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 49633f94a..96f3015d9 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -9,6 +9,9 @@ $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1) setTimeout( UpdateLinks( SetInver, index+1 ), SetInver[index]*1000); }*/ +$(document).ready(function(){ + $.getJSON('/json/links', LinksToContent ); +}); function LinksToContent(data) { diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index ec4ca496a..fa49565d3 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -2,10 +2,11 @@ <div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;"> <div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div> <h1>Add</h1> - <form id="add_form" action="" method="post" onsubmit="return AddSubmit();"> + <form id="add_form" action="json/add_package" method="post"> + Packagename<input name="add_name" type="text" size="20" /> <textarea rows="5" style="width: 890px;" name="add_links" id="add_links"></textarea> <br /> - <input type="file" name="add_cf" id="add_cf" /> - <input type="submit" value="Add Links" /> + <input type="file" name="add_file" id="add_file" /> + <input id="add_submit" type="submit" value="Add Links"/> </form> </div> -- cgit v1.2.3 From 70749232e6ea7875c14e98c79065340c680168e9 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 10 Jan 2010 18:10:34 +0100 Subject: new addbox design --- module/web/media/default/css/window.css | 89 +++++++++++++++++++++++++------ module/web/media/default/img/button.png | Bin 0 -> 452 bytes module/web/templates/default/base.html | 1 + module/web/templates/default/window.html | 40 ++++++++++---- 4 files changed, 104 insertions(+), 26 deletions(-) create mode 100644 module/web/media/default/img/button.png (limited to 'module') diff --git a/module/web/media/default/css/window.css b/module/web/media/default/css/window.css index aaccae082..130486d48 100644 --- a/module/web/media/default/css/window.css +++ b/module/web/media/default/css/window.css @@ -1,17 +1,74 @@ -.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;} -.SWclearfix {display: inline-table;} -* html .SWclearfix {height: 1%;} -.SWclearfix {display: block;} +/* ----------- My Form ----------- */ +.myform{ +margin:0 auto; +width:600px; +padding:14px; -div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;} -div.DefaultStickyWin div.top_ul{background:url(/static/window/full.png) top left no-repeat; height:30px; width:15px; float:left} -div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(/static/window/full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px} -div.DefaultStickyWin h1.caption{clear: none !important; margin:0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;} -div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(/static/window/body.png) top left repeat-y; margin:0px 20px 0px 0px !important; margin-bottom: -3px; position: relative; top: 0px !important; top: -3px;} -div.DefaultStickyWin div.body{background:url(/static/window/body.png) top right repeat-y; padding:8px 30px 8px 0px !important; margin-left:5px !important; position:relative; right:-20px !important;} -div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(/static/window/full.png) bottom left no-repeat; width:15px; height:15px; float:left} -div.DefaultStickyWin div.bottom_lr{background:url(/static/window/full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px} -div.DefaultStickyWin div.closeButtons{text-align: center; background:url(/static/window/body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px} -div.DefaultStickyWin a.button:hover{background:url(/static/window/big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(/static/window/big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;} -div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(/static/window/closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer;top:0px} -div.DefaultStickyWin div.dragHandle { width: 11px; height: 25px; position: relative; top: 5px; left: -3px; cursor: move; background: url(/static/window/drag_corner.gif); float: left;} \ No newline at end of file +left:50%; +top:150px; +margin-left: -350px; +position: absolute; +background: #FFF; +display:none; +} + +/* ----------- stylized ----------- */ +#add_box{ +border:solid 2px #b7ddf2; +background:#ebf4fb; +} +#add_box h1 { +font-size:14px; +font-weight:bold; +margin-bottom:8px; +} +#add_box p{ +font-size:11px; +color:#666666; +margin-bottom:20px; +border-bottom:solid 1px #b7ddf2; +padding-bottom:10px; +} +#add_box label{ +display:block; +font-weight:bold; +text-align:right; +width:240px; +float:left; +} +#add_box .small{ +color:#666666; +display:block; +font-size:11px; +font-weight:normal; +text-align:right; +width:240px; +} +#add_box input{ +float:left; +font-size:12px; +padding:4px 2px; +border:solid 1px #aacfe4; +width:300px; +margin:2px 0 20px 10px; +} +#add_box textarea{ +float:left; +font-size:12px; +padding:4px 2px; +border:solid 1px #aacfe4; +width:300px; +margin:2px 0 20px 10px; +} +#add_box button{ +clear:both; +margin-left:150px; +width:125px; +height:31px; +background:#666666 url(../img/button.png) no-repeat; +text-align:center; +line-height:31px; +color:#FFFFFF; +font-size:11px; +font-weight:bold; +} \ No newline at end of file diff --git a/module/web/media/default/img/button.png b/module/web/media/default/img/button.png new file mode 100644 index 000000000..890160614 Binary files /dev/null and b/module/web/media/default/img/button.png differ diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 7171a1f1c..6f9d5ff46 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -7,6 +7,7 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css"> +<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/window.css"> <script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script> <!--<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script>--> <script src="{{ MEDIA_URL }}js/sprintf.js"></script> diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index fa49565d3..7ef02e04a 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,12 +1,32 @@ <div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:absolute; top:0px; left:0px; display:none;"> </div> -<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;"> - <div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div> - <h1>Add</h1> - <form id="add_form" action="json/add_package" method="post"> - Packagename<input name="add_name" type="text" size="20" /> - <textarea rows="5" style="width: 890px;" name="add_links" id="add_links"></textarea> - <br /> - <input type="file" name="add_file" id="add_file" /> - <input id="add_submit" type="submit" value="Add Links"/> - </form> +<!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">--> + + <!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>--> +<div id="add_box" class="myform"> +<form id="add_form" action="json/add_package" method="post"> +<h1>Add Package</h1> +<p>Paste your links or upload a container.</p> +<label>Name +<span class="small">The name of the new package.</span> +</label> +<input name="add_name" type="text" size="20" /> + +<label>Links +<span class="small">Paste your links here</span> +</label> +<textarea rows="5" name="add_links" id="add_links"></textarea> + +<label>File +<span class="small">Upload a container.</span> +</label> +<input type="file" name="add_file" id="add_file" /> + +<button type="submit">Add Package</button> +<button style="margin-left:0px;" type="reset" onclick="AddBox();">Reset</button> +<div class="spacer"></div> + +</form> + +</div> + </div> -- cgit v1.2.3 From efa32b11e9cbbe265047cd582670cc2a1f3df310 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Sun, 10 Jan 2010 20:06:20 +0100 Subject: webinterface - little css change --- module/web/media/default/css/window.css | 147 ++++++++++++++++---------------- 1 file changed, 74 insertions(+), 73 deletions(-) (limited to 'module') diff --git a/module/web/media/default/css/window.css b/module/web/media/default/css/window.css index 130486d48..4c209f33b 100644 --- a/module/web/media/default/css/window.css +++ b/module/web/media/default/css/window.css @@ -1,74 +1,75 @@ -/* ----------- My Form ----------- */ -.myform{ -margin:0 auto; -width:600px; -padding:14px; - -left:50%; -top:150px; -margin-left: -350px; -position: absolute; -background: #FFF; -display:none; -} - -/* ----------- stylized ----------- */ -#add_box{ -border:solid 2px #b7ddf2; -background:#ebf4fb; -} -#add_box h1 { -font-size:14px; -font-weight:bold; -margin-bottom:8px; -} -#add_box p{ -font-size:11px; -color:#666666; -margin-bottom:20px; -border-bottom:solid 1px #b7ddf2; -padding-bottom:10px; -} -#add_box label{ -display:block; -font-weight:bold; -text-align:right; -width:240px; -float:left; -} -#add_box .small{ -color:#666666; -display:block; -font-size:11px; -font-weight:normal; -text-align:right; -width:240px; -} -#add_box input{ -float:left; -font-size:12px; -padding:4px 2px; -border:solid 1px #aacfe4; -width:300px; -margin:2px 0 20px 10px; -} -#add_box textarea{ -float:left; -font-size:12px; -padding:4px 2px; -border:solid 1px #aacfe4; -width:300px; -margin:2px 0 20px 10px; -} -#add_box button{ -clear:both; -margin-left:150px; -width:125px; -height:31px; -background:#666666 url(../img/button.png) no-repeat; -text-align:center; -line-height:31px; -color:#FFFFFF; -font-size:11px; -font-weight:bold; +/* ----------- My Form ----------- */ +.myform{ +margin:0 auto; +width:600px; +padding:14px; + +left:50%; +top:150px; +margin-left: -350px; +position: absolute; +background: #FFF; +display:none; +} + +/* ----------- stylized ----------- */ +#add_box{ +border:solid 2px #b7ddf2; +background:#ebf4fb; +} +#add_box h1 { +font-size:14px; +font-weight:bold; +margin-bottom:8px; +} +#add_box p{ +font-size:11px; +color:#666666; +margin-bottom:20px; +border-bottom:solid 1px #b7ddf2; +padding-bottom:10px; +} +#add_box label{ +display:block; +font-weight:bold; +text-align:right; +width:240px; +float:left; +} +#add_box .small{ +color:#666666; +display:block; +font-size:11px; +font-weight:normal; +text-align:right; +width:240px; +} +#add_box input{ +float:left; +font-size:12px; +padding:4px 2px; +border:solid 1px #aacfe4; +width:300px; +margin:2px 0 20px 10px; +} +#add_box textarea{ +float:left; +font-size:12px; +padding:4px 2px; +border:solid 1px #aacfe4; +width:300px; +margin:2px 0 20px 10px; +} +#add_box button{ +clear:both; +margin-left:150px; +width:125px; +height:31px; +background:#666666 url(../img/button.png) no-repeat; +text-align:center; +line-height:31px; +color:#FFFFFF; +font-size:11px; +font-weight:bold; +border: 0px; } \ No newline at end of file -- cgit v1.2.3 From 5448bace91d93bd499e89d9ca5496321b4dc816c Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 10 Jan 2010 21:29:01 +0100 Subject: fixed mp3convert --- module/HookManager.py | 2 +- module/plugins/hooks/Mp3Convert.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index 57b766201..3a1a3d533 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -54,7 +54,7 @@ class HookManager(): module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) plugin = pluginClass(self.core) - plugin.setup() + plugin.readConfig() plugins.append(plugin) self.logger.info("Activated %s" % pluginName) diff --git a/module/plugins/hooks/Mp3Convert.py b/module/plugins/hooks/Mp3Convert.py index d70bb93f6..6f32eecf4 100644 --- a/module/plugins/hooks/Mp3Convert.py +++ b/module/plugins/hooks/Mp3Convert.py @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. - @author: mkaay + @author: mkaaym spoob @interface-version: 0.1 """ @@ -30,8 +30,8 @@ class Mp3Convert(Hook): props['name'] = "Mp3Convert" props['version'] = "0.1" props['description'] = """converts files like videos to mp3""" - props['author_name'] = ("spoob") - props['author_mail'] = ("spoob@pyload.org") + props['author_name'] = ("spoob", "mkaay") + props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") self.props = props self.readConfig() @@ -48,3 +48,4 @@ class Mp3Convert(Hook): def setup(self): self.configParser.set(self.props["name"], {"option": "removeRegularFile", "type": "bool", "name": "Remove Regular Files"}, False) + Hook.setup(self) -- cgit v1.2.3 From f7d85633be5b0d470fefd0c2dbb92454b80e0c2f Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Sun, 10 Jan 2010 21:36:49 +0100 Subject: edited wrong file in last commit --- module/plugins/Hook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 2d8ed0741..1a7fba092 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -46,7 +46,8 @@ class Hook(): self.setup() def setup(self): - pass + self.configParser.set(self.props["name"], {"option": "activated", "type": "bool", "name": "Activated"}, True) + self.readConfig() def isActivated(self): return self.config["activated"] -- cgit v1.2.3 From 9bff9c69d6983dc190c189647821e12d0f134883 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Mon, 11 Jan 2010 22:16:31 +0100 Subject: finally and officially: webinterface home page working ;) --- module/web/ajax/views.py | 10 +- module/web/media/default/js/funktions.js | 9 +- module/web/media/default/js/home.js | 204 ------- module/web/media/default/js/jquery-1.3.2.min.js | 19 - .../media/default/js/jquery-ui-1.7.2.custom.min.js | 298 ---------- module/web/media/default/js/jquery.form.js | 660 --------------------- module/web/media/default/js/jquery.progressbar.js | 183 ------ module/web/media/default/js/mootools-1.2.4-core.js | 337 +++++++++++ .../web/media/default/js/mootools-1.2.4.2-more.js | 134 +++++ module/web/pyload/views.py | 2 +- module/web/templates/default/base.html | 78 ++- module/web/templates/default/home.html | 195 +++++- module/web/templates/default/window.html | 2 +- 13 files changed, 704 insertions(+), 1427 deletions(-) delete mode 100644 module/web/media/default/js/home.js delete mode 100644 module/web/media/default/js/jquery-1.3.2.min.js delete mode 100644 module/web/media/default/js/jquery-ui-1.7.2.custom.min.js delete mode 100644 module/web/media/default/js/jquery.form.js delete mode 100644 module/web/media/default/js/jquery.progressbar.js create mode 100644 module/web/media/default/js/mootools-1.2.4-core.js create mode 100644 module/web/media/default/js/mootools-1.2.4.2-more.js (limited to 'module') diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 952fbe2eb..08d87c30e 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -38,8 +38,7 @@ class JsonResponse(HttpResponse): def add_package(request): name = request.POST['add_name'] - - if name is None or "": + if name == None or name == "": return HttpResponseServerError() links = request.POST['add_links'].split("\n") @@ -72,7 +71,12 @@ def status(request): @permission('pyload.can_see_dl') def links(request): try: - return JsonResponse(settings.PYLOAD.status_downloads()) + links = settings.PYLOAD.status_downloads() + ids = map(lambda x: x['id'], links) + data = {} + data['links'] = links + data['ids'] = ids + return JsonResponse(data) except: return HttpResponseServerError() diff --git a/module/web/media/default/js/funktions.js b/module/web/media/default/js/funktions.js index ed1471595..9ca165b36 100644 --- a/module/web/media/default/js/funktions.js +++ b/module/web/media/default/js/funktions.js @@ -13,4 +13,11 @@ function HumanFileSize(size) var i = Math.floor(loga); var a = Math.pow(1024, i); return Math.round( size / a , 2) + " " + filesizename[i]; -} \ No newline at end of file +} + +Array.prototype.remove = function(from, to) { + var rest = this.slice((to || from) + 1 || this.length); + this.length = from < 0 ? this.length + from : from; + if (this.length == 0) return []; + return this.push.apply(this, rest); +}; \ No newline at end of file diff --git a/module/web/media/default/js/home.js b/module/web/media/default/js/home.js deleted file mode 100644 index 61a1f60d0..000000000 --- a/module/web/media/default/js/home.js +++ /dev/null @@ -1,204 +0,0 @@ -var dwProgressBar = new Class({ - - //implements - Implements: [Options], - - //options - options: { - container: $$('body')[0], - boxID: '', - percentageID: '', - displayID: '', - startPercentage: 0, - displayText: false, - speed: 10 - }, - - //initialization - initialize: function(options) { - //set options - this.setOptions(options); - //create elements - this.createElements(); - }, - - //creates the box and percentage elements - createElements: function() { - var box = new Element('div', { - id: this.options.boxID + this.options.id, - 'class': this.options.boxID - }); - var perc = new Element('div', { - id: this.options.percentageID + this.options.id, - 'style': 'width:0px;', - 'class': this.options.percentageID - }); - perc.inject(box); - box.inject(this.options.container); - if (this.options.displayText) { - var text = new Element('div', { - id: this.options.displayID + this.options.id, - 'class': this.options.displayID - }); - text.inject(this.options.container); - } - this.set(this.options.startPercentage); - }, - - //calculates width in pixels from percentage - calculate: function(percentage) { - return (document.id(this.options.boxID + this.options.id).getStyle('width').replace('px', '') * (percentage / 100)).toInt(); - }, - - //animates the change in percentage - animate: function(to) { - document.id(this.options.percentageID + this.options.id).set('morph', { - duration: this.options.speed, - link: 'cancel' - }).morph({ - width: this.calculate(to.toInt()) - }); - if (this.options.displayText) { - document.id(this.options.displayID + this.options.id).set('text', to.toInt() + '%'); - } - }, - - //sets the percentage from its current state to desired percentage - set: function(to) { - this.animate(to); - } - -}); -/* -req = new Request.JSON({ - onSuccess: renderTable, - method: 'get', - url: '/json/links', - initialDelay: 0, - delay: 1000, - limit: 20000 -}); -*/ -var dls = [] -var pbs = [] - -function renderTable(data) { - - data.downloads.each(function(dl) { - - if (dls.contains(dl.id)) { - - var div = $('dl' + dl.id) - - pbs[dl.id].set(dl.percent) - - div.getChildren("b")[0].textContent = dl.name - - if (dl.status == "downloading") { - - size = Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB"; - speed = Math.round(dl.speed) + " kb/s"; - eta = dl.eta; - - } else if (dl.status == "waiting") { - - size = "waiting " + dl.wait; - speed = ""; - eta = ""; - - } - div.getChildren(".dlsize")[0].textContent = size; - div.getChildren(".dlspeed")[0].textContent = speed; - div.getChildren(".dltime")[0].textContent = eta; - - } else { - - dls.push(dl.id) - - container = $("dlcontainer") - - dldiv = new Element('div', { - 'id': 'dl' + dl.id, - 'class': 'download', - 'styles': { - 'display': 'None' - } - }) - - new Element('p').inject(dldiv) - - new Element('b', { - 'html': dl.name - }).inject(dldiv) - - new Element('br').inject(dldiv) - - dldiv.inject(container) - - pbs[dl.id] = new dwProgressBar({ - container: $(dldiv), - startPercentage: 0, - speed: 1000, - id: dl.id, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' - }); - - new Element('div', { - 'class': 'dlsize', - 'html': Math.round((dl.size - dl.kbleft) / 1024) + "/" + Math.round(dl.size / 1024) + " MB" - }).inject(dldiv) - - new Element('div', { - 'class': 'dlspeed', - 'html': Math.round(dl.speed) + " kb/s" - }).inject(dldiv) - - new Element('div', { - 'class': 'dltime', - 'html': dl.eta - }).inject(dldiv) - - //dldiv.dissolve({duration : 0}) - dldiv.reveal() - - } - }) - - dls.each(function(id, index) { - - if (data.ids.contains(id)) { - -} else { - - //$("dl"+id).reveal() - dls.erase(id); - $('dl' + id).nix() - - } - - }) - -} - -window.addEvent('domready', -function() { - - /* -//create the progress bar for example 1 -pb = new dwProgressBar({ - container: $$('.level1 p')[0], - startPercentage: 25, - speed: 1000, - id: 1, - boxID: 'box', - percentageID: 'perc', - displayText: true, - displayID: 'boxtext' -}); -*/ -}); - - diff --git a/module/web/media/default/js/jquery-1.3.2.min.js b/module/web/media/default/js/jquery-1.3.2.min.js deleted file mode 100644 index b1ae21d8b..000000000 --- a/module/web/media/default/js/jquery-1.3.2.min.js +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js b/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js deleted file mode 100644 index cf19f30a9..000000000 --- a/module/web/media/default/js/jquery-ui-1.7.2.custom.min.js +++ /dev/null @@ -1,298 +0,0 @@ -/* - * jQuery UI 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m<n.length;m++){if(j.options[n[m][0]]){n[m][1].apply(j.element,k)}}}},contains:function(k,j){return document.compareDocumentPosition?k.compareDocumentPosition(j)&16:k!==j&&k.contains(j)},hasScroll:function(m,k){if(c(m).css("overflow")=="hidden"){return false}var j=(k&&k=="left")?"scrollLeft":"scrollTop",l=false;if(m[j]>0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* - * jQuery UI Draggable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.draggable",a.extend({},a.ui.mouse,{_init:function(){if(this.options.helper=="original"&&!(/^(?:r|a|f)/).test(this.element.css("position"))){this.element[0].style.position="relative"}(this.options.addClasses&&this.element.addClass("ui-draggable"));(this.options.disabled&&this.element.addClass("ui-draggable-disabled"));this._mouseInit()},destroy:function(){if(!this.element.data("draggable")){return}this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(b){var c=this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")){return false}this.handle=this._getHandle(b);if(!this.handle){return false}return true},_mouseStart:function(b){var c=this.options;this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager){a.ui.ddmanager.current=this}this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;if(c.cursorAt){this._adjustOffsetFromHelper(c.cursorAt)}if(c.containment){this._setContainment()}this._trigger("start",b);this._cacheHelperProportions();if(a.ui.ddmanager&&!c.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,b)}this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);return true},_mouseDrag:function(b,d){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!d){var c=this._uiHash();this._trigger("drag",b,c);this.position=c.position}if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}if(a.ui.ddmanager){a.ui.ddmanager.drag(this,b)}return false},_mouseStop:function(c){var d=false;if(a.ui.ddmanager&&!this.options.dropBehaviour){d=a.ui.ddmanager.drop(this,c)}if(this.dropped){d=this.dropped;this.dropped=false}if((this.options.revert=="invalid"&&!d)||(this.options.revert=="valid"&&d)||this.options.revert===true||(a.isFunction(this.options.revert)&&this.options.revert.call(this.element,d))){var b=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){b._trigger("stop",c);b._clear()})}else{this._trigger("stop",c);this._clear()}return false},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target){c=true}});return c},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c])):(d.helper=="clone"?this.element.clone():this.element);if(!b.parents("body").length){b.appendTo((d.appendTo=="parent"?this.element[0].parentNode:d.appendTo))}if(b[0]!=this.element[0]&&!(/(fixed|absolute)/).test(b.css("position"))){b.css("position","absolute")}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.element.css("marginLeft"),10)||0),top:(parseInt(this.element.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)&&e.containment.constructor!=Array){var c=a(e.containment)[0];if(!c){return}var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}else{if(e.containment.constructor==Array){this.containment=e.containment}}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");if(this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval){this.helper.remove()}this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag"){this.positionAbs=this._convertPositionTo("absolute")}return a.widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(b){return{helper:this.helper,position:this.position,absolutePosition:this.positionAbs,offset:this.positionAbs}}}));a.extend(a.ui.draggable,{version:"1.7.2",eventPrefix:"drag",defaults:{addClasses:true,appendTo:"parent",axis:false,cancel:":input,option",connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false}});a.ui.plugin.add("draggable","connectToSortable",{start:function(c,e){var d=a(this).data("draggable"),f=d.options,b=a.extend({},e,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var g=a.data(this,"sortable");if(g&&!g.options.disabled){d.sortables.push({instance:g,shouldRevert:g.options.revert});g._refreshItems();g._trigger("activate",c,b)}})},stop:function(c,e){var d=a(this).data("draggable"),b=a.extend({},e,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert){this.instance.options.revert=true}this.instance._mouseStop(c);this.instance.options.helper=this.instance.options._helper;if(d.options.helper=="original"){this.instance.currentItem.css({top:"auto",left:"auto"})}}else{this.instance.cancelHelperRemoval=false;this.instance._trigger("deactivate",c,b)}})},drag:function(c,f){var e=a(this).data("draggable"),b=this;var d=function(i){var n=this.offset.click.top,m=this.offset.click.left;var g=this.positionAbs.top,k=this.positionAbs.left;var j=i.height,l=i.width;var p=i.top,h=i.left;return a.ui.isOver(g+n,k+m,p,h,j,l)};a.each(e.sortables,function(g){this.instance.positionAbs=e.positionAbs;this.instance.helperProportions=e.helperProportions;this.instance.offset.click=e.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(b).clone().appendTo(this.instance.element).data("sortable-item",true);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return f.helper[0]};c.target=this.instance.currentItem[0];this.instance._mouseCapture(c,true);this.instance._mouseStart(c,true,true);this.instance.offset.click.top=e.offset.click.top;this.instance.offset.click.left=e.offset.click.left;this.instance.offset.parent.left-=e.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=e.offset.parent.top-this.instance.offset.parent.top;e._trigger("toSortable",c);e.dropped=this.instance.element;e.currentItem=e.element;this.instance.fromOutside=e}if(this.instance.currentItem){this.instance._mouseDrag(c)}}else{if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",c,this.instance._uiHash(this.instance));this.instance._mouseStop(c,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();if(this.instance.placeholder){this.instance.placeholder.remove()}e._trigger("fromSortable",c);e.dropped=false}}})}});a.ui.plugin.add("draggable","cursor",{start:function(c,d){var b=a("body"),e=a(this).data("draggable").options;if(b.css("cursor")){e._cursor=b.css("cursor")}b.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._cursor){a("body").css("cursor",d._cursor)}}});a.ui.plugin.add("draggable","iframeFix",{start:function(b,c){var d=a(this).data("draggable").options;a(d.iframeFix===true?"iframe":d.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1000}).css(a(this).offset()).appendTo("body")})},stop:function(b,c){a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});a.ui.plugin.add("draggable","opacity",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("opacity")){e._opacity=b.css("opacity")}b.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._opacity){a(c.helper).css("opacity",d._opacity)}}});a.ui.plugin.add("draggable","scroll",{start:function(c,d){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){b.overflowOffset=b.scrollParent.offset()}},drag:function(d,e){var c=a(this).data("draggable"),f=c.options,b=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!f.axis||f.axis!="x"){if((c.overflowOffset.top+c.scrollParent[0].offsetHeight)-d.pageY<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop+f.scrollSpeed}else{if(d.pageY-c.overflowOffset.top<f.scrollSensitivity){c.scrollParent[0].scrollTop=b=c.scrollParent[0].scrollTop-f.scrollSpeed}}}if(!f.axis||f.axis!="y"){if((c.overflowOffset.left+c.scrollParent[0].offsetWidth)-d.pageX<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft+f.scrollSpeed}else{if(d.pageX-c.overflowOffset.left<f.scrollSensitivity){c.scrollParent[0].scrollLeft=b=c.scrollParent[0].scrollLeft-f.scrollSpeed}}}}else{if(!f.axis||f.axis!="x"){if(d.pageY-a(document).scrollTop()<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-f.scrollSpeed)}else{if(a(window).height()-(d.pageY-a(document).scrollTop())<f.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+f.scrollSpeed)}}}if(!f.axis||f.axis!="y"){if(d.pageX-a(document).scrollLeft()<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-f.scrollSpeed)}else{if(a(window).width()-(d.pageX-a(document).scrollLeft())<f.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+f.scrollSpeed)}}}}if(b!==false&&a.ui.ddmanager&&!f.dropBehaviour){a.ui.ddmanager.prepareOffsets(c,d)}}});a.ui.plugin.add("draggable","snap",{start:function(c,d){var b=a(this).data("draggable"),e=b.options;b.snapElements=[];a(e.snap.constructor!=String?(e.snap.items||":data(draggable)"):e.snap).each(function(){var g=a(this);var f=g.offset();if(this!=b.element[0]){b.snapElements.push({item:this,width:g.outerWidth(),height:g.outerHeight(),top:f.top,left:f.left})}})},drag:function(u,p){var g=a(this).data("draggable"),q=g.options;var y=q.snapTolerance;var x=p.offset.left,w=x+g.helperProportions.width,f=p.offset.top,e=f+g.helperProportions.height;for(var v=g.snapElements.length-1;v>=0;v--){var s=g.snapElements[v].left,n=s+g.snapElements[v].width,m=g.snapElements[v].top,A=m+g.snapElements[v].height;if(!((s-y<x&&x<n+y&&m-y<f&&f<A+y)||(s-y<x&&x<n+y&&m-y<e&&e<A+y)||(s-y<w&&w<n+y&&m-y<f&&f<A+y)||(s-y<w&&w<n+y&&m-y<e&&e<A+y))){if(g.snapElements[v].snapping){(g.options.snap.release&&g.options.snap.release.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=false;continue}if(q.snapMode!="inner"){var c=Math.abs(m-e)<=y;var z=Math.abs(A-f)<=y;var j=Math.abs(s-w)<=y;var k=Math.abs(n-x)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m-g.helperProportions.height,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s-g.helperProportions.width}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n}).left-g.margins.left}}var h=(c||z||j||k);if(q.snapMode!="outer"){var c=Math.abs(m-f)<=y;var z=Math.abs(A-e)<=y;var j=Math.abs(s-x)<=y;var k=Math.abs(n-w)<=y;if(c){p.position.top=g._convertPositionTo("relative",{top:m,left:0}).top-g.margins.top}if(z){p.position.top=g._convertPositionTo("relative",{top:A-g.helperProportions.height,left:0}).top-g.margins.top}if(j){p.position.left=g._convertPositionTo("relative",{top:0,left:s}).left-g.margins.left}if(k){p.position.left=g._convertPositionTo("relative",{top:0,left:n-g.helperProportions.width}).left-g.margins.left}}if(!g.snapElements[v].snapping&&(c||z||j||k||h)){(g.options.snap.snap&&g.options.snap.snap.call(g.element,u,a.extend(g._uiHash(),{snapItem:g.snapElements[v].item})))}g.snapElements[v].snapping=(c||z||j||k||h)}}});a.ui.plugin.add("draggable","stack",{start:function(b,c){var e=a(this).data("draggable").options;var d=a.makeArray(a(e.stack.group)).sort(function(g,f){return(parseInt(a(g).css("zIndex"),10)||e.stack.min)-(parseInt(a(f).css("zIndex"),10)||e.stack.min)});a(d).each(function(f){this.style.zIndex=e.stack.min+f});this[0].style.zIndex=e.stack.min+d.length}});a.ui.plugin.add("draggable","zIndex",{start:function(c,d){var b=a(d.helper),e=a(this).data("draggable").options;if(b.css("zIndex")){e._zIndex=b.css("zIndex")}b.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;if(d._zIndex){a(c.helper).css("zIndex",d._zIndex)}}})})(jQuery);;/* - * jQuery UI Droppable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Droppables - * - * Depends: - * ui.core.js - * ui.draggable.js - */ -(function(a){a.widget("ui.droppable",{_init:function(){var c=this.options,b=c.accept;this.isover=0;this.isout=1;this.options.accept=this.options.accept&&a.isFunction(this.options.accept)?this.options.accept:function(e){return e.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[this.options.scope]=a.ui.ddmanager.droppables[this.options.scope]||[];a.ui.ddmanager.droppables[this.options.scope].push(this);(this.options.addClasses&&this.element.addClass("ui-droppable"))},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++){if(b[c]==this){b.splice(c,1)}}this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable")},_setData:function(b,c){if(b=="accept"){this.options.accept=c&&a.isFunction(c)?c:function(e){return e.is(c)}}else{a.widget.prototype._setData.apply(this,arguments)}},_activate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.addClass(this.options.activeClass)}(b&&this._trigger("activate",c,this.ui(b)))},_deactivate:function(c){var b=a.ui.ddmanager.current;if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}(b&&this._trigger("deactivate",c,this.ui(b)))},_over:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.addClass(this.options.hoverClass)}this._trigger("over",c,this.ui(b))}},_out:function(c){var b=a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("out",c,this.ui(b))}},_drop:function(c,d){var b=d||a.ui.ddmanager.current;if(!b||(b.currentItem||b.element)[0]==this.element[0]){return false}var e=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var f=a.data(this,"droppable");if(f.options.greedy&&a.ui.intersect(b,a.extend(f,{offset:f.element.offset()}),f.options.tolerance)){e=true;return false}});if(e){return false}if(this.options.accept.call(this.element[0],(b.currentItem||b.element))){if(this.options.activeClass){this.element.removeClass(this.options.activeClass)}if(this.options.hoverClass){this.element.removeClass(this.options.hoverClass)}this._trigger("drop",c,this.ui(b));return this.element}return false},ui:function(b){return{draggable:(b.currentItem||b.element),helper:b.helper,position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.7.2",eventPrefix:"drop",defaults:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"}});a.ui.intersect=function(q,j,o){if(!j.offset){return false}var e=(q.positionAbs||q.position.absolute).left,d=e+q.helperProportions.width,n=(q.positionAbs||q.position.absolute).top,m=n+q.helperProportions.height;var g=j.offset.left,c=g+j.proportions.width,p=j.offset.top,k=p+j.proportions.height;switch(o){case"fit":return(g<e&&d<c&&p<n&&m<k);break;case"intersect":return(g<e+(q.helperProportions.width/2)&&d-(q.helperProportions.width/2)<c&&p<n+(q.helperProportions.height/2)&&m-(q.helperProportions.height/2)<k);break;case"pointer":var h=((q.positionAbs||q.position.absolute).left+(q.clickOffset||q.offset.click).left),i=((q.positionAbs||q.position.absolute).top+(q.clickOffset||q.offset.click).top),f=a.ui.isOver(i,h,p,g,j.proportions.height,j.proportions.width);return f;break;case"touch":return((n>=p&&n<=k)||(m>=p&&m<=k)||(n<p&&m>k))&&((e>=g&&e<=c)||(d>=g&&d<=c)||(e<g&&d>c));break;default:return false;break}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,g){var b=a.ui.ddmanager.droppables[e.options.scope];var f=g?g.type:null;var h=(e.currentItem||e.element).find(":data(droppable)").andSelf();droppablesLoop:for(var d=0;d<b.length;d++){if(b[d].options.disabled||(e&&!b[d].options.accept.call(b[d].element[0],(e.currentItem||e.element)))){continue}for(var c=0;c<h.length;c++){if(h[c]==b[d].element[0]){b[d].proportions.height=0;continue droppablesLoop}}b[d].visible=b[d].element.css("display")!="none";if(!b[d].visible){continue}b[d].offset=b[d].element.offset();b[d].proportions={width:b[d].element[0].offsetWidth,height:b[d].element[0].offsetHeight};if(f=="mousedown"){b[d]._activate.call(b[d],g)}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(!this.options){return}if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)){d=this._drop.call(this,c)}if(!this.options.disabled&&this.visible&&this.options.accept.call(this.element[0],(b.currentItem||b.element))){this.isout=1;this.isover=0;this._deactivate.call(this,c)}});return d},drag:function(b,c){if(b.options.refreshPositions){a.ui.ddmanager.prepareOffsets(b,c)}a.each(a.ui.ddmanager.droppables[b.options.scope],function(){if(this.options.disabled||this.greedyChild||!this.visible){return}var e=a.ui.intersect(b,this,this.options.tolerance);var g=!e&&this.isover==1?"isout":(e&&this.isover==0?"isover":null);if(!g){return}var f;if(this.options.greedy){var d=this.element.parents(":data(droppable):eq(0)");if(d.length){f=a.data(d[0],"droppable");f.greedyChild=(g=="isover"?1:0)}}if(f&&g=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[g]=1;this[g=="isout"?"isover":"isout"]=0;this[g=="isover"?"_over":"_out"].call(this,c);if(f&&g=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}})}}})(jQuery);;/* - * jQuery UI Resizable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * ui.core.js - */ -(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f<k.length;f++){var h=c.trim(k[f]),d="ui-resizable-"+h;var g=c('<div class="ui-resizable-handle '+d+'"></div>');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidth<k.width),l=a(k.height)&&h.maxHeight&&(h.maxHeight<k.height),g=a(k.width)&&h.minWidth&&(h.minWidth>k.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e<this._proportionallyResizeElements.length;e++){var g=this._proportionallyResizeElements[e];if(!this.borderDif){var d=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],h=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=c.map(d,function(k,m){var l=parseInt(k,10)||0,n=parseInt(h[m],10)||0;return l+n})}if(c.browser.msie&&!(!(c(f).is(":hidden")||c(f).parents(":hidden").length))){continue}g.css({height:(f.height()-this.borderDif[0]-this.borderDif[2])||0,width:(f.width()-this.borderDif[1]-this.borderDif[3])||0})}},_renderProxy:function(){var e=this.element,h=this.options;this.elementOffset=e.offset();if(this._helper){this.helper=this.helper||c('<div style="overflow:hidden;"></div>');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)){s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);;/* - * jQuery UI Selectable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.selectable",a.extend({},a.ui.mouse,{_init:function(){var b=this;this.element.addClass("ui-selectable");this.dragged=false;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]);c.each(function(){var d=a(this);var e=d.offset();a.data(this,"selectable-item",{element:this,$element:d,left:e.left,top:e.top,right:e.left+d.outerWidth(),bottom:e.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"),selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=c.addClass("ui-selectee");this._mouseInit();this.helper=a(document.createElement("div")).css({border:"1px dotted black"}).addClass("ui-selectable-helper")},destroy:function(){this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy()},_mouseStart:function(d){var b=this;this.opos=[d.pageX,d.pageY];if(this.options.disabled){return}var c=this.options;this.selectees=a(c.filter,this.element[0]);this._trigger("start",d);a(c.appendTo).append(this.helper);this.helper.css({"z-index":100,position:"absolute",left:d.clientX,top:d.clientY,width:0,height:0});if(c.autoRefresh){this.refresh()}this.selectees.filter(".ui-selected").each(function(){var e=a.data(this,"selectable-item");e.startselected=true;if(!d.metaKey){e.$element.removeClass("ui-selected");e.selected=false;e.$element.addClass("ui-unselecting");e.unselecting=true;b._trigger("unselecting",d,{unselecting:e.element})}});a(d.target).parents().andSelf().each(function(){var e=a.data(this,"selectable-item");if(e){e.$element.removeClass("ui-unselecting").addClass("ui-selecting");e.unselecting=false;e.selecting=true;e.selected=true;b._trigger("selecting",d,{selecting:e.element});return false}})},_mouseDrag:function(i){var c=this;this.dragged=true;if(this.options.disabled){return}var e=this.options;var d=this.opos[0],h=this.opos[1],b=i.pageX,g=i.pageY;if(d>b){var f=b;b=d;d=f}if(h>g){var f=g;g=h;h=f}this.helper.css({left:d,top:h,width:b-d,height:g-h});this.selectees.each(function(){var j=a.data(this,"selectable-item");if(!j||j.element==c.element[0]){return}var k=false;if(e.tolerance=="touch"){k=(!(j.left>b||j.right<d||j.top>g||j.bottom<h))}else{if(e.tolerance=="fit"){k=(j.left>d&&j.right<b&&j.top>h&&j.bottom<g)}}if(k){if(j.selected){j.$element.removeClass("ui-selected");j.selected=false}if(j.unselecting){j.$element.removeClass("ui-unselecting");j.unselecting=false}if(!j.selecting){j.$element.addClass("ui-selecting");j.selecting=true;c._trigger("selecting",i,{selecting:j.element})}}else{if(j.selecting){if(i.metaKey&&j.startselected){j.$element.removeClass("ui-selecting");j.selecting=false;j.$element.addClass("ui-selected");j.selected=true}else{j.$element.removeClass("ui-selecting");j.selecting=false;if(j.startselected){j.$element.addClass("ui-unselecting");j.unselecting=true}c._trigger("unselecting",i,{unselecting:j.element})}}if(j.selected){if(!i.metaKey&&!j.startselected){j.$element.removeClass("ui-selected");j.selected=false;j.$element.addClass("ui-unselecting");j.unselecting=true;c._trigger("unselecting",i,{unselecting:j.element})}}}});return false},_mouseStop:function(d){var b=this;this.dragged=false;var c=this.options;a(".ui-unselecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-unselecting");e.unselecting=false;e.startselected=false;b._trigger("unselected",d,{unselected:e.element})});a(".ui-selecting",this.element[0]).each(function(){var e=a.data(this,"selectable-item");e.$element.removeClass("ui-selecting").addClass("ui-selected");e.selecting=false;e.selected=true;e.startselected=true;b._trigger("selected",d,{selected:e.element})});this._trigger("stop",d);this.helper.remove();return false}}));a.extend(a.ui.selectable,{version:"1.7.2",defaults:{appendTo:"body",autoRefresh:true,cancel:":input,option",delay:0,distance:0,filter:"*",tolerance:"touch"}})})(jQuery);;/* - * jQuery UI Sortable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.sortable",a.extend({},a.ui.mouse,{_init:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?(/left|right/).test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--){this.items[b].item.removeData("sortable-item")}},_mouseCapture:function(e,f){if(this.reverting){return false}if(this.options.disabled||this.options.type=="static"){return false}this._refreshItems(e);var d=null,c=this,b=a(e.target).parents().each(function(){if(a.data(this,"sortable-item")==c){d=a(this);return false}});if(a.data(e.target,"sortable-item")==c){d=a(e.target)}if(!d){return false}if(this.options.handle&&!f){var g=false;a(this.options.handle,d).find("*").andSelf().each(function(){if(this==e.target){g=true}});if(!g){return false}}this.currentItem=d;this._removeCurrentsFromItems();return true},_mouseStart:function(e,f,b){var g=this.options,c=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(e);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(e);this.originalPageX=e.pageX;this.originalPageY=e.pageY;if(g.cursorAt){this._adjustOffsetFromHelper(g.cursorAt)}this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};if(this.helper[0]!=this.currentItem[0]){this.currentItem.hide()}this._createPlaceholder();if(g.containment){this._setContainment()}if(g.cursor){if(a("body").css("cursor")){this._storedCursor=a("body").css("cursor")}a("body").css("cursor",g.cursor)}if(g.opacity){if(this.helper.css("opacity")){this._storedOpacity=this.helper.css("opacity")}this.helper.css("opacity",g.opacity)}if(g.zIndex){if(this.helper.css("zIndex")){this._storedZIndex=this.helper.css("zIndex")}this.helper.css("zIndex",g.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){this.overflowOffset=this.scrollParent.offset()}this._trigger("start",e,this._uiHash());if(!this._preserveHelperProportions){this._cacheHelperProportions()}if(!b){for(var d=this.containers.length-1;d>=0;d--){this.containers[d]._trigger("activate",e,c._uiHash(this))}}if(a.ui.ddmanager){a.ui.ddmanager.current=this}if(a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,e)}this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(e);return true},_mouseDrag:function(f){this.position=this._generatePosition(f);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs){this.lastPositionAbs=this.positionAbs}if(this.options.scroll){var g=this.options,b=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if((this.overflowOffset.top+this.scrollParent[0].offsetHeight)-f.pageY<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop+g.scrollSpeed}else{if(f.pageY-this.overflowOffset.top<g.scrollSensitivity){this.scrollParent[0].scrollTop=b=this.scrollParent[0].scrollTop-g.scrollSpeed}}if((this.overflowOffset.left+this.scrollParent[0].offsetWidth)-f.pageX<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft+g.scrollSpeed}else{if(f.pageX-this.overflowOffset.left<g.scrollSensitivity){this.scrollParent[0].scrollLeft=b=this.scrollParent[0].scrollLeft-g.scrollSpeed}}}else{if(f.pageY-a(document).scrollTop()<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()-g.scrollSpeed)}else{if(a(window).height()-(f.pageY-a(document).scrollTop())<g.scrollSensitivity){b=a(document).scrollTop(a(document).scrollTop()+g.scrollSpeed)}}if(f.pageX-a(document).scrollLeft()<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()-g.scrollSpeed)}else{if(a(window).width()-(f.pageX-a(document).scrollLeft())<g.scrollSensitivity){b=a(document).scrollLeft(a(document).scrollLeft()+g.scrollSpeed)}}}if(b!==false&&a.ui.ddmanager&&!g.dropBehaviour){a.ui.ddmanager.prepareOffsets(this,f)}}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y"){this.helper[0].style.left=this.position.left+"px"}if(!this.options.axis||this.options.axis!="x"){this.helper[0].style.top=this.position.top+"px"}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d],c=e.item[0],h=this._intersectsWithPointer(e);if(!h){continue}if(c!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=c&&!a.ui.contains(this.placeholder[0],c)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],c):true)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(e)){this._rearrange(f,e)}else{break}this._trigger("change",f,this._uiHash());break}}this._contactContainers(f);if(a.ui.ddmanager){a.ui.ddmanager.drag(this,f)}this._trigger("sort",f,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(c,d){if(!c){return}if(a.ui.ddmanager&&!this.options.dropBehaviour){a.ui.ddmanager.drop(this,c)}if(this.options.revert){var b=this;var e=b.placeholder.offset();b.reverting=true;a(this.helper).animate({left:e.left-this.offset.parent.left-b.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-b.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){b._clear(c)})}else{this._clear(c,d)}return false},cancel:function(){var b=this;if(this.dragging){this._mouseUp();if(this.options.helper=="original"){this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}for(var c=this.containers.length-1;c>=0;c--){this.containers[c]._trigger("deactivate",null,b._uiHash(this));if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",null,b._uiHash(this));this.containers[c].containerCache.over=0}}}if(this.placeholder[0].parentNode){this.placeholder[0].parentNode.removeChild(this.placeholder[0])}if(this.options.helper!="original"&&this.helper&&this.helper[0].parentNode){this.helper.remove()}a.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});if(this.domPosition.prev){a(this.domPosition.prev).after(this.currentItem)}else{a(this.domPosition.parent).prepend(this.currentItem)}return true},serialize:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};a(b).each(function(){var e=(a(d.item||this).attr(d.attribute||"id")||"").match(d.expression||(/(.+)[-=_](.+)/));if(e){c.push((d.key||e[1]+"[]")+"="+(d.key&&d.expression?e[1]:e[2]))}});return c.join("&")},toArray:function(d){var b=this._getItemsAsjQuery(d&&d.connected);var c=[];d=d||{};b.each(function(){c.push(a(d.item||this).attr(d.attribute||"id")||"")});return c},_intersectsWith:function(m){var e=this.positionAbs.left,d=e+this.helperProportions.width,k=this.positionAbs.top,j=k+this.helperProportions.height;var f=m.left,c=f+m.width,n=m.top,i=n+m.height;var o=this.offset.click.top,h=this.offset.click.left;var g=(k+o)>n&&(k+o)<i&&(e+h)>f&&(e+h)<c;if(this.options.tolerance=="pointer"||this.options.forcePointerForContainers||(this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>m[this.floating?"width":"height"])){return g}else{return(f<e+(this.helperProportions.width/2)&&d-(this.helperProportions.width/2)<c&&n<k+(this.helperProportions.height/2)&&j-(this.helperProportions.height/2)<i)}},_intersectsWithPointer:function(d){var e=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,d.top,d.height),c=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,d.left,d.width),g=e&&c,b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(!g){return false}return this.floating?(((f&&f=="right")||b=="down")?2:1):(b&&(b=="down"?2:1))},_intersectsWithSides:function(e){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,e.top+(e.height/2),e.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,e.left+(e.width/2),e.width),b=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();if(this.floating&&f){return((f=="right"&&d)||(f=="left"&&!d))}else{return b&&((b=="down"&&c)||(b=="up"&&!c))}},_getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions()},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var l=this;var g=[];var e=[];var h=this._connectWith();if(h&&b){for(var d=h.length-1;d>=0;d--){var k=a(h[d]);for(var c=k.length-1;c>=0;c--){var f=a.data(k[c],"sortable");if(f&&f!=this&&!f.options.disabled){e.push([a.isFunction(f.options.items)?f.options.items.call(f.element):a(f.options.items,f.element).not(".ui-sortable-helper"),f])}}}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper"),this]);for(var d=e.length-1;d>=0;d--){e[d][0].each(function(){g.push(this)})}return a(g)},_removeCurrentsFromItems:function(){var d=this.currentItem.find(":data(sortable-item)");for(var c=0;c<this.items.length;c++){for(var b=0;b<d.length;b++){if(d[b]==this.items[c].item[0]){this.items.splice(c,1)}}}},_refreshItems:function(b){this.items=[];this.containers=[this];var h=this.items;var p=this;var f=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]];var l=this._connectWith();if(l){for(var e=l.length-1;e>=0;e--){var m=a(l[e]);for(var d=m.length-1;d>=0;d--){var g=a.data(m[d],"sortable");if(g&&g!=this&&!g.options.disabled){f.push([a.isFunction(g.options.items)?g.options.items.call(g.element[0],b,{item:this.currentItem}):a(g.options.items,g.element),g]);this.containers.push(g)}}}}for(var e=f.length-1;e>=0;e--){var k=f[e][1];var c=f[e][0];for(var d=0,n=c.length;d<n;d++){var o=a(c[d]);o.data("sortable-item",k);h.push({item:o,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper){this.offset.parent=this._getParentOffset()}for(var d=this.items.length-1;d>=0;d--){var e=this.items[d];if(e.instance!=this.currentContainer&&this.currentContainer&&e.item[0]!=this.currentItem[0]){continue}var c=this.options.toleranceElement?a(this.options.toleranceElement,e.item):e.item;if(!b){e.width=c.outerWidth();e.height=c.outerHeight()}var f=c.offset();e.left=f.left;e.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers){this.options.custom.refreshContainers.call(this)}else{for(var d=this.containers.length-1;d>=0;d--){var f=this.containers[d].element.offset();this.containers[d].containerCache.left=f.left;this.containers[d].containerCache.top=f.top;this.containers[d].containerCache.width=this.containers[d].element.outerWidth();this.containers[d].containerCache.height=this.containers[d].element.outerHeight()}}},_createPlaceholder:function(d){var b=d||this,e=b.options;if(!e.placeholder||e.placeholder.constructor==String){var c=e.placeholder;e.placeholder={element:function(){var f=a(document.createElement(b.currentItem[0].nodeName)).addClass(c||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!c){f.style.visibility="hidden"}return f},update:function(f,g){if(c&&!e.forcePlaceholderSize){return}if(!g.height()){g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10))}if(!g.width()){g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=a(e.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);e.placeholder.update(b,b.placeholder)},_contactContainers:function(d){for(var c=this.containers.length-1;c>=0;c--){if(this._intersectsWith(this.containers[c].containerCache)){if(!this.containers[c].containerCache.over){if(this.currentContainer!=this.containers[c]){var h=10000;var g=null;var e=this.positionAbs[this.containers[c].floating?"left":"top"];for(var b=this.items.length-1;b>=0;b--){if(!a.ui.contains(this.containers[c].element[0],this.items[b].item[0])){continue}var f=this.items[b][this.containers[c].floating?"left":"top"];if(Math.abs(f-e)<h){h=Math.abs(f-e);g=this.items[b]}}if(!g&&!this.options.dropOnEmpty){continue}this.currentContainer=this.containers[c];g?this._rearrange(d,g,null,true):this._rearrange(d,null,this.containers[c].element,true);this._trigger("change",d,this._uiHash());this.containers[c]._trigger("change",d,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder)}this.containers[c]._trigger("over",d,this._uiHash(this));this.containers[c].containerCache.over=1}}else{if(this.containers[c].containerCache.over){this.containers[c]._trigger("out",d,this._uiHash(this));this.containers[c].containerCache.over=0}}}},_createHelper:function(c){var d=this.options;var b=a.isFunction(d.helper)?a(d.helper.apply(this.element[0],[c,this.currentItem])):(d.helper=="clone"?this.currentItem.clone():this.currentItem);if(!b.parents("body").length){a(d.appendTo!="parent"?d.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0])}if(b[0]==this.currentItem[0]){this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}}if(b[0].style.width==""||d.forceHelperSize){b.width(this.currentItem.width())}if(b[0].style.height==""||d.forceHelperSize){b.height(this.currentItem.height())}return b},_adjustOffsetFromHelper:function(b){if(b.left!=undefined){this.offset.click.left=b.left+this.margins.left}if(b.right!=undefined){this.offset.click.left=this.helperProportions.width-b.right+this.margins.left}if(b.top!=undefined){this.offset.click.top=b.top+this.margins.top}if(b.bottom!=undefined){this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top}},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if((this.offsetParent[0]==document.body)||(this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)){b={top:0,left:0}}return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else{return{top:0,left:0}}},_cacheMargins:function(){this.margins={left:(parseInt(this.currentItem.css("marginLeft"),10)||0),top:(parseInt(this.currentItem.css("marginTop"),10)||0)}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e=this.options;if(e.containment=="parent"){e.containment=this.helper[0].parentNode}if(e.containment=="document"||e.containment=="window"){this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(e.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(e.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]}if(!(/^(document|window|parent)$/).test(e.containment)){var c=a(e.containment)[0];var d=a(e.containment).offset();var b=(a(c).css("overflow")!="hidden");this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(b?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(b?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(f,h){if(!h){h=this.position}var c=f=="absolute"?1:-1;var e=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=(/(html|body)/i).test(b[0].tagName);return{top:(h.top+this.offset.relative.top*c+this.offset.parent.top*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(g?0:b.scrollTop()))*c)),left:(h.left+this.offset.relative.left*c+this.offset.parent.left*c-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:b.scrollLeft())*c))}},_generatePosition:function(e){var h=this.options,b=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,i=(/(html|body)/i).test(b[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0])){this.offset.relative=this._getRelativeOffset()}var d=e.pageX;var c=e.pageY;if(this.originalPosition){if(this.containment){if(e.pageX-this.offset.click.left<this.containment[0]){d=this.containment[0]+this.offset.click.left}if(e.pageY-this.offset.click.top<this.containment[1]){c=this.containment[1]+this.offset.click.top}if(e.pageX-this.offset.click.left>this.containment[2]){d=this.containment[2]+this.offset.click.left}if(e.pageY-this.offset.click.top>this.containment[3]){c=this.containment[3]+this.offset.click.top}}if(h.grid){var g=this.originalPageY+Math.round((c-this.originalPageY)/h.grid[1])*h.grid[1];c=this.containment?(!(g-this.offset.click.top<this.containment[1]||g-this.offset.click.top>this.containment[3])?g:(!(g-this.offset.click.top<this.containment[1])?g-h.grid[1]:g+h.grid[1])):g;var f=this.originalPageX+Math.round((d-this.originalPageX)/h.grid[0])*h.grid[0];d=this.containment?(!(f-this.offset.click.left<this.containment[0]||f-this.offset.click.left>this.containment[2])?f:(!(f-this.offset.click.left<this.containment[0])?f-h.grid[0]:f+h.grid[0])):f}}return{top:(c-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():(i?0:b.scrollTop())))),left:(d-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:b.scrollLeft())))}},_rearrange:function(g,f,c,e){c?c[0].appendChild(this.placeholder[0]):f.item[0].parentNode.insertBefore(this.placeholder[0],(this.direction=="down"?f.item[0]:f.item[0].nextSibling));this.counter=this.counter?++this.counter:1;var d=this,b=this.counter;window.setTimeout(function(){if(b==d.counter){d.refreshPositions(!e)}},0)},_clear:function(d,e){this.reverting=false;var f=[],b=this;if(!this._noFinalSort&&this.currentItem[0].parentNode){this.placeholder.before(this.currentItem)}this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var c in this._storedCSS){if(this._storedCSS[c]=="auto"||this._storedCSS[c]=="static"){this._storedCSS[c]=""}}this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else{this.currentItem.show()}if(this.fromOutside&&!e){f.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))})}if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!e){f.push(function(g){this._trigger("update",g,this._uiHash())})}if(!a.ui.contains(this.element[0],this.currentItem[0])){if(!e){f.push(function(g){this._trigger("remove",g,this._uiHash())})}for(var c=this.containers.length-1;c>=0;c--){if(a.ui.contains(this.containers[c].element[0],this.currentItem[0])&&!e){f.push((function(g){return function(h){g._trigger("receive",h,this._uiHash(this))}}).call(this,this.containers[c]));f.push((function(g){return function(h){g._trigger("update",h,this._uiHash(this))}}).call(this,this.containers[c]))}}}for(var c=this.containers.length-1;c>=0;c--){if(!e){f.push((function(g){return function(h){g._trigger("deactivate",h,this._uiHash(this))}}).call(this,this.containers[c]))}if(this.containers[c].containerCache.over){f.push((function(g){return function(h){g._trigger("out",h,this._uiHash(this))}}).call(this,this.containers[c]));this.containers[c].containerCache.over=0}}if(this._storedCursor){a("body").css("cursor",this._storedCursor)}if(this._storedOpacity){this.helper.css("opacity",this._storedOpacity)}if(this._storedZIndex){this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex)}this.dragging=false;if(this.cancelHelperRemoval){if(!e){this._trigger("beforeStop",d,this._uiHash());for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}return false}if(!e){this._trigger("beforeStop",d,this._uiHash())}this.placeholder[0].parentNode.removeChild(this.placeholder[0]);if(this.helper[0]!=this.currentItem[0]){this.helper.remove()}this.helper=null;if(!e){for(var c=0;c<f.length;c++){f[c].call(this,d)}this._trigger("stop",d,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){if(a.widget.prototype._trigger.apply(this,arguments)===false){this.cancel()}},_uiHash:function(c){var b=c||this;return{helper:b.helper,placeholder:b.placeholder||a([]),position:b.position,absolutePosition:b.positionAbs,offset:b.positionAbs,item:b.currentItem,sender:c?c.element:null}}}));a.extend(a.ui.sortable,{getter:"serialize toArray",version:"1.7.2",eventPrefix:"sort",defaults:{appendTo:"parent",axis:false,cancel:":input,option",connectWith:false,containment:false,cursor:"auto",cursorAt:false,delay:0,distance:1,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1000}})})(jQuery);;/* - * jQuery UI Accordion 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Accordion - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.accordion",{_init:function(){var d=this.options,b=this;this.running=0;if(d.collapsible==a.ui.accordion.defaults.collapsible&&d.alwaysOpen!=a.ui.accordion.defaults.alwaysOpen){d.collapsible=!d.alwaysOpen}if(d.navigation){var c=this.element.find("a").filter(d.navigationFilter);if(c.length){if(c.filter(d.header).length){this.active=c}else{this.active=c.parent().parent().prev();c.addClass("ui-accordion-content-active")}}}this.element.addClass("ui-accordion ui-widget ui-helper-reset");if(this.element[0].nodeName=="UL"){this.element.children("li").addClass("ui-accordion-li-fix")}this.headers=this.element.find(d.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){a(this).removeClass("ui-state-focus")});this.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");this.active=this._findActive(this.active||d.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");this.active.next().addClass("ui-accordion-content-active");a("<span/>").addClass("ui-icon "+d.icons.header).prependTo(this.headers);this.active.find(".ui-icon").toggleClass(d.icons.header).toggleClass(d.icons.headerSelected);if(a.browser.msie){this.element.find("a").css("zoom","1")}this.resize();this.element.attr("role","tablist");this.headers.attr("role","tab").bind("keydown",function(e){return b._keydown(e)}).next().attr("role","tabpanel");this.headers.not(this.active||"").attr("aria-expanded","false").attr("tabIndex","-1").next().hide();if(!this.active.length){this.headers.eq(0).attr("tabIndex","0")}else{this.active.attr("aria-expanded","true").attr("tabIndex","0")}if(!a.browser.safari){this.headers.find("a").attr("tabIndex","-1")}if(d.event){this.headers.bind((d.event)+".accordion",function(e){return b._clickHandler.call(b,e,this)})}},destroy:function(){var c=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role").unbind(".accordion").removeData("accordion");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabindex");this.headers.find("a").removeAttr("tabindex");this.headers.children(".ui-icon").remove();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active");if(c.autoHeight||c.fillHeight){b.css("height","")}},_setData:function(b,c){if(b=="alwaysOpen"){b="collapsible";c=!c}a.widget.prototype._setData.apply(this,arguments)},_keydown:function(e){var g=this.options,f=a.ui.keyCode;if(g.disabled||e.altKey||e.ctrlKey){return}var d=this.headers.length;var b=this.headers.index(e.target);var c=false;switch(e.keyCode){case f.RIGHT:case f.DOWN:c=this.headers[(b+1)%d];break;case f.LEFT:case f.UP:c=this.headers[(b-1+d)%d];break;case f.SPACE:case f.ENTER:return this._clickHandler({target:e.target},e.target)}if(c){a(e.target).attr("tabIndex","-1");a(c).attr("tabIndex","0");c.focus();return false}return true},resize:function(){var e=this.options,d;if(e.fillSpace){if(a.browser.msie){var b=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}d=this.element.parent().height();if(a.browser.msie){this.element.parent().css("overflow",b)}this.headers.each(function(){d-=a(this).outerHeight()});var c=0;this.headers.next().each(function(){c=Math.max(c,a(this).innerHeight()-a(this).height())}).height(Math.max(0,d-c)).css("overflow","auto")}else{if(e.autoHeight){d=0;this.headers.next().each(function(){d=Math.max(d,a(this).outerHeight())}).height(d)}}},activate:function(b){var c=this._findActive(b)[0];this._clickHandler({target:c},c)},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,f){var d=this.options;if(d.disabled){return false}if(!b.target&&d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var h=this.active.next(),e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:h},c=(this.active=a([]));this._toggle(c,h,e);return false}var g=a(b.currentTarget||f);var i=g[0]==this.active[0];if(this.running||(!d.collapsible&&i)){return false}this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").find(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");if(!i){g.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").find(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);g.next().addClass("ui-accordion-content-active")}var c=g.next(),h=this.active.next(),e={options:d,newHeader:i&&d.collapsible?a([]):g,oldHeader:this.active,newContent:i&&d.collapsible?a([]):c.find("> *"),oldContent:h.find("> *")},j=this.headers.index(this.active[0])>this.headers.index(g[0]);this.active=i?a([]):g;this._toggle(c,h,e,i,j);return false},_toggle:function(b,i,g,j,k){var d=this.options,m=this;this.toShow=b;this.toHide=i;this.data=g;var c=function(){if(!m){return}return m._completed.apply(m,arguments)};this._trigger("changestart",null,this.data);this.running=i.size()===0?b.size():i.size();if(d.animated){var f={};if(d.collapsible&&j){f={toShow:a([]),toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}else{f={toShow:b,toHide:i,complete:c,down:k,autoHeight:d.autoHeight||d.fillSpace}}if(!d.proxied){d.proxied=d.animated}if(!d.proxiedDuration){d.proxiedDuration=d.duration}d.animated=a.isFunction(d.proxied)?d.proxied(f):d.proxied;d.duration=a.isFunction(d.proxiedDuration)?d.proxiedDuration(f):d.proxiedDuration;var l=a.ui.accordion.animations,e=d.duration,h=d.animated;if(!l[h]){l[h]=function(n){this.slide(n,{easing:h,duration:e||700})}}l[h](f)}else{if(d.collapsible&&j){b.toggle()}else{i.hide();b.show()}c(true)}i.prev().attr("aria-expanded","false").attr("tabIndex","-1").blur();b.prev().attr("aria-expanded","true").attr("tabIndex","0").focus()},_completed:function(b){var c=this.options;this.running=b?0:--this.running;if(this.running){return}if(c.clearStyle){this.toShow.add(this.toHide).css({height:"",overflow:""})}this._trigger("change",null,this.data)}});a.extend(a.ui.accordion,{version:"1.7.2",defaults:{active:null,alwaysOpen:true,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()==location.href.toLowerCase()}},animations:{slide:function(j,h){j=a.extend({easing:"swing",duration:300},j,h);if(!j.toHide.size()){j.toShow.animate({height:"show"},j);return}if(!j.toShow.size()){j.toHide.animate({height:"hide"},j);return}var c=j.toShow.css("overflow"),g,d={},f={},e=["height","paddingTop","paddingBottom"],b;var i=j.toShow;b=i[0].style.width;i.width(parseInt(i.parent().width(),10)-parseInt(i.css("paddingLeft"),10)-parseInt(i.css("paddingRight"),10)-(parseInt(i.css("borderLeftWidth"),10)||0)-(parseInt(i.css("borderRightWidth"),10)||0));a.each(e,function(k,m){f[m]="hide";var l=(""+a.css(j.toShow[0],m)).match(/^([\d+-.]+)(.*)$/);d[m]={value:l[1],unit:l[2]||"px"}});j.toShow.css({height:0,overflow:"hidden"}).show();j.toHide.filter(":hidden").each(j.complete).end().filter(":visible").animate(f,{step:function(k,l){if(l.prop=="height"){g=(l.now-l.start)/(l.end-l.start)}j.toShow[0].style[l.prop]=(g*d[l.prop].value)+d[l.prop].unit},duration:j.duration,easing:j.easing,complete:function(){if(!j.autoHeight){j.toShow.css("height","")}j.toShow.css("width",b);j.toShow.css({overflow:c});j.complete()}})},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1000:200})},easeslide:function(b){this.slide(b,{easing:"easeinout",duration:700})}}})})(jQuery);;/* - * jQuery UI Dialog 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * ui.core.js - * ui.draggable.js - * ui.resizable.js - */ -(function(c){var b={dragStart:"start.draggable",drag:"drag.draggable",dragStop:"stop.draggable",maxHeight:"maxHeight.resizable",minHeight:"minHeight.resizable",maxWidth:"maxWidth.resizable",minWidth:"minWidth.resizable",resizeStart:"start.resizable",resize:"drag.resizable",resizeStop:"stop.resizable"},a="ui-dialog ui-widget ui-widget-content ui-corner-all ";c.widget("ui.dialog",{_init:function(){this.originalTitle=this.element.attr("title");var l=this,m=this.options,j=m.title||this.originalTitle||" ",e=c.ui.dialog.getTitleId(this.element),k=(this.uiDialog=c("<div/>")).appendTo(document.body).hide().addClass(a+m.dialogClass).css({position:"absolute",overflow:"hidden",zIndex:m.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){(m.closeOnEscape&&n.keyCode&&n.keyCode==c.ui.keyCode.ESCAPE&&l.close(n))}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(n){l.moveToTop(false,n)}),g=this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(k),f=(this.uiDialogTitlebar=c("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(k),i=c('<a href="#"/>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){i.addClass("ui-state-hover")},function(){i.removeClass("ui-state-hover")}).focus(function(){i.addClass("ui-state-focus")}).blur(function(){i.removeClass("ui-state-focus")}).mousedown(function(n){n.stopPropagation()}).click(function(n){l.close(n);return false}).appendTo(f),h=(this.uiDialogTitlebarCloseText=c("<span/>")).addClass("ui-icon ui-icon-closethick").text(m.closeText).appendTo(i),d=c("<span/>").addClass("ui-dialog-title").attr("id",e).html(j).prependTo(f);f.find("*").add(f).disableSelection();(m.draggable&&c.fn.draggable&&this._makeDraggable());(m.resizable&&c.fn.resizable&&this._makeResizable());this._createButtons(m.buttons);this._isOpen=false;(m.bgiframe&&c.fn.bgiframe&&k.bgiframe());(m.autoOpen&&this.open())},destroy:function(){(this.overlay&&this.overlay.destroy());this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");this.uiDialog.remove();(this.originalTitle&&this.element.attr("title",this.originalTitle))},close:function(f){var d=this;if(false===d._trigger("beforeclose",f)){return}(d.overlay&&d.overlay.destroy());d.uiDialog.unbind("keypress.ui-dialog");(d.options.hide?d.uiDialog.hide(d.options.hide,function(){d._trigger("close",f)}):d.uiDialog.hide()&&d._trigger("close",f));c.ui.dialog.overlay.resize();d._isOpen=false;if(d.options.modal){var e=0;c(".ui-dialog").each(function(){if(this!=d.uiDialog[0]){e=Math.max(e,c(this).css("z-index"))}});c.ui.dialog.maxZ=e}},isOpen:function(){return this._isOpen},moveToTop:function(f,e){if((this.options.modal&&!f)||(!this.options.stack&&!this.options.modal)){return this._trigger("focus",e)}if(this.options.zIndex>c.ui.dialog.maxZ){c.ui.dialog.maxZ=this.options.zIndex}(this.overlay&&this.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=++c.ui.dialog.maxZ));var d={scrollTop:this.element.attr("scrollTop"),scrollLeft:this.element.attr("scrollLeft")};this.uiDialog.css("z-index",++c.ui.dialog.maxZ);this.element.attr(d);this._trigger("focus",e)},open:function(){if(this._isOpen){return}var e=this.options,d=this.uiDialog;this.overlay=e.modal?new c.ui.dialog.overlay(this):null;(d.next().length&&d.appendTo("body"));this._size();this._position(e.position);d.show(e.show);this.moveToTop(true);(e.modal&&d.bind("keypress.ui-dialog",function(h){if(h.keyCode!=c.ui.keyCode.TAB){return}var g=c(":tabbable",this),i=g.filter(":first")[0],f=g.filter(":last")[0];if(h.target==f&&!h.shiftKey){setTimeout(function(){i.focus()},1)}else{if(h.target==i&&h.shiftKey){setTimeout(function(){f.focus()},1)}}}));c([]).add(d.find(".ui-dialog-content :tabbable:first")).add(d.find(".ui-dialog-buttonpane :tabbable:first")).add(d).filter(":first").focus();this._trigger("open");this._isOpen=true},_createButtons:function(g){var f=this,d=false,e=c("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix");this.uiDialog.find(".ui-dialog-buttonpane").remove();(typeof g=="object"&&g!==null&&c.each(g,function(){return !(d=true)}));if(d){c.each(g,function(h,i){c('<button type="button"></button>').addClass("ui-state-default ui-corner-all").text(h).click(function(){i.apply(f.element[0],arguments)}).hover(function(){c(this).addClass("ui-state-hover")},function(){c(this).removeClass("ui-state-hover")}).focus(function(){c(this).addClass("ui-state-focus")}).blur(function(){c(this).removeClass("ui-state-focus")}).appendTo(e)});e.appendTo(this.uiDialog)}},_makeDraggable:function(){var d=this,f=this.options,e;this.uiDialog.draggable({cancel:".ui-dialog-content",handle:".ui-dialog-titlebar",containment:"document",start:function(){e=f.height;c(this).height(c(this).height()).addClass("ui-dialog-dragging");(f.dragStart&&f.dragStart.apply(d.element[0],arguments))},drag:function(){(f.drag&&f.drag.apply(d.element[0],arguments))},stop:function(){c(this).removeClass("ui-dialog-dragging").height(e);(f.dragStop&&f.dragStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}})},_makeResizable:function(g){g=(g===undefined?this.options.resizable:g);var d=this,f=this.options,e=typeof g=="string"?g:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",alsoResize:this.element,maxWidth:f.maxWidth,maxHeight:f.maxHeight,minWidth:f.minWidth,minHeight:f.minHeight,start:function(){c(this).addClass("ui-dialog-resizing");(f.resizeStart&&f.resizeStart.apply(d.element[0],arguments))},resize:function(){(f.resize&&f.resize.apply(d.element[0],arguments))},handles:e,stop:function(){c(this).removeClass("ui-dialog-resizing");f.height=c(this).height();f.width=c(this).width();(f.resizeStop&&f.resizeStop.apply(d.element[0],arguments));c.ui.dialog.overlay.resize()}}).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_position:function(i){var e=c(window),f=c(document),g=f.scrollTop(),d=f.scrollLeft(),h=g;if(c.inArray(i,["center","top","right","bottom","left"])>=0){i=[i=="right"||i=="left"?i:"center",i=="top"||i=="bottom"?i:"middle"]}if(i.constructor!=Array){i=["center","middle"]}if(i[0].constructor==Number){d+=i[0]}else{switch(i[0]){case"left":d+=0;break;case"right":d+=e.width()-this.uiDialog.outerWidth();break;default:case"center":d+=(e.width()-this.uiDialog.outerWidth())/2}}if(i[1].constructor==Number){g+=i[1]}else{switch(i[1]){case"top":g+=0;break;case"bottom":g+=e.height()-this.uiDialog.outerHeight();break;default:case"middle":g+=(e.height()-this.uiDialog.outerHeight())/2}}g=Math.max(g,h);this.uiDialog.css({top:g,left:d})},_setData:function(e,f){(b[e]&&this.uiDialog.data(b[e],f));switch(e){case"buttons":this._createButtons(f);break;case"closeText":this.uiDialogTitlebarCloseText.text(f);break;case"dialogClass":this.uiDialog.removeClass(this.options.dialogClass).addClass(a+f);break;case"draggable":(f?this._makeDraggable():this.uiDialog.draggable("destroy"));break;case"height":this.uiDialog.height(f);break;case"position":this._position(f);break;case"resizable":var d=this.uiDialog,g=this.uiDialog.is(":data(resizable)");(g&&!f&&d.resizable("destroy"));(g&&typeof f=="string"&&d.resizable("option","handles",f));(g||this._makeResizable(f));break;case"title":c(".ui-dialog-title",this.uiDialogTitlebar).html(f||" ");break;case"width":this.uiDialog.width(f);break}c.widget.prototype._setData.apply(this,arguments)},_size:function(){var e=this.options;this.element.css({height:0,minHeight:0,width:"auto"});var d=this.uiDialog.css({height:"auto",width:e.width}).height();this.element.css({minHeight:Math.max(e.minHeight-d,0),height:e.height=="auto"?"auto":Math.max(e.height-d,0)})}});c.extend(c.ui.dialog,{version:"1.7.2",defaults:{autoOpen:true,bgiframe:false,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:"center",resizable:true,show:null,stack:true,title:"",width:300,zIndex:1000},getter:"isOpen",uuid:0,maxZ:0,getTitleId:function(d){return"ui-dialog-title-"+(d.attr("id")||++this.uuid)},overlay:function(d){this.$el=c.ui.dialog.overlay.create(d)}});c.extend(c.ui.dialog.overlay,{instances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(d){return d+".dialog-overlay"}).join(" "),create:function(e){if(this.instances.length===0){setTimeout(function(){if(c.ui.dialog.overlay.instances.length){c(document).bind(c.ui.dialog.overlay.events,function(f){var g=c(f.target).parents(".ui-dialog").css("zIndex")||0;return(g>c.ui.dialog.overlay.maxZ)})}},1);c(document).bind("keydown.dialog-overlay",function(f){(e.options.closeOnEscape&&f.keyCode&&f.keyCode==c.ui.keyCode.ESCAPE&&e.close(f))});c(window).bind("resize.dialog-overlay",c.ui.dialog.overlay.resize)}var d=c("<div></div>").appendTo(document.body).addClass("ui-widget-overlay").css({width:this.width(),height:this.height()});(e.options.bgiframe&&c.fn.bgiframe&&d.bgiframe());this.instances.push(d);return d},destroy:function(d){this.instances.splice(c.inArray(this.instances,d),1);if(this.instances.length===0){c([document,window]).unbind(".dialog-overlay")}d.remove();var e=0;c.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){if(c.browser.msie&&c.browser.version<7){var e=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var d=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);if(e<d){return c(window).height()+"px"}else{return e+"px"}}else{return c(document).height()+"px"}},width:function(){if(c.browser.msie&&c.browser.version<7){var d=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);var e=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);if(d<e){return c(window).width()+"px"}else{return d+"px"}}else{return c(document).width()+"px"}},resize:function(){var d=c([]);c.each(c.ui.dialog.overlay.instances,function(){d=d.add(this)});d.css({width:0,height:0}).css({width:c.ui.dialog.overlay.width(),height:c.ui.dialog.overlay.height()})}});c.extend(c.ui.dialog.overlay.prototype,{destroy:function(){c.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/* - * jQuery UI Slider 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Slider - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.slider",a.extend({},a.ui.mouse,{_init:function(){var b=this,c=this.options;this._keySliding=false;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all");this.range=a([]);if(c.range){if(c.range===true){this.range=a("<div></div>");if(!c.values){c.values=[this._valueMin(),this._valueMin()]}if(c.values.length&&c.values.length!=2){c.values=[c.values[0],c.values[0]]}}else{this.range=a("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(c.range=="min"||c.range=="max"){this.range.addClass("ui-slider-range-"+c.range)}this.range.addClass("ui-widget-header")}if(a(".ui-slider-handle",this.element).length==0){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}if(c.values&&c.values.length){while(a(".ui-slider-handle",this.element).length<c.values.length){a('<a href="#"></a>').appendTo(this.element).addClass("ui-slider-handle")}}this.handles=a(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(d){d.preventDefault()}).hover(function(){if(!c.disabled){a(this).addClass("ui-state-hover")}},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(!c.disabled){a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}else{a(this).blur()}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(d){a(this).data("index.ui-slider-handle",d)});this.handles.keydown(function(i){var f=true;var e=a(this).data("index.ui-slider-handle");if(b.options.disabled){return}switch(i.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:f=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");b._start(i,e)}break}var g,d,h=b._step();if(b.options.values&&b.options.values.length){g=d=b.values(e)}else{g=d=b.value()}switch(i.keyCode){case a.ui.keyCode.HOME:d=b._valueMin();break;case a.ui.keyCode.END:d=b._valueMax();break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g==b._valueMax()){return}d=g+h;break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g==b._valueMin()){return}d=g-h;break}b._slide(i,e,d);return f}).keyup(function(e){var d=a(this).data("index.ui-slider-handle");if(b._keySliding){b._stop(e,d);b._change(e,d);b._keySliding=false;a(this).removeClass("ui-state-active")}});this._refreshValue()},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy()},_mouseCapture:function(d){var e=this.options;if(e.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();var h={x:d.pageX,y:d.pageY};var j=this._normValueFromMouse(h);var c=this._valueMax()-this._valueMin()+1,f;var k=this,i;this.handles.each(function(l){var m=Math.abs(j-k.values(l));if(c>m){c=m;f=a(this);i=l}});if(e.range==true&&this.values(1)==e.min){f=a(this.handles[++i])}this._start(d,i);k._handleIndex=i;f.addClass("ui-state-active").focus();var g=f.offset();var b=!a(d.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=b?{left:0,top:0}:{left:d.pageX-g.left-(f.width()/2),top:d.pageY-g.top-(f.height()/2)-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};j=this._normValueFromMouse(h);this._slide(d,i,j);return true},_mouseStart:function(b){return true},_mouseDrag:function(d){var b={x:d.pageX,y:d.pageY};var c=this._normValueFromMouse(b);this._slide(d,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._handleIndex=null;this._clickOffset=null;return false},_detectOrientation:function(){this.orientation=this.options.orientation=="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(d){var c,h;if("horizontal"==this.orientation){c=this.elementSize.width;h=d.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;h=d.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}var f=(h/c);if(f>1){f=1}if(f<0){f=0}if("vertical"==this.orientation){f=1-f}var e=this._valueMax()-this._valueMin(),i=f*e,b=i%this.options.step,g=this._valueMin()+i-b;if(b>(this.options.step/2)){g+=this.options.step}return parseFloat(g.toFixed(5))},_start:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("start",d,b)},_slide:function(f,e,d){var g=this.handles[e];if(this.options.values&&this.options.values.length){var b=this.values(e?0:1);if((this.options.values.length==2&&this.options.range===true)&&((e==0&&d>b)||(e==1&&d<b))){d=b}if(d!=this.values(e)){var c=this.values();c[e]=d;var h=this._trigger("slide",f,{handle:this.handles[e],value:d,values:c});var b=this.values(e?0:1);if(h!==false){this.values(e,d,(f.type=="mousedown"&&this.options.animate),true)}}}else{if(d!=this.value()){var h=this._trigger("slide",f,{handle:this.handles[e],value:d});if(h!==false){this._setData("value",d,(f.type=="mousedown"&&this.options.animate))}}}},_stop:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("stop",d,b)},_change:function(d,c){var b={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){b.value=this.values(c);b.values=this.values()}this._trigger("change",d,b)},value:function(b){if(arguments.length){this._setData("value",b);this._change(null,0)}return this._value()},values:function(b,e,c,d){if(arguments.length>1){this.options.values[b]=e;this._refreshValue(c);if(!d){this._change(null,b)}}if(arguments.length){if(this.options.values&&this.options.values.length){return this._values(b)}else{return this.value()}}else{return this._values()}},_setData:function(b,d,c){a.widget.prototype._setData.apply(this,arguments);switch(b){case"disabled":if(d){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled")}else{this.handles.removeAttr("disabled")}case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue(c);break;case"value":this._refreshValue(c);break}},_step:function(){var b=this.options.step;return b},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_values:function(b){if(arguments.length){var c=this.options.values[b];if(c<this._valueMin()){c=this._valueMin()}if(c>this._valueMax()){c=this._valueMax()}return c}else{return this.options.values}},_valueMin:function(){var b=this.options.min;return b},_valueMax:function(){var b=this.options.max;return b},_refreshValue:function(c){var f=this.options.range,d=this.options,l=this;if(this.options.values&&this.options.values.length){var i,h;this.handles.each(function(p,n){var o=(l.values(p)-l._valueMin())/(l._valueMax()-l._valueMin())*100;var m={};m[l.orientation=="horizontal"?"left":"bottom"]=o+"%";a(this).stop(1,1)[c?"animate":"css"](m,d.animate);if(l.options.range===true){if(l.orientation=="horizontal"){(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({left:o+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({width:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}else{(p==0)&&l.range.stop(1,1)[c?"animate":"css"]({bottom:(o)+"%"},d.animate);(p==1)&&l.range[c?"animate":"css"]({height:(o-lastValPercent)+"%"},{queue:false,duration:d.animate})}}lastValPercent=o})}else{var j=this.value(),g=this._valueMin(),k=this._valueMax(),e=k!=g?(j-g)/(k-g)*100:0;var b={};b[l.orientation=="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[c?"animate":"css"](b,d.animate);(f=="min")&&(this.orientation=="horizontal")&&this.range.stop(1,1)[c?"animate":"css"]({width:e+"%"},d.animate);(f=="max")&&(this.orientation=="horizontal")&&this.range[c?"animate":"css"]({width:(100-e)+"%"},{queue:false,duration:d.animate});(f=="min")&&(this.orientation=="vertical")&&this.range.stop(1,1)[c?"animate":"css"]({height:e+"%"},d.animate);(f=="max")&&(this.orientation=="vertical")&&this.range[c?"animate":"css"]({height:(100-e)+"%"},{queue:false,duration:d.animate})}}}));a.extend(a.ui.slider,{getter:"value values",version:"1.7.2",eventPrefix:"slide",defaults:{animate:false,delay:0,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null}})})(jQuery);;/* - * jQuery UI Tabs 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.tabs",{_init:function(){if(this.options.deselectable!==undefined){this.options.collapsible=this.options.deselectable}this._tabify(true)},_setData:function(b,c){if(b=="selected"){if(this.options.collapsible&&c==this.options.selected){return}this.select(c)}else{this.options[b]=c;if(b=="deselectable"){this.options.collapsible=c}this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^A-Za-z0-9\-_:\.]/g,"")||this.options.idPrefix+a.data(b)},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+a.data(this.list[0]));return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(c,b){return{tab:c,panel:b,index:this.anchors.index(c)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(n){this.list=this.element.children("ul:first");this.lis=a("li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);var p=this,d=this.options;var c=/^#.+/;this.anchors.each(function(r,o){var q=a(o).attr("href");var s=q.split("#")[0],u;if(s&&(s===location.toString().split("#")[0]||(u=a("base")[0])&&s===u.href)){q=o.hash;o.href=q}if(c.test(q)){p.panels=p.panels.add(p._sanitizeSelector(q))}else{if(q!="#"){a.data(o,"href.tabs",q);a.data(o,"load.tabs",q.replace(/#.*$/,""));var w=p._tabId(o);o.href="#"+w;var v=a("#"+w);if(!v.length){v=a(d.panelTemplate).attr("id",w).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(p.panels[r-1]||p.list);v.data("destroy.tabs",true)}p.panels=p.panels.add(v)}else{d.disabled.push(r)}}});if(n){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(d.selected===undefined){if(location.hash){this.anchors.each(function(q,o){if(o.hash==location.hash){d.selected=q;return false}})}if(typeof d.selected!="number"&&d.cookie){d.selected=parseInt(p._cookie(),10)}if(typeof d.selected!="number"&&this.lis.filter(".ui-tabs-selected").length){d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}d.selected=d.selected||0}else{if(d.selected===null){d.selected=-1}}d.selected=((d.selected>=0&&this.anchors[d.selected])||d.selected<0)?d.selected:0;d.disabled=a.unique(d.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(q,o){return p.lis.index(q)}))).sort();if(a.inArray(d.selected,d.disabled)!=-1){d.disabled.splice(a.inArray(d.selected,d.disabled),1)}this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");if(d.selected>=0&&this.anchors.length){this.panels.eq(d.selected).removeClass("ui-tabs-hide");this.lis.eq(d.selected).addClass("ui-tabs-selected ui-state-active");p.element.queue("tabs",function(){p._trigger("show",null,p._ui(p.anchors[d.selected],p.panels[d.selected]))});this.load(d.selected)}a(window).bind("unload",function(){p.lis.add(p.anchors).unbind(".tabs");p.lis=p.anchors=p.panels=null})}else{d.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))}this.element[d.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");if(d.cookie){this._cookie(d.selected,d.cookie)}for(var g=0,m;(m=this.lis[g]);g++){a(m)[a.inArray(g,d.disabled)!=-1&&!a(m).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled")}if(d.cache===false){this.anchors.removeData("cache.tabs")}this.lis.add(this.anchors).unbind(".tabs");if(d.event!="mouseover"){var f=function(o,i){if(i.is(":not(.ui-state-disabled)")){i.addClass("ui-state-"+o)}};var j=function(o,i){i.removeClass("ui-state-"+o)};this.lis.bind("mouseover.tabs",function(){f("hover",a(this))});this.lis.bind("mouseout.tabs",function(){j("hover",a(this))});this.anchors.bind("focus.tabs",function(){f("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var b,h;if(d.fx){if(a.isArray(d.fx)){b=d.fx[0];h=d.fx[1]}else{b=h=d.fx}}function e(i,o){i.css({display:""});if(a.browser.msie&&o.opacity){i[0].style.removeAttribute("filter")}}var k=h?function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.hide().removeClass("ui-tabs-hide").animate(h,h.duration||"normal",function(){e(o,h);p._trigger("show",null,p._ui(i,o[0]))})}:function(i,o){a(i).closest("li").removeClass("ui-state-default").addClass("ui-tabs-selected ui-state-active");o.removeClass("ui-tabs-hide");p._trigger("show",null,p._ui(i,o[0]))};var l=b?function(o,i){i.animate(b,b.duration||"normal",function(){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");e(i,b);p.element.dequeue("tabs")})}:function(o,i,q){p.lis.removeClass("ui-tabs-selected ui-state-active").addClass("ui-state-default");i.addClass("ui-tabs-hide");p.element.dequeue("tabs")};this.anchors.bind(d.event+".tabs",function(){var o=this,r=a(this).closest("li"),i=p.panels.filter(":not(.ui-tabs-hide)"),q=a(p._sanitizeSelector(this.hash));if((r.hasClass("ui-tabs-selected")&&!d.collapsible)||r.hasClass("ui-state-disabled")||r.hasClass("ui-state-processing")||p._trigger("select",null,p._ui(this,q[0]))===false){this.blur();return false}d.selected=p.anchors.index(this);p.abort();if(d.collapsible){if(r.hasClass("ui-tabs-selected")){d.selected=-1;if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){l(o,i)}).dequeue("tabs");this.blur();return false}else{if(!i.length){if(d.cookie){p._cookie(d.selected,d.cookie)}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this));this.blur();return false}}}if(d.cookie){p._cookie(d.selected,d.cookie)}if(q.length){if(i.length){p.element.queue("tabs",function(){l(o,i)})}p.element.queue("tabs",function(){k(o,q)});p.load(p.anchors.index(this))}else{throw"jQuery UI Tabs: Mismatching fragment identifier."}if(a.browser.msie){this.blur()}});this.anchors.bind("click.tabs",function(){return false})},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var c=a.data(this,"href.tabs");if(c){this.href=c}var d=a(this).unbind(".tabs");a.each(["href","load","cache"],function(e,f){d.removeData(f+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){if(a.data(this,"destroy.tabs")){a(this).remove()}else{a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}});if(b.cookie){this._cookie(null,b.cookie)}},add:function(e,d,c){if(c===undefined){c=this.anchors.length}var b=this,g=this.options,i=a(g.tabTemplate.replace(/#\{href\}/g,e).replace(/#\{label\}/g,d)),h=!e.indexOf("#")?e.replace("#",""):this._tabId(a("a",i)[0]);i.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var f=a("#"+h);if(!f.length){f=a(g.panelTemplate).attr("id",h).data("destroy.tabs",true)}f.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(c>=this.lis.length){i.appendTo(this.list);f.appendTo(this.list[0].parentNode)}else{i.insertBefore(this.lis[c]);f.insertBefore(this.panels[c])}g.disabled=a.map(g.disabled,function(k,j){return k>=c?++k:k});this._tabify();if(this.anchors.length==1){i.addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){b._trigger("show",null,b._ui(b.anchors[0],b.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[c],this.panels[c]))},remove:function(b){var d=this.options,e=this.lis.eq(b).remove(),c=this.panels.eq(b).remove();if(e.hasClass("ui-tabs-selected")&&this.anchors.length>1){this.select(b+(b+1<this.anchors.length?1:-1))}d.disabled=a.map(a.grep(d.disabled,function(g,f){return g!=b}),function(g,f){return g>=b?--g:g});this._tabify();this._trigger("remove",null,this._ui(e.find("a")[0],c[0]))},enable:function(b){var c=this.options;if(a.inArray(b,c.disabled)==-1){return}this.lis.eq(b).removeClass("ui-state-disabled");c.disabled=a.grep(c.disabled,function(e,d){return e!=b});this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b]))},disable:function(c){var b=this,d=this.options;if(c!=d.selected){this.lis.eq(c).addClass("ui-state-disabled");d.disabled.push(c);d.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[c],this.panels[c]))}},select:function(b){if(typeof b=="string"){b=this.anchors.index(this.anchors.filter("[href$="+b+"]"))}else{if(b===null){b=-1}}if(b==-1&&this.options.collapsible){b=this.options.selected}this.anchors.eq(b).trigger(this.options.event+".tabs")},load:function(e){var c=this,g=this.options,b=this.anchors.eq(e)[0],d=a.data(b,"load.tabs");this.abort();if(!d||this.element.queue("tabs").length!==0&&a.data(b,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(e).addClass("ui-state-processing");if(g.spinner){var f=a("span",b);f.data("label.tabs",f.html()).html(g.spinner)}this.xhr=a.ajax(a.extend({},g.ajaxOptions,{url:d,success:function(i,h){a(c._sanitizeSelector(b.hash)).html(i);c._cleanup();if(g.cache){a.data(b,"cache.tabs",true)}c._trigger("load",null,c._ui(c.anchors[e],c.panels[e]));try{g.ajaxOptions.success(i,h)}catch(j){}c.element.dequeue("tabs")}}))},abort:function(){this.element.queue([]);this.panels.stop(false,true);if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup()},url:function(c,b){this.anchors.eq(c).removeData("cache.tabs").data("load.tabs",b)},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.7.2",getter:"length",defaults:{ajaxOptions:null,cache:false,cookie:null,collapsible:false,disabled:[],event:"click",fx:null,idPrefix:"ui-tabs-",panelTemplate:"<div></div>",spinner:"<em>Loading…</em>",tabTemplate:'<li><a href="#{href}"><span>#{label}</span></a></li>'}});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(d,f){var b=this,g=this.options;var c=b._rotate||(b._rotate=function(h){clearTimeout(b.rotation);b.rotation=setTimeout(function(){var i=g.selected;b.select(++i<b.anchors.length?i:0)},d);if(h){h.stopPropagation()}});var e=b._unrotate||(b._unrotate=!f?function(h){if(h.clientX){b.rotate(null)}}:function(h){t=g.selected;c()});if(d){this.element.bind("tabsshow",c);this.anchors.bind(g.event+".tabs",e);c()}else{clearTimeout(b.rotation);this.element.unbind("tabsshow",c);this.anchors.unbind(g.event+".tabs",e);delete this._rotate;delete this._unrotate}}})})(jQuery);;/* - * jQuery UI Datepicker 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Datepicker - * - * Depends: - * ui.core.js - */ -(function($){$.extend($.ui,{datepicker:{version:"1.7.2"}});var PROP_NAME="datepicker";function Datepicker(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._datepickerShowing=false;this._inDialog=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass="ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],dateFormat:"mm/dd/yy",firstDay:0,isRTL:false};this._defaults={showOn:"focus",showAnim:"show",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,showMonthAfterYear:false,yearRange:"-10:+10",showOtherMonths:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"normal",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false};$.extend(this._defaults,this.regional[""]);this.dpDiv=$('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all ui-helper-hidden-accessible"></div>')}$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",log:function(){if(this.debug){console.log.apply("",arguments)}},setDefaults:function(settings){extendRemove(this._defaults,settings||{});return this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase();var inline=(nodeName=="div"||nodeName=="span");if(!target.id){target.id="dp"+(++this.uuid)}var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{});if(nodeName=="input"){this._connectDatepicker(target,inst)}else{if(inline){this._inlineDatepicker(target,inst)}}},_newInst:function(target,inline){var id=target[0].id.replace(/([:\[\]\.])/g,"\\\\$1");return{id:id,input:target,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:inline,dpDiv:(!inline?this.dpDiv:$('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(target,inst){var input=$(target);inst.append=$([]);inst.trigger=$([]);if(input.hasClass(this.markerClassName)){return}var appendText=this._get(inst,"appendText");var isRTL=this._get(inst,"isRTL");if(appendText){inst.append=$('<span class="'+this._appendClass+'">'+appendText+"</span>");input[isRTL?"before":"after"](inst.append)}var showOn=this._get(inst,"showOn");if(showOn=="focus"||showOn=="both"){input.focus(this._showDatepicker)}if(showOn=="button"||showOn=="both"){var buttonText=this._get(inst,"buttonText");var buttonImage=this._get(inst,"buttonImage");inst.trigger=$(this._get(inst,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:buttonImage,alt:buttonText,title:buttonText}):$('<button type="button"></button>').addClass(this._triggerClass).html(buttonImage==""?buttonText:$("<img/>").attr({src:buttonImage,alt:buttonText,title:buttonText})));input[isRTL?"before":"after"](inst.trigger);inst.trigger.click(function(){if($.datepicker._datepickerShowing&&$.datepicker._lastInput==target){$.datepicker._hideDatepicker()}else{$.datepicker._showDatepicker(target)}return false})}input.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst)},_inlineDatepicker:function(target,inst){var divSpan=$(target);if(divSpan.hasClass(this.markerClassName)){return}divSpan.addClass(this.markerClassName).append(inst.dpDiv).bind("setData.datepicker",function(event,key,value){inst.settings[key]=value}).bind("getData.datepicker",function(event,key){return this._get(inst,key)});$.data(target,PROP_NAME,inst);this._setDate(inst,this._getDefaultDate(inst));this._updateDatepicker(inst);this._updateAlternate(inst)},_dialogDatepicker:function(input,dateText,onSelect,settings,pos){var inst=this._dialogInst;if(!inst){var id="dp"+(++this.uuid);this._dialogInput=$('<input type="text" id="'+id+'" size="1" style="position: absolute; top: -100px;"/>');this._dialogInput.keydown(this._doKeyDown);$("body").append(this._dialogInput);inst=this._dialogInst=this._newInst(this._dialogInput,false);inst.settings={};$.data(this._dialogInput[0],PROP_NAME,inst)}extendRemove(inst.settings,settings||{});this._dialogInput.val(dateText);this._pos=(pos?(pos.length?pos:[pos.pageX,pos.pageY]):null);if(!this._pos){var browserWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;var browserHeight=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;var scrollX=document.documentElement.scrollLeft||document.body.scrollLeft;var scrollY=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[(browserWidth/2)-100+scrollX,(browserHeight/2)-150+scrollY]}this._dialogInput.css("left",this._pos[0]+"px").css("top",this._pos[1]+"px");inst.settings.onSelect=onSelect;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);if($.blockUI){$.blockUI(this.dpDiv)}$.data(this._dialogInput[0],PROP_NAME,inst);return this},_destroyDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();$.removeData(target,PROP_NAME);if(nodeName=="input"){inst.append.remove();inst.trigger.remove();$target.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress)}else{if(nodeName=="div"||nodeName=="span"){$target.removeClass(this.markerClassName).empty()}}},_enableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=false;inst.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().removeClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)})},_disableDatepicker:function(target){var $target=$(target);var inst=$.data(target,PROP_NAME);if(!$target.hasClass(this.markerClassName)){return}var nodeName=target.nodeName.toLowerCase();if(nodeName=="input"){target.disabled=true;inst.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else{if(nodeName=="div"||nodeName=="span"){var inline=$target.children("."+this._inlineClass);inline.children().addClass("ui-state-disabled")}}this._disabledInputs=$.map(this._disabledInputs,function(value){return(value==target?null:value)});this._disabledInputs[this._disabledInputs.length]=target},_isDisabledDatepicker:function(target){if(!target){return false}for(var i=0;i<this._disabledInputs.length;i++){if(this._disabledInputs[i]==target){return true}}return false},_getInst:function(target){try{return $.data(target,PROP_NAME)}catch(err){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(target,name,value){var inst=this._getInst(target);if(arguments.length==2&&typeof name=="string"){return(name=="defaults"?$.extend({},$.datepicker._defaults):(inst?(name=="all"?$.extend({},inst.settings):this._get(inst,name)):null))}var settings=name||{};if(typeof name=="string"){settings={};settings[name]=value}if(inst){if(this._curInst==inst){this._hideDatepicker(null)}var date=this._getDateDatepicker(target);extendRemove(inst.settings,settings);this._setDateDatepicker(target,date);this._updateDatepicker(inst)}},_changeDatepicker:function(target,name,value){this._optionDatepicker(target,name,value)},_refreshDatepicker:function(target){var inst=this._getInst(target);if(inst){this._updateDatepicker(inst)}},_setDateDatepicker:function(target,date,endDate){var inst=this._getInst(target);if(inst){this._setDate(inst,date,endDate);this._updateDatepicker(inst);this._updateAlternate(inst)}},_getDateDatepicker:function(target){var inst=this._getInst(target);if(inst&&!inst.inline){this._setDateFromField(inst)}return(inst?this._getDate(inst):null)},_doKeyDown:function(event){var inst=$.datepicker._getInst(event.target);var handled=true;var isRTL=inst.dpDiv.is(".ui-datepicker-rtl");inst._keyEvent=true;if($.datepicker._datepickerShowing){switch(event.keyCode){case 9:$.datepicker._hideDatepicker(null,"");break;case 13:var sel=$("td."+$.datepicker._dayOverClass+", td."+$.datepicker._currentClass,inst.dpDiv);if(sel[0]){$.datepicker._selectDay(event.target,inst.selectedMonth,inst.selectedYear,sel[0])}else{$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"))}return false;break;case 27:$.datepicker._hideDatepicker(null,$.datepicker._get(inst,"duration"));break;case 33:$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M");break;case 34:$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M");break;case 35:if(event.ctrlKey||event.metaKey){$.datepicker._clearDate(event.target)}handled=event.ctrlKey||event.metaKey;break;case 36:if(event.ctrlKey||event.metaKey){$.datepicker._gotoToday(event.target)}handled=event.ctrlKey||event.metaKey;break;case 37:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?+1:-1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?-$.datepicker._get(inst,"stepBigMonths"):-$.datepicker._get(inst,"stepMonths")),"M")}break;case 38:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,-7,"D")}handled=event.ctrlKey||event.metaKey;break;case 39:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,(isRTL?-1:+1),"D")}handled=event.ctrlKey||event.metaKey;if(event.originalEvent.altKey){$.datepicker._adjustDate(event.target,(event.ctrlKey?+$.datepicker._get(inst,"stepBigMonths"):+$.datepicker._get(inst,"stepMonths")),"M")}break;case 40:if(event.ctrlKey||event.metaKey){$.datepicker._adjustDate(event.target,+7,"D")}handled=event.ctrlKey||event.metaKey;break;default:handled=false}}else{if(event.keyCode==36&&event.ctrlKey){$.datepicker._showDatepicker(this)}else{handled=false}}if(handled){event.preventDefault();event.stopPropagation()}},_doKeyPress:function(event){var inst=$.datepicker._getInst(event.target);if($.datepicker._get(inst,"constrainInput")){var chars=$.datepicker._possibleChars($.datepicker._get(inst,"dateFormat"));var chr=String.fromCharCode(event.charCode==undefined?event.keyCode:event.charCode);return event.ctrlKey||(chr<" "||!chars||chars.indexOf(chr)>-1)}},_showDatepicker:function(input){input=input.target||input;if(input.nodeName.toLowerCase()!="input"){input=$("input",input.parentNode)[0]}if($.datepicker._isDisabledDatepicker(input)||$.datepicker._lastInput==input){return}var inst=$.datepicker._getInst(input);var beforeShow=$.datepicker._get(inst,"beforeShow");extendRemove(inst.settings,(beforeShow?beforeShow.apply(input,[input,inst]):{}));$.datepicker._hideDatepicker(null,"");$.datepicker._lastInput=input;$.datepicker._setDateFromField(inst);if($.datepicker._inDialog){input.value=""}if(!$.datepicker._pos){$.datepicker._pos=$.datepicker._findPos(input);$.datepicker._pos[1]+=input.offsetHeight}var isFixed=false;$(input).parents().each(function(){isFixed|=$(this).css("position")=="fixed";return !isFixed});if(isFixed&&$.browser.opera){$.datepicker._pos[0]-=document.documentElement.scrollLeft;$.datepicker._pos[1]-=document.documentElement.scrollTop}var offset={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null;inst.rangeStart=null;inst.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});$.datepicker._updateDatepicker(inst);offset=$.datepicker._checkOffset(inst,offset,isFixed);inst.dpDiv.css({position:($.datepicker._inDialog&&$.blockUI?"static":(isFixed?"fixed":"absolute")),display:"none",left:offset.left+"px",top:offset.top+"px"});if(!inst.inline){var showAnim=$.datepicker._get(inst,"showAnim")||"show";var duration=$.datepicker._get(inst,"duration");var postProcess=function(){$.datepicker._datepickerShowing=true;if($.browser.msie&&parseInt($.browser.version,10)<7){$("iframe.ui-datepicker-cover").css({width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4})}};if($.effects&&$.effects[showAnim]){inst.dpDiv.show(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[showAnim](duration,postProcess)}if(duration==""){postProcess()}if(inst.input[0].type!="hidden"){inst.input[0].focus()}$.datepicker._curInst=inst}},_updateDatepicker:function(inst){var dims={width:inst.dpDiv.width()+4,height:inst.dpDiv.height()+4};var self=this;inst.dpDiv.empty().append(this._generateHTML(inst)).find("iframe.ui-datepicker-cover").css({width:dims.width,height:dims.height}).end().find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout",function(){$(this).removeClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).removeClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).removeClass("ui-datepicker-next-hover")}}).bind("mouseover",function(){if(!self._isDisabledDatepicker(inst.inline?inst.dpDiv.parent()[0]:inst.input[0])){$(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");$(this).addClass("ui-state-hover");if(this.className.indexOf("ui-datepicker-prev")!=-1){$(this).addClass("ui-datepicker-prev-hover")}if(this.className.indexOf("ui-datepicker-next")!=-1){$(this).addClass("ui-datepicker-next-hover")}}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();var numMonths=this._getNumberOfMonths(inst);var cols=numMonths[1];var width=17;if(cols>1){inst.dpDiv.addClass("ui-datepicker-multi-"+cols).css("width",(width*cols)+"em")}else{inst.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("")}inst.dpDiv[(numMonths[0]!=1||numMonths[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");inst.dpDiv[(this._get(inst,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");if(inst.input&&inst.input[0].type!="hidden"&&inst==$.datepicker._curInst){$(inst.input[0]).focus()}},_checkOffset:function(inst,offset,isFixed){var dpWidth=inst.dpDiv.outerWidth();var dpHeight=inst.dpDiv.outerHeight();var inputWidth=inst.input?inst.input.outerWidth():0;var inputHeight=inst.input?inst.input.outerHeight():0;var viewWidth=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)+$(document).scrollLeft();var viewHeight=(window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight)+$(document).scrollTop();offset.left-=(this._get(inst,"isRTL")?(dpWidth-inputWidth):0);offset.left-=(isFixed&&offset.left==inst.input.offset().left)?$(document).scrollLeft():0;offset.top-=(isFixed&&offset.top==(inst.input.offset().top+inputHeight))?$(document).scrollTop():0;offset.left-=(offset.left+dpWidth>viewWidth&&viewWidth>dpWidth)?Math.abs(offset.left+dpWidth-viewWidth):0;offset.top-=(offset.top+dpHeight>viewHeight&&viewHeight>dpHeight)?Math.abs(offset.top+dpHeight+inputHeight*2-viewHeight):0;return offset},_findPos:function(obj){while(obj&&(obj.type=="hidden"||obj.nodeType!=1)){obj=obj.nextSibling}var position=$(obj).offset();return[position.left,position.top]},_hideDatepicker:function(input,duration){var inst=this._curInst;if(!inst||(input&&inst!=$.data(input,PROP_NAME))){return}if(inst.stayOpen){this._selectDate("#"+inst.id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear))}inst.stayOpen=false;if(this._datepickerShowing){duration=(duration!=null?duration:this._get(inst,"duration"));var showAnim=this._get(inst,"showAnim");var postProcess=function(){$.datepicker._tidyDialog(inst)};if(duration!=""&&$.effects&&$.effects[showAnim]){inst.dpDiv.hide(showAnim,$.datepicker._get(inst,"showOptions"),duration,postProcess)}else{inst.dpDiv[(duration==""?"hide":(showAnim=="slideDown"?"slideUp":(showAnim=="fadeIn"?"fadeOut":"hide")))](duration,postProcess)}if(duration==""){this._tidyDialog(inst)}var onClose=this._get(inst,"onClose");if(onClose){onClose.apply((inst.input?inst.input[0]:null),[(inst.input?inst.input.val():""),inst])}this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if($.blockUI){$.unblockUI();$("body").append(this.dpDiv)}}this._inDialog=false}this._curInst=null},_tidyDialog:function(inst){inst.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(event){if(!$.datepicker._curInst){return}var $target=$(event.target);if(($target.parents("#"+$.datepicker._mainDivId).length==0)&&!$target.hasClass($.datepicker.markerClassName)&&!$target.hasClass($.datepicker._triggerClass)&&$.datepicker._datepickerShowing&&!($.datepicker._inDialog&&$.blockUI)){$.datepicker._hideDatepicker(null,"")}},_adjustDate:function(id,offset,period){var target=$(id);var inst=this._getInst(target[0]);if(this._isDisabledDatepicker(target[0])){return}this._adjustInstDate(inst,offset+(period=="M"?this._get(inst,"showCurrentAtPos"):0),period);this._updateDatepicker(inst)},_gotoToday:function(id){var target=$(id);var inst=this._getInst(target[0]);if(this._get(inst,"gotoCurrent")&&inst.currentDay){inst.selectedDay=inst.currentDay;inst.drawMonth=inst.selectedMonth=inst.currentMonth;inst.drawYear=inst.selectedYear=inst.currentYear}else{var date=new Date();inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear()}this._notifyChange(inst);this._adjustDate(target)},_selectMonthYear:function(id,select,period){var target=$(id);var inst=this._getInst(target[0]);inst._selectingMonthYear=false;inst["selected"+(period=="M"?"Month":"Year")]=inst["draw"+(period=="M"?"Month":"Year")]=parseInt(select.options[select.selectedIndex].value,10);this._notifyChange(inst);this._adjustDate(target)},_clickMonthYear:function(id){var target=$(id);var inst=this._getInst(target[0]);if(inst.input&&inst._selectingMonthYear&&!$.browser.msie){inst.input[0].focus()}inst._selectingMonthYear=!inst._selectingMonthYear},_selectDay:function(id,month,year,td){var target=$(id);if($(td).hasClass(this._unselectableClass)||this._isDisabledDatepicker(target[0])){return}var inst=this._getInst(target[0]);inst.selectedDay=inst.currentDay=$("a",td).html();inst.selectedMonth=inst.currentMonth=month;inst.selectedYear=inst.currentYear=year;if(inst.stayOpen){inst.endDay=inst.endMonth=inst.endYear=null}this._selectDate(id,this._formatDate(inst,inst.currentDay,inst.currentMonth,inst.currentYear));if(inst.stayOpen){inst.rangeStart=this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay));this._updateDatepicker(inst)}},_clearDate:function(id){var target=$(id);var inst=this._getInst(target[0]);inst.stayOpen=false;inst.endDay=inst.endMonth=inst.endYear=inst.rangeStart=null;this._selectDate(target,"")},_selectDate:function(id,dateStr){var target=$(id);var inst=this._getInst(target[0]);dateStr=(dateStr!=null?dateStr:this._formatDate(inst));if(inst.input){inst.input.val(dateStr)}this._updateAlternate(inst);var onSelect=this._get(inst,"onSelect");if(onSelect){onSelect.apply((inst.input?inst.input[0]:null),[dateStr,inst])}else{if(inst.input){inst.input.trigger("change")}}if(inst.inline){this._updateDatepicker(inst)}else{if(!inst.stayOpen){this._hideDatepicker(null,this._get(inst,"duration"));this._lastInput=inst.input[0];if(typeof(inst.input[0])!="object"){inst.input[0].focus()}this._lastInput=null}}},_updateAlternate:function(inst){var altField=this._get(inst,"altField");if(altField){var altFormat=this._get(inst,"altFormat")||this._get(inst,"dateFormat");var date=this._getDate(inst);dateStr=this.formatDate(altFormat,date,this._getFormatConfig(inst));$(altField).each(function(){$(this).val(dateStr)})}},noWeekends:function(date){var day=date.getDay();return[(day>0&&day<6),""]},iso8601Week:function(date){var checkDate=new Date(date.getFullYear(),date.getMonth(),date.getDate());var firstMon=new Date(checkDate.getFullYear(),1-1,4);var firstDay=firstMon.getDay()||7;firstMon.setDate(firstMon.getDate()+1-firstDay);if(firstDay<4&&checkDate<firstMon){checkDate.setDate(checkDate.getDate()-3);return $.datepicker.iso8601Week(checkDate)}else{if(checkDate>new Date(checkDate.getFullYear(),12-1,28)){firstDay=new Date(checkDate.getFullYear()+1,1-1,4).getDay()||7;if(firstDay>4&&(checkDate.getDay()||7)<firstDay-3){return 1}}}return Math.floor(((checkDate-firstMon)/86400000)/7)+1},parseDate:function(format,value,settings){if(format==null||value==null){throw"Invalid arguments"}value=(typeof value=="object"?value.toString():value+"");if(value==""){return null}var shortYearCutoff=(settings?settings.shortYearCutoff:null)||this._defaults.shortYearCutoff;var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var year=-1;var month=-1;var day=-1;var doy=-1;var literal=false;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var getNumber=function(match){lookAhead(match);var origSize=(match=="@"?14:(match=="y"?4:(match=="o"?3:2)));var size=origSize;var num=0;while(size>0&&iValue<value.length&&value.charAt(iValue)>="0"&&value.charAt(iValue)<="9"){num=num*10+parseInt(value.charAt(iValue++),10);size--}if(size==origSize){throw"Missing number at position "+iValue}return num};var getName=function(match,shortNames,longNames){var names=(lookAhead(match)?longNames:shortNames);var size=0;for(var j=0;j<names.length;j++){size=Math.max(size,names[j].length)}var name="";var iInit=iValue;while(size>0&&iValue<value.length){name+=value.charAt(iValue++);for(var i=0;i<names.length;i++){if(name==names[i]){return i+1}}size--}throw"Unknown name at position "+iInit};var checkLiteral=function(){if(value.charAt(iValue)!=format.charAt(iFormat)){throw"Unexpected literal at position "+iValue}iValue++};var iValue=0;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{checkLiteral()}}else{switch(format.charAt(iFormat)){case"d":day=getNumber("d");break;case"D":getName("D",dayNamesShort,dayNames);break;case"o":doy=getNumber("o");break;case"m":month=getNumber("m");break;case"M":month=getName("M",monthNamesShort,monthNames);break;case"y":year=getNumber("y");break;case"@":var date=new Date(getNumber("@"));year=date.getFullYear();month=date.getMonth()+1;day=date.getDate();break;case"'":if(lookAhead("'")){checkLiteral()}else{literal=true}break;default:checkLiteral()}}}if(year==-1){year=new Date().getFullYear()}else{if(year<100){year+=new Date().getFullYear()-new Date().getFullYear()%100+(year<=shortYearCutoff?0:-100)}}if(doy>-1){month=1;day=doy;do{var dim=this._getDaysInMonth(year,month-1);if(day<=dim){break}month++;day-=dim}while(true)}var date=this._daylightSavingAdjust(new Date(year,month-1,day));if(date.getFullYear()!=year||date.getMonth()+1!=month||date.getDate()!=day){throw"Invalid date"}return date},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TIMESTAMP:"@",W3C:"yy-mm-dd",formatDate:function(format,date,settings){if(!date){return""}var dayNamesShort=(settings?settings.dayNamesShort:null)||this._defaults.dayNamesShort;var dayNames=(settings?settings.dayNames:null)||this._defaults.dayNames;var monthNamesShort=(settings?settings.monthNamesShort:null)||this._defaults.monthNamesShort;var monthNames=(settings?settings.monthNames:null)||this._defaults.monthNames;var lookAhead=function(match){var matches=(iFormat+1<format.length&&format.charAt(iFormat+1)==match);if(matches){iFormat++}return matches};var formatNumber=function(match,value,len){var num=""+value;if(lookAhead(match)){while(num.length<len){num="0"+num}}return num};var formatName=function(match,value,shortNames,longNames){return(lookAhead(match)?longNames[value]:shortNames[value])};var output="";var literal=false;if(date){for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{output+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":output+=formatNumber("d",date.getDate(),2);break;case"D":output+=formatName("D",date.getDay(),dayNamesShort,dayNames);break;case"o":var doy=date.getDate();for(var m=date.getMonth()-1;m>=0;m--){doy+=this._getDaysInMonth(date.getFullYear(),m)}output+=formatNumber("o",doy,3);break;case"m":output+=formatNumber("m",date.getMonth()+1,2);break;case"M":output+=formatName("M",date.getMonth(),monthNamesShort,monthNames);break;case"y":output+=(lookAhead("y")?date.getFullYear():(date.getYear()%100<10?"0":"")+date.getYear()%100);break;case"@":output+=date.getTime();break;case"'":if(lookAhead("'")){output+="'"}else{literal=true}break;default:output+=format.charAt(iFormat)}}}}return output},_possibleChars:function(format){var chars="";var literal=false;for(var iFormat=0;iFormat<format.length;iFormat++){if(literal){if(format.charAt(iFormat)=="'"&&!lookAhead("'")){literal=false}else{chars+=format.charAt(iFormat)}}else{switch(format.charAt(iFormat)){case"d":case"m":case"y":case"@":chars+="0123456789";break;case"D":case"M":return null;case"'":if(lookAhead("'")){chars+="'"}else{literal=true}break;default:chars+=format.charAt(iFormat)}}}return chars},_get:function(inst,name){return inst.settings[name]!==undefined?inst.settings[name]:this._defaults[name]},_setDateFromField:function(inst){var dateFormat=this._get(inst,"dateFormat");var dates=inst.input?inst.input.val():null;inst.endDay=inst.endMonth=inst.endYear=null;var date=defaultDate=this._getDefaultDate(inst);var settings=this._getFormatConfig(inst);try{date=this.parseDate(dateFormat,dates,settings)||defaultDate}catch(event){this.log(event);date=defaultDate}inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();inst.currentDay=(dates?date.getDate():0);inst.currentMonth=(dates?date.getMonth():0);inst.currentYear=(dates?date.getFullYear():0);this._adjustInstDate(inst)},_getDefaultDate:function(inst){var date=this._determineDate(this._get(inst,"defaultDate"),new Date());var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);return date},_determineDate:function(date,defaultDate){var offsetNumeric=function(offset){var date=new Date();date.setDate(date.getDate()+offset);return date};var offsetString=function(offset,getDaysInMonth){var date=new Date();var year=date.getFullYear();var month=date.getMonth();var day=date.getDate();var pattern=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g;var matches=pattern.exec(offset);while(matches){switch(matches[2]||"d"){case"d":case"D":day+=parseInt(matches[1],10);break;case"w":case"W":day+=parseInt(matches[1],10)*7;break;case"m":case"M":month+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break;case"y":case"Y":year+=parseInt(matches[1],10);day=Math.min(day,getDaysInMonth(year,month));break}matches=pattern.exec(offset)}return new Date(year,month,day)};date=(date==null?defaultDate:(typeof date=="string"?offsetString(date,this._getDaysInMonth):(typeof date=="number"?(isNaN(date)?defaultDate:offsetNumeric(date)):date)));date=(date&&date.toString()=="Invalid Date"?defaultDate:date);if(date){date.setHours(0);date.setMinutes(0);date.setSeconds(0);date.setMilliseconds(0)}return this._daylightSavingAdjust(date)},_daylightSavingAdjust:function(date){if(!date){return null}date.setHours(date.getHours()>12?date.getHours()+2:0);return date},_setDate:function(inst,date,endDate){var clear=!(date);var origMonth=inst.selectedMonth;var origYear=inst.selectedYear;date=this._determineDate(date,new Date());inst.selectedDay=inst.currentDay=date.getDate();inst.drawMonth=inst.selectedMonth=inst.currentMonth=date.getMonth();inst.drawYear=inst.selectedYear=inst.currentYear=date.getFullYear();if(origMonth!=inst.selectedMonth||origYear!=inst.selectedYear){this._notifyChange(inst)}this._adjustInstDate(inst);if(inst.input){inst.input.val(clear?"":this._formatDate(inst))}},_getDate:function(inst){var startDate=(!inst.currentYear||(inst.input&&inst.input.val()=="")?null:this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return startDate},_generateHTML:function(inst){var today=new Date();today=this._daylightSavingAdjust(new Date(today.getFullYear(),today.getMonth(),today.getDate()));var isRTL=this._get(inst,"isRTL");var showButtonPanel=this._get(inst,"showButtonPanel");var hideIfNoPrevNext=this._get(inst,"hideIfNoPrevNext");var navigationAsDateFormat=this._get(inst,"navigationAsDateFormat");var numMonths=this._getNumberOfMonths(inst);var showCurrentAtPos=this._get(inst,"showCurrentAtPos");var stepMonths=this._get(inst,"stepMonths");var stepBigMonths=this._get(inst,"stepBigMonths");var isMultiMonth=(numMonths[0]!=1||numMonths[1]!=1);var currentDate=this._daylightSavingAdjust((!inst.currentDay?new Date(9999,9,9):new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");var drawMonth=inst.drawMonth-showCurrentAtPos;var drawYear=inst.drawYear;if(drawMonth<0){drawMonth+=12;drawYear--}if(maxDate){var maxDraw=this._daylightSavingAdjust(new Date(maxDate.getFullYear(),maxDate.getMonth()-numMonths[1]+1,maxDate.getDate()));maxDraw=(minDate&&maxDraw<minDate?minDate:maxDraw);while(this._daylightSavingAdjust(new Date(drawYear,drawMonth,1))>maxDraw){drawMonth--;if(drawMonth<0){drawMonth=11;drawYear--}}}inst.drawMonth=drawMonth;inst.drawYear=drawYear;var prevText=this._get(inst,"prevText");prevText=(!navigationAsDateFormat?prevText:this.formatDate(prevText,this._daylightSavingAdjust(new Date(drawYear,drawMonth-stepMonths,1)),this._getFormatConfig(inst)));var prev=(this._canAdjustMonth(inst,-1,drawYear,drawMonth)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', -"+stepMonths+", 'M');\" title=\""+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+prevText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"e":"w")+'">'+prevText+"</span></a>"));var nextText=this._get(inst,"nextText");nextText=(!navigationAsDateFormat?nextText:this.formatDate(nextText,this._daylightSavingAdjust(new Date(drawYear,drawMonth+stepMonths,1)),this._getFormatConfig(inst)));var next=(this._canAdjustMonth(inst,+1,drawYear,drawMonth)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery.datepicker._adjustDate(\'#'+inst.id+"', +"+stepMonths+", 'M');\" title=\""+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>":(hideIfNoPrevNext?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+nextText+'"><span class="ui-icon ui-icon-circle-triangle-'+(isRTL?"w":"e")+'">'+nextText+"</span></a>"));var currentText=this._get(inst,"currentText");var gotoDate=(this._get(inst,"gotoCurrent")&&inst.currentDay?currentDate:today);currentText=(!navigationAsDateFormat?currentText:this.formatDate(currentText,gotoDate,this._getFormatConfig(inst)));var controls=(!inst.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery.datepicker._hideDatepicker();">'+this._get(inst,"closeText")+"</button>":"");var buttonPanel=(showButtonPanel)?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(isRTL?controls:"")+(this._isInRange(inst,gotoDate)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery.datepicker._gotoToday(\'#'+inst.id+"');\">"+currentText+"</button>":"")+(isRTL?"":controls)+"</div>":"";var firstDay=parseInt(this._get(inst,"firstDay"),10);firstDay=(isNaN(firstDay)?0:firstDay);var dayNames=this._get(inst,"dayNames");var dayNamesShort=this._get(inst,"dayNamesShort");var dayNamesMin=this._get(inst,"dayNamesMin");var monthNames=this._get(inst,"monthNames");var monthNamesShort=this._get(inst,"monthNamesShort");var beforeShowDay=this._get(inst,"beforeShowDay");var showOtherMonths=this._get(inst,"showOtherMonths");var calculateWeek=this._get(inst,"calculateWeek")||this.iso8601Week;var endDate=inst.endDay?this._daylightSavingAdjust(new Date(inst.endYear,inst.endMonth,inst.endDay)):currentDate;var defaultDate=this._getDefaultDate(inst);var html="";for(var row=0;row<numMonths[0];row++){var group="";for(var col=0;col<numMonths[1];col++){var selectedDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,inst.selectedDay));var cornerClass=" ui-corner-all";var calender="";if(isMultiMonth){calender+='<div class="ui-datepicker-group ui-datepicker-group-';switch(col){case 0:calender+="first";cornerClass=" ui-corner-"+(isRTL?"right":"left");break;case numMonths[1]-1:calender+="last";cornerClass=" ui-corner-"+(isRTL?"left":"right");break;default:calender+="middle";cornerClass="";break}calender+='">'}calender+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+cornerClass+'">'+(/all|left/.test(cornerClass)&&row==0?(isRTL?next:prev):"")+(/all|right/.test(cornerClass)&&row==0?(isRTL?prev:next):"")+this._generateMonthYearHeader(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,row>0||col>0,monthNames,monthNamesShort)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var thead="";for(var dow=0;dow<7;dow++){var day=(dow+firstDay)%7;thead+="<th"+((dow+firstDay+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+dayNames[day]+'">'+dayNamesMin[day]+"</span></th>"}calender+=thead+"</tr></thead><tbody>";var daysInMonth=this._getDaysInMonth(drawYear,drawMonth);if(drawYear==inst.selectedYear&&drawMonth==inst.selectedMonth){inst.selectedDay=Math.min(inst.selectedDay,daysInMonth)}var leadDays=(this._getFirstDayOfMonth(drawYear,drawMonth)-firstDay+7)%7;var numRows=(isMultiMonth?6:Math.ceil((leadDays+daysInMonth)/7));var printDate=this._daylightSavingAdjust(new Date(drawYear,drawMonth,1-leadDays));for(var dRow=0;dRow<numRows;dRow++){calender+="<tr>";var tbody="";for(var dow=0;dow<7;dow++){var daySettings=(beforeShowDay?beforeShowDay.apply((inst.input?inst.input[0]:null),[printDate]):[true,""]);var otherMonth=(printDate.getMonth()!=drawMonth);var unselectable=otherMonth||!daySettings[0]||(minDate&&printDate<minDate)||(maxDate&&printDate>maxDate);tbody+='<td class="'+((dow+firstDay+6)%7>=5?" ui-datepicker-week-end":"")+(otherMonth?" ui-datepicker-other-month":"")+((printDate.getTime()==selectedDate.getTime()&&drawMonth==inst.selectedMonth&&inst._keyEvent)||(defaultDate.getTime()==printDate.getTime()&&defaultDate.getTime()==selectedDate.getTime())?" "+this._dayOverClass:"")+(unselectable?" "+this._unselectableClass+" ui-state-disabled":"")+(otherMonth&&!showOtherMonths?"":" "+daySettings[1]+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" "+this._currentClass:"")+(printDate.getTime()==today.getTime()?" ui-datepicker-today":""))+'"'+((!otherMonth||showOtherMonths)&&daySettings[2]?' title="'+daySettings[2]+'"':"")+(unselectable?"":" onclick=\"DP_jQuery.datepicker._selectDay('#"+inst.id+"',"+drawMonth+","+drawYear+', this);return false;"')+">"+(otherMonth?(showOtherMonths?printDate.getDate():" "):(unselectable?'<span class="ui-state-default">'+printDate.getDate()+"</span>":'<a class="ui-state-default'+(printDate.getTime()==today.getTime()?" ui-state-highlight":"")+(printDate.getTime()>=currentDate.getTime()&&printDate.getTime()<=endDate.getTime()?" ui-state-active":"")+'" href="#">'+printDate.getDate()+"</a>"))+"</td>";printDate.setDate(printDate.getDate()+1);printDate=this._daylightSavingAdjust(printDate)}calender+=tbody+"</tr>"}drawMonth++;if(drawMonth>11){drawMonth=0;drawYear++}calender+="</tbody></table>"+(isMultiMonth?"</div>"+((numMonths[0]>0&&col==numMonths[1]-1)?'<div class="ui-datepicker-row-break"></div>':""):"");group+=calender}html+=group}html+=buttonPanel+($.browser.msie&&parseInt($.browser.version,10)<7&&!inst.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':"");inst._keyEvent=false;return html},_generateMonthYearHeader:function(inst,drawMonth,drawYear,minDate,maxDate,selectedDate,secondary,monthNames,monthNamesShort){minDate=(inst.rangeStart&&minDate&&selectedDate<minDate?selectedDate:minDate);var changeMonth=this._get(inst,"changeMonth");var changeYear=this._get(inst,"changeYear");var showMonthAfterYear=this._get(inst,"showMonthAfterYear");var html='<div class="ui-datepicker-title">';var monthHtml="";if(secondary||!changeMonth){monthHtml+='<span class="ui-datepicker-month">'+monthNames[drawMonth]+"</span> "}else{var inMinYear=(minDate&&minDate.getFullYear()==drawYear);var inMaxYear=(maxDate&&maxDate.getFullYear()==drawYear);monthHtml+='<select class="ui-datepicker-month" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'M');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(var month=0;month<12;month++){if((!inMinYear||month>=minDate.getMonth())&&(!inMaxYear||month<=maxDate.getMonth())){monthHtml+='<option value="'+month+'"'+(month==drawMonth?' selected="selected"':"")+">"+monthNamesShort[month]+"</option>"}}monthHtml+="</select>"}if(!showMonthAfterYear){html+=monthHtml+((secondary||changeMonth||changeYear)&&(!(changeMonth&&changeYear))?" ":"")}if(secondary||!changeYear){html+='<span class="ui-datepicker-year">'+drawYear+"</span>"}else{var years=this._get(inst,"yearRange").split(":");var year=0;var endYear=0;if(years.length!=2){year=drawYear-10;endYear=drawYear+10}else{if(years[0].charAt(0)=="+"||years[0].charAt(0)=="-"){year=drawYear+parseInt(years[0],10);endYear=drawYear+parseInt(years[1],10)}else{year=parseInt(years[0],10);endYear=parseInt(years[1],10)}}year=(minDate?Math.max(year,minDate.getFullYear()):year);endYear=(maxDate?Math.min(endYear,maxDate.getFullYear()):endYear);html+='<select class="ui-datepicker-year" onchange="DP_jQuery.datepicker._selectMonthYear(\'#'+inst.id+"', this, 'Y');\" onclick=\"DP_jQuery.datepicker._clickMonthYear('#"+inst.id+"');\">";for(;year<=endYear;year++){html+='<option value="'+year+'"'+(year==drawYear?' selected="selected"':"")+">"+year+"</option>"}html+="</select>"}if(showMonthAfterYear){html+=(secondary||changeMonth||changeYear?" ":"")+monthHtml}html+="</div>";return html},_adjustInstDate:function(inst,offset,period){var year=inst.drawYear+(period=="Y"?offset:0);var month=inst.drawMonth+(period=="M"?offset:0);var day=Math.min(inst.selectedDay,this._getDaysInMonth(year,month))+(period=="D"?offset:0);var date=this._daylightSavingAdjust(new Date(year,month,day));var minDate=this._getMinMaxDate(inst,"min",true);var maxDate=this._getMinMaxDate(inst,"max");date=(minDate&&date<minDate?minDate:date);date=(maxDate&&date>maxDate?maxDate:date);inst.selectedDay=date.getDate();inst.drawMonth=inst.selectedMonth=date.getMonth();inst.drawYear=inst.selectedYear=date.getFullYear();if(period=="M"||period=="Y"){this._notifyChange(inst)}},_notifyChange:function(inst){var onChange=this._get(inst,"onChangeMonthYear");if(onChange){onChange.apply((inst.input?inst.input[0]:null),[inst.selectedYear,inst.selectedMonth+1,inst])}},_getNumberOfMonths:function(inst){var numMonths=this._get(inst,"numberOfMonths");return(numMonths==null?[1,1]:(typeof numMonths=="number"?[1,numMonths]:numMonths))},_getMinMaxDate:function(inst,minMax,checkRange){var date=this._determineDate(this._get(inst,minMax+"Date"),null);return(!checkRange||!inst.rangeStart?date:(!date||inst.rangeStart>date?inst.rangeStart:date))},_getDaysInMonth:function(year,month){return 32-new Date(year,month,32).getDate()},_getFirstDayOfMonth:function(year,month){return new Date(year,month,1).getDay()},_canAdjustMonth:function(inst,offset,curYear,curMonth){var numMonths=this._getNumberOfMonths(inst);var date=this._daylightSavingAdjust(new Date(curYear,curMonth+(offset<0?offset:numMonths[1]),1));if(offset<0){date.setDate(this._getDaysInMonth(date.getFullYear(),date.getMonth()))}return this._isInRange(inst,date)},_isInRange:function(inst,date){var newMinDate=(!inst.rangeStart?null:this._daylightSavingAdjust(new Date(inst.selectedYear,inst.selectedMonth,inst.selectedDay)));newMinDate=(newMinDate&&inst.rangeStart<newMinDate?inst.rangeStart:newMinDate);var minDate=newMinDate||this._getMinMaxDate(inst,"min");var maxDate=this._getMinMaxDate(inst,"max");return((!minDate||date>=minDate)&&(!maxDate||date<=maxDate))},_getFormatConfig:function(inst){var shortYearCutoff=this._get(inst,"shortYearCutoff");shortYearCutoff=(typeof shortYearCutoff!="string"?shortYearCutoff:new Date().getFullYear()%100+parseInt(shortYearCutoff,10));return{shortYearCutoff:shortYearCutoff,dayNamesShort:this._get(inst,"dayNamesShort"),dayNames:this._get(inst,"dayNames"),monthNamesShort:this._get(inst,"monthNamesShort"),monthNames:this._get(inst,"monthNames")}},_formatDate:function(inst,day,month,year){if(!day){inst.currentDay=inst.selectedDay;inst.currentMonth=inst.selectedMonth;inst.currentYear=inst.selectedYear}var date=(day?(typeof day=="object"?day:this._daylightSavingAdjust(new Date(year,month,day))):this._daylightSavingAdjust(new Date(inst.currentYear,inst.currentMonth,inst.currentDay)));return this.formatDate(this._get(inst,"dateFormat"),date,this._getFormatConfig(inst))}});function extendRemove(target,props){$.extend(target,props);for(var name in props){if(props[name]==null||props[name]==undefined){target[name]=props[name]}}return target}function isArray(a){return(a&&(($.browser.safari&&typeof a=="object"&&a.length)||(a.constructor&&a.constructor.toString().match(/\Array\(\)/))))}$.fn.datepicker=function(options){if(!$.datepicker.initialized){$(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv);$.datepicker.initialized=true}var otherArgs=Array.prototype.slice.call(arguments,1);if(typeof options=="string"&&(options=="isDisabled"||options=="getDate")){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}if(options=="option"&&arguments.length==2&&typeof arguments[1]=="string"){return $.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this[0]].concat(otherArgs))}return this.each(function(){typeof options=="string"?$.datepicker["_"+options+"Datepicker"].apply($.datepicker,[this].concat(otherArgs)):$.datepicker._attachDatepicker(this,options)})};$.datepicker=new Datepicker();$.datepicker.initialized=false;$.datepicker.uuid=new Date().getTime();$.datepicker.version="1.7.2";window.DP_jQuery=$})(jQuery);;/* - * jQuery UI Progressbar 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * ui.core.js - */ -(function(a){a.widget("ui.progressbar",{_init:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this._valueMin(),"aria-valuemax":this._valueMax(),"aria-valuenow":this._value()});this.valueDiv=a('<div class="ui-progressbar-value ui-widget-header ui-corner-left"></div>').appendTo(this.element);this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow").removeData("progressbar").unbind(".progressbar");this.valueDiv.remove();a.widget.prototype.destroy.apply(this,arguments)},value:function(b){if(b===undefined){return this._value()}this._setData("value",b);return this},_setData:function(b,c){switch(b){case"value":this.options.value=c;this._refreshValue();this._trigger("change",null,{});break}a.widget.prototype._setData.apply(this,arguments)},_value:function(){var b=this.options.value;if(b<this._valueMin()){b=this._valueMin()}if(b>this._valueMax()){b=this._valueMax()}return b},_valueMin:function(){var b=0;return b},_valueMax:function(){var b=100;return b},_refreshValue:function(){var b=this.value();this.valueDiv[b==this._valueMax()?"addClass":"removeClass"]("ui-corner-right");this.valueDiv.width(b+"%");this.element.attr("aria-valuenow",b)}});a.extend(a.ui.progressbar,{version:"1.7.2",defaults:{value:0}})})(jQuery);;/* - * jQuery UI Effects 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/ - */ -jQuery.effects||(function(d){d.effects={version:"1.7.2",save:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.data("ec.storage."+h[f],g[0].style[h[f]])}}},restore:function(g,h){for(var f=0;f<h.length;f++){if(h[f]!==null){g.css(h[f],g.data("ec.storage."+h[f]))}}},setMode:function(f,g){if(g=="toggle"){g=f.is(":hidden")?"show":"hide"}return g},getBaseline:function(g,h){var i,f;switch(g[0]){case"top":i=0;break;case"middle":i=0.5;break;case"bottom":i=1;break;default:i=g[0]/h.height}switch(g[1]){case"left":f=0;break;case"center":f=0.5;break;case"right":f=1;break;default:f=g[1]/h.width}return{x:f,y:i}},createWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent()}var g={width:f.outerWidth(true),height:f.outerHeight(true),"float":f.css("float")};f.wrap('<div class="ui-effects-wrapper" style="font-size:100%;background:transparent;border:none;margin:0;padding:0"></div>');var j=f.parent();if(f.css("position")=="static"){j.css({position:"relative"});f.css({position:"relative"})}else{var i=f.css("top");if(isNaN(parseInt(i,10))){i="auto"}var h=f.css("left");if(isNaN(parseInt(h,10))){h="auto"}j.css({position:f.css("position"),top:i,left:h,zIndex:f.css("z-index")}).show();f.css({position:"relative",top:0,left:0})}j.css(g);return j},removeWrapper:function(f){if(f.parent().is(".ui-effects-wrapper")){return f.parent().replaceWith(f)}return f},setTransition:function(g,i,f,h){h=h||{};d.each(i,function(k,j){unit=g.cssUnit(j);if(unit[0]>0){h[j]=unit[0]*f+unit[1]}});return h},animateClass:function(h,i,k,j){var f=(typeof k=="function"?k:(j?j:null));var g=(typeof k=="string"?k:null);return this.each(function(){var q={};var o=d(this);var p=o.attr("style")||"";if(typeof p=="object"){p=p.cssText}if(h.toggle){o.hasClass(h.toggle)?h.remove=h.toggle:h.add=h.toggle}var l=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.addClass(h.add)}if(h.remove){o.removeClass(h.remove)}var m=d.extend({},(document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle));if(h.add){o.removeClass(h.add)}if(h.remove){o.addClass(h.remove)}for(var r in m){if(typeof m[r]!="function"&&m[r]&&r.indexOf("Moz")==-1&&r.indexOf("length")==-1&&m[r]!=l[r]&&(r.match(/color/i)||(!r.match(/color/i)&&!isNaN(parseInt(m[r],10))))&&(l.position!="static"||(l.position=="static"&&!r.match(/left|top|bottom|right/)))){q[r]=m[r]}}o.animate(q,i,g,function(){if(typeof d(this).attr("style")=="object"){d(this).attr("style")["cssText"]="";d(this).attr("style")["cssText"]=p}else{d(this).attr("style",p)}if(h.add){d(this).addClass(h.add)}if(h.remove){d(this).removeClass(h.remove)}if(f){f.apply(this,arguments)}})})}};function c(g,f){var i=g[1]&&g[1].constructor==Object?g[1]:{};if(f){i.mode=f}var h=g[1]&&g[1].constructor!=Object?g[1]:(i.duration?i.duration:g[2]);h=d.fx.off?0:typeof h==="number"?h:d.fx.speeds[h]||d.fx.speeds._default;var j=i.callback||(d.isFunction(g[1])&&g[1])||(d.isFunction(g[2])&&g[2])||(d.isFunction(g[3])&&g[3]);return[g[0],i,h,j]}d.fn.extend({_show:d.fn.show,_hide:d.fn.hide,__toggle:d.fn.toggle,_addClass:d.fn.addClass,_removeClass:d.fn.removeClass,_toggleClass:d.fn.toggleClass,effect:function(g,f,h,i){return d.effects[g]?d.effects[g].call(this,{method:g,options:f||{},duration:h,callback:i}):null},show:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._show.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"show"))}},hide:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))){return this._hide.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"hide"))}},toggle:function(){if(!arguments[0]||(arguments[0].constructor==Number||(/(slow|normal|fast)/).test(arguments[0]))||(d.isFunction(arguments[0])||typeof arguments[0]=="boolean")){return this.__toggle.apply(this,arguments)}else{return this.effect.apply(this,c(arguments,"toggle"))}},addClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{add:g},f,i,h]):this._addClass(g)},removeClass:function(g,f,i,h){return f?d.effects.animateClass.apply(this,[{remove:g},f,i,h]):this._removeClass(g)},toggleClass:function(g,f,i,h){return((typeof f!=="boolean")&&f)?d.effects.animateClass.apply(this,[{toggle:g},f,i,h]):this._toggleClass(g,f)},morph:function(f,h,g,j,i){return d.effects.animateClass.apply(this,[{add:h,remove:f},g,j,i])},switchClass:function(){return this.morph.apply(this,arguments)},cssUnit:function(f){var g=this.css(f),h=[];d.each(["em","px","%","pt"],function(j,k){if(g.indexOf(k)>0){h=[parseFloat(g),k]}});return h}});d.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","color","outlineColor"],function(g,f){d.fx.step[f]=function(h){if(h.state==0){h.start=e(h.elem,f);h.end=b(h.end)}h.elem.style[f]="rgb("+[Math.max(Math.min(parseInt((h.pos*(h.end[0]-h.start[0]))+h.start[0],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[1]-h.start[1]))+h.start[1],10),255),0),Math.max(Math.min(parseInt((h.pos*(h.end[2]-h.start[2]))+h.start[2],10),255),0)].join(",")+")"}});function b(g){var f;if(g&&g.constructor==Array&&g.length==3){return g}if(f=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(g)){return[parseInt(f[1],10),parseInt(f[2],10),parseInt(f[3],10)]}if(f=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(g)){return[parseFloat(f[1])*2.55,parseFloat(f[2])*2.55,parseFloat(f[3])*2.55]}if(f=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(g)){return[parseInt(f[1],16),parseInt(f[2],16),parseInt(f[3],16)]}if(f=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(g)){return[parseInt(f[1]+f[1],16),parseInt(f[2]+f[2],16),parseInt(f[3]+f[3],16)]}if(f=/rgba\(0, 0, 0, 0\)/.exec(g)){return a.transparent}return a[d.trim(g).toLowerCase()]}function e(h,f){var g;do{g=d.curCSS(h,f);if(g!=""&&g!="transparent"||d.nodeName(h,"body")){break}f="backgroundColor"}while(h=h.parentNode);return b(g)}var a={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};d.easing.jswing=d.easing.swing;d.extend(d.easing,{def:"easeOutQuad",swing:function(g,h,f,j,i){return d.easing[d.easing.def](g,h,f,j,i)},easeInQuad:function(g,h,f,j,i){return j*(h/=i)*h+f},easeOutQuad:function(g,h,f,j,i){return -j*(h/=i)*(h-2)+f},easeInOutQuad:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h+f}return -j/2*((--h)*(h-2)-1)+f},easeInCubic:function(g,h,f,j,i){return j*(h/=i)*h*h+f},easeOutCubic:function(g,h,f,j,i){return j*((h=h/i-1)*h*h+1)+f},easeInOutCubic:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h+f}return j/2*((h-=2)*h*h+2)+f},easeInQuart:function(g,h,f,j,i){return j*(h/=i)*h*h*h+f},easeOutQuart:function(g,h,f,j,i){return -j*((h=h/i-1)*h*h*h-1)+f},easeInOutQuart:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h+f}return -j/2*((h-=2)*h*h*h-2)+f},easeInQuint:function(g,h,f,j,i){return j*(h/=i)*h*h*h*h+f},easeOutQuint:function(g,h,f,j,i){return j*((h=h/i-1)*h*h*h*h+1)+f},easeInOutQuint:function(g,h,f,j,i){if((h/=i/2)<1){return j/2*h*h*h*h*h+f}return j/2*((h-=2)*h*h*h*h+2)+f},easeInSine:function(g,h,f,j,i){return -j*Math.cos(h/i*(Math.PI/2))+j+f},easeOutSine:function(g,h,f,j,i){return j*Math.sin(h/i*(Math.PI/2))+f},easeInOutSine:function(g,h,f,j,i){return -j/2*(Math.cos(Math.PI*h/i)-1)+f},easeInExpo:function(g,h,f,j,i){return(h==0)?f:j*Math.pow(2,10*(h/i-1))+f},easeOutExpo:function(g,h,f,j,i){return(h==i)?f+j:j*(-Math.pow(2,-10*h/i)+1)+f},easeInOutExpo:function(g,h,f,j,i){if(h==0){return f}if(h==i){return f+j}if((h/=i/2)<1){return j/2*Math.pow(2,10*(h-1))+f}return j/2*(-Math.pow(2,-10*--h)+2)+f},easeInCirc:function(g,h,f,j,i){return -j*(Math.sqrt(1-(h/=i)*h)-1)+f},easeOutCirc:function(g,h,f,j,i){return j*Math.sqrt(1-(h=h/i-1)*h)+f},easeInOutCirc:function(g,h,f,j,i){if((h/=i/2)<1){return -j/2*(Math.sqrt(1-h*h)-1)+f}return j/2*(Math.sqrt(1-(h-=2)*h)+1)+f},easeInElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return -(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f},easeOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l)==1){return f+m}if(!k){k=l*0.3}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}return h*Math.pow(2,-10*i)*Math.sin((i*l-j)*(2*Math.PI)/k)+m+f},easeInOutElastic:function(g,i,f,m,l){var j=1.70158;var k=0;var h=m;if(i==0){return f}if((i/=l/2)==2){return f+m}if(!k){k=l*(0.3*1.5)}if(h<Math.abs(m)){h=m;var j=k/4}else{var j=k/(2*Math.PI)*Math.asin(m/h)}if(i<1){return -0.5*(h*Math.pow(2,10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k))+f}return h*Math.pow(2,-10*(i-=1))*Math.sin((i*l-j)*(2*Math.PI)/k)*0.5+m+f},easeInBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*(h/=j)*h*((i+1)*h-i)+f},easeOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}return k*((h=h/j-1)*h*((i+1)*h+i)+1)+f},easeInOutBack:function(g,h,f,k,j,i){if(i==undefined){i=1.70158}if((h/=j/2)<1){return k/2*(h*h*(((i*=(1.525))+1)*h-i))+f}return k/2*((h-=2)*h*(((i*=(1.525))+1)*h+i)+2)+f},easeInBounce:function(g,h,f,j,i){return j-d.easing.easeOutBounce(g,i-h,0,j,i)+f},easeOutBounce:function(g,h,f,j,i){if((h/=i)<(1/2.75)){return j*(7.5625*h*h)+f}else{if(h<(2/2.75)){return j*(7.5625*(h-=(1.5/2.75))*h+0.75)+f}else{if(h<(2.5/2.75)){return j*(7.5625*(h-=(2.25/2.75))*h+0.9375)+f}else{return j*(7.5625*(h-=(2.625/2.75))*h+0.984375)+f}}}},easeInOutBounce:function(g,h,f,j,i){if(h<i/2){return d.easing.easeInBounce(g,h*2,0,j,i)*0.5+f}return d.easing.easeOutBounce(g,h*2-i,0,j,i)*0.5+j*0.5+f}})})(jQuery);;/* - * jQuery UI Effects Blind 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Blind - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.blind=function(b){return this.queue(function(){var d=a(this),c=["position","top","left"];var h=a.effects.setMode(d,b.options.mode||"hide");var g=b.options.direction||"vertical";a.effects.save(d,c);d.show();var j=a.effects.createWrapper(d).css({overflow:"hidden"});var e=(g=="vertical")?"height":"width";var i=(g=="vertical")?j.height():j.width();if(h=="show"){j.css(e,0)}var f={};f[e]=h=="show"?i:0;j.animate(f,b.duration,b.options.easing,function(){if(h=="hide"){d.hide()}a.effects.restore(d,c);a.effects.removeWrapper(d);if(b.callback){b.callback.apply(d[0],arguments)}d.dequeue()})})}})(jQuery);;/* - * jQuery UI Effects Bounce 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Bounce - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.bounce=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"up";var c=b.options.distance||20;var d=b.options.times||5;var g=b.duration||250;if(/show|hide/.test(k)){l.push("opacity")}a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var c=b.options.distance||(f=="top"?e.outerHeight({margin:true})/3:e.outerWidth({margin:true})/3);if(k=="show"){e.css("opacity",0).css(f,p=="pos"?-c:c)}if(k=="hide"){c=c/(d*2)}if(k!="hide"){d--}if(k=="show"){var h={opacity:1};h[f]=(p=="pos"?"+=":"-=")+c;e.animate(h,g/2,b.options.easing);c=c/2;d--}for(var j=0;j<d;j++){var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing);c=(k=="hide")?c*2:c/2}if(k=="hide"){var h={opacity:0};h[f]=(p=="pos"?"-=":"+=")+c;e.animate(h,g/2,b.options.easing,function(){e.hide();a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}else{var o={},m={};o[f]=(p=="pos"?"-=":"+=")+c;m[f]=(p=="pos"?"+=":"-=")+c;e.animate(o,g/2,b.options.easing).animate(m,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}})}e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Clip 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Clip - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.clip=function(b){return this.queue(function(){var f=a(this),j=["position","top","left","height","width"];var i=a.effects.setMode(f,b.options.mode||"hide");var k=b.options.direction||"vertical";a.effects.save(f,j);f.show();var c=a.effects.createWrapper(f).css({overflow:"hidden"});var e=f[0].tagName=="IMG"?c:f;var g={size:(k=="vertical")?"height":"width",position:(k=="vertical")?"top":"left"};var d=(k=="vertical")?e.height():e.width();if(i=="show"){e.css(g.size,0);e.css(g.position,d/2)}var h={};h[g.size]=i=="show"?d:0;h[g.position]=i=="show"?0:d/2;e.animate(h,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){f.hide()}a.effects.restore(f,j);a.effects.removeWrapper(f);if(b.callback){b.callback.apply(f[0],arguments)}f.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Drop 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Drop - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.drop=function(b){return this.queue(function(){var e=a(this),d=["position","top","left","opacity"];var i=a.effects.setMode(e,b.options.mode||"hide");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e);var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true})/2:e.outerWidth({margin:true})/2);if(i=="show"){e.css("opacity",0).css(f,c=="pos"?-j:j)}var g={opacity:i=="show"?1:0};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Explode 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Explode - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.explode=function(b){return this.queue(function(){var k=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;var e=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?(a(this).is(":visible")?"hide":"show"):b.options.mode;var h=a(this).show().css("visibility","hidden");var l=h.offset();l.top-=parseInt(h.css("marginTop"),10)||0;l.left-=parseInt(h.css("marginLeft"),10)||0;var g=h.outerWidth(true);var c=h.outerHeight(true);for(var f=0;f<k;f++){for(var d=0;d<e;d++){h.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-d*(g/e),top:-f*(c/k)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/e,height:c/k,left:l.left+d*(g/e)+(b.options.mode=="show"?(d-Math.floor(e/2))*(g/e):0),top:l.top+f*(c/k)+(b.options.mode=="show"?(f-Math.floor(k/2))*(c/k):0),opacity:b.options.mode=="show"?0:1}).animate({left:l.left+d*(g/e)+(b.options.mode=="show"?0:(d-Math.floor(e/2))*(g/e)),top:l.top+f*(c/k)+(b.options.mode=="show"?0:(f-Math.floor(k/2))*(c/k)),opacity:b.options.mode=="show"?1:0},b.duration||500)}}setTimeout(function(){b.options.mode=="show"?h.css({visibility:"visible"}):h.css({visibility:"visible"}).hide();if(b.callback){b.callback.apply(h[0])}h.dequeue();a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/* - * jQuery UI Effects Fold 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Fold - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.fold=function(b){return this.queue(function(){var e=a(this),k=["position","top","left"];var h=a.effects.setMode(e,b.options.mode||"hide");var o=b.options.size||15;var n=!(!b.options.horizFirst);var g=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(e,k);e.show();var d=a.effects.createWrapper(e).css({overflow:"hidden"});var i=((h=="show")!=n);var f=i?["width","height"]:["height","width"];var c=i?[d.width(),d.height()]:[d.height(),d.width()];var j=/([0-9]+)%/.exec(o);if(j){o=parseInt(j[1],10)/100*c[h=="hide"?0:1]}if(h=="show"){d.css(n?{height:0,width:o}:{height:o,width:0})}var m={},l={};m[f[0]]=h=="show"?c[0]:o;l[f[1]]=h=="show"?c[1]:0;d.animate(m,g,b.options.easing).animate(l,g,b.options.easing,function(){if(h=="hide"){e.hide()}a.effects.restore(e,k);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(e[0],arguments)}e.dequeue()})})}})(jQuery);;/* - * jQuery UI Effects Highlight 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Highlight - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.highlight=function(b){return this.queue(function(){var e=a(this),d=["backgroundImage","backgroundColor","opacity"];var h=a.effects.setMode(e,b.options.mode||"show");var c=b.options.color||"#ffff99";var g=e.css("backgroundColor");a.effects.save(e,d);e.show();e.css({backgroundImage:"none",backgroundColor:c});var f={backgroundColor:g};if(h=="hide"){f.opacity=0}e.animate(f,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(h=="hide"){e.hide()}a.effects.restore(e,d);if(h=="show"&&a.browser.msie){this.style.removeAttribute("filter")}if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Pulsate 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Pulsate - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.pulsate=function(b){return this.queue(function(){var d=a(this);var g=a.effects.setMode(d,b.options.mode||"show");var f=b.options.times||5;var e=b.duration?b.duration/2:a.fx.speeds._default/2;if(g=="hide"){f--}if(d.is(":hidden")){d.css("opacity",0);d.show();d.animate({opacity:1},e,b.options.easing);f=f-2}for(var c=0;c<f;c++){d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing)}if(g=="hide"){d.animate({opacity:0},e,b.options.easing,function(){d.hide();if(b.callback){b.callback.apply(this,arguments)}})}else{d.animate({opacity:0},e,b.options.easing).animate({opacity:1},e,b.options.easing,function(){if(b.callback){b.callback.apply(this,arguments)}})}d.queue("fx",function(){d.dequeue()});d.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Scale 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Scale - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),width:f.width()};var d=g/100;f.from=(h=="hide")?e:{height:e.height*d,width:e.width*d};c.from=f.from;c.percent=(h=="hide")?g:100;c.mode=h;f.effect("scale",c,b.duration,b.callback);f.dequeue()})};a.effects.scale=function(b){return this.queue(function(){var g=a(this);var d=a.extend(true,{},b.options);var j=a.effects.setMode(g,b.options.mode||"effect");var h=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:(j=="hide"?0:100));var i=b.options.direction||"both";var c=b.options.origin;if(j!="effect"){d.origin=c||["middle","center"];d.restore=true}var f={height:g.height(),width:g.width()};g.from=b.options.from||(j=="show"?{height:0,width:0}:f);var e={y:i!="horizontal"?(h/100):1,x:i!="vertical"?(h/100):1};g.to={height:f.height*e.y,width:f.width*e.x};if(b.options.fade){if(j=="show"){g.from.opacity=0;g.to.opacity=1}if(j=="hide"){g.from.opacity=1;g.to.opacity=0}}d.from=g.from;d.to=g.to;d.mode=j;g.effect("size",d,b.duration,b.callback);g.dequeue()})};a.effects.size=function(b){return this.queue(function(){var c=a(this),n=["position","top","left","width","height","overflow","opacity"];var m=["position","top","left","overflow","opacity"];var j=["width","height","overflow"];var p=["fontSize"];var k=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"];var f=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"];var g=a.effects.setMode(c,b.options.mode||"effect");var i=b.options.restore||false;var e=b.options.scale||"both";var o=b.options.origin;var d={height:c.height(),width:c.width()};c.from=b.options.from||d;c.to=b.options.to||d;if(o){var h=a.effects.getBaseline(o,d);c.from.top=(d.height-c.from.height)*h.y;c.from.left=(d.width-c.from.width)*h.x;c.to.top=(d.height-c.to.height)*h.y;c.to.left=(d.width-c.to.width)*h.x}var l={from:{y:c.from.height/d.height,x:c.from.width/d.width},to:{y:c.to.height/d.height,x:c.to.width/d.width}};if(e=="box"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(k);c.from=a.effects.setTransition(c,k,l.from.y,c.from);c.to=a.effects.setTransition(c,k,l.to.y,c.to)}if(l.from.x!=l.to.x){n=n.concat(f);c.from=a.effects.setTransition(c,f,l.from.x,c.from);c.to=a.effects.setTransition(c,f,l.to.x,c.to)}}if(e=="content"||e=="both"){if(l.from.y!=l.to.y){n=n.concat(p);c.from=a.effects.setTransition(c,p,l.from.y,c.from);c.to=a.effects.setTransition(c,p,l.to.y,c.to)}}a.effects.save(c,i?n:m);c.show();a.effects.createWrapper(c);c.css("overflow","hidden").css(c.from);if(e=="content"||e=="both"){k=k.concat(["marginTop","marginBottom"]).concat(p);f=f.concat(["marginLeft","marginRight"]);j=n.concat(k).concat(f);c.find("*[width]").each(function(){child=a(this);if(i){a.effects.save(child,j)}var q={height:child.height(),width:child.width()};child.from={height:q.height*l.from.y,width:q.width*l.from.x};child.to={height:q.height*l.to.y,width:q.width*l.to.x};if(l.from.y!=l.to.y){child.from=a.effects.setTransition(child,k,l.from.y,child.from);child.to=a.effects.setTransition(child,k,l.to.y,child.to)}if(l.from.x!=l.to.x){child.from=a.effects.setTransition(child,f,l.from.x,child.from);child.to=a.effects.setTransition(child,f,l.to.x,child.to)}child.css(child.from);child.animate(child.to,b.duration,b.options.easing,function(){if(i){a.effects.restore(child,j)}})})}c.animate(c.to,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(g=="hide"){c.hide()}a.effects.restore(c,i?n:m);a.effects.removeWrapper(c);if(b.callback){b.callback.apply(this,arguments)}c.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Shake 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Shake - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.shake=function(b){return this.queue(function(){var e=a(this),l=["position","top","left"];var k=a.effects.setMode(e,b.options.mode||"effect");var n=b.options.direction||"left";var c=b.options.distance||20;var d=b.options.times||3;var g=b.duration||b.options.duration||140;a.effects.save(e,l);e.show();a.effects.createWrapper(e);var f=(n=="up"||n=="down")?"top":"left";var p=(n=="up"||n=="left")?"pos":"neg";var h={},o={},m={};h[f]=(p=="pos"?"-=":"+=")+c;o[f]=(p=="pos"?"+=":"-=")+c*2;m[f]=(p=="pos"?"-=":"+=")+c*2;e.animate(h,g,b.options.easing);for(var j=1;j<d;j++){e.animate(o,g,b.options.easing).animate(m,g,b.options.easing)}e.animate(o,g,b.options.easing).animate(h,g/2,b.options.easing,function(){a.effects.restore(e,l);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}});e.queue("fx",function(){e.dequeue()});e.dequeue()})}})(jQuery);;/* - * jQuery UI Effects Slide 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Slide - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.slide=function(b){return this.queue(function(){var e=a(this),d=["position","top","left"];var i=a.effects.setMode(e,b.options.mode||"show");var h=b.options.direction||"left";a.effects.save(e,d);e.show();a.effects.createWrapper(e).css({overflow:"hidden"});var f=(h=="up"||h=="down")?"top":"left";var c=(h=="up"||h=="left")?"pos":"neg";var j=b.options.distance||(f=="top"?e.outerHeight({margin:true}):e.outerWidth({margin:true}));if(i=="show"){e.css(f,c=="pos"?-j:j)}var g={};g[f]=(i=="show"?(c=="pos"?"+=":"-="):(c=="pos"?"-=":"+="))+j;e.animate(g,{queue:false,duration:b.duration,easing:b.options.easing,complete:function(){if(i=="hide"){e.hide()}a.effects.restore(e,d);a.effects.removeWrapper(e);if(b.callback){b.callback.apply(this,arguments)}e.dequeue()}})})}})(jQuery);;/* - * jQuery UI Effects Transfer 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Effects/Transfer - * - * Depends: - * effects.core.js - */ -(function(a){a.effects.transfer=function(b){return this.queue(function(){var f=a(this),h=a(b.options.to),e=h.offset(),g={top:e.top,left:e.left,height:h.innerHeight(),width:h.innerWidth()},d=f.offset(),c=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:d.top,left:d.left,height:f.innerHeight(),width:f.innerWidth(),position:"absolute"}).animate(g,b.duration,b.options.easing,function(){c.remove();(b.callback&&b.callback.apply(f[0],arguments));f.dequeue()})})}})(jQuery);; \ No newline at end of file diff --git a/module/web/media/default/js/jquery.form.js b/module/web/media/default/js/jquery.form.js deleted file mode 100644 index dde394270..000000000 --- a/module/web/media/default/js/jquery.form.js +++ /dev/null @@ -1,660 +0,0 @@ -/* - * jQuery Form Plugin - * version: 2.36 (07-NOV-2009) - * @requires jQuery v1.2.6 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function() { - $(this).ajaxSubmit({ - target: '#output' - }); - return false; // <-- important! - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') - options = { success: options }; - - var url = $.trim(this.attr('action')); - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - url = url || window.location.href || ''; - - options = $.extend({ - url: url, - type: this.attr('method') || 'GET', - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options || {}); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (var n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) - a.push( { name: n, value: options.data[n][k] } ); - } - else - a.push( { name: n, value: options.data[n] } ); - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else - options.data = q; // data is the query string for 'post' - - var $form = this, callbacks = []; - if (options.resetForm) callbacks.push(function() { $form.resetForm(); }); - if (options.clearForm) callbacks.push(function() { $form.clearForm(); }); - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - $(options.target).html(data).each(oldSuccess, arguments); - }); - } - else if (options.success) - callbacks.push(options.success); - - options.success = function(data, status) { - for (var i=0, max=callbacks.length; i < max; i++) - callbacks[i].apply(options, [data, status, $form]); - }; - - // are there files to upload? - var files = $('input:file', this).fieldValue(); - var found = false; - for (var j=0; j < files.length; j++) - if (files[j]) - found = true; - - var multipart = false; -// var mp = 'multipart/form-data'; -// multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if ((files.length && options.iframe !== false) || options.iframe || found || multipart) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) - $.get(options.closeKeepAlive, fileUpload); - else - fileUpload(); - } - else - $.ajax(options); - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[name=submit]', form).length) { - alert('Error: Form elements must not be named "submit".'); - return; - } - - var opts = $.extend({}, $.ajaxSettings, options); - var s = $.extend(true, {}, $.extend(true, {}, $.ajaxSettings), opts); - - var id = 'jqFormIO' + (new Date().getTime()); - var $io = $('<iframe id="' + id + '" name="' + id + '" src="'+ opts.iframeSrc +'" />'); - var io = $io[0]; - - $io.css({ position: 'absolute', top: '-1000px', left: '-1000px' }); - - var xhr = { // mock object - aborted: 0, - responseText: null, - responseXML: null, - status: 0, - statusText: 'n/a', - getAllResponseHeaders: function() {}, - getResponseHeader: function() {}, - setRequestHeader: function() {}, - abort: function() { - this.aborted = 1; - $io.attr('src', opts.iframeSrc); // abort op in progress - } - }; - - var g = opts.global; - // trigger ajax global events so that activity/block indicators work like normal - if (g && ! $.active++) $.event.trigger("ajaxStart"); - if (g) $.event.trigger("ajaxSend", [xhr, opts]); - - if (s.beforeSend && s.beforeSend(xhr, s) === false) { - s.global && $.active--; - return; - } - if (xhr.aborted) - return; - - var cbInvoked = 0; - var timedOut = 0; - - // add submitting element to data if we know it - var sub = form.clk; - if (sub) { - var n = sub.name; - if (n && !sub.disabled) { - options.extraData = options.extraData || {}; - options.extraData[n] = sub.value; - if (sub.type == "image") { - options.extraData[name+'.x'] = form.clk_x; - options.extraData[name+'.y'] = form.clk_y; - } - } - } - - // take a breath so that pending repaints get some cpu time before the upload starts - setTimeout(function() { - // make sure form attrs are set - var t = $form.attr('target'), a = $form.attr('action'); - - // update form attrs in IE friendly way - form.setAttribute('target',id); - if (form.getAttribute('method') != 'POST') - form.setAttribute('method', 'POST'); - if (form.getAttribute('action') != opts.url) - form.setAttribute('action', opts.url); - - // ie borks in some cases when setting encoding - if (! options.skipEncodingOverride) { - $form.attr({ - encoding: 'multipart/form-data', - enctype: 'multipart/form-data' - }); - } - - // support timout - if (opts.timeout) - setTimeout(function() { timedOut = true; cb(); }, opts.timeout); - - // add "extra" data to form if provided in options - var extraInputs = []; - try { - if (options.extraData) - for (var n in options.extraData) - extraInputs.push( - $('<input type="hidden" name="'+n+'" value="'+options.extraData[n]+'" />') - .appendTo(form)[0]); - - // add iframe to doc and submit the form - $io.appendTo('body'); - io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false); - form.submit(); - } - finally { - // reset attrs and remove "extra" input elements - form.setAttribute('action',a); - t ? form.setAttribute('target', t) : $form.removeAttr('target'); - $(extraInputs).remove(); - } - }, 10); - - var domCheckCount = 50; - - function cb() { - if (cbInvoked++) return; - - io.detachEvent ? io.detachEvent('onload', cb) : io.removeEventListener('load', cb, false); - - var ok = true; - try { - if (timedOut) throw 'timeout'; - // extract the server response from the iframe - var data, doc; - - doc = io.contentWindow ? io.contentWindow.document : io.contentDocument ? io.contentDocument : io.document; - - var isXml = opts.dataType == 'xml' || doc.XMLDocument || $.isXMLDoc(doc); - log('isXml='+isXml); - if (!isXml && (doc.body == null || doc.body.innerHTML == '')) { - if (--domCheckCount) { - // in some browsers (Opera) the iframe DOM is not always traversable when - // the onload callback fires, so we loop a bit to accommodate - cbInvoked = 0; - setTimeout(cb, 100); - return; - } - log('Could not access iframe DOM after 50 tries.'); - return; - } - - xhr.responseText = doc.body ? doc.body.innerHTML : null; - xhr.responseXML = doc.XMLDocument ? doc.XMLDocument : doc; - xhr.getResponseHeader = function(header){ - var headers = {'content-type': opts.dataType}; - return headers[header]; - }; - - if (opts.dataType == 'json' || opts.dataType == 'script') { - // see if user embedded response in textarea - var ta = doc.getElementsByTagName('textarea')[0]; - if (ta) - xhr.responseText = ta.value; - else { - // account for browsers injecting pre around json response - var pre = doc.getElementsByTagName('pre')[0]; - if (pre) - xhr.responseText = pre.innerHTML; - } - } - else if (opts.dataType == 'xml' && !xhr.responseXML && xhr.responseText != null) { - xhr.responseXML = toXml(xhr.responseText); - } - data = $.httpData(xhr, opts.dataType); - } - catch(e){ - ok = false; - $.handleError(opts, xhr, 'error', e); - } - - // ordering of these callbacks/triggers is odd, but that's how $.ajax does it - if (ok) { - opts.success(data, 'success'); - if (g) $.event.trigger("ajaxSuccess", [xhr, opts]); - } - if (g) $.event.trigger("ajaxComplete", [xhr, opts]); - if (g && ! --$.active) $.event.trigger("ajaxStop"); - if (opts.complete) opts.complete(xhr, ok ? 'success' : 'error'); - - // clean up - setTimeout(function() { - $io.remove(); - xhr.responseXML = null; - }, 100); - }; - - function toXml(s, doc) { - if (window.ActiveXObject) { - doc = new ActiveXObject('Microsoft.XMLDOM'); - doc.async = 'false'; - doc.loadXML(s); - } - else - doc = (new DOMParser()).parseFromString(s, 'text/xml'); - return (doc && doc.documentElement && doc.documentElement.tagName != 'parsererror') ? doc : null; - }; - }; -}; - -/** - * ajaxForm() provides a mechanism for fully automating form submission. - * - * The advantages of using this method instead of ajaxSubmit() are: - * - * 1: This method will include coordinates for <input type="image" /> elements (if the element - * is used to submit the form). - * 2. This method will include the submit element's name/value data (for the element that was - * used to submit the form). - * 3. This method binds the submit() method to the form for you. - * - * The options argument for ajaxForm works exactly as it does for ajaxSubmit. ajaxForm merely - * passes the options argument along after properly binding events for submit elements and - * the form itself. - */ -$.fn.ajaxForm = function(options) { - return this.ajaxFormUnbind().bind('submit.form-plugin', function() { - $(this).ajaxSubmit(options); - return false; - }).bind('click.form-plugin', function(e) { - var target = e.target; - var $el = $(target); - if (!($el.is(":submit,input:image"))) { - // is this a child element of the submit el? (ex: a span within a button) - var t = $el.closest(':submit'); - if (t.length == 0) - return; - target = t[0]; - } - var form = this; - form.clk = target; - if (target.type == 'image') { - if (e.offsetX != undefined) { - form.clk_x = e.offsetX; - form.clk_y = e.offsetY; - } else if (typeof $.fn.offset == 'function') { // try to use dimensions plugin - var offset = $el.offset(); - form.clk_x = e.pageX - offset.left; - form.clk_y = e.pageY - offset.top; - } else { - form.clk_x = e.pageX - target.offsetLeft; - form.clk_y = e.pageY - target.offsetTop; - } - } - // clear form vars - setTimeout(function() { form.clk = form.clk_x = form.clk_y = null; }, 100); - }); -}; - -// ajaxFormUnbind unbinds the event handlers that were bound by ajaxForm -$.fn.ajaxFormUnbind = function() { - return this.unbind('submit.form-plugin click.form-plugin'); -}; - -/** - * formToArray() gathers form element data into an array of objects that can - * be passed to any of the following ajax functions: $.get, $.post, or load. - * Each object in the array has both a 'name' and 'value' property. An example of - * an array for a simple login form might be: - * - * [ { name: 'username', value: 'jresig' }, { name: 'password', value: 'secret' } ] - * - * It is this array that is passed to pre-submit callback functions provided to the - * ajaxSubmit() and ajaxForm() methods. - */ -$.fn.formToArray = function(semantic) { - var a = []; - if (this.length == 0) return a; - - var form = this[0]; - var els = semantic ? form.getElementsByTagName('*') : form.elements; - if (!els) return a; - for(var i=0, max=els.length; i < max; i++) { - var el = els[i]; - var n = el.name; - if (!n) continue; - - if (semantic && form.clk && el.type == "image") { - // handle image inputs on the fly when semantic == true - if(!el.disabled && form.clk == el) { - a.push({name: n, value: $(el).val()}); - a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); - } - continue; - } - - var v = $.fieldValue(el, true); - if (v && v.constructor == Array) { - for(var j=0, jmax=v.length; j < jmax; j++) - a.push({name: n, value: v[j]}); - } - else if (v !== null && typeof v != 'undefined') - a.push({name: n, value: v}); - } - - if (!semantic && form.clk) { - // input type=='image' are not found in elements array! handle it here - var $input = $(form.clk), input = $input[0], n = input.name; - if (n && !input.disabled && input.type == 'image') { - a.push({name: n, value: $input.val()}); - a.push({name: n+'.x', value: form.clk_x}, {name: n+'.y', value: form.clk_y}); - } - } - return a; -}; - -/** - * Serializes form data into a 'submittable' string. This method will return a string - * in the format: name1=value1&name2=value2 - */ -$.fn.formSerialize = function(semantic) { - //hand off to jQuery.param for proper encoding - return $.param(this.formToArray(semantic)); -}; - -/** - * Serializes all field elements in the jQuery object into a query string. - * This method will return a string in the format: name1=value1&name2=value2 - */ -$.fn.fieldSerialize = function(successful) { - var a = []; - this.each(function() { - var n = this.name; - if (!n) return; - var v = $.fieldValue(this, successful); - if (v && v.constructor == Array) { - for (var i=0,max=v.length; i < max; i++) - a.push({name: n, value: v[i]}); - } - else if (v !== null && typeof v != 'undefined') - a.push({name: this.name, value: v}); - }); - //hand off to jQuery.param for proper encoding - return $.param(a); -}; - -/** - * Returns the value(s) of the element in the matched set. For example, consider the following form: - * - * <form><fieldset> - * <input name="A" type="text" /> - * <input name="A" type="text" /> - * <input name="B" type="checkbox" value="B1" /> - * <input name="B" type="checkbox" value="B2"/> - * <input name="C" type="radio" value="C1" /> - * <input name="C" type="radio" value="C2" /> - * </fieldset></form> - * - * var v = $(':text').fieldValue(); - * // if no values are entered into the text inputs - * v == ['',''] - * // if values entered into the text inputs are 'foo' and 'bar' - * v == ['foo','bar'] - * - * var v = $(':checkbox').fieldValue(); - * // if neither checkbox is checked - * v === undefined - * // if both checkboxes are checked - * v == ['B1', 'B2'] - * - * var v = $(':radio').fieldValue(); - * // if neither radio is checked - * v === undefined - * // if first radio is checked - * v == ['C1'] - * - * The successful argument controls whether or not the field element must be 'successful' - * (per http://www.w3.org/TR/html4/interact/forms.html#successful-controls). - * The default value of the successful argument is true. If this value is false the value(s) - * for each element is returned. - * - * Note: This method *always* returns an array. If no valid value can be determined the - * array will be empty, otherwise it will contain one or more values. - */ -$.fn.fieldValue = function(successful) { - for (var val=[], i=0, max=this.length; i < max; i++) { - var el = this[i]; - var v = $.fieldValue(el, successful); - if (v === null || typeof v == 'undefined' || (v.constructor == Array && !v.length)) - continue; - v.constructor == Array ? $.merge(val, v) : val.push(v); - } - return val; -}; - -/** - * Returns the value of the field element. - */ -$.fieldValue = function(el, successful) { - var n = el.name, t = el.type, tag = el.tagName.toLowerCase(); - if (typeof successful == 'undefined') successful = true; - - if (successful && (!n || el.disabled || t == 'reset' || t == 'button' || - (t == 'checkbox' || t == 'radio') && !el.checked || - (t == 'submit' || t == 'image') && el.form && el.form.clk != el || - tag == 'select' && el.selectedIndex == -1)) - return null; - - if (tag == 'select') { - var index = el.selectedIndex; - if (index < 0) return null; - var a = [], ops = el.options; - var one = (t == 'select-one'); - var max = (one ? index+1 : ops.length); - for(var i=(one ? index : 0); i < max; i++) { - var op = ops[i]; - if (op.selected) { - var v = op.value; - if (!v) // extra pain for IE... - v = (op.attributes && op.attributes['value'] && !(op.attributes['value'].specified)) ? op.text : op.value; - if (one) return v; - a.push(v); - } - } - return a; - } - return el.value; -}; - -/** - * Clears the form data. Takes the following actions on the form's input fields: - * - input text fields will have their 'value' property set to the empty string - * - select elements will have their 'selectedIndex' property set to -1 - * - checkbox and radio inputs will have their 'checked' property set to false - * - inputs of type submit, button, reset, and hidden will *not* be effected - * - button elements will *not* be effected - */ -$.fn.clearForm = function() { - return this.each(function() { - $('input,select,textarea', this).clearFields(); - }); -}; - -/** - * Clears the selected form elements. - */ -$.fn.clearFields = $.fn.clearInputs = function() { - return this.each(function() { - var t = this.type, tag = this.tagName.toLowerCase(); - if (t == 'text' || t == 'password' || tag == 'textarea') - this.value = ''; - else if (t == 'checkbox' || t == 'radio') - this.checked = false; - else if (tag == 'select') - this.selectedIndex = -1; - }); -}; - -/** - * Resets the form data. Causes all form elements to be reset to their original value. - */ -$.fn.resetForm = function() { - return this.each(function() { - // guard against an input with the name of 'reset' - // note that IE reports the reset function as an 'object' - if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType)) - this.reset(); - }); -}; - -/** - * Enables or disables any matching elements. - */ -$.fn.enable = function(b) { - if (b == undefined) b = true; - return this.each(function() { - this.disabled = !b; - }); -}; - -/** - * Checks/unchecks any matching checkboxes or radio buttons and - * selects/deselects and matching option elements. - */ -$.fn.selected = function(select) { - if (select == undefined) select = true; - return this.each(function() { - var t = this.type; - if (t == 'checkbox' || t == 'radio') - this.checked = select; - else if (this.tagName.toLowerCase() == 'option') { - var $sel = $(this).parent('select'); - if (select && $sel[0] && $sel[0].type == 'select-one') { - // deselect all other options - $sel.find('option').selected(false); - } - this.selected = select; - } - }); -}; - -// helper fn for console logging -// set $.fn.ajaxSubmit.debug to true to enable debug logging -function log() { - if ($.fn.ajaxSubmit.debug && window.console && window.console.log) - window.console.log('[jquery.form] ' + Array.prototype.join.call(arguments,'')); -}; - -})(jQuery); diff --git a/module/web/media/default/js/jquery.progressbar.js b/module/web/media/default/js/jquery.progressbar.js deleted file mode 100644 index e240109b4..000000000 --- a/module/web/media/default/js/jquery.progressbar.js +++ /dev/null @@ -1,183 +0,0 @@ -/* - * jQuery Progress Bar plugin - * Version 2.0 (06/22/2009) - * @requires jQuery v1.2.1 or later - * - * Copyright (c) 2008 Gary Teo - * http://t.wits.sg - -USAGE: - $(".someclass").progressBar(); - $("#progressbar").progressBar(); - $("#progressbar").progressBar(45); // percentage - $("#progressbar").progressBar({showText: false }); // percentage with config - $("#progressbar").progressBar(45, {showText: false }); // percentage with config -*/ -(function($) { - $.extend({ - progressBar: new function() { - - this.defaults = { - steps : 20, // steps taken to reach target - step_duration : 20, - max : 100, // Upon 100% i'd assume, but configurable - showText : true, // show text with percentage in next to the progressbar? - default : true - textFormat : 'percentage', // Or otherwise, set to 'fraction' - width : 1000, // Width of the progressbar - don't forget to adjust your image too!!! // Image to use in the progressbar. Can be a single image too: 'images/progressbg_green.gif' - height : 12, // Height of the progressbar - don't forget to adjust your image too!!! - callback : null, // Calls back with the config object that has the current percentage, target percentage, current image, etc - boxImage : '/media/default/img/progressbar.gif', // boxImage : image around the progress bar - barImage : { - 0: '/media/default/img/progressbg_red.gif', - 30: '/media/default/img/progressbg_orange.gif', - 70: '/media/default/img/progressbg_green.gif' - }, - - - // Internal use - running_value : 0, - value : 0, - image : null - }; - - /* public methods */ - this.construct = function(arg1, arg2) { - var argvalue = null; - var argconfig = null; - - if (arg1 != null) { - if (!isNaN(arg1)) { - argvalue = arg1; - if (arg2 != null) { - argconfig = arg2; - } - } else { - argconfig = arg1; - } - } - - return this.each(function(child) { - var pb = this; - var config = this.config; - - if (argvalue != null && this.bar != null && this.config != null) { - this.config.value = argvalue - if (argconfig != null) - pb.config = $.extend(this.config, argconfig); - config = pb.config; - } else { - var $this = $(this); - var config = $.extend({}, $.progressBar.defaults, argconfig); - config.id = $this.attr('id') ? $this.attr('id') : Math.ceil(Math.random() * 100000); // random id, if none provided - - if (argvalue == null) - argvalue = $this.html().replace("%","") // parse percentage - - config.value = argvalue; - config.running_value = 0; - config.image = getBarImage(config); - - $this.html(""); - var bar = document.createElement('img'); - var text = document.createElement('span'); - var $bar = $(bar); - var $text = $(text); - pb.bar = $bar; - - $bar.attr('id', config.id + "_pbImage"); - $text.attr('id', config.id + "_pbText"); - $text.html(getText(config)); - $bar.attr('title', getText(config)); - $bar.attr('alt', getText(config)); - $bar.attr('src', config.boxImage); - $bar.attr('width', config.width); - $bar.css("width", config.width + "px"); - $bar.css("height", config.height + "px"); - $bar.css("background-image", "url(" + config.image + ")"); - $bar.css("background-position", ((config.width * -1)) + 'px 50%'); - $bar.css("padding", "0"); - $bar.css("margin", "0"); - $this.append($bar); - $this.append($text); - } - - function getPercentage(config) { - return config.running_value * 100 / config.max; - } - - function getBarImage(config) { - var image = config.barImage; - if (typeof(config.barImage) == 'object') { - for (var i in config.barImage) { - if (config.running_value >= parseInt(i)) { - image = config.barImage[i]; - } else { break; } - } - } - return image; - } - - function getText(config) { - if (config.showText) { - if (config.textFormat == 'percentage') { - return " " + Math.round(config.running_value) + "%"; - } else if (config.textFormat == 'fraction') { - return " " + config.running_value + '/' + config.max; - } - } - } - - config.increment = Math.round((config.value - config.running_value)/config.steps); - if (config.increment < 0) - config.increment *= -1; - if (config.increment < 1) - config.increment = 1; - - var t = setInterval(function() { - var pixels = config.width / 100; // Define how many pixels go into 1% - var stop = false; - - if (config.running_value > config.value) { - if (config.running_value - config.increment < config.value) { - config.running_value = config.value; - } else { - config.running_value -= config.increment; - } - } - else if (config.running_value < config.value) { - if (config.running_value + config.increment > config.value) { - config.running_value = config.value; - } else { - config.running_value += config.increment; - } - } - - if (config.running_value == config.value) - clearInterval(t); - - var $bar = $("#" + config.id + "_pbImage"); - var $text = $("#" + config.id + "_pbText"); - var image = getBarImage(config); - if (image != config.image) { - $bar.css("background-image", "url(" + image + ")"); - config.image = image; - } - $bar.css("background-position", (((config.width * -1)) + (getPercentage(config) * pixels)) + 'px 50%'); - $bar.attr('title', getText(config)); - $text.html(getText(config)); - - if (config.callback != null && typeof(config.callback) == 'function') - config.callback(config); - - pb.config = config; - }, config.step_duration); - }); - }; - } - }); - - $.fn.extend({ - progressBar: $.progressBar.construct - }); - -})(jQuery); \ No newline at end of file diff --git a/module/web/media/default/js/mootools-1.2.4-core.js b/module/web/media/default/js/mootools-1.2.4-core.js new file mode 100644 index 000000000..6ea6a530a --- /dev/null +++ b/module/web/media/default/js/mootools-1.2.4-core.js @@ -0,0 +1,337 @@ +//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License. + +var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect; +var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"}; +if(i&&f){d.prototype=i.prototype;}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e);}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o; +}if(h){Native.genericize(n,l,b);}g.call(n,l,o);return n;};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p); +}}for(var m in n){this.alias(m,n[m],l);}return this;};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o);}for(var n in m){j(this,n,m[n],l); +}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments); +return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b); +};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true}); +}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]}; +for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean()); +}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this); +}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++; +}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each"); +function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a]; +};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c); +((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c; +}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments); +a.unshift({});return $mixin.apply(null,a);}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue; +}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g);}}return e;}function $pick(){for(var b=0,a=arguments.length; +b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b); +return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a; +b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name; +}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"; +}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e]); +}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925)); +},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419); +},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true; +Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true; +break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP"); +},function(){return new ActiveXObject("Microsoft.XMLHTTP");});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description; +},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}; +})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript"); +a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1; +var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a); +if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}; +}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}}; +new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0]; +a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true); +});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null; +});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}}; +new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true; +},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined); +},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,e){var c=[]; +for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true; +}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={}; +for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1; +},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null; +},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this; +},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[]; +for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]); +}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")"; +},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16); +b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this; +b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c); +}var e=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(e,b.delay);}if(b.periodical){return setInterval(e,b.periodical);}if(b.attempt){return $try(e); +}return e();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a}); +},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})(); +},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})(); +}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0; +a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each"); +(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a); +})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this); +},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim(); +},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase()); +});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1"); +},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/); +return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a=""; +var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c); +}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:""; +});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null; +},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c); +},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null; +},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this); +return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this)); +},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false; +}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[]; +Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[]; +Hash.each(this,function(f,e){if(a){e=a+"["+e+"]";}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h; +});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f);}if(f!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"}); +var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; +var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode;}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111; +if(d>0&&d<13){m="f"+d;}}m=m||String.fromCharCode(b).toLowerCase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body; +var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY}; +if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement; +break;case"mouseout":l=a.relatedTarget||a.toElement;}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){l=false; +}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey}); +}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault(); +},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault(); +}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this; +}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this); +a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e); +}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]); +break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a; +},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.'); +}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d;}.extend({_owner:a,_origin:c,_name:b}); +}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e]);}return this;}var f=Class.Mutators[a];if(f){d=f.call(this,d); +if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a]; +if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a; +this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.'); +}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b); +},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false; +},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[]; +this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c); +if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b); +if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]); +}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]); +}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments)); +if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]); +delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a); +if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b; +if(Array[a]){return;}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f); +if(g){g=($type(f)=="element");}}return(g)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined}); +var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time()); +c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host;});if(!g||g==window.location.host){var h=new Window(c.contentWindow); +new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype);}e.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow; +});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b); +f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue;}g[d.uid]=true; +}if(d){e.push(d);}}f=e;}return(b.cash)?$extend(f,this):f;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a); +}:a,b));}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return;}a+=" "+c+'="'+b[c]+'"'; +if(c!="checked"){delete b[c];}});a="<"+a+">";}return document.id(this.createElement(a)).set(b);},newTextNode:function(a){return this.createTextNode(a); +},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null; +},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d];}}return b;},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d); +}return null;}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c;}var b=$type(c);return(a[b])?a[b](c,e,d||document):null; +};})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a); +}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true)); +}}return new Elements(f);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b); +},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f; +},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"}; +var c=function(l){return(f[l]||(f[l]={}));};var g=function(n,l){if(!n){return;}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false); +n.clearAttributes();if(q){n.mergeAttributes(q);}}else{if(n.removeEvents){n.removeEvents();}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty; +}}Element.dispose(n);}}if(!m){return;}h[m]=f[m]=null;};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g); +}if(window.CollectGarbage){CollectGarbage();}h=f=null;};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r); +}q.push(o);}o=o[l];}return(p)?new Elements(q,{ddup:false,cash:!r}):null;};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"}; +var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"]; +b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l); +}},after:function(m,l){if(!l.parentNode){return;}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m);},bottom:function(m,l){l.appendChild(m); +},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m);}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true)); +return this;});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this;});});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n]); +}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m);}return this;},get:function(m){var l=Element.Properties.get(m); +return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m);},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m); +return this;},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m);}if(l&&b[m]){n=!!n;}(l)?this[l]=n:this.setAttribute(m,""+n); +return this;},setProperties:function(l){for(var m in l){this.setProperty(m,l[m]);}return this;},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2); +return(b[m])?!!n:(l)?n:n||null;},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l);},removeProperty:function(m){var l=e[m]; +(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this; +},hasClass:function(l){return this.className.contains(l," ");},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean(); +}return this;},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this;},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l); +},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l);}},this);return this;},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l); +},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this;},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this;},replaces:function(l){l=document.id(l,true); +l.parentNode.replaceChild(this,l);return this;},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l);},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m); +},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m);},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m);},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m); +},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m);},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m); +},getParent:function(l,m){return j(this,"parentNode",null,l,false,m);},getParents:function(l,m){return j(this,"parentNode",null,l,true,m);},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this); +},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument; +},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null;}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null; +}}return document.id(m,n);},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected;}));},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]; +}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null;},toQueryString:function(){var l=[]; +this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return;}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value; +}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o)); +}});});return l.join("&");},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id");}if(Browser.Engine.trident){v.clearAttributes(); +v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected;}}}var x=i[u.tagName.toLowerCase()]; +if(x&&u[x]){v[x]=u[x];}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m]);}}n(r,this);return document.id(r); +},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null;},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l); +});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(l){l=document.id(l,true);if(!l){return false; +}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l);}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16); +},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l));}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this; +n=function(){m.removeListener("unload",n);l();};}else{h[this.uid]=this;}if(this.addEventListener){this.addEventListener(o,n,false);}else{this.attachEvent("on"+o,n); +}return this;},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false);}else{this.detachEvent("on"+m,l);}return this; +},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l;}return $pick(n);},store:function(m,l){var n=c(this.uid);n[m]=l; +return this;},eliminate:function(l){var m=c(this.uid);delete m[l];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a; +},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase(); +}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]}; +a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2]; +for(var d=f[0];d--;){g=g.firstChild;}this.empty().adopt(g.childNodes);}else{this.innerHTML=e;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText; +}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a); +}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this; +}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g);}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j); +}return true;};}f=a.base||f;}var d=function(){return g.call(i);};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow()); +if(c.call(i,j)===false){j.stop();}};}this.addListener(f,d);}h[e].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this; +}var f=a[c].keys.indexOf(b);if(f==-1){return this;}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b); +}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,e):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this; +},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this; +}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this; +},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); +},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b); +}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e);},this);}}return this;}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1}; +(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c)); +};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}}); +})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"; +}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"; +}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true); +},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"; +}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return"";}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e; +}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(g){switch(g){case"opacity":return this.get("opacity"); +case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat";}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue; +}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e));}return a.join(" ");}a=this.getComputedStyle(g);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/); +if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0; +b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt();},this);return this["offset"+g.capitalize()]-d+"px"; +}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]); +}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"}); +Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles; +var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px";});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color"; +f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i); +}else{this.scrollLeft=h;this.scrollTop=i;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight}; +},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll(); +}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode; +}return h;},getOffsetParent:function(){var h=this;if(b(h)){return null;}if(!Browser.Engine.trident){return h.offsetParent;}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h; +}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var j=this.getBoundingClientRect(),m=document.id(this.getDocument().documentElement),p=m.getScroll(),k=this.getScrolls(),i=this.getScroll(),h=(d(this,"position")=="fixed"); +return{x:j.left.toInt()+k.x-i.x+((h)?0:p.x)-m.clientLeft,y:j.top.toInt()+k.y-i.y+((h)?0:p.y)-m.clientTop};}var l=this,n={x:0,y:0};if(b(this)){return n; +}while(l&&!b(l)){n.x+=l.offsetLeft;n.y+=l.offsetTop;if(Browser.Engine.gecko){if(!f(l)){n.x+=c(l);n.y+=g(l);}var o=l.parentNode;if(o&&d(o,"overflow")!="visible"){n.x+=c(o); +n.y+=g(o);}}else{if(l!=this&&Browser.Engine.webkit){n.x+=c(l);n.y+=g(l);}}l=l.offsetParent;}if(Browser.Engine.gecko&&!f(this)){n.x-=c(this);n.y-=g(this); +}return n;},getPosition:function(k){if(b(this)){return{x:0,y:0};}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0}; +return{x:h.x-j.x,y:h.y-j.y};},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates();}var h=this.getPosition(j),i=this.getSize(); +var k={left:h.x,top:h.y,width:i.x,height:i.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k;},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}; +},setPosition:function(h){return this.setStyles(this.computePosition(h));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow(); +return{x:i.innerWidth,y:i.innerHeight};}var h=a(this);return{x:h.clientWidth,y:h.clientHeight};},getScroll:function(){var i=this.getWindow(),h=a(this); +return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop};},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}; +},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}; +}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0;}function f(h){return d(h,"-moz-box-sizing")=="border-box";}function g(h){return e(h,"border-top-width"); +}function c(h){return e(h,"border-left-width");}function b(h){return(/^(?:body|html)$/i).test(h.tagName);}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body; +}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x; +},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y; +},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x; +}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e); +if(d!=0&&f.item){f=$A(f);}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f);}return new Elements(c,{ddup:(h.length>1),cash:!g});}});Element.implement({match:function(b){if(!b||(b==this)){return true; +}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b); +return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)}; +Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]; +}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false;}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0; +if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;f="index";}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"}; +break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"}; +break;default:e={a:(d-1),special:"index"};}return Selectors.Cache.nth[h]=e;},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]; +}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i); +}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j});}else{h.attributes.push({name:c,operator:"=",value:j});}}else{if(g){h.attributes.push({name:g,operator:f,value:b}); +}}}}if(!h.classes.length){delete h.classes;}if(!h.attributes.length){delete h.attributes;}if(!h.pseudos.length){delete h.pseudos;}if(!h.classes&&!h.attributes&&!h.pseudos){h=null; +}return Selectors.Cache.parsed[e]=h;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]; +},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false;}}}if(c.attributes){for(d=c.attributes.length; +d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d]; +if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true); +return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j); +return":)"+i;}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y); +continue;}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r);}else{var d={},g=[];for(var x=0,w=p.length; +x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d);}p=g;}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A); +}}p=e;}}return p;}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f); +}}return h;},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b); +}}return h;},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}break;}}return c;},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b); +}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b)); +},byClass:function(b,a){return(b.className&&b.className.contains&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d); +if(!a){return(b=="!=");}if(!b||e==undefined){return true;}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e); +case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-");}return false; +}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a); +},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this; +while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false; +}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g); +if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e);}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this; +while((b=b.previousSibling)){if(b.nodeType!=1){continue;}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break;}}e.positions[d]=f;}return(e.positions[d]%c.a==c.b); +},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a); +},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false); +}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true; +window.fireEvent("domready");document.fireEvent("domready");};window.addEvent("load",b);if(Browser.Engine.trident){var a=document.createElement("div"); +(function(){($try(function(){a.doScroll();return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})(); +}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50); +})();}else{document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16); +},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]"; +case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b); +case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null; +}return eval("("+string+")");}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this);}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this; +this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"; +}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration); +this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a); +},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); +return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition(); +this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel(); +}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject); +}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer(); +return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false; +}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c; +};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; +b[0]=d.getStyle(e);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a); +return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return;}var d=f.parse(c);if($chk(d)){b={value:d,parser:f};}}); +b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser}); +});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b)); +});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href; +if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return;}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase(); +}):null;if(!h||!h.test("^"+a+"$")){return;}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return;}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k; +});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true); +}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a)); +});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}}); +Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b; +b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,e,d){if(!this.check(c,e,d)){return this; +}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to); +}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a)); +},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options"))); +}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var e=this.get("tween"),d="opacity",a; +c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1); +e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color")); +a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original")); +b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a); +},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(e,d,c){var a={}; +for(var b in e){a[b]=this.parent(e[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var e={},d={}; +for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to;}return this.parent(e,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph"); +if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a); +}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a); +return this;}});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request(); +this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return; +}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML}; +this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300)); +},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts); +},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain(); +},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b); +return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true; +}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(k){if(!this.check(k)){return this; +}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k};}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=String(k.url),a=k.method.toLowerCase(); +switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g);}if(this.options.format){var j="format="+this.options.format; +g=(g)?j+"&"+g:j;}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:""; +this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f; +}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e);}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null;}this.xhr.open(a.toUpperCase(),b,this.options.async); +this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m);}catch(n){this.fireEvent("exception",[l,m]); +}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this; +}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={}; +["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined}); +return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel(); +}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a); +}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send"); +b.send({data:this,url:a||b.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i); +c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d="<root>"+c+"</root>",g;if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM"); +g.async=false;g.loadXML(d);}else{g=new DOMParser().parseFromString(d,"text/xml");}d=g.getElementsByTagName("root")[0];if(!d){return null;}for(var f=0,e=d.childNodes.length; +f<e;f++){var h=Element.clone(d.childNodes[f],true,true);if(h){a.grab(h);}}return a;})||a.set("html",c);},success:function(d){var c=this.options,b=this.response; +b.html=d.stripScripts(function(e){b.javascript=e;});var a=this.processHTML(b.html);b.tree=a.childNodes;b.elements=a.getElements("*");if(c.filter){b.tree=b.elements.filter(c.filter); +}if(c.update){document.id(c.update).empty().set("html",b.html);}else{if(c.append){document.id(c.append).adopt(a.getChildren());}}if(c.evalScripts){$exec(b.javascript); +}this.onSuccess(b.tree,b.elements,b.html,b.javascript);}});Element.Properties.load={set:function(a){var b=this.retrieve("load");if(b){b.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},a)); +},get:function(a){if(a||!this.retrieve("load")){if(a||!this.retrieve("load:options")){this.set("load",a);}this.store("load",new Request.HTML(this.retrieve("load:options"))); +}return this.retrieve("load");}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this; +}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({Accept:"application/json","X-Request":"JSON"}); +},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a);}}); \ No newline at end of file diff --git a/module/web/media/default/js/mootools-1.2.4.2-more.js b/module/web/media/default/js/mootools-1.2.4.2-more.js new file mode 100644 index 000000000..eb04477df --- /dev/null +++ b/module/web/media/default/js/mootools-1.2.4.2-more.js @@ -0,0 +1,134 @@ +//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License. + +MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};Class.refactor=function(b,a){$each(a,function(e,d){var c=b.prototype[d]; +if(c&&(c=c._origin)&&typeof e=="function"){b.implement(d,function(){var f=this.previous;this.previous=c;var g=e.apply(this,arguments);this.previous=f;return g; +});}else{b.implement(d,e);}});return b;};Class.Mutators.Binds=function(a){return a;};Class.Mutators.initialize=function(a){return function(){$splat(this.Binds).each(function(b){var c=this[b]; +if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Class.Occlude=new Class({occlude:function(c,b){b=document.id(b||this.element);var a=b.retrieve(c||this.property); +if(a&&!$defined(this.occluded)){return this.occluded=a;}this.occluded=false;b.store(c||this.property,this);return this.occluded;}});String.implement({parseQueryString:function(){var b=this.split(/[&;]/),a={}; +if(b.length){b.each(function(g){var c=g.indexOf("="),d=c<0?[""]:g.substr(0,c).match(/[^\]\[]+/g),e=decodeURIComponent(g.substr(c+1)),f=a;d.each(function(j,h){var k=f[j]; +if(h<d.length-1){f=f[j]=k||{};}else{if($type(k)=="array"){k.push(e);}else{f[j]=$defined(k)?[k,e]:e;}}});});}return a;},cleanQueryString:function(a){return this.split("&").filter(function(e){var b=e.indexOf("="),c=b<0?"":e.substr(0,b),d=e.substr(b+1); +return a?a.run([c,d]):$chk(d);}).join("&");}});Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth);}; +if(g(this)){return e.apply(this);}var d=this.getParent(),f=[],b=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose(); +var a=e.apply(this);c();b.each(function(h){h();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText; +this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a); +var f={};var d=function(g,e){return(e.computeSize)?g.getComputedSize(e):g.getSize();};var b=this.getParent("body");if(b&&this.getStyle("display")=="none"){f=this.measure(function(){return d(this,a); +});}else{if(b){try{f=d(this,a);}catch(c){}}else{f={x:0,y:0};}}return $chk(f.x)?$extend(f,{width:f.x,height:f.y}):$extend(f,{x:f.width,y:f.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a); +var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height; +break;}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h);});});});var e={}; +b.each(function(f){e[f]=this.getComputedStyle(f);},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0; +b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k];}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k); +c["computed"+h]=c["computed"+h]-e[k];}});});});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return;}c[f]=c[f]+this["offset"+g]+c["computed"+g]; +c["total"+g]=c[f]+c["total"+g];delete c["computed"+g];},this);return $extend(e,c);}});(function(){var a=Element.prototype.position;Element.implement({position:function(h){if(h&&($defined(h.x)||$defined(h.y))){return a?a.apply(this,arguments):this; +}$each(h||{},function(w,u){if(!$defined(w)){delete h[u];}});h=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,ignoreScroll:false,allowNegative:false},h); +var s={x:0,y:0},f=false;var c=this.measure(function(){return document.id(this.getOffsetParent());});if(c&&c!=this.getDocument().body){s=c.measure(function(){return this.getPosition(); +});f=c!=document.id(h.relativeTo);h.offset.x=h.offset.x-s.x;h.offset.y=h.offset.y-s.y;}var t=function(u){if($type(u)!="string"){return u;}u=u.toLowerCase(); +var v={};if(u.test("left")){v.x="left";}else{if(u.test("right")){v.x="right";}else{v.x="center";}}if(u.test("upper")||u.test("top")){v.y="top";}else{if(u.test("bottom")){v.y="bottom"; +}else{v.y="center";}}return v;};h.edge=t(h.edge);h.position=t(h.position);if(!h.edge){if(h.position.x=="center"&&h.position.y=="center"){h.edge={x:"center",y:"center"}; +}else{h.edge={x:"left",y:"top"};}}this.setStyle("position","absolute");var g=document.id(h.relativeTo)||document.body,d=g==document.body?window.getScroll():g.getPosition(),n=d.y,i=d.x; +var e=g.getScrolls();n+=e.y;i+=e.x;var o=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});var k={},p=h.offset.y,r=h.offset.x,l=window.getSize(); +switch(h.position.x){case"left":k.x=i+r;break;case"right":k.x=i+r+g.offsetWidth;break;default:k.x=i+((g==document.body?l.x:g.offsetWidth)/2)+r;break;}switch(h.position.y){case"top":k.y=n+p; +break;case"bottom":k.y=n+p+g.offsetHeight;break;default:k.y=n+((g==document.body?l.y:g.offsetHeight)/2)+p;break;}if(h.edge){var b={};switch(h.edge.x){case"left":b.x=0; +break;case"right":b.x=-o.x-o.computedRight-o.computedLeft;break;default:b.x=-(o.totalWidth/2);break;}switch(h.edge.y){case"top":b.y=0;break;case"bottom":b.y=-o.y-o.computedTop-o.computedBottom; +break;default:b.y=-(o.totalHeight/2);break;}k.x+=b.x;k.y+=b.y;}k={left:((k.x>=0||f||h.allowNegative)?k.x:0).toInt(),top:((k.y>=0||f||h.allowNegative)?k.y:0).toInt()}; +var j={left:"x",top:"y"};["minimum","maximum"].each(function(u){["left","top"].each(function(v){var w=h[u]?h[u][j[v]]:null;if(w!=null&&k[v]<w){k[v]=w;}}); +});if(g.getStyle("position")=="fixed"||h.relFixedPosition){var m=window.getScroll();k.top+=m.y;k.left+=m.x;}if(h.ignoreScroll){var q=g.getScroll();k.top-=q.y; +k.left-=q.x;}if(h.ignoreMargins){k.left+=(h.edge.x=="right"?o["margin-right"]:h.edge.x=="center"?-o["margin-left"]+((o["margin-right"]+o["margin-left"])/2):-o["margin-left"]); +k.top+=(h.edge.y=="bottom"?o["margin-bottom"]:h.edge.y=="center"?-o["margin-top"]+((o["margin-bottom"]+o["margin-top"])/2):-o["margin-top"]);}k.left=Math.ceil(k.left); +k.top=Math.ceil(k.top);if(h.returnPos){return k;}else{this.setStyles(k);}return this;}});})();Element.implement({isDisplayed:function(){return this.getStyle("display")!="none"; +},isVisible:function(){var a=this.offsetWidth,b=this.offsetHeight;return(a==0&&b==0)?false:(a>0&&b>0)?true:this.isDisplayed();},toggle:function(){return this[this.isDisplayed()?"hide":"show"](); +},hide:function(){var b;try{if((b=this.getStyle("display"))=="none"){b=null;}}catch(a){}return this.store("originalDisplay",b||"block").setStyle("display","none"); +},show:function(a){return this.setStyle("display",a||this.retrieve("originalDisplay")||"block");},swapClass:function(a,b){return this.removeClass(a).addClass(b); +}});if(!window.Form){window.Form={};}(function(){Form.Request=new Class({Binds:["onSubmit","onFormValidate"],Implements:[Options,Events,Class.Occlude],options:{requestOptions:{evalScripts:true,useSpinner:true,emulation:false,link:"ignore"},extraData:{},resetForm:true},property:"form.request",initialize:function(b,c,a){this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.update=document.id(c);this.setOptions(a);this.makeRequest();if(this.options.resetForm){this.request.addEvent("success",function(){$try(function(){this.element.reset(); +}.bind(this));if(window.OverText){OverText.update();}}.bind(this));}this.attach();},toElement:function(){return this.element;},makeRequest:function(){this.request=new Request.HTML($merge({url:this.element.get("action"),update:this.update,emulation:false,spinnerTarget:this.element,method:this.element.get("method")||"post"},this.options.requestOptions)).addEvents({success:function(b,a){["success","complete"].each(function(c){this.fireEvent(c,[this.update,b,a]); +},this);}.bind(this),failure:function(a){this.fireEvent("failure",a);}.bind(this),exception:function(){this.fireEvent("failure",xhr);}.bind(this)});},attach:function(a){a=$pick(a,true); +method=a?"addEvent":"removeEvent";var b=this.element.retrieve("validator");if(b){b[method]("onFormValidate",this.onFormValidate);}if(!b||!a){this.element[method]("submit",this.onSubmit); +}},detach:function(){this.attach(false);},enable:function(){this.attach();},disable:function(){this.detach();},onFormValidate:function(b,a,c){if(b||!fv.options.stopOnFailure){if(c&&c.stop){c.stop(); +}this.send();}},onSubmit:function(a){if(this.element.retrieve("validator")){this.detach();this.addFormEvent();return;}a.stop();this.send();},send:function(){var b=this.element.toQueryString().trim(); +var a=$H(this.options.extraData).toQueryString();if(b){b+="&"+a;}else{b=a;}this.fireEvent("send",[this.element,b]);this.request.send({data:b});return this; +}});Element.Properties.formRequest={set:function(){var a=Array.link(arguments,{options:Object.type,update:Element.type,updateId:String.type});var c=a.update||a.updateId; +var b=this.retrieve("form.request");if(c){if(b){b.update=document.id(c);}this.store("form.request:update",c);}if(a.options){if(b){b.setOptions(a.options); +}this.store("form.request:options",a.options);}return this;},get:function(){var a=Array.link(arguments,{options:Object.type,update:Element.type,updateId:String.type}); +var b=a.update||a.updateId;if(a.options||b||!this.retrieve("form.request")){if(a.options||!this.retrieve("form.request:options")){this.set("form.request",a.options); +}if(b){this.set("form.request",b);}this.store("form.request",new Form.Request(this,this.retrieve("form.request:update"),this.retrieve("form.request:options"))); +}return this.retrieve("form.request");}};Element.implement({formUpdate:function(b,a){this.get("form.request",b,a).send();return this;}});})();Fx.Reveal=new Class({Extends:Fx.Morph,options:{link:"cancel",styles:["padding","border","margin"],transitionOpacity:!Browser.Engine.trident4,mode:"vertical",display:"block",hideInputs:Browser.Engine.trident?"select, input, textarea, object, embed":false},dissolve:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true; +this.showing=false;this.hidden=true;this.cssText=this.element.style.cssText;var d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +this.element.setStyle("display","block");if(this.options.transitionOpacity){d.opacity=1;}var b={};$each(d,function(f,e){b[e]=[f,0];},this);this.element.setStyle("overflow","hidden"); +var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;this.$chain.unshift(function(){if(this.hidden){this.hiding=false;$each(d,function(f,e){d[e]=f; +},this);this.element.style.cssText=this.cssText;this.element.setStyle("display","none");if(a){a.setStyle("visibility","visible");}}this.fireEvent("hide",this.element); +this.callChain();}.bind(this));if(a){a.setStyle("visibility","hidden");}this.start(b);}else{this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}}else{if(this.options.link=="chain"){this.chain(this.dissolve.bind(this));}else{if(this.options.link=="cancel"&&!this.hiding){this.cancel(); +this.dissolve();}}}}catch(c){this.hiding=false;this.element.setStyle("display","none");this.callChain.delay(10,this);this.fireEvent("complete",this.element); +this.fireEvent("hide",this.element);}return this;},reveal:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true; +this.hiding=this.hidden=false;var d;this.cssText=this.element.style.cssText;this.element.measure(function(){d=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode}); +}.bind(this));$each(d,function(f,e){d[e]=f;});if($chk(this.options.heightOverride)){d.height=this.options.heightOverride.toInt();}if($chk(this.options.widthOverride)){d.width=this.options.widthOverride.toInt(); +}if(this.options.transitionOpacity){this.element.setStyle("opacity",0);d.opacity=1;}var b={height:0,display:this.options.display};$each(d,function(f,e){b[e]=0; +});this.element.setStyles($merge(b,{overflow:"hidden"}));var a=this.options.hideInputs?this.element.getElements(this.options.hideInputs):null;if(a){a.setStyle("visibility","hidden"); +}this.start(d);this.$chain.unshift(function(){this.element.style.cssText=this.cssText;this.element.setStyle("display",this.options.display);if(!this.hidden){this.showing=false; +}if(a){a.setStyle("visibility","visible");}this.callChain();this.fireEvent("show",this.element);}.bind(this));}else{this.callChain();this.fireEvent("complete",this.element); +this.fireEvent("show",this.element);}}else{if(this.options.link=="chain"){this.chain(this.reveal.bind(this));}else{if(this.options.link=="cancel"&&!this.showing){this.cancel(); +this.reveal();}}}}catch(c){this.element.setStyles({display:this.options.display,visiblity:"visible",opacity:1});this.showing=false;this.callChain.delay(10,this); +this.fireEvent("complete",this.element);this.fireEvent("show",this.element);}return this;},toggle:function(){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.reveal(); +}else{this.dissolve();}return this;},cancel:function(){this.parent.apply(this,arguments);this.element.style.cssText=this.cssText;this.hidding=false;this.showing=false; +}});Element.Properties.reveal={set:function(a){var b=this.retrieve("reveal");if(b){b.cancel();}return this.eliminate("reveal").store("reveal:options",a); +},get:function(a){if(a||!this.retrieve("reveal")){if(a||!this.retrieve("reveal:options")){this.set("reveal",a);}this.store("reveal",new Fx.Reveal(this,this.retrieve("reveal:options"))); +}return this.retrieve("reveal");}};Element.Properties.dissolve=Element.Properties.reveal;Element.implement({reveal:function(a){this.get("reveal",a).reveal(); +return this;},dissolve:function(a){this.get("reveal",a).dissolve();return this;},nix:function(){var a=Array.link(arguments,{destroy:Boolean.type,options:Object.type}); +this.get("reveal",a.options).dissolve().chain(function(){this[a.destroy?"destroy":"dispose"]();}.bind(this));return this;},wink:function(){var b=Array.link(arguments,{duration:Number.type,options:Object.type}); +var a=this.get("reveal",b.options);a.reveal().chain(function(){(function(){a.dissolve();}).delay(b.duration||2000);});}});Request.implement({options:{initialDelay:5000,delay:5000,limit:60000},startTimer:function(b){var a=function(){if(!this.running){this.send({data:b}); +}};this.timer=a.delay(this.options.initialDelay,this);this.lastDelay=this.options.initialDelay;this.completeCheck=function(c){$clear(this.timer);this.lastDelay=(c)?this.options.delay:(this.lastDelay+this.options.delay).min(this.options.limit); +this.timer=a.delay(this.lastDelay,this);};return this.addEvent("complete",this.completeCheck);},stopTimer:function(){$clear(this.timer);return this.removeEvent("complete",this.completeCheck); +}});var Color=new Native({initialize:function(b,c){if(arguments.length>=3){c="rgb";b=Array.slice(arguments,0,3);}else{if(typeof b=="string"){if(b.match(/rgb/)){b=b.rgbToHex().hexToRgb(true); +}else{if(b.match(/hsb/)){b=b.hsbToRgb();}else{b=b.hexToRgb(true);}}}}c=c||"rgb";switch(c){case"hsb":var a=b;b=b.hsbToRgb();b.hsb=a;break;case"hex":b=b.hexToRgb(true); +break;}b.rgb=b.slice(0,3);b.hsb=b.hsb||b.rgbToHsb();b.hex=b.rgbToHex();return $extend(b,this);}});Color.implement({mix:function(){var a=Array.slice(arguments); +var c=($type(a.getLast())=="number")?a.pop():50;var b=this.slice();a.each(function(d){d=new Color(d);for(var e=0;e<3;e++){b[e]=Math.round((b[e]/100*(100-c))+(d[e]/100*c)); +}});return new Color(b,"rgb");},invert:function(){return new Color(this.map(function(a){return 255-a;}));},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb"); +},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb");},setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb"); +}});var $RGB=function(d,c,a){return new Color([d,c,a],"rgb");};var $HSB=function(d,c,a){return new Color([d,c,a],"hsb");};var $HEX=function(a){return new Color(a,"hex"); +};Array.implement({rgbToHsb:function(){var b=this[0],c=this[1],j=this[2],g=0;var i=Math.max(b,c,j),e=Math.min(b,c,j);var k=i-e;var h=i/255,f=(i!=0)?k/i:0; +if(f!=0){var d=(i-b)/k;var a=(i-c)/k;var l=(i-j)/k;if(b==i){g=l-a;}else{if(c==i){g=2+d-l;}else{g=4+a-d;}}g/=6;if(g<0){g++;}}return[Math.round(g*360),Math.round(f*100),Math.round(h*100)]; +},hsbToRgb:function(){var c=Math.round(this[2]/100*255);if(this[1]==0){return[c,c,c];}else{var a=this[0]%360;var e=a%60;var g=Math.round((this[2]*(100-this[1]))/10000*255); +var d=Math.round((this[2]*(6000-this[1]*e))/600000*255);var b=Math.round((this[2]*(6000-this[1]*(60-e)))/600000*255);switch(Math.floor(a/60)){case 0:return[c,b,g]; +case 1:return[d,c,g];case 2:return[g,c,b];case 3:return[g,d,c];case 4:return[b,g,c];case 5:return[c,g,d];}}return false;}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g); +return(a)?a.rgbToHsb():null;},hsbToRgb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.hsbToRgb():null;}});var IframeShim=new Class({Implements:[Options,Events,Class.Occlude],options:{className:"iframeShim",src:'javascript:false;document.write("");',display:false,zIndex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac))},property:"IframeShim",initialize:function(b,a){this.element=document.id(b); +if(this.occlude()){return this.occluded;}this.setOptions(a);this.makeShim();return this;},makeShim:function(){if(this.options.browsers){var c=this.element.getStyle("zIndex").toInt(); +if(!c){c=1;var b=this.element.getStyle("position");if(b=="static"||!b){this.element.setStyle("position","relative");}this.element.setStyle("zIndex",c); +}c=($chk(this.options.zIndex)&&c>this.options.zIndex)?this.options.zIndex:c-1;if(c<0){c=1;}this.shim=new Element("iframe",{src:this.options.src,scrolling:"no",frameborder:0,styles:{zIndex:c,position:"absolute",border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"},"class":this.options.className}).store("IframeShim",this); +var a=(function(){this.shim.inject(this.element,"after");this[this.options.display?"show":"hide"]();this.fireEvent("inject");}).bind(this);if(IframeShim.ready){window.addEvent("load",a); +}else{a();}}else{this.position=this.hide=this.show=this.dispose=$lambda(this);}},position:function(){if(!IframeShim.ready||!this.shim){return this;}var a=this.element.measure(function(){return this.getSize(); +});if(this.options.margin!=undefined){a.x=a.x-(this.options.margin*2);a.y=a.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin; +}this.shim.set({width:a.x,height:a.y}).position({relativeTo:this.element,offset:this.options.offset});return this;},hide:function(){if(this.shim){this.shim.setStyle("display","none"); +}return this;},show:function(){if(this.shim){this.shim.setStyle("display","block");}return this.position();},dispose:function(){if(this.shim){this.shim.dispose(); +}return this;},destroy:function(){if(this.shim){this.shim.destroy();}return this;}});window.addEvent("load",function(){IframeShim.ready=true;});var Mask=new Class({Implements:[Options,Events],Binds:["resize"],options:{style:{},"class":"mask",maskMargins:false,useIframeShim:true},initialize:function(b,a){this.target=document.id(b)||document.body; +this.target.store("mask",this);this.setOptions(a);this.render();this.inject();},render:function(){this.element=new Element("div",{"class":this.options["class"],id:this.options.id||"mask-"+$time(),styles:$merge(this.options.style,{display:"none"}),events:{click:function(){this.fireEvent("click"); +if(this.options.hideOnClick){this.hide();}}.bind(this)}});this.hidden=true;},toElement:function(){return this.element;},inject:function(b,a){a=a||this.options.inject?this.options.inject.where:""||this.target==document.body?"inside":"after"; +b=b||this.options.inject?this.options.inject.target:""||this.target;this.element.inject(b,a);if(this.options.useIframeShim){this.shim=new IframeShim(this.element); +this.addEvents({show:this.shim.show.bind(this.shim),hide:this.shim.hide.bind(this.shim),destroy:this.shim.destroy.bind(this.shim)});}},position:function(){this.resize(this.options.width,this.options.height); +this.element.position({relativeTo:this.target,position:"topLeft",ignoreMargins:!this.options.maskMargins,ignoreScroll:this.target==document.body});return this; +},resize:function(a,e){var b={styles:["padding","border"]};if(this.options.maskMargins){b.styles.push("margin");}var d=this.target.getComputedSize(b);if(this.target==document.body){var c=window.getSize(); +if(d.totalHeight<c.y){d.totalHeight=c.y;}if(d.totalWidth<c.x){d.totalWidth=c.x;}}this.element.setStyles({width:$pick(a,d.totalWidth,d.x),height:$pick(e,d.totalHeight,d.y)}); +return this;},show:function(){if(!this.hidden){return this;}this.target.addEvent("resize",this.resize);if(this.target!=document.body){document.id(document.body).addEvent("resize",this.resize); +}this.position();this.showMask.apply(this,arguments);return this;},showMask:function(){this.element.setStyle("display","block");this.hidden=false;this.fireEvent("show"); +},hide:function(){if(this.hidden){return this;}this.target.removeEvent("resize",this.resize);this.hideMask.apply(this,arguments);if(this.options.destroyOnHide){return this.destroy(); +}return this;},hideMask:function(){this.element.setStyle("display","none");this.hidden=true;this.fireEvent("hide");},toggle:function(){this[this.hidden?"show":"hide"](); +},destroy:function(){this.hide();this.element.destroy();this.fireEvent("destroy");this.target.eliminate("mask");}});Element.Properties.mask={set:function(b){var a=this.retrieve("mask"); +return this.eliminate("mask").store("mask:options",b);},get:function(a){if(a||!this.retrieve("mask")){if(this.retrieve("mask")){this.retrieve("mask").destroy(); +}if(a||!this.retrieve("mask:options")){this.set("mask",a);}this.store("mask",new Mask(this,this.retrieve("mask:options")));}return this.retrieve("mask"); +}};Element.implement({mask:function(a){this.get("mask",a).show();return this;},unmask:function(){this.get("mask").hide();return this;}});var Spinner=new Class({Extends:Mask,options:{"class":"spinner",containerPosition:{},content:{"class":"spinner-content"},messageContainer:{"class":"spinner-msg"},img:{"class":"spinner-img"},fxOptions:{link:"chain"}},initialize:function(){this.parent.apply(this,arguments); +this.target.store("spinner",this);var a=function(){this.active=false;}.bind(this);this.addEvents({hide:a,show:a});},render:function(){this.parent();this.element.set("id",this.options.id||"spinner-"+$time()); +this.content=document.id(this.options.content)||new Element("div",this.options.content);this.content.inject(this.element);if(this.options.message){this.msg=document.id(this.options.message)||new Element("p",this.options.messageContainer).appendText(this.options.message); +this.msg.inject(this.content);}if(this.options.img){this.img=document.id(this.options.img)||new Element("div",this.options.img);this.img.inject(this.content); +}this.element.set("tween",this.options.fxOptions);},show:function(a){if(this.active){return this.chain(this.show.bind(this));}if(!this.hidden){this.callChain.delay(20,this); +return this;}this.active=true;return this.parent(a);},showMask:function(a){var b=function(){this.content.position($merge({relativeTo:this.element},this.options.containerPosition)); +}.bind(this);if(a){this.parent();b();}else{this.element.setStyles({display:"block",opacity:0}).tween("opacity",this.options.style.opacity||0.9);b();this.hidden=false; +this.fireEvent("show");this.callChain();}},hide:function(a){if(this.active){return this.chain(this.hide.bind(this));}if(this.hidden){this.callChain.delay(20,this); +return this;}this.active=true;return this.parent(a);},hideMask:function(a){if(a){return this.parent();}this.element.tween("opacity",0).get("tween").chain(function(){this.element.setStyle("display","none"); +this.hidden=true;this.fireEvent("hide");this.callChain();}.bind(this));},destroy:function(){this.content.destroy();this.parent();this.target.eliminate("spinner"); +}});Spinner.implement(new Chain);if(window.Request){Request=Class.refactor(Request,{options:{useSpinner:false,spinnerOptions:{},spinnerTarget:false},initialize:function(a){this._send=this.send; +this.send=function(c){if(this.spinner){this.spinner.chain(this._send.bind(this,c)).show();}else{this._send(c);}return this;};this.previous(a);var b=document.id(this.options.spinnerTarget)||document.id(this.options.update); +if(this.options.useSpinner&&b){this.spinner=b.get("spinner",this.options.spinnerOptions);["onComplete","onException","onCancel"].each(function(c){this.addEvent(c,this.spinner.hide.bind(this.spinner)); +},this);}},getSpinner:function(){return this.spinner;}});}Element.Properties.spinner={set:function(a){var b=this.retrieve("spinner");return this.eliminate("spinner").store("spinner:options",a); +},get:function(a){if(a||!this.retrieve("spinner")){if(this.retrieve("spinner")){this.retrieve("spinner").destroy();}if(a||!this.retrieve("spinner:options")){this.set("spinner",a); +}new Spinner(this,this.retrieve("spinner:options"));}return this.retrieve("spinner");}};Element.implement({spin:function(a){this.get("spinner",a).show(); +return this;},unspin:function(){var a=Array.link(arguments,{options:Object.type,callback:Function.type});this.get("spinner",a.options).hide(a.callback); +return this;}}); \ No newline at end of file diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 35d777020..a28b71e69 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -40,7 +40,7 @@ def check_server(function): def permission(perm): def _dec(view_func): def _view(request, * args, ** kwargs): - if request.user.has_perm(perm): + if request.user.has_perm(perm) and request.user.is_authenticated(): return view_func(request, * args, ** kwargs) else: return base(request, messages=['You don\'t have permission to view this page.']) diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 6f9d5ff46..e4d11ce34 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -6,26 +6,45 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/default.css"> -<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css"> +<!--<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/jquery-ui-1.7.2.custom.css">--> <link rel="stylesheet" type="text/css" href="{{ MEDIA_URL }}css/window.css"> -<script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script> -<!--<script src="{{ MEDIA_URL }}js/jquery-ui-1.7.2.custom.min.js"></script>--> +<!--<script src="{{ MEDIA_URL }}js/jquery-1.3.2.min.js"></script>--> <script src="{{ MEDIA_URL }}js/sprintf.js"></script> <script src="{{ MEDIA_URL }}js/funktions.js"></script> -<script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script> -<script src="{{ MEDIA_URL }}js/jquery.form.js"></script> +<script src="{{ MEDIA_URL }}js/mootools-1.2.4-core.js"></script> +<script src="{{ MEDIA_URL }}js/mootools-1.2.4.2-more.js"></script> + +<!--<script src="{{ MEDIA_URL }}js/jquery.progressbar.js"></script>--> +<!--<script src="{{ MEDIA_URL }}js/jquery.form.js"></script>--> <title>{% block title %}pyLoad Webinterface{% endblock %}</title> <script type="text/javascript"> -$(document).ready(function(){ - $.getJSON('/json/status', LoadJsonToContent ); - $('#add_form').ajaxForm(function() { - AddBox(); - }); -}); +var add_bg,add_box +document.addEvent("domready", function(){ + + add_bg = new Fx.Tween($('add_bg')); + add_box = new Fx.Tween($('add_box')); + new Form.Request("add_form", $('none_existent'), { onSuccess: function(){ + out(); + }}); + $('add_reset').addEvent('click', function(){ + out(); + }); + + var jsonStatus = new Request.JSON({ + url: "json/status", + onSuccess: LoadJsonToContent, + initialDelay: 0, + delay: 4000, + limit: 30000 + }) + + jsonStatus.startTimer(); + +}); /*function UpdateLinks( SetInver, index ) { @@ -35,30 +54,39 @@ $(document).ready(function(){ function LoadJsonToContent(data) { - JSONDATA = data; - $("#speed").text(Math.round(data.speed*100)/100); - $("#aktiv").text(data.queue); - $("#queue").text(data.total); + $("speed").textContent = Math.round(data.speed*100)/100; + $("aktiv").textContent = data.queue; + $("queue").textContent = data.total; +} +function show(){ + add_bg.set('opacity', 0); + $("add_bg").setStyle('display', 'block'); + add_bg.start('opacity',0.8); - setTimeout(function() - { - $.getJSON('/json/status', LoadJsonToContent ); - }, 4000); - req.startTimer(); + add_box.set('opacity', 0) + $("add_box").setStyle('display', 'block'); + add_box.start('opacity',1) +} + +function out(){ + add_bg.start('opacity',0).chain(function(){ + $('add_bg').setStyle('display', 'none'); + }); + add_box.start('opacity',0).chain(function(){ + $('add_box').setStyle('display', 'none'); + }); } function AddBox() { - if (!$("#add_box").is(":hidden")) + if ($("add_box").getStyle("display") == "hidden" || $("add_box").getStyle("display") == "none" || $("add_box").getStyle("opacity" == 0)) { - $("#add_box").fadeOut(800); - $("#add_bg").fadeOut(800); + show(); } else { - $("#add_box").fadeIn(800); - $("#add_bg").fadeIn(800); + out(); } } diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 96f3015d9..02681a23d 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -9,38 +9,167 @@ $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1) setTimeout( UpdateLinks( SetInver, index+1 ), SetInver[index]*1000); }*/ -$(document).ready(function(){ - $.getJSON('/json/links', LinksToContent ); +var em; + +document.addEvent("domready", function(){ + em = new EntryManager(); }); -function LinksToContent(data) -{ - - $.each(data, function(i,item) - { - //$("#LinksAktiv").append('<tr id="link_'+item.id+'"><td id="link_'+item.id+'_name">'+item.name+'</td><td id="link_'+item.id+'_status">'+item.status+'</td><td>'+SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s</td><td>'+HumanFileSize(item.size)+'</td><td><font id="aktiv_percent">'+item.percent+'</font>% / '+HumanFileSize(item.size-item.kbleft)+'</td></tr>'); - //SetInver[i] = (item.size / 100 ) / item.speed ; - //window.setInterval( $("#aktiv_percent").text(parseInt($("#aktiv_percent").text)+1), ((item.size / 100 ) / item.speed)*100); - //$("#LinksAktiv").append('<tr><td colspan="5"><div class="progress_bar" style="width: '+(100/item.size)*(item.size-item.kbleft)+'%;"> </div></td></tr>'); - //$(".progress_bar").animate({ width: "100%"}, (item.size / item.speed)*1000, "linear" ); - //var width = (100/item.size)*(item.size-item.kbleft); - //alert(width); - //$(".link_"+item.id+"_pgb").animate({ width: +"%"}, /*(item.size / item.speed)*1000*/1500, "linear" ); - //$("#link_"+item.id+"_pgb").fadeIn(); - /*$("#link_"+item.id+"_pgb").progressBar(); - $("#link_"+item.id+"_pgb").progressBar('option' , 'width' , '100%'); - $("#link_"+item.id+"_pgb").progressBar('option' , 'showText' , true); - $("#link_"+item.id+"_pgb").progressBar('option' , 'textFormat' , 'percentage');*/ - $("#link_"+item.id+"_pgb").progressBar((100/item.size)*(item.size-item.kbleft)); - +var EntryManager = new Class({ + initialize: function(){ + this.json = new Request.JSON({ + url: "json/links", + onSuccess: this.update.bind(this), + initialDelay: 0, + delay: 2500, + limit: 30000 }); - //UpdateLinks(SetInver, 0); - setTimeout(function() - { - $.getJSON('/json/links', LinksToContent ); - }, 1000); -} + this.ids = [{% for link in content %} + {% if forloop.last %} + {{ link.id }} + {% else %} + {{ link.id }}, + {% endif %} + {% endfor %}]; + + this.entries = []; + this.container = $('LinksAktiv'); + + this.parseFromContent(); + + this.json.startTimer(); + }, + parseFromContent: function(){ + this.ids.each(function(id,index){ + entry = new LinkEntry(id) + entry.parse() + this.entries.push(entry) + }, this); + }, + update: function(data){ + + try{ + this.ids = this.entries.map(function(item){ + return item.id + }); + + this.ids.filter(function(id){ + return !this.ids.contains(id) + },data).each(function(id){ + index = this.ids.indexOf(id); + this.entries[index].remove(); + this.entries = this.entries.remove(index); + this.ids = this.ids.remove(index); + }, this); + + data.links.each(function(link, i){ + if (this.ids.contains(link.id)){ + + index = this.ids.indexOf(link.id) + this.entries[index].update(link) + + }else{ + entry = new LinkEntry(link.id); + entry.insert(link); + this.entries.push(entry); + this.ids.push(link.id); + this.container.adopt(entry.elements.tr,entry.elements.pgbTr); + entry.fade.start('opacity', 1); + entry.fadeBar.start('opacity', 1); + + } + }, this) + }catch(e){alert(e)} + } +}) + + +var LinkEntry = new Class({ + initialize: function(id){ + this.id = id + }, + parse: function(){ + this.elements = { + tr: $("link_{id}".substitute({id: this.id})), + name: $("link_{id}_name".substitute({id: this.id})), + status: $("link_{id}_status".substitute({id: this.id})), + info: $("link_{id}_info".substitute({id: this.id})), + kbleft: $("link_{id}_kbleft".substitute({id: this.id})), + percent: $("link_{id}_percent".substitute({id: this.id})), + pgbTr: $("link_{id}_pgb_tr".substitute({id: this.id})), + pgb: $("link_{id}_pgb".substitute({id: this.id})) + } + this.initEffects(); + }, + insert: function(item){ + try{ + info = SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s' ; + + this.elements = { + tr: new Element('tr', { + 'html': '', + 'styles':{ + 'opacity': 0 + } + }), + name: new Element('td', { + 'html': item.name + }), + status: new Element('td', { + 'html': item.status + }), + info: new Element('td', { + 'html': info + }), + kbleft: new Element('td', { + 'html': HumanFileSize(item.size) + }), + percent: new Element('td', { + 'html': item.percent+ '% / '+ HumanFileSize(item.size-item.kbleft) + }), + pgbTr: new Element('tr', { + 'html':'' + }), + pgb: new Element('div', { + 'html': ' ', + 'styles':{ + 'height': '4px', + 'width': item.percent+'%', + 'background-color': '#ddd' + } + }) + } + + this.elements.tr.adopt(this.elements.name,this.elements.status,this.elements.info,this.elements.kbleft,this.elements.percent); + this.elements.pgbTr.adopt(new Element('td',{'colspan':5}).adopt(this.elements.pgb)); + this.initEffects(); + }catch(e){ + alert(e) + } + }, + initEffects: function(){ + this.bar = new Fx.Morph(this.elements.pgb, {unit: '%', duration: 3000, link: 'chain', fps:30}); + this.fade = new Fx.Tween(this.elements.tr); + this.fadeBar = new Fx.Tween(this.elements.pgbTr); + }, + update: function(item){ + this.elements.name.set('text', item.name); + this.elements.status.set('text', item.status); + this.elements.info.set('text', SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s'); + this.elements.kbleft.set('text', HumanFileSize(item.size)); + this.elements.percent.set('text', item.percent+ '% / '+ HumanFileSize(item.size-item.kbleft)); + this.bar.start({ + 'width': item.percent, + 'background-color': [Math.round(120/100*item.percent),100,100].hsbToRgb().rgbToHex() + }); + }, + remove: function(){ + this.fade.start('opacity',0).chain(function(){this.elements.tr.dispose();}.bind(this)); + this.fadeBar.start('opacity',0).chain(function(){this.elements.pgbTr.dispose();}.bind(this)); + + } + }); </script> {% endblock %} @@ -51,6 +180,7 @@ Active Downloads {% block content %} <table width="100%" class="queue"> + <thead> <tr class="header"> <th>Name</th> <th>Status</th> @@ -58,6 +188,7 @@ Active Downloads <th>Size</th> <th>Progress</th> </tr> + </thead> <tbody id="LinksAktiv"> {% for link in content %} @@ -66,11 +197,11 @@ Active Downloads <td id="link_{{ link.id }}_status">{{ link.status }}</td> <td id="link_{{ link.id }}_info">{{ link.info }}</td> <td id="link_{{ link.id }}_kbleft">{{ link.size }}</td> - <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font><a href="#" onclick="javascript:$('#pb1').progressBar(50);">load</a></td> + <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font></td> </tr> - <tr> - <td colspan="5"> - <span id="link_{{ link.id }}_pgb" class="progressBar" style="width: {{ link.percent }}%;"></span> + <tr id="link_{{ link.id }}_pgb_tr"> + <td span="5"> + <div id="link_{{ link.id }}_pgb" class="progressBar" style="background-color: green; height:4px; width: {{ link.percent }}%;"> </div> </td> </tr> {% endfor %} diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index 7ef02e04a..daf305892 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -22,7 +22,7 @@ <input type="file" name="add_file" id="add_file" /> <button type="submit">Add Package</button> -<button style="margin-left:0px;" type="reset" onclick="AddBox();">Reset</button> +<button id="add_reset" style="margin-left:0px;" type="reset">Reset</button> <div class="spacer"></div> </form> -- cgit v1.2.3 From 324ed3da96b07d42da753d1314495724ef4c2b7a Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 11:18:03 +0100 Subject: removed Mp3Convert, just load plugin config once --- module/Plugin.py | 2 +- module/plugins/Hook.py | 7 ++---- module/plugins/hooks/Mp3Convert.py | 51 -------------------------------------- 3 files changed, 3 insertions(+), 57 deletions(-) delete mode 100644 module/plugins/hooks/Mp3Convert.py (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 45371c3af..2e61a1b55 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -31,7 +31,7 @@ from module.download_thread import CaptchaError class Plugin(): def __init__(self, parent): - self.configparser = XMLConfigParser(join("module","config","plugin.xml")) + self.configparser = parent.core.parser_plugins self.config = {} props = {} props['name'] = "BasePlugin" diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 1a7fba092..366cde185 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -26,7 +26,7 @@ from module.XMLConfigParser import XMLConfigParser class Hook(): def __init__(self, core): self.logger = logging.getLogger("log") - self.configParser = XMLConfigParser(join("module","config","plugin.xml")) + self.configParser = core.parser_plugins self.config = {} props = {} props['name'] = "Hook" @@ -40,10 +40,7 @@ class Hook(): def readConfig(self): self.configParser.loadData() section = self.props['name'] - try: - self.config = self.configParser.getConfig()[section] - except: - self.setup() + self.config = self.configParser.getConfig()[section] def setup(self): self.configParser.set(self.props["name"], {"option": "activated", "type": "bool", "name": "Activated"}, True) diff --git a/module/plugins/hooks/Mp3Convert.py b/module/plugins/hooks/Mp3Convert.py deleted file mode 100644 index 6f32eecf4..000000000 --- a/module/plugins/hooks/Mp3Convert.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- - -""" - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, see <http://www.gnu.org/licenses/>. - - @author: mkaaym spoob - @interface-version: 0.1 -""" - -from module.plugins.Hook import Hook -from os.path import join, abspath -import subprocess -from os import remove - -class Mp3Convert(Hook): - def __init__(self, core): - Hook.__init__(self, core) - props = {} - props['name'] = "Mp3Convert" - props['version'] = "0.1" - props['description'] = """converts files like videos to mp3""" - props['author_name'] = ("spoob", "mkaay") - props['author_mail'] = ("spoob@pyload.org", "mkaay@mkaay.de") - self.props = props - self.readConfig() - - def downloadFinished(self, pyfile): - plugin = pyfile.plugin.props['name'] - if plugin == "YoutubeCom": - filename = pyfile.status.filename[:-4] - cmd = ['ffmpeg -i "%s" -vn -ar 44100 -ac 2 -ab 192k "%s.mp3"' % (abspath(join(pyfile.folder, pyfile.status.filename)), abspath(join(pyfile.folder, filename)))] - converter = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - converter.wait() - if self.config["removeRegularFile"]: - remove(abspath(join(pyfile.folder, pyfile.status.filename))) - self.logger.info("Mp3Convert: Converterd %s to Mp3" % filename) - - def setup(self): - self.configParser.set(self.props["name"], {"option": "removeRegularFile", "type": "bool", "name": "Remove Regular Files"}, False) - Hook.setup(self) -- cgit v1.2.3 From 3be34eb4b5b286f02de780ce34a7691d49c7a384 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 11:21:11 +0100 Subject: forgot changes --- module/plugins/Hook.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 366cde185..6f8a48802 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -40,7 +40,10 @@ class Hook(): def readConfig(self): self.configParser.loadData() section = self.props['name'] - self.config = self.configParser.getConfig()[section] + try: + self.config = self.configParser.getConfig()[section] + except: + self.setup() def setup(self): self.configParser.set(self.props["name"], {"option": "activated", "type": "bool", "name": "Activated"}, True) -- cgit v1.2.3 From b1637236297fc5c3278e4d358fa7ec990824db71 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 14:21:13 +0100 Subject: More YoutubeChannel Options --- module/config/plugin_default.xml | 1 + module/plugins/decrypter/YoutubeChannel.py | 31 +++++++++++++++++------------- 2 files changed, 19 insertions(+), 13 deletions(-) (limited to 'module') diff --git a/module/config/plugin_default.xml b/module/config/plugin_default.xml index 773e4e46f..43c220516 100644 --- a/module/config/plugin_default.xml +++ b/module/config/plugin_default.xml @@ -27,6 +27,7 @@ <YoutubeChannel> <!-- False for no limitation --> <max_videos>False</max_videos> + <video_groups name="Video Groups" type="str" input="uploads;favorites">uploads,favorites</video_groups> </YoutubeChannel> <SerienjunkiesOrg> <preferredHoster>RapidshareCom,UploadedTo,NetloadIn,FilefactoryCom</preferredHoster> diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py index 27a4ff8a7..2a3ae337f 100644 --- a/module/plugins/decrypter/YoutubeChannel.py +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -13,7 +13,7 @@ class YoutubeChannel(Plugin): props['name'] = "YoutubeChannel" props['type'] = "container" props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" - props['version'] = "0.3" + props['version'] = "0.4" props['description'] = """Youtube.com Channel Download Plugin""" props['author_name'] = ("RaNaN", "Spoob") props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") @@ -34,16 +34,21 @@ class YoutubeChannel(Plugin): max_videos = 1000 #max video a user can upload page = 0 temp_links = [] - for start_index in range(1, int(max_videos), 50): - max_results = max_videos - page * 50 - if max_results > 50: - max_results = 50 - url = "http://gdata.youtube.com/feeds/api/users/" + self.user + "/uploads?max-results=" + str(max_results) + "&start-index=" + str(start_index) - rep = self.req.load(url) - new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) - if new_links != []: - temp_links.extend(new_links) - else: - break - page += 1 + if "," in self.config['video_groups']: + video_groups = self.config['video_groups'].split(",") + else: + video_groups = [self.config['video_groups']] + for group in video_groups: + for start_index in range(1, int(max_videos), 50): + max_results = max_videos - page * 50 + if max_results > 50: + max_results = 50 + url = "http://gdata.youtube.com/feeds/api/users/%s/%s?max-results=%i&start-index=%i" % (self.user, group, max_results, start_index) + rep = self.req.load(str(url)) + new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) + if new_links != []: + temp_links.extend(new_links) + else: + break + page += 1 self.links = temp_links -- cgit v1.2.3 From fa885950149109926c8587876930a3f4e287ee26 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 14:24:29 +0100 Subject: More YoutubeChannel Options --- module/plugins/decrypter/YoutubeChannel.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py index 2a3ae337f..2cea419de 100644 --- a/module/plugins/decrypter/YoutubeChannel.py +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -21,14 +21,17 @@ class YoutubeChannel(Plugin): self.parent = parent self.html = None self.read_config() + self.user = re.search(r"/user/(.+)", self.parent.url).group(1) + def file_exists(self): """ returns True or False """ + rep = self.req.load("http://gdata.youtube.com/feeds/api/users/%s" % self.user) + print rep return True def proceed(self, url, location): - self.user = re.search(r"/user/(.+)", self.parent.url).group(1) max_videos = self.config['max_videos'] if not max_videos: max_videos = 1000 #max video a user can upload -- cgit v1.2.3 From 5d1ecc6df93a6f4015fe5b83b3391ddd8c90f7b5 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 14:28:55 +0100 Subject: YoutubeChannel Checks File Exists --- module/plugins/decrypter/YoutubeChannel.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py index 2cea419de..a5751ed7c 100644 --- a/module/plugins/decrypter/YoutubeChannel.py +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -13,7 +13,7 @@ class YoutubeChannel(Plugin): props['name'] = "YoutubeChannel" props['type'] = "container" props['pattern'] = r"http://(www\.)?(de\.)?\youtube\.com/user/*" - props['version'] = "0.4" + props['version'] = "0.9" props['description'] = """Youtube.com Channel Download Plugin""" props['author_name'] = ("RaNaN", "Spoob") props['author_mail'] = ("RaNaN@pyload.org", "spoob@pyload.org") @@ -23,12 +23,9 @@ class YoutubeChannel(Plugin): self.read_config() self.user = re.search(r"/user/(.+)", self.parent.url).group(1) - def file_exists(self): - """ returns True or False - """ - rep = self.req.load("http://gdata.youtube.com/feeds/api/users/%s" % self.user) - print rep + if "User not found" in self.req.load("http://gdata.youtube.com/feeds/api/users/%s" % self.user): + return False return True def proceed(self, url, location): -- cgit v1.2.3 From ea94eace93bae1f1f9a3fd27c498f1b5309de50b Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Wed, 13 Jan 2010 15:03:23 +0100 Subject: Fixed MyVideo.de (yuck) --- module/plugins/hoster/MyvideoDe.py | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py index 5e2eb0b39..f7c087091 100644 --- a/module/plugins/hoster/MyvideoDe.py +++ b/module/plugins/hoster/MyvideoDe.py @@ -12,40 +12,24 @@ class MyvideoDe(Plugin): props['name'] = "MyvideoDe" props['type'] = "hoster" props['pattern'] = r"http://(www\.)?myvideo.de/watch/" - props['version'] = "0.1" - props['description'] = """Youtube.com Video Download Plugin""" + props['version'] = "0.9" + props['description'] = """Myvideo.de Video Download Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") self.props = props self.parent = parent self.html = None - self.html_old = None #time() where loaded the HTML - self.time_plus_wait = None #time() + wait in seconds - - def set_parent_status(self): - """ sets all available Statusinfos about a File in self.parent.status - """ - if self.html == None: - self.download_html() - self.parent.status.filename = self.get_file_name() - self.parent.status.url = self.get_file_url() - self.parent.status.wait = self.wait_until() + self.url = self.parent.url def download_html(self): - url = self.parent.url - self.html = self.req.load(url) + self.html = self.req.load(self.url) def get_file_url(self): - """ returns the absolute downloadable filepath - """ if self.html == None: self.download_html() videoId = re.search(r"addVariable\('_videoid','(.*)'\);p.addParam\('quality'", self.html).group(1) videoServer = re.search("rel='image_src' href='(.*)thumbs/.*' />", self.html).group(1) file_url = videoServer + videoId + ".flv" - print videoId - print videoServer - print file_url return file_url def get_file_name(self): @@ -55,11 +39,9 @@ class MyvideoDe(Plugin): return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' def file_exists(self): - """ returns True or False - """ if self.html == None: self.download_html() - if re.search(r"(.* Das angeforderte Video ist nicht.*)", self.html) != None: + self.req.load(str(self.url), cookies=False, just_header=True) + if self.req.lastEffectiveURL == "http://www.myvideo.de/": return False - else: - return True + return True -- cgit v1.2.3 From 36ed6c373b8dfde42f81e28d62c540aba5a3c04d Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 13 Jan 2010 21:12:24 +0100 Subject: queue template + view --- module/web/pyload/views.py | 10 ++++++++-- module/web/templates/default/queue.html | 17 ++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index a28b71e69..55887d711 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -73,7 +73,13 @@ def home(request): @permission('pyload.can_see_dl') @check_server def queue(request): - return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {}, [status_proc])) + queue = settings.PYLOAD.get_queue() + for pack in queue: + children = [] + for child in settings.PYLOAD.get_package_files(pack["id"]): + children.append(settings.PYLOAD.get_file_info()) + pack["children"] = children + return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) @login_required @@ -147,4 +153,4 @@ def logs(request, page=0): for i in range(page, page + 20): data.append({'line': i + 1, 'content':log[i]}) - return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) \ No newline at end of file + return render_to_response(join(settings.TEMPLATE, 'logs.html'), RequestContext(request, {'log': data, 'next': str(page + 20), 'prev': 0 if page-20 < 0 else page-20}, [status_proc])) diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index b4f1cb278..e9c1baa92 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -13,4 +13,19 @@ <li class="right"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> -{% endblock %} \ No newline at end of file +{% endblock %} + +{% block content %} +<ul id="queue"> + {% for package in content %} + <li class="package"> + <span class="packagename">{{ package.package_name }}</span> + <ul class="children"> + {% for child in package.children %} + <li class="child">{{ child.filename }}</li> + {% endfor %} + </ul> + </li> + {% endfor %} +<ul> +{% endblock %} -- cgit v1.2.3 From 9cce347134cffb8e3e920d94768306c2156dddee Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 13 Jan 2010 21:23:05 +0100 Subject: some webinterface improvements, closed #40 --- module/web/ajax/urls.py | 1 + module/web/ajax/views.py | 20 ++++++++++++----- module/web/pyload/views.py | 2 +- module/web/templates/default/base.html | 15 ++++++++----- module/web/templates/default/home.html | 38 +++++++++++++++++++++++++------- module/web/templates/default/window.html | 5 +++-- 6 files changed, 59 insertions(+), 22 deletions(-) (limited to 'module') diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 2a7e109c3..4decc27b1 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -12,6 +12,7 @@ urlpatterns = patterns('ajax', # Uncomment the next line to enable the admin: (r'^add_package$', 'views.add_package'), + (r'^remove_link/(\d+)$', 'views.remove_link'), (r'^status$', 'views.status'), (r'^links$', 'views.links'), #currently active links (r'^queue$', 'views.queue'), diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 08d87c30e..ea092745f 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -30,7 +30,7 @@ class JsonResponse(HttpResponse): object, indent=2, cls=json.DjangoJSONEncoder, ensure_ascii=False) super(JsonResponse, self).__init__( - content)#, content_type='application/json') #@TODO uncomment + content, content_type='application/json') #@TODO uncomment self['Cache-Control'] = 'no-cache, must-revalidate' @@ -38,14 +38,17 @@ class JsonResponse(HttpResponse): def add_package(request): name = request.POST['add_name'] + if name == None or name == "": return HttpResponseServerError() - links = request.POST['add_links'].split("\n") + links = request.POST['add_links'].replace(" ","\n").split("\n") try: f = request.FILES['add_file'] + print f fpath = join(settings.DL_ROOT, f.name) + print fpath destination = open(fpath, 'wb') for chunk in f.chunks(): destination.write(chunk) @@ -54,12 +57,19 @@ def add_package(request): except: pass - links = filter(lambda x: x is not "", links) - - settings.PYLOAD.add_package(name, links) + links = filter(lambda x: x != "", links) + settings.PYLOAD.add_package(name, links) + return JsonResponse("success") +@permission('pyload.can_add_dl') +def remove_link(request, id): + try: + settings.PYLOAD.del_links([int(id)]) + return JsonResponse("sucess") + except: + return HttpResponseServerError() @permission('pyload.can_see_dl') def status(request): diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 55887d711..994075001 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -77,7 +77,7 @@ def queue(request): for pack in queue: children = [] for child in settings.PYLOAD.get_package_files(pack["id"]): - children.append(settings.PYLOAD.get_file_info()) + children.append(settings.PYLOAD.get_file_info(child)) pack["children"] = children return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index e4d11ce34..0cebeb5d8 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -25,10 +25,11 @@ document.addEvent("domready", function(){ add_bg = new Fx.Tween($('add_bg')); add_box = new Fx.Tween($('add_box')); - - new Form.Request("add_form", $('none_existent'), { onSuccess: function(){ + + $('add_form').onsubmit=function() { + $('add_form').target = 'upload_target'; //'upload_target' is the name of the iframe out(); - }}); + } $('add_reset').addEvent('click', function(){ out(); @@ -37,6 +38,8 @@ document.addEvent("domready", function(){ var jsonStatus = new Request.JSON({ url: "json/status", onSuccess: LoadJsonToContent, + secure: false, + async: true, initialDelay: 0, delay: 4000, limit: 30000 @@ -54,9 +57,9 @@ document.addEvent("domready", function(){ function LoadJsonToContent(data) { - $("speed").textContent = Math.round(data.speed*100)/100; - $("aktiv").textContent = data.queue; - $("queue").textContent = data.total; + $("speed").set('text', Math.round(data.speed*100)/100); + $("aktiv").set('text', data.queue); + $("queue").set('text', data.total); } function show(){ add_bg.set('opacity', 0); diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 02681a23d..4d499f6fe 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -19,6 +19,8 @@ var EntryManager = new Class({ initialize: function(){ this.json = new Request.JSON({ url: "json/links", + secure: false, + async: true, onSuccess: this.update.bind(this), initialDelay: 0, delay: 2500, @@ -59,8 +61,8 @@ var EntryManager = new Class({ },data).each(function(id){ index = this.ids.indexOf(id); this.entries[index].remove(); - this.entries = this.entries.remove(index); - this.ids = this.ids.remove(index); + this.entries = this.entries.filter(function(item){return item.id != this},id); + this.ids = this.ids.erase(id) }, this); data.links.each(function(link, i){ @@ -97,6 +99,7 @@ var LinkEntry = new Class({ info: $("link_{id}_info".substitute({id: this.id})), kbleft: $("link_{id}_kbleft".substitute({id: this.id})), percent: $("link_{id}_percent".substitute({id: this.id})), + remove: $("link_{id}_remove".substitute({id: this.id})), pgbTr: $("link_{id}_pgb_tr".substitute({id: this.id})), pgb: $("link_{id}_pgb".substitute({id: this.id})) } @@ -104,7 +107,7 @@ var LinkEntry = new Class({ }, insert: function(item){ try{ - info = SecToRightTime(item.eta)+' @ '+Math.round(item.speed*100)/100+' kb/s' ; + info = SecToRightTime(item.eta) +' @ '+ Math.round(item.speed*100)/100+' kb/s' ; this.elements = { tr: new Element('tr', { @@ -125,9 +128,20 @@ var LinkEntry = new Class({ kbleft: new Element('td', { 'html': HumanFileSize(item.size) }), - percent: new Element('td', { + percent: new Element('font', { 'html': item.percent+ '% / '+ HumanFileSize(item.size-item.kbleft) }), + remove: new Element('img',{ + 'html': '', + 'src': 'media/default/img/control_cancel.png', + 'styles':{ + 'vertical-align': 'middle', + 'margin-right': '-20px', + 'margin-left': '5px', + 'margin-top': '-2px', + 'cursor': 'pointer' + } + }), pgbTr: new Element('tr', { 'html':'' }), @@ -136,12 +150,12 @@ var LinkEntry = new Class({ 'styles':{ 'height': '4px', 'width': item.percent+'%', - 'background-color': '#ddd' + 'background-color': '#ddd', } }) } - this.elements.tr.adopt(this.elements.name,this.elements.status,this.elements.info,this.elements.kbleft,this.elements.percent); + this.elements.tr.adopt(this.elements.name,this.elements.status,this.elements.info,this.elements.kbleft,new Element('td').adopt(this.elements.percent,this.elements.remove)); this.elements.pgbTr.adopt(new Element('td',{'colspan':5}).adopt(this.elements.pgb)); this.initEffects(); }catch(e){ @@ -149,9 +163,14 @@ var LinkEntry = new Class({ } }, initEffects: function(){ - this.bar = new Fx.Morph(this.elements.pgb, {unit: '%', duration: 3000, link: 'chain', fps:30}); + this.bar = new Fx.Morph(this.elements.pgb, {unit: '%', duration: 5000, link: 'link', fps:30}); this.fade = new Fx.Tween(this.elements.tr); this.fadeBar = new Fx.Tween(this.elements.pgbTr); + + this.elements.remove.addEvent('click', function(){ + new Request({method: 'get', url: 'json/remove_link/'+this.id}).send(); + }.bind(this)); + }, update: function(item){ this.elements.name.set('text', item.name); @@ -197,7 +216,10 @@ Active Downloads <td id="link_{{ link.id }}_status">{{ link.status }}</td> <td id="link_{{ link.id }}_info">{{ link.info }}</td> <td id="link_{{ link.id }}_kbleft">{{ link.size }}</td> - <td id="link_{{ link.id }}_percent"><font id="link_{{ link.id }}_aktiv_percent">{{ link.percent }}</font>% / <font id="link_{{ link.id }}_aktiv_percent">{{ link.kbleft }}</font></td> + <td> + <font id="link_{{ link.id }}_percent">{{ link.percent }}% /{{ link.kbleft }}</font> + <img id="link_{{ link.id }}_remove" style="vertical-align: middle; margin-right: -20px; margin-left: 5px; margin-top: -2px; cursor:pointer;" src="media/default/img/control_cancel.png"/> + </td> </tr> <tr id="link_{{ link.id }}_pgb_tr"> <td span="5"> diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index daf305892..5f2dc594a 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -1,9 +1,10 @@ +<iframe id="upload_target" name="upload_target" src="" style="display: none; width:0;height:0"></iframe> <div id="add_bg" style="filter:alpha(opacity:80);KHTMLOpacity:0.80;MozOpacity:0.80;opacity:0.80; background:#000; width:100%; height: 100%; position:absolute; top:0px; left:0px; display:none;"> </div> <!--<div id="add_box" style="left:50%; top:200px; margin-left: -450px; width: 900px; position: absolute; background: #FFF; padding: 10px 10px 10px 10px; display:none;">--> <!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>--> <div id="add_box" class="myform"> -<form id="add_form" action="json/add_package" method="post"> +<form id="add_form" action="json/add_package" method="POST" enctype="multipart/form-data"> <h1>Add Package</h1> <p>Paste your links or upload a container.</p> <label>Name @@ -19,7 +20,7 @@ <label>File <span class="small">Upload a container.</span> </label> -<input type="file" name="add_file" id="add_file" /> +<input type="file" name="add_file" id="add_file"/> <button type="submit">Add Package</button> <button id="add_reset" style="margin-left:0px;" type="reset">Reset</button> -- cgit v1.2.3 From 2edf36eb45d427262e9f83af90b8b4fc2f69aab8 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Fri, 15 Jan 2010 15:03:00 +0100 Subject: Better Argument Parsing in Core, littel fixes --- module/network/Request.py | 4 ++++ module/plugins/decrypter/HoerbuchIn.py | 4 ++-- module/plugins/decrypter/SerienjunkiesOrg.py | 22 +++------------------- module/plugins/decrypter/YoutubeChannel.py | 2 +- module/plugins/hoster/MyvideoDe.py | 9 +-------- 5 files changed, 11 insertions(+), 30 deletions(-) (limited to 'module') diff --git a/module/network/Request.py b/module/network/Request.py index 9155185fd..dfe29e62d 100755 --- a/module/network/Request.py +++ b/module/network/Request.py @@ -125,6 +125,8 @@ class Request: def load(self, url, get={}, post={}, ref=True, cookies=False, just_header=False): + url = str(url) + if post: post = urllib.urlencode(post) else: @@ -244,6 +246,8 @@ class Request: def download(self, url, file_name, get={}, post={}, ref=True, cookies=False): + url = str(url) + if post: post = urllib.urlencode(post) else: diff --git a/module/plugins/decrypter/HoerbuchIn.py b/module/plugins/decrypter/HoerbuchIn.py index ae7ae9774..2c3fd4123 100644 --- a/module/plugins/decrypter/HoerbuchIn.py +++ b/module/plugins/decrypter/HoerbuchIn.py @@ -12,8 +12,8 @@ class HoerbuchIn(Plugin): props = {} props['name'] = "HoerbuchIn" props['type'] = "container" - props['pattern'] = r"http://(www\.)?hoerbuch\.in/blog\.php\?id=" - props['version'] = "0.3" + props['pattern'] = r"http://(www\.)?hoerbuch\.in/(blog\.php\?id=|download_(.*)\.html)" + props['version'] = "0.4" props['description'] = """Hoerbuch.in Container Plugin""" props['author_name'] = ("spoob") props['author_mail'] = ("spoob@pyload.org") diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 7302f904e..7d45fd705 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -4,23 +4,7 @@ import re from module.Plugin import Plugin from module.BeautifulSoup import BeautifulSoup - -from htmlentitydefs import name2codepoint as n2cp -def substitute_entity(match): - ent = match.group(2) - if match.group(1) == "#": - return unichr(int(ent)) - else: - cp = n2cp.get(ent) - if cp: - return unichr(cp) - else: - return match.group() - -def decode_htmlentities(string): - entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8});") - return entity_re.subn(substitute_entity, string)[0] - +from module.unescape import unescape class SerienjunkiesOrg(Plugin): def __init__(self, parent): @@ -100,10 +84,10 @@ class SerienjunkiesOrg(Plugin): var = p.findAll("strong") opts = {"Dauer": "", "Uploader": "", "Sprache": "", "Format": "", u"Größe": ""} for v in var: - n = decode_htmlentities(v.string) + n = unescape(v.string) val = v.nextSibling val = val.encode("utf-8") - val = decode_htmlentities(val) + val = unescape(val) val = val.replace("|", "").strip() n = n.strip() n = re.sub(r"^([:]?)(.*?)([:]?)$", r'\2', n) diff --git a/module/plugins/decrypter/YoutubeChannel.py b/module/plugins/decrypter/YoutubeChannel.py index a5751ed7c..ba2ca1472 100644 --- a/module/plugins/decrypter/YoutubeChannel.py +++ b/module/plugins/decrypter/YoutubeChannel.py @@ -44,7 +44,7 @@ class YoutubeChannel(Plugin): if max_results > 50: max_results = 50 url = "http://gdata.youtube.com/feeds/api/users/%s/%s?max-results=%i&start-index=%i" % (self.user, group, max_results, start_index) - rep = self.req.load(str(url)) + rep = self.req.load(url) new_links = re.findall(r"href\='(http:\/\/www.youtube.com\/watch\?v\=[^']+)", rep) if new_links != []: temp_links.extend(new_links) diff --git a/module/plugins/hoster/MyvideoDe.py b/module/plugins/hoster/MyvideoDe.py index f7c087091..0fe315547 100644 --- a/module/plugins/hoster/MyvideoDe.py +++ b/module/plugins/hoster/MyvideoDe.py @@ -1,11 +1,9 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import re from module.Plugin import Plugin class MyvideoDe(Plugin): - def __init__(self, parent): Plugin.__init__(self, parent) props = {} @@ -25,22 +23,17 @@ class MyvideoDe(Plugin): self.html = self.req.load(self.url) def get_file_url(self): - if self.html == None: - self.download_html() videoId = re.search(r"addVariable\('_videoid','(.*)'\);p.addParam\('quality'", self.html).group(1) videoServer = re.search("rel='image_src' href='(.*)thumbs/.*' />", self.html).group(1) file_url = videoServer + videoId + ".flv" return file_url def get_file_name(self): - if self.html == None: - self.download_html() file_name_pattern = r"<h1 class='globalHd'>(.*)</h1>" return re.search(file_name_pattern, self.html).group(1).replace("/", "") + '.flv' def file_exists(self): - if self.html == None: - self.download_html() + self.download_html() self.req.load(str(self.url), cookies=False, just_header=True) if self.req.lastEffectiveURL == "http://www.myvideo.de/": return False -- cgit v1.2.3 From 977e72f7ee17b1622fe09974bb294facc6eb7e81 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 16 Jan 2010 13:35:52 +0100 Subject: Fixed Shareonline --- module/plugins/hoster/ShareonlineBiz.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'module') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index b9a9accef..44ed98b54 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -6,6 +6,7 @@ import re import tempfile from time import time from base64 import b64decode +import hashlib from module.Plugin import Plugin @@ -62,6 +63,7 @@ class ShareonlineBiz(Plugin): if self.api_data["status"] == "NOTFOUND": return self.api_data["filename"] = fields[2] + print self.api_data["filename"] self.api_data["size"] = fields[3] # in bytes self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 -- cgit v1.2.3 From 8d842efb12ee7db88505e3078b626855e55aa4bf Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sun, 17 Jan 2010 18:31:52 +0100 Subject: some fixes, closed #62 ?? --- module/thread_list.py | 5 +++-- module/web/ajax/urls.py | 1 + module/web/ajax/views.py | 8 +++++++- module/web/templates/default/base.html | 26 ++++++++++++++++++++------ module/web/templates/default/queue.html | 13 +++++++++++++ 5 files changed, 44 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/thread_list.py b/module/thread_list.py index 55b21093f..e4952587c 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -201,7 +201,7 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") ip = re.match(".*Current IP Address: (.*)</body>.*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) - self.parent.hookManager.beforeReconnecting(ip) + #self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) @@ -212,10 +212,11 @@ class Thread_List(object): except: ip = "" time.sleep(1) - self.parent.hookManager.afterReconnecting(ip) + #self.parent.hookManager.afterReconnecting(ip) self.parent.logger.info("Reconnected, new IP: " + ip) def stopAllDownloads(self): + self.pause = True for pyfile in self.py_downloading: pyfile.plugin.req.abort = True diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 4decc27b1..7d63ef5a6 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -18,6 +18,7 @@ urlpatterns = patterns('ajax', (r'^queue$', 'views.queue'), (r'^pause$', 'views.pause'), (r'^unpause$', 'views.unpause'), + (r'^cancel$', 'views.cancel'), (r'^packages$', 'views.packages'), (r'^package/(\d+)$', 'views.package'), (r'^link/(\d+)$', 'views.link'), diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index ea092745f..4f136cef9 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -30,7 +30,7 @@ class JsonResponse(HttpResponse): object, indent=2, cls=json.DjangoJSONEncoder, ensure_ascii=False) super(JsonResponse, self).__init__( - content, content_type='application/json') #@TODO uncomment + content)#, content_type='application/json') #@TODO uncomment self['Cache-Control'] = 'no-cache, must-revalidate' @@ -117,6 +117,12 @@ def unpause(request): return HttpResponseServerError() +@permission('pyload.can_change_status') +def cancel(request): + try: + return JsonResponse(settings.PYLOAD.stop_downloads()) + except: + return HttpResponseServerError() @permission('pyload.can_see_dl') def packages(request): diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 0cebeb5d8..692a951bc 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -45,6 +45,20 @@ document.addEvent("domready", function(){ limit: 30000 }) + $('action_play').addEvent('click', function(){ + new Request({method: 'get', url: 'json/unpause'}).send(); + }); + + + $('action_cancel').addEvent('click', function(){ + new Request({method: 'get', url: 'json/cancel'}).send(); + }); + + + $('action_stop').addEvent('click', function(){ + new Request({method: 'get', url: 'json/pause'}).send(); + }); + jsonStatus.startTimer(); }); @@ -58,8 +72,8 @@ document.addEvent("domready", function(){ function LoadJsonToContent(data) { $("speed").set('text', Math.round(data.speed*100)/100); - $("aktiv").set('text', data.queue); - $("queue").set('text', data.total); + $("aktiv").set('text', data.activ); + $("aktiv_from").set('text', data.queue); } function show(){ add_bg.set('opacity', 0); @@ -147,9 +161,9 @@ function AddBox() {% if perms.pyload.can_change_status %} <ul id="page-actions2"> - <li id="action_play"><a href="/json/unpause" class="action play" accesskey="o" rel="nofollow">Play</a></li> - <li id="action_stop"><a href="" class="action cancel" accesskey="o" rel="nofollow">Cancel</a></li> - <li id="action_stop"><a href="/json/pause" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> + <li id="action_play"><a href="#" class="action play" accesskey="o" rel="nofollow">Play</a></li> + <li id="action_cancel"><a href="#" class="action cancel" accesskey="o" rel="nofollow">Cancel</a></li> + <li id="action_stop"><a href="#" class="action stop" accesskey="o" rel="nofollow">Stop</a></li> <li id="action_add"><a href="javascript:AddBox();" class="action stop" accesskey="o" rel="nofollow" >Add</a></li> </ul> {% endif %} @@ -157,7 +171,7 @@ function AddBox() {% if perms.pyload.can_see_dl %} <ul id="page-actions"> <li><a class="action backlink">Speed: <b id="speed">{{ status.speed }}</b> kb/s</a></li> - <li><a class="action cog">Active: <b id="aktiv">{{ status.queue }}</b> / <b id="aktiv_from">{{ status.total }}</b></a></li> + <li><a class="action cog">Active: <b id="aktiv">{{ status.activ }}</b> / <b id="aktiv_from">{{ status.queue }}</b></a></li> <li><a href="" class="action revisions" accesskey="o" rel="nofollow">Reload page</a></li> </ul><br /> {% endif %} diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index e9c1baa92..bc306730e 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -28,4 +28,17 @@ </li> {% endfor %} <ul> + + +<table > + <tr> + <td width=50%><h1>!Paketname!</h1></td> + </tr> + <tr> + <td width=100%><h2>test.png</h2></td> + <td width=100%>loading</td> + <td width=100%><a href="/"><img id="button" src="/img/button-delete.gif" alt="delete" /></a><a href="/"><img id="button" src="/img/button-unpause.gif" alt="unpause" /></a></td> + </tr> +</table> + {% endblock %} -- cgit v1.2.3 From b7ba3d89e802cc5e0ff3725bde72bf24f5f5c786 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 17 Jan 2010 22:19:57 +0100 Subject: Fixed Reconnect --- module/plugins/hoster/ShareonlineBiz.py | 1 - module/thread_list.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/ShareonlineBiz.py b/module/plugins/hoster/ShareonlineBiz.py index 44ed98b54..63d05c47a 100644 --- a/module/plugins/hoster/ShareonlineBiz.py +++ b/module/plugins/hoster/ShareonlineBiz.py @@ -63,7 +63,6 @@ class ShareonlineBiz(Plugin): if self.api_data["status"] == "NOTFOUND": return self.api_data["filename"] = fields[2] - print self.api_data["filename"] self.api_data["size"] = fields[3] # in bytes self.api_data["checksum"] = fields[4].strip().lower().replace("\n\n", "") # md5 diff --git a/module/thread_list.py b/module/thread_list.py index e4952587c..c8580fece 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -202,7 +202,7 @@ class Thread_List(object): self.parent.logger.info("Start reconnect") ip = re.match(".*Current IP Address: (.*)</body>.*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) #self.parent.hookManager.beforeReconnecting(ip) - reconn = subprocess.Popen(self.parent.config['activated']['method'])#, stdout=subprocess.PIPE) + reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) ip = "" -- cgit v1.2.3 From 57639a54f779abaff98a20fb741ce1781748166b Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sun, 17 Jan 2010 23:13:05 +0100 Subject: Fixed Hotfile --- module/plugins/hoster/HotfileCom.py | 56 ++++++++++--------------------------- 1 file changed, 15 insertions(+), 41 deletions(-) (limited to 'module') diff --git a/module/plugins/hoster/HotfileCom.py b/module/plugins/hoster/HotfileCom.py index a046cb6b1..a9853100c 100644 --- a/module/plugins/hoster/HotfileCom.py +++ b/module/plugins/hoster/HotfileCom.py @@ -19,17 +19,18 @@ class HotfileCom(Plugin): props['author_mail'] = ("sitacuisses@yhoo.de","spoob@pyload.org","mkaay@mkaay.de") self.props = props self.parent = parent - self.html = None + self.html = [None, None] self.want_reconnect = False self.multi_dl = False self.htmlwithlink = None self.url = None - + def prepare(self, thread): pyfile = self.parent self.want_reconnect = False - + + self.download_html() pyfile.status.exists = self.file_exists() if not pyfile.status.exists: @@ -45,47 +46,31 @@ class HotfileCom(Plugin): thread.wait(self.parent) pyfile.status.url = self.get_file_url() - return True def download_html(self): self.url = self.parent.url - self.html = self.req.load(self.url) + self.html[0] = self.req.load(self.url, cookies=True) def get_file_url(self): - """ returns the absolute downloadable filepath - """ - if self.html == None: - self.download_html() - if not self.want_reconnect: - self.get_download_page() - file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.htmlwithlink).group(1) - return file_url - else: - return False + form_content = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html[0]).group(0) + form_posts = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", form_content) + self.html[1] = self.req.load(self.url, post=form_posts, cookies=True) + file_url = re.search("a href=\"(http://hotfile\.com/get/\S*?)\"", self.html[1]).group(1) + return file_url def get_file_name(self): - if self.html == None: - self.download_html() - if not self.want_reconnect: - file_name = re.search('Downloading\s<b>(.*?)</b>', self.html).group(1) - return file_name - else: - return self.parent.url + file_name = re.search('Downloading\s<b>(.*?)</b>', self.html[0]).group(1) + return file_name def file_exists(self): - """ returns True or False - """ - if self.html == None: - self.download_html() - if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html) != None: + if re.search(r"Such file does not exist or it has been removed for infringement of copyrights.", self.html[0]) != None: return False - else: - return True + return True def get_wait_time(self): free_limit_pattern = re.compile(r"timerend=d\.getTime\(\)\+(\d+);") - matches = free_limit_pattern.findall(self.html) + matches = free_limit_pattern.findall(self.html[0]) if matches: for match in matches: if int(match) == 60000: @@ -97,14 +82,3 @@ class HotfileCom(Plugin): self.want_reconnect = True return True self.time_plus_wait = time() + 65 - - def get_download_page(self): - herewego = re.search(r"<form style=.*(\n<.*>\s*)*?\n<tr>", self.html).group(0) - all_the_tuples = re.findall(r"<input\stype=hidden\sname=(\S*)\svalue=(\S*)>", herewego) - - self.htmlwithlink = self.req.load(self.url, None, all_the_tuples) - - def proceed(self, url, location): - - self.req.download(url, location) - -- cgit v1.2.3 From c9637984b518bc13c07b28fa4e80c7a9efbd6632 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Mon, 18 Jan 2010 22:23:21 +0100 Subject: Webinterface - Queue style update --- module/web/media/default/css/default.css | 19 ++++++--- module/web/media/default/img/folder.png | Bin 0 -> 537 bytes module/web/templates/default/queue.html | 66 +++++++++++++------------------ 3 files changed, 41 insertions(+), 44 deletions(-) create mode 100644 module/web/media/default/img/folder.png (limited to 'module') diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 2d10c569b..392d828f1 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1465,13 +1465,22 @@ div.codearea pre span.Preprc { float:left; padding-right: 8px; } -.queue { - - border: none; +.package { + margin-bottom: 20px; +} +.packagename { + background: url(/media/default/img/folder.png) no-repeat; + padding-left: 20px; + font-weight: bold; + text-transform: uppercase; +} +.child { + margin-left: 20px; } -.queue tr td { - border: none; +.child_status { + width: 20px; } + .header, .header th { text-align: left; font-weight: normal; diff --git a/module/web/media/default/img/folder.png b/module/web/media/default/img/folder.png new file mode 100644 index 000000000..784e8fa48 Binary files /dev/null and b/module/web/media/default/img/folder.png differ diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index bc306730e..299452bc1 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -3,42 +3,30 @@ {% block title %}Queue - {{block.super}} {% endblock %} {% block menu %} -<li> - <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> -</li> -<li class="selected"> - <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> -<li> - <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> -<li class="right"> - <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> -</li> -{% endblock %} - -{% block content %} -<ul id="queue"> - {% for package in content %} - <li class="package"> - <span class="packagename">{{ package.package_name }}</span> - <ul class="children"> - {% for child in package.children %} - <li class="child">{{ child.filename }}</li> - {% endfor %} - </ul> - </li> - {% endfor %} -<ul> - - -<table > - <tr> - <td width=50%><h1>!Paketname!</h1></td> - </tr> - <tr> - <td width=100%><h2>test.png</h2></td> - <td width=100%>loading</td> - <td width=100%><a href="/"><img id="button" src="/img/button-delete.gif" alt="delete" /></a><a href="/"><img id="button" src="/img/button-unpause.gif" alt="unpause" /></a></td> - </tr> -</table> - -{% endblock %} +<li> <a href="{% url home %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-home.png" alt="" /> Home</a> </li> +<li class="selected"> <a href="{% url queue %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-download.png" alt="" /> Queue</a></li> +<li> <a href="{% url downloads %}" title=""><img src="{{ MEDIA_URL }}img/head-menu-development.png" alt="" /> Downloads</a></li> +<li class="right"> <a href="{% url logs %}" class="action index" accesskey="x" rel="nofollow"><img src="{{ MEDIA_URL }}img/head-menu-index.png" alt="" />Logs</a> </li> +{% endblock %} + +{% block content %} +{% for package in content %} +<div class="package"> <div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }}</div> + <div class="children"> + {% for child in package.children %} + <div class="child"><span class="child_status"> {{ child.status }}</span>{{ child.filename }}</div> + {% endfor %} + </div> +</div> +{% endfor %} +<!--table > + <tr> + <td colspan="3"><h1>!Paketname!</h1></td> + </tr> + <tr> + <td><h2>test.png</h2></td> + <td>loading</td> + <td><a href="/"><img id="button" src="/img/button-delete.gif" alt="delete" /></a><a href="/"><img id="button" src="/img/button-unpause.gif" alt="unpause" /></a></td> + </tr> +</table--> +{% endblock %} \ No newline at end of file -- cgit v1.2.3 From 5131657cc5ba16df1a39b36c2d0a316cc801e737 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Mon, 18 Jan 2010 22:37:21 +0100 Subject: webinterface - queue style update --- module/web/media/default/css/default.css | 5 ++++- module/web/media/default/img/delete.png | Bin 0 -> 715 bytes module/web/templates/default/queue.html | 9 +++++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 module/web/media/default/img/delete.png (limited to 'module') diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index 392d828f1..d7756e314 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1478,7 +1478,10 @@ div.codearea pre span.Preprc { margin-left: 20px; } .child_status { - width: 20px; + margin-right: 10px; +} +.child_secrow { + font-size: 10px; } .header, .header th { diff --git a/module/web/media/default/img/delete.png b/module/web/media/default/img/delete.png new file mode 100644 index 000000000..08f249365 Binary files /dev/null and b/module/web/media/default/img/delete.png differ diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index 299452bc1..ff1f35052 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -11,10 +11,15 @@ {% block content %} {% for package in content %} -<div class="package"> <div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }}</div> +<div class="package"><div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }} <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div> <div class="children"> {% for child in package.children %} - <div class="child"><span class="child_status"> {{ child.status }}</span>{{ child.filename }}</div> + <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> + <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> + <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> {% endfor %} </div> </div> -- cgit v1.2.3 From 0a0b9a792d4d89d3ecdfbbc79cf05eb349407959 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Mon, 18 Jan 2010 22:46:06 +0100 Subject: Webinterface - Queue style update NUMBER 3! --- module/web/media/default/img/arrow_refresh.png | Bin 0 -> 685 bytes module/web/templates/default/queue.html | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 module/web/media/default/img/arrow_refresh.png (limited to 'module') diff --git a/module/web/media/default/img/arrow_refresh.png b/module/web/media/default/img/arrow_refresh.png new file mode 100644 index 000000000..0de26566d Binary files /dev/null and b/module/web/media/default/img/arrow_refresh.png differ diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index ff1f35052..7c78ac45b 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -11,15 +11,15 @@ {% block content %} {% for package in content %} -<div class="package"><div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }} <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div> +<div class="package"><div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }} <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div> <div class="children"> {% for child in package.children %} <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a></div></div> + <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> {% endfor %} </div> </div> -- cgit v1.2.3 From 631c011b5e0618eb2cb0d709f803c60875d61e97 Mon Sep 17 00:00:00 2001 From: Wugy <wugy@mally-soft.com> Date: Mon, 18 Jan 2010 23:00:32 +0100 Subject: webinterface - status icons --- module/web/media/default/img/accept.png | Bin 0 -> 781 bytes module/web/media/default/img/clock_play.png | Bin 0 -> 943 bytes module/web/media/default/img/clock_red.png | Bin 0 -> 889 bytes module/web/media/default/img/stop.png | Bin 0 -> 700 bytes 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 module/web/media/default/img/accept.png create mode 100644 module/web/media/default/img/clock_play.png create mode 100644 module/web/media/default/img/clock_red.png create mode 100644 module/web/media/default/img/stop.png (limited to 'module') diff --git a/module/web/media/default/img/accept.png b/module/web/media/default/img/accept.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/module/web/media/default/img/accept.png differ diff --git a/module/web/media/default/img/clock_play.png b/module/web/media/default/img/clock_play.png new file mode 100644 index 000000000..fb4ebc850 Binary files /dev/null and b/module/web/media/default/img/clock_play.png differ diff --git a/module/web/media/default/img/clock_red.png b/module/web/media/default/img/clock_red.png new file mode 100644 index 000000000..2842cc338 Binary files /dev/null and b/module/web/media/default/img/clock_red.png differ diff --git a/module/web/media/default/img/stop.png b/module/web/media/default/img/stop.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/module/web/media/default/img/stop.png differ -- cgit v1.2.3 From 07f280a220ab5bc5c3fb510ea00aecedfcec7564 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Wed, 20 Jan 2010 19:41:43 +0100 Subject: queue page fully functional, some fixes --- module/file_list.py | 1 + module/web/ajax/urls.py | 6 +- module/web/ajax/views.py | 44 ++++++++- module/web/media/default/css/default.css | 15 ++- module/web/media/default/img/progress-bar-back.gif | Bin 10819 -> 0 bytes module/web/media/default/img/progress-bar.gif | Bin 10819 -> 0 bytes module/web/media/default/img/progressbar.gif | Bin 120 -> 0 bytes module/web/media/default/img/progressbg_black.gif | Bin 1626 -> 0 bytes module/web/media/default/img/progressbg_green.gif | Bin 1308 -> 0 bytes module/web/media/default/img/progressbg_orange.gif | Bin 1308 -> 0 bytes module/web/media/default/img/progressbg_red.gif | Bin 1308 -> 0 bytes module/web/media/default/img/progressbg_yellow.gif | Bin 1308 -> 0 bytes module/web/pyload/views.py | 4 +- module/web/templates/default/base.html | 8 +- module/web/templates/default/home.html | 4 +- module/web/templates/default/queue.html | 106 +++++++++++++++++++-- module/web/templates/default/window.html | 2 +- 17 files changed, 165 insertions(+), 25 deletions(-) delete mode 100644 module/web/media/default/img/progress-bar-back.gif delete mode 100644 module/web/media/default/img/progress-bar.gif delete mode 100644 module/web/media/default/img/progressbar.gif delete mode 100644 module/web/media/default/img/progressbg_black.gif delete mode 100644 module/web/media/default/img/progressbg_green.gif delete mode 100644 module/web/media/default/img/progressbg_orange.gif delete mode 100644 module/web/media/default/img/progressbg_red.gif delete mode 100644 module/web/media/default/img/progressbg_yellow.gif (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index ef47df6d9..2a7ecb191 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -167,6 +167,7 @@ class File_List(object): info["status_url"] = pyfile.status.url info["status_filename"] = pyfile.status.filename info["status_error"] = pyfile.status.error + info["size"] = pyfile.status.size() info["active"] = pyfile.active info["plugin"] = pyfile.plugin.props['name'] return info diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 7d63ef5a6..d50e7121e 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -12,7 +12,7 @@ urlpatterns = patterns('ajax', # Uncomment the next line to enable the admin: (r'^add_package$', 'views.add_package'), - (r'^remove_link/(\d+)$', 'views.remove_link'), + (r'^abort_link/(\d+)$', 'views.abort_link'), (r'^status$', 'views.status'), (r'^links$', 'views.links'), #currently active links (r'^queue$', 'views.queue'), @@ -22,4 +22,8 @@ urlpatterns = patterns('ajax', (r'^packages$', 'views.packages'), (r'^package/(\d+)$', 'views.package'), (r'^link/(\d+)$', 'views.link'), + (r'^remove_package/(\d+)$', 'views.remove_package'), + (r'^restart_package/(\d+)$', 'views.restart_package'), + (r'^remove_link/(\d+)$', 'views.remove_link'), + (r'^restart_link/(\d+)$', 'views.restart_link'), ) \ No newline at end of file diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index 4f136cef9..4d9762ab4 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -39,16 +39,15 @@ def add_package(request): name = request.POST['add_name'] - if name == None or name == "": - return HttpResponseServerError() - links = request.POST['add_links'].replace(" ","\n").split("\n") try: f = request.FILES['add_file'] - print f + + if name == None or name == "": + name = f.name + fpath = join(settings.DL_ROOT, f.name) - print fpath destination = open(fpath, 'wb') for chunk in f.chunks(): destination.write(chunk) @@ -57,6 +56,9 @@ def add_package(request): except: pass + if name == None or name == "": + return HttpResponseServerError() + links = filter(lambda x: x != "", links) settings.PYLOAD.add_package(name, links) @@ -160,3 +162,35 @@ def link(request, id): except: return HttpResponseServerError() + +@permission('pyload.can_add_dl') +def remove_package(request, id): + try: + settings.PYLOAD.del_packages([int(id)]) + return JsonResponse("sucess") + except: + return HttpResponseServerError() + +@permission('pyload.can_add_dl') +def restart_package(request, id): + try: + settings.PYLOAD.restart_package(int(id)) + return JsonResponse("sucess") + except: + return HttpResponseServerError() + +@permission('pyload.can_add_dl') +def restart_link(request, id): + try: + settings.PYLOAD.restart_file(int(id)) + return JsonResponse("sucess") + except: + return HttpResponseServerError() + +@permission('pyload.can_add_dl') +def abort_link(request, id): + try: + settings.PYLOAD.stop_download("link", int(id)) + return JsonResponse("sucess") + except: + return HttpResponseServerError() \ No newline at end of file diff --git a/module/web/media/default/css/default.css b/module/web/media/default/css/default.css index d7756e314..3c4762012 100644 --- a/module/web/media/default/css/default.css +++ b/module/web/media/default/css/default.css @@ -1466,7 +1466,7 @@ div.codearea pre span.Preprc { padding-right: 8px; } .package { - margin-bottom: 20px; + margin-bottom: 10px; } .packagename { background: url(/media/default/img/folder.png) no-repeat; @@ -1495,3 +1495,16 @@ div.codearea pre span.Preprc { height: 5px; } + +.queue { + border: none +} + +.queue tr td { + border: none +} + +.header, .header th{ + text-align: left; + font-weight: normal; +} \ No newline at end of file diff --git a/module/web/media/default/img/progress-bar-back.gif b/module/web/media/default/img/progress-bar-back.gif deleted file mode 100644 index 0c8f68211..000000000 Binary files a/module/web/media/default/img/progress-bar-back.gif and /dev/null differ diff --git a/module/web/media/default/img/progress-bar.gif b/module/web/media/default/img/progress-bar.gif deleted file mode 100644 index 746f77175..000000000 Binary files a/module/web/media/default/img/progress-bar.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbar.gif b/module/web/media/default/img/progressbar.gif deleted file mode 100644 index abe588c15..000000000 Binary files a/module/web/media/default/img/progressbar.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbg_black.gif b/module/web/media/default/img/progressbg_black.gif deleted file mode 100644 index 74fd1f9b3..000000000 Binary files a/module/web/media/default/img/progressbg_black.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbg_green.gif b/module/web/media/default/img/progressbg_green.gif deleted file mode 100644 index f3f3bf681..000000000 Binary files a/module/web/media/default/img/progressbg_green.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbg_orange.gif b/module/web/media/default/img/progressbg_orange.gif deleted file mode 100644 index 808cac7cf..000000000 Binary files a/module/web/media/default/img/progressbg_orange.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbg_red.gif b/module/web/media/default/img/progressbg_red.gif deleted file mode 100644 index 54dfa135f..000000000 Binary files a/module/web/media/default/img/progressbg_red.gif and /dev/null differ diff --git a/module/web/media/default/img/progressbg_yellow.gif b/module/web/media/default/img/progressbg_yellow.gif deleted file mode 100644 index fdb0dfc98..000000000 Binary files a/module/web/media/default/img/progressbg_yellow.gif and /dev/null differ diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index 994075001..d72dca56c 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -111,7 +111,7 @@ def downloads(request): return render_to_response(join(settings.TEMPLATE, 'downloads.html'), RequestContext(request, {'files': data}, [status_proc])) @login_required -@permission('pyload.user.can_download') +@permission('pyload.can_download') @check_server def download(request, path): path = path.split("/") @@ -143,7 +143,7 @@ def download(request, path): return HttpResponseNotFound("File not Found.") @login_required -@permission('pyload.user.can_see_logs') +@permission('pyload.can_see_logs') @check_server def logs(request, page=0): diff --git a/module/web/templates/default/base.html b/module/web/templates/default/base.html index 692a951bc..2a2490088 100644 --- a/module/web/templates/default/base.html +++ b/module/web/templates/default/base.html @@ -36,7 +36,7 @@ document.addEvent("domready", function(){ }); var jsonStatus = new Request.JSON({ - url: "json/status", + url: "/json/status", onSuccess: LoadJsonToContent, secure: false, async: true, @@ -46,17 +46,17 @@ document.addEvent("domready", function(){ }) $('action_play').addEvent('click', function(){ - new Request({method: 'get', url: 'json/unpause'}).send(); + new Request({method: 'get', url: '/json/unpause'}).send(); }); $('action_cancel').addEvent('click', function(){ - new Request({method: 'get', url: 'json/cancel'}).send(); + new Request({method: 'get', url: '/json/cancel'}).send(); }); $('action_stop').addEvent('click', function(){ - new Request({method: 'get', url: 'json/pause'}).send(); + new Request({method: 'get', url: '/json/pause'}).send(); }); jsonStatus.startTimer(); diff --git a/module/web/templates/default/home.html b/module/web/templates/default/home.html index 4d499f6fe..ab2135800 100644 --- a/module/web/templates/default/home.html +++ b/module/web/templates/default/home.html @@ -168,7 +168,7 @@ var LinkEntry = new Class({ this.fadeBar = new Fx.Tween(this.elements.pgbTr); this.elements.remove.addEvent('click', function(){ - new Request({method: 'get', url: 'json/remove_link/'+this.id}).send(); + new Request({method: 'get', url: '/json/abort_link/'+this.id}).send(); }.bind(this)); }, @@ -222,7 +222,7 @@ Active Downloads </td> </tr> <tr id="link_{{ link.id }}_pgb_tr"> - <td span="5"> + <td colspan="5"> <div id="link_{{ link.id }}_pgb" class="progressBar" style="background-color: green; height:4px; width: {{ link.percent }}%;"> </div> </td> </tr> diff --git a/module/web/templates/default/queue.html b/module/web/templates/default/queue.html index 7c78ac45b..aa21390a0 100644 --- a/module/web/templates/default/queue.html +++ b/module/web/templates/default/queue.html @@ -1,5 +1,76 @@ {% extends 'default/base.html' %} +{% block head %} +<script type="text/javascript"> + +document.addEvent("domready", function(){ + $$('.package').each(function(item){ + id = item.get('id').match(/[0-9]+/) + + imgs = item.getElements('img'); + imgs[0].addEvent('click', function(e){ + new Request({ + method: 'get', + url: '/json/remove_package/'+this, + onSuccess: function(){ + $('package_'+this).nix() + }.bind(this) + }).send(); + e.stop(); + }.bind(id)); + + imgs[1].addEvent('click', function(e){ + new Request({ + method: 'get', + url: '/json/restart_package/'+this, + onSuccess: function(){ + $('package_'+this).nix() + }.bind(this) + }).send(); + e.stop(); + }.bind(id)); + + + item.getElement('.packagename').addEvent('click', function(){ + + child = item.getElement('.children') + if (child.getStyle('display') == "block"){ + child.dissolve(); + }else{ + child.reveal(); + } + }.bind(item)); + + + item.getElements('.child').each(function(child){ + id = child.get('id').match(/[0-9]+/) + imgs = child.getElements('.child_secrow img') + imgs[0].addEvent('click', function(e){ + new Request({ + method: 'get', + url: '/json/remove_link/'+this, + onSuccess: function(){ + $('file_'+this).nix() + }.bind(this) + }).send(); + }.bind(id)); + + imgs[1].addEvent('click', function(e){ + new Request({ + method: 'get', + url: '/json/restart_link/'+this, + onSuccess: function(){ + $('file_'+this).nix() + }.bind(this) + }).send(); + }.bind(id)); + }); + + }) +}); +</script> +{% endblock %} + {% block title %}Queue - {{block.super}} {% endblock %} {% block menu %} @@ -11,17 +82,34 @@ {% block content %} {% for package in content %} -<div class="package"><div class="packagename" onclick="javascript: PackegeShower();">{{ package.package_name }} <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div> - <div class="children"> +<div id="package_{{package.id}}" class="package"> + <div class="packagename" style="cursor: pointer;"> + {{ package.package_name }} + + <img width="12px" height="12px" src="{{ MEDIA_URL }}img/delete.png" /> + + <img style="margin-left: -10px" height="12px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /> + </div> + <div id="children_{{package.id}}" style="display: none;" class="children"> {% for child in package.children %} - <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> - <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> - <div class="child"><span class="child_status">hierkommteinicondasaufdenstatusabgestimmtist</span>{{ child.filename }}<br /> - <div class="child_secrow"><span class="child_status">Downloaded</span> <span class="child_status">100 MB</span> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /></a> <a href=""><img width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /></a></div></div> + <div class="child" id="file_{{child.id}}"> + <span class="child_status"> + <img src="/media/default/img/status_{{child.status_type}}.png" style="width: 12px; height:12px;"/> + </span> + <span style="font-size: 15px">{{ child.filename }}</span><br /> + <div class="child_secrow"> + <span class="child_status">{{ child.status_type }}</span>{{child.status_error}} + <span class="child_status">{{ child.size }} KB</span> + <span class="child_status">{{ child.plugin }}</span> + <span class="child_status">Folder: {{child.folder}}</span> + + <img style="cursor: pointer;" width="10px" height="10px" src="{{ MEDIA_URL }}img/delete.png" /> + + <img style="cursor: pointer;margin-left: -4px" width="10px" height="10px" src="{{ MEDIA_URL }}img/arrow_refresh.png" /> + </div> + </div> {% endfor %} - </div> + </div> </div> {% endfor %} <!--table > diff --git a/module/web/templates/default/window.html b/module/web/templates/default/window.html index 5f2dc594a..7e5c249e6 100644 --- a/module/web/templates/default/window.html +++ b/module/web/templates/default/window.html @@ -4,7 +4,7 @@ <!--<div style="width: 900px; text-align: right;"><b onclick="AddBox();">[Close]</b></div>--> <div id="add_box" class="myform"> -<form id="add_form" action="json/add_package" method="POST" enctype="multipart/form-data"> +<form id="add_form" action="/json/add_package" method="POST" enctype="multipart/form-data"> <h1>Add Package</h1> <p>Paste your links or upload a container.</p> <label>Name -- cgit v1.2.3 From bdb3deb371bbbcb5452e97ee560b793834d1a3f3 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Thu, 21 Jan 2010 19:39:27 +0100 Subject: fixed link deletion --- module/file_list.py | 2 +- module/gui/Queue.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 2a7ecb191..bbea40e23 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -326,7 +326,7 @@ class File_List(object): key, n, pyfile, pypack, pid = packager._getFileFromID(id) pyfile.plugin.req.abort = True sleep(0.1) - del pypack.files[n] + packager.removeFileFromPackage(id, pid) if not pypack.files: packager.removePackage(pid) finally: diff --git a/module/gui/Queue.py b/module/gui/Queue.py index be2170309..8681d3bb1 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -298,9 +298,8 @@ class Queue(QObject): return remove.sort() remove.reverse() - parent = self for k in remove: - parent.takeChild(k) + self.takeChild(k) class QueueFile(QTreeWidgetItem): def __init__(self, queue, pack): -- cgit v1.2.3 From f34d216d292c5608a2011db0c406ef9c3fc01181 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Thu, 21 Jan 2010 21:16:01 +0100 Subject: Fixed Netload Wait --- module/plugins/container/DLC.pyc | Bin 5713 -> 5720 bytes module/plugins/hoster/NetloadIn.py | 8 ++++---- module/plugins/hoster/UploadedTo.py | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) (limited to 'module') diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc index 5dd89b5dd..6078f640e 100644 Binary files a/module/plugins/container/DLC.pyc and b/module/plugins/container/DLC.pyc differ diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index 0e5245e9e..a4c274c04 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -50,8 +50,8 @@ class NetloadIn(Plugin): pyfile.status.url = self.parent.url return True - self.download_html() while not pyfile.status.url: + self.download_html() self.get_wait_time() pyfile.status.waituntil = self.time_plus_wait pyfile.status.want_reconnect = self.want_reconnect @@ -106,8 +106,6 @@ class NetloadIn(Plugin): break def get_file_url(self): - """ returns the absolute downloadable filepath - """ try: file_url_pattern = r"<a class=\"Orange_Link\" href=\"(http://.+)\" >Click here" return re.search(file_url_pattern, self.html[2]).group(1) @@ -116,8 +114,10 @@ class NetloadIn(Plugin): def get_wait_time(self): if re.search(r"We had a reqeust with the IP", self.html[2]): + wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True - self.time_plus_wait = time() + 10 * 30 + print wait_minutes + self.time_plus_wait = time() + wait_minutes * 60 return wait_seconds = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 100 diff --git a/module/plugins/hoster/UploadedTo.py b/module/plugins/hoster/UploadedTo.py index df7d577f9..619c9bba1 100644 --- a/module/plugins/hoster/UploadedTo.py +++ b/module/plugins/hoster/UploadedTo.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- import re @@ -97,8 +96,6 @@ class UploadedTo(Plugin): self.time_plus_wait = 0 def get_file_url(self): - """ returns the absolute downloadable filepath - """ if self.config['premium']: self.start_dl = True return self.parent.url -- cgit v1.2.3 From 4eb1404eca2b795d809ee626a057a543043060cb Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Thu, 21 Jan 2010 22:13:21 +0100 Subject: some optimizations --- module/Plugin.py | 3 +-- module/download_thread.py | 7 +++++-- module/file_list.py | 1 + module/plugins/Hook.py | 2 -- 4 files changed, 7 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/Plugin.py b/module/Plugin.py index 2e61a1b55..5006da8dd 100644 --- a/module/Plugin.py +++ b/module/Plugin.py @@ -19,12 +19,11 @@ import logging import re -from os.path import exists, join +from os.path import exists from time import sleep from module.network.Request import Request -from module.XMLConfigParser import XMLConfigParser from module.download_thread import CaptchaError diff --git a/module/download_thread.py b/module/download_thread.py index a07f4511f..4a031a04c 100644 --- a/module/download_thread.py +++ b/module/download_thread.py @@ -49,7 +49,8 @@ class Status(object): return self.pyfile.plugin.req.dl_size / 1024 def percent(self): if not self.kB_left() == 0 and not self.size() == 0: - return ((self.size()-self.kB_left()) * 100) / self.size() + percent = ((self.size()-self.kB_left()) * 100) / self.size() + return percent if percent < 101 else 0 return 0 class Reconnect(Exception): @@ -115,7 +116,9 @@ class Download_Thread(threading.Thread): self.loadedPyFile.status.error = str(e) finally: self.parent.job_finished(self.loadedPyFile) - sleep(0.5) + else: + sleep(3) + sleep(0.8) if self.shutdown: sleep(1) self.parent.remove_thread(self) diff --git a/module/file_list.py b/module/file_list.py index bbea40e23..2785afdb2 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -144,6 +144,7 @@ class File_List(object): return files def getAllFiles(self): + files = [] for pypack in self.data["queue"] + self.data["packages"]: for pyfile in pypack.files: diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 6f8a48802..541d0c2e9 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -19,9 +19,7 @@ """ import logging -from os.path import join -from module.XMLConfigParser import XMLConfigParser class Hook(): def __init__(self, core): -- cgit v1.2.3 From f0914124436b8f66d296ef0d3d0e0f289f5a1aa6 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Fri, 22 Jan 2010 19:21:59 +0100 Subject: some final tweaks --- module/file_list.py | 68 +++++++++++++++++---------------------------------- module/thread_list.py | 11 ++++----- 2 files changed, 27 insertions(+), 52 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 2785afdb2..e87fec3dd 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -28,6 +28,7 @@ from download_thread import Status import cPickle import re import module.Plugin +from operator import concat from os import sep from time import sleep @@ -95,24 +96,10 @@ class File_List(object): "packages": [], "collector": [] } - packages = [] - queue = [] - collector = [] - for p in self.data["packages"]: - pd = PyLoadPackageData() - pd.set(p) - packages.append(pd) - for p in self.data["queue"]: - pd = PyLoadPackageData() - pd.set(p) - queue.append(pd) - for f in self.data["collector"]: - fd = PyLoadFileData() - fd.set(f) - collector.append(fd) - pdata["packages"] = packages - pdata["queue"] = queue - pdata["collector"] = collector + + pdata["packages"] = map(PyLoadPackageData().set, self.data["packages"]) + pdata["queue"] = map(PyLoadPackageData().set, self.data["queue"]) + pdata["collector"] = map(PyLoadFileData().set, self.data["collector"]) output = open('module' + sep + 'links.pkl', 'wb') cPickle.dump(pdata, output, -1) @@ -122,37 +109,26 @@ class File_List(object): def queueEmpty(self): return (self.data["queue"] == []) - def getDownloadList(self): + def getDownloadList(self, occ): """ - for thread_list only + for thread_list only, returns all elements that are suitable for downloadthread """ files = [] - for pypack in self.data["queue"]: - for pyfile in pypack.files: - if pyfile.status.type == None and pyfile.plugin.props['type'] == "container" and not pyfile.active: - files.append(pyfile) - for pypack in self.data["packages"]: - for pyfile in pypack.files: - if pyfile.status.type == None and pyfile.plugin.props['type'] == "container" and pyfile.plugin.decryptNow and not pyfile.active: - files.append(pyfile) - for pypack in self.data["queue"]: - for pyfile in pypack.files: - if pyfile in files: - continue - if (pyfile.status.type == "reconnected" or pyfile.status.type == None) and not pyfile.active: - files.append(pyfile) - return files + files += [[x for x in p.files if x.status.type == None and x.plugin.props['type'] == "container" and not x.active] for p in self.data["queue"] + self.data["packages"]] + files += [[x for x in p.files if (x.status.type == None or x.status.type == "reconnected") and not x.active and not x.modul.__name__ in occ] for p in self.data["queue"]] + + return reduce(concat, files, []) def getAllFiles(self): files = [] for pypack in self.data["queue"] + self.data["packages"]: - for pyfile in pypack.files: - files.append(pyfile) + files += pypack.files return files def countDownloads(self): - return len(self.getDownloadList()) + """ simply return len of all files in all packages(which have no type) in queue and collector""" + return len(reduce(concat, [[x for x in p.files if x.status.type == None] for p in self.data["queue"] + self.data["packages"]], [])) def getFileInfo(self, id): try: @@ -465,7 +441,7 @@ class PyLoadFileData(): self.filename = None self.status_type = None self.status_url = None - + def set(self, pyfile): self.id = pyfile.id self.url = pyfile.url @@ -476,7 +452,9 @@ class PyLoadFileData(): self.status_url = pyfile.status.url self.status_filename = pyfile.status.filename self.status_error = pyfile.status.error - + + return self + def get(self, pyfile): pyfile.id = self.id pyfile.url = self.url @@ -495,14 +473,12 @@ class PyLoadPackageData(): def __init__(self): self.data = None self.files = [] - + def set(self, pypack): self.data = pypack.data - for pyfile in pypack.files: - fdata = PyLoadFileData() - fdata.set(pyfile) - self.files.append(fdata) - + self.files = map(PyLoadFileData().set, pypack.files) + return self + def get(self, pypack, fl): pypack.data = self.data for fdata in self.files: diff --git a/module/thread_list.py b/module/thread_list.py index c8580fece..9211c7c2e 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -40,7 +40,8 @@ class Thread_List(object): self.reconnecting = False self.select_thread() - self.speedManager = self.SpeedManager(self) + if self.parent.config['general']['download_speed_limit'] != 0: + self.speedManager = self.SpeedManager(self) def create_thread(self): """ creates thread for Py_Load_File and append thread to self.threads @@ -69,12 +70,10 @@ class Thread_List(object): self.lock.acquire() pyfile = None - for f in self.list.getDownloadList(): - if not f.modul.__name__ in self.occ_plugins: - pyfile = f - break + pyfiles = self.list.getDownloadList(self.occ_plugins) - if pyfile: + if pyfiles: + pyfile = pyfiles[0] self.py_downloading.append(pyfile) self.parent.hookManager.downloadStarts(pyfile) if not pyfile.plugin.multi_dl: -- cgit v1.2.3 From 768ff9cbb3c61547e757584ab6dd737159fe9b37 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Fri, 22 Jan 2010 19:37:14 +0100 Subject: file_list save fix --- module/file_list.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index e87fec3dd..4e69bfdef 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -97,9 +97,9 @@ class File_List(object): "collector": [] } - pdata["packages"] = map(PyLoadPackageData().set, self.data["packages"]) - pdata["queue"] = map(PyLoadPackageData().set, self.data["queue"]) - pdata["collector"] = map(PyLoadFileData().set, self.data["collector"]) + pdata["packages"] = [PyLoadPackageData().set(x) for x in self.data["packages"]] + pdata["queue"] = [PyLoadPackageData().set(x) for x in self.data["queue"]] + pdata["collector"] = [PyLoadFileData().set(x) for x in self.data["collector"]] output = open('module' + sep + 'links.pkl', 'wb') cPickle.dump(pdata, output, -1) @@ -476,7 +476,7 @@ class PyLoadPackageData(): def set(self, pypack): self.data = pypack.data - self.files = map(PyLoadFileData().set, pypack.files) + self.files = [PyLoadFileData().set(x) for x in pypack.files] return self def get(self, pypack, fl): -- cgit v1.2.3 From ae550575a710201df8e7f928d8ba743b4cc4e532 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 23 Jan 2010 13:58:40 +0100 Subject: Removed Prints --- module/plugins/hoster/NetloadIn.py | 1 - 1 file changed, 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hoster/NetloadIn.py b/module/plugins/hoster/NetloadIn.py index a4c274c04..46afc4080 100644 --- a/module/plugins/hoster/NetloadIn.py +++ b/module/plugins/hoster/NetloadIn.py @@ -116,7 +116,6 @@ class NetloadIn(Plugin): if re.search(r"We had a reqeust with the IP", self.html[2]): wait_minutes = int(re.search(r"countdown\((.+),'change\(\)'\)", self.html[2]).group(1)) / 6000 self.want_reconnect = True - print wait_minutes self.time_plus_wait = time() + wait_minutes * 60 return -- cgit v1.2.3 From 6e128ed3339739e2e25441f42b21eff078330fe0 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Sat, 23 Jan 2010 14:02:22 +0100 Subject: Removed Prints in DLC --- module/plugins/container/DLC.pyc | Bin 5720 -> 5923 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'module') diff --git a/module/plugins/container/DLC.pyc b/module/plugins/container/DLC.pyc index 6078f640e..14d5d39a4 100644 Binary files a/module/plugins/container/DLC.pyc and b/module/plugins/container/DLC.pyc differ -- cgit v1.2.3 From 9aa8ca3b24133bef767f0eb8508e276fa7f92ee9 Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Sat, 23 Jan 2010 15:51:19 +0100 Subject: added missing icons, final improvments --- module/file_list.py | 19 +++++++------------ module/web/media/default/img/accept.png | Bin 781 -> 0 bytes module/web/media/default/img/clock_play.png | Bin 943 -> 0 bytes module/web/media/default/img/clock_red.png | Bin 889 -> 0 bytes module/web/media/default/img/status_None.png | Bin 0 -> 7613 bytes module/web/media/default/img/status_aborted.png | Bin 0 -> 700 bytes module/web/media/default/img/status_downloading.png | Bin 0 -> 943 bytes module/web/media/default/img/status_failed.png | Bin 0 -> 700 bytes module/web/media/default/img/status_finished.png | Bin 0 -> 781 bytes module/web/media/default/img/status_waiting.png | Bin 0 -> 889 bytes module/web/media/default/img/stop.png | Bin 700 -> 0 bytes module/web/media/img/favicon.ico | Bin 0 -> 7206 bytes module/web/pyload/views.py | 5 +---- 13 files changed, 8 insertions(+), 16 deletions(-) delete mode 100644 module/web/media/default/img/accept.png delete mode 100644 module/web/media/default/img/clock_play.png delete mode 100644 module/web/media/default/img/clock_red.png create mode 100644 module/web/media/default/img/status_None.png create mode 100644 module/web/media/default/img/status_aborted.png create mode 100644 module/web/media/default/img/status_downloading.png create mode 100644 module/web/media/default/img/status_failed.png create mode 100644 module/web/media/default/img/status_finished.png create mode 100644 module/web/media/default/img/status_waiting.png delete mode 100644 module/web/media/default/img/stop.png create mode 100644 module/web/media/img/favicon.ico (limited to 'module') diff --git a/module/file_list.py b/module/file_list.py index 4e69bfdef..1c4c4776b 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -29,6 +29,7 @@ import cPickle import re import module.Plugin from operator import concat +from operator import attrgetter from os import sep from time import sleep @@ -150,10 +151,7 @@ class File_List(object): return info def continueAborted(self): - for pypack in self.data["queue"]: - for pyfile in pypack.files: - if pyfile.status.type == "aborted": - self.packager.resetFileStatus(pyfile.id) + [[self.packager.resetFileStatus(x.id) for x in p.files if x.status.type == "aborted"] for p in self.data["queue"]] class pyLoadCollector(): def __init__(collector, file_list): @@ -176,8 +174,7 @@ class File_List(object): for pypack in (collector.file_list.data["packages"] + collector.file_list.data["queue"]): for pyf in pypack.files: ids.append(pyf.id) - for pyfile in collector.file_list.data["collector"]: - ids.append(pyfile.id) + ids += map(attrgetter("id"), collector.file_list.data["collector"]) id = 1 while id in ids: id += 1 @@ -241,9 +238,8 @@ class File_List(object): """ returns a free id """ - ids = [] - for pypack in (packager.file_list.data["packages"] + packager.file_list.data["queue"]): - ids.append(pypack.data["id"]) + ids = [ pypack.data["id"] for pypack in packager.file_list.data["packages"] + packager.file_list.data["queue"]] + id = 1 while id in ids: id += 1 @@ -347,9 +343,8 @@ class File_List(object): def getPackageFiles(packager, id): key, n, pypack = packager._getPackageFromID(id) - ids = [] - for pyfile in pypack.files: - ids.append(pyfile.id) + ids = map(attrgetter("id"), pypack.files) + return ids def addFileToPackage(packager, id, pyfile): diff --git a/module/web/media/default/img/accept.png b/module/web/media/default/img/accept.png deleted file mode 100644 index 89c8129a4..000000000 Binary files a/module/web/media/default/img/accept.png and /dev/null differ diff --git a/module/web/media/default/img/clock_play.png b/module/web/media/default/img/clock_play.png deleted file mode 100644 index fb4ebc850..000000000 Binary files a/module/web/media/default/img/clock_play.png and /dev/null differ diff --git a/module/web/media/default/img/clock_red.png b/module/web/media/default/img/clock_red.png deleted file mode 100644 index 2842cc338..000000000 Binary files a/module/web/media/default/img/clock_red.png and /dev/null differ diff --git a/module/web/media/default/img/status_None.png b/module/web/media/default/img/status_None.png new file mode 100644 index 000000000..293b13f77 Binary files /dev/null and b/module/web/media/default/img/status_None.png differ diff --git a/module/web/media/default/img/status_aborted.png b/module/web/media/default/img/status_aborted.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/module/web/media/default/img/status_aborted.png differ diff --git a/module/web/media/default/img/status_downloading.png b/module/web/media/default/img/status_downloading.png new file mode 100644 index 000000000..fb4ebc850 Binary files /dev/null and b/module/web/media/default/img/status_downloading.png differ diff --git a/module/web/media/default/img/status_failed.png b/module/web/media/default/img/status_failed.png new file mode 100644 index 000000000..0cfd58596 Binary files /dev/null and b/module/web/media/default/img/status_failed.png differ diff --git a/module/web/media/default/img/status_finished.png b/module/web/media/default/img/status_finished.png new file mode 100644 index 000000000..89c8129a4 Binary files /dev/null and b/module/web/media/default/img/status_finished.png differ diff --git a/module/web/media/default/img/status_waiting.png b/module/web/media/default/img/status_waiting.png new file mode 100644 index 000000000..2842cc338 Binary files /dev/null and b/module/web/media/default/img/status_waiting.png differ diff --git a/module/web/media/default/img/stop.png b/module/web/media/default/img/stop.png deleted file mode 100644 index 0cfd58596..000000000 Binary files a/module/web/media/default/img/stop.png and /dev/null differ diff --git a/module/web/media/img/favicon.ico b/module/web/media/img/favicon.ico new file mode 100644 index 000000000..58b1f4b89 Binary files /dev/null and b/module/web/media/img/favicon.ico differ diff --git a/module/web/pyload/views.py b/module/web/pyload/views.py index d72dca56c..ea9d5f1be 100644 --- a/module/web/pyload/views.py +++ b/module/web/pyload/views.py @@ -75,10 +75,7 @@ def home(request): def queue(request): queue = settings.PYLOAD.get_queue() for pack in queue: - children = [] - for child in settings.PYLOAD.get_package_files(pack["id"]): - children.append(settings.PYLOAD.get_file_info(child)) - pack["children"] = children + pack["children"] = map(settings.PYLOAD.get_file_info, settings.PYLOAD.get_package_files(pack["id"])) return render_to_response(join(settings.TEMPLATE, 'queue.html'), RequestContext(request, {'content': queue}, [status_proc])) -- cgit v1.2.3 From 769f156ea822d4520620727dc1317224a02bdaaa Mon Sep 17 00:00:00 2001 From: RaNaN <Mast3rRaNaN@hotmail.de> Date: Tue, 26 Jan 2010 21:23:16 +0100 Subject: extended script support --- module/HookManager.py | 71 ++++++++++++++++++++++++++++++++++++++++++++------- module/file_list.py | 2 +- module/thread_list.py | 4 +-- 3 files changed, 65 insertions(+), 12 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index 3a1a3d533..5dbf41936 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -17,28 +17,46 @@ @author: mkaay @interface-version: 0.1 """ +from glob import glob import logging +from os import listdir +from os.path import basename +from os.path import join +import subprocess +from threading import Lock from module.XMLConfigParser import XMLConfigParser -from os.path import basename, join -from glob import glob - -from threading import Lock - class HookManager(): def __init__(self, core): self.core = core - self.configParser = XMLConfigParser(join("module","config","plugin.xml")) + self.configParser = XMLConfigParser(join("module", "config", "plugin.xml")) self.configParser.loadData() self.config = self.configParser.getConfig() self.logger = logging.getLogger("log") self.plugins = [] + self.scripts = {} self.lock = Lock() self.createIndex() def createIndex(self): self.lock.acquire() + + f = lambda x: False if x.startswith("#") or x.endswith("~") else True + self.scripts = {} + + folder = join(self.core.path, "scripts") + + self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) + self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) + self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) + self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) + self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) + + self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) + + self.folder = folder + pluginFiles = glob(join(self.core.plugin_folder, "hooks", "*.py")) plugins = [] for pluginFile in pluginFiles: @@ -50,8 +68,8 @@ class HookManager(): self.logger.info("Deactivated %s" % pluginName) continue else: - self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) - module = __import__("module.plugins.hooks."+pluginName, globals(), locals(), [pluginName], -1) + self.configParser.set(pluginName, {"option": "activated", "type": "bool", "name": "Activated"}, True) + module = __import__("module.plugins.hooks." + pluginName, globals(), locals(), [pluginName], -1) pluginClass = getattr(module, pluginName) plugin = pluginClass(self.core) plugin.readConfig() @@ -63,24 +81,59 @@ class HookManager(): def downloadStarts(self, pyfile): self.lock.acquire() + + for script in self.scripts['download_preparing']: + try: + out = subprocess.Popen([join(self.folder, 'download_preparing', script), pyfile.plugin.props['name'], pyfile.url], stdout=subprocess.PIPE) + out.wait() + except: + pass + for plugin in self.plugins: plugin.downloadStarts(pyfile) self.lock.release() def downloadFinished(self, pyfile): self.lock.acquire() + + for script in self.scripts['download_finished']: + try: + out = subprocess.Popen([join(self.folder, 'download_finished', script), pyfile.plugin.props['name'], pyfile.url, pyfile.status.name, \ + join(self.core.path,self.core.config['general']['download_folder'], pyfile.folder, pyfile.status.name)], stdout=subprocess.PIPE) + except: + pass + + for plugin in self.plugins: plugin.downloadFinished(pyfile) self.lock.release() - + + def packageFinished(self, pyfile, package): + raise NotImplementedError + def beforeReconnecting(self, ip): self.lock.acquire() + + for script in self.scripts['before_reconnect']: + try: + out = subprocess.Popen([join(self.folder, 'before_reconnect', script), ip], stdout=subprocess.PIPE) + out.wait() + except: + pass + for plugin in self.plugins: plugin.beforeReconnecting(ip) self.lock.release() def afterReconnecting(self, ip): self.lock.acquire() + + for script in self.scripts['after_reconnect']: + try: + out = subprocess.Popen([join(self.folder, 'download_preparing', script), ip], stdout=subprocess.PIPE) + except: + pass + for plugin in self.plugins: plugin.afterReconnecting(ip) self.lock.release() diff --git a/module/file_list.py b/module/file_list.py index 1c4c4776b..7c68a7427 100644 --- a/module/file_list.py +++ b/module/file_list.py @@ -149,7 +149,7 @@ class File_List(object): info["active"] = pyfile.active info["plugin"] = pyfile.plugin.props['name'] return info - + def continueAborted(self): [[self.packager.resetFileStatus(x.id) for x in p.files if x.status.type == "aborted"] for p in self.data["queue"]] diff --git a/module/thread_list.py b/module/thread_list.py index 9211c7c2e..1a66bf6f5 100644 --- a/module/thread_list.py +++ b/module/thread_list.py @@ -200,7 +200,7 @@ class Thread_List(object): def reconnect(self): self.parent.logger.info("Start reconnect") ip = re.match(".*Current IP Address: (.*)</body>.*", urllib2.urlopen("http://checkip.dyndns.org/").read()).group(1) - #self.parent.hookManager.beforeReconnecting(ip) + self.parent.hookManager.beforeReconnecting(ip) reconn = subprocess.Popen(self.parent.config['reconnect']['method'])#, stdout=subprocess.PIPE) reconn.wait() time.sleep(1) @@ -211,7 +211,7 @@ class Thread_List(object): except: ip = "" time.sleep(1) - #self.parent.hookManager.afterReconnecting(ip) + self.parent.hookManager.afterReconnecting(ip) self.parent.logger.info("Reconnected, new IP: " + ip) def stopAllDownloads(self): -- cgit v1.2.3 From 7223256dbcbcad79b5edf0f71f525264903607f9 Mon Sep 17 00:00:00 2001 From: spoob <spoob@gmx.de> Date: Tue, 26 Jan 2010 22:10:09 +0100 Subject: Better Script Support --- module/HookManager.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index 5dbf41936..66a65acc8 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -43,17 +43,21 @@ class HookManager(): self.lock.acquire() f = lambda x: False if x.startswith("#") or x.endswith("~") else True - self.scripts = {} + self.scripts = {} folder = join(self.core.path, "scripts") - self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) - self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) - self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) - self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) + self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) + self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) + self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) + self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) - self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) + for script_type, script_name in self.scripts.iteritems(): + if script_name != []: + self.logger.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name))) + + #~ self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) self.folder = folder -- cgit v1.2.3 From ce184310fd592047d47de24287b20fee00a587cd Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 27 Jan 2010 14:52:42 +0100 Subject: moved script support to a new plugin --- module/HookManager.py | 50 ---------------- module/plugins/hooks/ExternalScripts.py | 100 ++++++++++++++++++++++++++++++++ 2 files changed, 100 insertions(+), 50 deletions(-) create mode 100644 module/plugins/hooks/ExternalScripts.py (limited to 'module') diff --git a/module/HookManager.py b/module/HookManager.py index 66a65acc8..a283a7349 100644 --- a/module/HookManager.py +++ b/module/HookManager.py @@ -19,10 +19,8 @@ """ from glob import glob import logging -from os import listdir from os.path import basename from os.path import join -import subprocess from threading import Lock from module.XMLConfigParser import XMLConfigParser @@ -35,32 +33,12 @@ class HookManager(): self.config = self.configParser.getConfig() self.logger = logging.getLogger("log") self.plugins = [] - self.scripts = {} self.lock = Lock() self.createIndex() def createIndex(self): self.lock.acquire() - f = lambda x: False if x.startswith("#") or x.endswith("~") else True - self.scripts = {} - - folder = join(self.core.path, "scripts") - - self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) - self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) - self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) - self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) - self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) - - for script_type, script_name in self.scripts.iteritems(): - if script_name != []: - self.logger.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name))) - - #~ self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) - - self.folder = folder - pluginFiles = glob(join(self.core.plugin_folder, "hooks", "*.py")) plugins = [] for pluginFile in pluginFiles: @@ -86,13 +64,6 @@ class HookManager(): def downloadStarts(self, pyfile): self.lock.acquire() - for script in self.scripts['download_preparing']: - try: - out = subprocess.Popen([join(self.folder, 'download_preparing', script), pyfile.plugin.props['name'], pyfile.url], stdout=subprocess.PIPE) - out.wait() - except: - pass - for plugin in self.plugins: plugin.downloadStarts(pyfile) self.lock.release() @@ -100,14 +71,6 @@ class HookManager(): def downloadFinished(self, pyfile): self.lock.acquire() - for script in self.scripts['download_finished']: - try: - out = subprocess.Popen([join(self.folder, 'download_finished', script), pyfile.plugin.props['name'], pyfile.url, pyfile.status.name, \ - join(self.core.path,self.core.config['general']['download_folder'], pyfile.folder, pyfile.status.name)], stdout=subprocess.PIPE) - except: - pass - - for plugin in self.plugins: plugin.downloadFinished(pyfile) self.lock.release() @@ -118,13 +81,6 @@ class HookManager(): def beforeReconnecting(self, ip): self.lock.acquire() - for script in self.scripts['before_reconnect']: - try: - out = subprocess.Popen([join(self.folder, 'before_reconnect', script), ip], stdout=subprocess.PIPE) - out.wait() - except: - pass - for plugin in self.plugins: plugin.beforeReconnecting(ip) self.lock.release() @@ -132,12 +88,6 @@ class HookManager(): def afterReconnecting(self, ip): self.lock.acquire() - for script in self.scripts['after_reconnect']: - try: - out = subprocess.Popen([join(self.folder, 'download_preparing', script), ip], stdout=subprocess.PIPE) - except: - pass - for plugin in self.plugins: plugin.afterReconnecting(ip) self.lock.release() diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py new file mode 100644 index 000000000..004ba07cc --- /dev/null +++ b/module/plugins/hooks/ExternalScripts.py @@ -0,0 +1,100 @@ +# -*- coding: utf-8 -*- + +""" + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + @author: mkaay + @interface-version: 0.1 +""" + +from module.plugins.hooks.Hook import Hook +import subprocess +from os import listdir, sep +from os.path import join + +class ExternalScripts(Hook): + def __init__(self, core): + Hook.__init__(self, core) + props = {} + props['name'] = "ExternalScripts" + props['version'] = "0.1" + props['description'] = """run external scripts""" + props['author_name'] = ("mkaay", "RaNaN", "spoob") + props['author_mail'] = ("mkaay@mkaay.de", "ranan@pyload.org", "spoob@pyload.org") + self.props = props + self.core = core + self.scripts = {} + + script_folders = ['scripts'+sep+'download_preparing'+sep, + 'scripts'+sep+'download_finished'+sep, + 'scripts'+sep+'package_finished'+sep, + 'scripts'+sep+'before_reconnect'+sep, + 'scripts'+sep+'after_reconnect'+sep] + self.core.check_file(script_folders, _("folders for scripts"), True) + + f = lambda x: False if x.startswith("#") or x.endswith("~") else True + self.scripts = {} + + folder = join(self.core.path, "scripts") + + self.scripts['download_preparing'] = filter(f, listdir(join(folder, 'download_preparing'))) + self.scripts['download_finished'] = filter(f, listdir(join(folder, 'download_finished'))) + self.scripts['package_finished'] = filter(f, listdir(join(folder, 'package_finished'))) + self.scripts['before_reconnect'] = filter(f, listdir(join(folder, 'before_reconnect'))) + self.scripts['after_reconnect'] = filter(f, listdir(join(folder, 'after_reconnect'))) + + for script_type, script_name in self.scripts.iteritems(): + if script_name != []: + self.logger.info("Installed %s Scripts: %s" % (script_type, ", ".join(script_name))) + + #~ self.core.logger.info("Installed Scripts: %s" % str(self.scripts)) + + self.folder = folder + + def downloadStarts(self, pyfile): + for script in self.scripts['download_preparing']: + try: + out = subprocess.Popen([join(self.folder, 'download_preparing', script), pyfile.plugin.props['name'], pyfile.url], stdout=subprocess.PIPE) + out.wait() + except: + pass + + def downloadFinished(self, pyfile): + for script in self.scripts['download_finished']: + try: + out = subprocess.Popen([join(self.folder, 'download_finished', script), pyfile.plugin.props['name'], pyfile.url, pyfile.status.name, \ + join(self.core.path,self.core.config['general']['download_folder'], pyfile.folder, pyfile.status.name)], stdout=subprocess.PIPE) + except: + pass + + def packageFinished(self, pypack): + """ + not implemented! + """ + pass + + def beforeReconnecting(self, ip): + for script in self.scripts['before_reconnect']: + try: + out = subprocess.Popen([join(self.folder, 'before_reconnect', script), ip], stdout=subprocess.PIPE) + out.wait() + except: + pass + + def afterReconnecting(self, ip): + for script in self.scripts['after_reconnect']: + try: + out = subprocess.Popen([join(self.folder, 'download_preparing', script), ip], stdout=subprocess.PIPE) + except: + pass -- cgit v1.2.3 From b4c21e149308dad7fca1ebd309b405864d38ad52 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 27 Jan 2010 15:51:36 +0100 Subject: fixed serienjunkies.org (new url pattern) --- module/plugins/decrypter/SerienjunkiesOrg.py | 17 +++++++++++++++-- module/unescape.py | 28 +++++++++++++++++++++------- 2 files changed, 36 insertions(+), 9 deletions(-) (limited to 'module') diff --git a/module/plugins/decrypter/SerienjunkiesOrg.py b/module/plugins/decrypter/SerienjunkiesOrg.py index 7d45fd705..af7dc8169 100644 --- a/module/plugins/decrypter/SerienjunkiesOrg.py +++ b/module/plugins/decrypter/SerienjunkiesOrg.py @@ -59,6 +59,16 @@ class SerienjunkiesOrg(Plugin): return True + def get_file_name(self): + showPattern = re.compile("^http://serienjunkies.org/serie/(.*)/$") + seasonPattern = re.compile("^http://serienjunkies.org/.*?/(.*)/$") + m = showPattern.match(self.parent.url) + if not m: + m = seasonPattern.match(self.parent.url) + if m: + return m.group(1) + return "n/a" + def getSJSrc(self, url): src = self.req.load(str(url)) if not src.find("Enter Serienjunkies") == -1: @@ -78,7 +88,7 @@ class SerienjunkiesOrg(Plugin): self.logger.debug("Preferred hoster: %s" % ", ".join(preferredHoster)) groups = {} gid = -1 - seasonName = soup.find("a", attrs={"rel":"bookmark"}).string + seasonName = unescape(soup.find("a", attrs={"rel":"bookmark"}).string) for p in ps: if re.search("<strong>Dauer|<strong>Sprache|<strong>Format", str(p)): var = p.findAll("strong") @@ -191,13 +201,16 @@ class SerienjunkiesOrg(Plugin): episodePattern = re.compile("^http://download.serienjunkies.org/f-.*?.html$") oldStyleLink = re.compile("^http://serienjunkies.org/safe/(.*)$") framePattern = re.compile("^http://download.serienjunkies.org/frame/go-.*?/$") - seasonPattern = re.compile("^http://serienjunkies.org/\?p=.*?$") + showPattern = re.compile("^http://serienjunkies.org/serie/.*/$") + seasonPattern = re.compile("^http://serienjunkies.org/.*?/.*/$") if framePattern.match(url): links = [self.handleFrame(url)] elif episodePattern.match(url): links = self.handleEpisode(url) elif oldStyleLink.match(url): links = self.handleOldStyleLink(url) + elif showPattern.match(url): + pass elif seasonPattern.match(url): links = self.handleSeason(url) self.links = links diff --git a/module/unescape.py b/module/unescape.py index 462423b03..59f35f36b 100644 --- a/module/unescape.py +++ b/module/unescape.py @@ -1,12 +1,25 @@ +from htmlentitydefs import name2codepoint as n2cp +import re + +def substitute_entity(match): + ent = match.group(2) + if match.group(1) == "#": + return unichr(int(ent)) + else: + cp = n2cp.get(ent) + if cp: + return unichr(cp) + else: + return match.group() + +def unescape(string): + entity_re = re.compile("&(#?)(\d{1,5}|\w{1,8});") + return entity_re.subn(substitute_entity, string)[0] + +""" import re def unescape(text): - """Removes HTML or XML character references - and entities from a text string. - keep &, >, < in the source code. - from Fredrik Lundh - http://effbot.org/zone/re-sub.htm#unescape-html - """ def fixup(m): text = m.group(0) if text[:2] == "&#": @@ -35,4 +48,5 @@ def unescape(text): print "keyerror" pass return text # leave as is - return str(re.sub("&#?\w+;", fixup, text)) + return re.sub("&#?\w+;", fixup, text) +""" -- cgit v1.2.3 From c3deb9779303e8300203650e4b44bf340f7c14c7 Mon Sep 17 00:00:00 2001 From: mkaay <mkaay@mkaay.de> Date: Wed, 27 Jan 2010 18:12:06 +0100 Subject: fix --- module/plugins/hooks/ExternalScripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'module') diff --git a/module/plugins/hooks/ExternalScripts.py b/module/plugins/hooks/ExternalScripts.py index 004ba07cc..30bd43770 100644 --- a/module/plugins/hooks/ExternalScripts.py +++ b/module/plugins/hooks/ExternalScripts.py @@ -18,7 +18,7 @@ @interface-version: 0.1 """ -from module.plugins.hooks.Hook import Hook +from module.plugins.Hook import Hook import subprocess from os import listdir, sep from os.path import join -- cgit v1.2.3