diff --git a/js/main.js b/js/main.js index d71dc8b..c203dc6 100644 --- a/js/main.js +++ b/js/main.js @@ -9,16 +9,11 @@ window.onload = function () { function add_shares (url) { var section = document.getElementsByTagName('section')[0], - div = document.createElement('div'), - script = document.createElement('script'); + div = document.createElement('div'); div.id = 'social'; div.style.cssText = 'margin-top:1em;padding-top:1em;border-top:1px dashed gray;' - div.innerHTML += '
'; - div.innerHTML += 'Tweet'; div.innerHTML += '

Comments

'; section.appendChild(div); - script.src = '../js/mastodon.js'; - section.appendChild(script); } diff --git a/js/mastodon.js b/js/mastodon.js deleted file mode 100644 index e23575e..0000000 --- a/js/mastodon.js +++ /dev/null @@ -1,60 +0,0 @@ -// Mastodon Share -// Create of DEADBLACKCLOVER -// License GNU GPL-3 - -var host = null, - message = null; - -var mastodon = document.getElementById("mastodon-share"); - -mastodon.innerHTML = "
" + - ""; - -var btn = document.getElementById("mastodon-share-btn"); - -btn.style.width = "120px"; -btn.style.height = "30px"; -btn.style.backgroundColor = "#282c37"; -btn.style.backgroundImage = "url(https://joinmastodon.org/static/media/logo_full.97822390.svg)"; -btn.style.backgroundSize = "75% 80%"; -btn.style.backgroundRepeat = "no-repeat"; -btn.style.backgroundPosition = "50% 50%"; -btn.style.color = "#d9e1e8"; -btn.style.border = "0"; -btn.style.borderRadius = "5px"; - -var block = document.getElementById("mastodon-share-host"); - -block.style.marginTop = "5px"; -block.style.backgroundColor = "#282c37"; -block.style.width = "180px"; -block.style.padding = "5px"; -block.style.borderRadius = "5px"; - -var ipt = document.getElementById("mastodon-share-ipt"); - -ipt.style.width = "110px"; -ipt.style.marginRight = "5px"; - -function getMessageMastodon(mes) { - message = mes; -} - -function viewHostMastodon() { - block.hidden = false; -} - -function getHostMastodon(){ - host = ipt.value; - shareMastodon(); -} - -function shareMastodon() { - if(host && message){ - host = 'https://' + host + '/share?text=' + message; - var newWin = window.open(host, "Mastodon", "width=430,height=320"); - } -}