Advertisement
Maulle

Chat Plugin

Sep 23rd, 2014
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 28.66 KB | None | 0 0
  1. if (typeof(FlashTitle)=="undefined") { //Make sure Monchoman45's ChatHacks isn't loaded
  2. /**
  3.  * Wikia ChatPlugins
  4.  * Change some options on Special:Chat to make it easier
  5.  * to use and more useful in general.
  6.  *
  7.  * WARNING
  8.  * Make sure you are not loading MediaWiki:Chat.js/load.js
  9.  * with MediaWiki:Chat-edit-count.
  10.  * Load it with MediaWiki:Chat-welcome-message, or this
  11.  * will malfunction badly.
  12.  *
  13.  * Created from ChatOptions
  14.  * by Callofduty4, Madnessfan34537, and Sactage
  15.  */
  16.  
  17.  
  18. if (typeof(chatPluginsCustom)!="undefined") {
  19.         if (typeof(chatPluginsCustom.staffIcon)=="undefined") {
  20.                 chatPluginsCustom.staffIcon = "http://img1.wikia.nocookie.net/__cb20140626173406/gamedezyner/images/6/60/StaffIcon.png";
  21.         }
  22.         if (typeof(chatPluginsCustom.modIcon)=="undefined") {
  23.                 chatPluginsCustom.modIcon= "http://img1.wikia.nocookie.net/__cb20140626173343/gamedezyner/images/8/89/ModIcon.png";
  24.         }  
  25.         if (typeof(chatPluginsCustom.pingSound)=="undefined") {
  26.                 chatPluginsCustom.pingSound = "http://images.wikia.com/gamedezyner/images/7/7e/PingSound.ogg";
  27.         }
  28.         if (typeof(chatPluginsCustom.loadedFrom)=="undefined") {
  29.                 chatPluginsCustom.loadedFrom = "chat.js";
  30.         }
  31. }
  32. else {
  33.         chatPluginsCustom = {
  34.                 staffIcon: "http://img1.wikia.nocookie.net/__cb20140626173406/gamedezyner/images/6/60/StaffIcon.png",
  35.                 modIcon: "http://img1.wikia.nocookie.net/__cb20140626173343/gamedezyner/images/8/89/ModIcon.png",
  36.                 pingSound: "http://images.wikia.com/gamedezyner/images/7/7e/PingSound.ogg",
  37.                 loadedFrom: "MediaWiki:Chat.js"
  38.         }
  39. }
  40.  
  41.  
  42. var chatPlugins = {
  43.         release: {
  44.                 version: 0.6,
  45.                 branch: "Stable"
  46.         },
  47.         custom: {
  48.                 staffIcon: chatPluginsCustom.staffIcon,
  49.                 modIcon: chatPluginsCustom.modIcon,
  50.                 pingSound: chatPluginsCustom.pingSound
  51. //              forcedModules: chatPluginsCustom.forcedModules,
  52. //              forcedSettings: chatPluginsCustom.forcedSettings,
  53. //              disabledModules: chatPluginsCustom.disabledModules
  54.         },
  55.         module: function(name, loadScript, loadWiki) {
  56.                 this.enabled = function() {
  57.                         return chatPlugins.cookie.arrays.modules[this.id];
  58.                 }
  59.                 this.id = Object.keys(chatPlugins.modules).length;
  60.                 this.loaded = false;
  61.                 this.modOnly = false;
  62.                 this.adminOnly = false;
  63.                 this.loadScript = loadScript;
  64.                 this.loadWiki = loadWiki;
  65.                 this.name = name;
  66.                 this.load = function() {
  67.                         if (this.loadWiki!="") {
  68.                                 importScriptPage(this.loadScript,this.loadWiki);
  69.                         }
  70.                         else {
  71.                                 importScriptPage(this.loadScript);
  72.                         }
  73.                         this.loaded = true;
  74.                 }
  75.         },
  76.         modules: {},
  77.         pages: {
  78.                 list: {},
  79.                 save: function() { // Save all registered cookie arrays to respective cookies
  80.                         for (i in Object.keys(chatPlugins.pages.list)) {
  81.                                 chatPlugins.api.functions.editPage("User:" + wgUserName + "/ChatPlugins/" + chatPlugins.pages.list[Object.keys(chatPlugins.pages.list)[i]].name,chatPlugins.pages.list[Object.keys(chatPlugins.pages.list)[i]].value);
  82.                         }
  83.                 },
  84.                 load: function() { // Save all registered cookie arrays to respective cookies
  85.                         for (i in Object.keys(chatPlugins.pages.list)) {
  86.                                 if (typeof(chatPlugins.api.functions.getPage("User:" + wgUserName + "/ChatPlugins/" + chatPlugins.pages.list[Object.keys(chatPlugins.pages.list)[i]].name).content)!="string") {
  87.                                   var content = "";
  88.                                 }
  89.                                 else {
  90.                                   content = chatPlugins.api.functions.getPage("User:" + wgUserName + "/ChatPlugins/" + chatPlugins.pages.list[Object.keys(chatPlugins.pages.list)[i]].name).content;
  91.                                 }
  92.                                 chatPlugins.pages.list[Object.keys(chatPlugins.pages.list)[i]].value = content;
  93.                         }
  94.                 }
  95.         },
  96.         cookie: {
  97.                 arrays: {
  98.                         version: [],
  99.                         modules: []
  100.                 },
  101.                 get: function(cookie_name,pos) {
  102.                         var x, y, cookie_array = document.cookie.split(";");
  103.                         for (var i=0; i < cookie_array.length; i++) {
  104.                                 x = cookie_array[i].substr(0,cookie_array[i].indexOf("="));
  105.                                 y = cookie_array[i].substr(cookie_array[i].indexOf("=")+1);
  106.                                 x = x.replace(/^\s+|\s+$/g,"");
  107.                                 if (x == cookie_name) {
  108.                                         return y;
  109.                                 }
  110.                         }
  111.                 },
  112.                 set: function (cookie_name,data) {
  113.                         var domain = wgServer.split("//")[1];
  114.                         document.cookie =
  115.                         cookie_name + "=" + data + "; max-age=" + 60*60*24*150 + "; path=/; domain=" + domain;
  116.                 },
  117.                 load: function() { // Load all registered cookie arrays from respective cookies
  118.                         for (i in Object.keys(chatPlugins.cookie.arrays)) {
  119.                                 chatPlugins.cookie.arrays[Object.keys(chatPlugins.cookie.arrays)[i]] = chatPlugins.cookie.get("chatPlugins"+Object.keys(chatPlugins.cookie.arrays)[i].charAt(0).toUpperCase() + Object.keys(chatPlugins.cookie.arrays)[i].slice(1)).split(",");
  120.                         }                
  121.                 },
  122.                 save: function() { // Save all registered cookie arrays to respective cookies
  123.                         for (i in Object.keys(chatPlugins.cookie.arrays)) {
  124.                                 chatPlugins.cookie.set("chatPlugins"+Object.keys(chatPlugins.cookie.arrays)[i].charAt(0).toUpperCase() + Object.keys(chatPlugins.cookie.arrays)[i].slice(1),chatPlugins.cookie.arrays[Object.keys(chatPlugins.cookie.arrays)[i]].toString());
  125.                         }
  126.                 },
  127.                 reset: function () { //Reset cookie data to default
  128.                         modules = Object.keys(chatPlugins.modules);
  129.                         for ( i in Object.keys(chatPlugins.modules) ) {
  130.                                 module = chatPlugins.modules[modules[i]];
  131.                                 chatPlugins.cookie.arrays.modules[module.id] = 0;
  132.                         }
  133.                         chatPlugins.cookie.arrays.version[0] = chatPlugins.release.version;
  134.                         chatPlugins.cookie.save();
  135.                 }
  136.         },
  137.         menu: {
  138.                 loaded: false,
  139.                 load: function() {
  140.                         $("#ChatHeader .public.wordmark").append('<ul id="chatPluginsMenu" class="chatPluginsMenu" style="position:absolute;right:150px;top:35px;z-index:99;padding:5px;border: solid 2px ' + $('body').css("background-color") + ';font-size:12px;color:' + $('#WikiaPage').css("color") + ';background-color:' + $('#WikiaPage').css("background-color") + ';display:none;"></ul>');
  141.                         $(".chatPluginsMenu").mouseover(function() {$('#chatPluginsMenu').css('display','block')});
  142.                         $(".chatPluginsMenu").mouseout(function() {$('#chatPluginsMenu').css('display','none')});
  143.                         chatPlugins.menu.loaded = true;
  144.                 },
  145.                 add: function(id, title) {
  146.                         if (!chatPlugins.menu.loaded) {
  147.                                 chatPlugins.menu.load();
  148.                         }
  149.                         $('#chatPluginsMenu').append('<li><a id="' + id + '" href="#">' + title + '</a></li>');
  150.                         $('#'+id).hover(function() { $(this).css("background-color","#cce1ef") },function() { $(this).css("background-color",$('#WikiaPage').css("background-color")) }); //Need to load background color from style
  151.                 },
  152.                 open: function() {
  153.                         var $optionsWindowHTML = $.showCustomModal( "Options", '<form method="" name="" class="WikiaForm "><fieldset>' +
  154.                                 '<div id="chatPluginsHeader">Please select the features you would like to enable:</div>' +
  155.                                 '<table id="chatPluginsTable"></table>' +
  156.                                 '<div>Note: Clicking Save will refresh the chat.</div></fieldset></form>', {
  157.                                 id: "optionsWindow",
  158.                                         width: 400,
  159.                                         buttons: [
  160.                                                 {
  161.                                                         id: "cancel",
  162.                                                         message: "Cancel",
  163.                                                         handler: chatPlugins.menu.cancel
  164.                                                 },
  165.                                                 {
  166.                                                         id: "save",
  167.                                                         defaultButton: true,
  168.                                                         message: "Save",
  169.                                                         handler: chatPlugins.menu.save
  170.                                                 }
  171.                                         ]
  172.                         });
  173.                         $(".close").click(chatPlugins.menu.cancel);
  174.                         $(".blackout").click(chatPlugins.menu.cancel);
  175.                         $(".blackout").addClass("chatPlugins");
  176.                         chatPluginsTable = "";
  177.                         modules = Object.keys(chatPlugins.modules);
  178.                                 for (i=0;i<modules.length;i++) {
  179.                                         module = chatPlugins.modules[modules[i]];
  180.                                         if (i%2) {
  181.                                                 chatPluginsTable += '<td style="padding:2px;"><label><input class="chatOption" type="checkbox" name="' + module.name + '" value="' + module.name + '"/>Enable ' + module.name + '</label>';
  182.                                                 if (typeof(module.settingsID)!="undefined"){
  183.                                                         chatPluginsTable += ' <a href="#" style="font-size:8pt;font-style:italic" id="' + module.settingsID + '">(Settings)</a>';
  184.                                                 }
  185.                                                 chatPluginsTable += '</td></tr>';
  186.                                         }
  187.                                         else {
  188.                                                 chatPluginsTable += '<tr><td style="padding:2px;"><label><input class="chatOption" type="checkbox" name="' + module.name + '" value="' + module.name + '"/>Enable ' + module.name + '</label>';
  189.                                                 if (typeof(module.settingsID)!="undefined"){
  190.                                                         chatPluginsTable += ' <a href="#" style="font-size:8pt;font-style:italic" id="' + module.settingsID + '">(Settings)</a>';
  191.                                                 }
  192.                                                 chatPluginsTable += '</td>';
  193.                                         }
  194.                                         if ((modules.length % 2)!=1) {
  195.                                                 chatPluginsTable += '</tr>';
  196.                                         }
  197.                                         $('#chatPluginsTable').html(chatPluginsTable);
  198.                                        
  199.                                 }
  200.                                 for (i=0;i<modules.length;i++) {
  201.                                         module = chatPlugins.modules[modules[i]];
  202.                                         if (module.enabled()==1) {
  203.                                                 $('input[name="' + module.name + '"]').attr("checked",true);
  204.                                         }
  205.                                         if (module.modOnly && wgUserGroups.indexOf("chatmoderator") == -1 && wgUserGroups.indexOf("sysop") == -1) {
  206.                                                 $('input[name="' + module.name + '"]').attr("checked",false);
  207.                                                 $('input[name="' + module.name + '"]').attr("disabled",true);
  208.                                         }
  209.                                         $("#"+module.settingsID).click(module.settingsFunction);
  210.                                         $("#"+module.settingsID).click(chatPlugins.menu.cancel);
  211.                                 }
  212.                        
  213.                 },
  214.                 save: function() {
  215.                         modules = Object.keys(chatPlugins.modules);
  216.                         checked = $(".chatOption:checked");
  217.                         unchecked = $(".chatOption:not(:checked)");
  218.                         cookieString = "";
  219.                         for ( i in Object.keys(chatPlugins.modules) ) {
  220.                                 module = chatPlugins.modules[modules[i]];
  221.                                 if ($('input[name="' + module.name + '"]:checked').length > 0) {
  222.                                         chatPlugins.cookie.arrays.modules[module.id] = 1;
  223.                                 }
  224.                                 else {
  225.                                         chatPlugins.cookie.arrays.modules[module.id] = 0;
  226.                                 }
  227.                         }
  228.                         chatPlugins.cookie.save();
  229.                         chatPlugins.menu.cancel();
  230.                         if (chatPluginsCustom.loadedFrom == "w:c:Special:MyPage/global.js") {
  231.                                 window.chatwindow = window.open('/wiki/Special:Chat?useskin=wikia', wgDBname + 'chat' + Math.round(Math.random()*100));
  232.                                         window.chatwindow.onload = function () {
  233.                                                 window.chatwindow.importScriptPage('User:' + wgUserName + '/global.js', 'c');
  234.                                                 window.chatwindow.importScriptPage('User:' + wgUserName + '/wikia.js');
  235.                                                 if (api.functions.getPageContents("MediaWiki:Chat.js").indexOf("Stable/ChatPlugins/code.js")==-1) {
  236.                                                         window.chatwindow.chatPluginsCustom = {
  237.                                                                 loadedFrom: "w:c:Special:MyPage/global.js"
  238.                                                         }
  239.                                                         window.chatwindow.importScriptPage('Testing/ChatPlugins/code.js', 'gamedezyner');
  240.                                                 }
  241.                                 }
  242.                                 window.closeme = true;
  243.                         }
  244.                         else {
  245.                                 window.location.reload();
  246.                         }
  247.                 },
  248.                 cancel: function() {
  249.                         $('#optionsWindow').remove();
  250.                         $('.blackout.chatPlugins').remove();
  251.                 }
  252.         },
  253.         load: function() {
  254.                 if (typeof(chatPlugins.cookie.get("chatPluginsVersion"))=="undefined") { // Is ChatPlugins version saved in cookie? If not, initialize cookies for first time and continue loading.
  255.                         chatPlugins.cookie.reset();
  256.                         chatPlugins.alert("Welcome to ChatPlugins! Installed version "+chatPlugins.release.version+" "+chatPlugins.release.branch+"!");
  257.                         chatPlugins.alert("Please be sure to set your settings the way you want!");
  258.                         console.log({Info: "Cookie",Data: "Cookies Initialized for first run"});
  259.                         chatPlugins.loading = true;
  260.                 }
  261.                 else {
  262.                         if (isNaN(parseFloat(chatPlugins.cookie.get("chatPluginsVersion")))) { // Is ChatPlugins version cookie invalid? If so, reset cookies to default values and continue loading.
  263.                                 chatPlugins.cookie.reset();
  264.                                 chatPlugins.alert("Something went wrong, but we caught it! Your chat settings had to be reset though :(");
  265.                                 chatPlugins.alert("Please change your settings to your liking.");
  266.                                 console.log({Error: "Cookie",Data: "Invalid cookies. Cookies were reset."});
  267.                                 chatPlugins.loading = true;
  268.                         }
  269.                         else {
  270.                                 if (parseFloat(chatPlugins.cookie.get("chatPluginsVersion"))>chatPlugins.release.version) { // Is ChatPlugins version older than last load? If so, alert user and stop loading.
  271.                                         chatPlugins.alert("Error! You have used a newer version of ChatPlugins before! Please use the newest version!");
  272.                                         console.log({Error: "Unknown",Result: "Aborting"});
  273.                                         chatPlugins.loading = false;
  274.                                 }
  275.                                 if (parseFloat(chatPlugins.cookie.get("chatPluginsVersion"))==chatPlugins.release.version) { // Is ChatPlugins version the same as last load? If so, log and continue loading.
  276.                                         console.log({Info:"Cookie",Data:"Version match. Continuing load."});
  277.                                         chatPlugins.loading = true;
  278.                                 }
  279.                                 if (parseFloat(chatPlugins.cookie.get("chatPluginsVersion"))<chatPlugins.release.version) { // Is ChatPlugins version newer than last load? If so, alert the user to the upgrade and continue loading.
  280.                                         chatPlugins.cookie.set("chatPluginsVersion",chatPlugins.release.version.toString());
  281.                                         chatPlugins.alert("Welcome to ChatPlugins! Upgraded to version "+chatPlugins.release.version+" "+chatPlugins.release.branch+"!");
  282.                                         chatPlugins.alert("Please be sure to check that your settings are set the way you want!");
  283.                                         chatPlugins.loading = true;
  284.                                 }
  285.                         }
  286.                 }
  287.                 if (chatPlugins.loading) {
  288.                         chatPlugins.cookie.load();
  289.                         modules = Object.keys(chatPlugins.modules);
  290.                         for (i = 0; i < Object.keys(chatPlugins.modules).length; i++) {
  291.                                 module = chatPlugins.modules[modules[i]];
  292.                                 if (module.enabled() == true) {
  293.                                         module.load();
  294.                                 }
  295.                         }
  296.                         $("#ChatHeader .public.wordmark").append('<a href="#" id="chatPluginsButton" class="chatPluginsMenu" style="position:absolute;right:150px;"><img src="http://img2.wikia.nocookie.net/__cb20140623220607/gamedezyner/images/b/bb/ChatPluginsButton.png" height="32px" style="float:right;padding-right:3px;"/></a>');
  297.                         if (chatPluginsCustom.loadedFrom == "w:c:Special:MyPage/global.js" || chatPluginsCustom.loadedFrom == "bookmark") {
  298.                                 $("#ChatHeader .public.wordmark").append('<a href="#" id="chatRefreshButton"><img src="http://img4.wikia.nocookie.net/__cb20140818203356/gamedezyner/images/a/a9/ChatPluginsRefreshButton.png" height="32px"/></a>');
  299.                                 $("#chatRefreshButton").click(function() {
  300.                                         window.chatwindow = window.open('/wiki/Special:Chat?useskin=wikia', wgDBname + 'chat' + Math.round(Math.random()*100));
  301.                                                 window.chatwindow.onload = function () {
  302.                                                         window.chatwindow.importScriptPage('User:' + wgUserName + '/global.js', 'c');
  303.                                                         window.chatwindow.importScriptPage('User:' + wgUserName + '/wikia.js');
  304.                                                         if (api.functions.getPageContents("MediaWiki:Chat.js").indexOf("Stable/ChatPlugins/code.js")==-1) {
  305.                                                                 window.chatwindow.chatPluginsCustom = {
  306.                                                                         loadedFrom: chatPluginsCustom.loadedFrom
  307.                                                                 }
  308.                                                                 window.chatwindow.importScriptPage('Testing/ChatPlugins/code.js', 'gamedezyner');
  309.                                                         }
  310.                                                 }
  311.                                         window.closeme = true;
  312.                                 });
  313.                                 function disableF5(e) {
  314.                                         if ((e.which || e.keyCode) == 116) {
  315.                                                 e.preventDefault();
  316.                                                 window.chatwindow = window.open('/wiki/Special:Chat?useskin=wikia', wgDBname + 'chat' + Math.round(Math.random()*100));
  317.                                         window.chatwindow.onload = function () {
  318.                                                 window.chatwindow.importScriptPage('User:' + wgUserName + '/global.js', 'c');
  319.                                                 window.chatwindow.importScriptPage('User:' + wgUserName + '/wikia.js');
  320.                                                 if (api.functions.getPageContents("MediaWiki:Chat.js").indexOf("Stable/ChatPlugins/code.js")==-1) {
  321.                                                         window.chatwindow.chatPluginsCustom = {
  322.                                                                 loadedFrom: "w:c:Special:MyPage/global.js"
  323.                                                         }
  324.                                                         window.chatwindow.importScriptPage('Testing/ChatPlugins/code.js', 'gamedezyner');
  325.                                                 }
  326.                                 }
  327.                                 window.closeme = true;
  328.                                         }
  329.                                 };
  330.                                 $(document).on("keydown", disableF5);
  331.                         }
  332.                        
  333.                         $('head').append('<style type="text/css">#WikiChatList {overflow:auto;padding-bottom:10px;height:30%;resize:vertical;} #Rail {overflow:hidden;} #Rail h1.private {display:block !important;} #Rail .WikiChatList li {display:block !important}.User {resize: none;}.User.chat-mod .username:after { background-image: url(' + chatPlugins.custom.modIcon + ');background-position: 0px;background-size: 16px;}.User.staff .username:after { background-image: url(' + chatPlugins.custom.staffIcon + ');background-position: 0px;background-size:16px;}</style>')
  334.                         $("#chatPluginsButton").click(chatPlugins.menu.open);
  335.                         chatPlugins.loading = false;
  336.                         chatPlugins.loaded = true;
  337.                         $("body").append('<span id="chatPluginsInfo" style="position:absolute;right:10px;bottom:0px;font-size:6pt;">ChatPlugins Version ' + chatPlugins.release.version + ' ' + chatPlugins.release.branch + ' Loaded successfully from ' + chatPluginsCustom.loadedFrom + ' - <a id="chatPluginsInfoLink" href="http://gamedezyner.wikia.com/wiki/Help:ChatPlugins" target="_help">Help</a></span>');
  338.                         var bgcolor = $("body").css("background-color");
  339.                         bgcolor = bgcolor.substring(4, bgcolor.length-1).replace(/ /g, '').split(',');
  340.                         var bgbrightness = Math.round(((parseInt(bgcolor[0]) * 299) + (parseInt(bgcolor[1]) * 587) + (parseInt(bgcolor[2]) * 114)) /1000);
  341.                         if (bgbrightness < 125) {
  342.                                 $("#chatPluginsInfo").css("color","white");
  343.                                 $("#chatPluginsInfoLink").css("color","lightblue");
  344.                         }
  345.                         else {
  346.                                 $("#chatPluginsInfo").css("color","black");
  347.                                 $("#chatPluginsInfoLink").css("color","#006cb0");
  348.                         }
  349.                         console.log({Info:"ChatPlugins",Data:"Successfully Loaded!"});
  350.                 }
  351.          
  352.         },
  353.         alert: function(text) {
  354.                 newInlineAlert = new models.InlineAlert;
  355.                 newInlineAlert.attributes.text = text;
  356.                 mainRoom.model.chats.add(newInlineAlert);
  357.         },
  358.         settings:  {
  359.                 open: function(title,content,width,save) {
  360.                          $.showCustomModal( title, '<form method="" name="" class="WikiaForm "><fieldset><div id="settingsHeader"></div>' + content + '</fieldset></form>', {
  361.                                 id: "settingsWindow",
  362.                                         width: width,
  363.                                         buttons: [
  364.                                                 {
  365.                                                         id: "cancel",
  366.                                                         message: "Cancel",
  367.                                                         handler: chatPlugins.settings.cancel
  368.                                                 },
  369.                                                 {
  370.                                                         id: "save",
  371.                                                         defaultButton: true,
  372.                                                         message: "Save",
  373.                                                         handler: save
  374.                                                 }
  375.                                         ]
  376.                         });
  377.                         $(".close").click(chatPlugins.settings.cancel);
  378.                         $(".blackout:not(.chatPlugins)").addClass("chatSettings")
  379.                 },
  380.                 cancel: function() {
  381.                         $('#settingsWindow').remove();
  382.                         $(".blackout.chatSettings").remove()
  383.                 }
  384.         }
  385.        
  386. };
  387. // Append Chat Options Button to header
  388.  
  389.  
  390. // Register our Modules
  391. // Pings
  392. chatPlugins.modules.pings = new chatPlugins.module("Pings", chatPlugins.release.branch + "/ChatPlugins/Modules/pings.js", "gamedezyner");
  393. // Multi PM
  394. chatPlugins.modules.multiPM = new chatPlugins.module("Multi PM", chatPlugins.release.branch + "/ChatPlugins/Modules/multiPM.js", "gamedezyner");
  395. // Multi Kick
  396. chatPlugins.modules.multiKick = new chatPlugins.module("Multi Kick", chatPlugins.release.branch + "/ChatPlugins/Modules/multiKick.js", "gamedezyner");
  397. chatPlugins.modules.multiKick.modOnly = true;
  398. // Chat Style
  399. chatPlugins.modules.style = new chatPlugins.module("Style", chatPlugins.release.branch + "/ChatPlugins/Modules/style.js", "gamedezyner");
  400. // Tab Complete
  401. chatPlugins.modules.tabComplete = new chatPlugins.module("Tab Complete", chatPlugins.release.branch + "/ChatPlugins/Modules/tabComplete.js", "gamedezyner");
  402. // AFK Button
  403. chatPlugins.modules.afkButton = new chatPlugins.module("AFK Button", chatPlugins.release.branch + "/ChatPlugins/Modules/afkButton.js", "gamedezyner");
  404.  
  405. // Load API plugin
  406. if (typeof(api)=="undefined") {
  407.         importScriptPage('Stable/API/code.js', 'gamedezyner');
  408. }
  409. if (window.opener!=null) {
  410.         if(typeof(window.opener.closeme)!="undefined") {
  411.                 window.opener.close();
  412.         }
  413. }
  414. // Initialize the script
  415. chatPlugins.load();
  416.  
  417. }
  418. else {
  419.         chathacksAlert = new models.InlineAlert;
  420.         chathacksAlert.attributes.text = 'You are loading Monchoman45\'s ChatHacks script. ChatPlugins is not compatible with ChatHacks, and has been disabled.';
  421.        mainRoom.model.chats.add(chathacksAlert);
  422.        chathacksAlert = new models.InlineAlert;
  423.        chathacksAlert.attributes.text = 'Please disable ChatPlugins or ChatHacks. If you need assistance, please contact <a href="http://gamedezyner.wikia.com/wiki/Message_Wall:Gamedezyner">Gamedezyner</a>';
  424.        mainRoom.model.chats.add(chathacksAlert);
  425. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement