Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
import ShowcaseCard from '@components/showcase-card/showcase-card';
import ShowcaseCardCloseExtension from '@components/showcase-card/extension/showcase-card-close-extension';
import MetaPageNameOptionHandler from '@pages/meta/meta-page-name-option-handler';
const {$} = window;
$(() => {
const meta = new window.prestashop.component.Grid('meta');
meta.addExtension(new window.prestashop.component.GridExtensions.ReloadListExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.ExportToSqlManagerExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.FiltersResetExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.SortingExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.LinkRowActionExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.SubmitGridActionExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.SubmitBulkActionExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.SubmitRowActionExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.BulkActionCheckboxExtension());
meta.addExtension(new window.prestashop.component.GridExtensions.FiltersSubmitButtonEnablerExtension());
const helperBlock = new ShowcaseCard('seo-urls-showcase-card');
helperBlock.addExtension(new ShowcaseCardCloseExtension());
new window.prestashop.component.TaggableField({
tokenFieldSelector: 'input.js-taggable-field',
options: {
createTokensOnBlur: true,
},
});
new MetaPageNameOptionHandler();
window.prestashop.component.initComponents(
[
'MultistoreConfigField',
'TranslatableInput',
'TextWithRecommendedLengthCounter',
],
);
});

View File

@@ -0,0 +1,43 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
const {$} = window;
/**
* Class MetaPageNameOptionHandler is responsible for checking the index page condition - if index page is selected it
* does not allow to enter url rewrite field by disabling that input. In another cases url rewrite field is mandatory to
* enter.
*/
export default class MetaPageNameOptionHandler {
constructor() {
const pageNameSelector = '.js-meta-page-name';
const currentPage = $(pageNameSelector).val();
this.setUrlRewriteDisabledStatusByCurrentPage(<string>currentPage);
$(document).on('change', pageNameSelector, (event: JQueryEventObject) => this.changePageNameEvent(event),
);
}
/**
* An event which is being called after the selector is being updated.
* @param {object} event
* @private
*/
private changePageNameEvent(event: JQueryEventObject): void {
const $this = $(event.currentTarget);
const currentPage = $this.val();
this.setUrlRewriteDisabledStatusByCurrentPage(<string>currentPage);
}
/**
* Sets url rewrite form field to disabled or enabled according to current page value.
* @param {string} currentPage
* @private
*/
private setUrlRewriteDisabledStatusByCurrentPage(currentPage: string): void {
$('.js-url-rewrite input').prop('disabled', currentPage === 'index');
}
}