Compare commits

..

No commits in common. "6070bde413f936c6fac5b2d898c8c056192e8960" and "e4b6c81024896d3d4ce3780582a69d370a1696d6" have entirely different histories.

4 changed files with 25 additions and 9 deletions

View File

@ -1,5 +1,5 @@
{ {
"type": "tildefriends-app", "type": "tildefriends-app",
"emoji": "🐌", "emoji": "🐌",
"previous": "&RGDjjNsX3jYJFpOcDyI+LH2qmscuY0q8gP4dyJjOtww=.sha256" "previous": "&zRv7YNZBT/NoliiTS7Jn/Q+3przdFZljUl8yPBIpSSE=.sha256"
} }

View File

@ -291,7 +291,6 @@ class TfComposeElement extends LitElement {
); );
} }
let tribute = new Tribute({ let tribute = new Tribute({
iframe: this.shadowRoot,
collection: [ collection: [
{ {
values: values, values: values,
@ -326,7 +325,6 @@ class TfComposeElement extends LitElement {
let encrypt = this.renderRoot.getElementById('encrypt_to'); let encrypt = this.renderRoot.getElementById('encrypt_to');
if (encrypt) { if (encrypt) {
let tribute = new Tribute({ let tribute = new Tribute({
iframe: this.shadowRoot,
values: Object.entries(this.users).map((x) => ({ values: Object.entries(this.users).map((x) => ({
key: x[1].name, key: x[1].name,
value: x[0], value: x[0],

View File

@ -483,8 +483,8 @@ class TributeRange {
getDocument() { getDocument() {
let iframe; let iframe;
if (this.tribute.current.collection[0].iframe) { if (this.tribute.current.collection) {
iframe = this.tribute.current.collection[0].iframe; iframe = this.tribute.current.collection.iframe;
} }
if (!iframe) { if (!iframe) {
@ -653,8 +653,8 @@ class TributeRange {
} }
getWindowSelection() { getWindowSelection() {
if (this.tribute.collection[0].iframe) { if (this.tribute.collection.iframe) {
return this.tribute.collection[0].iframe.getSelection() return this.tribute.collection.iframe.contentWindow.getSelection()
} }
return window.getSelection() return window.getSelection()

View File

@ -815,6 +815,24 @@ function setGlobalSettings(settings) {
} }
} }
/**
* TODOC
* @param {*} data
* @param {*} bytes
* @returns
*/
function startsWithBytes(data, bytes) {
if (data.byteLength >= bytes.length) {
let dataBytes = new Uint8Array(data.slice(0, bytes.length));
for (let i = 0; i < bytes.length; i++) {
if (dataBytes[i] !== bytes[i] && bytes[i] !== null) {
return;
}
}
return true;
}
}
/** /**
* TODOC * TODOC
* @param {*} response * @param {*} response
@ -1145,8 +1163,8 @@ async function blobHandler(request, response, blobId, uri) {
} }
let app_object = JSON.parse(utf8Decode(await getBlobOrContent(app_id))); let app_object = JSON.parse(utf8Decode(await getBlobOrContent(app_id)));
id = app_object?.files[uri.substring(1)]; id = app_object.files[uri.substring(1)];
if (!id && app_object?.files['handler.js']) { if (!id && app_object.files['handler.js']) {
let answer; let answer;
try { try {
answer = await useAppHandler( answer = await useAppHandler(