aboutsummaryrefslogtreecommitdiff
path: root/yomichan-user/conf.d/handwriting.js
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-05-09 20:19:22 +0200
committerlonkaars <loek@pipeframe.xyz>2023-05-09 20:19:22 +0200
commit99146502259dfc324ec427169e25554aaa91ab97 (patch)
tree4e8273c24d3a50926b65c481a20eebe6910946f9 /yomichan-user/conf.d/handwriting.js
parent67e7e2eee2c4a09b35470711fe5ac10453841d8c (diff)
WIP handwriting panel (added libs + button to search bar)
Diffstat (limited to 'yomichan-user/conf.d/handwriting.js')
-rw-r--r--yomichan-user/conf.d/handwriting.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/yomichan-user/conf.d/handwriting.js b/yomichan-user/conf.d/handwriting.js
new file mode 100644
index 0000000..7e63224
--- /dev/null
+++ b/yomichan-user/conf.d/handwriting.js
@@ -0,0 +1,24 @@
+{
+
+function patchSearchBar() {
+ var searchBarOuter = document.getElementsByClassName("search-textbox-container")[0];
+ var button = document.createElement("button");
+ button.id = "handwriting-input-toggle";
+ button.classList.add("search-button");
+ button.onclick = () => console.log("AAAA");
+ var icon = document.createElement("span");
+ icon.classList.add("icon");
+ icon.setAttribute("data-icon", "draw");
+ button.appendChild(icon);
+ searchBarOuter.insertBefore(button, searchBarOuter.childNodes[2]);
+}
+
+(() => {
+ if (document.body.classList.contains("handwriting-patched")) return;
+
+ patchSearchBar();
+
+ document.body.classList.add("handwriting-patched");
+})();
+
+}