优化文章评论在手机端效果

This commit is contained in:
Sky
2016-03-30 14:02:54 +08:00
parent acbb8dd0c4
commit ba2f361794

View File

@@ -33,12 +33,42 @@ block content
if(settings.ShowComments === 'true')
hr.hr-article
#SOHUCS(sid=post.UniqueId)
script(charset='utf-8', type='text/javascript', src='http://changyan.sohu.com/upload/changyan.js')
script.
window.changyan.api.config({
appid: '#{settings.ChangyanId}',
conf: '#{settings.ChangyanConf}'
});
(function () {
var appid = '#{settings.ChangyanId}';
var conf = '#{settings.ChangyanConf}';
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) {
window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="http://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>');
} else {
var loadJs = function (d, a) {
var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement;
var b = document.createElement("script");
b.setAttribute("type", "text/javascript");
b.setAttribute("charset", "UTF-8");
b.setAttribute("src", d);
if (typeof a === "function") {
if (window.attachEvent) {
b.onreadystatechange = function () {
var e = b.readyState;
if (e === "loaded" || e === "complete") {
b.onreadystatechange = null;
a()
}
}
} else {
b.onload = a
}
}
c.appendChild(b)
};
loadJs("http://changyan.sohu.com/upload/changyan.js", function () {
window.changyan.api.config({
appid: appid, conf: conf
})
});
}
})();
#control-wrap.col-md-3.hidden-sm.hidden-xs(style='#{settings.ExpandMenu === "true" ? "display: block;" : "display: none;"}')
a.close-menu(title='隐藏目录')
i.fa.fa-times
@@ -61,4 +91,4 @@ block content
};
script(type = 'text/javascript', src = 'http://v3.jiathis.com/code/jia.js?uid=#{settings.JiaThisId}', charset = 'utf-8')
script(type='text/javascript', src='/libs/jquery-qrcode/dist/jquery.qrcode.min.js', charset='utf-8')
script(type = 'text/javascript', src = '/javascripts/top.js', charset = 'utf-8')
script(type = 'text/javascript', src = '/javascripts/top.js', charset = 'utf-8')