Auto Load Preferences

Quickly load all of your preferred preferences by pressing CTRL + M

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Auto Load Preferences
// @namespace   Ultrabox Scripts
// @match       https://ultraabox.github.io/
// @match       https://aurysystem.github.io/goldbox/
// @match       https://jummb.us/
// @grant       none
// @version     1.0.1
// @author      PlanetBluto
// @description Quickly load all of your preferred preferences by pressing CTRL + M
// @license     MIT
// ==/UserScript==

const SETTINGS = {
  autoPlay: false,
  // autoFollow: false,
  enableNotePreview: true,
  showLetters: true,
  showFifth: true,
  notesOutsideScale: false,
  setDefaultScale: true,
  showChannels: true,
  showScrollBar: true,
  alwaysFineNoteVol: true,
  enableChannelMuting: true,
  displayBrowserUrl: true,
  displayVolumeBar: true,
  showOscilloscope: true,
  showSampleLoadingStatus: true
}

const print = console.log

var inited = false

var toggleFunc = (elem, key) => {
    elem.value = key
    elem.dispatchEvent(new Event("change"))

    print(`${key}: `, localStorage.getItem(key))
}

var int = setInterval(() => {
  var selectElem = document.querySelector(".selectContainer.menu.preferences > select")
  if (selectElem) {
    clearInterval(int)

    document.addEventListener("keydown", e => {
      if (e.which == 77 && e.ctrlKey) {
        Object.keys(SETTINGS).forEach(key => {
          localStorage.setItem(key, `${SETTINGS[key]}`)
        })

        location.reload()
      }
    })
  }
}, 10)