User:Samantas5855/chat.js

var chatTopicArray = [ {url:wgServer+"/wiki/Club_Penguin_Wiki:Policy/Chat",text:"Chat Policy",imgUrl:"http://vignette3.wikia.nocookie.net/clubpenguin/images/e/ef/Rules_chat_header.png/revision/latest?cb=20160102202156"}, {url:wgServer+"/wiki/Club_Penguin_Wiki:IRC",text:"IRC",imgUrl:"http://vignette1.wikia.nocookie.net/clubpenguin/images/d/db/Irc_chat_header.png/revision/latest?cb=20160102203031"}, {url:wgServer+"/wiki/Special:RecentChanges",text:"Recent Changes",imgUrl:"http://vignette4.wikia.nocookie.net/clubpenguin/images/0/05/Pencil_Pin.PNG/revision/latest?cb=20150313160141"}, {url:wgServer+"/wiki/MediaWiki:Emoticons",text:"Emoticons List",imgUrl:"http://vignette3.wikia.nocookie.net/clubpenguin/images/5/5c/Old_Laugh_Emoticon.png/revision/latest?cb=20130313015753"}, {url:wgServer+"/wiki/Special:MyPage",text:"My Profile",imgUrl:""+wgAvatarUrl} ]; if (typeof chatTopicArray === 'undefined') { var chatTopicArray = [{ url: wgServer + "/wiki/Special:RecentChanges", text: "Recent Changes", imgUrl: "http://img3.wikia.nocookie.net/__cb20140914153816/d97/images/7/7c/Icon_recent_changes.png" }, {       url: wgServer + "/wiki/Special:MyPage", text: "My Profile", imgUrl: "" + wgAvatarUrl + "" }, {       url: wgServer + "/wiki/Special:Chat?action=purge", text: "refresh", imgUrl: "http://img1.wikia.nocookie.net/__cb20140914153817/d97/images/8/89/Icon_refresh.png" }, ]; }

ChatTopic = { VERSION: "2.1.1",

loadApp: function {

$('#ChatHeader > h1.public.wordmark').css('position', 'absolute'); $('#ChatHeader > h1.public.wordmark').css('top', '0px');

// Fixes the logo

if (!$('.chattopic').length) {

// Adds the container for the chat topic

$('#ChatHeader').prepend(' ');

// Adds the topic items

for (i = 0; i < chatTopicArray.length; i++) { if (i < chatTopicArray.length - 1) { $("div.chattopic").append(' ' + chatTopicArray[i].text + ' • '); if (chatTopicArray[i].url.indexOf(wgServer + "/wiki/Special:Chat") != -1) { $("a.topiclink" + String(i)).attr("target", ""); }               } else { $("div.chattopic").append(' ' + chatTopicArray[i].text + ''); if (chatTopicArray[i].url.indexOf(wgServer + "/wiki/Special:Chat") != -1) { $("a.topiclink" + String(i)).attr("target", ""); }               }            }        }

$("#ChatHeader > h1.private").remove; // Stops the private chat header from causing problems

console.log("[TOPIC] Loaded ChatTopic version " + ChatTopic.VERSION); // END Chat header } };

ChatTopic.loadApp;