%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.149.237.89
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux 3051455-guretool.twc1.net 5.15.0-107-generic #117-Ubuntu SMP Fri Apr 26 12:26:49 UTC 2024 x86_64
User : www-root ( 1010)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/landing/ui/panel/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/landing/ui/panel//preview_panel.js
;(function() {
	"use strict";

	BX.namespace("BX.Landing.UI.Panel");


	/**
	 * Implements preview panel interface
	 *
	 * @extends {BX.Landing.UI.Panel.Content}
	 *
	 * @inheritDoc
	 * @constructor
	 */
	BX.Landing.UI.Panel.Preview = function(id, data)
	{
		this.size = null;
		this.headerButtons = new BX.Landing.UI.Collection.ButtonCollection();
		this.iframe = BX.Landing.UI.Panel.Preview.createIframe();
		this.iframe.dataset.postfix = "";
		BX.Landing.UI.Panel.Content.apply(this, arguments);

		// Add class names
		this.layout.classList.add("landing-ui-panel-preview");
		this.overlay.classList.add("landing-ui-panel-preview-overlay");

		// Bind on iFrame events
		this.iframe.addEventListener("load", this.onFrameLoad.bind(this));
		this.iframe.style.opacity = 0;

		BX.remove(this.footer);
	};


	BX.Landing.UI.Panel.Preview.createIframe = function()
	{
		return BX.create("iframe", {props: {
			className: "landing-ui-panel-preview-iframe",
			src: BX.util.add_url_param(window.location.toString(), {"landing_mode": "style"})
		}});
	};


	BX.Landing.UI.Panel.Preview.prototype = {
		constructor: BX.Landing.UI.Panel.Preview,
		__proto__: BX.Landing.UI.Panel.Content.prototype,
		superclass: BX.Landing.UI.Panel.Content.prototype,

		init: function()
		{
			// Init super class
			this.superclass.init.call(this);

			// Add desktop button
			this.addHeaderButton(new BX.Landing.UI.Button.BaseButton("desktop_button", {
				className: ["landing-ui-button-desktop", "active"],
				onClick: this.onDesktopSizeChange.bind(this)
			}));

			// Add tablet button
			this.addHeaderButton(new BX.Landing.UI.Button.BaseButton("tablet_button", {
				className: "landing-ui-button-tablet",
				onClick: this.onTabletSizeChange.bind(this)
			}));

			// Add mobile button
			this.addHeaderButton(new BX.Landing.UI.Button.BaseButton("mobile_button", {
				className: "landing-ui-button-mobile",
				onClick: this.onMobileSizeChange.bind(this)
			}));


			// Create custom size field
			this.size = new BX.Landing.UI.Field.Unit({
				selector: "size",
				content: "0",
				unit: "px",
				onInput: this.onSizeInput.bind(this),
				className: "landing-ui-panel-preview-size",
				min: 320,
				max: 12000,
				step: 1
			});

			this.title.appendChild(this.size.layout);

			// Add iFrame to content area of panel
			this.content.appendChild(this.iframe);
		},


		/**
		 * Handles size input event
		 */
		onSizeInput: function(field)
		{
			requestAnimationFrame(function() {
				this.iframe.style.width = field.getValue() + "px";
			}.bind(this));
		},


		/**
		 * Handles iFrame load event
		 */
		onFrameLoad: function()
		{
			this.size.setValue(this.body.getBoundingClientRect().width);
			this.iframe.contentWindow.scrollTo(0, window.scrollY);
			requestAnimationFrame(function() {
				this.iframe.style.opacity = 1;
			}.bind(this));
		},


		/**
		 * Handles desktop size change event
		 */
		onDesktopSizeChange: function()
		{
			this.headerButtons.forEach(function(button) {
				button.layout.classList.remove("active");
			});

			this.headerButtons.get("desktop_button").layout.classList.add("active");
			this.size.setValue(this.body.getBoundingClientRect().width);
			this.iframe.dataset.postfix = "";
		},


		/**
		 * Handles tablet size change event
		 */
		onTabletSizeChange: function()
		{
			this.headerButtons.forEach(function(button) {
				button.layout.classList.remove("active");
			});

			this.headerButtons.get("tablet_button").layout.classList.add("active");
			this.size.setValue(767);
			this.iframe.dataset.postfix = "--md";
		},


		/**
		 * Handles mobile size change event
		 */
		onMobileSizeChange: function()
		{
			this.headerButtons.forEach(function(button) {
				button.layout.classList.remove("active");
			});

			this.headerButtons.get("mobile_button").layout.classList.add("active");
			this.size.setValue(479);
			this.iframe.dataset.postfix = "--sm";
		},


		/**
		 * Shows preview panel
		 */
		show: function()
		{
			this.superclass.show.call(this);
			document.documentElement.style.overflow = "hidden";
			this.iframe.contentWindow.scrollTo(0, window.scrollY);
		},


		/**
		 * Hides preview panel
		 */
		hide: function()
		{
			this.superclass.hide.call(this);
			document.documentElement.style.overflow = null;
		},


		/**
		 * Appends header button
		 * @param {BX.Landing.UI.Button.BaseButton} button
		 */
		addHeaderButton: function(button)
		{
			this.title.appendChild(button.layout);
			this.headerButtons.add(button);
		}
	};
})();

Youez - 2016 - github.com/yon3zu
LinuXploit