From 7c163edb63fcdccc7b232b3b24fe398a363d00a7 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Thu, 16 Oct 2014 12:01:17 +0200 Subject: New theme Estate --- pyload/config/default.conf | 2 +- pyload/webui/themes/dark/js/render/filemanager.js | 291 + .../webui/themes/dark/js/static/mootools-core.js | 4 +- .../webui/themes/dark/js/static/mootools-more.js | 2 +- pyload/webui/themes/dark/js/static/tinytab.js | 2 +- .../webui/themes/default/js/render/filemanager.js | 291 - .../themes/default/js/static/mootools-core.js | 4 +- .../themes/default/js/static/mootools-more.js | 2 +- pyload/webui/themes/default/js/static/tinytab.js | 2 +- pyload/webui/themes/default/tml/base.html | 3 - pyload/webui/themes/default/tml/filemanager.html | 2 - pyload/webui/themes/default/tml/home.html | 3 - pyload/webui/themes/estate/css/MooDialog.css | 85 + pyload/webui/themes/estate/css/estate.css | 866 +++ pyload/webui/themes/estate/css/log.css | 72 + pyload/webui/themes/estate/css/pathchooser.css | 68 + pyload/webui/themes/estate/css/window.css | 70 + .../themes/estate/img/MooDialog/dialog-close.png | Bin 0 -> 689 bytes .../themes/estate/img/MooDialog/dialog-error.png | Bin 0 -> 1472 bytes .../estate/img/MooDialog/dialog-question.png | Bin 0 -> 2073 bytes .../themes/estate/img/MooDialog/dialog-warning.png | Bin 0 -> 1651 bytes pyload/webui/themes/estate/img/arrow_refresh.png | Bin 0 -> 119032 bytes pyload/webui/themes/estate/img/arrow_right.png | Bin 0 -> 136967 bytes pyload/webui/themes/estate/img/button.png | Bin 0 -> 569 bytes pyload/webui/themes/estate/img/cog.png | Bin 0 -> 137406 bytes pyload/webui/themes/estate/img/control_add.png | Bin 0 -> 116941 bytes .../webui/themes/estate/img/control_add_blue.png | Bin 0 -> 116941 bytes pyload/webui/themes/estate/img/control_cancel.png | Bin 0 -> 116939 bytes .../themes/estate/img/control_cancel_blue.png | Bin 0 -> 116939 bytes pyload/webui/themes/estate/img/control_pause.png | Bin 0 -> 134855 bytes .../webui/themes/estate/img/control_pause_blue.png | Bin 0 -> 134855 bytes pyload/webui/themes/estate/img/control_play.png | Bin 0 -> 134904 bytes .../webui/themes/estate/img/control_play_blue.png | Bin 0 -> 134904 bytes pyload/webui/themes/estate/img/control_stop.png | Bin 0 -> 134835 bytes .../webui/themes/estate/img/control_stop_blue.png | Bin 0 -> 134835 bytes .../webui/themes/estate/img/default/add_folder.png | Bin 0 -> 571 bytes .../themes/estate/img/default/ajax-loader.gif | Bin 0 -> 404 bytes .../webui/themes/estate/img/default/big_button.gif | Bin 0 -> 1905 bytes .../themes/estate/img/default/big_button_over.gif | Bin 0 -> 728 bytes pyload/webui/themes/estate/img/default/body.png | Bin 0 -> 402 bytes .../webui/themes/estate/img/default/closebtn.gif | Bin 0 -> 254 bytes .../themes/estate/img/default/drag_corner.gif | Bin 0 -> 76 bytes pyload/webui/themes/estate/img/default/full.png | Bin 0 -> 3543 bytes .../themes/estate/img/default/head-menu-recent.png | Bin 0 -> 932 bytes .../webui/themes/estate/img/default/head_bg1.png | Bin 0 -> 125 bytes pyload/webui/themes/estate/img/default/images.png | Bin 0 -> 661 bytes .../webui/themes/estate/img/default/parseUri.png | Bin 0 -> 666 bytes .../themes/estate/img/default/pyload-logo.png | Bin 0 -> 8457 bytes .../themes/estate/img/default/tab-background.png | Bin 0 -> 179 bytes .../estate/img/default/tabs-border-bottom.png | Bin 0 -> 163 bytes pyload/webui/themes/estate/img/delete.png | Bin 0 -> 117658 bytes pyload/webui/themes/estate/img/error.png | Bin 0 -> 137673 bytes pyload/webui/themes/estate/img/folder.png | Bin 0 -> 134669 bytes pyload/webui/themes/estate/img/head-login.png | Bin 0 -> 137406 bytes .../themes/estate/img/head-menu-collector.png | Bin 0 -> 134985 bytes .../webui/themes/estate/img/head-menu-config.png | Bin 0 -> 137664 bytes .../themes/estate/img/head-menu-development.png | Bin 0 -> 135818 bytes .../webui/themes/estate/img/head-menu-download.png | Bin 0 -> 137664 bytes pyload/webui/themes/estate/img/head-menu-home.png | Bin 0 -> 139387 bytes pyload/webui/themes/estate/img/head-menu-index.png | Bin 0 -> 136511 bytes pyload/webui/themes/estate/img/head-menu-news.png | Bin 0 -> 136511 bytes pyload/webui/themes/estate/img/head-menu-queue.png | Bin 0 -> 136269 bytes pyload/webui/themes/estate/img/head-menu-wiki.png | Bin 0 -> 137217 bytes .../themes/estate/img/head-search-noshadow.png | Bin 0 -> 137217 bytes pyload/webui/themes/estate/img/notice.png | Bin 0 -> 3061 bytes pyload/webui/themes/estate/img/package_go.png | Bin 0 -> 136299 bytes .../themes/estate/img/page-tools-backlinks.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/page-tools-edit.png | Bin 0 -> 138112 bytes .../themes/estate/img/page-tools-revisions.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/pencil.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/reconnect.png | Bin 0 -> 3063 bytes pyload/webui/themes/estate/img/status_None.png | Bin 0 -> 138112 bytes .../webui/themes/estate/img/status_downloading.png | Bin 0 -> 3061 bytes pyload/webui/themes/estate/img/status_failed.png | Bin 0 -> 137673 bytes pyload/webui/themes/estate/img/status_finished.png | Bin 0 -> 117658 bytes pyload/webui/themes/estate/img/status_offline.png | Bin 0 -> 137673 bytes pyload/webui/themes/estate/img/status_proc.png | Bin 0 -> 137406 bytes pyload/webui/themes/estate/img/status_queue.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/status_waiting.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/success.png | Bin 0 -> 117658 bytes .../themes/estate/img/user-actions-logout.png | Bin 0 -> 138112 bytes .../themes/estate/img/user-actions-profile.png | Bin 0 -> 138112 bytes pyload/webui/themes/estate/img/user-info.png | Bin 0 -> 3080 bytes pyload/webui/themes/estate/js/render/admin.coffee | 58 + pyload/webui/themes/estate/js/render/admin.min.js | 3 + pyload/webui/themes/estate/js/render/base.coffee | 177 + pyload/webui/themes/estate/js/render/base.min.js | 3 + .../webui/themes/estate/js/render/filemanager.js | 291 + pyload/webui/themes/estate/js/render/package.js | 376 ++ .../webui/themes/estate/js/render/settings.coffee | 107 + .../webui/themes/estate/js/render/settings.min.js | 3 + pyload/webui/themes/estate/js/static/MooDialog.js | 140 + .../webui/themes/estate/js/static/MooDialog.min.js | 1 + .../webui/themes/estate/js/static/MooDropMenu.js | 86 + .../themes/estate/js/static/MooDropMenu.min.js | 1 + .../webui/themes/estate/js/static/mootools-core.js | 5977 ++++++++++++++++++++ .../themes/estate/js/static/mootools-core.min.js | 491 ++ .../webui/themes/estate/js/static/mootools-more.js | 2856 ++++++++++ .../themes/estate/js/static/mootools-more.min.js | 226 + pyload/webui/themes/estate/js/static/purr.js | 309 + pyload/webui/themes/estate/js/static/purr.min.js | 1 + pyload/webui/themes/estate/js/static/tinytab.js | 43 + .../webui/themes/estate/js/static/tinytab.min.js | 1 + pyload/webui/themes/estate/tml/admin.html | 98 + pyload/webui/themes/estate/tml/base.html | 180 + pyload/webui/themes/estate/tml/captcha.html | 42 + pyload/webui/themes/estate/tml/downloads.html | 29 + pyload/webui/themes/estate/tml/filemanager.html | 78 + pyload/webui/themes/estate/tml/folder.html | 15 + pyload/webui/themes/estate/tml/home.html | 266 + pyload/webui/themes/estate/tml/info.html | 81 + pyload/webui/themes/estate/tml/login.html | 36 + pyload/webui/themes/estate/tml/logout.html | 9 + pyload/webui/themes/estate/tml/logs.html | 41 + pyload/webui/themes/estate/tml/pathchooser.html | 76 + pyload/webui/themes/estate/tml/queue.html | 104 + pyload/webui/themes/estate/tml/settings.html | 204 + pyload/webui/themes/estate/tml/settings_item.html | 48 + pyload/webui/themes/estate/tml/window.html | 46 + .../webui/themes/flat/js/static/mootools-core.js | 4 +- .../webui/themes/flat/js/static/mootools-more.js | 2 +- pyload/webui/themes/flat/js/static/tinytab.js | 2 +- 122 files changed, 13968 insertions(+), 312 deletions(-) create mode 100644 pyload/webui/themes/dark/js/render/filemanager.js delete mode 100644 pyload/webui/themes/default/js/render/filemanager.js create mode 100644 pyload/webui/themes/estate/css/MooDialog.css create mode 100644 pyload/webui/themes/estate/css/estate.css create mode 100644 pyload/webui/themes/estate/css/log.css create mode 100644 pyload/webui/themes/estate/css/pathchooser.css create mode 100644 pyload/webui/themes/estate/css/window.css create mode 100644 pyload/webui/themes/estate/img/MooDialog/dialog-close.png create mode 100644 pyload/webui/themes/estate/img/MooDialog/dialog-error.png create mode 100644 pyload/webui/themes/estate/img/MooDialog/dialog-question.png create mode 100644 pyload/webui/themes/estate/img/MooDialog/dialog-warning.png create mode 100644 pyload/webui/themes/estate/img/arrow_refresh.png create mode 100644 pyload/webui/themes/estate/img/arrow_right.png create mode 100644 pyload/webui/themes/estate/img/button.png create mode 100644 pyload/webui/themes/estate/img/cog.png create mode 100644 pyload/webui/themes/estate/img/control_add.png create mode 100644 pyload/webui/themes/estate/img/control_add_blue.png create mode 100644 pyload/webui/themes/estate/img/control_cancel.png create mode 100644 pyload/webui/themes/estate/img/control_cancel_blue.png create mode 100644 pyload/webui/themes/estate/img/control_pause.png create mode 100644 pyload/webui/themes/estate/img/control_pause_blue.png create mode 100644 pyload/webui/themes/estate/img/control_play.png create mode 100644 pyload/webui/themes/estate/img/control_play_blue.png create mode 100644 pyload/webui/themes/estate/img/control_stop.png create mode 100644 pyload/webui/themes/estate/img/control_stop_blue.png create mode 100644 pyload/webui/themes/estate/img/default/add_folder.png create mode 100644 pyload/webui/themes/estate/img/default/ajax-loader.gif create mode 100644 pyload/webui/themes/estate/img/default/big_button.gif create mode 100644 pyload/webui/themes/estate/img/default/big_button_over.gif create mode 100644 pyload/webui/themes/estate/img/default/body.png create mode 100644 pyload/webui/themes/estate/img/default/closebtn.gif create mode 100644 pyload/webui/themes/estate/img/default/drag_corner.gif create mode 100644 pyload/webui/themes/estate/img/default/full.png create mode 100644 pyload/webui/themes/estate/img/default/head-menu-recent.png create mode 100644 pyload/webui/themes/estate/img/default/head_bg1.png create mode 100644 pyload/webui/themes/estate/img/default/images.png create mode 100644 pyload/webui/themes/estate/img/default/parseUri.png create mode 100644 pyload/webui/themes/estate/img/default/pyload-logo.png create mode 100644 pyload/webui/themes/estate/img/default/tab-background.png create mode 100644 pyload/webui/themes/estate/img/default/tabs-border-bottom.png create mode 100644 pyload/webui/themes/estate/img/delete.png create mode 100644 pyload/webui/themes/estate/img/error.png create mode 100644 pyload/webui/themes/estate/img/folder.png create mode 100644 pyload/webui/themes/estate/img/head-login.png create mode 100644 pyload/webui/themes/estate/img/head-menu-collector.png create mode 100644 pyload/webui/themes/estate/img/head-menu-config.png create mode 100644 pyload/webui/themes/estate/img/head-menu-development.png create mode 100644 pyload/webui/themes/estate/img/head-menu-download.png create mode 100644 pyload/webui/themes/estate/img/head-menu-home.png create mode 100644 pyload/webui/themes/estate/img/head-menu-index.png create mode 100644 pyload/webui/themes/estate/img/head-menu-news.png create mode 100644 pyload/webui/themes/estate/img/head-menu-queue.png create mode 100644 pyload/webui/themes/estate/img/head-menu-wiki.png create mode 100644 pyload/webui/themes/estate/img/head-search-noshadow.png create mode 100644 pyload/webui/themes/estate/img/notice.png create mode 100644 pyload/webui/themes/estate/img/package_go.png create mode 100644 pyload/webui/themes/estate/img/page-tools-backlinks.png create mode 100644 pyload/webui/themes/estate/img/page-tools-edit.png create mode 100644 pyload/webui/themes/estate/img/page-tools-revisions.png create mode 100644 pyload/webui/themes/estate/img/pencil.png create mode 100644 pyload/webui/themes/estate/img/reconnect.png create mode 100644 pyload/webui/themes/estate/img/status_None.png create mode 100644 pyload/webui/themes/estate/img/status_downloading.png create mode 100644 pyload/webui/themes/estate/img/status_failed.png create mode 100644 pyload/webui/themes/estate/img/status_finished.png create mode 100644 pyload/webui/themes/estate/img/status_offline.png create mode 100644 pyload/webui/themes/estate/img/status_proc.png create mode 100644 pyload/webui/themes/estate/img/status_queue.png create mode 100644 pyload/webui/themes/estate/img/status_waiting.png create mode 100644 pyload/webui/themes/estate/img/success.png create mode 100644 pyload/webui/themes/estate/img/user-actions-logout.png create mode 100644 pyload/webui/themes/estate/img/user-actions-profile.png create mode 100644 pyload/webui/themes/estate/img/user-info.png create mode 100644 pyload/webui/themes/estate/js/render/admin.coffee create mode 100644 pyload/webui/themes/estate/js/render/admin.min.js create mode 100644 pyload/webui/themes/estate/js/render/base.coffee create mode 100644 pyload/webui/themes/estate/js/render/base.min.js create mode 100644 pyload/webui/themes/estate/js/render/filemanager.js create mode 100644 pyload/webui/themes/estate/js/render/package.js create mode 100644 pyload/webui/themes/estate/js/render/settings.coffee create mode 100644 pyload/webui/themes/estate/js/render/settings.min.js create mode 100644 pyload/webui/themes/estate/js/static/MooDialog.js create mode 100644 pyload/webui/themes/estate/js/static/MooDialog.min.js create mode 100644 pyload/webui/themes/estate/js/static/MooDropMenu.js create mode 100644 pyload/webui/themes/estate/js/static/MooDropMenu.min.js create mode 100644 pyload/webui/themes/estate/js/static/mootools-core.js create mode 100644 pyload/webui/themes/estate/js/static/mootools-core.min.js create mode 100644 pyload/webui/themes/estate/js/static/mootools-more.js create mode 100644 pyload/webui/themes/estate/js/static/mootools-more.min.js create mode 100644 pyload/webui/themes/estate/js/static/purr.js create mode 100644 pyload/webui/themes/estate/js/static/purr.min.js create mode 100644 pyload/webui/themes/estate/js/static/tinytab.js create mode 100644 pyload/webui/themes/estate/js/static/tinytab.min.js create mode 100644 pyload/webui/themes/estate/tml/admin.html create mode 100644 pyload/webui/themes/estate/tml/base.html create mode 100644 pyload/webui/themes/estate/tml/captcha.html create mode 100644 pyload/webui/themes/estate/tml/downloads.html create mode 100644 pyload/webui/themes/estate/tml/filemanager.html create mode 100644 pyload/webui/themes/estate/tml/folder.html create mode 100644 pyload/webui/themes/estate/tml/home.html create mode 100644 pyload/webui/themes/estate/tml/info.html create mode 100644 pyload/webui/themes/estate/tml/login.html create mode 100644 pyload/webui/themes/estate/tml/logout.html create mode 100644 pyload/webui/themes/estate/tml/logs.html create mode 100644 pyload/webui/themes/estate/tml/pathchooser.html create mode 100644 pyload/webui/themes/estate/tml/queue.html create mode 100644 pyload/webui/themes/estate/tml/settings.html create mode 100644 pyload/webui/themes/estate/tml/settings_item.html create mode 100644 pyload/webui/themes/estate/tml/window.html diff --git a/pyload/config/default.conf b/pyload/config/default.conf index 3a513f122..d030a1199 100644 --- a/pyload/config/default.conf +++ b/pyload/config/default.conf @@ -15,7 +15,7 @@ webinterface - "Web UI": bool https : "Use HTTPS" = False ip host : "IP" = 0.0.0.0 int port : "Port" = 8001 - default;dark;flat theme : "Theme" = flat + default;dark;estate;flat theme : "Theme" = estate str prefix: "Path Prefix" = log - "Log": bool file_log : "File Log" = True diff --git a/pyload/webui/themes/dark/js/render/filemanager.js b/pyload/webui/themes/dark/js/render/filemanager.js new file mode 100644 index 000000000..f1ebed93f --- /dev/null +++ b/pyload/webui/themes/dark/js/render/filemanager.js @@ -0,0 +1,291 @@ +var load, rename_box, confirm_box; + +document.addEvent("domready", function() { + load = new Fx.Tween($("load-indicator"), {link: "cancel"}); + load.set("opacity", 0); + + rename_box = new Fx.Tween($('rename_box')); + confirm_box = new Fx.Tween($('confirm_box')); + $('rename_reset').addEvent('click', function() { + hide_rename_box() + }); + $('delete_reset').addEvent('click', function() { + hide_confirm_box() + }); + + /*$('filemanager_actions_list').getChildren("li").each(function(action) { + var action_name = action.className; + if(functions[action.className] != undefined) + { + action.addEvent('click', functions[action.className]); + } + });*/ +}); + +function indicateLoad() { + //$("load-indicator").reveal(); + load.start("opacity", 1) +} + +function indicateFinish() { + load.start("opacity", 0) +} + +function indicateSuccess() { + indicateFinish(); + notify.alert('{{_("Success")}}.', { + 'className': 'success' + }); +} + +function indicateFail() { + indicateFinish(); + notify.alert('{{_("Failed")}}.', { + 'className': 'error' + }); +} + +function show_rename_box() { + bg_show(); + $("rename_box").setStyle('display', 'block'); + rename_box.start('opacity', 1) +} + +function hide_rename_box() { + bg_hide(); + rename_box.start('opacity', 0).chain(function() { + $('rename_box').setStyle('display', 'none'); + }); +} + +function show_confirm_box() { + bg_show(); + $("confirm_box").setStyle('display', 'block'); + confirm_box.start('opacity', 1) +} + +function hide_confirm_box() { + bg_hide(); + confirm_box.start('opacity', 0).chain(function() { + $('confirm_box').setStyle('display', 'none'); + }); +} + +var FilemanagerUI = new Class({ + initialize: function(url, type) { + this.url = url; + this.type = type; + this.directories = []; + this.files = []; + this.parseChildren(); + }, + + parseChildren: function() { + $("directories-list").getChildren("li.folder").each(function(ele) { + var path = ele.getElements("input.path")[0].get("value"); + var name = ele.getElements("input.name")[0].get("value"); + this.directories.push(new Item(this, path, name, ele)) + }.bind(this)); + + $("directories-list").getChildren("li.file").each(function(ele) { + var path = ele.getElements("input.path")[0].get("value"); + var name = ele.getElements("input.name")[0].get("value"); + this.files.push(new Item(this, path, name, ele)) + }.bind(this)); + } +}); + +var Item = new Class({ + initialize: function(ui, path, name, ele) { + this.ui = ui; + this.path = path; + this.name = name; + this.ele = ele; + this.directories = []; + this.files = []; + this.actions = new Array(); + this.actions["delete"] = this.del; + this.actions["rename"] = this.rename; + this.actions["mkdir"] = this.mkdir; + this.parseElement(); + + var pname = this.ele.getElements("span")[0]; + this.buttons = new Fx.Tween(this.ele.getElements(".buttons")[0], {link: "cancel"}); + this.buttons.set("opacity", 0); + + pname.addEvent("mouseenter", function(e) { + this.buttons.start("opacity", 1) + }.bind(this)); + + pname.addEvent("mouseleave", function(e) { + this.buttons.start("opacity", 0) + }.bind(this)); + + }, + + parseElement: function() { + this.ele.getChildren('span span.buttons img').each(function(img) { + img.addEvent('click', this.actions[img.className].bind(this)); + }, this); + + //click on the directory name must open the directory itself + this.ele.getElements('b')[0].addEvent('click', this.toggle.bind(this)); + + //iterate over child directories + var uls = this.ele.getElements('ul'); + if(uls.length > 0) + { + uls[0].getChildren("li.folder").each(function(fld) { + var path = fld.getElements("input.path")[0].get("value"); + var name = fld.getElements("input.name")[0].get("value"); + this.directories.push(new Item(this, path, name, fld)); + }.bind(this)); + uls[0].getChildren("li.file").each(function(fld) { + var path = fld.getElements("input.path")[0].get("value"); + var name = fld.getElements("input.name")[0].get("value"); + this.files.push(new Item(this, path, name, fld)); + }.bind(this)); + } + }, + + reorderElements: function() { + //TODO sort the main ul again (to keep data ordered after renaming something) + }, + + del: function(event) { + $("confirm_form").removeEvents("submit"); + $("confirm_form").addEvent("submit", this.deleteDirectory.bind(this)); + + $$("#confirm_form p").set('html', '{{_(("Are you sure you want to delete the selected item?"))}}'); + + show_confirm_box(); + event.stop(); + }, + + deleteDirectory: function(event) { + hide_confirm_box(); + new Request.JSON({ + method: 'POST', + url: "/json/filemanager/delete", + data: {'path': this.path, 'name': this.name}, + onSuccess: function(data) { + if(data.response == "success") + { + new Fx.Tween(this.ele).start('opacity', 0); + var ul = this.ele.parentNode; + this.ele.dispose(); + //if this was the only child, add a "empty folder" div + if(!ul.getChildren('li')[0]) + { + var div = new Element("div", { 'html': '{{ _("Folder is empty") }}' }); + div.replaces(ul); + } + + indicateSuccess(); + } else + { + //error from json code... + indicateFail(); + } + }.bind(this), + onFailure: indicateFail + }).send(); + + event.stop(); + }, + + rename: function(event) { + $("rename_form").removeEvents("submit"); + $("rename_form").addEvent("submit", this.renameDirectory.bind(this)); + + $("path").set("value", this.path); + $("old_name").set("value", this.name); + $("new_name").set("value", this.name); + + show_rename_box(); + event.stop(); + }, + + renameDirectory: function(event) { + hide_rename_box(); + new Request.JSON({ + method: 'POST', + url: "/json/filemanager/rename", + onSuccess: function(data) { + if(data.response == "success") + { + this.name = $("new_name").get("value"); + this.ele.getElements("b")[0].set('html', $("new_name").get("value")); + this.reorderElements(); + indicateSuccess(); + } else + { + //error from json code... + indicateFail(); + } + }.bind(this), + onFailure: indicateFail + }).send($("rename_form").toQueryString()); + + event.stop(); + }, + + mkdir: function(event) { + new Request.JSON({ + method: 'POST', + url: "/json/filemanager/mkdir", + data: {'path': this.path + "/" + this.name, 'name': '{{_("New folder")}}'}, + onSuccess: function(data) { + if(data.response == "success") + { + new Request.HTML({ + method: 'POST', + url: "/filemanager/get_dir", + data: {'path': data.path, 'name': data.name}, + onSuccess: function(li) { + //add node as first child of ul + var ul = this.ele.getChildren('ul')[0]; + if(!ul) + { + //remove the "Folder Empty" div + this.ele.getChildren('div').dispose(); + + //create new ul to contain subfolder + ul = new Element("ul"); + ul.inject(this.ele, 'bottom'); + } + li[0].inject(ul, 'top'); + + //add directory as a subdirectory of the current item + this.directories.push(new Item(this.ui, data.path, data.name, ul.firstChild)); + }.bind(this), + onFailure: indicateFail + }).send(); + indicateSuccess(); + } else + { + //error from json code... + indicateFail(); + } + }.bind(this), + onFailure: indicateFail + }).send(); + + event.stop(); + }, + + toggle: function() { + var child = this.ele.getElement('ul'); + if(child == null) + child = this.ele.getElement('div'); + + if(child != null) + { + if (child.getStyle('display') == "block") { + child.dissolve(); + } else { + child.reveal(); + } + } + } +}); diff --git a/pyload/webui/themes/dark/js/static/mootools-core.js b/pyload/webui/themes/dark/js/static/mootools-core.js index db83850fd..e73f1df1e 100644 --- a/pyload/webui/themes/dark/js/static/mootools-core.js +++ b/pyload/webui/themes/dark/js/static/mootools-core.js @@ -5732,8 +5732,8 @@ JSON.secure = true; JSON.decode = function(string, secure){ if (!string || typeOf(string) != 'string') return null; - - if (secure == null) secure = JSON.secure; + + if (secure == null) secure = JSON.secure; if (secure){ if (JSON.parse) return JSON.parse(string); if (!JSON.validate(string)) throw new Error('JSON could not decode the input; security is enabled and the value is not secure.'); diff --git a/pyload/webui/themes/dark/js/static/mootools-more.js b/pyload/webui/themes/dark/js/static/mootools-more.js index c7f4a1a0e..160b7234e 100644 --- a/pyload/webui/themes/dark/js/static/mootools-more.js +++ b/pyload/webui/themes/dark/js/static/mootools-more.js @@ -2491,7 +2491,7 @@ var Sortables = new Class({ return list; }, this)); }, - + getDroppableCoordinates: function (element){ var offsetParent = element.getOffsetParent(); var position = element.getPosition(offsetParent); diff --git a/pyload/webui/themes/dark/js/static/tinytab.js b/pyload/webui/themes/dark/js/static/tinytab.js index de50279fc..3273451fe 100644 --- a/pyload/webui/themes/dark/js/static/tinytab.js +++ b/pyload/webui/themes/dark/js/static/tinytab.js @@ -21,7 +21,7 @@ provides: TinyTab this.tabs = tabs; this.contents = contents; if(!opt) opt = {}; - this.css = opt.selectedClass || 'selected'; + this.css = opt.selectedClass || 'selected'; this.select(this.tabs[0]); tabs.each(function(el){ el.addEvent('click',function(e){ diff --git a/pyload/webui/themes/default/js/render/filemanager.js b/pyload/webui/themes/default/js/render/filemanager.js deleted file mode 100644 index f1ebed93f..000000000 --- a/pyload/webui/themes/default/js/render/filemanager.js +++ /dev/null @@ -1,291 +0,0 @@ -var load, rename_box, confirm_box; - -document.addEvent("domready", function() { - load = new Fx.Tween($("load-indicator"), {link: "cancel"}); - load.set("opacity", 0); - - rename_box = new Fx.Tween($('rename_box')); - confirm_box = new Fx.Tween($('confirm_box')); - $('rename_reset').addEvent('click', function() { - hide_rename_box() - }); - $('delete_reset').addEvent('click', function() { - hide_confirm_box() - }); - - /*$('filemanager_actions_list').getChildren("li").each(function(action) { - var action_name = action.className; - if(functions[action.className] != undefined) - { - action.addEvent('click', functions[action.className]); - } - });*/ -}); - -function indicateLoad() { - //$("load-indicator").reveal(); - load.start("opacity", 1) -} - -function indicateFinish() { - load.start("opacity", 0) -} - -function indicateSuccess() { - indicateFinish(); - notify.alert('{{_("Success")}}.', { - 'className': 'success' - }); -} - -function indicateFail() { - indicateFinish(); - notify.alert('{{_("Failed")}}.', { - 'className': 'error' - }); -} - -function show_rename_box() { - bg_show(); - $("rename_box").setStyle('display', 'block'); - rename_box.start('opacity', 1) -} - -function hide_rename_box() { - bg_hide(); - rename_box.start('opacity', 0).chain(function() { - $('rename_box').setStyle('display', 'none'); - }); -} - -function show_confirm_box() { - bg_show(); - $("confirm_box").setStyle('display', 'block'); - confirm_box.start('opacity', 1) -} - -function hide_confirm_box() { - bg_hide(); - confirm_box.start('opacity', 0).chain(function() { - $('confirm_box').setStyle('display', 'none'); - }); -} - -var FilemanagerUI = new Class({ - initialize: function(url, type) { - this.url = url; - this.type = type; - this.directories = []; - this.files = []; - this.parseChildren(); - }, - - parseChildren: function() { - $("directories-list").getChildren("li.folder").each(function(ele) { - var path = ele.getElements("input.path")[0].get("value"); - var name = ele.getElements("input.name")[0].get("value"); - this.directories.push(new Item(this, path, name, ele)) - }.bind(this)); - - $("directories-list").getChildren("li.file").each(function(ele) { - var path = ele.getElements("input.path")[0].get("value"); - var name = ele.getElements("input.name")[0].get("value"); - this.files.push(new Item(this, path, name, ele)) - }.bind(this)); - } -}); - -var Item = new Class({ - initialize: function(ui, path, name, ele) { - this.ui = ui; - this.path = path; - this.name = name; - this.ele = ele; - this.directories = []; - this.files = []; - this.actions = new Array(); - this.actions["delete"] = this.del; - this.actions["rename"] = this.rename; - this.actions["mkdir"] = this.mkdir; - this.parseElement(); - - var pname = this.ele.getElements("span")[0]; - this.buttons = new Fx.Tween(this.ele.getElements(".buttons")[0], {link: "cancel"}); - this.buttons.set("opacity", 0); - - pname.addEvent("mouseenter", function(e) { - this.buttons.start("opacity", 1) - }.bind(this)); - - pname.addEvent("mouseleave", function(e) { - this.buttons.start("opacity", 0) - }.bind(this)); - - }, - - parseElement: function() { - this.ele.getChildren('span span.buttons img').each(function(img) { - img.addEvent('click', this.actions[img.className].bind(this)); - }, this); - - //click on the directory name must open the directory itself - this.ele.getElements('b')[0].addEvent('click', this.toggle.bind(this)); - - //iterate over child directories - var uls = this.ele.getElements('ul'); - if(uls.length > 0) - { - uls[0].getChildren("li.folder").each(function(fld) { - var path = fld.getElements("input.path")[0].get("value"); - var name = fld.getElements("input.name")[0].get("value"); - this.directories.push(new Item(this, path, name, fld)); - }.bind(this)); - uls[0].getChildren("li.file").each(function(fld) { - var path = fld.getElements("input.path")[0].get("value"); - var name = fld.getElements("input.name")[0].get("value"); - this.files.push(new Item(this, path, name, fld)); - }.bind(this)); - } - }, - - reorderElements: function() { - //TODO sort the main ul again (to keep data ordered after renaming something) - }, - - del: function(event) { - $("confirm_form").removeEvents("submit"); - $("confirm_form").addEvent("submit", this.deleteDirectory.bind(this)); - - $$("#confirm_form p").set('html', '{{_(("Are you sure you want to delete the selected item?"))}}'); - - show_confirm_box(); - event.stop(); - }, - - deleteDirectory: function(event) { - hide_confirm_box(); - new Request.JSON({ - method: 'POST', - url: "/json/filemanager/delete", - data: {'path': this.path, 'name': this.name}, - onSuccess: function(data) { - if(data.response == "success") - { - new Fx.Tween(this.ele).start('opacity', 0); - var ul = this.ele.parentNode; - this.ele.dispose(); - //if this was the only child, add a "empty folder" div - if(!ul.getChildren('li')[0]) - { - var div = new Element("div", { 'html': '{{ _("Folder is empty") }}' }); - div.replaces(ul); - } - - indicateSuccess(); - } else - { - //error from json code... - indicateFail(); - } - }.bind(this), - onFailure: indicateFail - }).send(); - - event.stop(); - }, - - rename: function(event) { - $("rename_form").removeEvents("submit"); - $("rename_form").addEvent("submit", this.renameDirectory.bind(this)); - - $("path").set("value", this.path); - $("old_name").set("value", this.name); - $("new_name").set("value", this.name); - - show_rename_box(); - event.stop(); - }, - - renameDirectory: function(event) { - hide_rename_box(); - new Request.JSON({ - method: 'POST', - url: "/json/filemanager/rename", - onSuccess: function(data) { - if(data.response == "success") - { - this.name = $("new_name").get("value"); - this.ele.getElements("b")[0].set('html', $("new_name").get("value")); - this.reorderElements(); - indicateSuccess(); - } else - { - //error from json code... - indicateFail(); - } - }.bind(this), - onFailure: indicateFail - }).send($("rename_form").toQueryString()); - - event.stop(); - }, - - mkdir: function(event) { - new Request.JSON({ - method: 'POST', - url: "/json/filemanager/mkdir", - data: {'path': this.path + "/" + this.name, 'name': '{{_("New folder")}}'}, - onSuccess: function(data) { - if(data.response == "success") - { - new Request.HTML({ - method: 'POST', - url: "/filemanager/get_dir", - data: {'path': data.path, 'name': data.name}, - onSuccess: function(li) { - //add node as first child of ul - var ul = this.ele.getChildren('ul')[0]; - if(!ul) - { - //remove the "Folder Empty" div - this.ele.getChildren('div').dispose(); - - //create new ul to contain subfolder - ul = new Element("ul"); - ul.inject(this.ele, 'bottom'); - } - li[0].inject(ul, 'top'); - - //add directory as a subdirectory of the current item - this.directories.push(new Item(this.ui, data.path, data.name, ul.firstChild)); - }.bind(this), - onFailure: indicateFail - }).send(); - indicateSuccess(); - } else - { - //error from json code... - indicateFail(); - } - }.bind(this), - onFailure: indicateFail - }).send(); - - event.stop(); - }, - - toggle: function() { - var child = this.ele.getElement('ul'); - if(child == null) - child = this.ele.getElement('div'); - - if(child != null) - { - if (child.getStyle('display') == "block") { - child.dissolve(); - } else { - child.reveal(); - } - } - } -}); diff --git a/pyload/webui/themes/default/js/static/mootools-core.js b/pyload/webui/themes/default/js/static/mootools-core.js index db83850fd..e73f1df1e 100644 --- a/pyload/webui/themes/default/js/static/mootools-core.js +++ b/pyload/webui/themes/default/js/static/mootools-core.js @@ -5732,8 +5732,8 @@ JSON.secure = true; JSON.decode = function(string, secure){ if (!string || typeOf(string) != 'string') return null; - - if (secure == null) secure = JSON.secure; + + if (secure == null) secure = JSON.secure; if (secure){ if (JSON.parse) return JSON.parse(string); if (!JSON.validate(string)) throw new Error('JSON could not decode the input; security is enabled and the value is not secure.'); diff --git a/pyload/webui/themes/default/js/static/mootools-more.js b/pyload/webui/themes/default/js/static/mootools-more.js index c7f4a1a0e..160b7234e 100644 --- a/pyload/webui/themes/default/js/static/mootools-more.js +++ b/pyload/webui/themes/default/js/static/mootools-more.js @@ -2491,7 +2491,7 @@ var Sortables = new Class({ return list; }, this)); }, - + getDroppableCoordinates: function (element){ var offsetParent = element.getOffsetParent(); var position = element.getPosition(offsetParent); diff --git a/pyload/webui/themes/default/js/static/tinytab.js b/pyload/webui/themes/default/js/static/tinytab.js index de50279fc..3273451fe 100644 --- a/pyload/webui/themes/default/js/static/tinytab.js +++ b/pyload/webui/themes/default/js/static/tinytab.js @@ -21,7 +21,7 @@ provides: TinyTab this.tabs = tabs; this.contents = contents; if(!opt) opt = {}; - this.css = opt.selectedClass || 'selected'; + this.css = opt.selectedClass || 'selected'; this.select(this.tabs[0]); tabs.each(function(el){ el.addEvent('click',function(e){ diff --git a/pyload/webui/themes/default/tml/base.html b/pyload/webui/themes/default/tml/base.html index b92a4a668..a8f20504f 100644 --- a/pyload/webui/themes/default/tml/base.html +++ b/pyload/webui/themes/default/tml/base.html @@ -92,9 +92,6 @@
  • {{_("Downloads")}}
  • -{#
  • #} -{# {{_("FileManager")}}#} -{#
  • #}
  • {{_("Logs")}}
  • diff --git a/pyload/webui/themes/default/tml/filemanager.html b/pyload/webui/themes/default/tml/filemanager.html index 7a370d04c..0a2305923 100644 --- a/pyload/webui/themes/default/tml/filemanager.html +++ b/pyload/webui/themes/default/tml/filemanager.html @@ -2,8 +2,6 @@ {% block head %} - - +{% endblock %} + + +{% block title %}{{ _("Administrate") }} - {{ super() }} {% endblock %} +{% block subtitle %}{{ _("Administrate") }}{% endblock %} + +{% block content %} + + {{_("Quit pyLoad")}} | + {{_("Restart pyLoad")}} +
    +
    + + {{ _("To add user or change passwords use:") }} python pyload.py -u
    + {{ _("Important: Admin user have always all permissions!") }} + +
    + + + + + + + + + {% for name, data in users.iteritems() %} + + + + + + + {% endfor %} + + +
    + {{ _("Name") }} + + {{ _("Change Password") }} + + {{ _("Admin") }} + + {{ _("Permissions") }} +
    {{ name }}{{ _("change") }} + +
    + + +
    +{% endblock %} +{% block hidden %} +
    +
    +

    {{ _("Change Password") }}

    + +

    {{ _("Enter your current and desired Password.") }}

    + + + + + + + + + + + + + + + +
    + +
    + +
    +{% endblock %} diff --git a/pyload/webui/themes/estate/tml/base.html b/pyload/webui/themes/estate/tml/base.html new file mode 100644 index 000000000..2ad1be6d1 --- /dev/null +++ b/pyload/webui/themes/estate/tml/base.html @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + +{% block title %}pyLoad {{_("Web UI")}}{% endblock %} + +{% block head %} +{% endblock %} + + + + +
    + + +
    + {% block headpanel %} + + {% if user.is_authenticated %} + + +{% if update %} + +{{_("pyLoad Update available!")}} + +{% endif %} + + +{% if plugins %} + +{{_("Plugins updated, please restart!")}} + +{% endif %} + + +Captcha: +{{_("Captcha waiting")}} + + + User:{{user.name}} + +{% else %} + {{_("Please Login!")}} +{% endif %} + + {% endblock %} +
    + + + +
    + +
    + +
    +
    + +{% if perms.STATUS %} + +{% endif %} + +{% if perms.LIST %} + +{% endif %} + +{% block pageactions %} +{% endblock %} +
    + +
    + +
    + +

    {% block subtitle %}pyLoad - {{_("Web UI")}}{% endblock %}

    + +{% block statusbar %} +{% endblock %} + + +
    + +
    +
    + + +{% for message in messages %} +

    {{message}}

    +{% endfor %} + +
    + + {{_("loading")}} +
    + +{% block content %} +{% endblock content %} + +
    + + +
    +
    + +
    + {% include '/estate/tml/window.html' %} + {% include '/estate/tml/captcha.html' %} + {% block hidden %} + {% endblock %} +
    + + diff --git a/pyload/webui/themes/estate/tml/captcha.html b/pyload/webui/themes/estate/tml/captcha.html new file mode 100644 index 000000000..731d97d11 --- /dev/null +++ b/pyload/webui/themes/estate/tml/captcha.html @@ -0,0 +1,42 @@ + +
    + +
    + +

    {{_("Captcha reading")}}

    +

    {{_("Please read the text on the captcha.")}}

    + +
    + + + + + + + + + + + +
    + +
    + +
    + +
    + + + + +
    + +
    + +
    + +
    \ No newline at end of file diff --git a/pyload/webui/themes/estate/tml/downloads.html b/pyload/webui/themes/estate/tml/downloads.html new file mode 100644 index 000000000..9ba07ec75 --- /dev/null +++ b/pyload/webui/themes/estate/tml/downloads.html @@ -0,0 +1,29 @@ +{% extends '/estate/tml/base.html' %} + +{% block title %}Downloads - {{super()}} {% endblock %} + +{% block subtitle %} +{{_("Downloads")}} +{% endblock %} + +{% block content %} + + + +{% endblock %} \ No newline at end of file diff --git a/pyload/webui/themes/estate/tml/filemanager.html b/pyload/webui/themes/estate/tml/filemanager.html new file mode 100644 index 000000000..c49312db4 --- /dev/null +++ b/pyload/webui/themes/estate/tml/filemanager.html @@ -0,0 +1,78 @@ +{% extends '/estate/tml/base.html' %} + +{% block head %} + + + + +{% endblock %} + +{% block title %}Downloads - {{super()}} {% endblock %} + + +{% block subtitle %} +{{_("FileManager")}} +{% endblock %} + +{% macro display_file(file) %} +
  • + + + + {{ file.name }} + + +    + + + +
  • +{%- endmacro %} + +{% macro display_folder(fld, open = false) -%} +
  • + + + + {{ fld.name }} + + +    + +    + + + + {% if (fld.folders|length + fld.files|length) > 0 %} + {% if open %} +