-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.htm
86 lines (63 loc) · 1.82 KB
/
main.htm
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
<html
window-resizable="true"
window-width="800dip"
window-height="600dip"
>
<head>
<title>sciter zepto demo</title>
<style>
@import url(node_modules/sciter-logger/src/logger.css);
.red {
color: red;
}
.green {
color: green;
}
</style>
<script src="node_modules/zepto/dist/zepto.js" />
<script type="module">
import Logger from "node_modules/sciter-logger/src/logger.js";
import Utils from "node_modules/sciter-utils/src/utils.js";
// initialize logger
Logger.init();
// attach logger to console
Logger.attach();
// capture unhandled exceptions
Logger.capture();
// does not work Zepto(function($){
document.on("ready", function() {
// subscribe to logger messages
Logger.plaintext(document.$("plaintext#logger"));
// log sciter version
console.debug(Utils.sciterInfo());
// add support for F5 reload
Utils.addReloadWindow();
// close window on escape key press
Utils.closeWindowOnEscape(Window.this);
// center window on screen
Utils.centerWindow(Window.this, "screen");
// bring window to front and set input focus
if (!Window.this.activate(true))
console.error("Activate window - FAILED");
console.log("document ready");
const element = $("p");
element.text("Hello World from Zepto!");
element.toggleClass("red");
element.addClass("green");
console.log("dimensions: " + element.width() + " x " + element.height());
console.log("hasClass: " + element.hasClass("red"));
console.log("attribute: " + element.attr("data"));
// does not work
//element.css("color", "#0088ff");
// does not work
//element.css({ backgroundColor: '#8EE', fontSize: 28 })
// does not work
//element.hide();
});
</script>
</head>
<body>
<p data="test" class="red">No Zepto</p>
<plaintext #logger readonly />
</body>
</html>