]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Better UI for bookmark popup
authorEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 20:57:03 +0000 (12:57 -0800)
committerEvan Prodromou <evan@status.net>
Mon, 27 Dec 2010 20:57:03 +0000 (12:57 -0800)
plugins/Bookmark/bookmarkpopup.js [new file with mode: 0644]
plugins/Bookmark/bookmarkpopup.php

diff --git a/plugins/Bookmark/bookmarkpopup.js b/plugins/Bookmark/bookmarkpopup.js
new file mode 100644 (file)
index 0000000..29f314e
--- /dev/null
@@ -0,0 +1,23 @@
+$(document).ready(
+    function() {
+       var form = $('#form_new_bookmark');
+        form.append('<input type="hidden" name="ajax" value="1"/>');
+        form.ajaxForm({dataType: 'xml',
+                      timeout: '60000',
+                       beforeSend: function(formData) {
+                          form.addClass('processing');
+                          form.find('#submit').addClass('disabled');
+                      },
+                       error: function (xhr, textStatus, errorThrown) {
+                          form.removeClass('processing');
+                          form.find('#submit').removeClass('disabled');
+                          self.close();
+                      },
+                       success: function(data, textStatus) {
+                          form.removeClass('processing');
+                          form.find('#submit').removeClass('disabled');
+                           self.close();
+                       }});
+
+    }
+);
\ No newline at end of file
index 2e6d457a83f750a9be236cb8a71eae264af0bfa8..24ed79612b3fd65fb3cc17101f6295219ff1c185 100644 (file)
@@ -103,4 +103,10 @@ class BookmarkpopupAction extends NewbookmarkAction
     function showFooter()
     {
     }
+
+    function showScripts()
+    {
+        parent::showScripts();
+        $this->script(common_path('plugins/Bookmark/bookmarkpopup.js'));
+    }
 }