uawdijnntqw1x1x1
IP : 18.117.185.15
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
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,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
yar.axolotls.ru
/
bitrix
/
js
/
main
/
core
/
core_uploader
/
..
/
src
/
lib
/
tag.js
/
/
import Type from './type'; import Dom from './dom'; import Loc from './loc'; import Text from './text'; import render from './tag/render'; function parseProps(sections: string[], ...substitutions: string[]): {[key: string]: string} { return substitutions .reduce((acc, item, index) => { const nextSectionIndex = index + 1; if (!Type.isPlainObject(item) && !Type.isArray(item)) { return acc + item + sections[nextSectionIndex]; } return `${acc}__s${index}${sections[nextSectionIndex]}`; }, sections[0]) .replace(/[\r\t]/gm, '') .split(';\n') .map(item => item.replace(/\n/, '')) .reduce((acc, item) => { if (item !== '') { const matches = item.match(/^[\w-. ]+:/); const splitted = item.split(/^[\w-. ]+:/); const key = matches[0].replace(':', '').trim(); const value = splitted[1].trim(); const substitutionPlaceholderExp = /^__s\d+/; if (substitutionPlaceholderExp.test(value)) { acc[key] = substitutions[value.replace('__s', '')]; return acc; } acc[key] = value; } return acc; }, {}); } /** * @memberOf BX */ export default class Tag { /** * Encodes all substitutions * @param sections * @param substitutions * @return {string} */ static safe(sections: string[], ...substitutions: string[]) { return substitutions.reduce((acc, item, index) => ( acc + Text.encode(item) + sections[index + 1] ), sections[0]); } /** * Decodes all substitutions * @param sections * @param substitutions * @return {string} */ static unsafe(sections, ...substitutions) { return substitutions.reduce((acc, item, index) => ( acc + Text.decode(item) + sections[index + 1] ), sections[0]); } /** * Adds styles to specified element * @param {HTMLElement} element * @return {Function} */ static style(element: HTMLElement): Function { if (!Type.isDomNode(element)) { throw new Error('element is not HTMLElement'); } return function styleTagHandler(...args) { Dom.style(element, parseProps(...args)); }; } /** * Replace all messages identifiers to real messages * @param sections * @param substitutions * @return {string} */ static message(sections: string[], ...substitutions: string[]): string { return substitutions.reduce((acc, item, index) => ( acc + Loc.getMessage(item) + sections[index + 1] ), sections[0]); } static render = render; /** * Adds attributes to specified element * @param element * @return {Function} */ static attrs(element: HTMLElement) { if (!Type.isDomNode(element)) { throw new Error('element is not HTMLElement'); } return function attrsTagHandler(...args): string { Dom.attr(element, parseProps(...args)); }; } static attr = Tag.attrs; }
/var/www/axolotl/data/www/yar.axolotls.ru/bitrix/js/main/core/core_uploader/../src/lib/tag.js