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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-scripts-3.0.js

Код файла
Версия от 29.09.2026, 07:00:43 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
801						}802					}803				}804			});805		}806	}807	function setBreakWords() {808		var windowWidth = isInstagram ? screen.width : window.innerWidth;809		if (window.isMobile && !isInstagram) {810			windowWidth = document.documentElement.clientWidth;811		}812 813
История файла и сравнение версий
  • 29.09.2026, 07:00:43 · 56c3b845
var recBlocks = document.querySelectorAll(
814 '.r:not([data-record-type="396"], [data-record-type="1003"], [data-parenttplid="396"], [data-parenttplid="1003"])'
815 );
816 var visibleRecBlocks = [];
817
818 for (var k = 0; k < recBlocks.length; k++) {
819 var record = recBlocks[k];
820 var recStyles = getComputedStyle(record);
821
822 if (recStyles.display !== 'none' && recStyles.visibility !== 'hidden' && recStyles.opacity !== '0') {
823 visibleRecBlocks.push(record);
824 }
825 }
826
827 for (var i = 0; i < visibleRecBlocks.length; i++) {
828 var rec = visibleRecBlocks[i];
829 var blocks = rec.querySelectorAll(
830 '' +
831 'div:not([data-auto-correct-mobile-width="false"]):not(.tn-elem):not(.tn-atom):not(.tn-atom__sbs-anim-wrapper)' +
832 ':not(.tn-atom__prx-wrapper):not(.tn-atom__videoiframe):not(.tn-atom__sticky-wrapper)' +
833 ':not(.t-catalog__relevants__container):not(.t-slds__items-wrapper):not(.js-product-controls-wrapper)' +
834 ':not(.t-store__relevants__container):not(.t-slds__items-wrapper):not(.js-product-controls-wrapper)' +
835 ':not(.js-product-edition-option):not(.t-product__option-variants)'
836 );
837
838 for (var j = 0; j < blocks.length; j++) {
839 var block = blocks[j];
840 rec.style.wordBreak = '';
841 var blockWidth = t_outerWidth(block);
842
843 if (blockWidth > windowWidth) {
844 if (block.getAttribute('[data-customstyle]') === 'yes') {
845 if (block.parentNode.getAttribute('[data-auto-correct-mobile-width]') === 'false') {
846 return;
847 }
848 }
849
850 console.log(
851 'Block not optimized for mobile width. Block width:' +
852 blockWidth +
853 ' Block id:' +
854 rec.getAttribute('id')
855 );
856
857 console.log(block);
858
859 rec.style.overflow = 'auto';
860 rec.style.wordBreak = blockWidth - 3 > windowWidth ? 'break-word' : '';
861 }
862 }
863 }
864 }
865
866 function updateFontSize(breakpoint) {
867 var elements = document.querySelectorAll(
868 '' +
869 '.t-text:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
870 '.t-name:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
871 '.t-title:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
872 '.t-descr:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
873 '.t-heading:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
874 '.t-text-impact:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
875 '.t-subtitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"]), ' +
876 '.t-uptitle:not(.tn-elem):not(.tn-atom):not([data-auto-correct-line-height="false"])'
877 );
878
879 for (var i = 0; i < elements.length; i++) {
880 var element = elements[i];
881 var elementStyle = element.getAttribute('style');
882 if (!elementStyle) continue;
883 var isREMValue = element.getAttribute('data-auto-correct-font-size') === 'rem';
884 var newStyle;
885 if (document.documentElement.clientWidth > breakpoint) {
886 newStyle = elementStyle.replace('lineheight', 'line-height');
887 newStyle = newStyle.replace('fontsize', 'font-size');
888 element.setAttribute('style', newStyle);
889 } else {
890 if (elementStyle.indexOf('font-size') === -1) continue;
891 if (parseInt(getComputedStyle(element).fontSize.replace('px', '')) < 26) continue;
892 newStyle = elementStyle.replace('line-height', 'lineheight');
893 newStyle = isREMValue
894 ? newStyle.replace(/font-size.*px;/gi, 'font-size: 1.6rem;')
895 : newStyle.replace('font-size', 'fontsize');
896 element.setAttribute('style', newStyle);
897 }
898 }
899 }
900})();
Предыдущие 100 строкСледующие 100 строк