-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy_umlaut.js
101 lines (85 loc) · 3.03 KB
/
copy_umlaut.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
function updateCheckbox() {
var top_checkbox = document.getElementById("top-box");
var bottom_checkbox = document.getElementById("bottom-box");
var left_checkbox = document.getElementById("left-box");
var right_checkbox = document.getElementById("right-box");
if (top_checkbox.checked || bottom_checkbox.checked) {
left_checkbox.disabled = true;
right_checkbox.disabled = true;
} else if (left_checkbox.checked || right_checkbox.checked) {
top_checkbox.disabled = true;
bottom_checkbox.disabled = true;
} else {
left_checkbox.disabled = false;
right_checkbox.disabled = false;
top_checkbox.disabled = false;
bottom_checkbox.disabled = false;
}
}
function initCheckbox(checkboxId, titlebar_name, titlebar_icon_url, titlebar_text) {
var elem = document.getElementById(checkboxId);
if (!elem)
return;
elem.onclick = function() {
if (document.getElementById(checkboxId).checked)
addTitlebar(titlebar_name, titlebar_icon_url, titlebar_text);
else
removeTitlebar(titlebar_name);
focusTitlebars(true);
updateContentStyle();
updateCheckbox();
}
}
window.onfocus = function() {
console.log("focus");
focusTitlebars(true);
}
window.onblur = function() {
console.log("blur");
focusTitlebars(false);
}
window.onresize = function() {
updateContentStyle();
}
window.onload = function() {
initCheckbox("top-box", "top-titlebar", "top-titlebar.png", "Top Titlebar");
initCheckbox("bottom-box", "bottom-titlebar", "bottom-titlebar.png", "Bottom Titlebar");
initCheckbox("left-box", "left-titlebar", "left-titlebar.png", "Left Titlebar");
initCheckbox("right-box", "right-titlebar", "right-titlebar.png", "Right Titlebar");
const {remote} = require('electron');
const {BrowserWindow} = remote;
const win = BrowserWindow.getFocusedWindow();
document.getElementById("umlaut-ae").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%E4"))
}
document.getElementById("umlaut-ae-cap").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%C4"))
}
document.getElementById("umlaut-oe").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%F6"))
}
document.getElementById("umlaut-oe-cap").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%D6"))
}
document.getElementById("umlaut-ue").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%FC"))
}
document.getElementById("umlaut-ue-cap").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%DC"))
}
document.getElementById("umlaut-sz").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%DF"))
}
document.getElementById("umlaut-euro").onclick = function() {
const {clipboard} = require('electron')
clipboard.writeText(unescape("%u20AC"))
}
updateContentStyle();
}