jaraco.pmxbot
=============

Plugins for `pmxbot <https://pypi.python.org/pypi/pmxbot>`_ by jaraco.

Bookmarklet
-----------

jaraco.pmxbot provides a `share on IRC`_ bookmarklet
for readily sending messages to the pmxbot HTTP interface. To install it,
just option-click the link and add it to your bookmarks, then edit the bookmark
to replace "ircbot.example.com" with the hostname of your pmxbot HTTP listener.

.. _share on IRC: javascript:(function(){if(!window.pmxbot){function%20i(){document.body.style.overflow="initial";e.parentNode.removeChild(e);window.pmxbot=false;m()}function%20g(c){if(c.which>31&&c.which<41&&c.target===document.body){c.preventDefault();c.stopImmediatePropagation()}}function%20k(c){c.preventDefault();c.stopImmediatePropagation()}function%20b(){window.addEventListener("DOMMouseScroll",k);window.addEventListener("keydown",g)}function%20m(){window.removeEventListener("DOMMouseScroll",k);window.removeEventListener("keydown",g)}var%20n="//ircbot.example.com/";window.pmxbot=true;b();var%20j=document.createElement("div"),e=document.createElement("div");e.setAttribute("style","position:absolute;width:100%;background-color:rgba(0,0,0,.5);z-index:2147483647;text-align:center");e.id="pmxover";e.style.height=window.innerHeight+"px";e.style.top=window.scrollY+"px";e.style.left=window.scrollX+"px";var%20r="padding:1em;background:#fff;border:1px%20#ccc%20solid;margin:.5em;width:90%;border-radius:0;",p="text-align:center;font-family:Helvetica,Arial;";j.setAttribute("style",p+"background-color:#eee;padding:%201em;width:25em;position:relative;top:50%;transform:translateY(-50%);margin:auto;box-shadow:0%200%2030px%20#555;border-radius:0.25em;");e.appendChild(j);document.body.appendChild(e);document.body.style.overflow="hidden";var%20h=document.createElement("form"),u=document.createElement("input"),l=document.createElement("input");u.setAttribute("type","submit");l.setAttribute("type","button");h.innerHTML="<span%20style='font-size:2em;float:left;padding-left:.2em;color:#666;'>pmxbot</span><input%20id='pmxchn'%20placeholder='Channel'%20style='"+p+r+"'><br><input%20id='pmxmsg'%20placeholder='Message'%20style='"+p+r+"'%20value='"+document.URL+"'>";var%20a="all:initial;margin:.5em;width:42.5%;cursor:pointer;padding:.5em%200;";u.setAttribute("style",a+p+"background:#5dc251;border:0;box-shadow:0%203px%200%20#409936;color:#dbf0df");l.setAttribute("style",a+p+"background:#f66;border:0;box-shadow:0%203px%200%20#e01414;color:#fcc");u.setAttribute("value","Submit");l.setAttribute("value","Cancel");h.style.marginBottom="0";h.appendChild(u);h.appendChild(l);j.appendChild(h);document.getElementById("pmxmsg").focus();document.getElementById("pmxchn").value=localStorage.getItem("strchn")||"";document.getElementById("pmxchn").addEventListener("keyup",function(){localStorage.setItem("strchn",this.value)});h.addEventListener("submit",function(o){o.stopImmediatePropagation();o.preventDefault();var%20c=new%20XMLHttpRequest(),d=document.getElementById("pmxchn").value,f=document.getElementById("pmxmsg").value;c.open("POST",n+d,true);c.setRequestHeader("Content-type","text/plain");c.onreadystatechange=function(){if(c.readyState===4){if(c.status===200){i()}else{alert("Err:%20Received%20Code:%20"+c.status)}}};c.send(f)});e.addEventListener("click",function(c){c.stopImmediatePropagation();if(c.target.id==="pmxover"){i()}});e.addEventListener("keyup",function(c){if(c.which===27){i()}});l.addEventListener("click",function(c){c.stopImmediatePropagation();i()})}})();
