Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes

This commit is contained in:
Pantheon Automation 2016-04-20 09:56:34 -07:00 committed by Greg Anderson
parent b11a755ba8
commit c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions

View file

@ -3,7 +3,7 @@
* CKEditor button and group configuration user interface.
*/
(function ($, Drupal, _, CKEDITOR) {
(function ($, Drupal, drupalSettings, _) {
'use strict';
@ -496,4 +496,4 @@
return '<li class="ckeditor-add-new-group"><button role="button" aria-label="' + Drupal.t('Add a CKEditor button group to the end of this row.') + '">' + Drupal.t('Add group') + '</button></li>';
};
})(jQuery, Drupal, _, CKEDITOR);
})(jQuery, Drupal, drupalSettings, _);

View file

@ -273,4 +273,7 @@
}
});
// Set the CKEditor cache-busting string to the same value as Drupal.
CKEDITOR.timestamp = drupalSettings.ckeditor.timestamp;
})(Drupal, Drupal.debounce, CKEDITOR, jQuery);

View file

@ -0,0 +1,16 @@
(function ($, Drupal) {
'use strict';
/**
* Provides the summary for the "language" plugin settings vertical tab.
*/
Drupal.behaviors.ckeditorLanguageSettingsSummary = {
attach: function () {
$('#edit-editor-settings-plugins-language').drupalSetSummary(function (context) {
return $('#edit-editor-settings-plugins-language-language-list-type option:selected').text();
});
}
};
})(jQuery, Drupal);

View file

@ -3,7 +3,7 @@
* CKEditor StylesCombo admin behavior.
*/
(function ($, Drupal, drupalSettings) {
(function ($, Drupal, drupalSettings, _) {
'use strict';
@ -125,4 +125,4 @@
}
};
})(jQuery, Drupal, drupalSettings);
})(jQuery, Drupal, drupalSettings, _);

View file

Before

Width:  |  Height:  |  Size: 470 B

After

