Pengguna:Connel MacKenzie/irc.js

Daripada Wiktionary

Catatan: Selepas menyiarkan perubahan, anda mungkin perlu memintas cache pelayar untuk melihatnya.

  • Firefox / Safari: Tahan Shift sambil mengklik Reload, atau tekan sama ada Ctrl-F5 atau Ctrl-R (⌘-R pada Mac)
  • Google Chrome: Tekan Ctrl-Shift-R (⌘-Shift-R pada Mac)
  • Internet Explorer / Edge: Tahan Ctrl sambil mengklik Refresh, atau tekan Ctrl-F5
  • Opera: Tekan Ctrl-F5.
/* 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("<html><title>Wiktionary IRC di irc.freenode.net</title>");
        PromptWin.document.write('<body onload="document.loginform.submit.click();">');
        PromptWin.document.write('<form action="http://chatwikizine.memebot.com/cgi-bin/cgiirc/irc.cgi" method="post" id="loginform" name="loginform">');
        PromptWin.document.write('<input type="hidden" name="interface" value="nonjs">');
        PromptWin.document.write('<input type="text" name="Nama samaran" value="' + wgUserName + '">');
        PromptWin.document.write('<input type="text" name="Pelayan" value="irc.freenode.net " disabled="1">');
        PromptWin.document.write('<select name="Siaran"><option value="#wiktionary">#wiktionary</option></select>');
        PromptWin.document.write('<input type="submit" name="submit" id="submit">');
        PromptWin.document.write('</form></body></html>');
        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 );