User:Connel MacKenzie/irc.js

/* Use Wikizine.org's CGI-IRC gateway May have to install my own copy of http://cgiirc.sourceforge.net/ on toolserver?

function wiktOpenCgiWindow { // If they have a "delete" button on this page, they are a sysop. // var isSysop = document.getElementById('ca-delete'); // if ( !isSysop ) return; PromptWin = window.open("about:blank", "WiktionaryIRC", "width=680,location=yes,menubar=yes,toolbar=yes,resizable,scrollbars"); PromptWin.document.open; PromptWin.document.write(" Wiktionary IRC on irc.freenode.net "); PromptWin.document.write(''); PromptWin.document.write(''); PromptWin.document.write(''); PromptWin.document.write(''); PromptWin.document.write(''); PromptWin.document.write('#wiktionary '); PromptWin.document.write(''); PromptWin.document.write('  '); PromptWin.document.close; }

function wiktAddIrcButton { // If they have a "delete" button on this page, they are a sysop. var isSysop = document.getElementById('ca-delete'); if ( !isSysop ) return; var irca = document.createElement('a'); irca.href = "javascript:wiktOpenCgiWindow; return false;"; irca.onclick = function { wiktOpenCgiWindow; return false;} ; var ircs = document.createTextNode(' . . '); var irct = document.createTextNode('irc'); irca.appendChild( irct ); document.getElementById( 'pt-logout' ).parentNode.appendChild( ircs ); document.getElementById( 'pt-logout' ).parentNode.appendChild( irca ); }

$( wiktAddIrcButton );