1(function (Drupal, $) { 2 Drupal.behaviors.inheritPracticePlace = { 3 attach: function (context, settings) { 4 $('input[name$="[subform][field_start_date][value]"]').click(function() { 5 $('input[name$="[subform][field_start_date][value]"]').not(this).prop('checked', false); 6 }); 7 } 8 }; 9 10 Drupal.behaviors.setUserType = { 11 attach: function (context, settings) { 12 let searchParams = new URLSearchParams(window.location.search); 13 if(searchParams.has('field_type')) { 14 let value = searchParams.get('field_type') 15 if($('select[name="field_type"] option[value="' + value + '"]').length > 0) { 16 $('select[name="field_type"]').val(value); 17 } 18 } 19 } 20 }; 21 22 Drupal.behaviors.export_download = { 23 attach: function (context, settings) { 24 if (settings.download_file_url) { 25 window.location.assign(settings.download_file_url); 26 27 // Fix for export file double download when iporting employees after export is done. 28 delete settings.download_file_url; 29 } 30 } 31 }; 32 33} (Drupal, jQuery)); 34; 35/** 36 * @file 37 * Recaptcha v3 behaviors. 38 */ 39 40(function ($, Drupal) { 41 'use strict'; 42 43 function updateTokenElement(element) { 44 // Wait for grecaptcha to be loaded. 45 if (typeof grecaptcha === 'undefined') { 46 var timer = setInterval(function() { 47 if (typeof grecaptcha !== 'undefined' || !element) { 48 clearInterval(timer); 49 50 if (element) { 51 doUpdateTokenElement(element); 52 } 53 } 54 }, 500); 55 } 56 else { 57 doUpdateTokenElement(element); 58 } 59 } 60 61 function doUpdateTokenElement(element) { 62 grecaptcha.ready(function () { 63 if (!element) { 64 return; 65 } 66 67 var $element = $(element); 68 69 grecaptcha.execute( 70 $element.data('recaptchaV3SiteKey'), 71 { 72 action: $element.data('recaptchaV3Action') 73 } 74 ).then(function (token) { 75 $element.val(token); 76 $element.trigger('change'); 77 }); 78 }); 79 } 80 81 /** 82 * Attach recaptcha response token from google with form. 83 * 84 * @type {{attach: Drupal.behaviors.reCaptchaV3.attach}} 85 */ 86 Drupal.behaviors.reCaptchaV3 = { 87 attach: function (context) { 88 once('recaptcha-v3-token', '.recaptcha-v3-token', context).forEach(function (element) { 89 90 updateTokenElement(element); 91 92 // Update the recaptcha tokens every 90 seconds. 93 // This seems to be the most robust way to always have valid recaptcha 94 // tokens when you don't have control over how the forms are being 95 // submitted. For example normal form submits are synchronous while 96 // Google Recaptcha v3 is asynchonous. 97 // A recaptcha token has a maximum lifetime of 120 seconds. 98 // https://developers.google.com/recaptcha/docs/v3 99 var interval = setInterval(function () { 100 if (!element) { 101 clearInterval(interval); 102 } 103 else { 104 updateTokenElement(element); 105 } 106 }, 90000); 107 }); 108 } 109 }; 110 111})(jQuery, Drupal); 112; 113/*! 114 * jQuery Form Plugin 115 * version: 4.3.0 116 * Requires jQuery v1.7.2 or later 117 * Project repository: https://github.com/jquery-form/form 118 119 * Copyright 2017 Kevin Morris 120 * Copyright 2006 M. Alsup 121 122 * Dual licensed under the LGPL-2.1+ or MIT licenses 123 * https://github.com/jquery-form/form#license 124 125 * This library is free software; you can redistribute it and/or 126 * modify it under the terms of the GNU Lesser General Public 127 * License as published by the Free Software Foundation; either 128 * version 2.1 of the License, or (at your option) any later version. 129 * This library is distributed in the hope that it will be useful, 130 * but WITHOUT ANY WARRANTY; without even the implied warranty of 131 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 132 * Lesser General Public License for more details. 133 */ 134!function(r){"function"==typeof define&&define.amd?define(["jquery"],r):"object"==typeof module&&module.exports?module.exports=function(e,t){return void 0===t&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),r(t),t}:r(jQuery)}(function(q){"use strict";var m=/\r?\n/g,S={};S.fileapi=void 0!==q('<input type="file">').get(0).files,S.formdata=void 0!==window.FormData;var _=!!q.fn.prop;function o(e){var t=e.data;e.isDefaultPrevented()||(e.preventDefault(),q(e.target).closest("form").ajaxSubmit(t))}function i(e){var t=e.target,r=q(t);if(!r.is("[type=submit],[type=image]")){var a=r.closest("[type=submit]");if(0===a.length)return;t=a[0]}var n,o=t.form;"image"===(o.clk=t).type&&(void 0!==e.offsetX?(o.clk_x=e.offsetX,o.clk_y=e.offsetY):"function"==typeof q.fn.offset?(n=r.offset(),o.clk_x=e.pageX-n.left,o.clk_y=e.pageY-n.top):(o.clk_x=e.pageX-t.offsetLeft,o.clk_y=e.pageY-t.offsetTop)),setTimeout(function(){o.clk=o.clk_x=o.clk_y=null},100)}function N(){var e;q.fn.ajaxSubmit.debug&&(e="[jquery.form] "+Array.prototype.join.call(arguments,""),window.console&&window.console.log?window.console.log(e):window.opera&&window.opera.postError&&window.opera.postError(e))}q.fn.attr2=function(){if(!_)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},q.fn.ajaxSubmit=function(M,e,t,r){if(!this.length)return N("ajaxSubmit: ski
134pping submit process - no element selected"),this;var O,a,n,o,X=this;"function"==typeof M?M={success:M}:"string"==typeof M||!1===M&&0<arguments.length?(M={url:M,data:e,dataType:t},"function"==typeof r&&(M.success=r)):void 0===M&&(M={}),O=M.method||M.type||this.attr2("method"),n=(n=(n="string"==typeof(a=M.url||this.attr2("action"))?q.trim(a):"")||window.location.href||"")&&(n.match(/^([^#]+)/)||[])[1],o=/(MSIE|Trident)/.test(navigator.userAgent||"")&&/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",M=q.extend(!0,{url:n,success:q.ajaxSettings.success,type:O||q.ajaxSettings.type,iframeSrc:o},M);var i={};if(this.trigger("form-pre-serialize",[this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(M.beforeSerialize&&!1===M.beforeSerialize(this,M))return N("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var s=M.traditional;void 0===s&&(s=q.ajaxSettings.traditional);var u,c,C=[],l=this.formToArray(M.semantic,C,M.filtering);if(M.data&&(c=q.isFunction(M.data)?M.data(l):M.data,M.extraData=c,u=q.param(c,s)),M.beforeSubmit&&!1===M.beforeSubmit(l,this,M))return N("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[l,this,M,i]),i.veto)return N("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var f=q.param(l,s);u&&(f=f?f+"&"+u:u),"GET"===M.type.toUpperCase()?(M.url+=(0<=M.url.indexOf("?")?"&":"?")+f,M.data=null):M.data=f;var d,m,p,h=[];M.resetForm&&h.push(function(){X.resetForm()}),M.clearForm&&h.push(function(){X.clearForm(M.includeHidden)}),!M.dataType&&M.target?(d=M.success||function(){},h.push(function(e,t,r){var a=arguments,n=M.replaceTarget?"replaceWith":"html";q(M.target)[n](e).each(function(){d.apply(this,a)})})):M.success&&(q.isArray(M.success)?q.merge(h,M.success):h.push(M.success)),M.success=function(e,t,r){for(var a=M.context||this,n=0,o=h.length;n<o;n++)h[n].apply(a,[e,t,r||X,X])},M.error&&(m=M.error,M.error=function(e,t,r){var a=M.context||this;m.apply(a,[e,t,r,X])}),M.complete&&(p=M.complete,M.complete=function(e,t){var r=M.context||this;p.apply(r,[e,t,X])});var v=0<q("input[type=file]:enabled",this).filter(function(){return""!==q(this).val()}).length,g="multipart/form-data",x=X.attr("enctype")===g||X.attr("encoding")===g,y=S.fileapi&&S.formdata;N("fileAPI :"+y);var b,T=(v||x)&&!y;!1!==M.iframe&&(M.iframe||T)?M.closeKeepAlive?q.get(M.closeKeepAlive,function(){b=w(l)}):b=w(l):b=(v||x)&&y?function(e){for(var r=new FormData,t=0;t<e.length;t++)r.append(e[t].name,e[t].value);if(M.extraData){var a=function(e){var t,r,a=q.param(e,M.traditional).split("&"),n=a.length,o=[];for(t=0;t<n;t++)a[t]=a[t].replace(/\+/g," "),r=a[t].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}(M.extraData);for(t=0;t<a.length;t++)a[t]&&r.append(a[t][0],a[t][1])}M.data=null;var n=q.extend(!0,{},q.ajaxSettings,M,{contentType:!1,processData:!1,cache:!1,type:O||"POST"});M.uploadProgress&&(n.xhr=function(){var e=q.ajaxSettings.xhr();return e.upload&&e.upload.addEventListener("progress",function(e){var t=0,r=e.loaded||e.position,a=e.total;e.lengthComputable&&(t=Math.ceil(r/a*100)),M.uploadProgress(e,r,a,t)},!1),e});n.data=null;var o=n.beforeSend;return n.beforeSend=function(e,t){M.formData?t.data=M.formData:t.data=r,o&&o.call(this,e,t)},q.ajax(n)}(l):q.ajax(M),X.removeData("jqxhr").data("jqxhr",b);for(var j=0;j<C.length;j++)C[j]=null;return this.trigger("form-submit-notify",[this,M]),this;function w(e){var t,r,l,f,o,d,m,p,a,n,h,v,i=X[0],g=q.Deferred();if(g.abort=function(e){p.abort(e)},e)for(r=0;r<C.length;r++)t=q(C[r]),_?t.prop("disabled",!1):t.removeAttr("disabled");(l=q.extend(!0,{},q.ajaxSettings,M)).context=l.context||l,o="jqFormIO"+(new Date).getTime();var s=i.ownerDocument,u=X.closest("body");if(l.iframeTarget?(n=(d=q(l.iframeTarget,s)).attr2("name"))?o=n:d.attr2("name",o):(d=q('<iframe name="'+o+'" src="'+l.iframeSrc+'" />',s)).css({position:"absolute",top:"-1000px",left:"-1000px"}),m=d[0],p={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(e){var t="timeout"===e?"timeout":"aborted";N("aborting upload... "+t),this.aborted=1;try{m.contentWindow.document.execCommand&&m.contentWindow.document.execCommand("Stop")}catch(e){}d.attr("src",l.iframeSrc),p.error=t,l.error&&l.error.call(l.context,p,t,e),f&&q.event.trigger("ajaxError",[p,l,t]),l.complete&&l.complete.call(l.context,p,t)}},(f=l.global)&&0==q.active++&&q.event.trigger("ajaxStart"),f&&q.event.trigger("ajaxSend",[p,l]),l.beforeSend&&!1===l.beforeSend.c
vendor: 9,900 bytes, line 134
134all(l.context,p,l))return l.global&&q.active--,g.reject(),g;if(p.aborted)return g.reject(),g;(a=i.clk)&&(n=a.name)&&!a.disabled&&(l.extraData=l.extraData||{},l.extraData[n]=a.value,"image"===a.type&&(l.extraData[n+".x"]=i.clk_x,l.extraData[n+".y"]=i.clk_y));var x=1,y=2;function b(t){var r=null;try{t.contentWindow&&(r=t.contentWindow.document)}catch(e){N("cannot get iframe.contentWindow document: "+e)}if(r)return r;try{r=t.contentDocument?t.contentDocument:t.document}catch(e){N("cannot get iframe.contentDocument: "+e),r=t.document}return r}var c=q("meta[name=csrf-token]").attr("content"),T=q("meta[name=csrf-param]").attr("content");function j(){var e=X.attr2("target"),t=X.attr2("action"),r=X.attr("enctype")||X.attr("encoding")||"multipart/form-data";i.setAttribute("target",o),O&&!/post/i.test(O)||i.setAttribute("method","POST"),t!==l.url&&i.setAttribute("action",l.url),l.skipEncodingOverride||O&&!/post/i.test(O)||X.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),l.timeout&&(v=setTimeout(function(){h=!0,A(x)},l.timeout));var a=[];try{if(l.extraData)for(var n in l.extraData)l.extraData.hasOwnProperty(n)&&(q.isPlainObject(l.extraData[n])&&l.extraData[n].hasOwnProperty("name")&&l.extraData[n].hasOwnProperty("value")?a.push(q('<input type="hidden" name="'+l.extraData[n].name+'">',s).val(l.extraData[n].value).appendTo(i)[0]):a.push(q('<input type="hidden" name="'+n+'">',s).val(l.extraData[n]).appendTo(i)[0]));l.iframeTarget||d.appendTo(u),m.attachEvent?m.attachEvent("onload",A):m.addEventListener("load",A,!1),setTimeout(function e(){try{var t=b(m).readyState;N("state = "+t),t&&"uninitialized"===t.toLowerCase()&&setTimeout(e,50)}catch(e){N("Server abort: ",e," (",e.name,")"),A(y),v&&clearTimeout(v),v=void 0}},15);try{i.submit()}catch(e){document.createElement("form").submit.apply(i)}}finally{i.setAttribute("action",t),i.setAttribute("enctype",r),e?i.setAttribute("target",e):X.removeAttr("target"),q(a).remove()}}T&&c&&(l.extraData=l.extraData||{},l.extraData[T]=c),l.forceSync?j():setTimeout(j,10);var w,S,k,D=50;function A(e){if(!p.aborted&&!k){if((S=b(m))||(N("cannot access response document"),e=y),e===x&&p)return p.abort("timeout"),void g.reject(p,"timeout");if(e===y&&p)return p.abort("server abort"),void g.reject(p,"error","server abort");if(S&&S.location.href!==l.iframeSrc||h){m.detachEvent?m.detachEvent("onload",A):m.removeEventListener("load",A,!1);var t,r="success";try{if(h)throw"timeout";var a="xml"===l.dataType||S.XMLDocument||q.isXMLDoc(S);if(N("isXml="+a),!a&&window.opera&&(null===S.body||!S.body.innerHTML)&&--D)return N("requeing onLoad callback, DOM not available"),void setTimeout(A,250);var n=S.body?S.body:S.documentElement;p.responseText=n?n.innerHTML:null,p.responseXML=S.XMLDocument?S.XMLDocument:S,a&&(l.dataType="xml"),p.getResponseHeader=function(e){return{"content-type":l.dataType}[e.toLowerCase()]},n&&(p.status=Number(n.getAttribute("status"))||p.status,p.statusText=n.getAttribute("statusText")||p.statusText);var o,i,s,u=(l.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);c||l.textarea?(o=S.getElementsByTagName("textarea")[0])?(p.responseText=o.value,p.status=Number(o.getAttribute("status"))||p.status,p.statusText=o.getAttribute("statusText")||p.statusText):c&&(i=S.getElementsByTagName("pre")[0],s=S.getElementsByTagName("body")[0],i?p.responseText=i.textContent?i.textContent:i.innerText:s&&(p.responseText=s.textContent?s.textContent:s.innerText)):"xml"===u&&!p.responseXML&&p.responseText&&(p.responseXML=F(p.responseText));try{w=E(p,u,l)}catch(e){r="parsererror",p.error=t=e||r}}catch(e){N("error caught: ",e),r="error",p.error=t=e||r}p.aborted&&(N("upload aborted"),r=null),p.status&&(r=200<=p.status&&p.status<300||304===p.status?"success":"error"),"success"===r?(l.success&&l.success.call(l.context,w,"success",p),g.resolve(p.responseText,"success",p),f&&q.event.trigger("ajaxSuccess",[p,l])):r&&(void 0===t&&(t=p.statusText),l.error&&l.error.call(l.context,p,r,t),g.reject(p,"error",t),f&&q.event.trigger("ajaxError",[p,l,t])),f&&q.event.trigger("ajaxComplete",[p,l]),f&&!--q.active&&q.event.trigger("ajaxStop"),l.complete&&l.complete.call(l.context,p,r),k=!0,l.timeout&&clearTimeout(v),setTimeout(function(){l.iframeTarget?d.attr("src",l.iframeSrc):d.remove(),p.responseXML=null},100)}}}var F=q.parseXML||function(e,t){return window.ActiveXObject?((t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!==t.documentElement.nodeName?t:null},L=q.parseJSON||function(e){return window.eval("("+e+")")},E=function(e,t,r){var a=e.getResponseHeader("content-type")||"",n=("xml"===t||!t)&&0<=a.indexOf("xml"),o=n?e.responseXML:e.responseText;return n&&"parsererror"===o.documentElement.nodeName&&q.error&&q.error("parsererror"),r&&r.dataFilter&&(o=r.dataFilter(o,t)),"string"==typeof o&&(("json"===t||!t)&&0<=a.indexOf("json")?o=L(o):("script"===t||!t)&&0<=a.indexOf("javascript")&&q.globalEval(o)),o};return g}},q.fn.ajaxForm=function(e,t,r,a){if(("string"==typeof e||!1===e&&0<arguments.length)&&(e={url:e,data:t,dataType:r},"function"==typeof a&&(e.success=a)),(e=e||{}).delegation=e.delegation&&q.isFunction(q.fn.on),e.delegation||0!==this.length)return e.delegation?(q(document).off("submit.form-plugin",this.selector,o).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,e,o).on("click.form-plugin",this.selector,e,i),this):(e.beforeFormUnbind&&e.beforeFormUnbind(this,e),this.ajaxFormUnbind().on("submit.form-plugin",e,o).on("click.form-plugin",e,i));var n={s:this.selector,c:this.context};return!q.isReady&&n.s?(N("DOM not ready, queuing ajaxForm"),q(function(){q(n.s,n.c).ajaxForm(e)})):N("terminating; zero elements found by selector"+(q.isReady?"":" (DOM not ready)")),this},q.fn.ajaxFormUnbind=function(){return this.off("submit.form-plugin click.form-plugin")},q.fn.formToArray=function(e,t,r){var a=[];if(0===this.length)return a;var n,o,i,s,u,c,l,f,d,m,p=this[0],h=this.attr("id"),v=(v=e||void 0===p.elements?p.getElementsByTagName("*"):p.elements)&&q.makeArray(v);if(h&&(e||/(Edge|Trident)\//.test(navigator.userAgent))&&(n=q(':input[form="'+h+'"]').get()).length&&(v=(v||[]).concat(n)),!v||!v.length)return a;for(q.isFunction(r)&&(v=q.map(v,r)),o=0,c=v.length;o<c;o++)if((m=(u=v[o]).name)&&!u.disabled)if(e&&p.clk&&"image"===u.type)p.clk===u&&(a.push({name:m,value:q(u).val(),type:u.type}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y}));else if((s=q.fieldValue(u,!0))&&s.constructor===Array)for(t&&t.push(u),i=0,l=s.length;i<l;i++)a.push({name:m,value:s[i]});else if(S.fileapi&&"file"===u.type){t&&t.push(u);var g=u.files;if(g.length)for(i=0;i<g.length;i++)a.push({name:m,value:g[i],type:u.type});else a.push({name:m,value:"",type:u.type})}else null!=s&&(t&&t.push(u),a.push({name:m,value:s,type:u.type,required:u.required}));return e||!p.clk||(m=(d=(f=q(p.clk))[0]).name)&&!d.disabled&&"image"===d.type&&(a.push({name:m,value:f.val()}),a.push({name:m+".x",value:p.clk_x},{name:m+".y",value:p.clk_y})),a},q.fn.formSerialize=function(e){return q.param(this.formToArray(e))},q.fn.fieldSerialize=function(n){var o=[];return this.each(function(){var e=this.name;if(e){var t=q.fieldValue(this,n);if(t&&t.constructor===Array)for(var r=0,a=t.length;r<a;r++)o.push({name:e,value:t[r]});else null!=t&&o.push({name:this.name,value:t})}}),q.param(o)},q.fn.fieldValue=function(e){for(var t=[],r=0,a=this.length;r<a;r++){var n=this[r],o=q.fieldValue(n,e);null==o||o.constructor===Array&&!o.length||(o.constructor===Array?q.merge(t,o):t.push(o))}return t},q.fieldValue=function(e,t){var r=e.name,a=e.type,n=e.tagName.toLowerCase();if(void 0===t&&(t=!0),t&&(!r||e.disabled||"reset"===a||"button"===a||("checkbox"===a||"radio"===a)&&!e.checked||("submit"===a||"image"===a)&&e.form&&e.form.clk!==e||"select"===n&&-1===e.selectedIndex))return null;if("select"!==n)return q(e).val().replace(m,"\r\n");var o=e.selectedIndex;if(o<0)return null;for(var i=[],s=e.options,u="select-one"===a,c=u?o+1:s.length,l=u?o:0;l<c;l++){var f=s[l];if(f.selected&&!f.disabled){var d=(d=f.value)||(f.attributes&&f.attributes.value&&!f.attributes.value.specified?f.text:f.value);if(u)return d;i.push(d)}}return i},q.fn.clearForm=function(e){return this.each(function(){q("input,select,textarea",this).clearFields(e)})},q.fn.clearFields=q.fn.clearInputs=function(r){var a=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var e=this.type,t=this.tagName.toLowerCase();a.test(e)||"textarea"===t?this.value="":"checkbox"===e||"radio"===e?this.checked=!1:"select"===t?this.selectedIndex=-1:"file"===e?/MSIE/.test(navigator.userAgent)?q(this).replaceWith(q(this).clone(!0)):q(this).val(""):r&&(!0===r&&/hidden/.test(e)||"string"==typeof r&&q(this).is(r))&&(this.value="")})},q.fn.resetForm=function(){return this.each(function(){var t=q(this),e=this.tagName.toLowerCase();switch(e){case"input":this.checked=this.defaultChecked;case"textarea":return this.value=this.defaultValue,!0;case"option":case"optgroup":var r=t.parents("select");return r.length&&r[0].multiple?"option"===e?this.selected=this.defaultSelected:t.find("option").resetForm():r.resetForm(),!0;case"select":return t.find("option").each(function(e){if(this.selected=this.defaultSelected,this.defaultSelected&&!t[0].multiple)return t[0].selectedIndex=e,!1}),!0;case"label":var a=q(t.attr("for")),n=t.find("input,select,textarea");return a[0]&&n.unshift(a[0]),n.resetForm(),!0;case"form":return"function"!=typeof this.reset&&("object"!=typeof this.reset||this.reset.nodeType)||this.reset(),!0;default:return t.find("form,input,label,select,textarea").resetForm(),!0}})},q.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},q.fn.selected=function(r){return void 0===r&&(r=!0),this.each(function(){var e,t=this.t
134ype;"checkbox"===t||"radio"===t?this.checked=r:"option"===this.tagName.toLowerCase()&&(e=q(this).parent("select"),r&&e[0]&&"select-one"===e[0].type&&e.find("option").selected(!1),this.selected=r)})},q.fn.ajaxSubmit.debug=!1}); 135 136; 137/** 138* DO NOT EDIT THIS FILE. 139* See the following change record for more information, 140* https://www.drupal.org/node/2815083 141* @preserve 142**/ 143 144(function ($, Drupal) { 145 Drupal.theme.progressBar = function (id) { 146 return "<div id=\"".concat(id, "\" class=\"progress\" aria-live=\"polite\">") + '<div class="progress__label"> </div>' + '<div class="progress__track"><div class="progress__bar"></div></div>' + '<div class="progress__percentage"></div>' + '<div class="progress__description"> </div>' + '</div>'; 147 }; 148 149 Drupal.ProgressBar = function (id, updateCallback, method, errorCallback) { 150 this.id = id; 151 this.method = method || 'GET'; 152 this.updateCallback = updateCallback; 153 this.errorCallback = errorCallback; 154 this.element = $(Drupal.theme('progressBar', id)); 155 }; 156 157 $.extend(Drupal.ProgressBar.prototype, { 158 setProgress: function setProgress(percentage, message, label) { 159 if (percentage >= 0 && percentage <= 100) { 160 $(this.element).find('div.progress__bar').css('width', "".concat(percentage, "%")); 161 $(this.element).find('div.progress__percentage').html("".concat(percentage, "%")); 162 } 163 164 $('div.progress__description', this.element).html(message); 165 $('div.progress__label', this.element).html(label); 166 167 if (this.updateCallback) { 168 this.updateCallback(percentage, message, this); 169 } 170 }, 171 startMonitoring: function startMonitoring(uri, delay) { 172 this.delay = delay; 173 this.uri = uri; 174 this.sendPing(); 175 }, 176 stopMonitoring: function stopMonitoring() { 177 clearTimeout(this.timer); 178 this.uri = null; 179 }, 180 sendPing: function sendPing() { 181 if (this.timer) { 182 clearTimeout(this.timer); 183 } 184 185 if (this.uri) { 186 var pb = this; 187 var uri = this.uri; 188 189 if (uri.indexOf('?') === -1) { 190 uri += '?'; 191 } else { 192 uri += '&'; 193 } 194 195 uri += '_format=json'; 196 $.ajax({ 197 type: this.method, 198 url: uri, 199 data: '', 200 dataType: 'json', 201 success: function success(progress) { 202 if (progress.status === 0) { 203 pb.displayError(progress.data); 204 return; 205 } 206 207 pb.setProgress(progress.percentage, progress.message, progress.label); 208 pb.timer = setTimeout(function () { 209 pb.sendPing(); 210 }, pb.delay); 211 }, 212 error: function error(xmlhttp) { 213 var e = new Drupal.AjaxError(xmlhttp, pb.uri); 214 pb.displayError("<pre>".concat(e.message, "</pre>")); 215 } 216 }); 217 } 218 }, 219 displayError: function displayError(string) { 220 var error = $('<div class="messages messages--error"></div>').html(string); 221 $(this.element).before(error).hide(); 222 223 if (this.errorCallback) { 224 this.errorCallback(this); 225 } 226 } 227 }); 228})(jQuery, Drupal);; 229/** 230* DO NOT EDIT THIS FILE. 231* See the following change record for more information, 232* https://www.drupal.org/node/2815083 233* @preserve 234**/ 235 236function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } 237 238function _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."); } 239 240function _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); } 241 242function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } 243 244function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } 245 246function _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; } 247 248(function ($, window, Drupal, drupalSettings, _ref) { 249 var isFocusable = _ref.isFocusable, 250 tabbable = _ref.tabbable; 251 Drupal.behaviors.AJAX = { 252 attach: function attach(context, settings) { 253 function loadAjaxBehavior(base) { 254 var elementSettings = settings.ajax[base]; 255 256 if (typeof elementSettings.selector === 'undefined') { 257 elementSettings.selector = "#".concat(base); 258 } 259
260 once('drupal-ajax', $(elementSettings.selector)).forEach(function (el) { 261 elementSettings.element = el; 262 elementSettings.base = base; 263 Drupal.ajax(elementSettings); 264 }); 265 } 266 267 Object.keys(settings.ajax || {}).forEach(function (base) { 268 return loadAjaxBehavior(base); 269 }); 270 Drupal.ajax.bindAjaxLinks(document.body); 271 once('ajax', '.use-ajax-submit').forEach(function (el) { 272 var elementSettings = {}; 273 elementSettings.url = $(el.form).attr('action'); 274 elementSettings.setClick = true; 275 elementSettings.event = 'click'; 276 elementSettings.progress = { 277 type: 'throbber' 278 }; 279 elementSettings.base = el.id; 280 elementSettings.element = el; 281 Drupal.ajax(elementSettings); 282 }); 283 }, 284 detach: function detach(context, settings, trigger) { 285 if (trigger === 'unload') { 286 Drupal.ajax.expired().forEach(function (instance) { 287 Drupal.ajax.instances[instance.instanceIndex] = null; 288 }); 289 } 290 } 291 }; 292 293 Drupal.AjaxError = function (xmlhttp, uri, customMessage) { 294 var statusCode; 295 var statusText; 296 var responseText; 297 298 if (xmlhttp.status) { 299 statusCode = "\n".concat(Drupal.t('An AJAX HTTP error occurred.'), "\n").concat(Drupal.t('HTTP Result Code: !status', { 300 '!status': xmlhttp.status 301 })); 302 } else { 303 statusCode = "\n".concat(Drupal.t('An AJAX HTTP request terminated abnormally.')); 304 } 305 306 statusCode += "\n".concat(Drupal.t('Debugging information follows.')); 307 var pathText = "\n".concat(Drupal.t('Path: !uri', { 308 '!uri': uri 309 })); 310 statusText = ''; 311 312 try { 313 statusText = "\n".concat(Drupal.t('StatusText: !statusText', { 314 '!statusText': xmlhttp.statusText.trim() 315 })); 316 } catch (e) {} 317 318 responseText = ''; 319 320 try { 321 responseText = "\n".concat(Drupal.t('ResponseText: !responseText', { 322 '!responseText': xmlhttp.responseText.trim() 323 })); 324 } catch (e) {} 325 326 responseText = responseText.replace(/<("[^"]*"|'[^']*'|[^'">])*>/gi, ''); 327 responseText = responseText.replace(/[\n]+\s+/g, '\n'); 328 var readyStateText = xmlhttp.status === 0 ? "\n".concat(Drupal.t('ReadyState: !readyState', { 329 '!readyState': xmlhttp.readyState 330 })) : ''; 331 customMessage = customMessage ? "\n".concat(Drupal.t('CustomMessage: !customMessage', { 332 '!customMessage': customMessage 333 })) : ''; 334 this.message = statusCode + pathText + statusText + customMessage + responseText + readyStateText; 335 this.name = 'AjaxError'; 336 }; 337 338 Drupal.AjaxError.prototype = new Error(); 339 Drupal.AjaxError.prototype.constructor = Drupal.AjaxError; 340 341 Drupal.ajax = function (settings) { 342 if (arguments.length !== 1) { 343 throw new Error('Drupal.ajax() function must be called with one configuration object only'); 344 } 345 346 var base = settings.base || false; 347 var element = settings.element || false; 348 delete settings.base; 349 delete settings.element; 350 351 if (!settings.progress && !element) { 352 settings.progress = false; 353 } 354 355 var ajax = new Drupal.Ajax(base, element, settings); 356 ajax.instanceIndex = Drupal.ajax.instances.length; 357 Drupal.ajax.instances.push(ajax); 358 return ajax; 359 }; 360 361 Drupal.ajax.instances = []; 362 363 Drupal.ajax.expired = function () { 364 return Drupal.ajax.instances.filter(function (instance) { 365 return instance && instance.element !== false && !document.body.contains(instance.element); 366 }); 367 }; 368 369 Drupal.ajax.bindAjaxLinks = function (element) { 370 once('ajax', '.use-ajax', element).forEach(function (ajaxLink) { 371 var $linkElement = $(ajaxLink); 372 var elementSettings = { 373 progress: { 374 type: 'throbber' 375 }, 376 dialogType: $linkElement.data('dialog-type'), 377 dialog: $linkElement.data('dialog-options'), 378 dialogRenderer: $linkElement.data('dialog-renderer'), 379 base: $linkElement.attr('id'), 380 element: ajaxLink 381 }; 382 var href = $linkElement.attr('href'); 383 384 if (href) { 385 elementSettings.url = href; 386 elementSettings.event = 'click'; 387 } 388 389 Drupal.ajax(elementSettings); 390 }); 391 }; 392 393 Drupal.Ajax = function (base, element, elementSettings) { 394 var defaults = { 395 event: element ? 'mousedown' : null, 396 keypress: true,
397 selector: base ? "#".concat(base) : null, 398 effect: 'none', 399 speed: 'none', 400 method: 'replaceWith', 401 progress: { 402 type: 'throbber', 403 message: Drupal.t('Please wait...') 404 }, 405 submit: { 406 js: true 407 } 408 }; 409 $.extend(this, defaults, elementSettings); 410 this.commands = new Drupal.AjaxCommands(); 411 this.instanceIndex = false; 412 413 if (this.wrapper) { 414 this.wrapper = "#".concat(this.wrapper); 415 } 416 417 this.element = element; 418 this.element_settings = elementSettings; 419 this.elementSettings = elementSettings; 420 421 if (this.element && this.element.form) { 422 this.$form = $(this.element.form); 423 } 424 425 if (!this.url) { 426 var $element = $(this.element); 427 428 if ($element.is('a')) { 429 this.url = $element.attr('href'); 430 } else if (this.element && element.form) { 431 this.url = this.$form.attr('action'); 432 } 433 } 434 435 var originalUrl = this.url; 436 this.url = this.url.replace(/\/nojs(\/|$|\?|#)/, '/ajax$1'); 437 438 if (drupalSettings.ajaxTrustedUrl[originalUrl]) { 439 drupalSettings.ajaxTrustedUrl[this.url] = true; 440 } 441 442 var ajax = this; 443 ajax.options = { 444 url: ajax.url, 445 data: ajax.submit, 446 beforeSerialize: function beforeSerialize(elementSettings, options) { 447 return ajax.beforeSerialize(elementSettings, options); 448 }, 449 beforeSubmit: function beforeSubmit(formValues, elementSettings, options) { 450 ajax.ajaxing = true; 451 return ajax.beforeSubmit(formValues, elementSettings, options); 452 }, 453 beforeSend: function beforeSend(xmlhttprequest, options) { 454 ajax.ajaxing = true; 455 return ajax.beforeSend(xmlhttprequest, options); 456 }, 457 success: function success(response, status, xmlhttprequest) { 458 if (typeof response === 'string') { 459 response = $.parseJSON(response); 460 } 461 462 if (response !== null && !drupalSettings.ajaxTrustedUrl[ajax.url]) { 463 if (xmlhttprequest.getResponseHeader('X-Drupal-Ajax-Token') !== '1') { 464 var customMessage = Drupal.t('The response failed verification so will not be processed.'); 465 return ajax.error(xmlhttprequest, ajax.url, customMessage); 466 } 467 } 468 469 return ajax.success(response, status); 470 }, 471 complete: function complete(xmlhttprequest, status) { 472 ajax.ajaxing = false; 473 474 if (status === 'error' || status === 'parsererror') { 475 return ajax.error(xmlhttprequest, ajax.url); 476 } 477 }, 478 dataType: 'json', 479 jsonp: false, 480 type: 'POST' 481 }; 482 483 if (elementSettings.dialog) { 484 ajax.options.data.dialogOptions = elementSettings.dialog; 485 } 486 487 if (ajax.options.url.indexOf('?') === -1) { 488 ajax.options.url += '?'; 489 } else { 490 ajax.options.url += '&'; 491 } 492 493 var wrapper = "drupal_".concat(elementSettings.dialogType || 'ajax'); 494 495 if (elementSettings.dialogRenderer) { 496 wrapper += ".".concat(elementSettings.dialogRenderer); 497 } 498 499 ajax.options.url += "".concat(Drupal.ajax.WRAPPER_FORMAT, "=").concat(wrapper); 500 $(ajax.element).on(elementSettings.event, function (event) { 501 if (!drupalSettings.ajaxTrustedUrl[ajax.url] && !Drupal.url.isLocal(ajax.url)) { 502 throw new Error(Drupal.t('The callback URL is not local and not trusted: !url', { 503 '!url': ajax.url 504 })); 505 } 506 507 return ajax.eventResponse(this, event); 508 }); 509 510 if (elementSettings.keypress) { 511 $(ajax.element).on('keypress', function (event) { 512 return ajax.keypressResponse(this, event); 513 }); 514 } 515 516 if (elementSettings.prevent) { 517 $(ajax.element).on(elementSettings.prevent, false); 518 } 519 }; 520 521 Drupal.ajax.WRAPPER_FORMAT = '_wrapper_format'; 522 Drupal.Ajax.AJAX_REQUEST_PARAMETER = '_drupal_ajax'; 523 524 Drupal.Ajax.prototype.execute = function () { 525 if (this.ajaxing) { 526 return; 527 } 528 529 try { 530 this.beforeSerialize(this.element, this.options); 531 return $.ajax(this.options); 532 } catch (e) { 533 this.ajaxing = false; 534 window.alert("An error occurred while attempting to process ".concat(this.options.url, ": ").concat(e.message)); 535 return $.Deferred().reject(); 536 } 537 }; 538 539 Drupal.Ajax.prototype.keypressResponse = function (element, event) { 540 var ajax = this; 541 542 if (event.which === 13 || event.which === 32 && element.type !== 'text' && element.type !== 'textarea' && element.type !== 'tel' && element.type !== 'number') { 543 event.preventDefault(); 544 event.stopPropagation(); 545 $(element).trigger(ajax.elementSettings.event); 546 } 547 }; 548 549 Drupal.Ajax.prototype.eventResponse = function (element, event) { 550 event.preventDefault(); 551 event.stopPropagation(); 552 var ajax = this; 553 554 if (ajax.ajaxing) { 555 return; 556 } 557 558 try { 559 if (ajax.$form) { 560 if (ajax.setClick) { 561 element.form.clk = element; 562 } 563 564 ajax.$form.ajaxSubmit(ajax.options); 565 } else { 566 ajax.beforeSerialize(ajax.element, ajax.options); 567 $.ajax(ajax.options); 568 } 569 } catch (e) { 570 ajax.ajaxing = false;
571 window.alert("An error occurred while attempting to process ".concat(ajax.options.url, ": ").concat(e.message)); 572 } 573 }; 574 575 Drupal.Ajax.prototype.beforeSerialize = function (element, options) { 576 if (this.$form && document.body.contains(this.$form.get(0))) { 577 var settings = this.settings || drupalSettings; 578 Drupal.detachBehaviors(this.$form.get(0), settings, 'serialize'); 579 } 580 581 options.data[Drupal.Ajax.AJAX_REQUEST_PARAMETER] = 1; 582 var pageState = drupalSettings.ajaxPageState; 583 options.data['ajax_page_state[theme]'] = pageState.theme; 584 options.data['ajax_page_state[theme_token]'] = pageState.theme_token; 585 options.data['ajax_page_state[libraries]'] = pageState.libraries; 586 }; 587 588 Drupal.Ajax.prototype.beforeSubmit = function (formValues, element, options) {}; 589 590 Drupal.Ajax.prototype.beforeSend = function (xmlhttprequest, options) { 591 if (this.$form) { 592 options.extraData = options.extraData || {}; 593 options.extraData.ajax_iframe_upload = '1'; 594 var v = $.fieldValue(this.element); 595 596 if (v !== null) { 597 options.extraData[this.element.name] = v; 598 } 599 } 600 601 $(this.element).prop('disabled', true); 602 603 if (!this.progress || !this.progress.type) { 604 return; 605 } 606 607 var progressIndicatorMethod = "setProgressIndicator".concat(this.progress.type.slice(0, 1).toUpperCase()).concat(this.progress.type.slice(1).toLowerCase()); 608 609 if (progressIndicatorMethod in this && typeof this[progressIndicatorMethod] === 'function') { 610 this[progressIndicatorMethod].call(this); 611 } 612 }; 613 614 Drupal.theme.ajaxProgressThrobber = function (message) { 615 var messageMarkup = typeof message === 'string' ? Drupal.theme('ajaxProgressMessage', message) : ''; 616 var throbber = '<div class="throbber"> </div>'; 617 return "<div class=\"ajax-progress ajax-progress-throbber\">".concat(throbber).concat(messageMarkup, "</div>"); 618 }; 619 620 Drupal.theme.ajaxProgressIndicatorFullscreen = function () { 621 return '<div class="ajax-progress ajax-progress-fullscreen"> </div>'; 622 }; 623 624 Drupal.theme.ajaxProgressMessage = function (message) { 625 return "<div class=\"message\">".concat(message, "</div>"); 626 }; 627 628 Drupal.theme.ajaxProgressBar = function ($element) { 629 return $('<div class="ajax-progress ajax-progress-bar"></div>').append($element); 630 }; 631 632 Drupal.Ajax.prototype.setProgressIndicatorBar = function () { 633 var progressBar = new Drupal.ProgressBar("ajax-progress-".concat(this.element.id), $.noop, this.progress.method, $.noop); 634 635 if (this.progress.message) { 636 progressBar.setProgress(-1, this.progress.message); 637 } 638 639 if (this.progress.url) { 640 progressBar.startMonitoring(this.progress.url, this.progress.interval || 1500); 641 } 642 643 this.progress.element = $(Drupal.theme('ajaxProgressBar', progressBar.element)); 644 this.progress.object = progressBar; 645 $(this.element).after(this.progress.element); 646 }; 647 648 Drupal.Ajax.prototype.setProgressIndicatorThrobber = function () { 649 this.progress.element = $(Drupal.theme('ajaxProgressThrobber', this.progress.message)); 650 $(this.element).after(this.progress.element); 651 }; 652 653 Drupal.Ajax.prototype.setProgressIndicatorFullscreen = function () { 654 this.progress.element = $(Drupal.theme('ajaxProgressIndicatorFullscreen')); 655 $('body').append(this.progress.element); 656 }; 657 658 Drupal.Ajax.prototype.success = function (response, status) { 659 var _this = this; 660 661 if (this.progress.element) { 662 $(this.progress.element).remove(); 663 } 664 665 if (this.progress.object) { 666 this.progress.object.stopMonitoring(); 667 } 668 669 $(this.element).prop('disabled', false); 670 var elementParents = $(this.element).parents('[data-drupal-selector]').addBack().toArray(); 671 var focusChanged = false; 672 Object.keys(response || {}).forEach(function (i) { 673 if (response[i].command && _this.commands[response[i].command]) { 674 _this.commands[response[i].command](_this, response[i], status); 675 676 if (response[i].command === 'invoke' && response[i].method === 'focus' || response[i].command === 'focusFirst') { 677 focusChanged = true; 678 } 679 } 680 }); 681 682 if (!focusChanged && this.element && !$(this.element).data('disable-refocus')) { 683 var target = false;
684 685 for (var n = elementParents.length - 1; !target && n >= 0; n--) { 686 target = document.querySelector("[data-drupal-selector=\"".concat(elementParents[n].getAttribute('data-drupal-selector'), "\"]")); 687 } 688 689 if (target) { 690 $(target).trigger('focus'); 691 } 692 } 693 694 if (this.$form && document.body.contains(this.$form.get(0))) { 695 var settings = this.settings || drupalSettings; 696 Drupal.attachBehaviors(this.$form.get(0), settings); 697 } 698 699 this.settings = null; 700 }; 701 702 Drupal.Ajax.prototype.getEffect = function (response) { 703 var type = response.effect || this.effect; 704 var speed = response.speed || this.speed; 705 var effect = {}; 706 707 if (type === 'none') { 708 effect.showEffect = 'show'; 709 effect.hideEffect = 'hide'; 710 effect.showSpeed = ''; 711 } else if (type === 'fade') { 712 effect.showEffect = 'fadeIn'; 713 effect.hideEffect = 'fadeOut'; 714 effect.showSpeed = speed; 715 } else { 716 effect.showEffect = "".concat(type, "Toggle"); 717 effect.hideEffect = "".concat(type, "Toggle"); 718 effect.showSpeed = speed; 719 } 720 721 return effect; 722 }; 723 724 Drupal.Ajax.prototype.error = function (xmlhttprequest, uri, customMessage) { 725 if (this.progress.element) { 726 $(this.progress.element).remove(); 727 } 728 729 if (this.progress.object) { 730 this.progress.object.stopMonitoring(); 731 } 732 733 $(this.wrapper).show(); 734 $(this.element).prop('disabled', false); 735 736 if (this.$form && document.body.contains(this.$form.get(0))) { 737 var settings = this.settings || drupalSettings; 738 Drupal.attachBehaviors(this.$form.get(0), settings); 739 } 740 741 throw new Drupal.AjaxError(xmlhttprequest, uri, customMessage); 742 }; 743 744 Drupal.theme.ajaxWrapperNewContent = function ($newContent, ajax, response) { 745 return (response.effect || ajax.effect) !== 'none' && $newContent.filter(function (i) { 746 return !($newContent[i].nodeName === '#comment' || $newContent[i].nodeName === '#text' && /^(\s|\n|\r)*$/.test($newContent[i].textContent)); 747 }).length > 1 ? Drupal.theme('ajaxWrapperMultipleRootElements', $newContent) : $newContent; 748 }; 749 750 Drupal.theme.ajaxWrapperMultipleRootElements = function ($elements) { 751 return $('<div></div>').append($elements); 752 }; 753 754 Drupal.AjaxCommands = function () {}; 755 756 Drupal.AjaxCommands.prototype = { 757 insert: function insert(ajax, response) { 758 var $wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); 759 var method = response.method || ajax.method; 760 var effect = ajax.getEffect(response); 761 var settings = response.settings || ajax.settings || drupalSettings; 762 var $newContent = $($.parseHTML(response.data, document, true)); 763 $newContent = Drupal.theme('ajaxWrapperNewContent', $newContent, ajax, response); 764 765 switch (method) { 766 case 'html': 767 case 'replaceWith': 768 case 'replaceAll': 769 case 'empty': 770 case 'remove': 771 Drupal.detachBehaviors($wrapper.get(0), settings); 772 break; 773 774 default: 775 break; 776 } 777 778 $wrapper[method]($newContent); 779 780 if (effect.showEffect !== 'show') { 781 $newContent.hide(); 782 } 783 784 var $ajaxNewContent = $newContent.find('.ajax-new-content'); 785 786 if ($ajaxNewContent.length) { 787 $ajaxNewContent.hide(); 788 $newContent.show(); 789 $ajaxNewContent[effect.showEffect](effect.showSpeed); 790 } else if (effect.showEffect !== 'show') { 791 $newContent[effect.showEffect](effect.showSpeed); 792 } 793 794 if ($newContent.parents('html').length) { 795 $newContent.each(function (index, element) { 796 if (element.nodeType === Node.ELEMENT_NODE) { 797 Drupal.attachBehaviors(element, settings); 798 } 799 }); 800 } 801 }, 802 remove: function remove(ajax, response, status) { 803 var settings = response.settings || ajax.settings || drupalSettings; 804 $(response.selector).each(function () { 805 Drupal.detachBehaviors(this, settings); 806 }).remove(); 807 }, 808 changed: function changed(ajax, response, status) { 809 var $element = $(response.selector); 810 811 if (!$element.hasClass('ajax-changed')) { 812 $element.addClass('ajax-changed'); 813 814 if (response.asterisk) { 815 $element.find(response.asterisk).append(" <abbr class=\"ajax-changed\" title=\"".concat(Drupal.t('Changed'), "\">*</abbr> ")); 816 } 817 } 818 }, 819 alert: function alert(ajax, response, status) { 820 window.alert(response.text); 821 }, 822 announce: function announce(ajax, response) { 823 if (response.priority) { 824 Drupal.announce(response.text, response.priority); 825 } else { 826 Drupal.announce(response.text); 827 } 828 }, 829 redirect: function redirect(ajax, response, status) { 830 window.location = response.url; 831 }, 832 css: function css(ajax, response, status) { 833 $(response.selector).css(response.argument); 834 }, 835 settings: function settings(ajax, response, status) { 836 var ajaxSettings = drupalSettings.ajax; 837 838 if (ajaxSettings) {
839 Drupal.ajax.expired().forEach(function (instance) { 840 if (instance.selector) { 841 var selector = instance.selector.replace('#', ''); 842 843 if (selector in ajaxSettings) { 844 delete ajaxSettings[selector]; 845 } 846 } 847 }); 848 } 849 850 if (response.merge) { 851 $.extend(true, drupalSettings, response.settings); 852 } else { 853 ajax.settings = response.settings; 854 } 855 }, 856 data: function data(ajax, response, status) { 857 $(response.selector).data(response.name, response.value); 858 }, 859 focusFirst: function focusFirst(ajax, response, status) { 860 var focusChanged = false; 861 var container = document.querySelector(response.selector); 862 863 if (container) { 864 var tabbableElements = tabbable(container); 865 866 if (tabbableElements.length) { 867 tabbableElements[0].focus(); 868 focusChanged = true; 869 } else if (isFocusable(container)) { 870 container.focus(); 871 focusChanged = true; 872 } 873 } 874 875 if (ajax.hasOwnProperty('element') && !focusChanged) { 876 ajax.element.focus(); 877 } 878 }, 879 invoke: function invoke(ajax, response, status) { 880 var $element = $(response.selector); 881 $element[response.method].apply($element, _toConsumableArray(response.args)); 882 }, 883 restripe: function restripe(ajax, response, status) { 884 $(response.selector).find('> tbody > tr:visible, > tr:visible').removeClass('odd even').filter(':even').addClass('odd').end().filter(':odd').addClass('even'); 885 }, 886 update_build_id: function update_build_id(ajax, response, status) { 887 $("input[name=\"form_build_id\"][value=\"".concat(response.old, "\"]")).val(response.new); 888 }, 889 add_css: function add_css(ajax, response, status) { 890 $('head').prepend(response.data); 891 }, 892 message: function message(ajax, response) { 893 var messages = new Drupal.Message(document.querySelector(response.messageWrapperQuerySelector)); 894 895 if (response.clearPrevious) { 896 messages.clear(); 897 } 898 899 messages.add(response.message, response.messageOptions); 900 } 901 }; 902})(jQuery, window, Drupal, drupalSettings, window.tabbable);; 903/** 904 * @file 905 * better_exposed_filters.js 906 * 907 * Provides some client-side functionality for the Better Exposed Filters module. 908 */ 909 910(function ($, Drupal, drupalSettings) { 911 Drupal.behaviors.betterExposedFilters = { 912 attach: function (context, settings) { 913 // Add highlight class to checked checkboxes for better theming. 914 $('.bef-tree input[type=checkbox], .bef-checkboxes input[type=checkbox]') 915 // Highlight newly selected checkboxes. 916 .change(function () { 917 _bef_highlight(this, context); 918 }) 919 .filter(':checked').closest('.form-item', context).addClass('highlight'); 920 } 921 }; 922 923 /* 924 * Helper functions 925 */ 926 927 /** 928 * Adds/Removes the highlight class from the form-item div as appropriate. 929 */ 930 function _bef_highlight(elem, context) { 931 $elem = $(elem, context); 932 $elem.attr('checked') 933 ? $elem.closest('.form-item', context).addClass('highlight') 934 : $elem.closest('.form-item', context).removeClass('highlight'); 935 } 936 937})(jQuery, Drupal, drupalSettings); 938; 939/** 940 * @file 941 * Dropdown language selector js. 942 */ 943 944(function ($, Drupal) { 945 'use strict'; 946 947 Drupal.behaviors.dropdownLanguagesSelector = { 948 attach: function (context, settings) { 949 $('.dropdown-language-item .active-language', context).once('dropdown-language-selector') 950 .click(function (e) { 951 var $wrapper = $(this).closest('.dropbutton-wrapper'); 952 if ($wrapper.length > 0) { 953 e.preventDefault(); 954 e.stopPropagation(); 955 $wrapper.toggleClass('open'); 956 } 957 }); 958 } 959 }; 960 961})(jQuery, Drupal); 962; 963/** 964* DO NOT EDIT THIS FILE. 965* See the following change record for more information, 966* https://www.drupal.org/node/2815083 967* @preserve 968**/ 969 970(function ($, Drupal) { 971 function DropButton(dropbutton, settings) { 972 var options = $.extend({ 973 title: Drupal.t('List additional actions') 974 }, settings); 975 var $dropbutton = $(dropbutton); 976 this.$dropbutton = $dropbutton; 977 this.$list = $dropbutton.find('.dropbutton'); 978 this.$actions = this.$list.find('li').addClass('dropbutton-action'); 979 980 if (this.$actions.length > 1) { 981 var $primary = this.$actions.slice(0, 1); 982 var $secondary = this.$actions.slice(1); 983 $secondary.addClass('secondary-action'); 984 $primary.after(Drupal.theme('dropbuttonToggle', options)); 985 this.$dropbutton.addClass('dropbutton-multiple').on({ 986 'mouseleave.dropbutton': $.proxy(this.hoverOut, this), 987 'mouseenter.dropbutton': $.proxy(this.hoverIn, this),
988 'focusout.dropbutton': $.proxy(this.focusOut, this), 989 'focusin.dropbutton': $.proxy(this.focusIn, this) 990 }); 991 } else { 992 this.$dropbutton.addClass('dropbutton-single'); 993 } 994 } 995 996 function dropbuttonClickHandler(e) { 997 e.preventDefault(); 998 $(e.target).closest('.dropbutton-wrapper').toggleClass('open'); 999 } 1000 1001 Drupal.behaviors.dropButton = { 1002 attach: function attach(context, settings) { 1003 var dropbuttons = once('dropbutton', '.dropbutton-wrapper', context); 1004 1005 if (dropbuttons.length) { 1006 var body = once('dropbutton-click', 'body'); 1007 1008 if (body.length) { 1009 $(body).on('click', '.dropbutton-toggle', dropbuttonClickHandler); 1010 } 1011 1012 dropbuttons.forEach(function (dropbutton) { 1013 DropButton.dropbuttons.push(new DropButton(dropbutton, settings.dropbutton)); 1014 }); 1015 } 1016 } 1017 }; 1018 $.extend(DropButton, { 1019 dropbuttons: [] 1020 }); 1021 $.extend(DropButton.prototype, { 1022 toggle: function toggle(show) { 1023 var isBool = typeof show === 'boolean'; 1024 show = isBool ? show : !this.$dropbutton.hasClass('open'); 1025 this.$dropbutton.toggleClass('open', show); 1026 }, 1027 hoverIn: function hoverIn() { 1028 if (this.timerID) { 1029 window.clearTimeout(this.timerID); 1030 } 1031 }, 1032 hoverOut: function hoverOut() { 1033 this.timerID = window.setTimeout($.proxy(this, 'close'), 500); 1034 }, 1035 open: function open() { 1036 this.toggle(true); 1037 }, 1038 close: function close() { 1039 this.toggle(false); 1040 }, 1041 focusOut: function focusOut(e) { 1042 this.hoverOut.call(this, e); 1043 }, 1044 focusIn: function focusIn(e) { 1045 this.hoverIn.call(this, e); 1046 } 1047 }); 1048 $.extend(Drupal.theme, { 1049 dropbuttonToggle: function dropbuttonToggle(options) { 1050 return "<li class=\"dropbutton-toggle\"><button type=\"button\"><span class=\"dropbutton-arrow\"><span class=\"visually-hidden\">".concat(options.title, "</span></span></button></li>"); 1051 } 1052 }); 1053 Drupal.DropButton = DropButton; 1054})(jQuery, Drupal);;
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.