gazellegames GGN 1click collection add + unfold all filelists

unfolds all filelists | Greasemonkey 4.1: ✕ Tampermonkey 4.4: ✔

  1. // ==UserScript==
  2. // @name gazellegames GGN 1click collection add + unfold all filelists
  3. // @namespace https://gazellegames.net/torrents
  4. // @description unfolds all filelists | Greasemonkey 4.1: ✕ Tampermonkey 4.4: ✔
  5. // @include https://gazellegames.net/torrents.php?id=*
  6. // @version 3.4
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10.  
  11. //unfold stuff
  12. var unfoldLink = document.createElement('a');
  13. var linkText = document.createTextNode('[Unfold all filelists]');
  14. unfoldLink.appendChild(linkText);
  15. unfoldLink.id = 'unfoldLink';
  16. unfoldLink.title = 'Unfold all filelists';
  17. unfoldLink.href = '#';
  18. unfoldLink.setAttribute('onclick', 'unfoldAll()');
  19. document.getElementsByClassName('linkbox groupoptions') [0].appendChild(unfoldLink);
  20.  
  21.  
  22.  
  23.  
  24. var topBox = document.getElementsByClassName('linkbox groupoptions')[0];
  25. topBox.innerHTML = topBox.innerHTML + '<a href="javascript:;" onclick="document.getElementById(\'vr_add\').style.display=\'block\'">[Show Collection Add]</a> <br> <div id="vr_add" style="display:none;"> <br>VR--> <a href="javascript:;" id="vive_excl" >[Vive Excl.]</a> <a href="javascript:;" id="ocul_excl">[Ocul Excl.]</a><a href="javascript:;" id="both_excl">[Both Excl.]</a> <a href="javascript:;" id="ocul_supp">[Ocul Supp.]</a><a href="javascript:;" id="vive_supp">[Vive Supp.]</a><a href="javascript:;" id="both_supp">[Both Vr Supp.]</a><a href="javascript:;" id="osvr_supp_coll" >[osvr]</a><br> <br>Store --> <a href="javascript:;" id="humble_coll">[HUMBLE]</a><a href="javascript:;" id="gog_coll" >[GOG]</a><br><br>Features --> <a href="javascript:;" id="native_gamepad_coll">[Native Gamepad]</a><a href="javascript:;" id="early_access_coll" >[Early Access]</a><a href="javascript:;" id="single_mp_coll" >[Singlescreen MP]</a><a href="javascript:;" id="cracked_online_coll">[Cracked Online]</a><a href="javascript:;" id="lan_supp_coll" >[LAN Supp.]</a><a href="javascript:;" id="loc_mp_supp_coll" >[local MP]</a><a href="javascript:;" id="loc_coop_supp_coll" >[local CO-OP]</a><a href="javascript:;" id="coop_supp_coll" >[CO-OP]</a><br> <br>Themes --> <a href="javascript:;" id="procedural_coll" >[Procedural Gen]</a><a href="javascript:;" id="adult_coll" >[Adult]</a><a href="javascript:;" id="zombie_coll">[Zombie]</a><a href="javascript:;" id="female_prot_coll">[Female Prot.]</a><br><br>Engine --> <a href="javascript:;" id="unreal_coll">[Unreal]</a><a href="javascript:;" id="unity_coll">[Unity]</a></div>';
  26.  
  27.  
  28.  
  29. var ggnAuth = authkey
  30.  
  31.  
  32. document.getElementById('vive_excl').addEventListener('click', vive_excl, false);
  33. document.getElementById('ocul_excl').addEventListener('click', ocul_excl, false);
  34. document.getElementById('both_excl').addEventListener('click', both_excl, false);
  35. document.getElementById('ocul_supp').addEventListener('click', ocul_supp, false);
  36. document.getElementById('vive_supp').addEventListener('click', vive_supp, false);
  37. document.getElementById('both_supp').addEventListener('click', both_supp, false);
  38. document.getElementById('humble_coll').addEventListener('click', humble_coll, false);
  39. document.getElementById('gog_coll').addEventListener('click', gog_coll, false);
  40. document.getElementById('native_gamepad_coll').addEventListener('click', native_gamepad_coll, false);
  41. document.getElementById('early_access_coll').addEventListener('click', early_access_coll, false);
  42. document.getElementById('single_mp_coll').addEventListener('click', single_mp_coll, false);
  43. document.getElementById('cracked_online_coll').addEventListener('click', cracked_online_coll, false);
  44. document.getElementById('lan_supp_coll').addEventListener('click', lan_supp_coll, false);
  45. document.getElementById('procedural_coll').addEventListener('click', procedural_coll, false);
  46. document.getElementById('adult_coll').addEventListener('click', adult_coll, false);
  47. document.getElementById('zombie_coll').addEventListener('click', zombie_coll, false);
  48. document.getElementById('female_prot_coll').addEventListener('click', female_prot_coll, false);
  49. document.getElementById('unity_coll').addEventListener('click', unity_coll, false);
  50. document.getElementById('unreal_coll').addEventListener('click', unreal_coll, false);
  51. document.getElementById('coop_supp_coll').addEventListener('click', coop_supp_coll, false);
  52. document.getElementById('loc_coop_supp_coll').addEventListener('click', loc_coop_supp_coll, false);
  53. document.getElementById('loc_mp_supp_coll').addEventListener('click', loc_mp_supp_coll, false);
  54. document.getElementById('osvr_supp_coll').addEventListener('click', osvr_supp_coll, false);
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. function coop_supp_coll(){
  62. postToColl("961");}
  63. function loc_coop_supp_coll(){
  64. postToColl("962");
  65. postToColl("961");
  66. postToColl("963");}
  67. function loc_mp_supp_coll(){
  68. postToColl("963");}
  69. function osvr_supp_coll(){
  70. postToColl("968");
  71. vr_support();}
  72.  
  73.  
  74.  
  75. function vive_excl(){
  76. postToColl("739");
  77. vr_support();
  78. vr_exclusive();
  79. }
  80. function ocul_excl(){
  81. postToColl("738");
  82. vr_support();
  83. vr_exclusive();
  84. }
  85. function both_excl(){
  86. postToColl("739");
  87. postToColl("738");
  88. vr_support();
  89. vr_exclusive();
  90. }
  91. function ocul_supp(){
  92. postToColl("738");
  93. vr_support();
  94. }
  95. function vive_supp(){
  96. postToColl("739");
  97. vr_support();
  98. }
  99. function both_supp(){
  100. postToColl("739");
  101. postToColl("738");
  102. vr_support();
  103. }
  104. function humble_coll(){postToColl("133");}
  105. function gog_coll(){postToColl("25");}
  106. function native_gamepad_coll(){postToColl("551");}
  107. function early_access_coll(){postToColl("152");}
  108. function single_mp_coll(){postToColl("476");postToColl("963");}
  109. function cracked_online_coll(){postToColl("23");}
  110. function lan_supp_coll(){postToColl("77");postToColl("963");}
  111. function procedural_coll(){postToColl("902");}
  112. function adult_coll(){postToColl("849");}
  113. function zombie_coll(){postToColl("586");}
  114. function female_prot_coll(){postToColl("856");}
  115. function unreal_coll(){postToColl("245");}
  116. function unity_coll(){postToColl("263");}
  117.  
  118.  
  119. function vr_support(){postToColl("559");}
  120. function vr_exclusive(){postToColl("683");}
  121.  
  122. function postToColl(collId){
  123. var http = new XMLHttpRequest();
  124. var url = "collections.php";
  125. var params = "action=add_torrent&auth="+ggnAuth+"&collageid="+collId+"&url="+window.location.href;
  126. http.open("POST", url, true);
  127.  
  128. //Send the proper header information along with the request
  129. http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  130.  
  131. http.onreadystatechange = function() {//Call a function when the state changes.
  132. if(http.readyState == 4 && http.status == 200) {
  133. addSuccess();
  134. return true;
  135. }
  136.  
  137. }
  138. http.send(params);
  139. return true;
  140. }
  141.  
  142. var wholeThing = document.getElementById("content");
  143. function addSuccess(){
  144. wholeThing.innerHTML="GOOD____"+wholeThing.innerHTML;
  145. }
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152. document.getElementById('unfoldLink').addEventListener('click', unfoldAll, false);
  153. var folded = true;
  154. function unfoldAll() {
  155. var torrentGroups = document.getElementsByClassName('pad hidden');
  156. for (var i = 0; i < torrentGroups.length; i++) {
  157. var re = /torrent_(.*)/;
  158. var id = torrentGroups[i].id.match(re) [1];
  159. if (folded == true) {
  160. jQuery('#torrent_' + id).show();
  161. jQuery('#files_' + id).show();
  162. }
  163. else {
  164. jQuery('#torrent_' + id).hide();
  165. jQuery('#files_' + id).hide();
  166. }
  167. }
  168. folded=!folded;
  169. }