TYPO3 v15 dev-main snapshot ()
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import r from"@typo3/core/document-service.js";import o from"@typo3/backend/form-engine.js";class n{constructor(e){this.controlElement=null,this.registerClickHandler=t=>{t.preventDefault(),o.preventFollowLinkIfNotSaved(this.controlElement.getAttribute("href"))},r.ready().then(()=>{this.controlElement=document.querySelector(e),this.controlElement.addEventListener("click",this.registerClickHandler)})}}export{n as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import l from"@typo3/core/document-service.js";class r{constructor(s){this.controlElement=null,this.assignedFormField=null,this.registerChangeHandler=()=>{this.controlElement.classList.toggle("disabled",this.assignedFormField.options.selectedIndex===-1)},this.registerClickHandler=n=>{n.preventDefault();const t=[];for(let e=0;e<this.assignedFormField.selectedOptions.length;++e){const o=this.assignedFormField.selectedOptions.item(e);t.push(o.value)}const i=this.controlElement.getAttribute("href")+"&P[currentValue]="+encodeURIComponent(this.assignedFormField.value)+"&P[currentSelectedValues]="+t.join(",");window.open(i,"",this.controlElement.dataset.windowParameters).focus()},l.ready().then(()=>{this.controlElement=document.querySelector(s),this.assignedFormField=document.querySelector('select[data-formengine-input-name="'+this.controlElement.dataset.element+'"]'),this.assignedFormField.options.selectedIndex===-1&&this.controlElement.classList.add("disabled"),this.assignedFormField.addEventListener("change",this.registerChangeHandler),this.controlElement.addEventListener("click",this.registerClickHandler)})}}export{r as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import n from"@typo3/core/document-service.js";import s from"@typo3/backend/form-engine.js";class i{constructor(t){this.controlElement=null,this.registerClickHandler=r=>{r.preventDefault();const o=this.controlElement.dataset.element,l=JSON.parse(this.controlElement.dataset.clipboardItems);for(const e of l)s.setSelectOptionFromExternalSource(o,e.value,e.title,e.title)},n.ready().then(()=>{this.controlElement=document.querySelector(t),this.controlElement.addEventListener("click",this.registerClickHandler)})}}export{i as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import u from"@typo3/core/document-service.js";import h from"@typo3/backend/form-engine.js";import{selector as l}from"@typo3/core/literals.js";import t from"@typo3/backend/modal.js";import{FormEngineLinkBrowserSetLinkEvent as p}from"@typo3/backend/event/form-engine-link-browser-set-link-event.js";class f{constructor(a){this.controlElement=null,this.handleControlClick=i=>{i.preventDefault();const e=this.controlElement.dataset.itemName,c=document.querySelector(l`[name="${e}"]`),n=document.querySelector(l`[data-formengine-input-name="${e}"]`),m=this.controlElement.getAttribute("href")+"&P[currentValue]="+encodeURIComponent(document.forms.namedItem("editform")[e].value)+"&P[currentSelectedValues]="+encodeURIComponent(c.value),o=t.advanced({type:t.types.iframe,content:m,size:t.sizes.large});o.addEventListener(p.eventName,s=>{const{value:d,onFieldChangeItems:r}=s;n.value=d,n.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),Array.isArray(r)&&h.processOnFieldChange(r),o.hideModal()})},u.ready().then(()=>{this.controlElement=document.querySelector(a),this.controlElement!==null&&this.controlElement.addEventListener("click",this.handleControlClick)})}}export{f as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import r from"@typo3/core/document-service.js";import o from"@typo3/backend/form-engine.js";class l{constructor(e){this.controlElement=null,this.registerClickHandler=t=>{t.preventDefault(),o.preventFollowLinkIfNotSaved(this.controlElement.getAttribute("href"))},r.ready().then(()=>{this.controlElement=document.querySelector(e),this.controlElement.addEventListener("click",this.registerClickHandler)})}}export{l as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import s from"@typo3/core/document-service.js";import n from"@typo3/backend/form-engine.js";import o from"@typo3/backend/form-engine-validation.js";import d from"@typo3/core/ajax/ajax-request.js";import l from"@typo3/backend/notification.js";import i from"~labels/core.core";class r{constructor(a){this.controlElement=null,this.humanReadableField=null,this.hiddenField=null,this.passwordPolicy=null,s.ready().then(()=>{if(this.controlElement=document.getElementById(a),this.humanReadableField=document.querySelector('input[data-formengine-input-name="'+this.controlElement.dataset.itemName+'"]'),this.hiddenField=document.querySelector('input[name="'+this.controlElement.dataset.itemName+'"]'),this.passwordPolicy=this.controlElement.dataset.passwordPolicy||null,!this.controlElement.dataset.allowEdit&&(this.humanReadableField.disabled=!0,this.humanReadableField.readOnly=!0,this.humanReadableField.isClearable||this.humanReadableField.classList.contains("t3js-clearable"))){this.humanReadableField.classList.remove("t3js-clearable");const e=this.humanReadableField.closest("div.form-control-clearable-wrapper");if(e){e.classList.remove("form-control-clearable");const t=e.querySelector("button.close");t&&e.removeChild(t)}}this.controlElement.addEventListener("click",this.generatePassword.bind(this))})}generatePassword(a){a.preventDefault(),new d(TYPO3.settings.ajaxUrls.password_generate).post({passwordPolicy:this.passwordPolicy}).then(async e=>{const t=await e.resolve();t.success===!0?(this.humanReadableField.type="text",this.humanReadableField.value=t.password,this.humanReadableField.dispatchEvent(new Event("change")),this.hiddenField&&(this.humanReadableField.value=this.hiddenField.value),o.validateField(this.humanReadableField),n.markFieldAsChanged(this.humanReadableField)):l.warning(i.get("labels.generatePassword.failed"))}).catch(()=>{l.warning(i.get("labels.generatePassword.failed"))})}}export{r as default};
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
import c from"@typo3/core/document-service.js";class r{constructor(t){this.controlElement=null,this.registerClickHandler=n=>{n.preventDefault();const o=this.controlElement.dataset.itemName,l=JSON.parse(this.controlElement.dataset.selectedIndices),e=document.forms.namedItem("editform").querySelector('[name="'+o+'[]"]');e.selectedIndex=-1;for(const s of l)e.options[s].selected=!0},c.ready().then(()=>{this.controlElement=document.querySelector(t),this.controlElement!==null&&this.controlElement.addEventListener("click",this.registerClickHandler)})}}export{r as default};
|
||||
Reference in New Issue
Block a user