Skip to content

Commit

Permalink
全部主题下的评论插件都改为畅言
Browse files Browse the repository at this point in the history
  • Loading branch information
BookFrank committed Dec 2, 2017
1 parent 3121641 commit d772200
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 35 deletions.
28 changes: 11 additions & 17 deletions app/View/line/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,17 @@ <h2>{{ blog.title }}</h2>
{{ blog.content | raw }}

<br/>
{% if site.duoshuo %}
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="{{ blog.blogId }}" data-title="{{ blog.title }}" data-url="{{ site.url }}{{ blog.siteURL }}"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"{{ site.duoshuo }}"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
{% if site.changyan %}
<!--畅言评论插件 start-->
<div id="SOHUCS" sid="{{ blog.blogId }}" ></div>
<script type="text/javascript">
(function(){
var appid = "{{ confObj.changyan }}";
var conf = 'prod_1fb21904f797de208dd3e1bee418b76e';
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})}); } })(); </script>
<!--畅言评论插件 end-->
</div>
{% endif %}
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/View/quest/block/comments.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if confObj.changyan %}
<div id="comments" class="comments-area">
<div id="respond" class="comment-respond">
<!--PC和WAP自适应版-->
<!--畅言评论插件 start-->
<div id="SOHUCS" sid="{{ blog.blogId }}" ></div>
<script type="text/javascript">
(function(){
Expand All @@ -10,6 +10,7 @@
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})}); } })(); </script>
<!--畅言评论插件 end-->
</div>
</div>
{% endif %}
28 changes: 11 additions & 17 deletions app/View/simple/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,18 @@ <h1 class="post-title">{{ blog.title }}</h1>
{{ blog.content | raw }}
</article>

{% if site.duoshuo %}
{% if site.changyan %}
<div class="post-content">
<!-- 多说评论框 start -->
<div class="ds-thread" data-thread-key="{{ blog.blogId }}" data-title="{{ blog.title }}" data-url="{{ site.url }}{{ blog.siteURL }}"></div>
<!-- 多说评论框 end -->
<!-- 多说公共JS代码 start (一个网页只需插入一次) -->
<script type="text/javascript">
var duoshuoQuery = {short_name:"{{ site.duoshuo }}"};
(function() {
var ds = document.createElement('script');
ds.type = 'text/javascript';ds.async = true;
ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
ds.charset = 'UTF-8';
(document.getElementsByTagName('head')[0]
|| document.getElementsByTagName('body')[0]).appendChild(ds);
})();
</script>
<!-- 多说公共JS代码 end -->
<!--畅言评论插件 start-->
<div id="SOHUCS" sid="{{ blog.blogId }}" ></div>
<script type="text/javascript">
(function(){
var appid = "{{ confObj.changyan }}";
var conf = 'prod_1fb21904f797de208dd3e1bee418b76e';
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})}); } })(); </script>
<!--畅言评论插件 end-->
</div>
{% endif %}
</div>
Expand Down

0 comments on commit d772200

Please sign in to comment.