aboutsummaryrefslogtreecommitdiff
path: root/yomichan-user/conf.d/handwriting.js
diff options
context:
space:
mode:
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");
+})();
+
+}