/*
This is the script to add CGI:IRC login box to random pages (like ]).
Please report problems to ] (http://en.wikinews.orghttps://wikines.com/sv/user_talk:Bawolff ).
modifications may take some time to get through caching. For yourself you can do
a hard refresh of
to make mods go live. From http://en.wikinews.orghttps://wikines.com/sv/mediawiki:Irc.js this is
version 2.0. If you have any complaints, comments requests, please contact me at
http://en.wikinews.orghttps://wikines.com/sv/user_talk:Bawolff
Just add <code><nowiki><div id="cgiircbox"/> </nowiki></code> (some wikis may
need <code><nowiki><div id="cgiircbox"></div> </nowiki></code>) to a random page.
You can style and add classes to thsi div if you want. in fact it doesn' even
have to be a div, but a block level element is recommended (could be
<code><nowiki><center id="cgiircbox"/> </nowiki></code>)
Note: This is heavily based on the login page from CGI:IRC 0.5 (or more
specificly it is a reimplementation of the login page in javascript, to get
around restrictions on which elements can be added to a mediawiki page, plus
a few extra features added along the way). CGI:IRC is made by David Leadbeater
and is under the GPL. See http://cgiirc.sf.net . (therefor i geuss you could
consider the entire combined thing under the gpl. I'm not a 100% sure how the
copyright issue for this works, in any case I'm ok with any of my edits to the
script being GPL)
*/
/*extern wgUserName wgUserGroups, new_input, new_element, new_label, setcharset*/
function add_irc() {
var debug = false;
var irc_div = document.getElementById( "cgiircbox" );
if ( irc_div ) {
var ircframe = document.createElement( "iframe" );
var src_attr = document.createAttribute( "src" );
var dim = new Array( document.createAttribute( "width" ), document.createAttribute( "height" ) );
src_attr.nodeValue = "//webchat.freenode.net/?channels=%23wikipedia-sv&uio=MT1mYWxzZQ9a&prompt=1&nick="
+ (mw.user.getName() || '');
dim.nodeValue = "100%";
dim.nodeValue = "500";
ircframe.setAttributeNode( src_attr );
ircframe.setAttributeNode( dim );
ircframe.setAttributeNode( dim );
irc_div.appendChild( ircframe );
}
}
//because this is already from a load event
add_irc();