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

// ==UserScript==
// @name        1337x - Default values for uploads
// @namespace   NotNeo
// @description let's you set up defaults in the "Upload" section of 1337x (custom default descriptions for every category)
// @include     http*://1337x.to/upload
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @version     0.9
// @grant       none
// ==/UserScript==

//"Default" of course means that you can change everything in the "upload torrent" section normally, the values just start out with these settings.

//--------------------------------
//------------Settings------------
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)
var dLanguage = "English"; //put the EXACT name of your language (from the dropdown menu) in the quotes
var dCategory = "Choose One"; //put the EXACT name of your main Category (from the dropdown menu) in the quotes ("Choose One" for now default)
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)
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)
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)
var showOnlyUpload = true; // Choose whether to hide the the boxes above the "Upload your files" box.

/*Tips for more complicated descriptions:
- To put text on a new line use the newline character(\n).
This is the firstline.\nThis is the second line.
- 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)
\"this\" will work
"this" will not

Example: 
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";


You can create default descriptions for as many categories as you wish. 
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! */
//Remind me? true/false 
var reminder = true; /* (red text next to category)
These take priority over the global default description.
Simply type the description between the quotes on the line corresponding to your category id. */

//-------------------------------
//-------------------------------

///////////////////////////////////////////////////
//////////Edit main category defaults below///////
/////////////////////////////////////////////////
/*
Descriptions for Main Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val. (See example)
Example line: 
$("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here

Remember the the rules for creating descriptions. (See settings section above)
*/
function catChange() {
  setTimeout(function() {
    if($("#category").parent().find(".trigger").text() == "Movie") {
      $("[name='description']").val(""); // Put your description for "Movie" here
    } else if($("#category").parent().find(".trigger").text() == "Game") {
      $("[name='description']").val(""); // Put your description for "Game" here
    } else if($("#category").parent().find(".trigger").text() == "Music") {
      $("[name='description']").val(""); // Put your description for "Music" here
    } else if($("#category").parent().find(".trigger").text() == "TV") {
      $("[name='description']").val(""); // Put your description for "TV" here
    } else if($("#category").parent().find(".trigger").text() == "Apps") {
      $("[name='description']").val(""); // Put your description for "Apps" here
    } else if($("#category").parent().find(".trigger").text() == "Documentaries") {
      $("[name='description']").val(""); // Put your description for "Documentaries" here
    } else if($("#category").parent().find(".trigger").text() == "Anime") {
      $("[name='description']").val(""); // Put your description for "Anime" here
    } else if($("#category").parent().find(".trigger").text() == "XXX") {
      $("[name='description']").val(""); // Put your description for "XXX" here
    } else if($("#category").parent().find(".trigger").text() == "Other") {
      $("[name='description']").val(""); // Put your description for "Other" here
    }
    subCatChange()
  }, 700);
}
///////////////////////////////////////////////////
//////////Edit main category defaults above///////
/////////////////////////////////////////////////




