v26110443 首页「孕N周专属福利」加后台开关(giftEnabled,默认开;js/ugc.js 读同一接口,关时藏 .shelf.gift2)
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
function getJSON(u) { return fetch(u, { cache: 'no-cache' }).then(function (r) { if (!r.ok) throw r.status; return r.json(); }); }
|
||||
|
||||
function related(box) {
|
||||
getJSON('../_shared/idx.json?v=26110416').then(function (idx) {
|
||||
getJSON('../_shared/idx.json?v=26110443').then(function (idx) {
|
||||
var me = null; idx.forEach(function (x) { if (x[0] === SLUG) me = x; });
|
||||
var tag = me ? me[2] : '', h = 0; for (var i = 0; i < SLUG.length; i++) h = (h * 31 + SLUG.charCodeAt(i)) >>> 0;
|
||||
var rest = idx.filter(function (x) { return x[0] !== SLUG && (window.__mbUgc || ['ceshi', 'duiyou'].indexOf(x[0]) < 0); }); /* UGC 关着不推两个测试 */
|
||||
@@ -175,13 +175,13 @@
|
||||
}
|
||||
fetch(API + '/comments?kind=topic&target=' + encodeURIComponent(SLUG) + (OID ? '&openid=' + encodeURIComponent(OID) : ''))
|
||||
.then(function (r) { return r.json(); }).then(function (j) { if (j && j.code === 200) { RC = j.result; paint(); } }).catch(function () {});
|
||||
getJSON('../_shared/cm/' + SLUG + '.json?v=26110416').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
|
||||
getJSON('../_shared/cm/' + SLUG + '.json?v=26110443').then(function (d) { L = d.c || []; paint(); }).catch(function () { paint(); });
|
||||
}
|
||||
|
||||
function ugcReady() {
|
||||
if (window.__mbUgcReady) return window.__mbUgcReady;
|
||||
return new Promise(function (res) {
|
||||
var u = document.createElement('script'); u.src = '../../js/ugc.js?v=26110416';
|
||||
var u = document.createElement('script'); u.src = '../../js/ugc.js?v=26110443';
|
||||
u.onload = function () { (window.__mbUgcReady || Promise.resolve(false)).then(res); };
|
||||
u.onerror = function () { res(false); };
|
||||
document.head.appendChild(u);
|
||||
|
||||
Reference in New Issue
Block a user