Projet

Général

Profil

Révision 2e0f6994

Ajouté par Assos Assos il y a environ 4 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ckeditor/includes/ckeditor.utils.js
37 37
    $("#" + textarea_id).addClass("ckeditor-processed");
38 38

  
39 39
    var textarea_settings = false;
40
    ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar = eval(ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar);
40
    if (typeof(ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar) != 'object') {
41
      ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar = Drupal.ckeditorToolbarToArray(ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]].toolbar);
42
    }
41 43
    textarea_settings = ckeditor_obj.input_formats[ckeditor_obj.elements[textarea_id]];
42 44

  
43 45
    var drupalTopToolbar = $('#toolbar, #admin-menu', Drupal.overlayChild ? window.parent.document : document);
......
123 125

  
124 126
    if (typeof textarea_settings['js_conf'] != 'undefined'){
125 127
      for (var add_conf in textarea_settings['js_conf']){
126
        textarea_settings[add_conf] = eval(textarea_settings['js_conf'][add_conf]);
128
        var data;
129
        if (add_conf == 'toolbar') {
130
          data = Drupal.ckeditorToolbarToArray(textarea_settings['js_conf'][add_conf]);
131
        } else if (typeof textarea_settings['js_conf'][add_conf] === "boolean" ) {
132
          data = textarea_settings['js_conf'][add_conf];
133
        } else {
134
          data = JSON.parse(textarea_settings['js_conf'][add_conf].replace(/'/g, '"'));
135
        }
136

  
137
        textarea_settings[add_conf] = data;
127 138
      }
128 139
    }
129 140

  
......
141 152
      textarea_settings = Drupal.ckeditorLoadPlugins(textarea_settings);
142 153
      Drupal.ckeditorInstance = CKEDITOR.replace(textarea_id, textarea_settings);
143 154
    }
144
  }
155
  };
145 156

  
146 157
  Drupal.ckeditorOn = function(textarea_id, run_filter) {
147 158

  
......
256 267
    }
257 268
  };
258 269

  
270
  if (typeof(Drupal.ckeditorToolbarToArray) == 'undefined') {
271
    Drupal.ckeditorToolbarToArray = function (toolbar) {
272
      toolbar = toolbar.replace(/\r?\n|\r/gmi, '')
273
          .replace(/\s/gmi, '')
274
          .replace(/([a-zA-Z0-9]+?):/g, '"$1":')
275
          .replace(/'/g, '"');
276

  
277
      return JSON.parse(toolbar);
278
    };
279
  }
280

  
259 281
  /**
260 282
 * Ajax support
261 283
 */
......
282 304
      Drupal.behaviors.textarea.attach(context);
283 305
    }
284 306

  
307
    // Manually set the cache-busting string to the same value as Drupal.
308
    if (typeof(Drupal.settings.ckeditor.timestamp) != 'undefined') {
309
      CKEDITOR.timestamp = Drupal.settings.ckeditor.timestamp;
310
    }
311

  
285 312
    $(context).find("textarea.ckeditor-mod:not(.ckeditor-processed)").each(function () {
286 313
      var ta_id=$(this).attr("id");
287 314
      if (CKEDITOR.instances && typeof(CKEDITOR.instances[ta_id]) != 'undefined'){

Formats disponibles : Unified diff