1/** 2* DO NOT EDIT THIS FILE. 3* See the following change record for more information, 4* https://www.drupal.org/node/2815083 5* @preserve 6**/ 7 8(function (Drupal) { 9 Drupal.behaviors.responsiveImageAJAX = { 10 attach: function attach() { 11 if (window.picturefill) { 12 window.picturefill(); 13 } 14 } 15 }; 16})(Drupal);; 17/** 18* DO NOT EDIT THIS FILE. 19* See the following change record for more information, 20* https://www.drupal.org/node/2815083 21* @preserve 22**/ 23function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } 24 25(function ($, window, Drupal, drupalSettings) { 26 Drupal.behaviors.AJAX = { 27 attach: function attach(context, settings) { 28 function loadAjaxBehavior(base) { 29 var elementSettings = settings.ajax[base]; 30 if (typeof elementSettings.selector === 'undefined') { 31 elementSettings.selector = '#' + base; 32 } 33 $(elementSettings.selector).once('drupal-ajax').each(function () { 34 elementSettings.element = this; 35 elementSettings.base = base; 36 Drupal.ajax(elementSettings); 37 }); 38 } 39 40 Object.keys(settings.ajax || {}).forEach(function (base) { 41 return loadAjaxBehavior(base); 42 }); 43 44 Drupal.ajax.bindAjaxLinks(document.body); 45 46 $('.use-ajax-submit').once('ajax').each(function () { 47 var elementSettings = {}; 48 49 elementSettings.url = $(this.form).attr('action'); 50 51 elementSettings.setClick = true; 52 53 elementSettings.event = 'click'; 54 55 elementSettings.progress = { type: 'throbber' }; 56 elementSettings.base = $(this).attr('id'); 57 elementSettings.element = this; 58 59 Drupal.ajax(elementSettings); 60 }); 61 }, 62 detach: function detach(context, settings, trigger) { 63 if (trigger === 'unload') { 64 Drupal.ajax.expired().forEach(function (instance) { 65 Drupal.ajax.instances[instance.instanceIndex] = null; 66 }); 67 } 68 } 69 }; 70 71 Drupal.AjaxError = function (xmlhttp, uri, customMessage) { 72 var statusCode = void 0; 73 var statusText = void 0; 74 var responseText = void 0; 75 if (xmlhttp.status) { 76 statusCode = '\n' + Drupal.t('An AJAX HTTP error occurred.') + '\n' + Drupal.t('HTTP Result Code: !status', { 77 '!status': xmlhttp.status 78 }); 79 } else { 80 statusCode = '\n' + Drupal.t('An AJAX HTTP request terminated abnormally.'); 81 } 82 statusCode += '\n' + Drupal.t('Debugging information follows.'); 83 var pathText = '\n' + Drupal.t('Path: !uri', { '!uri': uri }); 84 statusText = ''; 85 86 try { 87 statusText = '\n' + Drupal.t('StatusText: !statusText', { 88 '!statusText': $.trim(xmlhttp.statusText) 89 }); 90 } catch (e) {} 91 92 responseText = ''; 93 94 try { 95 responseText = '\n' + Drupal.t('ResponseText: !responseText', { 96 '!responseText': $.trim(xmlhttp.responseText) 97 }); 98 } catch (e) {} 99 100 responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); 101 responseText = responseText.replace(/[\n]+\s+/g, '\n'); 102 103 var readyStateText = xmlhttp.status === 0 ? '\n' + Drupal.t('ReadyState: !readyState', { 104 '!readyState': xmlhttp.readyState 105 }) : ''; 106 107 customMessage = customMessage ? '\n' + Drupal.t('CustomMessage: !customMessage', { 108 '!customMessage': customMessage 109 }) : ''; 110 111 this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; 112 113 this.name = 'AjaxError'; 114 }; 115 116 Drupal.AjaxError.prototype = new Error(); 117 Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; 118 119 Drupal.ajax = function (settings) { 120 if (arguments.length !== 1) { 121 throw new Error('Drupal.ajax() function must be called with one configuration object only'); 122 } 123 124 var base = settings.base || false; 125 var element = settings.element || false; 126 delete settings.base; 127 delete settings.element; 128 129 if (!settings.progress && !element) { 130 settings.progress = false; 131 } 132 133 var ajax = new Drupal.Ajax(base, element, settings); 134 ajax.instanceIndex = Drupal.ajax.instances.length; 135 Drupal.ajax.instances.push(ajax); 136 137 return ajax; 138 }; 139 140 Drupal.ajax.instances = []; 141 142 Drupal.ajax.expired = function () { 143 return Drupal.ajax.instances.filter(function (instance) { 144 return instance && instance.element !== false && !document.body.contains(instance.element); 145 }); 146 }; 147 148 Drupal.ajax.bindAjaxLinks = function (element) {
149 $(element).find('.use-ajax').once('ajax').each(function (i, ajaxLink) { 150 var $linkElement = $(ajaxLink); 151 152 var elementSettings = { 153 progress: { type: 'throbber' }, 154 dialogType: $linkElement.data('dialog-type'), 155 dialog: $linkElement.data('dialog-options'), 156 dialogRenderer: $linkElement.data('dialog-renderer'), 157 base: $linkElement.attr('id'), 158 element: ajaxLink 159 }; 160 var href = $linkElement.attr('href'); 161 162 if (href) { 163 elementSettings.url = href; 164 elementSettings.event = 'click'; 165 } 166 Drupal.ajax(elementSettings); 167 }); 168 }; 169 170 Drupal.Ajax = function (base, element, elementSettings) { 171 var defaults = { 172 event: element ? 'mousedown' : null, 173 keypress: true, 174 selector: base ? '#' + base : null, 175 effect: 'none', 176 speed: 'none', 177 method: 'replaceWith', 178 progress: { 179 type: 'throbber', 180 message: Drupal.t('Please wait...') 181 }, 182 submit: { 183 js: true 184 } 185 }; 186 187 $.extend(this, defaults, elementSettings); 188 189 this.commands = new Drupal.AjaxCommands(); 190 191 this.instanceIndex = false; 192 193 if (this.wrapper) { 194 this.wrapper = '#' + this.wrapper; 195 } 196 197 this.element = element; 198 199 this.element_settings = elementSettings; 200 201 this.elementSettings = elementSettings; 202 203 if (this.element && this.element.form) { 204 this.$form = $(this.element.form); 205 } 206 207 if (!this.url) { 208 var $element = $(this.element); 209 if ($element.is('a')) { 210 this.url = $element.attr('href'); 211 } else if (this.element && element.form) { 212 this.url = this.$form.attr('action'); 213 } 214 } 215 216 var originalUrl = this.url; 217 218 this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); 219 220 if (drupalSettings.ajaxTrustedUrl[originalUrl]) { 221 drupalSettings.ajaxTrustedUrl[this.url] = true; 222 } 223 224 var ajax = this; 225 226 ajax.options = { 227 url: ajax.url, 228 data: ajax.submit, 229 beforeSerialize: function beforeSerialize(elementSettings, options) { 230 return ajax.beforeSerialize(elementSettings, options); 231 }, 232 beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { 233 ajax.ajaxing = true; 234 return ajax.beforeSubmit(formValues, elementSettings, options); 235 }, 236 beforeSend: function beforeSend(xmlhttprequest, options) { 237 ajax.ajaxing = true; 238 return ajax.beforeSend(xmlhttprequest, options); 239 }, 240 success: function success(response, status, xmlhttprequest) { 241 if (typeof response === 'string') { 242 response = $.parseJSON(response); 243 } 244 245 if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { 246 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 247 var customMessage = Drupal.t('The response failed verification so will not be processed.'); 248 return ajax.error(xmlhttprequest, ajax.url, customMessage); 249 } 250 } 251 252 return ajax.success(response, status); 253 }, 254 complete: function complete(xmlhttprequest, status) { 255 ajax.ajaxing = false; 256 if (status === 'error' || status === 'parsererror') { 257 return ajax.error(xmlhttprequest, ajax.url); 258 } 259 }, 260 261 dataType: 'json', 262 jsonp: false, 263 type: 'POST' 264 }; 265 266 if (elementSettings.dialog) { 267 ajax.options.data.dialogOptions = elementSettings.dialog; 268 } 269 270 if (ajax.options.url.indexOf('?') === -1) { 271 ajax.options.url += '?'; 272 } else { 273 ajax.options.url += '&'; 274 } 275 276 var wrapper = 'drupal_' + (elementSettings.dialogType || 'ajax'); 277 if (elementSettings.dialogRenderer) { 278 wrapper += '.' + elementSettings.dialogRenderer; 279 } 280 ajax.options.url += Drupal.ajax.WRAPPER_FORMAT + '=' + wrapper; 281 282 $(ajax.element).on(elementSettings.event, function (event) { 283 if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { 284 throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', { 285 '!url': ajax.url 286 })); 287 } 288 return ajax.eventResponse(this, event); 289 }); 290 291 if (elementSettings.keypress) { 292 $(ajax.element).on('keypress', function (event) { 293 return ajax.keypressResponse(this, event); 294 }); 295 } 296 297 if (elementSettings.prevent) { 298 $(ajax.element).on(elementSettings.prevent, false); 299 } 300 }; 301 302 Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; 303 304 Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; 305 306 Drupal.Ajax.prototype.execute = function () { 307 if (this.ajaxing) { 308 return; 309 } 310 311 try { 312 this.beforeSerialize(this.element, this.options); 313 314 return $.ajax(this.options); 315 } catch (e) { 316 this.ajaxing = false;
317 window.alert('An error occurred while attempting to process ' + this.options.url + ': ' + e.message); 318 319 return $.Deferred().reject(); 320 } 321 }; 322 323 Drupal.Ajax.prototype.keypressResponse = function (element, event) { 324 var ajax = this; 325 326 if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { 327 event.preventDefault(); 328 event.stopPropagation(); 329 $(element).trigger(ajax.elementSettings.event); 330 } 331 }; 332 333 Drupal.Ajax.prototype.eventResponse = function (element, event) { 334 event.preventDefault(); 335 event.stopPropagation(); 336 337 var ajax = this; 338 339 if (ajax.ajaxing) { 340 return; 341 } 342 343 try { 344 if (ajax.$form) { 345 if (ajax.setClick) { 346 element.form.clk = element; 347 } 348 349 ajax.$form.ajaxSubmit(ajax.options); 350 } else { 351 ajax.beforeSerialize(ajax.element, ajax.options); 352 $.ajax(ajax.options); 353 } 354 } catch (e) { 355 ajax.ajaxing = false; 356 window.alert('An error occurred while attempting to process ' + ajax.options.url + ': ' + e.message); 357 } 358 }; 359 360 Drupal.Ajax.prototype.beforeSerialize = function (element, options) { 361 if (this.$form && document.body.contains(this.$form.get(0))) { 362 var settings = this.settings || drupalSettings; 363 Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); 364 } 365 366 options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; 367 368 var pageState = drupalSettings.ajaxPageState; 369 options.data['ajax_page_state[theme]'] = pageState.theme; 370 options.data['ajax_page_state[theme_token]'] = pageState.theme_token; 371 options.data['ajax_page_state[libraries]'] = pageState.libraries; 372 }; 373 374 Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; 375 376 Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { 377 if (this.$form) { 378 options.extraData = options.extraData || {}; 379 380 options.extraData.ajax_iframe_upload = '1'; 381 382 var v = $.fieldValue(this.element); 383 if (v !== null) { 384 options.extraData[this.element.name] = v; 385 } 386 } 387 388 $(this.element).prop('disabled', true); 389 390 if (!this.progress || !this.progress.type) { 391 return; 392 } 393 394 var progressIndicatorMethod = 'setProgressIndicator' + this.progress.type.slice(0, 1).toUpperCase() + this.progress.type.slice(1).toLowerCase(); 395 if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { 396 this[progressIndicatorMethod].call(this); 397 } 398 }; 399 400 Drupal.theme.ajaxProgressThrobber = function (message) { 401 var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; 402 var throbber = '<div class="throbber"> </div>'; 403 404 return '<div class="ajax-progress ajax-progress-throbber">' + throbber + messageMarkup + '</div>'; 405 }; 406 407 Drupal.theme.ajaxProgressIndicatorFullscreen = function () { 408 return '<div class="ajax-progress ajax-progress-fullscreen"> </div>'; 409 }; 410 411 Drupal.theme.ajaxProgressMessage = function (message) { 412 return '<div class="message">' + message + '</div>'; 413 }; 414 415 Drupal.theme.ajaxProgressBar = function ($element) { 416 return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element); 417 }; 418 419 Drupal.Ajax.prototype.setProgressIndicatorBar = function () { 420 var progressBar = new Drupal.ProgressBar('ajax-progress-' + this.element.id, $.noop, this.progress.method, $.noop); 421 if (this.progress.message) { 422 progressBar.setProgress(-1, this.progress.message); 423 } 424 if (this.progress.url) { 425 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 426 } 427 this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); 428 this.progress.object = progressBar; 429 $(this.element).after(this.progress.element); 430 }; 431 432 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 433 this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); 434 $(this.element).after(this.progress.element); 435 }; 436 437 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 438 this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); 439 $('body').append(this.progress.element); 440 }; 441 442 Drupal.Ajax.prototype.success = function (response, status) { 443 var _this = this; 444 445 if (this.progress.element) { 446 $(this.progress.element).remove(); 447 } 448 if (this.progress.object) { 449 this.progress.object.stopMonitoring(); 450 } 451 $(this.element).prop('disabled', false); 452 453 var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); 454 455 var focusChanged = false;
456 Object.keys(response || {}).forEach(function (i) { 457 if (response[i].command && _this.commands[response[i].command]) { 458 _this.commands[response[i].command](_this, response[i], status); 459 if (response[i].command === 'invoke' && response[i].method === 'focus') { 460 focusChanged = true; 461 } 462 } 463 }); 464 465 if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) { 466 var target = false; 467 468 for (var n = elementParents.length - 1; !target && n >= 0; n--) { 469 target = document.querySelector('[data-drupal-selector="' + elementParents[n].getAttribute('data-drupal-selector') + '"]'); 470 } 471 472 if (target) { 473 $(target).trigger('focus'); 474 } 475 } 476 477 if (this.$form && document.body.contains(this.$form.get(0))) { 478 var settings = this.settings || drupalSettings; 479 Drupal.attachBehaviors(this.$form.get(0), settings); 480 } 481 482 this.settings = null; 483 }; 484 485 Drupal.Ajax.prototype.getEffect = function (response) { 486 var type = response.effect || this.effect; 487 var speed = response.speed || this.speed; 488 489 var effect = {}; 490 if (type === 'none') { 491 effect.showEffect = 'show'; 492 effect.hideEffect = 'hide'; 493 effect.showSpeed = ''; 494 } else if (type === 'fade') { 495 effect.showEffect = 'fadeIn'; 496 effect.hideEffect = 'fadeOut'; 497 effect.showSpeed = speed; 498 } else { 499 effect.showEffect = type + 'Toggle'; 500 effect.hideEffect = type + 'Toggle'; 501 effect.showSpeed = speed; 502 } 503 504 return effect; 505 }; 506 507 Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 508 if (this.progress.element) { 509 $(this.progress.element).remove(); 510 } 511 if (this.progress.object) { 512 this.progress.object.stopMonitoring(); 513 } 514 515 $(this.wrapper).show(); 516 517 $(this.element).prop('disabled', false); 518 519 if (this.$form && document.body.contains(this.$form.get(0))) { 520 var settings = this.settings || drupalSettings; 521 Drupal.attachBehaviors(this.$form.get(0), settings); 522 } 523 throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); 524 }; 525 526 Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { 527 return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { 528 return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); 529 }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; 530 }; 531 532 Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { 533 return $('<div></div>').append($elements); 534 }; 535 536 Drupal.AjaxCommands = function () {}; 537 Drupal.AjaxCommands.prototype = { 538 insert: function insert(ajax, response) { 539 var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 540 var method = response.method || ajax.method; 541 var effect = ajax.getEffect(response); 542 543 var settings = response.settings || ajax.settings || drupalSettings; 544 545 var $newContent = $($.parseHTML(response.data, document, true)); 546 547 $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); 548 549 switch (method) { 550 case 'html': 551 case 'replaceWith': 552 case 'replaceAll': 553 case 'empty': 554 case 'remove': 555 Drupal.detachBehaviors($wrapper.get(0), settings); 556 break; 557 default: 558 break; 559 } 560 561 $wrapper[method]($newContent); 562 563 if (effect.showEffect !== 'show') { 564 $newContent.hide(); 565 } 566 567 var $ajaxNewContent = $newContent.find('.ajax-new-content'); 568 if ($ajaxNewContent.length) { 569 $ajaxNewContent.hide(); 570 $newContent.show(); 571 $ajaxNewContent[effect.showEffect](effect.showSpeed); 572 } else if (effect.showEffect !== 'show') { 573 $newContent[effect.showEffect](effect.showSpeed); 574 } 575 576 if ($newContent.parents('html').length) { 577 $newContent.each(function (index, element) { 578 if (element.nodeType === Node.ELEMENT_NODE) { 579 Drupal.attachBehaviors(element, settings); 580 } 581 }); 582 } 583 }, 584 remove: function remove(ajax, response, status) { 585 var settings = response.settings || ajax.settings || drupalSettings; 586 $(response.selector).each(function () { 587 Drupal.detachBehaviors(this, settings); 588 }).remove(); 589 }, 590 changed: function changed(ajax, response, status) { 591 var $element = $(response.selector); 592 if (!$element.hasClass('ajax-changed')) { 593 $element.addClass('ajax-changed'); 594 if (response.asterisk) { 595 $element.find(response.asterisk).append(' <abbr class="ajax-changed" title="' + Drupal.t('Changed') + '">*</abbr> '); 596 } 597 } 598 }, 599 alert: function alert(ajax, response, status) { 600 window.alert(response.text, response.title); 601 }, 602 announce: function announce(ajax, response) { 603 if (response.priority) { 604 Drupal.announce(response.text, response.priority); 605 } else { 606 Drupal.announce(response.text); 607 } 608 }, 609 redirect: function redirect(ajax, response, status) { 610 window.location = response.url; 611 }, 612 css: function css(ajax, response, status) { 613 $(response.selector).css(response.argument); 614 }, 615 settings: function settings(ajax, response, status) { 616 var ajaxSettings = drupalSettings.ajax; 617 618 if (ajaxSettings) {
619 Drupal.ajax.expired().forEach(function (instance) { 620 621 if (instance.selector) { 622 var selector = instance.selector.replace('#', ''); 623 if (selector in ajaxSettings) { 624 delete ajaxSettings[selector]; 625 } 626 } 627 }); 628 } 629 630 if (response.merge) { 631 $.extend(true, drupalSettings, response.settings); 632 } else { 633 ajax.settings = response.settings; 634 } 635 }, 636 data: function data(ajax, response, status) { 637 $(response.selector).data(response.name, response.value); 638 }, 639 invoke: function invoke(ajax, response, status) { 640 var $element = $(response.selector); 641 $element[response.method].apply($element, _toConsumableArray(response.args)); 642 }, 643 restripe: function restripe(ajax, response, status) { 644 $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); 645 }, 646 update_build_id: function update_build_id(ajax, response, status) { 647 $('input[name="form_build_id"][value="' + response.old + '"]').val(response.new); 648 }, 649 add_css: function add_css(ajax, response, status) { 650 $('head').prepend(response.data); 651 }, 652 message: function message(ajax, response) { 653 var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); 654 if (response.clearPrevious) { 655 messages.clear(); 656 } 657 messages.add(response.message, response.messageOptions); 658 } 659 }; 660})(jQuery, window, Drupal, drupalSettings);;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.