1 line
5.2 KiB
JavaScript
1 line
5.2 KiB
JavaScript
|
(()=>{"use strict";var e,t={8238:(e,t,o)=>{var r=o(5311),n=o.n(r),a=o(6024);const i={browse(e,t){n()(".link-types a",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("[data-locale-selector-link]",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),e.ajaxifyForm(n()("form.search-form",e.body));const o=n()("form.search-form",e.body).attr("action"),r=n()(".page-results",e.body).html();let a;function i(){const t=n()("#id_q",e.body).val();return""!==t?a=n().ajax({url:o,data:{q:t},success(t){a=null,n()(".page-results",e.body).html(t),s()},error(){a=null}}):(n()(".page-results",e.body).html(r),c()),!1}function s(){n()(".page-results a.choose-page",e.body).on("click",(function(){const t=n()(this).data();return e.respond("pageChosen",t),e.close(),!1})),n()('.page-results a.navigate-pages, .page-results [data-w-breadcrumbs-target~="content"] a',e.body).on("click",(function(){return n()(".page-results",e.body).load(this.href,s),!1})),n()(".page-results a.navigate-parent",e.body).on("click",(function(){return e.loadUrl(this.href),!1}))}function l(){n()("[data-multiple-choice-select]:checked",e.body).length?n()("[data-multiple-choice-submit]",e.body).removeAttr("disabled"):n()("[data-multiple-choice-submit]",e.body).attr("disabled",!0)}function c(){n()('.page-results a.navigate-pages, .page-results [data-w-breadcrumbs-target~="content"] a',e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("a.choose-page",e.body).on("click",(function(){const o=n()(this).data();return o.parentId=t.parent_page_id,e.respond("pageChosen",o),e.close(),!1})),n()("[data-locale-selector-link]",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),l(),n()("[data-multiple-choice-select]",e.body).on("change",(()=>{l()}))}e.ajaxifyForm(n()("form[data-multiple-choice-form]",e.body)),n()("#id_q",e.body).on("input",(function(){a&&a.abort(),clearTimeout(n().data(this,"timer"));const e=setTimeout(i,200);n()(this).data("timer",e)})),c(),n()("#id_q",e.body).trigger("focus")},anchor_link(e){n()("p.link-types a",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("form",e.body).on("submit",(function(){return e.postForm(this.action,n()(this).serialize()),!1}))},email_link(e){n()("p.link-types a",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("form",e.body).on("submit",(function(){return e.postForm(this.action,n()(this).serialize()),!1}))},phone_link(e){n()("p.link-types a",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("form",e.body).on("submit",(function(){return e.postForm(this.action,n()(this).serialize()),!1}))},external_link(e){n()("p.link-types a",e.body).on("click",(function(){return e.loadUrl(this.href),!1})),n()("form",e.body).on("submit",(function(){return e.postForm(this.action,n()(this).serialize()),!1}))},external_link_chosen(e,t){e.respond("pageChosen",t.result),e.close()},page_chosen(e,t){e.respond("pageChosen",t.result),e.close()},confirm_external_to_internal(e,t){n()("[data-action-confirm]",e.body).on("click",(function(){return e.respond("pageChosen",t.internal),e.close(),!1})),n()("[data-action-deny]",e.body).on("click",(function(){return e.respond("pageChosen",t.external),e.close(),!1}))}};window.PAGE_CHOOSER_MODAL_ONLOAD_HANDLERS=i;class s extends a.sf{onloadHandlers=i;chosenResponseName="pageChosen";getURL(e){let t=super.getURL();return e.parentId&&(t+=e.parentId+"/"),t}getURLParams(e){const t=super.getURLParams(e);return t.page_type=e.modelNames.join(","),e.targetPages&&(t.target_pages=e.targetPages),e.matchSubclass&&(t.match_subclass=e.matchSubclass),e.canChooseRoot&&(t.can_choose_root="true"),e.userPerms&&(t.user_perms=e.userPerms),t}}window.PageChooserModal=s},5311:e=>{e.exports=jQuery}},o={};function r(e){var n=o[e];if(void 0!==n)return n.exports;var a=o[e]={id:e,loaded:!1,exports:{}};return t[e].call(a.exports,a,a.exports,r),a.loaded=!0,a.exports}r.m=t,e=[],r.O=(t,o,n,a)=>{if(!o){var i=1/0;for(u=0;u<e.length;u++){for(var[o,n,a]=e[u],s=!0,l=0;l<o.length;l++)(!1&a||i>=a)&&Object.keys(r.O).every((e=>r.O[e](o[l])))?o.splice(l--
|