/[drupal]/contributions/modules/autosave/autosave.js
ViewVC logotype

Diff of /contributions/modules/autosave/autosave.js

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

revision 1.8, Mon Nov 2 17:09:55 2009 UTC revision 1.9, Wed Nov 4 06:23:09 2009 UTC
# Line 15  if (Drupal.jsEnabled) { Line 15  if (Drupal.jsEnabled) {
15          if ($(this).html() == 'View') {          if ($(this).html() == 'View') {
16            $('#' + autosaved_form_id).formHash(autosaved.serialized);            $('#' + autosaved_form_id).formHash(autosaved.serialized);
17    
18            // need to loop through any WYSIWYG editor fields and update the visible iframe fields with hidden field content            if (Drupal.settings.autosave.wysiwyg) {
19            for (var instance in Drupal.wysiwyg.instances) {              // need to loop through any WYSIWYG editor fields and update the visible iframe fields with hidden field content
20              Drupal.wysiwyg.instances[instance].setContent($('#' + instance).val());              for (var instance in Drupal.wysiwyg.instances) {
21                  Drupal.wysiwyg.instances[instance].setContent($('#' + instance).val());
22                }
23            }            }
24            $('#' + autosaved_form_id).focus();            $('#' + autosaved_form_id).focus();
25            $(this).html('Reset');            $(this).html('Reset');
# Line 58  if (Drupal.jsEnabled) { Line 60  if (Drupal.jsEnabled) {
60  }  }
61    
62  Drupal.saveForm = function() {  Drupal.saveForm = function() {
63    // need to loop through any WYSIWYG editor fields and update the real (hidden) text fields before saving    if (Drupal.settings.autosave.wysiwyg) {
64    for (var instance in Drupal.wysiwyg.instances) {      // need to loop through any WYSIWYG editor fields and update the real (hidden) text fields before saving
65      if (Drupal.wysiwyg.instances[instance].editor != 'none') {      for (var instance in Drupal.wysiwyg.instances) {
66        var content = Drupal.wysiwyg.instances[instance].getContent();        if (Drupal.wysiwyg.instances[instance].editor != 'none') {
67        $('#' + instance).val(content);          var content = Drupal.wysiwyg.instances[instance].getContent();
68            $('#' + instance).val(content);
69          }
70      }      }
71    }    }
72    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2