Skip to content

Instantly share code, notes, and snippets.

@dfischer
Created August 14, 2014 23:29
Show Gist options
  • Save dfischer/42ae5c3dc20b0d3a65b2 to your computer and use it in GitHub Desktop.
Save dfischer/42ae5c3dc20b0d3a65b2 to your computer and use it in GitHub Desktop.
--- /dev/null
+++ b/client/views/application/disqus.html
@@ -0,0 +1,7 @@
+<template name="disqus">
+ <div id="my-disqus">
+ <div id="disqus_thread"></div>
+ <noscript>Por favor, habilite JavaScript para ver os <a href="http://disqus.com/?ref_noscript">comentários hospeda
+ <a href="http://disqus.com" class="dsq-brlink"><h2>Carregando postagens...</h2><br /><small>comentários hospedados
+ </div>
+</template>
--- a/lib/router.js
+++ b/lib/router.js
+ onAfterAction: function() {
+ var disqus_developer, disqus_identifier, disqus_shortname, disqus_title, disqus_url, dsq, locator;
+ if (window.DISQUS) {
+ locator = this.data;
+ return window.DISQUS.reset({
+ reload: true,
+ config: function() {
+ this.page.identifier = locator.slug;
+ this.page.title = locator.fullName;
+ return this.page.url = window.location.href;
+ }
+ });
+ } else {
+ disqus_shortname = 'nosfiscais';
+ disqus_identifier = this.data.slug;
+ disqus_title = this.data.fullName;
+ disqus_url = window.location.href;
+ disqus_developer = 1;
+ dsq = document.createElement("script");
+ dsq.type = "text/javascript";
+ dsq.async = true;
+ dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
+ return (document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq)
+ }
+
+ },
--- a/client/views/locators/locator_page.html
+++ b/client/views/locators/locator_page.html
+ {{> disqus}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment