1501alignClass = opts.parts_opts.align === 'left' ? 't-align_left' : 't-align_center';1502} else {1503alignClass = 't-align_center';1504}1505}1506var str = '';1507str += '<ul class="t-feed__parts-switch-wrapper ' + alignClass + '" aria-label="' + t_feed_getDictionary('feedsections', recid) + '">';1508// add root part1509var hideClass = !opts.showPartAll ? ' t-feed__parts-switch-btn_hide' : '';1510str +=1511'<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 * @param {object} opts – object with feed settings * @returns */function t_feed_cropShortDescr(post, opts) { var postDescr = post.descr; if (opts.amountOfSymbols != '') {