FFL Chat Modifier

This userscript allows you to run the FFL LIVE chat within a tab in your browser and allows for some new BBCode!

当前为 2015-09-24 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name FFL Chat Modifier
  3. // @namespace http://fusionfalllegacy.com/
  4. // @version 1.0
  5. // @description This userscript allows you to run the FFL LIVE chat within a tab in your browser and allows for some new BBCode!
  6. // @author L0L_Limewire
  7. // @match http://interact.modulatornetwork.com/forums/chat/index.php
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // ADDED FEATURES LIST
  12. // [textcolor=#COLOR IN HEX]message[/textcolor]
  13. // [code]message[/code]
  14. // [img]image url[/img]
  15. // enabled opening the LIVE chat in a tab
  16.  
  17. // allow for tab chat to be open
  18.  
  19. window.name = 'ModNetFMHQliveMainWindow';
  20. top = self;
  21.  
  22. // very hacky but it works
  23.  
  24. // now for the real features
  25.  
  26. sound = new Audio("http://s1.vocaroo.com/media/download_temp/Vocaroo_s1i83BLxw0A0.mp3"); // you're welcome Professor
  27.  
  28. NaughtyWords = [ // avert your eyes, children!
  29. 'bastard',
  30. 'basstard',
  31. 'basterd',
  32. 'bassterd',
  33. 'bas tard',
  34. 'bass tard',
  35. 'bas terd',
  36. 'bass terd',
  37. 'asshole',
  38. 'asshoie',
  39. 'assho1e',
  40. 'assho!e',
  41. 'ass',
  42. 'azzhole',
  43. 'azzhoie',
  44. 'azzho1e',
  45. 'azzho!e',
  46. 'beer',
  47. 'boob',
  48. 'badb',
  49. 'bitch',
  50. 'cunt',
  51. 'dammit',
  52. 'damm!t',
  53. 'damm1t',
  54. 'dammlt',
  55. 'damn',
  56. 'dick',
  57. 'd!ck',
  58. 'd1ck',
  59. 'dlck',
  60. 'fuc',
  61. 'fuk',
  62. 'fuck',
  63. 'fux',
  64. 'nipple',
  65. 'nude',
  66. 'nudity',
  67. 'p!ss',
  68. 'p1ss',
  69. 'penis',
  70. 'pen!s',
  71. 'pen1s',
  72. 'piss',
  73. 'puss',
  74. 'sex',
  75. 'shit',
  76. 'sh!t',
  77. 'sh1t',
  78. 'shlt',
  79. 'tits',
  80. 'vagisil',
  81. 'vagina',
  82. 'arse',
  83. 'hel',
  84. 'hell',
  85. 'bullass',
  86. 'fvck',
  87. 'twat',
  88. 'jerkwad',
  89. 'jack coco',
  90. 'jackazz',
  91. 'jack azz',
  92. 'porn',
  93. 'customass',
  94. 'sasser',
  95. 'sasst',
  96. 'helpuffs',
  97. 'cock',
  98. 'faggot',
  99. 'fagot',
  100. 'fagot',
  101. 'fagot',
  102. 'fag',
  103. 'nigger',
  104. 'n!gger',
  105. 'panty',
  106. 'porm',
  107. 'pr0n',
  108. 'anal',
  109. 'ccoco',
  110. 'semen',
  111. 'whore',
  112. 'biggot',
  113. 'chink',
  114. 'clit',
  115. 'vag',
  116. 'slut',
  117. 'skank',
  118. 'hooker',
  119. 'prostitute',
  120. 'nigga',
  121. 'thot',
  122. 'hentai'
  123. ];
  124.  
  125. ajaxChat.bbCodeTags = ['b','i','u','strike','quote','color','url','img','textcolor']; //add new bbcode and revive old bbcode
  126. ajaxChat.settings.bbCodeImages = true; // enable images
  127.  
  128. ajaxChat.replaceBBCodeCallback = function(str, p1, p2, p3) { // replace functions to allow for new features
  129. // Only replace predefined BBCode tags:
  130. if(!ajaxChat.inArray(ajaxChat.bbCodeTags, p1)) {
  131. return str;
  132. }
  133. // Avoid invalid XHTML (unclosed tags):
  134. if(ajaxChat.containsUnclosedTags(p3)) {
  135. return str;
  136. }
  137. switch(p1) {
  138. case 'color':
  139. return ajaxChat.replaceBBCodeColor(p3, p2);
  140. case 'textcolor': // [color] tag but allows for use within nested colors such as
  141. return ajaxChat.replaceBBCodeColor(p3,p2);
  142. case 'url':
  143. return ajaxChat.replaceBBCodeUrl(p3, p2);
  144. case 'quote':
  145. return ajaxChat.replaceBBCodeQuote(p3, p2);
  146. case 'u':
  147. return ajaxChat.replaceBBCodeUnderline(p3);
  148. case 'strike':
  149. return ajaxChat.replaceBBCodeStrike(p3);
  150. case 'img': // [img] tag
  151. return ajaxChat.replaceBBCodeImage(p3);
  152. default:
  153. return ajaxChat.replaceCustomBBCode(p1, p2, p3);
  154. }
  155. };
  156.  
  157. ajaxChat.replaceBBCodeImage = function(url) { // function enabled
  158. var regExpUrl;
  159. regExpUrl = new RegExp(this.regExpMediaUrl,'');
  160. if(!url || !url.match(regExpUrl))
  161. return url;
  162. url = url.replace(/\s/gm, this.encodeText(' '));
  163. return '<a href="'+url+'" onclick="window.open(this.href); return false;">'+'<img class="bbCodeImage" style="max-width:250px;" src="'+url+'" alt="Click to view full-size image." onload="ajaxChat.updateChatlistView();"/></a>';
  164. };
  165.  
  166. ajaxChat.replaceBBCodeColor = function(content, attribute) { // color limitations removed
  167. if(this.settings.bbCodeColors) {
  168. return '<span style="color:'+ attribute + ';">'+ this.replaceBBCode(content)+ '</span>';
  169. }
  170. return content;
  171. };
  172.  
  173. ajaxChat.replaceCustomText = function(text){
  174. var doAlert,index;
  175. doAlert = false; // do sound upon naughty word
  176. for(index in NaughtyWords){
  177. naughty = NaughtyWords[index];
  178. if(text.search(new RegExp('\\b'+naughty+'\\b','gi'))!=-1){
  179. doAlert = true; // enable sound playback
  180. }
  181. text = text.replace(new RegExp('\\b'+naughty+'\\b','gi'), 'coco'); // and then censor the word
  182. }
  183. if(doAlert === true){
  184. sound.play();
  185. }
  186. return text;
  187. };