Permalink
Browse files

fix: 畅言加载阻塞问题

  • Loading branch information...
litten committed Nov 15, 2017
1 parent d52d6c0 commit 5cd9ba5a98fa4aad18a82e2344390dab1aae7685
Showing with 16 additions and 19 deletions.
  1. +7 −8 layout/_partial/post/changyan.ejs
  2. +4 −4 layout/_partial/script.ejs
  3. +1 −3 source-src/js/fix.js
  4. +4 −0 source/mobile.992cbe.js
  5. +0 −4 source/mobile.fdc4b7.js
@@ -1,10 +1,9 @@
<div id="SOHUCS" sid="<%=key%>" ></div>
<script type="text/javascript">
window.YiliaChangyanWrap = function() {
var appid = "<%=theme.changyan_appid%>";
var conf = "<%=theme.changyan_conf%>";
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="//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("//changyan.sohu.com/upload/changyan.js",function(){window.changyan.api.config({appid:appid,conf:conf})}); }
}
<script charset="utf-8" type="text/javascript" src="//changyan.sohu.com/upload/changyan.js" ></script>
<script type="text/javascript">
window.changyan.api.config({
appid: "<%=theme.changyan_appid%>",
conf: "<%=theme.changyan_conf%>"
});
</script>
</script>

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -31,9 +31,7 @@ function init() {
if ($aboutme && $aboutme.length !== 0) {
$aboutme.innerHTML = $aboutme.innerText
}
// 畅言的初始化
window.YiliaChangyanWrap && window.YiliaChangyanWrap();
}
module.exports = {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

This file was deleted.

Oops, something went wrong.

0 comments on commit 5cd9ba5

Please sign in to comment.