Projet

Général

Profil

Révision 29771811

Ajouté par Assos Assos il y a presque 5 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media_ckeditor/js/plugins/media/plugin.js
20 20
    hidpi: true,
21 21
    onLoad: function() {
22 22
      // Check if this instance has widget support.
23
      mediaPluginDefinition.hasWidgetSupport = typeof(CKEDITOR.plugins.registered.widget) != 'undefined';
23
      // mediaPluginDefinition.hasWidgetSupport = typeof(CKEDITOR.plugins.registered.widget) != 'undefined';
24 24
      // Add dependency to widget plugin if possible.
25
      if (parseFloat(CKEDITOR.version) >= 4.3 && mediaPluginDefinition.hasWidgetSupport) {
25
      if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4.3') >= 0 && mediaPluginDefinition.hasWidgetSupport) {
26 26
        mediaPluginDefinition.requires.push('widget');
27 27
      }
28 28
    },
......
90 90
        editor.addMenuGroup('mediaGroup');
91 91
        editor.addMenuItem('mediaConfigureItem', {
92 92
          label: Drupal.settings.media_ckeditor.labels['settings'],
93
          icon: this.path + 'images/icon.gif',
93
          icon: this.path + 'icons/media.png',
94 94
          command: 'mediaConfigure',
95 95
          group: 'mediaGroup'
96 96
        });
......
110 110
        command: 'media'
111 111
      });
112 112

  
113
      var ckeditorversion = parseFloat(CKEDITOR.version);
114

  
115 113
      // Because the media comment wrapper don't work well for CKEditor we
116 114
      // replace them by using a custom mediawrapper element.
117 115
      // Instead having
......
123 121
      CKEDITOR.dtd.$blockLimit['mediawrapper'] = 1;
124 122
      CKEDITOR.dtd.$inline['mediawrapper'] = 1;
125 123
      CKEDITOR.dtd.$nonEditable['mediawrapper'] = 1;
126
      if (ckeditorversion >= 4.1) {
124
      if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4.1') >= 0) {
127 125
        // Register allowed tag for advanced filtering.
128 126
        editor.filter.allow( 'mediawrapper[!data]', 'mediawrapper', true);
129 127
        // Don't remove the data-file_info attribute added by media!
......
205 203
          }
206 204
        });
207 205
      }
208
      else if (ckeditorversion >= 4) {
206
      else if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '4') >= 0) {
209 207
        // CKEditor >=4.0
210 208
        editor.on('setData', function( event ) {
211 209
          event.data.dataValue = prepareDataForWysiwygMode(event.data.dataValue);
......
254 252
                  // While v3 plays nice with setting start and end to avoid
255 253
                  // editing within the media wrapper element, v4 ignores that.
256 254
                  // Thus we try to move the cursor further away.
257
                  if (parseInt(CKEDITOR.version) > 3) {
255
                  if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '3') > 0) {
258 256
                    range.setStart(commonAncestor.getPrevious());
259 257
                    range.setEnd(commonAncestor.getPrevious());
260 258
                  }
......
266 264
                  // While v3 plays nice with setting start and end to avoid
267 265
                  // editing within the media wrapper element, v4 ignores that.
268 266
                  // Thus we try to move the cursor further away.
269
                  if (parseInt(CKEDITOR.version) > 3) {
267
                  if (Drupal.settings.ckeditor.plugins['media'].compareVersions(CKEDITOR.version, '3') > 0) {
270 268
                    range.setStart(commonAncestor.getNext(), 1);
271 269
                    range.setEnd(commonAncestor.getNext(), 1);
272 270
                  }

Formats disponibles : Unified diff