mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2025-08-09 07:45:01 +02:00
embedding support popup
This commit is contained in:
@ -997,6 +997,22 @@ async function getStorageData(key) {
|
||||
});
|
||||
}
|
||||
|
||||
function insertAtCursor(field, text) {
|
||||
if (field.selectionStart || field.selectionStart == "0") {
|
||||
var startPos = field.selectionStart
|
||||
var endPos = field.selectionEnd
|
||||
var before = field.value.substring(0, startPos)
|
||||
var after = field.value.substring(endPos, field.value.length)
|
||||
|
||||
if (!before.endsWith(" ")) { before += " " }
|
||||
if (!after.startsWith(" ")) { after = " "+after }
|
||||
|
||||
field.value = before + text + after
|
||||
} else {
|
||||
field.value += text
|
||||
}
|
||||
}
|
||||
|
||||
// indexedDB debug functions
|
||||
async function getAllKeys() {
|
||||
return openDB().then(db => {
|
||||
|
Reference in New Issue
Block a user