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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/dev.artlot24.ru/bitrix/js/currency//core_uf_money.js
;(function(){
	'use strict';

	BX.namespace('BX.Main.UF');

	if(typeof BX.Main.UF.TypeMoney !== 'undefined')
	{
		return;
	}

	/**
	 * Money type handler class. Will be initialized in Factory.
	 *
	 * @constructor
	 */
	BX.Main.UF.TypeMoney = function()
	{
	};
	BX.extend(BX.Main.UF.TypeMoney, BX.Main.UF.BaseType);

	BX.Main.UF.TypeMoney.USER_TYPE_ID = 'money';

	BX.Main.UF.TypeMoney.prototype.addRow = function(fieldName, thisButton)
	{
		var node = thisButton.previousElementSibling;
		var newNode = this.getClone(node, fieldName);

		node.parentNode.insertBefore(newNode, thisButton);
	};

	BX.Main.UF.TypeMoney.prototype.getCloneBase = BX.Main.UF.BaseType.prototype.getClone;

	BX.Main.UF.TypeMoney.prototype.getClone = function(node, fieldName)
	{
		if (
			node.hasAttribute('data-media-type')
			&&
			node.getAttribute('data-media-type') === 'mobile'
		)
		{
			return this.getCloneBase(node, fieldName);
		}
		else
		{
			var newNode = BX.Main.UF.TypeMoney.superclass.getClone.apply(this, arguments);
			var nodeList = BX.findChildrenByClassName(newNode, 'money-editor-currency-selector-wrap', true);
			var wrapNode = nodeList[0];
			BX.cleanNode(wrapNode);

			var inputList = BX.findChildren(newNode, {
				tagName: /INPUT|SELECT/i
			}, true);

			inputList[0].value = '';
			inputList[1].value = '';

			var currencyList = BX.message('CURRENCY');
			var currencyItems = [];
			var defaultValue = null;

			for (var currency in currencyList)
			{
				if (currencyList.hasOwnProperty(currency))
				{
					var item = {NAME: currencyList[currency].NAME, VALUE: currency};
					currencyItems.push(item);

					if (defaultValue === null)
					{
						defaultValue = item;
					}
				}
			}

			var inputHandler = new BX.Currency.MoneyInput({
				controlId: controlId,
				input: inputList[1],
				resultInput: inputList[0],
				currency: defaultValue.VALUE
			});

			var controlId = Math.random();

			wrapNode.appendChild(BX.decl({
				block: 'main-ui-select',
				name: controlId,
				items: currencyItems,
				value: defaultValue,
				params: {
					fieldName: controlId, isMulti: false
				},
				valueDelete: false
			}));

			BX.addCustomEvent(window, 'UI::Select::change', function (controlObject, value)
			{
				if (controlObject.params.fieldName === controlId)
				{
					var currentValue = JSON.parse(controlObject.node.getAttribute('data-value'));
					if (!!currentValue)
					{
						inputHandler.setCurrency(currentValue.VALUE);
					}
				}
			});

			return newNode;
		}
	};

	BX.Main.UF.TypeMoney.prototype.focus = function(field)
	{
		var node = this.getNode(field);

		if(!BX.isNodeInDom(node))
		{
			console.error('Node for field ' + field + ' is already removed from DOM');
		}

		var input = BX.findChild(node, {
			tagName: 'INPUT',
			attribute: {
				type: 'text'
			}
		}, true);

		if(input)
		{
			BX.focus(input);
		}
	};

	BX.Main.UF.Factory.setTypeHandler(BX.Main.UF.TypeMoney.USER_TYPE_ID, BX.Main.UF.TypeMoney);
})();

Youez - 2016 - github.com/yon3zu
LinuXploit