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!
|
||||
*/
|
||||
class e extends CustomEvent{constructor(){super("auto-advance",{bubbles:!0,composed:!0})}}export{e as AutoAdvanceEvent};
|
||||
@@ -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!
|
||||
*/
|
||||
class e extends CustomEvent{static{this.eventName="wizard-before-next-step"}constructor(t,s){super(e.eventName,{detail:{currentStepKey:t,currentStepIndex:s}})}}export{e as BeforeNextStepEvent};
|
||||
@@ -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!
|
||||
*/
|
||||
class e extends CustomEvent{static{this.eventName="wizard-step-summary"}constructor(t){super(e.eventName,{detail:{summaryData:t},bubbles:!0,composed:!0})}}export{e as StepSummaryEvent};
|
||||
@@ -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{html as n}from"lit";class o{setConfig(e){this.config=e}async render(){return n`<typo3-backend-alert severity=0 heading=${this.config.labels.successTitle} message=${this.config.labels.successDescription} show-icon></typo3-backend-alert>`}async execute(){window.top&&window.top!==window.self&&window.top.TYPO3?.Backend?.ContentContainer?window.top.TYPO3.Backend.ContentContainer.refresh():window.location.reload()}}export{o 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{html as n}from"lit";class o{setConfig(e){this.config=e}async render(){return n`<typo3-backend-alert severity=0 heading=${this.config.labels.successTitle} message=${this.config.labels.successDescription} show-icon></typo3-backend-alert>`}async execute(){const e=this.config.data.url;if(!e){console.warn("Redirect finisher called without URL");return}window.opener&&!window.opener.closed&&window.self===window.top?(window.opener.location.href=e,window.close()):window.top&&window.top.TYPO3?.Backend?.ContentContainer?window.top.TYPO3.Backend.ContentContainer.setUrl(e):window.location.href=e}}export{o 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{html as n}from"lit";class o{setConfig(e){this.config=e}async render(){return n`<typo3-backend-alert severity=0 heading=${this.config.labels.successTitle} message=${this.config.labels.successDescription} show-icon></typo3-backend-alert>`}async execute(){window.top&&window.top!==window.self&&window.top.TYPO3?.Backend?.ContentContainer?window.top.TYPO3.Backend.ContentContainer.refresh():window.location.reload()}}export{o 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/ajax/ajax-request.js";function i(r,a){return new n(TYPO3.settings.ajaxUrls.wizard_config).withQueryArguments({mode:r,data:a.getDataStore()}).get().then(e=>e.resolve()).then(async e=>await Promise.all(e.steps.map(async t=>{if(!t.module)throw new Error("Step data does not contain a module path");const{default:o}=await import(t.module);if(!o)throw new Error(`Step module ${t.module} does not export a default class`);return new o(a,t.configurationData)})))}export{i as loadDynamicSteps};
|
||||
@@ -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 p from"@typo3/core/event/regular-event.js";import y from"@typo3/core/document-service.js";import h from"@typo3/backend/ajax-data-handler.js";import w from"@typo3/backend/modal.js";import b from"@typo3/backend/notification.js";import C from"@typo3/backend/action-button/immediate-action.js";import g from"@typo3/backend/viewport.js";import e from"~labels/backend.wizards.move_content_elements";import f from"~labels/core.misc";class E{constructor(){this.initialize()}async initialize(){await y.ready(),this.registerEvents(document.querySelector(".element-browser-body"))}registerEvents(l){new p("change",async r=>{const o=document.querySelector("#elementRecordTitle").value,n=new URL(window.location.href).searchParams.get("uid"),i=document.querySelector("h2");if(i){const t=[o,Number(n)];i.innerText=r.target.checked?e.get("headline.copy",t):e.get("headline.move",t)}const a=r.target.checked?f.get("copyElementToHere"):f.get("moveElementToHere");document.querySelectorAll('[data-action="paste"]').forEach(t=>{t.querySelector("span.t3js-button-label").textContent=a})}).delegateTo(l,"#makeCopy"),new p("click",async(r,o)=>{const m=document.querySelector("#makeCopy"),n=document.querySelector("#elementRecordTitle").value,i=document.querySelector("#pageRecordTitle").value,a=document.querySelector("#pageUid").value,t=new URL(window.location.href),d=t.searchParams.get("uid"),c=new URL(t.searchParams.get("returnUrl"),window.origin),s=m.checked,v=s?"copy":"move",u={cmd:{tt_content:{[d]:{[v]:o.dataset.position}}}};o.dataset.colpos!==void 0&&(u.data={tt_content:{[d]:{colPos:o.dataset.colpos}}}),h.process(u).then(()=>{w.dismiss(),b.success(s?e.get("moveElement.notification.elementCopied.title"):e.get("moveElement.notification.elementMoved.title"),s?e.get("moveElement.notification.elementCopied.message",[n]):e.get("moveElement.notification.elementMoved.message",[n]),10,[{label:e.get("moveElement.notification.elementPasted.action.dismiss")},{label:e.get("moveElement.notification.elementPasted.action.open",[i]),action:new C(()=>{c.searchParams.set("id",a),g.ContentContainer.setUrl(c)})}]),g.ContentContainer.setUrl(c)})}).delegateTo(l,'[data-action="paste"]')}}export{E as MoveContentElement};
|
||||
@@ -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 m from"@typo3/core/event/regular-event.js";import d from"@typo3/core/document-service.js";import p from"@typo3/backend/ajax-data-handler.js";import g from"@typo3/backend/modal.js";import i from"@typo3/backend/module-menu.js";import l from"@typo3/backend/notification.js";import u from"@typo3/backend/action-button/immediate-action.js";import e from"~labels/backend.wizards.move_page";class f{constructor(){this.initialize()}async initialize(){await d.ready(),this.registerEvents(document.querySelector(".element-browser-body"))}registerEvents(r){const o=document.querySelector("#elementRecordTitle").value,t=new URL(window.location.href);new m("click",async(P,s)=>{const a=document.querySelector("#makeCopy").checked,n=a?"copy":"move",c={cmd:{[t.searchParams.get("table")]:{[t.searchParams.get("uid")]:{[n]:s.dataset.position}}}};p.process(c).then(()=>{g.dismiss(),l.success(a?e.get("movePage.notification.pageCopied.title"):e.get("movePage.notification.pageMoved.title"),a?e.get("movePage.notification.pageCopied.message",[o]):e.get("movePage.notification.pageMoved.message",[o]),10,[{label:e.get("movePage.notification.pagePasted.action.dismiss")},{label:e.get("movePage.notification.pagePasted.action.open",[o]),action:new u(()=>{i.App.showModule("records","id="+t.searchParams.get("uid"))})}]),top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh")),i.App.showModule("records","id="+t.searchParams.get("expandPage"))})}).delegateTo(r,'[data-action="paste"]')}}export{f as MovePage};
|
||||
@@ -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{html as i}from"lit";import{StepSummaryEvent as o}from"@typo3/backend/wizard/events/step-summary-event.js";import e from"~labels/backend.wizards.general";class r{constructor(t){this.wizard=t,this.key="confirm",this.title=e.get("step.confirmation.title"),this.autoAdvance=!1}isComplete(){return!0}render(){const t=new o(this.wizard.getStepSummaries());this.wizard.dispatchEvent(t);const s=t.detail.summaryData;return i`<div class=localization-confirmation><h2 class=h4>${e.get("step.confirmation.headline")}</h2><p>${e.get("step.confirmation.description")}</p><div class="table-fit table-fit-wrap"><table class="table table-striped"><tbody>${s.map(a=>i`<tr><th class=col-fieldname>${a.label}</th><td class=col-word-break>${a.value}</td></tr>`)}</tbody></table></div></div>`}}export{r as ConfirmStep,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{html as n,nothing as d}from"lit";import{until as a}from"lit/directives/until.js";import{Task as u,TaskStatus as o}from"@lit/task";import t from"~labels/backend.wizards.general";class h{constructor(r,i){this.wizard=r,this.finisher=i,this.key="finisher",this.title=t.get("step.finisher.title"),this.autoAdvance=!1,this.resetButtonTitle=null,this.finisherInstance=null,this.hasError=!1,this.task=new u(this.wizard,{task:async([e])=>e.execute(),args:()=>[this.finisher],autoRun:!1})}isComplete(){return this.task.status===o.COMPLETE}async beforeAdvance(){if(this.hasError){this.wizard.dismissWizard();return}if(!this.finisherInstance)throw new Error("Finisher instance not loaded");this.wizard.dismissWizard(),await this.finisherInstance.execute()}render(){return this.task.status===o.INITIAL&&this.task.run(),this.task.render({pending:()=>this.wizard.renderLoader(t.get("wizard.status.pending.message")),error:r=>(this.hasError=!0,this.wizard.renderError(t.get("wizard.status.error.message"),r)),complete:r=>r.success===!1?(this.hasError=!0,this.wizard.renderError(t.get("wizard.status.error.message"),r.errors)):(r?.finisher?.data?.resetButtonTitle&&(this.resetButtonTitle=String(r?.finisher?.data?.resetButtonTitle)),this.renderFinisher(r.finisher))})}renderFinisher(r){if(!this.finisherInstance){const i=this.loadFinisher(r).then(e=>(this.finisherInstance=e,e.render())).catch(e=>(console.error("Failed to load finisher:",e),this.hasError=!0,this.wizard.renderError(t.get("wizard.finisher.load_error.message"),e)));return n`${a(i,this.wizard.renderLoader(t.get("wizard.loading_finisher")))}`}return n`${a(this.finisherInstance.render(),d)}`}async loadFinisher(r){if(!r.module)throw new Error("Finisher data does not contain a module path");const e=(await import(r.module)).default;if(!e)throw new Error(`Finisher module ${r.module} does not export a default class`);const s=new e;return s.setConfig(r),s}}export{h as FinisherStep,h as default};
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user