Skip to content

Commit 37d41b0

Browse files
committed
Renamed toolbarMenu to gmToolbarMenu
1 parent e7dc469 commit 37d41b0

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

block-quora-poe/block-quora-poe.user.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// @description:zh-TW 阻止 AI + Quora 的推廣/贊助答案
1414
// @author Adam Lui
1515
// @namespace https://github.com/adamlui
16-
// @version 2026.7.25
16+
// @version 2026.7.28
1717
// @license MIT
1818
// @icon https://cdn.jsdelivr.net/gh/adamlui/userscripts@f3e6bf0/assets/images/icons/sites/quora/icon64.png
1919
// @match *://*.quora.com/*
@@ -104,7 +104,7 @@
104104

105105
// Define MENU functions
106106

107-
const toolbarMenu = {
107+
window.gmToolbarMenu = {
108108
state: {
109109
symbols: ['❌', '✔️'], separator: env.scriptManager.name == 'Tampermonkey' ? ' — ' : ': ',
110110
words: ['OFF', 'ON']
@@ -497,7 +497,7 @@
497497
vpYoffset = 23, vpXoffset = 27 // px offset from viewport border
498498

499499
// Strip state word to append colored one later
500-
const foundState = toolbarMenu.state.words.find(word => msg.includes(word))
500+
const foundState = gmToolbarMenu.state.words.find(word => msg.includes(word))
501501
if (foundState) msg = msg.replace(foundState, '')
502502

503503
// Create/append notification div
@@ -615,7 +615,7 @@
615615
}
616616
const styledStateSpan = dom.create.elem('span')
617617
styledStateSpan.style.cssText = stateStyles[
618-
foundState == toolbarMenu.state.words[0] ? 'off' : 'on'][env.ui.scheme]
618+
foundState == gmToolbarMenu.state.words[0] ? 'off' : 'on'][env.ui.scheme]
619619
styledStateSpan.append(foundState) ; notif.append(styledStateSpan)
620620
}
621621

@@ -865,7 +865,7 @@
865865
}
866866
}
867867

868-
window.sync = { configToUI() { styles.update({ key: 'tweaks' }) ; toolbarMenu.refresh() }}
868+
window.sync = { configToUI() { styles.update({ key: 'tweaks' }) ; gmToolbarMenu.refresh() }}
869869

870870
window.updateCheck = () => env.xhr({
871871
method: 'GET', url: `${app.urls.update.gm}?t=${Date.now()}`,
@@ -891,7 +891,7 @@
891891

892892
// Run MAIN routine
893893

894-
toolbarMenu.register()
894+
gmToolbarMenu.register()
895895

896896
// Create/append STYLES
897897
styles.update({ key: 'tweaks' })

eslint.config.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,15 @@ export default [
1717
app: 'writable', browserAPI: 'readonly', buttons: 'writable', chatbar: 'writable', chatgpt: 'readonly',
1818
checkBtnsToClick: 'readonly', config: 'writable', CryptoJS: 'readonly', cryptoUtils: 'readonly',
1919
css: 'readonly', dom: 'readonly', env: 'writable', expFlags: 'readonly', feedback: 'readonly',
20-
fontSizeSlider: 'writable', get: 'readonly', GM_cookie: 'readonly', gmToolbarMenu: 'readonly',
20+
fontSizeSlider: 'writable', get: 'readonly', GM_cookie: 'readonly', gmToolbarMenu: 'writable',
2121
hljs: 'readonly', i18n: 'readonly', icons: 'writable', infinity: 'readonly', inputEvents: 'readonly',
2222
ipv4: 'readonly', JSON5: 'readonly', log: 'readonly', marked: 'readonly', menus: 'writable',
2323
modals: 'writable', msgChain: 'writable', notify: 'readonly', prompts: 'readonly',
2424
renderMathInElement: 'readonly', replyBubble: 'writable', session: 'readonly', settings: 'writable',
2525
show: 'readonly', sites: 'writable', string: 'readonly', styles: 'writable', sync: 'readonly',
2626
syncConfigToUI: 'readonly', themes: 'readonly', toggle: 'readonly', toggleMode: 'readonly',
27-
toggles: 'writable', Tone: 'readonly', toolbarMenu: 'writable', tooltip: 'writable', ui: 'readonly',
28-
update: 'readonly', updateCheck: 'readonly', userscript: 'readonly', webkitAudioContext: 'readonly',
29-
xhr: 'readonly'
27+
toggles: 'writable', Tone: 'readonly', tooltip: 'writable', ui: 'readonly', update: 'readonly',
28+
updateCheck: 'readonly', userscript: 'readonly', webkitAudioContext: 'readonly', xhr: 'readonly'
3029
}
3130
},
3231
plugins: { 'import-x': importPlugin, 'js-styles': stylisticJS, regexp },

0 commit comments

Comments
 (0)