/[drupal]/contributions/themes/blueprint/scripts/general.js
ViewVC logotype

Contents of /contributions/themes/blueprint/scripts/general.js

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download) (as text)
Wed Feb 6 16:40:00 2008 UTC (21 months, 2 weeks ago) by m3avrck
Branch: MAIN
CVS Tags: DRUPAL-6--1-0, DRUPAL-6--1-1, DRUPAL-5--1-1, DRUPAL-5--1-0, DRUPAL-5--1-2, HEAD
Branch point for: DRUPAL-5, DRUPAL-6--1
Changes since 1.2: +3 -3 lines
File MIME type: text/javascript
whitespace cleanup
1 // generic JS fixes
2
3 // various JavaScript object.
4 var Blueprint = {};
5
6 // jump to the value in a select drop down
7 Blueprint.go = function(e) {
8 var destination = e.options[e.selectedIndex].value;
9 if (destination && destination != 0) location.href = destination;
10 };
11
12 // prevent users from clicking a submit button twice
13 Blueprint.formCheck = function() {
14 // only apply this to node and comment and new user registration forms
15 var forms = $("#node-form>div>div>#edit-submit,#comment-form>div>#edit-submit,#user-register>div>#edit-submit");
16
17 // insert the saving div now to cache it for better performance and to show the loading image
18 $('<div id="saving"><p class="saving">Saving&hellip;</p></div>').insertAfter(forms);
19
20 forms.click(function() {
21 $(this).siblings("input[@type=submit]").hide();
22 $(this).hide();
23 $("#saving").show();
24
25 var notice = function() {
26 $('<p id="saving-notice">Not saving? Wait a few seconds, reload this page, and try again. Every now and then the internet hiccups too :-)</p>').appendTo("#saving").fadeIn();
27 };
28
29 // append notice if form saving isn't work, perhaps a timeout issue
30 setTimeout(notice, 24000);
31 });
32 };
33
34 // Global Killswitch.
35 if (Drupal.jsEnabled) {
36 $(document).ready(Blueprint.formCheck);
37 }

  ViewVC Help
Powered by ViewVC 1.1.2