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
|
<html><head>
<title>test lightweight themes</title>
</head><body>
<script>
var themes = [
{
id: "test-01",
name: "Test 01",
headerURL: "test.png",
footerURL: "test.png",
textcolor: "#fff",
accentcolor: "#6b6b6b",
},
{
id: "test-02",
name: "Test 02",
headerURL: "test.png",
footerURL: "test.png",
textcolor: "#bcf",
accentcolor: "#8888FF",
},
];
const INSTALL = "InstallBrowserTheme";
const PREVIEW = "PreviewBrowserTheme";
const RESET_PREVIEW = "ResetBrowserThemePreview";
function setTheme(node, theme, action) {
node.setAttribute("data-browsertheme", JSON.stringify(themes[theme]));
dump("dispatching " + action + "\n");
node.dispatchEvent(new Event(action, { bubbles: true, cancelable: false }));
}
</script>
<button id="install1"
onclick="setTheme(this, 0, INSTALL);"
onmouseover="setTheme(this, 0, PREVIEW);"
onmouseout="setTheme(this, 0, RESET_PREVIEW);">Test 01</button>
<button id="install2"
onclick="setTheme(this, 1, INSTALL);"
onmouseover="setTheme(this, 1, PREVIEW);"
onmouseout="setTheme(this, 1, RESET_PREVIEW);">Test 02</button>
</body>
</html>
|