first commit

This commit is contained in:
2024-07-15 11:28:08 +02:00
commit f52d538ea5
21891 changed files with 6161164 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
var NewTemplateView = require( 'elementor-admin/new-template/view' );
module.exports = elementorModules.common.views.modal.Layout.extend( {
getModalOptions: function() {
return {
id: 'elementor-new-template-modal',
};
},
getLogoOptions: function() {
return {
title: __( 'New Template', 'elementor' ),
};
},
initialize: function() {
elementorModules.common.views.modal.Layout.prototype.initialize.apply( this, arguments );
this.showLogo();
this.showContentView();
},
showContentView: function() {
this.modalContent.show( new NewTemplateView() );
},
} );

View File

@@ -0,0 +1,52 @@
var NewTemplateLayout = require( 'elementor-admin/new-template/layout' );
var NewTemplateModule = elementorModules.ViewModule.extend( {
getDefaultSettings: function() {
return {
selectors: {
addButton: '.page-title-action:first, #elementor-template-library-add-new',
},
};
},
getDefaultElements: function() {
var selectors = this.getSettings( 'selectors' );
return {
$addButton: jQuery( selectors.addButton ),
};
},
bindEvents: function() {
this.elements.$addButton.on( 'click', this.onAddButtonClick );
elementorCommon.elements.$window.on( 'hashchange', this.showModalByHash.bind( this ) );
},
showModalByHash: function() {
if ( '#add_new' === location.hash ) {
this.layout.showModal();
location.hash = '';
}
},
onInit: function() {
elementorModules.ViewModule.prototype.onInit.apply( this, arguments );
this.layout = new NewTemplateLayout();
this.showModalByHash();
},
onAddButtonClick: function( event ) {
event.preventDefault();
this.layout.showModal();
},
} );
jQuery( function() {
window.elementorNewTemplate = new NewTemplateModule();
} );

View File

@@ -0,0 +1,12 @@
module.exports = Marionette.ItemView.extend( {
id: 'elementor-new-template-dialog-content',
template: '#tmpl-elementor-new-template',
ui: {},
events: {},
onRender: function() {},
} );