1337x - Default descriptions for categories and more

let's you set up default descriptions for categories and other defaults like title, tags etc.

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

  1. // ==UserScript==
  2. // @name 1337x - Default descriptions for categories and more
  3. // @namespace NotNeo
  4. // @description let's you set up default descriptions for categories and other defaults like title, tags etc.
  5. // @include http*://1337x.to/upload
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
  7. // @version 1.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 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. ///////////////////////////////////////////////////
  43. //////////Edit main category defaults below///////
  44. /////////////////////////////////////////////////
  45. /*
  46. Descriptions for Main Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val.
  47. and then uncomment the line(remove the two forwardslashes at the start of the line) (See example below)
  48.  
  49. Example lines:
  50.  
  51. //$("[name='description']").val(""); // Put your description for "X" here
  52. above line becomes ->
  53. $("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here
  54.  
  55. Remember the the rules for creating descriptions. (See settings section above)
  56. */
  57. function catChange() {
  58. setTimeout(function() {
  59. if($("#category").parent().find(".trigger").text() == "Movie") {
  60. //$("[name='description']").val(""); // Put your description for "Movie" here
  61. } else if($("#category").parent().find(".trigger").text() == "Game") {
  62. //$("[name='description']").val(""); // Put your description for "Game" here
  63. } else if($("#category").parent().find(".trigger").text() == "Music") {
  64. //$("[name='description']").val(""); // Put your description for "Music" here
  65. } else if($("#category").parent().find(".trigger").text() == "TV") {
  66. //$("[name='description']").val(""); // Put your description for "TV" here
  67. } else if($("#category").parent().find(".trigger").text() == "Apps") {
  68. //$("[name='description']").val(""); // Put your description for "Apps" here
  69. } else if($("#category").parent().find(".trigger").text() == "Documentaries") {
  70. //$("[name='description']").val(""); // Put your description for "Documentaries" here
  71. } else if($("#category").parent().find(".trigger").text() == "Anime") {
  72. //$("[name='description']").val(""); // Put your description for "Anime" here
  73. } else if($("#category").parent().find(".trigger").text() == "XXX") {
  74. //$("[name='description']").val(""); // Put your description for "XXX" here
  75. } else if($("#category").parent().find(".trigger").text() == "Other") {
  76. //$("[name='description']").val(""); // Put your description for "Other" here
  77. }
  78. subCatChange();
  79. }, 700);
  80. }
  81. ///////////////////////////////////////////////////
  82. //////////Edit main category defaults above///////
  83. /////////////////////////////////////////////////
  84.  
  85.  
  86.  
  87.  
  88. ///////////////////////////////////////////////
  89. ///////Edit sub category defaults below///////
  90. /////////////////////////////////////////////
  91. /*
  92. These will of course replace the description added by the main category.
  93. Descriptions for Sub Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val.
  94. and then uncomment the line(remove the two forwardslashes at the start of the line) (See example below)
  95.  
  96. Example lines:
  97.  
  98. //$("[name='description']").val(""); // Put your description for "X" here
  99. above line becomes ->
  100. $("[name='description']").val("[center][b]This is my example description for X subcategory[/b][/center]"); // Put your description for "X" here
  101.  
  102. Remember the the rules for creating descriptions. (See settings section above)
  103. */
  104. function subCatChange() {
  105. setTimeout(function() {
  106. if($("#category").parent().find(".trigger").text() == "Movie") { //------Subcategories of Movie below------
  107. if($("#type").parent().find(".trigger").text() == "DVD") {
  108. //$("[name='description']").val(""); // Put your description for "DVD" here
  109. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  110. //$("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  111. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  112. //$("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  113. } else if($("#type").parent().find(".trigger").text() == "Dubs/Dual Audio") {
  114. //$("[name='description']").val(""); // Put your description for "Dubs/Dual Audio" here
  115. } else if($("#type").parent().find(".trigger").text() == "HD") {
  116. //$("[name='description']").val(""); // Put your description for "HD" here
  117. } else if($("#type").parent().find(".trigger").text() == "h.264/x264") {
  118. //$("[name='description']").val(""); // Put your description for "h.264/x264" here
  119. } else if($("#type").parent().find(".trigger").text() == "Mp4") {
  120. //$("[name='description']").val(""); // Put your description for "Mp4" here
  121. } else if($("#type").parent().find(".trigger").text() == "3D") {
  122. //$("[name='description']").val(""); // Put your description for "3D" here
  123. }
  124. } else if($("#category").parent().find(".trigger").text() == "Game") { //------Subcategories of Game below------
  125. if($("#type").parent().find(".trigger").text() == "PC Game") {
  126. //$("[name='description']").val(""); // Put your description for "PC Game" here
  127. } else if($("#type").parent().find(".trigger").text() == "PS2") {
  128. //$("[name='description']").val(""); // Put your description for "PS2" here
  129. } else if($("#type").parent().find(".trigger").text() == "PSP") {
  130. //$("[name='description']").val(""); // Put your description for "PSP" here
  131. } else if($("#type").parent().find(".trigger").text() == "Xbox") {
  132. //$("[name='description']").val(""); // Put your description for "Xbox" here
  133. } else if($("#type").parent().find(".trigger").text() == "Xbox360") {
  134. //$("[name='description']").val(""); // Put your description for "Xbox360" here
  135. } else if($("#type").parent().find(".trigger").text() == "PS1") {
  136. //$("[name='description']").val(""); // Put your description for "PS1" here
  137. } else if($("#type").parent().find(".trigger").text() == "Dreamcast") {
  138. //$("[name='description']").val(""); // Put your description for "Dreamcast" here
  139. } else if($("#type").parent().find(".trigger").text() == "Other") {
  140. //$("[name='description']").val(""); // Put your description for "Other" here
  141. } else if($("#type").parent().find(".trigger").text() == "PS3") {
  142. //$("[name='description']").val(""); // Put your description for "PS3" here
  143. } else if($("#type").parent().find(".trigger").text() == "Wii") {
  144. //$("[name='description']").val(""); // Put your description for "Wii" here
  145. } else if($("#type").parent().find(".trigger").text() == "DS") {
  146. //$("[name='description']").val(""); // Put your description for "DS" here
  147. } else if($("#type").parent().find(".trigger").text() == "GameCube") {
  148. //$("[name='description']").val(""); // Put your description for "GameCube" here
  149. }
  150. } else if($("#category").parent().find(".trigger").text() == "Music") { //------Subcategories of Music below------
  151. if($("#type").parent().find(".trigger").text() == "MP3") {
  152. //$("[name='description']").val(""); // Put your description for "MP3" here
  153. } else if($("#type").parent().find(".trigger").text() == "Lossless") {
  154. //$("[name='description']").val(""); // Put your description for "Lossless" here
  155. } else if($("#type").parent().find(".trigger").text() == "DVD") {
  156. //$("[name='description']").val(""); // Put your description for "DVD" here
  157. } else if($("#type").parent().find(".trigger").text() == "Video") {
  158. //$("[name='description']").val(""); // Put your description for "Video" here
  159. } else if($("#type").parent().find(".trigger").text() == "Radio") {
  160. //$("[name='description']").val(""); // Put your description for "Radio" here
  161. } else if($("#type").parent().find(".trigger").text() == "Other") {
  162. //$("[name='description']").val(""); // Put your description for "Other" here
  163. } else if($("#type").parent().find(".trigger").text() == "Album") {
  164. //$("[name='description']").val(""); // Put your description for "Album" here
  165. } else if($("#type").parent().find(".trigger").text() == "Box Set") {
  166. //$("[name='description']").val(""); // Put your description for "Box Set" here
  167. } else if($("#type").parent().find(".trigger").text() == "Discography") {
  168. //$("[name='description']").val(""); // Put your description for "Discography" here
  169. } else if($("#type").parent().find(".trigger").text() == "Single") {
  170. //$("[name='description']").val(""); // Put your description for "Singles" here
  171. } else if($("#type").parent().find(".trigger").text() == "Concerts") {
  172. //$("[name='description']").val(""); // Put your description for "Concerts" here
  173. } else if($("#type").parent().find(".trigger").text() == "AAC") {
  174. //$("[name='description']").val(""); // Put your description for "AAC" here
  175. }
  176. } else if($("#category").parent().find(".trigger").text() == "TV") { //------Subcategories of TV below------
  177. if($("#type").parent().find(".trigger").text() == "DVD") {
  178. //$("[name='description']").val(""); // Put your description for "DVD" here
  179. } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
  180. //$("[name='description']").val(""); // Put your description for "Divx/Xvid" here
  181. } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
  182. //$("[name='description']").val(""); // Put your description for "SVCD/VCD" here
  183. } else if($("#type").parent().find(".trigger").text() == "HD") {
  184. //$("[name='description']").val(""); // Put your description for "HD" here
  185. }
  186. } else if($("#category").parent().find(".trigger").text() == "Apps") { //------Subcategories of Apps below------
  187. if($("#type").parent().find(".trigger").text() == "PC Software") {
  188. //$("[name='description']").val(""); // Put your description for "PC Software" here
  189. } else if($("#type").parent().find(".trigger").text() == "Mac") {
  190. //$("[name='description']").val(""); // Put your description for "Mac" here
  191. } else if($("#type").parent().find(".trigger").text() == "Linux") {
  192. //$("[name='description']").val(""); // Put your description for "Linux" here
  193. } else if($("#type").parent().find(".trigger").text() == "Other") {
  194. //$("[name='description']").val(""); // Put your description for "Other" here
  195. } else if($("#type").parent().find(".trigger").text() == "Android") {
  196. //$("[name='description']").val(""); // Put your description for "Android" here
  197. } else if($("#type").parent().find(".trigger").text() == "iOS") {
  198. //$("[name='description']").val(""); // Put your description for "iOS" here
  199. }
  200. } else if($("#category").parent().find(".trigger").text() == "XXX") { //------Subcategories of XXX below------
  201. if($("#type").parent().find(".trigger").text() == "Video") {
  202. //$("[name='description']").val(""); // Put your description for "Video" here
  203. } else if($("#type").parent().find(".trigger").text() == "Picture") {
  204. //$("[name='description']").val(""); // Put your description for "Picture" here
  205. } else if($("#type").parent().find(".trigger").text() == "Magazine") {
  206. //$("[name='description']").val(""); // Put your description for "Magazine" here
  207. } else if($("#type").parent().find(".trigger").text() == "Hentai") {
  208. //$("[name='description']").val(""); // Put your description for "Hentai" here
  209. } else if($("#type").parent().find(".trigger").text() == "Games") {
  210. //$("[name='description']").val(""); // Put your description for "Games" here
  211. }
  212. } else if($("#category").parent().find(".trigger").text() == "Other") { //------Subcategories of Other below------
  213. if($("#type").parent().find(".trigger").text() == "Emulation") {
  214. //$("[name='description']").val(""); // Put your description for "Emulation" here
  215. } else if($("#type").parent().find(".trigger").text() == "Tutorials") {
  216. //$("[name='description']").val(""); // Put your description for "Tutorials" here
  217. } else if($("#type").parent().find(".trigger").text() == "Sounds") {
  218. //$("[name='description']").val(""); // Put your description for "Sounds" here
  219. } else if($("#type").parent().find(".trigger").text() == "E-Books") {
  220. //$("[name='description']").val(""); // Put your description for "E-Books" here
  221. } else if($("#type").parent().find(".trigger").text() == "Images") {
  222. //$("[name='description']").val(""); // Put your description for "Images" here
  223. } else if($("#type").parent().find(".trigger").text() == "Mobile Phone") {
  224. //$("[name='description']").val(""); // Put your description for "Mobile Phone" here
  225. } else if($("#type").parent().find(".trigger").text() == "Comics") {
  226. //$("[name='description']").val(""); // Put your description for "Comics" here
  227. } else if($("#type").parent().find(".trigger").text() == "Other") {
  228. //$("[name='description']").val(""); // Put your description for "Other" here
  229. } else if($("#type").parent().find(".trigger").text() == "Nulled Script") {
  230. //$("[name='description']").val(""); // Put your description for "Nulled Script" here
  231. } else if($("#type").parent().find(".trigger").text() == "Audiobook") {
  232. //$("[name='description']").val(""); // Put your description for "Audiobook" here
  233. }
  234. }
  235. }, 100);
  236. }
  237. ///////////////////////////////////////////////
  238. ///////Edit sub category defaults above///////
  239. /////////////////////////////////////////////
  240. ////////////////////////////////////////////
  241. ////DO NOT EDIT ANYTHING BELOW THIS LINE///
  242. //////////////////////////////////////////
  243.  
  244. $("#category").parent().find(".options").click(function() {
  245. catChange();
  246. });
  247.  
  248. $("#type").parent().find(".options").click(function() {
  249. catChange();
  250. });
  251.  
  252.  
  253.  
  254. $(document).ready(function() {
  255. if (reminder) {
  256. $("small:contains('Please select which category best fits your torrent.')").append(" <p style='color:red'>Choose before editing the description!</p> ");
  257. }
  258. if (showOnlyUpload) {
  259. $("h1:contains(' Want to upload a torrent? No problem! Please use the announce URLs: ')").parent().parent().hide();
  260. $("h1:contains('New upload categories')").parent().parent().hide();
  261. }
  262. $("[name='title']").val(dName); //set default title
  263. $("[name='tags']").val(dTags); //set default tags
  264. $("[name='description']").val(dDesc); //set default description
  265.  
  266. setTimeout(function(){
  267. //setting default Language ---------------------------------------------------
  268. $("#language").parent().find(".options").find("li").each(function() {
  269. $(this).removeAttr("class");
  270. });
  271. $("#language").parent().find(".trigger").text(dLanguage);
  272. $("#language").parent().find(".options").find("li:contains('" + dLanguage + "')").attr("class", "selected");
  273. //----------------------------------------------------------------------------
  274. catChange();
  275. }, 1000);
  276. });