25 lines
791 B
JavaScript
25 lines
791 B
JavaScript
window.onload = function () {
|
|
var url = window.location.pathname,
|
|
file = url.split('/')[url.split('/').length - 1].substring(0,5);
|
|
|
|
if (file == 'entry') {
|
|
add_shares(url);
|
|
}
|
|
};
|
|
|
|
function add_shares (url) {
|
|
var section = document.getElementsByTagName('section')[0],
|
|
div = document.createElement('div'),
|
|
script = document.createElement('script');
|
|
|
|
div.id = 'social';
|
|
div.style.cssText = 'margin-top:1em;padding-top:1em;border-top:1px dashed gray;'
|
|
div.innerHTML += '<h3 style="margin:0;color:gray;font-style:normal;">Comments</h3>';
|
|
div.innerHTML += '<p><a href="#comments"><span id="cmtcount"></span> Comments</a></p>';
|
|
section.appendChild(div);
|
|
|
|
script.type = 'text/javascript';
|
|
script.src = '/hashover/comments.php';
|
|
div.appendChild(script);
|
|
}
|