Don't mess with my "use subreddit style" toggle (Old Reddit/RES required)

This script always shows RES' "use subreddit style" checkbox in the right of the logout link even if the sub intentionally hides it from the side bar (need RES extension installed)

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Don't mess with my "use subreddit style" toggle (Old Reddit/RES required)
// @author      warireku
// @description This script always shows RES' "use subreddit style" checkbox in the right of the logout link even if the sub intentionally hides it from the side bar (need RES extension installed)
// @include     https://old.reddit.com/r/*
// @license     CC0 1.0 Universal (No Rights Reserved)
// @version     0.1
// @grant       none
// @namespace https://greasyfork.org/users/237709
// ==/UserScript==

//runs when page is fully loaded
window.addEventListener('load', function() {
    var styleBox = document.getElementById("res-style-checkbox");
    //if the res element exists
    if(styleBox !== null){
      styleBox.style.cssText = "display:inline !important; visibility: visible !important";

      var styleForm = document.getElementsByClassName("res-sr-style-toggle");
      var separator = document.getElementsByClassName("separator")[0];
      separator.innerHTML = "|";
      for(var i=0;i<styleForm.length;i++){
        styleForm[i].style.cssText = "display:contents !important; visibility: visible !important; position:absolute !important;";
        document.getElementById("header-bottom-right").appendChild(separator);
        document.getElementById("header-bottom-right").appendChild(styleForm[i]);
      }
		}
}, false);