Width:  |  Height:  |  Size: 470 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -19,6 +19,8 @@
CKEDITOR.plugins.add('drupalimage', {
requires: 'image2',
icons: 'drupalimage',
hidpi: true,
beforeInit: function (editor) {
// Override the image2 widget definition to require and handle the
@ -216,7 +218,7 @@
// discovered.
// @see plugins/image2/plugin.js/init() in CKEditor; this is similar.
if (this.parts.link) {
this.setData('link', CKEDITOR.plugins.link.parseLinkAttributes(editor, this.parts.link));
this.setData('link', CKEDITOR.plugins.image2.getLinkAttributesParser()(editor, this.parts.link));
}
};
});
@ -270,8 +272,7 @@
editor.ui.addButton('DrupalImage', {
label: Drupal.t('Image'),
// Note that we use the original image2 command!
command: 'image',
icon: this.path + '/image.png'
command: 'image'
});
}
},
@ -282,6 +283,15 @@
});
// Override image2's integration with the official CKEditor link plugin:
// integrate with the drupallink plugin instead.
CKEDITOR.plugins.image2.getLinkAttributesParser = function () {
return CKEDITOR.plugins.drupallink.parseLinkAttributes;
};
CKEDITOR.plugins.image2.getLinkAttributesGetter = function () {
return CKEDITOR.plugins.drupallink.getLinkAttributes;
};
/**
* Integrates the drupalimage widget with the drupallink plugin.
*

View file

Before

Width:  |  Height:  |  Size: 328 B

After

Width:  |  Height:  |  Size: 328 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -9,7 +9,7 @@
'use strict';
function parseAttributes(element) {
function parseAttributes(editor, element) {
var parsedAttributes = {};
var domElement = element.$;
@ -35,7 +35,36 @@
return parsedAttributes;
}
function getAttributes(editor, data) {
var set = {};
for (var attributeName in data) {
if (data.hasOwnProperty(attributeName)) {
set[attributeName] = data[attributeName];
}
}
// CKEditor tracks the *actual* saved href in a data-cke-saved-* attribute
// to work around browser quirks. We need to update it.
set['data-cke-saved-href'] = set.href;
// Remove all attributes which are not currently set.
var removed = {};
for (var s in set) {
if (set.hasOwnProperty(s)) {
delete removed[s];
}
}
return {
set: set,
removed: CKEDITOR.tools.objectKeys(removed)
};
}
CKEDITOR.plugins.add('drupallink', {
icons: 'drupallink,drupalunlink',
hidpi: true,
init: function (editor) {
// Add the commands for link and unlink.
editor.addCommand('drupallink', {
@ -63,7 +92,7 @@
// Set existing values based on selected element.
var existingValues = {};
if (linkElement && linkElement.$) {
existingValues = parseAttributes(linkElement);
existingValues = parseAttributes(editor, linkElement);
}
// Or, if an image widget is focused, we're editing a link wrapping
// an image widget.
@ -169,13 +198,11 @@
if (editor.ui.addButton) {
editor.ui.addButton('DrupalLink', {
label: Drupal.t('Link'),
command: 'drupallink',
icon: this.path + '/link.png'
command: 'drupallink'
});
editor.ui.addButton('DrupalUnlink', {
label: Drupal.t('Unlink'),
command: 'drupalunlink',
icon: this.path + '/unlink.png'
command: 'drupalunlink'
});
}
@ -266,47 +293,12 @@
return null;
}
/**
* The image2 plugin is currently tightly coupled to the link plugin: it
* calls CKEDITOR.plugins.link.parseLinkAttributes().
*
* Drupal 8's CKEditor build doesn't include the 'link' plugin. Because it
* includes its own link plugin that integrates with Drupal's dialog system.
* So, to allow images to be linked, we need to duplicate the necessary subset
* of the logic.
*
* @todo Remove once we update to CKEditor 4.5.5.
* @see https://dev.ckeditor.com/ticket/13885
*/
CKEDITOR.plugins.link = CKEDITOR.plugins.link || {
parseLinkAttributes: function (editor, element) {
return parseAttributes(element);
},
getLinkAttributes: function (editor, data) {
var set = {};
for (var attributeName in data) {
if (data.hasOwnProperty(attributeName)) {
set[attributeName] = data[attributeName];
}
}
// CKEditor tracks the *actual* saved href in a data-cke-saved-* attribute
// to work around browser quirks. We need to update it.
set['data-cke-saved-href'] = set.href;
// Remove all attributes which are not currently set.
var removed = {};
for (var s in set) {
if (set.hasOwnProperty(s)) {
delete removed[s];
}
}
return {
set: set,
removed: CKEDITOR.tools.objectKeys(removed)
};
}
// Expose an API for other plugins to interact with drupallink widgets.
// (Compatible with the official CKEditor link plugin's API:
// http://dev.ckeditor.com/ticket/13885.)
CKEDITOR.plugins.drupallink = {
parseLinkAttributes: parseAttributes,
getLinkAttributes: getAttributes
};
})(jQuery, Drupal, drupalSettings, CKEDITOR);

View file

@ -3,7 +3,7 @@
* A Backbone View acting as a controller for CKEditor toolbar configuration.
*/
(function (Drupal, Backbone, $) {
(function ($, Drupal, Backbone, CKEDITOR, _) {
'use strict';
@ -380,4 +380,4 @@
}
});
})(Drupal, Backbone, jQuery);
})(jQuery, Drupal, Backbone, CKEDITOR, _);

View file

@ -3,7 +3,7 @@
* Backbone View providing the aural view of CKEditor keyboard UX configuration.
*/
(function (Drupal, Backbone, $) {
(function ($, Drupal, Backbone, _) {
'use strict';
@ -263,4 +263,4 @@
}
});
})(Drupal, Backbone, jQuery);
})(jQuery, Drupal, Backbone, _);