Discourse Topic Quick Switcher

Enhance Discourse forums with instant topic switching, current topic highlighting, and smart theme detection

目前為 2025-09-28 提交的版本,檢視 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

作者
Pipecraft
評價
0 0 0
版本
0.1.2
建立日期
2025-09-28
更新日期
2025-09-28
尺寸
37.5 KB
授權條款
MIT
腳本執行於

Discourse Topic Quick Switcher

A powerful user script that brings seamless topic navigation, intelligent current topic highlighting, and adaptive theme switching to Discourse forums. Browse your favorite forums with unprecedented speed and efficiency.

Features

  • Topic List Caching: Automatically caches the topic list when you visit a list page.
  • Quick Access: Access the cached list from any topic page via:
    • A floating button in the bottom-right corner
    • A keyboard shortcut (backtick key `)
  • User-Friendly Interface:
    • Displays cache time and source information
    • Navigate directly to topics from the popup panel
    • Close with the ESC key, a close button, or by clicking outside the panel
    • Highlights the current topic for easy identification
    • Automatically scrolls to the current topic in the list
  • Smart Theme Detection:
    • Automatically adapts to light/dark mode based on system and site preferences
  • Cache Management:
    • 1-hour cache expiration with a visual indicator
    • Source link to return to the original list page

Installation

  1. Install a user script manager like Tampermonkey or Violentmonkey
  2. Click here to install this script
  3. Visit any Discourse forum and enjoy the enhanced navigation experience!

Usage

  1. Cache a Topic List:

    • Visit any Discourse forum topic list page (Latest, New, Categories, etc.)
    • The script will automatically cache the current list
  2. View the Cached List:

    • While viewing a topic, you can:
      • Click the floating button in the bottom-right corner
      • Press the backtick key (`)
    • A popup will appear showing the cached topic list
  3. Navigate Between Topics:

    • Click any topic in the popup to navigate to it
    • The popup will automatically close after selection
  4. Close the Popup:

    • Click the × button
    • Press the ESC key
    • Click outside the popup

Configuration

You can modify the following settings at the top of the script:

const CONFIG = {
  // Keyboard shortcut (default: backtick key)
  HOTKEY: '`',
  // Cache key name
  CACHE_KEY: 'discourse_topic_list_cache',
  // Cache expiration time (in milliseconds) - 1 hour
  CACHE_EXPIRY: 60 * 60 * 1000,
  // Whether to show the floating button on topic pages
  SHOW_FLOATING_BUTTON: true,
  // Route check interval (in milliseconds)
  ROUTE_CHECK_INTERVAL: 500,
  // Whether to automatically follow system dark mode
  AUTO_DARK_MODE: true,
}

Compatibility

This script is designed for all Discourse forums and has been tested on the following browsers:

  • Chrome
  • Firefox
  • Safari

Release Notes

v0.1.0

  • Initial release
  • Basic topic list caching functionality
  • Floating button for quick access
  • Keyboard shortcut support
  • Cache expiration indicator
  • Added current topic highlighting
  • Added auto-scrolling to the current topic
  • Added closing the list by clicking outside of it
  • Improved dark mode support with automatic theme detection

License

MIT License - see the LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a pull request.