aboutsummaryrefslogtreecommitdiff
path: root/yomichan-user/conf.d/handwriting.js
blob: 7e6322460cf648ba5bcd9eb096719349490140a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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");
})();

}