1601if (opts.parts_opts.align) {1602alignClass = opts.parts_opts.align === 'left' ? 't-align_left' : 't-align_center';1603} else {1604alignClass = 't-align_center';1605}1606}1607var str = '';1608str +=1609'<ul class="t-feed__parts-switch-wrapper ' +1610alignClass +1611'" aria-label="' +1612t_feed_getDictionary('feedsections', recid) +
'">'; // add root part var hideClass = !opts.showPartAll ? ' t-feed__parts-switch-btn_hide' : ''; str += '<li class="js-feed-parts-switcher t-feed__parts-switch-btn ' + partsWithBg + ' t-feed__parts-switch-btn-all t-name t-name_xs t-menu__link-item t-active' + hideClass + '" data-feedpart-title="" data-feedpart-uid="' + opts.feeduid + '">' + '<a href="javascript:void(0);">' + '' + t_feed_getDictionary('all', recid) + '</a>' + '</li>'; // add custom parts for (var i = 0; i < opts.feedPartsArr.length; i++) { var feedPart = opts.feedPartsArr[i]; str += '<li class="js-feed-parts-switcher t-feed__parts-switch-btn ' + partsWithBg + ' t-name t-name_xs t-menu__link-item" data-feedpart-title="' + feedPart.title + '" data-feedpart-uid="' + feedPart.uid + '">' + '<a href="#!/tfeeds/' + feeduid + '/c/' + feedPart.title + '">' + '' + feedPart.title + '</a>' + '</li>'; } str += '</ul>'; return str;}function t_feed_getLazyUrl(opts, imgSrc) { // lazyLoad works just in published pages, // so in redactor and previewmode we do not add smaller images if (!opts.isPublishedPage || window.lazy !== 'y') { return imgSrc; } if (imgSrc.indexOf('static.tildacdn.' + t_feed__getRootZone()) === -1) { // we cant apply lazy load to images, hosted to another servers return imgSrc; } var arr = imgSrc.split('/'); arr.splice(imgSrc.split('/').length - 1, 0, '-/resizeb/x20'); var newSrc = arr.join('/'); return newSrc;}function t_feed_getLazySrc(opts, imgSrc) { // lazyLoad works just in published pages, // so in redactor and previewmode we do not add smaller images if (!opts.isPublishedPage || window.lazy !== 'y') { return 'src="' + imgSrc + '"'; } var arr = imgSrc.split('/'); arr.splice(imgSrc.split('/').length - 1, 0, '-/empty'); var newSrc = arr.join('/'); return 'src="' + newSrc + '" data-original="' + imgSrc + '"';}/** * Draw separator in FD10* * @param {object} opts – object with feed settings * @returns */function t_feed_drawPostSeparatorLine(opts) { var str = ''; var style = ''; style += opts.separator.height ? 'height:' + opts.separator.height + ';' : ''; style += opts.separator.color ? 'background-color:' + opts.separator.color + ';' : ''; style += opts.separator.opacity ? 'opacity:' + opts.separator.opacity / 100 + ';' : ''; style = style ? 'style="' + style + '"' : ''; str += '<div class="t-feed__post__line-separator" ' + style + '></div>'; return str;}/** * Crop text in short descr in feed * @param {object} post – JSON with data for post