-
-
Save ebryn/1478583 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/x-handlebars" data-template-name="blog-post"> | |
{{view Blog.EditFormView contentBinding="content" classBinding="content.isEditing:editing-form"}} | |
{{view Blog.PostDisplayView contentBinding="content" classBinding="content.isEditing:editing-display"}} | |
{{#if showComments}} | |
<div id="disqus_thread"></div> | |
{{#view contentBinding="content" tagName="script" type="text/javascript"}} | |
var disqus_shortname = 'ideafreemonoid'; | |
var disqus_identifier = '{{content.slug}}'; | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); | |
{{/view}} | |
<a href="http://disqus.com" class="dsq-brlink">blog comments powered by | |
<span class="logo-disqus">Disqus</span></a> | |
{{/if}} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Blog.PostDisplayView = Ember.View.extend({ | |
didInsertElement: function() { | |
var disqus_shortname = 'ideafreemonoid'; | |
var disqus_identifier = this.getPath('content.slug'); | |
(function() { | |
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; | |
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js'; | |
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); | |
})(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment