Subscene Language Filter

Filter Your Language in Subscene

  1. // ==UserScript==
  2. // @name Subscene Language Filter
  3. // @namespace https://greasyfork.org/en/users/175554-reissfeld
  4. // @version 1.1
  5. // @description Filter Your Language in Subscene
  6. // @author Reissfeld
  7. // @match https://subscene.com/*
  8. // @match https://u.subscene.com/*
  9. // @icon https://www.google.com/s2/favicons?domain=subscene.com
  10. // @require https://openuserjs.org/src/libs/sizzle/GM_config.js
  11. // @require https://code.jquery.com/jquery-3.6.0.min.js
  12. // @grant GM_getValue
  13. // @grant GM_setValue
  14. // @grant GM_registerMenuCommand
  15. // @run-at document-start
  16. // @license MIT
  17. /* globals $, GM_config */
  18. // ==/UserScript==
  19. 'use strict';
  20. var darkm = `body {
  21. background-image: none;
  22. background-color: #111;
  23. color: #aaa;
  24. border-bottom: 130px solid #111
  25. }
  26.  
  27. #logo em {
  28. background: url("/content/images/logo-dark.gif") no-repeat scroll 0 0 transparent
  29. }
  30.  
  31. #search .text {
  32. border-color: #222628 #333 #222628 #333;
  33. background-color: #000;
  34. color: #eee
  35. }
  36.  
  37. #user-navigation,
  38. #forum-navigation,
  39. #admin-navigation {
  40. background: #000
  41. }
  42.  
  43. hr {
  44. border-top: 1px solid #444
  45. }
  46.  
  47. .poster {
  48. min-width: 106px;
  49. min-height: 132px;
  50. background: #000;
  51. border: solid 1px #222
  52. }
  53.  
  54. .content {
  55. border-top: 0
  56. }
  57.  
  58. .subtitles table {
  59. background-color: #000;
  60. width: 100%
  61. }
  62.  
  63. .subtitles thead {
  64. background: #000;
  65. color: #eee
  66. }
  67.  
  68. .subtitles td.a1 a:visited,
  69. .subtitles td.a1 .visited {
  70. background-color: #333;
  71. color: #999
  72. }
  73.  
  74. .subtitles td.a1 a:link {
  75. display: block;
  76. background-color: #000;
  77. color: #999
  78. }
  79.  
  80. .subtitles td.a1 a:hover {
  81. background-color: #333;
  82. cursor: pointer
  83. }
  84.  
  85. .byFilm .rating-guide span.visited {
  86. background: #333;
  87. border: 2px solid #000
  88. }
  89.  
  90. .byFilm .sort-by {
  91. background-color: #333;
  92. border: 1px solid #000;
  93. color: #999
  94. }
  95.  
  96. .subtitle .comment {
  97. -moz-box-shadow: inset -1px -2px 5px #333;
  98. -webkit-box-shadow: inset 1px 2px 5px #333;
  99. box-shadow: inset -1px -2px 5px #333;
  100. background: #000;
  101. color: #ccc
  102. }
  103.  
  104. .subtitle .comment:before {
  105. background: none
  106. }
  107.  
  108. .subtitles td a {
  109. color: #00599e
  110. }
  111.  
  112. .subtitles td a:hover {
  113. color: #0090ff
  114. }
  115.  
  116. .subtitles td.a41 {
  117. background: url('/content/images/icon-hearing-impaired-dark.png') no-repeat 0 5px
  118. }
  119.  
  120. .window {
  121. background: #062433;
  122. border-top: 1px solid #333
  123. }
  124.  
  125. .bread a,
  126. .bread a:visited {
  127. color: #00599e
  128. }
  129.  
  130. a,
  131. a:link {
  132. color: #00599e;
  133. text-decoration: none;
  134. cursor: pointer
  135. }
  136.  
  137. a:visited {
  138. color: #00599e
  139. }
  140.  
  141. a:hover {
  142. color: #0090ff
  143. }
  144.  
  145. .pagination>li>a,
  146. .pagination>li>span {
  147. background-color: #000;
  148. border: 1px solid #444
  149. }
  150.  
  151. .pagination>.disabled>a,
  152. .pagination>.disabled>a:focus,
  153. .pagination>.disabled>a:hover,
  154. .pagination>.disabled>span,
  155. .pagination>.disabled>span:focus,
  156. .pagination>.disabled>span:hover {
  157. background-color: #000;
  158. border-color: #444;
  159. color: #777
  160. }
  161.  
  162. .pagination>li>a:hover,
  163. .pagination>li>span:hover,
  164. .pagination>li>a:focus,
  165. .pagination>li>span:focus {
  166. background-color: #444
  167. }
  168.  
  169. .pagination>.active>a,
  170. .pagination>.active>span,
  171. .pagination>.active>a:hover,
  172. .pagination>.active>span:hover,
  173. .pagination>.active>a:focus,
  174. .pagination>.active>span:focus {
  175. color: #dedede;
  176. background-color: #000
  177. }
  178.  
  179. .btn-default {
  180. color: #333;
  181. background-color: #aaa;
  182. border-color: #555
  183. }
  184.  
  185. .btn-default:hover {
  186. background-color: #e6e6e6;
  187. border-color: #000
  188. }
  189.  
  190. .dropdown-menu {
  191. background-color: #aaa;
  192. border: 1px solid #555;
  193. border: 1px solid rgba(0, 0, 0, .15)
  194. }
  195.  
  196. .nav>li>a:hover,
  197. .nav>li>a:focus {
  198. background-color: #333
  199. }
  200.  
  201. .panel-default {
  202. border-color: #ddd
  203. }
  204.  
  205. .panel {
  206. background-color: #000;
  207. border: 1px solid #333;
  208. -webkit-box-shadow: none;
  209. box-shadow: none
  210. }
  211.  
  212. .form-control {
  213. color: #dedede;
  214. background-color: #000;
  215. border: 1px solid #444
  216. }
  217.  
  218. .sand-box {
  219. background-color: #000
  220. }
  221.  
  222. .sand-box>ul>li,
  223. .sand-box .area {
  224. background-color: #222;
  225. border-bottom: 1px solid #000
  226. }
  227.  
  228. #messageCount.badge {
  229. background-color: #000
  230. }
  231.  
  232. .my-recent-messages {
  233. background-color: #000
  234. }
  235.  
  236. .message-view {
  237. background-color: #000
  238. }
  239.  
  240. .message-view .list-group-item-sender {
  241. background-color: #222
  242. }
  243.  
  244. .list-group-item {
  245. background-color: #000;
  246. border: 1px solid #444
  247. }
  248.  
  249. .ratings ul {
  250. background-color: #000
  251. }
  252.  
  253. .ratings ul>li {
  254. background-color: #222;
  255. border-bottom: 1px solid #000
  256. }
  257.  
  258. .user-home .subtitles .list {
  259. background-color: #000
  260. }
  261.  
  262. .user-home .subtitles ul>li,
  263. .user-home .footer {
  264. background-color: #222;
  265. border-bottom: 1px solid #000
  266. }
  267.  
  268. .posts .post {
  269. -moz-box-shadow: none;
  270. -webkit-box-shadow: none;
  271. box-shadow: none;
  272. border: 1px solid #333;
  273. color: #dedede;
  274. background: #000
  275. }
  276.  
  277. .posts .post:before {
  278. background: none
  279. }
  280.  
  281. footer {
  282. background: #000
  283. }
  284.  
  285. .sustain {
  286. border-bottom: solid 1px #444
  287. }
  288. .byTitle .search-result{
  289. background-color: #3e351f !important;
  290. }`
  291. function addGlobalStyle(css) {
  292. var head, style;
  293. head = document.getElementsByTagName('head')[0];
  294. if (!head) { return; }
  295. style = document.createElement('style');
  296. style.type = 'text/css';
  297. style.innerHTML = css;
  298. style.setAttribute('class','gelap')
  299. head.appendChild(style);
  300. }
  301. GM_config.init(
  302. {
  303. 'id': 'Aturan',
  304. 'title': 'Settings',
  305. 'frameStyle': {
  306. width: '480px'
  307. },
  308. 'fields': {
  309. 'Filter': {
  310. 'label': 'Language to Filter (Case Sensitive)',
  311. 'type': 'text'
  312. },
  313. 'DarkRadio': {
  314. 'label': ' Dark Mode',
  315. 'type': 'radio',
  316. 'options': ['Yes','No'],
  317. 'default': 'No'
  318. },
  319. 'DarkEdit': {
  320. 'type': 'textarea',
  321. 'default': darkm
  322. }
  323. },
  324. 'events': {
  325. 'save': simpan,
  326. 'close': tutup,
  327. 'reset': function() { alert('Save & Close after Resetting'); }
  328. },
  329. 'css': '#Aturan_field_DarkEdit{margin: 0px 0px 0px 0px;width: 100%;height: 50%;}'
  330. }
  331. )
  332. function simpan() {
  333. jalan()
  334. modegelap()
  335. }
  336. function pengaturan(){
  337. GM_config.open()
  338. }
  339. function tutup(){
  340. jalan()
  341. modegelap()
  342. }
  343. GM_registerMenuCommand('Add Filter', pengaturan);
  344.  
  345. function modegelap(){
  346. if(GM_config.get('DarkRadio') == 'Yes'){
  347. addGlobalStyle(GM_config.get('DarkEdit'))
  348. }else{
  349. document.querySelector('.gelap').remove()
  350. }
  351. }
  352. modegelap()
  353. function jalan(){
  354. var lang = document.querySelectorAll('.l.r')
  355. var langstart = document.querySelectorAll('.language-start')
  356. for(let i = 0; i < lang.length; i++){
  357. if(langstart.length > i){
  358. langstart[i].parentElement.style = 'display:none;'
  359. }
  360. if(!lang[i].innerText.includes(GM_config.get('Filter'))){
  361. lang[i].parentElement.parentElement.parentElement.style = 'display:none;'
  362.  
  363. }
  364. if(lang[i].innerText.includes(GM_config.get('Filter'))){
  365. lang[i].parentElement.parentElement.parentElement.style = 'display:table-row;'
  366. }
  367. }
  368. }
  369. window.addEventListener('load', function() {
  370. jalan()
  371. }, false);