diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-09 18:18:23 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2011-10-09 18:18:23 +0200 |
commit | 57cce481460efd7c9897c59652b544ef65063837 (patch) | |
tree | d3e8f4d1465e32c20028258d941c7eb56f15943d /module/web/media/default/js/settings_ui.js | |
parent | add filejungle.com, fix sharerapid.com (diff) | |
download | pyload-57cce481460efd7c9897c59652b544ef65063837.tar.xz |
updated js/mootools, some parts now coffeescript
Diffstat (limited to 'module/web/media/default/js/settings_ui.js')
-rw-r--r-- | module/web/media/default/js/settings_ui.js | 146 |
1 files changed, 0 insertions, 146 deletions
diff --git a/module/web/media/default/js/settings_ui.js b/module/web/media/default/js/settings_ui.js deleted file mode 100644 index 338556675..000000000 --- a/module/web/media/default/js/settings_ui.js +++ /dev/null @@ -1,146 +0,0 @@ -var success_msg,failed_msg; -var account_dialog; - -function show_account_dialog() { - bg_show(); - $("account_box").setStyle('display', 'block'); - account_dialog.start('opacity', 1) -} - -function hide_account_dialog() { - bg_hide(); - account_dialog.start('opacity', 0).chain(function() { - $('account_box').setStyle('display', 'none'); - }); -} - - -var SettingsUI = new Class({ - initialize: function() { - this.menu = $$("#general-menu li"); - this.menu.append($$("#plugin-menu li")); - - this.name = $("tabsback"); - this.general = $("general_form_content"); - this.plugin = $("plugin_form_content"); - - this.menu.each(function(el) { - el.addEvent("click", this.menuClick.bind(this)); - }.bind(this)); - - - $("general|submit").addEvent("click", this.configSubmit.bind(this)); - $("plugin|submit").addEvent("click", this.configSubmit.bind(this)); - - $("account_add").addEvent("click", function(e) { - show_account_dialog(); - e.stop(); - }); - - $("account_reset").addEvent("click", function(e) { - hide_account_dialog(); - }); - - $("account_add_button").addEvent("click", this.addAccount.bind(this)); - $("account_submit").addEvent("click", this.submitAccounts.bind(this)); - - - }, - - menuClick: function(e) { - var string = e.target.get("id").split("|"); - var category = string[0]; - var section = string[1]; - var name = e.target.get("text"); - - if (category == "general") { - var target = this.general; - } else if (category == "plugin") { - var target = this.plugin; - } - - target.dissolve(); - - new Request({ - "method" : "get", - "url" : "/json/load_config/" + category + "/" + section, - "onSuccess": function(data) { - target.set("html", data); - target.reveal(); - this.name.set("text", name); - }.bind(this) - }).send(); - }, - - configSubmit: function(e) { - var string = e.target.get("id").split("|"); - var category = string[0]; - - var form = $(category + "_form"); - - - form.set("send", { - "method": "post", - "url": "/json/save_config/" + category, - "onSuccess" : function() { - notify.alert(success_msg, { - 'className': 'success' - }); - - }, - "onFailure": function() { - notify.alert(failed_msg, { - 'className': 'error' - }); - } - }); - - form.send(); - - e.stop(); - - }, - addAccount: function(e) { - - var form = $("add_account_form"); - form.set("send", { - "method": "post", - "onSuccess" : function() { - window.location.reload() - }, - "onFailure": function() { - notify.alert(failed_msg, { - 'className': 'error' - }); - } - }); - - form.send(); - - - e.stop(); - }, - - submitAccounts: function(e) { - - var form = $("account_form"); - form.set("send", { - "method": "post", - "onSuccess" : function() { - window.location.reload() - }, - "onFailure": function() { - notify.alert('Error occured', { - 'className': 'error' - }); - } - }); - - form.send(); - - - e.stop(); - - e.stop(); - } - }); |