Issue #1996238 by sun, nod_, damiankloip, Wim Leers, longwave, alexpott, Xano, mdrummond, Mark Carver, Jeff Burnz, highrockmedia, joelpittet, et al: Replace hook_library_info() by *.libraries.yml file.
2014-02-23 04:56:51 +00:00
|
|
|
/**
|
2017-05-19 22:12:53 +00:00
|
|
|
* DO NOT EDIT THIS FILE.
|
|
|
|
* See the following change record for more information,
|
2017-05-23 14:30:14 +00:00
|
|
|
* https://www.drupal.org/node/2815083
|
2017-05-19 22:12:53 +00:00
|
|
|
* @preserve
|
|
|
|
**/
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2020-01-30 09:08:38 +00:00
|
|
|
window.Drupal = {
|
|
|
|
behaviors: {},
|
|
|
|
locale: {}
|
|
|
|
};
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2019-10-11 00:34:41 +00:00
|
|
|
(function (Drupal, drupalSettings, drupalTranslations, console, Proxy, Reflect) {
|
2015-08-06 12:09:40 +00:00
|
|
|
Drupal.throwError = function (error) {
|
2021-12-18 06:12:16 +00:00
|
|
|
setTimeout(() => {
|
2017-05-19 22:12:53 +00:00
|
|
|
throw error;
|
|
|
|
}, 0);
|
2015-08-06 12:09:40 +00:00
|
|
|
};
|
2012-08-24 11:38:13 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.attachBehaviors = function (context, settings) {
|
|
|
|
context = context || document;
|
|
|
|
settings = settings || drupalSettings;
|
2021-12-18 06:12:16 +00:00
|
|
|
const behaviors = Drupal.behaviors;
|
|
|
|
Object.keys(behaviors || {}).forEach(i => {
|
2018-01-03 23:25:46 +00:00
|
|
|
if (typeof behaviors[i].attach === 'function') {
|
2014-01-27 21:41:32 +00:00
|
|
|
try {
|
|
|
|
behaviors[i].attach(context, settings);
|
2017-05-19 22:12:53 +00:00
|
|
|
} catch (e) {
|
2015-08-06 12:09:40 +00:00
|
|
|
Drupal.throwError(e);
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
2012-08-24 11:38:13 +00:00
|
|
|
}
|
2018-01-03 23:25:46 +00:00
|
|
|
});
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2008-10-29 10:01:28 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.detachBehaviors = function (context, settings, trigger) {
|
|
|
|
context = context || document;
|
|
|
|
settings = settings || drupalSettings;
|
|
|
|
trigger = trigger || 'unload';
|
2021-12-18 06:12:16 +00:00
|
|
|
const behaviors = Drupal.behaviors;
|
|
|
|
Object.keys(behaviors || {}).forEach(i => {
|
2018-01-03 23:25:46 +00:00
|
|
|
if (typeof behaviors[i].detach === 'function') {
|
2014-01-27 21:41:32 +00:00
|
|
|
try {
|
|
|
|
behaviors[i].detach(context, settings, trigger);
|
2017-05-19 22:12:53 +00:00
|
|
|
} catch (e) {
|
2015-08-06 12:09:40 +00:00
|
|
|
Drupal.throwError(e);
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
2012-08-24 11:38:13 +00:00
|
|
|
}
|
2018-01-03 23:25:46 +00:00
|
|
|
});
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2007-07-01 15:37:10 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.checkPlain = function (str) {
|
SA-CORE-2018-001 by cashwilliams, catch, cilefen, droplet, dawehner, bonus, agentrickard, David_Rothstein, Chi, Gábor Hojtsy, Heine, Wim Leers, Schnitzel, drpal, effulgentsia, tedbow, tim.plunkett, tstoeckler, xjm, will_c, stefan.r, samuel.mortenson, larowlan, greggles, logaritmisk, mpdonadio, pwolanin, plach
2018-02-21 16:58:22 +00:00
|
|
|
str = str.toString().replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, ''');
|
2014-01-27 21:41:32 +00:00
|
|
|
return str;
|
|
|
|
};
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.formatString = function (str, args) {
|
2021-12-18 06:12:16 +00:00
|
|
|
const processedArgs = {};
|
|
|
|
Object.keys(args || {}).forEach(key => {
|
2018-01-03 23:25:46 +00:00
|
|
|
switch (key.charAt(0)) {
|
|
|
|
case '@':
|
|
|
|
processedArgs[key] = Drupal.checkPlain(args[key]);
|
|
|
|
break;
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2018-01-03 23:25:46 +00:00
|
|
|
case '!':
|
|
|
|
processedArgs[key] = args[key];
|
|
|
|
break;
|
2015-06-08 14:04:39 +00:00
|
|
|
|
2018-01-03 23:25:46 +00:00
|
|
|
default:
|
|
|
|
processedArgs[key] = Drupal.theme('placeholder', args[key]);
|
|
|
|
break;
|
2012-05-16 02:55:55 +00:00
|
|
|
}
|
2018-01-03 23:25:46 +00:00
|
|
|
});
|
2015-04-08 12:45:05 +00:00
|
|
|
return Drupal.stringReplace(str, processedArgs, null);
|
2014-02-03 14:25:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Drupal.stringReplace = function (str, args, keys) {
|
|
|
|
if (str.length === 0) {
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!Array.isArray(keys)) {
|
2018-01-03 23:25:46 +00:00
|
|
|
keys = Object.keys(args || {});
|
2021-12-18 06:12:16 +00:00
|
|
|
keys.sort((a, b) => a.length - b.length);
|
2014-02-03 14:25:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (keys.length === 0) {
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
const key = keys.pop();
|
|
|
|
const fragments = str.split(key);
|
2014-02-03 14:25:26 +00:00
|
|
|
|
|
|
|
if (keys.length) {
|
2021-12-18 06:12:16 +00:00
|
|
|
for (let i = 0; i < fragments.length; i++) {
|
2014-02-11 10:35:09 +00:00
|
|
|
fragments[i] = Drupal.stringReplace(fragments[i], args, keys.slice(0));
|
2014-02-03 14:25:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return fragments.join(args[key]);
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2011-08-07 15:01:39 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.t = function (str, args, options) {
|
|
|
|
options = options || {};
|
|
|
|
options.context = options.context || '';
|
2011-10-26 07:38:48 +00:00
|
|
|
|
2015-02-19 09:56:00 +00:00
|
|
|
if (typeof drupalTranslations !== 'undefined' && drupalTranslations.strings && drupalTranslations.strings[options.context] && drupalTranslations.strings[options.context][str]) {
|
|
|
|
str = drupalTranslations.strings[options.context][str];
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
if (args) {
|
|
|
|
str = Drupal.formatString(str, args);
|
|
|
|
}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
return str;
|
|
|
|
};
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.url = function (path) {
|
2014-11-28 13:38:17 +00:00
|
|
|
return drupalSettings.path.baseUrl + drupalSettings.path.pathPrefix + path;
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2012-04-29 15:16:27 +00:00
|
|
|
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
Drupal.url.toAbsolute = function (url) {
|
2021-12-18 06:12:16 +00:00
|
|
|
const urlParsingNode = document.createElement('a');
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
url = decodeURIComponent(url);
|
2017-05-19 22:12:53 +00:00
|
|
|
} catch (e) {}
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
|
|
|
|
urlParsingNode.setAttribute('href', url);
|
|
|
|
return urlParsingNode.cloneNode(false).href;
|
|
|
|
};
|
|
|
|
|
|
|
|
Drupal.url.isLocal = function (url) {
|
2021-12-18 06:12:16 +00:00
|
|
|
let absoluteUrl = Drupal.url.toAbsolute(url);
|
|
|
|
let {
|
|
|
|
protocol
|
|
|
|
} = window.location;
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
|
|
|
|
if (protocol === 'http:' && absoluteUrl.indexOf('https:') === 0) {
|
|
|
|
protocol = 'https:';
|
|
|
|
}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
let baseUrl = `${protocol}//${window.location.host}${drupalSettings.path.baseUrl.slice(0, -1)}`;
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
|
|
|
|
try {
|
|
|
|
absoluteUrl = decodeURIComponent(absoluteUrl);
|
2017-05-19 22:12:53 +00:00
|
|
|
} catch (e) {}
|
2020-01-30 09:08:38 +00:00
|
|
|
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
try {
|
|
|
|
baseUrl = decodeURIComponent(baseUrl);
|
2017-05-19 22:12:53 +00:00
|
|
|
} catch (e) {}
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
return absoluteUrl === baseUrl || absoluteUrl.indexOf(`${baseUrl}/`) === 0;
|
Issue #2554219 by nod_, larowlan, tim.plunkett, regilero, droplet, japerry, samuel.mortenson, Pere Orga, effulgentsia, benjy, Gábor Hojtsy, greggles, Wim Leers, David_Rothstein, pwolanin, neclimdul, EclipseGc, znerol: Port Cross-site Scripting - Ajax system fixes from SA-CORE-2015-003 to Drupal 8
2015-08-26 22:02:58 +00:00
|
|
|
};
|
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.formatPlural = function (count, singular, plural, args, options) {
|
|
|
|
args = args || {};
|
|
|
|
args['@count'] = count;
|
2021-12-18 06:12:16 +00:00
|
|
|
const pluralDelimiter = drupalSettings.pluralDelimiter;
|
|
|
|
const translations = Drupal.t(singular + pluralDelimiter + plural, args, options).split(pluralDelimiter);
|
|
|
|
let index = 0;
|
2014-02-03 14:25:26 +00:00
|
|
|
|
2015-02-19 09:56:00 +00:00
|
|
|
if (typeof drupalTranslations !== 'undefined' && drupalTranslations.pluralFormula) {
|
2020-01-28 13:12:54 +00:00
|
|
|
index = count in drupalTranslations.pluralFormula ? drupalTranslations.pluralFormula[count] : drupalTranslations.pluralFormula.default;
|
2017-05-19 22:12:53 +00:00
|
|
|
} else if (args['@count'] !== 1) {
|
2014-04-06 21:20:00 +00:00
|
|
|
index = 1;
|
|
|
|
}
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-02-03 14:25:26 +00:00
|
|
|
return translations[index];
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.encodePath = function (item) {
|
|
|
|
return window.encodeURIComponent(item).replace(/%2F/g, '/');
|
|
|
|
};
|
2013-05-13 12:49:00 +00:00
|
|
|
|
2022-02-18 19:53:44 +00:00
|
|
|
Drupal.deprecationError = _ref => {
|
|
|
|
let {
|
|
|
|
message
|
|
|
|
} = _ref;
|
|
|
|
|
2019-10-11 00:34:41 +00:00
|
|
|
if (drupalSettings.suppressDeprecationErrors === false && typeof console !== 'undefined' && console.warn) {
|
2021-12-18 06:12:16 +00:00
|
|
|
console.warn(`[Deprecation] ${message}`);
|
2019-10-11 00:34:41 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-02-18 19:53:44 +00:00
|
|
|
Drupal.deprecatedProperty = _ref2 => {
|
|
|
|
let {
|
|
|
|
target,
|
|
|
|
deprecatedProperty,
|
|
|
|
message
|
|
|
|
} = _ref2;
|
|
|
|
|
2019-10-11 00:34:41 +00:00
|
|
|
if (!Proxy || !Reflect) {
|
|
|
|
return target;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Proxy(target, {
|
2022-02-18 19:53:44 +00:00
|
|
|
get: function (target, key) {
|
2020-01-30 09:08:38 +00:00
|
|
|
if (key === deprecatedProperty) {
|
|
|
|
Drupal.deprecationError({
|
2021-12-18 06:12:16 +00:00
|
|
|
message
|
2020-01-30 09:08:38 +00:00
|
|
|
});
|
2019-10-11 00:34:41 +00:00
|
|
|
}
|
2020-01-28 11:36:14 +00:00
|
|
|
|
2022-02-18 19:53:44 +00:00
|
|
|
for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
|
|
rest[_key - 2] = arguments[_key];
|
|
|
|
}
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
return Reflect.get(target, key, ...rest);
|
2019-10-11 00:34:41 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2022-02-18 19:53:44 +00:00
|
|
|
Drupal.theme = function (func) {
|
2014-01-27 21:41:32 +00:00
|
|
|
if (func in Drupal.theme) {
|
2022-02-18 19:53:44 +00:00
|
|
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
|
|
args[_key2 - 1] = arguments[_key2];
|
|
|
|
}
|
|
|
|
|
2021-12-18 06:12:16 +00:00
|
|
|
return Drupal.theme[func](...args);
|
2014-01-27 21:41:32 +00:00
|
|
|
}
|
|
|
|
};
|
2007-06-08 12:51:59 +00:00
|
|
|
|
2014-01-27 21:41:32 +00:00
|
|
|
Drupal.theme.placeholder = function (str) {
|
2021-12-18 06:12:16 +00:00
|
|
|
return `<em class="placeholder">${Drupal.checkPlain(str)}</em>`;
|
2014-01-27 21:41:32 +00:00
|
|
|
};
|
2019-10-11 00:34:41 +00:00
|
|
|
})(Drupal, window.drupalSettings, window.drupalTranslations, window.console, window.Proxy, window.Reflect);
|