diff options
author | Heshan Wanigasooriya <heshanmw@gmail.com> | 2009-04-27 09:40:04 +0000 |
---|---|---|
committer | Heshan Wanigasooriya <heshanmw@gmail.com> | 2009-04-27 09:40:04 +0000 |
commit | 8914e5e66485a1cb9ee1fb741ae47a561167104e (patch) | |
tree | c717efd7d4293212a617d697853f49b3da64ca3f /types/video_upload/video_upload.js | |
parent | 23348d9bc9a704d4a1a58c9580d03737ee52f8a3 (diff) | |
download | video-8914e5e66485a1cb9ee1fb741ae47a561167104e.tar.gz video-8914e5e66485a1cb9ee1fb741ae47a561167104e.tar.bz2 |
add video types to the latest version
Diffstat (limited to 'types/video_upload/video_upload.js')
-rw-r--r-- | types/video_upload/video_upload.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/types/video_upload/video_upload.js b/types/video_upload/video_upload.js new file mode 100644 index 0000000..0341f16 --- /dev/null +++ b/types/video_upload/video_upload.js @@ -0,0 +1,44 @@ +// $Id$ +/** + * @file + * Javascript functions for busy status on video uploads + * + * TODO: Support AJAX Uploads :-) + * + * @author Fabio Varesano <fvaresano at yahoo dot it> + * porting to Drupal 6 + * @author Heshan Wanigasooriya <heshan at heidisoft.com><heshanmw@gmail.com> + * @todo +*/ + +/** + * Hide the node form and show the busy div +*/ +Drupal.video_upload_hide = function () { + // hiding the form (using display: none) makes its file values empty in Konqueror (Possibly also Safari). So let's move the form away of the view of the browser + + $('#node-form').css({ position: "absolute", top: "-4000px" }); + + $("#sending").show(); + $("#video_upload_cancel_link").click(Drupal.video_upload_show); +} + +Drupal.video_upload_show = function() { + $('#node-form').show(); + $("#sending").hide(); + + //$("form").bind("submit", function() { return false; }) + window.location = window.location; +} + +/** + * Attaches the upload behaviour to the video upload form. + */ +Drupal.video_upload = function() { + $('#node-form').submit(Drupal.video_upload_hide); +} + +// Global killswitch +if (Drupal.jsEnabled) { + $(document).ready(Drupal.video_upload); +} |