aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorFabio Varesano <fax8@13637.no-reply.drupal.org>2007-01-14 16:35:44 +0000
committerFabio Varesano <fax8@13637.no-reply.drupal.org>2007-01-14 16:35:44 +0000
commitce5c292f8cd4f31ceee8012055c6f6c0ac957d4b (patch)
tree4c376eade9125f3b0d3c0bb1060b5d15c0ec27bb /plugins
parentcd355d137ff231091774b87050ffd5ec76d9ef4d (diff)
downloadvideo-ce5c292f8cd4f31ceee8012055c6f6c0ac957d4b.tar.gz
video-ce5c292f8cd4f31ceee8012055c6f6c0ac957d4b.tar.bz2
Added support for busy indicator on video uploads.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/video_upload/video_upload.js17
-rw-r--r--plugins/video_upload/video_upload.module10
2 files changed, 27 insertions, 0 deletions
diff --git a/plugins/video_upload/video_upload.js b/plugins/video_upload/video_upload.js
index 0fd80c1..bed69a0 100644
--- a/plugins/video_upload/video_upload.js
+++ b/plugins/video_upload/video_upload.js
@@ -8,5 +8,22 @@
* @author Fabio Varesano <fvaresano at yahoo dot it>
*/
+/**
+ * Hide the node form and show the busy div
+*/
+Drupal.video_upload_hide = function () {
+ $('#node-form').hide();
+ $("#sending").show();
+}
+/**
+ * Attaches the upload behaviour to the video upload form.
+ */
+Drupal.video_upload = function() {
+ $('#node-form').submit(video_upload_hide);
+}
+// Global killswitch
+if (Drupal.jsEnabled) {
+ $(document).ready(Drupal.video_upload);
+}
diff --git a/plugins/video_upload/video_upload.module b/plugins/video_upload/video_upload.module
index 55d72d7..d0a82f0 100644
--- a/plugins/video_upload/video_upload.module
+++ b/plugins/video_upload/video_upload.module
@@ -135,6 +135,8 @@ function video_upload_form_alter($form_id, &$form) {
if($form_id == 'video_node_form' && isset($form['video']) && user_access('upload video files')) {
theme('video_upload_get_script');
+
+ $form['#suffix'] = theme('video_upload_busy');
//get node object from form
$node = $form['#node'];
@@ -365,4 +367,12 @@ function theme_video_upload_get_script() {
}
+function theme_video_upload_busy() {
+ return '<div id="sending" style="display: none;">
+ <h3>' . t('Sending video... please wait.') . '</h3>
+ <img src="'. drupal_get_path('module', 'video_upload') . '/busy.gif" alt="' . t('Sending video... please wait.') . '"/>
+ </div>';
+}
+
+