1859022: onSelector()
has been turned into the SelectorObserver
class to reduce the performance impact on larger sites:
debounce()
function, but is disabled by default)The SelectorObserver.addListener()
method is backwards compatible with the old onSelector()
function, so you can just add the class instance in front (for full backwards compat use document.body
for the baseElement
parameter of the constructor), then change the old function's name and it should work as before.
For more info and examples, please view the SelectorObserver documentation
0db73b5
: Removed the limiter (DynamicsCompressorNode) from amplifyMedia()
for clear and undistorted audio.Notable changes:
source
has been renamed to sourceNode
to fit the naming of the gainNode
propertyenabled
has been added to check if the amplification is enabled or notThe parameter initialMultiplier
has been renamed to initialGain
to reduce confusion (it is not a multiplier strictly speaking)
736784f
: Added function randomId()
to randomly generate cryptographically strong hexadecimal IDs
563e515
: Added utility type NonEmptyArray
for typing an array with at least 1 item
a123da6
: Added @linkcode
references to the JSDoc in-IDE documentation63af1a7
: Change default limiter options to be more balancedb53a946
: Added compression to amplifyMedia()
to prevent audio clipping and distortion and modified return type accordingly:
amplify()
to setGain()
and getAmpLevel()
to getGain()
enable()
, disable()
, setLimiterOptions()
and limiterNode
enable()
must now be called manually after initializing84b37f1
: Added utility type Stringifiable to describe a string or any value that can be converted to one142c5e2
: Added function insertValues() to insert values into a string with placeholders16ce257
: Added lightweight translation systemad17374
: Add support for OpenUserJS049aeb0
: Export ConfigMigrationsDict for easier use with TypeScript4799a9f
: Fix TS error in ConfigManager migration functionsdb5cded
: Added isScrollable()
to check whether an element has a horizontal or vertical scroll bar9e26464
: Replaced most occurrences of HTMLElement
in the docs with Element
for better compatibilitya500a98
: Added ConfigManager to manage persistent user configurations including data versioning and migration6d0a700
: Event interceptor can now be toggled at runtime (#16)d038b21
: Global (IIFE) build now comes with a headerf97dae6
: change bundling process18d4a10
: make npm bundle smalleraa8efbd
: fix documentation54e7905
: Features:
amplifyMedia()
to boost the volume of a MediaElement past its default maximumMutationObserver.observe()
options to be passed to initOnSelector()
Fixes:
onSelector()
not triggering correctly85ec87b
: fix missing export for array functions231a79c
: Refactored code and documentation and added new functions:
mapRange()
to map a number from one range to the same spot in another rangerandRange()
to generate a random number between a min and max boundaryrandomItem()
to return a random item from an arrayrandomItemIndex()
to return a tuple of a random item and its index from an arraytakeRandomItem()
to return a random item from an array and mutate it to remove the itemrandomizeArray()
to return a copy of the array with its items in a random order7edf837
: decrease npm bundle size07ec443
: add getSelectorMap()
to return all currently registered selectors0cf2254
: add onSelector()
to call a listener once a selector is found in the DOMbb60db0
: minor fixes9206f6e
: Initial release - Features:
onSelector()
to call a listener once a selector is found in the DOMautoPlural()
to automatically pluralize a stringclamp()
to clamp a number between a min and max valuepauseFor()
to pause the execution of a function for a given amount of timedebounce()
to call a function only once, after a given amount of timegetUnsafeWindow()
to get the unsafeWindow object or fall back to the regular window objectinsertAfter()
to insert an element as a sibling after another elementaddParent()
to add a parent element around another elementaddGlobalStyle()
to add a global style to the pagepreloadImages()
to preload images into the browser cache for faster loading later onfetchAdvanced()
as a wrapper around the fetch API with a timeout optionopenInNewTab()
to open a link in a new tabinterceptEvent()
to conditionally intercept events registered by addEventListener()
on any given EventTarget objectinterceptWindowEvent()
to conditionally intercept events registered by addEventListener()
on the window object