Advertisement
Guest User

CustEM

a guest
Jun 27th, 2015
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.63 KB | None | 0 0
  1. // ==UserScript==
  2. // @name CustEM
  3. // @version 0.1
  4. // @description Personalize EpicMafia
  5. // @match https://epicmafia.com/lobby
  6. // @grant none
  7. // ==/UserScript==
  8.  
  9. //Created by Floor
  10.  
  11. $('#nav').append("<li id='btn'></li>");
  12. $('#btn').append("<a href=''>CustEM</a>");
  13. $('#lobby_i').append("<div id='extension'></div>");
  14. $('#extension').append('<div id="listBox">Hide:</div>');
  15.  
  16. $('#listBox').append('<br><input type="checkbox" id="options0">Lobby Info Box<br>');
  17. $('#listBox').append('<input type="checkbox" id="options1">Recent Topics<br>');
  18. $('#listBox').append('<input type="checkbox" id="options2">Lobby Chat<br>');
  19. $('#listBox').append('<input type="checkbox" id="options3">Lobby Poll<br>');
  20. $('#listBox').append('<input type="checkbox" id="options4">Stickied Topics<br>');
  21. $('#listBox').append('<input type="checkbox" id="options5">Stickied Setups<br>');
  22. $('#listBox').append('<input type="checkbox" id="options6">Recent Activity<br>');
  23. $('#listBox').append('<input type="checkbox" id="options7">Friends in Game<br>');
  24. $('#listBox').append('<input type="checkbox" id="options8">Announcements<br>');
  25. $('#listBox').append('<input type="checkbox" id="options9">Favorite Setups<br>');
  26. $('#listBox').append('<input type="checkbox" id="options10">Lobby Wall Comments<br><br>');
  27.  
  28. //$('#extension').append('Theme:<form><input type="radio" id="t1" name="theme">tumblr<br><input type="radio" id="t2" name="theme">4chan<br><input type="radio" name="theme">None<br></form><br>Chat Size:');
  29. $('#extension').append('<form><input type="radio" id="c1" name="chat">Default<br><input type="radio" id="c2" name="chat">Large</form><br>');
  30.  
  31. $('#extension').append('<input type="button" value="Exit" id="exit" />');
  32.  
  33. $('#extension').hide();
  34.  
  35. var settings = [15];
  36.  
  37. //LOAD
  38. //ZERO
  39. if (localStorage.getItem("opZero") === "0"){
  40. $('#lobbyinfo_box').show();
  41. }else if (localStorage.getItem("opZero") === "1"){
  42. $('#lobbyinfo_box').hide();
  43. $('#options0').prop('checked', true);
  44. }
  45. //1
  46. if (localStorage.getItem("op1") === "0"){
  47. $('#lobby_recent_topics').show();
  48. }else if (localStorage.getItem("op1") === "1"){
  49. $('#lobby_recent_topics').hide();
  50. $('#options1').prop('checked', true);
  51. }
  52. //2
  53. if (localStorage.getItem("op2") === "0"){
  54. $('#lobbychat').show();
  55. }else if (localStorage.getItem("op2") === "1"){
  56. $('#lobbychat').hide();
  57. $('#options2').prop('checked', true);
  58. }
  59. //3
  60. if (localStorage.getItem("op3") === "0"){
  61. $('#lobby-poll').show();
  62. }else if (localStorage.getItem("op3") === "1"){
  63. $('#lobby-poll').hide();
  64. $('#options3').prop('checked', true);
  65. }
  66. //4
  67. if (localStorage.getItem("op4") === "0"){
  68. $('#lobby_sticky_topics').show();
  69. }else if (localStorage.getItem("op4") === "1"){
  70. $('#lobby_sticky_topics').hide();
  71. $('#options4').prop('checked', true);
  72. }
  73. if (localStorage.getItem("op5") === "0"){
  74. $('#lobby_sticky_setups').show();
  75. }else if (localStorage.getItem("op5") === "1"){
  76. $('#lobby_sticky_setups').hide();
  77. $('#options5').prop('checked', true);
  78. }
  79. if (localStorage.getItem("op6") === "0"){
  80. $('#gameevents').show();
  81. }else if (localStorage.getItem("op6") === "1"){
  82. $('#gameevents').hide();
  83. $('#options6').prop('checked', true);
  84. }
  85. if (localStorage.getItem("op7") === "0"){
  86. $('#friends_in_games').show();
  87. }else if (localStorage.getItem("op7") === "1"){
  88. $('#friends_in_games').hide();
  89. $('#options7').prop('checked', true);
  90. }
  91. if (localStorage.getItem("op8") === "0"){
  92. $('#announcements').show();
  93. }else if (localStorage.getItem("op8") === "1"){
  94. $('#announcements').hide();
  95. $('#options8').prop('checked', true);
  96. }
  97. if (localStorage.getItem("op9") === "0"){
  98. $('#favoritesetups').show();
  99. }else if (localStorage.getItem("op9") === "1"){
  100. $('#favoritesetups').hide();
  101. $('#options9').prop('checked', true);
  102. }
  103. //10
  104. if (localStorage.getItem("op10") === "0"){
  105. $('.comment_container').show();
  106. }else if (localStorage.getItem("op10") === "1"){
  107. $('.comment_container').hide();
  108. $('#options10').prop('checked', true);
  109. }
  110.  
  111.  
  112. //CHAT
  113.  
  114. if (localStorage.getItem("op12") === "0"){
  115. $('#c1').prop('checked', true);
  116. $("#window").css("height", '245');
  117. $("#window_i").css("height", '205');
  118. $("#userlist").css("height", '200');
  119. }else if (localStorage.getItem("op12") === "1"){
  120. $('#c2').prop('checked', true);
  121. $("#window").css("height", '500');
  122. $("#window_i").css("height", '465');
  123. $("#userlist").css("height", '465');
  124. }
  125.  
  126. //DISPLAY OPTIONS
  127. $('#btn').click(function(){
  128.  
  129. $('#lobby_name').text('Options:');
  130. $('#gamepage').hide();
  131. $('#extension').show();
  132.  
  133. $('#options0').click(function(){
  134. if( $('#options0').prop('checked') === true ){
  135. $('#lobbyinfo_box').hide();
  136. settings[0] = "1";
  137. localStorage.setItem("opZero",settings[0]);
  138. }else if ( $('#options0').prop('checked') === false ){
  139. $('#lobbyinfo_box').show();
  140. settings[0] = "0";
  141. localStorage.setItem("opZero",settings[0]);
  142. }
  143. }
  144. );
  145. $('#options1').click(function(){
  146. if( $('#options1').prop('checked') === true ){
  147. $('#lobby_recent_topics').hide();
  148. settings[1] = "1";
  149. localStorage.setItem("op1",settings[1]);
  150. }else if ( $('#options1').prop('checked') === false ){
  151. $('#lobby_recent_topics').show();
  152. settings[1] = "0";
  153. localStorage.setItem("op1",settings[1]);
  154. }
  155. }
  156. );
  157. $('#options2').click(function(){
  158. if( $('#options2').prop('checked') === true ){
  159. $('#lobbychat').hide();
  160. settings[2] = "1";
  161. localStorage.setItem("op2",settings[2]);
  162. }else if ( $('#options2').prop('checked') === false ){
  163. $('#lobbychat').show();
  164. settings[2] = "0";
  165. localStorage.setItem("op2",settings[2]);
  166. }
  167. }
  168. );
  169. $('#options3').click(function(){
  170. if( $('#options3').prop('checked') === true ){
  171. $('#lobby-poll').hide();
  172. settings[3] = "1";
  173. localStorage.setItem("op3",settings[3]);
  174. }else if ( $('#options3').prop('checked') === false ){
  175. $('#lobby-poll').show();
  176. settings[3] = "0";
  177. localStorage.setItem("op3",settings[3]);
  178. }
  179. }
  180. );
  181. $('#options4').click(function(){
  182. if( $('#options4').prop('checked') === true ){
  183. $('#lobby_sticky_topics').hide();
  184. settings[4] = "1";
  185. localStorage.setItem("op4",settings[4]);
  186. }else if ( $('#options4').prop('checked') === false ){
  187. $('#lobby_sticky_topics').show();
  188. settings[4] = "0";
  189. localStorage.setItem("op4",settings[4]);
  190. }
  191. }
  192. );
  193. $('#options5').click(function(){
  194. if( $('#options5').prop('checked') === true ){
  195. $('#lobby_sticky_setups').hide();
  196. settings[5] = "1";
  197. localStorage.setItem("op5",settings[5]);
  198. }else if ( $('#options5').prop('checked') === false ){
  199. $('#lobby_sticky_setups').show();
  200. settings[5] = "0";
  201. localStorage.setItem("op5",settings[4]);
  202. }
  203. }
  204. );
  205. $('#options6').click(function(){
  206. if( $('#options6').prop('checked') === true ){
  207. $('#gameevents').hide();
  208. settings[6] = "1";
  209. localStorage.setItem("op6",settings[6]);
  210. }else if ( $('#options6').prop('checked') === false ){
  211. $('#gameevents').show();
  212. settings[6] = "0";
  213. localStorage.setItem("op6",settings[6]);
  214. }
  215. }
  216. );
  217. $('#options7').click(function(){
  218. if( $('#options7').prop('checked') === true ){
  219. $('#friends_in_games').hide();
  220. settings[7] = "1";
  221. localStorage.setItem("op7",settings[7]);
  222. }else if ( $('#options7').prop('checked') === false ){
  223. $('#friends_in_games').show();
  224. settings[7] = "0";
  225. localStorage.setItem("op7",settings[7]);
  226. }
  227. }
  228. );
  229. $('#options8').click(function(){
  230. if( $('#options8').prop('checked') === true ){
  231. $('#announcements').hide();
  232. settings[8] = "1";
  233. localStorage.setItem("op8",settings[8]);
  234. }else if ( $('#options8').prop('checked') === false ){
  235. $('#announcements').show();
  236. settings[8] = "0";
  237. localStorage.setItem("op8",settings[8]);
  238. }
  239. }
  240. );
  241. $('#options9').click(function(){
  242. if( $('#options9').prop('checked') === true ){
  243. $('#favoritesetups').hide();
  244. settings[9] = "1";
  245. localStorage.setItem("op9",settings[9]);
  246. }else if ( $('#options9').prop('checked') === false ){
  247. $('#favoritesetups').show();
  248. settings[9] = "0";
  249. localStorage.setItem("op9",settings[9]);
  250. }
  251. }
  252. );
  253. $('#options10').click(function(){
  254. if( $('#options10').prop('checked') === true ){
  255. $('.comment_container').hide();
  256. settings[10] = "1";
  257. localStorage.setItem("op10",settings[10]);
  258. }else if ( $('#options10').prop('checked') === false ){
  259. $('.comment_container').show();
  260. settings[10] = "0";
  261. localStorage.setItem("op10",settings[10]);
  262. }
  263. }
  264. );
  265.  
  266. //CHAT SIZE
  267.  
  268. $('#c1, #c2').click(function(){
  269. if ($('#c2').prop('checked') === true ){
  270. $("#window").css("height", '500');
  271. $("#window_i").css("height", '465');
  272. $("#userlist").css("height", '465');
  273. settings[12] = "1";
  274. localStorage.setItem("op12",settings[12]);
  275. }else{
  276. $("#window").css("height", '245');
  277. $("#window_i").css("height", '205');
  278. $("#userlist").css("height", '200');
  279. settings[12] = "0";
  280. localStorage.setItem("op12",settings[12]);
  281. }
  282. }
  283. );
  284.  
  285. $('#exit').click(function(){
  286. $('#lobby_name').text('Sandbox Lobby');
  287. $('#gamepage').show();
  288. $('#extension').hide();
  289. }
  290. );
  291.  
  292. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement