aboutsummaryrefslogtreecommitdiff
path: root/data/assets/js/admin/dialogs/project-edit.js
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2016-07-29 17:10:50 -0400
committerPaul Duncan <pabs@pablotron.org>2016-07-29 17:10:50 -0400
commit0c2d54c6159cf4b9e4c93e43c18ad4d08bf54faf (patch)
tree743a1f36336db69c2e95fc9d02e7a5e26fe2f963 /data/assets/js/admin/dialogs/project-edit.js
parent80c76ca5320ca3b45ed6bf4a2d4530c6dad59c3c (diff)
downloadguff-0c2d54c6159cf4b9e4c93e43c18ad4d08bf54faf.tar.bz2
guff-0c2d54c6159cf4b9e4c93e43c18ad4d08bf54faf.zip
enable generate secret button and add gripe()
Diffstat (limited to 'data/assets/js/admin/dialogs/project-edit.js')
-rw-r--r--data/assets/js/admin/dialogs/project-edit.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/data/assets/js/admin/dialogs/project-edit.js b/data/assets/js/admin/dialogs/project-edit.js
index 17236f6..8df9364 100644
--- a/data/assets/js/admin/dialogs/project-edit.js
+++ b/data/assets/js/admin/dialogs/project-edit.js
@@ -21,4 +21,20 @@ jQuery(function($) {
// stop event
return false;
});
+
+ $('#project-edit-generate-secret').click(function() {
+ var me = $(this);
+
+ // disable button
+ me.toggleClass('disabled').find('.fa').toggleClass('fa-spin');
+ send('project/generate_secret').always(function() {
+ // enable button
+ me.toggleClass('disabled').find('.fa').toggleClass('fa-spin');
+ }).fail(function(r) {
+ gripe(r, 'generate secret');
+ }).done(function(r) {
+ // update secret
+ $('#project-edit-secret').val(r.secret);
+ });
+ });
});