User:Ultimate Dark Carnage/Sandbox3.js

/*********************************************************/ /********************** Mass Ban   **********************/ /********* Idea by: Madnessfan34537 & Phillycj ***********/ /* Created by: Madnessfan34537, Joeytje50, & Callofduty4 */ /*********** Modified by: Ultimate Dark Carnage **********/ /*********************************************************/

function showPopup{ $.showCustomModal('Multi-Ban', ' Check the boxes of the names that you want to ban:  '           {            id: "multiBanModal",            width: 535,            buttons: [                {                   id: "cancel",                   message: "Cancel",                   handler: function{                        cancelBan;                   }                },                {                   id: "ban",                   defaultButton: true,                   message: "Ban Users",                   handler: function{                        startMultiBan;                        setInterval(cancelBan, 1000);                   }                 }            ]   }); multiBanTable = ""; for (var i = 0; i < Object.keys(mainRoom.model.users._byCid).length; i++){ if (i % 2) { multiBanTable += ""; multiBanTable += " "; }     else { multiBanTable += ""; multiBanTable += ""; }  }   if ((Object.keys(mainRoom.model.users._byCid).length % 2) != 1){ multiBanTable += ""; }  $('#multiBanTable').append(multiBanTable); }

function cancelBan{ $('#multiBanModal').closeModal; }

function startMultiBan{ if ($('.multiBanUser:checked').length == 0){ $('#multiBanInfo').css('color', 'red'); return; }  else { users = []; for (var i = 0; i < $('.multiBanUser:checked').length; i++){ users.push($('.multiBanUser:checked')[i].value;     }      for (var i = 0; i < $('.multiBanUser:checked').length; i++){           var command = new models.BanCommand({ userToBan: users[i], time: parseInt(times[i]), reason: reasons[i] });          mainRoom.socket.socket.send(cmd.xport);      }   } }