User:Marek69/sharebox.js

function shareBox { var panel = document.getElementById("mw-panel"); var sharebox = document.createElement("div"); sharebox.className = "portal collapsed" sharebox.setAttribute("id","p-share"); var heading = document.createElement("h5"); heading.innerHTML = "Share this article..."; var body = document.createElement("div"); body.style.display = "hidden"; body.className = "body" var ul = document.createElement("ul"); body.appendChild(ul); var twitterli = document.createElement("li"); ul.appendChild(twitterli); var twitter = document.createElement("a"); twitter.href = "http://twitter.com/share?url="+window.location+"&text="+document.title+" #Wikipedia"; twitter.innerHTML = "on Twitter"; twitterli.appendChild(twitter); sharebox.appendChild(heading); sharebox.appendChild(body); panel.appendChild(sharebox); } $(function { shareBox ; });