Каталог файловtilda-members-store-other.js
1601 * В #allrecords кладём переменные из настроек ЛК,1602 * если она не определены, задаём значения по умолчанию1603 */1604function tmst__initGlobalCssVariables() {1605 const mainPage = window.tildaMembers.settingStyles.welcomepage;1606 1607 const styleVariables = `#allrecords {1608 --background-color: rgba(${tmst__hexToRgb(mainPage && Boolean(mainPage.backgroundColor) ? mainPage.backgroundColor : '#F5F5F5').join(', ')}, ${mainPage ? tma__getOpacity(mainPage.backgroundColorOpacity) : 1});1609 --text-color: ${mainPage && Boolean(mainPage.textColor) ? mainPage.textColor : '#000000'};1610 --font-size: ${mainPage && Boolean(mainPage.textSize) ? mainPage.textSize : '16px'};1611
История файла и сравнение версий
--text-hover-color: ${mainPage && Boolean(mainPage.textHoverColor) ? mainPage.textHoverColor : '#FA876b'};
1612 --box-background-color: rgba(${tmst__hexToRgb(mainPage && Boolean(mainPage.boxBackgroundColor) ? mainPage.boxBackgroundColor : '#FFFFFF')}, ${mainPage ? tma__getOpacity(mainPage.boxBackgroundColorOpacity) : 1}); 1613 --box-background-color__no-transparency: rgba(${tmst__hexToRgb(mainPage && Boolean(mainPage.boxBackgroundColor) ? mainPage.boxBackgroundColor : '#FFFFFF')}); 1614 --box-radius: ${mainPage && Boolean(mainPage.boxRadius) ? mainPage.boxRadius : '12px'}; 1615 --border-color: rgba(${tmst__hexToRgb(mainPage && Boolean(mainPage.textColor) ? mainPage.textColor : '#000000')}, 0.1); 1618 document.head.insertAdjacentHTML( 1620 `<style id="tlk-pagelist-style-variables" type="text/css">${styleVariables}</style>` 1625 * Преобразует прозрачность из 0...100 в 0...1 1627 * @param {string} opacity - значение opacity 1630function tma__getOpacity(opacity) { 1631 if (opacity && opacity !== '0') { 1632 return +opacity / 100; 1633 } else if (opacity === '0') { 1641 * Копирует текст элемента в data-copy-text атрибуте в буфер обмена 1642 * @param {Element} target 1644function tmst__copyElText(target) { 1645 const text = target.getAttribute('data-copy-text'); 1648 const tempInput = document.createElement('input'); 1649 tempInput.style.position = 'absolute'; 1650 tempInput.style.left = '-9999px'; // Убираем его с видимой области 1652 document.body.appendChild(tempInput); 1653 tempInput.value = text; // Вставляем текст в input 1654 tempInput.select(); // Выделяем текст 1657 // Пытаемся выполнить команду копирования 1658 const isSuccess = document.execCommand('copy'); 1660 // TODO Добавить тултип 1662 throw Error('execCommand failure'); 1665 console.error('Failed to copy text: ', err); 1668 // Удаляем временный элемент input 1669 document.body.removeChild(tempInput); 1673 * Инитит копирование на элементах 1675 * @param {Element} parentEl 1677function tmst__initCopyElements(parentEl) { 1678 const copyEls = parentEl.querySelectorAll('.js-tmst-copy'); 1679 copyEls.forEach(copyEl => { 1680 copyEl.addEventListener('click', clickEvent => { 1681 clickEvent.stopPropagation(); 1682 tmst__copyElText(copyEl); 1688 * Получает разметку иконки Копировать 1691function tmst__createCopyIconHtml() { 1692 return '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none"><path d="M12.1111 15.5H5.88889C5.27005 15.5 4.67656 15.2629 4.23897 14.841C3.80139 14.419 3.55556 13.8467 3.55556 13.25V5.75C3.55556 5.55109 3.47361 5.36032 3.32775 5.21967C3.18189 5.07902 2.98406 5 2.77778 5C2.5715 5 2.37367 5.07902 2.22781 5.21967C2.08194 5.36032 2 5.55109 2 5.75V13.25C2 14.2446 2.40972 15.1984 3.13903 15.9017C3.86834 16.6049 4.85749 17 5.88889 17H12.1111C12.3174 17 12.5152 16.921 12.6611 16.7803C12.8069 16.6397 12.8889 16.4489 12.8889 16.25C12.8889 16.0511 12.8069 15.8603 12.6611 15.7197C12.5152 15.579 12.3174 15.5 12.1111 15.5ZM16 7.205C15.9919 7.1361 15.9763 7.06822 15.9533 7.0025V6.935C15.9159 6.85788 15.8661 6.787 15.8056 6.725L11.1389 2.225C11.0746 2.16666 11.0011 2.11856 10.9211 2.0825H10.8511L10.6022 2H7.44444C6.82561 2 6.23211 2.23705 5.79453 2.65901C5.35694 3.08097 5.11111 3.65326 5.11111 4.25V11.75C5.11111 12.3467 5.35694 12.919 5.79453 13.341C6.23211 13.7629 6.82561 14 7.44444 14H13.6667C14.2855 14 14.879 13.7629 15.3166 13.341C15.7542 12.919 16 12.3467 16 11.75V7.25C16 7.25 16 7.25 16 7.205ZM11.3333 4.5575L13.3478 6.5H12.1111C11.9048 6.5 11.707 6.42098 11.5611 6.28033C11.4153 6.13968 11.3333 5.94891 11.3333 5.75V4.5575ZM14.4444 11.75C14.4444 11.9489 14.3625 12.1397 14.2166 12.2803C14.0708 12.421 13.8729 12.5 13.6667 12.5H7.44444C7.23816 12.5 7.04033 12.421 6.89447 12.2803C6.74861 12.1397 6.66667 11.9489 6.66667 11.75V4.25C6.66667 4.05109 6.74861 3.86032 6.89447 3.71967C7.04033 3.57902 7.23816 3.5 7.44444 3.5H9.77778V5.75C9.77778 6.34674 10.0236 6.91903 10.4612 7.34099C10.8988 7.76295 11.4923 8 12.1111 8H14.4444V11.75Z" fill="currentColor"/></svg>'; 1695function tmst__addBgIfNeeded() { 1698 if (window.tildaMembers.settingStyles) { 1699 style = window.tildaMembers.settingStyles.welcomepage;