403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/scale/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/scale/loadbar.js
/**
 * Class BX.Scale.LoadBar
 * Role's LoadBar control
 */
;(function(window) {

	if (BX.Scale.LoadBar) return;

	/**
	 * Class BX.Scale.LoadBar
	 * @constructor
	 */
	BX.Scale.LoadBar = function (id)
	{
		this.id = id;
		this.domObj = null;
		this.value = 0;
	};

	//Dom prototype object to copy from
	BX.Scale.LoadBar.prototype.protoObj = null;

	/**
	 * Returns and creates (if need) prototype object
	 * @returns {domNode}
	 */
	BX.Scale.LoadBar.prototype.getProtoObj = function()
	{
		if(BX.Scale.LoadBar.prototype.protoObj === null)
		{
			BX.Scale.LoadBar.prototype.protoObj = document.createElement("div");
			BX.addClass(BX.Scale.LoadBar.prototype.protoObj, "adm-scale-item-state");
			BX.addClass(BX.Scale.LoadBar.prototype.protoObj, "adm-scale-0");

			for(var i=100; i>=5; i-=5)
			{
				var span = document.createElement("span");
				BX.addClass(span, "adm-state-item");
				BX.addClass(span, "adm-state-item-"+i);
				BX.Scale.LoadBar.prototype.protoObj.appendChild(span);
			}
		}

		return BX.Scale.LoadBar.prototype.protoObj;
	};

	/**
	 * Returns DOM object contains server data
	 * @returns {object}
	 */

	BX.Scale.LoadBar.prototype.getDomObj = function()
	{
		if(!this.domObj)
		{
			this.domObj = this.getProtoObj().cloneNode(true);
			this.domObj.id = this.id;
		}

		return this.domObj;
	};

	/**
	 * Sets the bar value
	 * @param value
	 * @returns {boolean}
	 */
	BX.Scale.LoadBar.prototype.setValue = function(value)
	{
		if(!this.domObj)
			return false;

		value = parseInt(value);
		value = Math.round(value/5)*5;

		BX.removeClass(this.domObj, "adm-scale-"+this.value);

		if(value < 0)
			this.value = 0;
		else if(value > 100)
			this.value = 100;
		else
			this.value = value;

		BX.addClass(this.domObj, "adm-scale-"+this.value);

		return value;
	};

	})(window);

Youez - 2016 - github.com/yon3zu
LinuXploit