diff --git a/deluge/ui/web/js/deluge-all/.order b/deluge/ui/web/js/deluge-all/.order new file mode 100644 index 000000000..7c2a1533d --- /dev/null +++ b/deluge/ui/web/js/deluge-all/.order @@ -0,0 +1 @@ ++ OptionsManager.js diff --git a/deluge/ui/web/js/deluge-all/00OptionsManager.js b/deluge/ui/web/js/deluge-all/OptionsManager.js similarity index 100% rename from deluge/ui/web/js/deluge-all/00OptionsManager.js rename to deluge/ui/web/js/deluge-all/OptionsManager.js diff --git a/deluge/ui/web/server.py b/deluge/ui/web/server.py index ed6e4ad7a..eefd06774 100644 --- a/deluge/ui/web/server.py +++ b/deluge/ui/web/server.py @@ -359,6 +359,23 @@ class ScriptResource(resource.Resource, component.Component): for dirpath, dirnames, filenames in os.walk(filepath, False): files = fnmatch.filter(filenames, "*.js") files.sort() + + order_file = os.path.join(dirpath, '.order') + if os.path.isfile(order_file): + for line in open(order_file, 'rb'): + line = line.strip() + if not line or line[0] == '#': + continue + try: + pos, filename = line.split() + files.pop(files.index(filename)) + if pos == '+': + files.insert(0, filename) + else: + files.append(filename) + except: + pass + dirpath = dirpath[len(filepath)+1:] if dirpath: scripts.extend(['js/' + path + '/' + dirpath + '/' + f for f in files])