瀏覽代碼

fix: userutils docs links

Sv443 3 月之前
父節點
當前提交
b629fe813c
共有 3 個文件被更改,包括 7 次插入7 次删除
  1. 4 4
      changelog.md
  2. 2 2
      contributing.md
  3. 1 1
      src/dev/discoveries.md

+ 4 - 4
changelog.md

@@ -125,7 +125,7 @@
   - Added Storybook for easier and faster development of components
   - Added Storybook for easier and faster development of components
   - Removed the `@updateURL` and `@downloadURL` directives because their use is controversial and the script has a built-in update check now
   - Removed the `@updateURL` and `@downloadURL` directives because their use is controversial and the script has a built-in update check now
   - Migrated to pnpm for faster compilation times
   - Migrated to pnpm for faster compilation times
-  - Moved `NanoEmitter` class over to the [UserUtils library](https://github.com/Sv443-Network/UserUtils#nanoemitter) (it is still re-exported by the plugin interface as before)
+  - Moved `NanoEmitter` class over to the [UserUtils library](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#nanoemitter) (it is still re-exported by the plugin interface as before)
   - Made `getThumbnailUrl()` and `getBestThumbnailUrl()` use the domain `youtube.com` to prevent cross-origin issues
   - Made `getThumbnailUrl()` and `getBestThumbnailUrl()` use the domain `youtube.com` to prevent cross-origin issues
   - Added custom error instances `LyricsError` and `PluginError` for better error handling using `instanceof`
   - Added custom error instances `LyricsError` and `PluginError` for better error handling using `instanceof`
   - Changed the feature identifier key for `showVotesFormat` to `numbersFormat` as it is now generic and available to plugins through the `formatNumber()` function
   - Changed the feature identifier key for `showVotesFormat` to `numbersFormat` as it is now generic and available to plugins through the `formatNumber()` function
@@ -173,7 +173,7 @@
       - `bytm:siteEvent:pathChanged` - emitted whenever the URL path (`location.pathname`) changes
       - `bytm:siteEvent:pathChanged` - emitted whenever the URL path (`location.pathname`) changes
     - Now the event `bytm:siteEvent:fullscreenToggled` is only emitted once per fullscreen change
     - Now the event `bytm:siteEvent:fullscreenToggled` is only emitted once per fullscreen change
     - Renamed event `bytm:initPlugins` to `bytm:registerPlugin` to be more consistent
     - Renamed event `bytm:initPlugins` to `bytm:registerPlugin` to be more consistent
-    - Changed `event` property returned by `registerPlugin()` from nanoevents Emitter to NanoEmitter instance (see [the UserUtils docs](https://github.com/Sv443-Network/UserUtils#nanoemitter))  
+    - Changed `event` property returned by `registerPlugin()` from nanoevents Emitter to NanoEmitter instance (see [the UserUtils docs](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#nanoemitter))  
       In practice this changes nothing, but it benefits from plugins having access to the additional methods `once()` for immediately unsubscribing from an event after it was emitted once and `unsubscribeAll()` to remove all event listeners.
       In practice this changes nothing, but it benefits from plugins having access to the additional methods `once()` for immediately unsubscribing from an event after it was emitted once and `unsubscribeAll()` to remove all event listeners.
 
 
 </details>
 </details>
@@ -211,7 +211,7 @@
 
 
 - **Internal Changes:**
 - **Internal Changes:**
   - Improved script performance
   - Improved script performance
-    - Implemented new [SelectorObserver](https://github.com/Sv443-Network/UserUtils#selectorobserver) instances to improve overall performance by quite a lot
+    - Implemented new [SelectorObserver](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#selectorobserver) instances to improve overall performance by quite a lot
       - Implemented rising-edge debounce for SelectorObserver instances to massively improve responsiveness
       - Implemented rising-edge debounce for SelectorObserver instances to massively improve responsiveness
     - Added a cache to save lyrics in. Up to 1000 of the most listened to songs are saved throughout sessions for 30 days to save time and reduce server load.
     - Added a cache to save lyrics in. Up to 1000 of the most listened to songs are saved throughout sessions for 30 days to save time and reduce server load.
   - Implemented new class BytmDialog for less duplicate code, better maintainability, the ability to make more menus easier and for them to have better accessibility
   - Implemented new class BytmDialog for less duplicate code, better maintainability, the ability to make more menus easier and for them to have better accessibility
@@ -219,7 +219,7 @@
   - Expanded plugin interface
   - Expanded plugin interface
     - Added function to register plugins (see [contributing guide](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#registerplugin))  
     - Added function to register plugins (see [contributing guide](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#registerplugin))  
       All plugins that are not registered will have restricted access to the BetterYTM API (subject to change in the future).
       All plugins that are not registered will have restricted access to the BetterYTM API (subject to change in the future).
-    - Plugins are now given access to the classes [`BytmDialog`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#bytmdialog) and [`NanoEmitter`](https://github.com/Sv443-Network/UserUtils#nanoemitter), and the functions [`onInteraction()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#oninteraction), [`getThumbnailUrl()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#getthumbnailurl), [`getBestThumbnailUrl()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#getbestthumbnailurl) [`createHotkeyInput()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createhotkeyinput), [`createToggleInput()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createtoggleinput) and [`createCircularBtn()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createcircularbtn)
+    - Plugins are now given access to the classes [`BytmDialog`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#bytmdialog) and [`NanoEmitter`](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#nanoemitter), and the functions [`onInteraction()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#oninteraction), [`getThumbnailUrl()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#getthumbnailurl), [`getBestThumbnailUrl()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#getbestthumbnailurl) [`createHotkeyInput()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createhotkeyinput), [`createToggleInput()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createtoggleinput) and [`createCircularBtn()`](https://github.com/Sv443/BetterYTM/blob/main/contributing.md#createcircularbtn)
   - Added an experimental fuzzy filtering algorithm when fetching lyrics to eventually yield more accurate results (hidden behind advanced mode because it's far from perfect)
   - Added an experimental fuzzy filtering algorithm when fetching lyrics to eventually yield more accurate results (hidden behind advanced mode because it's far from perfect)
   - Resource URL versioning was improved, so all versions from now on will still work in the future when the URLs potentially change
   - Resource URL versioning was improved, so all versions from now on will still work in the future when the URLs potentially change
 
 

+ 2 - 2
contributing.md

@@ -758,7 +758,7 @@ The usage and example blocks on each are written in TypeScript but can be used i
 >   
 >   
 > The instances are chained together in a way that the least specific observer is the parent of the more specific ones.  
 > The instances are chained together in a way that the least specific observer is the parent of the more specific ones.  
 > This is done to limit the amount of checks that need to be run, especially on pages with a lot of dynamic content and if `continuous` listeners are used.  
 > This is done to limit the amount of checks that need to be run, especially on pages with a lot of dynamic content and if `continuous` listeners are used.  
-> See the [UserUtils SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils#selectorobserver) for more info and example code.  
+> See the [UserUtils SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#selectorobserver) for more info and example code.  
 >   
 >   
 > ⚠️ Due to this chained architecture, the selector you pass can only start with an element that is a child of the observer's base element.  
 > ⚠️ Due to this chained architecture, the selector you pass can only start with an element that is a child of the observer's base element.  
 > If you provide a selector that starts higher up or directly on the base element, the listener will never be called.  
 > If you provide a selector that starts higher up or directly on the base element, the listener will never be called.  
@@ -767,7 +767,7 @@ The usage and example blocks on each are written in TypeScript but can be used i
 > Arguments:  
 > Arguments:  
 > - `observerName` - The name of the SelectorObserver instance to add the listener to. You can find all available instances and which base element they observe in the file [`src/observers.ts`](src/observers.ts)
 > - `observerName` - The name of the SelectorObserver instance to add the listener to. You can find all available instances and which base element they observe in the file [`src/observers.ts`](src/observers.ts)
 > - `selector` - The CSS selector to observe for changes.
 > - `selector` - The CSS selector to observe for changes.
-> - `options` - The options for the listener. See the [UserUtils SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils#selectorobserver)
+> - `options` - The options for the listener. See the [UserUtils SelectorObserver documentation](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#selectorobserver)
 >   
 >   
 > <details><summary><b>Example <i>(click to expand)</i></b></summary>
 > <details><summary><b>Example <i>(click to expand)</i></b></summary>
 > 
 > 

+ 1 - 1
src/dev/discoveries.md

@@ -2,7 +2,7 @@
 
 
 ### The problem with userscripts and SPAs:
 ### The problem with userscripts and SPAs:
 YTM is an SPA (single page application), meaning navigating to a different part of the site doesn't trigger the website, and by extension userscripts, to entirely reload like traditional redirects on MPAs (multi-page applications).  
 YTM is an SPA (single page application), meaning navigating to a different part of the site doesn't trigger the website, and by extension userscripts, to entirely reload like traditional redirects on MPAs (multi-page applications).  
-This means userscripts like BetterYTM rely on detecting changes in the DOM using something like the [MutationObserver API](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) (see the file [`src/observers.ts`](../observers.ts)) and [the SelectorObserver documentation.](https://github.com/Sv443-Network/UserUtils#selectorobserver)  
+This means userscripts like BetterYTM rely on detecting changes in the DOM using something like the [MutationObserver API](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) (see the file [`src/observers.ts`](../observers.ts)) and [the SelectorObserver documentation.](https://github.com/Sv443-Network/UserUtils/blob/main/docs.md#selectorobserver)  
 This causes a LOT of headaches (race conditions, detecting navigation, state consistency, performance impacts and more) but it's the only option as far as I'm aware.
 This causes a LOT of headaches (race conditions, detecting navigation, state consistency, performance impacts and more) but it's the only option as far as I'm aware.
 
 
 <br>
 <br>