User:SpacePucky/global.js

/** Variablen für AjaxRC **/ window.AjaxRCRefreshText = 'Auto-Aktualisierung'; window.AjaxRCRefreshHoverText = 'automatische Aktualisierung ohne Neuladen der kompletten Seite';

/* Buttons (taken from: http://community.wikia.com/wiki/User:AmonFatalis/global.js)*/ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://static2.wikia.nocookie.net/monsterhunternews/de/images/d/d3/Button_Weiterleitung.png", "speedTip": "Weiterleitung", "tagOpen": "#REDIRECT ",   "tagClose": "", "sampleText": "R" }; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://upload.wikimedia.org/wikipedia/en/f/fd/Button_blockquote.png", "speedTip": "Anführungszeichen", "tagOpen": "„", "tagClose": "“", "sampleText": "M" }; } /* chat hacks */ importScriptPage('User:Monchoman45/ChatHacks.js', 'c');

/* AwesomeSearch by PedroM (from:http://community.wikia.com/wiki/User:PedroM/global.js) */ document.getElementById("searchForm").addEventListener ("submit", function(event) { "use strict";  var suchText = document.getElementById("searchInput").value;  if (suchText.indexOf(":") != -1) {    event.preventDefault;    //event.stopPropagation;    window.location = '/wiki/' + encodeURI(suchText);  } });

/* Multi-PM */ importScriptPage('User:Joeytje50/ChatPMs.js', 'c');

/* changing "Start a wikia" in RC (taken from: http://community.wikia.com/wiki/User:AmonFatalis/global.js)*/ $('.start-wikia').attr('href','/wiki/Special:RecentChanges?hidebots=0').attr('title','Special:RecentChanges').text('Änderungen');

/* Lets the join chat button open in a new tab + let the /chat.css and /chat.js pages work. Taken from Monchoman */ $(setTimeout('ChatCheck', 200)); function ChatCheck { if($('.chat-join button').length != 0) { $('.chat-join button').replaceWith('Join the Chat'); } else { setTimeout('ChatCheck', 200); }   }    function OpenChatWindow { window.chatwindow = window.open('/index.php?title=Special:Chat&useskin=wikia'); window.chatwindow.onload = function { //addOnloadHook, importScript, and importStylesheet window.chatwindow.$('body').prepend(' \nfunction importScript(b){var a=wgScript+"?title="+encodeURIComponent(b.replace(/ /g,"_")).replace(/%2F/ig,"/").replace(/%3A/ig,":")+"&action=raw&ctype=text/javascript";return importScriptURI(a)}\nfunction importScriptURI(a){var b=document.createElement("script");b.setAttribute("src",a);b.setAttribute("type","text/javascript");document.getElementsByTagName("head")[0].appendChild(b);return b}\nfunction importScriptPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/javascript";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importScriptURI(a)}\nfunction importStylesheet(a){return importStylesheetURI(wgScript+"?action=raw&ctype=text/css&title="+encodeURIComponent(a.replace(/ /g,"_")))}\nfunction importStylesheetURI(b,d){var a=document.createElement("link");a.type="text/css";a.rel="stylesheet";a.href=b;if(d){a.media=d}document.getElementsByTagName("head")[0].appendChild(a);return a}\nfunction importStylesheetPage(b,d){var a="/index.php?title="+encodeURIComponent(b.replace(/ /g,"_")).replace("%2F","/").replace("%3A",":")+"&action=raw&ctype=text/css";if(typeof d=="string"){if(d.indexOf("://")==-1){a="http://"+d+".wikia.com"+a}else{a=d+a}}return importStylesheetURI(a)}\n//This isn\'t the same as the regular addOnloadHook, because the regular one runs from a script tag in the body that I don\'t feel like appending. It\'s easier to just make it $(function), which is essentially equivalent\nfunction addOnloadHook(func) {$(func);}\n ');                   //global.js                    window.chatwindow.importScriptURI('http://community.wikia.com/index.php?title=User:' + wgUserName + '/global.js&action=raw&ctype=text/javascript');                    //chat.js                    window.chatwindow.importScriptURI(wgServer + '/index.php?title=User:' + wgUserName + '/chat.js&action=raw&ctype=text/javascript');                    //global.css                    window.chatwindow.importStylesheetURI('http://community.wikia.com/index.php?title=User:' + wgUserName + '/global.css&action=raw&ctype=text/css');                    //chat.css                    window.chatwindow.importStylesheetURI(wgServer + '/index.php?title=User:' + wgUserName + '/chat.css&action=raw&ctype=text/css');            }    }

/* Stuff */ importArticles({   type: 'script',    articles: [         'u:dev:AjaxDiff/code.js',         'u:dev:ViewRemoved/code.js',         'u:dev:View_Source/code.js',         'u:dev:AjaxPatrol/code.js',         'u:dev:RedirectManagement/code.js',         'u:dev:ColoredColors/code.js',         'u:dev:AjaxRC/code.js',         'u:dev:WallGreetingButton/code.js'    ] });