mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-06-23 22:21:54 +08:00
Lexical: Added basic URL field header option list
May show bad option label names on chrome/safari. This was an easy first pass without loads of extra custom UI since we're using native datalists.
This commit is contained in:
@ -84,6 +84,17 @@ export function uniqueId() {
|
||||
return (`${S4() + S4()}-${S4()}-${S4()}-${S4()}-${S4()}${S4()}${S4()}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a random smaller unique ID.
|
||||
*
|
||||
* @returns {string}
|
||||
*/
|
||||
export function uniqueIdSmall() {
|
||||
// eslint-disable-next-line no-bitwise
|
||||
const S4 = () => (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
|
||||
return S4();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a promise that resolves after the given time.
|
||||
* @param {int} timeMs
|
||||
|
Reference in New Issue
Block a user