bookmarkpopup.js 1.0 KB

123456789101112131415161718192021222324252627282930
  1. $(document).ready(
  2. function() {
  3. var form = $('#form_new_bookmark');
  4. form.append('<input type="hidden" name="ajax" value="1"/>');
  5. function doClose() {
  6. self.close();
  7. // If in popup blocker situation, we'll have to redirect back.
  8. setTimeout(function() {
  9. window.location = $('#url').val();
  10. }, 100);
  11. }
  12. form.ajaxForm({dataType: 'xml',
  13. timeout: '60000',
  14. beforeSend: function(formData) {
  15. form.addClass('processing');
  16. form.find('#submit').addClass('disabled');
  17. },
  18. error: function (xhr, textStatus, errorThrown) {
  19. form.removeClass('processing');
  20. form.find('#submit').removeClass('disabled');
  21. doClose();
  22. },
  23. success: function(data, textStatus) {
  24. form.removeClass('processing');
  25. form.find('#submit').removeClass('disabled');
  26. doClose();
  27. }});
  28. }
  29. );