Updated disqus and some docs

This commit is contained in:
C9 2012-09-17 02:00:48 -04:00
commit 94b75bd994
5 changed files with 74 additions and 59 deletions

View file

@ -1,22 +1,17 @@
function setupDisqus() {
function setupDisqus(href) {
var disqus_shortname = 'aceapi';
var dsqId = "disqusScript";
//var paths = window.location.pathname.split("/");
//var fileName = paths[paths.length - 2] + "/" + paths[paths.length - 1];
//var disqus_identifier = fileName;
var lochash = location.hash.substr(1);
var disqus_identifier = "api/" + (lochash.substr(lochash.indexOf('api=')).split('&')[0].split('=')[1] || "index") + ".html";
var disqus_identifier = href.substring(2);
(function() {
if (document.getElementById(dsqId))
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).removeChild(document.getElementById(dsqId));
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'https://' + disqus_shortname + '.disqus.com/embed.js';
dsq.id="disqusScript";
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
if (document.getElementById("disqusScript") === null) {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
}
})();
}