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/landing/ui/field/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/landing/ui/field/color_field.js
;(function() {
	"use strict";

	BX.namespace("BX.Landing.UI.Field");


	/**
	 * @extends {BX.Landing.UI.Field.ButtonGroup}
	 * @param options
	 * @constructor
	 */
	BX.Landing.UI.Field.ColorPalette = function(options)
	{
		BX.Landing.UI.Field.ButtonGroup.apply(this, arguments);
		this.pseudoElement = typeof options.pseudoElement === "string" ? options.pseudoElement : null;
		this.pseudoClass = typeof options.pseudoClass === "string" ? options.pseudoClass : null;
		this.layout.classList.add("landing-ui-field-color");
		this.stylePath = options.stylePath;
		this.initButtons();
	};


	function getCssPropertyForRule(rule, prop, stylePath) {
		var sheets = document.styleSheets;
		var slen = sheets.length;

		for(var i=0; i<slen; i++) {
			if (
				"href" in document.styleSheets[i] && (
				document.styleSheets[i].href && document.styleSheets[i].href.indexOf("/templates/landing24/") !== -1 ||
				document.styleSheets[i].href && document.styleSheets[i].href.indexOf("/landing24/template_") !== -1 ||
				document.styleSheets[i].href && document.styleSheets[i].href.indexOf("/landing24/kernel_landing_assets_") !== -1) ||
				(stylePath && document.styleSheets[i].href && document.styleSheets[i].href.indexOf(stylePath) !== -1)
			)
			{
				var rules = document.styleSheets[i].cssRules;
				if (rules)
				{
					var rlen = rules.length;
					for(var j=0; j<rlen; j++) {
						if(rules[j].selectorText === rule) {
							return rules[j].style[prop];
						}
					}
				}
			}
		}
	}

	BX.Landing.UI.Field.ColorPalette.prototype = {
		constructor: BX.Landing.UI.Field.ColorPalette,
		__proto__: BX.Landing.UI.Field.ButtonGroup.prototype,

		initButtons: function()
		{
			this.buttons.forEach(function(button) {
				button.layout.classList.add(button.layout.value);
				button.layout.innerHTML = "<span class=\"landing-ui-button-inner landing-ui-pattern-transparent\"></span>";

				var property = BX.Landing.UI.Adapter.CSSProperty.get(this.property);

				if (((property !== "background-image" && property !== "background-color") || this.pseudoElement) && !this.pseudoClass)
				{
					BX.DOM.read(function() {
						var color = getComputedStyle(button.layout, this.pseudoElement).getPropertyValue(property);
						BX.DOM.write(function() {
							button.layout.classList.remove(button.layout.value);
							button.layout.style["background-color"] = color;
						});
					}.bind(this));
				}
				else if (this.pseudoClass)
				{
					BX.DOM.read(function() {
						var color = getCssPropertyForRule("."+button.layout.value+this.pseudoClass, property, this.stylePath);
						BX.DOM.write(function() {
							button.layout.classList.remove(button.layout.value);
							button.layout.style["background-color"] = color;
						});
					}.bind(this));
				}
			}, this);
		},

		reset: function()
		{
			this.buttons.forEach(function(button) {
				button.layout.classList.remove("landing-ui-active");
			});
		}
	};

})();

Youez - 2016 - github.com/yon3zu
LinuXploit