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-18 提交的版本,查看 最新版本

  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 0.8
  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 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)
  18. 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)
  19. var showOnlyUpload = true; // Choose whether to hide the the boxes above the "Upload your files" box.
  20.  
  21. /*Tips for more complicated descriptions:
  22. - To put text on a new line use the newline character(\n).
  23. This is the firstline.\nThis is the second line.
  24. - 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)
  25. \"this\" will work
  26. "this" will not
  27.  
  28. Example:
  29. 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";
  30.  
  31.  
  32. You can create default descriptions for as many categories as you wish.
  33. 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! */
  34. //Remind me? true/false
  35. var reminder = true; /* (red text next to category)
  36. These take priority over the global default description.
  37. Simply type the description between the quotes on the line corresponding to your category id. */
  38.  
  39. //-------------------------------
  40. //-------------------------------
  41.  
  42. $("#category").parent().find(".options").find("li").click(function() {
  43. catChange();
  44. });
  45.  
  46. $(document).ready(function() {
  47. if (reminder) {
  48. $("small:contains('Please select which category best fits your torrent.')").append(" <p style='color:red'>Choose before editing the description!</p> ");
  49. }
  50. if (showOnlyUpload) {
  51. $("h1:contains(' Want to upload a torrent? No problem! Please use the announce URLs: ')").parent().parent().hide();
  52. $("h1:contains('New upload categories')").parent().parent().hide();
  53. }
  54. $("[name='title']").val(dName); //set default title
  55. $("[name='tags']").val(dTags); //set default tags
  56. $("[name='description']").val(dDesc); //set default description
  57.  
  58. setTimeout(function(){
  59. //set default Language ---------------------------------------------------
  60. $("#language").parent().find(".options").find("li").each(function() {
  61. $(this).removeAttr("class");
  62. });
  63. $("#language").parent().find(".trigger").text(dLanguage);
  64. $("#language").parent().find(".options").find("li:contains('" + dLanguage + "')").attr("class", "selected");
  65. }, 1000); //----------------------------------------------------------------
  66. });
  67.  
  68. ///////////////////////////////////////////////////
  69. //////////Edit main category defaults below///////
  70. /////////////////////////////////////////////////
  71. /*
  72. Descriptions for Main Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val. (See example)
  73. Example line:
  74. $("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here
  75.  
  76. Remember the the rules for creating descriptions. (See settings section above)
  77. */
  78. function catChange() {
  79. setTimeout(function() {
  80. if($("#category").parent().find(".trigger").text() == "Movie") {
  81. $("[name='description']").val(""); // Put your description for "Movie" here
  82. } else if($("#category").parent().find(".trigger").text() == "Game") {
  83. $("[name='description']").val(""); // Put your description for "Game" here
  84. } else if($("#category").parent().find(".trigger").text() == "Music") {
  85. $("[name='description']").val(""); // Put your description for "Music" here
  86. } else if($("#category").parent().find(".trigger").text() == "TV") {
  87. $("[name='description']").val(""); // Put your description for "TV" here
  88. } else if($("#category").parent().find(".trigger").text() == "Apps") {
  89. $("[name='description']").val(""); // Put your description for "Apps" here
  90. } else if($("#category").parent().find(".trigger").text() == "Documentaries") {
  91. $("[name='description']").val(""); // Put your description for "Documentaries" here
  92. } else if($("#category").parent().find(".trigger").text() == "Anime") {
  93. $("[name='description']").val(""); // Put your description for "Anime" here
  94. } else if($("#category").parent().find(".trigger").text() == "XXX") {
  95. $("[name='description']").val(""); // Put your description for "XXX" here
  96. } else if($("#category").parent().find(".trigger").text() == "Other") {
  97. $("[name='description']").val(""); // Put your description for "Other" here
  98. }
  99. subCatChange()
  100. $("#type").parent().find(".options").find("li").click(function() {
  101. subCatChange();
  102. });
  103. }, 700);
  104. }
  105. ///////////////////////////////////////////////////
  106. //////////Edit main category defaults above///////
  107. /////////////////////////////////////////////////
  108.  
  109.  
  110.  
  111.  
  112. ///////////////////////////////////////////////
  113. ///////Edit sub category defaults below///////
  114. /////////////////////////////////////////////
  115. /*
  116. These will of course replace the description added by the main category.
  117. Descriptions for Sub Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val. (See example)
  118. Example line:
  119. $("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here
  120.  
  121. Remember the the rules for creating descriptions. (See settings section above)
  122. */
  123. function subCatChange() {
  124. setTimeout(function() {
  125. if($("#category").parent().find(".trigger").text() == "Movie") { //------Subcategories of Movie below------
  126. if($("#type").parent().find(".trigger").text() == "DVD") {
  127. $("[name='description']").val(""); // Put your description for "DVD" here
  128. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  129. $("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  130. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  131. $("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  132. } else if($("#type").parent().find(".trigger").text() == "Dubs/Dual Audio") {
  133. $("[name='description']").val(""); // Put your description for "Dubs/Dual Audio" here
  134. } else if($("#type").parent().find(".trigger").text() == "HD") {
  135. $("[name='description']").val(""); // Put your description for "HD" here
  136. } else if($("#type").parent().find(".trigger").text() == "h.264/x264") {
  137. $("[name='description']").val(""); // Put your description for "h.264/x264" here
  138. } else if($("#type").parent().find(".trigger").text() == "Mp4") {
  139. $("[name='description']").val(""); // Put your description for "Mp4" here
  140. } else if($("#type").parent().find(".trigger").text() == "3D") {
  141. $("[name='description']").val(""); // Put your description for "3D" here
  142. }
  143. } else if($("#category").parent().find(".trigger").text() == "Game") { //------Subcategories of Game below------
  144. if($("#type").parent().find(".trigger").text() == "PC Game") {
  145. $("[name='description']").val(""); // Put your description for "PC Game" here
  146. } else if($("#type").parent().find(".trigger").text() == "PS2") {
  147. $("[name='description']").val(""); // Put your description for "PS2" here
  148. } else if($("#type").parent().find(".trigger").text() == "PSP") {
  149. $("[name='description']").val(""); // Put your description for "PSP" here
  150. } else if($("#type").parent().find(".trigger").text() == "Xbox") {
  151. $("[name='description']").val(""); // Put your description for "Xbox" here
  152. } else if($("#type").parent().find(".trigger").text() == "Xbox360") {
  153. $("[name='description']").val(""); // Put your description for "Xbox360" here
  154. } else if($("#type").parent().find(".trigger").text() == "PS1") {
  155. $("[name='description']").val(""); // Put your description for "PS1" here
  156. } else if($("#type").parent().find(".trigger").text() == "Dreamcast") {
  157. $("[name='description']").val(""); // Put your description for "Dreamcast" here
  158. } else if($("#type").parent().find(".trigger").text() == "Other") {
  159. $("[name='description']").val(""); // Put your description for "Other" here
  160. } else if($("#type").parent().find(".trigger").text() == "PS3") {
  161. $("[name='description']").val(""); // Put your description for "PS3" here
  162. } else if($("#type").parent().find(".trigger").text() == "Wii") {
  163. $("[name='description']").val(""); // Put your description for "Wii" here
  164. } else if($("#type").parent().find(".trigger").text() == "DS") {
  165. $("[name='description']").val(""); // Put your description for "DS" here
  166. } else if($("#type").parent().find(".trigger").text() == "GameCube") {
  167. $("[name='description']").val(""); // Put your description for "GameCube" here
  168. }
  169. } else if($("#category").parent().find(".trigger").text() == "Music") { //------Subcategories of Music below------
  170. if($("#type").parent().find(".trigger").text() == "MP3") {
  171. $("[name='description']").val(""); // Put your description for "MP#" here
  172. } else if($("#type").parent().find(".trigger").text() == "Lossless") {
  173. $("[name='description']").val(""); // Put your description for "Lossless" here
  174. } else if($("#type").parent().find(".trigger").text() == "DVD") {
  175. $("[name='description']").val(""); // Put your description for "DVD" here
  176. } else if($("#type").parent().find(".trigger").text() == "Video") {
  177. $("[name='description']").val(""); // Put your description for "Video" here
  178. } else if($("#type").parent().find(".trigger").text() == "Radio") {
  179. $("[name='description']").val(""); // Put your description for "Radio" here
  180. } else if($("#type").parent().find(".trigger").text() == "Other") {
  181. $("[name='description']").val(""); // Put your description for "Other" here
  182. } else if($("#type").parent().find(".trigger").text() == "Album") {
  183. $("[name='description']").val(""); // Put your description for "Album" here
  184. } else if($("#type").parent().find(".trigger").text() == "Box Set") {
  185. $("[name='description']").val(""); // Put your description for "Box Set" here
  186. } else if($("#type").parent().find(".trigger").text() == "Discography") {
  187. $("[name='description']").val(""); // Put your description for "Discography" here
  188. } else if($("#type").parent().find(".trigger").text() == "Single") {
  189. $("[name='description']").val(""); // Put your description for "Singles" here
  190. } else if($("#type").parent().find(".trigger").text() == "Concerts") {
  191. $("[name='description']").val(""); // Put your description for "Concerts" here
  192. } else if($("#type").parent().find(".trigger").text() == "AAC") {
  193. $("[name='description']").val(""); // Put your description for "AAC" here
  194. }
  195. } else if($("#category").parent().find(".trigger").text() == "TV") { //------Subcategories of TV below------
  196. if($("#type").parent().find(".trigger").text() == "DVD") {
  197. $("[name='description']").val(""); // Put your description for "DVD" here
  198. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  199. $("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  200. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  201. $("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  202. } else if($("#type").parent().find(".trigger").text() == "HD") {
  203. $("[name='description']").val(""); // Put your description for "HD" here
  204. }
  205. } else if($("#category").parent().find(".trigger").text() == "Apps") { //------Subcategories of Apps below------
  206. if($("#type").parent().find(".trigger").text() == "PC Software") {
  207. $("[name='description']").val(""); // Put your description for "PC Software" here
  208. } else if($("#type").parent().find(".trigger").text() == "Mac") {
  209. $("[name='description']").val(""); // Put your description for "Mac" here
  210. } else if($("#type").parent().find(".trigger").text() == "Linux") {
  211. $("[name='description']").val(""); // Put your description for "Linux" here
  212. } else if($("#type").parent().find(".trigger").text() == "Other") {
  213. $("[name='description']").val(""); // Put your description for "Other" here
  214. } else if($("#type").parent().find(".trigger").text() == "Android") {
  215. $("[name='description']").val(""); // Put your description for "Android" here
  216. } else if($("#type").parent().find(".trigger").text() == "iOS") {
  217. $("[name='description']").val(""); // Put your description for "iOS" here
  218. }
  219. } else if($("#category").parent().find(".trigger").text() == "XXX") { //------Subcategories of XXX below------
  220. if($("#type").parent().find(".trigger").text() == "Video") {
  221. $("[name='description']").val(""); // Put your description for "Video" here
  222. } else if($("#type").parent().find(".trigger").text() == "Picture") {
  223. $("[name='description']").val(""); // Put your description for "Picture" here
  224. } else if($("#type").parent().find(".trigger").text() == "Magazine") {
  225. $("[name='description']").val(""); // Put your description for "Magazine" here
  226. } else if($("#type").parent().find(".trigger").text() == "Hentai") {
  227. $("[name='description']").val(""); // Put your description for "Hentai" here
  228. } else if($("#type").parent().find(".trigger").text() == "Games") {
  229. $("[name='description']").val(""); // Put your description for "Games" here
  230. }
  231. } else if($("#category").parent().find(".trigger").text() == "Other") { //------Subcategories of Other below------
  232. if($("#type").parent().find(".trigger").text() == "Emulation") {
  233. $("[name='description']").val(""); // Put your description for "Emulation" here
  234. } else if($("#type").parent().find(".trigger").text() == "Tutorials") {
  235. $("[name='description']").val(""); // Put your description for "Tutorials" here
  236. } else if($("#type").parent().find(".trigger").text() == "Sounds") {
  237. $("[name='description']").val(""); // Put your description for "Sounds" here
  238. } else if($("#type").parent().find(".trigger").text() == "E-Books") {
  239. $("[name='description']").val(""); // Put your description for "E-Books" here
  240. } else if($("#type").parent().find(".trigger").text() == "Images") {
  241. $("[name='description']").val(""); // Put your description for "Images" here
  242. } else if($("#type").parent().find(".trigger").text() == "Mobile Phone") {
  243. $("[name='description']").val(""); // Put your description for "Mobile Phone" here
  244. } else if($("#type").parent().find(".trigger").text() == "Comics") {
  245. $("[name='description']").val(""); // Put your description for "Comics" here
  246. } else if($("#type").parent().find(".trigger").text() == "Other") {
  247. $("[name='description']").val(""); // Put your description for "Other" here
  248. } else if($("#type").parent().find(".trigger").text() == "Nulled Script") {
  249. $("[name='description']").val(""); // Put your description for "Nulled Script" here
  250. } else if($("#type").parent().find(".trigger").text() == "Audiobook") {
  251. $("[name='description']").val(""); // Put your description for "Audiobook" here
  252. }
  253. }
  254. }, 100);
  255. }
  256. ///////////////////////////////////////////////
  257. ///////Edit sub category defaults above///////
  258. /////////////////////////////////////////////