Commit 27881b60 authored by Benjamin Franzke's avatar Benjamin Franzke Committed by Benni Mack
Browse files

[TASK] Update bootstrap javascript to 5.0.0-beta1

Bootstrap v5 – introduced in #92616 – was added with CCS from beta1 but
JavaScript from alpha2. bootstrap.bundle.js was manually wrapped
into a AMD closure, and because bootstrap 5.0.0-beta1 contains alot of
changes regarding data tags, it couldn't be updated in the initial
patch.

Bootstrap is now bundled using rollup using the ES6 sources in order
to allow for automatic updates through `grunt build`.

popperjs – previously bundled into bootstrap distributed files –
is now added as dependency. The bootstap ES6 sources, that we now use
through rollup, do not bundle this external dependency (for good reasons).

Dependency added with:

   yarn add @popperjs/core

Further adaptions contained in this change to ensure beta1 compatibility:

a) Carousel "item" to "carousel-item" class migration
b) $.fn.modal(options) does no longer imply $.fn.modal('show')
c) Fix panels, both JS and CSS (card-group can't be used here)
d) All bootstrap data- tags are migrated to data-bs-.
   (see https://github.com/twbs/bootstrap/pull/31827)
   Migrated with

   # renderes a sed substition with the help of a nested sed from all the
   # data-bs attributes that where changed in the twbs/bootstrap commit
   git grep -l data- | xargs sed -i $( \
        curl -s \
        https://patch-diff.githubusercontent.com/raw/twbs/bootstrap/pull/31827.patch | \
        sed 's/data-bs-[a-z-]*/\n&\n/g' | grep "data-bs-[a-z-]" | \
        sort | uniq | \
        sed 's/data-bs-\(.*\)\([^a-z-]\|$\)/ -e s\/data-\1\\\([^a-z-]\\\)\/data-bs-\1\\1\/g -e s\/data('"'"'\1'"'"')\/data('"'"'bs-\1'"'"')\/g/g' \
   )

   # Revert false positives from the above auto-replacement
   git checkout -- typo3/sysext/core/Documentation/Changelog/ \
        typo3/sysext/backend/Classes/Form/Container/FlexFormContainerContainer.php \
        Build/Sources/TypeScript/backend/Resources/Public/TypeScript/LiveSearch.ts \
        Build/Sources/TypeScript/backend/Resources/Public/TypeScript/FormEngineFlexForm.ts \
        Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ExtensionConfiguration.ts \
        Build/Sources/Sass/typo3/_element_panel.scss

   (cd Build && grunt build)

Resolves: #93126
Resolves: #93123
Resolves: #93132
Related: #92616
Releases: master
Change-Id: Ie194d0f87d2c60df7b9e8a6de4893cfaaea55356
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/67215

Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarMartin Kutschker <mkutschker-typo3@yahoo.com>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 89f2e9f8
......@@ -71,9 +71,9 @@ define(['jquery',
'<input type="text" class="form-control search-input" placeholder="' + TYPO3.lang['tcatree.findItem'] + '">' +
'</div>' +
'<div class="btn-group">' +
'<button type="button" data-toggle="tooltip" class="btn btn-default expand-all-btn" title="' + TYPO3.lang['tcatree.expandAll'] + '"></button>' +
'<button type="button" data-toggle="tooltip" class="btn btn-default collapse-all-btn" title="' + TYPO3.lang['tcatree.collapseAll'] + '"></button>' +
'<button type="button" data-toggle="tooltip" class="btn btn-default hide-unchecked-btn" title="' + TYPO3.lang['tcatree.toggleHideUnchecked'] + '"></button>' +
'<button type="button" data-bs-toggle="tooltip" class="btn btn-default expand-all-btn" title="' + TYPO3.lang['tcatree.expandAll'] + '"></button>' +
'<button type="button" data-bs-toggle="tooltip" class="btn btn-default collapse-all-btn" title="' + TYPO3.lang['tcatree.collapseAll'] + '"></button>' +
'<button type="button" data-bs-toggle="tooltip" class="btn btn-default hide-unchecked-btn" title="' + TYPO3.lang['tcatree.toggleHideUnchecked'] + '"></button>' +
'</div>' +
'</div>'
);
......@@ -131,7 +131,7 @@ define(['jquery',
});
$toolbar.find(this.settings.toggleHideUnchecked).on('click', this.toggleHideUnchecked.bind(this));
$toolbar.find('[data-toggle="tooltip"]').tooltip();
$toolbar.find('[data-bs-toggle="tooltip"]').tooltip();
};
/**
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Enum/Severity","TYPO3/CMS/Core/Ajax/AjaxRequest","./Icons","./Wizard"],(function(e,t,a,l,s,i,o){"use strict";a=__importDefault(a);return new class{constructor(){this.triggerButton=".t3js-localize",this.localizationMode=null,this.sourceLanguage=null,this.records=[],a.default(()=>{this.initialize()})}initialize(){const e=this;i.getIcon("actions-localize",i.sizes.large).then(t=>{i.getIcon("actions-edit-copy",i.sizes.large).then(s=>{a.default(e.triggerButton).removeClass("disabled"),a.default(document).on("click",e.triggerButton,e=>{e.preventDefault();const n=a.default(e.currentTarget),d=[];let c="";n.data("allowTranslate")&&d.push('<div class="row"><div class="btn-group col-sm-3"><label class="btn btn-block btn-default t3js-localization-option" data-helptext=".t3js-helptext-translate">'+t+'<input type="radio" name="mode" id="mode_translate" value="localize" style="display: none"><br>Translate</label></div><div class="col-sm-9"><p class="t3js-helptext t3js-helptext-translate text-muted">'+TYPO3.lang["localize.educate.translate"]+"</p></div></div>"),n.data("allowCopy")&&d.push('<div class="row"><div class="col-sm-3 btn-group"><label class="btn btn-block btn-default t3js-localization-option" data-helptext=".t3js-helptext-copy">'+s+'<input type="radio" name="mode" id="mode_copy" value="copyFromLanguage" style="display: none"><br>Copy</label></div><div class="col-sm-9"><p class="t3js-helptext t3js-helptext-copy text-muted">'+TYPO3.lang["localize.educate.copy"]+"</p></div></div>"),0===n.data("allowTranslate")&&0===n.data("allowCopy")&&d.push('<div class="row"><div class="col-sm-12"><div class="alert alert-warning"><div class="media"><div class="media-left"><span class="fa-stack fa-lg"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-exclamation fa-stack-1x"></i></span></div><div class="media-body"><p class="alert-message">'+TYPO3.lang["localize.educate.noTranslate"]+"</p></div></div></div></div></div>"),c+='<div data-toggle="buttons">'+d.join("<hr>")+"</div>",o.addSlide("localize-choose-action",TYPO3.lang["localize.wizard.header_page"].replace("{0}",n.data("page")).replace("{1}",n.data("languageName")),c,l.SeverityEnum.info),o.addSlide("localize-choose-language",TYPO3.lang["localize.view.chooseLanguage"],"",l.SeverityEnum.info,e=>{i.getIcon("spinner-circle-dark",i.sizes.large).then(t=>{e.html('<div class="text-center">'+t+"</div>"),this.loadAvailableLanguages(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10)).then(async t=>{const l=await t.resolve();if(1===l.length)return this.sourceLanguage=l[0].uid,void o.unlockNextStep().trigger("click");o.getComponent().on("click",".t3js-language-option",e=>{const t=a.default(e.currentTarget).find('input[type="radio"]');this.sourceLanguage=t.val(),console.log("Localization.ts@132",this.sourceLanguage),o.unlockNextStep()});const s=a.default("<div />",{class:"row","data-toggle":"buttons"});for(const e of l)s.append(a.default("<div />",{class:"col-sm-4"}).append(a.default("<label />",{class:"btn btn-default btn-block t3js-language-option option"}).text(" "+e.title).prepend(e.flagIcon).prepend(a.default("<input />",{type:"radio",name:"language",id:"language"+e.uid,value:e.uid,style:"display: none;"}))));e.empty().append(s)})})}),o.addSlide("localize-summary",TYPO3.lang["localize.view.summary"],"",l.SeverityEnum.info,e=>{i.getIcon("spinner-circle-dark",i.sizes.large).then(t=>{e.html('<div class="text-center">'+t+"</div>")}),this.getSummary(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10)).then(async t=>{const l=await t.resolve();e.empty(),this.records=[];const s=l.columns.columns;l.columns.columnList.forEach(t=>{if(void 0===l.records[t])return;const i=s[t],o=a.default("<div />",{class:"row"});l.records[t].forEach(e=>{const t=" ("+e.uid+") "+e.title;this.records.push(e.uid),o.append(a.default("<div />",{class:"col-sm-6"}).append(a.default("<div />",{class:"input-group"}).append(a.default("<span />",{class:"input-group-addon"}).append(a.default("<input />",{type:"checkbox",class:"t3js-localization-toggle-record",id:"record-uid-"+e.uid,checked:"checked","data-uid":e.uid,"aria-label":t})),a.default("<label />",{class:"form-control",for:"record-uid-"+e.uid}).text(t).prepend(e.icon))))}),e.append(a.default("<fieldset />",{class:"localization-fieldset"}).append(a.default("<label />").text(i).prepend(a.default("<input />",{class:"t3js-localization-toggle-column",type:"checkbox",checked:"checked"})),o))}),o.unlockNextStep(),o.getComponent().on("change",".t3js-localization-toggle-record",e=>{const t=a.default(e.currentTarget),l=t.data("uid"),s=t.closest("fieldset"),i=s.find(".t3js-localization-toggle-column");if(t.is(":checked"))this.records.push(l);else{const e=this.records.indexOf(l);e>-1&&this.records.splice(e,1)}const n=s.find(".t3js-localization-toggle-record"),d=s.find(".t3js-localization-toggle-record:checked");i.prop("checked",d.length>0),i.prop("indeterminate",d.length>0&&d.length<n.length),this.records.length>0?o.unlockNextStep():o.lockNextStep()}).on("change",".t3js-localization-toggle-column",e=>{const t=a.default(e.currentTarget),l=t.closest("fieldset").find(".t3js-localization-toggle-record");l.prop("checked",t.is(":checked")),l.trigger("change")})})}),o.addFinalProcessingSlide(()=>{this.localizeRecords(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10),this.records).then(()=>{o.dismiss(),document.location.reload()})}).then(()=>{o.show(),o.getComponent().on("click",".t3js-localization-option",e=>{const t=a.default(e.currentTarget),l=t.find('input[type="radio"]');if(t.data("helptext")){const l=a.default(e.delegateTarget);l.find(".t3js-helptext").addClass("text-muted"),l.find(t.data("helptext")).removeClass("text-muted")}this.localizationMode=l.val(),o.unlockNextStep()})})})})})}loadAvailableLanguages(e,t){return new s(TYPO3.settings.ajaxUrls.page_languages).withQueryArguments({pageId:e,languageId:t}).get()}getSummary(e,t){return new s(TYPO3.settings.ajaxUrls.records_localize_summary).withQueryArguments({pageId:e,destLanguageId:t,languageId:this.sourceLanguage}).get()}localizeRecords(e,t,a){return new s(TYPO3.settings.ajaxUrls.records_localize).withQueryArguments({pageId:e,srcLanguageId:this.sourceLanguage,destLanguageId:t,action:this.localizationMode,uidList:a}).get()}}}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Enum/Severity","TYPO3/CMS/Core/Ajax/AjaxRequest","./Icons","./Wizard"],(function(e,t,a,l,s,i,o){"use strict";a=__importDefault(a);return new class{constructor(){this.triggerButton=".t3js-localize",this.localizationMode=null,this.sourceLanguage=null,this.records=[],a.default(()=>{this.initialize()})}initialize(){const e=this;i.getIcon("actions-localize",i.sizes.large).then(t=>{i.getIcon("actions-edit-copy",i.sizes.large).then(s=>{a.default(e.triggerButton).removeClass("disabled"),a.default(document).on("click",e.triggerButton,e=>{e.preventDefault();const n=a.default(e.currentTarget),d=[];let c="";n.data("allowTranslate")&&d.push('<div class="row"><div class="btn-group col-sm-3"><label class="btn btn-block btn-default t3js-localization-option" data-helptext=".t3js-helptext-translate">'+t+'<input type="radio" name="mode" id="mode_translate" value="localize" style="display: none"><br>Translate</label></div><div class="col-sm-9"><p class="t3js-helptext t3js-helptext-translate text-muted">'+TYPO3.lang["localize.educate.translate"]+"</p></div></div>"),n.data("allowCopy")&&d.push('<div class="row"><div class="col-sm-3 btn-group"><label class="btn btn-block btn-default t3js-localization-option" data-helptext=".t3js-helptext-copy">'+s+'<input type="radio" name="mode" id="mode_copy" value="copyFromLanguage" style="display: none"><br>Copy</label></div><div class="col-sm-9"><p class="t3js-helptext t3js-helptext-copy text-muted">'+TYPO3.lang["localize.educate.copy"]+"</p></div></div>"),0===n.data("allowTranslate")&&0===n.data("allowCopy")&&d.push('<div class="row"><div class="col-sm-12"><div class="alert alert-warning"><div class="media"><div class="media-left"><span class="fa-stack fa-lg"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-exclamation fa-stack-1x"></i></span></div><div class="media-body"><p class="alert-message">'+TYPO3.lang["localize.educate.noTranslate"]+"</p></div></div></div></div></div>"),c+='<div data-bs-toggle="buttons">'+d.join("<hr>")+"</div>",o.addSlide("localize-choose-action",TYPO3.lang["localize.wizard.header_page"].replace("{0}",n.data("page")).replace("{1}",n.data("languageName")),c,l.SeverityEnum.info),o.addSlide("localize-choose-language",TYPO3.lang["localize.view.chooseLanguage"],"",l.SeverityEnum.info,e=>{i.getIcon("spinner-circle-dark",i.sizes.large).then(t=>{e.html('<div class="text-center">'+t+"</div>"),this.loadAvailableLanguages(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10)).then(async t=>{const l=await t.resolve();if(1===l.length)return this.sourceLanguage=l[0].uid,void o.unlockNextStep().trigger("click");o.getComponent().on("click",".t3js-language-option",e=>{const t=a.default(e.currentTarget).find('input[type="radio"]');this.sourceLanguage=t.val(),console.log("Localization.ts@132",this.sourceLanguage),o.unlockNextStep()});const s=a.default("<div />",{class:"row","data-bs-toggle":"buttons"});for(const e of l)s.append(a.default("<div />",{class:"col-sm-4"}).append(a.default("<label />",{class:"btn btn-default btn-block t3js-language-option option"}).text(" "+e.title).prepend(e.flagIcon).prepend(a.default("<input />",{type:"radio",name:"language",id:"language"+e.uid,value:e.uid,style:"display: none;"}))));e.empty().append(s)})})}),o.addSlide("localize-summary",TYPO3.lang["localize.view.summary"],"",l.SeverityEnum.info,e=>{i.getIcon("spinner-circle-dark",i.sizes.large).then(t=>{e.html('<div class="text-center">'+t+"</div>")}),this.getSummary(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10)).then(async t=>{const l=await t.resolve();e.empty(),this.records=[];const s=l.columns.columns;l.columns.columnList.forEach(t=>{if(void 0===l.records[t])return;const i=s[t],o=a.default("<div />",{class:"row"});l.records[t].forEach(e=>{const t=" ("+e.uid+") "+e.title;this.records.push(e.uid),o.append(a.default("<div />",{class:"col-sm-6"}).append(a.default("<div />",{class:"input-group"}).append(a.default("<span />",{class:"input-group-addon"}).append(a.default("<input />",{type:"checkbox",class:"t3js-localization-toggle-record",id:"record-uid-"+e.uid,checked:"checked","data-uid":e.uid,"aria-label":t})),a.default("<label />",{class:"form-control",for:"record-uid-"+e.uid}).text(t).prepend(e.icon))))}),e.append(a.default("<fieldset />",{class:"localization-fieldset"}).append(a.default("<label />").text(i).prepend(a.default("<input />",{class:"t3js-localization-toggle-column",type:"checkbox",checked:"checked"})),o))}),o.unlockNextStep(),o.getComponent().on("change",".t3js-localization-toggle-record",e=>{const t=a.default(e.currentTarget),l=t.data("uid"),s=t.closest("fieldset"),i=s.find(".t3js-localization-toggle-column");if(t.is(":checked"))this.records.push(l);else{const e=this.records.indexOf(l);e>-1&&this.records.splice(e,1)}const n=s.find(".t3js-localization-toggle-record"),d=s.find(".t3js-localization-toggle-record:checked");i.prop("checked",d.length>0),i.prop("indeterminate",d.length>0&&d.length<n.length),this.records.length>0?o.unlockNextStep():o.lockNextStep()}).on("change",".t3js-localization-toggle-column",e=>{const t=a.default(e.currentTarget),l=t.closest("fieldset").find(".t3js-localization-toggle-record");l.prop("checked",t.is(":checked")),l.trigger("change")})})}),o.addFinalProcessingSlide(()=>{this.localizeRecords(parseInt(n.data("pageId"),10),parseInt(n.data("languageId"),10),this.records).then(()=>{o.dismiss(),document.location.reload()})}).then(()=>{o.show(),o.getComponent().on("click",".t3js-localization-option",e=>{const t=a.default(e.currentTarget),l=t.find('input[type="radio"]');if(t.data("helptext")){const l=a.default(e.delegateTarget);l.find(".t3js-helptext").addClass("text-muted"),l.find(t.data("helptext")).removeClass("text-muted")}this.localizationMode=l.val(),o.unlockNextStep()})})})})})}loadAvailableLanguages(e,t){return new s(TYPO3.settings.ajaxUrls.page_languages).withQueryArguments({pageId:e,languageId:t}).get()}getSummary(e,t){return new s(TYPO3.settings.ajaxUrls.records_localize_summary).withQueryArguments({pageId:e,destLanguageId:t,languageId:this.sourceLanguage}).get()}localizeRecords(e,t,a){return new s(TYPO3.settings.ajaxUrls.records_localize).withQueryArguments({pageId:e,srcLanguageId:this.sourceLanguage,destLanguageId:t,action:this.localizationMode,uidList:a}).get()}}}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Backend/Notification"],(function(e,t,o,i,s){"use strict";var a;o=__importDefault(o),function(e){e.loginrefresh="t3js-modal-loginrefresh",e.lockedModal="t3js-modal-backendlocked",e.loginFormModal="t3js-modal-backendloginform"}(a||(a={}));class n{constructor(){this.options={modalConfig:{backdrop:"static"}},this.intervalTime=60,this.intervalId=null,this.backendIsLocked=!1,this.isTimingOut=!1,this.$timeoutModal=null,this.$backendLockedModal=null,this.$loginForm=null,this.loginFramesetUrl="",this.logoutUrl="",this.submitForm=e=>{e.preventDefault();const t=this.$loginForm.find("form"),a=t.find("input[name=p_field]"),n=t.find("input[name=userident]"),l=a.val();if(""===l&&""===n.val())return s.error(TYPO3.lang["mess.refresh_login_failed"],TYPO3.lang["mess.refresh_login_emptyPassword"]),void a.focus();l&&(n.val(l),a.val(""));const d={login_status:"login"};o.default.each(t.serializeArray(),(function(e,t){d[t.name]=t.value})),new i(t.attr("action")).post(d).then(async e=>{(await e.resolve()).login.success?this.hideLoginForm():(s.error(TYPO3.lang["mess.refresh_login_failed"],TYPO3.lang["mess.refresh_login_failed_message"]),a.focus())})},this.checkActiveSession=()=>{new i(TYPO3.settings.ajaxUrls.login_timedout).get().then(async e=>{const t=await e.resolve();t.login.locked?this.backendIsLocked||(this.backendIsLocked=!0,this.showBackendLockedModal()):this.backendIsLocked&&(this.backendIsLocked=!1,this.hideBackendLockedModal()),this.backendIsLocked||(t.login.timed_out||t.login.will_time_out)&&(t.login.timed_out?this.showLoginForm():this.showTimeoutModal())})}}initialize(){this.initializeTimeoutModal(),this.initializeBackendLockedModal(),this.initializeLoginForm(),this.startTask()}startTask(){if(null!==this.intervalId)return;let e=1e3*this.intervalTime;this.intervalId=setInterval(this.checkActiveSession,e)}stopTask(){clearInterval(this.intervalId),this.intervalId=null}setIntervalTime(e){this.intervalTime=Math.min(e,86400)}setLogoutUrl(e){this.logoutUrl=e}setLoginFramesetUrl(e){this.loginFramesetUrl=e}showTimeoutModal(){this.isTimingOut=!0,this.$timeoutModal.modal(this.options.modalConfig),this.fillProgressbar(this.$timeoutModal)}hideTimeoutModal(){this.isTimingOut=!1,this.$timeoutModal.modal("hide")}showBackendLockedModal(){this.$backendLockedModal.modal(this.options.modalConfig)}hideBackendLockedModal(){this.$backendLockedModal.modal("hide")}showLoginForm(){new i(TYPO3.settings.ajaxUrls.logout).get().then(()=>{TYPO3.configuration.showRefreshLoginPopup?this.showLoginPopup():this.$loginForm.modal(this.options.modalConfig)})}showLoginPopup(){const e=window.open(this.loginFramesetUrl,"relogin_"+Math.random().toString(16).slice(2),"height=450,width=700,status=0,menubar=0,location=1");e&&e.focus()}hideLoginForm(){this.$loginForm.modal("hide")}initializeBackendLockedModal(){this.$backendLockedModal=this.generateModal(a.lockedModal),this.$backendLockedModal.find(".modal-header h4").text(TYPO3.lang["mess.please_wait"]),this.$backendLockedModal.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.be_locked"])),this.$backendLockedModal.find(".modal-footer").remove(),o.default("body").append(this.$backendLockedModal)}initializeTimeoutModal(){this.$timeoutModal=this.generateModal(a.loginrefresh),this.$timeoutModal.addClass("modal-severity-notice"),this.$timeoutModal.find(".modal-header h4").text(TYPO3.lang["mess.login_about_to_expire_title"]),this.$timeoutModal.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.login_about_to_expire"]),o.default("<div />",{class:"progress"}).append(o.default("<div />",{class:"progress-bar progress-bar-warning progress-bar-striped active",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"}).append(o.default("<span />",{class:"sr-only"})))),this.$timeoutModal.find(".modal-footer").append(o.default("<button />",{class:"btn btn-default","data-action":"logout"}).text(TYPO3.lang["mess.refresh_login_logout_button"]).on("click",()=>{top.location.href=this.logoutUrl}),o.default("<button />",{class:"btn btn-primary t3js-active","data-action":"refreshSession"}).text(TYPO3.lang["mess.refresh_login_refresh_button"]).on("click",()=>{new i(TYPO3.settings.ajaxUrls.login_timedout).get().then(()=>{this.hideTimeoutModal()})})),this.registerDefaultModalEvents(this.$timeoutModal),o.default("body").append(this.$timeoutModal)}initializeLoginForm(){if(TYPO3.configuration.showRefreshLoginPopup)return;this.$loginForm=this.generateModal(a.loginFormModal),this.$loginForm.addClass("modal-notice");let t=String(TYPO3.lang["mess.refresh_login_title"]).replace("%s",TYPO3.configuration.username);this.$loginForm.find(".modal-header h4").text(t),this.$loginForm.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.login_expired"]),o.default("<form />",{id:"beLoginRefresh",method:"POST",action:TYPO3.settings.ajaxUrls.login}).append(o.default("<div />",{class:"form-group"}).append(o.default("<input />",{type:"password",name:"p_field",autofocus:"autofocus",class:"form-control",placeholder:TYPO3.lang["mess.refresh_login_password"],"data-rsa-encryption":"t3-loginrefres-userident"})),o.default("<input />",{type:"hidden",name:"username",value:TYPO3.configuration.username}),o.default("<input />",{type:"hidden",name:"userident",id:"t3-loginrefres-userident"}))),this.$loginForm.find(".modal-footer").append(o.default("<a />",{href:this.logoutUrl,class:"btn btn-default"}).text(TYPO3.lang["mess.refresh_exit_button"]),o.default("<button />",{type:"button",class:"btn btn-primary","data-action":"refreshSession"}).text(TYPO3.lang["mess.refresh_login_button"]).on("click",()=>{this.$loginForm.find("form").trigger("submit")})),this.registerDefaultModalEvents(this.$loginForm).on("submit",this.submitForm),o.default("body").append(this.$loginForm),e.specified("TYPO3/CMS/Rsaauth/RsaEncryptionModule")&&e(["TYPO3/CMS/Rsaauth/RsaEncryptionModule"],(function(e){e.registerForm(o.default("#beLoginRefresh").get(0))}))}generateModal(e){return o.default("<div />",{id:e,class:"t3js-modal "+e+" modal modal-type-default modal-severity-notice modal-style-light modal-size-small fade"}).append(o.default("<div />",{class:"modal-dialog"}).append(o.default("<div />",{class:"modal-content"}).append(o.default("<div />",{class:"modal-header"}).append(o.default("<h4 />",{class:"modal-title"})),o.default("<div />",{class:"modal-body"}),o.default("<div />",{class:"modal-footer"}))))}fillProgressbar(e){if(!this.isTimingOut)return;let t=0;const o=e.find(".progress-bar"),i=o.children(".sr-only"),s=setInterval(()=>{const e=t>=100;!this.isTimingOut||e?(clearInterval(s),e&&(this.hideTimeoutModal(),this.showLoginForm()),t=0):t+=1;const a=t+"%";o.css("width",a),i.text(a)},300)}registerDefaultModalEvents(e){return e.on("hidden.bs.modal",()=>{this.startTask()}).on("shown.bs.modal",()=>{this.stopTask(),this.$timeoutModal.find(".modal-footer .t3js-active").first().focus()}),e}}let l;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.LoginRefresh&&(l=window.opener.TYPO3.LoginRefresh),parent&&parent.window.TYPO3&&parent.window.TYPO3.LoginRefresh&&(l=parent.window.TYPO3.LoginRefresh),top&&top.TYPO3&&top.TYPO3.LoginRefresh&&(l=top.TYPO3.LoginRefresh)}catch(e){}return l||(l=new n,"undefined"!=typeof TYPO3&&(TYPO3.LoginRefresh=l)),l}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Backend/Notification"],(function(e,t,o,i,s){"use strict";var a;o=__importDefault(o),function(e){e.loginrefresh="t3js-modal-loginrefresh",e.lockedModal="t3js-modal-backendlocked",e.loginFormModal="t3js-modal-backendloginform"}(a||(a={}));class n{constructor(){this.options={modalConfig:{backdrop:"static"}},this.intervalTime=60,this.intervalId=null,this.backendIsLocked=!1,this.isTimingOut=!1,this.$timeoutModal=null,this.$backendLockedModal=null,this.$loginForm=null,this.loginFramesetUrl="",this.logoutUrl="",this.submitForm=e=>{e.preventDefault();const t=this.$loginForm.find("form"),a=t.find("input[name=p_field]"),n=t.find("input[name=userident]"),l=a.val();if(""===l&&""===n.val())return s.error(TYPO3.lang["mess.refresh_login_failed"],TYPO3.lang["mess.refresh_login_emptyPassword"]),void a.focus();l&&(n.val(l),a.val(""));const d={login_status:"login"};o.default.each(t.serializeArray(),(function(e,t){d[t.name]=t.value})),new i(t.attr("action")).post(d).then(async e=>{(await e.resolve()).login.success?this.hideLoginForm():(s.error(TYPO3.lang["mess.refresh_login_failed"],TYPO3.lang["mess.refresh_login_failed_message"]),a.focus())})},this.checkActiveSession=()=>{new i(TYPO3.settings.ajaxUrls.login_timedout).get().then(async e=>{const t=await e.resolve();t.login.locked?this.backendIsLocked||(this.backendIsLocked=!0,this.showBackendLockedModal()):this.backendIsLocked&&(this.backendIsLocked=!1,this.hideBackendLockedModal()),this.backendIsLocked||(t.login.timed_out||t.login.will_time_out)&&(t.login.timed_out?this.showLoginForm():this.showTimeoutModal())})}}initialize(){this.initializeTimeoutModal(),this.initializeBackendLockedModal(),this.initializeLoginForm(),this.startTask()}startTask(){if(null!==this.intervalId)return;let e=1e3*this.intervalTime;this.intervalId=setInterval(this.checkActiveSession,e)}stopTask(){clearInterval(this.intervalId),this.intervalId=null}setIntervalTime(e){this.intervalTime=Math.min(e,86400)}setLogoutUrl(e){this.logoutUrl=e}setLoginFramesetUrl(e){this.loginFramesetUrl=e}showTimeoutModal(){this.isTimingOut=!0,this.$timeoutModal.modal(this.options.modalConfig),this.$timeoutModal.modal("show"),this.fillProgressbar(this.$timeoutModal)}hideTimeoutModal(){this.isTimingOut=!1,this.$timeoutModal.modal("hide")}showBackendLockedModal(){this.$backendLockedModal.modal(this.options.modalConfig),this.$backendLockedModal.modal("show")}hideBackendLockedModal(){this.$backendLockedModal.modal("hide")}showLoginForm(){new i(TYPO3.settings.ajaxUrls.logout).get().then(()=>{TYPO3.configuration.showRefreshLoginPopup?this.showLoginPopup():(this.$loginForm.modal(this.options.modalConfig),this.$loginForm.modal("show"))})}showLoginPopup(){const e=window.open(this.loginFramesetUrl,"relogin_"+Math.random().toString(16).slice(2),"height=450,width=700,status=0,menubar=0,location=1");e&&e.focus()}hideLoginForm(){this.$loginForm.modal("hide")}initializeBackendLockedModal(){this.$backendLockedModal=this.generateModal(a.lockedModal),this.$backendLockedModal.find(".modal-header h4").text(TYPO3.lang["mess.please_wait"]),this.$backendLockedModal.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.be_locked"])),this.$backendLockedModal.find(".modal-footer").remove(),o.default("body").append(this.$backendLockedModal)}initializeTimeoutModal(){this.$timeoutModal=this.generateModal(a.loginrefresh),this.$timeoutModal.addClass("modal-severity-notice"),this.$timeoutModal.find(".modal-header h4").text(TYPO3.lang["mess.login_about_to_expire_title"]),this.$timeoutModal.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.login_about_to_expire"]),o.default("<div />",{class:"progress"}).append(o.default("<div />",{class:"progress-bar progress-bar-warning progress-bar-striped active",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100"}).append(o.default("<span />",{class:"sr-only"})))),this.$timeoutModal.find(".modal-footer").append(o.default("<button />",{class:"btn btn-default","data-action":"logout"}).text(TYPO3.lang["mess.refresh_login_logout_button"]).on("click",()=>{top.location.href=this.logoutUrl}),o.default("<button />",{class:"btn btn-primary t3js-active","data-action":"refreshSession"}).text(TYPO3.lang["mess.refresh_login_refresh_button"]).on("click",()=>{new i(TYPO3.settings.ajaxUrls.login_timedout).get().then(()=>{this.hideTimeoutModal()})})),this.registerDefaultModalEvents(this.$timeoutModal),o.default("body").append(this.$timeoutModal)}initializeLoginForm(){if(TYPO3.configuration.showRefreshLoginPopup)return;this.$loginForm=this.generateModal(a.loginFormModal),this.$loginForm.addClass("modal-notice");let t=String(TYPO3.lang["mess.refresh_login_title"]).replace("%s",TYPO3.configuration.username);this.$loginForm.find(".modal-header h4").text(t),this.$loginForm.find(".modal-body").append(o.default("<p />").text(TYPO3.lang["mess.login_expired"]),o.default("<form />",{id:"beLoginRefresh",method:"POST",action:TYPO3.settings.ajaxUrls.login}).append(o.default("<div />",{class:"form-group"}).append(o.default("<input />",{type:"password",name:"p_field",autofocus:"autofocus",class:"form-control",placeholder:TYPO3.lang["mess.refresh_login_password"],"data-rsa-encryption":"t3-loginrefres-userident"})),o.default("<input />",{type:"hidden",name:"username",value:TYPO3.configuration.username}),o.default("<input />",{type:"hidden",name:"userident",id:"t3-loginrefres-userident"}))),this.$loginForm.find(".modal-footer").append(o.default("<a />",{href:this.logoutUrl,class:"btn btn-default"}).text(TYPO3.lang["mess.refresh_exit_button"]),o.default("<button />",{type:"button",class:"btn btn-primary","data-action":"refreshSession"}).text(TYPO3.lang["mess.refresh_login_button"]).on("click",()=>{this.$loginForm.find("form").trigger("submit")})),this.registerDefaultModalEvents(this.$loginForm).on("submit",this.submitForm),o.default("body").append(this.$loginForm),e.specified("TYPO3/CMS/Rsaauth/RsaEncryptionModule")&&e(["TYPO3/CMS/Rsaauth/RsaEncryptionModule"],(function(e){e.registerForm(o.default("#beLoginRefresh").get(0))}))}generateModal(e){return o.default("<div />",{id:e,class:"t3js-modal "+e+" modal modal-type-default modal-severity-notice modal-style-light modal-size-small fade"}).append(o.default("<div />",{class:"modal-dialog"}).append(o.default("<div />",{class:"modal-content"}).append(o.default("<div />",{class:"modal-header"}).append(o.default("<h4 />",{class:"modal-title"})),o.default("<div />",{class:"modal-body"}),o.default("<div />",{class:"modal-footer"}))))}fillProgressbar(e){if(!this.isTimingOut)return;let t=0;const o=e.find(".progress-bar"),i=o.children(".sr-only"),s=setInterval(()=>{const e=t>=100;!this.isTimingOut||e?(clearInterval(s),e&&(this.hideTimeoutModal(),this.showLoginForm()),t=0):t+=1;const a=t+"%";o.css("width",a),i.text(a)},300)}registerDefaultModalEvents(e){return e.on("hidden.bs.modal",()=>{this.startTask()}).on("shown.bs.modal",()=>{this.stopTask(),this.$timeoutModal.find(".modal-footer .t3js-active").first().focus()}),e}}let l;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.LoginRefresh&&(l=window.opener.TYPO3.LoginRefresh),parent&&parent.window.TYPO3&&parent.window.TYPO3.LoginRefresh&&(l=parent.window.TYPO3.LoginRefresh),top&&top.TYPO3&&top.TYPO3.LoginRefresh&&(l=top.TYPO3.LoginRefresh)}catch(e){}return l||(l=new n,"undefined"!=typeof TYPO3&&(TYPO3.LoginRefresh=l)),l}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","./Enum/Severity","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/SecurityUtility","./Icons","./Severity","bootstrap"],(function(t,e,a,n,l,s,i,o){"use strict";var d,r,c,u;a=__importDefault(a),function(t){t.modal=".t3js-modal",t.content=".t3js-modal-content",t.title=".t3js-modal-title",t.close=".t3js-modal-close",t.body=".t3js-modal-body",t.footer=".t3js-modal-footer",t.iframe=".t3js-modal-iframe",t.iconPlaceholder=".t3js-modal-icon-placeholder"}(d||(d={})),function(t){t.small="small",t.default="default",t.medium="medium",t.large="large",t.full="full"}(r||(r={})),function(t){t.default="default",t.light="light",t.dark="dark"}(c||(c={})),function(t){t.default="default",t.ajax="ajax",t.iframe="iframe"}(u||(u={}));class f{constructor(t){this.sizes=r,this.styles=c,this.types=u,this.currentModal=null,this.instances=[],this.$template=a.default('\n <div class="t3js-modal modal fade">\n <div class="modal-dialog">\n <div class="t3js-modal-content modal-content">\n <div class="modal-header">\n <h4 class="t3js-modal-title modal-title"></h4>\n <button class="t3js-modal-close close">\n <span aria-hidden="true">\n <span class="t3js-modal-icon-placeholder" data-icon="actions-close"></span>\n </span>\n <span class="sr-only"></span>\n </button>\n </div>\n <div class="t3js-modal-body modal-body"></div>\n <div class="t3js-modal-footer modal-footer"></div>\n </div>\n </div>\n </div>'),this.defaultConfiguration={type:u.default,title:"Information",content:"No content provided, please check your <code>Modal</code> configuration.",severity:n.SeverityEnum.notice,buttons:[],style:c.default,size:r.default,additionalCssClasses:[],callback:a.default.noop(),ajaxCallback:a.default.noop(),ajaxTarget:null},this.securityUtility=t,a.default(document).on("modal-dismiss",this.dismiss),this.initializeMarkupTrigger(document)}static resolveEventNameTargetElement(t){const e=t.target,a=t.currentTarget;return e.dataset&&e.dataset.eventName?e:a.dataset&&a.dataset.eventName?a:null}static createModalResponseEventFromElement(t,e){return t&&t.dataset.eventName?new CustomEvent(t.dataset.eventName,{bubbles:!0,detail:{result:e,payload:t.dataset.eventPayload||null}}):null}dismiss(){this.currentModal&&this.currentModal.modal("hide")}confirm(t,e,l=n.SeverityEnum.warning,s=[],i){return 0===s.length&&s.push({text:a.default(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a.default(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-"+o.getCssClass(l),name:"ok"}),this.advanced({title:t,content:e,severity:l,buttons:s,additionalCssClasses:i,callback:t=>{t.on("button.clicked",t=>{"cancel"===t.target.getAttribute("name")?a.default(t.currentTarget).trigger("confirm.button.cancel"):"ok"===t.target.getAttribute("name")&&a.default(t.currentTarget).trigger("confirm.button.ok")})}})}loadUrl(t,e=n.SeverityEnum.info,a,l,s,i){return this.advanced({type:u.ajax,title:t,severity:e,buttons:a,ajaxCallback:s,ajaxTarget:i,content:l})}show(t,e,a=n.SeverityEnum.info,l,s){return this.advanced({type:u.default,title:t,content:e,severity:a,buttons:l,additionalCssClasses:s})}advanced(t){return t.type="string"==typeof t.type&&t.type in u?t.type:this.defaultConfiguration.type,t.title="string"==typeof t.title?t.title:this.defaultConfiguration.title,t.content="string"==typeof t.content||"object"==typeof t.content?t.content:this.defaultConfiguration.content,t.severity=void 0!==t.severity?t.severity:this.defaultConfiguration.severity,t.buttons=t.buttons||this.defaultConfiguration.buttons,t.size="string"==typeof t.size&&t.size in r?t.size:this.defaultConfiguration.size,t.style="string"==typeof t.style&&t.style in c?t.style:this.defaultConfiguration.style,t.additionalCssClasses=t.additionalCssClasses||this.defaultConfiguration.additionalCssClasses,t.callback="function"==typeof t.callback?t.callback:this.defaultConfiguration.callback,t.ajaxCallback="function"==typeof t.ajaxCallback?t.ajaxCallback:this.defaultConfiguration.ajaxCallback,t.ajaxTarget="string"==typeof t.ajaxTarget?t.ajaxTarget:this.defaultConfiguration.ajaxTarget,this.generate(t)}setButtons(t){const e=this.currentModal.find(d.footer);if(t.length>0){e.empty();for(let n=0;n<t.length;n++){const l=t[n],s=a.default("<button />",{class:"btn"});s.html("<span>"+this.securityUtility.encodeHtml(l.text,!1)+"</span>"),l.active&&s.addClass("t3js-active"),""!==l.btnClass&&s.addClass(l.btnClass),""!==l.name&&s.attr("name",l.name),l.action?s.on("click",()=>{e.find("button").not(s).addClass("disabled"),l.action.execute(s.get(0)).then(()=>{this.currentModal.modal("hide")})}):l.trigger&&s.on("click",l.trigger),l.dataAttributes&&Object.keys(l.dataAttributes).length>0&&Object.keys(l.dataAttributes).map(t=>{s.attr("data-"+t,l.dataAttributes[t])}),l.icon&&s.prepend('<span class="t3js-modal-icon-placeholder" data-icon="'+l.icon+'"></span>'),e.append(s)}e.show(),e.find("button").on("click",t=>{a.default(t.currentTarget).trigger("button.clicked")})}else e.hide();return this.currentModal}initializeMarkupTrigger(t){a.default(t).on("click",".t3js-modal-trigger",t=>{t.preventDefault();const e=a.default(t.currentTarget),l=e.data("content")||"Are you sure?",s=void 0!==n.SeverityEnum[e.data("severity")]?n.SeverityEnum[e.data("severity")]:n.SeverityEnum.info;let i=e.data("url")||null;if(null!==i){const t=i.includes("?")?"&":"?";i=i+t+a.default.param({data:e.data()})}this.advanced({type:null!==i?u.ajax:u.default,title:e.data("title")||"Alert",content:null!==i?i:l,severity:s,buttons:[{text:e.data("button-close-text")||TYPO3.lang["button.close"]||"Close",active:!0,btnClass:"btn-default",trigger:()=>{this.currentModal.trigger("modal-dismiss");const e=f.resolveEventNameTargetElement(t),a=f.createModalResponseEventFromElement(e,!1);null!==a&&e.dispatchEvent(a)}},{text:e.data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-"+o.getCssClass(s),trigger:()=>{this.currentModal.trigger("modal-dismiss");const a=f.resolveEventNameTargetElement(t),n=f.createModalResponseEventFromElement(a,!0);null!==n&&a.dispatchEvent(n);const l=e.data("href")||e.attr("href");l&&"#"!==l&&(t.target.ownerDocument.location.href=l)}}]})})}generate(t){const e=this.$template.clone();if(t.additionalCssClasses.length>0)for(let a of t.additionalCssClasses)e.addClass(a);if(e.addClass("modal-type-"+t.type),e.addClass("modal-severity-"+o.getCssClass(t.severity)),e.addClass("modal-style-"+t.style),e.addClass("modal-size-"+t.size),e.attr("tabindex","-1"),e.find(d.title).text(t.title),e.find(d.close).on("click",()=>{e.modal("hide")}),"ajax"===t.type){const a=t.ajaxTarget?t.ajaxTarget:d.body,n=e.find(a);i.getIcon("spinner-circle",i.sizes.default,null,null,i.markupIdentifiers.inline).then(e=>{n.html('<div class="modal-loading">'+e+"</div>"),new l(t.content).get().then(async e=>{const n=await e.raw().text();this.currentModal.parent().length||this.currentModal.appendTo("body"),this.currentModal.find(a).empty().append(n),t.ajaxCallback&&t.ajaxCallback(),this.currentModal.trigger("modal-loaded")})})}else"iframe"===t.type?(e.find(d.body).append(a.default("<iframe />",{src:t.content,name:"modal_frame",class:"modal-iframe t3js-modal-iframe"})),e.find(d.iframe).on("load",()=>{e.find(d.title).text(e.find(d.iframe).get(0).contentDocument.title)})):("string"==typeof t.content&&(t.content=a.default("<p />").html(this.securityUtility.encodeHtml(t.content))),e.find(d.body).append(t.content));return e.on("shown.bs.modal",t=>{const e=a.default(t.currentTarget);e.find(d.footer).find(".t3js-active").first().focus(),e.find(d.iconPlaceholder).each((t,e)=>{i.getIcon(a.default(e).data("icon"),i.sizes.small,null,null,i.markupIdentifiers.inline).then(t=>{this.currentModal.find(d.iconPlaceholder+"[data-icon="+a.default(t).data("identifier")+"]").replaceWith(t)})})}),e.on("hidden.bs.modal",t=>{if(this.instances.length>0){const t=this.instances.length-1;this.instances.splice(t,1),this.currentModal=this.instances[t-1]}e.trigger("modal-destroyed"),a.default(t.currentTarget).remove(),this.instances.length>0&&a.default("body").addClass("modal-open")}),e.on("show.bs.modal",e=>{this.currentModal=a.default(e.currentTarget),this.setButtons(t.buttons),this.instances.push(this.currentModal)}),e.on("modal-dismiss",t=>{a.default(t.currentTarget).modal("hide")}),t.callback&&t.callback(e),e.modal()}}let m=null;try{parent&&parent.window.TYPO3&&parent.window.TYPO3.Modal?(parent.window.TYPO3.Modal.initializeMarkupTrigger(document),m=parent.window.TYPO3.Modal):top&&top.TYPO3.Modal&&(top.TYPO3.Modal.initializeMarkupTrigger(document),m=top.TYPO3.Modal)}catch(t){}return m||(m=new f(new s),TYPO3.Modal=m),m}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","./Enum/Severity","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Core/SecurityUtility","./Icons","./Severity","bootstrap"],(function(t,e,a,n,l,s,i,o){"use strict";var d,r,c,u;a=__importDefault(a),function(t){t.modal=".t3js-modal",t.content=".t3js-modal-content",t.title=".t3js-modal-title",t.close=".t3js-modal-close",t.body=".t3js-modal-body",t.footer=".t3js-modal-footer",t.iframe=".t3js-modal-iframe",t.iconPlaceholder=".t3js-modal-icon-placeholder"}(d||(d={})),function(t){t.small="small",t.default="default",t.medium="medium",t.large="large",t.full="full"}(r||(r={})),function(t){t.default="default",t.light="light",t.dark="dark"}(c||(c={})),function(t){t.default="default",t.ajax="ajax",t.iframe="iframe"}(u||(u={}));class f{constructor(t){this.sizes=r,this.styles=c,this.types=u,this.currentModal=null,this.instances=[],this.$template=a.default('\n <div class="t3js-modal modal fade">\n <div class="modal-dialog">\n <div class="t3js-modal-content modal-content">\n <div class="modal-header">\n <h4 class="t3js-modal-title modal-title"></h4>\n <button class="t3js-modal-close close">\n <span aria-hidden="true">\n <span class="t3js-modal-icon-placeholder" data-icon="actions-close"></span>\n </span>\n <span class="sr-only"></span>\n </button>\n </div>\n <div class="t3js-modal-body modal-body"></div>\n <div class="t3js-modal-footer modal-footer"></div>\n </div>\n </div>\n </div>'),this.defaultConfiguration={type:u.default,title:"Information",content:"No content provided, please check your <code>Modal</code> configuration.",severity:n.SeverityEnum.notice,buttons:[],style:c.default,size:r.default,additionalCssClasses:[],callback:a.default.noop(),ajaxCallback:a.default.noop(),ajaxTarget:null},this.securityUtility=t,a.default(document).on("modal-dismiss",this.dismiss),this.initializeMarkupTrigger(document)}static resolveEventNameTargetElement(t){const e=t.target,a=t.currentTarget;return e.dataset&&e.dataset.eventName?e:a.dataset&&a.dataset.eventName?a:null}static createModalResponseEventFromElement(t,e){return t&&t.dataset.eventName?new CustomEvent(t.dataset.eventName,{bubbles:!0,detail:{result:e,payload:t.dataset.eventPayload||null}}):null}dismiss(){this.currentModal&&this.currentModal.modal("hide")}confirm(t,e,l=n.SeverityEnum.warning,s=[],i){return 0===s.length&&s.push({text:a.default(this).data("button-close-text")||TYPO3.lang["button.cancel"]||"Cancel",active:!0,btnClass:"btn-default",name:"cancel"},{text:a.default(this).data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-"+o.getCssClass(l),name:"ok"}),this.advanced({title:t,content:e,severity:l,buttons:s,additionalCssClasses:i,callback:t=>{t.on("button.clicked",t=>{"cancel"===t.target.getAttribute("name")?a.default(t.currentTarget).trigger("confirm.button.cancel"):"ok"===t.target.getAttribute("name")&&a.default(t.currentTarget).trigger("confirm.button.ok")})}})}loadUrl(t,e=n.SeverityEnum.info,a,l,s,i){return this.advanced({type:u.ajax,title:t,severity:e,buttons:a,ajaxCallback:s,ajaxTarget:i,content:l})}show(t,e,a=n.SeverityEnum.info,l,s){return this.advanced({type:u.default,title:t,content:e,severity:a,buttons:l,additionalCssClasses:s})}advanced(t){return t.type="string"==typeof t.type&&t.type in u?t.type:this.defaultConfiguration.type,t.title="string"==typeof t.title?t.title:this.defaultConfiguration.title,t.content="string"==typeof t.content||"object"==typeof t.content?t.content:this.defaultConfiguration.content,t.severity=void 0!==t.severity?t.severity:this.defaultConfiguration.severity,t.buttons=t.buttons||this.defaultConfiguration.buttons,t.size="string"==typeof t.size&&t.size in r?t.size:this.defaultConfiguration.size,t.style="string"==typeof t.style&&t.style in c?t.style:this.defaultConfiguration.style,t.additionalCssClasses=t.additionalCssClasses||this.defaultConfiguration.additionalCssClasses,t.callback="function"==typeof t.callback?t.callback:this.defaultConfiguration.callback,t.ajaxCallback="function"==typeof t.ajaxCallback?t.ajaxCallback:this.defaultConfiguration.ajaxCallback,t.ajaxTarget="string"==typeof t.ajaxTarget?t.ajaxTarget:this.defaultConfiguration.ajaxTarget,this.generate(t)}setButtons(t){const e=this.currentModal.find(d.footer);if(t.length>0){e.empty();for(let n=0;n<t.length;n++){const l=t[n],s=a.default("<button />",{class:"btn"});s.html("<span>"+this.securityUtility.encodeHtml(l.text,!1)+"</span>"),l.active&&s.addClass("t3js-active"),""!==l.btnClass&&s.addClass(l.btnClass),""!==l.name&&s.attr("name",l.name),l.action?s.on("click",()=>{e.find("button").not(s).addClass("disabled"),l.action.execute(s.get(0)).then(()=>{this.currentModal.modal("hide")})}):l.trigger&&s.on("click",l.trigger),l.dataAttributes&&Object.keys(l.dataAttributes).length>0&&Object.keys(l.dataAttributes).map(t=>{s.attr("data-"+t,l.dataAttributes[t])}),l.icon&&s.prepend('<span class="t3js-modal-icon-placeholder" data-icon="'+l.icon+'"></span>'),e.append(s)}e.show(),e.find("button").on("click",t=>{a.default(t.currentTarget).trigger("button.clicked")})}else e.hide();return this.currentModal}initializeMarkupTrigger(t){a.default(t).on("click",".t3js-modal-trigger",t=>{t.preventDefault();const e=a.default(t.currentTarget),l=e.data("bs-content")||"Are you sure?",s=void 0!==n.SeverityEnum[e.data("severity")]?n.SeverityEnum[e.data("severity")]:n.SeverityEnum.info;let i=e.data("url")||null;if(null!==i){const t=i.includes("?")?"&":"?";i=i+t+a.default.param({data:e.data()})}this.advanced({type:null!==i?u.ajax:u.default,title:e.data("title")||"Alert",content:null!==i?i:l,severity:s,buttons:[{text:e.data("button-close-text")||TYPO3.lang["button.close"]||"Close",active:!0,btnClass:"btn-default",trigger:()=>{this.currentModal.trigger("modal-dismiss");const e=f.resolveEventNameTargetElement(t),a=f.createModalResponseEventFromElement(e,!1);null!==a&&e.dispatchEvent(a)}},{text:e.data("button-ok-text")||TYPO3.lang["button.ok"]||"OK",btnClass:"btn-"+o.getCssClass(s),trigger:()=>{this.currentModal.trigger("modal-dismiss");const a=f.resolveEventNameTargetElement(t),n=f.createModalResponseEventFromElement(a,!0);null!==n&&a.dispatchEvent(n);const l=e.data("href")||e.attr("href");l&&"#"!==l&&(t.target.ownerDocument.location.href=l)}}]})})}generate(t){const e=this.$template.clone();if(t.additionalCssClasses.length>0)for(let a of t.additionalCssClasses)e.addClass(a);if(e.addClass("modal-type-"+t.type),e.addClass("modal-severity-"+o.getCssClass(t.severity)),e.addClass("modal-style-"+t.style),e.addClass("modal-size-"+t.size),e.attr("tabindex","-1"),e.find(d.title).text(t.title),e.find(d.close).on("click",()=>{e.modal("hide")}),"ajax"===t.type){const a=t.ajaxTarget?t.ajaxTarget:d.body,n=e.find(a);i.getIcon("spinner-circle",i.sizes.default,null,null,i.markupIdentifiers.inline).then(e=>{n.html('<div class="modal-loading">'+e+"</div>"),new l(t.content).get().then(async e=>{const n=await e.raw().text();this.currentModal.parent().length||this.currentModal.appendTo("body"),this.currentModal.find(a).empty().append(n),t.ajaxCallback&&t.ajaxCallback(),this.currentModal.trigger("modal-loaded")})})}else"iframe"===t.type?(e.find(d.body).append(a.default("<iframe />",{src:t.content,name:"modal_frame",class:"modal-iframe t3js-modal-iframe"})),e.find(d.iframe).on("load",()=>{e.find(d.title).text(e.find(d.iframe).get(0).contentDocument.title)})):("string"==typeof t.content&&(t.content=a.default("<p />").html(this.securityUtility.encodeHtml(t.content))),e.find(d.body).append(t.content));return e.on("shown.bs.modal",t=>{const e=a.default(t.currentTarget);e.find(d.footer).find(".t3js-active").first().focus(),e.find(d.iconPlaceholder).each((t,e)=>{i.getIcon(a.default(e).data("icon"),i.sizes.small,null,null,i.markupIdentifiers.inline).then(t=>{this.currentModal.find(d.iconPlaceholder+"[data-icon="+a.default(t).data("identifier")+"]").replaceWith(t)})})}),e.on("hidden.bs.modal",t=>{if(this.instances.length>0){const t=this.instances.length-1;this.instances.splice(t,1),this.currentModal=this.instances[t-1]}e.trigger("modal-destroyed"),a.default(t.currentTarget).remove(),this.instances.length>0&&a.default("body").addClass("modal-open")}),e.on("show.bs.modal",e=>{this.currentModal=a.default(e.currentTarget),this.setButtons(t.buttons),this.instances.push(this.currentModal)}),e.on("modal-dismiss",t=>{a.default(t.currentTarget).modal("hide")}),t.callback&&t.callback(e),e.modal("show")}}let m=null;try{parent&&parent.window.TYPO3&&parent.window.TYPO3.Modal?(parent.window.TYPO3.Modal.initializeMarkupTrigger(document),m=parent.window.TYPO3.Modal):top&&top.TYPO3.Modal&&(top.TYPO3.Modal.initializeMarkupTrigger(document),m=top.TYPO3.Modal)}catch(t){}return m||(m=new f(new s),TYPO3.Modal=m),m}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","./Enum/Severity","jquery","./Modal","./Severity","./Icons"],(function(t,e,s,i,r,a,l){"use strict";i=__importDefault(i);class n{constructor(){this.setup={slides:[],settings:{},forceSelection:!0,$carousel:null},this.originalSetup=i.default.extend(!0,{},this.setup)}set(t,e){return this.setup.settings[t]=e,this}addSlide(t,e,i="",r=s.SeverityEnum.info,a,l){const n={identifier:t,title:e,content:i,severity:r,progressBarTitle:a,callback:l};return this.setup.slides.push(n),this}addFinalProcessingSlide(t){return t||(t=()=>{this.dismiss()}),l.getIcon("spinner-circle",l.sizes.default,null,null).then(e=>{let s=i.default("<div />",{class:"text-center"}).append(e);this.addSlide("final-processing-slide",top.TYPO3.lang["wizard.processing.title"],s[0].outerHTML,a.info,null,t)})}show(){let t=this.generateSlides(),e=this.setup.slides[0];r.confirm(e.title,t,e.severity,[{text:top.TYPO3.lang["wizard.button.cancel"],active:!0,btnClass:"btn-default pull-left",name:"cancel",trigger:()=>{this.getComponent().trigger("wizard-dismiss")}},{text:top.TYPO3.lang["wizard.button.prev"],btnClass:"btn-"+a.getCssClass(e.severity),name:"prev"},{text:top.TYPO3.lang["wizard.button.next"],btnClass:"btn-"+a.getCssClass(e.severity),name:"next"}],["modal-multi-step-wizard"]),this.addButtonContainer(),this.addProgressBar(),this.initializeEvents(),this.getComponent().on("wizard-visible",()=>{this.runSlideCallback(e,this.setup.$carousel.find(".item").first())}).on("wizard-dismissed",()=>{this.setup=i.default.extend(!0,{},this.originalSetup)})}getComponent(){return null===this.setup.$carousel&&this.generateSlides(),this.setup.$carousel}dismiss(){r.dismiss()}lockNextStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="next"]');return t.prop("disabled",!0),t}unlockNextStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="next"]');return t.prop("disabled",!1),t}lockPrevStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="prev"]');return t.prop("disabled",!0),t}unlockPrevStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="prev"]');return t.prop("disabled",!1),t}triggerStepButton(t){let e=this.setup.$carousel.closest(".modal").find('button[name="'+t+'"]');return e.length>0&&!0!==e.prop("disabled")&&e.trigger("click"),e}blurCancelStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="cancel"]');return t.trigger("blur"),t}initializeEvents(){let t=this.setup.$carousel.closest(".modal");this.initializeSlideNextEvent(t),this.initializeSlidePrevEvent(t),this.setup.$carousel.on("slide.bs.carousel",e=>{"left"===e.direction?this.nextSlideChanges(t):this.prevSlideChanges(t)}).on("slid.bs.carousel",t=>{let e=this.setup.$carousel.data("currentIndex"),s=this.setup.slides[e];this.runSlideCallback(s,i.default(t.relatedTarget)),this.setup.forceSelection&&this.lockNextStep()});let e=this.getComponent();e.on("wizard-dismiss",this.dismiss),r.currentModal.on("hidden.bs.modal",()=>{e.trigger("wizard-dismissed")}).on("shown.bs.modal",()=>{e.trigger("wizard-visible")})}initializeSlideNextEvent(t){t.find(".modal-footer").find('button[name="next"]').off().on("click",()=>{this.setup.$carousel.carousel("next")})}initializeSlidePrevEvent(t){t.find(".modal-footer").find('button[name="prev"]').off().on("click",()=>{this.setup.$carousel.carousel("prev")})}nextSlideChanges(t){this.initializeSlideNextEvent(t);let e=t.find(".modal-title"),s=t.find(".modal-footer"),i=t.find(".modal-btn-group"),r=s.find('button[name="next"]'),l=this.setup.$carousel.data("currentSlide")+1,n=this.setup.$carousel.data("currentIndex")+1;e.text(this.setup.slides[n].title),this.setup.$carousel.data("currentSlide",l),this.setup.$carousel.data("currentIndex",n),l>=this.setup.$carousel.data("realSlideCount")?(r.text(this.getProgressBarTitle(this.setup.$carousel.data("currentIndex"))),s.find(".progress-bar.first-step").width("100%").text(this.getProgressBarTitle(this.setup.$carousel.data("currentIndex"))),s.find(".progress-bar.last-step").width("0%").text(""),this.setup.forceSelection=!1):(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*l+"%").text(this.getProgressBarTitle(n)),s.find(".progress-bar.step").width("0%").text(""),i.slideDown()),r.removeClass("btn-"+a.getCssClass(this.setup.slides[n-1].severity)).addClass("btn-"+a.getCssClass(this.setup.slides[n].severity)),t.removeClass("modal-severity-"+a.getCssClass(this.setup.slides[n-1].severity)).addClass("modal-severity-"+a.getCssClass(this.setup.slides[n].severity))}prevSlideChanges(t){this.initializeSlidePrevEvent(t);let e=t.find(".modal-title"),s=t.find(".modal-footer"),i=t.find(".modal-btn-group"),r=s.find('button[name="next"]'),a=this.setup.$carousel.data("currentSlide")-1,l=this.setup.$carousel.data("currentIndex")-1;this.setup.$carousel.data("currentSlide",a),this.setup.$carousel.data("currentIndex",l),e.text(this.setup.slides[l].title),s.find(".progress-bar.last-step").width(this.setup.$carousel.data("initialStep")+"%").text(this.getProgressBarTitle(this.setup.$carousel.data("slideCount")-1)),r.text(top.TYPO3.lang["wizard.button.next"]),1===a?(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*a+"%").text(this.getProgressBarTitle(0)),s.find(".progress-bar.step").width(this.setup.$carousel.data("initialStep")+"%").text(this.getProgressBarTitle(l+1)),i.slideUp()):(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*a+"%").text(this.getProgressBarTitle(l)),this.setup.forceSelection=!0)}getProgressBarTitle(t){let e;return e=null===this.setup.slides[t].progressBarTitle?0===t?top.TYPO3.lang["wizard.progressStep.start"]:t>=this.setup.$carousel.data("slideCount")-1?top.TYPO3.lang["wizard.progressStep.finish"]:top.TYPO3.lang["wizard.progressStep"]+String(t+1):this.setup.slides[t].progressBarTitle,e}runSlideCallback(t,e){"function"==typeof t.callback&&t.callback(e,this.setup.settings,t.identifier)}addProgressBar(){let t,e=this.setup.$carousel.find(".item").length-1,s=Math.max(1,e),r=this.setup.$carousel.closest(".modal").find(".modal-footer");if(t=Math.round(100/s),this.setup.$carousel.data("initialStep",t).data("slideCount",s).data("realSlideCount",e).data("currentIndex",0).data("currentSlide",1),s>1){r.prepend(i.default("<div />",{class:"progress"}));for(let e=0;e<this.setup.slides.length;++e){let s;s=0===e?"progress-bar first-step":e===this.setup.$carousel.data("slideCount")-1?"progress-bar last-step inactive":"progress-bar step inactive",r.find(".progress").append(i.default("<div />",{role:"progressbar",class:s,"aria-valuemin":0,"aria-valuenow":t,"aria-valuemax":100}).width(t+"%").text(this.getProgressBarTitle(e)))}}}addButtonContainer(){this.setup.$carousel.closest(".modal").find(".modal-footer .btn").wrapAll('<div class="modal-btn-group" />')}generateSlides(){if(null!==this.setup.$carousel)return this.setup.$carousel;let t='<div class="carousel slide" data-ride="carousel" data-interval="false"><div class="carousel-inner" role="listbox">';for(let e=0;e<this.setup.slides.length;++e){let s=this.setup.slides[e],i=s.content;"object"==typeof i&&(i=i.html()),t+='<div class="item" data-slide="'+s.identifier+'" data-step="'+e+'">'+i+"</div>"}return t+="</div></div>",this.setup.$carousel=i.default(t),this.setup.$carousel.find(".item").first().addClass("active"),this.setup.$carousel}}let d;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.MultiStepWizard&&(d=window.opener.TYPO3.MultiStepWizard),parent&&parent.window.TYPO3&&parent.window.TYPO3.MultiStepWizard&&(d=parent.window.TYPO3.MultiStepWizard),top&&top.TYPO3&&top.TYPO3.MultiStepWizard&&(d=top.TYPO3.MultiStepWizard)}catch(t){}return d||(d=new n,"undefined"!=typeof TYPO3&&(TYPO3.MultiStepWizard=d)),d}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","./Enum/Severity","jquery","./Modal","./Severity","./Icons"],(function(t,e,s,i,r,a,l){"use strict";i=__importDefault(i);class n{constructor(){this.setup={slides:[],settings:{},forceSelection:!0,$carousel:null},this.originalSetup=i.default.extend(!0,{},this.setup)}set(t,e){return this.setup.settings[t]=e,this}addSlide(t,e,i="",r=s.SeverityEnum.info,a,l){const n={identifier:t,title:e,content:i,severity:r,progressBarTitle:a,callback:l};return this.setup.slides.push(n),this}addFinalProcessingSlide(t){return t||(t=()=>{this.dismiss()}),l.getIcon("spinner-circle",l.sizes.default,null,null).then(e=>{let s=i.default("<div />",{class:"text-center"}).append(e);this.addSlide("final-processing-slide",top.TYPO3.lang["wizard.processing.title"],s[0].outerHTML,a.info,null,t)})}show(){let t=this.generateSlides(),e=this.setup.slides[0];r.confirm(e.title,t,e.severity,[{text:top.TYPO3.lang["wizard.button.cancel"],active:!0,btnClass:"btn-default pull-left",name:"cancel",trigger:()=>{this.getComponent().trigger("wizard-dismiss")}},{text:top.TYPO3.lang["wizard.button.prev"],btnClass:"btn-"+a.getCssClass(e.severity),name:"prev"},{text:top.TYPO3.lang["wizard.button.next"],btnClass:"btn-"+a.getCssClass(e.severity),name:"next"}],["modal-multi-step-wizard"]),this.addButtonContainer(),this.addProgressBar(),this.initializeEvents(),this.getComponent().on("wizard-visible",()=>{this.runSlideCallback(e,this.setup.$carousel.find(".item").first())}).on("wizard-dismissed",()=>{this.setup=i.default.extend(!0,{},this.originalSetup)})}getComponent(){return null===this.setup.$carousel&&this.generateSlides(),this.setup.$carousel}dismiss(){r.dismiss()}lockNextStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="next"]');return t.prop("disabled",!0),t}unlockNextStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="next"]');return t.prop("disabled",!1),t}lockPrevStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="prev"]');return t.prop("disabled",!0),t}unlockPrevStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="prev"]');return t.prop("disabled",!1),t}triggerStepButton(t){let e=this.setup.$carousel.closest(".modal").find('button[name="'+t+'"]');return e.length>0&&!0!==e.prop("disabled")&&e.trigger("click"),e}blurCancelStep(){let t=this.setup.$carousel.closest(".modal").find('button[name="cancel"]');return t.trigger("blur"),t}initializeEvents(){let t=this.setup.$carousel.closest(".modal");this.initializeSlideNextEvent(t),this.initializeSlidePrevEvent(t),this.setup.$carousel.on("slide.bs.carousel",e=>{"left"===e.direction?this.nextSlideChanges(t):this.prevSlideChanges(t)}).on("slid.bs.carousel",t=>{let e=this.setup.$carousel.data("currentIndex"),s=this.setup.slides[e];this.runSlideCallback(s,i.default(t.relatedTarget)),this.setup.forceSelection&&this.lockNextStep()});let e=this.getComponent();e.on("wizard-dismiss",this.dismiss),r.currentModal.on("hidden.bs.modal",()=>{e.trigger("wizard-dismissed")}).on("shown.bs.modal",()=>{e.trigger("wizard-visible")})}initializeSlideNextEvent(t){t.find(".modal-footer").find('button[name="next"]').off().on("click",()=>{this.setup.$carousel.carousel("next")})}initializeSlidePrevEvent(t){t.find(".modal-footer").find('button[name="prev"]').off().on("click",()=>{this.setup.$carousel.carousel("prev")})}nextSlideChanges(t){this.initializeSlideNextEvent(t);let e=t.find(".modal-title"),s=t.find(".modal-footer"),i=t.find(".modal-btn-group"),r=s.find('button[name="next"]'),l=this.setup.$carousel.data("currentSlide")+1,n=this.setup.$carousel.data("currentIndex")+1;e.text(this.setup.slides[n].title),this.setup.$carousel.data("currentSlide",l),this.setup.$carousel.data("currentIndex",n),l>=this.setup.$carousel.data("realSlideCount")?(r.text(this.getProgressBarTitle(this.setup.$carousel.data("currentIndex"))),s.find(".progress-bar.first-step").width("100%").text(this.getProgressBarTitle(this.setup.$carousel.data("currentIndex"))),s.find(".progress-bar.last-step").width("0%").text(""),this.setup.forceSelection=!1):(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*l+"%").text(this.getProgressBarTitle(n)),s.find(".progress-bar.step").width("0%").text(""),i.slideDown()),r.removeClass("btn-"+a.getCssClass(this.setup.slides[n-1].severity)).addClass("btn-"+a.getCssClass(this.setup.slides[n].severity)),t.removeClass("modal-severity-"+a.getCssClass(this.setup.slides[n-1].severity)).addClass("modal-severity-"+a.getCssClass(this.setup.slides[n].severity))}prevSlideChanges(t){this.initializeSlidePrevEvent(t);let e=t.find(".modal-title"),s=t.find(".modal-footer"),i=t.find(".modal-btn-group"),r=s.find('button[name="next"]'),a=this.setup.$carousel.data("currentSlide")-1,l=this.setup.$carousel.data("currentIndex")-1;this.setup.$carousel.data("currentSlide",a),this.setup.$carousel.data("currentIndex",l),e.text(this.setup.slides[l].title),s.find(".progress-bar.last-step").width(this.setup.$carousel.data("initialStep")+"%").text(this.getProgressBarTitle(this.setup.$carousel.data("slideCount")-1)),r.text(top.TYPO3.lang["wizard.button.next"]),1===a?(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*a+"%").text(this.getProgressBarTitle(0)),s.find(".progress-bar.step").width(this.setup.$carousel.data("initialStep")+"%").text(this.getProgressBarTitle(l+1)),i.slideUp()):(s.find(".progress-bar.first-step").width(this.setup.$carousel.data("initialStep")*a+"%").text(this.getProgressBarTitle(l)),this.setup.forceSelection=!0)}getProgressBarTitle(t){let e;return e=null===this.setup.slides[t].progressBarTitle?0===t?top.TYPO3.lang["wizard.progressStep.start"]:t>=this.setup.$carousel.data("slideCount")-1?top.TYPO3.lang["wizard.progressStep.finish"]:top.TYPO3.lang["wizard.progressStep"]+String(t+1):this.setup.slides[t].progressBarTitle,e}runSlideCallback(t,e){"function"==typeof t.callback&&t.callback(e,this.setup.settings,t.identifier)}addProgressBar(){let t,e=this.setup.$carousel.find(".item").length-1,s=Math.max(1,e),r=this.setup.$carousel.closest(".modal").find(".modal-footer");if(t=Math.round(100/s),this.setup.$carousel.data("initialStep",t).data("slideCount",s).data("realSlideCount",e).data("currentIndex",0).data("currentSlide",1),s>1){r.prepend(i.default("<div />",{class:"progress"}));for(let e=0;e<this.setup.slides.length;++e){let s;s=0===e?"progress-bar first-step":e===this.setup.$carousel.data("slideCount")-1?"progress-bar last-step inactive":"progress-bar step inactive",r.find(".progress").append(i.default("<div />",{role:"progressbar",class:s,"aria-valuemin":0,"aria-valuenow":t,"aria-valuemax":100}).width(t+"%").text(this.getProgressBarTitle(e)))}}}addButtonContainer(){this.setup.$carousel.closest(".modal").find(".modal-footer .btn").wrapAll('<div class="modal-btn-group" />')}generateSlides(){if(null!==this.setup.$carousel)return this.setup.$carousel;let t='<div class="carousel slide" data-bs-ride="carousel" data-bs-interval="false"><div class="carousel-inner" role="listbox">';for(let e=0;e<this.setup.slides.length;++e){let s=this.setup.slides[e],i=s.content;"object"==typeof i&&(i=i.html()),t+='<div class="item" data-bs-slide="'+s.identifier+'" data-step="'+e+'">'+i+"</div>"}return t+="</div></div>",this.setup.$carousel=i.default(t),this.setup.$carousel.find(".item").first().addClass("active"),this.setup.$carousel}}let d;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.MultiStepWizard&&(d=window.opener.TYPO3.MultiStepWizard),parent&&parent.window.TYPO3&&parent.window.TYPO3.MultiStepWizard&&(d=parent.window.TYPO3.MultiStepWizard),top&&top.TYPO3&&top.TYPO3.MultiStepWizard&&(d=top.TYPO3.MultiStepWizard)}catch(t){}return d||(d=new n,"undefined"!=typeof TYPO3&&(TYPO3.MultiStepWizard=d)),d}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Enum/Severity","./Severity"],(function(e,t,a,s,i){"use strict";a=__importDefault(a);class n{static notice(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.notice,a,i)}static info(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.info,a,i)}static success(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.ok,a,i)}static warning(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.warning,a,i)}static error(e,t,a=0,i){n.showMessage(e,t,s.SeverityEnum.error,a,i)}static showMessage(e,t,n=s.SeverityEnum.info,r=this.duration,o=[]){const l=i.getCssClass(n);let c="";switch(n){case s.SeverityEnum.notice:c="lightbulb-o";break;case s.SeverityEnum.ok:c="check";break;case s.SeverityEnum.warning:c="exclamation";break;case s.SeverityEnum.error:c="times";break;case s.SeverityEnum.info:default:c="info"}r=void 0===r?this.duration:"string"==typeof r?parseFloat(r):r,null!==this.messageContainer&&null!==document.getElementById("alert-container")||(this.messageContainer=a.default("<div>",{id:"alert-container"}).appendTo("body"));const d="notification-"+Math.random().toString(36).substr(2,5),u=a.default('<div id="'+d+'" class="alert alert-'+l+' alert-dismissible fade" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span><span class="sr-only">Close</span></button><div class="media"><div class="media-left"><span class="fa-stack fa-lg"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-'+c+' fa-stack-1x"></i></span></div><div class="media-body"><h4 class="alert-title"></h4><p class="alert-message text-pre-wrap"></p></div></div><div class="alert-actions"></div></div>');u.find(".alert-title").text(e),u.find(".alert-message").text(t);const f=u.find(".alert-actions");if(o.length>0)for(let e of o){const t=a.default("<a />",{href:"#",title:e.label});t.text(e.label),t.on("click",t=>{u.clearQueue();const a=t.currentTarget;a.classList.add("executing"),f.find("a").not(a).addClass("disabled"),e.action.execute(a).then(()=>{u.alert("close")})}),f.append(t)}else f.remove();u.on("close.bs.alert",e=>{e.preventDefault();const t=a.default(e.currentTarget);t.clearQueue().queue(e=>{t.removeClass("in"),e()}).slideUp({complete:()=>{t.remove()}})}),u.appendTo(this.messageContainer),u.delay(200).queue(e=>{u.addClass("in"),e()}),r>0&&u.delay(1e3*r).queue(e=>{u.alert("close"),e()})}}let r;n.duration=5,n.messageContainer=null;try{parent&&parent.window.TYPO3&&parent.window.TYPO3.Notification&&(r=parent.window.TYPO3.Notification),top&&top.TYPO3.Notification&&(r=top.TYPO3.Notification)}catch(e){}return r||(r=n,"undefined"!=typeof TYPO3&&(TYPO3.Notification=r)),r}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","jquery","./Enum/Severity","./Severity","bootstrap"],(function(e,t,a,s,i){"use strict";a=__importDefault(a);class n{static notice(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.notice,a,i)}static info(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.info,a,i)}static success(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.ok,a,i)}static warning(e,t,a,i){n.showMessage(e,t,s.SeverityEnum.warning,a,i)}static error(e,t,a=0,i){n.showMessage(e,t,s.SeverityEnum.error,a,i)}static showMessage(e,t,n=s.SeverityEnum.info,r=this.duration,o=[]){const l=i.getCssClass(n);let c="";switch(n){case s.SeverityEnum.notice:c="lightbulb-o";break;case s.SeverityEnum.ok:c="check";break;case s.SeverityEnum.warning:c="exclamation";break;case s.SeverityEnum.error:c="times";break;case s.SeverityEnum.info:default:c="info"}r=void 0===r?this.duration:"string"==typeof r?parseFloat(r):r,null!==this.messageContainer&&null!==document.getElementById("alert-container")||(this.messageContainer=a.default("<div>",{id:"alert-container"}).appendTo("body"));const d="notification-"+Math.random().toString(36).substr(2,5),u=a.default('<div id="'+d+'" class="alert alert-'+l+' alert-dismissible fade" role="alert"><button type="button" class="close" data-bs-dismiss="alert"><span aria-hidden="true"><i class="fa fa-times-circle"></i></span><span class="sr-only">Close</span></button><div class="media"><div class="media-left"><span class="fa-stack fa-lg"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-'+c+' fa-stack-1x"></i></span></div><div class="media-body"><h4 class="alert-title"></h4><p class="alert-message text-pre-wrap"></p></div></div><div class="alert-actions"></div></div>');u.find(".alert-title").text(e),u.find(".alert-message").text(t);const f=u.find(".alert-actions");if(o.length>0)for(let e of o){const t=a.default("<a />",{href:"#",title:e.label});t.text(e.label),t.on("click",t=>{u.clearQueue();const a=t.currentTarget;a.classList.add("executing"),f.find("a").not(a).addClass("disabled"),e.action.execute(a).then(()=>{u.alert("close")})}),f.append(t)}else f.remove();u.on("close.bs.alert",e=>{e.preventDefault();const t=a.default(e.currentTarget);t.clearQueue().queue(e=>{t.removeClass("in"),e()}).slideUp({complete:()=>{t.remove()}})}),u.appendTo(this.messageContainer),u.delay(200).queue(e=>{u.addClass("in"),e()}),r>0&&u.delay(1e3*r).queue(e=>{u.alert("close"),e()})}}let r;n.duration=5,n.messageContainer=null;try{parent&&parent.window.TYPO3&&parent.window.TYPO3.Notification&&(r=parent.window.TYPO3.Notification),top&&top.TYPO3.Notification&&(r=top.TYPO3.Notification)}catch(e){}return r||(r=n,"undefined"!=typeof TYPO3&&(TYPO3.Notification=r)),r}));
\ No newline at end of file
......@@ -67,7 +67,7 @@ define(['jquery',
// Ensure tooltips don't stay when scrolling the pagetree
$('#typo3-pagetree-tree').on('scroll', function () {
$(this).find('[data-toggle=tooltip]').tooltip('hide');
$(this).find('[data-bs-toggle=tooltip]').tooltip('hide');
});
var dataUrl = top.TYPO3.settings.ajaxUrls.page_tree_data;
......
......@@ -205,7 +205,7 @@ define(['jquery',
this.search(e.target);
}.bind(this), this.settings.filterTimeout).bindTo(document.querySelector(this.settings.searchInput));
$toolbar.find('[data-toggle="tooltip"]').tooltip();
$toolbar.find('[data-bs-toggle="tooltip"]').tooltip();
if ($('[data-tree-show-submenu="page-new"]').length) {
$('[data-tree-show-submenu="page-new"]').trigger('click');
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","bootstrap"],(function(t,o,e){"use strict";e=__importDefault(e);return new class{constructor(){this.DEFAULT_SELECTOR='[data-toggle="popover"]',this.initialize()}initialize(t){t=t||this.DEFAULT_SELECTOR,e.default(t).popover()}popover(t){t.popover()}setOptions(t,o){const e=(o=o||{}).title||t.data("title")||"",r=o.content||t.data("content")||"";t.attr("data-original-title",e).attr("data-content",r).attr("data-placement","auto").popover(o)}setOption(t,o,e){t.data("bs.popover").options[o]=e}show(t){t.popover("show")}hide(t){t.popover("hide")}destroy(t){t.popover("destroy")}toggle(t){t.popover("toggle")}}}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","bootstrap"],(function(t,e,o,a){"use strict";o=__importDefault(o);return new class{constructor(){this.DEFAULT_SELECTOR='[data-bs-toggle="popover"]',this.initialize()}initialize(t){t=t||this.DEFAULT_SELECTOR,o.default(t).each((t,e)=>{const s=new a.Popover(e);o.default(e).data("typo3.bs.popover",s)})}popover(t){t.each((t,e)=>{const s=new a.Popover(e);o.default(e).data("typo3.bs.popover",s)})}setOptions(t,e){const a=(e=e||{}).title||t.data("title")||"",s=e.content||t.data("bs-content")||"";t.attr("data-bs-original-title",a).attr("data-bs-content",s).attr("data-bs-placement","auto"),o.default.each(e,(e,o)=>{this.setOption(t,e,o)})}setOption(t,e,a){"content"===e?t.attr("data-bs-content",a):t.each((t,s)=>{const n=o.default(s).data("typo3.bs.popover");n&&(n.config[e]=a)})}show(t){t.each((t,e)=>{const a=o.default(e).data("typo3.bs.popover");a&&a.show()})}hide(t){t.each((t,e)=>{const a=o.default(e).data("typo3.bs.popover");a&&a.hide()})}destroy(t){t.each((t,e)=>{const a=o.default(e).data("typo3.bs.popover");a&&a.dispose()})}toggle(t){t.each((t,e)=>{const a=o.default(e).data("typo3.bs.popover");a&&a.toggle()})}}}));
\ No newline at end of file
......@@ -909,7 +909,7 @@ define(
.append('g')
.attr('class', 'node-icon-container')
.attr('title', this.getNodeTitle)
.attr('data-toggle', 'tooltip')
.attr('data-bs-toggle', 'tooltip')
.on('click', function(node) {
_this.clickOnIcon(node, this);
});
......@@ -932,7 +932,7 @@ define(
.attr('class', 'node-icon-locked');
}
Tooltip.initialize('[data-toggle="tooltip"]', {
Tooltip.initialize('[data-bs-toggle="tooltip"]', {
delay: {
"show": 50,
"hide": 50
......
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","bootstrap"],(function(t,i,e){"use strict";e=__importDefault(e);const o=new class{constructor(){e.default(()=>{this.initialize('[data-toggle="tooltip"]')})}initialize(t,i){(i=i||{}).title=i.title||"",e.default(t).tooltip(i)}show(t,i){t.attr("data-placement","auto").attr("data-title",i).tooltip("show")}hide(t){t.tooltip("hide")}};return TYPO3.Tooltip=o,o}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};define(["require","exports","jquery","bootstrap"],(function(t,i,e){"use strict";e=__importDefault(e);const o=new class{constructor(){e.default(()=>{this.initialize('[data-bs-toggle="tooltip"]')})}initialize(t,i){(i=i||{}).title=i.title||"",e.default(t).tooltip(i)}show(t,i){t.attr("data-bs-placement","auto").attr("data-title",i).tooltip("show")}hide(t){t.tooltip("hide")}};return TYPO3.Tooltip=o,o}));
\ No newline at end of file
......@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./Enum/Severity","jquery","./Modal","./Severity","./Icons"],(function(e,t,s,i,a,l,r){"use strict";i=__importDefault(i);class n{constructor(){this.setup={slides:[],settings:{},forceSelection:!0,$carousel:null},this.originalSetup=i.default.extend(!0,{},this.setup)}set(e,t){return this.setup.settings[e]=t,this}addSlide(e,t,i="",a=s.SeverityEnum.info,l){const r={identifier:e,title:t,content:i,severity:a,callback:l};return this.setup.slides.push(r),this}addFinalProcessingSlide(e){return e||(e=()=>{this.dismiss()}),r.getIcon("spinner-circle-dark",r.sizes.large,null,null).then(t=>{let s=i.default("<div />",{class:"text-center"}).append(t);this.addSlide("final-processing-slide",top.TYPO3.lang["wizard.processing.title"],s[0].outerHTML,l.info,e)})}show(){let e=this.generateSlides(),t=this.setup.slides[0];a.confirm(t.title,e,t.severity,[{text:top.TYPO3.lang["wizard.button.cancel"],active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{this.getComponent().trigger("wizard-dismiss")}},{text:top.TYPO3.lang["wizard.button.next"],btnClass:"btn-"+l.getCssClass(t.severity),name:"next"}]),this.setup.forceSelection&&this.lockNextStep(),this.addProgressBar(),this.initializeEvents(),this.getComponent().on("wizard-visible",()=>{this.runSlideCallback(t,this.setup.$carousel.find(".item").first())}).on("wizard-dismissed",()=>{this.setup=i.default.extend(!0,{},this.originalSetup)})}getComponent(){return null===this.setup.$carousel&&this.generateSlides(),this.setup.$carousel}dismiss(){a.dismiss()}lockNextStep(){let e=this.setup.$carousel.closest(".modal").find('button[name="next"]');return e.prop("disabled",!0),e}unlockNextStep(){let e=this.setup.$carousel.closest(".modal").find('button[name="next"]');return e.prop("disabled",!1),e}setForceSelection(e){this.setup.forceSelection=e}initializeEvents(){let e=this.setup.$carousel.closest(".modal"),t=e.find(".modal-title"),s=e.find(".modal-footer"),r=s.find('button[name="next"]');r.on("click",()=>{this.setup.$carousel.carousel("next")}),this.setup.$carousel.on("slide.bs.carousel",()=>{let i=this.setup.$carousel.data("currentSlide")+1,a=this.setup.$carousel.data("currentIndex")+1;t.text(this.setup.slides[a].title),this.setup.$carousel.data("currentSlide",i),this.setup.$carousel.data("currentIndex",a),i>=this.setup.$carousel.data("realSlideCount")?(e.find(".modal-header .close").remove(),s.slideUp()):s.find(".progress-bar").width(this.setup.$carousel.data("initialStep")*i+"%").text(top.TYPO3.lang["wizard.progress"].replace("{0}",i).replace("{1}",this.setup.$carousel.data("slideCount"))),r.removeClass("btn-"+l.getCssClass(this.setup.slides[a-1].severity)).addClass("btn-"+l.getCssClass(this.setup.slides[a].severity)),e.removeClass("modal-severity-"+l.getCssClass(this.setup.slides[a-1].severity)).addClass("modal-severity-"+l.getCssClass(this.setup.slides[a].severity))}).on("slid.bs.carousel",e=>{let t=this.setup.$carousel.data("currentIndex"),s=this.setup.slides[t];this.runSlideCallback(s,i.default(e.relatedTarget)),this.setup.forceSelection&&this.lockNextStep()});let n=this.getComponent();n.on("wizard-dismiss",this.dismiss),a.currentModal.on("hidden.bs.modal",()=>{n.trigger("wizard-dismissed")}).on("shown.bs.modal",()=>{n.trigger("wizard-visible")})}runSlideCallback(e,t){"function"==typeof e.callback&&e.callback(t,this.setup.settings,e.identifier)}addProgressBar(){let e,t=this.setup.$carousel.find(".item").length,s=Math.max(1,t),a=this.setup.$carousel.closest(".modal").find(".modal-footer");e=Math.round(100/s),this.setup.$carousel.data("initialStep",e).data("slideCount",s).data("realSlideCount",t).data("currentIndex",0).data("currentSlide",1),s>1&&a.prepend(i.default("<div />",{class:"progress"}).append(i.default("<div />",{role:"progressbar",class:"progress-bar","aria-valuemin":0,"aria-valuenow":e,"aria-valuemax":100}).width(e+"%").text(top.TYPO3.lang["wizard.progress"].replace("{0}","1").replace("{1}",s))))}generateSlides(){if(null!==this.setup.$carousel)return this.setup.$carousel;let e='<div class="carousel slide" data-ride="carousel" data-interval="false"><div class="carousel-inner" role="listbox">';for(let t of Object.values(this.setup.slides)){let s=t.content;"object"==typeof s&&(s=s.html()),e+='<div class="item" data-slide="'+t.identifier+'">'+s+"</div>"}return e+="</div></div>",this.setup.$carousel=i.default(e),this.setup.$carousel.find(".item").first().addClass("active"),this.setup.$carousel}}let d;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Wizard&&(d=window.opener.TYPO3.Wizard),parent&&parent.window.TYPO3&&parent.window.TYPO3.Wizard&&(d=parent.window.TYPO3.Wizard),top&&top.TYPO3&&top.TYPO3.Wizard&&(d=top.TYPO3.Wizard)}catch(e){}return d||(d=new n,"undefined"!=typeof TYPO3&&(TYPO3.Wizard=d)),d}));
\ No newline at end of file
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","./Enum/Severity","jquery","./Modal","./Severity","./Icons"],(function(e,t,s,i,a,l,r){"use strict";i=__importDefault(i);class n{constructor(){this.setup={slides:[],settings:{},forceSelection:!0,$carousel:null},this.originalSetup=i.default.extend(!0,{},this.setup)}set(e,t){return this.setup.settings[e]=t,this}addSlide(e,t,i="",a=s.SeverityEnum.info,l){const r={identifier:e,title:t,content:i,severity:a,callback:l};return this.setup.slides.push(r),this}addFinalProcessingSlide(e){return e||(e=()=>{this.dismiss()}),r.getIcon("spinner-circle-dark",r.sizes.large,null,null).then(t=>{let s=i.default("<div />",{class:"text-center"}).append(t);this.addSlide("final-processing-slide",top.TYPO3.lang["wizard.processing.title"],s[0].outerHTML,l.info,e)})}show(){let e=this.generateSlides(),t=this.setup.slides[0];a.confirm(t.title,e,t.severity,[{text:top.TYPO3.lang["wizard.button.cancel"],active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{this.getComponent().trigger("wizard-dismiss")}},{text:top.TYPO3.lang["wizard.button.next"],btnClass:"btn-"+l.getCssClass(t.severity),name:"next"}]),this.setup.forceSelection&&this.lockNextStep(),this.addProgressBar(),this.initializeEvents(),this.getComponent().on("wizard-visible",()=>{this.runSlideCallback(t,this.setup.$carousel.find(".carousel-item").first())}).on("wizard-dismissed",()=>{this.setup=i.default.extend(!0,{},this.originalSetup)})}getComponent(){return null===this.setup.$carousel&&this.generateSlides(),this.setup.$carousel}dismiss(){a.dismiss()}lockNextStep(){let e=this.setup.$carousel.closest(".modal").find('button[name="next"]');return e.prop("disabled",!0),e}unlockNextStep(){let e=this.setup.$carousel.closest(".modal").find('button[name="next"]');return e.prop("disabled",!1),e}setForceSelection(e){this.setup.forceSelection=e}initializeEvents(){let e=this.setup.$carousel.closest(".modal"),t=e.find(".modal-title"),s=e.find(".modal-footer"),r=s.find('button[name="next"]');r.on("click",()=>{this.setup.$carousel.carousel("next")}),this.setup.$carousel.on("slide.bs.carousel",()=>{let i=this.setup.$carousel.data("currentSlide")+1,a=this.setup.$carousel.data("currentIndex")+1;t.text(this.setup.slides[a].title),this.setup.$carousel.data("currentSlide",i),this.setup.$carousel.data("currentIndex",a),i>=this.setup.$carousel.data("realSlideCount")?(e.find(".modal-header .close").remove(),s.slideUp()):s.find(".progress-bar").width(this.setup.$carousel.data("initialStep")*i+"%").text(top.TYPO3.lang["wizard.progress"].replace("{0}",i).replace("{1}",this.setup.$carousel.data("slideCount"))),r.removeClass("btn-"+l.getCssClass(this.setup.slides[a-1].severity)).addClass("btn-"+l.getCssClass(this.setup.slides[a].severity)),e.removeClass("modal-severity-"+l.getCssClass(this.setup.slides[a-1].severity)).addClass("modal-severity-"+l.getCssClass(this.setup.slides[a].severity))}).on("slid.bs.carousel",e=>{let t=this.setup.$carousel.data("currentIndex"),s=this.setup.slides[t];this.runSlideCallback(s,i.default(e.relatedTarget)),this.setup.forceSelection&&this.lockNextStep()});let n=this.getComponent();n.on("wizard-dismiss",this.dismiss),a.currentModal.on("hidden.bs.modal",()=>{n.trigger("wizard-dismissed")}).on("shown.bs.modal",()=>{n.trigger("wizard-visible")})}runSlideCallback(e,t){"function"==typeof e.callback&&e.callback(t,this.setup.settings,e.identifier)}addProgressBar(){let e,t=this.setup.$carousel.find(".carousel-item").length,s=Math.max(1,t),a=this.setup.$carousel.closest(".modal").find(".modal-footer");e=Math.round(100/s),this.setup.$carousel.data("initialStep",e).data("slideCount",s).data("realSlideCount",t).data("currentIndex",0).data("currentSlide",1),s>1&&a.prepend(i.default("<div />",{class:"progress"}).append(i.default("<div />",{role:"progressbar",class:"progress-bar","aria-valuemin":0,"aria-valuenow":e,"aria-valuemax":100}).width(e+"%").text(top.TYPO3.lang["wizard.progress"].replace("{0}","1").replace("{1}",s))))}generateSlides(){if(null!==this.setup.$carousel)return this.setup.$carousel;let e='<div class="carousel slide" data-bs-ride="carousel" data-bs-interval="false"><div class="carousel-inner" role="listbox">';for(let t of Object.values(this.setup.slides)){let s=t.content;"object"==typeof s&&(s=s.html()),e+='<div class="carousel-item" data-bs-slide="'+t.identifier+'">'+s+"</div>"}return e+="</div></div>",this.setup.$carousel=i.default(e),this.setup.$carousel.find(".carousel-item").first().addClass("active"),this.setup.$carousel}}let d;try{window.opener&&window.opener.TYPO3&&window.opener.TYPO3.Wizard&&(d=window.opener.TYPO3.Wizard),parent&&parent.window.TYPO3&&parent.window.TYPO3.Wizard&&(d=parent.window.TYPO3.Wizard),top&&top.TYPO3&&top.TYPO3.Wizard&&(d=top.TYPO3.Wizard)}catch(e){}return d||(d=new n,"undefined"!=typeof TYPO3&&(TYPO3.Wizard=d)),d}));
\ No newline at end of file
......@@ -18,7 +18,7 @@
var TBE_EDITOR = {
/* Example:
elements: {
'data-parentPid-table-uid': {
'data-bs-parentPid-table-uid': {
'field': {
'range': [0, 100],
'rangeImg': '',
......
......@@ -7,67 +7,67 @@ define(['jquery', 'bootstrap', 'TYPO3/CMS/Backend/Popover'], function($, bootstr
*/
describe('initialize', function() {
var $body = $('body');
var $element = $('<div data-toggle="popover">');
var $element = $('<div data-bs-toggle="popover">');
$body.append($element);
it('works with default selector', function() {
Popover.initialize();
expect($element[0].outerHTML).toBe('<div data-toggle="popover" data-original-title="" title=""></div>');
expect($element[0].outerHTML).toBe('<div data-bs-toggle="popover" data-bs-original-title="" title=""></div>');
});
var $element2 = $('<div data-toggle="popover" data-title="foo">');
var $element2 = $('<div data-bs-toggle="popover" data-title="foo">');
$body.append($element2);
it('works with default selector and title attribute', function() {
Popover.initialize();
expect($element2[0].outerHTML).toBe('<div data-toggle="popover" data-title="foo" data-original-title="" title=""></div>');
expect($element2[0].outerHTML).toBe('<div data-bs-toggle="popover" data-title="foo" data-bs-original-title="" title=""></div>');
});
var $element3 = $('<div data-toggle="popover" data-content="foo">');
var $element3 = $('<div data-bs-toggle="popover" data-bs-content="foo">');
$body.append($element3);
it('works with default selector and content attribute', function() {
Popover.initialize();
expect($element3[0].outerHTML).toBe('<div data-toggle="popover" data-content="foo" data-original-title="" title=""></div>');
expect($element3[0].outerHTML).toBe('<div data-bs-toggle="popover" data-bs-content="foo" data-bs-original-title="" title=""></div>');
});
var $element4 = $('<div class="t3js-popover">');
$body.append($element4);
it('works with custom selector', function() {
Popover.initialize('.t3js-popover');
expect($element4[0].outerHTML).toBe('<div class="t3js-popover" data-original-title="" title=""></div>');
expect($element4[0].outerHTML).toBe('<div class="t3js-popover" data-bs-original-title="" title=""></div>');
});
});
describe('call setOptions', function() {
var $body = $('body');
var $element = $('<div class="t3js-test-set-options" data-title="foo-title" data-content="foo-content">');
var $element = $('<div class="t3js-test-set-options" data-title="foo-title" data-bs-content="foo-content">');
$body.append($element);
it('can set title', function() {
Popover.initialize('.t3js-test-set-options');
expect($element.attr('data-title')).toBe('foo-title');
expect($element.attr('data-content')).toBe('foo-content');
expect($element.attr('data-original-title')).toBe('');
expect($element.attr('data-bs-content')).toBe('foo-content');
expect($element.attr('data-bs-original-title')).toBe('');
expect($element.attr('title')).toBe('');
Popover.setOptions($element, {
'title': 'bar-title'
});
expect($element.attr('data-title')).toBe('foo-title');
expect($element.attr('data-content')).toBe('foo-content');