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

© 2020-2026 Некодим

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

Компания

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

Полезное

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

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

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

tilda-catalog-1.1.js

Код файла
Версия от 04.12.2026, 04:03:55 МСК
Оригинал на CDNСнимок 56c3b845Полный текст
3401		link = t_store_get_productCard_link(options.prodCard.btnLink2, product, isRelevantsShow, rec);3402		linkTarget = t_store_get_productCard_targetAttr(options.prodCard.btnLink2, product);3403 3404		if (isT1025) str += '<div class="t-store__card__btn-row t-store__card__btn-second_wrapper">';3405		str +=3406			'<a' +3407			' href="' +3408			link +3409			'" ' +3410			linkTarget +3411			' class="js-store-prod-btn2 t-store__card__btn t-store__card__btn_second t-btn ' +3412
История файла и сравнение версий
  • 04.12.2026, 04:03:55 · 56c3b845
btnSizeClass +
3413 '"' +
3414 (!options.button2_styles ? ' style="' + options.btn2_style + '"' : '') +
3415 '">' +
3416 '<span class="t-store__card__btn-text t-btnflex__text">' +
3417 options.prodCard.btnTitle2 +
3418 '</span></a>';
3419 if (isT1025) str += '</div>';
3420 }
3421 str += '</div>';
3422 return str;
3423}
3424
3425function t_store_get_productCard_link(link, product, isRelevantsShow, rec) {
3426 if (rec[0]) {
3427 var isSnippet =
3428 document.getElementById('allrecords') !== document.querySelector('.t-store__product-snippet') &&
3429 document.getElementById('allrecords').contains(document.querySelector('.t-store__product-snippet'));
3430 if (isSnippet && link === 'popup') {
3431 return t_store_generateUrl(product);
3432 }
3433 }
3434
3435 if (link === 'order') {
3436 return '#order';
3437 }
3438
3439 if (isRelevantsShow) {
3440 return product.buttonlink ? product.buttonlink : '#prodpopup';
3441 }
3442
3443 if (link === 'popup') {
3444 if (product.buttonlink) {
3445 var url = product.buttonlink;
3446 if (url.indexOf('//') === -1 && url.slice(0, 1) !== '/' && url.slice(0, 1) !== '#') {
3447 url = 'http://' + url;
3448 }
3449 return url;
3450 } else {
3451 return '#prodpopup';
3452 }
3453 }
3454 return '#prodpopup';
3455}
3456
3457function t_store_get_productCard_targetAttr(link, product) {
3458 if (link === 'popup' && product.buttonlink && product.buttontarget === '_blank') {
3459 return 'target="_blank"';
3460 }
3461 return '';
3462}
3463
3464/**
3465 * Returns the HTML for a horizontal separator element to be used in a grid layout.
3466 *
3467 * @param {Object} opts - An object containing options for the separator element.
3468 * @param {number} [opts.vindent=0] - The vertical indentation (in pixels) for the separator element.
3469 * @return {string} - The HTML for the separator element.
3470 */
3471function t_store_get_horizSeparator_html(opts) {
3472 var str = '<div class="t-clear t-store__grid-separator" [[style]]></div>';
3473 str = str.replace('[[style]]', opts.vindent ? 'style="margin-bottom:' + opts.vindent + ';"' : '');
3474 return str;
3475}
3476
3477/**
3478 * Returns the number of blocks that should be placed in a row based on the current screen width and the provided options.
3479 *
3480 * @param {Object} options - An object containing options for determining the number of blocks in a row.
3481 * @param {boolean} [options.isHorizOnMob=false] - Whether to place the blocks horizontally on mobile devices.
3482 * @param {number} [options.blocksInRow=0] - The number of blocks to place in a row on desktop devices.
3483 * @param {Array} cards - An array of card elements.
3484 * @return {number} - The number of blocks to place in a row.
3485 */
3486function t_store_unifyCardsHeights_getBlocksInRow(options, cards) {
3487 if (window.innerWidth <= 960 && options.isHorizOnMob) {
3488 return cards.length;
3489 } else if (window.innerWidth <= 960) {
3490 return 2;
3491 } else {
3492 return parseInt(options.blocksInRow, 10);
3493 }
3494}
3495
3496function t_store_unifyCardsWidth(recid) {
3497 var rec = document.getElementById('rec' + recid);
3498 if (!rec) return;
3499 if (window.getComputedStyle(rec).display === 'none') return;
3500
Предыдущие 100 строкСледующие 100 строк