///////////////////////////////////////////////
///////Edit sub category defaults below///////
/////////////////////////////////////////////
/*
These will of course replace the description added by the main category.
Descriptions for Sub Categories --------( put your custom descriptions in the marked lines in quotes inside the paranthesis after .val. (See example)
Example line: 
$("[name='description']").val("[center][b]This is my example description for X category[/b][/center]"); // Put your description for "X" here

Remember the the rules for creating descriptions. (See settings section above)
*/
function subCatChange() {
  setTimeout(function() {
    if($("#category").parent().find(".trigger").text() == "Movie") { //------Subcategories of Movie below------
      if($("#type").parent().find(".trigger").text() == "DVD") {
        $("[name='description']").val(""); // Put your description for "DVD" here
      } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
        $("[name='description']").val(""); // Put your description for "Divx/Xvid" here
      } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
        $("[name='description']").val(""); // Put your description for "SVCD/VCD" here
      } else if($("#type").parent().find(".trigger").text() == "Dubs/Dual Audio") {
        $("[name='description']").val(""); // Put your description for "Dubs/Dual Audio" here
      } else if($("#type").parent().find(".trigger").text() == "HD") {
        $("[name='description']").val(""); // Put your description for "HD" here
      } else if($("#type").parent().find(".trigger").text() == "h.264/x264") {
        $("[name='description']").val(""); // Put your description for "h.264/x264" here
      } else if($("#type").parent().find(".trigger").text() == "Mp4") {
        $("[name='description']").val(""); // Put your description for "Mp4" here
      } else if($("#type").parent().find(".trigger").text() == "3D") {
        $("[name='description']").val(""); // Put your description for "3D" here
      }
    } else if($("#category").parent().find(".trigger").text() == "Game") { //------Subcategories of Game below------
      if($("#type").parent().find(".trigger").text() == "PC Game") {
        $("[name='description']").val(""); // Put your description for "PC Game" here
      } else if($("#type").parent().find(".trigger").text() == "PS2") {
        $("[name='description']").val(""); // Put your description for "PS2" here
      } else if($("#type").parent().find(".trigger").text() == "PSP") {
        $("[name='description']").val(""); // Put your description for "PSP" here
      } else if($("#type").parent().find(".trigger").text() == "Xbox") {
        $("[name='description']").val(""); // Put your description for "Xbox" here
      } else if($("#type").parent().find(".trigger").text() == "Xbox360") {
        $("[name='description']").val(""); // Put your description for "Xbox360" here
      } else if($("#type").parent().find(".trigger").text() == "PS1") {
        $("[name='description']").val(""); // Put your description for "PS1" here
      } else if($("#type").parent().find(".trigger").text() == "Dreamcast") {
        $("[name='description']").val(""); // Put your description for "Dreamcast" here
      } else if($("#type").parent().find(".trigger").text() == "Other") {
        $("[name='description']").val(""); // Put your description for "Other" here
      } else if($("#type").parent().find(".trigger").text() == "PS3") {
        $("[name='description']").val(""); // Put your description for "PS3" here
      } else if($("#type").parent().find(".trigger").text() == "Wii") {
        $("[name='description']").val(""); // Put your description for "Wii" here
      } else if($("#type").parent().find(".trigger").text() == "DS") {
        $("[name='description']").val(""); // Put your description for "DS" here
      } else if($("#type").parent().find(".trigger").text() == "GameCube") {
        $("[name='description']").val(""); // Put your description for "GameCube" here
      }
    } else if($("#category").parent().find(".trigger").text() == "Music") { //------Subcategories of Music below------
      if($("#type").parent().find(".trigger").text() == "MP3") {
        $("[name='description']").val(""); // Put your description for "MP#" here
      } else if($("#type").parent().find(".trigger").text() == "Lossless") {
        $("[name='description']").val(""); // Put your description for "Lossless" here
      } else if($("#type").parent().find(".trigger").text() == "DVD") {
        $("[name='description']").val(""); // Put your description for "DVD" here
      } else if($("#type").parent().find(".trigger").text() == "Video") {
        $("[name='description']").val(""); // Put your description for "Video" here
      } else if($("#type").parent().find(".trigger").text() == "Radio") {
        $("[name='description']").val(""); // Put your description for "Radio" here
      } else if($("#type").parent().find(".trigger").text() == "Other") {
        $("[name='description']").val(""); // Put your description for "Other" here
      } else if($("#type").parent().find(".trigger").text() == "Album") {
        $("[name='description']").val(""); // Put your description for "Album" here
      } else if($("#type").parent().find(".trigger").text() == "Box Set") {
        $("[name='description']").val(""); // Put your description for "Box Set" here
      } else if($("#type").parent().find(".trigger").text() == "Discography") {
        $("[name='description']").val(""); // Put your description for "Discography" here
      } else if($("#type").parent().find(".trigger").text() == "Single") {
        $("[name='description']").val(""); // Put your description for "Singles" here
      } else if($("#type").parent().find(".trigger").text() == "Concerts") {
        $("[name='description']").val(""); // Put your description for "Concerts" here
      } else if($("#type").parent().find(".trigger").text() == "AAC") {
        $("[name='description']").val(""); // Put your description for "AAC" here
      }
    } else if($("#category").parent().find(".trigger").text() == "TV") { //------Subcategories of TV below------
      if($("#type").parent().find(".trigger").text() == "DVD") {
        $("[name='description']").val(""); // Put your description for "DVD" here
      } else if($("#type").parent().find(".trigger").text() == "Divx/Xvid") {
        $("[name='description']").val(""); // Put your description for "Divx/Xvid" here
      } else if($("#type").parent().find(".trigger").text() == "SVCD/VCD") {
        $("[name='description']").val(""); // Put your description for "SVCD/VCD" here
      } else if($("#type").parent().find(".trigger").text() == "HD") {
        $("[name='description']").val(""); // Put your description for "HD" here
      }
    } else if($("#category").parent().find(".trigger").text() == "Apps") { //------Subcategories of Apps below------
      if($("#type").parent().find(".trigger").text() == "PC Software") {
        $("[name='description']").val(""); // Put your description for "PC Software" here
      } else if($("#type").parent().find(".trigger").text() == "Mac") {
        $("[name='description']").val(""); // Put your description for "Mac" here
      } else if($("#type").parent().find(".trigger").text() == "Linux") {
        $("[name='description']").val(""); // Put your description for "Linux" here
      } else if($("#type").parent().find(".trigger").text() == "Other") {
        $("[name='description']").val(""); // Put your description for "Other" here
      } else if($("#type").parent().find(".trigger").text() == "Android") {
        $("[name='description']").val(""); // Put your description for "Android" here
      } else if($("#type").parent().find(".trigger").text() == "iOS") {
        $("[name='description']").val(""); // Put your description for "iOS" here
      }
    } else if($("#category").parent().find(".trigger").text() == "XXX") { //------Subcategories of XXX below------
      if($("#type").parent().find(".trigger").text() == "Video") {
        $("[name='description']").val(""); // Put your description for "Video" here
      } else if($("#type").parent().find(".trigger").text() == "Picture") {
        $("[name='description']").val(""); // Put your description for "Picture" here
      } else if($("#type").parent().find(".trigger").text() == "Magazine") {
        $("[name='description']").val(""); // Put your description for "Magazine" here
      } else if($("#type").parent().find(".trigger").text() == "Hentai") {
        $("[name='description']").val(""); // Put your description for "Hentai" here
      } else if($("#type").parent().find(".trigger").text() == "Games") {
        $("[name='description']").val(""); // Put your description for "Games" here
      }
    } else if($("#category").parent().find(".trigger").text() == "Other") { //------Subcategories of Other below------
      if($("#type").parent().find(".trigger").text() == "Emulation") {
        $("[name='description']").val(""); // Put your description for "Emulation" here
      } else if($("#type").parent().find(".trigger").text() == "Tutorials") {
        $("[name='description']").val(""); // Put your description for "Tutorials" here
      } else if($("#type").parent().find(".trigger").text() == "Sounds") {
        $("[name='description']").val(""); // Put your description for "Sounds" here
      } else if($("#type").parent().find(".trigger").text() == "E-Books") {
        $("[name='description']").val(""); // Put your description for "E-Books" here
      } else if($("#type").parent().find(".trigger").text() == "Images") {
        $("[name='description']").val(""); // Put your description for "Images" here
      } else if($("#type").parent().find(".trigger").text() == "Mobile Phone") {
        $("[name='description']").val(""); // Put your description for "Mobile Phone" here
      } else if($("#type").parent().find(".trigger").text() == "Comics") {
        $("[name='description']").val(""); // Put your description for "Comics" here
      } else if($("#type").parent().find(".trigger").text() == "Other") {
        $("[name='description']").val(""); // Put your description for "Other" here
      } else if($("#type").parent().find(".trigger").text() == "Nulled Script") {
        $("[name='description']").val(""); // Put your description for "Nulled Script" here
      } else if($("#type").parent().find(".trigger").text() == "Audiobook") {
        $("[name='description']").val(""); // Put your description for "Audiobook" here
      }
    }
  }, 100);
}
///////////////////////////////////////////////
///////Edit sub category defaults above///////
/////////////////////////////////////////////
////////////////////////////////////////////
////DO NOT EDIT ANYTHING BELOW THIS LINE///
//////////////////////////////////////////

