403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/js/landing/ui/panel/separatorpanel/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/landing/ui/panel/separatorpanel/src/separatorpanel.js
import {Cache, Dom, Type} from 'main.core';
import {Content} from 'landing.ui.panel.content';
import {PageObject} from 'landing.pageobject';
import {Loc} from 'landing.loc';

import solidLinePreview from './images/solid.png';
import dashedLinePreview from './images/dashed.png';
import headerPreview from './images/header.png';
import pagePreview from './images/page.png';
import waveLinePreview from './images/wave.png';

import './css/style.css';

/**
 * @memberOf BX.Landing.UI.Panel
 */
export class SeparatorPanel extends Content
{
	static getInstance(): FormSettingsPanel
	{
		const rootWindow = PageObject.getRootWindow();
		const rootWindowPanel = rootWindow.BX.Landing.UI.Panel.SeparatorPanel;
		if (!rootWindowPanel.instance && !SeparatorPanel.instance)
		{
			rootWindowPanel.instance = new SeparatorPanel();
		}

		return (rootWindowPanel.instance || SeparatorPanel.instance);
	}

	adjustActionsPanels = false;

	constructor()
	{
		super();
		this.setEventNamespace('BX.Landing.UI.Panel.SeparatorPanel');
		this.setLayoutClass('landing-ui-panel-separator');
		this.setOverlayClass('landing-ui-panel-separator-overlay');

		this.setTitle(Loc.getMessage('LANDING_SEPARATOR_PANEL_TITLE'));

		this.cache = new Cache.MemoryCache();
		this.renderTo(this.getViewContainer());

		this.appendCard(
			new BX.Landing.UI.Card.BlockPreviewCard({
				title: Loc.getMessage('LANDING_SEPARATOR_SOLID_LINE'),
				image: solidLinePreview,
				code: 'hr',
				onClick: this.onPreviewClick.bind(this),
			}),
		);

		this.appendCard(
			new BX.Landing.UI.Card.BlockPreviewCard({
				title: Loc.getMessage('LANDING_SEPARATOR_HEADER'),
				image: headerPreview,
				code: 'section',
				onClick: this.onPreviewClick.bind(this),
			}),
		);

		this.appendCard(
			new BX.Landing.UI.Card.BlockPreviewCard({
				title: Loc.getMessage('LANDING_SEPARATOR_PAGE'),
				image: pagePreview,
				code: 'page',
				onClick: this.onPreviewClick.bind(this),
			}),
		);

		[...this.content.children].forEach((item) => {
			Dom.style(item, 'opacity', '1');
		});
	}

	getViewContainer(): HTMLDivElement
	{
		return this.cache.remember('viewContainer', () => {
			const rootWindow = PageObject.getRootWindow();
			return rootWindow.document.querySelector('.landing-ui-view-container');
		});
	}

	show(options): Promise<{type: string}>
	{
		void super.show(options);
		return new Promise((resolve) => {
			this.promiseResolver = resolve;
		});
	}

	onPreviewClick(card)
	{
		void this.hide();

		if (Type.isFunction(this.promiseResolver))
		{
			this.promiseResolver({type: card.code, separatorTitle: card.title});
		}
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit