diff options
author | bobzel <zzzman@gmail.com> | 2021-08-30 12:34:13 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-08-30 12:34:13 -0400 |
commit | 1c3b334de7c1a34075b71569e800b7ce7c5d41a5 (patch) | |
tree | b3f8fcb88090d93f45febcd2f26cbb3a8641ab21 | |
parent | 962a1a3f1ae9a55c5aea630d3252cecb740fa15c (diff) |
fixed web pages so that you can type into input fields. changed default webpage to use bing.com url.
-rw-r--r-- | src/Utils.ts | 3 | ||||
-rw-r--r-- | src/client/util/CurrentUserUtils.ts | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/Utils.ts b/src/Utils.ts index 8054245f5..3fffadb6d 100644 --- a/src/Utils.ts +++ b/src/Utils.ts @@ -577,7 +577,7 @@ export function simulateMouseClick(element: Element | null | undefined, x: numbe export function lightOrDark(color: any) { const nonAlphaColor = color.startsWith("#") ? (color as string).substring(0, 7) : - color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color; + color.startsWith("rgba") ? color.replace(/,.[^,]*\)/, ")").replace("rgba", "rgb") : color; const col = Color(nonAlphaColor).rgb(); const colsum = (col.red() + col.green() + col.blue()); if (colsum / col.alpha() > 400 || col.alpha() < 0.25) return Colors.DARK_GRAY; @@ -586,6 +586,7 @@ export function lightOrDark(color: any) { export function getWordAtPoint(elem: any, x: number, y: number): string | undefined { + if (elem.tagName === "INPUT") return "input"; if (elem.nodeType === elem.TEXT_NODE) { const range = elem.ownerDocument.createRange(); range.selectNodeContents(elem); diff --git a/src/client/util/CurrentUserUtils.ts b/src/client/util/CurrentUserUtils.ts index bba7616e8..ef24acf6d 100644 --- a/src/client/util/CurrentUserUtils.ts +++ b/src/client/util/CurrentUserUtils.ts @@ -500,7 +500,7 @@ export class CurrentUserUtils { ((doc.emptyButton as Doc).proto as Doc)["dragFactory-count"] = 0; } if (doc.emptyWebpage === undefined) { - doc.emptyWebpage = Docs.Create.WebDocument("", { title: "webpage", _nativeWidth: 850, _height: 512, _width: 400, useCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) }); + doc.emptyWebpage = Docs.Create.WebDocument("http://www.bing.com/", { title: "webpage", _nativeWidth: 850, _height: 512, _width: 400, useCors: true, system: true, cloneFieldFilter: new List<string>(["system"]) }); } if (doc.activeMobileMenu === undefined) { this.setupActiveMobileMenu(doc); |