$("#category").parent().find(".options").find("li").click(function() {
  catChange();
});

$("#category").parent().find(".options").find("li").click(function() {
  setTimeout(function() {
    changeSubCatList();
  }, 100);
});

$(document).ready(function() {
  if (reminder) {
    $("small:contains('Please select which category best fits your torrent.')").append(" <p style='color:red'>Choose before editing the description!</p> ");
  }
  if (showOnlyUpload) {
    $("h1:contains(' Want to upload a torrent? No problem! Please use the announce URLs: ')").parent().parent().hide();
    $("h1:contains('New upload categories')").parent().parent().hide();
  }
  $("[name='title']").val(dName); //set default title
  $("[name='tags']").val(dTags); //set default tags
  $("[name='description']").val(dDesc); //set default description

  setTimeout(function(){ 
    //setting default Language ---------------------------------------------------
    $("#language").parent().find(".options").find("li").each(function() {
      $(this).removeAttr("class");
    });
    $("#language").parent().find(".trigger").text(dLanguage);
    $("#language").parent().find(".options").find("li:contains('" + dLanguage + "')").attr("class", "selected");
    //----------------------------------------------------------------------------
    //setting default category ---------------------------------------------------
    $("#category").parent().find(".trigger").text(dCategory);
    $("#category").parent().find(".options").find("li").each(function() {
      $(this).attr("class", "");
    });
    $("#category").parent().find(".options").find("li:contains('" + dCategory + "')").attr("class", "selected");
    
    //setting default sub category -----------------------------------------------
    if(dCategory == "Movie") {
      $("#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>');
    } else if(dCategory == "Game") {
      $("#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>');
    } else if(dCategory == "Music") {
      $("#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>');
    } else if(dCategory == "TV") {
      $("#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>');
    } else if(dCategory == "Apps") {
      $("#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>');
    } else if(dCategory == "Documentaries") {
      $("#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>');
    } else if(dCategory == "Anime") {
      $("#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>');
    } else if(dCategory == "XXX") {
      $("#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>');
    } else if(dCategory == "Other") {
      $("#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>');
    }
    
    $("#type").parent().find(".trigger").text(dSubCategory);
    $("#type").parent().find(".options").find("li").each(function() {
      $(this).attr("class", "");
    });
    $("#type").parent().find(".options").find("li:contains('" + dSubCategory + "')").attr("class", "selected");
    
    catChange();
    //Basically a whole new dropdown menu...
    $("#type").parent().find(".trigger").click(function() {
      if ( $("#type").parent().find(".options").attr("class").indexOf("open") >= 0 ) { //if it's open, close it ---------
        var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
        $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
      } else { //If it's closed, open it ----------
        var openClass = $("#type").parent().find(".options").attr("class") + " open"; //get the classes and add "open" to it
        $("#type").parent().find(".options").attr("class", openClass); //replace the classes with the one with "open"
        $("#type").parent().find(".options").find("li").mouseenter(function() {
          var mEClass = $(this).attr("class") + " hover";
          $(this).attr("class", mEClass);
        });
        $("#type").parent().find(".options").find("li").mouseleave(function() {
          var mLClass = $(this).attr("class").replace(" hover", "");
          $(this).attr("class", mLClass);
          mLClass = "";
        });
        $("#type").parent().find(".options").find("li").click(function() {
          $("#type").parent().find(".options").find("li").each(function() {
            $(this).attr("class", "");
          });
          var mCClass = $(this).attr("class") + " selected";
          var select = $(this).text();
          $(this).attr("class", mCClass);
          $("#type").parent().find(".trigger").text(select);
          var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
          $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
        });
      }
    });
    
    
    //-----------------------------------------------------------------------------
  }, 1000); 
  
});

function changeSubCatList() {
  var currentCategory = $("#category").parent().find(".trigger").text();
  if(currentCategory == "Movie") {
    $("#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>');
  } else if(currentCategory == "Game") {
    $("#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>');
  } else if(currentCategory == "Music") {
    $("#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>');
  } else if(currentCategory == "TV") {
    $("#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>');
  } else if(currentCategory == "Apps") {
    $("#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>');
  } else if(currentCategory == "Documentaries") {
    $("#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>');
  } else if(currentCategory == "Anime") {
    $("#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>');
  } else if(currentCategory == "XXX") {
    $("#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>');
  } else if(currentCategory == "Other") {
    $("#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>');
  }
  
  //Basically a whole new dropdown menu...
    $("#type").parent().find(".trigger").click(function() {
      if ( $("#type").parent().find(".options").attr("class").indexOf("open") >= 0 ) { //if it's open, close it ---------
        var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
        $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
      } else { //If it's closed, open it ----------
        var openClass = $("#type").parent().find(".options").attr("class") + " open"; //get the classes and add "open" to it
        $("#type").parent().find(".options").attr("class", openClass); //replace the classes with the one with "open"
        $("#type").parent().find(".options").find("li").mouseenter(function() {
          var mEClass = $(this).attr("class") + " hover";
          $(this).attr("class", mEClass);
        });
        $("#type").parent().find(".options").find("li").mouseleave(function() {
          var mLClass = $(this).attr("class").replace(" hover", "");
          $(this).attr("class", mLClass);
          mLClass = "";
        });
        $("#type").parent().find(".options").find("li").click(function() {
          $("#type").parent().find(".options").find("li").each(function() {
            $(this).attr("class", "");
          });
          var mCClass = $(this).attr("class") + " selected";
          var select = $(this).text();
          $(this).attr("class", mCClass);
          $("#type").parent().find(".trigger").text(select);
          var openClass = $("#type").parent().find(".options").attr("class").replace(" open", ""); //get the classes and remove "open" from it
          $("#type").parent().find(".options").attr("class", openClass); //set the classes to the one without "open"
          subCatChange();
        });
      }
    });
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址