add discus

This commit is contained in:
Van 2015-03-01 21:13:21 +08:00
parent 6b7aaa6a77
commit 9e920eff93
5 changed files with 28 additions and 5 deletions

View File

@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
body {
overflow: auto;
}
.header {
margin: 0;
padding: 5px;
@ -87,4 +91,9 @@
.btn {
padding: 1px 5px;
}
#disqus_thread {
border-top: 1px solid #919191;
padding: 0 30px;
}

View File

@ -13,6 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
body {
overflow: auto;
}
.header {
margin: 0;
padding: 10px;
@ -83,4 +87,9 @@
#dialogShare a {
white-space: pre-wrap;
word-wrap: break-word;
}
#disqus_thread {
border-top: 1px solid #919191;
padding: 0 30px;
}

View File

@ -309,7 +309,6 @@
padding-left: 5px;
height: 19px;
line-height: 18px;
position: fixed;
bottom: 0;
z-index: 11;
width: 100%;

View File

@ -18,11 +18,14 @@ var playground = {
editor: undefined,
pid: undefined,
_resize: function () {
if (config.disqus) {
return false;
}
if (config.embed) {
$("#editorDiv").parent().height($(window).height() - 35 - $(".footer").height());
playground.editor.setSize("auto", ($("#editorDiv").parent().height() * 0.7) + "px");
} else {
$("#editor, #output").height($(window).height() - 58 - $(".footer").height());
$("#editor, #output").height($(window).height() - 60 - $(".footer").height());
playground.editor.setSize("auto", $("#editor").height() + "px");
}
},

View File

@ -70,12 +70,14 @@
<script type="text/javascript">
var disqus_shortname = 'wide-playground';
var disqus_identifier = {{.fileName}};
var disqus_url = window.location.protocol + "//" + {{.conf.Server}} + {{.conf.Context}} + "/playground/" + {{.fileName}}
var disqus_url = window.location.protocol + "//" + {{.conf.Server}} + {{.conf.Context}} + "/playground/" + {{.fileName}};
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();</script>
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
{{end}}
<div class="footer">
@ -94,7 +96,8 @@
"channel": "{{.conf.Channel}}",
"wideSessionId": "{{.session.ID}}",
"label": {{.i18n}},
"embed": {{.embed}}
"embed": {{.embed}},
"disqus": {{.disqus}}
};
function newWideRequest() {
var ret = {