load disqus only on request
[mdref/mdref] / views / layout.phtml
index 6ef0ecf46fc6d7a51f51b75b6b70b6bf95d0fa0f..e49d520fe8a9c66509d00ab6f77c69bc9e85ac31 100644 (file)
@@ -17,7 +17,7 @@
                        <link rel="stylesheet" href="index.css">
                <?php endif; ?>
 
-               <link href="https://fonts.googleapis.com/css?family=Inconsolata&subset=latin-ext" rel="stylesheet">
+               <link href="https://fonts.googleapis.com/css?family=Inconsolata&amp;subset=latin-ext" rel="stylesheet">
                <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
                <link rel="shortcut icon" href="<?= $baseUrl . "favicon.ico" ?>">
        </head>
                        <?php include __DIR__."/index.phtml" ?>
                <?php endif; ?>
 
-               <?php if (@$_SERVER["SERVER_NAME"] != "localhost") : ?>
-
-                       <div id="disqus_thread"></div>
+                       <div id="disqus_thread"><button id="disqus_activator">Show <span> </span> Comment(s)</button></div>
                        <script>
                                var disqus_shortname = 'mdref';
                                var disqus_identifier = '<?=$ref?>';
-                               (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>
-               <?php endif; ?>
 
                        <footer>
                                <?php include __DIR__."/footer.phtml" ?>