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/catalog/product-model/src/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/catalog/product-model/src/image-collection.js
import {Text, Type} from 'main.core';
import {ProductModel} from "catalog.product-model";

export class ImageCollection
{
	#isEnabledSaving = false;
	#preview = '';
	#editInput = '';

	constructor(model: ProductModel = {})
	{
		this.model = model;
	}

	isEnableFileSaving(): boolean
	{
		return this.#isEnabledSaving;
	}

	enableFileSaving(): void
	{
		this.#isEnabledSaving = true;
	}

	getMorePhotoValues(): {}
	{
		return this.morePhoto;
	}

	setMorePhotoValues(values): void
	{
		this.morePhoto = Type.isPlainObject(values) ? values : {};
	}

	removeMorePhotoItem(fileId): boolean
	{
		for (const index in this.morePhoto)
		{
			let value = this.morePhoto[index];

			if (!Type.isObject(value))
			{
				value = Text.toInteger(value);
			}

			if (
				(Type.isNumber(value) && value === Text.toInteger(fileId))
				|| (Type.isObject(value) && value.fileId === fileId)
			)
			{
				delete this.morePhoto[index];
				return true;
			}
		}

		return false;
	}

	setPreview(html: string): ImageCollection
	{
		this.#preview = Type.isStringFilled(html) ? html : '';

		return this;
	}

	setEditInput(html: string): ImageCollection
	{
		this.#editInput = Type.isStringFilled(html) ? html : '';

		return this;
	}

	getPreview(): string
	{
		return this.#preview || '';
	}

	getEditInput(): string
	{
		return this.#editInput || '';
	}

	addMorePhotoItem(fileId, value): void
	{
		this.morePhoto[fileId] = value;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit