]> git.wh0rd.org - tt-rss.git/blobdiff - js/prefs.js
require version information in all additional themes
[tt-rss.git] / js / prefs.js
index e226459fc24fa0386b479ea53e20b464256b6560..67a4a378c57c9b1131c7027ebaf7516a1863b908 100644 (file)
@@ -83,17 +83,34 @@ function addUser() {
 function editUser(id, event) {
 
        try {
-               notify_progress("Loading, please wait...");
-
-               var query = "?op=pref-users&method=edit&id=" +
+               var query = "backend.php?op=pref-users&method=edit&id=" +
                        param_escape(id);
 
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                                       infobox_callback2(transport, __("User Editor"));
-                                       document.forms['user_edit_form'].login.focus();
-                               } });
+               if (dijit.byId("userEditDlg"))
+                       dijit.byId("userEditDlg").destroyRecursive();
+
+               dialog = new dijit.Dialog({
+                       id: "userEditDlg",
+                       title: __("User Editor"),
+                       style: "width: 600px",
+                       execute: function() {
+                               if (this.validate()) {
+
+                                       notify_progress("Saving data...", true);
+
+                                       var query = dojo.formToQuery("user_edit_form");
+
+                                       new Ajax.Request("backend.php", {
+                                               parameters: query,
+                                               onComplete: function(transport) {
+                                                       dialog.hide();
+                                                       updateUsersList();
+                                               }});
+                               }
+                       },
+                       href: query});
+
+               dialog.show();
 
        } catch (e) {
                exception_error("editUser", e);
@@ -463,43 +480,6 @@ function purgeSelectedFeeds() {
        return false;
 }
 
-function userEditCancel() {
-       closeInfoBox();
-       return false;
-}
-
-function userEditSave() {
-
-       try {
-
-               var login = document.forms["user_edit_form"].login.value;
-
-               if (login.length == 0) {
-                       alert(__("Login field cannot be blank."));
-                       return;
-               }
-
-               notify_progress("Saving user...");
-
-               closeInfoBox();
-
-               var query = Form.serialize("user_edit_form");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               updateUsersList();
-                       } });
-
-       } catch (e) {
-               exception_error("userEditSave", e);
-       }
-
-       return false;
-
-}
-
-
 function editSelectedUser() {
        var rows = getSelectedUsers();
 
@@ -573,17 +553,24 @@ function selectedUserDetails() {
                        return;
                }
 
-               notify_progress("Loading, please wait...");
-
                var id = rows[0];
 
-               var query = "?op=pref-users&method=userdetails&id=" + id;
+               var query = "backend.php?op=pref-users&method=userdetails&id=" + id;
+
+               if (dijit.byId("userDetailsDlg"))
+                       dijit.byId("userDetailsDlg").destroyRecursive();
+
+               dialog = new dijit.Dialog({
+                       id: "userDetailsDlg",
+                       title: __("User details"),
+                       style: "width: 600px",
+                       execute: function() {
+                               dialog.hide();
+                       },
+                       href: query});
+
+               dialog.show();
 
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                                       infobox_callback2(transport, __("User details"));
-                               } });
        } catch (e) {
                exception_error("selectedUserDetails", e);
        }
@@ -1542,25 +1529,6 @@ function clearFeedAccessKeys() {
        return false;
 }
 
-function clearArticleAccessKeys() {
-
-       var ok = confirm(__("This will invalidate all previously shared article URLs. Continue?"));
-
-       if (ok) {
-               notify_progress("Clearing URLs...");
-
-               var query = "?op=rpc&method=clearArticleKeys";
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               notify_info("Shared URLs cleared.");
-                       } });
-       }
-
-       return false;
-}
-
 function resetFilterOrder() {
        try {
                notify_progress("Loading, please wait...");