展开 var __INLINE_SCRIPT__ = (function () {
'use strict';
var __setDesc = function __setDesc(desc, isNoEncode, itemShowType) {
function getAttr(s, a) {
var m = s.match(new RegExp(a + '\s*=\s*["']?([^"'\s>]+)["']?'));
return m && m[1];
}
function filterContentWithLinkNWeapp(str) {
str = str.split(/(]*>)((?:.|n)*?)()/);
var valid;
for (var i = 0; i < str.length; i++) {
if (i % 4 === 1) {
valid = false;
var href = getAttr(str[i], 'href');
if (/^https?://mp.weixin.qq.com/.test(href)) {
valid = true;
}
var r = '' : '';
} else if (i % 4 === 3) {
!valid && (str[i] = '');
} else {
str[i] = str[i].replace(//g, '');
}
}
return str.join('');
}
if (isNoEncode) {
if (itemShowType * 1 === 8 || itemShowType * 1 === 10) desc = desc.html(false);
desc = window.__emojiFormat(filterContentWithLinkNWeapp(desc).replace(/r/g, '').replace(/n/g, '
'));
} else {
desc = desc.replace(/r/g, '').replace(/n/g, '
').replace(/s/g, ' ');
}
if (itemShowType * 1 === 8) {
var descDom = document.getElementById('js_image_desc');
descDom && (descDom.innerHTML = desc);
} else if (itemShowType * 1 === 10) {
var _descDom = document.getElementById('js_text_desc');
_descDom && (_descDom.innerHTML = desc);
} else {
var _descDom2 = document.getElementById('js_common_share_desc');
var descDomWrap = document.getElementById('js_common_share_desc_wrap');
if (!_descDom2 || !descDomWrap) {
return;
}
_descDom2.innerHTML = desc;
setTimeout(function () {
var folderSwitcher = document.getElementById('js_folder_text_switch');
if (_descDom2.offsetHeight - descDomWrap.offsetHeight > 1) {
descDomWrap.className += ' weui-ellipsis_multi';
folderSwitcher.style.display = 'block';
} else {
folderSwitcher.style.display = 'none';
}
}, 300);
}
};
if (!window.__second_open__) {
var videoContentNoEncode = window.a_value_which_never_exists || '';
var TextContentNoEncode = window.a_value_which_never_exists || '';
var itemShowType = window.a_value_which_never_exists || '5';
var content = window.a_value_which_never_exists || '';
var desc = window.a_value_which_never_exists || '';
if (videoContentNoEncode) {
__setDesc(videoContentNoEncode, true, itemShowType);
} else if (TextContentNoEncode) {
__setDesc(TextContentNoEncode, true, itemShowType);
} else if (itemShowType * 1 === 8) {
__setDesc(content || desc, true, itemShowType);
} else {
__setDesc(desc, false, itemShowType);
}
window.__setDesc = __setDesc;
}
return __setDesc;
})();