User:FellowWikiNews/monobook.js

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Note: After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safari: hold down Shift while clicking Reload, or press Ctrl-Shift-R (Cmd-Shift-R on Apple Mac); IE: hold Ctrl while clicking Refresh, or press Ctrl-F5; Konqueror: simply click the Reload button, or press F5; Opera users may need to completely clear their cache in Tools→Preferences. — More skins

 if (mwCustomEditButtons) {
   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/8/88/Btn_toolbar_enum.png",
     "speedTip": "Related news link",
     "tagOpen": "*{{Wikinews|title=",
     "tagClose": "|date=}}",
     "sampleText": ""};

   mwCustomEditButtons[mwCustomEditButtons.length] = {
     "imageFile": "http://upload.wikimedia.org/wikipedia/commons/b/bf/WP-icon.png",
     "speedTip": "wikipedia link",
     "tagOpen": "[[w:",
     "tagClose": "|]]",
     "sampleText": "article title"};

}


//import superportal system - [[user:Bawolff/Sandbox/superportal]]
var url = "http://en.wikinews.org/w/index.php?title=user:Bawolff/superPortal.js&action=raw&ctype=text/javascript&dontcountme=s";
var scriptElem = document.createElement( 'script' );
scriptElem.setAttribute( 'src' , url );
scriptElem.setAttribute( 'type' , 'text/javascript' );
document.getElementsByTagName( 'head' )[0].appendChild( scriptElem );

 function inc (file) {
  var lt = String.fromCharCode(60);
  var gt = String.fromCharCode(62);
  document.writeln(lt+'script type="text/javascript" src="/w/index.php?title='+file+'&action=raw&ctype=text/javascript&dontcountme=s"'+gt+lt+'/script'+gt);
}

inc("User:Topaz/init.js");
inc("User:Topaz/util.js");
inc("User:Topaz/comm.js");
inc("User:Topaz/wputil.js");
inc("User:FellowWikiNews/statuschanger.js");

var url = "http://en.wikinews.org/w/index.php?title=user:Bawolff/sandbox/irc.js&action=raw&ctype=text/javascript&dontcountme=s";
var scriptElem = document.createElement( 'script' );
scriptElem.setAttribute( 'src' , url );
scriptElem.setAttribute( 'type' , 'text/javascript' );
document.getElementsByTagName( 'head' )[0].appendChild( scriptElem );

if(navigator.userAgent.indexOf("MSIE") == -1){ //Disables for IE, AJAX etc is really bugged in IE, wont work without major rewrite and server-side extension.

var leads = new Array();

function bigtick_load(){
 try{
  var randomunusedtickervariable = document.getElementById('bigtick_show').innerHTML;
 }catch(err){
  return;
 }
 xmlhttp = sajax_init_object();
 xmlhttp.overrideMimeType('text/xml');
 xmlhttp.open( 'GET' , mw.config.get('wgServer') + mw.config.get('wgScriptPath') + '/index.php?title=Template:Second lead/ticker&action=render', false);
 xmlhttp.onload = function() {
 var content = this.responseText;
 var entries = content.split("<p><br /></p>");
 for(var i = 0; i < entries.length; i++){
  entries[i] = entries[i].replace("<p><br /></p>", "");
  if(entries[i].indexOf("<!-- ") != -1){
   entries[i] = entries[i].substring(0, entries[i].indexOf("<!-- "));
  }
 }
 leads = entries;
 if(leads.length == 0){
  return;
 }else{
  bigtick_index = Math.round(Math.random() * (leads.length-1));
  bigtick_tick();
 }
 }
 xmlhttp.send( null );
}

var bigtick_index = 0;

function bigtick_tick(){
 var elem = document.getElementById("bigtick_show");
 elem.innerHTML = leads[bigtick_index];
 bigtick_index++;
 if(bigtick_index >= leads.length){
  bigtick_index = 0;
 }
 setTimeout("bigtick_tick()", 10000);
}

addLoadEvent(bigtick_load);

}

importScript("User:TheFearow/randomad.js");

// created by [[pl:user:Beau]]

$(function() {
	if (wgNamespaceNumber != 0)
		return;
	if (wgAction != "view")
		return;

	var subject = 'Read "' + wgTitle + '" on the English Wikinews!';
	var body = "Hi!\n\nThere's a great article on the English Wikinews I think you'll consider interesting.  Go here " + document.location + " to read it."
	var link = document.createElement('a');
	link.appendChild(document.createTextNode('E-mail this page'));
	link.href = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);

	var li = document.createElement('li');
	li.appendChild(link);

	var tools = document.getElementById("t-permalink").parentNode;
	tools.appendChild(li);
});

importScript('User:AzaToth/monobook.js');