Некодим логотипНекодим
МодификацииПубликацииНекодИИмЦены
Некодим логотипНекодим

© 2020-2026 Некодим

Готовые модификации для вашего сайта. Улучшайте функциональность и дизайн без программирования.

Компания

  • Контакты
  • Публичная оферта
  • Политика конфиденциальности
  • Согласие на обработку данных
  • Лицензионное соглашение
  • Реферальная программа

Полезное

  • Модификации
  • Публикации
  • Каталог блоков Tilda
  • MCP для агентов
  • Журнал изменений
  • Доска почёта

Личный кабинет

  • Вход
  • Регистрация
  • Цены
Журнал измененийИстория GitФайлыTilda MCP
Каталог файлов

tilda-members-store-other.js

Код файла
Версия от 04.12.2026, 04:03:53 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
1401				tma__loadJS(js.from);1402			}1403		}1404	}1405}1406 1407/**1408 * Переносит атрибуты из данного блока в allrecords1409 *1410 * @param {Element} main - элемент в котором необходимо искать скрипты1411 */1412function tmst__addAttributesFromElToAllrecords(main) {1413
История файла и сравнение версий
  • 04.12.2026, 04:03:53 · 56c3b845
const allRecords = document.getElementById('allrecords');
1414 const excludedAttrNames = ['id', 'class', 'style', 'data-tilda-project-id', 'data-tilda-page-id'];
1415
1416 for (let i = 0; i < main.attributes.length; i++) {
1417 const attr = main.attributes[i];
1418
1419 // Исключения
1420 if (excludedAttrNames.includes(attr.name)) continue;
1421
1422 allRecords.setAttribute(attr.name, attr.value);
1423 }
1424}
1425
1426/**
1427 * Добавляет скрипты на страницу и запускает их
1428 *
1429 * @param {HTMLElement} main - элемент в котором необходимо искать скрипты
1430 */
1431function tmst__addScripts(main) {
1432 const scripts = main.querySelectorAll('script');
1433
1434 for (let i = 0; i < scripts.length; i++) {
1435 const oldScript = scripts[i];
1436 const newScript = document.createElement('script');
1437 let src = '';
1438
1439 for (let j = 0; j < oldScript.attributes.length; j++) {
1440 const attr = oldScript.attributes[j];
1441
1442 if (attr.name === 'src') {
1443 src = attr.value;
1444 break;
1445 }
1446 }
1447
1448 if (src && oldScript.innerHTML.length === 0) {
1449 tma__loadJS(src);
1450 } else {
1451 newScript.innerHTML = oldScript.innerHTML;
1452 oldScript.parentNode.appendChild(newScript);
1453
1454 setTimeout(function () {
1455 oldScript.remove();
1456 }, 500);
1457 }
1458 }
1459}
1460
1461/**
1462 * Создает стили для кастомизации индексной страницы
1463 *
1464 * @returns {string} - стили страницы
1465 */
1466function tmst__applyStyles() {
1467 const styles = window.tildaMembers.settingStyles;
1468 const mainPage = styles.welcomepage;
1469
1470 tmst__initGlobalCssVariables();
1471
1472 if (!mainPage || !mainPage.typeId || mainPage.typeId !== 'custom') return;
1473
1474 let textStyle = '';
1475
1476 if (mainPage.textMargin) {
1477 const margin = Number(mainPage.textMargin.replace(/[^0-9]/g, ''));
1478
1479 textStyle += '.tlk-resources__item + .tlk-resources__item {\n';
1480 textStyle += ` margin-top: ${mainPage.textMargin};\n`;
1481 textStyle += '}\n';
1482 textStyle += '.tlk-resources__wrap > div + div {\n';
1483 textStyle += ` margin-top: ${margin * 2}px;\n`;
1484 textStyle += '}\n';
1485 textStyle += '.tlk-resources__groups-pages {\n';
1486 textStyle += ` margin-top: ${margin * 0.4}px;\n`;
1487 textStyle += '}\n';
1488 textStyle += '.tlk-resources__groups-pages-item + .tlk-resources__groups-pages-item {\n';
1489 textStyle += ` margin-top: ${margin * 0.24}px;\n`;
1490 textStyle += '}\n';
1491 }
1492
1493 if (mainPage.backgroundColor || mainPage.backgroundImage || mainPage.textSize) {
1494 textStyle += '#app {\n';
1495
1496 if (mainPage.backgroundColor && !mainPage.backgroundImage) {
1497 textStyle += ` background-color: rgba(${tmst__hexToRgb(mainPage.backgroundColor).join(', ')}, ${tma__getOpacity(mainPage.backgroundColorOpacity)});\n`;
1498 }
1499
1500 if (mainPage.textSize) {
Предыдущие 100 строкСледующие 100 строк