1337x - Default values for uploads

let's you set up defaults in the "Upload" section of 1337x (custom default descriptions for every category)

当前为 2017-05-19 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name 1337x - Default values for uploads
  3. // @namespace NotNeo
  4. // @description let's you set up defaults in the "Upload" section of 1337x (custom default descriptions for every category)
  5. // @include http*://1337x.to/upload
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  7. // @version 1
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. //"Default" of course means that you can change everything in the "upload torrent" section normally, the values just start out with these settings.
  12.  
  13. //--------------------------------
  14. //------------Settings------------
  15. var dName = ""; //put your default name between the quotes. For no default/empty, leave no spaces between the quotes ("") (doublequotes(") inside the name need to be escaped. Check Description tips below)
  16. var dLanguage = "English"; //put the EXACT name of your language (from the dropdown menu) in the quotes
  17. var dCategory = "Choose One"; //put the EXACT name of your main Category (from the dropdown menu) in the quotes ("Choose One" for now default)
  18. var dSubCategory = ""; //put the EXACT name of your sub category (from the dropdown menu) in the quotes (Set the right main category if you are using a sub category)
  19. var dDesc = ""; //put your default description between the quotes. For no default/empty, leave no spaces between the quotes (""). (doublequotes(") inside the description need to be escaped. Check tips below)
  20. var dTags = ""; //put your default tags between the quotes. For no default/empty, leave no spaces between the quotes ("") (doublequotes(") inside the tags need to be escaped. Check Description tips below)
  21. var showOnlyUpload = true; // Choose whether to hide the the boxes above the "Upload your files" box.
  22.  
  23. /*Tips for more complicated descriptions:
  24. - To put text on a new line use the newline character(\n).
  25. This is the firstline.\nThis is the second line.
  26. - To use duoblequotes(") in your desription, you must "escape them", meaning you need to use the escape character(\) in front of them. (the escape characters won't actually show up in the description)
  27. \"this\" will work
  28. "this" will not
  29.  
  30. Example:
  31. var dDesc = "[center][img]https://i.imgur.com/example.jpg[/img]\nSo this is a test\n\nThis should work.\n\"Quotes\" work like this.[/center]\n:smile";
  32.  
  33.  
  34. You can create default descriptions for as many categories as you wish.
  35. Changing the category will insert the default description for that category in to the description box, so make sure you choose the category BEFORE you start editing the description! */
  36. //Remind me? true/false
  37. var reminder = true; /* (red text next to category)
  38. These take priority over the global default description.
  39. Simply type the description between the quotes on the line corresponding to your category id. */
  40.  
  41. //-------------------------------
  42. //-------------------------------
  43.  
  44. ///////////////////////////////////////////////////
  45. //////////Edit main category defaults below///////
  46. /////////////////////////////////////////////////
  47. /*
  48. Descriptions for Main Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val.
  49. and then uncomment the line(remove the two forwardslashes at the start of the line) (See example below)
  50.  
  51. Example lines:
  52.  
  53. //$("[name='description']").val(""); // Put your description for "X" here
  54. above line becomes ->
  55. $("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here
  56.  
  57. Remember the the rules for creating descriptions. (See settings section above)
  58. */
  59. function catChange() {
  60. setTimeout(function() {
  61. if($("#category").parent().find(".trigger").text() == "Movie") {
  62. //$("[name='description']").val(""); // Put your description for "Movie" here
  63. } else if($("#category").parent().find(".trigger").text() == "Game") {
  64. //$("[name='description']").val(""); // Put your description for "Game" here
  65. } else if($("#category").parent().find(".trigger").text() == "Music") {
  66. //$("[name='description']").val(""); // Put your description for "Music" here
  67. } else if($("#category").parent().find(".trigger").text() == "TV") {
  68. //$("[name='description']").val(""); // Put your description for "TV" here
  69. } else if($("#category").parent().find(".trigger").text() == "Apps") {
  70. //$("[name='description']").val(""); // Put your description for "Apps" here
  71. } else if($("#category").parent().find(".trigger").text() == "Documentaries") {
  72. //$("[name='description']").val(""); // Put your description for "Documentaries" here
  73. } else if($("#category").parent().find(".trigger").text() == "Anime") {
  74. //$("[name='description']").val(""); // Put your description for "Anime" here
  75. } else if($("#category").parent().find(".trigger").text() == "XXX") {
  76. //$("[name='description']").val(""); // Put your description for "XXX" here
  77. } else if($("#category").parent().find(".trigger").text() == "Other") {
  78. //$("[name='description']").val(""); // Put your description for "Other" here
  79. }
  80. subCatChange();
  81. }, 700);
  82. }
  83. ///////////////////////////////////////////////////
  84. //////////Edit main category defaults above///////
  85. /////////////////////////////////////////////////
  86.  
  87.  
  88.  
  89.  
  90. ///////////////////////////////////////////////
  91. ///////Edit sub category defaults below///////
  92. /////////////////////////////////////////////
  93. /*
  94. These will of course replace the description added by the main category.
  95. Descriptions for Sub Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val.
  96. and then uncomment the line(remove the two forwardslashes at the start of the line) (See example below)
  97.  
  98. Example lines:
  99.  
  100. //$("[name='description']").val(""); // Put your description for "X" here
  101. above line becomes ->
  102. $("[name='description']").val("[center][b]This is my example description for X subcategory[/b][/center]"); // Put your description for "X" here
  103.  
  104. Remember the the rules for creating descriptions. (See settings section above)
  105. */
  106. function subCatChange() {
  107. setTimeout(function() {
  108. if($("#category").parent().find(".trigger").text() == "Movie") { //------Subcategories of Movie below------
  109. if($("#type").parent().find(".trigger").text() == "DVD") {
  110. //$("[name='description']").val(""); // Put your description for "DVD" here
  111. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  112. //$("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  113. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  114. //$("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  115. } else if($("#type").parent().find(".trigger").text() == "Dubs/Dual Audio") {
  116. //$("[name='description']").val(""); // Put your description for "Dubs/Dual Audio" here
  117. } else if($("#type").parent().find(".trigger").text() == "HD") {
  118. //$("[name='description']").val(""); // Put your description for "HD" here
  119. } else if($("#type").parent().find(".trigger").text() == "h.264/x264") {
  120. //$("[name='description']").val(""); // Put your description for "h.264/x264" here
  121. } else if($("#type").parent().find(".trigger").text() == "Mp4") {
  122. //$("[name='description']").val(""); // Put your description for "Mp4" here
  123. } else if($("#type").parent().find(".trigger").text() == "3D") {
  124. //$("[name='description']").val(""); // Put your description for "3D" here
  125. }
  126. } else if($("#category").parent().find(".trigger").text() == "Game") { //------Subcategories of Game below------
  127. if($("#type").parent().find(".trigger").text() == "PC Game") {
  128. //$("[name='description']").val(""); // Put your description for "PC Game" here
  129. } else if($("#type").parent().find(".trigger").text() == "PS2") {
  130. //$("[name='description']").val(""); // Put your description for "PS2" here
  131. } else if($("#type").parent().find(".trigger").text() == "PSP") {
  132. //$("[name='description']").val(""); // Put your description for "PSP" here
  133. } else if($("#type").parent().find(".trigger").text() == "Xbox") {
  134. //$("[name='description']").val(""); // Put your description for "Xbox" here
  135. } else if($("#type").parent().find(".trigger").text() == "Xbox360") {
  136. //$("[name='description']").val(""); // Put your description for "Xbox360" here
  137. } else if($("#type").parent().find(".trigger").text() == "PS1") {
  138. //$("[name='description']").val(""); // Put your description for "PS1" here
  139. } else if($("#type").parent().find(".trigger").text() == "Dreamcast") {
  140. //$("[name='description']").val(""); // Put your description for "Dreamcast" here
  141. } else if($("#type").parent().find(".trigger").text() == "Other") {
  142. //$("[name='description']").val(""); // Put your description for "Other" here
  143. } else if($("#type").parent().find(".trigger").text() == "PS3") {
  144. //$("[name='description']").val(""); // Put your description for "PS3" here
  145. } else if($("#type").parent().find(".trigger").text() == "Wii") {
  146. //$("[name='description']").val(""); // Put your description for "Wii" here
  147. } else if($("#type").parent().find(".trigger").text() == "DS") {
  148. //$("[name='description']").val(""); // Put your description for "DS" here
  149. } else if($("#type").parent().find(".trigger").text() == "GameCube") {
  150. //$("[name='description']").val(""); // Put your description for "GameCube" here
  151. }
  152. } else if($("#category").parent().find(".trigger").text() == "Music") { //------Subcategories of Music below------
  153. if($("#type").parent().find(".trigger").text() == "MP3") {
  154. //$("[name='description']").val(""); // Put your description for "MP3" here
  155. } else if($("#type").parent().find(".trigger").text() == "Lossless") {
  156. //$("[name='description']").val(""); // Put your description for "Lossless" here
  157. } else if($("#type").parent().find(".trigger").text() == "DVD") {
  158. //$("[name='description']").val(""); // Put your description for "DVD" here
  159. } else if($("#type").parent().find(".trigger").text() == "Video") {
  160. //$("[name='description']").val(""); // Put your description for "Video" here
  161. } else if($("#type").parent().find(".trigger").text() == "Radio") {
  162. //$("[name='description']").val(""); // Put your description for "Radio" here
  163. } else if($("#type").parent().find(".trigger").text() == "Other") {
  164. //$("[name='description']").val(""); // Put your description for "Other" here
  165. } else if($("#type").parent().find(".trigger").text() == "Album") {
  166. //$("[name='description']").val(""); // Put your description for "Album" here
  167. } else if($("#type").parent().find(".trigger").text() == "Box Set") {
  168. //$("[name='description']").val(""); // Put your description for "Box Set" here
  169. } else if($("#type").parent().find(".trigger").text() == "Discography") {
  170. //$("[name='description']").val(""); // Put your description for "Discography" here
  171. } else if($("#type").parent().find(".trigger").text() == "Single") {
  172. //$("[name='description']").val(""); // Put your description for "Singles" here
  173. } else if($("#type").parent().find(".trigger").text() == "Concerts") {
  174. //$("[name='description']").val(""); // Put your description for "Concerts" here
  175. } else if($("#type").parent().find(".trigger").text() == "AAC") {
  176. //$("[name='description']").val(""); // Put your description for "AAC" here
  177. }
  178. } else if($("#category").parent().find(".trigger").text() == "TV") { //------Subcategories of TV below------
  179. if($("#type").parent().find(".trigger").text() == "DVD") {
  180. //$("[name='description']").val(""); // Put your description for "DVD" here
  181. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  182. //$("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  183. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  184. //$("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  185. } else if($("#type").parent().find(".trigger").text() == "HD") {
  186. //$("[name='description']").val(""); // Put your description for "HD" here
  187. }
  188. } else if($("#category").parent().find(".trigger").text() == "Apps") { //------Subcategories of Apps below------
  189. if($("#type").parent().find(".trigger").text() == "PC Software") {
  190. //$("[name='description']").val(""); // Put your description for "PC Software" here
  191. } else if($("#type").parent().find(".trigger").text() == "Mac") {
  192. //$("[name='description']").val(""); // Put your description for "Mac" here
  193. } else if($("#type").parent().find(".trigger").text() == "Linux") {
  194. //$("[name='description']").val(""); // Put your description for "Linux" here
  195. } else if($("#type").parent().find(".trigger").text() == "Other") {
  196. //$("[name='description']").val(""); // Put your description for "Other" here
  197. } else if($("#type").parent().find(".trigger").text() == "Android") {
  198. //$("[name='description']").val(""); // Put your description for "Android" here
  199. } else if($("#type").parent().find(".trigger").text() == "iOS") {
  200. //$("[name='description']").val(""); // Put your description for "iOS" here
  201. }
  202. } else if($("#category").parent().find(".trigger").text() == "XXX") { //------Subcategories of XXX below------
  203. if($("#type").parent().find(".trigger").text() == "Video") {
  204. //$("[name='description']").val(""); // Put your description for "Video" here
  205. } else if($("#type").parent().find(".trigger").text() == "Picture") {
  206. //$("[name='description']").val(""); // Put your description for "Picture" here
  207. } else if($("#type").parent().find(".trigger").text() == "Magazine") {
  208. //$("[name='description']").val(""); // Put your description for "Magazine" here
  209. } else if($("#type").parent().find(".trigger").text() == "Hentai") {
  210. //$("[name='description']").val(""); // Put your description for "Hentai" here
  211. } else if($("#type").parent().find(".trigger").text() == "Games") {
  212. //$("[name='description']").val(""); // Put your description for "Games" here
  213. }
  214. } else if($("#category").parent().find(".trigger").text() == "Other") { //------Subcategories of Other below------
  215. if($("#type").parent().find(".trigger").text() == "Emulation") {
  216. //$("[name='description']").val(""); // Put your description for "Emulation" here
  217. } else if($("#type").parent().find(".trigger").text() == "Tutorials") {
  218. //$("[name='description']").val(""); // Put your description for "Tutorials" here
  219. } else if($("#type").parent().find(".trigger").text() == "Sounds") {
  220. //$("[name='description']").val(""); // Put your description for "Sounds" here
  221. } else if($("#type").parent().find(".trigger").text() == "E-Books") {
  222. //$("[name='description']").val(""); // Put your description for "E-Books" here
  223. } else if($("#type").parent().find(".trigger").text() == "Images") {
  224. //$("[name='description']").val(""); // Put your description for "Images" here
  225. } else if($("#type").parent().find(".trigger").text() == "Mobile Phone") {
  226. //$("[name='description']").val(""); // Put your description for "Mobile Phone" here
  227. } else if($("#type").parent().find(".trigger").text() == "Comics") {
  228. //$("[name='description']").val(""); // Put your description for "Comics" here
  229. } else if($("#type").parent().find(".trigger").text() == "Other") {
  230. //$("[name='description']").val(""); // Put your description for "Other" here
  231. } else if($("#type").parent().find(".trigger").text() == "Nulled Script") {
  232. //$("[name='description']").val(""); // Put your description for "Nulled Script" here
  233. } else if($("#type").parent().find(".trigger").text() == "Audiobook") {
  234. //$("[name='description']").val(""); // Put your description for "Audiobook" here
  235. }
  236. }
  237. }, 100);
  238. }
  239. ///////////////////////////////////////////////
  240. ///////Edit sub category defaults above///////
  241. /////////////////////////////////////////////
  242. ////////////////////////////////////////////
  243. ////DO NOT EDIT ANYTHING BELOW THIS LINE///
  244. //////////////////////////////////////////
  245.  
  246. $("#category").parent().find(".options").find("li").click(function() {
  247. catChange();
  248. });
  249.  
  250. $("#category").parent().find(".options").find("li").click(function() {
  251. setTimeout(function() {
  252. changeSubCatList();
  253. }, 100);
  254. });
  255.  
  256. $(document).ready(function() {
  257. if (reminder) {
  258. $("small:contains('Please select which category best fits your torrent.')").append(" <p style='color:red'>Choose before editing the description!</p> ");
  259. }
  260. if (showOnlyUpload) {
  261. $("h1:contains(' Want to upload a torrent? No problem! Please use the announce URLs: ')").parent().parent().hide();
  262. $("h1:contains('New upload categories')").parent().parent().hide();
  263. }
  264. $("[name='title']").val(dName); //set default title
  265. $("[name='tags']").val(dTags); //set default tags
  266. $("[name='description']").val(dDesc); //set default description
  267.  
  268. setTimeout(function(){
  269. //setting default Language ---------------------------------------------------
  270. $("#language").parent().find(".options").find("li").each(function() {
  271. $(this).removeAttr("class");
  272. });
  273. $("#language").parent().find(".trigger").text(dLanguage);
  274. $("#language").parent().find(".options").find("li:contains('" + dLanguage + "')").attr("class", "selected");
  275. //----------------------------------------------------------------------------
  276. //setting default category ---------------------------------------------------
  277. $("#category").parent().find(".trigger").text(dCategory);
  278. $("#category").parent().find(".options").find("li").each(function() {
  279. $(this).attr("class", "");
  280. });
  281. $("#category").parent().find(".options").find("li:contains('" + dCategory + "')").attr("class", "selected");
  282. //setting default sub category -----------------------------------------------
  283. if(dCategory == "Movie") {
  284. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="1">DVD</option><option value="2">Divx/Xvid</option><option value="3">SVCD/VCD</option><option value="4">Dubs/Dual Audio</option><option value="42">HD</option><option value="54">h.264/x264</option><option value="55">Mp4</option><option value="66">3D</option></select><div class="trigger">DVD</div><ul class="options"><li data-raw-value="1" class="selected">DVD</li><li data-raw-value="2">Divx/Xvid</li><li data-raw-value="3">SVCD/VCD</li><li data-raw-value="4">Dubs/Dual Audio</li><li data-raw-value="42">HD</li><li data-raw-value="54">h.264/x264</li><li data-raw-value="55">Mp4</li><li data-raw-value="66">3D</li></ul></div>');
  285. } else if(dCategory == "Game") {
  286. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="10">PC Game</option><option value="11">PS2</option><option value="12">PSP</option><option value="13">Xbox</option><option value="14">Xbox360</option><option value="15">PS1</option><option value="16">Dreamcast</option><option value="17">Other</option><option value="43">PS3</option><option value="44">Wii</option><option value="45">DS</option><option value="46">GameCube</option></select><div class="trigger">PC Game</div><ul class="options"><li data-raw-value="10" class="selected">PC Game</li><li data-raw-value="11">PS2</li><li data-raw-value="12">PSP</li><li data-raw-value="13">Xbox</li><li data-raw-value="14">Xbox360</li><li data-raw-value="15">PS1</li><li data-raw-value="16">Dreamcast</li><li data-raw-value="17">Other</li><li data-raw-value="43">PS3</li><li data-raw-value="44">Wii</li><li data-raw-value="45">DS</li><li data-raw-value="46">GameCube</li></ul></div>');
  287. } else if(dCategory == "Music") {
  288. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="22">MP3</option><option value="23">Lossless</option><option value="24">DVD</option><option value="25">Video</option><option value="26">Radio</option><option value="27">Other</option><option value="53">Album</option><option value="58">Box Set</option><option value="59">Discography</option><option value="60">Single</option><option value="68">Concerts</option><option value="69">AAC</option></select><div class="trigger">MP3</div><ul class="options"><li data-raw-value="22" class="selected">MP3</li><li data-raw-value="23">Lossless</li><li data-raw-value="24">DVD</li><li data-raw-value="25">Video</li><li data-raw-value="26">Radio</li><li data-raw-value="27">Other</li><li data-raw-value="53">Album</li><li data-raw-value="58">Box Set</li><li data-raw-value="59">Discography</li><li data-raw-value="60">Single</li><li data-raw-value="68">Concerts</li><li data-raw-value="69">AAC</li></ul></div>');
  289. } else if(dCategory == "TV") {
  290. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="5">DVD</option><option value="6">Divx/Xvid</option><option value="7">SVCD/VCD</option><option value="41">HD</option></select><div class="trigger">DVD</div><ul class="options"><li data-raw-value="5" class="selected">DVD</li><li data-raw-value="6">Divx/Xvid</li><li data-raw-value="7">SVCD/VCD</li><li data-raw-value="41">HD</li></ul></div>');
  291. } else if(dCategory == "Apps") {
  292. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="18">PC Software</option><option value="19">Mac</option><option value="20">Linux</option><option value="21">Other</option><option value="56">Android</option><option value="57">iOS</option></select><div class="trigger">PC Software</div><ul class="options"><li data-raw-value="18" class="selected">PC Software</li><li data-raw-value="19">Mac</li><li data-raw-value="20">Linux</li><li data-raw-value="21">Other</li><li data-raw-value="56">Android</li><li data-raw-value="57">iOS</li></ul></div>');
  293. } else if(dCategory == "Documentaries") {
  294. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="9">Documentary</option></select><div class="trigger">Documentary</div><ul class="options"><li data-raw-value="9" class="selected">Documentary</li></ul></div>');
  295. } else if(dCategory == "Anime") {
  296. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="28">Anime</option></select><div class="trigger">Anime</div><ul class="options"><li data-raw-value="28" class="selected">Anime</li></ul></div>');
  297. } else if(dCategory == "XXX") {
  298. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="48">Video</option><option value="49">Picture</option><option value="50">Magazine</option><option value="51">Hentai</option><option value="67">Games</option></select><div class="trigger">Video</div><ul class="options"><li data-raw-value="48" class="selected">Video</li><li data-raw-value="49">Picture</li><li data-raw-value="50">Magazine</li><li data-raw-value="51">Hentai</li><li data-raw-value="67">Games</li></ul></div>');
  299. } else if(dCategory == "Other") {
  300. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="33">Emulation</option><option value="34">Tutorials</option><option value="35">Sounds</option><option value="36">E-Books</option><option value="37">Images</option><option value="38">Mobile Phone</option><option value="39">Comics</option><option value="40">Other</option><option value="47">Nulled Script</option><option value="52">Audiobook</option></select><div class="trigger">Emulation</div><ul class="options"><li data-raw-value="33" class="selected">Emulation</li><li data-raw-value="34">Tutorials</li><li data-raw-value="35">Sounds</li><li data-raw-value="36">E-Books</li><li data-raw-value="37">Images</li><li data-raw-value="38">Mobile Phone</li><li data-raw-value="39">Comics</li><li data-raw-value="40">Other</li><li data-raw-value="47">Nulled Script</li><li data-raw-value="52">Audiobook</li></ul></div>');
  301. }
  302. $("#type").parent().find(".trigger").text(dSubCategory);
  303. $("#type").parent().find(".options").find("li").each(function() {
  304. $(this).attr("class", "");
  305. });
  306. $("#type").parent().find(".options").find("li:contains('" + dSubCategory + "')").attr("class", "selected");
  307. catChange();
  308. //Basically a whole new dropdown menu...
  309. $("#type").parent().find(".trigger").click(function() {
  310. if ( $("#type").parent().find(".options").attr("class").indexOf("open") >= 0 ) { //if it's open, close it ---------
  311. var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
  312. $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
  313. } else { //If it's closed, open it ----------
  314. var openClass = $("#type").parent().find(".options").attr("class") + " open"; //get the classes and add "open" to it
  315. $("#type").parent().find(".options").attr("class", openClass); //replace the classes with the one with "open"
  316. $("#type").parent().find(".options").find("li").mouseenter(function() {
  317. var mEClass = $(this).attr("class") + " hover";
  318. $(this).attr("class", mEClass);
  319. });
  320. $("#type").parent().find(".options").find("li").mouseleave(function() {
  321. var mLClass = $(this).attr("class").replace(" hover", "");
  322. $(this).attr("class", mLClass);
  323. mLClass = "";
  324. });
  325. $("#type").parent().find(".options").find("li").click(function() {
  326. $("#type").parent().find(".options").find("li").each(function() {
  327. $(this).attr("class", "");
  328. });
  329. var mCClass = $(this).attr("class") + " selected";
  330. var select = $(this).text();
  331. $(this).attr("class", mCClass);
  332. $("#type").parent().find(".trigger").text(select);
  333. var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
  334. $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
  335. catChange();
  336. });
  337. }
  338. });
  339. //-----------------------------------------------------------------------------
  340. }, 1000);
  341. });
  342.  
  343. function changeSubCatList() {
  344. var currentCategory = $("#category").parent().find(".trigger").text();
  345. if(currentCategory == "Movie") {
  346. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="1">DVD</option><option value="2">Divx/Xvid</option><option value="3">SVCD/VCD</option><option value="4">Dubs/Dual Audio</option><option value="42">HD</option><option value="54">h.264/x264</option><option value="55">Mp4</option><option value="66">3D</option></select><div class="trigger">DVD</div><ul class="options"><li data-raw-value="1" class="selected">DVD</li><li data-raw-value="2">Divx/Xvid</li><li data-raw-value="3">SVCD/VCD</li><li data-raw-value="4">Dubs/Dual Audio</li><li data-raw-value="42">HD</li><li data-raw-value="54">h.264/x264</li><li data-raw-value="55">Mp4</li><li data-raw-value="66">3D</li></ul></div>');
  347. } else if(currentCategory == "Game") {
  348. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="10">PC Game</option><option value="11">PS2</option><option value="12">PSP</option><option value="13">Xbox</option><option value="14">Xbox360</option><option value="15">PS1</option><option value="16">Dreamcast</option><option value="17">Other</option><option value="43">PS3</option><option value="44">Wii</option><option value="45">DS</option><option value="46">GameCube</option></select><div class="trigger">PC Game</div><ul class="options"><li data-raw-value="10" class="selected">PC Game</li><li data-raw-value="11">PS2</li><li data-raw-value="12">PSP</li><li data-raw-value="13">Xbox</li><li data-raw-value="14">Xbox360</li><li data-raw-value="15">PS1</li><li data-raw-value="16">Dreamcast</li><li data-raw-value="17">Other</li><li data-raw-value="43">PS3</li><li data-raw-value="44">Wii</li><li data-raw-value="45">DS</li><li data-raw-value="46">GameCube</li></ul></div>');
  349. } else if(currentCategory == "Music") {
  350. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="22">MP3</option><option value="23">Lossless</option><option value="24">DVD</option><option value="25">Video</option><option value="26">Radio</option><option value="27">Other</option><option value="53">Album</option><option value="58">Box Set</option><option value="59">Discography</option><option value="60">Single</option><option value="68">Concerts</option><option value="69">AAC</option></select><div class="trigger">MP3</div><ul class="options"><li data-raw-value="22" class="selected">MP3</li><li data-raw-value="23">Lossless</li><li data-raw-value="24">DVD</li><li data-raw-value="25">Video</li><li data-raw-value="26">Radio</li><li data-raw-value="27">Other</li><li data-raw-value="53">Album</li><li data-raw-value="58">Box Set</li><li data-raw-value="59">Discography</li><li data-raw-value="60">Single</li><li data-raw-value="68">Concerts</li><li data-raw-value="69">AAC</li></ul></div>');
  351. } else if(currentCategory == "TV") {
  352. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="5">DVD</option><option value="6">Divx/Xvid</option><option value="7">SVCD/VCD</option><option value="41">HD</option></select><div class="trigger">DVD</div><ul class="options"><li data-raw-value="5" class="selected">DVD</li><li data-raw-value="6">Divx/Xvid</li><li data-raw-value="7">SVCD/VCD</li><li data-raw-value="41">HD</li></ul></div>');
  353. } else if(currentCategory == "Apps") {
  354. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="18">PC Software</option><option value="19">Mac</option><option value="20">Linux</option><option value="21">Other</option><option value="56">Android</option><option value="57">iOS</option></select><div class="trigger">PC Software</div><ul class="options"><li data-raw-value="18" class="selected">PC Software</li><li data-raw-value="19">Mac</li><li data-raw-value="20">Linux</li><li data-raw-value="21">Other</li><li data-raw-value="56">Android</li><li data-raw-value="57">iOS</li></ul></div>');
  355. } else if(currentCategory == "Documentaries") {
  356. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="9">Documentary</option></select><div class="trigger">Documentary</div><ul class="options"><li data-raw-value="9" class="selected">Documentary</li></ul></div>');
  357. } else if(currentCategory == "Anime") {
  358. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="28">Anime</option></select><div class="trigger">Anime</div><ul class="options"><li data-raw-value="28" class="selected">Anime</li></ul></div>');
  359. } else if(currentCategory == "XXX") {
  360. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="48">Video</option><option value="49">Picture</option><option value="50">Magazine</option><option value="51">Hentai</option><option value="67">Games</option></select><div class="trigger">Video</div><ul class="options"><li data-raw-value="48" class="selected">Video</li><li data-raw-value="49">Picture</li><li data-raw-value="50">Magazine</li><li data-raw-value="51">Hentai</li><li data-raw-value="67">Games</li></ul></div>');
  361. } else if(currentCategory == "Other") {
  362. $("#type").parent().replaceWith('<div class="fancy-select"><select name="type" class="select fancified" id="type" style="width: 1px; height: 1px; display: block; position: absolute; top: 0px; left: 0px; opacity: 0;"><option value="33">Emulation</option><option value="34">Tutorials</option><option value="35">Sounds</option><option value="36">E-Books</option><option value="37">Images</option><option value="38">Mobile Phone</option><option value="39">Comics</option><option value="40">Other</option><option value="47">Nulled Script</option><option value="52">Audiobook</option></select><div class="trigger">Emulation</div><ul class="options"><li data-raw-value="33" class="selected">Emulation</li><li data-raw-value="34">Tutorials</li><li data-raw-value="35">Sounds</li><li data-raw-value="36">E-Books</li><li data-raw-value="37">Images</li><li data-raw-value="38">Mobile Phone</li><li data-raw-value="39">Comics</li><li data-raw-value="40">Other</li><li data-raw-value="47">Nulled Script</li><li data-raw-value="52">Audiobook</li></ul></div>');
  363. }
  364. //Basically a whole new dropdown menu...
  365. $("#type").parent().find(".trigger").click(function() {
  366. if ( $("#type").parent().find(".options").attr("class").indexOf("open") >= 0 ) { //if it's open, close it ---------
  367. var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
  368. $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
  369. } else { //If it's closed, open it ----------
  370. var openClass = $("#type").parent().find(".options").attr("class") + " open"; //get the classes and add "open" to it
  371. $("#type").parent().find(".options").attr("class", openClass); //replace the classes with the one with "open"
  372. $("#type").parent().find(".options").find("li").mouseenter(function() {
  373. var mEClass = $(this).attr("class") + " hover";
  374. $(this).attr("class", mEClass);
  375. });
  376. $("#type").parent().find(".options").find("li").mouseleave(function() {
  377. var mLClass = $(this).attr("class").replace(" hover", "");
  378. $(this).attr("class", mLClass);
  379. mLClass = "";
  380. });
  381. $("#type").parent().find(".options").find("li").click(function() {
  382. $("#type").parent().find(".options").find("li").each(function() {
  383. $(this).attr("class", "");
  384. });
  385. var mCClass = $(this).attr("class") + " selected";
  386. var select = $(this).text();
  387. $(this).attr("class", mCClass);
  388. $("#type").parent().find(".trigger").text(select);
  389. var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
  390. $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
  391. catChange();
  392. });
  393. }
  394. });
  395. }