ErogameScape Remove Uid

エロゲー批評空間のレビューをユーザー条件で非表示

  1. // ==UserScript==
  2. // @name ErogameScape Remove Uid
  3. // @namespace http://blueblueblue.fool.jp/wp/
  4. // @version 3.1
  5. // @description エロゲー批評空間のレビューをユーザー条件で非表示
  6. // @include http://erogamescape*/~ap2/ero/toukei_kaiseki/*
  7. // @copyright 2013-2014, ebi
  8. // ==/UserScript==
  9.  
  10. /* << exit url */
  11. if(location.href.indexOf("loginExe", 0) !== -1) { return };
  12. if(location.href.indexOf("keijiban", 0) !== -1) { return };
  13. if(location.href.indexOf("example", 0) !== -1) { return };
  14. if(location.href.indexOf("memo.php", 0) !== -1) { return };
  15. if(location.href.indexOf("usersql_exec", 0) !== -1) { return };
  16. if(location.href.indexOf("usersql", 0) !== -1) { return };
  17. if(location.href.indexOf("sql_for_erogamer_index", 0) !== -1) { return };
  18. if(location.href.indexOf("sql_for_erogamer_form", 0) !== -1) { return };
  19. if(location.href.indexOf("select.php", 0) !== -1) { return };
  20. if(location.href.indexOf("loginExe", 0) !== -1) { return };
  21. if(location.href.indexOf("keijiban", 0) !== -1) { return };
  22. if(location.href.indexOf("example", 0) !== -1) { return };
  23. if(location.href.indexOf("memo.php", 0) !== -1) { return };
  24. if(location.href.indexOf("select.php", 0) !== -1) { return };
  25. /*if(location.href.indexOf("contents", 0) !== -1) { return };*/
  26. /* exit url >> */
  27.  
  28. function main() {
  29. /* << favorite and dislike */
  30. if(location.href.indexOf("contents_fav_user.php", 0) !== -1 || location.href.indexOf("contents_dis_user.php", 0) !== -1) {
  31. var uid = "";
  32. if(location.href.indexOf("contents_fav_user.php", 0) !== -1){
  33. var lst_uid = "favorite_user_stylesheet<hr>.favorite_user";
  34. } else {
  35. var lst_uid = "dislike_user_stylesheet<hr>.dislike_user";
  36. }
  37. $("tr a[href*='user_infomation.php']").each(function(){
  38. uid = $(this).attr("href").split("user_infomation.php")[1].split("user=")[1].split(/=|&|#/g)[0];
  39. uid = uid.replace(/\./g, "-_-");
  40. uid = uid.replace(/\+/g, "_-_");
  41. uid = uid.replace(/%/g, "--");
  42. lst_uid += ", .uid_" + uid;
  43. });
  44. if(location.href.indexOf("contents_fav_user.php", 0) !== -1){
  45. lst_uid += "{display:block !important; opacity: 1 !important;}";
  46. } else {
  47. lst_uid += "{display:none !important;}";
  48. }
  49. $div = $("<div/>");
  50. $div.html(lst_uid);
  51. $div.css({"color" : "#fff"
  52. , "font-family" : "Arial"
  53. , "font-size" : "9px"
  54. , "text-align" : "center"
  55. , "background" : "rgba(0,0,0,0.8)"
  56. , "margin" : "0"
  57. , "padding" : "2px 0px"
  58. , "width" : "300px"
  59. , "position" : "fixed"
  60. , "top" : "0"
  61. , "right" : "5px"
  62. , "cursor" : "pointer"
  63. , "border-bottom-left-radius" : "5px"
  64. , "border-bottom-right-radius" : "5px"
  65. , "-webkit-border-bottom-left-radius" : "5px"
  66. , "-webkit-border-bottom-right-radius" : "5px"
  67. , "-moz-border-bottom-left-radius" : "5px"
  68. , "-moz-border-bottom-right-radius" : "5px"
  69. });
  70. $("body").append($div);
  71. return;
  72. };
  73. /* favorite and dislike >> */
  74.  
  75. /* cookie */
  76. function read_cookie(name, value){
  77. if (document.cookie) {
  78. var cookies = document.cookie.split("; ");
  79. for (var i = 0; i < cookies.length; i++) {
  80. var str = cookies[i].split("=");
  81. if (str[0] == name) {
  82. value = cookie_value = unescape(str[1]);
  83. break;
  84. }
  85. }
  86. }
  87. return value;
  88. }
  89. /* << config */
  90. var uid = "";
  91. var comment = "";
  92. var comment_arr = new Array();
  93. var body_height = 0;
  94. var count = read_cookie("removeUid_count", 0);
  95. var interval = read_cookie("removeUid_interval", 0);
  96. var type = read_cookie("removeUid_type", "opacity");
  97. /*
  98. var checked = "";
  99. if ( type == "opacity" ) {
  100. checked = "checked";
  101. }
  102. */
  103. var short_length = read_cookie("removeUid_short_length", "0");
  104. var long_length = read_cookie("removeUid_long_length", "0");
  105. var dt = new Date ();
  106. var ver = dt.getFullYear() + ("0"+(dt.getMonth ()+1)).slice (-2) + ("0"+dt.getDate ()).slice (-2);
  107. /* config >> */
  108. /* << DOM create */
  109. $css = $("<link/>");
  110. $css.attr("id", "removeUid_css");
  111. $css.attr("rel", "stylesheet");
  112. $css.attr("type", "text/css");
  113. $css.attr("href", "http://blueblueblue.fool.jp/php/es_uid_css.php?count=" + count + "&interval=" + interval + "&type=" + type + "&ver=" + ver);
  114. $("body").append($css);
  115. $div = $("<div/>");
  116. $div.css({ "color" : "#fff"
  117. , "font-family" : "Arial"
  118. , "font-size" : "9px"
  119. , "text-align" : "center"
  120. , "background" : "rgba(0,0,0,0.8)"
  121. , "margin" : "0"
  122. , "padding" : "2px 0px"
  123. , "width" : "230px"
  124. , "position" : "fixed"
  125. , "top" : "0"
  126. , "left" : "5px"
  127. , "cursor" : "pointer"
  128. , "border-bottom-left-radius" : "5px"
  129. , "border-bottom-right-radius" : "5px"
  130. , "-webkit-border-bottom-left-radius" : "5px"
  131. , "-webkit-border-bottom-right-radius" : "5px"
  132. , "-moz-border-bottom-left-radius" : "5px"
  133. , "-moz-border-bottom-right-radius" : "5px"
  134. , "z-index" : "98"
  135. });
  136. $div.attr("id", "removeUid");
  137. $div.html("remove cnt." + count + " int." + interval + " short." + short_length + " long." + long_length);
  138. $("body").append($div);
  139. $div = $("<div/>");
  140. $div.css({ "background" : "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAI0lEQVQIW2NkwARpjGhiaUD+LGRBsABIEUwQLgATRBEACQIAw+IEbPD2jzoAAAAASUVORK5CYII=) repeat"
  141. , "margin" : "0"
  142. , "padding" : "0px"
  143. , "width" : "5000px"
  144. , "height" : "5000px"
  145. , "position" : "fixed"
  146. , "top" : "0"
  147. , "left" : "0"
  148. , "cursor" : "pointer"
  149. , "z-index" : "99"
  150. , "display" : "none"
  151. });
  152. $div.attr("id", "black-out");
  153. $("body").append($div);
  154.  
  155. $div = $("<div/>");
  156. $div.css({ "color" : "#fff"
  157. , "font-family" : "Arial"
  158. , "font-size" : "12px"
  159. , "text-align" : "left"
  160. , "background" : "rgba(0,0,0,0.8)"
  161. , "margin" : "0"
  162. , "padding" : "2px 10px"
  163. , "width" : "210px"
  164. , "position" : "fixed"
  165. , "top" : "30px"
  166. , "left" : "5px"
  167. , "display" : "none"
  168. , "border-radius" : "5px"
  169. , "border-radius" : "5px"
  170. , "-webkit-border-radius" : "5px"
  171. , "-webkit-border-radius" : "5px"
  172. , "-moz-border-radius" : "5px"
  173. , "-moz-border-radius" : "5px"
  174. , "z-index" : "100"
  175. });
  176. $div.attr("id", "removeUid_config");
  177. $div.html("reviewUid Config<hr />"
  178. + "*感想投稿数<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_count\" value=\"" + count + "\" />(min5)<br />"
  179. + "*投稿期間(日数)<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_interval\" value=\"" + interval + "\" />(min30)<br />"
  180. + "*非表示方法<br />"
  181. + "<input id=\"opacity\" type=\"radio\" name=\"removeUid_type\" value=\"0\"><label>透過</label>"
  182. + "<input id=\"hidden\" type=\"radio\" name=\"removeUid_type\" value=\"1\"><label>非表示</label>"
  183. + "<input id=\"opacity_rev\" type=\"radio\" name=\"removeUid_type\" value=\"2\"><label>透過反転</label>"
  184. + "<br />"
  185. + "*長文感想文字数下限<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_short_length\" value=\"" + short_length + "\" /><br />"
  186. + "*長文感想文字数上限<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_long_length\" value=\"" + long_length + "\" />"
  187. );
  188. /*
  189. $div.html("reviewUid Config<hr />"
  190. + "*review_count<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_count\" value=\"" + count + "\" />(min5)<br />"
  191. + "*review_interval<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_interval\" value=\"" + interval + "\" />(min30)<br />"
  192. + "*review_hide_type<br /><label><input type=\"checkbox\" style=\"margin-left:15px;\" id=\"removeUid_type\" " + checked + "/>opacity</label><br />"
  193. + "*short_review_length<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_short_length\" value=\"" + short_length + "\" /><br />"
  194. + "*long_review_length<br /><input style=\"margin-left:15px;width:50px;\" id=\"removeUid_long_length\" value=\"" + long_length + "\" />"
  195. );
  196. */
  197. $("body").append($div);
  198. $("#" + type).val(['1']);
  199. /* DOM create >> */
  200. /* << event */
  201. /* display event */
  202. $(window).on("load scroll", function(){
  203. if ( body_height !== $("body").height() ) {
  204. var selector_str = "div[class*='game_'], div[class*='uid_'], div.coment > div";
  205. $(selector_str).each( function() {
  206. if ( !$(this).hasClass("us-remove-uid") ) {
  207. $(this).addClass( "us-remove-uid" );
  208. uid = $(this).html().split("user_game.php")[1].split("user=")[1].split(/=|&|#/g)[0];
  209. uid = uid.replace(/\./g, "-_-");
  210. uid = uid.replace(/\+/g, "_-_");
  211. uid = uid.replace(/%/g, "--");
  212. $(this).addClass( "uid_" + uid );
  213. $(this).addClass( "game_" + $(this).html().split("user_game.php")[1].split("game=")[1].split(/=|&|#/g)[0] );
  214. comment = $(".comment1, .comment2, .odd, .even", $(this)).html().replace(/<span.*?\/span>|\n/gi, "");
  215. comment_arr = comment.split(/<br>|<a\shref="memo\.php|<div/);
  216. if ( comment.indexOf("memo.php", 0) == -1 ) {
  217. data_short = comment_arr[1].length;
  218. $(this).attr("data-short-comment", data_short);
  219. } else {
  220. data_short = comment_arr[1].length - 3;
  221. data_long = comment_arr[2].split(/\(|\)/)[1];
  222. $(this).attr("data-short-comment", data_short);
  223. $(this).attr("data-long-comment", data_long);
  224. }
  225. } // if hasClass
  226. $(this).removeClass("hidden_short_comment_length");
  227. $(this).removeClass("hidden_long_comment_length");
  228. if ( short_length !== 0 || long_length !== 0 ) {
  229. if ( $(this).attr("data-short-comment") * 1 < short_length * 1 ) {
  230. $(this).addClass("hidden_short_comment_length");
  231. }
  232. if ( $(this).attr("data-long-comment") * 1 < long_length * 1 ) {
  233. $(this).addClass("hidden_long_comment_length");
  234. }
  235. }
  236. })
  237. var body_height = $("body").height();
  238. }
  239. });
  240.  
  241. /* setting event */
  242. $(document).on("click", "#removeUid", function(){
  243. $("#black-out").show();
  244. $("#removeUid_config").slideToggle("100");
  245. })
  246. $(document).on("click", "#black-out", function(){
  247. $("#black-out").hide();
  248. $("#removeUid_config").slideToggle("100", function(){
  249. count = $("#removeUid_count").val();
  250. if ( count > 0 && count < 5) {
  251. count = 5;
  252. $("#removeUid_config").val(5);
  253. }
  254. interval = $("#removeUid_interval").val();
  255. if ( interval > 0 && interval < 30) {
  256. interval = 30;
  257. $("#removeUid_interval").val(30);
  258. }
  259. document.cookie = "removeUid_count=" + escape(count) + "; expires=Thu, 1-Jan-2030 00:00:00 GMT;"
  260. document.cookie = "removeUid_interval=" + escape(interval) + "; expires=Thu, 1-Jan-2030 00:00:00 GMT;"
  261. type = $('input[name="removeUid_type"]:checked').attr("id");
  262. document.cookie = "removeUid_type=" + type + "; expires=Thu, 1-Jan-2030 00:00:00 GMT;";
  263. short_length = $("#removeUid_short_length").val();
  264. document.cookie = "removeUid_short_length=" + escape(short_length) + "; expires=Thu, 1-Jan-2030 00:00:00 GMT;"
  265. long_length = $("#removeUid_long_length").val();
  266. document.cookie = "removeUid_long_length=" + escape(long_length) + "; expires=Thu, 1-Jan-2030 00:00:00 GMT;"
  267. $("#removeUid").html("remove cnt." + count + " int." + interval + " short." + short_length + " long." + long_length);
  268. $("#removeUid_css").attr("href", "http://blueblueblue.fool.jp/php/es_uid_css.php?count=" + count + "&interval=" + interval + "&type=" + type + "&ver=" + ver);
  269. //check_remove_uid();
  270. });
  271. })
  272. /* event >> */
  273. } //function main()
  274.  
  275. function addJQuery(callback) {
  276. var script = document.createElement("script");
  277. script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js");
  278. script.addEventListener('load', function() {
  279. var script = document.createElement("script");
  280. script.textContent = "(" + callback.toString() + ")();";
  281. document.body.appendChild(script);
  282. }, false);
  283. document.body.appendChild(script);
  284. }
  285. addJQuery(main);