reverted: --- b/core/misc/active-link.js +++ a/core/misc/active-link.js @@ -0,0 +1,47 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, drupalSettings) { + Drupal.behaviors.activeLinks = { + attach: function attach(context) { + var path = drupalSettings.path; + var queryString = JSON.stringify(path.currentQuery); + var querySelector = path.currentQuery ? "[data-drupal-link-query='".concat(queryString, "']") : ':not([data-drupal-link-query])'; + var originalSelectors = ["[data-drupal-link-system-path=\"".concat(path.currentPath, "\"]")]; + var selectors; + + if (path.isFront) { + originalSelectors.push('[data-drupal-link-system-path=""]'); + } + + selectors = [].concat(originalSelectors.map(function (selector) { + return "".concat(selector, ":not([hreflang])"); + }), originalSelectors.map(function (selector) { + return "".concat(selector, "[hreflang=\"").concat(path.currentLanguage, "\"]"); + })); + selectors = selectors.map(function (current) { + return current + querySelector; + }); + var activeLinks = context.querySelectorAll(selectors.join(',')); + var il = activeLinks.length; + + for (var i = 0; i < il; i++) { + activeLinks[i].classList.add('is-active'); + } + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + var activeLinks = context.querySelectorAll('[data-drupal-link-system-path].is-active'); + var il = activeLinks.length; + + for (var i = 0; i < il; i++) { + activeLinks[i].classList.remove('is-active'); + } + } + } + }; +})(Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/misc/ajax.js +++ a/core/misc/ajax.js @@ -0,0 +1,727 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +(function ($, window, Drupal, drupalSettings, loadjs, _ref) { + var isFocusable = _ref.isFocusable, + tabbable = _ref.tabbable; + Drupal.behaviors.AJAX = { + attach: function attach(context, settings) { + function loadAjaxBehavior(base) { + var elementSettings = settings.ajax[base]; + + if (typeof elementSettings.selector === 'undefined') { + elementSettings.selector = "#".concat(base); + } + + once('drupal-ajax', $(elementSettings.selector)).forEach(function (el) { + elementSettings.element = el; + elementSettings.base = base; + Drupal.ajax(elementSettings); + }); + } + + Object.keys(settings.ajax || {}).forEach(function (base) { + return loadAjaxBehavior(base); + }); + Drupal.ajax.bindAjaxLinks(document.body); + once('ajax', '.use-ajax-submit').forEach(function (el) { + var elementSettings = {}; + elementSettings.url = $(el.form).attr('action'); + elementSettings.setClick = true; + elementSettings.event = 'click'; + elementSettings.progress = { + type: 'throbber' + }; + elementSettings.base = el.id; + elementSettings.element = el; + Drupal.ajax(elementSettings); + }); + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + Drupal.ajax.expired().forEach(function (instance) { + Drupal.ajax.instances[instance.instanceIndex] = null; + }); + } + } + }; + + Drupal.AjaxError = function (xmlhttp, uri, customMessage) { + var statusCode; + var statusText; + var responseText; + + if (xmlhttp.status) { + statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', { + '!status': xmlhttp.status + })); + } else { + statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.')); + } + + statusCode += "\n".concat(Drupal.t('Debugging information follows.')); + var pathText = "\n".concat(Drupal.t('Path: !uri', { + '!uri': uri + })); + statusText = ''; + + try { + statusText = "\n".concat(Drupal.t('StatusText: !statusText', { + '!statusText': xmlhttp.statusText.trim() + })); + } catch (e) {} + + responseText = ''; + + try { + responseText = "\n".concat(Drupal.t('ResponseText: !responseText', { + '!responseText': xmlhttp.responseText.trim() + })); + } catch (e) {} + + responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); + responseText = responseText.replace(/[\n]+\s+/g, '\n'); + var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', { + '!readyState': xmlhttp.readyState + })) : ''; + customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', { + '!customMessage': customMessage + })) : ''; + this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; + this.name = 'AjaxError'; + }; + + Drupal.AjaxError.prototype = new Error(); + Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; + + Drupal.ajax = function (settings) { + if (arguments.length !== 1) { + throw new Error('Drupal.ajax() function must be called with one configuration object only'); + } + + var base = settings.base || false; + var element = settings.element || false; + delete settings.base; + delete settings.element; + + if (!settings.progress && !element) { + settings.progress = false; + } + + var ajax = new Drupal.Ajax(base, element, settings); + ajax.instanceIndex = Drupal.ajax.instances.length; + Drupal.ajax.instances.push(ajax); + return ajax; + }; + + Drupal.ajax.instances = []; + + Drupal.ajax.expired = function () { + return Drupal.ajax.instances.filter(function (instance) { + return instance && instance.element !== false && !document.body.contains(instance.element); + }); + }; + + Drupal.ajax.bindAjaxLinks = function (element) { + once('ajax', '.use-ajax', element).forEach(function (ajaxLink) { + var $linkElement = $(ajaxLink); + var elementSettings = { + progress: { + type: 'throbber' + }, + dialogType: $linkElement.data('dialog-type'), + dialog: $linkElement.data('dialog-options'), + dialogRenderer: $linkElement.data('dialog-renderer'), + base: $linkElement.attr('id'), + element: ajaxLink + }; + var href = $linkElement.attr('href'); + + if (href) { + elementSettings.url = href; + elementSettings.event = 'click'; + } + + Drupal.ajax(elementSettings); + }); + }; + + Drupal.Ajax = function (base, element, elementSettings) { + var defaults = { + event: element ? 'mousedown' : null, + keypress: true, + selector: base ? "#".concat(base) : null, + effect: 'none', + speed: 'none', + method: 'replaceWith', + progress: { + type: 'throbber', + message: Drupal.t('Please wait...') + }, + submit: { + js: true + } + }; + $.extend(this, defaults, elementSettings); + this.commands = new Drupal.AjaxCommands(); + this.instanceIndex = false; + + if (this.wrapper) { + this.wrapper = "#".concat(this.wrapper); + } + + this.element = element; + this.element_settings = elementSettings; + this.elementSettings = elementSettings; + + if (this.element && this.element.form) { + this.$form = $(this.element.form); + } + + if (!this.url) { + var $element = $(this.element); + + if ($element.is('a')) { + this.url = $element.attr('href'); + } else if (this.element && element.form) { + this.url = this.$form.attr('action'); + } + } + + var originalUrl = this.url; + this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); + + if (drupalSettings.ajaxTrustedUrl[originalUrl]) { + drupalSettings.ajaxTrustedUrl[this.url] = true; + } + + var ajax = this; + ajax.options = { + url: ajax.url, + data: ajax.submit, + beforeSerialize: function beforeSerialize(elementSettings, options) { + return ajax.beforeSerialize(elementSettings, options); + }, + beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { + ajax.ajaxing = true; + return ajax.beforeSubmit(formValues, elementSettings, options); + }, + beforeSend: function beforeSend(xmlhttprequest, options) { + ajax.ajaxing = true; + return ajax.beforeSend(xmlhttprequest, options); + }, + success: function success(response, status, xmlhttprequest) { + if (typeof response === 'string') { + response = $.parseJSON(response); + } + + if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { + if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { + var customMessage = Drupal.t('The response failed verification so will not be processed.'); + return ajax.error(xmlhttprequest, ajax.url, customMessage); + } + } + + return Promise.resolve(ajax.success(response, status)).then(function () { + ajax.ajaxing = false; + }); + }, + error: function error(xmlhttprequest, status, _error) { + ajax.ajaxing = false; + }, + complete: function complete(xmlhttprequest, status) { + if (status === 'error' || status === 'parsererror') { + return ajax.error(xmlhttprequest, ajax.url); + } + }, + dataType: 'json', + jsonp: false, + type: 'POST' + }; + + if (elementSettings.dialog) { + ajax.options.data.dialogOptions = elementSettings.dialog; + } + + if (ajax.options.url.indexOf('?') === -1) { + ajax.options.url += '?'; + } else { + ajax.options.url += '&'; + } + + var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax'); + + if (elementSettings.dialogRenderer) { + wrapper += ".".concat(elementSettings.dialogRenderer); + } + + ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper); + $(ajax.element).on(elementSettings.event, function (event) { + if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { + throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', { + '!url': ajax.url + })); + } + + return ajax.eventResponse(this, event); + }); + + if (elementSettings.keypress) { + $(ajax.element).on('keypress', function (event) { + return ajax.keypressResponse(this, event); + }); + } + + if (elementSettings.prevent) { + $(ajax.element).on(elementSettings.prevent, false); + } + }; + + Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; + Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; + + Drupal.Ajax.prototype.execute = function () { + if (this.ajaxing) { + return; + } + + try { + this.beforeSerialize(this.element, this.options); + return $.ajax(this.options); + } catch (e) { + this.ajaxing = false; + window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message)); + return $.Deferred().reject(); + } + }; + + Drupal.Ajax.prototype.keypressResponse = function (element, event) { + var ajax = this; + + if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { + event.preventDefault(); + event.stopPropagation(); + $(element).trigger(ajax.elementSettings.event); + } + }; + + Drupal.Ajax.prototype.eventResponse = function (element, event) { + event.preventDefault(); + event.stopPropagation(); + var ajax = this; + + if (ajax.ajaxing) { + return; + } + + try { + if (ajax.$form) { + if (ajax.setClick) { + element.form.clk = element; + } + + ajax.$form.ajaxSubmit(ajax.options); + } else { + ajax.beforeSerialize(ajax.element, ajax.options); + $.ajax(ajax.options); + } + } catch (e) { + ajax.ajaxing = false; + window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message)); + } + }; + + Drupal.Ajax.prototype.beforeSerialize = function (element, options) { + if (this.$form && document.body.contains(this.$form.get(0))) { + var settings = this.settings || drupalSettings; + Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); + } + + options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; + var pageState = drupalSettings.ajaxPageState; + options.data['ajax_page_state[theme]'] = pageState.theme; + options.data['ajax_page_state[theme_token]'] = pageState.theme_token; + options.data['ajax_page_state[libraries]'] = pageState.libraries; + }; + + Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; + + Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { + if (this.$form) { + options.extraData = options.extraData || {}; + options.extraData.ajax_iframe_upload = '1'; + var v = $.fieldValue(this.element); + + if (v !== null) { + options.extraData[this.element.name] = v; + } + } + + $(this.element).prop('disabled', true); + + if (!this.progress || !this.progress.type) { + return; + } + + var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase()); + + if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { + this[progressIndicatorMethod].call(this); + } + }; + + Drupal.theme.ajaxProgressThrobber = function (message) { + var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; + var throbber = '
 
'; + return "
".concat(throbber).concat(messageMarkup, "
"); + }; + + Drupal.theme.ajaxProgressIndicatorFullscreen = function () { + return '
 
'; + }; + + Drupal.theme.ajaxProgressMessage = function (message) { + return "
".concat(message, "
"); + }; + + Drupal.theme.ajaxProgressBar = function ($element) { + return $('
').append($element); + }; + + Drupal.Ajax.prototype.setProgressIndicatorBar = function () { + var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.id), $.noop, this.progress.method, $.noop); + + if (this.progress.message) { + progressBar.setProgress(-1, this.progress.message); + } + + if (this.progress.url) { + progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); + } + + this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); + this.progress.object = progressBar; + $(this.element).after(this.progress.element); + }; + + Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { + this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); + $(this.element).after(this.progress.element); + }; + + Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { + this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); + $('body').append(this.progress.element); + }; + + Drupal.Ajax.prototype.commandExecutionQueue = function (response, status) { + var _this = this; + + var ajaxCommands = this.commands; + return Object.keys(response || {}).reduce(function (executionQueue, key) { + return executionQueue.then(function () { + var command = response[key].command; + + if (command && ajaxCommands[command]) { + return ajaxCommands[command](_this, response[key], status); + } + }); + }, Promise.resolve()); + }; + + Drupal.Ajax.prototype.success = function (response, status) { + var _this2 = this; + + if (this.progress.element) { + $(this.progress.element).remove(); + } + + if (this.progress.object) { + this.progress.object.stopMonitoring(); + } + + $(this.element).prop('disabled', false); + var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); + var focusChanged = Object.keys(response || {}).some(function (key) { + var _response$key = response[key], + command = _response$key.command, + method = _response$key.method; + return command === 'focusFirst' || command === 'invoke' && method === 'focus'; + }); + return this.commandExecutionQueue(response, status).then(function () { + if (!focusChanged && _this2.element && !$(_this2.element).data('disable-refocus')) { + var target = false; + + for (var n = elementParents.length - 1; !target && n >= 0; n--) { + target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]")); + } + + if (target) { + $(target).trigger('focus'); + } + } + + if (_this2.$form && document.body.contains(_this2.$form.get(0))) { + var settings = _this2.settings || drupalSettings; + Drupal.attachBehaviors(_this2.$form.get(0), settings); + } + + _this2.settings = null; + }).catch(function (error) { + return console.error(Drupal.t('An error occurred during the execution of the Ajax response: !error', { + '!error': error + })); + }); + }; + + Drupal.Ajax.prototype.getEffect = function (response) { + var type = response.effect || this.effect; + var speed = response.speed || this.speed; + var effect = {}; + + if (type === 'none') { + effect.showEffect = 'show'; + effect.hideEffect = 'hide'; + effect.showSpeed = ''; + } else if (type === 'fade') { + effect.showEffect = 'fadeIn'; + effect.hideEffect = 'fadeOut'; + effect.showSpeed = speed; + } else { + effect.showEffect = "".concat(type, "Toggle"); + effect.hideEffect = "".concat(type, "Toggle"); + effect.showSpeed = speed; + } + + return effect; + }; + + Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { + if (this.progress.element) { + $(this.progress.element).remove(); + } + + if (this.progress.object) { + this.progress.object.stopMonitoring(); + } + + $(this.wrapper).show(); + $(this.element).prop('disabled', false); + + if (this.$form && document.body.contains(this.$form.get(0))) { + var settings = this.settings || drupalSettings; + Drupal.attachBehaviors(this.$form.get(0), settings); + } + + throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); + }; + + Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { + return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { + return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); + }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; + }; + + Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { + return $('
').append($elements); + }; + + Drupal.AjaxCommands = function () {}; + + Drupal.AjaxCommands.prototype = { + insert: function insert(ajax, response) { + var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); + var method = response.method || ajax.method; + var effect = ajax.getEffect(response); + var settings = response.settings || ajax.settings || drupalSettings; + var $newContent = $($.parseHTML(response.data, document, true)); + $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); + + switch (method) { + case 'html': + case 'replaceWith': + case 'replaceAll': + case 'empty': + case 'remove': + Drupal.detachBehaviors($wrapper.get(0), settings); + break; + + default: + break; + } + + $wrapper[method]($newContent); + + if (effect.showEffect !== 'show') { + $newContent.hide(); + } + + var $ajaxNewContent = $newContent.find('.ajax-new-content'); + + if ($ajaxNewContent.length) { + $ajaxNewContent.hide(); + $newContent.show(); + $ajaxNewContent[effect.showEffect](effect.showSpeed); + } else if (effect.showEffect !== 'show') { + $newContent[effect.showEffect](effect.showSpeed); + } + + if ($newContent.parents('html').length) { + $newContent.each(function (index, element) { + if (element.nodeType === Node.ELEMENT_NODE) { + Drupal.attachBehaviors(element, settings); + } + }); + } + }, + remove: function remove(ajax, response, status) { + var settings = response.settings || ajax.settings || drupalSettings; + $(response.selector).each(function () { + Drupal.detachBehaviors(this, settings); + }).remove(); + }, + changed: function changed(ajax, response, status) { + var $element = $(response.selector); + + if (!$element.hasClass('ajax-changed')) { + $element.addClass('ajax-changed'); + + if (response.asterisk) { + $element.find(response.asterisk).append(" * ")); + } + } + }, + alert: function alert(ajax, response, status) { + window.alert(response.text); + }, + announce: function announce(ajax, response) { + if (response.priority) { + Drupal.announce(response.text, response.priority); + } else { + Drupal.announce(response.text); + } + }, + redirect: function redirect(ajax, response, status) { + window.location = response.url; + }, + css: function css(ajax, response, status) { + $(response.selector).css(response.argument); + }, + settings: function settings(ajax, response, status) { + var ajaxSettings = drupalSettings.ajax; + + if (ajaxSettings) { + Drupal.ajax.expired().forEach(function (instance) { + if (instance.selector) { + var selector = instance.selector.replace('#', ''); + + if (selector in ajaxSettings) { + delete ajaxSettings[selector]; + } + } + }); + } + + if (response.merge) { + $.extend(true, drupalSettings, response.settings); + } else { + ajax.settings = response.settings; + } + }, + data: function data(ajax, response, status) { + $(response.selector).data(response.name, response.value); + }, + focusFirst: function focusFirst(ajax, response, status) { + var focusChanged = false; + var container = document.querySelector(response.selector); + + if (container) { + var tabbableElements = tabbable(container); + + if (tabbableElements.length) { + tabbableElements[0].focus(); + focusChanged = true; + } else if (isFocusable(container)) { + container.focus(); + focusChanged = true; + } + } + + if (ajax.hasOwnProperty('element') && !focusChanged) { + ajax.element.focus(); + } + }, + invoke: function invoke(ajax, response, status) { + var $element = $(response.selector); + $element[response.method].apply($element, _toConsumableArray(response.args)); + }, + restripe: function restripe(ajax, response, status) { + $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); + }, + update_build_id: function update_build_id(ajax, response, status) { + document.querySelectorAll("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).forEach(function (item) { + item.value = response.new; + }); + }, + add_css: function add_css(ajax, response, status) { + $('head').prepend(response.data); + }, + message: function message(ajax, response) { + var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); + + if (response.clearPrevious) { + messages.clear(); + } + + messages.add(response.message, response.messageOptions); + }, + add_js: function add_js(ajax, response, status) { + var parentEl = document.querySelector(response.selector || 'body'); + var settings = ajax.settings || drupalSettings; + var allUniqueBundleIds = response.data.map(function (script) { + var uniqueBundleId = script.src + ajax.instanceIndex; + loadjs(script.src, uniqueBundleId, { + async: false, + before: function before(path, scriptEl) { + Object.keys(script).forEach(function (attributeKey) { + scriptEl.setAttribute(attributeKey, script[attributeKey]); + }); + parentEl.appendChild(scriptEl); + return false; + } + }); + return uniqueBundleId; + }); + return new Promise(function (resolve, reject) { + loadjs.ready(allUniqueBundleIds, { + success: function success() { + Drupal.attachBehaviors(parentEl, settings); + resolve(); + }, + error: function error(depsNotFound) { + var message = Drupal.t("The following files could not be loaded: @dependencies", { + '@dependencies': depsNotFound.join(', ') + }); + reject(message); + } + }); + }); + } + }; +})(jQuery, window, Drupal, drupalSettings, loadjs, window.tabbable); \ No newline at end of file reverted: --- b/core/misc/announce.js +++ a/core/misc/announce.js @@ -0,0 +1,55 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, debounce) { + var liveElement; + var announcements = []; + Drupal.behaviors.drupalAnnounce = { + attach: function attach(context) { + if (!liveElement) { + liveElement = document.createElement('div'); + liveElement.id = 'drupal-live-announce'; + liveElement.className = 'visually-hidden'; + liveElement.setAttribute('aria-live', 'polite'); + liveElement.setAttribute('aria-busy', 'false'); + document.body.appendChild(liveElement); + } + } + }; + + function announce() { + var text = []; + var priority = 'polite'; + var announcement; + var il = announcements.length; + + for (var i = 0; i < il; i++) { + announcement = announcements.pop(); + text.unshift(announcement.text); + + if (announcement.priority === 'assertive') { + priority = 'assertive'; + } + } + + if (text.length) { + liveElement.innerHTML = ''; + liveElement.setAttribute('aria-busy', 'true'); + liveElement.setAttribute('aria-live', priority); + liveElement.innerHTML = text.join('\n'); + liveElement.setAttribute('aria-busy', 'false'); + } + } + + Drupal.announce = function (text, priority) { + announcements.push({ + text: text, + priority: priority + }); + return debounce(announce, 200)(); + }; +})(Drupal, Drupal.debounce); \ No newline at end of file reverted: --- b/core/misc/autocomplete.js +++ a/core/misc/autocomplete.js @@ -0,0 +1,163 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + var autocomplete; + + function autocompleteSplitValues(value) { + var result = []; + var quote = false; + var current = ''; + var valueLength = value.length; + var character; + + for (var i = 0; i < valueLength; i++) { + character = value.charAt(i); + + if (character === '"') { + current += character; + quote = !quote; + } else if (character === ',' && !quote) { + result.push(current.trim()); + current = ''; + } else { + current += character; + } + } + + if (value.length > 0) { + result.push(current.trim()); + } + + return result; + } + + function extractLastTerm(terms) { + return autocomplete.splitValues(terms).pop(); + } + + function searchHandler(event) { + var options = autocomplete.options; + + if (options.isComposing) { + return false; + } + + var term = autocomplete.extractLastTerm(event.target.value); + + if (term.length > 0 && options.firstCharacterBlacklist.indexOf(term[0]) !== -1) { + return false; + } + + return term.length >= options.minLength; + } + + function sourceData(request, response) { + var elementId = this.element.attr('id'); + + if (!(elementId in autocomplete.cache)) { + autocomplete.cache[elementId] = {}; + } + + function showSuggestions(suggestions) { + var tagged = autocomplete.splitValues(request.term); + var il = tagged.length; + + for (var i = 0; i < il; i++) { + var index = suggestions.indexOf(tagged[i]); + + if (index >= 0) { + suggestions.splice(index, 1); + } + } + + response(suggestions); + } + + var term = autocomplete.extractLastTerm(request.term); + + function sourceCallbackHandler(data) { + autocomplete.cache[elementId][term] = data; + showSuggestions(data); + } + + if (autocomplete.cache[elementId].hasOwnProperty(term)) { + showSuggestions(autocomplete.cache[elementId][term]); + } else { + var options = $.extend({ + success: sourceCallbackHandler, + data: { + q: term + } + }, autocomplete.ajax); + $.ajax(this.element.attr('data-autocomplete-path'), options); + } + } + + function focusHandler() { + return false; + } + + function selectHandler(event, ui) { + var terms = autocomplete.splitValues(event.target.value); + terms.pop(); + terms.push(ui.item.value); + event.target.value = terms.join(', '); + return false; + } + + function renderItem(ul, item) { + return $('
  • ').append($('').html(item.label)).appendTo(ul); + } + + Drupal.behaviors.autocomplete = { + attach: function attach(context) { + var $autocomplete = $(once('autocomplete', 'input.form-autocomplete', context)); + + if ($autocomplete.length) { + var blacklist = $autocomplete.attr('data-autocomplete-first-character-blacklist'); + $.extend(autocomplete.options, { + firstCharacterBlacklist: blacklist || '' + }); + $autocomplete.autocomplete(autocomplete.options).each(function () { + $(this).data('ui-autocomplete')._renderItem = autocomplete.options.renderItem; + }); + $autocomplete.on('compositionstart.autocomplete', function () { + autocomplete.options.isComposing = true; + }); + $autocomplete.on('compositionend.autocomplete', function () { + autocomplete.options.isComposing = false; + }); + } + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + $(once.remove('autocomplete', 'input.form-autocomplete', context)).autocomplete('destroy'); + } + } + }; + autocomplete = { + cache: {}, + splitValues: autocompleteSplitValues, + extractLastTerm: extractLastTerm, + options: { + source: sourceData, + focus: focusHandler, + search: searchHandler, + select: selectHandler, + renderItem: renderItem, + minLength: 1, + firstCharacterBlacklist: '', + isComposing: false + }, + ajax: { + dataType: 'json', + jsonp: false + } + }; + Drupal.autocomplete = autocomplete; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/batch.js +++ a/core/misc/batch.js @@ -0,0 +1,36 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.batch = { + attach: function attach(context, settings) { + var batch = settings.batch; + var $progress = $(once('batch', '[data-drupal-progress]')); + var progressBar; + + function updateCallback(progress, status, pb) { + if (progress === '100') { + pb.stopMonitoring(); + window.location = "".concat(batch.uri, "&op=finished"); + } + } + + function errorCallback(pb) { + $progress.prepend($('

    ').html(batch.errorMessage)); + $('#wait').hide(); + } + + if ($progress.length) { + progressBar = new Drupal.ProgressBar('updateprogress', updateCallback, 'POST', errorCallback); + progressBar.setProgress(-1, batch.initMessage); + progressBar.startMonitoring("".concat(batch.uri, "&op=do"), 10); + $progress.empty(); + $progress.append(progressBar.element); + } + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/checkbox.js +++ a/core/misc/checkbox.js @@ -0,0 +1,12 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.checkbox = function () { + return ""; + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/misc/collapse.js +++ a/core/misc/collapse.js @@ -0,0 +1,72 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Modernizr, Drupal) { + function CollapsibleDetails(node) { + this.$node = $(node); + this.$node.data('details', this); + var anchor = window.location.hash && window.location.hash !== '#' ? ", ".concat(window.location.hash) : ''; + + if (this.$node.find(".error".concat(anchor)).length) { + this.$node.attr('open', true); + } + + this.setupSummaryPolyfill(); + } + + $.extend(CollapsibleDetails, { + instances: [] + }); + $.extend(CollapsibleDetails.prototype, { + setupSummaryPolyfill: function setupSummaryPolyfill() { + var $summary = this.$node.find('> summary'); + $summary.attr('tabindex', '-1'); + $('').append(this.$node.attr('open') ? Drupal.t('Hide') : Drupal.t('Show')).prependTo($summary).after(document.createTextNode(' ')); + $('
    ').attr('href', "#".concat(this.$node.attr('id'))).prepend($summary.contents()).appendTo($summary); + $summary.append(this.$summary).on('click', $.proxy(this.onSummaryClick, this)); + }, + onSummaryClick: function onSummaryClick(e) { + this.toggle(); + e.preventDefault(); + }, + toggle: function toggle() { + var _this = this; + + var isOpen = !!this.$node.attr('open'); + var $summaryPrefix = this.$node.find('> summary span.details-summary-prefix'); + + if (isOpen) { + $summaryPrefix.html(Drupal.t('Show')); + } else { + $summaryPrefix.html(Drupal.t('Hide')); + } + + setTimeout(function () { + _this.$node.attr('open', !isOpen); + }, 0); + } + }); + Drupal.behaviors.collapse = { + attach: function attach(context) { + if (Modernizr.details) { + return; + } + + once('collapse', 'details', context).forEach(function (detail) { + detail.classList.add('collapse-processed'); + CollapsibleDetails.instances.push(new CollapsibleDetails(detail)); + }); + } + }; + + var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e, $target) { + $target.parents('details').not('[open]').find('> summary').trigger('click'); + }; + + $('body').on('formFragmentLinkClickOrHashChange.details', handleFragmentLinkClickOrHashChange); + Drupal.CollapsibleDetails = CollapsibleDetails; +})(jQuery, Modernizr, Drupal); \ No newline at end of file reverted: --- b/core/misc/date.js +++ a/core/misc/date.js @@ -0,0 +1,94 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +(function (Modernizr, Drupal, once) { + Drupal.behaviors.date = { + attach: function attach(context, settings) { + if (Modernizr.inputtypes.date === false) { + once('datepicker', '[data-drupal-field-elements="date-time"]').forEach(function (dateTime) { + var dateInput = dateTime.querySelector('input[type="date"]'); + var timeInput = dateTime.querySelector('input[type="time"]'); + var help = Drupal.theme.dateTimeHelp({ + dateId: "".concat(dateInput.id, "--description"), + dateDesc: dateInput.dataset.help, + timeId: "".concat(timeInput.id, "--description"), + timeDesc: timeInput.dataset.help + }); + [dateInput, timeInput].forEach(function (input) { + input.setAttribute('aria-describedby', "".concat(input.id, "--description")); + input.setAttribute('type', 'text'); + }); + Drupal.DatepickerPolyfill.attachDescription(dateTime, help); + }); + once('datepicker', '[data-drupal-field-elements="date"]').forEach(function (date) { + var dateInput = date.querySelector('input[type="date"]'); + var help = Drupal.theme.dateHelp({ + dateDesc: dateInput.dataset.help + }); + var id = "".concat(date.id, "--description"); + dateInput.setAttribute('aria-describedby', id); + dateInput.setAttribute('type', 'text'); + Drupal.DatepickerPolyfill.attachDescription(date, help, id); + }); + } + } + }; + + Drupal.DatepickerPolyfill = function () { + function _class() { + _classCallCheck(this, _class); + } + + _createClass(_class, null, [{ + key: "attachDescription", + value: function attachDescription(element, help, id) { + var description = element.nextElementSibling; + + if (!(description && description.getAttribute('data-drupal-field-elements') === 'description')) { + description = Drupal.DatepickerPolyfill.descriptionWrapperElement(id); + element.parentNode.insertBefore(description, element.nextSibling); + } + + description.insertAdjacentHTML('beforeend', help); + } + }, { + key: "descriptionWrapperElement", + value: function descriptionWrapperElement(id) { + var description = document.createElement('div'); + description.classList.add('description'); + description.setAttribute('data-drupal-field-elements', 'description'); + + if (id) { + description.setAttribute('id', id); + } + + return description; + } + }]); + + return _class; + }(); + + Drupal.theme.dateHelp = function (_ref) { + var dateDesc = _ref.dateDesc; + return "
    ".concat(dateDesc, "
    "); + }; + + Drupal.theme.dateTimeHelp = function (_ref2) { + var dateId = _ref2.dateId, + timeId = _ref2.timeId, + dateDesc = _ref2.dateDesc, + timeDesc = _ref2.timeDesc; + return "
    \n ").concat(dateDesc, " ").concat(timeDesc, "\n
    "); + }; +})(Modernizr, Drupal, once); \ No newline at end of file reverted: --- b/core/misc/debounce.js +++ a/core/misc/debounce.js @@ -0,0 +1,36 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +Drupal.debounce = function (func, wait, immediate) { + var timeout; + var result; + return function () { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var context = this; + + var later = function later() { + timeout = null; + + if (!immediate) { + result = func.apply(context, args); + } + }; + + var callNow = immediate && !timeout; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + + if (callNow) { + result = func.apply(context, args); + } + + return result; + }; +}; \ No newline at end of file reverted: --- b/core/misc/details-aria.js +++ a/core/misc/details-aria.js @@ -0,0 +1,21 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.detailsAria = { + attach: function attach() { + $(once('detailsAria', 'body')).on('click.detailsAria', 'summary', function (event) { + var $summary = $(event.currentTarget); + var open = $(event.currentTarget.parentNode).attr('open') === 'open' ? 'false' : 'true'; + $summary.attr({ + 'aria-expanded': open, + 'aria-pressed': open + }); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/details-summarized-content.js +++ a/core/misc/details-summarized-content.js @@ -0,0 +1,43 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + function DetailsSummarizedContent(node) { + this.$node = $(node); + this.setupSummary(); + } + + $.extend(DetailsSummarizedContent, { + instances: [] + }); + $.extend(DetailsSummarizedContent.prototype, { + setupSummary: function setupSummary() { + this.$detailsSummarizedContentWrapper = $(Drupal.theme('detailsSummarizedContentWrapper')); + this.$node.on('summaryUpdated', $.proxy(this.onSummaryUpdated, this)).trigger('summaryUpdated').find('> summary').append(this.$detailsSummarizedContentWrapper); + }, + onSummaryUpdated: function onSummaryUpdated() { + var text = this.$node.drupalGetSummary(); + this.$detailsSummarizedContentWrapper.html(Drupal.theme('detailsSummarizedContentText', text)); + } + }); + Drupal.behaviors.detailsSummary = { + attach: function attach(context) { + DetailsSummarizedContent.instances = DetailsSummarizedContent.instances.concat(once('details', 'details', context).map(function (details) { + return new DetailsSummarizedContent(details); + })); + } + }; + Drupal.DetailsSummarizedContent = DetailsSummarizedContent; + + Drupal.theme.detailsSummarizedContentWrapper = function () { + return ""; + }; + + Drupal.theme.detailsSummarizedContentText = function (text) { + return text ? " (".concat(text, ")") : ''; + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/dialog/dialog.ajax.js +++ a/core/misc/dialog/dialog.ajax.js @@ -0,0 +1,134 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.dialog = { + attach: function attach(context, settings) { + var $context = $(context); + + if (!$('#drupal-modal').length) { + $('
    ').hide().appendTo('body'); + } + + var $dialog = $context.closest('.ui-dialog-content'); + + if ($dialog.length) { + if ($dialog.dialog('option', 'drupalAutoButtons')) { + $dialog.trigger('dialogButtonsChange'); + } + + $dialog.dialog('widget').trigger('focus'); + } + + var originalClose = settings.dialog.close; + + settings.dialog.close = function (event) { + for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + originalClose.apply(settings.dialog, [event].concat(args)); + $(event.target).remove(); + }; + }, + prepareDialogButtons: function prepareDialogButtons($dialog) { + var buttons = []; + var $buttons = $dialog.find('.form-actions input[type=submit], .form-actions a.button'); + $buttons.each(function () { + var $originalButton = $(this).css({ + display: 'none' + }); + buttons.push({ + text: $originalButton.html() || $originalButton.attr('value'), + class: $originalButton.attr('class'), + click: function click(e) { + if ($originalButton.is('a')) { + $originalButton[0].click(); + } else { + $originalButton.trigger('mousedown').trigger('mouseup').trigger('click'); + e.preventDefault(); + } + } + }); + }); + return buttons; + } + }; + + Drupal.AjaxCommands.prototype.openDialog = function (ajax, response, status) { + if (!response.selector) { + return false; + } + + var $dialog = $(response.selector); + + if (!$dialog.length) { + $dialog = $("
    ")).appendTo('body'); + } + + if (!ajax.wrapper) { + ajax.wrapper = $dialog.attr('id'); + } + + response.command = 'insert'; + response.method = 'html'; + ajax.commands.insert(ajax, response, status); + + if (!response.dialogOptions.buttons) { + response.dialogOptions.drupalAutoButtons = true; + response.dialogOptions.buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog); + } + + $dialog.on('dialogButtonsChange', function () { + var buttons = Drupal.behaviors.dialog.prepareDialogButtons($dialog); + $dialog.dialog('option', 'buttons', buttons); + }); + response.dialogOptions = response.dialogOptions || {}; + var dialog = Drupal.dialog($dialog.get(0), response.dialogOptions); + + if (response.dialogOptions.modal) { + dialog.showModal(); + } else { + dialog.show(); + } + + $dialog.parent().find('.ui-dialog-buttonset').addClass('form-actions'); + }; + + Drupal.AjaxCommands.prototype.closeDialog = function (ajax, response, status) { + var $dialog = $(response.selector); + + if ($dialog.length) { + Drupal.dialog($dialog.get(0)).close(); + + if (!response.persist) { + $dialog.remove(); + } + } + + $dialog.off('dialogButtonsChange'); + }; + + Drupal.AjaxCommands.prototype.setDialogOption = function (ajax, response, status) { + var $dialog = $(response.selector); + + if ($dialog.length) { + $dialog.dialog('option', response.optionName, response.optionValue); + } + }; + + $(window).on('dialog:aftercreate', function (e, dialog, $element, settings) { + $element.on('click.dialog', '.dialog-cancel', function (e) { + dialog.close('cancel'); + e.preventDefault(); + e.stopPropagation(); + }); + }); + $(window).on('dialog:beforeclose', function (e, dialog, $element) { + $element.off('.dialog'); + }); +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/dialog/dialog.jquery-ui.js +++ a/core/misc/dialog/dialog.jquery-ui.js @@ -0,0 +1,74 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _ref) { + var tabbable = _ref.tabbable, + isTabbable = _ref.isTabbable; + $.widget('ui.dialog', $.ui.dialog, { + options: { + buttonClass: 'button', + buttonPrimaryClass: 'button--primary' + }, + _createButtons: function _createButtons() { + var opts = this.options; + var primaryIndex; + var index; + var il = opts.buttons.length; + + for (index = 0; index < il; index++) { + if (opts.buttons[index].primary && opts.buttons[index].primary === true) { + primaryIndex = index; + delete opts.buttons[index].primary; + break; + } + } + + this._super(); + + var $buttons = this.uiButtonSet.children().addClass(opts.buttonClass); + + if (typeof primaryIndex !== 'undefined') { + $buttons.eq(index).addClass(opts.buttonPrimaryClass); + } + }, + _focusTabbable: function _focusTabbable() { + var hasFocus = this._focusedElement ? this._focusedElement.get(0) : null; + + if (!hasFocus) { + hasFocus = this.element.find('[autofocus]').get(0); + } + + if (!hasFocus) { + var $elements = [this.element, this.uiDialogButtonPane]; + + for (var i = 0; i < $elements.length; i++) { + var element = $elements[i].get(0); + + if (element) { + var elementTabbable = tabbable(element); + hasFocus = elementTabbable.length ? elementTabbable[0] : null; + } + + if (hasFocus) { + break; + } + } + } + + if (!hasFocus) { + var closeBtn = this.uiDialogTitlebarClose.get(0); + hasFocus = closeBtn && isTabbable(closeBtn) ? closeBtn : null; + } + + if (!hasFocus) { + hasFocus = this.uiDialog.get(0); + } + + $(hasFocus).eq(0).trigger('focus'); + } + }); +})(jQuery, window.tabbable); \ No newline at end of file reverted: --- b/core/misc/dialog/dialog.js +++ a/core/misc/dialog/dialog.js @@ -0,0 +1,59 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + drupalSettings.dialog = { + autoOpen: true, + dialogClass: '', + buttonClass: 'button', + buttonPrimaryClass: 'button--primary', + close: function close(event) { + Drupal.dialog(event.target).close(); + Drupal.detachBehaviors(event.target, null, 'unload'); + } + }; + + Drupal.dialog = function (element, options) { + var undef; + var $element = $(element); + var dialog = { + open: false, + returnValue: undef + }; + + function openDialog(settings) { + settings = $.extend({}, drupalSettings.dialog, options, settings); + $(window).trigger('dialog:beforecreate', [dialog, $element, settings]); + $element.dialog(settings); + dialog.open = true; + $(window).trigger('dialog:aftercreate', [dialog, $element, settings]); + } + + function closeDialog(value) { + $(window).trigger('dialog:beforeclose', [dialog, $element]); + $element.dialog('close'); + dialog.returnValue = value; + dialog.open = false; + $(window).trigger('dialog:afterclose', [dialog, $element]); + } + + dialog.show = function () { + openDialog({ + modal: false + }); + }; + + dialog.showModal = function () { + openDialog({ + modal: true + }); + }; + + dialog.close = closeDialog; + return dialog; + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/misc/dialog/dialog.position.js +++ a/core/misc/dialog/dialog.position.js @@ -0,0 +1,82 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, debounce, displace) { + drupalSettings.dialog = $.extend({ + autoResize: true, + maxHeight: '95%' + }, drupalSettings.dialog); + + function resetPosition(options) { + var offsets = displace.offsets; + var left = offsets.left - offsets.right; + var top = offsets.top - offsets.bottom; + var leftString = "".concat((left > 0 ? '+' : '-') + Math.abs(Math.round(left / 2)), "px"); + var topString = "".concat((top > 0 ? '+' : '-') + Math.abs(Math.round(top / 2)), "px"); + options.position = { + my: "center".concat(left !== 0 ? leftString : '', " center").concat(top !== 0 ? topString : ''), + of: window + }; + return options; + } + + function resetSize(event) { + var positionOptions = ['width', 'height', 'minWidth', 'minHeight', 'maxHeight', 'maxWidth', 'position']; + var adjustedOptions = {}; + var windowHeight = $(window).height(); + var option; + var optionValue; + var adjustedValue; + + for (var n = 0; n < positionOptions.length; n++) { + option = positionOptions[n]; + optionValue = event.data.settings[option]; + + if (optionValue) { + if (typeof optionValue === 'string' && /%$/.test(optionValue) && /height/i.test(option)) { + windowHeight -= displace.offsets.top + displace.offsets.bottom; + adjustedValue = parseInt(0.01 * parseInt(optionValue, 10) * windowHeight, 10); + + if (option === 'height' && event.data.$element.parent().outerHeight() < adjustedValue) { + adjustedValue = 'auto'; + } + + adjustedOptions[option] = adjustedValue; + } + } + } + + if (!event.data.settings.modal) { + adjustedOptions = resetPosition(adjustedOptions); + } + + event.data.$element.dialog('option', adjustedOptions).trigger('dialogContentResize'); + } + + $(window).on({ + 'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) { + var autoResize = debounce(resetSize, 20); + var eventData = { + settings: settings, + $element: $element + }; + + if (settings.autoResize === true || settings.autoResize === 'true') { + $element.dialog('option', { + resizable: false, + draggable: false + }).dialog('widget').css('position', 'fixed'); + $(window).on('resize.dialogResize scroll.dialogResize', eventData, autoResize).trigger('resize.dialogResize'); + $(document).on('drupalViewportOffsetChange.dialogResize', eventData, autoResize); + } + }, + 'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) { + $(window).off('.dialogResize'); + $(document).off('.dialogResize'); + } + }); +})(jQuery, Drupal, drupalSettings, Drupal.debounce, Drupal.displace); \ No newline at end of file reverted: --- b/core/misc/dialog/off-canvas.base.css +++ a/core/misc/dialog/off-canvas.base.css @@ -274,7 +274,7 @@ #drupal-off-canvas ol li { display: block; padding: 0.3125rem 0; + border-bottom: 1px solid #333 - border-bottom: 1px solid #333; } #drupal-off-canvas ul li:last-child, #drupal-off-canvas ol li:last-child { @@ -312,9 +312,6 @@ #drupal-off-canvas .visually-hidden { position: absolute !important; -} - -#drupal-off-canvas .visually-hidden { overflow: hidden; clip: rect(1px, 1px, 1px, 1px); width: 1px; @@ -325,10 +322,6 @@ #drupal-off-canvas .visually-hidden.focusable:active, #drupal-off-canvas .visually-hidden.focusable:focus { position: static !important; -} - -#drupal-off-canvas .visually-hidden.focusable:active, -#drupal-off-canvas .visually-hidden.focusable:focus { overflow: visible; clip: auto; width: auto; reverted: --- b/core/misc/dialog/off-canvas.js +++ a/core/misc/dialog/off-canvas.js @@ -0,0 +1,186 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, debounce, displace) { + Drupal.offCanvas = { + position: null, + minimumHeight: 30, + minDisplaceWidth: 768, + $mainCanvasWrapper: $('[data-off-canvas-main-canvas]'), + isOffCanvas: function isOffCanvas($element) { + return $element.is('#drupal-off-canvas'); + }, + removeOffCanvasEvents: function removeOffCanvasEvents($element) { + $element.off('.off-canvas'); + $(document).off('.off-canvas'); + $(window).off('.off-canvas'); + }, + beforeCreate: function beforeCreate(_ref) { + var settings = _ref.settings, + $element = _ref.$element; + Drupal.offCanvas.removeOffCanvasEvents($element); + $('body').addClass('js-off-canvas-dialog-open'); + settings.position = { + my: 'left top', + at: "".concat(Drupal.offCanvas.getEdge(), " top"), + of: window + }; + var position = settings.drupalOffCanvasPosition; + var height = position === 'side' ? $(window).height() : settings.height; + var width = position === 'side' ? settings.width : '100%'; + settings.height = height; + settings.width = width; + }, + beforeClose: function beforeClose(_ref2) { + var $element = _ref2.$element; + $('body').removeClass('js-off-canvas-dialog-open'); + Drupal.offCanvas.removeOffCanvasEvents($element); + Drupal.offCanvas.resetPadding(); + }, + afterCreate: function afterCreate(_ref3) { + var $element = _ref3.$element, + settings = _ref3.settings; + var eventData = { + settings: settings, + $element: $element, + offCanvasDialog: this + }; + $element.on('dialogContentResize.off-canvas', eventData, Drupal.offCanvas.handleDialogResize).on('dialogContentResize.off-canvas', eventData, Drupal.offCanvas.bodyPadding); + Drupal.offCanvas.getContainer($element).attr("data-offset-".concat(Drupal.offCanvas.getEdge()), ''); + $(window).on('resize.off-canvas', eventData, debounce(Drupal.offCanvas.resetSize, 100)).trigger('resize.off-canvas'); + }, + render: function render(_ref4) { + var settings = _ref4.settings; + $('.ui-dialog-off-canvas, .ui-dialog-off-canvas .ui-dialog-titlebar').toggleClass('ui-dialog-empty-title', !settings.title); + }, + handleDialogResize: function handleDialogResize(event) { + var $element = event.data.$element; + var $container = Drupal.offCanvas.getContainer($element); + var $offsets = $container.find('> :not(#drupal-off-canvas, .ui-resizable-handle)'); + var offset = 0; + $element.css({ + height: 'auto' + }); + var modalHeight = $container.height(); + $offsets.each(function (i, e) { + offset += $(e).outerHeight(); + }); + var scrollOffset = $element.outerHeight() - $element.height(); + $element.height(modalHeight - offset - scrollOffset); + }, + resetSize: function resetSize(event) { + var $element = event.data.$element; + var container = Drupal.offCanvas.getContainer($element); + var position = event.data.settings.drupalOffCanvasPosition; + + if (Drupal.offCanvas.position && Drupal.offCanvas.position !== position) { + container.removeAttr("data-offset-".concat(Drupal.offCanvas.position)); + } + + if (position === 'top') { + $element.css('min-height', "".concat(Drupal.offCanvas.minimumHeight, "px")); + } + + displace(); + var offsets = displace.offsets; + var topPosition = position === 'side' && offsets.top !== 0 ? "+".concat(offsets.top) : ''; + var adjustedOptions = { + position: { + my: "".concat(Drupal.offCanvas.getEdge(), " top"), + at: "".concat(Drupal.offCanvas.getEdge(), " top").concat(topPosition), + of: window + } + }; + var height = position === 'side' ? "".concat($(window).height() - (offsets.top + offsets.bottom), "px") : event.data.settings.height; + container.css({ + position: 'fixed', + height: height + }); + $element.dialog('option', adjustedOptions).trigger('dialogContentResize.off-canvas'); + Drupal.offCanvas.position = position; + }, + bodyPadding: function bodyPadding(event) { + var position = event.data.settings.drupalOffCanvasPosition; + + if (position === 'side' && $('body').outerWidth() < Drupal.offCanvas.minDisplaceWidth) { + return; + } + + Drupal.offCanvas.resetPadding(); + var $element = event.data.$element; + var $container = Drupal.offCanvas.getContainer($element); + var $mainCanvasWrapper = Drupal.offCanvas.$mainCanvasWrapper; + var width = $container.outerWidth(); + var mainCanvasPadding = $mainCanvasWrapper.css("padding-".concat(Drupal.offCanvas.getEdge())); + + if (position === 'side' && width !== mainCanvasPadding) { + $mainCanvasWrapper.css("padding-".concat(Drupal.offCanvas.getEdge()), "".concat(width, "px")); + $container.attr("data-offset-".concat(Drupal.offCanvas.getEdge()), width); + displace(); + } + + var height = $container.outerHeight(); + + if (position === 'top') { + $mainCanvasWrapper.css('padding-top', "".concat(height, "px")); + $container.attr('data-offset-top', height); + displace(); + } + }, + getContainer: function getContainer($element) { + return $element.dialog('widget'); + }, + getEdge: function getEdge() { + return document.documentElement.dir === 'rtl' ? 'left' : 'right'; + }, + resetPadding: function resetPadding() { + Drupal.offCanvas.$mainCanvasWrapper.css("padding-".concat(Drupal.offCanvas.getEdge()), 0); + Drupal.offCanvas.$mainCanvasWrapper.css('padding-top', 0); + displace(); + } + }; + Drupal.behaviors.offCanvasEvents = { + attach: function attach() { + if (!once('off-canvas', 'html').length) { + return; + } + + $(window).on({ + 'dialog:beforecreate': function dialogBeforecreate(event, dialog, $element, settings) { + if (Drupal.offCanvas.isOffCanvas($element)) { + Drupal.offCanvas.beforeCreate({ + dialog: dialog, + $element: $element, + settings: settings + }); + } + }, + 'dialog:aftercreate': function dialogAftercreate(event, dialog, $element, settings) { + if (Drupal.offCanvas.isOffCanvas($element)) { + Drupal.offCanvas.render({ + dialog: dialog, + $element: $element, + settings: settings + }); + Drupal.offCanvas.afterCreate({ + $element: $element, + settings: settings + }); + } + }, + 'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) { + if (Drupal.offCanvas.isOffCanvas($element)) { + Drupal.offCanvas.beforeClose({ + dialog: dialog, + $element: $element + }); + } + } + }); + } + }; +})(jQuery, Drupal, Drupal.debounce, Drupal.displace); \ No newline at end of file reverted: --- b/core/misc/dialog/off-canvas.reset.css +++ a/core/misc/dialog/off-canvas.reset.css @@ -123,7 +123,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -138,6 +138,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; @@ -193,178 +194,178 @@ box-sizing: border-box; text-shadow: none; -webkit-font-smoothing: antialiased; + -webkit-tap-highlight-color: initial - -webkit-tap-highlight-color: initial; } #drupal-off-canvas span:after, + #drupal-off-canvas span:before, #drupal-off-canvas applet:after, + #drupal-off-canvas applet:before, #drupal-off-canvas object:after, + #drupal-off-canvas object:before, #drupal-off-canvas iframe:after, + #drupal-off-canvas iframe:before, #drupal-off-canvas h1:after, + #drupal-off-canvas h1:before, #drupal-off-canvas h2:after, + #drupal-off-canvas h2:before, #drupal-off-canvas h3:after, + #drupal-off-canvas h3:before, #drupal-off-canvas h4:after, + #drupal-off-canvas h4:before, #drupal-off-canvas h5:after, + #drupal-off-canvas h5:before, #drupal-off-canvas h6:after, + #drupal-off-canvas h6:before, #drupal-off-canvas p:after, + #drupal-off-canvas p:before, #drupal-off-canvas blockquote:after, + #drupal-off-canvas blockquote:before, #drupal-off-canvas pre:after, + #drupal-off-canvas pre:before, #drupal-off-canvas a:after, + #drupal-off-canvas a:before, #drupal-off-canvas abbr:after, + #drupal-off-canvas abbr:before, #drupal-off-canvas acronym:after, + #drupal-off-canvas acronym:before, #drupal-off-canvas address:after, + #drupal-off-canvas address:before, #drupal-off-canvas big:after, + #drupal-off-canvas big:before, #drupal-off-canvas button:after, + #drupal-off-canvas button:before, #drupal-off-canvas cite:after, + #drupal-off-canvas cite:before, #drupal-off-canvas code:after, + #drupal-off-canvas code:before, #drupal-off-canvas del:after, + #drupal-off-canvas del:before, #drupal-off-canvas dfn:after, + #drupal-off-canvas dfn:before, #drupal-off-canvas em:after, + #drupal-off-canvas em:before, #drupal-off-canvas img:after, + #drupal-off-canvas img:before, #drupal-off-canvas ins:after, + #drupal-off-canvas ins:before, #drupal-off-canvas kbd:after, + #drupal-off-canvas kbd:before, #drupal-off-canvas q:after, + #drupal-off-canvas q:before, #drupal-off-canvas s:after, + #drupal-off-canvas s:before, #drupal-off-canvas samp:after, + #drupal-off-canvas samp:before, #drupal-off-canvas small:after, + #drupal-off-canvas small:before, #drupal-off-canvas strike:after, + #drupal-off-canvas strike:before, #drupal-off-canvas strong:after, + #drupal-off-canvas strong:before, #drupal-off-canvas sub:after, + #drupal-off-canvas sub:before, #drupal-off-canvas sup:after, + #drupal-off-canvas sup:before, #drupal-off-canvas tt:after, + #drupal-off-canvas tt:before, #drupal-off-canvas var:after, + #drupal-off-canvas var:before, #drupal-off-canvas b:after, + #drupal-off-canvas b:before, #drupal-off-canvas u:after, + #drupal-off-canvas u:before, #drupal-off-canvas i:after, + #drupal-off-canvas i:before, #drupal-off-canvas center:after, + #drupal-off-canvas center:before, #drupal-off-canvas dl:after, + #drupal-off-canvas dl:before, #drupal-off-canvas dt:after, + #drupal-off-canvas dt:before, #drupal-off-canvas dd:after, + #drupal-off-canvas dd:before, #drupal-off-canvas ol:after, + #drupal-off-canvas ol:before, #drupal-off-canvas ul:after, + #drupal-off-canvas ul:before, #drupal-off-canvas li:after, + #drupal-off-canvas li:before, #drupal-off-canvas fieldset:after, + #drupal-off-canvas fieldset:before, #drupal-off-canvas form:after, + #drupal-off-canvas form:before, #drupal-off-canvas label:after, + #drupal-off-canvas label:before, #drupal-off-canvas legend:after, + #drupal-off-canvas legend:before, #drupal-off-canvas table:after, + #drupal-off-canvas table:before, #drupal-off-canvas caption:after, + #drupal-off-canvas caption:before, #drupal-off-canvas tbody:after, + #drupal-off-canvas tbody:before, #drupal-off-canvas tfoot:after, + #drupal-off-canvas tfoot:before, #drupal-off-canvas thead:after, + #drupal-off-canvas thead:before, #drupal-off-canvas tr:after, + #drupal-off-canvas tr:before, #drupal-off-canvas th:after, + #drupal-off-canvas th:before, #drupal-off-canvas td:after, + #drupal-off-canvas td:before, #drupal-off-canvas article:after, + #drupal-off-canvas article:before, #drupal-off-canvas aside:after, + #drupal-off-canvas aside:before, #drupal-off-canvas canvas:after, + #drupal-off-canvas canvas:before, #drupal-off-canvas details:after, + #drupal-off-canvas details:before, #drupal-off-canvas embed:after, + #drupal-off-canvas embed:before, #drupal-off-canvas figure:after, + #drupal-off-canvas figure:before, #drupal-off-canvas figcaption:after, + #drupal-off-canvas figcaption:before, #drupal-off-canvas footer:after, + #drupal-off-canvas footer:before, #drupal-off-canvas header:after, + #drupal-off-canvas header:before, #drupal-off-canvas hgroup:after, + #drupal-off-canvas hgroup:before, #drupal-off-canvas main:after, + #drupal-off-canvas main:before, #drupal-off-canvas menu:after, + #drupal-off-canvas menu:before, #drupal-off-canvas meter:after, + #drupal-off-canvas meter:before, #drupal-off-canvas nav:after, + #drupal-off-canvas nav:before, #drupal-off-canvas output:after, + #drupal-off-canvas output:before, #drupal-off-canvas progress:after, + #drupal-off-canvas progress:before, #drupal-off-canvas ruby:after, + #drupal-off-canvas ruby:before, #drupal-off-canvas section:after, + #drupal-off-canvas section:before, #drupal-off-canvas summary:after, + #drupal-off-canvas summary:before, #drupal-off-canvas time:after, + #drupal-off-canvas time:before, #drupal-off-canvas mark:after, + #drupal-off-canvas mark:before, #drupal-off-canvas audio:after, + #drupal-off-canvas audio:before, #drupal-off-canvas video:after, + #drupal-off-canvas video:before, #drupal-off-canvas input:after, + #drupal-off-canvas input:before, #drupal-off-canvas select:after, + #drupal-off-canvas select:before, #drupal-off-canvas textarea:after, - #drupal-off-canvas span:before, - #drupal-off-canvas applet:before, - #drupal-off-canvas object:before, - #drupal-off-canvas iframe:before, - #drupal-off-canvas h1:before, - #drupal-off-canvas h2:before, - #drupal-off-canvas h3:before, - #drupal-off-canvas h4:before, - #drupal-off-canvas h5:before, - #drupal-off-canvas h6:before, - #drupal-off-canvas p:before, - #drupal-off-canvas blockquote:before, - #drupal-off-canvas pre:before, - #drupal-off-canvas a:before, - #drupal-off-canvas abbr:before, - #drupal-off-canvas acronym:before, - #drupal-off-canvas address:before, - #drupal-off-canvas big:before, - #drupal-off-canvas button:before, - #drupal-off-canvas cite:before, - #drupal-off-canvas code:before, - #drupal-off-canvas del:before, - #drupal-off-canvas dfn:before, - #drupal-off-canvas em:before, - #drupal-off-canvas img:before, - #drupal-off-canvas ins:before, - #drupal-off-canvas kbd:before, - #drupal-off-canvas q:before, - #drupal-off-canvas s:before, - #drupal-off-canvas samp:before, - #drupal-off-canvas small:before, - #drupal-off-canvas strike:before, - #drupal-off-canvas strong:before, - #drupal-off-canvas sub:before, - #drupal-off-canvas sup:before, - #drupal-off-canvas tt:before, - #drupal-off-canvas var:before, - #drupal-off-canvas b:before, - #drupal-off-canvas u:before, - #drupal-off-canvas i:before, - #drupal-off-canvas center:before, - #drupal-off-canvas dl:before, - #drupal-off-canvas dt:before, - #drupal-off-canvas dd:before, - #drupal-off-canvas ol:before, - #drupal-off-canvas ul:before, - #drupal-off-canvas li:before, - #drupal-off-canvas fieldset:before, - #drupal-off-canvas form:before, - #drupal-off-canvas label:before, - #drupal-off-canvas legend:before, - #drupal-off-canvas table:before, - #drupal-off-canvas caption:before, - #drupal-off-canvas tbody:before, - #drupal-off-canvas tfoot:before, - #drupal-off-canvas thead:before, - #drupal-off-canvas tr:before, - #drupal-off-canvas th:before, - #drupal-off-canvas td:before, - #drupal-off-canvas article:before, - #drupal-off-canvas aside:before, - #drupal-off-canvas canvas:before, - #drupal-off-canvas details:before, - #drupal-off-canvas embed:before, - #drupal-off-canvas figure:before, - #drupal-off-canvas figcaption:before, - #drupal-off-canvas footer:before, - #drupal-off-canvas header:before, - #drupal-off-canvas hgroup:before, - #drupal-off-canvas main:before, - #drupal-off-canvas menu:before, - #drupal-off-canvas meter:before, - #drupal-off-canvas nav:before, - #drupal-off-canvas output:before, - #drupal-off-canvas progress:before, - #drupal-off-canvas ruby:before, - #drupal-off-canvas section:before, - #drupal-off-canvas summary:before, - #drupal-off-canvas time:before, - #drupal-off-canvas mark:before, - #drupal-off-canvas audio:before, - #drupal-off-canvas video:before, - #drupal-off-canvas input:before, - #drupal-off-canvas select:before, #drupal-off-canvas textarea:before { animation: none 0s ease 0s 1 normal none running; -webkit-backface-visibility: visible; @@ -385,7 +386,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -400,6 +401,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; reverted: --- b/core/misc/displace.js +++ a/core/misc/displace.js @@ -0,0 +1,107 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, debounce) { + var offsets = { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; + + function getRawOffset(el, edge) { + var $el = $(el); + var documentElement = document.documentElement; + var displacement = 0; + var horizontal = edge === 'left' || edge === 'right'; + var placement = $el.offset()[horizontal ? 'left' : 'top']; + placement -= window["scroll".concat(horizontal ? 'X' : 'Y')] || document.documentElement["scroll".concat(horizontal ? 'Left' : 'Top')] || 0; + + switch (edge) { + case 'top': + displacement = placement + $el.outerHeight(); + break; + + case 'left': + displacement = placement + $el.outerWidth(); + break; + + case 'bottom': + displacement = documentElement.clientHeight - placement; + break; + + case 'right': + displacement = documentElement.clientWidth - placement; + break; + + default: + displacement = 0; + } + + return displacement; + } + + function calculateOffset(edge) { + var edgeOffset = 0; + var displacingElements = document.querySelectorAll("[data-offset-".concat(edge, "]")); + var n = displacingElements.length; + + for (var i = 0; i < n; i++) { + var el = displacingElements[i]; + + if (el.style.display === 'none') { + continue; + } + + var displacement = parseInt(el.getAttribute("data-offset-".concat(edge)), 10); + + if (isNaN(displacement)) { + displacement = getRawOffset(el, edge); + } + + edgeOffset = Math.max(edgeOffset, displacement); + } + + return edgeOffset; + } + + function calculateOffsets() { + return { + top: calculateOffset('top'), + right: calculateOffset('right'), + bottom: calculateOffset('bottom'), + left: calculateOffset('left') + }; + } + + function displace(broadcast) { + offsets = calculateOffsets(); + Drupal.displace.offsets = offsets; + + if (typeof broadcast === 'undefined' || broadcast) { + $(document).trigger('drupalViewportOffsetChange', offsets); + } + + return offsets; + } + + Drupal.behaviors.drupalDisplace = { + attach: function attach() { + if (this.displaceProcessed) { + return; + } + + this.displaceProcessed = true; + $(window).on('resize.drupalDisplace', debounce(displace, 200)); + } + }; + Drupal.displace = displace; + $.extend(Drupal.displace, { + offsets: offsets, + calculateOffset: calculateOffset + }); +})(jQuery, Drupal, Drupal.debounce); \ No newline at end of file reverted: --- b/core/misc/dropbutton/dropbutton.js +++ a/core/misc/dropbutton/dropbutton.js @@ -0,0 +1,92 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + function DropButton(dropbutton, settings) { + var options = $.extend({ + title: Drupal.t('List additional actions') + }, settings); + var $dropbutton = $(dropbutton); + this.$dropbutton = $dropbutton; + this.$list = $dropbutton.find('.dropbutton'); + this.$actions = this.$list.find('li').addClass('dropbutton-action'); + + if (this.$actions.length > 1) { + var $primary = this.$actions.slice(0, 1); + var $secondary = this.$actions.slice(1); + $secondary.addClass('secondary-action'); + $primary.after(Drupal.theme('dropbuttonToggle', options)); + this.$dropbutton.addClass('dropbutton-multiple').on({ + 'mouseleave.dropbutton': $.proxy(this.hoverOut, this), + 'mouseenter.dropbutton': $.proxy(this.hoverIn, this), + 'focusout.dropbutton': $.proxy(this.focusOut, this), + 'focusin.dropbutton': $.proxy(this.focusIn, this) + }); + } else { + this.$dropbutton.addClass('dropbutton-single'); + } + } + + function dropbuttonClickHandler(e) { + e.preventDefault(); + $(e.target).closest('.dropbutton-wrapper').toggleClass('open'); + } + + Drupal.behaviors.dropButton = { + attach: function attach(context, settings) { + var dropbuttons = once('dropbutton', '.dropbutton-wrapper', context); + + if (dropbuttons.length) { + var body = once('dropbutton-click', 'body'); + + if (body.length) { + $(body).on('click', '.dropbutton-toggle', dropbuttonClickHandler); + } + + dropbuttons.forEach(function (dropbutton) { + DropButton.dropbuttons.push(new DropButton(dropbutton, settings.dropbutton)); + }); + } + } + }; + $.extend(DropButton, { + dropbuttons: [] + }); + $.extend(DropButton.prototype, { + toggle: function toggle(show) { + var isBool = typeof show === 'boolean'; + show = isBool ? show : !this.$dropbutton.hasClass('open'); + this.$dropbutton.toggleClass('open', show); + }, + hoverIn: function hoverIn() { + if (this.timerID) { + window.clearTimeout(this.timerID); + } + }, + hoverOut: function hoverOut() { + this.timerID = window.setTimeout($.proxy(this, 'close'), 500); + }, + open: function open() { + this.toggle(true); + }, + close: function close() { + this.toggle(false); + }, + focusOut: function focusOut(e) { + this.hoverOut.call(this, e); + }, + focusIn: function focusIn(e) { + this.hoverIn.call(this, e); + } + }); + $.extend(Drupal.theme, { + dropbuttonToggle: function dropbuttonToggle(options) { + return "
  • "); + } + }); + Drupal.DropButton = DropButton; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/drupal.init.js +++ a/core/misc/drupal.init.js @@ -0,0 +1,31 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +if (window.jQuery) { + jQuery.noConflict(); +} + +document.documentElement.className += ' js'; + +(function (Drupal, drupalSettings) { + var domReady = function domReady(callback) { + var listener = function listener() { + callback(); + document.removeEventListener('DOMContentLoaded', listener); + }; + + if (document.readyState !== 'loading') { + setTimeout(callback, 0); + } else { + document.addEventListener('DOMContentLoaded', listener); + } + }; + + domReady(function () { + Drupal.attachBehaviors(document, drupalSettings); + }); +})(Drupal, window.drupalSettings); \ No newline at end of file reverted: --- b/core/misc/drupal.js +++ a/core/misc/drupal.js @@ -0,0 +1,224 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +window.Drupal = { + behaviors: {}, + locale: {} +}; + +(function (Drupal, drupalSettings, drupalTranslations, console, Proxy, Reflect) { + Drupal.throwError = function (error) { + setTimeout(function () { + throw error; + }, 0); + }; + + Drupal.attachBehaviors = function (context, settings) { + context = context || document; + settings = settings || drupalSettings; + var behaviors = Drupal.behaviors; + Object.keys(behaviors || {}).forEach(function (i) { + if (typeof behaviors[i].attach === 'function') { + try { + behaviors[i].attach(context, settings); + } catch (e) { + Drupal.throwError(e); + } + } + }); + }; + + Drupal.detachBehaviors = function (context, settings, trigger) { + context = context || document; + settings = settings || drupalSettings; + trigger = trigger || 'unload'; + var behaviors = Drupal.behaviors; + Object.keys(behaviors || {}).forEach(function (i) { + if (typeof behaviors[i].detach === 'function') { + try { + behaviors[i].detach(context, settings, trigger); + } catch (e) { + Drupal.throwError(e); + } + } + }); + }; + + Drupal.checkPlain = function (str) { + str = str.toString().replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, '''); + return str; + }; + + Drupal.formatString = function (str, args) { + var processedArgs = {}; + Object.keys(args || {}).forEach(function (key) { + switch (key.charAt(0)) { + case '@': + processedArgs[key] = Drupal.checkPlain(args[key]); + break; + + case '!': + processedArgs[key] = args[key]; + break; + + default: + processedArgs[key] = Drupal.theme('placeholder', args[key]); + break; + } + }); + return Drupal.stringReplace(str, processedArgs, null); + }; + + Drupal.stringReplace = function (str, args, keys) { + if (str.length === 0) { + return str; + } + + if (!Array.isArray(keys)) { + keys = Object.keys(args || {}); + keys.sort(function (a, b) { + return a.length - b.length; + }); + } + + if (keys.length === 0) { + return str; + } + + var key = keys.pop(); + var fragments = str.split(key); + + if (keys.length) { + for (var i = 0; i < fragments.length; i++) { + fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0)); + } + } + + return fragments.join(args[key]); + }; + + Drupal.t = function (str, args, options) { + options = options || {}; + options.context = options.context || ''; + + if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) { + str = drupalTranslations.strings[options.context][str]; + } + + if (args) { + str = Drupal.formatString(str, args); + } + + return str; + }; + + Drupal.url = function (path) { + return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path; + }; + + Drupal.url.toAbsolute = function (url) { + var urlParsingNode = document.createElement('a'); + + try { + url = decodeURIComponent(url); + } catch (e) {} + + urlParsingNode.setAttribute('href', url); + return urlParsingNode.cloneNode(false).href; + }; + + Drupal.url.isLocal = function (url) { + var absoluteUrl = Drupal.url.toAbsolute(url); + var protocol = window.location.protocol; + + if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) { + protocol = 'https:'; + } + + var baseUrl = "".concat(protocol, "//").concat(window.location.host).concat(drupalSettings.path.baseUrl.slice(0, -1)); + + try { + absoluteUrl = decodeURIComponent(absoluteUrl); + } catch (e) {} + + try { + baseUrl = decodeURIComponent(baseUrl); + } catch (e) {} + + return absoluteUrl === baseUrl || absoluteUrl.indexOf("".concat(baseUrl, "/")) === 0; + }; + + Drupal.formatPlural = function (count, singular, plural, args, options) { + args = args || {}; + args['@count'] = count; + var pluralDelimiter = drupalSettings.pluralDelimiter; + var translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter); + var index = 0; + + if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) { + index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula.default; + } else if (args['@count'] !== 1) { + index = 1; + } + + return translations[index]; + }; + + Drupal.encodePath = function (item) { + return window.encodeURIComponent(item).replace(/%2F/g, '/'); + }; + + Drupal.deprecationError = function (_ref) { + var message = _ref.message; + + if (drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn) { + console.warn("[Deprecation] ".concat(message)); + } + }; + + Drupal.deprecatedProperty = function (_ref2) { + var target = _ref2.target, + deprecatedProperty = _ref2.deprecatedProperty, + message = _ref2.message; + + if (!Proxy || !Reflect) { + return target; + } + + return new Proxy(target, { + get: function get(target, key) { + if (key === deprecatedProperty) { + Drupal.deprecationError({ + message: message + }); + } + + for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + rest[_key - 2] = arguments[_key]; + } + + return Reflect.get.apply(Reflect, [target, key].concat(rest)); + } + }); + }; + + Drupal.theme = function (func) { + if (func in Drupal.theme) { + var _Drupal$theme; + + for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + args[_key2 - 1] = arguments[_key2]; + } + + return (_Drupal$theme = Drupal.theme)[func].apply(_Drupal$theme, args); + } + }; + + Drupal.theme.placeholder = function (str) { + return "".concat(Drupal.checkPlain(str), ""); + }; +})(Drupal, window.drupalSettings, window.drupalTranslations, window.console, window.Proxy, window.Reflect); \ No newline at end of file reverted: --- b/core/misc/drupalSettingsLoader.js +++ a/core/misc/drupalSettingsLoader.js @@ -0,0 +1,15 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function () { + var settingsElement = document.querySelector('head > script[type="application/json"][data-drupal-selector="drupal-settings-json"], body > script[type="application/json"][data-drupal-selector="drupal-settings-json"]'); + window.drupalSettings = {}; + + if (settingsElement !== null) { + window.drupalSettings = JSON.parse(settingsElement.textContent); + } +})(); \ No newline at end of file reverted: --- b/core/misc/entity-form.js +++ a/core/misc/entity-form.js @@ -0,0 +1,38 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.entityContentDetailsSummaries = { + attach: function attach(context) { + var $context = $(context); + $context.find('.entity-content-form-revision-information').drupalSetSummary(function (context) { + var $revisionContext = $(context); + var revisionCheckbox = $revisionContext.find('.js-form-item-revision input'); + + if (revisionCheckbox.is(':checked') || !revisionCheckbox.length && $revisionContext.find('.js-form-item-revision-log textarea').length) { + return Drupal.t('New revision'); + } + + return Drupal.t('No revision'); + }); + $context.find('details.entity-translation-options').drupalSetSummary(function (context) { + var $translationContext = $(context); + var translate; + var $checkbox = $translationContext.find('.js-form-item-translation-translate input'); + + if ($checkbox.length) { + translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated'); + } else { + $checkbox = $translationContext.find('.js-form-item-translation-retranslate input'); + translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated'); + } + + return translate; + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/form.js +++ a/core/misc/form.js @@ -0,0 +1,158 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, debounce) { + $.fn.drupalGetSummary = function () { + var callback = this.data('summaryCallback'); + return this[0] && callback ? callback(this[0]).trim() : ''; + }; + + $.fn.drupalSetSummary = function (callback) { + var self = this; + + if (typeof callback !== 'function') { + var val = callback; + + callback = function callback() { + return val; + }; + } + + return this.data('summaryCallback', callback).off('formUpdated.summary').on('formUpdated.summary', function () { + self.trigger('summaryUpdated'); + }).trigger('summaryUpdated'); + }; + + Drupal.behaviors.formSingleSubmit = { + attach: function attach() { + function onFormSubmit(e) { + var $form = $(e.currentTarget); + var formValues = $form.serialize(); + var previousValues = $form.attr('data-drupal-form-submit-last'); + + if (previousValues === formValues) { + e.preventDefault(); + } else { + $form.attr('data-drupal-form-submit-last', formValues); + } + } + + $(once('form-single-submit', 'body')).on('submit.singleSubmit', 'form:not([method~="GET"])', onFormSubmit); + } + }; + + function triggerFormUpdated(element) { + $(element).trigger('formUpdated'); + } + + function fieldsList(form) { + return [].map.call(form.querySelectorAll('[name][id]'), function (el) { + return el.id; + }); + } + + Drupal.behaviors.formUpdated = { + attach: function attach(context) { + var $context = $(context); + var contextIsForm = $context.is('form'); + var $forms = $(once('form-updated', contextIsForm ? $context : $context.find('form'))); + var formFields; + + if ($forms.length) { + $.makeArray($forms).forEach(function (form) { + var events = 'change.formUpdated input.formUpdated '; + var eventHandler = debounce(function (event) { + triggerFormUpdated(event.target); + }, 300); + formFields = fieldsList(form).join(','); + form.setAttribute('data-drupal-form-fields', formFields); + $(form).on(events, eventHandler); + }); + } + + if (contextIsForm) { + formFields = fieldsList(context).join(','); + var currentFields = $(context).attr('data-drupal-form-fields'); + + if (formFields !== currentFields) { + triggerFormUpdated(context); + } + } + }, + detach: function detach(context, settings, trigger) { + var $context = $(context); + var contextIsForm = $context.is('form'); + + if (trigger === 'unload') { + once.remove('form-updated', contextIsForm ? $context : $context.find('form')).forEach(function (form) { + form.removeAttribute('data-drupal-form-fields'); + $(form).off('.formUpdated'); + }); + } + } + }; + Drupal.behaviors.fillUserInfoFromBrowser = { + attach: function attach(context, settings) { + var userInfo = ['name', 'mail', 'homepage']; + var $forms = $(once('user-info-from-browser', '[data-user-info-from-browser]')); + + if ($forms.length) { + userInfo.forEach(function (info) { + var $element = $forms.find("[name=".concat(info, "]")); + var browserData = localStorage.getItem("Drupal.visitor.".concat(info)); + + if (!$element.length) { + return; + } + + var emptyValue = $element[0].value === ''; + var defaultValue = $element.attr('data-drupal-default-value') === $element[0].value; + + if (browserData && (emptyValue || defaultValue)) { + $element.each(function (index, item) { + item.value = browserData; + }); + } + }); + } + + $forms.on('submit', function () { + userInfo.forEach(function (info) { + var $element = $forms.find("[name=".concat(info, "]")); + + if ($element.length) { + localStorage.setItem("Drupal.visitor.".concat(info), $element[0].value); + } + }); + }); + } + }; + + var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e) { + var url; + + if (e.type === 'click') { + url = e.currentTarget.location ? e.currentTarget.location : e.currentTarget; + } else { + url = window.location; + } + + var hash = url.hash.substr(1); + + if (hash) { + var $target = $("#".concat(hash)); + $('body').trigger('formFragmentLinkClickOrHashChange', [$target]); + setTimeout(function () { + return $target.trigger('focus'); + }, 300); + } + }; + + var debouncedHandleFragmentLinkClickOrHashChange = debounce(handleFragmentLinkClickOrHashChange, 300, true); + $(window).on('hashchange.form-fragment', debouncedHandleFragmentLinkClickOrHashChange); + $(document).on('click.form-fragment', 'a[href*="#"]', debouncedHandleFragmentLinkClickOrHashChange); +})(jQuery, Drupal, Drupal.debounce); \ No newline at end of file reverted: --- b/core/misc/jquery.cookie.shim.js +++ a/core/misc/jquery.cookie.shim.js @@ -0,0 +1,98 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +(function ($, Drupal, cookies) { + var deprecatedMessageSuffix = "is deprecated in Drupal 9.0.0 and will be removed in Drupal 10.0.0. Use the core/js-cookie library instead. See https://www.drupal.org/node/3104677"; + + var isFunction = function isFunction(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + }; + + var parseCookieValue = function parseCookieValue(value, parseJson) { + if (value.indexOf('"') === 0) { + value = value.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); + } + + try { + value = decodeURIComponent(value.replace(/\+/g, ' ')); + return parseJson ? JSON.parse(value) : value; + } catch (e) {} + }; + + var reader = function reader(cookieValue, cookieName, converter, readUnsanitized, parseJson) { + var value = readUnsanitized ? cookieValue : parseCookieValue(cookieValue, parseJson); + + if (converter !== undefined && isFunction(converter)) { + return converter(value, cookieName); + } + + return value; + }; + + $.cookie = function (key) { + var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; + Drupal.deprecationError({ + message: "jQuery.cookie() ".concat(deprecatedMessageSuffix) + }); + + if (value !== undefined && !isFunction(value)) { + var attributes = _objectSpread(_objectSpread({}, $.cookie.defaults), options); + + if (typeof attributes.expires === 'string' && attributes.expires !== '') { + attributes.expires = new Date(attributes.expires); + } + + var cookieSetter = cookies.withConverter({ + write: function write(cookieValue) { + return encodeURIComponent(cookieValue); + } + }); + value = $.cookie.json && !$.cookie.raw ? JSON.stringify(value) : String(value); + return cookieSetter.set(key, value, attributes); + } + + var userProvidedConverter = value; + var cookiesShim = cookies.withConverter({ + read: function read(cookieValue, cookieName) { + return reader(cookieValue, cookieName, userProvidedConverter, $.cookie.raw, $.cookie.json); + } + }); + + if (key !== undefined) { + return cookiesShim.get(key); + } + + var results = cookiesShim.get(); + Object.keys(results).forEach(function (resultKey) { + if (results[resultKey] === undefined) { + delete results[resultKey]; + } + }); + return results; + }; + + $.cookie.defaults = _objectSpread({ + path: '' + }, cookies.defaults); + $.cookie.json = false; + $.cookie.raw = false; + + $.removeCookie = function (key, options) { + Drupal.deprecationError({ + message: "jQuery.removeCookie() ".concat(deprecatedMessageSuffix) + }); + cookies.remove(key, _objectSpread(_objectSpread({}, $.cookie.defaults), options)); + return !cookies.get(key); + }; +})(jQuery, Drupal, window.Cookies); \ No newline at end of file reverted: --- b/core/misc/jquery.once.bc.js +++ a/core/misc/jquery.once.bc.js @@ -0,0 +1,42 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, once) { + var deprecatedMessageSuffix = "is deprecated in Drupal 9.3.0 and will be removed in Drupal 10.0.0. Use the core/once library instead. See https://www.drupal.org/node/3158256"; + var originalJQOnce = $.fn.once; + var originalJQRemoveOnce = $.fn.removeOnce; + + $.fn.once = function jQueryOnce(id) { + Drupal.deprecationError({ + message: "jQuery.once() ".concat(deprecatedMessageSuffix) + }); + return originalJQOnce.apply(this, [id]); + }; + + $.fn.removeOnce = function jQueryRemoveOnce(id) { + Drupal.deprecationError({ + message: "jQuery.removeOnce() ".concat(deprecatedMessageSuffix) + }); + return originalJQRemoveOnce.apply(this, [id]); + }; + + var drupalOnce = once; + + function augmentedOnce(id, selector, context) { + originalJQOnce.apply($(selector, context), [id]); + return drupalOnce(id, selector, context); + } + + function remove(id, selector, context) { + originalJQRemoveOnce.apply($(selector, context), [id]); + return drupalOnce.remove(id, selector, context); + } + + window.once = Object.assign(augmentedOnce, drupalOnce, { + remove: remove + }); +})(jQuery, once); \ No newline at end of file reverted: --- b/core/misc/jquery.tabbable.shim.js +++ a/core/misc/jquery.tabbable.shim.js @@ -0,0 +1,27 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, _ref) { + var isTabbable = _ref.isTabbable; + $.extend($.expr[':'], { + tabbable: function tabbable(element) { + Drupal.deprecationError({ + message: 'The :tabbable selector is deprecated in Drupal 9.2.0 and will be removed in Drupal 11.0.0. Use the core/tabbable library instead. See https://www.drupal.org/node/3183730' + }); + + if (element.tagName === 'SUMMARY' || element.tagName === 'DETAILS') { + var tabIndex = element.getAttribute('tabIndex'); + + if (tabIndex === null || tabIndex < 0) { + return false; + } + } + + return isTabbable(element); + } + }); +})(jQuery, Drupal, window.tabbable); \ No newline at end of file reverted: --- b/core/misc/machine-name.js +++ a/core/misc/machine-name.js @@ -0,0 +1,135 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.behaviors.machineName = { + attach: function attach(context, settings) { + var self = this; + var $context = $(context); + var timeout = null; + var xhr = null; + + function clickEditHandler(e) { + var data = e.data; + data.$wrapper.removeClass('visually-hidden'); + data.$target.trigger('focus'); + data.$suffix.hide(); + data.$source.off('.machineName'); + } + + function machineNameHandler(e) { + var data = e.data; + var options = data.options; + var baseValue = e.target.value; + var rx = new RegExp(options.replace_pattern, 'g'); + var expected = baseValue.toLowerCase().replace(rx, options.replace).substr(0, options.maxlength); + + if (xhr && xhr.readystate !== 4) { + xhr.abort(); + xhr = null; + } + + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + + if (baseValue.toLowerCase() !== expected) { + timeout = setTimeout(function () { + xhr = self.transliterate(baseValue, options).done(function (machine) { + self.showMachineName(machine.substr(0, options.maxlength), data); + }); + }, 300); + } else { + self.showMachineName(expected, data); + } + } + + Object.keys(settings.machineName).forEach(function (sourceId) { + var options = settings.machineName[sourceId]; + var $source = $(once('machine-name', $context.find(sourceId).addClass('machine-name-source'))); + var $target = $context.find(options.target).addClass('machine-name-target'); + var $suffix = $context.find(options.suffix); + var $wrapper = $target.closest('.js-form-item'); + + if (!$source.length || !$target.length || !$suffix.length || !$wrapper.length) { + return; + } + + if ($target.hasClass('error')) { + return; + } + + options.maxlength = $target.attr('maxlength'); + $wrapper.addClass('visually-hidden'); + var machine = $target[0].value; + var $preview = $("".concat(options.field_prefix).concat(Drupal.checkPlain(machine)).concat(options.field_suffix, "")); + $suffix.empty(); + + if (options.label) { + $suffix.append("".concat(options.label, ": ")); + } + + $suffix.append($preview); + + if ($target.is(':disabled')) { + return; + } + + var eventData = { + $source: $source, + $target: $target, + $suffix: $suffix, + $wrapper: $wrapper, + $preview: $preview, + options: options + }; + + if (machine === '' && $source[0].value !== '') { + self.transliterate($source[0].value, options).done(function (machineName) { + self.showMachineName(machineName.substr(0, options.maxlength), eventData); + }); + } + + var $link = $("")).on('click', eventData, clickEditHandler); + $suffix.append($link); + + if ($target[0].value === '') { + $source.on('formUpdated.machineName', eventData, machineNameHandler).trigger('formUpdated.machineName'); + } + + $target.on('invalid', eventData, clickEditHandler); + }); + }, + showMachineName: function showMachineName(machine, data) { + var settings = data.options; + + if (machine !== '') { + if (machine !== settings.replace) { + data.$target[0].value = machine; + data.$preview.html(settings.field_prefix + Drupal.checkPlain(machine) + settings.field_suffix); + } + + data.$suffix.show(); + } else { + data.$suffix.hide(); + data.$target[0].value = machine; + data.$preview.empty(); + } + }, + transliterate: function transliterate(source, settings) { + return $.get(Drupal.url('machine_name/transliterate'), { + text: source, + langcode: drupalSettings.langcode, + replace_pattern: settings.replace_pattern, + replace_token: settings.replace_token, + replace: settings.replace, + lowercase: true + }); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/misc/message.js +++ a/core/misc/message.js @@ -0,0 +1,134 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +(function (Drupal) { + Drupal.Message = function () { + function _class() { + var messageWrapper = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; + + _classCallCheck(this, _class); + + if (!messageWrapper) { + this.messageWrapper = Drupal.Message.defaultWrapper(); + } else { + this.messageWrapper = messageWrapper; + } + } + + _createClass(_class, [{ + key: "add", + value: function add(message) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (!options.hasOwnProperty('type')) { + options.type = 'status'; + } + + if (typeof message !== 'string') { + throw new Error('Message must be a string.'); + } + + Drupal.Message.announce(message, options); + options.id = options.id ? String(options.id) : "".concat(options.type, "-").concat(Math.random().toFixed(15).replace('0.', '')); + + if (!Drupal.Message.getMessageTypeLabels().hasOwnProperty(options.type)) { + var type = options.type; + throw new Error("The message type, ".concat(type, ", is not present in Drupal.Message.getMessageTypeLabels().")); + } + + this.messageWrapper.appendChild(Drupal.theme('message', { + text: message + }, options)); + return options.id; + } + }, { + key: "select", + value: function select(id) { + return this.messageWrapper.querySelector("[data-drupal-message-id^=\"".concat(id, "\"]")); + } + }, { + key: "remove", + value: function remove(id) { + return this.messageWrapper.removeChild(this.select(id)); + } + }, { + key: "clear", + value: function clear() { + var _this = this; + + Array.prototype.forEach.call(this.messageWrapper.querySelectorAll('[data-drupal-message-id]'), function (message) { + _this.messageWrapper.removeChild(message); + }); + } + }], [{ + key: "defaultWrapper", + value: function defaultWrapper() { + var wrapper = document.querySelector('[data-drupal-messages]'); + + if (!wrapper) { + wrapper = document.querySelector('[data-drupal-messages-fallback]'); + wrapper.removeAttribute('data-drupal-messages-fallback'); + wrapper.setAttribute('data-drupal-messages', ''); + wrapper.classList.remove('hidden'); + } + + return wrapper.innerHTML === '' ? Drupal.Message.messageInternalWrapper(wrapper) : wrapper.firstElementChild; + } + }, { + key: "getMessageTypeLabels", + value: function getMessageTypeLabels() { + return { + status: Drupal.t('Status message'), + error: Drupal.t('Error message'), + warning: Drupal.t('Warning message') + }; + } + }, { + key: "announce", + value: function announce(message, options) { + if (!options.priority && (options.type === 'warning' || options.type === 'error')) { + options.priority = 'assertive'; + } + + if (options.announce !== '') { + Drupal.announce(options.announce || message, options.priority); + } + } + }, { + key: "messageInternalWrapper", + value: function messageInternalWrapper(messageWrapper) { + var innerWrapper = document.createElement('div'); + innerWrapper.setAttribute('class', 'messages__wrapper'); + messageWrapper.insertAdjacentElement('afterbegin', innerWrapper); + return innerWrapper; + } + }]); + + return _class; + }(); + + Drupal.theme.message = function (_ref, _ref2) { + var text = _ref.text; + var type = _ref2.type, + id = _ref2.id; + var messagesTypes = Drupal.Message.getMessageTypeLabels(); + var messageWrapper = document.createElement('div'); + messageWrapper.setAttribute('class', "messages messages--".concat(type)); + messageWrapper.setAttribute('role', type === 'error' || type === 'warning' ? 'alert' : 'status'); + messageWrapper.setAttribute('data-drupal-message-id', id); + messageWrapper.setAttribute('data-drupal-message-type', type); + messageWrapper.setAttribute('aria-label', messagesTypes[type]); + messageWrapper.innerHTML = "".concat(text); + return messageWrapper; + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/misc/modernizr-additional-tests.js +++ a/core/misc/modernizr-additional-tests.js @@ -0,0 +1,71 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Modernizr) { + var _deprecationErrorModernizrCopy = function _deprecationErrorModernizrCopy(_ref) { + var message = _ref.message; + + if (typeof console !== 'undefined' && console.warn) { + console.warn("[Deprecation] ".concat(message)); + } + }; + + var _deprecatedPropertyModernizrCopy = function _deprecatedPropertyModernizrCopy(_ref2) { + var target = _ref2.target, + deprecatedProperty = _ref2.deprecatedProperty, + message = _ref2.message; + + if (!Proxy || !Reflect) { + return target; + } + + return new Proxy(target, { + get: function get(target, key) { + if (key === deprecatedProperty) { + _deprecationErrorModernizrCopy({ + message: message + }); + } + + for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { + rest[_key - 2] = arguments[_key]; + } + + return Reflect.get.apply(Reflect, [target, key].concat(rest)); + } + }); + }; + + window.Modernizr = _deprecatedPropertyModernizrCopy({ + target: Modernizr, + deprecatedProperty: 'touchevents', + message: 'The touchevents property of Modernizr has been deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There will be no replacement for this feature. See https://www.drupal.org/node/3277381.' + }); + + if (document.documentElement.classList.contains('touchevents') || document.documentElement.classList.contains('no-touchevents')) { + return; + } + + Modernizr.addTest('touchevents', function () { + _deprecationErrorModernizrCopy({ + message: 'The Modernizr touch events test is deprecated in Drupal 9.4.0 and will be removed in Drupal 10.0.0. See https://www.drupal.org/node/3277381 for information on its replacement and how it should be used.' + }); + + var bool; + + if ('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch) { + bool = true; + } else { + var query = ['@media (', Modernizr._prefixes.join('touch-enabled),('), 'heartz', ')', '{#modernizr{top:9px;position:absolute}}'].join(''); + Modernizr.testStyles(query, function (node) { + bool = node.offsetTop === 9; + }); + } + + return bool; + }); +})(Modernizr); \ No newline at end of file reverted: --- b/core/misc/polyfills/array.find.js +++ a/core/misc/polyfills/array.find.js @@ -0,0 +1,40 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +if (!Array.prototype.find) { + Object.defineProperty(Array.prototype, 'find', { + value: function value(predicate) { + if (this == null) { + throw TypeError('"this" is null or not defined'); + } + + var o = Object(this); + var len = o.length >>> 0; + + if (typeof predicate !== 'function') { + throw TypeError('predicate must be a function'); + } + + var thisArg = arguments[1]; + var k = 0; + + while (k < len) { + var kValue = o[k]; + + if (predicate.call(thisArg, kValue, k, o)) { + return kValue; + } + + k++; + } + + return undefined; + }, + configurable: true, + writable: true + }); +} \ No newline at end of file reverted: --- b/core/misc/polyfills/array.includes.js +++ a/core/misc/polyfills/array.includes.js @@ -0,0 +1,48 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +if (!Array.prototype.includes) { + Array.prototype.includes = function (searchElement) { + if (this == null) { + throw new TypeError('Array.prototype.includes called on null or undefined'); + } + + var O = Object(this); + var len = parseInt(O.length, 10) || 0; + + if (len === 0) { + return false; + } + + var n = parseInt(arguments[1], 10) || 0; + var k; + + if (n >= 0) { + k = n; + } else { + k = len + n; + + if (k < 0) { + k = 0; + } + } + + var currentElement; + + while (k < len) { + currentElement = O[k]; + + if (searchElement === currentElement || searchElement !== searchElement && currentElement !== currentElement) { + return true; + } + + k += 1; + } + + return false; + }; +} \ No newline at end of file reverted: --- b/core/misc/polyfills/customevent.js +++ a/core/misc/polyfills/customevent.js @@ -0,0 +1,23 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function () { + if (typeof window.CustomEvent === 'function') return false; + + function CustomEvent(event, params) { + params = params || { + bubbles: false, + cancelable: false, + detail: null + }; + var evt = document.createEvent('CustomEvent'); + evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); + return evt; + } + + window.CustomEvent = CustomEvent; +})(); \ No newline at end of file reverted: --- b/core/misc/polyfills/element.closest.js +++ a/core/misc/polyfills/element.closest.js @@ -0,0 +1,19 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +if (!Element.prototype.closest) { + Element.prototype.closest = function (s) { + var el = this; + + do { + if (Element.prototype.matches.call(el, s)) return el; + el = el.parentElement || el.parentNode; + } while (el !== null && el.nodeType === 1); + + return null; + }; +} \ No newline at end of file reverted: --- b/core/misc/position.js +++ a/core/misc/position.js @@ -0,0 +1,417 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($) { + var cachedScrollbarWidth = null; + var max = Math.max, + abs = Math.abs; + var regexHorizontal = /left|center|right/; + var regexVertical = /top|center|bottom/; + var regexOffset = /[+-]\d+(\.[\d]+)?%?/; + var regexPosition = /^\w+/; + var regexPercent = /%$/; + var _position = $.fn.position; + + function getOffsets(offsets, width, height) { + return [parseFloat(offsets[0]) * (regexPercent.test(offsets[0]) ? width / 100 : 1), parseFloat(offsets[1]) * (regexPercent.test(offsets[1]) ? height / 100 : 1)]; + } + + function parseCss(element, property) { + return parseInt($.css(element, property), 10) || 0; + } + + function getDimensions(elem) { + var raw = elem[0]; + + if (raw.nodeType === 9) { + return { + width: elem.width(), + height: elem.height(), + offset: { + top: 0, + left: 0 + } + }; + } + + if ($.isWindow(raw)) { + return { + width: elem.width(), + height: elem.height(), + offset: { + top: elem.scrollTop(), + left: elem.scrollLeft() + } + }; + } + + if (raw.preventDefault) { + return { + width: 0, + height: 0, + offset: { + top: raw.pageY, + left: raw.pageX + } + }; + } + + return { + width: elem.outerWidth(), + height: elem.outerHeight(), + offset: elem.offset() + }; + } + + var collisions = { + fit: { + left: function left(position, data) { + var within = data.within; + var withinOffset = within.isWindow ? within.scrollLeft : within.offset.left; + var outerWidth = within.width; + var collisionPosLeft = position.left - data.collisionPosition.marginLeft; + var overLeft = withinOffset - collisionPosLeft; + var overRight = collisionPosLeft + data.collisionWidth - outerWidth - withinOffset; + var newOverRight; + + if (data.collisionWidth > outerWidth) { + if (overLeft > 0 && overRight <= 0) { + newOverRight = position.left + overLeft + data.collisionWidth - outerWidth - withinOffset; + position.left += overLeft - newOverRight; + } else if (overRight > 0 && overLeft <= 0) { + position.left = withinOffset; + } else if (overLeft > overRight) { + position.left = withinOffset + outerWidth - data.collisionWidth; + } else { + position.left = withinOffset; + } + } else if (overLeft > 0) { + position.left += overLeft; + } else if (overRight > 0) { + position.left -= overRight; + } else { + position.left = max(position.left - collisionPosLeft, position.left); + } + }, + top: function top(position, data) { + var within = data.within; + var withinOffset = within.isWindow ? within.scrollTop : within.offset.top; + var outerHeight = data.within.height; + var collisionPosTop = position.top - data.collisionPosition.marginTop; + var overTop = withinOffset - collisionPosTop; + var overBottom = collisionPosTop + data.collisionHeight - outerHeight - withinOffset; + var newOverBottom; + + if (data.collisionHeight > outerHeight) { + if (overTop > 0 && overBottom <= 0) { + newOverBottom = position.top + overTop + data.collisionHeight - outerHeight - withinOffset; + position.top += overTop - newOverBottom; + } else if (overBottom > 0 && overTop <= 0) { + position.top = withinOffset; + } else if (overTop > overBottom) { + position.top = withinOffset + outerHeight - data.collisionHeight; + } else { + position.top = withinOffset; + } + } else if (overTop > 0) { + position.top += overTop; + } else if (overBottom > 0) { + position.top -= overBottom; + } else { + position.top = max(position.top - collisionPosTop, position.top); + } + } + }, + flip: { + left: function left(position, data) { + var within = data.within; + var withinOffset = within.offset.left + within.scrollLeft; + var outerWidth = within.width; + var offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left; + var collisionPosLeft = position.left - data.collisionPosition.marginLeft; + var overLeft = collisionPosLeft - offsetLeft; + var overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft; + var myOffset = data.my[0] === 'left' ? -data.elemWidth : data.my[0] === 'right' ? data.elemWidth : 0; + var atOffset = data.at[0] === 'left' ? data.targetWidth : data.at[0] === 'right' ? -data.targetWidth : 0; + var offset = -2 * data.offset[0]; + var newOverRight; + var newOverLeft; + + if (overLeft < 0) { + newOverRight = position.left + myOffset + atOffset + offset + data.collisionWidth - outerWidth - withinOffset; + + if (newOverRight < 0 || newOverRight < abs(overLeft)) { + position.left += myOffset + atOffset + offset; + } + } else if (overRight > 0) { + newOverLeft = position.left - data.collisionPosition.marginLeft + myOffset + atOffset + offset - offsetLeft; + + if (newOverLeft > 0 || abs(newOverLeft) < overRight) { + position.left += myOffset + atOffset + offset; + } + } + }, + top: function top(position, data) { + var within = data.within; + var withinOffset = within.offset.top + within.scrollTop; + var outerHeight = within.height; + var offsetTop = within.isWindow ? within.scrollTop : within.offset.top; + var collisionPosTop = position.top - data.collisionPosition.marginTop; + var overTop = collisionPosTop - offsetTop; + var overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop; + var top = data.my[1] === 'top'; + var myOffset = top ? -data.elemHeight : data.my[1] === 'bottom' ? data.elemHeight : 0; + var atOffset = data.at[1] === 'top' ? data.targetHeight : data.at[1] === 'bottom' ? -data.targetHeight : 0; + var offset = -2 * data.offset[1]; + var newOverTop; + var newOverBottom; + + if (overTop < 0) { + newOverBottom = position.top + myOffset + atOffset + offset + data.collisionHeight - outerHeight - withinOffset; + + if (newOverBottom < 0 || newOverBottom < abs(overTop)) { + position.top += myOffset + atOffset + offset; + } + } else if (overBottom > 0) { + newOverTop = position.top - data.collisionPosition.marginTop + myOffset + atOffset + offset - offsetTop; + + if (newOverTop > 0 || abs(newOverTop) < overBottom) { + position.top += myOffset + atOffset + offset; + } + } + } + }, + flipfit: { + left: function left() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + collisions.flip.left.apply(this, args); + collisions.fit.left.apply(this, args); + }, + top: function top() { + for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + collisions.flip.top.apply(this, args); + collisions.fit.top.apply(this, args); + } + } + }; + $.position = { + scrollbarWidth: function scrollbarWidth() { + if (cachedScrollbarWidth !== undefined) { + return cachedScrollbarWidth; + } + + var div = $('
    " + "
    "); + var innerDiv = div.children()[0]; + $('body').append(div); + var w1 = innerDiv.offsetWidth; + div.css('overflow', 'scroll'); + var w2 = innerDiv.offsetWidth; + + if (w1 === w2) { + w2 = div[0].clientWidth; + } + + div.remove(); + cachedScrollbarWidth = w1 - w2; + return cachedScrollbarWidth; + }, + getScrollInfo: function getScrollInfo(within) { + var overflowX = within.isWindow || within.isDocument ? '' : within.element.css('overflow-x'); + var overflowY = within.isWindow || within.isDocument ? '' : within.element.css('overflow-y'); + var hasOverflowX = overflowX === 'scroll' || overflowX === 'auto' && within.width < within.element[0].scrollWidth; + var hasOverflowY = overflowY === 'scroll' || overflowY === 'auto' && within.height < within.element[0].scrollHeight; + return { + width: hasOverflowY ? $.position.scrollbarWidth() : 0, + height: hasOverflowX ? $.position.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function getWithinInfo(element) { + var withinElement = $(element || window); + var isWindow = $.isWindow(withinElement[0]); + var isDocument = !!withinElement[0] && withinElement[0].nodeType === 9; + var hasOffset = !isWindow && !isDocument; + return { + element: withinElement, + isWindow: isWindow, + isDocument: isDocument, + offset: hasOffset ? $(element).offset() : { + left: 0, + top: 0 + }, + scrollLeft: withinElement.scrollLeft(), + scrollTop: withinElement.scrollTop(), + width: withinElement.outerWidth(), + height: withinElement.outerHeight() + }; + } + }; + + $.fn.position = function (options) { + if (!options || !options.of) { + return _position.apply(this, arguments); + } + + options = $.extend({}, options); + var within = $.position.getWithinInfo(options.within); + var scrollInfo = $.position.getScrollInfo(within); + var collision = (options.collision || 'flip').split(' '); + var offsets = {}; + var target = typeof options.of === 'string' ? $(document).find(options.of) : $(options.of); + var dimensions = getDimensions(target); + var targetWidth = dimensions.width; + var targetHeight = dimensions.height; + var targetOffset = dimensions.offset; + + if (target[0].preventDefault) { + options.at = 'left top'; + } + + var basePosition = $.extend({}, targetOffset); + $.each(['my', 'at'], function () { + var pos = (options[this] || '').split(' '); + + if (pos.length === 1) { + pos = regexHorizontal.test(pos[0]) ? pos.concat(['center']) : regexVertical.test(pos[0]) ? ['center'].concat(pos) : ['center', 'center']; + } + + pos[0] = regexHorizontal.test(pos[0]) ? pos[0] : 'center'; + pos[1] = regexVertical.test(pos[1]) ? pos[1] : 'center'; + var horizontalOffset = regexOffset.exec(pos[0]); + var verticalOffset = regexOffset.exec(pos[1]); + offsets[this] = [horizontalOffset ? horizontalOffset[0] : 0, verticalOffset ? verticalOffset[0] : 0]; + options[this] = [regexPosition.exec(pos[0])[0], regexPosition.exec(pos[1])[0]]; + }); + + if (collision.length === 1) { + collision[1] = collision[0]; + } + + if (options.at[0] === 'right') { + basePosition.left += targetWidth; + } else if (options.at[0] === 'center') { + basePosition.left += targetWidth / 2; + } + + if (options.at[1] === 'bottom') { + basePosition.top += targetHeight; + } else if (options.at[1] === 'center') { + basePosition.top += targetHeight / 2; + } + + var atOffset = getOffsets(offsets.at, targetWidth, targetHeight); + basePosition.left += atOffset[0]; + basePosition.top += atOffset[1]; + return this.each(function () { + var using; + var elem = $(this); + var elemWidth = elem.outerWidth(); + var elemHeight = elem.outerHeight(); + var marginLeft = parseCss(this, 'marginLeft'); + var marginTop = parseCss(this, 'marginTop'); + var collisionWidth = elemWidth + marginLeft + parseCss(this, 'marginRight') + scrollInfo.width; + var collisionHeight = elemHeight + marginTop + parseCss(this, 'marginBottom') + scrollInfo.height; + var position = $.extend({}, basePosition); + var myOffset = getOffsets(offsets.my, elem.outerWidth(), elem.outerHeight()); + + if (options.my[0] === 'right') { + position.left -= elemWidth; + } else if (options.my[0] === 'center') { + position.left -= elemWidth / 2; + } + + if (options.my[1] === 'bottom') { + position.top -= elemHeight; + } else if (options.my[1] === 'center') { + position.top -= elemHeight / 2; + } + + position.left += myOffset[0]; + position.top += myOffset[1]; + var collisionPosition = { + marginLeft: marginLeft, + marginTop: marginTop + }; + $.each(['left', 'top'], function (i, dir) { + if (collisions[collision[i]]) { + collisions[collision[i]][dir](position, { + targetWidth: targetWidth, + targetHeight: targetHeight, + elemWidth: elemWidth, + elemHeight: elemHeight, + collisionPosition: collisionPosition, + collisionWidth: collisionWidth, + collisionHeight: collisionHeight, + offset: [atOffset[0] + myOffset[0], atOffset[1] + myOffset[1]], + my: options.my, + at: options.at, + within: within, + elem: elem + }); + } + }); + + if (options.using) { + using = function using(props) { + var left = targetOffset.left - position.left; + var right = left + targetWidth - elemWidth; + var top = targetOffset.top - position.top; + var bottom = top + targetHeight - elemHeight; + var feedback = { + target: { + element: target, + left: targetOffset.left, + top: targetOffset.top, + width: targetWidth, + height: targetHeight + }, + element: { + element: elem, + left: position.left, + top: position.top, + width: elemWidth, + height: elemHeight + }, + horizontal: right < 0 ? 'left' : left > 0 ? 'right' : 'center', + vertical: bottom < 0 ? 'top' : top > 0 ? 'bottom' : 'middle' + }; + + if (targetWidth < elemWidth && abs(left + right) < targetWidth) { + feedback.horizontal = 'center'; + } + + if (targetHeight < elemHeight && abs(top + bottom) < targetHeight) { + feedback.vertical = 'middle'; + } + + if (max(abs(left), abs(right)) > max(abs(top), abs(bottom))) { + feedback.important = 'horizontal'; + } else { + feedback.important = 'vertical'; + } + + options.using.call(this, props, feedback); + }; + } + + elem.offset($.extend(position, { + using: using + })); + }); + }; + + if (!$.hasOwnProperty('ui')) { + $.ui = {}; + } + + $.ui.position = collisions; +})(jQuery); \ No newline at end of file reverted: --- b/core/misc/progress.js +++ a/core/misc/progress.js @@ -0,0 +1,92 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.theme.progressBar = function (id) { + return "
    ") + '
     
    ' + '
    ' + '
    ' + '
     
    ' + '
    '; + }; + + Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { + this.id = id; + this.method = method || 'GET'; + this.updateCallback = updateCallback; + this.errorCallback = errorCallback; + this.element = $(Drupal.theme('progressBar', id)); + }; + + $.extend(Drupal.ProgressBar.prototype, { + setProgress: function setProgress(percentage, message, label) { + if (percentage >= 0 && percentage <= 100) { + $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%")); + $(this.element).find('div.progress__percentage').html("".concat(percentage, "%")); + } + + $('div.progress__description', this.element).html(message); + $('div.progress__label', this.element).html(label); + + if (this.updateCallback) { + this.updateCallback(percentage, message, this); + } + }, + startMonitoring: function startMonitoring(uri, delay) { + this.delay = delay; + this.uri = uri; + this.sendPing(); + }, + stopMonitoring: function stopMonitoring() { + clearTimeout(this.timer); + this.uri = null; + }, + sendPing: function sendPing() { + if (this.timer) { + clearTimeout(this.timer); + } + + if (this.uri) { + var pb = this; + var uri = this.uri; + + if (uri.indexOf('?') === -1) { + uri += '?'; + } else { + uri += '&'; + } + + uri += '_format=json'; + $.ajax({ + type: this.method, + url: uri, + data: '', + dataType: 'json', + success: function success(progress) { + if (progress.status === 0) { + pb.displayError(progress.data); + return; + } + + pb.setProgress(progress.percentage, progress.message, progress.label); + pb.timer = setTimeout(function () { + pb.sendPing(); + }, pb.delay); + }, + error: function error(xmlhttp) { + var e = new Drupal.AjaxError(xmlhttp, pb.uri); + pb.displayError("
    ".concat(e.message, "
    ")); + } + }); + } + }, + displayError: function displayError(string) { + var error = $('
    ').html(string); + $(this.element).before(error).hide(); + + if (this.errorCallback) { + this.errorCallback(this); + } + } + }); +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/states.js +++ a/core/misc/states.js @@ -0,0 +1,380 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + var states = { + postponed: [] + }; + Drupal.states = states; + + function invert(a, invertState) { + return invertState && typeof a !== 'undefined' ? !a : a; + } + + function _compare2(a, b) { + if (a === b) { + return typeof a === 'undefined' ? a : true; + } + + return typeof a === 'undefined' || typeof b === 'undefined'; + } + + function ternary(a, b) { + if (typeof a === 'undefined') { + return b; + } + + if (typeof b === 'undefined') { + return a; + } + + return a && b; + } + + Drupal.behaviors.states = { + attach: function attach(context, settings) { + var $states = $(context).find('[data-drupal-states]'); + var il = $states.length; + + var _loop = function _loop(i) { + var config = JSON.parse($states[i].getAttribute('data-drupal-states')); + Object.keys(config || {}).forEach(function (state) { + new states.Dependent({ + element: $($states[i]), + state: states.State.sanitize(state), + constraints: config[state] + }); + }); + }; + + for (var i = 0; i < il; i++) { + _loop(i); + } + + while (states.postponed.length) { + states.postponed.shift()(); + } + } + }; + + states.Dependent = function (args) { + var _this = this; + + $.extend(this, { + values: {}, + oldValue: null + }, args); + this.dependees = this.getDependees(); + Object.keys(this.dependees || {}).forEach(function (selector) { + _this.initializeDependee(selector, _this.dependees[selector]); + }); + }; + + states.Dependent.comparisons = { + RegExp: function RegExp(reference, value) { + return reference.test(value); + }, + Function: function Function(reference, value) { + return reference(value); + }, + Number: function Number(reference, value) { + return typeof value === 'string' ? _compare2(reference.toString(), value) : _compare2(reference, value); + } + }; + states.Dependent.prototype = { + initializeDependee: function initializeDependee(selector, dependeeStates) { + var _this2 = this; + + this.values[selector] = {}; + Object.keys(dependeeStates).forEach(function (i) { + var state = dependeeStates[i]; + + if ($.inArray(state, dependeeStates) === -1) { + return; + } + + state = states.State.sanitize(state); + _this2.values[selector][state.name] = null; + $(selector).on("state:".concat(state), { + selector: selector, + state: state + }, function (e) { + _this2.update(e.data.selector, e.data.state, e.value); + }); + new states.Trigger({ + selector: selector, + state: state + }); + }); + }, + compare: function compare(reference, selector, state) { + var value = this.values[selector][state.name]; + + if (reference.constructor.name in states.Dependent.comparisons) { + return states.Dependent.comparisons[reference.constructor.name](reference, value); + } + + return _compare2(reference, value); + }, + update: function update(selector, state, value) { + if (value !== this.values[selector][state.name]) { + this.values[selector][state.name] = value; + this.reevaluate(); + } + }, + reevaluate: function reevaluate() { + var value = this.verifyConstraints(this.constraints); + + if (value !== this.oldValue) { + this.oldValue = value; + value = invert(value, this.state.invert); + this.element.trigger({ + type: "state:".concat(this.state), + value: value, + trigger: true + }); + } + }, + verifyConstraints: function verifyConstraints(constraints, selector) { + var result; + + if ($.isArray(constraints)) { + var hasXor = $.inArray('xor', constraints) === -1; + var len = constraints.length; + + for (var i = 0; i < len; i++) { + if (constraints[i] !== 'xor') { + var constraint = this.checkConstraints(constraints[i], selector, i); + + if (constraint && (hasXor || result)) { + return hasXor; + } + + result = result || constraint; + } + } + } else if ($.isPlainObject(constraints)) { + for (var n in constraints) { + if (constraints.hasOwnProperty(n)) { + result = ternary(result, this.checkConstraints(constraints[n], selector, n)); + + if (result === false) { + return false; + } + } + } + } + + return result; + }, + checkConstraints: function checkConstraints(value, selector, state) { + if (typeof state !== 'string' || /[0-9]/.test(state[0])) { + state = null; + } else if (typeof selector === 'undefined') { + selector = state; + state = null; + } + + if (state !== null) { + state = states.State.sanitize(state); + return invert(this.compare(value, selector, state), state.invert); + } + + return this.verifyConstraints(value, selector); + }, + getDependees: function getDependees() { + var cache = {}; + var _compare = this.compare; + + this.compare = function (reference, selector, state) { + (cache[selector] || (cache[selector] = [])).push(state.name); + }; + + this.verifyConstraints(this.constraints); + this.compare = _compare; + return cache; + } + }; + + states.Trigger = function (args) { + $.extend(this, args); + + if (this.state in states.Trigger.states) { + this.element = $(this.selector); + + if (!this.element.data("trigger:".concat(this.state))) { + this.initialize(); + } + } + }; + + states.Trigger.prototype = { + initialize: function initialize() { + var _this3 = this; + + var trigger = states.Trigger.states[this.state]; + + if (typeof trigger === 'function') { + trigger.call(window, this.element); + } else { + Object.keys(trigger || {}).forEach(function (event) { + _this3.defaultTrigger(event, trigger[event]); + }); + } + + this.element.data("trigger:".concat(this.state), true); + }, + defaultTrigger: function defaultTrigger(event, valueFn) { + var oldValue = valueFn.call(this.element); + this.element.on(event, $.proxy(function (e) { + var value = valueFn.call(this.element, e); + + if (oldValue !== value) { + this.element.trigger({ + type: "state:".concat(this.state), + value: value, + oldValue: oldValue + }); + oldValue = value; + } + }, this)); + states.postponed.push($.proxy(function () { + this.element.trigger({ + type: "state:".concat(this.state), + value: oldValue, + oldValue: null + }); + }, this)); + } + }; + states.Trigger.states = { + empty: { + keyup: function keyup() { + return this.val() === ''; + } + }, + checked: { + change: function change() { + var checked = false; + this.each(function () { + checked = $(this).prop('checked'); + return !checked; + }); + return checked; + } + }, + value: { + keyup: function keyup() { + if (this.length > 1) { + return this.filter(':checked').val() || false; + } + + return this.val(); + }, + change: function change() { + if (this.length > 1) { + return this.filter(':checked').val() || false; + } + + return this.val(); + } + }, + collapsed: { + collapsed: function collapsed(e) { + return typeof e !== 'undefined' && 'value' in e ? e.value : !this.is('[open]'); + } + } + }; + + states.State = function (state) { + this.pristine = state; + this.name = state; + var process = true; + + do { + while (this.name.charAt(0) === '!') { + this.name = this.name.substring(1); + this.invert = !this.invert; + } + + if (this.name in states.State.aliases) { + this.name = states.State.aliases[this.name]; + } else { + process = false; + } + } while (process); + }; + + states.State.sanitize = function (state) { + if (state instanceof states.State) { + return state; + } + + return new states.State(state); + }; + + states.State.aliases = { + enabled: '!disabled', + invisible: '!visible', + invalid: '!valid', + untouched: '!touched', + optional: '!required', + filled: '!empty', + unchecked: '!checked', + irrelevant: '!relevant', + expanded: '!collapsed', + open: '!collapsed', + closed: 'collapsed', + readwrite: '!readonly' + }; + states.State.prototype = { + invert: false, + toString: function toString() { + return this.name; + } + }; + var $document = $(document); + $document.on('state:disabled', function (e) { + if (e.trigger) { + $(e.target).prop('disabled', e.value).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggleClass('form-disabled', e.value).find('select, input, textarea').prop('disabled', e.value); + } + }); + $document.on('state:required', function (e) { + if (e.trigger) { + if (e.value) { + var label = "label".concat(e.target.id ? "[for=".concat(e.target.id, "]") : ''); + var $label = $(e.target).attr({ + required: 'required', + 'aria-required': 'true' + }).closest('.js-form-item, .js-form-wrapper').find(label); + + if (!$label.hasClass('js-form-required').length) { + $label.addClass('js-form-required form-required'); + } + } else { + $(e.target).removeAttr('required aria-required').closest('.js-form-item, .js-form-wrapper').find('label.js-form-required').removeClass('js-form-required form-required'); + } + } + }); + $document.on('state:visible', function (e) { + if (e.trigger) { + $(e.target).closest('.js-form-item, .js-form-submit, .js-form-wrapper').toggle(e.value); + } + }); + $document.on('state:checked', function (e) { + if (e.trigger) { + $(e.target).prop('checked', e.value); + } + }); + $document.on('state:collapsed', function (e) { + if (e.trigger) { + if ($(e.target).is('[open]') === e.value) { + $(e.target).find('> summary').trigger('click'); + } + } + }); +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/tabbingmanager.js +++ a/core/misc/tabbingmanager.js @@ -0,0 +1,197 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +(function ($, Drupal, _ref) { + var tabbable = _ref.tabbable, + isTabbable = _ref.isTabbable; + + function TabbingManager() { + this.stack = []; + } + + function TabbingContext(options) { + $.extend(this, { + level: null, + $tabbableElements: $(), + $disabledElements: $(), + released: false, + active: false, + trapFocus: false + }, options); + } + + $.extend(TabbingManager.prototype, { + constrain: function constrain(elements) { + var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + _ref2$trapFocus = _ref2.trapFocus, + trapFocus = _ref2$trapFocus === void 0 ? false : _ref2$trapFocus; + + var il = this.stack.length; + + for (var i = 0; i < il; i++) { + this.stack[i].deactivate(); + } + + var tabbableElements = []; + $(elements).each(function (index, rootElement) { + tabbableElements = [].concat(_toConsumableArray(tabbableElements), _toConsumableArray(tabbable(rootElement))); + + if (isTabbable(rootElement)) { + tabbableElements = [].concat(_toConsumableArray(tabbableElements), [rootElement]); + } + }); + var tabbingContext = new TabbingContext({ + level: this.stack.length, + $tabbableElements: $(tabbableElements), + trapFocus: trapFocus + }); + this.stack.push(tabbingContext); + tabbingContext.activate(); + $(document).trigger('drupalTabbingConstrained', tabbingContext); + return tabbingContext; + }, + release: function release() { + var toActivate = this.stack.length - 1; + + while (toActivate >= 0 && this.stack[toActivate].released) { + toActivate--; + } + + this.stack.splice(toActivate + 1); + + if (toActivate >= 0) { + this.stack[toActivate].activate(); + } + }, + activate: function activate(tabbingContext) { + var $set = tabbingContext.$tabbableElements; + var level = tabbingContext.level; + var $disabledSet = $(tabbable(document.body)).not($set); + tabbingContext.$disabledElements = $disabledSet; + var il = $disabledSet.length; + + for (var i = 0; i < il; i++) { + this.recordTabindex($disabledSet.eq(i), level); + } + + $disabledSet.prop('tabindex', -1).prop('autofocus', false); + var $hasFocus = $set.filter('[autofocus]').eq(-1); + + if ($hasFocus.length === 0) { + $hasFocus = $set.eq(0); + } + + $hasFocus.trigger('focus'); + + if ($set.length && tabbingContext.trapFocus) { + $set.last().on('keydown.focus-trap', function (event) { + if (event.key === 'Tab' && !event.shiftKey) { + event.preventDefault(); + $set.first().focus(); + } + }); + $set.first().on('keydown.focus-trap', function (event) { + if (event.key === 'Tab' && event.shiftKey) { + event.preventDefault(); + $set.last().focus(); + } + }); + } + }, + deactivate: function deactivate(tabbingContext) { + var $set = tabbingContext.$disabledElements; + var level = tabbingContext.level; + var il = $set.length; + tabbingContext.$tabbableElements.first().off('keydown.focus-trap'); + tabbingContext.$tabbableElements.last().off('keydown.focus-trap'); + + for (var i = 0; i < il; i++) { + this.restoreTabindex($set.eq(i), level); + } + }, + recordTabindex: function recordTabindex($el, level) { + var tabInfo = $el.data('drupalOriginalTabIndices') || {}; + tabInfo[level] = { + tabindex: $el[0].getAttribute('tabindex'), + autofocus: $el[0].hasAttribute('autofocus') + }; + $el.data('drupalOriginalTabIndices', tabInfo); + }, + restoreTabindex: function restoreTabindex($el, level) { + var tabInfo = $el.data('drupalOriginalTabIndices'); + + if (tabInfo && tabInfo[level]) { + var data = tabInfo[level]; + + if (data.tabindex) { + $el[0].setAttribute('tabindex', data.tabindex); + } else { + $el[0].removeAttribute('tabindex'); + } + + if (data.autofocus) { + $el[0].setAttribute('autofocus', 'autofocus'); + } + + if (level === 0) { + $el.removeData('drupalOriginalTabIndices'); + } else { + var levelToDelete = level; + + while (tabInfo.hasOwnProperty(levelToDelete)) { + delete tabInfo[levelToDelete]; + levelToDelete++; + } + + $el.data('drupalOriginalTabIndices', tabInfo); + } + } + } + }); + $.extend(TabbingContext.prototype, { + release: function release() { + if (!this.released) { + this.deactivate(); + this.released = true; + Drupal.tabbingManager.release(this); + $(document).trigger('drupalTabbingContextReleased', this); + } + }, + activate: function activate() { + if (!this.active && !this.released) { + this.active = true; + Drupal.tabbingManager.activate(this); + $(document).trigger('drupalTabbingContextActivated', this); + } + }, + deactivate: function deactivate() { + if (this.active) { + this.active = false; + Drupal.tabbingManager.deactivate(this); + $(document).trigger('drupalTabbingContextDeactivated', this); + } + } + }); + + if (Drupal.tabbingManager) { + return; + } + + Drupal.tabbingManager = new TabbingManager(); +})(jQuery, Drupal, window.tabbable); \ No newline at end of file reverted: --- b/core/misc/tabledrag.js +++ a/core/misc/tabledrag.js @@ -0,0 +1,1015 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +(function ($, Drupal, drupalSettings) { + var showWeight = JSON.parse(localStorage.getItem('Drupal.tableDrag.showWeight')); + Drupal.behaviors.tableDrag = { + attach: function attach(context, settings) { + function initTableDrag(table, base) { + if (table.length) { + Drupal.tableDrag[base] = new Drupal.tableDrag(table[0], settings.tableDrag[base]); + } + } + + Object.keys(settings.tableDrag || {}).forEach(function (base) { + initTableDrag($(once('tabledrag', "#".concat(base), context)), base); + }); + } + }; + + Drupal.tableDrag = function (table, tableSettings) { + var _this = this; + + var self = this; + var $table = $(table); + this.$table = $(table); + this.table = table; + this.tableSettings = tableSettings; + this.dragObject = null; + this.rowObject = null; + this.oldRowElement = null; + this.oldY = null; + this.changed = false; + this.maxDepth = 0; + this.rtl = $(this.table).css('direction') === 'rtl' ? -1 : 1; + this.striping = $(this.table).data('striping') === 1; + this.scrollSettings = { + amount: 4, + interval: 50, + trigger: 70 + }; + this.scrollInterval = null; + this.scrollY = 0; + this.windowHeight = 0; + this.$toggleWeightButton = null; + this.indentEnabled = false; + Object.keys(tableSettings || {}).forEach(function (group) { + Object.keys(tableSettings[group] || {}).forEach(function (n) { + if (tableSettings[group][n].relationship === 'parent') { + _this.indentEnabled = true; + } + + if (tableSettings[group][n].limit > 0) { + _this.maxDepth = tableSettings[group][n].limit; + } + }); + }); + + if (this.indentEnabled) { + this.indentCount = 1; + var indent = Drupal.theme('tableDragIndentation'); + var testRow = $('').addClass('draggable').appendTo(table); + var testCell = $('').appendTo(testRow).prepend(indent).prepend(indent); + var $indentation = testCell.find('.js-indentation'); + this.indentAmount = $indentation.get(1).offsetLeft - $indentation.get(0).offsetLeft; + testRow.remove(); + } + + $table.find('> tr.draggable, > tbody > tr.draggable').each(function () { + self.makeDraggable(this); + }); + var $toggleWeightWrapper = $(Drupal.theme('tableDragToggle')); + this.$toggleWeightButton = $toggleWeightWrapper.find('[data-drupal-selector="tabledrag-toggle-weight"]'); + this.$toggleWeightButton.on('click', $.proxy(function (e) { + e.preventDefault(); + this.toggleColumns(); + }, this)); + $table.before($toggleWeightWrapper); + self.initColumns(); + $(document).on('touchmove', function (event) { + return self.dragRow(event.originalEvent.touches[0], self); + }); + $(document).on('touchend', function (event) { + return self.dropRow(event.originalEvent.touches[0], self); + }); + $(document).on('mousemove pointermove', function (event) { + return self.dragRow(event, self); + }); + $(document).on('mouseup pointerup', function (event) { + return self.dropRow(event, self); + }); + $(window).on('storage', $.proxy(function (e) { + if (e.originalEvent.key === 'Drupal.tableDrag.showWeight') { + showWeight = JSON.parse(e.originalEvent.newValue); + this.displayColumns(showWeight); + } + }, this)); + }; + + Drupal.tableDrag.prototype.initColumns = function () { + var _this2 = this; + + var $table = this.$table; + var hidden; + var cell; + var columnIndex; + Object.keys(this.tableSettings || {}).forEach(function (group) { + Object.keys(_this2.tableSettings[group]).some(function (tableSetting) { + var field = $table.find(".".concat(_this2.tableSettings[group][tableSetting].target)).eq(0); + + if (field.length && _this2.tableSettings[group][tableSetting].hidden) { + hidden = _this2.tableSettings[group][tableSetting].hidden; + cell = field.closest('td'); + return true; + } + + return false; + }); + + if (hidden && cell[0]) { + columnIndex = cell.parent().find('> td').index(cell.get(0)) + 1; + $table.find('> thead > tr, > tbody > tr, > tr').each(_this2.addColspanClass(columnIndex)); + } + }); + this.displayColumns(showWeight); + }; + + Drupal.tableDrag.prototype.addColspanClass = function (columnIndex) { + return function () { + var $row = $(this); + var index = columnIndex; + var cells = $row.children(); + var cell; + cells.each(function (n) { + if (n < index && this.colSpan && this.colSpan > 1) { + index -= this.colSpan - 1; + } + }); + + if (index > 0) { + cell = cells.filter(":nth-child(".concat(index, ")")); + + if (cell[0].colSpan && cell[0].colSpan > 1) { + cell.addClass('tabledrag-has-colspan'); + } else { + cell.addClass('tabledrag-hide'); + } + } + }; + }; + + Drupal.tableDrag.prototype.displayColumns = function (displayWeight) { + if (displayWeight) { + this.showColumns(); + } else { + this.hideColumns(); + } + + this.$toggleWeightButton.html(Drupal.theme('toggleButtonContent', displayWeight)); + $(once.filter('tabledrag', 'table')).trigger('columnschange', !!displayWeight); + }; + + Drupal.tableDrag.prototype.toggleColumns = function () { + showWeight = !showWeight; + this.displayColumns(showWeight); + + if (showWeight) { + localStorage.setItem('Drupal.tableDrag.showWeight', showWeight); + } else { + localStorage.removeItem('Drupal.tableDrag.showWeight'); + } + }; + + Drupal.tableDrag.prototype.hideColumns = function () { + var $tables = $(once.filter('tabledrag', 'table')); + $tables.find('.tabledrag-hide').css('display', 'none'); + $tables.find('.tabledrag-handle').css('display', ''); + $tables.find('.tabledrag-has-colspan').each(function () { + this.colSpan -= 1; + }); + }; + + Drupal.tableDrag.prototype.showColumns = function () { + var $tables = $(once.filter('tabledrag', 'table')); + $tables.find('.tabledrag-hide').css('display', ''); + $tables.find('.tabledrag-handle').css('display', 'none'); + $tables.find('.tabledrag-has-colspan').each(function () { + this.colSpan += 1; + }); + }; + + Drupal.tableDrag.prototype.rowSettings = function (group, row) { + var field = $(row).find(".".concat(group)); + var tableSettingsGroup = this.tableSettings[group]; + return Object.keys(tableSettingsGroup).map(function (delta) { + var targetClass = tableSettingsGroup[delta].target; + var rowSettings; + + if (field.is(".".concat(targetClass))) { + rowSettings = {}; + Object.keys(tableSettingsGroup[delta]).forEach(function (n) { + rowSettings[n] = tableSettingsGroup[delta][n]; + }); + } + + return rowSettings; + }).filter(function (rowSetting) { + return rowSetting; + })[0]; + }; + + Drupal.tableDrag.prototype.makeDraggable = function (item) { + var self = this; + var $item = $(item); + $item.find('td:first-of-type').find('a').addClass('menu-item__link'); + var $handle = $(Drupal.theme('tableDragHandle')); + var $indentationLast = $item.find('td:first-of-type').find('.js-indentation').eq(-1); + + if ($indentationLast.length) { + $indentationLast.after($handle); + self.indentCount = Math.max($item.find('.js-indentation').length, self.indentCount); + } else { + $item.find('td').eq(0).prepend($handle); + } + + $handle.on('mousedown touchstart pointerdown', function (event) { + event.preventDefault(); + + if (event.originalEvent.type === 'touchstart') { + event = event.originalEvent.touches[0]; + } + + self.dragStart(event, self, item); + }); + $handle.on('click', function (e) { + e.preventDefault(); + }); + $handle.on('focus', function () { + self.safeBlur = true; + }); + $handle.on('blur', function (event) { + if (self.rowObject && self.safeBlur) { + self.dropRow(event, self); + } + }); + $handle.on('keydown', function (event) { + if (event.keyCode !== 9 && !self.rowObject) { + self.rowObject = new self.row(item, 'keyboard', self.indentEnabled, self.maxDepth, true); + } + + var keyChange = false; + var groupHeight; + + switch (event.keyCode) { + case 37: + case 63234: + keyChange = true; + self.rowObject.indent(-1 * self.rtl); + break; + + case 38: + case 63232: + { + var $previousRow = $(self.rowObject.element).prev('tr').eq(0); + var previousRow = $previousRow.get(0); + + while (previousRow && $previousRow.is(':hidden')) { + $previousRow = $(previousRow).prev('tr').eq(0); + previousRow = $previousRow.get(0); + } + + if (previousRow) { + self.safeBlur = false; + self.rowObject.direction = 'up'; + keyChange = true; + + if ($(item).is('.tabledrag-root')) { + groupHeight = 0; + + while (previousRow && $previousRow.find('.js-indentation').length) { + $previousRow = $(previousRow).prev('tr').eq(0); + previousRow = $previousRow.get(0); + groupHeight += $previousRow.is(':hidden') ? 0 : previousRow.offsetHeight; + } + + if (previousRow) { + self.rowObject.swap('before', previousRow); + window.scrollBy(0, -groupHeight); + } + } else if (self.table.tBodies[0].rows[0] !== previousRow || $previousRow.is('.draggable')) { + self.rowObject.swap('before', previousRow); + self.rowObject.interval = null; + self.rowObject.indent(0); + window.scrollBy(0, -parseInt(item.offsetHeight, 10)); + } + + $handle.trigger('focus'); + } + + break; + } + + case 39: + case 63235: + keyChange = true; + self.rowObject.indent(self.rtl); + break; + + case 40: + case 63233: + { + var $nextRow = $(self.rowObject.group).eq(-1).next('tr').eq(0); + var nextRow = $nextRow.get(0); + + while (nextRow && $nextRow.is(':hidden')) { + $nextRow = $(nextRow).next('tr').eq(0); + nextRow = $nextRow.get(0); + } + + if (nextRow) { + self.safeBlur = false; + self.rowObject.direction = 'down'; + keyChange = true; + + if ($(item).is('.tabledrag-root')) { + groupHeight = 0; + var nextGroup = new self.row(nextRow, 'keyboard', self.indentEnabled, self.maxDepth, false); + + if (nextGroup) { + $(nextGroup.group).each(function () { + groupHeight += $(this).is(':hidden') ? 0 : this.offsetHeight; + }); + var nextGroupRow = $(nextGroup.group).eq(-1).get(0); + self.rowObject.swap('after', nextGroupRow); + window.scrollBy(0, parseInt(groupHeight, 10)); + } + } else { + self.rowObject.swap('after', nextRow); + self.rowObject.interval = null; + self.rowObject.indent(0); + window.scrollBy(0, parseInt(item.offsetHeight, 10)); + } + + $handle.trigger('focus'); + } + + break; + } + } + + if (self.rowObject && self.rowObject.changed === true) { + $(item).addClass('drag'); + + if (self.oldRowElement) { + $(self.oldRowElement).removeClass('drag-previous'); + } + + self.oldRowElement = item; + + if (self.striping === true) { + self.restripeTable(); + } + + self.onDrag(); + } + + if (keyChange) { + return false; + } + }); + $handle.on('keypress', function (event) { + switch (event.keyCode) { + case 37: + case 38: + case 39: + case 40: + return false; + } + }); + }; + + Drupal.tableDrag.prototype.dragStart = function (event, self, item) { + self.dragObject = {}; + self.dragObject.initOffset = self.getPointerOffset(item, event); + self.dragObject.initPointerCoords = self.pointerCoords(event); + + if (self.indentEnabled) { + self.dragObject.indentPointerPos = self.dragObject.initPointerCoords; + } + + if (self.rowObject) { + $(self.rowObject.element).find('a.tabledrag-handle').trigger('blur'); + } + + self.rowObject = new self.row(item, 'pointer', self.indentEnabled, self.maxDepth, true); + self.table.topY = $(self.table).offset().top; + self.table.bottomY = self.table.topY + self.table.offsetHeight; + $(item).addClass('drag'); + $('body').addClass('drag'); + + if (self.oldRowElement) { + $(self.oldRowElement).removeClass('drag-previous'); + } + + self.oldY = self.pointerCoords(event).y; + }; + + Drupal.tableDrag.prototype.dragRow = function (event, self) { + if (self.dragObject) { + self.currentPointerCoords = self.pointerCoords(event); + var y = self.currentPointerCoords.y - self.dragObject.initOffset.y; + var x = self.currentPointerCoords.x - self.dragObject.initOffset.x; + + if (y !== self.oldY) { + self.rowObject.direction = y > self.oldY ? 'down' : 'up'; + self.oldY = y; + var scrollAmount = self.checkScroll(self.currentPointerCoords.y); + clearInterval(self.scrollInterval); + + if (scrollAmount > 0 && self.rowObject.direction === 'down' || scrollAmount < 0 && self.rowObject.direction === 'up') { + self.setScroll(scrollAmount); + } + + var currentRow = self.findDropTargetRow(x, y); + + if (currentRow) { + if (self.rowObject.direction === 'down') { + self.rowObject.swap('after', currentRow, self); + } else { + self.rowObject.swap('before', currentRow, self); + } + + if (self.striping === true) { + self.restripeTable(); + } + } + } + + if (self.indentEnabled) { + var xDiff = self.currentPointerCoords.x - self.dragObject.indentPointerPos.x; + var indentDiff = Math.round(xDiff / self.indentAmount); + var indentChange = self.rowObject.indent(indentDiff); + self.dragObject.indentPointerPos.x += self.indentAmount * indentChange * self.rtl; + self.indentCount = Math.max(self.indentCount, self.rowObject.indents); + } + + return false; + } + }; + + Drupal.tableDrag.prototype.dropRow = function (event, self) { + var droppedRow; + var $droppedRow; + + if (self.rowObject !== null) { + droppedRow = self.rowObject.element; + $droppedRow = $(droppedRow); + + if (self.rowObject.changed === true) { + self.updateFields(droppedRow); + Object.keys(self.tableSettings || {}).forEach(function (group) { + var rowSettings = self.rowSettings(group, droppedRow); + + if (rowSettings.relationship === 'group') { + Object.keys(self.rowObject.children || {}).forEach(function (n) { + self.updateField(self.rowObject.children[n], group); + }); + } + }); + self.rowObject.markChanged(); + + if (self.changed === false) { + $(Drupal.theme('tableDragChangedWarning')).insertBefore(self.table).hide().fadeIn('slow'); + self.changed = true; + } + } + + if (self.indentEnabled) { + self.rowObject.removeIndentClasses(); + } + + if (self.oldRowElement) { + $(self.oldRowElement).removeClass('drag-previous'); + } + + $droppedRow.removeClass('drag').addClass('drag-previous'); + self.oldRowElement = droppedRow; + self.onDrop(); + self.rowObject = null; + } + + if (self.dragObject !== null) { + self.dragObject = null; + $('body').removeClass('drag'); + clearInterval(self.scrollInterval); + } + }; + + Drupal.tableDrag.prototype.pointerCoords = function (event) { + if (event.pageX || event.pageY) { + return { + x: event.pageX, + y: event.pageY + }; + } + + return { + x: event.clientX + document.body.scrollLeft - document.body.clientLeft, + y: event.clientY + document.body.scrollTop - document.body.clientTop + }; + }; + + Drupal.tableDrag.prototype.getPointerOffset = function (target, event) { + var docPos = $(target).offset(); + var pointerPos = this.pointerCoords(event); + return { + x: pointerPos.x - docPos.left, + y: pointerPos.y - docPos.top + }; + }; + + Drupal.tableDrag.prototype.findDropTargetRow = function (x, y) { + var _this3 = this; + + var rows = $(this.table.tBodies[0].rows).not(':hidden'); + + var _loop = function _loop(n) { + var row = rows[n]; + var $row = $(row); + var rowY = $row.offset().top; + var rowHeight = void 0; + + if (row.offsetHeight === 0) { + rowHeight = parseInt(row.firstChild.offsetHeight, 10) / 2; + } else { + rowHeight = parseInt(row.offsetHeight, 10) / 2; + } + + if (y > rowY - rowHeight && y < rowY + rowHeight) { + if (_this3.indentEnabled) { + if (Object.keys(_this3.rowObject.group).some(function (o) { + return _this3.rowObject.group[o] === row; + })) { + return { + v: null + }; + } + } else if (row === _this3.rowObject.element) { + return { + v: null + }; + } + + if (!_this3.rowObject.isValidSwap(row)) { + return { + v: null + }; + } + + while ($row.is(':hidden') && $row.prev('tr').is(':hidden')) { + $row = $row.prev('tr:first-of-type'); + row = $row.get(0); + } + + return { + v: row + }; + } + }; + + for (var n = 0; n < rows.length; n++) { + var _ret = _loop(n); + + if (_typeof(_ret) === "object") return _ret.v; + } + + return null; + }; + + Drupal.tableDrag.prototype.updateFields = function (changedRow) { + var _this4 = this; + + Object.keys(this.tableSettings || {}).forEach(function (group) { + _this4.updateField(changedRow, group); + }); + }; + + Drupal.tableDrag.prototype.updateField = function (changedRow, group) { + var rowSettings = this.rowSettings(group, changedRow); + var $changedRow = $(changedRow); + var sourceRow; + var $previousRow; + var previousRow; + var useSibling; + + if (rowSettings.relationship === 'self' || rowSettings.relationship === 'group') { + sourceRow = changedRow; + } else if (rowSettings.relationship === 'sibling') { + $previousRow = $changedRow.prev('tr:first-of-type'); + previousRow = $previousRow.get(0); + var $nextRow = $changedRow.next('tr:first-of-type'); + var nextRow = $nextRow.get(0); + sourceRow = changedRow; + + if ($previousRow.is('.draggable') && $previousRow.find(".".concat(group)).length) { + if (this.indentEnabled) { + if ($previousRow.find('.js-indentations').length === $changedRow.find('.js-indentations').length) { + sourceRow = previousRow; + } + } else { + sourceRow = previousRow; + } + } else if ($nextRow.is('.draggable') && $nextRow.find(".".concat(group)).length) { + if (this.indentEnabled) { + if ($nextRow.find('.js-indentations').length === $changedRow.find('.js-indentations').length) { + sourceRow = nextRow; + } + } else { + sourceRow = nextRow; + } + } + } else if (rowSettings.relationship === 'parent') { + $previousRow = $changedRow.prev('tr'); + previousRow = $previousRow; + + while ($previousRow.length && $previousRow.find('.js-indentation').length >= this.rowObject.indents) { + $previousRow = $previousRow.prev('tr'); + previousRow = $previousRow; + } + + if ($previousRow.length) { + sourceRow = $previousRow.get(0); + } else { + sourceRow = $(this.table).find('tr.draggable:first-of-type').get(0); + + if (sourceRow === this.rowObject.element) { + sourceRow = $(this.rowObject.group[this.rowObject.group.length - 1]).next('tr.draggable').get(0); + } + + useSibling = true; + } + } + + this.copyDragClasses(sourceRow, changedRow, group); + rowSettings = this.rowSettings(group, changedRow); + + if (useSibling) { + rowSettings.relationship = 'sibling'; + rowSettings.source = rowSettings.target; + } + + var targetClass = ".".concat(rowSettings.target); + var targetElement = $changedRow.find(targetClass).get(0); + + if (targetElement) { + var sourceClass = ".".concat(rowSettings.source); + var sourceElement = $(sourceClass, sourceRow).get(0); + + switch (rowSettings.action) { + case 'depth': + targetElement.value = $(sourceElement).closest('tr').find('.js-indentation').length; + break; + + case 'match': + targetElement.value = sourceElement.value; + break; + + case 'order': + { + var siblings = this.rowObject.findSiblings(rowSettings); + + if ($(targetElement).is('select')) { + var values = []; + $(targetElement).find('option').each(function () { + values.push(this.value); + }); + var maxVal = values[values.length - 1]; + $(siblings).find(targetClass).each(function () { + if (values.length > 0) { + this.value = values.shift(); + } else { + this.value = maxVal; + } + }); + } else { + var weight = 0; + var $siblingTarget = $(siblings[0]).find(targetClass); + + if ($siblingTarget.length) { + weight = parseInt($siblingTarget[0].value, 10) || 0; + } + + $(siblings).find(targetClass).each(function () { + this.value = weight; + weight++; + }); + } + + break; + } + } + } + }; + + Drupal.tableDrag.prototype.copyDragClasses = function (sourceRow, targetRow, group) { + var sourceElement = $(sourceRow).find(".".concat(group)); + var targetElement = $(targetRow).find(".".concat(group)); + + if (sourceElement.length && targetElement.length) { + targetElement[0].className = sourceElement[0].className; + } + }; + + Drupal.tableDrag.prototype.checkScroll = function (cursorY) { + var de = document.documentElement; + var b = document.body; + var windowHeight = window.innerHeight || (de.clientHeight && de.clientWidth !== 0 ? de.clientHeight : b.offsetHeight); + this.windowHeight = windowHeight; + var scrollY; + + if (document.all) { + scrollY = !de.scrollTop ? b.scrollTop : de.scrollTop; + } else { + scrollY = window.pageYOffset ? window.pageYOffset : window.scrollY; + } + + this.scrollY = scrollY; + var trigger = this.scrollSettings.trigger; + var delta = 0; + + if (cursorY - scrollY > windowHeight - trigger) { + delta = trigger / (windowHeight + scrollY - cursorY); + delta = delta > 0 && delta < trigger ? delta : trigger; + return delta * this.scrollSettings.amount; + } + + if (cursorY - scrollY < trigger) { + delta = trigger / (cursorY - scrollY); + delta = delta > 0 && delta < trigger ? delta : trigger; + return -delta * this.scrollSettings.amount; + } + }; + + Drupal.tableDrag.prototype.setScroll = function (scrollAmount) { + var self = this; + this.scrollInterval = setInterval(function () { + self.checkScroll(self.currentPointerCoords.y); + var aboveTable = self.scrollY > self.table.topY; + var belowTable = self.scrollY + self.windowHeight < self.table.bottomY; + + if (scrollAmount > 0 && belowTable || scrollAmount < 0 && aboveTable) { + window.scrollBy(0, scrollAmount); + } + }, this.scrollSettings.interval); + }; + + Drupal.tableDrag.prototype.restripeTable = function () { + $(this.table).find('> tbody > tr.draggable, > tr.draggable').filter(':visible').filter(':odd').removeClass('odd').addClass('even').end().filter(':even').removeClass('even').addClass('odd'); + }; + + Drupal.tableDrag.prototype.onDrag = function () { + return null; + }; + + Drupal.tableDrag.prototype.onDrop = function () { + return null; + }; + + Drupal.tableDrag.prototype.row = function (tableRow, method, indentEnabled, maxDepth, addClasses) { + var $tableRow = $(tableRow); + this.element = tableRow; + this.method = method; + this.group = [tableRow]; + this.groupDepth = $tableRow.find('.js-indentation').length; + this.changed = false; + this.table = $tableRow.closest('table')[0]; + this.indentEnabled = indentEnabled; + this.maxDepth = maxDepth; + this.direction = ''; + + if (this.indentEnabled) { + this.indents = $tableRow.find('.js-indentation').length; + this.children = this.findChildren(addClasses); + this.group = this.group.concat(this.children); + + for (var n = 0; n < this.group.length; n++) { + this.groupDepth = Math.max($(this.group[n]).find('.js-indentation').length, this.groupDepth); + } + } + }; + + Drupal.tableDrag.prototype.row.prototype.findChildren = function (addClasses) { + var parentIndentation = this.indents; + var currentRow = $(this.element, this.table).next('tr.draggable'); + var rows = []; + var child = 0; + + function rowIndentation(indentNum, el) { + var self = $(el); + + if (child === 1 && indentNum === parentIndentation) { + self.addClass('tree-child-first'); + } + + if (indentNum === parentIndentation) { + self.addClass('tree-child'); + } else if (indentNum > parentIndentation) { + self.addClass('tree-child-horizontal'); + } + } + + while (currentRow.length) { + if (currentRow.find('.js-indentation').length > parentIndentation) { + child++; + rows.push(currentRow[0]); + + if (addClasses) { + currentRow.find('.js-indentation').each(rowIndentation); + } + } else { + break; + } + + currentRow = currentRow.next('tr.draggable'); + } + + if (addClasses && rows.length) { + $(rows[rows.length - 1]).find(".js-indentation:nth-child(".concat(parentIndentation + 1, ")")).addClass('tree-child-last'); + } + + return rows; + }; + + Drupal.tableDrag.prototype.row.prototype.isValidSwap = function (row) { + var $row = $(row); + + if (this.indentEnabled) { + var prevRow; + var nextRow; + + if (this.direction === 'down') { + prevRow = row; + nextRow = $row.next('tr').get(0); + } else { + prevRow = $row.prev('tr').get(0); + nextRow = row; + } + + this.interval = this.validIndentInterval(prevRow, nextRow); + + if (this.interval.min > this.interval.max) { + return false; + } + } + + if (this.table.tBodies[0].rows[0] === row && $row.is(':not(.draggable)')) { + return false; + } + + return true; + }; + + Drupal.tableDrag.prototype.row.prototype.swap = function (position, row) { + this.group.forEach(function (row) { + Drupal.detachBehaviors(row, drupalSettings, 'move'); + }); + $(row)[position](this.group); + this.group.forEach(function (row) { + Drupal.attachBehaviors(row, drupalSettings); + }); + this.changed = true; + this.onSwap(row); + }; + + Drupal.tableDrag.prototype.row.prototype.validIndentInterval = function (prevRow, nextRow) { + var $prevRow = $(prevRow); + var maxIndent; + var minIndent = nextRow ? $(nextRow).find('.js-indentation').length : 0; + + if (!prevRow || $prevRow.is(':not(.draggable)') || $(this.element).is('.tabledrag-root')) { + maxIndent = 0; + } else { + maxIndent = $prevRow.find('.js-indentation').length + ($prevRow.is('.tabledrag-leaf') ? 0 : 1); + + if (this.maxDepth) { + maxIndent = Math.min(maxIndent, this.maxDepth - (this.groupDepth - this.indents)); + } + } + + return { + min: minIndent, + max: maxIndent + }; + }; + + Drupal.tableDrag.prototype.row.prototype.indent = function (indentDiff) { + var $group = $(this.group); + + if (!this.interval) { + var prevRow = $(this.element).prev('tr').get(0); + var nextRow = $group.eq(-1).next('tr').get(0); + this.interval = this.validIndentInterval(prevRow, nextRow); + } + + var indent = this.indents + indentDiff; + indent = Math.max(indent, this.interval.min); + indent = Math.min(indent, this.interval.max); + indentDiff = indent - this.indents; + + for (var n = 1; n <= Math.abs(indentDiff); n++) { + if (indentDiff < 0) { + $group.find('.js-indentation:first-of-type').remove(); + this.indents--; + } else { + $group.find('td:first-of-type').prepend(Drupal.theme('tableDragIndentation')); + this.indents++; + } + } + + if (indentDiff) { + this.changed = true; + this.groupDepth += indentDiff; + this.onIndent(); + } + + return indentDiff; + }; + + Drupal.tableDrag.prototype.row.prototype.findSiblings = function (rowSettings) { + var siblings = []; + var directions = ['prev', 'next']; + var rowIndentation = this.indents; + var checkRowIndentation; + + for (var d = 0; d < directions.length; d++) { + var checkRow = $(this.element)[directions[d]](); + + while (checkRow.length) { + if (checkRow.find(".".concat(rowSettings.target))) { + if (this.indentEnabled) { + checkRowIndentation = checkRow.find('.js-indentation').length; + } + + if (!this.indentEnabled || checkRowIndentation === rowIndentation) { + siblings.push(checkRow[0]); + } else if (checkRowIndentation < rowIndentation) { + break; + } + } else { + break; + } + + checkRow = checkRow[directions[d]](); + } + + if (directions[d] === 'prev') { + siblings.reverse(); + siblings.push(this.element); + } + } + + return siblings; + }; + + Drupal.tableDrag.prototype.row.prototype.removeIndentClasses = function () { + var _this5 = this; + + Object.keys(this.children || {}).forEach(function (n) { + $(_this5.children[n]).find('.js-indentation').removeClass('tree-child').removeClass('tree-child-first').removeClass('tree-child-last').removeClass('tree-child-horizontal'); + }); + }; + + Drupal.tableDrag.prototype.row.prototype.markChanged = function () { + var marker = Drupal.theme('tableDragChangedMarker'); + var cell = $(this.element).find('td:first-of-type'); + + if (cell.find('abbr.tabledrag-changed').length === 0) { + cell.append(marker); + } + }; + + Drupal.tableDrag.prototype.row.prototype.onIndent = function () { + return null; + }; + + Drupal.tableDrag.prototype.row.prototype.onSwap = function (swappedRow) { + return null; + }; + + $.extend(Drupal.theme, { + tableDragChangedMarker: function tableDragChangedMarker() { + return "*"); + }, + tableDragIndentation: function tableDragIndentation() { + return '
     
    '; + }, + tableDragChangedWarning: function tableDragChangedWarning() { + return "
    ".concat(Drupal.theme('tableDragChangedMarker'), " ").concat(Drupal.t('You have unsaved changes.'), "
    "); + }, + tableDragToggle: function tableDragToggle() { + return "
    \n \n
    "; + }, + toggleButtonContent: function toggleButtonContent(show) { + return show ? Drupal.t('Hide row weights') : Drupal.t('Show row weights'); + }, + tableDragHandle: function tableDragHandle() { + return "
    "); + } + }); +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/misc/tableheader.js +++ a/core/misc/tableheader.js @@ -0,0 +1,160 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, displace) { + function TableHeader(table) { + var $table = $(table); + this.$originalTable = $table; + this.$originalHeader = $table.children('thead'); + this.$originalHeaderCells = this.$originalHeader.find('> tr > th'); + this.displayWeight = null; + this.$originalTable.addClass('sticky-table'); + this.tableHeight = $table[0].clientHeight; + this.tableOffset = this.$originalTable.offset(); + this.$originalTable.on('columnschange', { + tableHeader: this + }, function (e, display) { + var tableHeader = e.data.tableHeader; + + if (tableHeader.displayWeight === null || tableHeader.displayWeight !== display) { + tableHeader.recalculateSticky(); + } + + tableHeader.displayWeight = display; + }); + this.createSticky(); + } + + function forTables(method, arg) { + var tables = TableHeader.tables; + var il = tables.length; + + for (var i = 0; i < il; i++) { + tables[i][method](arg); + } + } + + function tableHeaderInitHandler(e) { + once('tableheader', $(e.data.context).find('table.sticky-enabled')).forEach(function (table) { + TableHeader.tables.push(new TableHeader(table)); + }); + forTables('onScroll'); + } + + Drupal.behaviors.tableHeader = { + attach: function attach(context) { + $(window).one('scroll.TableHeaderInit', { + context: context + }, tableHeaderInitHandler); + } + }; + + function scrollValue(position) { + return document.documentElement[position] || document.body[position]; + } + + function tableHeaderResizeHandler(e) { + forTables('recalculateSticky'); + } + + function tableHeaderOnScrollHandler(e) { + forTables('onScroll'); + } + + function tableHeaderOffsetChangeHandler(e, offsets) { + forTables('stickyPosition', offsets.top); + } + + $(window).on({ + 'resize.TableHeader': tableHeaderResizeHandler, + 'scroll.TableHeader': tableHeaderOnScrollHandler + }); + $(document).on({ + 'columnschange.TableHeader drupalToolbarTrayChange': tableHeaderResizeHandler, + 'drupalViewportOffsetChange.TableHeader': tableHeaderOffsetChangeHandler + }); + $.extend(TableHeader, { + tables: [] + }); + $.extend(TableHeader.prototype, { + minHeight: 100, + tableOffset: null, + tableHeight: null, + stickyVisible: false, + createSticky: function createSticky() { + this.$html = $('html'); + var $stickyHeader = this.$originalHeader.clone(true); + this.$stickyTable = $('').css({ + visibility: 'hidden', + position: 'fixed', + top: '0px' + }).append($stickyHeader).insertBefore(this.$originalTable); + this.$stickyHeaderCells = $stickyHeader.find('> tr > th'); + this.recalculateSticky(); + }, + stickyPosition: function stickyPosition(offsetTop, offsetLeft) { + var css = {}; + + if (typeof offsetTop === 'number') { + css.top = "".concat(offsetTop, "px"); + } + + if (typeof offsetLeft === 'number') { + css.left = "".concat(this.tableOffset.left - offsetLeft, "px"); + } + + this.$html.css('scroll-padding-top', displace.offsets.top + (this.stickyVisible ? this.$stickyTable.height() : 0)); + return this.$stickyTable.css(css); + }, + checkStickyVisible: function checkStickyVisible() { + var scrollTop = scrollValue('scrollTop'); + var tableTop = this.tableOffset.top - displace.offsets.top; + var tableBottom = tableTop + this.tableHeight; + var visible = false; + + if (tableTop < scrollTop && scrollTop < tableBottom - this.minHeight) { + visible = true; + } + + this.stickyVisible = visible; + return visible; + }, + onScroll: function onScroll(e) { + this.checkStickyVisible(); + this.stickyPosition(null, scrollValue('scrollLeft')); + this.$stickyTable.css('visibility', this.stickyVisible ? 'visible' : 'hidden'); + }, + recalculateSticky: function recalculateSticky(event) { + this.tableHeight = this.$originalTable[0].clientHeight; + displace.offsets.top = displace.calculateOffset('top'); + this.tableOffset = this.$originalTable.offset(); + this.stickyPosition(displace.offsets.top, scrollValue('scrollLeft')); + var $that = null; + var $stickyCell = null; + var display = null; + var il = this.$originalHeaderCells.length; + + for (var i = 0; i < il; i++) { + $that = $(this.$originalHeaderCells[i]); + $stickyCell = this.$stickyHeaderCells.eq($that.index()); + display = $that.css('display'); + + if (display !== 'none') { + $stickyCell.css({ + width: $that.css('width'), + display: display + }); + } else { + $stickyCell.css('display', 'none'); + } + } + + this.$stickyTable.css('width', this.$originalTable.outerWidth()); + } + }); + Drupal.TableHeader = TableHeader; +})(jQuery, Drupal, window.Drupal.displace); \ No newline at end of file reverted: --- b/core/misc/tableresponsive.js +++ a/core/misc/tableresponsive.js @@ -0,0 +1,94 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, window) { + function TableResponsive(table) { + this.table = table; + this.$table = $(table); + this.showText = Drupal.t('Show all columns'); + this.hideText = Drupal.t('Hide lower priority columns'); + this.$headers = this.$table.find('th'); + this.$link = $('').attr('title', Drupal.t('Show table cells that were hidden to make the table fit within a small screen.')).on('click', $.proxy(this, 'eventhandlerToggleColumns')); + this.$table.before($('
    ').append(this.$link)); + $(window).on('resize.tableresponsive', $.proxy(this, 'eventhandlerEvaluateColumnVisibility')).trigger('resize.tableresponsive'); + } + + Drupal.behaviors.tableResponsive = { + attach: function attach(context, settings) { + once('tableresponsive', 'table.responsive-enabled', context).forEach(function (table) { + TableResponsive.tables.push(new TableResponsive(table)); + }); + } + }; + $.extend(TableResponsive, { + tables: [] + }); + $.extend(TableResponsive.prototype, { + eventhandlerEvaluateColumnVisibility: function eventhandlerEvaluateColumnVisibility(e) { + var pegged = parseInt(this.$link.data('pegged'), 10); + var hiddenLength = this.$headers.filter('.priority-medium:hidden, .priority-low:hidden').length; + + if (hiddenLength > 0) { + this.$link.show(); + this.$link[0].textContent = this.showText; + } + + if (!pegged && hiddenLength === 0) { + this.$link.hide(); + this.$link[0].textContent = this.hideText; + } + }, + eventhandlerToggleColumns: function eventhandlerToggleColumns(e) { + e.preventDefault(); + var self = this; + var $hiddenHeaders = this.$headers.filter('.priority-medium:hidden, .priority-low:hidden'); + this.$revealedCells = this.$revealedCells || $(); + + if ($hiddenHeaders.length > 0) { + $hiddenHeaders.each(function (index, element) { + var $header = $(this); + var position = $header.prevAll('th').length; + self.$table.find('tbody tr').each(function () { + var $cells = $(this).find('td').eq(position); + $cells.show(); + self.$revealedCells = $().add(self.$revealedCells).add($cells); + }); + $header.show(); + self.$revealedCells = $().add(self.$revealedCells).add($header); + }); + this.$link[0].textContent = this.hideText; + this.$link.data('pegged', 1); + } else { + this.$revealedCells.hide(); + this.$revealedCells.each(function (index, element) { + var $cell = $(this); + var properties = $cell.attr('style').split(';'); + var newProps = []; + var match = /^display\s*:\s*none$/; + + for (var i = 0; i < properties.length; i++) { + var prop = properties[i]; + prop.trim(); + var isDisplayNone = match.exec(prop); + + if (isDisplayNone) { + continue; + } + + newProps.push(prop); + } + + $cell.attr('style', newProps.join(';')); + }); + this.$link[0].textContent = this.showText; + this.$link.data('pegged', 0); + $(window).trigger('resize.tableresponsive'); + } + } + }); + Drupal.TableResponsive = TableResponsive; +})(jQuery, Drupal, window); \ No newline at end of file reverted: --- b/core/misc/tableselect.js +++ a/core/misc/tableselect.js @@ -0,0 +1,93 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.tableSelect = { + attach: function attach(context, settings) { + once('table-select', $(context).find('th.select-all').closest('table')).forEach(function (table) { + return Drupal.tableSelect.call(table); + }); + } + }; + + Drupal.tableSelect = function () { + if ($(this).find('td input[type="checkbox"]').length === 0) { + return; + } + + var table = this; + var checkboxes; + var lastChecked; + var $table = $(table); + var strings = { + selectAll: Drupal.t('Select all rows in this table'), + selectNone: Drupal.t('Deselect all rows in this table') + }; + + var updateSelectAll = function updateSelectAll(state) { + $table.prev('table.sticky-header').addBack().find('th.select-all input[type="checkbox"]').each(function () { + var $checkbox = $(this); + var stateChanged = $checkbox.prop('checked') !== state; + $checkbox.attr('title', state ? strings.selectNone : strings.selectAll); + + if (stateChanged) { + $checkbox.prop('checked', state).trigger('change'); + } + }); + }; + + $table.find('th.select-all').prepend($(Drupal.theme('checkbox')).attr('title', strings.selectAll)).on('click', function (event) { + if ($(event.target).is('input[type="checkbox"]')) { + checkboxes.each(function () { + var $checkbox = $(this); + var stateChanged = $checkbox.prop('checked') !== event.target.checked; + + if (stateChanged) { + $checkbox.prop('checked', event.target.checked).trigger('change'); + } + + $checkbox.closest('tr').toggleClass('selected', this.checked); + }); + updateSelectAll(event.target.checked); + } + }); + checkboxes = $table.find('td input[type="checkbox"]:enabled').on('click', function (e) { + $(this).closest('tr').toggleClass('selected', this.checked); + + if (e.shiftKey && lastChecked && lastChecked !== e.target) { + Drupal.tableSelectRange($(e.target).closest('tr')[0], $(lastChecked).closest('tr')[0], e.target.checked); + } + + updateSelectAll(checkboxes.length === checkboxes.filter(':checked').length); + lastChecked = e.target; + }); + updateSelectAll(checkboxes.length === checkboxes.filter(':checked').length); + }; + + Drupal.tableSelectRange = function (from, to, state) { + var mode = from.rowIndex > to.rowIndex ? 'previousSibling' : 'nextSibling'; + + for (var i = from[mode]; i; i = i[mode]) { + var $i = $(i); + + if (i.nodeType !== 1) { + continue; + } + + $i.toggleClass('selected', state); + $i.find('input[type="checkbox"]').prop('checked', state); + + if (to.nodeType) { + if (i === to) { + break; + } + } else if ($.filter(to, [i]).r.length) { + break; + } + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/timezone.js +++ a/core/misc/timezone.js @@ -0,0 +1,61 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.setTimezone = { + attach: function attach(context, settings) { + var timezone = once('timezone', '.timezone-detect', context); + + if (timezone.length) { + var tz = new Intl.DateTimeFormat().resolvedOptions().timeZone; + + if (tz && $(timezone).find("option[value=\"".concat(tz, "\"]")).length) { + timezone.forEach(function (item) { + item.value = tz; + }); + return; + } + + var dateString = Date(); + var matches = dateString.match(/\(([A-Z]{3,5})\)/); + var abbreviation = matches ? matches[1] : 0; + var dateNow = new Date(); + var offsetNow = dateNow.getTimezoneOffset() * -60; + var dateJan = new Date(dateNow.getFullYear(), 0, 1, 12, 0, 0, 0); + var dateJul = new Date(dateNow.getFullYear(), 6, 1, 12, 0, 0, 0); + var offsetJan = dateJan.getTimezoneOffset() * -60; + var offsetJul = dateJul.getTimezoneOffset() * -60; + var isDaylightSavingTime; + + if (offsetJan === offsetJul) { + isDaylightSavingTime = ''; + } else if (Math.max(offsetJan, offsetJul) === offsetNow) { + isDaylightSavingTime = 1; + } else { + isDaylightSavingTime = 0; + } + + var path = "system/timezone/".concat(abbreviation, "/").concat(offsetNow, "/").concat(isDaylightSavingTime); + $.ajax({ + async: false, + url: Drupal.url(path), + data: { + date: dateString + }, + dataType: 'json', + success: function success(data) { + if (data) { + document.querySelectorAll('.timezone-detect').forEach(function (item) { + item.value = data; + }); + } + } + }); + } + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/misc/touchevents-test.js +++ a/core/misc/touchevents-test.js @@ -0,0 +1,8 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +document.documentElement.classList.add('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch ? 'touchevents' : 'no-touchevents'); \ No newline at end of file reverted: --- b/core/misc/vertical-tabs.js +++ a/core/misc/vertical-tabs.js @@ -0,0 +1,138 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + var handleFragmentLinkClickOrHashChange = function handleFragmentLinkClickOrHashChange(e, $target) { + $target.parents('.vertical-tabs__pane').each(function (index, pane) { + $(pane).data('verticalTab').focus(); + }); + }; + + Drupal.behaviors.verticalTabs = { + attach: function attach(context) { + var width = drupalSettings.widthBreakpoint || 640; + var mq = "(max-width: ".concat(width, "px)"); + + if (window.matchMedia(mq).matches) { + return; + } + + $(once('vertical-tabs-fragments', 'body')).on('formFragmentLinkClickOrHashChange.verticalTabs', handleFragmentLinkClickOrHashChange); + once('vertical-tabs', '[data-vertical-tabs-panes]', context).forEach(function (verticalTab) { + var $this = $(verticalTab).addClass('vertical-tabs__panes'); + var focusID = $this.find(':hidden.vertical-tabs__active-tab')[0].value; + var tabFocus; + var $details = $this.find('> details'); + + if ($details.length === 0) { + return; + } + + var tabList = $(''); + $this.wrap('
    ').before(tabList); + $details.each(function () { + var $that = $(this); + var $summary = $that.find('> summary'); + var verticalTab = new Drupal.verticalTab({ + title: $summary.length ? $summary[0].textContent : '', + details: $that + }); + tabList.append(verticalTab.item); + $that.removeClass('collapsed').removeAttr('open').addClass('vertical-tabs__pane').data('verticalTab', verticalTab); + + if (this.id === focusID) { + tabFocus = $that; + } + }); + $(tabList).find('> li').eq(0).addClass('first'); + $(tabList).find('> li').eq(-1).addClass('last'); + + if (!tabFocus) { + var $locationHash = $this.find(window.location.hash); + + if (window.location.hash && $locationHash.length) { + tabFocus = $locationHash.closest('.vertical-tabs__pane'); + } else { + tabFocus = $this.find('> .vertical-tabs__pane').eq(0); + } + } + + if (tabFocus.length) { + tabFocus.data('verticalTab').focus(); + } + }); + } + }; + + Drupal.verticalTab = function (settings) { + var self = this; + $.extend(this, settings, Drupal.theme('verticalTab', settings)); + this.link.attr('href', "#".concat(settings.details.attr('id'))); + this.link.on('click', function (e) { + e.preventDefault(); + self.focus(); + }); + this.link.on('keydown', function (event) { + if (event.keyCode === 13) { + event.preventDefault(); + self.focus(); + $('.vertical-tabs__pane :input:visible:enabled').eq(0).trigger('focus'); + } + }); + this.details.on('summaryUpdated', function () { + self.updateSummary(); + }).trigger('summaryUpdated'); + }; + + Drupal.verticalTab.prototype = { + focus: function focus() { + this.details.siblings('.vertical-tabs__pane').each(function () { + var tab = $(this).data('verticalTab'); + tab.details.hide(); + tab.details.removeAttr('open'); + tab.item.removeClass('is-selected'); + }).end().show().siblings(':hidden.vertical-tabs__active-tab')[0].value = this.details.attr('id'); + this.details.attr('open', true); + this.item.addClass('is-selected'); + $('#active-vertical-tab').remove(); + this.link.append("".concat(Drupal.t('(active tab)'), "")); + }, + updateSummary: function updateSummary() { + this.summary.html(this.details.drupalGetSummary()); + }, + tabShow: function tabShow() { + this.item.show(); + this.item.closest('.js-form-type-vertical-tabs').show(); + this.item.parent().children('.vertical-tabs__menu-item').removeClass('first').filter(':visible').eq(0).addClass('first'); + this.details.removeClass('vertical-tab--hidden').show(); + this.focus(); + return this; + }, + tabHide: function tabHide() { + this.item.hide(); + this.item.parent().children('.vertical-tabs__menu-item').removeClass('first').filter(':visible').eq(0).addClass('first'); + this.details.addClass('vertical-tab--hidden').hide().removeAttr('open'); + var $firstTab = this.details.siblings('.vertical-tabs__pane:not(.vertical-tab--hidden)').eq(0); + + if ($firstTab.length) { + $firstTab.data('verticalTab').focus(); + } else { + this.item.closest('.js-form-type-vertical-tabs').hide(); + } + + return this; + } + }; + + Drupal.theme.verticalTab = function (settings) { + var tab = {}; + tab.title = $(''); + tab.title[0].textContent = settings.title; + tab.item = $('
  • ').append(tab.link = $('').append(tab.title).append(tab.summary = $(''))); + return tab; + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/big_pipe/js/big_pipe.js +++ a/core/modules/big_pipe/js/big_pipe.js @@ -0,0 +1,82 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, drupalSettings) { + function mapTextContentToAjaxResponse(content) { + if (content === '') { + return false; + } + + try { + return JSON.parse(content); + } catch (e) { + return false; + } + } + + function bigPipeProcessPlaceholderReplacement(placeholderReplacement) { + var placeholderId = placeholderReplacement.getAttribute('data-big-pipe-replacement-for-placeholder-with-id'); + var content = placeholderReplacement.textContent.trim(); + + if (typeof drupalSettings.bigPipePlaceholderIds[placeholderId] !== 'undefined') { + var response = mapTextContentToAjaxResponse(content); + + if (response === false) { + once.remove('big-pipe', placeholderReplacement); + } else { + var ajaxObject = Drupal.ajax({ + url: '', + base: false, + element: false, + progress: false + }); + ajaxObject.success(response, 'success'); + } + } + } + + var interval = drupalSettings.bigPipeInterval || 50; + var timeoutID; + + function bigPipeProcessDocument(context) { + if (!context.querySelector('script[data-big-pipe-event="start"]')) { + return false; + } + + once('big-pipe-early-behaviors', 'body', context).forEach(function (el) { + Drupal.attachBehaviors(el); + }); + once('big-pipe', 'script[data-big-pipe-replacement-for-placeholder-with-id]', context).forEach(bigPipeProcessPlaceholderReplacement); + + if (context.querySelector('script[data-big-pipe-event="stop"]')) { + if (timeoutID) { + clearTimeout(timeoutID); + } + + return true; + } + + return false; + } + + function bigPipeProcess() { + timeoutID = setTimeout(function () { + if (!bigPipeProcessDocument(document)) { + bigPipeProcess(); + } + }, interval); + } + + bigPipeProcess(); + window.addEventListener('load', function () { + if (timeoutID) { + clearTimeout(timeoutID); + } + + bigPipeProcessDocument(document); + }); +})(Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/block/js/block.admin.js +++ a/core/modules/block/js/block.admin.js @@ -0,0 +1,52 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, debounce, once) { + Drupal.behaviors.blockFilterByText = { + attach: function attach(context, settings) { + var $input = $(once('block-filter-text', 'input.block-filter-text')); + var $table = $($input.attr('data-element')); + var $filterRows; + + function filterBlockList(e) { + var query = e.target.value.toLowerCase(); + + function toggleBlockEntry(index, label) { + var $row = $(label).parent().parent(); + var textMatch = label.textContent.toLowerCase().includes(query); + $row.toggle(textMatch); + } + + if (query.length >= 2) { + $filterRows.each(toggleBlockEntry); + Drupal.announce(Drupal.formatPlural($table.find('tr:visible').length - 1, '1 block is available in the modified list.', '@count blocks are available in the modified list.')); + } else { + $filterRows.each(function (index) { + $(this).parent().parent().show(); + }); + } + } + + if ($table.length) { + $filterRows = $table.find('div.block-filter-text-source'); + $input.on('keyup', debounce(filterBlockList, 200)); + } + } + }; + Drupal.behaviors.blockHighlightPlacement = { + attach: function attach(context, settings) { + if (settings.blockPlacement && $('.js-block-placed').length) { + once('block-highlight', '[data-drupal-selector="edit-blocks"]', context).forEach(function (container) { + var $container = $(container); + $('html, body').animate({ + scrollTop: $('.js-block-placed').offset().top - $container.offset().top + $container.scrollTop() + }, 500); + }); + } + } + }; +})(jQuery, Drupal, Drupal.debounce, once); \ No newline at end of file reverted: --- b/core/modules/book/book.js +++ a/core/modules/book/book.js @@ -0,0 +1,27 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.bookDetailsSummaries = { + attach: function attach(context) { + $(context).find('.book-outline-form').drupalSetSummary(function (context) { + var $select = $(context).find('.book-title-select'); + var val = $select[0].value; + + if (val === '0') { + return Drupal.t('Not in book'); + } + + if (val === 'new') { + return Drupal.t('New book'); + } + + return Drupal.checkPlain($select.find(':selected')[0].textContent); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/ckeditor.admin.js +++ a/core/modules/ckeditor/js/ckeditor.admin.js @@ -0,0 +1,275 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, _) { + Drupal.ckeditor = Drupal.ckeditor || {}; + Drupal.behaviors.ckeditorAdmin = { + attach: function attach(context) { + var configurationForm = once('ckeditor-configuration', '.ckeditor-toolbar-configuration', context); + + if (configurationForm.length) { + var $configurationForm = $(configurationForm); + var $textarea = $configurationForm.find('.js-form-item-editor-settings-toolbar-button-groups').hide().find('textarea'); + $configurationForm.append(drupalSettings.ckeditor.toolbarAdmin); + Drupal.ckeditor.models.Model = new Drupal.ckeditor.Model({ + $textarea: $textarea, + activeEditorConfig: JSON.parse($textarea[0].value), + hiddenEditorConfig: drupalSettings.ckeditor.hiddenCKEditorConfig + }); + var viewDefaults = { + model: Drupal.ckeditor.models.Model, + el: $('.ckeditor-toolbar-configuration') + }; + Drupal.ckeditor.views = { + controller: new Drupal.ckeditor.ControllerView(viewDefaults), + visualView: new Drupal.ckeditor.VisualView(viewDefaults), + keyboardView: new Drupal.ckeditor.KeyboardView(viewDefaults), + auralView: new Drupal.ckeditor.AuralView(viewDefaults) + }; + } + }, + detach: function detach(context, settings, trigger) { + if (trigger !== 'unload') { + return; + } + + var configurationForm = once.filter('ckeditor-configuration', '.ckeditor-toolbar-configuration', context); + + if (configurationForm.length && Drupal.ckeditor.models && Drupal.ckeditor.models.Model) { + var config = Drupal.ckeditor.models.Model.toJSON().activeEditorConfig; + var buttons = Drupal.ckeditor.views.controller.getButtonList(config); + var $activeToolbar = $('.ckeditor-toolbar-configuration').find('.ckeditor-toolbar-active'); + + for (var i = 0; i < buttons.length; i++) { + $activeToolbar.trigger('CKEditorToolbarChanged', ['removed', buttons[i]]); + } + } + } + }; + Drupal.ckeditor = { + views: {}, + models: {}, + registerButtonMove: function registerButtonMove(view, $button, callback) { + var $group = $button.closest('.ckeditor-toolbar-group'); + + if ($group.hasClass('placeholder')) { + if (view.isProcessing) { + return; + } + + view.isProcessing = true; + Drupal.ckeditor.openGroupNameDialog(view, $group, callback); + } else { + view.model.set('isDirty', true); + callback(true); + } + }, + registerGroupMove: function registerGroupMove(view, $group) { + var $row = $group.closest('.ckeditor-row'); + + if ($row.hasClass('placeholder')) { + $row.removeClass('placeholder'); + } + + $row.parent().children().each(function () { + $row = $(this); + + if ($row.find('.ckeditor-toolbar-group').not('.placeholder').length === 0) { + $row.addClass('placeholder'); + } + }); + view.model.set('isDirty', true); + }, + openGroupNameDialog: function openGroupNameDialog(view, $group, callback) { + callback = callback || function () {}; + + function validateForm(form) { + if (form.elements[0].value.length === 0) { + var $form = $(form); + + if (!$form.hasClass('errors')) { + $form.addClass('errors').find('input').addClass('error').attr('aria-invalid', 'true'); + $("
    ".concat(Drupal.t('Please provide a name for the button group.'), "
    ")).insertAfter(form.elements[0]); + } + + return true; + } + + return false; + } + + function closeDialog(action, form) { + function shutdown() { + dialog.close(action); + delete view.isProcessing; + } + + function namePlaceholderGroup($group, name) { + if ($group.hasClass('placeholder')) { + var groupID = "ckeditor-toolbar-group-aria-label-for-".concat(Drupal.checkPlain(name.toLowerCase().replace(/\s/g, '-'))); + $group.removeAttr('aria-label').attr('data-drupal-ckeditor-type', 'group').attr('tabindex', 0).children('.ckeditor-toolbar-group-name').attr('id', groupID).end().children('.ckeditor-toolbar-group-buttons').attr('aria-labelledby', groupID); + } + + $group.attr('data-drupal-ckeditor-toolbar-group-name', name).children('.ckeditor-toolbar-group-name').each(function () { + this.textContent = name; + }); + } + + if (action === 'cancel') { + shutdown(); + callback(false, $group); + return; + } + + if (form && validateForm(form)) { + return; + } + + if (action === 'apply') { + shutdown(); + namePlaceholderGroup($group, Drupal.checkPlain(form.elements[0].value)); + $group.closest('.ckeditor-row.placeholder').addBack().removeClass('placeholder'); + callback(true, $group); + view.model.set('isDirty', true); + } + } + + var $ckeditorButtonGroupNameForm = $(Drupal.theme('ckeditorButtonGroupNameForm')); + var dialog = Drupal.dialog($ckeditorButtonGroupNameForm.get(0), { + title: Drupal.t('Button group name'), + dialogClass: 'ckeditor-name-toolbar-group', + resizable: false, + buttons: [{ + text: Drupal.t('Apply'), + click: function click() { + closeDialog('apply', this); + }, + primary: true + }, { + text: Drupal.t('Cancel'), + click: function click() { + closeDialog('cancel'); + } + }], + open: function open() { + var form = this; + var $form = $(this); + var $widget = $form.parent(); + $widget.find('.ui-dialog-titlebar-close').remove(); + $widget.on('keypress.ckeditor', 'input, button', function (event) { + if (event.keyCode === 13) { + var $target = $(event.currentTarget); + var data = $target.data('ui-button'); + var action = 'apply'; + + if (data && data.options && data.options.label) { + action = data.options.label.toLowerCase(); + } + + closeDialog(action, form); + event.stopPropagation(); + event.stopImmediatePropagation(); + event.preventDefault(); + } + }); + var text = Drupal.t('Editing the name of the new button group in a dialog.'); + + if (typeof $group.attr('data-drupal-ckeditor-toolbar-group-name') !== 'undefined') { + text = Drupal.t('Editing the name of the "@groupName" button group in a dialog.', { + '@groupName': $group.attr('data-drupal-ckeditor-toolbar-group-name') + }); + } + + Drupal.announce(text); + }, + close: function close(event) { + $(event.target).remove(); + } + }); + dialog.showModal(); + $(document.querySelector('.ckeditor-name-toolbar-group').querySelector('input')).attr('value', $group.attr('data-drupal-ckeditor-toolbar-group-name')).trigger('focus'); + } + }; + Drupal.behaviors.ckeditorAdminButtonPluginSettings = { + attach: function attach(context) { + var $context = $(context); + var ckeditorPluginSettings = once('ckeditor-plugin-settings', '#ckeditor-plugin-settings', context); + + if (ckeditorPluginSettings.length) { + var $ckeditorPluginSettings = $(ckeditorPluginSettings); + $ckeditorPluginSettings.find('[data-ckeditor-buttons]').each(function () { + var $this = $(this); + + if ($this.data('verticalTab')) { + $this.data('verticalTab').tabHide(); + } else { + $this.hide(); + } + + $this.data('ckeditorButtonPluginSettingsActiveButtons', []); + }); + $context.find('.ckeditor-toolbar-active').off('CKEditorToolbarChanged.ckeditorAdminPluginSettings').on('CKEditorToolbarChanged.ckeditorAdminPluginSettings', function (event, action, button) { + var $pluginSettings = $ckeditorPluginSettings.find("[data-ckeditor-buttons~=".concat(button, "]")); + + if ($pluginSettings.length === 0) { + return; + } + + var verticalTab = $pluginSettings.data('verticalTab'); + var activeButtons = $pluginSettings.data('ckeditorButtonPluginSettingsActiveButtons'); + + if (action === 'added') { + activeButtons.push(button); + + if (verticalTab) { + verticalTab.tabShow(); + } else { + $pluginSettings.show(); + } + } else { + activeButtons.splice(activeButtons.indexOf(button), 1); + + if (activeButtons.length === 0) { + if (verticalTab) { + verticalTab.tabHide(); + } else { + $pluginSettings.hide(); + } + } + } + + $pluginSettings.data('ckeditorButtonPluginSettingsActiveButtons', activeButtons); + }); + } + } + }; + + Drupal.theme.ckeditorRow = function () { + return '
  • '; + }; + + Drupal.theme.ckeditorToolbarGroup = function () { + var group = ''; + group += "
  • "); + group += "

    ".concat(Drupal.t('New group'), "

    "); + group += ''; + group += '
  • '; + return group; + }; + + Drupal.theme.ckeditorButtonGroupNameForm = function () { + return '
    '; + }; + + Drupal.theme.ckeditorButtonGroupNamesToggle = function () { + return ''; + }; + + Drupal.theme.ckeditorNewButtonGroup = function () { + return "
  • "); + }; +})(jQuery, Drupal, drupalSettings, _); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js +++ a/core/modules/ckeditor/js/plugins/drupalimagecaption/plugin.js @@ -0,0 +1,211 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (CKEDITOR) { + function findElementByName(element, name) { + if (element.name === name) { + return element; + } + + var found = null; + element.forEach(function (el) { + if (el.name === name) { + found = el; + return false; + } + }, CKEDITOR.NODE_ELEMENT); + return found; + } + + CKEDITOR.plugins.add('drupalimagecaption', { + requires: 'drupalimage', + beforeInit: function beforeInit(editor) { + editor.lang.image2.captionPlaceholder = ''; + var placeholderText = editor.config.drupalImageCaption_captionPlaceholderText; + editor.on('widgetDefinition', function (event) { + var widgetDefinition = event.data; + + if (widgetDefinition.name !== 'image') { + return; + } + + var captionFilterEnabled = editor.config.drupalImageCaption_captionFilterEnabled; + var alignFilterEnabled = editor.config.drupalImageCaption_alignFilterEnabled; + CKEDITOR.tools.extend(widgetDefinition.features, { + caption: { + requiredContent: 'img[data-caption]' + }, + align: { + requiredContent: 'img[data-align]' + } + }, true); + var requiredContent = widgetDefinition.requiredContent.getDefinition(); + requiredContent.attributes['data-align'] = ''; + requiredContent.attributes['data-caption'] = ''; + widgetDefinition.requiredContent = new CKEDITOR.style(requiredContent); + widgetDefinition.allowedContent.img.attributes['!data-align'] = true; + widgetDefinition.allowedContent.img.attributes['!data-caption'] = true; + widgetDefinition.editables.caption.allowedContent = 'a[!href]; em strong cite code br'; + var originalDowncast = widgetDefinition.downcast; + + widgetDefinition.downcast = function (element) { + var img = findElementByName(element, 'img'); + originalDowncast.call(this, img); + var caption = this.editables.caption; + var captionHtml = caption && caption.getData(); + var attrs = img.attributes; + + if (captionFilterEnabled) { + if (captionHtml) { + attrs['data-caption'] = captionHtml; + } + } + + if (alignFilterEnabled) { + if (this.data.align !== 'none') { + attrs['data-align'] = this.data.align; + } + } + + if (img.parent.name === 'a') { + return img.parent; + } + + return img; + }; + + var originalUpcast = widgetDefinition.upcast; + + widgetDefinition.upcast = function (element, data) { + if (element.name !== 'img' || !element.attributes['data-entity-type'] || !element.attributes['data-entity-uuid']) { + return; + } + + if (element.attributes['data-cke-realelement']) { + return; + } + + element = originalUpcast.call(this, element, data); + var attrs = element.attributes; + + if (element.parent.name === 'a') { + element = element.parent; + } + + var retElement = element; + var caption; + + if (captionFilterEnabled) { + caption = attrs['data-caption']; + delete attrs['data-caption']; + } + + if (alignFilterEnabled) { + data.align = attrs['data-align']; + delete attrs['data-align']; + } + + data['data-entity-type'] = attrs['data-entity-type']; + delete attrs['data-entity-type']; + data['data-entity-uuid'] = attrs['data-entity-uuid']; + delete attrs['data-entity-uuid']; + + if (captionFilterEnabled) { + if (element.parent.name === 'p' && caption) { + var index = element.getIndex(); + var splitBefore = index > 0; + var splitAfter = index + 1 < element.parent.children.length; + + if (splitBefore) { + element.parent.split(index); + } + + index = element.getIndex(); + + if (splitAfter) { + element.parent.split(index + 1); + } + + element.parent.replaceWith(element); + retElement = element; + } + + if (caption) { + var figure = new CKEDITOR.htmlParser.element('figure'); + caption = new CKEDITOR.htmlParser.fragment.fromHtml(caption, 'figcaption'); + var captionFilter = new CKEDITOR.filter(widgetDefinition.editables.caption.allowedContent); + captionFilter.applyTo(caption); + caption.attributes['data-placeholder'] = placeholderText; + element.replaceWith(figure); + figure.add(element); + figure.add(caption); + figure.attributes.class = editor.config.image2_captionedClass; + retElement = figure; + } + } + + if (alignFilterEnabled) { + if (data.align === 'center' && (!captionFilterEnabled || !caption)) { + var p = new CKEDITOR.htmlParser.element('p'); + element.replaceWith(p); + p.add(element); + p.addClass(editor.config.image2_alignClasses[1]); + retElement = p; + } + } + + return retElement; + }; + + CKEDITOR.tools.extend(widgetDefinition._mapDataToDialog, { + align: 'data-align', + 'data-caption': 'data-caption', + hasCaption: 'hasCaption' + }); + var originalCreateDialogSaveCallback = widgetDefinition._createDialogSaveCallback; + + widgetDefinition._createDialogSaveCallback = function (editor, widget) { + var saveCallback = originalCreateDialogSaveCallback.call(this, editor, widget); + return function (dialogReturnValues) { + dialogReturnValues.attributes.hasCaption = !!dialogReturnValues.attributes.hasCaption; + var actualWidget = saveCallback(dialogReturnValues); + + if (dialogReturnValues.attributes.hasCaption) { + actualWidget.editables.caption.setAttribute('data-placeholder', placeholderText); + var captionElement = actualWidget.editables.caption.$; + + if (captionElement.childNodes.length === 1 && captionElement.childNodes.item(0).nodeName === 'BR') { + captionElement.removeChild(captionElement.childNodes.item(0)); + } + } + }; + }; + }, null, null, 20); + }, + afterInit: function afterInit(editor) { + var disableButtonIfOnWidget = function disableButtonIfOnWidget(evt) { + var widget = editor.widgets.focused; + + if (widget && widget.name === 'image') { + this.setState(CKEDITOR.TRISTATE_DISABLED); + evt.cancel(); + } + }; + + if (editor.plugins.justify && !editor.config.drupalImageCaption_alignFilterEnabled) { + var cmd; + var commands = ['justifyleft', 'justifycenter', 'justifyright', 'justifyblock']; + + for (var n = 0; n < commands.length; n++) { + cmd = editor.getCommand(commands[n]); + cmd.contextSensitive = 1; + cmd.on('refresh', disableButtonIfOnWidget, null, null, 4); + } + } + } + }); +})(CKEDITOR); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/plugins/drupallink/plugin.js +++ a/core/modules/ckeditor/js/plugins/drupallink/plugin.js @@ -0,0 +1,265 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, CKEDITOR) { + function parseAttributes(editor, element) { + var parsedAttributes = {}; + var domElement = element.$; + var attribute; + var attributeName; + + for (var attrIndex = 0; attrIndex < domElement.attributes.length; attrIndex++) { + attribute = domElement.attributes.item(attrIndex); + attributeName = attribute.nodeName.toLowerCase(); + + if (attributeName.indexOf('data-cke-') === 0) { + continue; + } + + parsedAttributes[attributeName] = element.data("cke-saved-".concat(attributeName)) || attribute.nodeValue; + } + + if (parsedAttributes.class) { + parsedAttributes.class = CKEDITOR.tools.trim(parsedAttributes.class.replace(/cke_\S+/, '')); + } + + return parsedAttributes; + } + + function getAttributes(editor, data) { + var set = {}; + Object.keys(data || {}).forEach(function (attributeName) { + set[attributeName] = data[attributeName]; + }); + set['data-cke-saved-href'] = set.href; + var removed = {}; + Object.keys(set).forEach(function (s) { + delete removed[s]; + }); + return { + set: set, + removed: CKEDITOR.tools.objectKeys(removed) + }; + } + + var registeredLinkableWidgets = []; + + function registerLinkableWidget(widgetName) { + registeredLinkableWidgets.push(widgetName); + } + + function getFocusedLinkableWidget(editor) { + var widget = editor.widgets.focused; + + if (widget && registeredLinkableWidgets.indexOf(widget.name) !== -1) { + return widget; + } + + return null; + } + + function getSelectedLink(editor) { + var selection = editor.getSelection(); + var selectedElement = selection.getSelectedElement(); + + if (selectedElement && selectedElement.is('a')) { + return selectedElement; + } + + var range = selection.getRanges(true)[0]; + + if (range) { + range.shrink(CKEDITOR.SHRINK_TEXT); + return editor.elementPath(range.getCommonAncestor()).contains('a', 1); + } + + return null; + } + + CKEDITOR.plugins.add('drupallink', { + icons: 'drupallink,drupalunlink', + hidpi: true, + init: function init(editor) { + editor.addCommand('drupallink', { + allowedContent: { + a: { + attributes: { + '!href': true + }, + classes: {} + } + }, + requiredContent: new CKEDITOR.style({ + element: 'a', + attributes: { + href: '' + } + }), + modes: { + wysiwyg: 1 + }, + canUndo: true, + exec: function exec(editor) { + var focusedLinkableWidget = getFocusedLinkableWidget(editor); + var linkElement = getSelectedLink(editor); + var existingValues = {}; + + if (linkElement && linkElement.$) { + existingValues = parseAttributes(editor, linkElement); + } else if (focusedLinkableWidget && focusedLinkableWidget.data.link) { + existingValues = CKEDITOR.tools.clone(focusedLinkableWidget.data.link); + } + + var saveCallback = function saveCallback(returnValues) { + if (focusedLinkableWidget) { + focusedLinkableWidget.setData('link', CKEDITOR.tools.extend(returnValues.attributes, focusedLinkableWidget.data.link)); + editor.fire('saveSnapshot'); + return; + } + + editor.fire('saveSnapshot'); + + if (!linkElement && returnValues.attributes.href) { + var selection = editor.getSelection(); + var range = selection.getRanges(1)[0]; + + if (range.collapsed) { + var text = new CKEDITOR.dom.text(returnValues.attributes.href.replace(/^mailto:/, ''), editor.document); + range.insertNode(text); + range.selectNodeContents(text); + } + + var style = new CKEDITOR.style({ + element: 'a', + attributes: returnValues.attributes + }); + style.type = CKEDITOR.STYLE_INLINE; + style.applyToRange(range); + range.select(); + linkElement = getSelectedLink(editor); + } else if (linkElement) { + Object.keys(returnValues.attributes || {}).forEach(function (attrName) { + if (returnValues.attributes[attrName].length > 0) { + var value = returnValues.attributes[attrName]; + linkElement.data("cke-saved-".concat(attrName), value); + linkElement.setAttribute(attrName, value); + } else { + linkElement.removeAttribute(attrName); + } + }); + } + + editor.fire('saveSnapshot'); + }; + + var dialogSettings = { + title: linkElement ? editor.config.drupalLink_dialogTitleEdit : editor.config.drupalLink_dialogTitleAdd, + dialogClass: 'editor-link-dialog' + }; + Drupal.ckeditor.openDialog(editor, Drupal.url("editor/dialog/link/".concat(editor.config.drupal.format)), existingValues, saveCallback, dialogSettings); + } + }); + editor.addCommand('drupalunlink', { + contextSensitive: 1, + startDisabled: 1, + requiredContent: new CKEDITOR.style({ + element: 'a', + attributes: { + href: '' + } + }), + exec: function exec(editor) { + var style = new CKEDITOR.style({ + element: 'a', + type: CKEDITOR.STYLE_INLINE, + alwaysRemoveElement: 1 + }); + editor.removeStyle(style); + }, + refresh: function refresh(editor, path) { + var element = path.lastElement && path.lastElement.getAscendant('a', true); + + if (element && element.getName() === 'a' && element.getAttribute('href') && element.getChildCount()) { + this.setState(CKEDITOR.TRISTATE_OFF); + } else { + this.setState(CKEDITOR.TRISTATE_DISABLED); + } + } + }); + editor.setKeystroke(CKEDITOR.CTRL + 75, 'drupallink'); + + if (editor.ui.addButton) { + editor.ui.addButton('DrupalLink', { + label: Drupal.t('Link'), + command: 'drupallink' + }); + editor.ui.addButton('DrupalUnlink', { + label: Drupal.t('Unlink'), + command: 'drupalunlink' + }); + } + + editor.on('doubleclick', function (evt) { + var element = getSelectedLink(editor) || evt.data.element; + + if (!element.isReadOnly()) { + if (element.is('a')) { + editor.getSelection().selectElement(element); + editor.getCommand('drupallink').exec(); + } + } + }); + + if (editor.addMenuItems) { + editor.addMenuItems({ + link: { + label: Drupal.t('Edit Link'), + command: 'drupallink', + group: 'link', + order: 1 + }, + unlink: { + label: Drupal.t('Unlink'), + command: 'drupalunlink', + group: 'link', + order: 5 + } + }); + } + + if (editor.contextMenu) { + editor.contextMenu.addListener(function (element, selection) { + if (!element || element.isReadOnly()) { + return null; + } + + var anchor = getSelectedLink(editor); + + if (!anchor) { + return null; + } + + var menu = {}; + + if (anchor.getAttribute('href') && anchor.getChildCount()) { + menu = { + link: CKEDITOR.TRISTATE_OFF, + unlink: CKEDITOR.TRISTATE_OFF + }; + } + + return menu; + }); + } + } + }); + CKEDITOR.plugins.drupallink = { + parseLinkAttributes: parseAttributes, + getLinkAttributes: getAttributes, + registerLinkableWidget: registerLinkableWidget + }; +})(jQuery, Drupal, drupalSettings, CKEDITOR); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/plugins/drupalmedia/plugin.js +++ a/core/modules/ckeditor/js/plugins/drupalmedia/plugin.js @@ -0,0 +1,335 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (jQuery, Drupal, CKEDITOR) { + function getFocusedWidget(editor) { + var widget = editor.widgets.focused; + + if (widget && widget.name === 'drupalmedia') { + return widget; + } + + return null; + } + + function linkCommandIntegrator(editor) { + if (!editor.plugins.drupallink) { + return; + } + + CKEDITOR.plugins.drupallink.registerLinkableWidget('drupalmedia'); + editor.getCommand('drupalunlink').on('exec', function (evt) { + var widget = getFocusedWidget(editor); + + if (!widget) { + return; + } + + widget.setData('link', null); + this.refresh(editor, editor.elementPath()); + evt.cancel(); + }); + editor.getCommand('drupalunlink').on('refresh', function (evt) { + var widget = getFocusedWidget(editor); + + if (!widget) { + return; + } + + this.setState(widget.data.link ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED); + evt.cancel(); + }); + + if (editor.contextMenu) { + editor.contextMenu.addListener(function () { + var widget = getFocusedWidget(editor); + + if (!widget) { + return; + } + + if (widget.data.link) { + return { + link: CKEDITOR.TRISTATE_OFF, + unlink: CKEDITOR.TRISTATE_OFF + }; + } + + return {}; + }); + } + } + + CKEDITOR.plugins.add('drupalmedia', { + requires: 'widget', + beforeInit: function beforeInit(editor) { + var dtd = CKEDITOR.dtd; + dtd['drupal-media'] = { + '#': 1 + }; + Object.keys(dtd).forEach(function (tagName) { + if (dtd[tagName].div) { + dtd[tagName]['drupal-media'] = 1; + } + }); + dtd.a['drupal-media'] = 1; + editor.widgets.add('drupalmedia', { + allowedContent: { + 'drupal-media': { + attributes: { + '!data-entity-type': true, + '!data-entity-uuid': true, + 'data-align': true, + 'data-caption': true, + alt: true, + title: true + }, + classes: {} + } + }, + requiredContent: new CKEDITOR.style({ + element: 'drupal-media', + attributes: { + 'data-entity-type': '', + 'data-entity-uuid': '' + } + }), + pathName: Drupal.t('Embedded media'), + editables: { + caption: { + selector: 'figcaption', + allowedContent: 'a[!href]; em strong cite code br', + pathName: Drupal.t('Caption') + } + }, + getLabel: function getLabel() { + if (this.data.label) { + return this.data.label; + } + + return Drupal.t('Embedded media'); + }, + upcast: function upcast(element, data) { + var attributes = element.attributes; + + if (element.name !== 'drupal-media' || attributes['data-entity-type'] !== 'media' || attributes['data-entity-uuid'] === undefined) { + return; + } + + data.attributes = CKEDITOR.tools.copy(attributes); + data.hasCaption = data.attributes.hasOwnProperty('data-caption'); + + if (data.hasCaption && data.attributes['data-caption'] === '') { + data.attributes['data-caption'] = ' '; + } + + data.label = null; + data.link = null; + + if (element.parent.name === 'a') { + data.link = CKEDITOR.tools.copy(element.parent.attributes); + Object.keys(element.parent.attributes).forEach(function (attrName) { + if (attrName.indexOf('data-cke-') !== -1) { + delete data.link[attrName]; + } + }); + } + + var hostEntityLangcode = document.getElementById(editor.name).getAttribute('data-media-embed-host-entity-langcode'); + + if (hostEntityLangcode) { + data.hostEntityLangcode = hostEntityLangcode; + } + + return element; + }, + destroy: function destroy() { + this._tearDownDynamicEditables(); + }, + data: function data(event) { + var _this = this; + + if (this.oldData) { + if (!this.data.hasCaption && this.oldData.hasCaption) { + delete this.data.attributes['data-caption']; + } else if (this.data.hasCaption && !this.data.attributes['data-caption']) { + this.data.attributes['data-caption'] = ' '; + } + } + + if (this._previewNeedsServerSideUpdate()) { + editor.fire('lockSnapshot'); + + this._tearDownDynamicEditables(); + + this._loadPreview(function (widget) { + widget._setUpDynamicEditables(); + + widget._setUpEditButton(); + + editor.fire('unlockSnapshot'); + }); + } + + if (this.oldData) { + Object.keys(this.oldData.attributes).forEach(function (attrName) { + _this.element.removeAttribute(attrName); + }); + } + + this.element.setAttributes(this.data.attributes); + this.oldData = CKEDITOR.tools.clone(this.data); + }, + downcast: function downcast() { + var downcastElement = new CKEDITOR.htmlParser.element('drupal-media', this.data.attributes); + + if (this.data.link) { + var link = new CKEDITOR.htmlParser.element('a', this.data.link); + link.add(downcastElement); + return link; + } + + return downcastElement; + }, + _setUpDynamicEditables: function _setUpDynamicEditables() { + var _this2 = this; + + if (this.initEditable('caption', this.definition.editables.caption)) { + var captionEditable = this.editables.caption; + captionEditable.setAttribute('data-placeholder', Drupal.t('Enter caption here')); + this.captionObserver = new MutationObserver(function () { + var mediaAttributes = CKEDITOR.tools.clone(_this2.data.attributes); + mediaAttributes['data-caption'] = captionEditable.getData(); + + _this2.setData('attributes', mediaAttributes); + }); + this.captionObserver.observe(captionEditable.$, { + characterData: true, + attributes: true, + childList: true, + subtree: true + }); + + if (captionEditable.$.childNodes.length === 1 && captionEditable.$.childNodes.item(0).nodeName === 'BR') { + captionEditable.$.removeChild(captionEditable.$.childNodes.item(0)); + } + } + }, + _setUpEditButton: function _setUpEditButton() { + if (this.element.findOne('.media-embed-error')) { + return; + } + + var isElementNode = function isElementNode(n) { + return n.type === CKEDITOR.NODE_ELEMENT; + }; + + var embeddedMediaContainer = this.data.hasCaption ? this.element.findOne('figure') : this.element; + var embeddedMedia = embeddedMediaContainer.getFirst(isElementNode); + + if (this.data.link) { + embeddedMedia = embeddedMedia.getFirst(isElementNode); + } + + embeddedMedia.setStyle('position', 'relative'); + var editButton = CKEDITOR.dom.element.createFromHtml(Drupal.theme('mediaEmbedEditButton')); + embeddedMedia.getFirst().insertBeforeMe(editButton); + var widget = this; + this.element.findOne('.media-library-item__edit').on('click', function (event) { + var saveCallback = function saveCallback(values) { + event.cancel(); + editor.fire('saveSnapshot'); + + if (values.hasOwnProperty('attributes')) { + CKEDITOR.tools.extend(values.attributes, widget.data.attributes); + Object.keys(values.attributes).forEach(function (prop) { + if (values.attributes[prop] === false || prop === 'data-align' && values.attributes[prop] === 'none') { + delete values.attributes[prop]; + } + }); + } + + widget.setData({ + attributes: values.attributes, + hasCaption: !!values.hasCaption + }); + editor.fire('saveSnapshot'); + }; + + Drupal.ckeditor.openDialog(editor, Drupal.url("editor/dialog/media/".concat(editor.config.drupal.format)), widget.data, saveCallback, {}); + }); + this.element.findOne('.media-library-item__edit').on('keydown', function (event) { + var returnKey = 13; + var spaceBar = 32; + + if (typeof event.data !== 'undefined') { + var keypress = event.data.getKey(); + + if (keypress === returnKey || keypress === spaceBar) { + event.sender.$.click(); + } + + event.data.$.stopPropagation(); + event.data.$.stopImmediatePropagation(); + } + }); + }, + _tearDownDynamicEditables: function _tearDownDynamicEditables() { + if (this.captionObserver) { + this.captionObserver.disconnect(); + } + }, + _previewNeedsServerSideUpdate: function _previewNeedsServerSideUpdate() { + if (!this.ready) { + return true; + } + + return this._hashData(this.oldData) !== this._hashData(this.data); + }, + _hashData: function _hashData(data) { + var dataToHash = CKEDITOR.tools.clone(data); + delete dataToHash.attributes['data-caption']; + delete dataToHash.label; + + if (dataToHash.link) { + delete dataToHash.link.href; + } + + return JSON.stringify(dataToHash); + }, + _loadPreview: function _loadPreview(callback) { + var _this3 = this; + + jQuery.get({ + url: Drupal.url("media/".concat(editor.config.drupal.format, "/preview")), + data: { + text: this.downcast().getOuterHtml(), + uuid: this.data.attributes['data-entity-uuid'] + }, + dataType: 'html', + headers: { + 'X-Drupal-MediaPreview-CSRF-Token': editor.config.drupalMedia_previewCsrfToken + }, + success: function success(previewHtml, textStatus, jqXhr) { + _this3.element.setHtml(previewHtml); + + _this3.setData('label', jqXhr.getResponseHeader('Drupal-Media-Label')); + + callback(_this3); + }, + error: function error() { + _this3.element.setHtml(Drupal.theme('mediaEmbedPreviewError')); + } + }); + } + }); + }, + afterInit: function afterInit(editor) { + linkCommandIntegrator(editor); + } + }); +})(jQuery, Drupal, CKEDITOR); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/plugins/drupalmedialibrary/plugin.js +++ a/core/modules/ckeditor/js/plugins/drupalmedialibrary/plugin.js @@ -0,0 +1,64 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, CKEDITOR) { + CKEDITOR.plugins.add('drupalmedialibrary', { + requires: 'drupalmedia', + icons: 'drupalmedialibrary', + hidpi: true, + beforeInit: function beforeInit(editor) { + editor.addCommand('drupalmedialibrary', { + allowedContent: { + 'drupal-media': { + attributes: { + '!data-entity-type': true, + '!data-entity-uuid': true, + '!data-view-mode': true, + '!data-align': true, + '!data-caption': true, + '!alt': true, + '!title': true + }, + classes: {} + } + }, + requiredContent: new CKEDITOR.style({ + element: 'drupal-media', + attributes: { + 'data-entity-type': '', + 'data-entity-uuid': '' + } + }), + modes: { + wysiwyg: 1 + }, + canUndo: true, + exec: function exec(editor) { + var saveCallback = function saveCallback(values) { + editor.fire('saveSnapshot'); + var mediaElement = editor.document.createElement('drupal-media'); + var attributes = values.attributes; + Object.keys(attributes).forEach(function (key) { + mediaElement.setAttribute(key, attributes[key]); + }); + editor.insertHtml(mediaElement.getOuterHtml()); + editor.fire('saveSnapshot'); + }; + + Drupal.ckeditor.openDialog(editor, editor.config.DrupalMediaLibrary_url, {}, saveCallback, editor.config.DrupalMediaLibrary_dialogOptions); + } + }); + + if (editor.ui.addButton) { + editor.ui.addButton('DrupalMediaLibrary', { + label: Drupal.t('Insert from Media Library'), + command: 'drupalmedialibrary' + }); + } + } + }); +})(Drupal, CKEDITOR); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/views/ControllerView.js +++ a/core/modules/ckeditor/js/views/ControllerView.js @@ -0,0 +1,228 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, Backbone, CKEDITOR, _) { + Drupal.ckeditor.ControllerView = Backbone.View.extend({ + events: {}, + initialize: function initialize() { + this.getCKEditorFeatures(this.model.get('hiddenEditorConfig'), this.disableFeaturesDisallowedByFilters.bind(this)); + this.model.listenTo(this.model, 'change:activeEditorConfig', this.model.sync); + this.listenTo(this.model, 'change:isDirty', this.parseEditorDOM); + }, + parseEditorDOM: function parseEditorDOM(model, isDirty, options) { + if (isDirty) { + var currentConfig = this.model.get('activeEditorConfig'); + var rows = []; + this.$el.find('.ckeditor-active-toolbar-configuration').children('.ckeditor-row').each(function () { + var groups = []; + $(this).find('.ckeditor-toolbar-group').each(function () { + var $group = $(this); + var $buttons = $group.find('.ckeditor-button'); + + if ($buttons.length) { + var group = { + name: $group.attr('data-drupal-ckeditor-toolbar-group-name'), + items: [] + }; + $group.find('.ckeditor-button, .ckeditor-multiple-button').each(function () { + group.items.push($(this).attr('data-drupal-ckeditor-button-name')); + }); + groups.push(group); + } + }); + + if (groups.length) { + rows.push(groups); + } + }); + this.model.set('activeEditorConfig', rows); + this.model.set('isDirty', false); + + if (options.broadcast !== false) { + var prev = this.getButtonList(currentConfig); + var next = this.getButtonList(rows); + + if (prev.length !== next.length) { + this.$el.find('.ckeditor-toolbar-active').trigger('CKEditorToolbarChanged', [prev.length < next.length ? 'added' : 'removed', _.difference(_.union(prev, next), _.intersection(prev, next))[0]]); + } + } + } + }, + getCKEditorFeatures: function getCKEditorFeatures(CKEditorConfig, callback) { + var getProperties = function getProperties(CKEPropertiesList) { + return _.isObject(CKEPropertiesList) ? _.keys(CKEPropertiesList) : []; + }; + + var convertCKERulesToEditorFeature = function convertCKERulesToEditorFeature(feature, CKEFeatureRules) { + for (var i = 0; i < CKEFeatureRules.length; i++) { + var CKERule = CKEFeatureRules[i]; + var rule = new Drupal.EditorFeatureHTMLRule(); + var tags = getProperties(CKERule.elements); + rule.required.tags = CKERule.propertiesOnly ? [] : tags; + rule.allowed.tags = tags; + rule.required.attributes = getProperties(CKERule.requiredAttributes); + rule.allowed.attributes = getProperties(CKERule.attributes); + rule.required.styles = getProperties(CKERule.requiredStyles); + rule.allowed.styles = getProperties(CKERule.styles); + rule.required.classes = getProperties(CKERule.requiredClasses); + rule.allowed.classes = getProperties(CKERule.classes); + rule.raw = CKERule; + feature.addHTMLRule(rule); + } + }; + + var hiddenCKEditorID = 'ckeditor-hidden'; + + if (CKEDITOR.instances[hiddenCKEditorID]) { + CKEDITOR.instances[hiddenCKEditorID].destroy(true); + } + + var hiddenEditorConfig = this.model.get('hiddenEditorConfig'); + + if (hiddenEditorConfig.drupalExternalPlugins) { + var externalPlugins = hiddenEditorConfig.drupalExternalPlugins; + Object.keys(externalPlugins || {}).forEach(function (pluginName) { + CKEDITOR.plugins.addExternal(pluginName, externalPlugins[pluginName], ''); + }); + } + + CKEDITOR.inline($("#".concat(hiddenCKEditorID)).get(0), CKEditorConfig); + CKEDITOR.once('instanceReady', function (e) { + if (e.editor.name === hiddenCKEditorID) { + var CKEFeatureRulesMap = {}; + var rules = e.editor.filter.allowedContent; + var rule; + var name; + + for (var i = 0; i < rules.length; i++) { + rule = rules[i]; + name = rule.featureName || ':('; + + if (!CKEFeatureRulesMap[name]) { + CKEFeatureRulesMap[name] = []; + } + + CKEFeatureRulesMap[name].push(rule); + } + + var features = {}; + var buttonsToFeatures = {}; + Object.keys(CKEFeatureRulesMap).forEach(function (featureName) { + var feature = new Drupal.EditorFeature(featureName); + convertCKERulesToEditorFeature(feature, CKEFeatureRulesMap[featureName]); + features[featureName] = feature; + var command = e.editor.getCommand(featureName); + + if (command) { + buttonsToFeatures[command.uiItems[0].name] = featureName; + } + }); + callback(features, buttonsToFeatures); + } + }); + }, + getFeatureForButton: function getFeatureForButton(button) { + if (button === '-') { + return false; + } + + var featureName = this.model.get('buttonsToFeatures')[button.toLowerCase()]; + + if (!featureName) { + featureName = button.toLowerCase(); + } + + var featuresMetadata = this.model.get('featuresMetadata'); + + if (!featuresMetadata[featureName]) { + featuresMetadata[featureName] = new Drupal.EditorFeature(featureName); + this.model.set('featuresMetadata', featuresMetadata); + } + + return featuresMetadata[featureName]; + }, + disableFeaturesDisallowedByFilters: function disableFeaturesDisallowedByFilters(features, buttonsToFeatures) { + this.model.set('featuresMetadata', features); + this.model.set('buttonsToFeatures', buttonsToFeatures); + this.broadcastConfigurationChanges(this.$el); + var existingButtons = []; + + var buttonGroups = _.flatten(this.model.get('activeEditorConfig')); + + for (var i = 0; i < buttonGroups.length; i++) { + var buttons = buttonGroups[i].items; + + for (var k = 0; k < buttons.length; k++) { + existingButtons.push(buttons[k]); + } + } + + existingButtons = _.unique(existingButtons); + + for (var n = 0; n < existingButtons.length; n++) { + var button = existingButtons[n]; + var feature = this.getFeatureForButton(button); + + if (feature === false) { + continue; + } + + if (Drupal.editorConfiguration.featureIsAllowedByFilters(feature)) { + this.$el.find('.ckeditor-toolbar-active').trigger('CKEditorToolbarChanged', ['added', existingButtons[n]]); + } else { + $(".ckeditor-toolbar-active li[data-drupal-ckeditor-button-name=\"".concat(button, "\"]")).detach().appendTo('.ckeditor-toolbar-disabled > .ckeditor-toolbar-available > ul'); + this.model.set({ + isDirty: true + }, { + broadcast: false + }); + } + } + }, + broadcastConfigurationChanges: function broadcastConfigurationChanges($ckeditorToolbar) { + var view = this; + var hiddenEditorConfig = this.model.get('hiddenEditorConfig'); + var getFeatureForButton = this.getFeatureForButton.bind(this); + var getCKEditorFeatures = this.getCKEditorFeatures.bind(this); + $ckeditorToolbar.find('.ckeditor-toolbar-active').on('CKEditorToolbarChanged.ckeditorAdmin', function (event, action, button) { + var feature = getFeatureForButton(button); + + if (feature === false) { + return; + } + + var configEvent = action === 'added' ? 'addedFeature' : 'removedFeature'; + Drupal.editorConfiguration[configEvent](feature); + }).on('CKEditorPluginSettingsChanged.ckeditorAdmin', function (event, settingsChanges) { + Object.keys(settingsChanges || {}).forEach(function (key) { + hiddenEditorConfig[key] = settingsChanges[key]; + }); + getCKEditorFeatures(hiddenEditorConfig, function (features) { + var featuresMetadata = view.model.get('featuresMetadata'); + Object.keys(features || {}).forEach(function (name) { + var feature = features[name]; + + if (featuresMetadata.hasOwnProperty(name) && !_.isEqual(featuresMetadata[name], feature)) { + Drupal.editorConfiguration.modifiedFeature(feature); + } + }); + view.model.set('featuresMetadata', features); + }); + }); + }, + getButtonList: function getButtonList(config) { + var buttons = []; + config = _.flatten(config); + config.forEach(function (group) { + group.items.forEach(function (button) { + buttons.push(button); + }); + }); + return _.without(buttons, '-'); + } + }); +})(jQuery, Drupal, Backbone, CKEDITOR, _); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/views/KeyboardView.js +++ a/core/modules/ckeditor/js/views/KeyboardView.js @@ -0,0 +1,148 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, Backbone, _) { + Drupal.ckeditor.KeyboardView = Backbone.View.extend({ + initialize: function initialize() { + this.$el.on('keydown.ckeditor', '.ckeditor-buttons a, .ckeditor-multiple-buttons a', this.onPressButton.bind(this)); + this.$el.on('keydown.ckeditor', '[data-drupal-ckeditor-type="group"]', this.onPressGroup.bind(this)); + }, + render: function render() {}, + onPressButton: function onPressButton(event) { + var upDownKeys = [38, 63232, 40, 63233]; + var leftRightKeys = [37, 63234, 39, 63235]; + + if (event.keyCode === 13) { + event.stopPropagation(); + } + + if (_.indexOf(_.union(upDownKeys, leftRightKeys), event.keyCode) > -1) { + var view = this; + var $target = $(event.currentTarget); + var $button = $target.parent(); + var $container = $button.parent(); + var $group = $button.closest('.ckeditor-toolbar-group'); + var $row; + var containerType = $container.data('drupal-ckeditor-button-sorting'); + var $availableButtons = this.$el.find('[data-drupal-ckeditor-button-sorting="source"]'); + var $activeButtons = this.$el.find('.ckeditor-toolbar-active'); + var $originalGroup = $group; + var dir; + + if (containerType === 'source') { + if (_.indexOf([40, 63233], event.keyCode) > -1) { + $activeButtons.find('.ckeditor-toolbar-group-buttons').eq(0).prepend($button); + } + } else if (containerType === 'target') { + if (_.indexOf(leftRightKeys, event.keyCode) > -1) { + var $siblings = $container.children(); + var index = $siblings.index($button); + + if (_.indexOf([37, 63234], event.keyCode) > -1) { + if (index > 0) { + $button.insertBefore($container.children().eq(index - 1)); + } else { + $group = $container.parent().prev(); + + if ($group.length > 0) { + $group.find('.ckeditor-toolbar-group-buttons').append($button); + } else { + $container.closest('.ckeditor-row').prev().find('.ckeditor-toolbar-group').not('.placeholder').find('.ckeditor-toolbar-group-buttons').eq(-1).append($button); + } + } + } else if (_.indexOf([39, 63235], event.keyCode) > -1) { + if (index < $siblings.length - 1) { + $button.insertAfter($container.children().eq(index + 1)); + } else { + $container.parent().next().find('.ckeditor-toolbar-group-buttons').prepend($button); + } + } + } else if (_.indexOf(upDownKeys, event.keyCode) > -1) { + dir = _.indexOf([38, 63232], event.keyCode) > -1 ? 'prev' : 'next'; + $row = $container.closest('.ckeditor-row')[dir](); + + if (dir === 'prev' && $row.length === 0) { + if ($button.data('drupal-ckeditor-type') === 'separator') { + $button.off().remove(); + $activeButtons.find('.ckeditor-toolbar-group-buttons').eq(0).children().eq(0).children().trigger('focus'); + } else { + $availableButtons.prepend($button); + } + } else { + $row.find('.ckeditor-toolbar-group-buttons').eq(0).prepend($button); + } + } + } else if (containerType === 'dividers') { + if (_.indexOf([40, 63233], event.keyCode) > -1) { + $button = $button.clone(true); + $activeButtons.find('.ckeditor-toolbar-group-buttons').eq(0).prepend($button); + $target = $button.children(); + } + } + + view = this; + Drupal.ckeditor.registerButtonMove(this, $button, function (result) { + if (!result && $originalGroup) { + $originalGroup.find('.ckeditor-buttons').append($button); + } + + $target.trigger('focus'); + }); + event.preventDefault(); + event.stopPropagation(); + } + }, + onPressGroup: function onPressGroup(event) { + var upDownKeys = [38, 63232, 40, 63233]; + var leftRightKeys = [37, 63234, 39, 63235]; + + if (event.keyCode === 13) { + var view = this; + window.setTimeout(function () { + Drupal.ckeditor.openGroupNameDialog(view, $(event.currentTarget)); + }, 0); + event.preventDefault(); + event.stopPropagation(); + } + + if (_.indexOf(_.union(upDownKeys, leftRightKeys), event.keyCode) > -1) { + var $group = $(event.currentTarget); + var $container = $group.parent(); + var $siblings = $container.children(); + var index; + var dir; + + if (_.indexOf(leftRightKeys, event.keyCode) > -1) { + index = $siblings.index($group); + + if (_.indexOf([37, 63234], event.keyCode) > -1) { + if (index > 0) { + $group.insertBefore($siblings.eq(index - 1)); + } else { + var $rowChildElement = $container.closest('.ckeditor-row').prev().find('.ckeditor-toolbar-groups').children().eq(-1); + $group.insertBefore($rowChildElement); + } + } else if (_.indexOf([39, 63235], event.keyCode) > -1) { + if (!$siblings.eq(index + 1).hasClass('placeholder')) { + $group.insertAfter($container.children().eq(index + 1)); + } else { + $container.closest('.ckeditor-row').next().find('.ckeditor-toolbar-groups').prepend($group); + } + } + } else if (_.indexOf(upDownKeys, event.keyCode) > -1) { + dir = _.indexOf([38, 63232], event.keyCode) > -1 ? 'prev' : 'next'; + $group.closest('.ckeditor-row')[dir]().find('.ckeditor-toolbar-groups').eq(0).prepend($group); + } + + Drupal.ckeditor.registerGroupMove(this, $group); + $group.trigger('focus'); + event.preventDefault(); + event.stopPropagation(); + } + } + }); +})(jQuery, Drupal, Backbone, _); \ No newline at end of file reverted: --- b/core/modules/ckeditor/js/views/VisualView.js +++ a/core/modules/ckeditor/js/views/VisualView.js @@ -0,0 +1,141 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, Backbone, $, Sortable) { + Drupal.ckeditor.VisualView = Backbone.View.extend({ + events: { + 'click .ckeditor-toolbar-group-name': 'onGroupNameClick', + 'click .ckeditor-groupnames-toggle': 'onGroupNamesToggleClick', + 'click .ckeditor-add-new-group button': 'onAddGroupButtonClick' + }, + initialize: function initialize() { + this.listenTo(this.model, 'change:isDirty change:groupNamesVisible', this.render); + $(Drupal.theme('ckeditorButtonGroupNamesToggle')).prependTo(this.$el.find('#ckeditor-active-toolbar').parent()); + this.render(); + }, + render: function render(model, value, changedAttributes) { + this.insertPlaceholders(); + this.applySorting(); + var groupNamesVisible = this.model.get('groupNamesVisible'); + + if (changedAttributes && changedAttributes.changes && changedAttributes.changes.isDirty) { + this.model.set({ + groupNamesVisible: true + }, { + silent: true + }); + groupNamesVisible = true; + } + + this.$el.find('[data-toolbar="active"]').toggleClass('ckeditor-group-names-are-visible', groupNamesVisible); + var $toggle = this.$el.find('.ckeditor-groupnames-toggle'); + $toggle.each(function (index, element) { + element.textContent = groupNamesVisible ? Drupal.t('Hide group names') : Drupal.t('Show group names'); + }).attr('aria-pressed', groupNamesVisible); + return this; + }, + onGroupNameClick: function onGroupNameClick(event) { + var $group = $(event.currentTarget).closest('.ckeditor-toolbar-group'); + Drupal.ckeditor.openGroupNameDialog(this, $group); + event.stopPropagation(); + event.preventDefault(); + }, + onGroupNamesToggleClick: function onGroupNamesToggleClick(event) { + this.model.set('groupNamesVisible', !this.model.get('groupNamesVisible')); + event.preventDefault(); + }, + onAddGroupButtonClick: function onAddGroupButtonClick(event) { + function insertNewGroup(success, $group) { + if (success) { + $group.appendTo($(event.currentTarget).closest('.ckeditor-row').children('.ckeditor-toolbar-groups')); + $group.trigger('focus'); + } + } + + Drupal.ckeditor.openGroupNameDialog(this, $(Drupal.theme('ckeditorToolbarGroup')), insertNewGroup); + event.preventDefault(); + }, + endGroupDrag: function endGroupDrag(event) { + var $item = $(event.item); + Drupal.ckeditor.registerGroupMove(this, $item); + }, + startButtonDrag: function startButtonDrag(event) { + this.$el.find('a:focus').trigger('blur'); + this.model.set('groupNamesVisible', true); + }, + endButtonDrag: function endButtonDrag(event) { + var $item = $(event.item); + Drupal.ckeditor.registerButtonMove(this, $item, function (success) { + $item.find('a').trigger('focus'); + }); + }, + applySorting: function applySorting() { + var _this = this; + + Array.prototype.forEach.call(this.el.querySelectorAll('.ckeditor-buttons:not(.js-sortable)'), function (buttons) { + buttons.classList.add('js-sortable'); + Sortable.create(buttons, { + ghostClass: 'ckeditor-button-placeholder', + group: 'ckeditor-buttons', + onStart: _this.startButtonDrag.bind(_this), + onEnd: _this.endButtonDrag.bind(_this) + }); + }); + Array.prototype.forEach.call(this.el.querySelectorAll('.ckeditor-toolbar-groups:not(.js-sortable)'), function (buttons) { + buttons.classList.add('js-sortable'); + Sortable.create(buttons, { + ghostClass: 'ckeditor-toolbar-group-placeholder', + onEnd: _this.endGroupDrag.bind(_this) + }); + }); + Array.prototype.forEach.call(this.el.querySelectorAll('.ckeditor-multiple-buttons:not(.js-sortable)'), function (buttons) { + buttons.classList.add('js-sortable'); + Sortable.create(buttons, { + group: { + name: 'ckeditor-buttons', + pull: 'clone' + }, + onEnd: _this.endButtonDrag.bind(_this) + }); + }); + }, + insertPlaceholders: function insertPlaceholders() { + this.insertPlaceholderRow(); + this.insertNewGroupButtons(); + }, + insertPlaceholderRow: function insertPlaceholderRow() { + var $rows = this.$el.find('.ckeditor-row'); + + if (!$rows.eq(-1).hasClass('placeholder')) { + this.$el.find('.ckeditor-toolbar-active').children('.ckeditor-active-toolbar-configuration').append(Drupal.theme('ckeditorRow')); + } + + $rows = this.$el.find('.ckeditor-row'); + var len = $rows.length; + $rows.filter(function (index, row) { + if (index + 1 === len) { + return false; + } + + return $(row).find('.ckeditor-toolbar-group').not('.placeholder').length === 0; + }).remove(); + }, + insertNewGroupButtons: function insertNewGroupButtons() { + this.$el.find('.ckeditor-row').each(function () { + var $row = $(this); + var $groups = $row.find('.ckeditor-toolbar-group'); + var $button = $row.find('.ckeditor-add-new-group'); + + if ($button.length === 0) { + $row.children('.ckeditor-toolbar-groups').append(Drupal.theme('ckeditorNewButtonGroup')); + } else if (!$groups.eq(-1).hasClass('ckeditor-add-new-group')) { + $button.appendTo($row.children('.ckeditor-toolbar-groups')); + } + }); + } + }); +})(Drupal, Backbone, jQuery, Sortable); \ No newline at end of file reverted: --- b/core/modules/ckeditor5/js/ckeditor5.admin.js +++ a/core/modules/ckeditor5/js/ckeditor5.admin.js @@ -0,0 +1,614 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } + +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +(function (Drupal, drupalSettings, $, JSON, once, Sortable, _ref) { + var tabbable = _ref.tabbable; + var toolbarHelp = [{ + message: Drupal.t("The toolbar buttons that don't fit the user's browser window width will be grouped in a dropdown. If multiple toolbar rows are preferred, those can be configured by adding an explicit wrapping breakpoint wherever you want to start a new row.", null, { + context: 'CKEditor 5 toolbar help text, default, no explicit wrapping breakpoint' + }), + button: 'wrapping', + condition: false + }, { + message: Drupal.t('You have configured a multi-row toolbar by using an explicit wrapping breakpoint. This may not work well in narrow browser windows. To use automatic grouping, remove any of these divider buttons.', null, { + context: 'CKEditor 5 toolbar help text, with explicit wrapping breakpoint' + }), + button: 'wrapping', + condition: true + }]; + + var Observable = function () { + function Observable(value) { + _classCallCheck(this, Observable); + + this._listeners = []; + this._value = value; + } + + _createClass(Observable, [{ + key: "notify", + value: function notify() { + var _this = this; + + this._listeners.forEach(function (listener) { + return listener(_this._value); + }); + } + }, { + key: "subscribe", + value: function subscribe(listener) { + this._listeners.push(listener); + } + }, { + key: "value", + get: function get() { + return this._value; + }, + set: function set(val) { + if (val !== this._value) { + this._value = val; + this.notify(); + } + } + }]); + + return Observable; + }(); + + var getSelectedButtons = function getSelectedButtons(selected, dividers, available) { + return selected.map(function (id) { + return _objectSpread({}, [].concat(_toConsumableArray(dividers), _toConsumableArray(available)).find(function (button) { + return button.id === id; + })); + }); + }; + + var updateSelectedButtons = function updateSelectedButtons(selection, textarea) { + var newValue = JSON.stringify(selection); + var priorValue = textarea.innerHTML; + textarea.value = newValue; + textarea.innerHTML = newValue; + textarea.dispatchEvent(new CustomEvent('change', { + detail: { + priorValue: priorValue + } + })); + }; + + var addToSelectedButtons = function addToSelectedButtons(selection, element, announceChange) { + var list = _toConsumableArray(selection.value); + + list.push(element.dataset.id); + selection.value = list; + + if (announceChange) { + setTimeout(function () { + announceChange(element.dataset.label); + }); + } + }; + + var removeFromSelectedButtons = function removeFromSelectedButtons(selection, element, announceChange) { + var list = _toConsumableArray(selection.value); + + var index = Array.from(element.parentElement.children).findIndex(function (child) { + return child === element; + }); + list.splice(index, 1); + selection.value = list; + + if (announceChange) { + setTimeout(function () { + announceChange(element.dataset.label); + }); + } + }; + + var moveWithinSelectedButtons = function moveWithinSelectedButtons(selection, element, dir) { + var list = _toConsumableArray(selection.value); + + var index = Array.from(element.parentElement.children).findIndex(function (child) { + return child === element; + }); + var condition = dir < 0 ? index > 0 : index < list.length - 1; + + if (condition) { + list.splice(index + dir, 0, list.splice(index, 1)[0]); + selection.value = list; + } + }; + + var copyToActiveButtons = function copyToActiveButtons(selection, element, announceChange) { + var list = _toConsumableArray(selection.value); + + list.push(element.dataset.id); + selection.value = list; + setTimeout(function () { + if (announceChange) { + announceChange(element.dataset.label); + } + }); + }; + + var render = function render(root, selectedButtons, availableButtons, dividerButtons) { + var toolbarHelpText = toolbarHelp.filter(function (helpItem) { + return selectedButtons.value.includes(helpItem.button) === helpItem.condition; + }).map(function (helpItem) { + return helpItem.message; + }); + var existingToolbarHelpText = document.querySelector('[data-drupal-selector="ckeditor5-admin-help-message"]'); + + if (existingToolbarHelpText && toolbarHelpText.join('').trim() !== existingToolbarHelpText.textContent.trim()) { + Drupal.announce(toolbarHelpText.join(' ')); + } + + root.innerHTML = Drupal.theme.ckeditor5Admin({ + availableButtons: Drupal.theme.ckeditor5AvailableButtons({ + buttons: availableButtons.filter(function (button) { + return !selectedButtons.value.includes(button.id); + }) + }), + dividerButtons: Drupal.theme.ckeditor5DividerButtons({ + buttons: dividerButtons + }), + activeToolbar: Drupal.theme.ckeditor5SelectedButtons({ + buttons: getSelectedButtons(selectedButtons.value, dividerButtons, availableButtons) + }), + helpMessage: toolbarHelpText + }); + new Sortable(root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"]'), { + group: { + name: 'toolbar', + put: ['divider', 'available'] + }, + sort: true, + store: { + set: function set(sortable) { + selectedButtons.value = sortable.toArray(); + } + } + }); + var toolbarAvailableButtons = new Sortable(root.querySelector('[data-button-list="ckeditor5-toolbar-available-buttons"]'), { + group: { + name: 'available', + put: ['toolbar'] + }, + sort: false, + onAdd: function onAdd(event) { + if (dividerButtons.find(function (dividerButton) { + return dividerButton.id === event.item.dataset.id; + })) { + var newIndex = event.newIndex; + setTimeout(function () { + document.querySelectorAll('.ckeditor5-toolbar-available__buttons li')[newIndex].remove(); + }); + } + } + }); + new Sortable(root.querySelector('[data-button-list="ckeditor5-toolbar-divider-buttons"]'), { + group: { + name: 'divider', + put: false, + pull: 'clone', + sort: 'false' + } + }); + root.querySelectorAll('[data-drupal-selector="ckeditor5-toolbar-button"]').forEach(function (element) { + var expandButton = function expandButton(event) { + event.currentTarget.querySelectorAll('.ckeditor5-toolbar-button').forEach(function (buttonElement) { + buttonElement.setAttribute('data-expanded', true); + }); + }; + + var retractButton = function retractButton(event) { + event.currentTarget.querySelectorAll('.ckeditor5-toolbar-button').forEach(function (buttonElement) { + buttonElement.setAttribute('data-expanded', false); + }); + }; + + element.addEventListener('mouseenter', expandButton); + element.addEventListener('focus', expandButton); + element.addEventListener('mouseleave', retractButton); + element.addEventListener('blur', retractButton); + element.addEventListener('keyup', function (event) { + var supportedKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']; + var dir = document.documentElement.dir; + + if (supportedKeys.includes(event.key)) { + if (event.currentTarget.dataset.divider.toLowerCase() === 'true') { + switch (event.key) { + case 'ArrowDown': + { + var announceChange = function announceChange(name) { + Drupal.announce(Drupal.t('Button @name has been copied to the active toolbar.', { + '@name': name + })); + }; + + copyToActiveButtons(selectedButtons, event.currentTarget, announceChange); + root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus(); + break; + } + } + } else if (selectedButtons.value.includes(event.currentTarget.dataset.id)) { + var index = Array.from(element.parentElement.children).findIndex(function (child) { + return child === element; + }); + + switch (event.key) { + case 'ArrowLeft': + { + var leftOffset = dir === 'ltr' ? -1 : 1; + moveWithinSelectedButtons(selectedButtons, event.currentTarget, leftOffset); + root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + leftOffset].focus(); + break; + } + + case 'ArrowRight': + { + var rightOffset = dir === 'ltr' ? 1 : -1; + moveWithinSelectedButtons(selectedButtons, event.currentTarget, rightOffset); + root.querySelectorAll('[data-button-list="ckeditor5-toolbar-active-buttons"] li')[index + rightOffset].focus(); + break; + } + + case 'ArrowUp': + { + var _announceChange = function _announceChange(name) { + Drupal.announce(Drupal.t('Button @name has been removed from the active toolbar.', { + '@name': name + })); + }; + + removeFromSelectedButtons(selectedButtons, event.currentTarget, _announceChange); + + if (!dividerButtons.find(function (dividerButton) { + return event.currentTarget.dataset.id === dividerButton.id; + })) { + root.querySelector("[data-button-list=\"ckeditor5-toolbar-available-buttons\"] [data-id=\"".concat(event.currentTarget.dataset.id, "\"]")).focus(); + } + + break; + } + } + } else if (toolbarAvailableButtons.toArray().includes(event.currentTarget.dataset.id)) { + switch (event.key) { + case 'ArrowDown': + { + var _announceChange2 = function _announceChange2(name) { + Drupal.announce(Drupal.t('Button @name has been moved to the active toolbar.', { + '@name': name + })); + }; + + addToSelectedButtons(selectedButtons, event.currentTarget, _announceChange2); + root.querySelector('[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child').focus(); + break; + } + } + } + } + }); + }); + }; + + Drupal.behaviors.ckeditor5Admin = { + attach: function attach(context) { + once('ckeditor5-admin-toolbar', '#ckeditor5-toolbar-app').forEach(function (container) { + var selectedTextarea = context.querySelector('#ckeditor5-toolbar-buttons-selected'); + var available = Object.entries(JSON.parse(context.querySelector('#ckeditor5-toolbar-buttons-available').innerHTML)).map(function (_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + name = _ref3[0], + attrs = _ref3[1]; + + return _objectSpread({ + name: name, + id: name + }, attrs); + }); + var dividers = [{ + id: 'divider', + name: '|', + label: Drupal.t('Divider') + }, { + id: 'wrapping', + name: '-', + label: Drupal.t('Wrapping') + }]; + var selected = new Observable(JSON.parse(selectedTextarea.innerHTML).map(function (name) { + return [].concat(dividers, _toConsumableArray(available)).find(function (button) { + return button.name === name; + }).id; + })); + + var mapSelection = function mapSelection(selection) { + return selection.map(function (id) { + return [].concat(dividers, _toConsumableArray(available)).find(function (button) { + return button.id === id; + }).name; + }); + }; + + selected.subscribe(function (selection) { + updateSelectedButtons(mapSelection(selection), selectedTextarea); + render(container, selected, available, dividers); + }); + [context.querySelector('#ckeditor5-toolbar-buttons-available'), context.querySelector('[class*="editor-settings-toolbar-items"]')].filter(function (el) { + return el; + }).forEach(function (el) { + el.classList.add('visually-hidden'); + }); + render(container, selected, available, dividers); + }); + once('safari-focus-fix', '.ckeditor5-toolbar-item').forEach(function (item) { + item.addEventListener('keydown', function (e) { + var keyCodeDirections = { + 9: 'tab', + 37: 'left', + 38: 'up', + 39: 'right', + 40: 'down' + }; + + if (['tab', 'left', 'up', 'right', 'down'].includes(keyCodeDirections[e.keyCode])) { + var hideTip = false; + var isActive = e.target.closest('[data-button-list="ckeditor5-toolbar-active__buttons"]'); + + if (isActive) { + if (['tab', 'left', 'up', 'right'].includes(keyCodeDirections[e.keyCode])) { + hideTip = true; + } + } else if (['tab', 'down'].includes(keyCodeDirections[e.keyCode])) { + hideTip = true; + } + + if (hideTip) { + e.target.querySelector('[data-expanded]').setAttribute('data-expanded', 'false'); + } + } + }); + }); + + var updateUiStateStorage = function updateUiStateStorage(states) { + var form = document.querySelector('#filter-format-edit-form, #filter-format-add-form'); + var currentStates = form.hasAttribute('data-drupal-ui-state') ? JSON.parse(form.getAttribute('data-drupal-ui-state')) : {}; + form.setAttribute('data-drupal-ui-state', JSON.stringify(_objectSpread(_objectSpread({}, currentStates), states))); + }; + + var getUiStateStorage = function getUiStateStorage(property) { + var form = document.querySelector('#filter-format-edit-form, #filter-format-add-form'); + + if (form === null) { + return; + } + + return form.hasAttribute('data-drupal-ui-state') ? JSON.parse(form.getAttribute('data-drupal-ui-state'))[property] : null; + }; + + once('ui-state-storage', '#filter-format-edit-form, #filter-format-add-form').forEach(function (form) { + form.setAttribute('data-drupal-ui-state', JSON.stringify({})); + }); + + var maintainActiveVerticalTab = function maintainActiveVerticalTab(verticalTabs) { + var id = verticalTabs.id; + var activeTab = getUiStateStorage("".concat(id, "-active-tab")); + + if (activeTab) { + setTimeout(function () { + var activeTabLink = document.querySelector(activeTab); + activeTabLink.click(); + + if (id !== 'plugin-settings-wrapper') { + return; + } + + if (document.activeElement !== document.body) { + return; + } + + var targetTabPane = document.querySelector(activeTabLink.getAttribute('href')); + + if (targetTabPane) { + var tabbableElements = tabbable(targetTabPane); + + if (tabbableElements.length) { + tabbableElements[0].focus(); + } + } + }); + } + + verticalTabs.querySelectorAll('.vertical-tabs__menu').forEach(function (tab) { + tab.addEventListener('click', function (e) { + var state = {}; + var href = e.target.closest('[href]').getAttribute('href').split('--')[0]; + state["".concat(id, "-active-tab")] = "#".concat(id, " [href^='").concat(href, "']"); + updateUiStateStorage(state); + }); + }); + }; + + once('maintainActiveVerticalTab', '#plugin-settings-wrapper, #filter-settings-wrapper').forEach(maintainActiveVerticalTab); + var selectedButtons = document.querySelector('#ckeditor5-toolbar-buttons-selected'); + once('textarea-listener', selectedButtons).forEach(function (textarea) { + textarea.addEventListener('change', function (e) { + var buttonName = document.activeElement.getAttribute('data-id'); + + if (!buttonName) { + return; + } + + var focusSelector = ''; + + if (['divider', 'wrapping'].includes(buttonName)) { + var oldConfig = JSON.parse(e.detail.priorValue); + var newConfig = JSON.parse(e.target.innerHTML); + + if (oldConfig.length > newConfig.length) { + for (var item = 0; item < newConfig.length; item++) { + if (newConfig[item] !== oldConfig[item]) { + focusSelector = "[data-button-list=\"ckeditor5-toolbar-active-buttons\"] li:nth-child(".concat(Math.min(item - 1, 0), ")"); + break; + } + } + } else if (oldConfig.length < newConfig.length) { + focusSelector = '[data-button-list="ckeditor5-toolbar-active-buttons"] li:last-child'; + } else { + document.querySelectorAll("[data-button-list=\"ckeditor5-toolbar-active-buttons\"] [data-id='".concat(buttonName, "']")).forEach(function (divider, index) { + if (divider === document.activeElement) { + focusSelector = "".concat(buttonName, "|").concat(index); + } + }); + } + } else { + focusSelector = "[data-id='".concat(buttonName, "']"); + } + + updateUiStateStorage({ + focusSelector: focusSelector + }); + }); + textarea.addEventListener('focus', function () { + var focusSelector = getUiStateStorage('focusSelector'); + + if (focusSelector) { + if (focusSelector.includes('|')) { + var _focusSelector$split = focusSelector.split('|'), + _focusSelector$split2 = _slicedToArray(_focusSelector$split, 2), + buttonName = _focusSelector$split2[0], + count = _focusSelector$split2[1]; + + document.querySelectorAll("[data-button-list=\"ckeditor5-toolbar-active-buttons\"] [data-id='".concat(buttonName, "']")).forEach(function (item, index) { + if (index === parseInt(count, 10)) { + item.focus(); + } + }); + } else { + var toFocus = document.querySelector(focusSelector); + + if (toFocus) { + toFocus.focus(); + } + } + } + }); + }); + } + }; + + Drupal.theme.ckeditor5SelectedButtons = function (_ref4) { + var buttons = _ref4.buttons; + return "\n \n "); + }; + + Drupal.theme.ckeditor5DividerButtons = function (_ref5) { + var buttons = _ref5.buttons; + return "\n \n "); + }; + + Drupal.theme.ckeditor5AvailableButtons = function (_ref6) { + var buttons = _ref6.buttons; + return "\n \n "); + }; + + Drupal.theme.ckeditor5Button = function (_ref7) { + var _ref7$button = _ref7.button, + label = _ref7$button.label, + id = _ref7$button.id, + listType = _ref7.listType; + var buttonInstructions = { + divider: Drupal.t('Press the down arrow key to use this divider in the active button list'), + available: Drupal.t('Press the down arrow key to activate'), + active: Drupal.t('Press the up arrow key to deactivate. Use the right and left arrow keys to move position') + }; + var visuallyHiddenLabel = Drupal.t("@listType button @label", { + '@listType': listType !== 'divider' ? listType : 'available', + '@label': label + }); + return "\n
  • \n \n ").concat(visuallyHiddenLabel, ". ").concat(buttonInstructions[listType], "\n \n ").concat(label, " \n
  • \n "); + }; + + Drupal.theme.ckeditor5Admin = function (_ref8) { + var availableButtons = _ref8.availableButtons, + dividerButtons = _ref8.dividerButtons, + activeToolbar = _ref8.activeToolbar, + helpMessage = _ref8.helpMessage; + return "\n
    \n

    ".concat(helpMessage.join('

    '), "

    \n
    \n
    \n
    \n \n ").concat(availableButtons, "\n
    \n
    \n \n ").concat(dividerButtons, "\n
    \n
    \n
    \n \n ").concat(activeToolbar, "\n
    \n "); + }; + + var originalFilterStatusAttach = Drupal.behaviors.filterStatus.attach; + + Drupal.behaviors.filterStatus.attach = function (context, settings) { + var filterStatusCheckboxes = document.querySelectorAll('#filters-status-wrapper input.form-checkbox'); + once.remove('filter-status', filterStatusCheckboxes); + $(filterStatusCheckboxes).off('click.filterUpdate'); + originalFilterStatusAttach(context, settings); + }; + + Drupal.behaviors.tabErrorsVisible = { + attach: function attach(context) { + context.querySelectorAll('details .form-item .error').forEach(function (item) { + var details = item.closest('details'); + + if (details.style.display === 'none') { + var tabSelect = document.querySelector("[href='#".concat(details.id, "']")); + + if (tabSelect) { + tabSelect.click(); + } + } + }); + } + }; +})(Drupal, drupalSettings, jQuery, JSON, once, Sortable, tabbable); \ No newline at end of file reverted: --- b/core/modules/color/color.js +++ a/core/modules/color/color.js @@ -0,0 +1,191 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.color = { + attach: function attach(context, settings) { + var i; + var j; + var colors; + var form = $(once('color', '#system-theme-settings .color-form', context)); + + if (form.length === 0) { + return; + } + + var inputs = []; + var hooks = []; + var locks = []; + var focused = null; + $(once('color', $('
    '))).prependTo(form); + var farb = $.farbtastic('.color-placeholder'); + var reference = settings.color.reference; + Object.keys(reference || {}).forEach(function (color) { + reference[color] = farb.RGBToHSL(farb.unpack(reference[color])); + }); + var height = []; + var width = []; + + function preview() { + Drupal.color.callback(context, settings, form, farb, height, width); + } + + function resetScheme() { + form.find('#edit-scheme').each(function () { + this.selectedIndex = this.options.length - 1; + }); + } + + function shiftColor(given, ref1, ref2) { + var d; + given = farb.RGBToHSL(farb.unpack(given)); + given[0] += ref2[0] - ref1[0]; + + if (ref1[1] === 0 || ref2[1] === 0) { + given[1] = ref2[1]; + } else { + d = ref1[1] / ref2[1]; + + if (d > 1) { + given[1] /= d; + } else { + given[1] = 1 - (1 - given[1]) * d; + } + } + + if (ref1[2] === 0 || ref2[2] === 0) { + given[2] = ref2[2]; + } else { + d = ref1[2] / ref2[2]; + + if (d > 1) { + given[2] /= d; + } else { + given[2] = 1 - (1 - given[2]) * d; + } + } + + return farb.pack(farb.HSLToRGB(given)); + } + + function callback(input, color, propagate, colorScheme) { + var matched; + $(input).css({ + backgroundColor: color, + color: farb.RGBToHSL(farb.unpack(color))[2] > 0.5 ? '#000' : '#fff' + }); + + if (input.value && input.value !== color) { + input.value = color; + + if (propagate) { + i = input.i; + + for (j = i + 1;; ++j) { + if (!locks[j - 1] || $(locks[j - 1]).is('.is-unlocked')) { + break; + } + + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + callback(inputs[j], matched, false); + } + + for (j = i - 1;; --j) { + if (!locks[j] || $(locks[j]).is('.is-unlocked')) { + break; + } + + matched = shiftColor(color, reference[input.key], reference[inputs[j].key]); + callback(inputs[j], matched, false); + } + + preview(); + } + + if (!colorScheme) { + resetScheme(); + } + } + } + + Object.keys(settings.gradients || {}).forEach(function (i) { + $(once('color', '.color-preview')).append("
    ")); + var gradient = $(".color-preview #gradient-".concat(i)); + height.push(parseInt(gradient.css('height'), 10) / 10); + width.push(parseInt(gradient.css('width'), 10) / 10); + + for (j = 0; j < (settings.gradients[i].direction === 'vertical' ? height[i] : width[i]); ++j) { + gradient.append('
    '); + } + }); + form.find('#edit-scheme').on('change', function () { + var schemes = settings.color.schemes; + var colorScheme = this.options[this.selectedIndex].value; + + if (colorScheme !== '' && schemes[colorScheme]) { + colors = schemes[colorScheme]; + Object.keys(colors || {}).forEach(function (fieldName) { + callback($("#edit-palette-".concat(fieldName)), colors[fieldName], false, true); + }); + preview(); + } + }); + + function focus(e) { + var input = e.target; + + if (focused) { + $(focused).off('keyup', farb.updateValue).off('keyup', preview).off('keyup', resetScheme).parent().removeClass('item-selected'); + } + + focused = input; + farb.linkTo(function (color) { + callback(input, color, true, false); + }); + farb.setColor(input.value); + $(focused).on('keyup', farb.updateValue).on('keyup', preview).on('keyup', resetScheme).parent().addClass('item-selected'); + } + + form.find('.js-color-palette input.form-text').each(function () { + this.key = this.id.substring(13); + farb.linkTo(function () {}).setColor('#000').linkTo(this); + var i = inputs.length; + + if (inputs.length) { + var toggleClick = true; + var lock = $("")).on('click', function (e) { + e.preventDefault(); + + if (toggleClick) { + $(this).addClass('is-unlocked').html(Drupal.t('Lock')); + $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-up' : 'color-palette__hook'); + $(hooks[i]).attr('class', locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-down' : 'color-palette__hook'); + } else { + $(this).removeClass('is-unlocked').html(Drupal.t('Unlock')); + $(hooks[i - 1]).attr('class', locks[i - 2] && $(locks[i - 2]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-down'); + $(hooks[i]).attr('class', locks[i] && $(locks[i]).is(':not(.is-unlocked)') ? 'color-palette__hook is-both' : 'color-palette__hook is-up'); + } + + toggleClick = !toggleClick; + }); + $(this).after(lock); + locks.push(lock); + } + + var hook = $('
    '); + $(this).after(hook); + hooks.push(hook); + $(this).parent().find('.color-palette__lock').trigger('click'); + this.i = i; + inputs.push(this); + }).on('focus', focus); + form.find('.js-color-palette label'); + inputs[0].focus(); + preview(); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/comment/comment-entity-form.js +++ a/core/modules/comment/comment-entity-form.js @@ -0,0 +1,17 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.commentFieldsetSummaries = { + attach: function attach(context) { + var $context = $(context); + $context.find('fieldset.comment-entity-settings-form').drupalSetSummary(function (context) { + return Drupal.checkPlain($(context).find('.js-form-item-comment input:checked').next('label')[0].textContent); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/content_translation/content_translation.admin.js +++ a/core/modules/content_translation/content_translation.admin.js @@ -0,0 +1,91 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.behaviors.contentTranslationDependentOptions = { + attach: function attach(context) { + var $context = $(context); + var options = drupalSettings.contentTranslationDependentOptions; + var $fields; + + function fieldsChangeHandler($fields, dependentColumns) { + return function (e) { + Drupal.behaviors.contentTranslationDependentOptions.check($fields, dependentColumns, $(e.target)); + }; + } + + if (options && options.dependent_selectors) { + Object.keys(options.dependent_selectors).forEach(function (field) { + $fields = $context.find("input[name^=\"".concat(field, "\"]")); + var dependentColumns = options.dependent_selectors[field]; + $fields.on('change', fieldsChangeHandler($fields, dependentColumns)); + Drupal.behaviors.contentTranslationDependentOptions.check($fields, dependentColumns); + }); + } + }, + check: function check($fields, dependentColumns, $changed) { + var $element = $changed; + var column; + + function filterFieldsList(index, field) { + return field.value === column; + } + + Object.keys(dependentColumns || {}).forEach(function (index) { + column = dependentColumns[index]; + + if (!$changed) { + $element = $fields.filter(filterFieldsList); + } + + if ($element.is("input[value=\"".concat(column, "\"]:checked"))) { + $fields.prop('checked', true).not($element).prop('disabled', true); + } else { + $fields.prop('disabled', false); + } + }); + } + }; + Drupal.behaviors.contentTranslation = { + attach: function attach(context) { + once('translation-entity-admin-hide', $(context).find('table .bundle-settings .translatable :input')).forEach(function (input) { + var $input = $(input); + var $bundleSettings = $input.closest('.bundle-settings'); + + if (!$input.is(':checked')) { + $bundleSettings.nextUntil('.bundle-settings').hide(); + } else { + $bundleSettings.nextUntil('.bundle-settings', '.field-settings').find('.translatable :input:not(:checked)').closest('.field-settings').nextUntil(':not(.column-settings)').hide(); + } + }); + $(once('translation-entity-admin-bind', 'body')).on('click', 'table .bundle-settings .translatable :input', function (e) { + var $target = $(e.target); + var $bundleSettings = $target.closest('.bundle-settings'); + var $settings = $bundleSettings.nextUntil('.bundle-settings'); + var $fieldSettings = $settings.filter('.field-settings'); + + if ($target.is(':checked')) { + $bundleSettings.find('.operations :input[name$="[language_alterable]"]').prop('checked', true); + $fieldSettings.find('.translatable :input').prop('checked', true); + $settings.show(); + } else { + $settings.hide(); + } + }).on('click', 'table .field-settings .translatable :input', function (e) { + var $target = $(e.target); + var $fieldSettings = $target.closest('.field-settings'); + var $columnSettings = $fieldSettings.nextUntil('.field-settings, .bundle-settings'); + + if ($target.is(':checked')) { + $columnSettings.show(); + } else { + $columnSettings.hide(); + } + }); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/contextual/js/contextual.js +++ a/core/modules/contextual/js/contextual.js @@ -0,0 +1,172 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, _, Backbone, JSON, storage) { + var options = $.extend(drupalSettings.contextual, { + strings: { + open: Drupal.t('Open'), + close: Drupal.t('Close') + } + }); + var cachedPermissionsHash = storage.getItem('Drupal.contextual.permissionsHash'); + var permissionsHash = drupalSettings.user.permissionsHash; + + if (cachedPermissionsHash !== permissionsHash) { + if (typeof permissionsHash === 'string') { + _.chain(storage).keys().each(function (key) { + if (key.substring(0, 18) === 'Drupal.contextual.') { + storage.removeItem(key); + } + }); + } + + storage.setItem('Drupal.contextual.permissionsHash', permissionsHash); + } + + function adjustIfNestedAndOverlapping($contextual) { + var $contextuals = $contextual.parents('.contextual-region').eq(-1).find('.contextual'); + + if ($contextuals.length <= 1) { + return; + } + + var firstTop = $contextuals.eq(0).offset().top; + var secondTop = $contextuals.eq(1).offset().top; + + if (firstTop === secondTop) { + var $nestedContextual = $contextuals.eq(1); + var height = 0; + var $trigger = $nestedContextual.find('.trigger'); + $trigger.removeClass('visually-hidden'); + height = $nestedContextual.height(); + $trigger.addClass('visually-hidden'); + $nestedContextual.css({ + top: $nestedContextual.position().top + height + }); + } + } + + function initContextual($contextual, html) { + var $region = $contextual.closest('.contextual-region'); + var contextual = Drupal.contextual; + $contextual.html(html).addClass('contextual').prepend(Drupal.theme('contextualTrigger')); + var destination = "destination=".concat(Drupal.encodePath(Drupal.url(drupalSettings.path.currentPath))); + $contextual.find('.contextual-links a').each(function () { + var url = this.getAttribute('href'); + var glue = url.indexOf('?') === -1 ? '?' : '&'; + this.setAttribute('href', url + glue + destination); + }); + var title = ''; + var $regionHeading = $region.find('h2'); + + if ($regionHeading.length) { + title = $regionHeading[0].textContent.trim(); + } + + var model = new contextual.StateModel({ + title: title + }); + var viewOptions = $.extend({ + el: $contextual, + model: model + }, options); + contextual.views.push({ + visual: new contextual.VisualView(viewOptions), + aural: new contextual.AuralView(viewOptions), + keyboard: new contextual.KeyboardView(viewOptions) + }); + contextual.regionViews.push(new contextual.RegionView($.extend({ + el: $region, + model: model + }, options))); + contextual.collection.add(model); + $(document).trigger('drupalContextualLinkAdded', Drupal.deprecatedProperty({ + target: { + $el: $contextual, + $region: $region, + model: model + }, + deprecatedProperty: 'model', + message: 'The model property is deprecated in drupal:9.4.0 and is removed from drupal:10.0.0. There is no replacement.' + })); + adjustIfNestedAndOverlapping($contextual); + } + + Drupal.behaviors.contextual = { + attach: function attach(context) { + var $context = $(context); + var $placeholders = $(once('contextual-render', '[data-contextual-id]', context)); + + if ($placeholders.length === 0) { + return; + } + + var ids = []; + $placeholders.each(function () { + ids.push({ + id: $(this).attr('data-contextual-id'), + token: $(this).attr('data-contextual-token') + }); + }); + var uncachedIDs = []; + var uncachedTokens = []; + ids.forEach(function (contextualID) { + var html = storage.getItem("Drupal.contextual.".concat(contextualID.id)); + + if (html && html.length) { + window.setTimeout(function () { + initContextual($context.find("[data-contextual-id=\"".concat(contextualID.id, "\"]:empty")).eq(0), html); + }); + return; + } + + uncachedIDs.push(contextualID.id); + uncachedTokens.push(contextualID.token); + }); + + if (uncachedIDs.length > 0) { + $.ajax({ + url: Drupal.url('contextual/render'), + type: 'POST', + data: { + 'ids[]': uncachedIDs, + 'tokens[]': uncachedTokens + }, + dataType: 'json', + success: function success(results) { + _.each(results, function (html, contextualID) { + storage.setItem("Drupal.contextual.".concat(contextualID), html); + + if (html.length > 0) { + $placeholders = $context.find("[data-contextual-id=\"".concat(contextualID, "\"]")); + + for (var i = 0; i < $placeholders.length; i++) { + initContextual($placeholders.eq(i), html); + } + } + }); + } + }); + } + } + }; + Drupal.contextual = { + views: [], + regionViews: [] + }; + Drupal.contextual.collection = new Backbone.Collection([], { + model: Drupal.contextual.StateModel + }); + + Drupal.theme.contextualTrigger = function () { + return ''; + }; + + $(document).on('drupalContextualLinkAdded', function (event, data) { + Drupal.ajax.bindAjaxLinks(data.$el[0]); + }); +})(jQuery, Drupal, drupalSettings, _, Backbone, window.JSON, window.sessionStorage); \ No newline at end of file reverted: --- b/core/modules/contextual/js/toolbar/views/AuralView.js +++ a/core/modules/contextual/js/toolbar/views/AuralView.js @@ -0,0 +1,58 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, Backbone, _) { + Drupal.contextualToolbar.AuralView = Backbone.View.extend({ + announcedOnce: false, + initialize: function initialize(options) { + this.options = options; + this.listenTo(this.model, 'change', this.render); + this.listenTo(this.model, 'change:isViewing', this.manageTabbing); + $(document).on('keyup', _.bind(this.onKeypress, this)); + this.manageTabbing(); + }, + render: function render() { + this.$el.find('button').attr('aria-pressed', !this.model.get('isViewing')); + return this; + }, + manageTabbing: function manageTabbing() { + var tabbingContext = this.model.get('tabbingContext'); + + if (tabbingContext) { + if (tabbingContext.active) { + Drupal.announce(this.options.strings.tabbingReleased); + } + + tabbingContext.release(); + } + + if (!this.model.get('isViewing')) { + tabbingContext = Drupal.tabbingManager.constrain($('.contextual-toolbar-tab, .contextual')); + this.model.set('tabbingContext', tabbingContext); + this.announceTabbingConstraint(); + this.announcedOnce = true; + } + }, + announceTabbingConstraint: function announceTabbingConstraint() { + var strings = this.options.strings; + Drupal.announce(Drupal.formatString(strings.tabbingConstrained, { + '@contextualsCount': Drupal.formatPlural(Drupal.contextual.collection.length, '@count contextual link', '@count contextual links') + })); + Drupal.announce(strings.pressEsc); + }, + onKeypress: function onKeypress(event) { + if (!this.announcedOnce && event.keyCode === 9 && !this.model.get('isViewing')) { + this.announceTabbingConstraint(); + this.announcedOnce = true; + } + + if (event.keyCode === 27) { + this.model.set('isViewing', true); + } + } + }); +})(jQuery, Drupal, Backbone, _); \ No newline at end of file reverted: --- b/core/modules/contextual/js/views/KeyboardView.js +++ a/core/modules/contextual/js/views/KeyboardView.js @@ -0,0 +1,31 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, Backbone) { + Drupal.contextual.KeyboardView = Backbone.View.extend({ + events: { + 'focus .trigger': 'focus', + 'focus .contextual-links a': 'focus', + 'blur .trigger': function blurTrigger() { + this.model.blur(); + }, + 'blur .contextual-links a': function blurContextualLinksA() { + var that = this; + this.timer = window.setTimeout(function () { + that.model.close().blur(); + }, 150); + } + }, + initialize: function initialize() { + this.timer = NaN; + }, + focus: function focus() { + window.clearTimeout(this.timer); + this.model.focus(); + } + }); +})(Drupal, Backbone); \ No newline at end of file reverted: --- b/core/modules/contextual/js/views/RegionView.js +++ a/core/modules/contextual/js/views/RegionView.js @@ -0,0 +1,39 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, Backbone) { + Drupal.contextual.RegionView = Backbone.View.extend({ + events: function events() { + var touchStart = false; + return { + touchstart: function touchstart() { + touchStart = true; + }, + mouseenter: function mouseenter() { + if (!touchStart) { + this.model.set('regionIsHovered', true); + } + }, + mouseleave: function mouseleave() { + if (!touchStart) { + this.model.close().blur().set('regionIsHovered', false); + } + }, + mousemove: function mousemove() { + touchStart = false; + } + }; + }, + initialize: function initialize() { + this.listenTo(this.model, 'change:hasFocus', this.render); + }, + render: function render() { + this.$el.toggleClass('focus', this.model.get('hasFocus')); + return this; + } + }); +})(Drupal, Backbone); \ No newline at end of file reverted: --- b/core/modules/contextual/js/views/VisualView.js +++ a/core/modules/contextual/js/views/VisualView.js @@ -0,0 +1,54 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, Backbone) { + Drupal.contextual.VisualView = Backbone.View.extend({ + events: function events() { + var touchEndToClick = function touchEndToClick(event) { + event.preventDefault(); + event.target.click(); + }; + + var touchStart = false; + return { + touchstart: function touchstart() { + touchStart = true; + }, + mouseenter: function mouseenter() { + if (!touchStart) { + this.model.focus(); + } + }, + mousemove: function mousemove() { + touchStart = false; + }, + 'click .trigger': function clickTrigger() { + this.model.toggleOpen(); + }, + 'touchend .trigger': touchEndToClick, + 'click .contextual-links a': function clickContextualLinksA() { + this.model.close().blur(); + }, + 'touchend .contextual-links a': touchEndToClick + }; + }, + initialize: function initialize() { + this.listenTo(this.model, 'change', this.render); + }, + render: function render() { + var isOpen = this.model.get('isOpen'); + var isVisible = this.model.get('isLocked') || this.model.get('regionIsHovered') || isOpen; + this.$el.toggleClass('open', isOpen).find('.trigger').toggleClass('visually-hidden', !isVisible); + + if ('isOpen' in this.model.changed) { + this.$el.closest('.contextual-region').find('.contextual .trigger:not(:first)').toggle(!isOpen); + } + + return this; + } + }); +})(Drupal, Backbone); \ No newline at end of file reverted: --- b/core/modules/editor/js/editor.admin.js +++ a/core/modules/editor/js/editor.admin.js @@ -0,0 +1,374 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, document) { + Drupal.editorConfiguration = { + addedFeature: function addedFeature(feature) { + $(document).trigger('drupalEditorFeatureAdded', feature); + }, + removedFeature: function removedFeature(feature) { + $(document).trigger('drupalEditorFeatureRemoved', feature); + }, + modifiedFeature: function modifiedFeature(feature) { + $(document).trigger('drupalEditorFeatureModified', feature); + }, + featureIsAllowedByFilters: function featureIsAllowedByFilters(feature) { + function emptyProperties(section) { + return section.attributes.length === 0 && section.classes.length === 0 && section.styles.length === 0; + } + + function generateUniverseFromFeatureRequirements(feature) { + var properties = ['attributes', 'styles', 'classes']; + var universe = {}; + + for (var r = 0; r < feature.rules.length; r++) { + var featureRule = feature.rules[r]; + var requiredTags = featureRule.required.tags; + + for (var t = 0; t < requiredTags.length; t++) { + universe[requiredTags[t]] = { + tag: false, + touchedByAllowedPropertyRule: false + }; + } + + if (emptyProperties(featureRule.required)) { + continue; + } + + for (var p = 0; p < properties.length; p++) { + var property = properties[p]; + + for (var pv = 0; pv < featureRule.required[property].length; pv++) { + var propertyValue = featureRule.required[property]; + universe[requiredTags]["".concat(property, ":").concat(propertyValue)] = false; + } + } + } + + return universe; + } + + function findPropertyValueOnTag(universe, tag, property, propertyValue, allowing) { + if (!universe.hasOwnProperty(tag)) { + return false; + } + + var key = "".concat(property, ":").concat(propertyValue); + + if (allowing) { + universe[tag].touchedByAllowedPropertyRule = true; + } + + if (propertyValue.indexOf('*') === -1) { + if (universe.hasOwnProperty(tag) && universe[tag].hasOwnProperty(key)) { + if (allowing) { + universe[tag][key] = true; + } + + return true; + } + + return false; + } + + var atLeastOneFound = false; + var regex = key.replace(/\*/g, '[^ ]*'); + Object.keys(universe[tag]).forEach(function (key) { + if (key.match(regex)) { + atLeastOneFound = true; + + if (allowing) { + universe[tag][key] = true; + } + } + }); + return atLeastOneFound; + } + + function findPropertyValuesOnAllTags(universe, property, propertyValues, allowing) { + var atLeastOneFound = false; + Object.keys(universe).forEach(function (tag) { + if (findPropertyValuesOnTag(universe, tag, property, propertyValues, allowing)) { + atLeastOneFound = true; + } + }); + return atLeastOneFound; + } + + function findPropertyValuesOnTag(universe, tag, property, propertyValues, allowing) { + if (tag === '*') { + return findPropertyValuesOnAllTags(universe, property, propertyValues, allowing); + } + + var atLeastOneFound = false; + propertyValues.forEach(function (propertyValue) { + if (findPropertyValueOnTag(universe, tag, property, propertyValue, allowing)) { + atLeastOneFound = true; + } + }); + return atLeastOneFound; + } + + function deleteAllTagsFromUniverseIfAllowed(universe) { + var atLeastOneDeleted = false; + Object.keys(universe).forEach(function (tag) { + if (deleteFromUniverseIfAllowed(universe, tag)) { + atLeastOneDeleted = true; + } + }); + return atLeastOneDeleted; + } + + function deleteFromUniverseIfAllowed(universe, tag) { + if (tag === '*') { + return deleteAllTagsFromUniverseIfAllowed(universe); + } + + if (universe.hasOwnProperty(tag) && Object.keys(universe[tag]).filter(function (key) { + return key !== 'touchedByAllowedPropertyRule'; + }).every(function (key) { + return universe[tag][key]; + })) { + delete universe[tag]; + return true; + } + + return false; + } + + function anyForbiddenFilterRuleMatches(universe, filterStatus) { + var properties = ['attributes', 'styles', 'classes']; + var allRequiredTags = Object.keys(universe); + var filterRule; + + for (var i = 0; i < filterStatus.rules.length; i++) { + filterRule = filterStatus.rules[i]; + + if (filterRule.allow === false) { + var intersection = filterRule.tags.filter(function (tag) { + return allRequiredTags.includes(tag); + }); + + if (intersection.length > 0) { + return true; + } + } + } + + for (var n = 0; n < filterStatus.rules.length; n++) { + filterRule = filterStatus.rules[n]; + + if (filterRule.restrictedTags.tags.length && !emptyProperties(filterRule.restrictedTags.forbidden)) { + for (var j = 0; j < filterRule.restrictedTags.tags.length; j++) { + var tag = filterRule.restrictedTags.tags[j]; + + for (var k = 0; k < properties.length; k++) { + var property = properties[k]; + + if (findPropertyValuesOnTag(universe, tag, property, filterRule.restrictedTags.forbidden[property], false)) { + return true; + } + } + } + } + } + + return false; + } + + function markAllowedTagsAndPropertyValues(universe, filterStatus) { + var properties = ['attributes', 'styles', 'classes']; + var filterRule; + var tag; + + for (var l = 0; Object.keys(universe).length > 0 && l < filterStatus.rules.length; l++) { + filterRule = filterStatus.rules[l]; + + if (filterRule.allow === true) { + for (var m = 0; Object.keys(universe).length > 0 && m < filterRule.tags.length; m++) { + tag = filterRule.tags[m]; + + if (universe.hasOwnProperty(tag)) { + universe[tag].tag = true; + deleteFromUniverseIfAllowed(universe, tag); + } + } + } + } + + for (var i = 0; Object.keys(universe).length > 0 && i < filterStatus.rules.length; i++) { + filterRule = filterStatus.rules[i]; + + if (filterRule.restrictedTags.tags.length && !emptyProperties(filterRule.restrictedTags.allowed)) { + for (var j = 0; Object.keys(universe).length > 0 && j < filterRule.restrictedTags.tags.length; j++) { + tag = filterRule.restrictedTags.tags[j]; + + for (var k = 0; k < properties.length; k++) { + var property = properties[k]; + + if (findPropertyValuesOnTag(universe, tag, property, filterRule.restrictedTags.allowed[property], true)) { + deleteFromUniverseIfAllowed(universe, tag); + } + } + } + } + } + } + + function filterStatusAllowsFeature(filterStatus, feature) { + if (!filterStatus.active) { + return true; + } + + if (feature.rules.length === 0) { + return true; + } + + if (filterStatus.rules.length === 0) { + return true; + } + + var universe = generateUniverseFromFeatureRequirements(feature); + + if (anyForbiddenFilterRuleMatches(universe, filterStatus)) { + return false; + } + + markAllowedTagsAndPropertyValues(universe, filterStatus); + + if (filterStatus.rules.some(function (_ref) { + var allow = _ref.allow; + return allow; + })) { + if (Object.keys(universe).length === 0) { + return true; + } + + if (!Object.keys(universe).every(function (tagName) { + return universe[tagName].tag; + })) { + return false; + } + + var tags = Object.keys(universe); + + for (var i = 0; i < tags.length; i++) { + var tag = tags[i]; + + if (universe.hasOwnProperty(tag)) { + if (universe[tag].touchedByAllowedPropertyRule === false) { + delete universe[tag]; + } + } + } + + return Object.keys(universe).length === 0; + } + + return true; + } + + Drupal.filterConfiguration.update(); + return Object.keys(Drupal.filterConfiguration.statuses).every(function (filterID) { + return filterStatusAllowsFeature(Drupal.filterConfiguration.statuses[filterID], feature); + }); + } + }; + + Drupal.EditorFeatureHTMLRule = function () { + this.required = { + tags: [], + attributes: [], + styles: [], + classes: [] + }; + this.allowed = { + tags: [], + attributes: [], + styles: [], + classes: [] + }; + this.raw = null; + }; + + Drupal.EditorFeature = function (name) { + this.name = name; + this.rules = []; + }; + + Drupal.EditorFeature.prototype.addHTMLRule = function (rule) { + this.rules.push(rule); + }; + + Drupal.FilterStatus = function (name) { + this.name = name; + this.active = false; + this.rules = []; + }; + + Drupal.FilterStatus.prototype.addHTMLRule = function (rule) { + this.rules.push(rule); + }; + + Drupal.FilterHTMLRule = function () { + this.tags = []; + this.allow = null; + this.restrictedTags = { + tags: [], + allowed: { + attributes: [], + styles: [], + classes: [] + }, + forbidden: { + attributes: [], + styles: [], + classes: [] + } + }; + return this; + }; + + Drupal.FilterHTMLRule.prototype.clone = function () { + var clone = new Drupal.FilterHTMLRule(); + clone.tags = this.tags.slice(0); + clone.allow = this.allow; + clone.restrictedTags.tags = this.restrictedTags.tags.slice(0); + clone.restrictedTags.allowed.attributes = this.restrictedTags.allowed.attributes.slice(0); + clone.restrictedTags.allowed.styles = this.restrictedTags.allowed.styles.slice(0); + clone.restrictedTags.allowed.classes = this.restrictedTags.allowed.classes.slice(0); + clone.restrictedTags.forbidden.attributes = this.restrictedTags.forbidden.attributes.slice(0); + clone.restrictedTags.forbidden.styles = this.restrictedTags.forbidden.styles.slice(0); + clone.restrictedTags.forbidden.classes = this.restrictedTags.forbidden.classes.slice(0); + return clone; + }; + + Drupal.filterConfiguration = { + statuses: {}, + liveSettingParsers: {}, + update: function update() { + Object.keys(Drupal.filterConfiguration.statuses || {}).forEach(function (filterID) { + Drupal.filterConfiguration.statuses[filterID].active = $("[name=\"filters[".concat(filterID, "][status]\"]")).is(':checked'); + + if (Drupal.filterConfiguration.liveSettingParsers[filterID]) { + Drupal.filterConfiguration.statuses[filterID].rules = Drupal.filterConfiguration.liveSettingParsers[filterID].getRules(); + } + }); + } + }; + Drupal.behaviors.initializeFilterConfiguration = { + attach: function attach(context, settings) { + once('filter-editor-status', '#filters-status-wrapper input.form-checkbox', context).forEach(function (checkbox) { + var $checkbox = $(checkbox); + var nameAttribute = $checkbox.attr('name'); + var filterID = nameAttribute.substring(8, nameAttribute.indexOf(']')); + Drupal.filterConfiguration.statuses[filterID] = new Drupal.FilterStatus(filterID); + }); + } + }; +})(jQuery, Drupal, document); \ No newline at end of file reverted: --- b/core/modules/field_ui/field_ui.js +++ a/core/modules/field_ui/field_ui.js @@ -0,0 +1,187 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.behaviors.fieldUIFieldStorageAddForm = { + attach: function attach(context) { + var form = once('field_ui_add', '[data-drupal-selector="field-ui-field-storage-add-form"]', context); + + if (form.length) { + var $form = $(form); + $form.find('.js-form-item-label label,' + '.js-form-item-field-name label,' + '.js-form-item-existing-storage-label label').addClass('js-form-required form-required'); + var $newFieldType = $form.find('select[name="new_storage_type"]'); + var $existingStorageName = $form.find('select[name="existing_storage_name"]'); + var $existingStorageLabel = $form.find('input[name="existing_storage_label"]'); + $newFieldType.on('change', function () { + if (this.value !== '') { + if ($existingStorageName.length) { + $existingStorageName[0].value = ''; + $existingStorageName.trigger('change'); + } + } + }); + $existingStorageName.on('change', function () { + var value = this.value; + + if (value !== '') { + if ($newFieldType.length) { + $newFieldType[0].value = ''; + $newFieldType.trigger('change'); + } + + if (typeof drupalSettings.existingFieldLabels[value] !== 'undefined') { + $existingStorageLabel[0].value = drupalSettings.existingFieldLabels[value]; + } + } + }); + } + } + }; + Drupal.behaviors.fieldUIDisplayOverview = { + attach: function attach(context, settings) { + once('field-display-overview', 'table#field-display-overview', context).forEach(function (overview) { + Drupal.fieldUIOverview.attach(overview, settings.fieldUIRowsData, Drupal.fieldUIDisplayOverview); + }); + } + }; + Drupal.fieldUIOverview = { + attach: function attach(table, rowsData, rowHandlers) { + var tableDrag = Drupal.tableDrag[table.id]; + tableDrag.onDrop = this.onDrop; + tableDrag.row.prototype.onSwap = this.onSwap; + $(table).find('tr.draggable').each(function () { + var row = this; + + if (row.id in rowsData) { + var data = rowsData[row.id]; + data.tableDrag = tableDrag; + var rowHandler = new rowHandlers[data.rowHandler](row, data); + $(row).data('fieldUIRowHandler', rowHandler); + } + }); + }, + onChange: function onChange() { + var $trigger = $(this); + var $row = $trigger.closest('tr'); + var rowHandler = $row.data('fieldUIRowHandler'); + var refreshRows = {}; + refreshRows[rowHandler.name] = $trigger.get(0); + var region = rowHandler.getRegion(); + + if (region !== rowHandler.region) { + var $fieldParent = $row.find('select.js-field-parent'); + + if ($fieldParent.length) { + $fieldParent[0].value = ''; + } + + $.extend(refreshRows, rowHandler.regionChange(region)); + rowHandler.region = region; + } + + Drupal.fieldUIOverview.AJAXRefreshRows(refreshRows); + }, + onDrop: function onDrop() { + var dragObject = this; + var row = dragObject.rowObject.element; + var $row = $(row); + var rowHandler = $row.data('fieldUIRowHandler'); + + if (typeof rowHandler !== 'undefined') { + var regionRow = $row.prevAll('tr.region-message').get(0); + var region = regionRow.className.replace(/([^ ]+[ ]+)*region-([^ ]+)-message([ ]+[^ ]+)*/, '$2'); + + if (region !== rowHandler.region) { + var refreshRows = rowHandler.regionChange(region); + rowHandler.region = region; + Drupal.fieldUIOverview.AJAXRefreshRows(refreshRows); + } + } + }, + onSwap: function onSwap(draggedRow) { + var rowObject = this; + $(rowObject.table).find('tr.region-message').each(function () { + var $this = $(this); + + if ($this.prev('tr').get(0) === rowObject.group[rowObject.group.length - 1]) { + if (rowObject.method !== 'keyboard' || rowObject.direction === 'down') { + rowObject.swap('after', this); + } + } + + if ($this.next('tr').is(':not(.draggable)') || $this.next('tr').length === 0) { + $this.removeClass('region-populated').addClass('region-empty'); + } else if ($this.is('.region-empty')) { + $this.removeClass('region-empty').addClass('region-populated'); + } + }); + }, + AJAXRefreshRows: function AJAXRefreshRows(rows) { + var rowNames = []; + var ajaxElements = []; + Object.keys(rows || {}).forEach(function (rowName) { + rowNames.push(rowName); + ajaxElements.push(rows[rowName]); + }); + + if (rowNames.length) { + $(ajaxElements).after(Drupal.theme.ajaxProgressThrobber()); + var $refreshRows = $('input[name=refresh_rows]'); + + if ($refreshRows.length) { + $refreshRows[0].value = rowNames.join(' '); + } + + $('input[data-drupal-selector="edit-refresh"]').trigger('mousedown'); + $(ajaxElements).prop('disabled', true); + } + } + }; + Drupal.fieldUIDisplayOverview = {}; + + Drupal.fieldUIDisplayOverview.field = function (row, data) { + this.row = row; + this.name = data.name; + this.region = data.region; + this.tableDrag = data.tableDrag; + this.defaultPlugin = data.defaultPlugin; + this.$pluginSelect = $(row).find('.field-plugin-type'); + this.$pluginSelect.on('change', Drupal.fieldUIOverview.onChange); + this.$regionSelect = $(row).find('select.field-region'); + this.$regionSelect.on('change', Drupal.fieldUIOverview.onChange); + return this; + }; + + Drupal.fieldUIDisplayOverview.field.prototype = { + getRegion: function getRegion() { + if (this.$regionSelect.length) { + return this.$regionSelect[0].value; + } + }, + regionChange: function regionChange(region) { + region = region.replace(/-/g, '_'); + + if (this.$regionSelect.length) { + this.$regionSelect[0].value = region; + } + + if (this.region === 'hidden') { + var value = typeof this.defaultPlugin !== 'undefined' ? this.defaultPlugin : this.$pluginSelect.find('option')[0].value; + + if (typeof value !== 'undefined') { + if (this.$pluginSelect.length) { + this.$pluginSelect[0].value = value; + } + } + } + + var refreshRows = {}; + refreshRows[this.name] = this.$pluginSelect.get(0); + return refreshRows; + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/file/file.js +++ a/core/modules/file/file.js @@ -0,0 +1,132 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.fileValidateAutoAttach = { + attach: function attach(context, settings) { + var $context = $(context); + var elements; + + function initFileValidation(selector) { + $(once('fileValidate', $context.find(selector))).on('change.fileValidate', { + extensions: elements[selector] + }, Drupal.file.validateExtension); + } + + if (settings.file && settings.file.elements) { + elements = settings.file.elements; + Object.keys(elements).forEach(initFileValidation); + } + }, + detach: function detach(context, settings, trigger) { + var $context = $(context); + var elements; + + function removeFileValidation(selector) { + $(once.remove('fileValidate', $context.find(selector))).off('change.fileValidate', Drupal.file.validateExtension); + } + + if (trigger === 'unload' && settings.file && settings.file.elements) { + elements = settings.file.elements; + Object.keys(elements).forEach(removeFileValidation); + } + } + }; + Drupal.behaviors.fileAutoUpload = { + attach: function attach(context) { + $(once('auto-file-upload', 'input[type="file"]', context)).on('change.autoFileUpload', Drupal.file.triggerUploadButton); + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + $(once.remove('auto-file-upload', 'input[type="file"]', context)).off('.autoFileUpload'); + } + } + }; + Drupal.behaviors.fileButtons = { + attach: function attach(context) { + var $context = $(context); + $context.find('.js-form-submit').on('mousedown', Drupal.file.disableFields); + $context.find('.js-form-managed-file .js-form-submit').on('mousedown', Drupal.file.progressBar); + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + var $context = $(context); + $context.find('.js-form-submit').off('mousedown', Drupal.file.disableFields); + $context.find('.js-form-managed-file .js-form-submit').off('mousedown', Drupal.file.progressBar); + } + } + }; + Drupal.behaviors.filePreviewLinks = { + attach: function attach(context) { + $(context).find('div.js-form-managed-file .file a').on('click', Drupal.file.openInNewWindow); + }, + detach: function detach(context) { + $(context).find('div.js-form-managed-file .file a').off('click', Drupal.file.openInNewWindow); + } + }; + Drupal.file = Drupal.file || { + validateExtension: function validateExtension(event) { + event.preventDefault(); + $('.file-upload-js-error').remove(); + var extensionPattern = event.data.extensions.replace(/,\s*/g, '|'); + + if (extensionPattern.length > 1 && this.value.length > 0) { + var acceptableMatch = new RegExp("\\.(".concat(extensionPattern, ")$"), 'gi'); + + if (!acceptableMatch.test(this.value)) { + var error = Drupal.t('The selected file %filename cannot be uploaded. Only files with the following extensions are allowed: %extensions.', { + '%filename': this.value.replace('C:\\fakepath\\', ''), + '%extensions': extensionPattern.replace(/\|/g, ', ') + }); + $(this).closest('div.js-form-managed-file').prepend("
    ".concat(error, "
    ")); + this.value = ''; + event.stopImmediatePropagation(); + } + } + }, + triggerUploadButton: function triggerUploadButton(event) { + $(event.target).closest('.js-form-managed-file').find('.js-form-submit[data-drupal-selector$="upload-button"]').trigger('mousedown'); + }, + disableFields: function disableFields(event) { + var $clickedButton = $(this); + $clickedButton.trigger('formUpdated'); + var $enabledFields = []; + + if ($clickedButton.closest('div.js-form-managed-file').length > 0) { + $enabledFields = $clickedButton.closest('div.js-form-managed-file').find('input.js-form-file'); + } + + var $fieldsToTemporarilyDisable = $('div.js-form-managed-file input.js-form-file').not($enabledFields).not(':disabled'); + $fieldsToTemporarilyDisable.prop('disabled', true); + setTimeout(function () { + $fieldsToTemporarilyDisable.prop('disabled', false); + }, 1000); + }, + progressBar: function progressBar(event) { + var $clickedButton = $(this); + var $progressId = $clickedButton.closest('div.js-form-managed-file').find('input.file-progress'); + + if ($progressId.length) { + var originalName = $progressId.attr('name'); + $progressId.attr('name', originalName.match(/APC_UPLOAD_PROGRESS|UPLOAD_IDENTIFIER/)[0]); + setTimeout(function () { + $progressId.attr('name', originalName); + }, 1000); + } + + setTimeout(function () { + $clickedButton.closest('div.js-form-managed-file').find('div.ajax-progress-bar').slideDown(); + }, 500); + $clickedButton.trigger('fileUpload'); + }, + openInNewWindow: function openInNewWindow(event) { + event.preventDefault(); + $(this).attr('target', '_blank'); + window.open(this.href, 'filePreview', 'toolbar=0,scrollbars=1,location=1,statusbar=1,menubar=0,resizable=1,width=500,height=550'); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/filter/filter.admin.js +++ a/core/modules/filter/filter.admin.js @@ -0,0 +1,49 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.filterStatus = { + attach: function attach(context, settings) { + var $context = $(context); + once('filter-status', '#filters-status-wrapper input.form-checkbox', context).forEach(function (checkbox) { + var $checkbox = $(checkbox); + var $row = $context.find("#".concat($checkbox.attr('id').replace(/-status$/, '-weight'))).closest('tr'); + var $filterSettings = $context.find("[data-drupal-selector='".concat($checkbox.attr('id').replace(/-status$/, '-settings'), "']")); + var filterSettingsTab = $filterSettings.data('verticalTab'); + $checkbox.on('click.filterUpdate', function () { + if ($checkbox.is(':checked')) { + $row.show(); + + if (filterSettingsTab) { + filterSettingsTab.tabShow().updateSummary(); + } else { + $filterSettings.show(); + } + } else { + $row.hide(); + + if (filterSettingsTab) { + filterSettingsTab.tabHide().updateSummary(); + } else { + $filterSettings.hide(); + } + } + + Drupal.tableDrag['filter-order'].restripeTable(); + }); + + if (filterSettingsTab) { + filterSettingsTab.details.drupalSetSummary(function () { + return $checkbox.is(':checked') ? Drupal.t('Enabled') : Drupal.t('Disabled'); + }); + } + + $checkbox.triggerHandler('click.filterUpdate'); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/history/js/history.js +++ a/core/modules/history/js/history.js @@ -0,0 +1,74 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, storage) { + var currentUserID = parseInt(drupalSettings.user.uid, 10); + var secondsIn30Days = 2592000; + var thirtyDaysAgo = Math.round(new Date().getTime() / 1000) - secondsIn30Days; + var embeddedLastReadTimestamps = false; + + if (drupalSettings.history && drupalSettings.history.lastReadTimestamps) { + embeddedLastReadTimestamps = drupalSettings.history.lastReadTimestamps; + } + + Drupal.history = { + fetchTimestamps: function fetchTimestamps(nodeIDs, callback) { + if (embeddedLastReadTimestamps) { + callback(); + return; + } + + $.ajax({ + url: Drupal.url('history/get_node_read_timestamps'), + type: 'POST', + data: { + 'node_ids[]': nodeIDs + }, + dataType: 'json', + success: function success(results) { + Object.keys(results || {}).forEach(function (nodeID) { + storage.setItem("Drupal.history.".concat(currentUserID, ".").concat(nodeID), results[nodeID]); + }); + callback(); + } + }); + }, + getLastRead: function getLastRead(nodeID) { + if (embeddedLastReadTimestamps && embeddedLastReadTimestamps[nodeID]) { + return parseInt(embeddedLastReadTimestamps[nodeID], 10); + } + + return parseInt(storage.getItem("Drupal.history.".concat(currentUserID, ".").concat(nodeID)) || 0, 10); + }, + markAsRead: function markAsRead(nodeID) { + $.ajax({ + url: Drupal.url("history/".concat(nodeID, "/read")), + type: 'POST', + dataType: 'json', + success: function success(timestamp) { + if (embeddedLastReadTimestamps && embeddedLastReadTimestamps[nodeID]) { + return; + } + + storage.setItem("Drupal.history.".concat(currentUserID, ".").concat(nodeID), timestamp); + } + }); + }, + needsServerCheck: function needsServerCheck(nodeID, contentTimestamp) { + if (contentTimestamp < thirtyDaysAgo) { + return false; + } + + if (embeddedLastReadTimestamps && embeddedLastReadTimestamps[nodeID]) { + return contentTimestamp > parseInt(embeddedLastReadTimestamps[nodeID], 10); + } + + var minLastReadTimestamp = parseInt(storage.getItem("Drupal.history.".concat(currentUserID, ".").concat(nodeID)) || 0, 10); + return contentTimestamp > minLastReadTimestamp; + } + }; +})(jQuery, Drupal, drupalSettings, window.localStorage); \ No newline at end of file reverted: --- b/core/modules/language/language.admin.js +++ a/core/modules/language/language.admin.js @@ -0,0 +1,27 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.negotiationLanguage = { + attach: function attach() { + var $configForm = $('#language-negotiation-configure-form'); + var inputSelector = 'input[name$="[configurable]"]'; + + function toggleTable(checkbox) { + var $checkbox = $(checkbox); + $checkbox.closest('.table-language-group').find('table, .tabledrag-toggle-weight').toggle($checkbox.prop('checked')); + } + + $(once('negotiation-language-admin-bind', $configForm)).on('change', inputSelector, function (event) { + toggleTable(event.target); + }); + $configForm.find("".concat(inputSelector, ":not(:checked)")).each(function (index, element) { + toggleTable(element); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/layout_builder/js/layout-builder.js +++ a/core/modules/layout_builder/js/layout-builder.js @@ -0,0 +1,199 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, Sortable) { + var ajax = Drupal.ajax, + behaviors = Drupal.behaviors, + debounce = Drupal.debounce, + announce = Drupal.announce, + formatPlural = Drupal.formatPlural; + var layoutBuilderBlocksFiltered = false; + behaviors.layoutBuilderBlockFilter = { + attach: function attach(context) { + var $categories = $('.js-layout-builder-categories', context); + var $filterLinks = $categories.find('.js-layout-builder-block-link'); + + var filterBlockList = function filterBlockList(e) { + var query = e.target.value.toLowerCase(); + + var toggleBlockEntry = function toggleBlockEntry(index, link) { + var textMatch = link.textContent.toLowerCase().indexOf(query) !== -1; + $(link).toggle(textMatch); + }; + + if (query.length >= 2) { + $categories.find('.js-layout-builder-category:not([open])').attr('remember-closed', ''); + $categories.find('.js-layout-builder-category').attr('open', ''); + $filterLinks.each(toggleBlockEntry); + $categories.find('.js-layout-builder-category:not(:has(.js-layout-builder-block-link:visible))').hide(); + announce(formatPlural($categories.find('.js-layout-builder-block-link:visible').length, '1 block is available in the modified list.', '@count blocks are available in the modified list.')); + layoutBuilderBlocksFiltered = true; + } else if (layoutBuilderBlocksFiltered) { + layoutBuilderBlocksFiltered = false; + $categories.find('.js-layout-builder-category[remember-closed]').removeAttr('open').removeAttr('remember-closed'); + $categories.find('.js-layout-builder-category').show(); + $filterLinks.show(); + announce(Drupal.t('All available blocks are listed.')); + } + }; + + $(once('block-filter-text', 'input.js-layout-builder-filter', context)).on('keyup', debounce(filterBlockList, 200)); + } + }; + + Drupal.layoutBuilderBlockUpdate = function (item, from, to) { + var $item = $(item); + var $from = $(from); + var itemRegion = $item.closest('.js-layout-builder-region'); + + if (to === itemRegion[0]) { + var deltaTo = $item.closest('[data-layout-delta]').data('layout-delta'); + var deltaFrom = $from ? $from.closest('[data-layout-delta]').data('layout-delta') : deltaTo; + ajax({ + url: [$item.closest('[data-layout-update-url]').data('layout-update-url'), deltaFrom, deltaTo, itemRegion.data('region'), $item.data('layout-block-uuid'), $item.prev('[data-layout-block-uuid]').data('layout-block-uuid')].filter(function (element) { + return element !== undefined; + }).join('/') + }).execute(); + } + }; + + behaviors.layoutBuilderBlockDrag = { + attach: function attach(context) { + var regionSelector = '.js-layout-builder-region'; + Array.prototype.forEach.call(context.querySelectorAll(regionSelector), function (region) { + Sortable.create(region, { + draggable: '.js-layout-builder-block', + ghostClass: 'ui-state-drop', + group: 'builder-region', + onEnd: function onEnd(event) { + return Drupal.layoutBuilderBlockUpdate(event.item, event.from, event.to); + } + }); + }); + } + }; + behaviors.layoutBuilderDisableInteractiveElements = { + attach: function attach() { + var $blocks = $('#layout-builder [data-layout-block-uuid]'); + $blocks.find('input, textarea, select').prop('disabled', true); + $blocks.find('a').not(function (index, element) { + return $(element).closest('[data-contextual-id]').length > 0; + }).on('click mouseup touchstart', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + $blocks.find('button, [href], input, select, textarea, iframe, [tabindex]:not([tabindex="-1"]):not(.tabbable)').not(function (index, element) { + return $(element).closest('[data-contextual-id]').length > 0; + }).attr('tabindex', -1); + } + }; + $(window).on('dialog:aftercreate', function (event, dialog, $element) { + if (Drupal.offCanvas.isOffCanvas($element)) { + $('.is-layout-builder-highlighted').removeClass('is-layout-builder-highlighted'); + var id = $element.find('[data-layout-builder-target-highlight-id]').attr('data-layout-builder-target-highlight-id'); + + if (id) { + $("[data-layout-builder-highlight-id=\"".concat(id, "\"]")).addClass('is-layout-builder-highlighted'); + } + + $('#layout-builder').removeClass('layout-builder--move-blocks-active'); + var layoutBuilderWrapperValue = $element.find('[data-add-layout-builder-wrapper]').attr('data-add-layout-builder-wrapper'); + + if (layoutBuilderWrapperValue) { + $('#layout-builder').addClass(layoutBuilderWrapperValue); + } + } + }); + + if (document.querySelector('[data-off-canvas-main-canvas]')) { + var mainCanvas = document.querySelector('[data-off-canvas-main-canvas]'); + mainCanvas.addEventListener('transitionend', function () { + var $target = $('.is-layout-builder-highlighted'); + + if ($target.length > 0) { + var targetTop = $target.offset().top; + var targetBottom = targetTop + $target.outerHeight(); + var viewportTop = $(window).scrollTop(); + var viewportBottom = viewportTop + $(window).height(); + + if (targetBottom < viewportTop || targetTop > viewportBottom) { + var viewportMiddle = (viewportBottom + viewportTop) / 2; + var scrollAmount = targetTop - viewportMiddle; + + if ('scrollBehavior' in document.documentElement.style) { + window.scrollBy({ + top: scrollAmount, + left: 0, + behavior: 'smooth' + }); + } else { + window.scrollBy(0, scrollAmount); + } + } + } + }); + } + + $(window).on('dialog:afterclose', function (event, dialog, $element) { + if (Drupal.offCanvas.isOffCanvas($element)) { + $('.is-layout-builder-highlighted').removeClass('is-layout-builder-highlighted'); + $('#layout-builder').removeClass('layout-builder--move-blocks-active'); + } + }); + behaviors.layoutBuilderToggleContentPreview = { + attach: function attach(context) { + var $layoutBuilder = $('#layout-builder'); + var $layoutBuilderContentPreview = $('#layout-builder-content-preview'); + var contentPreviewId = $layoutBuilderContentPreview.data('content-preview-id'); + var isContentPreview = JSON.parse(localStorage.getItem(contentPreviewId)) !== false; + + var disableContentPreview = function disableContentPreview() { + $layoutBuilder.addClass('layout-builder--content-preview-disabled'); + $('[data-layout-content-preview-placeholder-label]', context).each(function (i, element) { + var $element = $(element); + $element.children(':not([data-contextual-id])').hide(0); + var contentPreviewPlaceholderText = $element.attr('data-layout-content-preview-placeholder-label'); + var contentPreviewPlaceholderLabel = Drupal.theme('layoutBuilderPrependContentPreviewPlaceholderLabel', contentPreviewPlaceholderText); + $element.prepend(contentPreviewPlaceholderLabel); + }); + }; + + var enableContentPreview = function enableContentPreview() { + $layoutBuilder.removeClass('layout-builder--content-preview-disabled'); + $('.js-layout-builder-content-preview-placeholder-label').remove(); + $('[data-layout-content-preview-placeholder-label]').each(function (i, element) { + $(element).children().show(); + }); + }; + + $('#layout-builder-content-preview', context).on('change', function (event) { + var isChecked = $(event.currentTarget).is(':checked'); + localStorage.setItem(contentPreviewId, JSON.stringify(isChecked)); + + if (isChecked) { + enableContentPreview(); + announce(Drupal.t('Block previews are visible. Block labels are hidden.')); + } else { + disableContentPreview(); + announce(Drupal.t('Block previews are hidden. Block labels are visible.')); + } + }); + + if (!isContentPreview) { + $layoutBuilderContentPreview.attr('checked', false); + disableContentPreview(); + } + } + }; + + Drupal.theme.layoutBuilderPrependContentPreviewPlaceholderLabel = function (contentPreviewPlaceholderText) { + var contentPreviewPlaceholderLabel = document.createElement('div'); + contentPreviewPlaceholderLabel.className = 'layout-builder-block__content-preview-placeholder-label js-layout-builder-content-preview-placeholder-label'; + contentPreviewPlaceholderLabel.innerHTML = contentPreviewPlaceholderText; + return "
    ".concat(contentPreviewPlaceholderText, "
    "); + }; +})(jQuery, Drupal, Sortable); \ No newline at end of file reverted: --- b/core/modules/locale/locale.admin.js +++ a/core/modules/locale/locale.admin.js @@ -0,0 +1,75 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.localeTranslateDirty = { + attach: function attach() { + var form = once('localetranslatedirty', '#locale-translate-edit-form'); + + if (form.length) { + var $form = $(form); + $form.one('formUpdated.localeTranslateDirty', 'table', function () { + var $marker = $(Drupal.theme('localeTranslateChangedWarning')).hide(); + $(this).addClass('changed').before($marker); + $marker.fadeIn('slow'); + }); + $form.on('formUpdated.localeTranslateDirty', 'tr', function () { + var $row = $(this); + var rowToMark = once('localemark', $row); + var marker = Drupal.theme('localeTranslateChangedMarker'); + $row.addClass('changed'); + + if (rowToMark.length) { + $(rowToMark).find('td:first-child .js-form-item').append(marker); + } + }); + } + }, + detach: function detach(context, settings, trigger) { + if (trigger === 'unload') { + var form = once.remove('localetranslatedirty', '#locale-translate-edit-form'); + + if (form.length) { + $(form).off('formUpdated.localeTranslateDirty'); + } + } + } + }; + Drupal.behaviors.hideUpdateInformation = { + attach: function attach(context, settings) { + var table = once('expand-updates', '#locale-translation-status-form'); + + if (table.length) { + var $table = $(table); + var $tbodies = $table.find('tbody'); + $tbodies.on('click keydown', '.description', function (e) { + if (e.keyCode && e.keyCode !== 13 && e.keyCode !== 32) { + return; + } + + e.preventDefault(); + var $tr = $(this).closest('tr'); + $tr.toggleClass('expanded'); + var $localePrefix = $tr.find('.locale-translation-update__prefix'); + + if ($localePrefix.length) { + $localePrefix[0].textContent = $tr.hasClass('expanded') ? Drupal.t('Hide description') : Drupal.t('Show description'); + } + }); + $table.find('.requirements, .links').hide(); + } + } + }; + $.extend(Drupal.theme, { + localeTranslateChangedMarker: function localeTranslateChangedMarker() { + return "*"); + }, + localeTranslateChangedWarning: function localeTranslateChangedWarning() { + return "
    ".concat(Drupal.theme('localeTranslateChangedMarker'), " ").concat(Drupal.t('Changes made in this table will not be saved until the form is submitted.'), "
    "); + } + }); +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/media/js/form.js +++ a/core/modules/media/js/form.js @@ -0,0 +1,38 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.mediaFormSummaries = { + attach: function attach(context) { + $(context).find('.media-form-author').drupalSetSummary(function (context) { + var nameInput = context.querySelector('.field--name-uid input'); + var name = nameInput && nameInput.value; + var dateInput = context.querySelector('.field--name-created input'); + var date = dateInput && dateInput.value; + + if (name && date) { + return Drupal.t('By @name on @date', { + '@name': name, + '@date': date + }); + } + + if (name) { + return Drupal.t('By @name', { + '@name': name + }); + } + + if (date) { + return Drupal.t('Authored on @date', { + '@date': date + }); + } + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/media_library/js/media_library.click_to_select.js +++ a/core/modules/media_library/js/media_library.click_to_select.js @@ -0,0 +1,31 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.ClickToSelect = { + attach: function attach(context) { + $(once('media-library-click-to-select', '.js-click-to-select-trigger', context)).on('click', function (event) { + event.preventDefault(); + var $input = $(event.currentTarget).closest('.js-click-to-select').find('.js-click-to-select-checkbox input'); + $input.prop('checked', !$input.prop('checked')).trigger('change'); + }); + $(once('media-library-click-to-select', '.js-click-to-select-checkbox input', context)).on('change', function (_ref) { + var currentTarget = _ref.currentTarget; + $(currentTarget).closest('.js-click-to-select').toggleClass('checked', $(currentTarget).prop('checked')); + }).on('focus blur', function (_ref2) { + var currentTarget = _ref2.currentTarget, + type = _ref2.type; + $(currentTarget).closest('.js-click-to-select').toggleClass('is-focus', type === 'focus'); + }); + $(once('media-library-click-to-select-hover', '.js-click-to-select-trigger, .js-click-to-select-checkbox', context)).on('mouseover mouseout', function (_ref3) { + var currentTarget = _ref3.currentTarget, + type = _ref3.type; + $(currentTarget).closest('.js-click-to-select').toggleClass('is-hover', type === 'mouseover'); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/menu_ui/menu_ui.admin.js +++ a/core/modules/menu_ui/menu_ui.admin.js @@ -0,0 +1,51 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.menuUiChangeParentItems = { + attach: function attach(context, settings) { + var menu = once('menu-parent', '#edit-menu'); + + if (menu.length) { + var $menu = $(menu); + Drupal.menuUiUpdateParentList(); + $menu.on('change', 'input', Drupal.menuUiUpdateParentList); + } + } + }; + + Drupal.menuUiUpdateParentList = function () { + var $menu = $('#edit-menu'); + var values = []; + $menu.find('input:checked').each(function () { + values.push(Drupal.checkPlain(this.value)); + }); + $.ajax({ + url: "".concat(window.location.protocol, "//").concat(window.location.host).concat(Drupal.url('admin/structure/menu/parents')), + type: 'POST', + data: { + 'menus[]': values + }, + dataType: 'json', + success: function success(options) { + var $select = $('#edit-menu-parent'); + var selected = $select[0].value; + $select.children().remove(); + var totalOptions = 0; + Object.keys(options || {}).forEach(function (machineName) { + var selectContents = document.createElement('option'); + selectContents.selected = machineName === selected; + selectContents.value = machineName; + selectContents.textContent = options[machineName]; + $select.append(selectContents); + totalOptions++; + }); + $select.closest('div').toggle(totalOptions > 0).attr('hidden', totalOptions === 0); + } + }); + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/node/content_types.js +++ a/core/modules/node/content_types.js @@ -0,0 +1,52 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.contentTypes = { + attach: function attach(context) { + var $context = $(context); + $context.find('#edit-submission').drupalSetSummary(function (context) { + var vals = []; + vals.push(Drupal.checkPlain($(context).find('#edit-title-label')[0].value) || Drupal.t('Requires a title')); + return vals.join(', '); + }); + $context.find('#edit-workflow').drupalSetSummary(function (context) { + var vals = []; + $(context).find('input[name^="options"]:checked').next('label').each(function () { + vals.push(Drupal.checkPlain(this.textContent)); + }); + + if (!$(context).find('#edit-options-status').is(':checked')) { + vals.unshift(Drupal.t('Not published')); + } + + return vals.join(', '); + }); + $('#edit-language', context).drupalSetSummary(function (context) { + var vals = []; + vals.push($('.js-form-item-language-configuration-langcode select option:selected', context)[0].textContent); + $('input:checked', context).next('label').each(function () { + vals.push(Drupal.checkPlain(this.textContent)); + }); + return vals.join(', '); + }); + $context.find('#edit-display').drupalSetSummary(function (context) { + var vals = []; + var $editContext = $(context); + $editContext.find('input:checked').next('label').each(function () { + vals.push(Drupal.checkPlain(this.textContent)); + }); + + if (!$editContext.find('#edit-display-submitted').is(':checked')) { + vals.unshift(Drupal.t("Don't display post information")); + } + + return vals.join(', '); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/path/path.js +++ a/core/modules/path/path.js @@ -0,0 +1,20 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.pathDetailsSummaries = { + attach: function attach(context) { + $(context).find('.path-form').drupalSetSummary(function (context) { + var pathElement = document.querySelector('.js-form-item-path-0-alias input'); + var path = pathElement && pathElement.value; + return path ? Drupal.t('Alias: @alias', { + '@alias': path + }) : Drupal.t('No alias'); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/editors/formEditor.js +++ a/core/modules/quickedit/js/editors/formEditor.js @@ -0,0 +1,161 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, _) { + Drupal.quickedit.editors.form = Drupal.quickedit.EditorView.extend({ + $formContainer: null, + formSaveAjax: null, + stateChange: function stateChange(fieldModel, state) { + var from = fieldModel.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + break; + + case 'candidate': + if (from !== 'inactive') { + this.removeForm(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + if (from !== 'invalid') { + this.loadForm(); + } + + break; + + case 'active': + break; + + case 'changed': + break; + + case 'saving': + this.save(); + break; + + case 'saved': + break; + + case 'invalid': + this.showValidationErrors(); + break; + } + }, + getQuickEditUISettings: function getQuickEditUISettings() { + return { + padding: true, + unifiedToolbar: true, + fullWidthToolbar: true, + popup: true + }; + }, + loadForm: function loadForm() { + var fieldModel = this.fieldModel; + var id = "quickedit-form-for-".concat(fieldModel.id.replace(/[/[\]]/g, '_')); + var $formContainer = $(Drupal.theme('quickeditFormContainer', { + id: id, + loadingMsg: Drupal.t('Loading…') + })); + this.$formContainer = $formContainer; + $formContainer.find('.quickedit-form').addClass('quickedit-editable quickedit-highlighted quickedit-editing').attr('role', 'dialog'); + + if (this.$el.css('display') === 'inline') { + $formContainer.prependTo(this.$el.offsetParent()); + var pos = this.$el.position(); + $formContainer.css('left', pos.left).css('top', pos.top); + } else { + $formContainer.insertBefore(this.$el); + } + + var formOptions = { + fieldID: fieldModel.get('fieldID'), + $el: this.$el, + nocssjs: false, + reset: !fieldModel.get('entity').get('inTempStore') + }; + Drupal.quickedit.util.form.load(formOptions, function (form, ajax) { + Drupal.AjaxCommands.prototype.insert(ajax, { + data: form, + selector: "#".concat(id, " .placeholder") + }); + $formContainer.on('formUpdated.quickedit', ':input', function (event) { + var state = fieldModel.get('state'); + + if (state === 'invalid') { + fieldModel.set('state', 'activating'); + } else { + fieldModel.set('state', 'changed'); + } + }).on('keypress.quickedit', 'input', function (event) { + if (event.keyCode === 13) { + return false; + } + }); + fieldModel.set('state', 'active'); + }); + }, + removeForm: function removeForm() { + if (this.$formContainer === null) { + return; + } + + delete this.formSaveAjax; + Drupal.detachBehaviors(this.$formContainer.get(0), null, 'unload'); + this.$formContainer.off('change.quickedit', ':input').off('keypress.quickedit', 'input').remove(); + this.$formContainer = null; + }, + save: function save() { + var $formContainer = this.$formContainer; + var $submit = $formContainer.find('.quickedit-form-submit'); + var editorModel = this.model; + var fieldModel = this.fieldModel; + var formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving({ + nocssjs: false, + other_view_modes: fieldModel.findOtherViewModes() + }, $submit); + + function cleanUpAjax() { + Drupal.quickedit.util.form.unajaxifySaving(formSaveAjax); + formSaveAjax = null; + } + + formSaveAjax.commands.quickeditFieldFormSaved = function (ajax, response, status) { + cleanUpAjax(); + fieldModel.set('state', 'saved'); + fieldModel.set('htmlForOtherViewModes', response.other_view_modes); + + _.defer(function () { + fieldModel.set('html', response.data); + }); + }; + + formSaveAjax.commands.quickeditFieldFormValidationErrors = function (ajax, response, status) { + editorModel.set('validationErrors', response.data); + fieldModel.set('state', 'invalid'); + }; + + formSaveAjax.commands.quickeditFieldForm = function (ajax, response, status) { + Drupal.AjaxCommands.prototype.insert(ajax, { + data: response.data, + selector: "#".concat($formContainer.attr('id'), " form") + }); + }; + + $submit.trigger('click.quickedit'); + }, + showValidationErrors: function showValidationErrors() { + this.$formContainer.find('.quickedit-form').addClass('quickedit-validation-error').find('form').prepend(this.model.get('validationErrors')); + } + }); +})(jQuery, Drupal, _); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/editors/formattedTextEditor.js +++ a/core/modules/quickedit/js/editors/formattedTextEditor.js @@ -0,0 +1,158 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, _) { + Drupal.quickedit.editors.editor = Drupal.quickedit.EditorView.extend({ + textFormat: null, + textFormatHasTransformations: null, + textEditor: null, + $textElement: null, + initialize: function initialize(options) { + Drupal.quickedit.EditorView.prototype.initialize.call(this, options); + var metadata = Drupal.quickedit.metadata.get(this.fieldModel.get('fieldID'), 'custom'); + this.textFormat = drupalSettings.editor.formats[metadata.format]; + this.textFormatHasTransformations = metadata.formatHasTransformations; + this.textEditor = Drupal.editors[this.textFormat.editor]; + var $fieldItems = this.$el.find('.quickedit-field'); + + if ($fieldItems.length) { + this.$textElement = $fieldItems.eq(0); + } else { + this.$textElement = this.$el; + } + + this.model.set('originalValue', this.$textElement.html()); + + if (Drupal.editors && Drupal.editors.ckeditor5 && once('quickedit-ckeditor5-destroy', 'body').length) { + var ckeditor5Detach = Drupal.editors.ckeditor5.detach; + + Drupal.editors.ckeditor5.detach = function quickeditDetach(element, format, trigger) { + var destroyPromise = ckeditor5Detach.call(this, element, format, trigger); + + if (destroyPromise && destroyPromise.then) { + var textElement = null; + var originalValue = null; + + Drupal.quickedit.editors.editor.prototype.revert = function revertQuickeditChanges() { + textElement = this.$textElement[0]; + originalValue = this.model.get('originalValue'); + }; + + destroyPromise.then(function () { + if (textElement && originalValue) { + textElement.innerHTML = originalValue; + } + }); + } + }; + } + }, + getEditedElement: function getEditedElement() { + return this.$textElement; + }, + stateChange: function stateChange(fieldModel, state) { + var editorModel = this.model; + var from = fieldModel.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + break; + + case 'candidate': + if (from !== 'inactive' && from !== 'highlighted') { + this.textEditor.detach(this.$textElement.get(0), this.textFormat); + } + + if (from === 'active' && this.textFormatHasTransformations) { + this.revert(); + } + + if (from === 'invalid') { + this.removeValidationErrors(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + if (this.textFormatHasTransformations) { + var $textElement = this.$textElement; + + this._getUntransformedText(function (untransformedText) { + $textElement.html(untransformedText); + fieldModel.set('state', 'active'); + }); + } else { + _.defer(function () { + fieldModel.set('state', 'active'); + }); + } + + break; + + case 'active': + { + var textElement = this.$textElement.get(0); + var toolbarView = fieldModel.toolbarView; + this.textEditor.attachInlineEditor(textElement, this.textFormat, toolbarView.getMainWysiwygToolgroupId(), toolbarView.getFloatedWysiwygToolgroupId()); + this.textEditor.onChange(textElement, function (htmlText) { + editorModel.set('currentValue', htmlText); + fieldModel.set('state', 'changed'); + }); + break; + } + + case 'changed': + break; + + case 'saving': + if (from === 'invalid') { + this.removeValidationErrors(); + } + + this.save(); + break; + + case 'saved': + break; + + case 'invalid': + this.showValidationErrors(); + break; + } + }, + getQuickEditUISettings: function getQuickEditUISettings() { + return { + padding: true, + unifiedToolbar: true, + fullWidthToolbar: true, + popup: false + }; + }, + revert: function revert() { + this.$textElement.html(this.model.get('originalValue')); + }, + _getUntransformedText: function _getUntransformedText(callback) { + var fieldID = this.fieldModel.get('fieldID'); + var textLoaderAjax = Drupal.ajax({ + url: Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('quickedit/!entity_type/!id/!field_name/!langcode/!view_mode')), + submit: { + nocssjs: true + } + }); + + textLoaderAjax.commands.editorGetUntransformedText = function (ajax, response, status) { + callback(response.data); + }; + + textLoaderAjax.execute(); + } + }); +})(jQuery, Drupal, drupalSettings, _); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/editors/image.js +++ a/core/modules/quickedit/js/editors/image.js @@ -0,0 +1,221 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _, Drupal) { + Drupal.quickedit.editors.image = Drupal.quickedit.EditorView.extend({ + initialize: function initialize(options) { + Drupal.quickedit.EditorView.prototype.initialize.call(this, options); + this.model.set('originalValue', this.$el.html().trim()); + this.model.set('currentValue', function (index, value) { + var matches = $(this).attr('name').match(/(alt|title)]$/); + + if (matches) { + var name = matches[1]; + var $toolgroup = $("#".concat(options.fieldModel.toolbarView.getMainWysiwygToolgroupId())); + var $input = $toolgroup.find(".quickedit-image-field-info input[name=\"".concat(name, "\"]")); + + if ($input.length) { + return $input[0].value; + } + } + }); + }, + stateChange: function stateChange(fieldModel, state, options) { + var from = fieldModel.previous('state'); + + switch (state) { + case 'inactive': + break; + + case 'candidate': + if (from !== 'inactive') { + this.$el.find('.quickedit-image-dropzone').remove(); + this.$el.removeClass('quickedit-image-element'); + } + + if (from === 'invalid') { + this.removeValidationErrors(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + _.defer(function () { + fieldModel.set('state', 'active'); + }); + + break; + + case 'active': + { + var self = this; + this.$el.addClass('quickedit-image-element'); + var $dropzone = this.renderDropzone('upload', Drupal.t('Drop file here or click to upload')); + $dropzone.on('dragenter', function (e) { + $(this).addClass('hover'); + }); + $dropzone.on('dragleave', function (e) { + $(this).removeClass('hover'); + }); + $dropzone.on('drop', function (e) { + if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files.length) { + $(this).removeClass('hover'); + self.uploadImage(e.originalEvent.dataTransfer.files[0]); + } + }); + $dropzone.on('click', function (e) { + $('').trigger('click').on('change', function () { + if (this.files.length) { + self.uploadImage(this.files[0]); + } + }); + }); + $dropzone.on('dragover dragenter dragleave drop click', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + this.renderToolbar(fieldModel); + break; + } + + case 'changed': + break; + + case 'saving': + if (from === 'invalid') { + this.removeValidationErrors(); + } + + this.save(options); + break; + + case 'saved': + break; + + case 'invalid': + this.showValidationErrors(); + break; + } + }, + uploadImage: function uploadImage(file) { + this.renderDropzone('upload loading', Drupal.t('Uploading @file…', { + '@file': file.name + })); + var fieldID = this.fieldModel.get('fieldID'); + var url = Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('quickedit/image/upload/!entity_type/!id/!field_name/!langcode/!view_mode')); + var data = new FormData(); + data.append('files[image]', file); + var self = this; + this.ajax({ + type: 'POST', + url: url, + data: data, + success: function success(response) { + var $el = $(self.fieldModel.get('el')); + self.fieldModel.set('state', 'changed'); + self.fieldModel.get('entity').set('inTempStore', true); + self.removeValidationErrors(); + var $content = $(response.html).closest('[data-quickedit-field-id]').children(); + $el.empty().append($content); + } + }); + }, + ajax: function ajax(options) { + var defaultOptions = { + context: this, + dataType: 'json', + cache: false, + contentType: false, + processData: false, + error: function error() { + this.renderDropzone('error', Drupal.t('A server error has occurred.')); + } + }; + var ajaxOptions = $.extend(defaultOptions, options); + var successCallback = ajaxOptions.success; + + ajaxOptions.success = function (response) { + if (response.main_error) { + this.renderDropzone('error', response.main_error); + + if (response.errors.length) { + this.model.set('validationErrors', response.errors); + } + + this.showValidationErrors(); + } else { + successCallback(response); + } + }; + + $.ajax(ajaxOptions); + }, + renderToolbar: function renderToolbar(fieldModel) { + var $toolgroup = $("#".concat(fieldModel.toolbarView.getMainWysiwygToolgroupId())); + var $toolbar = $toolgroup.find('.quickedit-image-field-info'); + + if ($toolbar.length === 0) { + var fieldID = fieldModel.get('fieldID'); + var url = Drupal.quickedit.util.buildUrl(fieldID, Drupal.url('quickedit/image/info/!entity_type/!id/!field_name/!langcode/!view_mode')); + var self = this; + self.ajax({ + type: 'GET', + url: url, + success: function success(response) { + $toolbar = $(Drupal.theme.quickeditImageToolbar(response)); + $toolgroup.append($toolbar); + $toolbar.on('keyup paste', function () { + fieldModel.set('state', 'changed'); + }); + fieldModel.get('entity').toolbarView.position(); + } + }); + } + }, + renderDropzone: function renderDropzone(state, text) { + var $dropzone = this.$el.find('.quickedit-image-dropzone'); + + if ($dropzone.length) { + $dropzone.removeClass('upload error hover loading').addClass(".quickedit-image-dropzone ".concat(state)).children('.quickedit-image-text').html(text); + } else { + $dropzone = $(Drupal.theme('quickeditImageDropzone', { + state: state, + text: text + })); + this.$el.append($dropzone); + } + + return $dropzone; + }, + revert: function revert() { + this.$el.html(this.model.get('originalValue')); + }, + getQuickEditUISettings: function getQuickEditUISettings() { + return { + padding: false, + unifiedToolbar: true, + fullWidthToolbar: true, + popup: false + }; + }, + showValidationErrors: function showValidationErrors() { + var errors = Drupal.theme('quickeditImageErrors', { + errors: this.model.get('validationErrors') + }); + $("#".concat(this.fieldModel.toolbarView.getMainWysiwygToolgroupId())).append(errors); + this.getEditedElement().addClass('quickedit-validation-error'); + this.fieldModel.get('entity').toolbarView.position(); + }, + removeValidationErrors: function removeValidationErrors() { + $("#".concat(this.fieldModel.toolbarView.getMainWysiwygToolgroupId())).find('.quickedit-image-errors').remove(); + this.getEditedElement().removeClass('quickedit-validation-error'); + } + }); +})(jQuery, _, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/editors/plainTextEditor.js +++ a/core/modules/quickedit/js/editors/plainTextEditor.js @@ -0,0 +1,97 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _, Drupal) { + Drupal.quickedit.editors.plain_text = Drupal.quickedit.EditorView.extend({ + $textElement: null, + initialize: function initialize(options) { + Drupal.quickedit.EditorView.prototype.initialize.call(this, options); + var editorModel = this.model; + var fieldModel = this.fieldModel; + var $fieldItems = this.$el.find('.quickedit-field'); + var $textElement = $fieldItems.length ? $fieldItems.eq(0) : this.$el; + this.$textElement = $textElement; + editorModel.set('originalValue', this.$textElement[0].textContent.trim()); + var previousText = editorModel.get('originalValue'); + $textElement.on('keyup paste', function (event) { + var currentText = $textElement[0].textContent.trim(); + + if (previousText !== currentText) { + previousText = currentText; + editorModel.set('currentValue', currentText); + fieldModel.set('state', 'changed'); + } + }); + }, + getEditedElement: function getEditedElement() { + return this.$textElement; + }, + stateChange: function stateChange(fieldModel, state, options) { + var from = fieldModel.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + break; + + case 'candidate': + if (from !== 'inactive') { + this.$textElement.removeAttr('contenteditable'); + } + + if (from === 'invalid') { + this.removeValidationErrors(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + _.defer(function () { + fieldModel.set('state', 'active'); + }); + + break; + + case 'active': + this.$textElement.attr('contenteditable', 'true'); + break; + + case 'changed': + break; + + case 'saving': + if (from === 'invalid') { + this.removeValidationErrors(); + } + + this.save(options); + break; + + case 'saved': + break; + + case 'invalid': + this.showValidationErrors(); + break; + } + }, + getQuickEditUISettings: function getQuickEditUISettings() { + return { + padding: true, + unifiedToolbar: false, + fullWidthToolbar: false, + popup: false + }; + }, + revert: function revert() { + this.$textElement.html(this.model.get('originalValue')); + } + }); +})(jQuery, _, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/models/BaseModel.js +++ a/core/modules/quickedit/js/models/BaseModel.js @@ -0,0 +1,32 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } + +(function (Drupal, Backbone) { + Drupal.quickedit.BaseModel = Backbone.Model.extend({ + initialize: function initialize(options) { + this.__initialized = true; + return Backbone.Model.prototype.initialize.call(this, options); + }, + set: function set(key, val, options) { + if (this.__initialized) { + if (_typeof(key) === 'object') { + key.validate = true; + } else { + if (!options) { + options = {}; + } + + options.validate = true; + } + } + + return Backbone.Model.prototype.set.call(this, key, val, options); + } + }); +})(Drupal, Backbone); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/models/EditorModel.js +++ a/core/modules/quickedit/js/models/EditorModel.js @@ -0,0 +1,16 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Backbone, Drupal) { + Drupal.quickedit.EditorModel = Backbone.Model.extend({ + defaults: { + originalValue: null, + currentValue: null, + validationErrors: null + } + }); +})(Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/models/EntityModel.js +++ a/core/modules/quickedit/js/models/EntityModel.js @@ -0,0 +1,319 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_, $, Backbone, Drupal) { + Drupal.quickedit.EntityModel = Drupal.quickedit.BaseModel.extend({ + defaults: { + el: null, + entityID: null, + entityInstanceID: null, + id: null, + label: null, + fields: null, + isActive: false, + inTempStore: false, + isDirty: false, + isCommitting: false, + state: 'closed', + fieldsInTempStore: [], + reload: false + }, + initialize: function initialize() { + this.set('fields', new Drupal.quickedit.FieldCollection()); + this.listenTo(this, 'change:state', this.stateChange); + this.listenTo(this.get('fields'), 'change:state', this.fieldStateChange); + Drupal.quickedit.BaseModel.prototype.initialize.call(this); + }, + stateChange: function stateChange(entityModel, state, options) { + var to = state; + + switch (to) { + case 'closed': + this.set({ + isActive: false, + inTempStore: false, + isDirty: false + }); + break; + + case 'launching': + break; + + case 'opening': + entityModel.get('fields').each(function (fieldModel) { + fieldModel.set('state', 'candidate', options); + }); + break; + + case 'opened': + this.set('isActive', true); + break; + + case 'committing': + { + var fields = this.get('fields'); + fields.chain().filter(function (fieldModel) { + return _.intersection([fieldModel.get('state')], ['active']).length; + }).each(function (fieldModel) { + fieldModel.set('state', 'candidate'); + }); + fields.chain().filter(function (fieldModel) { + return _.intersection([fieldModel.get('state')], Drupal.quickedit.app.changedFieldStates).length; + }).each(function (fieldModel) { + fieldModel.set('state', 'saving'); + }); + break; + } + + case 'deactivating': + { + var changedFields = this.get('fields').filter(function (fieldModel) { + return _.intersection([fieldModel.get('state')], ['changed', 'invalid']).length; + }); + + if ((changedFields.length || this.get('fieldsInTempStore').length) && !options.saved && !options.confirmed) { + this.set('state', 'opened', { + confirming: true + }); + + _.defer(function () { + Drupal.quickedit.app.confirmEntityDeactivation(entityModel); + }); + } else { + var invalidFields = this.get('fields').filter(function (fieldModel) { + return _.intersection([fieldModel.get('state')], ['invalid']).length; + }); + entityModel.set('reload', this.get('fieldsInTempStore').length || invalidFields.length); + entityModel.get('fields').each(function (fieldModel) { + if (_.intersection([fieldModel.get('state')], ['candidate', 'highlighted']).length) { + fieldModel.trigger('change:state', fieldModel, fieldModel.get('state'), options); + } else { + fieldModel.set('state', 'candidate', options); + } + }); + } + + break; + } + + case 'closing': + options.reason = 'stop'; + this.get('fields').each(function (fieldModel) { + fieldModel.set({ + inTempStore: false, + state: 'inactive' + }, options); + }); + break; + } + }, + _updateInTempStoreAttributes: function _updateInTempStoreAttributes(entityModel, fieldModel) { + var current = fieldModel.get('state'); + var previous = fieldModel.previous('state'); + var fieldsInTempStore = entityModel.get('fieldsInTempStore'); + + if (current === 'saved') { + entityModel.set('inTempStore', true); + fieldModel.set('inTempStore', true); + fieldsInTempStore.push(fieldModel.get('fieldID')); + fieldsInTempStore = _.uniq(fieldsInTempStore); + entityModel.set('fieldsInTempStore', fieldsInTempStore); + } else if (current === 'candidate' && previous === 'inactive') { + fieldModel.set('inTempStore', _.intersection([fieldModel.get('fieldID')], fieldsInTempStore).length > 0); + } + }, + fieldStateChange: function fieldStateChange(fieldModel, state) { + var entityModel = this; + var fieldState = state; + + switch (this.get('state')) { + case 'closed': + case 'launching': + break; + + case 'opening': + _.defer(function () { + entityModel.set('state', 'opened', { + 'accept-field-states': Drupal.quickedit.app.readyFieldStates + }); + }); + + break; + + case 'opened': + if (fieldState === 'changed') { + entityModel.set('isDirty', true); + } else { + this._updateInTempStoreAttributes(entityModel, fieldModel); + } + + break; + + case 'committing': + { + if (fieldState === 'invalid') { + _.defer(function () { + entityModel.set('state', 'opened', { + reason: 'invalid' + }); + }); + } else { + this._updateInTempStoreAttributes(entityModel, fieldModel); + } + + var options = { + 'accept-field-states': Drupal.quickedit.app.readyFieldStates + }; + + if (entityModel.set('isCommitting', true, options)) { + entityModel.save({ + success: function success() { + entityModel.set({ + state: 'deactivating', + isCommitting: false + }, { + saved: true + }); + }, + error: function error() { + entityModel.set('isCommitting', false); + entityModel.set('state', 'opened', { + reason: 'networkerror' + }); + var message = Drupal.t('Your changes to @entity-title could not be saved, either due to a website problem or a network connection problem.
    Please try again.', { + '@entity-title': entityModel.get('label') + }); + Drupal.quickedit.util.networkErrorModal(Drupal.t('Network problem!'), message); + } + }); + } + + break; + } + + case 'deactivating': + _.defer(function () { + entityModel.set('state', 'closing', { + 'accept-field-states': Drupal.quickedit.app.readyFieldStates + }); + }); + + break; + + case 'closing': + _.defer(function () { + entityModel.set('state', 'closed', { + 'accept-field-states': ['inactive'] + }); + }); + + break; + } + }, + save: function save(options) { + var entityModel = this; + var entitySaverAjax = Drupal.ajax({ + url: Drupal.url("quickedit/entity/".concat(entityModel.get('entityID'))), + error: function error() { + options.error.call(entityModel); + } + }); + + entitySaverAjax.commands.quickeditEntitySaved = function (ajax, response, status) { + entityModel.get('fields').each(function (fieldModel) { + fieldModel.set('inTempStore', false); + }); + entityModel.set('inTempStore', false); + entityModel.set('fieldsInTempStore', []); + + if (options.success) { + options.success.call(entityModel); + } + }; + + entitySaverAjax.options.headers = entitySaverAjax.options.headers || {}; + entitySaverAjax.options.headers['X-Drupal-Quickedit-CSRF-Token'] = drupalSettings.quickedit.csrf_token; + entitySaverAjax.execute(); + }, + validate: function validate(attrs, options) { + var acceptedFieldStates = options['accept-field-states'] || []; + var currentState = this.get('state'); + var nextState = attrs.state; + + if (currentState !== nextState) { + if (_.indexOf(this.constructor.states, nextState) === -1) { + return "\"".concat(nextState, "\" is an invalid state"); + } + + if (!this._acceptStateChange(currentState, nextState, options)) { + return 'state change not accepted'; + } + + if (!this._fieldsHaveAcceptableStates(acceptedFieldStates)) { + return 'state change not accepted because fields are not in acceptable state'; + } + } + + var currentIsCommitting = this.get('isCommitting'); + var nextIsCommitting = attrs.isCommitting; + + if (currentIsCommitting === false && nextIsCommitting === true) { + if (!this._fieldsHaveAcceptableStates(acceptedFieldStates)) { + return 'isCommitting change not accepted because fields are not in acceptable state'; + } + } else if (currentIsCommitting === true && nextIsCommitting === true) { + return 'isCommitting is a mutex, hence only changes are allowed'; + } + }, + _acceptStateChange: function _acceptStateChange(from, to, context) { + var accept = true; + + if (!this.constructor.followsStateSequence(from, to)) { + accept = false; + + if (from === 'closing' && to === 'closed') { + accept = true; + } else if (from === 'committing' && to === 'opened' && context.reason && (context.reason === 'invalid' || context.reason === 'networkerror')) { + accept = true; + } else if (from === 'deactivating' && to === 'opened' && context.confirming) { + accept = true; + } else if (from === 'opened' && to === 'deactivating' && context.confirmed) { + accept = true; + } + } + + return accept; + }, + _fieldsHaveAcceptableStates: function _fieldsHaveAcceptableStates(acceptedFieldStates) { + var accept = true; + + if (acceptedFieldStates.length > 0) { + var fieldStates = this.get('fields').pluck('state') || []; + + if (_.difference(fieldStates, acceptedFieldStates).length) { + accept = false; + } + } + + return accept; + }, + destroy: function destroy(options) { + Drupal.quickedit.BaseModel.prototype.destroy.call(this, options); + this.stopListening(); + this.get('fields').reset(); + }, + sync: function sync() {} + }, { + states: ['closed', 'launching', 'opening', 'opened', 'committing', 'deactivating', 'closing'], + followsStateSequence: function followsStateSequence(from, to) { + return _.indexOf(this.states, from) < _.indexOf(this.states, to); + } + }); + Drupal.quickedit.EntityCollection = Backbone.Collection.extend({ + model: Drupal.quickedit.EntityModel + }); +})(_, jQuery, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/models/FieldModel.js +++ a/core/modules/quickedit/js/models/FieldModel.js @@ -0,0 +1,79 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_, Backbone, Drupal) { + Drupal.quickedit.FieldModel = Drupal.quickedit.BaseModel.extend({ + defaults: { + el: null, + fieldID: null, + id: null, + entity: null, + metadata: null, + acceptStateChange: null, + logicalFieldID: null, + state: 'inactive', + isChanged: false, + inTempStore: false, + html: null, + htmlForOtherViewModes: null + }, + initialize: function initialize(options) { + this.set('html', options.el.outerHTML); + this.get('entity').get('fields').add(this); + this.set('logicalFieldID', this.get('fieldID').split('/').slice(0, 4).join('/')); + Drupal.quickedit.BaseModel.prototype.initialize.call(this, options); + }, + destroy: function destroy(options) { + if (this.get('state') !== 'inactive') { + throw new Error('FieldModel cannot be destroyed if it is not inactive state.'); + } + + Drupal.quickedit.BaseModel.prototype.destroy.call(this, options); + }, + sync: function sync() {}, + validate: function validate(attrs, options) { + var current = this.get('state'); + var next = attrs.state; + + if (current !== next) { + if (_.indexOf(this.constructor.states, next) === -1) { + return "\"".concat(next, "\" is an invalid state"); + } + + if (!this.get('acceptStateChange')(current, next, options, this)) { + return 'state change not accepted'; + } + } + }, + getEntityID: function getEntityID() { + return this.get('fieldID').split('/').slice(0, 2).join('/'); + }, + getViewMode: function getViewMode() { + return this.get('fieldID').split('/').pop(); + }, + findOtherViewModes: function findOtherViewModes() { + var currentField = this; + var otherViewModes = []; + Drupal.quickedit.collections.fields.where({ + logicalFieldID: currentField.get('logicalFieldID') + }).forEach(function (field) { + if (field !== currentField && field.get('fieldID') !== currentField.get('fieldID')) { + otherViewModes.push(field.getViewMode()); + } + }); + return otherViewModes; + } + }, { + states: ['inactive', 'candidate', 'highlighted', 'activating', 'active', 'changed', 'saving', 'saved', 'invalid'], + followsStateSequence: function followsStateSequence(from, to) { + return _.indexOf(this.states, from) < _.indexOf(this.states, to); + } + }); + Drupal.quickedit.FieldCollection = Backbone.Collection.extend({ + model: Drupal.quickedit.FieldModel + }); +})(_, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/ContextualLinkView.js +++ a/core/modules/quickedit/js/views/ContextualLinkView.js @@ -0,0 +1,37 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Backbone, Drupal) { + Drupal.quickedit.ContextualLinkView = Backbone.View.extend({ + events: function events() { + function touchEndToClick(event) { + event.preventDefault(); + event.target.click(); + } + + return { + 'click a': function clickA(event) { + event.preventDefault(); + this.model.set('state', 'launching'); + }, + 'touchEnd a': touchEndToClick + }; + }, + initialize: function initialize(options) { + this.$el.find('a').each(function (index, element) { + element.textContent = options.strings.quickEdit; + }); + this.render(); + this.listenTo(this.model, 'change:isActive', this.render); + }, + render: function render(entityModel, isActive) { + this.$el.find('a').attr('aria-pressed', isActive); + this.$el.closest('.contextual').toggle(!isActive); + return this; + } + }); +})(jQuery, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/EditorView.js +++ a/core/modules/quickedit/js/views/EditorView.js @@ -0,0 +1,142 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Backbone, Drupal) { + Drupal.quickedit.EditorView = Backbone.View.extend({ + initialize: function initialize(options) { + this.fieldModel = options.fieldModel; + this.listenTo(this.fieldModel, 'change:state', this.stateChange); + }, + remove: function remove() { + this.setElement(); + Backbone.View.prototype.remove.call(this); + }, + getEditedElement: function getEditedElement() { + return this.$el; + }, + getQuickEditUISettings: function getQuickEditUISettings() { + return { + padding: false, + unifiedToolbar: false, + fullWidthToolbar: false, + popup: false + }; + }, + stateChange: function stateChange(fieldModel, state) { + var from = fieldModel.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + break; + + case 'candidate': + if (from === 'invalid') { + this.removeValidationErrors(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + { + var loadDependencies = function loadDependencies(callback) { + callback(); + }; + + loadDependencies(function () { + fieldModel.set('state', 'active'); + }); + break; + } + + case 'active': + break; + + case 'changed': + break; + + case 'saving': + if (from === 'invalid') { + this.removeValidationErrors(); + } + + this.save(); + break; + + case 'saved': + break; + + case 'invalid': + this.showValidationErrors(); + break; + } + }, + revert: function revert() {}, + save: function save() { + var fieldModel = this.fieldModel; + var editorModel = this.model; + var backstageId = "quickedit_backstage-".concat(this.fieldModel.id.replace(/[/[\]_\s]/g, '-')); + + function fillAndSubmitForm(value) { + var $form = $("#".concat(backstageId)).find('form'); + $form.find(':input[type!="hidden"][type!="submit"]:not(select)').not('[name$="\\[summary\\]"]').val(value); + $form.find('.quickedit-form-submit').trigger('click.quickedit'); + } + + var formOptions = { + fieldID: this.fieldModel.get('fieldID'), + $el: this.$el, + nocssjs: true, + other_view_modes: fieldModel.findOtherViewModes(), + reset: !this.fieldModel.get('entity').get('inTempStore') + }; + var self = this; + Drupal.quickedit.util.form.load(formOptions, function (form, ajax) { + var $backstage = $(Drupal.theme('quickeditBackstage', { + id: backstageId + })).appendTo('body'); + var $form = $(form).appendTo($backstage); + $form.prop('novalidate', true); + var $submit = $form.find('.quickedit-form-submit'); + self.formSaveAjax = Drupal.quickedit.util.form.ajaxifySaving(formOptions, $submit); + + function removeHiddenForm() { + Drupal.quickedit.util.form.unajaxifySaving(self.formSaveAjax); + delete self.formSaveAjax; + $backstage.remove(); + } + + self.formSaveAjax.commands.quickeditFieldFormSaved = function (ajax, response, status) { + removeHiddenForm(); + fieldModel.set('state', 'saved'); + fieldModel.set('htmlForOtherViewModes', response.other_view_modes); + fieldModel.set('html', response.data); + }; + + self.formSaveAjax.commands.quickeditFieldFormValidationErrors = function (ajax, response, status) { + removeHiddenForm(); + editorModel.set('validationErrors', response.data); + fieldModel.set('state', 'invalid'); + }; + + self.formSaveAjax.commands.quickeditFieldForm = function () {}; + + fillAndSubmitForm(editorModel.get('currentValue')); + }); + }, + showValidationErrors: function showValidationErrors() { + var $errors = $('
    ').append(this.model.get('validationErrors')); + this.getEditedElement().addClass('quickedit-validation-error').after($errors); + }, + removeValidationErrors: function removeValidationErrors() { + this.getEditedElement().removeClass('quickedit-validation-error').next('.quickedit-validation-errors').remove(); + } + }); +})(jQuery, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/EntityDecorationView.js +++ a/core/modules/quickedit/js/views/EntityDecorationView.js @@ -0,0 +1,21 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, $, Backbone) { + Drupal.quickedit.EntityDecorationView = Backbone.View.extend({ + initialize: function initialize() { + this.listenTo(this.model, 'change', this.render); + }, + render: function render() { + this.$el.toggleClass('quickedit-entity-active', this.model.get('isActive')); + }, + remove: function remove() { + this.setElement(null); + Backbone.View.prototype.remove.call(this); + } + }); +})(Drupal, jQuery, Backbone); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/EntityToolbarView.js +++ a/core/modules/quickedit/js/views/EntityToolbarView.js @@ -0,0 +1,295 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _, Backbone, Drupal, debounce, Popper) { + Drupal.quickedit.EntityToolbarView = Backbone.View.extend({ + _fieldToolbarRoot: null, + events: function events() { + var map = { + 'click button.action-save': 'onClickSave', + 'click button.action-cancel': 'onClickCancel', + mouseenter: 'onMouseenter' + }; + return map; + }, + initialize: function initialize(options) { + var that = this; + this.appModel = options.appModel; + this.$entity = $(this.model.get('el')); + this.listenTo(this.model, 'change:isActive change:isDirty change:state', this.render); + this.listenTo(this.appModel, 'change:highlightedField change:activeField', this.render); + this.listenTo(this.model.get('fields'), 'change:state', this.fieldStateChange); + $(window).on('resize.quickedit scroll.quickedit drupalViewportOffsetChange.quickedit', debounce($.proxy(this.windowChangeHandler, this), 150)); + $(document).on('drupalViewportOffsetChange.quickedit', function (event, offsets) { + if (that.$fence) { + that.$fence.css(offsets); + } + }); + var $toolbar = this.buildToolbarEl(); + this.setElement($toolbar); + this._fieldToolbarRoot = $toolbar.find('.quickedit-toolbar-field').get(0); + this.render(); + }, + render: function render() { + if (this.model.get('isActive')) { + var $body = $('body'); + + if ($body.children('#quickedit-entity-toolbar').length === 0) { + $body.append(this.$el); + } + + if ($body.children('#quickedit-toolbar-fence').length === 0) { + this.$fence = $(Drupal.theme('quickeditEntityToolbarFence')).css(Drupal.displace()).appendTo($body); + } + + this.label(); + this.show('ops'); + this.position(); + } + + var $button = this.$el.find('.quickedit-button.action-save'); + var isDirty = this.model.get('isDirty'); + + switch (this.model.get('state')) { + case 'opened': + $button[0].textContent = Drupal.t('Save'); + $button.removeClass('action-saving icon-throbber icon-end').removeAttr('disabled').attr('aria-hidden', !isDirty); + break; + + case 'committing': + $button[0].textContent = Drupal.t('Saving'); + $button.addClass('action-saving icon-throbber icon-end').attr('disabled', 'disabled'); + break; + + default: + $button.attr('aria-hidden', true); + break; + } + + return this; + }, + remove: function remove() { + this.$fence.remove(); + $(window).off('resize.quickedit scroll.quickedit drupalViewportOffsetChange.quickedit'); + $(document).off('drupalViewportOffsetChange.quickedit'); + Backbone.View.prototype.remove.call(this); + }, + windowChangeHandler: function windowChangeHandler(event) { + this.position(); + }, + fieldStateChange: function fieldStateChange(model, state) { + switch (state) { + case 'active': + this.render(); + break; + + case 'invalid': + this.render(); + break; + } + }, + position: function position(element) { + clearTimeout(this.timer); + var that = this; + var edge = document.documentElement.dir === 'rtl' ? 'right' : 'left'; + var delay = 0; + var check = 0; + var horizontalPadding = 0; + var of; + var activeField; + var highlightedField; + + do { + switch (check) { + case 0: + of = element; + break; + + case 1: + activeField = Drupal.quickedit.app.model.get('activeField'); + of = activeField && activeField.editorView && activeField.editorView.$formContainer && activeField.editorView.$formContainer.find('.quickedit-form'); + break; + + case 2: + of = activeField && activeField.editorView && activeField.editorView.getEditedElement(); + + if (activeField && activeField.editorView && activeField.editorView.getQuickEditUISettings().padding) { + horizontalPadding = 5; + } + + break; + + case 3: + highlightedField = Drupal.quickedit.app.model.get('highlightedField'); + of = highlightedField && highlightedField.editorView && highlightedField.editorView.getEditedElement(); + delay = 250; + break; + + default: + { + var fieldModels = this.model.get('fields').models; + var topMostPosition = 1000000; + var topMostField = null; + + for (var i = 0; i < fieldModels.length; i++) { + var pos = fieldModels[i].get('el').getBoundingClientRect().top; + + if (pos < topMostPosition) { + topMostPosition = pos; + topMostField = fieldModels[i]; + } + } + + of = topMostField.get('el'); + delay = 50; + break; + } + } + + check++; + } while (!of); + + function refinePopper(_ref) { + var state = _ref.state; + var isBelow = state.placement.split('-')[0] === 'bottom'; + var classListMethod = isBelow ? 'add' : 'remove'; + state.elements.popper.classList[classListMethod]('quickedit-toolbar-pointer-top'); + } + + function positionToolbar() { + var popperElement = that.el; + var referenceElement = of; + var boundariesElement = that.$fence[0]; + var popperedge = edge === 'left' ? 'start' : 'end'; + + if (referenceElement !== undefined) { + if (!popperElement.classList.contains('js-popper-processed')) { + that.popper = Popper.createPopper(referenceElement, popperElement, { + placement: "top-".concat(popperedge), + modifiers: [{ + name: 'flip', + options: { + boundary: boundariesElement + } + }, { + name: 'preventOverflow', + options: { + boundary: boundariesElement, + tether: false, + altAxis: true, + padding: { + top: 5, + bottom: 5 + } + } + }, { + name: 'computeStyles', + options: { + adaptive: false + } + }, { + name: 'refinePopper', + phase: 'write', + enabled: true, + fn: refinePopper + }] + }); + popperElement.classList.add('js-popper-processed'); + } else { + that.popper.state.elements.reference = referenceElement[0] ? referenceElement[0] : referenceElement; + that.popper.forceUpdate(); + } + } + + that.$el.css({ + 'max-width': document.documentElement.clientWidth < 450 ? document.documentElement.clientWidth : 450, + 'min-width': document.documentElement.clientWidth < 240 ? document.documentElement.clientWidth : 240, + width: '100%' + }); + } + + this.timer = setTimeout(function () { + _.defer(positionToolbar); + }, delay); + }, + onClickSave: function onClickSave(event) { + event.stopPropagation(); + event.preventDefault(); + this.model.set('state', 'committing'); + }, + onClickCancel: function onClickCancel(event) { + event.preventDefault(); + this.model.set('state', 'deactivating'); + }, + onMouseenter: function onMouseenter(event) { + clearTimeout(this.timer); + }, + buildToolbarEl: function buildToolbarEl() { + var $toolbar = $(Drupal.theme('quickeditEntityToolbar', { + id: 'quickedit-entity-toolbar' + })); + $toolbar.find('.quickedit-toolbar-entity').prepend(Drupal.theme('quickeditToolgroup', { + classes: ['ops'], + buttons: [{ + label: Drupal.t('Save'), + type: 'submit', + classes: 'action-save quickedit-button icon', + attributes: { + 'aria-hidden': true + } + }, { + label: Drupal.t('Close'), + classes: 'action-cancel quickedit-button icon icon-close icon-only' + }] + })); + $toolbar.css({ + left: this.$entity.offset().left, + top: this.$entity.offset().top + }); + return $toolbar; + }, + getToolbarRoot: function getToolbarRoot() { + return this._fieldToolbarRoot; + }, + label: function label() { + var label = ''; + var entityLabel = this.model.get('label'); + var activeField = Drupal.quickedit.app.model.get('activeField'); + var activeFieldLabel = activeField && activeField.get('metadata').label; + var highlightedField = Drupal.quickedit.app.model.get('highlightedField'); + var highlightedFieldLabel = highlightedField && highlightedField.get('metadata').label; + + if (activeFieldLabel) { + label = Drupal.theme('quickeditEntityToolbarLabel', { + entityLabel: entityLabel, + fieldLabel: activeFieldLabel + }); + } else if (highlightedFieldLabel) { + label = Drupal.theme('quickeditEntityToolbarLabel', { + entityLabel: entityLabel, + fieldLabel: highlightedFieldLabel + }); + } else { + label = Drupal.checkPlain(entityLabel); + } + + this.$el.find('.quickedit-toolbar-label').html(label); + }, + addClass: function addClass(toolgroup, classes) { + this._find(toolgroup).addClass(classes); + }, + removeClass: function removeClass(toolgroup, classes) { + this._find(toolgroup).removeClass(classes); + }, + _find: function _find(toolgroup) { + return this.$el.find(".quickedit-toolbar .quickedit-toolgroup.".concat(toolgroup)); + }, + show: function show(toolgroup) { + this.$el.removeClass('quickedit-animate-invisible'); + } + }); +})(jQuery, _, Backbone, Drupal, Drupal.debounce, Popper); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/FieldDecorationView.js +++ a/core/modules/quickedit/js/views/FieldDecorationView.js @@ -0,0 +1,211 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Backbone, Drupal) { + Drupal.quickedit.FieldDecorationView = Backbone.View.extend({ + _widthAttributeIsEmpty: null, + events: { + 'mouseenter.quickedit': 'onMouseEnter', + 'mouseleave.quickedit': 'onMouseLeave', + click: 'onClick', + 'tabIn.quickedit': 'onMouseEnter', + 'tabOut.quickedit': 'onMouseLeave' + }, + initialize: function initialize(options) { + this.editorView = options.editorView; + this.listenTo(this.model, 'change:state', this.stateChange); + this.listenTo(this.model, 'change:isChanged change:inTempStore', this.renderChanged); + }, + remove: function remove() { + this.setElement(); + Backbone.View.prototype.remove.call(this); + }, + stateChange: function stateChange(model, state) { + var from = model.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + this.undecorate(); + break; + + case 'candidate': + this.decorate(); + + if (from !== 'inactive') { + this.stopHighlight(); + + if (from !== 'highlighted') { + this.model.set('isChanged', false); + this.stopEdit(); + } + } + + this._unpad(); + + break; + + case 'highlighted': + this.startHighlight(); + break; + + case 'activating': + this.prepareEdit(); + break; + + case 'active': + if (from !== 'activating') { + this.prepareEdit(); + } + + if (this.editorView.getQuickEditUISettings().padding) { + this._pad(); + } + + break; + + case 'changed': + this.model.set('isChanged', true); + break; + + case 'saving': + break; + + case 'saved': + break; + + case 'invalid': + break; + } + }, + renderChanged: function renderChanged() { + this.$el.toggleClass('quickedit-changed', this.model.get('isChanged') || this.model.get('inTempStore')); + }, + onMouseEnter: function onMouseEnter(event) { + var that = this; + that.model.set('state', 'highlighted'); + event.stopPropagation(); + }, + onMouseLeave: function onMouseLeave(event) { + var that = this; + that.model.set('state', 'candidate', { + reason: 'mouseleave' + }); + event.stopPropagation(); + }, + onClick: function onClick(event) { + this.model.set('state', 'activating'); + event.preventDefault(); + event.stopPropagation(); + }, + decorate: function decorate() { + this.$el.addClass('quickedit-candidate quickedit-editable'); + }, + undecorate: function undecorate() { + this.$el.removeClass('quickedit-candidate quickedit-editable quickedit-highlighted quickedit-editing'); + }, + startHighlight: function startHighlight() { + var that = this; + that.$el.addClass('quickedit-highlighted'); + }, + stopHighlight: function stopHighlight() { + this.$el.removeClass('quickedit-highlighted'); + }, + prepareEdit: function prepareEdit() { + this.$el.addClass('quickedit-editing'); + + if (this.editorView.getQuickEditUISettings().popup) { + this.$el.addClass('quickedit-editor-is-popup'); + } + }, + stopEdit: function stopEdit() { + this.$el.removeClass('quickedit-highlighted quickedit-editing'); + + if (this.editorView.getQuickEditUISettings().popup) { + this.$el.removeClass('quickedit-editor-is-popup'); + } + + $('.quickedit-candidate').addClass('quickedit-editable'); + }, + _pad: function _pad() { + if (this.$el.data('quickedit-padded')) { + return; + } + + var self = this; + + if (this.$el[0].style.width === '') { + this._widthAttributeIsEmpty = true; + this.$el.addClass('quickedit-animate-disable-width').css('width', this.$el.width()); + } + + var posProp = this._getPositionProperties(this.$el); + + setTimeout(function () { + self.$el.removeClass('quickedit-animate-disable-width'); + self.$el.css({ + position: 'relative', + top: "".concat(posProp.top - 5, "px"), + left: "".concat(posProp.left - 5, "px"), + 'padding-top': "".concat(posProp['padding-top'] + 5, "px"), + 'padding-left': "".concat(posProp['padding-left'] + 5, "px"), + 'padding-right': "".concat(posProp['padding-right'] + 5, "px"), + 'padding-bottom': "".concat(posProp['padding-bottom'] + 5, "px"), + 'margin-bottom': "".concat(posProp['margin-bottom'] - 10, "px") + }).data('quickedit-padded', true); + }, 0); + }, + _unpad: function _unpad() { + if (!this.$el.data('quickedit-padded')) { + return; + } + + var self = this; + + if (this._widthAttributeIsEmpty) { + this.$el.addClass('quickedit-animate-disable-width').css('width', ''); + } + + var posProp = this._getPositionProperties(this.$el); + + setTimeout(function () { + self.$el.removeClass('quickedit-animate-disable-width'); + self.$el.css({ + position: 'relative', + top: "".concat(posProp.top + 5, "px"), + left: "".concat(posProp.left + 5, "px"), + 'padding-top': "".concat(posProp['padding-top'] - 5, "px"), + 'padding-left': "".concat(posProp['padding-left'] - 5, "px"), + 'padding-right': "".concat(posProp['padding-right'] - 5, "px"), + 'padding-bottom': "".concat(posProp['padding-bottom'] - 5, "px"), + 'margin-bottom': "".concat(posProp['margin-bottom'] + 10, "px") + }); + }, 0); + this.$el.removeData('quickedit-padded'); + }, + _getPositionProperties: function _getPositionProperties($e) { + var p; + var r = {}; + var props = ['top', 'left', 'bottom', 'right', 'padding-top', 'padding-left', 'padding-right', 'padding-bottom', 'margin-bottom']; + var propCount = props.length; + + for (var i = 0; i < propCount; i++) { + p = props[i]; + r[p] = parseInt(this._replaceBlankPosition($e.css(p)), 10); + } + + return r; + }, + _replaceBlankPosition: function _replaceBlankPosition(pos) { + if (pos === 'auto' || !pos) { + pos = '0px'; + } + + return pos; + } + }); +})(jQuery, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/quickedit/js/views/FieldToolbarView.js +++ a/core/modules/quickedit/js/views/FieldToolbarView.js @@ -0,0 +1,111 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _, Backbone, Drupal) { + Drupal.quickedit.FieldToolbarView = Backbone.View.extend({ + $editedElement: null, + editorView: null, + _id: null, + initialize: function initialize(options) { + this.$editedElement = options.$editedElement; + this.editorView = options.editorView; + this.$root = this.$el; + this._id = "quickedit-toolbar-for-".concat(this.model.id.replace(/[/[\]]/g, '_')); + this.listenTo(this.model, 'change:state', this.stateChange); + }, + render: function render() { + this.setElement($(Drupal.theme('quickeditFieldToolbar', { + id: this._id + }))); + this.$el.prependTo(this.$root); + return this; + }, + stateChange: function stateChange(model, state) { + var from = model.previous('state'); + var to = state; + + switch (to) { + case 'inactive': + break; + + case 'candidate': + if (from !== 'inactive' && from !== 'highlighted') { + this.$el.remove(); + this.setElement(); + } + + break; + + case 'highlighted': + break; + + case 'activating': + this.render(); + + if (this.editorView.getQuickEditUISettings().fullWidthToolbar) { + this.$el.addClass('quickedit-toolbar-fullwidth'); + } + + if (this.editorView.getQuickEditUISettings().unifiedToolbar) { + this.insertWYSIWYGToolGroups(); + } + + break; + + case 'active': + break; + + case 'changed': + break; + + case 'saving': + break; + + case 'saved': + break; + + case 'invalid': + break; + } + }, + insertWYSIWYGToolGroups: function insertWYSIWYGToolGroups() { + this.$el.append(Drupal.theme('quickeditToolgroup', { + id: this.getFloatedWysiwygToolgroupId(), + classes: ['wysiwyg-floated', 'quickedit-animate-slow', 'quickedit-animate-invisible', 'quickedit-animate-delay-veryfast'], + buttons: [] + })).append(Drupal.theme('quickeditToolgroup', { + id: this.getMainWysiwygToolgroupId(), + classes: ['wysiwyg-main', 'quickedit-animate-slow', 'quickedit-animate-invisible', 'quickedit-animate-delay-veryfast'], + buttons: [] + })); + this.show('wysiwyg-floated'); + this.show('wysiwyg-main'); + }, + getId: function getId() { + return "quickedit-toolbar-for-".concat(this._id); + }, + getFloatedWysiwygToolgroupId: function getFloatedWysiwygToolgroupId() { + return "quickedit-wysiwyg-floated-toolgroup-for-".concat(this._id); + }, + getMainWysiwygToolgroupId: function getMainWysiwygToolgroupId() { + return "quickedit-wysiwyg-main-toolgroup-for-".concat(this._id); + }, + _find: function _find(toolgroup) { + return this.$el.find(".quickedit-toolgroup.".concat(toolgroup)); + }, + show: function show(toolgroup) { + var $group = this._find(toolgroup); + + $group.on(Drupal.quickedit.util.constants.transitionEnd, function (event) { + $group.off(Drupal.quickedit.util.constants.transitionEnd); + }); + window.setTimeout(function () { + $group.removeClass('quickedit-animate-invisible'); + }, 0); + } + }); +})(jQuery, _, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/responsive_image/js/responsive_image.ajax.js +++ a/core/modules/responsive_image/js/responsive_image.ajax.js @@ -0,0 +1,16 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.behaviors.responsiveImageAJAX = { + attach: function attach() { + if (window.picturefill) { + window.picturefill(); + } + } + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/settings_tray/js/settings_tray.js +++ a/core/modules/settings_tray/js/settings_tray.js @@ -0,0 +1,167 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + var blockConfigureSelector = '[data-settings-tray-edit]'; + var toggleEditSelector = '[data-drupal-settingstray="toggle"]'; + var itemsToToggleSelector = '[data-off-canvas-main-canvas], #toolbar-bar, [data-drupal-settingstray="editable"] a, [data-drupal-settingstray="editable"] button'; + var contextualItemsSelector = '[data-contextual-id] a, [data-contextual-id] button'; + var quickEditItemSelector = '[data-quickedit-entity-id]'; + + function preventClick(event) { + if ($(event.target).closest('.contextual-links').length) { + return; + } + + event.preventDefault(); + } + + function closeToolbarTrays() { + $(Drupal.toolbar.models.toolbarModel.get('activeTab')).trigger('click'); + } + + function disableQuickEdit() { + $('.quickedit-toolbar button.action-cancel').trigger('click'); + } + + function closeOffCanvas() { + $('.ui-dialog-off-canvas .ui-dialog-titlebar-close').trigger('click'); + } + + function getItemsToToggle() { + return $(itemsToToggleSelector).not(contextualItemsSelector); + } + + function setEditModeState(editMode) { + if (!document.querySelector('[data-off-canvas-main-canvas]')) { + throw new Error('data-off-canvas-main-canvas is missing from settings-tray-page-wrapper.html.twig'); + } + + editMode = !!editMode; + var $editables; + var editButton = document.querySelector(toggleEditSelector); + + if (editMode) { + if (editButton) { + editButton.textContent = Drupal.t('Editing'); + } + + closeToolbarTrays(); + $editables = $(once('settingstray', '[data-drupal-settingstray="editable"]')); + + if ($editables.length) { + document.querySelector('[data-off-canvas-main-canvas]').addEventListener('click', preventClick, true); + $editables.not(contextualItemsSelector).on('click.settingstray', function (e) { + if ($(e.target).closest('.contextual').length || !localStorage.getItem('Drupal.contextualToolbar.isViewing')) { + return; + } + + $(e.currentTarget).find(blockConfigureSelector).trigger('click'); + disableQuickEdit(); + }); + $(quickEditItemSelector).not(contextualItemsSelector).on('click.settingstray', function (e) { + if (!$(e.target).parent().hasClass('contextual') || $(e.target).parent().hasClass('quickedit')) { + closeOffCanvas(); + } + + if ($(e.target).parent().hasClass('contextual') || $(e.target).parent().hasClass('quickedit')) { + return; + } + + $(e.currentTarget).find('li.quickedit a').trigger('click'); + }); + } + } else { + $editables = $(once.remove('settingstray', '[data-drupal-settingstray="editable"]')); + + if ($editables.length) { + document.querySelector('[data-off-canvas-main-canvas]').removeEventListener('click', preventClick, true); + $editables.off('.settingstray'); + $(quickEditItemSelector).off('.settingstray'); + } + + if (editButton) { + editButton.textContent = Drupal.t('Edit'); + } + + closeOffCanvas(); + disableQuickEdit(); + } + + getItemsToToggle().toggleClass('js-settings-tray-edit-mode', editMode); + $('.edit-mode-inactive').toggleClass('visually-hidden', editMode); + } + + function isInEditMode() { + return $('#toolbar-bar').hasClass('js-settings-tray-edit-mode'); + } + + function toggleEditMode() { + setEditModeState(!isInEditMode()); + } + + function prepareAjaxLinks() { + Drupal.ajax.instances.filter(function (instance) { + return instance && $(instance.element).attr('data-dialog-renderer') === 'off_canvas'; + }).forEach(function (instance) { + if (!instance.options.data.hasOwnProperty('dialogOptions')) { + instance.options.data.dialogOptions = {}; + } + + instance.options.data.dialogOptions.settingsTrayActiveEditableId = $(instance.element).parents('.settings-tray-editable').attr('id'); + instance.progress = { + type: 'fullscreen' + }; + }); + } + + $(document).on('drupalContextualLinkAdded', function (event, data) { + prepareAjaxLinks(); + once('settings_tray.edit_mode_init', 'body').forEach(function () { + var editMode = localStorage.getItem('Drupal.contextualToolbar.isViewing') === 'false'; + + if (editMode) { + setEditModeState(true); + } + }); + data.$el.find(blockConfigureSelector).on('click.settingstray', function () { + if (!isInEditMode()) { + $(toggleEditSelector).trigger('click').trigger('click.settings_tray'); + } + + disableQuickEdit(); + }); + }); + $(document).on('keyup.settingstray', function (e) { + if (isInEditMode() && e.keyCode === 27) { + Drupal.announce(Drupal.t('Exited edit mode.')); + toggleEditMode(); + } + }); + Drupal.behaviors.toggleEditMode = { + attach: function attach() { + $(once('settingstray', toggleEditSelector)).on('click.settingstray', toggleEditMode); + } + }; + $(window).on({ + 'dialog:beforecreate': function dialogBeforecreate(event, dialog, $element, settings) { + if ($element.is('#drupal-off-canvas')) { + $('body .settings-tray-active-editable').removeClass('settings-tray-active-editable'); + var $activeElement = $("#".concat(settings.settingsTrayActiveEditableId)); + + if ($activeElement.length) { + $activeElement.addClass('settings-tray-active-editable'); + } + } + }, + 'dialog:beforeclose': function dialogBeforeclose(event, dialog, $element) { + if ($element.is('#drupal-off-canvas')) { + $('body .settings-tray-active-editable').removeClass('settings-tray-active-editable'); + } + } + }); +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/statistics/statistics.js +++ a/core/modules/statistics/statistics.js @@ -0,0 +1,17 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + $(document).ready(function () { + $.ajax({ + type: 'POST', + cache: false, + url: drupalSettings.statistics.url, + data: drupalSettings.statistics.data + }); + }); +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/system/js/system.date.js +++ a/core/modules/system/js/system.date.js @@ -0,0 +1,35 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + var dateFormats = drupalSettings.dateFormats; + Drupal.behaviors.dateFormat = { + attach: function attach(context) { + var source = once('dateFormat', '[data-drupal-date-formatter="source"]', context); + var target = once('dateFormat', '[data-drupal-date-formatter="preview"]', context); + + if (!source.length || !target.length) { + return; + } + + function dateFormatHandler(e) { + var baseValue = e.target.value || ''; + var dateString = baseValue.replace(/\\?(.?)/gi, function (key, value) { + return dateFormats[key] ? dateFormats[key] : value; + }); + target.forEach(function (item) { + item.querySelectorAll('em').forEach(function (em) { + em.textContent = dateString; + }); + }); + $(target).toggleClass('js-hide', !dateString.length); + } + + $(source).on('keyup.dateFormat change.dateFormat input.dateFormat', dateFormatHandler).trigger('keyup'); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/ajax_test/js/focus-ajax.js +++ a/core/modules/system/tests/modules/ajax_test/js/focus-ajax.js @@ -0,0 +1,21 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.behaviors.focusFirstTest = { + attach: function attach() { + once('focusin', document.body).forEach(function (element) { + element.addEventListener('focusin', function (e) { + document.querySelectorAll('[data-has-focus]').forEach(function (wasFocused) { + wasFocused.removeAttribute('data-has-focus'); + }); + e.target.setAttribute('data-has-focus', true); + }); + }); + } + }; +})(Drupal, once); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/ajax_test/js/insert-ajax.js +++ a/core/modules/system/tests/modules/ajax_test/js/insert-ajax.js @@ -0,0 +1,40 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, window, Drupal) { + Drupal.behaviors.insertTest = { + attach: function attach(context) { + $(once('ajax-insert', '.ajax-insert')).on('click', function (event) { + event.preventDefault(); + var ajaxSettings = { + url: event.currentTarget.getAttribute('href'), + wrapper: 'ajax-target', + base: false, + element: false, + method: event.currentTarget.getAttribute('data-method'), + effect: event.currentTarget.getAttribute('data-effect') + }; + var myAjaxObject = Drupal.ajax(ajaxSettings); + myAjaxObject.execute(); + }); + $(once('ajax-insert', '.ajax-insert-inline')).on('click', function (event) { + event.preventDefault(); + var ajaxSettings = { + url: event.currentTarget.getAttribute('href'), + wrapper: 'ajax-target-inline', + base: false, + element: false, + method: event.currentTarget.getAttribute('data-method'), + effect: event.currentTarget.getAttribute('data-effect') + }; + var myAjaxObject = Drupal.ajax(ajaxSettings); + myAjaxObject.execute(); + }); + $(context).addClass('processed'); + } + }; +})(jQuery, window, Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.js +++ a/core/modules/system/tests/modules/css_disable_transitions_test/js/disable_transitions.theme.js @@ -0,0 +1,10 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +if (window.jQuery) { + jQuery.fx.off = true; +} \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/jquery_keyevent_polyfilll_test/js/jquery.keyevent.polyfill.js +++ a/core/modules/system/tests/modules/jquery_keyevent_polyfilll_test/js/jquery.keyevent.polyfill.js @@ -0,0 +1,36 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($) { + jQuery.event.addProp('which', function (event) { + var keyEventRegex = /^key/; + var mouseEventRegex = /^(?:mouse|pointer|contextmenu|drag|drop)|click/; + var button = event.button; + + if (event.which == null && keyEventRegex.test(event.type)) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + if (!event.which && button !== undefined && mouseEventRegex.test(event.type)) { + if (button && 1) { + return 1; + } + + if (button && 2) { + return 3; + } + + if (button && 4) { + return 2; + } + + return 0; + } + + return event.which; + }); +})(jQuery); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.js +++ a/core/modules/system/tests/modules/js_ajax_test/js/js_ajax_test.ajax.js @@ -0,0 +1,18 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.AjaxCommands.prototype.jsAjaxTestCommand = function (ajax, response) { + var $domElement = $(response.selector); + ajax.element_settings.cat = 'catbro'; + var data = { + element_settings: ajax.element_settings.cat || {}, + elementSettings: ajax.elementSettings.cat || {} + }; + $domElement.html("
    ".concat(JSON.stringify(data), "
    ")); + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_cookie_test/js/js_cookie_shim_test.js +++ a/core/modules/system/tests/modules/js_cookie_test/js/js_cookie_shim_test.js @@ -0,0 +1,39 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_ref, $) { + var behaviors = _ref.behaviors; + behaviors.jqueryCookie = { + attach: function attach() { + if (once('js_cookie_test-init', 'body').length) { + $('.js_cookie_test_add_button').on('click', function () { + $.cookie('js_cookie_test', 'red panda'); + }); + $('.js_cookie_test_add_raw_button').on('click', function () { + $.cookie.raw = true; + $.cookie('js_cookie_test_raw', 'red panda'); + }); + $('.js_cookie_test_add_json_button').on('click', function () { + $.cookie.json = true; + $.cookie('js_cookie_test_json', { + panda: 'red' + }); + $.cookie('js_cookie_test_json_simple', 'red panda'); + }); + $('.js_cookie_test_add_json_string_button').on('click', function () { + $.cookie.json = false; + $.cookie('js_cookie_test_json_string', { + panda: 'red' + }); + }); + $('.js_cookie_test_remove_button').on('click', function () { + $.removeCookie('js_cookie_test'); + }); + } + } + }; +})(Drupal, jQuery); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_deprecation_test/js/js_deprecation_test.js +++ a/core/modules/system/tests/modules/js_deprecation_test/js/js_deprecation_test.js @@ -0,0 +1,32 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_ref) { + var deprecationError = _ref.deprecationError, + deprecatedProperty = _ref.deprecatedProperty, + behaviors = _ref.behaviors; + + var deprecatedFunction = function deprecatedFunction() { + deprecationError({ + message: 'This function is deprecated for testing purposes.' + }); + }; + + var objectWithDeprecatedProperty = deprecatedProperty({ + target: { + deprecatedProperty: 'Kitten' + }, + deprecatedProperty: 'deprecatedProperty', + message: 'This property is deprecated for testing purposes.' + }); + behaviors.testDeprecations = { + attach: function attach() { + deprecatedFunction(); + var deprecatedProperty = objectWithDeprecatedProperty.deprecatedProperty; + } + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_errors_test/js/js_errors_test.js +++ a/core/modules/system/tests/modules/js_errors_test/js/js_errors_test.js @@ -0,0 +1,16 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_ref) { + var throwError = _ref.throwError, + behaviors = _ref.behaviors; + behaviors.testErrors = { + attach: function attach() { + throwError(new Error('A manually thrown error.')); + } + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_interaction_test/js/js_interaction_test.trigger_link.js +++ a/core/modules/system/tests/modules/js_interaction_test/js/js_interaction_test.trigger_link.js @@ -0,0 +1,28 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_ref) { + var behaviors = _ref.behaviors; + behaviors.js_interaction_test_trigger_link = { + attach: function attach() { + var removeBlockerTrigger = once('remove-blocker-trigger', '.remove-blocker-trigger').shift(); + removeBlockerTrigger.addEventListener('click', function (event) { + event.preventDefault(); + setTimeout(function () { + document.querySelector('.blocker-element').remove(); + }, 100); + }); + var enableFieldTrigger = once('enable-field-trigger', '.enable-field-trigger').shift(); + enableFieldTrigger.addEventListener('click', function (event) { + event.preventDefault(); + setTimeout(function () { + document.querySelector('input[name="target_field"]').disabled = false; + }, 100); + }); + } + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_message_test/js/js_message_test.js +++ a/core/modules/system/tests/modules/js_message_test/js/js_message_test.js @@ -0,0 +1,86 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, _ref, _ref2) { + var behaviors = _ref.behaviors; + var testMessages = _ref2.testMessages; + var indexes = {}; + testMessages.types.forEach(function (type) { + indexes[type] = []; + }); + var messageObjects = { + default: { + zone: new Drupal.Message(), + indexes: indexes + }, + multiple: [] + }; + messageObjects.default.zone.clear(); + testMessages.selectors.filter(Boolean).forEach(function (selector) { + messageObjects[selector] = { + zone: new Drupal.Message(document.querySelector(selector)), + indexes: indexes + }; + }); + behaviors.js_message_test = { + attach: function attach() { + $(once('messages-details', '[data-drupal-messages-area]')).on('click', '[data-action]', function (e) { + var $target = $(e.currentTarget); + var type = $target.attr('data-type'); + var area = $target.closest('[data-drupal-messages-area]').attr('data-drupal-messages-area') || 'default'; + var message = messageObjects[area].zone; + var action = $target.attr('data-action'); + + if (action === 'add') { + messageObjects[area].indexes[type].push(message.add("This is a message of the type, ".concat(type, ". You be the judge of its importance."), { + type: type + })); + } else if (action === 'remove') { + message.remove(messageObjects[area].indexes[type].pop()); + } + }); + $(once('add-multiple', '[data-action="add-multiple"]')).on('click', function () { + [0, 1, 2, 3, 4, 5].forEach(function (i) { + messageObjects.multiple.push(messageObjects.default.zone.add("This is message number ".concat(i, " of the type, ").concat(testMessages.types[i % testMessages.types.length], ". You be the judge of its importance."), { + type: testMessages.types[i % testMessages.types.length] + })); + }); + }); + $(once('remove-multiple', '[data-action="remove-multiple"]')).on('click', function () { + messageObjects.multiple.forEach(function (messageIndex) { + return messageObjects.default.zone.remove(messageIndex); + }); + messageObjects.multiple = []; + }); + $(once('add-multiple-error', '[data-action="add-multiple-error"]')).on('click', function () { + [0, 1, 2, 3, 4, 5].forEach(function (i) { + return messageObjects.default.zone.add("Msg-".concat(i), { + type: 'error' + }); + }); + messageObjects.default.zone.add("Msg-".concat(testMessages.types.length * 2), { + type: 'status' + }); + }); + $(once('remove-type', '[data-action="remove-type"]')).on('click', function () { + Array.prototype.map.call(document.querySelectorAll('[data-drupal-message-id^="error"]'), function (element) { + return element.getAttribute('data-drupal-message-id'); + }).forEach(function (id) { + return messageObjects.default.zone.remove(id); + }); + }); + $(once('clear-all', '[data-action="clear-all"]')).on('click', function () { + messageObjects.default.zone.clear(); + }); + $(once('id-no-status', '[data-action="id-no-status"]')).on('click', function () { + messageObjects.default.zone.add('Msg-id-no-status', { + id: 'my-special-id' + }); + }); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_testing_log_test/js/js_testing_log.js +++ a/core/modules/system/tests/modules/js_testing_log_test/js/js_testing_log.js @@ -0,0 +1,28 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + if (typeof console !== 'undefined' && console.warn) { + var originalWarnFunction = console.warn; + + console.warn = function (warning) { + var warnings = JSON.parse(sessionStorage.getItem('js_testing_log_test.warnings') || JSON.stringify([])); + warnings.push(warning); + sessionStorage.setItem('js_testing_log_test.warnings', JSON.stringify(warnings)); + originalWarnFunction(warning); + }; + + var originalThrowFunction = Drupal.throwError; + + Drupal.throwError = function (error) { + var errors = JSON.parse(sessionStorage.getItem('js_testing_log_test.errors') || JSON.stringify([])); + errors.push(error.stack); + sessionStorage.setItem('js_testing_log_test.errors', JSON.stringify(errors)); + originalThrowFunction(error); + }; + } +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.no_element_after_wait.js +++ a/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.no_element_after_wait.js @@ -0,0 +1,25 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.js_webassert_test_wait_for_ajax_request = { + attach: function attach() { + $('#edit-test-assert-no-element-after-wait-pass').on('click', function (e) { + e.preventDefault(); + setTimeout(function () { + $('#edit-test-assert-no-element-after-wait-pass').remove(); + }, 500); + }); + $('#edit-test-assert-no-element-after-wait-fail').on('click', function (e) { + e.preventDefault(); + setTimeout(function () { + $('#edit-test-assert-no-element-after-wait-fail').remove(); + }, 2000); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.wait_for_ajax_request.js +++ a/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.wait_for_ajax_request.js @@ -0,0 +1,18 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, drupalSettings) { + Drupal.behaviors.js_webassert_test_wait_for_ajax_request = { + attach: function attach(context) { + var waitAjaxInput = document.querySelector('input[name="test_assert_wait_on_ajax_input"]'); + + if (waitAjaxInput) { + waitAjaxInput.value = 'js_webassert_test'; + } + } + }; +})(Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.wait_for_element.js +++ a/core/modules/system/tests/modules/js_webassert_test/js/js_webassert_test.wait_for_element.js @@ -0,0 +1,14 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.behaviors.js_webassert_test_wait_for_element = { + attach: function attach(context) { + $('#js_webassert_test_element_invisible').show(); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/modernizr_deprecation_test/js/access-unsupported-property.js +++ a/core/modules/system/tests/modules/modernizr_deprecation_test/js/access-unsupported-property.js @@ -0,0 +1,22 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal, once, Modernizr) { + Drupal.behaviors.unsupportedModernizrProperty = { + attach: function attach() { + once('unsupported-modernizr-property', 'body').forEach(function () { + var triggerDeprecationButton = document.createElement('button'); + triggerDeprecationButton.id = 'trigger-a-deprecation'; + triggerDeprecationButton.textContent = 'trigger a deprecation'; + triggerDeprecationButton.addEventListener('click', function () { + var thisShouldTriggerWarning = Modernizr.touchevents; + }); + document.querySelector('main').append(triggerDeprecationButton); + }); + } + }; +})(Drupal, once, Modernizr); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/off_canvas_test/js/resize-helper.js +++ a/core/modules/system/tests/modules/off_canvas_test/js/resize-helper.js @@ -0,0 +1,16 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (_ref) { + var offCanvas = _ref.offCanvas; + var originalResetSize = offCanvas.resetSize; + + offCanvas.resetSize = function (event) { + originalResetSize(event); + event.data.$element.attr('data-resize-done', 'true'); + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/olivero_test/js/log-errors.js +++ a/core/modules/system/tests/modules/olivero_test/js/log-errors.js @@ -0,0 +1,11 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +Drupal.errorLog = []; +window.addEventListener('error', function (e) { + Drupal.errorLog.push(e); +}); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/tabledrag_test/js/tabledrag_test.js +++ a/core/modules/system/tests/modules/tabledrag_test/js/tabledrag_test.js @@ -0,0 +1,16 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.tableDragTest = { + attach: function attach(context) { + $(once('tabledrag-test', '.tabledrag-handle', context)).on('keydown.tabledrag-test', function (event) { + $(event.currentTarget).removeClass('tabledrag-test-dragging'); + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.js +++ a/core/modules/system/tests/modules/twig_theme_test/twig_theme_test.js @@ -0,0 +1,6 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ \ No newline at end of file reverted: --- b/core/modules/taxonomy/taxonomy.js +++ a/core/modules/taxonomy/taxonomy.js @@ -0,0 +1,43 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.termDrag = { + attach: function attach(context, settings) { + var backStep = settings.taxonomy.backStep; + var forwardStep = settings.taxonomy.forwardStep; + var tableDrag = Drupal.tableDrag.taxonomy; + var $table = $('#taxonomy'); + var rows = $table.find('tr').length; + + tableDrag.row.prototype.onSwap = function (swappedRow) { + $table.find('tr.taxonomy-term-preview').removeClass('taxonomy-term-preview'); + $table.find('tr.taxonomy-term-divider-top').removeClass('taxonomy-term-divider-top'); + $table.find('tr.taxonomy-term-divider-bottom').removeClass('taxonomy-term-divider-bottom'); + var tableBody = $table[0].tBodies[0]; + + if (backStep) { + for (var n = 0; n < backStep; n++) { + $(tableBody.rows[n]).addClass('taxonomy-term-preview'); + } + + $(tableBody.rows[backStep - 1]).addClass('taxonomy-term-divider-top'); + $(tableBody.rows[backStep]).addClass('taxonomy-term-divider-bottom'); + } + + if (forwardStep) { + for (var k = rows - forwardStep - 1; k < rows - 1; k++) { + $(tableBody.rows[k]).addClass('taxonomy-term-preview'); + } + + $(tableBody.rows[rows - forwardStep - 2]).addClass('taxonomy-term-divider-top'); + $(tableBody.rows[rows - forwardStep - 1]).addClass('taxonomy-term-divider-bottom'); + } + }; + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/text/text.js +++ a/core/modules/text/text.js @@ -0,0 +1,53 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal) { + Drupal.behaviors.textSummary = { + attach: function attach(context, settings) { + once('text-summary', '.js-text-summary', context).forEach(function (summary) { + var $widget = $(summary).closest('.js-text-format-wrapper'); + var $summary = $widget.find('.js-text-summary-wrapper'); + var $summaryLabel = $summary.find('label').eq(0); + var $full = $widget.children('.js-form-type-textarea'); + var $fullLabel = $full.find('label').eq(0); + + if ($fullLabel.length === 0) { + $fullLabel = $('').prependTo($full); + } + + if ($fullLabel.hasClass('visually-hidden')) { + $fullLabel.html(function (index, oldHtml) { + return "".concat(oldHtml, ""); + }); + $fullLabel.removeClass('visually-hidden'); + } + + var $link = $(" ()")); + var $button = $link.find('button'); + var toggleClick = true; + $link.on('click', function (e) { + if (toggleClick) { + $summary.hide(); + $button.html(Drupal.t('Edit summary')); + $link.appendTo($fullLabel); + } else { + $summary.show(); + $button.html(Drupal.t('Hide summary')); + $link.appendTo($summaryLabel); + } + + e.preventDefault(); + toggleClick = !toggleClick; + }).appendTo($summaryLabel); + + if (summary.value === '') { + $link.trigger('click'); + } + }); + } + }; +})(jQuery, Drupal); \ No newline at end of file reverted: --- b/core/modules/toolbar/js/escapeAdmin.js +++ a/core/modules/toolbar/js/escapeAdmin.js @@ -0,0 +1,30 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + var pathInfo = drupalSettings.path; + var escapeAdminPath = sessionStorage.getItem('escapeAdminPath'); + var windowLocation = window.location; + + if (!pathInfo.currentPathIsAdmin && !/destination=/.test(windowLocation.search)) { + sessionStorage.setItem('escapeAdminPath', windowLocation); + } + + Drupal.behaviors.escapeAdmin = { + attach: function attach() { + var toolbarEscape = once('escapeAdmin', '[data-toolbar-escape-admin]'); + + if (toolbarEscape.length && pathInfo.currentPathIsAdmin) { + if (escapeAdminPath !== null) { + $(toolbarEscape).attr('href', escapeAdminPath); + } else { + toolbarEscape[0].textContent = Drupal.t('Home'); + } + } + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/toolbar/js/models/ToolbarModel.js +++ a/core/modules/toolbar/js/models/ToolbarModel.js @@ -0,0 +1,34 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Backbone, Drupal) { + Drupal.toolbar.ToolbarModel = Backbone.Model.extend({ + defaults: { + activeTab: null, + activeTray: null, + isOriented: false, + isFixed: false, + areSubtreesLoaded: false, + isViewportOverflowConstrained: false, + orientation: 'horizontal', + locked: false, + isTrayToggleVisible: true, + height: null, + offsets: { + top: 0, + right: 0, + bottom: 0, + left: 0 + } + }, + validate: function validate(attributes, options) { + if (attributes.orientation === 'horizontal' && this.get('locked') && !options.override) { + return Drupal.t('The toolbar cannot be set to a horizontal orientation when it is locked.'); + } + } + }); +})(Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/toolbar/js/views/MenuVisualView.js +++ a/core/modules/toolbar/js/views/MenuVisualView.js @@ -0,0 +1,26 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Backbone, Drupal) { + Drupal.toolbar.MenuVisualView = Backbone.View.extend({ + initialize: function initialize() { + this.listenTo(this.model, 'change:subtrees', this.render); + }, + render: function render() { + var _this = this; + + var subtrees = this.model.get('subtrees'); + Object.keys(subtrees || {}).forEach(function (id) { + $(once('toolbar-subtrees', _this.$el.find("#toolbar-link-".concat(id)))).after(subtrees[id]); + }); + + if ('drupalToolbarMenu' in $.fn) { + this.$el.children('.toolbar-menu').drupalToolbarMenu(); + } + } + }); +})(jQuery, Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/toolbar/js/views/ToolbarAuralView.js +++ a/core/modules/toolbar/js/views/ToolbarAuralView.js @@ -0,0 +1,45 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Backbone, Drupal) { + Drupal.toolbar.ToolbarAuralView = Backbone.View.extend({ + initialize: function initialize(options) { + this.strings = options.strings; + this.listenTo(this.model, 'change:orientation', this.onOrientationChange); + this.listenTo(this.model, 'change:activeTray', this.onActiveTrayChange); + }, + onOrientationChange: function onOrientationChange(model, orientation) { + Drupal.announce(Drupal.t('Tray orientation changed to @orientation.', { + '@orientation': orientation + })); + }, + onActiveTrayChange: function onActiveTrayChange(model, tray) { + var relevantTray = tray === null ? model.previous('activeTray') : tray; + + if (!relevantTray) { + return; + } + + var action = tray === null ? Drupal.t('closed') : Drupal.t('opened'); + var trayNameElement = relevantTray.querySelector('.toolbar-tray-name'); + var text; + + if (trayNameElement !== null) { + text = Drupal.t('Tray "@tray" @action.', { + '@tray': trayNameElement.textContent, + '@action': action + }); + } else { + text = Drupal.t('Tray @action.', { + '@action': action + }); + } + + Drupal.announce(text); + } + }); +})(Backbone, Drupal); \ No newline at end of file reverted: --- b/core/modules/toolbar/js/views/ToolbarVisualView.js +++ a/core/modules/toolbar/js/views/ToolbarVisualView.js @@ -0,0 +1,180 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings, Backbone) { + Drupal.toolbar.ToolbarVisualView = Backbone.View.extend({ + events: function events() { + var touchEndToClick = function touchEndToClick(event) { + event.preventDefault(); + event.target.click(); + }; + + return { + 'click .toolbar-bar .toolbar-tab .trigger': 'onTabClick', + 'click .toolbar-toggle-orientation button': 'onOrientationToggleClick', + 'touchend .toolbar-bar .toolbar-tab .trigger': touchEndToClick, + 'touchend .toolbar-toggle-orientation button': touchEndToClick + }; + }, + initialize: function initialize(options) { + this.strings = options.strings; + this.listenTo(this.model, 'change:activeTab change:orientation change:isOriented change:isTrayToggleVisible', this.render); + this.listenTo(this.model, 'change:mqMatches', this.onMediaQueryChange); + this.listenTo(this.model, 'change:offsets', this.adjustPlacement); + this.listenTo(this.model, 'change:activeTab change:orientation change:isOriented', this.updateToolbarHeight); + this.$el.find('.toolbar-tray .toolbar-lining').has('.toolbar-menu').append(Drupal.theme('toolbarOrientationToggle')); + this.model.trigger('change:activeTab'); + }, + updateToolbarHeight: function updateToolbarHeight() { + var toolbarTabOuterHeight = $('#toolbar-bar').find('.toolbar-tab').outerHeight() || 0; + var toolbarTrayHorizontalOuterHeight = $('.is-active.toolbar-tray-horizontal').outerHeight() || 0; + this.model.set('height', toolbarTabOuterHeight + toolbarTrayHorizontalOuterHeight); + $('body').css({ + 'padding-top': this.model.get('height') + }); + $('html').css({ + 'scroll-padding-top': this.model.get('height') + }); + this.triggerDisplace(); + }, + triggerDisplace: function triggerDisplace() { + _.defer(function () { + Drupal.displace(true); + }); + }, + render: function render() { + this.updateTabs(); + this.updateTrayOrientation(); + this.updateBarAttributes(); + $('body').removeClass('toolbar-loading'); + + if (this.model.changed.orientation === 'vertical' || this.model.changed.activeTab) { + this.loadSubtrees(); + } + + return this; + }, + onTabClick: function onTabClick(event) { + if (event.currentTarget.hasAttribute('data-toolbar-tray')) { + var activeTab = this.model.get('activeTab'); + var clickedTab = event.currentTarget; + this.model.set('activeTab', !activeTab || clickedTab !== activeTab ? clickedTab : null); + event.preventDefault(); + event.stopPropagation(); + } + }, + onOrientationToggleClick: function onOrientationToggleClick(event) { + var orientation = this.model.get('orientation'); + var antiOrientation = orientation === 'vertical' ? 'horizontal' : 'vertical'; + var locked = antiOrientation === 'vertical'; + + if (locked) { + localStorage.setItem('Drupal.toolbar.trayVerticalLocked', 'true'); + } else { + localStorage.removeItem('Drupal.toolbar.trayVerticalLocked'); + } + + this.model.set({ + locked: locked, + orientation: antiOrientation + }, { + validate: true, + override: true + }); + event.preventDefault(); + event.stopPropagation(); + }, + updateTabs: function updateTabs() { + var $tab = $(this.model.get('activeTab')); + $(this.model.previous('activeTab')).removeClass('is-active').prop('aria-pressed', false); + $(this.model.previous('activeTray')).removeClass('is-active'); + + if ($tab.length > 0) { + $tab.addClass('is-active').prop('aria-pressed', true); + var name = $tab.attr('data-toolbar-tray'); + var id = $tab.get(0).id; + + if (id) { + localStorage.setItem('Drupal.toolbar.activeTabID', JSON.stringify(id)); + } + + var $tray = this.$el.find("[data-toolbar-tray=\"".concat(name, "\"].toolbar-tray")); + + if ($tray.length) { + $tray.addClass('is-active'); + this.model.set('activeTray', $tray.get(0)); + } else { + this.model.set('activeTray', null); + } + } else { + this.model.set('activeTray', null); + localStorage.removeItem('Drupal.toolbar.activeTabID'); + } + }, + updateBarAttributes: function updateBarAttributes() { + var isOriented = this.model.get('isOriented'); + + if (isOriented) { + this.$el.find('.toolbar-bar').attr('data-offset-top', ''); + } else { + this.$el.find('.toolbar-bar').removeAttr('data-offset-top'); + } + + this.$el.toggleClass('toolbar-oriented', isOriented); + }, + updateTrayOrientation: function updateTrayOrientation() { + var orientation = this.model.get('orientation'); + var antiOrientation = orientation === 'vertical' ? 'horizontal' : 'vertical'; + $('body').toggleClass('toolbar-vertical', orientation === 'vertical').toggleClass('toolbar-horizontal', orientation === 'horizontal'); + var removeClass = antiOrientation === 'horizontal' ? 'toolbar-tray-horizontal' : 'toolbar-tray-vertical'; + var $trays = this.$el.find('.toolbar-tray').removeClass(removeClass).addClass("toolbar-tray-".concat(orientation)); + var iconClass = "toolbar-icon-toggle-".concat(orientation); + var iconAntiClass = "toolbar-icon-toggle-".concat(antiOrientation); + var $orientationToggle = this.$el.find('.toolbar-toggle-orientation').toggle(this.model.get('isTrayToggleVisible')); + var $orientationToggleButton = $orientationToggle.find('button'); + $orientationToggleButton[0].value = antiOrientation; + $orientationToggleButton.attr('title', this.strings[antiOrientation]).removeClass(iconClass).addClass(iconAntiClass); + $orientationToggleButton[0].textContent = this.strings[antiOrientation]; + var dir = document.documentElement.dir; + var edge = dir === 'rtl' ? 'right' : 'left'; + $trays.removeAttr('data-offset-left data-offset-right data-offset-top'); + $trays.filter('.toolbar-tray-vertical.is-active').attr("data-offset-".concat(edge), ''); + $trays.filter('.toolbar-tray-horizontal.is-active').attr('data-offset-top', ''); + }, + adjustPlacement: function adjustPlacement() { + var $trays = this.$el.find('.toolbar-tray'); + + if (!this.model.get('isOriented')) { + $trays.removeClass('toolbar-tray-horizontal').addClass('toolbar-tray-vertical'); + } + }, + loadSubtrees: function loadSubtrees() { + var $activeTab = $(this.model.get('activeTab')); + var orientation = this.model.get('orientation'); + + if (!this.model.get('areSubtreesLoaded') && typeof $activeTab.data('drupal-subtrees') !== 'undefined' && orientation === 'vertical') { + var subtreesHash = drupalSettings.toolbar.subtreesHash; + var theme = drupalSettings.ajaxPageState.theme; + var endpoint = Drupal.url("toolbar/subtrees/".concat(subtreesHash)); + var cachedSubtreesHash = localStorage.getItem("Drupal.toolbar.subtreesHash.".concat(theme)); + var cachedSubtrees = JSON.parse(localStorage.getItem("Drupal.toolbar.subtrees.".concat(theme))); + var isVertical = this.model.get('orientation') === 'vertical'; + + if (isVertical && subtreesHash === cachedSubtreesHash && cachedSubtrees) { + Drupal.toolbar.setSubtrees.resolve(cachedSubtrees); + } else if (isVertical) { + localStorage.removeItem("Drupal.toolbar.subtreesHash.".concat(theme)); + localStorage.removeItem("Drupal.toolbar.subtrees.".concat(theme)); + Drupal.ajax({ + url: endpoint + }).execute(); + localStorage.setItem("Drupal.toolbar.subtreesHash.".concat(theme), subtreesHash); + } + } + } + }); +})(jQuery, Drupal, drupalSettings, Backbone); \ No newline at end of file reverted: --- b/core/modules/tour/js/tour.js +++ a/core/modules/tour/js/tour.js @@ -0,0 +1,170 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Backbone, Drupal, settings, document, Shepherd) { + var queryString = decodeURI(window.location.search); + Drupal.behaviors.tour = { + attach: function attach(context) { + once('tour', 'body').forEach(function () { + var model = new Drupal.tour.models.StateModel(); + new Drupal.tour.views.ToggleTourView({ + el: $(context).find('#toolbar-tab-tour'), + model: model + }); + model.on('change:isActive', function (tourModel, isActive) { + $(document).trigger(isActive ? 'drupalTourStarted' : 'drupalTourStopped'); + }); + + if (settings._tour_internal) { + model.set('tour', settings._tour_internal); + } + + if (/tour=?/i.test(queryString)) { + model.set('isActive', true); + } + }); + } + }; + Drupal.tour = Drupal.tour || { + models: {}, + views: {} + }; + Drupal.tour.models.StateModel = Backbone.Model.extend({ + defaults: { + tour: [], + isActive: false, + activeTour: [] + } + }); + Drupal.tour.views.ToggleTourView = Backbone.View.extend({ + events: { + click: 'onClick' + }, + initialize: function initialize() { + this.listenTo(this.model, 'change:tour change:isActive', this.render); + this.listenTo(this.model, 'change:isActive', this.toggleTour); + }, + render: function render() { + this.$el.toggleClass('hidden', this._getTour().length === 0); + var isActive = this.model.get('isActive'); + this.$el.find('button').toggleClass('is-active', isActive).attr('aria-pressed', isActive); + return this; + }, + toggleTour: function toggleTour() { + if (this.model.get('isActive')) { + this._removeIrrelevantTourItems(this._getTour()); + + var tourItems = this.model.get('tour'); + var that = this; + + if (tourItems.length) { + settings.tourShepherdConfig.defaultStepOptions.popperOptions.modifiers.push({ + name: 'moveArrowJoyridePosition', + enabled: true, + phase: 'write', + fn: function fn(_ref) { + var state = _ref.state; + var arrow = state.elements.arrow; + var placement = state.placement; + + if (arrow && /^top|bottom/.test(placement) && /-start|-end$/.test(placement)) { + var horizontalPosition = placement.split('-')[1]; + var offset = horizontalPosition === 'start' ? 28 : state.elements.popper.clientWidth - 56; + arrow.style.transform = "translate3d(".concat(offset, "px, 0px, 0px)"); + } + } + }); + var shepherdTour = new Shepherd.Tour(settings.tourShepherdConfig); + shepherdTour.on('cancel', function () { + that.model.set('isActive', false); + }); + shepherdTour.on('complete', function () { + that.model.set('isActive', false); + }); + tourItems.forEach(function (tourStepConfig, index) { + var tourItemOptions = { + title: tourStepConfig.title ? Drupal.checkPlain(tourStepConfig.title) : null, + text: function text() { + return Drupal.theme('tourItemContent', tourStepConfig); + }, + attachTo: tourStepConfig.attachTo, + buttons: [Drupal.tour.nextButton(shepherdTour, tourStepConfig)], + classes: tourStepConfig.classes, + index: index + }; + tourItemOptions.when = { + show: function show() { + var nextButton = shepherdTour.currentStep.el.querySelector('footer button'); + nextButton.focus(); + + if (Drupal.tour.hasOwnProperty('convertToJoyrideMarkup')) { + Drupal.tour.convertToJoyrideMarkup(shepherdTour); + } + } + }; + shepherdTour.addStep(tourItemOptions); + }); + shepherdTour.start(); + this.model.set({ + isActive: true, + activeTour: shepherdTour + }); + } + } else { + this.model.get('activeTour').cancel(); + this.model.set({ + isActive: false, + activeTour: [] + }); + } + }, + onClick: function onClick(event) { + this.model.set('isActive', !this.model.get('isActive')); + event.preventDefault(); + event.stopPropagation(); + }, + _getTour: function _getTour() { + return this.model.get('tour'); + }, + _removeIrrelevantTourItems: function _removeIrrelevantTourItems(tourItems) { + var tips = /tips=([^&]+)/.exec(queryString); + var filteredTour = tourItems.filter(function (tourItem) { + if (tips && tourItem.hasOwnProperty('classes') && tourItem.classes.indexOf(tips[1]) === -1) { + return false; + } + + return !(tourItem.selector && !document.querySelector(tourItem.selector)); + }); + + if (tourItems.length !== filteredTour.length) { + filteredTour.forEach(function (filteredTourItem, filteredTourItemId) { + filteredTour[filteredTourItemId].counter = Drupal.t('!tour_item of !total', { + '!tour_item': filteredTourItemId + 1, + '!total': filteredTour.length + }); + + if (filteredTourItemId === filteredTour.length - 1) { + filteredTour[filteredTourItemId].cancelText = Drupal.t('End tour'); + } + }); + this.model.set('tour', filteredTour); + } + } + }); + + Drupal.tour.nextButton = function (shepherdTour, tourStepConfig) { + return { + classes: 'button button--primary', + text: tourStepConfig.cancelText ? tourStepConfig.cancelText : Drupal.t('Next'), + action: tourStepConfig.cancelText ? shepherdTour.cancel : shepherdTour.next + }; + }; + + Drupal.theme.tourItemContent = function (tourStepConfig) { + return "".concat(tourStepConfig.body, "
    ").concat(tourStepConfig.counter, "
    "); + }; +})(jQuery, Backbone, Drupal, drupalSettings, document, window.Shepherd); \ No newline at end of file reverted: --- b/core/modules/tracker/js/tracker-history.js +++ a/core/modules/tracker/js/tracker-history.js @@ -0,0 +1,105 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, window) { + function processNodeNewIndicators(placeholders) { + var newNodeString = Drupal.t('new'); + var updatedNodeString = Drupal.t('updated'); + placeholders.forEach(function (placeholder) { + var timestamp = parseInt(placeholder.getAttribute('data-history-node-timestamp'), 10); + var nodeID = placeholder.getAttribute('data-history-node-id'); + var lastViewTimestamp = Drupal.history.getLastRead(nodeID); + + if (timestamp > lastViewTimestamp) { + var message = lastViewTimestamp === 0 ? newNodeString : updatedNodeString; + $(placeholder).append("".concat(message, "")); + } + }); + } + + function processNewRepliesIndicators(placeholders) { + var placeholdersToUpdate = {}; + placeholders.forEach(function (placeholder) { + var timestamp = parseInt(placeholder.getAttribute('data-history-node-last-comment-timestamp'), 10); + var nodeID = placeholder.previousSibling.previousSibling.getAttribute('data-history-node-id'); + var lastViewTimestamp = Drupal.history.getLastRead(nodeID); + + if (timestamp > lastViewTimestamp) { + placeholdersToUpdate[nodeID] = placeholder; + } + }); + var nodeIDs = Object.keys(placeholdersToUpdate); + + if (nodeIDs.length === 0) { + return; + } + + $.ajax({ + url: Drupal.url('comments/render_new_comments_node_links'), + type: 'POST', + data: { + 'node_ids[]': nodeIDs + }, + dataType: 'json', + success: function success(results) { + Object.keys(results || {}).forEach(function (nodeID) { + if (placeholdersToUpdate.hasOwnProperty(nodeID)) { + var url = results[nodeID].first_new_comment_link; + var text = Drupal.formatPlural(results[nodeID].new_comment_count, '1 new', '@count new'); + $(placeholdersToUpdate[nodeID]).append("
    ").concat(text, "")); + } + }); + } + }); + } + + Drupal.behaviors.trackerHistory = { + attach: function attach(context) { + var nodeIDs = []; + var nodeNewPlaceholders = once('history', '[data-history-node-timestamp]', context).filter(function (placeholder) { + var nodeTimestamp = parseInt(placeholder.getAttribute('data-history-node-timestamp'), 10); + var nodeID = placeholder.getAttribute('data-history-node-id'); + + if (Drupal.history.needsServerCheck(nodeID, nodeTimestamp)) { + nodeIDs.push(nodeID); + return true; + } + + return false; + }); + var newRepliesPlaceholders = once('history', '[data-history-node-last-comment-timestamp]', context).filter(function (placeholder) { + var lastCommentTimestamp = parseInt(placeholder.getAttribute('data-history-node-last-comment-timestamp'), 10); + var nodeTimestamp = parseInt(placeholder.previousSibling.previousSibling.getAttribute('data-history-node-timestamp'), 10); + + if (lastCommentTimestamp === nodeTimestamp) { + return false; + } + + var nodeID = placeholder.previousSibling.previousSibling.getAttribute('data-history-node-id'); + + if (Drupal.history.needsServerCheck(nodeID, lastCommentTimestamp)) { + if (nodeIDs.indexOf(nodeID) === -1) { + nodeIDs.push(nodeID); + } + + return true; + } + + return false; + }); + + if (nodeNewPlaceholders.length === 0 && newRepliesPlaceholders.length === 0) { + return; + } + + Drupal.history.fetchTimestamps(nodeIDs, function () { + processNodeNewIndicators(nodeNewPlaceholders); + processNewRepliesIndicators(newRepliesPlaceholders); + }); + } + }; +})(jQuery, Drupal, window); \ No newline at end of file reverted: --- b/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.js +++ a/core/modules/user/tests/themes/password_theme_function_test/js/password-theme-functions.js @@ -0,0 +1,33 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.passwordStrength = function (_ref) { + var strengthTitle = _ref.strengthTitle; + var strengthIndicator = 'Overridden passwordStrength:
    '; + var strengthText = ''; + return "\n
    \n
    ".concat(strengthIndicator, "
    \n
    ").concat(strengthTitle, " ").concat(strengthText, "
    \n
    \n "); + }; + + Drupal.theme.passwordSuggestions = function (_ref2, tips) { + var hasWeaknesses = _ref2.hasWeaknesses; + return "
    Overridden passwordSuggestions: ".concat(tips.length ? "".concat(hasWeaknesses, "") : '', "
    "); + }; + + Drupal.theme.passwordConfirmMessage = function (_ref3) { + var confirmTitle = _ref3.confirmTitle; + var confirmTextWrapper = 'Overridden passwordConfirmMessage:'; + return "
    ".concat(confirmTitle, " ").concat(confirmTextWrapper, "
    "); + }; + + Drupal.behaviors.passwordThemeFunctionTest = { + attach: function attach(context, settings) { + var strength = Drupal.evaluatePasswordStrength('password', settings.password); + var message = strength.message; + } + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/modules/views/js/ajax_view.js +++ a/core/modules/views/js/ajax_view.js @@ -0,0 +1,127 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.behaviors.ViewsAjaxView = {}; + + Drupal.behaviors.ViewsAjaxView.attach = function (context, settings) { + if (settings && settings.views && settings.views.ajaxViews) { + var ajaxViews = settings.views.ajaxViews; + Object.keys(ajaxViews || {}).forEach(function (i) { + Drupal.views.instances[i] = new Drupal.views.ajaxView(ajaxViews[i]); + }); + } + }; + + Drupal.behaviors.ViewsAjaxView.detach = function (context, settings, trigger) { + if (trigger === 'unload') { + if (settings && settings.views && settings.views.ajaxViews) { + var ajaxViews = settings.views.ajaxViews; + Object.keys(ajaxViews || {}).forEach(function (i) { + var selector = ".js-view-dom-id-".concat(ajaxViews[i].view_dom_id); + + if ($(selector, context).length) { + delete Drupal.views.instances[i]; + delete settings.views.ajaxViews[i]; + } + }); + } + } + }; + + Drupal.views = {}; + Drupal.views.instances = {}; + + Drupal.views.ajaxView = function (settings) { + var selector = ".js-view-dom-id-".concat(settings.view_dom_id); + this.$view = $(selector); + var ajaxPath = drupalSettings.views.ajax_path; + + if (ajaxPath.constructor.toString().indexOf('Array') !== -1) { + ajaxPath = ajaxPath[0]; + } + + var queryString = window.location.search || ''; + + if (queryString !== '') { + queryString = queryString.slice(1).replace(/q=[^&]+&?|&?render=[^&]+/, ''); + + if (queryString !== '') { + queryString = (/\?/.test(ajaxPath) ? '&' : '?') + queryString; + } + } + + this.element_settings = { + url: ajaxPath + queryString, + submit: settings, + setClick: true, + event: 'click', + selector: selector, + progress: { + type: 'fullscreen' + } + }; + this.settings = settings; + this.$exposed_form = $("form#views-exposed-form-".concat(settings.view_name.replace(/_/g, '-'), "-").concat(settings.view_display_id.replace(/_/g, '-'))); + once('exposed-form', this.$exposed_form).forEach($.proxy(this.attachExposedFormAjax, this)); + once('ajax-pager', this.$view.filter($.proxy(this.filterNestedViews, this))).forEach($.proxy(this.attachPagerAjax, this)); + var selfSettings = $.extend({}, this.element_settings, { + event: 'RefreshView', + base: this.selector, + element: this.$view.get(0) + }); + this.refreshViewAjax = Drupal.ajax(selfSettings); + }; + + Drupal.views.ajaxView.prototype.attachExposedFormAjax = function () { + var that = this; + this.exposedFormAjax = []; + $('input[type=submit], button[type=submit], input[type=image]', this.$exposed_form).not('[data-drupal-selector=edit-reset]').each(function (index) { + var selfSettings = $.extend({}, that.element_settings, { + base: $(this).attr('id'), + element: this + }); + that.exposedFormAjax[index] = Drupal.ajax(selfSettings); + }); + }; + + Drupal.views.ajaxView.prototype.filterNestedViews = function () { + return !this.$view.parents('.view').length; + }; + + Drupal.views.ajaxView.prototype.attachPagerAjax = function () { + this.$view.find('ul.js-pager__items > li > a, th.views-field a, .attachment .views-summary a').each($.proxy(this.attachPagerLinkAjax, this)); + }; + + Drupal.views.ajaxView.prototype.attachPagerLinkAjax = function (id, link) { + var $link = $(link); + var viewData = {}; + var href = $link.attr('href'); + $.extend(viewData, this.settings, Drupal.Views.parseQueryString(href), Drupal.Views.parseViewArgs(href, this.settings.view_base_path)); + var selfSettings = $.extend({}, this.element_settings, { + submit: viewData, + base: false, + element: link + }); + this.pagerAjax = Drupal.ajax(selfSettings); + }; + + Drupal.AjaxCommands.prototype.viewsScrollTop = function (ajax, response) { + var offset = $(response.selector).offset(); + var scrollTarget = response.selector; + + while ($(scrollTarget).scrollTop() === 0 && $(scrollTarget).parent()) { + scrollTarget = $(scrollTarget).parent(); + } + + if (offset.top - 10 < $(scrollTarget).scrollTop()) { + $(scrollTarget).animate({ + scrollTop: offset.top - 10 + }, 500); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/modules/views_ui/js/ajax.js +++ a/core/modules/views_ui/js/ajax.js @@ -0,0 +1,147 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.AjaxCommands.prototype.viewsHighlight = function (ajax, response, status) { + $('.hilited').removeClass('hilited'); + $(response.selector).addClass('hilited'); + }; + + Drupal.AjaxCommands.prototype.viewsSetForm = function (ajax, response, status) { + var $form = $('.js-views-ui-dialog form'); + var $submitButtons = $(once('views-ajax-submit', $form.find('input[type=submit].js-form-submit, button.js-form-submit'))); + $submitButtons.on('click mousedown', function () { + this.form.clk = this; + }); + once('views-ajax-submit', $form).forEach(function (form) { + var $form = $(form); + var elementSettings = { + url: response.url, + event: 'submit', + base: $form.attr('id'), + element: form + }; + var ajaxForm = Drupal.ajax(elementSettings); + ajaxForm.$form = $form; + }); + }; + + Drupal.AjaxCommands.prototype.viewsShowButtons = function (ajax, response, status) { + $('div.views-edit-view div.form-actions').removeClass('js-hide'); + + if (response.changed) { + $('div.views-edit-view div.view-changed.messages').removeClass('js-hide'); + } + }; + + Drupal.AjaxCommands.prototype.viewsTriggerPreview = function (ajax, response, status) { + if ($('input#edit-displays-live-preview').is(':checked')) { + $('#preview-submit').trigger('click'); + } + }; + + Drupal.AjaxCommands.prototype.viewsReplaceTitle = function (ajax, response, status) { + var doc = document; + var oldTitle = doc.title; + var escapedSiteName = response.siteName.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); + var re = new RegExp(".+ (.) ".concat(escapedSiteName)); + doc.title = oldTitle.replace(re, "".concat(response.title, " $1 ").concat(response.siteName)); + document.querySelectorAll('h1.page-title').forEach(function (item) { + item.textContent = response.title; + }); + }; + + Drupal.theme.tableDragChangedWarning = function () { + return []; + }; + + Drupal.behaviors.livePreview = { + attach: function attach(context) { + $(once('views-ajax', 'input#edit-displays-live-preview', context)).on('click', function () { + if ($(this).is(':checked')) { + $('#preview-submit').trigger('click'); + } + }); + } + }; + Drupal.behaviors.syncPreviewDisplay = { + attach: function attach(context) { + $(once('views-ajax', '#views-tabset a')).on('click', function () { + var href = $(this).attr('href'); + var displayId = href.substr(11); + var viewsPreviewId = document.querySelector('#views-live-preview #preview-display-id'); + + if (viewsPreviewId) { + viewsPreviewId.value = displayId; + } + }); + } + }; + Drupal.behaviors.viewsAjax = { + collapseReplaced: false, + attach: function attach(context, settings) { + var baseElementSettings = { + event: 'click', + progress: { + type: 'fullscreen' + } + }; + once('views-ajax', 'a.views-ajax-link', context).forEach(function (link) { + var $link = $(link); + var elementSettings = baseElementSettings; + elementSettings.base = $link.attr('id'); + elementSettings.element = link; + + if ($link.attr('href')) { + elementSettings.url = $link.attr('href'); + } + + Drupal.ajax(elementSettings); + }); + once('views-ajax', 'div#views-live-preview a').forEach(function (link) { + var $link = $(link); + + if (!$link.attr('href')) { + return true; + } + + var elementSettings = baseElementSettings; + elementSettings.url = $link.attr('href'); + + if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') { + return true; + } + + elementSettings.wrapper = 'views-preview-wrapper'; + elementSettings.method = 'replaceWith'; + elementSettings.base = link.id; + elementSettings.element = link; + Drupal.ajax(elementSettings); + }); + once('views-ajax', 'div#views-live-preview input[type=submit]').forEach(function (submit) { + var $submit = $(submit); + $submit.on('click', function () { + this.form.clk = this; + return true; + }); + var elementSettings = baseElementSettings; + elementSettings.url = $(submit.form).attr('action'); + + if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') { + return true; + } + + elementSettings.wrapper = 'views-preview-wrapper'; + elementSettings.method = 'replaceWith'; + elementSettings.event = 'click'; + elementSettings.base = submit.id; + elementSettings.element = submit; + Drupal.ajax(elementSettings); + }); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/profiles/demo_umami/themes/umami/js/classy/media_embed_ckeditor.theme.js +++ a/core/profiles/demo_umami/themes/umami/js/classy/media_embed_ckeditor.theme.js @@ -0,0 +1,12 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.mediaEmbedPreviewError = function () { + return "
    ".concat(Drupal.t('An error occurred while trying to preview the media. Please save your work and reload this page.'), "
    "); + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/themes/bartik/color/preview.js +++ a/core/themes/bartik/color/preview.js @@ -0,0 +1,36 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function ($, Drupal, drupalSettings) { + Drupal.color = { + logoChanged: false, + callback: function callback(context, settings, $form) { + if (!this.logoChanged) { + $('.color-preview .color-preview-logo img').attr('src', drupalSettings.color.logo); + this.logoChanged = true; + } + + if (drupalSettings.color.logo === null) { + $('div').remove('.color-preview-logo'); + } + + var $colorPreview = $form.find('.color-preview'); + var $colorPalette = $form.find('.js-color-palette'); + $colorPreview.css('backgroundColor', $colorPalette.find('input[name="palette[bg]"]')[0].value); + $colorPreview.find('.color-preview-main h2, .color-preview .preview-content').css('color', $colorPalette.find('input[name="palette[text]"]')[0].value); + $colorPreview.find('.color-preview-content a').css('color', $colorPalette.find('input[name="palette[link]"]')[0].value); + var $colorPreviewBlock = $colorPreview.find('.color-preview-sidebar .color-preview-block'); + $colorPreviewBlock.css('background-color', $colorPalette.find('input[name="palette[sidebar]"]')[0].value); + $colorPreviewBlock.css('border-color', $colorPalette.find('input[name="palette[sidebarborders]"]')[0].value); + $colorPreview.find('.color-preview-footer-wrapper').css('background-color', $colorPalette.find('input[name="palette[footer]"]')[0].value); + var gradientStart = $colorPalette.find('input[name="palette[top]"]')[0].value; + var gradientEnd = $colorPalette.find('input[name="palette[bottom]"]')[0].value; + $colorPreview.find('.color-preview-header').attr('style', "background-color: ".concat(gradientStart, "; background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(").concat(gradientStart, "), to(").concat(gradientEnd, ")); background-image: -moz-linear-gradient(-90deg, ").concat(gradientStart, ", ").concat(gradientEnd, ");")); + $colorPreview.find('.color-preview-site-name').css('color', $colorPalette.find('input[name="palette[titleslogan]"]')[0].value); + } + }; +})(jQuery, Drupal, drupalSettings); \ No newline at end of file reverted: --- b/core/themes/claro/css/base/print.css +++ a/core/themes/claro/css/base/print.css @@ -6,15 +6,13 @@ */ @media print { * { + /* Black prints faster */ + /* https://github.com/h5bp/main.css/blob/main/dist/_print.css#L14 */ color: #000 !important; background-color: transparent !important; box-shadow: none !important; text-shadow: none !important; } - * { - /* Black prints faster */ - /* https://github.com/h5bp/main.css/blob/main/dist/_print.css#L14 */ - } body { padding-top: 0; } reverted: --- b/core/themes/claro/css/components/accordion.css +++ a/core/themes/claro/css/components/accordion.css @@ -20,7 +20,7 @@ .accordion__item { margin: 0 -1px; + border-radius: 0 - border-radius: 0; } .accordion__item:first-child { reverted: --- b/core/themes/claro/css/components/action-link.css +++ a/core/themes/claro/css/components/action-link.css @@ -246,8 +246,6 @@ @media (forced-colors: active) { .action-link--icon-plus::before { background: linktext !important; - } - .action-link--icon-plus::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg height='16' stroke='%23d72222' stroke-width='2' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M3 8h10M8 3v10'/%3e%3c/svg%3e"); @@ -293,8 +291,6 @@ @media (forced-colors: active) { .action-link--icon-trash::before { background: linktext !important; - } - .action-link--icon-trash::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg height='16' width='16' fill='%23d72222' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M14.9 2.9c-.1-.4-.2-.6-.2-.6-.1-.4-.4-.4-.8-.5l-2.3-.3c-.3 0-.3 0-.4-.3-.4-.7-.5-1.2-.9-1.2H5.7c-.4 0-.5.5-.9 1.3-.1.2-.1.2-.4.3l-2.3.3c-.4 0-.7.1-.8.4 0 0-.1.2-.2.5-.1.6-.2.5.3.5h13.2c.5 0 .4.1.3-.4zm-1.5 1.8H2.6c-.7 0-.8.1-.7.6l.8 10.1c.1.5.1.6.8.6h9.1c.6 0 .7-.1.8-.6l.8-10.1c0-.5-.1-.6-.8-.6z'/%3e%3c/svg%3e"); @@ -340,8 +336,6 @@ @media (forced-colors: active) { .action-link--icon-ex::before { background: linktext !important; - } - .action-link--icon-ex::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg height='16' stroke='%23d72222' stroke-width='1.5' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M13 3L3 13M13 13L3 3'/%3e%3c/svg%3e"); @@ -387,8 +381,6 @@ @media (forced-colors: active) { .action-link--icon-checkmark::before { background: linktext !important; - } - .action-link--icon-checkmark::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg fill='none' height='16' stroke='%23d72222' stroke-width='2' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2 8.571L5.6 12 14 4'/%3e%3c/svg%3e"); @@ -434,8 +426,6 @@ @media (forced-colors: active) { .action-link--icon-cog::before { background: linktext !important; - } - .action-link--icon-cog::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg height='16' fill='%23D72222' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M15.426 9.249a7.29 7.29 0 00.076-.998c0-.36-.035-.71-.086-1.056l-2.275-.293a5.039 5.039 0 00-.498-1.201l1.396-1.808a7.3 7.3 0 00-1.459-1.452l-1.807 1.391a5.058 5.058 0 00-1.2-.499l-.292-2.252C8.943 1.033 8.604 1 8.252 1s-.694.033-1.032.082l-.291 2.251a5.076 5.076 0 00-1.2.499L3.924 2.441a7.3 7.3 0 00-1.459 1.452L3.86 5.701a5.076 5.076 0 00-.499 1.2l-2.276.294A7.35 7.35 0 001 8.251c0 .34.031.671.077.998l2.285.295c.115.426.284.826.499 1.2L2.444 12.58c.411.55.896 1.038 1.443 1.452l1.842-1.42c.374.215.774.383 1.2.498l.298 2.311c.337.047.677.08 1.025.08s.688-.033 1.021-.08l.299-2.311a5.056 5.056 0 001.201-.498l1.842 1.42a7.326 7.326 0 001.443-1.452l-1.416-1.837c.215-.373.383-.773.498-1.199zm-7.174 1.514a2.54 2.54 0 110-5.082 2.542 2.542 0 010 5.082z'/%3e%3c/svg%3e"); @@ -481,8 +471,6 @@ @media (forced-colors: active) { .action-link--icon-show::before { background: linktext !important; - } - .action-link--icon-show::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg fill-rule='evenodd' height='16' width='16' fill='%23D72222' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M8 3C4.364 3 1.258 5.073 0 8c1.258 2.927 4.364 5 8 5s6.742-2.073 8-5c-1.258-2.927-4.364-5-8-5zm0 8a3 3 0 100-6 3 3 0 000 6z'/%3e%3c/svg%3e"); @@ -528,8 +516,6 @@ @media (forced-colors: active) { .action-link--icon-hide::before { background: linktext !important; - } - .action-link--icon-hide::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg fill-rule='evenodd' height='16' fill='%23D72222' width='16' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M2.01 1.696L2 1.707 14.072 13.78l-.696.697-2.078-2.078A9.232 9.232 0 018 13c-3.636 0-6.742-2.073-8-5 .647-1.505 1.783-2.784 3.228-3.672L1 2.1l.707-.707zM5 8c0-.546.146-1.058.4-1.5l4.1 4.1A3 3 0 015 8zM5.151 3.444l1.76 1.76a3 3 0 013.885 3.885l2.344 2.344C14.41 10.561 15.41 9.375 16 8c-1.258-2.927-4.364-5-8-5-.999 0-1.958.156-2.849.444z'/%3e%3c/svg%3e"); @@ -575,8 +561,6 @@ @media (forced-colors: active) { .action-link--icon-key::before { background: linktext !important; - } - .action-link--icon-key::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M13.727 6.714A4.239 4.239 0 008.9 5.896L3.001 0H0v2h1v1.618L1.378 4H3v1h1v1.622h1.622l.864.862L5.5 8.5l.992.99a4.227 4.227 0 001.223 3.234 4.264 4.264 0 006.012 0 4.253 4.253 0 000-6.01zm-.829 5.182a1.653 1.653 0 11-2.338-2.338 1.653 1.653 0 112.338 2.338z' fill='%23d72222'/%3e%3c/svg%3e"); @@ -622,8 +606,6 @@ @media (forced-colors: active) { .action-link--icon-questionmark::before { background: linktext !important; - } - .action-link--icon-questionmark::before { -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-image: url("data:image/svg+xml,%3csvg width='15' height='14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7.002 0a7 7 0 100 14 7 7 0 000-14zm3 5c0 .551-.16 1.085-.477 1.586l-.158.22c-.07.093-.189.241-.361.393a9.67 9.67 0 01-.545.447l-.203.189-.141.129-.096.17L8 8.369v.63H5.999v-.704c.026-.396.078-.73.204-.999a2.83 2.83 0 01.439-.688l.225-.21-.01-.015.176-.14.137-.128c.186-.139.357-.277.516-.417l.148-.18A.948.948 0 008.002 5 1.001 1.001 0 006 5H4a3 3 0 016.002 0zm-1.75 6.619a.627.627 0 01-.625.625h-1.25a.627.627 0 01-.626-.625v-1.238c0-.344.281-.625.626-.625h1.25c.344 0 .625.281.625.625v1.238z' fill='%23d72222'/%3e%3c/svg%3e"); reverted: --- b/core/themes/claro/css/components/breadcrumb.css +++ a/core/themes/claro/css/components/breadcrumb.css @@ -34,11 +34,11 @@ .breadcrumb__item + .breadcrumb__item::before { display: inline-block; padding: 0 0.75rem; + content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='8' width='5'%3e%3cpath fill='currentColor' d='M1.207.647L.5 1.354 3.146 4 .5 6.647l.707.707L4.561 4z'/%3e%3c/svg%3e") - content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' height='8' width='5'%3e%3cpath fill='currentColor' d='M1.207.647L.5 1.354 3.146 4 .5 6.647l.707.707L4.561 4z'/%3e%3c/svg%3e"); } [dir="rtl"] .breadcrumb__item + .breadcrumb__item::before { + transform: scaleX(-1) - transform: scaleX(-1); } @media (forced-colors: active) { @@ -55,7 +55,7 @@ -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; + mask-position: center - mask-position: center; } } reverted: --- b/core/themes/claro/css/components/button.css +++ a/core/themes/claro/css/components/button.css @@ -35,10 +35,6 @@ * dropbutton.css or action-links.css as well. */ -.button { - border: 1px solid transparent !important; -} - .button { display: inline-block; margin: 1rem 0.75rem 1rem 0; /* LTR */ @@ -46,7 +42,8 @@ cursor: pointer; text-align: center; text-decoration: none; + color: #232429; + border: 1px solid transparent !important; /* 2 */ - color: #232429; /* 2 */ border-radius: 2px; background-color: #d3d4d9; font-size: 1rem; reverted: --- b/core/themes/claro/css/components/details.css +++ a/core/themes/claro/css/components/details.css @@ -43,7 +43,7 @@ border: 1px solid #dedfe4; border-radius: 2px; background-color: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* * The following width and min-width values ensure that the
    element @@ -55,7 +55,7 @@ td .claro-details { width: min-content; + min-width: 100% - min-width: 100%; } .claro-details--accordion-item, @@ -211,7 +211,7 @@ /* stylelint-disable-next-line unit-allowed-list */ +@media not all and (min-resolution: 0.001dpcm) { -@media not all and (-webkit-min-device-pixel-ratio: 0), not all and (min-resolution: 0.001dpcm) { @supports (-webkit-appearance: none) { .claro-details__summary::before { transition: none; @@ -365,7 +365,7 @@ /* stylelint-disable-next-line unit-allowed-list */ +@media not all and (min-resolution: 0.001dpcm) { -@media not all and (-webkit-min-device-pixel-ratio: 0), not all and (min-resolution: 0.001dpcm) { @supports (-webkit-appearance: none) { .claro-details__summary::after { transition: none; reverted: --- b/core/themes/claro/css/components/dropbutton.css +++ a/core/themes/claro/css/components/dropbutton.css @@ -113,10 +113,6 @@ * Dropbutton toggler. */ -.dropbutton__toggle { - border: 1px solid transparent !important; -} - .dropbutton__toggle { position: absolute; z-index: 3; @@ -124,7 +120,8 @@ right: 0; /* LTR */ bottom: 0; width: 3rem; + height: 3rem; + border: 1px solid transparent !important; /* 1 */ - height: 3rem; /* 1 */ border-radius: 0 2px 2px 0; /* LTR */ background: #d3d4d9; font-size: 1px; /* iOS Safari sets a minimum button-width based on font-size. */ @@ -234,10 +231,6 @@ * Duplicates base button styles. */ -.dropbutton__item:first-of-type > * { - border: 1px solid transparent !important; -} - .dropbutton__item:first-of-type > * { display: inline-block; margin: 0; @@ -245,7 +238,8 @@ cursor: pointer; text-align: center; text-decoration: none; + color: #232429; + border: 1px solid transparent !important; /* 1 */ - color: #232429; /* 1 */ border-radius: 2px; background-color: #d3d4d9; font-size: 1rem; @@ -361,17 +355,13 @@ max-width: 12.5rem; } -.dropbutton__item:first-of-type ~ .dropbutton__item > a, -.dropbutton__item:first-of-type ~ .dropbutton__item > .button { - border: 1px solid transparent !important; -} - .dropbutton__item:first-of-type ~ .dropbutton__item > a, .dropbutton__item:first-of-type ~ .dropbutton__item > .button { position: relative; padding: calc(1rem - 1px); text-decoration: none; + color: #55565b; + border: 1px solid transparent !important; /* 1 */ - color: #55565b; /* 1 */ border-radius: 2px; background: #fff; box-shadow: 0; @@ -433,9 +423,6 @@ } .dropbutton__item:first-of-type ~ .dropbutton__item > *:focus { + border-color: #26a769 !important; /* 1 */ - border-color: #26a769 !important; -} - -.dropbutton__item:first-of-type ~ .dropbutton__item > *:focus { /* 1 */ box-shadow: inset 0 0 0 1px #26a769, 0 0 0 1px #26a769; } reverted: --- b/core/themes/claro/css/components/form--select.css +++ a/core/themes/claro/css/components/form--select.css @@ -61,7 +61,7 @@ padding-right: calc(1rem - 1px); background-image: none; -webkit-appearance: listbox; + appearance: listbox /* Default appearance value for modern browsers. */ /* Lets browser set appearance value for modern browsers. */ - appearance: listbox; /* Default appearance to whatever the browser's default is. */ } @@ -116,21 +122,24 @@ select { -webkit-appearance: revert; + appearance: revert - appearance: revert; } } } +select { + + /* Necessary for Internet Explorer to show chevron. */ +} -/* Necessary for Internet Explorer to show chevron. */ @media screen and (-ms-high-contrast: active) { [dir="ltr"] select { + padding-right: 0 - padding-right: 0; } [dir="rtl"] select { + padding-left: 0 - padding-left: 0; } select { reverted: --- b/core/themes/olivero/css/components/form-text.css +++ a/core/themes/olivero/css/components/form-text.css @@ -36,12 +36,12 @@ font-family: inherit; font-size: inherit; -webkit-appearance: none; + appearance: none - appearance: none; } [type="color"]:focus, [type="date"]:focus, [type="datetime-local"]:focus, [type="email"]:focus, [type="file"]:focus, [type="month"]:focus, [type="number"]:focus, [type="password"]:focus, [type="search"]:focus, [type="tel"]:focus, [type="text"]:focus, [type="time"]:focus, [type="url"]:focus, [type="week"]:focus, textarea:focus { border: solid 2px #2494db; + outline: solid 2px #2494db - outline: solid 2px #2494db; } @supports (outline-style: double) { @@ -50,7 +50,7 @@ border-width: 1px; outline-width: 6px; outline-style: double; + outline-offset: -1px - outline-offset: -1px; } } @@ -63,20 +63,20 @@ background-color: #f1f4f7; } +[type="color"].error, [type="date"].error, [type="datetime-local"].error, [type="email"].error, [type="file"].error, [type="month"].error, [type="number"].error, [type="password"].error, [type="search"].error, [type="tel"].error, [type="text"].error, [type="time"].error, [type="url"].error, [type="week"].error, textarea.error { + border: solid 2px #e33f1e -.error[type="color"], .error[type="date"], .error[type="datetime-local"], .error[type="email"], .error[type="file"], .error[type="month"], .error[type="number"], .error[type="password"], .error[type="search"], .error[type="tel"], .error[type="text"], .error[type="time"], .error[type="url"], .error[type="week"], textarea.error { - border: solid 2px #e33f1e; } +[type="color"].error:focus, [type="date"].error:focus, [type="datetime-local"].error:focus, [type="email"].error:focus, [type="file"].error:focus, [type="month"].error:focus, [type="number"].error:focus, [type="password"].error:focus, [type="search"].error:focus, [type="tel"].error:focus, [type="text"].error:focus, [type="time"].error:focus, [type="url"].error:focus, [type="week"].error:focus, textarea.error:focus { -.error[type="color"]:focus, .error[type="date"]:focus, .error[type="datetime-local"]:focus, .error[type="email"]:focus, .error[type="file"]:focus, .error[type="month"]:focus, .error[type="number"]:focus, .error[type="password"]:focus, .error[type="search"]:focus, .error[type="tel"]:focus, .error[type="text"]:focus, .error[type="time"]:focus, .error[type="url"]:focus, .error[type="week"]:focus, textarea.error:focus { outline-color: #e33f1e; outline-offset: -2px; } +[type="color"].error + .ck-editor > .ck-editor__main, [type="date"].error + .ck-editor > .ck-editor__main, [type="datetime-local"].error + .ck-editor > .ck-editor__main, [type="email"].error + .ck-editor > .ck-editor__main, [type="file"].error + .ck-editor > .ck-editor__main, [type="month"].error + .ck-editor > .ck-editor__main, [type="number"].error + .ck-editor > .ck-editor__main, [type="password"].error + .ck-editor > .ck-editor__main, [type="search"].error + .ck-editor > .ck-editor__main, [type="tel"].error + .ck-editor > .ck-editor__main, [type="text"].error + .ck-editor > .ck-editor__main, [type="time"].error + .ck-editor > .ck-editor__main, [type="url"].error + .ck-editor > .ck-editor__main, [type="week"].error + .ck-editor > .ck-editor__main, textarea.error + .ck-editor > .ck-editor__main { -.error[type="color"] + .ck-editor > .ck-editor__main, .error[type="date"] + .ck-editor > .ck-editor__main, .error[type="datetime-local"] + .ck-editor > .ck-editor__main, .error[type="email"] + .ck-editor > .ck-editor__main, .error[type="file"] + .ck-editor > .ck-editor__main, .error[type="month"] + .ck-editor > .ck-editor__main, .error[type="number"] + .ck-editor > .ck-editor__main, .error[type="password"] + .ck-editor > .ck-editor__main, .error[type="search"] + .ck-editor > .ck-editor__main, .error[type="tel"] + .ck-editor > .ck-editor__main, .error[type="text"] + .ck-editor > .ck-editor__main, .error[type="time"] + .ck-editor > .ck-editor__main, .error[type="url"] + .ck-editor > .ck-editor__main, .error[type="week"] + .ck-editor > .ck-editor__main, textarea.error + .ck-editor > .ck-editor__main { border: solid 2px #e33f1e; } +[type="color"].form-element--small, [type="date"].form-element--small, [type="datetime-local"].form-element--small, [type="email"].form-element--small, [type="file"].form-element--small, [type="month"].form-element--small, [type="number"].form-element--small, [type="password"].form-element--small, [type="search"].form-element--small, [type="tel"].form-element--small, [type="text"].form-element--small, [type="time"].form-element--small, [type="url"].form-element--small, [type="week"].form-element--small, textarea.form-element--small { -.form-element--small[type="color"], .form-element--small[type="date"], .form-element--small[type="datetime-local"], .form-element--small[type="email"], .form-element--small[type="file"], .form-element--small[type="month"], .form-element--small[type="number"], .form-element--small[type="password"], .form-element--small[type="search"], .form-element--small[type="tel"], .form-element--small[type="text"], .form-element--small[type="time"], .form-element--small[type="url"], .form-element--small[type="week"], textarea.form-element--small { min-height: 2.8125rem; } @@ -97,26 +97,28 @@ [type="url"], [type="week"], textarea { + width: auto - width: auto; } } +[type="date"] { + /* Ensure that date field isn't larger than other fields. */ +} -/* Ensure that date field isn't larger than other fields. */ [dir="ltr"] [type="date"]::-webkit-datetime-edit-fields-wrapper { + padding-left: 0 - padding-left: 0; } [dir="rtl"] [type="date"]::-webkit-datetime-edit-fields-wrapper { + padding-right: 0 - padding-right: 0; } [dir="ltr"] [type="date"]::-webkit-datetime-edit-fields-wrapper { + padding-right: 0 - padding-right: 0; } [dir="rtl"] [type="date"]::-webkit-datetime-edit-fields-wrapper { + padding-left: 0 - padding-left: 0; } [type="date"]::-webkit-datetime-edit-fields-wrapper { reverted: --- b/core/themes/olivero/css/components/form.css +++ a/core/themes/olivero/css/components/form.css @@ -110,7 +110,7 @@ /* Use a background image to prevent screen readers from announcing the text. */ background-image: url("data:image/svg+xml,%3Csvg height='16' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m0 7.562 1.114-3.438c2.565.906 4.43 1.688 5.59 2.35-.306-2.921-.467-4.93-.484-6.027h3.511c-.05 1.597-.234 3.6-.558 6.003 1.664-.838 3.566-1.613 5.714-2.325l1.113 3.437c-2.05.678-4.06 1.131-6.028 1.356.984.856 2.372 2.381 4.166 4.575l-2.906 2.059c-.935-1.274-2.041-3.009-3.316-5.206-1.194 2.275-2.244 4.013-3.147 5.206l-2.856-2.059c1.872-2.307 3.211-3.832 4.017-4.575-2.081-.402-4.058-.856-5.93-1.356' fill='%232494DB'/%3E%3C/svg%3E%0A"); background-repeat: no-repeat; + background-size: 0.5rem 0.5rem - background-size: 0.5rem 0.5rem; } @media screen and (-ms-high-contrast: active) { @@ -118,7 +118,7 @@ .form-item__label.form-required::after, .fieldset__label.form-required::after, .required-mark::after { + background-image: url("data:image/svg+xml,%3Csvg height='16' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m0 7.562 1.114-3.438c2.565.906 4.43 1.688 5.59 2.35-.306-2.921-.467-4.93-.484-6.027h3.511c-.05 1.597-.234 3.6-.558 6.003 1.664-.838 3.566-1.613 5.714-2.325l1.113 3.437c-2.05.678-4.06 1.131-6.028 1.356.984.856 2.372 2.381 4.166 4.575l-2.906 2.059c-.935-1.274-2.041-3.009-3.316-5.206-1.194 2.275-2.244 4.013-3.147 5.206l-2.856-2.059c1.872-2.307 3.211-3.832 4.017-4.575-2.081-.402-4.058-.856-5.93-1.356' fill='%23ffffff'/%3E%3C/svg%3E%0A") - background-image: url("data:image/svg+xml,%3Csvg height='16' width='16' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m0 7.562 1.114-3.438c2.565.906 4.43 1.688 5.59 2.35-.306-2.921-.467-4.93-.484-6.027h3.511c-.05 1.597-.234 3.6-.558 6.003 1.664-.838 3.566-1.613 5.714-2.325l1.113 3.437c-2.05.678-4.06 1.131-6.028 1.356.984.856 2.372 2.381 4.166 4.575l-2.906 2.059c-.935-1.274-2.041-3.009-3.316-5.206-1.194 2.275-2.244 4.013-3.147 5.206l-2.856-2.059c1.872-2.307 3.211-3.832 4.017-4.575-2.081-.402-4.058-.856-5.93-1.356' fill='%23ffffff'/%3E%3C/svg%3E%0A"); } } @@ -159,13 +159,13 @@ background-position: left top; /* LTR */ background-size: 1.125rem 1.125rem; font-size: 0.875rem; + line-height: 1.125rem - line-height: 1.125rem; } @media screen and (-ms-high-contrast: active) { .form-item--error-message { + background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23ffffff' d='M9 0C4.03125 0 0 4.03125 0 9C0 13.9688 4.03125 18 9 18C13.9687 18 18 13.9688 18 9C18 4.03125 13.9687 0 9 0ZM10.5 14.6133C10.5 14.8242 10.3359 15 10.1367 15H7.88672C7.67578 15 7.5 14.8242 7.5 14.6133V12.3867C7.5 12.1758 7.67578 12 7.88672 12H10.1367C10.3359 12 10.5 12.1758 10.5 12.3867V14.6133ZM10.4766 10.582C10.4648 10.7461 10.2891 10.875 10.0781 10.875H7.91016C7.6875 10.875 7.51172 10.7461 7.51172 10.582L7.3125 3.30469C7.3125 3.22266 7.34766 3.14063 7.42969 3.09375C7.5 3.03516 7.60547 3 7.71094 3H10.2891C10.3945 3 10.5 3.03516 10.5703 3.09375C10.6523 3.14063 10.6875 3.22266 10.6875 3.30469L10.4766 10.582Z'/%3E%3C/svg%3E") - background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23ffffff' d='M9 0C4.03125 0 0 4.03125 0 9C0 13.9688 4.03125 18 9 18C13.9687 18 18 13.9688 18 9C18 4.03125 13.9687 0 9 0ZM10.5 14.6133C10.5 14.8242 10.3359 15 10.1367 15H7.88672C7.67578 15 7.5 14.8242 7.5 14.6133V12.3867C7.5 12.1758 7.67578 12 7.88672 12H10.1367C10.3359 12 10.5 12.1758 10.5 12.3867V14.6133ZM10.4766 10.582C10.4648 10.7461 10.2891 10.875 10.0781 10.875H7.91016C7.6875 10.875 7.51172 10.7461 7.51172 10.582L7.3125 3.30469C7.3125 3.22266 7.34766 3.14063 7.42969 3.09375C7.5 3.03516 7.60547 3 7.71094 3H10.2891C10.3945 3 10.5 3.03516 10.5703 3.09375C10.6523 3.14063 10.6875 3.22266 10.6875 3.30469L10.4766 10.582Z'/%3E%3C/svg%3E"); } } reverted: --- b/core/themes/olivero/css/components/header-buttons-mobile.css +++ a/core/themes/olivero/css/components/header-buttons-mobile.css @@ -11,35 +11,35 @@ */ [dir="ltr"] .mobile-buttons { + margin-left: auto - margin-left: auto; } [dir="rtl"] .mobile-buttons { + margin-right: auto - margin-right: auto; } .mobile-buttons { + margin-top: 0.5625rem - margin-top: 0.5625rem; } @media (min-width: 31.25rem) { .mobile-buttons { + margin-top: 2.25rem - margin-top: 2.25rem; } } @media (min-width: 43.75rem) { .mobile-buttons { + margin-top: 4.5rem - margin-top: 4.5rem; } } @media (min-width: 75rem) { .mobile-buttons { + margin-top: 6.75rem - margin-top: 6.75rem; } } reverted: --- b/core/themes/olivero/css/components/header-navigation.css +++ a/core/themes/olivero/css/components/header-navigation.css @@ -11,27 +11,27 @@ */ [dir="ltr"] .header-nav { + left: 100% - left: 100%; } [dir="rtl"] .header-nav { + right: 100% - right: 100%; } [dir="ltr"] .header-nav { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .header-nav { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .header-nav { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .header-nav { + padding-left: 1.125rem - padding-left: 1.125rem; } .header-nav { @@ -57,9 +57,9 @@ * use padding because that would enable the button to scroll out of the * viewport on short screens. */ + border-top: solid #fff 54px; - border-top: solid #fff 3.375rem; background-color: #fff; + box-shadow: 0 0 72px rgba(0, 0, 0, 0.1) - box-shadow: 0 0 72px rgba(0, 0, 0, 0.1); } .header-nav.is-active { @@ -70,30 +70,30 @@ @supports (flex-basis: max-content) { .header-nav { + flex-basis: max-content - flex-basis: max-content; } } @media (min-width: 31.25rem) { .header-nav { + border-top-width: 90px - border-top-width: 90px; } } @media (min-width: 43.75rem) { [dir="ltr"] .header-nav { + padding-left: 3.375rem - padding-left: 3.375rem; } [dir="rtl"] .header-nav { + padding-right: 3.375rem - padding-right: 3.375rem; } .header-nav { padding-bottom: 3.375rem; + border-top-width: 126px - border-top-width: 126px; } } @@ -102,18 +102,21 @@ .header-nav { -ms-grid-column: 5; -ms-grid-column-span: 9; + grid-column: 5 / 14 - grid-column: 5 / 14; } } +.header-nav { + + /* -/* * Ensure top border has the same color as the background when in forced colors. */ +} @media (forced-colors: active) { .header-nav { + border-top-color: canvas - border-top-color: canvas; } } @@ -129,13 +132,13 @@ /* Toolbar is fixed, and tray is vertical. */ body.toolbar-vertical .header-nav { + border-top-width: 93px - border-top-width: 93px; } @media (min-width: 31.25rem) { body.toolbar-vertical .header-nav { + border-top-width: 129px - border-top-width: 129px; } } @@ -145,7 +148,7 @@ body.toolbar-vertical .header-nav, body.toolbar-horizontal.toolbar-fixed .header-nav { + border-top-width: 165px - border-top-width: 165px; } } @@ -154,26 +157,26 @@ @media (min-width: 43.75rem) { body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open .header-nav { + border-top-width: 205px - border-top-width: 205px; } } @media (min-width: 75rem) { [dir="ltr"] body:not(.is-always-mobile-nav) .header-nav { + padding-left: 0 - padding-left: 0; } [dir="rtl"] body:not(.is-always-mobile-nav) .header-nav { + padding-right: 0 - padding-right: 0; } [dir="ltr"] body:not(.is-always-mobile-nav) .header-nav { + padding-right: 0 - padding-right: 0; } [dir="rtl"] body:not(.is-always-mobile-nav) .header-nav { + padding-left: 0 - padding-left: 0; } body:not(.is-always-mobile-nav) .header-nav { @@ -194,59 +197,64 @@ transition: transform 0.2s; transform: none; border-top: 0; + box-shadow: none - box-shadow: none; } } +body.is-always-mobile-nav { + /* Toolbar is fixed, and tray is vertical or toolbar is horizontal and tray is closed. */ +} -/* Toolbar is fixed, and tray is vertical or toolbar is horizontal and tray is closed. */ @media (min-width: 75rem) { body.is-always-mobile-nav.toolbar-vertical .header-nav, body.is-always-mobile-nav.toolbar-horizontal.toolbar-fixed .header-nav { + border-top-width: 237px - border-top-width: 237px; } } +body.is-always-mobile-nav { + + /* Toolbar is horizontal fixed, and tray is open. */ +} -/* Toolbar is horizontal fixed, and tray is open. */ @media (min-width: 75rem) { body.is-always-mobile-nav.toolbar-horizontal.toolbar-fixed.toolbar-tray-open .header-nav { + border-top-width: 277px - border-top-width: 277px; } } @media (min-width: 75rem) { [dir="ltr"] body.is-always-mobile-nav .header-nav { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] body.is-always-mobile-nav .header-nav { + padding-left: 1.125rem - padding-left: 1.125rem; } body.is-always-mobile-nav .header-nav { overflow: auto; max-width: calc(50vw - 4.40625rem); transition: transform 0.2s, visibility 0.2s; + border-top-width: 198px - border-top-width: 198px; } } @media (min-width: 90rem) { [dir="ltr"] body.is-always-mobile-nav .header-nav { + padding-right: calc(100vw - 88.875rem) - padding-right: calc(100vw - 88.875rem); } [dir="rtl"] body.is-always-mobile-nav .header-nav { + padding-left: calc(100vw - 88.875rem) - padding-left: calc(100vw - 88.875rem); } body.is-always-mobile-nav .header-nav { + max-width: calc(100vw - 48.9375rem) - max-width: calc(100vw - 48.9375rem); } } @@ -255,11 +263,11 @@ } [dir="ltr"] .header-nav-overlay { + left: 0 - left: 0; } [dir="rtl"] .header-nav-overlay { + right: 0 - right: 0; } .header-nav-overlay { @@ -270,16 +278,16 @@ width: 100%; height: 100vh; opacity: 0.2; + background: #0d77b5 - background: #0d77b5; } @media (forced-colors: active) { .header-nav-overlay { + background: canvastext - background: canvastext; } } .is-overlay-active .header-nav-overlay { + display: block - display: block; } reverted: --- b/core/themes/olivero/css/components/header-search-narrow.css +++ a/core/themes/olivero/css/components/header-search-narrow.css @@ -14,7 +14,7 @@ margin-left: -1.125rem; margin-right: -1.125rem; margin-bottom: 2.25rem; + background: #000 - background: #000; } .block-search-narrow .search-block-form { @@ -31,19 +31,19 @@ } [dir="ltr"] .block-search-narrow input[type="search"] { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .block-search-narrow input[type="search"] { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .block-search-narrow input[type="search"] { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .block-search-narrow input[type="search"] { + padding-left: 1.125rem - padding-left: 1.125rem; } .block-search-narrow input[type="search"] { @@ -62,7 +62,7 @@ box-shadow: none; font-family: "Lora", "georgia", serif; font-size: 1rem; + -webkit-appearance: none - -webkit-appearance: none; } .block-search-narrow input[type="search"]::-ms-clear { @@ -73,7 +73,7 @@ .block-search-narrow input[type="search"]:focus { outline: solid 4px transparent; outline-offset: -4px; + background-size: 100% 0.3125rem - background-size: 100% 0.3125rem; /* We normally indicate focus by animating background-image width. This isn't @@ -84,63 +84,63 @@ @media screen and (-ms-high-contrast: active) { .block-search-narrow input[type="search"]:focus { + border-bottom-width: 5px - border-bottom-width: 5px; } } @media (min-width: 43.75rem) { [dir="ltr"] .block-search-narrow input[type="search"] { + padding-left: 2.25rem - padding-left: 2.25rem; } [dir="rtl"] .block-search-narrow input[type="search"] { + padding-right: 2.25rem - padding-right: 2.25rem; } [dir="ltr"] .block-search-narrow input[type="search"] { + padding-right: 2.25rem - padding-right: 2.25rem; } [dir="rtl"] .block-search-narrow input[type="search"] { + padding-left: 2.25rem - padding-left: 2.25rem; } .block-search-narrow input[type="search"] { + height: 4.5rem - height: 4.5rem; } } [dir="ltr"] .block-search-narrow .search-form__submit { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .block-search-narrow .search-form__submit { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .block-search-narrow .search-form__submit { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .block-search-narrow .search-form__submit { + margin-left: 0 - margin-left: 0; } [dir="ltr"] .block-search-narrow .search-form__submit { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .block-search-narrow .search-form__submit { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .block-search-narrow .search-form__submit { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .block-search-narrow .search-form__submit { + padding-left: 0 - padding-left: 0; } .block-search-narrow .search-form__submit { @@ -156,7 +156,7 @@ padding-bottom: 0; cursor: pointer; border-color: transparent; + background-color: transparent - background-color: transparent; /* When in Windows high contrast mode, FF will not output either background @@ -165,11 +165,11 @@ } [dir="ltr"] .block-search-narrow .search-form__submit .icon--search { + left: 0 - left: 0; } [dir="rtl"] .block-search-narrow .search-form__submit .icon--search { + right: 0 - right: 0; } .block-search-narrow .search-form__submit .icon--search { @@ -182,15 +182,15 @@ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='26' height='27.2' viewBox='0 0 26 27.2'%3e %3cpath fill='%23fff' d='M25.8,25.5l-5.3-5.3c2.1-2.1,3.4-5.1,3.4-8.3C23.9,5.3,18.5,0,11.9,0C5.3,0,0,5.3,0,11.9c0,6.6,5.3,11.9,11.9,11.9c2.6,0,5.1-0.9,7-2.3l5.4,5.4c0.4,0.4,1,0.4,1.4,0C26.1,26.6,26.1,25.9,25.8,25.5z M11.9,21.9c-5.5,0-9.9-4.4-9.9-9.9S6.4,2,11.9,2c5.5,0,9.9,4.4,9.9,9.9S17.4,21.9,11.9,21.9z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: center; + background-size: auto - background-size: auto; } [dir="ltr"] .block-search-narrow .search-form__submit .icon--search:after { + left: 0 - left: 0; } [dir="rtl"] .block-search-narrow .search-form__submit .icon--search:after { + right: 0 - right: 0; } .block-search-narrow .search-form__submit .icon--search:after { @@ -202,7 +202,7 @@ transition: transform 0.2s; transform: scaleX(0); transform-origin: left; /* LTR */ + border-top: solid 5px #2494db; - border-top: solid 0.3125rem #2494db; } @media (forced-colors: active) { @@ -214,14 +214,14 @@ -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; + mask-position: center - mask-position: center; } } .block-search-narrow .search-form__submit:focus { outline: solid 4px transparent; outline-offset: -4px; + box-shadow: none - box-shadow: none; } .block-search-narrow .search-form__submit:focus span:after { @@ -231,7 +231,7 @@ @media screen and (-ms-high-contrast: active) { .block-search-narrow .search-form__submit:focus { + border-bottom-width: 9px - border-bottom-width: 9px; } .block-search-narrow .search-form__submit:focus span:after { @@ -242,12 +242,15 @@ @media (min-width: 43.75rem) { .block-search-narrow .search-form__submit { + width: 5rem - width: 5rem; } } @media screen and (-ms-high-contrast: active) { + +.block-search-narrow .search-form__submit { /* IE11's high contrast show will not show the background image, so we show the text. */ + } .block-search-narrow .search-form__submit .visually-hidden { position: static; overflow: visible; @@ -257,37 +260,43 @@ text-align: center; } +.block-search-narrow .search-form__submit { + /* Edge's high contrast does show the background image, so we hide it. */ + } .block-search-narrow .search-form__submit .icon--search { display: none; } } +.block-search-narrow { + + /* 500px is the width of the primary nav at mobile. */ +} -/* 500px is the width of the primary nav at mobile. */ @media (min-width: 31.25rem) { [dir="ltr"] .block-search-narrow { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .block-search-narrow { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .block-search-narrow { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .block-search-narrow { + margin-left: 0 - margin-left: 0; } } @media (min-width: 75rem) { body:not(.is-always-mobile-nav) .block-search-narrow { + display: none - display: none; } } reverted: --- b/core/themes/olivero/css/components/header-search-wide.css +++ a/core/themes/olivero/css/components/header-search-wide.css @@ -57,11 +57,11 @@ } [dir="ltr"] .block-search-wide__wrapper { + border-left: solid 90px #313637; - border-left: solid 5.625rem #313637; } [dir="rtl"] .block-search-wide__wrapper { + border-right: solid 90px #313637; - border-right: solid 5.625rem #313637; } .block-search-wide__wrapper { @@ -80,7 +80,7 @@ padding-top: 0; padding-bottom: 0; transition: all 0.2s; + background: #000 - background: #000; } .block-search-wide__wrapper.is-active { @@ -122,7 +122,7 @@ box-shadow: none; font-family: "Lora", "georgia", serif; font-size: 2rem; + -webkit-appearance: none - -webkit-appearance: none; } .block-search-wide__wrapper input[type="search"]::-ms-clear { @@ -132,7 +132,7 @@ .block-search-wide__wrapper input[type="search"]:focus { outline: solid 4px transparent; + outline-offset: -4px - outline-offset: -4px; /* We normally indicate focus by animating background-image width. This isn't @@ -143,7 +143,7 @@ @media screen and (-ms-high-contrast: active) { .block-search-wide__wrapper input[type="search"]:focus { + border-bottom-width: 9px - border-bottom-width: 9px; } } @@ -202,7 +202,7 @@ padding-bottom: 0; cursor: pointer; border-color: transparent; + background-color: transparent - background-color: transparent; /* When in Windows high contrast mode, FF will not output either background @@ -228,7 +228,7 @@ background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='26' height='27.2' viewBox='0 0 26 27.2'%3e %3cpath fill='%23fff' d='M25.8,25.5l-5.3-5.3c2.1-2.1,3.4-5.1,3.4-8.3C23.9,5.3,18.5,0,11.9,0C5.3,0,0,5.3,0,11.9c0,6.6,5.3,11.9,11.9,11.9c2.6,0,5.1-0.9,7-2.3l5.4,5.4c0.4,0.4,1,0.4,1.4,0C26.1,26.6,26.1,25.9,25.8,25.5z M11.9,21.9c-5.5,0-9.9-4.4-9.9-9.9S6.4,2,11.9,2c5.5,0,9.9,4.4,9.9,9.9S17.4,21.9,11.9,21.9z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: center; + background-size: contain - background-size: contain; } [dir="ltr"] .block-search-wide__wrapper .search-form__submit .icon--search:after { @@ -248,13 +248,13 @@ transition: transform 0.2s; transform: scaleX(0); transform-origin: left; + border-top: solid 9px #2494db; - border-top: solid 0.5625rem #2494db; } .block-search-wide__wrapper .search-form__submit:focus { outline: solid 4px transparent; outline-offset: -4px; + box-shadow: none - box-shadow: none; } .block-search-wide__wrapper .search-form__submit:focus span:after { @@ -264,7 +264,7 @@ @media screen and (-ms-high-contrast: active) { .block-search-wide__wrapper .search-form__submit:focus { + border-bottom-width: 9px - border-bottom-width: 9px; } .block-search-wide__wrapper .search-form__submit:focus span:after { @@ -273,7 +273,10 @@ } @media screen and (-ms-high-contrast: active) { + +.block-search-wide__wrapper .search-form__submit { /* IE11's high contrast show will not show the background image, so we show the text. */ + } .block-search-wide__wrapper .search-form__submit .visually-hidden { position: static; overflow: visible; @@ -283,7 +286,10 @@ text-align: center; } +.block-search-wide__wrapper .search-form__submit { + /* Edge's high contrast does show the background image, so we hide it. */ + } .block-search-wide__wrapper .search-form__submit .icon--search { display: none; } @@ -329,12 +335,12 @@ color: #0d1214; /* Affects SVG search icon. */ border: 0; background: transparent; + -webkit-appearance: none - -webkit-appearance: none; } .block-search-wide__button:focus { position: relative; + outline: 0 - outline: 0; } .block-search-wide__button:focus:after { @@ -350,7 +356,7 @@ } .block-search-wide__button[aria-expanded="true"] { + background: #000 - background: #000; } .block-search-wide__button[aria-expanded="true"]:focus:after { @@ -399,7 +405,7 @@ @media (forced-colors: active) { .block-search-wide__button { + background: ButtonFace - background: ButtonFace; } .block-search-wide__button path { @@ -421,7 +427,7 @@ background-image: linear-gradient(#2494db, #2494db); /* Two values are needed for IE11 support. */ background-repeat: no-repeat; background-position: bottom left; /* LTR */ + background-size: 0% 0.625rem - background-size: 0% 0.625rem; } [dir] .block-search-wide__wrapper input[type="search"]:focus { @@ -440,6 +446,6 @@ body:not(.is-always-mobile-nav) .block-search-wide__wrapper, body:not(.is-always-mobile-nav) .block-search-wide__button { + display: block - display: block; } } reverted: --- b/core/themes/olivero/css/components/header-site-branding.css +++ a/core/themes/olivero/css/components/header-site-branding.css @@ -12,28 +12,28 @@ [dir="ltr"] .site-branding { margin-left: -1.125rem; + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .site-branding { margin-right: -1.125rem; + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .site-branding { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .site-branding { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .site-branding { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .site-branding { + padding-left: 1.125rem - padding-left: 1.125rem; } .site-branding { @@ -46,13 +46,13 @@ padding-bottom: 0.5625rem; /* @todo - #0d7ab8 isn't currently a variable. */ + background-image: linear-gradient(160deg, #2494db 0%, #0d7ab8 78.66%) - background-image: linear-gradient(160deg, #2494db 0%, #0d7ab8 78.66%); } @media (min-width: 31.25rem) { .site-branding { + min-height: 4.5rem - min-height: 4.5rem; } } @@ -60,55 +60,55 @@ .site-branding { min-height: 6.75rem; + padding-bottom: 1.125rem - padding-bottom: 1.125rem; } } @media (min-width: 62.5rem) { .site-branding { + min-width: calc(14.28571vw + 0.99107rem) - min-width: calc(14.28571vw + 0.99107rem); } } @media (min-width: 75rem) { [dir="ltr"] .site-branding { + margin-left: -2.25rem - margin-left: -2.25rem; } [dir="rtl"] .site-branding { + margin-right: -2.25rem - margin-right: -2.25rem; } [dir="ltr"] .site-branding { + padding-left: 2.25rem - padding-left: 2.25rem; } [dir="rtl"] .site-branding { + padding-right: 2.25rem - padding-right: 2.25rem; } [dir="ltr"] .site-branding { + padding-right: 2.25rem - padding-right: 2.25rem; } [dir="rtl"] .site-branding { + padding-left: 2.25rem - padding-left: 2.25rem; } .site-branding { min-width: calc(14.28571vw + 0.99107rem); min-height: 11.25rem; padding-top: 0; + padding-bottom: 0 - padding-bottom: 0; } } @media (min-width: 90rem) { .site-branding { + min-width: 13.98214rem - min-width: 13.98214rem; } } @@ -126,7 +126,7 @@ .site-branding__inner { display: flex; + align-items: center - align-items: center; } .site-branding__inner a { @@ -136,64 +136,64 @@ @media (min-width: 75rem) { [dir="ltr"] .site-branding__inner { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .site-branding__inner { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .site-branding__inner { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .site-branding__inner { + padding-left: 0 - padding-left: 0; } .site-branding__inner { height: 6.75rem; padding-top: 0.5625rem; + padding-bottom: 0.5625rem - padding-bottom: 0.5625rem; } } .site-branding__logo { flex-shrink: 0; + max-width: 100% - max-width: 100%; } .site-branding__logo img { width: auto; max-width: 100%; + max-height: 2.25rem - max-height: 2.25rem; } @media (min-width: 31.25rem) { .site-branding__logo img { + max-height: 3.375rem - max-height: 3.375rem; } } @media (min-width: 43.75rem) { .site-branding__logo img { + max-height: 4.5rem - max-height: 4.5rem; } } @media (min-width: 75rem) { .site-branding__logo img { + max-height: 5.625rem - max-height: 5.625rem; } } .site-branding__text { color: #fff; font-size: 1.125rem; + font-weight: bold - font-weight: bold; } .site-branding__text a { @@ -204,7 +204,7 @@ .site-branding__text { font-size: 1.75rem; + line-height: 1.75rem - line-height: 1.75rem; } } @@ -213,7 +213,7 @@ .site-branding__text { letter-spacing: 0.02em; font-size: 2rem; + line-height: 2.25rem - line-height: 2.25rem; } } @@ -223,9 +223,9 @@ } [dir="ltr"] .site-branding__logo + .site-branding__text { + margin-left: 0.75rem - margin-left: 0.75rem; } [dir="rtl"] .site-branding__logo + .site-branding__text { + margin-right: 0.75rem - margin-right: 0.75rem; } reverted: --- b/core/themes/olivero/css/components/header-sticky-toggle.css +++ a/core/themes/olivero/css/components/header-sticky-toggle.css @@ -14,7 +14,7 @@ */ .sticky-header-toggle { + display: none - display: none; } @media (min-width: 75rem) { @@ -30,7 +30,7 @@ opacity: 0; border: 0; outline: 0; + background-color: #2494db - background-color: #2494db; } .sticky-header-toggle:focus { @@ -45,14 +45,14 @@ @media (min-width: 75rem) { body:not(.is-always-mobile-nav) .is-fixed .sticky-header-toggle { + visibility: visible - visibility: visible; } } @media (min-width: 75rem) { body.is-always-mobile-nav .sticky-header-toggle { + visibility: hidden - visibility: hidden; } } @@ -62,22 +62,22 @@ height: 1.3125rem; transition: opacity 0.2s; pointer-events: none; + transform-style: preserve-3d - transform-style: preserve-3d; } .sticky-header-toggle__icon > span { display: block; height: 0; /* Intentionally not using CSS logical properties. */ + border-top: solid 3px #fff - border-top: solid 3px #fff; } [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(1) { + left: 0 - left: 0; } [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(1) { + right: 0 - right: 0; } .sticky-header-toggle__icon > span:nth-child(1) { @@ -90,11 +90,11 @@ } [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(2) { + left: 0 - left: 0; } [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(2) { + right: 0 - right: 0; } .sticky-header-toggle__icon > span:nth-child(2) { @@ -107,11 +107,11 @@ } [dir="ltr"] .sticky-header-toggle__icon > span:nth-child(3) { + left: 0 - left: 0; } [dir="rtl"] .sticky-header-toggle__icon > span:nth-child(3) { + right: 0 - right: 0; } .sticky-header-toggle__icon > span:nth-child(3) { reverted: --- b/core/themes/olivero/css/components/hero.css +++ a/core/themes/olivero/css/components/hero.css @@ -13,7 +13,7 @@ .hero__content { -ms-grid-column: 1; -ms-grid-column-span: 6; + grid-column: 1 / 7 - grid-column: 1 / 7; } @media (min-width: 43.75rem) { @@ -21,7 +21,7 @@ .hero__content { /* 700px */ -ms-grid-column: 3; -ms-grid-column-span: 10; + grid-column: 3 / 13 - grid-column: 3 / 13; } } @@ -30,7 +30,7 @@ .hero__content { -ms-grid-column: 3; -ms-grid-column-span: 8; + grid-column: 3 / 11 - grid-column: 3 / 11; } } @@ -39,7 +39,7 @@ -ms-grid-column-span: 6; grid-column: 1 / 7; margin-top: 2.25rem; + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } .hero__img img { @@ -50,7 +50,7 @@ .hero__img { margin-top: 3.375rem; + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } @@ -61,7 +61,7 @@ -ms-grid-column-span: 14; grid-column: 1 / 15; margin-top: 4.5rem; + margin-bottom: 4.5rem - margin-bottom: 4.5rem; } } @@ -70,6 +70,6 @@ .hero__img { -ms-grid-column: 2; -ms-grid-column-span: 12; + grid-column: 2 / 14 - grid-column: 2 / 14; } } reverted: --- b/core/themes/olivero/css/components/links.css +++ a/core/themes/olivero/css/components/links.css @@ -11,54 +11,54 @@ */ [dir="ltr"] .links.inline { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .links.inline { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .links.inline { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .links.inline { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .links.inline { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .links.inline { + padding-left: 0 - padding-left: 0; } .links.inline { padding-top: 0; padding-bottom: 0; + list-style: none - list-style: none; } .links.inline > * { + display: inline - display: inline; } [dir="ltr"] .links.inline > *:not(:last-child) { + padding-right: 1em - padding-right: 1em; } [dir="rtl"] .links.inline > *:not(:last-child) { + padding-left: 1em - padding-left: 1em; } @media (min-width: 43.75rem) { [dir="ltr"] .node--type-book .links.inline { + text-align: right - text-align: right; } [dir="rtl"] .node--type-book .links.inline { + text-align: left - text-align: left; } } reverted: --- b/core/themes/olivero/css/components/maintenance-page.css +++ a/core/themes/olivero/css/components/maintenance-page.css @@ -14,7 +14,7 @@ .maintenance-page .site-header__initial { flex-shrink: 0; + width: 5.625rem - width: 5.625rem; } } reverted: --- b/core/themes/olivero/css/components/messages.css +++ a/core/themes/olivero/css/components/messages.css @@ -56,14 +56,17 @@ padding-bottom: 1.125rem; color: #fff; outline: solid 1px transparent; + background-color: #0d1214 - background-color: #0d1214; } .messages * { color: inherit; } +.messages { + + /* Additional specificity to override contrib modules. */ +} -/* Additional specificity to override contrib modules. */ .messages.messages-list__item { background-image: none; @@ -130,7 +133,7 @@ } .messages__header { + flex-shrink: 0 - flex-shrink: 0; } [dir="ltr"] .messages__header.no-icon { @@ -187,7 +190,7 @@ border: 0; background: none; -webkit-appearance: none; + appearance: none - appearance: none; } .messages__close:before, @@ -249,11 +252,11 @@ } [dir="ltr"] .js-form-managed-file .messages { + border-left: solid 6px #e33f1e; - border-left: solid 0.375rem #e33f1e; } [dir="rtl"] .js-form-managed-file .messages { + border-right: solid 6px #e33f1e; - border-right: solid 0.375rem #e33f1e; } .js-form-managed-file .messages { reverted: --- b/core/themes/olivero/css/components/navigation/menu-sidebar.css +++ a/core/themes/olivero/css/components/navigation/menu-sidebar.css @@ -11,7 +11,7 @@ */ .menu--sidebar { + list-style: none - list-style: none; } .menu--sidebar .menu { @@ -23,19 +23,19 @@ } [dir="ltr"] .menu--sidebar .menu__link { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .menu--sidebar .menu__link { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .menu--sidebar .menu__link { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .menu--sidebar .menu__link { + padding-left: 0 - padding-left: 0; } .menu--sidebar .menu__link { @@ -44,17 +44,17 @@ padding-top: 0.84375rem; padding-bottom: 0.84375rem; font-family: "Lora", "georgia", serif; + font-size: 1.125rem - font-size: 1.125rem; /* Bottom divider line. */ } [dir="ltr"] .menu--sidebar .menu__link:after { + left: 0 - left: 0; } [dir="rtl"] .menu--sidebar .menu__link:after { + right: 0 - right: 0; } .menu--sidebar .menu__link:after { @@ -69,14 +69,17 @@ .menu--sidebar .menu__link--link { text-decoration: none; color: #0d1214; + font-weight: 600 - font-weight: 600; } .menu--sidebar .menu__link--link:hover { color: #2494db; } +.menu--sidebar { + + /* No bottom divider line for last menu item. */ +} -/* No bottom divider line for last menu item. */ .menu--sidebar .menu__item--level-1:last-child > .menu__link:last-child:after, .menu--sidebar .menu__item--level-1:last-child > .menu__item--level-2:last-child > .menu__link:last-child:after { content: none; reverted: --- b/core/themes/olivero/css/components/navigation/nav-button-mobile.css +++ a/core/themes/olivero/css/components/navigation/nav-button-mobile.css @@ -11,35 +11,35 @@ */ [dir="ltr"] .mobile-nav-button { + margin-left: auto - margin-left: auto; } [dir="rtl"] .mobile-nav-button { + margin-right: auto - margin-right: auto; } [dir="ltr"] .mobile-nav-button { + margin-right: -0.375rem - margin-right: -0.375rem; } [dir="rtl"] .mobile-nav-button { + margin-left: -0.375rem - margin-left: -0.375rem; } [dir="ltr"] .mobile-nav-button { + padding-left: 0.375rem - padding-left: 0.375rem; } [dir="rtl"] .mobile-nav-button { + padding-right: 0.375rem - padding-right: 0.375rem; } [dir="ltr"] .mobile-nav-button { + padding-right: 0.375rem - padding-right: 0.375rem; } [dir="rtl"] .mobile-nav-button { + padding-left: 0.375rem - padding-left: 0.375rem; } .mobile-nav-button { @@ -57,7 +57,7 @@ border: none; background: transparent; -webkit-appearance: none; + appearance: none - appearance: none; } .mobile-nav-button:focus { @@ -71,16 +71,16 @@ @media (min-width: 31.25rem) { [dir="ltr"] .mobile-nav-button { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .mobile-nav-button { + padding-right: 1.125rem - padding-right: 1.125rem; } .mobile-nav-button { display: inline-flex; + width: auto - width: auto; } } @@ -93,17 +93,17 @@ clip: rect(1px, 1px, 1px, 1px); width: 1px; height: 1px; + word-wrap: normal - word-wrap: normal; } @media (min-width: 31.25rem) { [dir="ltr"] .mobile-nav-button__label { + margin-right: 0.75rem - margin-right: 0.75rem; } [dir="rtl"] .mobile-nav-button__label { + margin-left: 0.75rem - margin-left: 0.75rem; } .mobile-nav-button__label { @@ -114,7 +114,7 @@ height: auto; letter-spacing: 0.05em; font-size: 0.875rem; + font-weight: 600 - font-weight: 600; } } @@ -123,15 +123,15 @@ display: block; width: 2.25rem; height: 0; + border-top: solid 3px #2494db - border-top: solid 3px #2494db; } [dir="ltr"] .mobile-nav-button__icon:before { + left: 0 - left: 0; } [dir="rtl"] .mobile-nav-button__icon:before { + right: 0 - right: 0; } .mobile-nav-button__icon:before { @@ -145,11 +145,11 @@ } [dir="ltr"] .mobile-nav-button__icon:after { + left: 0 - left: 0; } [dir="rtl"] .mobile-nav-button__icon:after { + right: 0 - right: 0; } .mobile-nav-button__icon:after { @@ -164,7 +164,7 @@ } .mobile-nav-button[aria-expanded="true"] .mobile-nav-button__icon { + border-top: 0 - border-top: 0; } .mobile-nav-button[aria-expanded="true"] .mobile-nav-button__icon:before { reverted: --- b/core/themes/olivero/css/components/navigation/nav-primary-button.css +++ a/core/themes/olivero/css/components/navigation/nav-primary-button.css @@ -11,19 +11,19 @@ */ [dir="ltr"] .primary-nav__button-toggle { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .primary-nav__button-toggle { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .primary-nav__button-toggle { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .primary-nav__button-toggle { + padding-left: 0 - padding-left: 0; } .primary-nav__button-toggle { @@ -38,7 +38,7 @@ text-indent: -62.4375rem; border: 0; background: transparent; + -webkit-appearance: none - -webkit-appearance: none; } .primary-nav__button-toggle:focus { @@ -56,7 +56,7 @@ height: 1rem; transition: background-color 0.2s; transform: translate(-50%, -50%); + border-radius: 2px - border-radius: 2px; } .primary-nav__button-toggle .icon--menu-toggle:before, @@ -83,9 +83,12 @@ opacity: 0; } +.primary-nav__button-toggle { + + /* aria-hidden attribute is removed by JS. Button is non-functional -/* aria-hidden attribute is removed by JS. Button is non-functional until JS is enabled. */ +} .primary-nav__button-toggle[aria-hidden="true"] { pointer-events: none; @@ -93,10 +96,10 @@ @media (min-width: 75rem) { [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__button-toggle { + margin-right: -2.25rem - margin-right: -2.25rem; } [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__button-toggle { + margin-left: -2.25rem - margin-left: -2.25rem; } body:not(.is-always-mobile-nav) .primary-nav__button-toggle { flex-shrink: 0; @@ -104,12 +107,12 @@ align-self: stretch; width: 2.75rem; height: auto; + margin-top: 0 - margin-top: 0; } body:not(.is-always-mobile-nav) .primary-nav__button-toggle:focus { border: 0; + outline: 0 - outline: 0; } body:not(.is-always-mobile-nav) .primary-nav__button-toggle:focus .icon--menu-toggle { @@ -126,18 +129,18 @@ } [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__button-toggle .icon--menu-toggle { + left: 0.1875rem - left: 0.1875rem; } [dir="rtl"] body:not(.is-always-mobile-nav) .primary-nav__button-toggle .icon--menu-toggle { + right: 0.1875rem - right: 0.1875rem; } body:not(.is-always-mobile-nav) .primary-nav__button-toggle .icon--menu-toggle { width: 1.125rem; transform: translateY(-50%); border-radius: 0.25rem; + background-color: #fff - background-color: #fff; } body:not(.is-always-mobile-nav) .primary-nav__button-toggle .icon--menu-toggle:before { reverted: --- b/core/themes/olivero/css/components/navigation/nav-primary-no-js.css +++ a/core/themes/olivero/css/components/navigation/nav-primary-no-js.css @@ -10,14 +10,16 @@ * Styles for primary navigation when JavaScript is disabled. */ +html:not(.js) { + /** -/** * Mobile styles for primary navigation when JS is disabled. */ +} @media (max-width: 75rem) { html:not(.js) .primary-nav__menu--level-1 { column-width: 18.75rem; + grid-column-gap: 2.25rem; - column-gap: 2.25rem; } html:not(.js) .primary-nav__menu-item { @@ -35,39 +37,35 @@ html[dir="ltr"]:not(.js) .header-nav { margin-left: 2.25rem; + } - } html[dir="rtl"]:not(.js) .header-nav { margin-right: 2.25rem; + } - } html[dir="ltr"]:not(.js) .header-nav { margin-right: 2.25rem; + } - } html[dir="rtl"]:not(.js) .header-nav { margin-left: 2.25rem; + } - } html[dir="ltr"]:not(.js) .header-nav { padding-left: 2.25rem; + } - } html[dir="rtl"]:not(.js) .header-nav { padding-right: 2.25rem; + } - } html[dir="ltr"]:not(.js) .header-nav { padding-right: 2.25rem; + } - } html[dir="rtl"]:not(.js) .header-nav { padding-left: 2.25rem; + } - } - - html:not(.js) .header-nav { - border: solid 1px #e7edf1 !important; - } html:not(.js) .header-nav { position: static; @@ -80,16 +78,17 @@ padding-top: 2.25rem; padding-bottom: 0; transform: none; + border: solid 1px #e7edf1 !important; box-shadow: 0 0 36px #d7e1e8; } html[dir="ltr"]:not(.js) .primary-nav__menu--level-2 { border-left: 0; + } - } html[dir="rtl"]:not(.js) .primary-nav__menu--level-2 { border-right: 0; + } - } html:not(.js) .primary-nav__button-toggle { display: none; @@ -101,12 +100,15 @@ } @media (min-width: 75rem) { + +html:not(.js) { /** * Styles for 'always on mobile navigation' when JS is disabled. */ +} html:not(.js) body.is-always-mobile-nav .primary-nav__menu--level-1 { column-width: 18.75rem; + grid-column-gap: 2.25rem; - column-gap: 2.25rem; } html:not(.js) body.is-always-mobile-nav .primary-nav__menu-item { @@ -124,39 +126,35 @@ html[dir="ltr"]:not(.js) body.is-always-mobile-nav .header-nav { margin-left: 2.25rem; + } - } html[dir="rtl"]:not(.js) body.is-always-mobile-nav .header-nav { margin-right: 2.25rem; + } - } html[dir="ltr"]:not(.js) body.is-always-mobile-nav .header-nav { margin-right: 2.25rem; + } - } html[dir="rtl"]:not(.js) body.is-always-mobile-nav .header-nav { margin-left: 2.25rem; + } - } html[dir="ltr"]:not(.js) body.is-always-mobile-nav .header-nav { padding-left: 2.25rem; + } - } html[dir="rtl"]:not(.js) body.is-always-mobile-nav .header-nav { padding-right: 2.25rem; + } - } html[dir="ltr"]:not(.js) body.is-always-mobile-nav .header-nav { padding-right: 2.25rem; + } - } html[dir="rtl"]:not(.js) body.is-always-mobile-nav .header-nav { padding-left: 2.25rem; + } - } - - html:not(.js) body.is-always-mobile-nav .header-nav { - border: solid 1px #e7edf1 !important; - } html:not(.js) body.is-always-mobile-nav .header-nav { position: static; @@ -169,16 +167,17 @@ padding-top: 2.25rem; padding-bottom: 0; transform: none; + border: solid 1px #e7edf1 !important; box-shadow: 0 0 36px #d7e1e8; } html[dir="ltr"]:not(.js) body.is-always-mobile-nav .primary-nav__menu--level-2 { border-left: 0; + } - } html[dir="rtl"]:not(.js) body.is-always-mobile-nav .primary-nav__menu--level-2 { border-right: 0; + } - } html:not(.js) body.is-always-mobile-nav .primary-nav__button-toggle { display: none; @@ -188,20 +187,25 @@ content: none; } +html:not(.js) { + /** * Styles for traditional dropdown primary navigation when JS is disabled. */ +} html:not(.js) body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:hover .primary-nav__menu--level-2, html:not(.js) body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:hover .primary-nav__menu-🥕 { visibility: visible; transform: translate(-50%, 0); opacity: 1; } + html:not(.js) body:not(.is-always-mobile-nav) { /* * Cannot combine the focus-within pseudo selector with other selectors, * because it will break IE11 and earlier versions of MS Edge. */ + } html:not(.js) body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:focus-within .primary-nav__menu--level-2, html:not(.js) body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:focus-within .primary-nav__menu-🥕 { visibility: visible; reverted: --- b/core/themes/olivero/css/components/navigation/nav-primary-wide.css +++ a/core/themes/olivero/css/components/navigation/nav-primary-wide.css @@ -12,14 +12,17 @@ @media (min-width: 75rem) { body:not(.is-always-mobile-nav) .primary-nav__menu-item { + flex-wrap: nowrap /* Ensure that sub navigation toggle button doesn't wrap underneath link. */ - flex-wrap: nowrap; /* Ensure that sub navigation toggle button doesn't wrap underneath link. */ } body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--link, body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--nolink { flex-basis: auto; } + body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children { + /* Remove hover state if submenu exists. */ + } body:not(.is-always-mobile-nav) .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--level-1 .primary-nav__menu-link-inner:after { content: none; } @@ -27,12 +30,12 @@ body:not(.is-always-mobile-nav) .primary-nav__menu-link { letter-spacing: 0.02em; font-size: 1rem; + line-height: 1.6875rem - line-height: 1.6875rem; } body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus { position: relative; + outline: 0 - outline: 0; } body:not(.is-always-mobile-nav) .primary-nav__menu-link:focus:before { @@ -53,7 +56,7 @@ padding-left: 0.5625rem; } body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children { + overflow: visible /* Necessary to view icon in IE11 */ - overflow: visible; /* Necessary to view icon in IE11 */ } body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:focus:before { @@ -64,8 +67,10 @@ body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:before { content: none; } + body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children { /* Chevron icon for desktop navigation. */ + } [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-link--button.primary-nav__menu-link--has-children:after { left: calc(100% - 0.1875rem); } @@ -107,7 +112,7 @@ body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner { padding-top: 2.25rem; + padding-bottom: 2.25rem - padding-bottom: 2.25rem; } body:not(.is-always-mobile-nav) .primary-nav__menu-link-inner:after { @@ -151,7 +156,7 @@ width: max-content; max-width: 12.5rem; margin-top: 0; + margin-bottom: 0 - margin-bottom: 0; } [dir="ltr"] body:not(.is-always-mobile-nav) .primary-nav__menu-item--level-1:not(:last-child) { @@ -212,7 +217,7 @@ border-left: solid 1px transparent; border-radius: 0 0 2px 2px; background: #fff; + box-shadow: 0 1px 36px rgba(0, 0, 0, 0.08) - box-shadow: 0 1px 36px rgba(0, 0, 0, 0.08); } body:not(.is-always-mobile-nav) .primary-nav__menu--level-2.is-active-menu-parent { @@ -223,7 +228,7 @@ } body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 { + display: block - display: block; } body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2:focus:before { @@ -251,7 +256,7 @@ body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner { padding-top: 0.5625rem; + padding-bottom: 0.5625rem - padding-bottom: 0.5625rem; } body:not(.is-always-mobile-nav) .primary-nav__menu-link--level-2 .primary-nav__menu-link-inner:after { @@ -259,10 +264,13 @@ border-top-width: 3px; } +body:not(.is-always-mobile-nav) { + /** * Arrow is placed outside of submenu because the submenu has the * `overflow: hidden` CSS rule applied. */ +} body:not(.is-always-mobile-nav) .primary-nav__menu-🥕 { position: absolute; z-index: 105; /* Match level 2 menus. */ @@ -276,7 +284,7 @@ /* Intentionally not using CSS logical properties. */ border-right: solid 10px transparent; border-bottom: solid 10px #2494db; + border-left: solid 10px transparent - border-left: solid 10px transparent; } body:not(.is-always-mobile-nav) .primary-nav__menu-🥕.is-active-menu-parent { @@ -285,10 +293,13 @@ opacity: 1; } +body:not(.is-always-mobile-nav) { + /** * When ensuring that long menus don't overflow viewport, we can give a * little extra room when the toolbar is fixed (and is shorter). */ +} body:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 { max-height: calc(100vh - 7.875rem); } @@ -300,21 +311,25 @@ */ @media (min-width: 75rem) { + body:not(.is-always-mobile-nav) { /* Toolbar is fixed, and tray is vertical or toolbar is horizontal and tray is closed. */ + } + body:not(.is-always-mobile-nav).toolbar-vertical .primary-nav__menu--level-2, body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed .primary-nav__menu--level-2 { - body.toolbar-vertical:not(.is-always-mobile-nav) .primary-nav__menu--level-2, body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .primary-nav__menu--level-2 { max-height: calc(100vh - 14.8125rem); } + body:not(.is-always-mobile-nav).toolbar-vertical .is-fixed .primary-nav__menu--level-2, body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed .is-fixed .primary-nav__menu--level-2 { - body.toolbar-vertical:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2, body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 { max-height: calc(100vh - 10.3125rem); } + body:not(.is-always-mobile-nav) { /* Toolbar is horizontal fixed, and tray is open. */ + } + body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed.toolbar-tray-open .primary-nav__menu--level-2 { - body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .primary-nav__menu--level-2 { max-height: calc(100vh - 17.3125rem); } + body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed.toolbar-tray-open .is-fixed .primary-nav__menu--level-2 { - body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .is-fixed .primary-nav__menu--level-2 { max-height: calc(100vh - 12.8125rem); } } reverted: --- b/core/themes/olivero/css/components/navigation/nav-primary.css +++ a/core/themes/olivero/css/components/navigation/nav-primary.css @@ -16,7 +16,7 @@ } .primary-nav__menu-item { + margin-bottom: 0.5625rem - margin-bottom: 0.5625rem; } .primary-nav__menu-item:last-child { @@ -26,7 +26,7 @@ .primary-nav__menu-item.primary-nav__menu-item--has-children { display: flex; flex-wrap: wrap; + justify-content: space-between - justify-content: space-between; } .primary-nav__menu-item.primary-nav__menu-item--has-children .primary-nav__menu-link--link, @@ -41,7 +41,7 @@ color: #0d1214; font-size: 1.75rem; font-weight: bold; + line-height: 2.25rem - line-height: 2.25rem; } .primary-nav__menu-link:hover { @@ -106,7 +106,7 @@ padding-bottom: 0; cursor: pointer; border: 0; + background: transparent - background: transparent; /* Plus icon for mobile navigation. */ } @@ -173,7 +173,7 @@ display: inline-flex; align-items: center; padding-top: 0.5625rem; + padding-bottom: 0.5625rem - padding-bottom: 0.5625rem; } [dir="ltr"] .primary-nav__menu-link-inner:after { @@ -198,7 +198,7 @@ } .primary-nav__menu-link:hover .primary-nav__menu-link-inner:after { + transform: scaleX(1) - transform: scaleX(1); } /* @@ -271,11 +271,11 @@ } [dir="ltr"] .primary-nav__menu--level-2 { + border-left: solid 18px #2494db; - border-left: solid 1.125rem #2494db; } [dir="rtl"] .primary-nav__menu--level-2 { + border-right: solid 18px #2494db; - border-right: solid 1.125rem #2494db; } .primary-nav__menu--level-2 { @@ -286,7 +286,7 @@ margin-top: 0; margin-bottom: 0; transition: opacity 0.2s, visibility 0.2s, max-height 0.2s; + opacity: 0 - opacity: 0; } .primary-nav__menu--level-2.is-active-menu-parent { reverted: --- b/core/themes/olivero/css/components/navigation/nav-secondary.css +++ a/core/themes/olivero/css/components/navigation/nav-secondary.css @@ -66,7 +66,7 @@ /* @todo should this be scoped to desktop nav? */ width: max-content; + max-width: 12.5rem - max-width: 12.5rem; } [dir="ltr"] .secondary-nav__menu-item:not(:last-child) { @@ -83,7 +83,7 @@ align-items: center; height: 2.25rem; text-decoration: none; + color: inherit - color: inherit; } .secondary-nav__menu-link:after { @@ -120,7 +120,7 @@ } body:not(.is-always-mobile-nav) .secondary-nav { position: relative; + display: flex - display: flex; } [dir="ltr"] body:not(.is-always-mobile-nav) .secondary-nav:before { @@ -150,7 +150,7 @@ } body:not(.is-always-mobile-nav) .secondary-nav__menu-link:focus { position: relative; + outline: 0 - outline: 0; } body:not(.is-always-mobile-nav) .secondary-nav__menu-link:focus:before { reverted: --- b/core/themes/olivero/css/components/navigation/wide-nav-expand.css +++ a/core/themes/olivero/css/components/navigation/wide-nav-expand.css @@ -11,7 +11,7 @@ */ .wide-nav-expand { + display: none - display: none; } @media (min-width: 75rem) { @@ -28,7 +28,7 @@ pointer-events: auto; color: #fff; border: 0; + background-color: #2494db - background-color: #2494db; } .wide-nav-expand:focus { @@ -40,14 +40,14 @@ @media (min-width: 75rem) { body:not(.is-always-mobile-nav) .is-fixed .wide-nav-expand { + visibility: visible - visibility: visible; } } @media (min-width: 75rem) { body.is-always-mobile-nav .wide-nav-expand { + visibility: hidden - visibility: hidden; } } @@ -58,22 +58,22 @@ transition: opacity 0.2s; pointer-events: none; opacity: 0; + transform-style: preserve-3d - transform-style: preserve-3d; } .wide-nav-expand__icon > span { display: block; height: 0; /* Intentionally not using CSS logical properties. */ + border-top: solid 3px currentColor - border-top: solid 3px currentColor; } [dir="ltr"] .wide-nav-expand__icon > span:nth-child(1) { + left: 0 - left: 0; } [dir="rtl"] .wide-nav-expand__icon > span:nth-child(1) { + right: 0 - right: 0; } .wide-nav-expand__icon > span:nth-child(1) { @@ -86,11 +86,11 @@ } [dir="ltr"] .wide-nav-expand__icon > span:nth-child(2) { + left: 0 - left: 0; } [dir="rtl"] .wide-nav-expand__icon > span:nth-child(2) { + right: 0 - right: 0; } .wide-nav-expand__icon > span:nth-child(2) { @@ -103,11 +103,11 @@ } [dir="ltr"] .wide-nav-expand__icon > span:nth-child(3) { + left: 0 - left: 0; } [dir="rtl"] .wide-nav-expand__icon > span:nth-child(3) { + right: 0 - right: 0; } .wide-nav-expand__icon > span:nth-child(3) { reverted: --- b/core/themes/olivero/css/components/node-teaser.css +++ a/core/themes/olivero/css/components/node-teaser.css @@ -12,7 +12,7 @@ .node--view-mode-teaser { position: relative; /* Anchor after pseudo-element. */ + margin-bottom: 1.6875rem - margin-bottom: 1.6875rem; } .node--view-mode-teaser:after { @@ -26,7 +26,7 @@ } .node--view-mode-teaser .node__meta { + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } .node--view-mode-teaser .node__meta a { @@ -38,40 +38,40 @@ display: flex; flex-wrap: wrap; align-items: center; + margin: 0 - margin: 0; } @media (min-width: 62.5rem) { .node--view-mode-teaser .node__top-wrapper { + position: relative /* Anchor the image */ - position: relative; /* Anchor the image */ } } [dir="ltr"] .node--view-mode-teaser .primary-image { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .node--view-mode-teaser .primary-image { + margin-left: 1.125rem - margin-left: 1.125rem; } .node--view-mode-teaser .primary-image { flex-shrink: 0; margin: 0; + margin-bottom: 1.125rem - margin-bottom: 1.125rem; /* Ensure title does not wrap under image until necessary. */ } .node--view-mode-teaser .primary-image + .node__title { + flex-basis: calc(100% - 5.0625rem) - flex-basis: calc(100% - 5.0625rem); } @media (min-width: 62.5rem) { .node--view-mode-teaser .primary-image + .node__title { + flex-basis: auto - flex-basis: auto; } } @@ -83,14 +83,14 @@ width: 3.9375rem; height: 3.9375rem; object-fit: cover; + border-radius: 50% - border-radius: 50%; } @media (min-width: 62.5rem) { .node--view-mode-teaser .primary-image img { width: calc(7.14286vw - 2.31696rem); + height: calc(7.14286vw - 2.31696rem) - height: calc(7.14286vw - 2.31696rem); } } @@ -98,7 +98,7 @@ .node--view-mode-teaser .primary-image img { width: calc(7.14286vw - 2.87946rem); + height: calc(7.14286vw - 2.87946rem) - height: calc(7.14286vw - 2.87946rem); } } @@ -106,46 +106,46 @@ .node--view-mode-teaser .primary-image img { width: 3.61607rem; + height: 3.61607rem - height: 3.61607rem; } } @media (min-width: 62.5rem) { [dir="ltr"] .node--view-mode-teaser .primary-image { + left: calc(-7.14286vw - -1.07143px) - left: calc(-7.14286vw - -0.06696rem); } [dir="rtl"] .node--view-mode-teaser .primary-image { + right: calc(-7.14286vw - -1.07143px) - right: calc(-7.14286vw - -0.06696rem); } .node--view-mode-teaser .primary-image { position: absolute; top: 0; + margin: 0 - margin: 0; } } @media (min-width: 75rem) { [dir="ltr"] .node--view-mode-teaser .primary-image { + left: calc(-7.14286vw - -0.62946rem) - left: calc(-7.14286vw - -0.62946rem); } [dir="rtl"] .node--view-mode-teaser .primary-image { + right: calc(-7.14286vw - -0.62946rem) - right: calc(-7.14286vw - -0.62946rem); } } @media (min-width: 90rem) { [dir="ltr"] .node--view-mode-teaser .primary-image { + left: -5.86607rem - left: -5.86607rem; } [dir="rtl"] .node--view-mode-teaser .primary-image { + right: -5.86607rem - right: -5.86607rem; } } @@ -154,47 +154,47 @@ margin-bottom: 1.125rem; color: #0d1214; font-size: 1.5rem; + line-height: 1.6875rem - line-height: 1.6875rem; } @media (min-width: 62.5rem) { .node--view-mode-teaser .node__title { font-size: 2.25rem; + line-height: 3.375rem - line-height: 3.375rem; } } [dir="ltr"] .node--view-mode-teaser .field--tag-ref { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .node--view-mode-teaser .field--tag-ref { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .node--view-mode-teaser .field--tag-ref { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .node--view-mode-teaser .field--tag-ref { + margin-left: 0 - margin-left: 0; } [dir="ltr"] .node--view-mode-teaser .field--tag-ref { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .node--view-mode-teaser .field--tag-ref { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .node--view-mode-teaser .field--tag-ref { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .node--view-mode-teaser .field--tag-ref { + padding-left: 0 - padding-left: 0; } .node--view-mode-teaser .field--tag-ref { @@ -202,20 +202,20 @@ margin-bottom: 0; padding-top: 0; padding-bottom: 0; + background-color: transparent - background-color: transparent; } @media (min-width: 62.5rem) { .node--view-mode-teaser .field--tag-ref { + margin-top: 2.25rem - margin-top: 2.25rem; } } @media (min-width: 62.5rem) { .node--view-mode-teaser { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/components/node.css +++ a/core/themes/olivero/css/components/node.css @@ -16,7 +16,7 @@ margin-bottom: 1.125rem; color: #6e7172; font-size: 0.875rem; + line-height: 1.125rem - line-height: 1.125rem; } .node__meta a { @@ -26,16 +26,16 @@ @media (min-width: 31.25rem) { .node__meta { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } } [dir="ltr"] .node__author-image img { + margin-right: 0.5625rem - margin-right: 0.5625rem; } [dir="rtl"] .node__author-image img { + margin-left: 0.5625rem - margin-left: 0.5625rem; } .node__author-image img { @@ -54,7 +54,7 @@ background-image: linear-gradient(#2494db, #2494db); /* Two values are needed for IE11 support. */ background-repeat: no-repeat; background-position: bottom left; /* LTR */ + background-size: 0 0.1875rem - background-size: 0 0.1875rem; } .node__title a:hover, @@ -67,13 +67,13 @@ } .node__content { + padding-bottom: 1.6875rem - padding-bottom: 1.6875rem; } @media (min-width: 62.5rem) { .node__content { + padding-bottom: 3.375rem - padding-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/components/off-canvas.css +++ a/core/themes/olivero/css/components/off-canvas.css @@ -11,15 +11,15 @@ */ [dir="ltr"] #drupal-off-canvas .form-type-boolean { + margin-left: 0 - margin-left: 0; } [dir="rtl"] #drupal-off-canvas .form-type-boolean { + margin-right: 0 - margin-right: 0; } #drupal-off-canvas .form-type-boolean { + line-height: 1.125rem - line-height: 1.125rem; } #drupal-off-canvas .form-type-boolean input[type="checkbox"], @@ -32,14 +32,17 @@ } [dir="ltr"] #drupal-off-canvas .form-type-boolean .form-item__description { + margin-left: 0 - margin-left: 0; } [dir="rtl"] #drupal-off-canvas .form-type-boolean .form-item__description { + margin-right: 0 - margin-right: 0; } +#drupal-off-canvas { + + /* Necessary for Safari. */ +} -/* Necessary for Safari. */ #drupal-off-canvas .olivero-details { border-top: solid 1px rgba(255, 255, 255, 0.25); @@ -51,12 +54,15 @@ padding: 1.25rem; } +#drupal-off-canvas { + + /* Necessary for Safari. */ +} -/* Necessary for Safari. */ #drupal-off-canvas .olivero-details__summary { display: block; list-style: disc outside none; + list-style: initial - list-style: initial; } #drupal-off-canvas .olivero-details__summary:focus { @@ -71,33 +77,45 @@ display: inline-block; } +#drupal-off-canvas .olivero-details__summary { + + /* Necessary for IE11. */ + } -/* Necessary for IE11. */ #drupal-off-canvas .olivero-details__summary .details-title:before { content: none; } +#drupal-off-canvas .olivero-details__summary { + + /* Necessary for Firefox. */ + } -/* Necessary for Firefox. */ @supports (list-style-type: disclosure-closed) { #drupal-off-canvas .olivero-details__summary { display: list-item; list-style-position: inside; + list-style-type: disclosure-closed - list-style-type: disclosure-closed; } } +#drupal-off-canvas { + + /* Necessary for Firefox. */ +} -/* Necessary for Firefox. */ @supports (list-style-type: disclosure-open) { #drupal-off-canvas .olivero-details[open] .olivero-details__summary { + list-style-type: disclosure-open - list-style-type: disclosure-open; } } +#drupal-off-canvas { + + /* Necessary for Safari. */ +} -/* Necessary for Safari. */ #drupal-off-canvas div { display: block; reverted: --- b/core/themes/olivero/css/components/pager.css +++ a/core/themes/olivero/css/components/pager.css @@ -54,14 +54,14 @@ height: 2.8125rem; cursor: default; color: #6e7172; + background-color: #fff - background-color: #fff; } @media (min-width: 31.25rem) { .pager__item { width: 3.375rem; + height: 3.375rem - height: 3.375rem; } } @@ -74,19 +74,21 @@ background-color: #0d77b5; } +.pager__item--control path { + /* IE11 Specific. */ + } -/* IE11 Specific. */ @media (-ms-high-contrast: active) { .pager__item--control path { + fill: currentColor - fill: currentColor; } } @media (forced-colors: active) { .pager__item--control path { + fill: linktext - fill: linktext; } } reverted: --- b/core/themes/olivero/css/components/powered-by-block.css +++ a/core/themes/olivero/css/components/powered-by-block.css @@ -13,11 +13,11 @@ .block-system-powered-by-block { letter-spacing: 0.02em; font-size: 0.875rem; + line-height: 1.125rem - line-height: 1.125rem; } .block-system-powered-by-block a { + text-decoration: underline - text-decoration: underline; } .block-system-powered-by-block a:hover, @@ -26,11 +26,11 @@ } [dir="ltr"] .block-system-powered-by-block .drupal-logo { + margin-left: 0.28125rem - margin-left: 0.28125rem; } [dir="rtl"] .block-system-powered-by-block .drupal-logo { + margin-right: 0.28125rem - margin-right: 0.28125rem; } .block-system-powered-by-block .drupal-logo { @@ -41,7 +41,7 @@ .block-system-powered-by-block svg { width: 0.875rem; /* 14 */ height: 1.1875rem; /* 19 */ + vertical-align: top - vertical-align: top; } .block-system-powered-by-block svg path { reverted: --- b/core/themes/olivero/css/components/search-results.css +++ a/core/themes/olivero/css/components/search-results.css @@ -11,49 +11,49 @@ */ [dir="ltr"] .search-results { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .search-results { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .search-results { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .search-results { + padding-left: 0 - padding-left: 0; } .search-results { margin-bottom: 2.25rem; padding-top: 0; padding-bottom: 0; + list-style: none - list-style: none; } @media (min-width: 43.75rem) { .search-results { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } [dir="ltr"] .search-result__title { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .search-result__title { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .search-result__title { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .search-result__title { + margin-left: 0 - margin-left: 0; } .search-result__title { @@ -61,7 +61,7 @@ margin-bottom: 0; color: #0d1214; font-size: 1.25rem; + line-height: 1.6875rem - line-height: 1.6875rem; } .search-result__title a { @@ -72,7 +72,7 @@ background-image: linear-gradient(#2494db, #2494db); /* Two values are needed for IE11 support. */ background-repeat: no-repeat; background-position: bottom left; /* LTR */ + background-size: 0 0.1875rem - background-size: 0 0.1875rem; } .search-result__title a:hover { @@ -84,7 +84,7 @@ .search-result__title { margin-bottom: 1.125rem; font-size: 1.875rem; + line-height: 3.375rem - line-height: 3.375rem; } } @@ -93,13 +93,13 @@ } .search-result__snippet { + padding-bottom: 1.5625rem - padding-bottom: calc(1.6875rem - 2px); } @media (min-width: 62.5rem) { .search-result__snippet { + padding-bottom: 3.375rem - padding-bottom: 3.375rem; } } @@ -109,7 +109,7 @@ margin-bottom: 1.125rem; color: #6e7172; font-size: 0.875rem; + line-height: 1.125rem - line-height: 1.125rem; } .search-result__meta a { @@ -119,7 +119,7 @@ .search-results__item { position: relative; /* Anchor after pseudo-element. */ + margin-bottom: 1.6875rem - margin-bottom: 1.6875rem; } .search-results__item:after { @@ -139,6 +139,6 @@ @media (min-width: 62.5rem) { .search-results__item { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/components/site-header.css +++ a/core/themes/olivero/css/components/site-header.css @@ -16,7 +16,7 @@ * Ensure mobile site header is always above other elements including * contextual links, quick-edit, and Tour. */ + z-index: 101 - z-index: 101; } @media (min-width: 75rem) { @@ -24,7 +24,7 @@ .site-header { /* Necessary to keep the content from jumping up when header transitions to fixed. */ min-height: 11.25rem; + border-bottom: solid 1px transparent /* Will show in Windows high contrast mode. */ - border-bottom: solid 1px transparent; /* Will show in Windows high contrast mode. */ } } @@ -41,7 +41,7 @@ .site-header__fixable { display: flex; align-items: flex-end; + transition: all 0.5s - transition: all 0.5s; } @media (min-width: 75rem) { @@ -57,13 +57,17 @@ top: -4.5rem; max-width: 98.125rem; } + body:not(.is-always-mobile-nav) { /* Toolbar is fixed, and tray is either vertical or closed and horizontal. */ + } + body:not(.is-always-mobile-nav).toolbar-vertical.toolbar-fixed .site-header__fixable.is-fixed, body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed .site-header__fixable.is-fixed { - body.toolbar-vertical.toolbar-fixed:not(.is-always-mobile-nav) .site-header__fixable.is-fixed, body.toolbar-horizontal.toolbar-fixed:not(.is-always-mobile-nav) .site-header__fixable.is-fixed { top: -2.0625rem; } + body:not(.is-always-mobile-nav) { /* Toolbar is fixed, and tray is open and horizontal. */ + } + body:not(.is-always-mobile-nav).toolbar-horizontal.toolbar-fixed.toolbar-tray-open .site-header__fixable.is-fixed { - body.toolbar-horizontal.toolbar-fixed.toolbar-tray-open:not(.is-always-mobile-nav) .site-header__fixable.is-fixed { top: 0.4375rem; } } @@ -83,21 +87,21 @@ @media (min-width: 75rem) { html.js body:not(.is-always-mobile-nav) .site-header__inner { + transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s - transition: opacity 0.3s, transform 0.3s, box-shadow 0.3s; } } @media (min-width: 75rem) { .site-header__fixable.is-expanded .site-header__inner { + box-shadow: -36px 1px 36px rgba(0, 0, 0, 0.08) /* LTR */ - box-shadow: -36px 1px 36px rgba(0, 0, 0, 0.08); /* LTR */ } } @media (min-width: 75rem) { [dir="rtl"] .site-header__fixable.is-expanded .site-header__inner { + box-shadow: 36px 1px 36px rgba(0, 0, 0, 0.08) - box-shadow: 36px 1px 36px rgba(0, 0, 0, 0.08); } } @@ -107,14 +111,14 @@ body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner { transform: translateX(-101%); /* LTR */ + opacity: 0 - opacity: 0; } } @media (min-width: 75rem) { [dir="rtl"] body:not(.is-always-mobile-nav) .site-header__fixable.is-fixed:not(.is-expanded) .site-header__inner { + transform: translateX(101%) - transform: translateX(101%); } } reverted: --- b/core/themes/olivero/css/components/skip-link.css +++ a/core/themes/olivero/css/components/skip-link.css @@ -13,19 +13,19 @@ */ [dir="ltr"] .skip-link { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .skip-link { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .skip-link { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .skip-link { + padding-left: 1.125rem - padding-left: 1.125rem; } .skip-link { @@ -37,7 +37,7 @@ text-decoration: none; color: #fff; outline: 0; + background-color: #0d1214 - background-color: #0d1214; } .skip-link:hover { @@ -50,10 +50,7 @@ } .skip-link.focusable:focus { + position: absolute !important; /* Override position from module file. */ - position: absolute !important; -} - -.skip-link.focusable:focus { /* Override position from module file. */ z-index: 503; width: 100%; height: 2.5rem; reverted: --- b/core/themes/olivero/css/components/table.css +++ a/core/themes/olivero/css/components/table.css @@ -22,15 +22,15 @@ border-collapse: collapse; font-family: "metropolis", sans-serif; font-size: 1rem; + line-height: 1.6875rem - line-height: 1.6875rem; } [dir="ltr"] .forum table caption,[dir="ltr"] .text-content table caption,[dir="ltr"] .views-table caption,[dir="ltr"] .draggable-table caption { + text-align: left - text-align: left; } [dir="rtl"] .forum table caption,[dir="rtl"] .text-content table caption,[dir="rtl"] .views-table caption,[dir="rtl"] .draggable-table caption { + text-align: right - text-align: right; } .forum table caption, .text-content table caption, .views-table caption, .draggable-table caption { @@ -47,56 +47,56 @@ } [dir="ltr"] .forum table td,[dir="ltr"] + .forum table th,[dir="ltr"] .text-content table td,[dir="ltr"] + .text-content table th,[dir="ltr"] .views-table td,[dir="ltr"] + .views-table th,[dir="ltr"] .draggable-table td,[dir="ltr"] - .forum table th,[dir="ltr"] - .text-content table th,[dir="ltr"] - .views-table th,[dir="ltr"] .draggable-table th { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .forum table td,[dir="rtl"] + .forum table th,[dir="rtl"] .text-content table td,[dir="rtl"] + .text-content table th,[dir="rtl"] .views-table td,[dir="rtl"] + .views-table th,[dir="rtl"] .draggable-table td,[dir="rtl"] - .forum table th,[dir="rtl"] - .text-content table th,[dir="rtl"] - .views-table th,[dir="rtl"] .draggable-table th { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .forum table td,[dir="ltr"] + .forum table th,[dir="ltr"] .text-content table td,[dir="ltr"] + .text-content table th,[dir="ltr"] .views-table td,[dir="ltr"] + .views-table th,[dir="ltr"] .draggable-table td,[dir="ltr"] - .forum table th,[dir="ltr"] - .text-content table th,[dir="ltr"] - .views-table th,[dir="ltr"] .draggable-table th { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .forum table td,[dir="rtl"] + .forum table th,[dir="rtl"] .text-content table td,[dir="rtl"] + .text-content table th,[dir="rtl"] .views-table td,[dir="rtl"] + .views-table th,[dir="rtl"] .draggable-table td,[dir="rtl"] - .forum table th,[dir="rtl"] - .text-content table th,[dir="rtl"] - .views-table th,[dir="rtl"] .draggable-table th { + padding-left: 1.125rem - padding-left: 1.125rem; } .forum table td, + .forum table th, .text-content table td, + .text-content table th, .views-table td, + .views-table th, .draggable-table td, - .forum table th, - .text-content table th, - .views-table th, .draggable-table th { padding-top: 1.125rem; padding-bottom: 1.125rem; @@ -104,27 +104,27 @@ } [dir="ltr"] .forum table th,[dir="ltr"] .text-content table th,[dir="ltr"] .views-table th,[dir="ltr"] .draggable-table th { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .forum table th,[dir="rtl"] .text-content table th,[dir="rtl"] .views-table th,[dir="rtl"] .draggable-table th { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .forum table th,[dir="ltr"] .text-content table th,[dir="ltr"] .views-table th,[dir="ltr"] .draggable-table th { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .forum table th,[dir="rtl"] .text-content table th,[dir="rtl"] .views-table th,[dir="rtl"] .draggable-table th { + margin-left: 0 - margin-left: 0; } [dir="ltr"] .forum table th,[dir="ltr"] .text-content table th,[dir="ltr"] .views-table th,[dir="ltr"] .draggable-table th { + text-align: left - text-align: left; } [dir="rtl"] .forum table th,[dir="rtl"] .text-content table th,[dir="rtl"] .views-table th,[dir="rtl"] .draggable-table th { + text-align: right - text-align: right; } .forum table th, .text-content table th, .views-table th, .draggable-table th { @@ -135,7 +135,7 @@ border-bottom: 2px solid #2494db; font-family: "metropolis", sans-serif; font-size: 0.875rem; + line-height: 1.125rem - line-height: 1.125rem; /** * Fixes for styles injected by CKEditor @@ -143,19 +143,19 @@ } [dir="ltr"] .forum table th.text-align-left,[dir="ltr"] .text-content table th.text-align-left,[dir="ltr"] .views-table th.text-align-left,[dir="ltr"] .draggable-table th.text-align-left { + text-align: left - text-align: left; } [dir="rtl"] .forum table th.text-align-left,[dir="rtl"] .text-content table th.text-align-left,[dir="rtl"] .views-table th.text-align-left,[dir="rtl"] .draggable-table th.text-align-left { + text-align: right - text-align: right; } [dir="ltr"] .forum table th.text-align-right,[dir="ltr"] .text-content table th.text-align-right,[dir="ltr"] .views-table th.text-align-right,[dir="ltr"] .draggable-table th.text-align-right { + text-align: right - text-align: right; } [dir="rtl"] .forum table th.text-align-right,[dir="rtl"] .text-content table th.text-align-right,[dir="rtl"] .views-table th.text-align-right,[dir="rtl"] .draggable-table th.text-align-right { + text-align: left - text-align: left; } .forum table th.text-align-center, .text-content table th.text-align-center, .views-table th.text-align-center, .draggable-table th.text-align-center { @@ -172,12 +172,12 @@ } .forum table th.checkbox, + .forum table td.checkbox, .text-content table th.checkbox, + .text-content table td.checkbox, .views-table th.checkbox, + .views-table td.checkbox, .draggable-table th.checkbox, - .forum table td.checkbox, - .text-content table td.checkbox, - .views-table td.checkbox, .draggable-table td.checkbox { text-align: center; } @@ -197,7 +197,7 @@ .sticky-header { z-index: 0; margin: 0; + border-bottom: 4px solid #2494db; - border-bottom: 0.25rem solid #2494db; } /* Properly align VBO checkboxes. */ reverted: --- b/core/themes/olivero/css/components/tabs.css +++ a/core/themes/olivero/css/components/tabs.css @@ -5,28 +5,28 @@ * @preserve */ [dir="ltr"] .tabs { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .tabs { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .tabs { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .tabs { + margin-left: 0 - margin-left: 0; } [dir="ltr"] .tabs { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .tabs { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .tabs { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .tabs { + padding-left: 0 - padding-left: 0; } .tabs { display: flex; @@ -36,18 +36,18 @@ margin-bottom: 0; padding-top: 0; padding-bottom: 0; + list-style: none - list-style: none; } @media (min-width: 43.75rem) { .tabs { flex-direction: row; + flex-wrap: wrap - flex-wrap: wrap; } } .tabs__tab { display: none; margin: 0; + margin-bottom: -1px - margin-bottom: -1px; } .tabs__tab.is-active { display: flex; @@ -56,7 +56,7 @@ .tabs__tab { display: flex; margin: 0; + margin-bottom: -1px - margin-bottom: -1px; } } html:not(.js) .tabs__tab, @@ -64,24 +64,24 @@ display: flex; } .tabs--secondary .tabs__tab { + display: block - display: block; } @media (min-width: 43.75rem) { .tabs--secondary .tabs__tab { + display: flex - display: flex; } } [dir="ltr"] .tabs__link { + padding-left: 1.6875rem - padding-left: 1.6875rem; } [dir="rtl"] .tabs__link { + padding-right: 1.6875rem - padding-right: 1.6875rem; } [dir="ltr"] .tabs__link { + padding-right: 1.6875rem - padding-right: 1.6875rem; } [dir="rtl"] .tabs__link { + padding-left: 1.6875rem - padding-left: 1.6875rem; } .tabs__link { display: flex; @@ -99,14 +99,14 @@ font-size: 0.875rem; } .tabs--secondary .tabs__link { + text-transform: none - text-transform: none; } @media (min-width: 43.75rem) { .tabs--secondary .tabs__link { border-top-color: transparent; border-right-color: transparent; border-left-color: transparent; + background-color: transparent - background-color: transparent; } } .tabs__link:focus { @@ -120,19 +120,19 @@ .tabs__link.is-active { position: relative; color: #0d1214; + font-weight: 600 - font-weight: 600; } [dir="ltr"] .tabs__link.is-active:after { + left: -1px - left: -1px; } [dir="rtl"] .tabs__link.is-active:after { + right: -1px - right: -1px; } [dir="ltr"] .tabs__link.is-active:after { + border-left: 6px solid #2494db - border-left: 0.375rem solid #2494db; } [dir="rtl"] .tabs__link.is-active:after { + border-right: 6px solid #2494db - border-right: 0.375rem solid #2494db; } .tabs__link.is-active:after { position: absolute; @@ -142,34 +142,34 @@ } @media (min-width: 43.75rem) { [dir="ltr"] .tabs__link.is-active:after { + left: 0 - left: 0; } [dir="rtl"] .tabs__link.is-active:after { + right: 0 - right: 0; } [dir="ltr"] .tabs__link.is-active:after { + border-left: 0 - border-left: 0; } [dir="rtl"] .tabs__link.is-active:after { + border-right: 0 - border-right: 0; } .tabs__link.is-active:after { width: 100%; height: auto; + border-top: 6px solid #2494db; - border-top: 0.375rem solid #2494db; } } [dir="ltr"] .tabs__trigger { + margin-left: -1px - margin-left: -1px; } [dir="rtl"] .tabs__trigger { + margin-right: -1px - margin-right: -1px; } [dir="ltr"] .tabs__trigger { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .tabs__trigger { + margin-left: 0 - margin-left: 0; } .tabs__trigger { display: flex; @@ -180,7 +180,7 @@ margin-bottom: 0; cursor: pointer; border: solid 1px #e7edf1; + background-color: #f7f9fa - background-color: #f7f9fa; } .tabs__trigger:hover { background-color: #e7edf1; @@ -192,7 +192,7 @@ } @media (min-width: 43.75rem) { .tabs__trigger { + display: none - display: none; } } html:not(.js) .tabs__trigger { @@ -203,20 +203,20 @@ display: block; width: 1.125rem; height: 0.625rem; + margin-top: -2px - margin-top: -2px; } [dir="ltr"] .tabs__trigger-icon > span { + left: 0 - left: 0; } [dir="rtl"] .tabs__trigger-icon > span { + right: 0 - right: 0; } .tabs__trigger-icon > span { position: absolute; display: block; width: 100%; transition: transform 0.2s, opacity 0.2s, top 0.2s; + border-top: solid 2px #2494db - border-top: solid 2px #2494db; } .tabs__trigger-icon > span:nth-child(1) { top: 0; reverted: --- b/core/themes/olivero/css/components/tags.css +++ a/core/themes/olivero/css/components/tags.css @@ -29,7 +29,7 @@ color: #6e7172; font-size: 0.875rem; font-weight: 600; + line-height: 1.6 - line-height: 1.6; } .field--tags__label:after { @@ -39,7 +39,7 @@ @media (min-width: 43.75rem) { .field--tags__label { + line-height: 2 - line-height: 2; } } reverted: --- b/core/themes/olivero/css/components/text-content.css +++ a/core/themes/olivero/css/components/text-content.css @@ -14,7 +14,7 @@ .cke_editable { color: #313637; font-family: "Lora", "georgia", serif; + line-height: 1.6875rem - line-height: 1.6875rem; /* @todo @@ -31,7 +31,7 @@ -webkit-text-decoration-color: #0d77b5; text-decoration-color: #0d77b5; text-decoration-thickness: 2px; + word-wrap: break-word - word-wrap: break-word; } @supports (box-shadow: none) { @@ -39,7 +39,7 @@ .text-content a:not(.button), .cke_editable a:not(.button) { transition: box-shadow 0.3s cubic-bezier(0.55, 0.085, 0, 0.99); text-decoration: none; + box-shadow: inset 0 -2px 0 0 #2494db - box-shadow: inset 0 -2px 0 0 #2494db; } .text-content a:not(.button):hover, .cke_editable a:not(.button):hover { @@ -55,7 +55,7 @@ .text-content p, .cke_editable p { margin-top: 1.125rem; + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } .text-content p:first-child, .cke_editable p:first-child { @@ -70,7 +70,7 @@ .text-content p, .cke_editable p { margin-top: 2.25rem; + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } } @@ -79,19 +79,19 @@ } [dir="ltr"] .text-content pre code,[dir="ltr"] .cke_editable pre code { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .text-content pre code,[dir="rtl"] .cke_editable pre code { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .text-content pre code,[dir="ltr"] .cke_editable pre code { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .text-content pre code,[dir="rtl"] .cke_editable pre code { + padding-left: 1.125rem - padding-left: 1.125rem; } .text-content pre code, .cke_editable pre code { @@ -103,27 +103,27 @@ } [dir="ltr"] .text-content blockquote,[dir="ltr"] .cke_editable blockquote { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .text-content blockquote,[dir="rtl"] .cke_editable blockquote { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .text-content blockquote,[dir="ltr"] .cke_editable blockquote { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .text-content blockquote,[dir="rtl"] .cke_editable blockquote { + margin-left: 0 - margin-left: 0; } [dir="ltr"] .text-content blockquote,[dir="ltr"] .cke_editable blockquote { + padding-left: 2.25rem - padding-left: 2.25rem; } [dir="rtl"] .text-content blockquote,[dir="rtl"] .cke_editable blockquote { + padding-right: 2.25rem - padding-right: 2.25rem; } .text-content blockquote, .cke_editable blockquote { @@ -133,15 +133,15 @@ letter-spacing: -0.01em; font-family: "Lora", "georgia", serif; font-size: 1.3125rem; + line-height: 2.25rem - line-height: 2.25rem; } [dir="ltr"] .text-content blockquote:before,[dir="ltr"] .cke_editable blockquote:before { + left: 0 - left: 0; } [dir="rtl"] .text-content blockquote:before,[dir="rtl"] .cke_editable blockquote:before { + right: 0 - right: 0; } .text-content blockquote:before, .cke_editable blockquote:before { @@ -153,19 +153,19 @@ } [dir="ltr"] .text-content blockquote:after,[dir="ltr"] .cke_editable blockquote:after { + left: 0 - left: 0; } [dir="rtl"] .text-content blockquote:after,[dir="rtl"] .cke_editable blockquote:after { + right: 0 - right: 0; } [dir="ltr"] .text-content blockquote:after,[dir="ltr"] .cke_editable blockquote:after { + margin-left: 0.25rem - margin-left: 0.25rem; } [dir="rtl"] .text-content blockquote:after,[dir="rtl"] .cke_editable blockquote:after { + margin-right: 0.25rem - margin-right: 0.25rem; } .text-content blockquote:after, .cke_editable blockquote:after { @@ -181,7 +181,7 @@ .text-content blockquote, .cke_editable blockquote { font-size: 2rem; + line-height: 3.375rem - line-height: 3.375rem; } } @@ -189,7 +189,7 @@ .text-content blockquote, .cke_editable blockquote { font-size: 2.5rem; + line-height: 3.9375rem - line-height: 3.9375rem; } } @@ -198,7 +198,7 @@ .text-content, .cke_editable { font-size: 1.125rem; + line-height: 2.25rem - line-height: 2.25rem; } } @@ -207,7 +207,7 @@ */ .site-footer .text-content { + color: inherit - color: inherit; } .site-footer .text-content * { @@ -217,7 +217,7 @@ .site-footer .text-content a { text-decoration: underline; color: #fff; + box-shadow: none - box-shadow: none; } .site-footer .text-content a:hover { @@ -234,6 +234,6 @@ .region--sidebar .text-content blockquote { font-size: 1.5rem; + line-height: 2.25rem - line-height: 2.25rem; } } reverted: --- b/core/themes/olivero/css/components/vertical-tabs.css +++ a/core/themes/olivero/css/components/vertical-tabs.css @@ -13,24 +13,24 @@ @media (min-width: 62.5rem) { .vertical-tabs { + display: flex - display: flex; } } [dir="ltr"] .vertical-tabs__menu { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .vertical-tabs__menu { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .vertical-tabs__menu { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .vertical-tabs__menu { + margin-left: 0 - margin-left: 0; } .vertical-tabs__menu { @@ -40,33 +40,33 @@ list-style: none; border-width: 1px; border-style: solid; + border-color: #e7edf1 - border-color: #e7edf1; } @media (min-width: 62.5rem) { .vertical-tabs__menu { width: 15rem; + border-width: 1px 0 1px 1px - border-width: 1px 0 1px 1px; } } .vertical-tabs__panes { + margin-top: -1px - margin-top: -1px; } @media (min-width: 62.5rem) { .vertical-tabs__panes { width: calc(100% - 15rem); + margin-top: 0 - margin-top: 0; } } @media (min-width: 62.5rem) { .vertical-tabs__pane { + min-height: 100% - min-height: 100%; } } @@ -85,19 +85,19 @@ } [dir="ltr"] .vertical-tabs__menu-item a { + padding-left: 0.84375rem - padding-left: 0.84375rem; } [dir="rtl"] .vertical-tabs__menu-item a { + padding-right: 0.84375rem - padding-right: 0.84375rem; } [dir="ltr"] .vertical-tabs__menu-item a { + padding-right: 0.84375rem - padding-right: 0.84375rem; } [dir="rtl"] .vertical-tabs__menu-item a { + padding-left: 0.84375rem - padding-left: 0.84375rem; } .vertical-tabs__menu-item a { @@ -106,7 +106,7 @@ padding-bottom: 0.5625rem; text-decoration: none; color: #0f6292; + background-color: #e7edf1 - background-color: #e7edf1; } .vertical-tabs__menu-item a:focus, @@ -116,25 +116,25 @@ } .vertical-tabs__menu-item.is-selected { + background-color: #fff - background-color: #fff; } @media (min-width: 62.5rem) { [dir="ltr"] .vertical-tabs__menu-item.is-selected { + margin-right: -1px - margin-right: -1px; } [dir="rtl"] .vertical-tabs__menu-item.is-selected { + margin-left: -1px - margin-left: -1px; } [dir="ltr"] .vertical-tabs__menu-item.is-selected { + padding-right: 1px - padding-right: 1px; } [dir="rtl"] .vertical-tabs__menu-item.is-selected { + padding-left: 1px - padding-left: 1px; } } reverted: --- b/core/themes/olivero/css/components/wide-image.css +++ a/core/themes/olivero/css/components/wide-image.css @@ -11,85 +11,85 @@ */ [dir="ltr"] .wide-image { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .wide-image { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .wide-image { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .wide-image { + margin-left: 0 - margin-left: 0; } .wide-image { margin-top: 0.5625rem; + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } @media (min-width: 43.75rem) { [dir="ltr"] .wide-image { + margin-left: -7.14286vw - margin-left: -7.14286vw; } [dir="rtl"] .wide-image { + margin-right: -7.14286vw - margin-right: -7.14286vw; } .wide-image { width: calc(100vw - 2.25rem); margin-top: 2.25rem; + margin-bottom: 4.5rem - margin-bottom: 4.5rem; } } @media (min-width: 62.5rem) { [dir="ltr"] .wide-image { + margin-left: calc(-7.14286vw - -1.07143px) - margin-left: calc(-7.14286vw - -0.06696rem); } [dir="rtl"] .wide-image { + margin-right: calc(-7.14286vw - -1.07143px) - margin-right: calc(-7.14286vw - -0.06696rem); } .wide-image { + width: calc(85.71429vw - 3.05357rem) - width: calc(85.71429vw - 3.05357rem); } } @media (min-width: 75rem) { [dir="ltr"] .wide-image { + margin-left: calc(-7.14286vw - -0.62946rem) - margin-left: calc(-7.14286vw - -0.62946rem); } [dir="rtl"] .wide-image { + margin-right: calc(-7.14286vw - -0.62946rem) - margin-right: calc(-7.14286vw - -0.62946rem); } .wide-image { + width: calc(85.71429vw - 9.80357rem) - width: calc(85.71429vw - 9.80357rem); } } @media (min-width: 90rem) { [dir="ltr"] .wide-image { + margin-left: -5.86607rem - margin-left: -5.86607rem; } [dir="rtl"] .wide-image { + margin-right: -5.86607rem - margin-right: -5.86607rem; } .wide-image { + width: 68.14286rem - width: 68.14286rem; } } @@ -98,47 +98,47 @@ @media (min-width: 62.5rem) { .sidebar-grid .wide-image { + width: calc(64.28571vw - 2.85268rem) - width: calc(64.28571vw - 2.85268rem); } } @media (min-width: 75rem) { .sidebar-grid .wide-image { + width: calc(64.28571vw - 7.91518rem) - width: calc(64.28571vw - 7.91518rem); } } @media (min-width: 81.25rem) { .sidebar-grid .wide-image { + width: calc(71.42857vw - 8.54464rem) - width: calc(71.42857vw - 8.54464rem); } } @media (min-width: 90rem) { .sidebar-grid .wide-image { + width: 56.41071rem - width: 56.41071rem; } } /* Ensure that image doesn't overlap layout builder sections when editing layouts. */ [dir="ltr"] .layout-builder .wide-image { + margin-left: 0 - margin-left: 0; } [dir="rtl"] .layout-builder .wide-image { + margin-right: 0 - margin-right: 0; } [dir="ltr"] .layout-builder .wide-image { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .layout-builder .wide-image { + margin-left: 0 - margin-left: 0; } .layout-builder .wide-image { reverted: --- b/core/themes/olivero/css/layout/grid.css +++ a/core/themes/olivero/css/layout/grid.css @@ -17,7 +17,7 @@ grid-template-rows: 1fr; -ms-grid-columns: (minmax(0, 1fr))[6]; grid-template-columns: repeat(6, minmax(0, 1fr)); + grid-column-gap: 1.125rem - grid-column-gap: 1.125rem; /* .grid-full classes nested 3 or more deep go full width. */ } @@ -31,7 +31,7 @@ .grid-full { -ms-grid-columns: (minmax(0, 1fr))[14]; grid-template-columns: repeat(14, minmax(0, 1fr)); + grid-column-gap: 2.25rem - grid-column-gap: 2.25rem; } } @@ -46,7 +46,7 @@ .layout--content-narrow .grid-full, .layout--pass--content-narrow > * .grid-full { -ms-grid-columns: (minmax(0, 1fr))[ 12 ]; + grid-template-columns: repeat(12, minmax(0, 1fr)) - grid-template-columns: repeat(12, minmax(0, 1fr)); } } @@ -55,7 +55,7 @@ .layout--content-narrow .grid-full, .layout--pass--content-narrow > * .grid-full { -ms-grid-columns: (minmax(0, 1fr))[ 8 ]; + grid-template-columns: repeat(8, minmax(0, 1fr)) - grid-template-columns: repeat(8, minmax(0, 1fr)); } } @@ -70,7 +70,7 @@ .layout--content-medium .grid-full, .layout--pass--content-medium > * .grid-full { -ms-grid-columns: (minmax(0, 1fr))[ 12 ]; + grid-template-columns: repeat(12, minmax(0, 1fr)) - grid-template-columns: repeat(12, minmax(0, 1fr)); } } @@ -79,6 +79,6 @@ .layout--content-medium .grid-full, .layout--pass--content-medium > * .grid-full { -ms-grid-columns: (minmax(0, 1fr))[ 10 ]; + grid-template-columns: repeat(10, minmax(0, 1fr)) - grid-template-columns: repeat(10, minmax(0, 1fr)); } } reverted: --- b/core/themes/olivero/css/layout/layout-builder-fourcol-section.css +++ a/core/themes/olivero/css/layout/layout-builder-fourcol-section.css @@ -12,12 +12,12 @@ .layout--fourcol-section { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } .layout--fourcol-section > .layout__region { flex: 1 0 100%; + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 43.75rem) { @@ -26,11 +26,14 @@ flex-basis: calc(50% - 1.125rem); flex-grow: 0; flex-shrink: 0; + margin-bottom: 0 - margin-bottom: 0; } } +.layout--fourcol-section { + + /* Two column layout. */ +} -/* Two column layout. */ @media (min-width: 43.75rem) { .layout--fourcol-section > .layout__region--first, @@ -40,26 +43,29 @@ [dir="ltr"] .layout--fourcol-section > .layout__region--first,[dir="ltr"] .layout--fourcol-section > .layout__region--third { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .layout--fourcol-section > .layout__region--first,[dir="rtl"] .layout--fourcol-section > .layout__region--third { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .layout--fourcol-section > .layout__region--second,[dir="ltr"] .layout--fourcol-section > .layout__region--fourth { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="rtl"] .layout--fourcol-section > .layout__region--second,[dir="rtl"] .layout--fourcol-section > .layout__region--fourth { + margin-right: 1.125rem - margin-right: 1.125rem; } } +.layout--fourcol-section { + + /* Four column layout. */ +} -/* Four column layout. */ @media (min-width: 62.5rem) { .layout--fourcol-section > .layout__region { @@ -72,11 +78,11 @@ } [dir="ltr"] .layout--fourcol-section > .layout__region--first { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .layout--fourcol-section > .layout__region--first { + margin-left: 1.125rem - margin-left: 1.125rem; } .layout--fourcol-section > .layout__region--second, @@ -86,10 +92,10 @@ } [dir="ltr"] .layout--fourcol-section > .layout__region--fourth { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="rtl"] .layout--fourcol-section > .layout__region--fourth { + margin-right: 1.125rem - margin-right: 1.125rem; } } reverted: --- b/core/themes/olivero/css/layout/layout-builder-threecol-section.css +++ a/core/themes/olivero/css/layout/layout-builder-threecol-section.css @@ -12,12 +12,12 @@ .layout--threecol-section { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } .layout--threecol-section > .layout__region { flex: 1 0 100%; + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 62.5rem) { @@ -25,16 +25,16 @@ .layout--threecol-section > .layout__region { flex-grow: 0; flex-shrink: 0; + margin-bottom: 0 - margin-bottom: 0; } } @media (min-width: 62.5rem) { [dir="ltr"] .layout--threecol-section > .layout__region--first { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .layout--threecol-section > .layout__region--first { + margin-left: 1.125rem - margin-left: 1.125rem; } .layout--threecol-section > .layout__region--second { @@ -43,11 +43,11 @@ } [dir="ltr"] .layout--threecol-section > .layout__region--third { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="rtl"] .layout--threecol-section > .layout__region--third { + margin-right: 1.125rem - margin-right: 1.125rem; } .layout--threecol-section--25-50-25 > .layout__region--first, .layout--threecol-section--25-50-25 > .layout__region--third { reverted: --- b/core/themes/olivero/css/layout/layout-builder-twocol-section.css +++ a/core/themes/olivero/css/layout/layout-builder-twocol-section.css @@ -12,12 +12,12 @@ .layout--twocol-section { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } .layout--twocol-section > .layout__region { flex: 1 0 100%; + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 43.75rem) { @@ -25,111 +25,111 @@ .layout--twocol-section > .layout__region { flex-grow: 0; flex-shrink: 0; + margin-bottom: 0 - margin-bottom: 0; } } @media (min-width: 43.75rem) { [dir="ltr"] .layout--twocol-section--50-50 > .layout__region--first { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .layout--twocol-section--50-50 > .layout__region--first { + margin-left: 1.125rem - margin-left: 1.125rem; } .layout--twocol-section--50-50 > .layout__region--first { flex-basis: calc(50% - 1.125rem); } [dir="ltr"] .layout--twocol-section--50-50 > .layout__region--second { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="rtl"] .layout--twocol-section--50-50 > .layout__region--second { + margin-right: 1.125rem - margin-right: 1.125rem; } .layout--twocol-section--50-50 > .layout__region--second { flex-basis: calc(50% - 1.125rem); } [dir="ltr"] .layout--twocol-section--33-67 > .layout__region--first { + margin-right: 0.74993rem - margin-right: 0.74993rem; } [dir="rtl"] .layout--twocol-section--33-67 > .layout__region--first { + margin-left: 0.74993rem - margin-left: 0.74993rem; } .layout--twocol-section--33-67 > .layout__region--first { flex-basis: calc(33.33% - 0.74993rem); } [dir="ltr"] .layout--twocol-section--33-67 > .layout__region--second { + margin-left: 1.49985rem - margin-left: 1.49985rem; } [dir="rtl"] .layout--twocol-section--33-67 > .layout__region--second { + margin-right: 1.49985rem - margin-right: 1.49985rem; } .layout--twocol-section--33-67 > .layout__region--second { flex-basis: calc(66.66% - 1.49985rem); } [dir="ltr"] .layout--twocol-section--67-33 > .layout__region--first { + margin-right: 1.49985rem - margin-right: 1.49985rem; } [dir="rtl"] .layout--twocol-section--67-33 > .layout__region--first { + margin-left: 1.49985rem - margin-left: 1.49985rem; } .layout--twocol-section--67-33 > .layout__region--first { flex-basis: calc(66.66% - 1.49985rem); } [dir="ltr"] .layout--twocol-section--67-33 > .layout__region--second { + margin-left: 0.74993rem - margin-left: 0.74993rem; } [dir="rtl"] .layout--twocol-section--67-33 > .layout__region--second { + margin-right: 0.74993rem - margin-right: 0.74993rem; } .layout--twocol-section--67-33 > .layout__region--second { flex-basis: calc(33.33% - 0.74993rem); } [dir="ltr"] .layout--twocol-section--25-75 > .layout__region--first { + margin-right: 0.5625rem - margin-right: 0.5625rem; } [dir="rtl"] .layout--twocol-section--25-75 > .layout__region--first { + margin-left: 0.5625rem - margin-left: 0.5625rem; } .layout--twocol-section--25-75 > .layout__region--first { flex-basis: calc(25% - 0.5625rem); } [dir="ltr"] .layout--twocol-section--25-75 > .layout__region--second { + margin-left: 1.6875rem - margin-left: 1.6875rem; } [dir="rtl"] .layout--twocol-section--25-75 > .layout__region--second { + margin-right: 1.6875rem - margin-right: 1.6875rem; } .layout--twocol-section--25-75 > .layout__region--second { flex-basis: calc(75% - 1.6875rem); } [dir="ltr"] .layout--twocol-section--75-25 > .layout__region--first { + margin-right: 1.6875rem - margin-right: 1.6875rem; } [dir="rtl"] .layout--twocol-section--75-25 > .layout__region--first { + margin-left: 1.6875rem - margin-left: 1.6875rem; } .layout--twocol-section--75-25 > .layout__region--first { flex-basis: calc(75% - 1.6875rem); } [dir="ltr"] .layout--twocol-section--75-25 > .layout__region--second { + margin-left: 0.5625rem - margin-left: 0.5625rem; } [dir="rtl"] .layout--twocol-section--75-25 > .layout__region--second { + margin-right: 0.5625rem - margin-right: 0.5625rem; } .layout--twocol-section--75-25 > .layout__region--second { reverted: --- b/core/themes/olivero/css/layout/layout-content-medium.css +++ a/core/themes/olivero/css/layout/layout-content-medium.css @@ -15,7 +15,7 @@ -ms-grid-column: 1; -ms-grid-column-span: 6; grid-column: 1 / 7; + width: 100% - width: 100%; } @media (min-width: 43.75rem) { @@ -24,7 +24,7 @@ .layout--pass--content-medium > * { -ms-grid-column: 2; -ms-grid-column-span: 12; + grid-column: 2 / 14 - grid-column: 2 / 14; } } @@ -34,7 +34,7 @@ .layout--pass--content-medium > * { -ms-grid-column: 3; -ms-grid-column-span: 10; + grid-column: 3 / 13 - grid-column: 3 / 13; } } @@ -47,23 +47,23 @@ @media (min-width: 43.75rem) { .layout--pass--content-medium > * .layout--content-medium, + .layout--pass--content-medium > * .layout--pass--content-medium > *, .layout--content-medium .layout--content-medium, - .layout--pass--content-medium > * .layout--pass--content-medium > *, .layout--content-medium .layout--pass--content-medium > * { -ms-grid-column: 1; -ms-grid-column-span: 12; + grid-column: 1 / 13 - grid-column: 1 / 13; } } @media (min-width: 62.5rem) { .layout--pass--content-medium > * .layout--content-medium, + .layout--pass--content-medium > * .layout--pass--content-medium > *, .layout--content-medium .layout--content-medium, - .layout--pass--content-medium > * .layout--pass--content-medium > *, .layout--content-medium .layout--pass--content-medium > * { -ms-grid-column: 1; -ms-grid-column-span: 10; + grid-column: 1 / 11 - grid-column: 1 / 11; } } reverted: --- b/core/themes/olivero/css/layout/layout-content-narrow.css +++ a/core/themes/olivero/css/layout/layout-content-narrow.css @@ -15,7 +15,7 @@ -ms-grid-column: 1; -ms-grid-column-span: 6; grid-column: 1 / 7; + width: 100% - width: 100%; } @media (min-width: 43.75rem) { @@ -24,7 +24,7 @@ .layout--pass--content-narrow > * { -ms-grid-column: 2; -ms-grid-column-span: 12; + grid-column: 2 / 14 - grid-column: 2 / 14; } } @@ -34,7 +34,7 @@ .layout--pass--content-narrow > * { -ms-grid-column: 3; -ms-grid-column-span: 8; + grid-column: 3 / 11 - grid-column: 3 / 11; } } @@ -50,32 +50,32 @@ @media (min-width: 43.75rem) { .layout--content-narrow .layout--content-narrow, + .layout--content-narrow .layout--pass--content-narrow > *, .layout--pass--content-narrow > * .layout--content-narrow, + .layout--pass--content-narrow > * .layout--pass--content-narrow > *, .layout--content-medium .layout--content-narrow, + .layout--content-medium .layout--pass--content-narrow > *, .layout--pass--content-medium > * .layout--content-narrow, - .layout--content-narrow .layout--pass--content-narrow > *, - .layout--pass--content-narrow > * .layout--pass--content-narrow > *, - .layout--content-medium .layout--pass--content-narrow > *, .layout--pass--content-medium > * .layout--pass--content-narrow > * { -ms-grid-column: 1; -ms-grid-column-span: 12; + grid-column: 1 / 13 - grid-column: 1 / 13; } } @media (min-width: 62.5rem) { .layout--content-narrow .layout--content-narrow, + .layout--content-narrow .layout--pass--content-narrow > *, .layout--pass--content-narrow > * .layout--content-narrow, + .layout--pass--content-narrow > * .layout--pass--content-narrow > *, .layout--content-medium .layout--content-narrow, + .layout--content-medium .layout--pass--content-narrow > *, .layout--pass--content-medium > * .layout--content-narrow, - .layout--content-narrow .layout--pass--content-narrow > *, - .layout--pass--content-narrow > * .layout--pass--content-narrow > *, - .layout--content-medium .layout--pass--content-narrow > *, .layout--pass--content-medium > * .layout--pass--content-narrow > * { -ms-grid-column: 1; -ms-grid-column-span: 8; + grid-column: 1 / 9 - grid-column: 1 / 9; } } @@ -86,193 +86,193 @@ @media (min-width: 43.75rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { + left: -7.14286vw -[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { - left: -7.14286vw; } +[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { + right: -7.14286vw -[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { - right: -7.14286vw; } } @media (min-width: 62.5rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { + left: calc(-7.14286vw - -1.07143px) -[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { - left: calc(-7.14286vw - -0.06696rem); } +[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { + right: calc(-7.14286vw - -1.07143px) -[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { - right: calc(-7.14286vw - -0.06696rem); } } @media (min-width: 75rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { + left: calc(-7.14286vw - -0.62946rem) -[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { - left: calc(-7.14286vw - -0.62946rem); } +[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { + right: calc(-7.14286vw - -0.62946rem) -[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { - right: calc(-7.14286vw - -0.62946rem); } } @media (min-width: 90rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { + left: -5.86607rem -[dir="ltr"] .layout--content-narrow.text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="ltr"] .layout--content-narrow .text-content blockquote:before,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:before { - left: -5.86607rem; } +[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { + right: -5.86607rem -[dir="rtl"] .layout--content-narrow.text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:before,[dir="rtl"] .layout--content-narrow .text-content blockquote:before,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:before { - right: -5.86607rem; } } @media (min-width: 43.75rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { + left: -7.14286vw -[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { - left: -7.14286vw; } +[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { + right: -7.14286vw -[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { - right: -7.14286vw; } +[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { + margin-left: 2px -[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { - margin-left: 2px; } +[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { + margin-right: 2px -[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { - margin-right: 2px; } +.layout--content-narrow.text-content blockquote:after, .layout--content-narrow .text-content blockquote:after, .layout--pass--content-narrow > *.text-content blockquote:after, .layout--pass--content-narrow > * .text-content blockquote:after { -.layout--content-narrow.text-content blockquote:after, .layout--pass--content-narrow > *.text-content blockquote:after, .layout--content-narrow .text-content blockquote:after, .layout--pass--content-narrow > * .text-content blockquote:after { width: 1.125rem; + height: calc(100% - 2.8125rem) - height: calc(100% - 2.8125rem); } } @media (min-width: 62.5rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { + left: calc(-7.14286vw - -1.07143px) -[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { - left: calc(-7.14286vw - -0.06696rem); } +[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { + right: calc(-7.14286vw - -1.07143px) -[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { - right: calc(-7.14286vw - -0.06696rem); } } @media (min-width: 75rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { + left: calc(-7.14286vw - -0.62946rem) -[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { - left: calc(-7.14286vw - -0.62946rem); } +[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { + right: calc(-7.14286vw - -0.62946rem) -[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { - right: calc(-7.14286vw - -0.62946rem); } } @media (min-width: 90rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { + left: -5.86607rem -[dir="ltr"] .layout--content-narrow.text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="ltr"] .layout--content-narrow .text-content blockquote:after,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote:after { - left: -5.86607rem; } +[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { + right: -5.86607rem -[dir="rtl"] .layout--content-narrow.text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote:after,[dir="rtl"] .layout--content-narrow .text-content blockquote:after,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote:after { - right: -5.86607rem; } } @media (min-width: 43.75rem) { +[dir="ltr"] .layout--content-narrow.text-content blockquote,[dir="ltr"] .layout--content-narrow .text-content blockquote,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote { + padding-left: 0 -[dir="ltr"] .layout--content-narrow.text-content blockquote,[dir="ltr"] .layout--pass--content-narrow > *.text-content blockquote,[dir="ltr"] .layout--content-narrow .text-content blockquote,[dir="ltr"] .layout--pass--content-narrow > * .text-content blockquote { - padding-left: 0; } +[dir="rtl"] .layout--content-narrow.text-content blockquote,[dir="rtl"] .layout--content-narrow .text-content blockquote,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote { + padding-right: 0 -[dir="rtl"] .layout--content-narrow.text-content blockquote,[dir="rtl"] .layout--pass--content-narrow > *.text-content blockquote,[dir="rtl"] .layout--content-narrow .text-content blockquote,[dir="rtl"] .layout--pass--content-narrow > * .text-content blockquote { - padding-right: 0; } +.layout--content-narrow.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { -.layout--content-narrow.text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { width: calc(71.42857vw - 2.25rem); margin-top: 3.375rem; + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } @media (min-width: 62.5rem) { +.layout--content-narrow.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { + width: calc(71.42857vw - 2.91964rem) -.layout--content-narrow.text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { - width: calc(71.42857vw - 2.91964rem); } } @media (min-width: 75rem) { +.layout--content-narrow.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { + width: calc(71.42857vw - 8.54464rem) -.layout--content-narrow.text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { - width: calc(71.42857vw - 8.54464rem); } } @media (min-width: 90rem) { +.layout--content-narrow.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { + width: 56.41071rem -.layout--content-narrow.text-content blockquote, .layout--pass--content-narrow > *.text-content blockquote, .layout--content-narrow .text-content blockquote, .layout--pass--content-narrow > * .text-content blockquote { - width: 56.41071rem; } } @media (min-width: 43.75rem) { +.layout--content-narrow.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--pass--content-narrow > * .text-content pre { -.layout--content-narrow.text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > * .text-content pre { margin-top: 3.375rem; + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } @media (min-width: 62.5rem) { +[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { + margin-left: calc(-7.14286vw - -1.07143px) -[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { - margin-left: calc(-7.14286vw - -0.06696rem); } +[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { + margin-right: calc(-7.14286vw - -1.07143px) -[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { - margin-right: calc(-7.14286vw - -0.06696rem); } +.layout--content-narrow.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--pass--content-narrow > * .text-content pre { + width: calc(85.71429vw - 3.05357rem) -.layout--content-narrow.text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > * .text-content pre { - width: calc(85.71429vw - 3.05357rem); } } @media (min-width: 75rem) { +[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { + margin-left: calc(-7.14286vw - -0.62946rem) -[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { - margin-left: calc(-7.14286vw - -0.62946rem); } +[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { + margin-right: calc(-7.14286vw - -0.62946rem) -[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { - margin-right: calc(-7.14286vw - -0.62946rem); } +.layout--content-narrow.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--pass--content-narrow > * .text-content pre { + width: calc(85.71429vw - 9.80357rem) -.layout--content-narrow.text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > * .text-content pre { - width: calc(85.71429vw - 9.80357rem); } } @media (min-width: 90rem) { +[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { + margin-left: -5.86607rem -[dir="ltr"] .layout--content-narrow.text-content pre,[dir="ltr"] .layout--pass--content-narrow > *.text-content pre,[dir="ltr"] .layout--content-narrow .text-content pre,[dir="ltr"] .layout--pass--content-narrow > * .text-content pre { - margin-left: -5.86607rem; } +[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { + margin-right: -5.86607rem -[dir="rtl"] .layout--content-narrow.text-content pre,[dir="rtl"] .layout--pass--content-narrow > *.text-content pre,[dir="rtl"] .layout--content-narrow .text-content pre,[dir="rtl"] .layout--pass--content-narrow > * .text-content pre { - margin-right: -5.86607rem; } +.layout--content-narrow.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--pass--content-narrow > * .text-content pre { + width: 68.14286rem -.layout--content-narrow.text-content pre, .layout--pass--content-narrow > *.text-content pre, .layout--content-narrow .text-content pre, .layout--pass--content-narrow > * .text-content pre { - width: 68.14286rem; } } @@ -282,12 +282,12 @@ */ .sidebar-grid .layout--content-narrow.text-content blockquote, + .sidebar-grid .layout--content-narrow.text-content pre, + .sidebar-grid .layout--content-narrow .text-content blockquote, + .sidebar-grid .layout--content-narrow .text-content pre, .sidebar-grid .layout--pass--content-narrow > *.text-content blockquote, + .sidebar-grid .layout--pass--content-narrow > *.text-content pre, - .sidebar-grid .layout--content-narrow .text-content blockquote, .sidebar-grid .layout--pass--content-narrow > * .text-content blockquote, - .sidebar-grid .layout--content-narrow.text-content pre, - .sidebar-grid .layout--pass--content-narrow > *.text-content pre, - .sidebar-grid .layout--content-narrow .text-content pre, .sidebar-grid .layout--pass--content-narrow > * .text-content pre { width: auto; } reverted: --- b/core/themes/olivero/css/layout/layout-discovery-section-layout.css +++ a/core/themes/olivero/css/layout/layout-discovery-section-layout.css @@ -11,19 +11,19 @@ */ .layout { + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 43.75rem) { .layout { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } } @media (min-width: 62.5rem) { .layout { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/layout/layout-footer.css +++ a/core/themes/olivero/css/layout/layout-footer.css @@ -22,26 +22,26 @@ .site-footer__inner { padding-top: 2.25rem; + padding-bottom: 2.25rem - padding-bottom: 2.25rem; } @media (min-width: 75rem) { .site-footer__inner { padding-top: 4.5rem; + padding-bottom: 14.625rem - padding-bottom: 14.625rem; } } .region--footer_top__inner > *, .region--footer_bottom__inner > * { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } @media (min-width: 43.75rem) { .region--footer_top__inner > *, .region--footer_bottom__inner > * { flex: 1; + margin-bottom: 0 - margin-bottom: 0; } [dir="ltr"] .region--footer_top__inner > *:not(:last-child),[dir="ltr"] .region--footer_bottom__inner > *:not(:last-child) { @@ -58,6 +58,6 @@ .region--footer_top__inner, .region--footer_bottom__inner { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } } reverted: --- b/core/themes/olivero/css/layout/layout-sidebar.css +++ a/core/themes/olivero/css/layout/layout-sidebar.css @@ -15,7 +15,7 @@ -ms-grid-column-span: 6; grid-column: 1 / 7; align-self: flex-start; + -ms-grid-row-align: start - -ms-grid-row-align: start; } @media (min-width: 43.75rem) { @@ -23,7 +23,7 @@ .sidebar-grid > .site-main { -ms-grid-column: 1; -ms-grid-column-span: 14; + grid-column: 1 / 15 - grid-column: 1 / 15; } } @@ -36,7 +36,7 @@ grid-template-columns: repeat(8, minmax(0, 1fr)); -ms-grid-column: 3; -ms-grid-column-span: 8; + grid-column: 3 / 11 - grid-column: 3 / 11; } .sidebar-grid > .site-main > .region--content-above, @@ -62,7 +62,7 @@ -ms-grid-row: 2; -ms-grid-column: 1; -ms-grid-column-span: 6; + grid-column: 1 / 7 - grid-column: 1 / 7; } @media (min-width: 43.75rem) { @@ -70,7 +70,7 @@ .sidebar-grid .region--sidebar { -ms-grid-column: 3; -ms-grid-column-span: 10; + grid-column: 3 / 13 - grid-column: 3 / 13; } } @@ -80,6 +80,6 @@ -ms-grid-row: 1; -ms-grid-column: 12; -ms-grid-column-span: 3; + grid-column: 12 / 15 - grid-column: 12 / 15; } } reverted: --- b/core/themes/olivero/css/layout/layout-views-grid-horizontal.css +++ a/core/themes/olivero/css/layout/layout-views-grid-horizontal.css @@ -12,15 +12,15 @@ .views-view-grid--horizontal { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } [dir="ltr"] .views-view-grid--horizontal.cols-1 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-1 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-1 > * { @@ -28,15 +28,15 @@ } [dir="ltr"] .views-view-grid--horizontal.cols-2 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-2 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-2 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -44,36 +44,36 @@ @media (min-width: 43.75rem) { [dir="ltr"] .views-view-grid--horizontal.cols-2 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-2 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-2 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-2 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-2 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-3 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-3 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-3 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -81,61 +81,64 @@ @media (min-width: 43.75rem) { [dir="ltr"] .views-view-grid--horizontal.cols-3 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-3 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-3 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-3 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-3 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-3 > * { + + /* 3 column layout. */ + } -/* 3 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-3 > * { + flex-basis: calc(33.33333% - 0.75rem) - flex-basis: calc(33.33333% - 0.75rem); } [dir="ltr"] .views-view-grid--horizontal.cols-3 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-3 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-3 > *:nth-child(3n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-3 > *:nth-child(3n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-4 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-4 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-4 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -143,61 +146,64 @@ @media (min-width: 43.75rem) { [dir="ltr"] .views-view-grid--horizontal.cols-4 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-4 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-4 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-4 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-4 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-4 > * { + + /* 4 column layout. */ + } -/* 4 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-4 > * { + flex-basis: calc(25% - 0.84375rem) - flex-basis: calc(25% - 0.84375rem); } [dir="ltr"] .views-view-grid--horizontal.cols-4 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-4 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-4 > *:nth-child(4n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-4 > *:nth-child(4n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-5 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-5 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -205,86 +211,92 @@ @media (min-width: 31.25rem) { [dir="ltr"] .views-view-grid--horizontal.cols-5 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-5 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-5 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-5 > * { + + /* 3 column layout. */ + } -/* 3 column layout. */ @media (min-width: 43.75rem) { .views-view-grid--horizontal.cols-5 > * { + flex-basis: calc(33.33333% - 0.75rem) - flex-basis: calc(33.33333% - 0.75rem); } [dir="ltr"] .views-view-grid--horizontal.cols-5 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-5 > *:nth-child(3n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > *:nth-child(3n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-5 > * { + + /* 5 column layout. */ + } -/* 5 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-5 > * { + flex-basis: calc(20% - 0.9rem) - flex-basis: calc(20% - 0.9rem); } [dir="ltr"] .views-view-grid--horizontal.cols-5 > *:nth-child(3n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > *:nth-child(3n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-5 > *:nth-child(5n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-5 > *:nth-child(5n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-6 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-6 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -292,86 +304,92 @@ @media (min-width: 31.25rem) { [dir="ltr"] .views-view-grid--horizontal.cols-6 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-6 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-6 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-6 > * { + + /* 3 column layout. */ + } -/* 3 column layout. */ @media (min-width: 43.75rem) { .views-view-grid--horizontal.cols-6 > * { + flex-basis: calc(33.33333% - 0.75rem) - flex-basis: calc(33.33333% - 0.75rem); } [dir="ltr"] .views-view-grid--horizontal.cols-6 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-6 > *:nth-child(3n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > *:nth-child(3n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-6 > * { + + /* 6 column layout. */ + } -/* 6 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-6 > * { + flex-basis: calc(16.66667% - 0.9375rem) - flex-basis: calc(16.66667% - 0.9375rem); } [dir="ltr"] .views-view-grid--horizontal.cols-6 > *:nth-child(3n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > *:nth-child(3n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-6 > *:nth-child(6n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-6 > *:nth-child(6n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-7 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-7 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -379,86 +397,92 @@ @media (min-width: 31.25rem) { [dir="ltr"] .views-view-grid--horizontal.cols-7 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-7 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-7 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-7 > * { + + /* 3 column layout. */ + } -/* 3 column layout. */ @media (min-width: 43.75rem) { .views-view-grid--horizontal.cols-7 > * { + flex-basis: calc(33.33333% - 0.75rem) - flex-basis: calc(33.33333% - 0.75rem); } [dir="ltr"] .views-view-grid--horizontal.cols-7 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-7 > *:nth-child(3n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > *:nth-child(3n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-7 > * { + + /* 7 column layout. */ + } -/* 7 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-7 > * { + flex-basis: calc(14.28571% - 0.96429rem) - flex-basis: calc(14.28571% - 0.96429rem); } [dir="ltr"] .views-view-grid--horizontal.cols-7 > *:nth-child(3n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > *:nth-child(3n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-7 > *:nth-child(7n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-7 > *:nth-child(7n) { + margin-left: 0 - margin-left: 0; } } [dir="ltr"] .views-view-grid--horizontal.cols-8 > * { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > * { + margin-left: 0 - margin-left: 0; } .views-view-grid--horizontal.cols-8 > * { + flex-basis: 100% - flex-basis: 100%; /* 2 column layout. */ } @@ -466,73 +490,79 @@ @media (min-width: 31.25rem) { [dir="ltr"] .views-view-grid--horizontal.cols-8 > * { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > * { + margin-left: 1.125rem - margin-left: 1.125rem; } .views-view-grid--horizontal.cols-8 > * { + flex-basis: calc(50% - 0.5625rem) - flex-basis: calc(50% - 0.5625rem); } [dir="ltr"] .views-view-grid--horizontal.cols-8 > *:nth-child(2n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > *:nth-child(2n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-8 > * { + + /* 4 column layout. */ + } -/* 4 column layout. */ @media (min-width: 43.75rem) { .views-view-grid--horizontal.cols-8 > * { + flex-basis: calc(25% - 0.84375rem) - flex-basis: calc(25% - 0.84375rem); } [dir="ltr"] .views-view-grid--horizontal.cols-8 > *:nth-child(2n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > *:nth-child(2n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-8 > *:nth-child(4n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > *:nth-child(4n) { + margin-left: 0 - margin-left: 0; } } +.views-view-grid--horizontal.cols-8 > * { + + /* 8 column layout. */ + } -/* 8 column layout. */ @media (min-width: 62.5rem) { .views-view-grid--horizontal.cols-8 > * { + flex-basis: calc(12.5% - 0.98438rem) - flex-basis: calc(12.5% - 0.98438rem); } [dir="ltr"] .views-view-grid--horizontal.cols-8 > *:nth-child(4n) { + margin-right: 1.125rem - margin-right: 1.125rem; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > *:nth-child(4n) { + margin-left: 1.125rem - margin-left: 1.125rem; } [dir="ltr"] .views-view-grid--horizontal.cols-8 > *:nth-child(8n) { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .views-view-grid--horizontal.cols-8 > *:nth-child(8n) { + margin-left: 0 - margin-left: 0; } } reverted: --- b/core/themes/olivero/css/layout/layout-views-grid-vertical.css +++ a/core/themes/olivero/css/layout/layout-views-grid-vertical.css @@ -12,132 +12,132 @@ .views-view-grid--vertical { margin-bottom: -1.125rem; /* Offset the bottom row's padding. */ + grid-column-gap: 1.125rem - column-gap: 1.125rem; } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-2 { + column-count: 2 - column-count: 2; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-3 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-3 { + column-count: 3 - column-count: 3; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-4 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-4 { + column-count: 3 - column-count: 3; } } @media (min-width: 62.5rem) { .views-view-grid--vertical.cols-4 { + column-count: 4 - column-count: 4; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-5 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-5 { + column-count: 3 - column-count: 3; } } @media (min-width: 62.5rem) { .views-view-grid--vertical.cols-5 { + column-count: 5 - column-count: 5; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-6 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-6 { + column-count: 3 - column-count: 3; } } @media (min-width: 62.5rem) { .views-view-grid--vertical.cols-6 { + column-count: 6 - column-count: 6; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-7 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-7 { + column-count: 3 - column-count: 3; } } @media (min-width: 62.5rem) { .views-view-grid--vertical.cols-7 { + column-count: 7 - column-count: 7; } } @media (min-width: 31.25rem) { .views-view-grid--vertical.cols-8 { + column-count: 2 - column-count: 2; } } @media (min-width: 43.75rem) { .views-view-grid--vertical.cols-8 { + column-count: 4 - column-count: 4; } } @media (min-width: 62.5rem) { .views-view-grid--vertical.cols-8 { + column-count: 8 - column-count: 8; } } reverted: --- b/core/themes/olivero/css/layout/layout.css +++ a/core/themes/olivero/css/layout/layout.css @@ -14,14 +14,14 @@ width: 100%; max-width: 84.375rem; padding-left: 1.125rem; + padding-right: 1.125rem - padding-right: 1.125rem; } @media (min-width: 75rem) { .container { padding-left: 2.25rem; + padding-right: 2.25rem - padding-right: 2.25rem; } } @@ -47,32 +47,32 @@ .layout-main { display: flex; flex-direction: row-reverse; + flex-wrap: wrap - flex-wrap: wrap; } } @media (min-width: 75rem) { [dir="ltr"] .main-content { + margin-right: auto - margin-right: auto; } [dir="rtl"] .main-content { + margin-left: auto - margin-left: auto; } .main-content { + width: calc(100% - 5.625rem) - width: calc(100% - 5.625rem); } } .main-content__container { + padding-top: 3.375rem - padding-top: 3.375rem; } @media (min-width: 43.75rem) { .main-content__container { + padding-top: 5.625rem - padding-top: 5.625rem; } } reverted: --- b/core/themes/olivero/css/layout/region-content-below.css +++ a/core/themes/olivero/css/layout/region-content-below.css @@ -14,56 +14,56 @@ .region--content-below { display: flex; + flex-wrap: wrap - flex-wrap: wrap; } [dir="ltr"] .region--content-below > * { + margin-right: 2.25rem - margin-right: 2.25rem; } [dir="rtl"] .region--content-below > * { + margin-left: 2.25rem - margin-left: 2.25rem; } .region--content-below > * { flex-basis: calc(50% - 1.125rem); flex-grow: 1; + flex-shrink: 0 - flex-shrink: 0; } [dir="ltr"] .region--content-below > *:nth-child(2n),[dir="ltr"] .region--content-below > *:last-child { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .region--content-below > *:nth-child(2n),[dir="rtl"] .region--content-below > *:last-child { + margin-left: 0 - margin-left: 0; } } @media (min-width: 43.75rem) { .region--content-below > * { + flex-basis: calc(33.33% - 1.50075rem) - flex-basis: calc(33.33% - 1.50075rem); } [dir="ltr"] .region--content-below > *:nth-child(2n),[dir="ltr"] .region--content-below > *:last-child { + margin-right: 2.25rem - margin-right: 2.25rem; } [dir="rtl"] .region--content-below > *:nth-child(2n),[dir="rtl"] .region--content-below > *:last-child { + margin-left: 2.25rem - margin-left: 2.25rem; } [dir="ltr"] .region--content-below > *:nth-child(3n),[dir="ltr"] .region--content-below > *:last-child { + margin-right: 0 - margin-right: 0; } [dir="rtl"] .region--content-below > *:nth-child(3n),[dir="rtl"] .region--content-below > *:last-child { + margin-left: 0 - margin-left: 0; } } reverted: --- b/core/themes/olivero/css/layout/region-content.css +++ a/core/themes/olivero/css/layout/region-content.css @@ -11,19 +11,19 @@ */ .region--content { + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 43.75rem) { .region--content { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } } @media (min-width: 62.5rem) { .region--content { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/layout/region-secondary-menu.css +++ a/core/themes/olivero/css/layout/region-secondary-menu.css @@ -13,7 +13,7 @@ .region--secondary-menu { display: flex; margin-top: 2.25rem; + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } .region--secondary-menu > * { @@ -23,7 +23,7 @@ @media (min-width: 75rem) { body:not(.is-always-mobile-nav) .region--secondary-menu { justify-content: flex-end; + margin: 0 - margin: 0; /* If the secondary nav is the first item within the header, it does not need left separator. */ } reverted: --- b/core/themes/olivero/css/layout/region.css +++ a/core/themes/olivero/css/layout/region.css @@ -11,19 +11,19 @@ */ .region > * { + margin-bottom: 1.125rem - margin-bottom: 1.125rem; } @media (min-width: 43.75rem) { .region > * { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } } @media (min-width: 62.5rem) { .region > * { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/css/layout/social-bar.css +++ a/core/themes/olivero/css/layout/social-bar.css @@ -16,63 +16,63 @@ .social-bar { flex-shrink: 0; width: 5.625rem; + background-color: #f7f9fa - background-color: #f7f9fa; } } [dir="ltr"] .social-bar__inner { + padding-left: 1.125rem - padding-left: 1.125rem; } [dir="rtl"] .social-bar__inner { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="ltr"] .social-bar__inner { + padding-right: 1.125rem - padding-right: 1.125rem; } [dir="rtl"] .social-bar__inner { + padding-left: 1.125rem - padding-left: 1.125rem; } .social-bar__inner { position: relative; padding-top: 0.5625rem; + padding-bottom: 0.5625rem - padding-bottom: 0.5625rem; } @media (min-width: 75rem) { [dir="ltr"] .social-bar__inner { + padding-left: 0 - padding-left: 0; } [dir="rtl"] .social-bar__inner { + padding-right: 0 - padding-right: 0; } [dir="ltr"] .social-bar__inner { + padding-right: 0 - padding-right: 0; } [dir="rtl"] .social-bar__inner { + padding-left: 0 - padding-left: 0; } .social-bar__inner { position: relative; width: 5.625rem; padding-top: 5.625rem; + padding-bottom: 5.625rem - padding-bottom: 5.625rem; } [dir="ltr"] .social-bar__inner.is-fixed { + left: 0 - left: 0; } [dir="rtl"] .social-bar__inner.is-fixed { + right: 0 - right: 0; } .social-bar__inner.is-fixed { @@ -83,7 +83,7 @@ } .rotate > * { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } @media (min-width: 75rem) { @@ -91,15 +91,15 @@ .rotate > * { display: flex; align-items: center; + margin-bottom: 0 - margin-bottom: 0; } [dir="ltr"] .rotate > *:not(:first-child) { + margin-right: 2.25rem - margin-right: 2.25rem; } [dir="rtl"] .rotate > *:not(:first-child) { + margin-left: 2.25rem - margin-left: 2.25rem; } } @@ -107,36 +107,36 @@ [dir="ltr"] .rotate .contextual { left: 100%; + right: auto - right: auto; } [dir="rtl"] .rotate .contextual { right: 100%; + left: auto - left: auto; } .rotate .contextual { transform: rotate(90deg); /* LTR */ + transform-origin: top left /* LTR */ - transform-origin: top left; /* LTR */ } [dir="ltr"] .rotate .contextual .trigger { + float: left - float: left; } [dir="rtl"] .rotate .contextual .trigger { + float: right - float: right; } } @media (min-width: 75rem) { [dir="ltr"] .rotate { + left: 50% - left: 50%; } [dir="rtl"] .rotate { + right: 50% - right: 50%; } .rotate { @@ -145,13 +145,13 @@ flex-direction: row-reverse; width: 100vh; transform: rotate(-90deg) translateX(-100%); /* LTR */ + transform-origin: left /* LTR */ - transform-origin: left; /* LTR */ } @supports (width: max-content) { .rotate { + width: max-content - width: max-content; } } } @@ -159,7 +159,7 @@ @media (min-width: 75rem) { [dir="rtl"] .rotate { transform: rotate(90deg) translateX(100%); + transform-origin: right - transform-origin: right; } [dir="rtl"] .rotate .contextual { reverted: --- b/core/themes/olivero/css/layout/views.css +++ a/core/themes/olivero/css/layout/views.css @@ -11,7 +11,7 @@ */ .view > * { + margin-bottom: 2.25rem - margin-bottom: 2.25rem; } .view > *:last-child { @@ -21,6 +21,6 @@ @media (min-width: 43.75rem) { .view > * { + margin-bottom: 3.375rem - margin-bottom: 3.375rem; } } reverted: --- b/core/themes/olivero/js/checkbox.js +++ a/core/themes/olivero/js/checkbox.js @@ -0,0 +1,12 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.checkbox = function () { + return ''; + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/themes/seven/js/classy/media_embed_ckeditor.theme.js +++ a/core/themes/seven/js/classy/media_embed_ckeditor.theme.js @@ -0,0 +1,12 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.mediaEmbedPreviewError = function () { + return "
    ".concat(Drupal.t('An error occurred while trying to preview the media. Please save your work and reload this page.'), "
    "); + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/themes/stable/css/core/dialog/off-canvas.base.css +++ a/core/themes/stable/css/core/dialog/off-canvas.base.css @@ -274,7 +274,7 @@ #drupal-off-canvas ol li { display: block; padding: 0.3125rem 0; + border-bottom: 1px solid #333 - border-bottom: 1px solid #333; } #drupal-off-canvas ul li:last-child, #drupal-off-canvas ol li:last-child { @@ -312,9 +312,6 @@ #drupal-off-canvas .visually-hidden { position: absolute !important; -} - -#drupal-off-canvas .visually-hidden { overflow: hidden; clip: rect(1px, 1px, 1px, 1px); width: 1px; @@ -325,10 +322,6 @@ #drupal-off-canvas .visually-hidden.focusable:active, #drupal-off-canvas .visually-hidden.focusable:focus { position: static !important; -} - -#drupal-off-canvas .visually-hidden.focusable:active, -#drupal-off-canvas .visually-hidden.focusable:focus { overflow: visible; clip: auto; width: auto; reverted: --- b/core/themes/stable/css/core/dialog/off-canvas.reset.css +++ a/core/themes/stable/css/core/dialog/off-canvas.reset.css @@ -123,7 +123,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -138,6 +138,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; @@ -193,178 +194,178 @@ box-sizing: border-box; text-shadow: none; -webkit-font-smoothing: antialiased; + -webkit-tap-highlight-color: initial - -webkit-tap-highlight-color: initial; } #drupal-off-canvas span:after, + #drupal-off-canvas span:before, #drupal-off-canvas applet:after, + #drupal-off-canvas applet:before, #drupal-off-canvas object:after, + #drupal-off-canvas object:before, #drupal-off-canvas iframe:after, + #drupal-off-canvas iframe:before, #drupal-off-canvas h1:after, + #drupal-off-canvas h1:before, #drupal-off-canvas h2:after, + #drupal-off-canvas h2:before, #drupal-off-canvas h3:after, + #drupal-off-canvas h3:before, #drupal-off-canvas h4:after, + #drupal-off-canvas h4:before, #drupal-off-canvas h5:after, + #drupal-off-canvas h5:before, #drupal-off-canvas h6:after, + #drupal-off-canvas h6:before, #drupal-off-canvas p:after, + #drupal-off-canvas p:before, #drupal-off-canvas blockquote:after, + #drupal-off-canvas blockquote:before, #drupal-off-canvas pre:after, + #drupal-off-canvas pre:before, #drupal-off-canvas a:after, + #drupal-off-canvas a:before, #drupal-off-canvas abbr:after, + #drupal-off-canvas abbr:before, #drupal-off-canvas acronym:after, + #drupal-off-canvas acronym:before, #drupal-off-canvas address:after, + #drupal-off-canvas address:before, #drupal-off-canvas big:after, + #drupal-off-canvas big:before, #drupal-off-canvas button:after, + #drupal-off-canvas button:before, #drupal-off-canvas cite:after, + #drupal-off-canvas cite:before, #drupal-off-canvas code:after, + #drupal-off-canvas code:before, #drupal-off-canvas del:after, + #drupal-off-canvas del:before, #drupal-off-canvas dfn:after, + #drupal-off-canvas dfn:before, #drupal-off-canvas em:after, + #drupal-off-canvas em:before, #drupal-off-canvas img:after, + #drupal-off-canvas img:before, #drupal-off-canvas ins:after, + #drupal-off-canvas ins:before, #drupal-off-canvas kbd:after, + #drupal-off-canvas kbd:before, #drupal-off-canvas q:after, + #drupal-off-canvas q:before, #drupal-off-canvas s:after, + #drupal-off-canvas s:before, #drupal-off-canvas samp:after, + #drupal-off-canvas samp:before, #drupal-off-canvas small:after, + #drupal-off-canvas small:before, #drupal-off-canvas strike:after, + #drupal-off-canvas strike:before, #drupal-off-canvas strong:after, + #drupal-off-canvas strong:before, #drupal-off-canvas sub:after, + #drupal-off-canvas sub:before, #drupal-off-canvas sup:after, + #drupal-off-canvas sup:before, #drupal-off-canvas tt:after, + #drupal-off-canvas tt:before, #drupal-off-canvas var:after, + #drupal-off-canvas var:before, #drupal-off-canvas b:after, + #drupal-off-canvas b:before, #drupal-off-canvas u:after, + #drupal-off-canvas u:before, #drupal-off-canvas i:after, + #drupal-off-canvas i:before, #drupal-off-canvas center:after, + #drupal-off-canvas center:before, #drupal-off-canvas dl:after, + #drupal-off-canvas dl:before, #drupal-off-canvas dt:after, + #drupal-off-canvas dt:before, #drupal-off-canvas dd:after, + #drupal-off-canvas dd:before, #drupal-off-canvas ol:after, + #drupal-off-canvas ol:before, #drupal-off-canvas ul:after, + #drupal-off-canvas ul:before, #drupal-off-canvas li:after, + #drupal-off-canvas li:before, #drupal-off-canvas fieldset:after, + #drupal-off-canvas fieldset:before, #drupal-off-canvas form:after, + #drupal-off-canvas form:before, #drupal-off-canvas label:after, + #drupal-off-canvas label:before, #drupal-off-canvas legend:after, + #drupal-off-canvas legend:before, #drupal-off-canvas table:after, + #drupal-off-canvas table:before, #drupal-off-canvas caption:after, + #drupal-off-canvas caption:before, #drupal-off-canvas tbody:after, + #drupal-off-canvas tbody:before, #drupal-off-canvas tfoot:after, + #drupal-off-canvas tfoot:before, #drupal-off-canvas thead:after, + #drupal-off-canvas thead:before, #drupal-off-canvas tr:after, + #drupal-off-canvas tr:before, #drupal-off-canvas th:after, + #drupal-off-canvas th:before, #drupal-off-canvas td:after, + #drupal-off-canvas td:before, #drupal-off-canvas article:after, + #drupal-off-canvas article:before, #drupal-off-canvas aside:after, + #drupal-off-canvas aside:before, #drupal-off-canvas canvas:after, + #drupal-off-canvas canvas:before, #drupal-off-canvas details:after, + #drupal-off-canvas details:before, #drupal-off-canvas embed:after, + #drupal-off-canvas embed:before, #drupal-off-canvas figure:after, + #drupal-off-canvas figure:before, #drupal-off-canvas figcaption:after, + #drupal-off-canvas figcaption:before, #drupal-off-canvas footer:after, + #drupal-off-canvas footer:before, #drupal-off-canvas header:after, + #drupal-off-canvas header:before, #drupal-off-canvas hgroup:after, + #drupal-off-canvas hgroup:before, #drupal-off-canvas main:after, + #drupal-off-canvas main:before, #drupal-off-canvas menu:after, + #drupal-off-canvas menu:before, #drupal-off-canvas meter:after, + #drupal-off-canvas meter:before, #drupal-off-canvas nav:after, + #drupal-off-canvas nav:before, #drupal-off-canvas output:after, + #drupal-off-canvas output:before, #drupal-off-canvas progress:after, + #drupal-off-canvas progress:before, #drupal-off-canvas ruby:after, + #drupal-off-canvas ruby:before, #drupal-off-canvas section:after, + #drupal-off-canvas section:before, #drupal-off-canvas summary:after, + #drupal-off-canvas summary:before, #drupal-off-canvas time:after, + #drupal-off-canvas time:before, #drupal-off-canvas mark:after, + #drupal-off-canvas mark:before, #drupal-off-canvas audio:after, + #drupal-off-canvas audio:before, #drupal-off-canvas video:after, + #drupal-off-canvas video:before, #drupal-off-canvas input:after, + #drupal-off-canvas input:before, #drupal-off-canvas select:after, + #drupal-off-canvas select:before, #drupal-off-canvas textarea:after, - #drupal-off-canvas span:before, - #drupal-off-canvas applet:before, - #drupal-off-canvas object:before, - #drupal-off-canvas iframe:before, - #drupal-off-canvas h1:before, - #drupal-off-canvas h2:before, - #drupal-off-canvas h3:before, - #drupal-off-canvas h4:before, - #drupal-off-canvas h5:before, - #drupal-off-canvas h6:before, - #drupal-off-canvas p:before, - #drupal-off-canvas blockquote:before, - #drupal-off-canvas pre:before, - #drupal-off-canvas a:before, - #drupal-off-canvas abbr:before, - #drupal-off-canvas acronym:before, - #drupal-off-canvas address:before, - #drupal-off-canvas big:before, - #drupal-off-canvas button:before, - #drupal-off-canvas cite:before, - #drupal-off-canvas code:before, - #drupal-off-canvas del:before, - #drupal-off-canvas dfn:before, - #drupal-off-canvas em:before, - #drupal-off-canvas img:before, - #drupal-off-canvas ins:before, - #drupal-off-canvas kbd:before, - #drupal-off-canvas q:before, - #drupal-off-canvas s:before, - #drupal-off-canvas samp:before, - #drupal-off-canvas small:before, - #drupal-off-canvas strike:before, - #drupal-off-canvas strong:before, - #drupal-off-canvas sub:before, - #drupal-off-canvas sup:before, - #drupal-off-canvas tt:before, - #drupal-off-canvas var:before, - #drupal-off-canvas b:before, - #drupal-off-canvas u:before, - #drupal-off-canvas i:before, - #drupal-off-canvas center:before, - #drupal-off-canvas dl:before, - #drupal-off-canvas dt:before, - #drupal-off-canvas dd:before, - #drupal-off-canvas ol:before, - #drupal-off-canvas ul:before, - #drupal-off-canvas li:before, - #drupal-off-canvas fieldset:before, - #drupal-off-canvas form:before, - #drupal-off-canvas label:before, - #drupal-off-canvas legend:before, - #drupal-off-canvas table:before, - #drupal-off-canvas caption:before, - #drupal-off-canvas tbody:before, - #drupal-off-canvas tfoot:before, - #drupal-off-canvas thead:before, - #drupal-off-canvas tr:before, - #drupal-off-canvas th:before, - #drupal-off-canvas td:before, - #drupal-off-canvas article:before, - #drupal-off-canvas aside:before, - #drupal-off-canvas canvas:before, - #drupal-off-canvas details:before, - #drupal-off-canvas embed:before, - #drupal-off-canvas figure:before, - #drupal-off-canvas figcaption:before, - #drupal-off-canvas footer:before, - #drupal-off-canvas header:before, - #drupal-off-canvas hgroup:before, - #drupal-off-canvas main:before, - #drupal-off-canvas menu:before, - #drupal-off-canvas meter:before, - #drupal-off-canvas nav:before, - #drupal-off-canvas output:before, - #drupal-off-canvas progress:before, - #drupal-off-canvas ruby:before, - #drupal-off-canvas section:before, - #drupal-off-canvas summary:before, - #drupal-off-canvas time:before, - #drupal-off-canvas mark:before, - #drupal-off-canvas audio:before, - #drupal-off-canvas video:before, - #drupal-off-canvas input:before, - #drupal-off-canvas select:before, #drupal-off-canvas textarea:before { animation: none 0s ease 0s 1 normal none running; -webkit-backface-visibility: visible; @@ -385,7 +386,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -400,6 +401,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; reverted: --- b/core/themes/stable/js/ajax.js +++ a/core/themes/stable/js/ajax.js @@ -0,0 +1,12 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +(function (Drupal) { + Drupal.theme.ajaxProgressBar = function ($element) { + return $element.addClass('ajax-progress ajax-progress-bar'); + }; +})(Drupal); \ No newline at end of file reverted: --- b/core/themes/stable9/css/core/dialog/off-canvas.base.css +++ a/core/themes/stable9/css/core/dialog/off-canvas.base.css @@ -274,7 +274,7 @@ #drupal-off-canvas ol li { display: block; padding: 0.3125rem 0; + border-bottom: 1px solid #333 - border-bottom: 1px solid #333; } #drupal-off-canvas ul li:last-child, #drupal-off-canvas ol li:last-child { @@ -312,9 +312,6 @@ #drupal-off-canvas .visually-hidden { position: absolute !important; -} - -#drupal-off-canvas .visually-hidden { overflow: hidden; clip: rect(1px, 1px, 1px, 1px); width: 1px; @@ -325,10 +322,6 @@ #drupal-off-canvas .visually-hidden.focusable:active, #drupal-off-canvas .visually-hidden.focusable:focus { position: static !important; -} - -#drupal-off-canvas .visually-hidden.focusable:active, -#drupal-off-canvas .visually-hidden.focusable:focus { overflow: visible; clip: auto; width: auto; reverted: --- b/core/themes/stable9/css/core/dialog/off-canvas.reset.css +++ a/core/themes/stable9/css/core/dialog/off-canvas.reset.css @@ -123,7 +123,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -138,6 +138,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; @@ -193,178 +194,178 @@ box-sizing: border-box; text-shadow: none; -webkit-font-smoothing: antialiased; + -webkit-tap-highlight-color: initial - -webkit-tap-highlight-color: initial; } #drupal-off-canvas span:after, + #drupal-off-canvas span:before, #drupal-off-canvas applet:after, + #drupal-off-canvas applet:before, #drupal-off-canvas object:after, + #drupal-off-canvas object:before, #drupal-off-canvas iframe:after, + #drupal-off-canvas iframe:before, #drupal-off-canvas h1:after, + #drupal-off-canvas h1:before, #drupal-off-canvas h2:after, + #drupal-off-canvas h2:before, #drupal-off-canvas h3:after, + #drupal-off-canvas h3:before, #drupal-off-canvas h4:after, + #drupal-off-canvas h4:before, #drupal-off-canvas h5:after, + #drupal-off-canvas h5:before, #drupal-off-canvas h6:after, + #drupal-off-canvas h6:before, #drupal-off-canvas p:after, + #drupal-off-canvas p:before, #drupal-off-canvas blockquote:after, + #drupal-off-canvas blockquote:before, #drupal-off-canvas pre:after, + #drupal-off-canvas pre:before, #drupal-off-canvas a:after, + #drupal-off-canvas a:before, #drupal-off-canvas abbr:after, + #drupal-off-canvas abbr:before, #drupal-off-canvas acronym:after, + #drupal-off-canvas acronym:before, #drupal-off-canvas address:after, + #drupal-off-canvas address:before, #drupal-off-canvas big:after, + #drupal-off-canvas big:before, #drupal-off-canvas button:after, + #drupal-off-canvas button:before, #drupal-off-canvas cite:after, + #drupal-off-canvas cite:before, #drupal-off-canvas code:after, + #drupal-off-canvas code:before, #drupal-off-canvas del:after, + #drupal-off-canvas del:before, #drupal-off-canvas dfn:after, + #drupal-off-canvas dfn:before, #drupal-off-canvas em:after, + #drupal-off-canvas em:before, #drupal-off-canvas img:after, + #drupal-off-canvas img:before, #drupal-off-canvas ins:after, + #drupal-off-canvas ins:before, #drupal-off-canvas kbd:after, + #drupal-off-canvas kbd:before, #drupal-off-canvas q:after, + #drupal-off-canvas q:before, #drupal-off-canvas s:after, + #drupal-off-canvas s:before, #drupal-off-canvas samp:after, + #drupal-off-canvas samp:before, #drupal-off-canvas small:after, + #drupal-off-canvas small:before, #drupal-off-canvas strike:after, + #drupal-off-canvas strike:before, #drupal-off-canvas strong:after, + #drupal-off-canvas strong:before, #drupal-off-canvas sub:after, + #drupal-off-canvas sub:before, #drupal-off-canvas sup:after, + #drupal-off-canvas sup:before, #drupal-off-canvas tt:after, + #drupal-off-canvas tt:before, #drupal-off-canvas var:after, + #drupal-off-canvas var:before, #drupal-off-canvas b:after, + #drupal-off-canvas b:before, #drupal-off-canvas u:after, + #drupal-off-canvas u:before, #drupal-off-canvas i:after, + #drupal-off-canvas i:before, #drupal-off-canvas center:after, + #drupal-off-canvas center:before, #drupal-off-canvas dl:after, + #drupal-off-canvas dl:before, #drupal-off-canvas dt:after, + #drupal-off-canvas dt:before, #drupal-off-canvas dd:after, + #drupal-off-canvas dd:before, #drupal-off-canvas ol:after, + #drupal-off-canvas ol:before, #drupal-off-canvas ul:after, + #drupal-off-canvas ul:before, #drupal-off-canvas li:after, + #drupal-off-canvas li:before, #drupal-off-canvas fieldset:after, + #drupal-off-canvas fieldset:before, #drupal-off-canvas form:after, + #drupal-off-canvas form:before, #drupal-off-canvas label:after, + #drupal-off-canvas label:before, #drupal-off-canvas legend:after, + #drupal-off-canvas legend:before, #drupal-off-canvas table:after, + #drupal-off-canvas table:before, #drupal-off-canvas caption:after, + #drupal-off-canvas caption:before, #drupal-off-canvas tbody:after, + #drupal-off-canvas tbody:before, #drupal-off-canvas tfoot:after, + #drupal-off-canvas tfoot:before, #drupal-off-canvas thead:after, + #drupal-off-canvas thead:before, #drupal-off-canvas tr:after, + #drupal-off-canvas tr:before, #drupal-off-canvas th:after, + #drupal-off-canvas th:before, #drupal-off-canvas td:after, + #drupal-off-canvas td:before, #drupal-off-canvas article:after, + #drupal-off-canvas article:before, #drupal-off-canvas aside:after, + #drupal-off-canvas aside:before, #drupal-off-canvas canvas:after, + #drupal-off-canvas canvas:before, #drupal-off-canvas details:after, + #drupal-off-canvas details:before, #drupal-off-canvas embed:after, + #drupal-off-canvas embed:before, #drupal-off-canvas figure:after, + #drupal-off-canvas figure:before, #drupal-off-canvas figcaption:after, + #drupal-off-canvas figcaption:before, #drupal-off-canvas footer:after, + #drupal-off-canvas footer:before, #drupal-off-canvas header:after, + #drupal-off-canvas header:before, #drupal-off-canvas hgroup:after, + #drupal-off-canvas hgroup:before, #drupal-off-canvas main:after, + #drupal-off-canvas main:before, #drupal-off-canvas menu:after, + #drupal-off-canvas menu:before, #drupal-off-canvas meter:after, + #drupal-off-canvas meter:before, #drupal-off-canvas nav:after, + #drupal-off-canvas nav:before, #drupal-off-canvas output:after, + #drupal-off-canvas output:before, #drupal-off-canvas progress:after, + #drupal-off-canvas progress:before, #drupal-off-canvas ruby:after, + #drupal-off-canvas ruby:before, #drupal-off-canvas section:after, + #drupal-off-canvas section:before, #drupal-off-canvas summary:after, + #drupal-off-canvas summary:before, #drupal-off-canvas time:after, + #drupal-off-canvas time:before, #drupal-off-canvas mark:after, + #drupal-off-canvas mark:before, #drupal-off-canvas audio:after, + #drupal-off-canvas audio:before, #drupal-off-canvas video:after, + #drupal-off-canvas video:before, #drupal-off-canvas input:after, + #drupal-off-canvas input:before, #drupal-off-canvas select:after, + #drupal-off-canvas select:before, #drupal-off-canvas textarea:after, - #drupal-off-canvas span:before, - #drupal-off-canvas applet:before, - #drupal-off-canvas object:before, - #drupal-off-canvas iframe:before, - #drupal-off-canvas h1:before, - #drupal-off-canvas h2:before, - #drupal-off-canvas h3:before, - #drupal-off-canvas h4:before, - #drupal-off-canvas h5:before, - #drupal-off-canvas h6:before, - #drupal-off-canvas p:before, - #drupal-off-canvas blockquote:before, - #drupal-off-canvas pre:before, - #drupal-off-canvas a:before, - #drupal-off-canvas abbr:before, - #drupal-off-canvas acronym:before, - #drupal-off-canvas address:before, - #drupal-off-canvas big:before, - #drupal-off-canvas button:before, - #drupal-off-canvas cite:before, - #drupal-off-canvas code:before, - #drupal-off-canvas del:before, - #drupal-off-canvas dfn:before, - #drupal-off-canvas em:before, - #drupal-off-canvas img:before, - #drupal-off-canvas ins:before, - #drupal-off-canvas kbd:before, - #drupal-off-canvas q:before, - #drupal-off-canvas s:before, - #drupal-off-canvas samp:before, - #drupal-off-canvas small:before, - #drupal-off-canvas strike:before, - #drupal-off-canvas strong:before, - #drupal-off-canvas sub:before, - #drupal-off-canvas sup:before, - #drupal-off-canvas tt:before, - #drupal-off-canvas var:before, - #drupal-off-canvas b:before, - #drupal-off-canvas u:before, - #drupal-off-canvas i:before, - #drupal-off-canvas center:before, - #drupal-off-canvas dl:before, - #drupal-off-canvas dt:before, - #drupal-off-canvas dd:before, - #drupal-off-canvas ol:before, - #drupal-off-canvas ul:before, - #drupal-off-canvas li:before, - #drupal-off-canvas fieldset:before, - #drupal-off-canvas form:before, - #drupal-off-canvas label:before, - #drupal-off-canvas legend:before, - #drupal-off-canvas table:before, - #drupal-off-canvas caption:before, - #drupal-off-canvas tbody:before, - #drupal-off-canvas tfoot:before, - #drupal-off-canvas thead:before, - #drupal-off-canvas tr:before, - #drupal-off-canvas th:before, - #drupal-off-canvas td:before, - #drupal-off-canvas article:before, - #drupal-off-canvas aside:before, - #drupal-off-canvas canvas:before, - #drupal-off-canvas details:before, - #drupal-off-canvas embed:before, - #drupal-off-canvas figure:before, - #drupal-off-canvas figcaption:before, - #drupal-off-canvas footer:before, - #drupal-off-canvas header:before, - #drupal-off-canvas hgroup:before, - #drupal-off-canvas main:before, - #drupal-off-canvas menu:before, - #drupal-off-canvas meter:before, - #drupal-off-canvas nav:before, - #drupal-off-canvas output:before, - #drupal-off-canvas progress:before, - #drupal-off-canvas ruby:before, - #drupal-off-canvas section:before, - #drupal-off-canvas summary:before, - #drupal-off-canvas time:before, - #drupal-off-canvas mark:before, - #drupal-off-canvas audio:before, - #drupal-off-canvas video:before, - #drupal-off-canvas input:before, - #drupal-off-canvas select:before, #drupal-off-canvas textarea:before { animation: none 0s ease 0s 1 normal none running; -webkit-backface-visibility: visible; @@ -385,7 +386,7 @@ columns: auto; column-count: auto; column-fill: balance; + grid-column-gap: normal; - column-gap: normal; column-rule: medium none currentColor; column-span: 1; column-width: auto; @@ -400,6 +401,7 @@ font-family: serif; font-size: medium; font-style: normal; + font-feature-settings: normal; font-variant: normal; font-weight: normal; font-stretch: normal; reverted: --- b/core/themes/stable9/js/tour.js +++ a/core/themes/stable9/js/tour.js @@ -0,0 +1,112 @@ +/** +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +(function (Drupal) { + Drupal.tour.convertToJoyrideMarkup = function (shepherdTour) { + var changeTag = function changeTag(element, tag) { + if (element) { + var newTagElement = document.createElement(tag); + + _toConsumableArray(element.attributes).forEach(function (attr) { + newTagElement.setAttribute(attr.name, attr.value); + }); + + newTagElement.innerHTML = element.innerHTML; + element.parentNode.replaceChild(newTagElement, element); + } + }; + + var shepherdElement = shepherdTour.currentStep.el; + var shepherdContent = shepherdElement.querySelector('.shepherd-content'); + var shepherdCancel = shepherdElement.querySelector('.shepherd-cancel-icon'); + var shepherdTitle = shepherdElement.querySelector('.shepherd-title'); + var shepherdText = shepherdElement.querySelector('.shepherd-text'); + var shepherdNext = shepherdElement.querySelector('footer .button'); + var tourProgress = shepherdElement.querySelector('.tour-progress'); + shepherdElement.classList.add('joyride-tip-guide'); + shepherdContent.classList.add('joyride-content-wrapper'); + shepherdNext.classList.add('joyride-next-tip'); + shepherdNext.setAttribute('href', '#'); + shepherdNext.setAttribute('role', 'button'); + shepherdNext.removeAttribute('type'); + shepherdCancel.classList.add('joyride-close-tip'); + shepherdCancel.removeAttribute('type'); + shepherdCancel.setAttribute('href', '#'); + shepherdCancel.setAttribute('role', 'button'); + shepherdElement.setAttribute('data-index', shepherdTour.currentStep.options.index); + shepherdElement.querySelector('footer').remove(); + + if (shepherdElement.classList.contains('tip-uses-get-output')) { + shepherdText.appendChild(shepherdNext); + shepherdText.appendChild(shepherdCancel); + shepherdContent.querySelector('.shepherd-header').remove(); + Array.from(shepherdText.children).forEach(function (node) { + if (node.tagName === 'P' && node.textContent === '' && node.classList.length === 0) { + node.remove(); + } + }); + shepherdContent.innerHTML = shepherdText.innerHTML; + } else { + shepherdContent.insertBefore(shepherdTitle, shepherdContent.firstChild); + shepherdContent.insertBefore(tourProgress, shepherdText.nextSibling); + shepherdContent.appendChild(shepherdCancel); + shepherdContent.querySelector('.shepherd-header').remove(); + shepherdContent.insertBefore(shepherdNext, tourProgress.nextSibling); + shepherdCancel.innerHTML = ''; + shepherdTitle.classList.add('tour-tip-label'); + changeTag(shepherdTitle, 'h2'); + shepherdText.outerHTML = shepherdText.innerHTML; + } + + changeTag(shepherdElement.querySelector('.joyride-close-tip'), 'a'); + changeTag(shepherdElement.querySelector('.joyride-next-tip'), 'a'); + var shepherdArrow = shepherdElement.querySelector('.shepherd-arrow'); + + if (shepherdArrow) { + shepherdArrow.classList.add('joyride-nub'); + + if (shepherdTour.currentStep.options.attachTo.on) { + var stepToTipPosition = { + bottom: 'top', + top: 'bottom', + left: 'right', + right: 'left' + }; + shepherdArrow.classList.add(stepToTipPosition[shepherdTour.currentStep.options.attachTo.on.split('-')[0]]); + } + + changeTag(shepherdArrow, 'span'); + } else { + var nub = document.createElement('span'); + nub.classList.add('joyride-nub'); + nub.setAttribute('style', 'display: none;'); + shepherdElement.insertBefore(nub, shepherdElement.firstChild); + } + + shepherdElement.querySelector('.joyride-next-tip').addEventListener('click', function (e) { + e.preventDefault(); + shepherdTour.next(); + }); + shepherdElement.querySelector('.joyride-close-tip').addEventListener('click', function (e) { + e.preventDefault(); + shepherdTour.cancel(); + }); + shepherdElement.querySelector('.joyride-next-tip').focus(); + }; +})(Drupal); \ No newline at end of file