summaryrefslogtreecommitdiffstatshomepage
path: root/core/misc/authorize.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/misc/authorize.js')
-rw-r--r--core/misc/authorize.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/core/misc/authorize.js b/core/misc/authorize.js
new file mode 100644
index 00000000000..66b789791c8
--- /dev/null
+++ b/core/misc/authorize.js
@@ -0,0 +1,28 @@
+
+/**
+ * @file
+ * Conditionally hide or show the appropriate settings and saved defaults
+ * on the file transfer connection settings form used by authorize.php.
+ */
+
+(function ($) {
+
+Drupal.behaviors.authorizeFileTransferForm = {
+ attach: function(context) {
+ $('#edit-connection-settings-authorize-filetransfer-default').change(function() {
+ $('.filetransfer').hide().filter('.filetransfer-' + $(this).val()).show();
+ });
+ $('.filetransfer').hide().filter('.filetransfer-' + $('#edit-connection-settings-authorize-filetransfer-default').val()).show();
+
+ // Removes the float on the select box (used for non-JS interface).
+ if ($('.connection-settings-update-filetransfer-default-wrapper').length > 0) {
+ console.log($('.connection-settings-update-filetransfer-default-wrapper'));
+ $('.connection-settings-update-filetransfer-default-wrapper').css('float', 'none');
+ }
+ // Hides the submit button for non-js users.
+ $('#edit-submit-connection').hide();
+ $('#edit-submit-process').show();
+ }
+};
+
+})(jQuery);