forked from nextapps-de/winbox
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
867 lines (743 loc) · 27.8 KB
/
index.html
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover, shrink-to-fit=no">
<meta name="robots" content="index, follow">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/styles/railscasts.min.css">
<title>WinBox.js – Modern HTML5 Window Manager</title>
<link rel="stylesheet" href="dist/css/winbox.min.css">
<link rel="stylesheet" href="dist/css/themes/modern.min.css">
<link rel="stylesheet" href="dist/css/themes/white.min.css">
<script src="dist/js/winbox.min.js"></script>
<!--<script src="dist/winbox.bundle.js"></script>-->
<style>
/* WinBox Theme: "custom" */
.winbox.custom {
background: linear-gradient(90deg, #ff00f0, #0050ff);
box-shadow: none;
border-radius: 12px 12px 0 0;
}
.winbox.custom.max,
.winbox.custom.min {
border-radius: 0;
}
.winbox.custom .wb-body {
/* margin represents the width of window border: */
margin: 4px;
color: #fff;
background: #131820;
}
.winbox.custom .wb-title {
font-size: 13px;
text-transform: uppercase;
font-weight: 600;
}
.winbox.custom .wb-icon * {
opacity: 0.65;
}
.winbox.custom .wb-icon *:hover {
opacity: 1;
}
.winbox.custom .wb-max {
background-image: url(src/img/max.svg);
background-size: 17px auto;
}
.winbox.custom .wb-min {
background-image: url(src/img/min.svg);
}
.winbox.custom .wb-close {
background-image: url(src/img/close.svg);
}
.winbox.custom .wb-full {
display: none;
}
.winbox.custom .wb-body::-webkit-scrollbar {
width: 12px;
}
.winbox.custom .wb-body::-webkit-scrollbar-track {
background: transparent;
}
.winbox.custom .wb-body::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #263040;
}
.winbox.custom .wb-body::-webkit-scrollbar-thumb:window-inactive {
background: #181f2a;
}
.winbox.custom .wb-body::-webkit-scrollbar-corner {
background: transparent;
}
/* WinBox Theme: "my-theme" */
.winbox.my-theme{
background: #fff;
}
.winbox.my-theme .wb-body {
color: #fff;
background: #131820;
}
.winbox.my-theme .wb-title {
color: #000;
}
.winbox.my-theme .wb-icon {
filter: invert(1);
}
</style>
<link rel="stylesheet" href="demo/style.css">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="WinBox is a modern HTML5 window manager for the web. Lightweight, outstanding performance, no dependencies, fully customizable, free and open source!">
<meta name="keywords" content="window manager, web window, html5 popup, javascript window, web desktop, html5 windows, web frame, web box">
<meta name="thumbnail" content="https://nextapps-de.github.io/winbox/demo/favicon.png">
<meta property="og:url" content="https://nextapps-de.github.io/winbox/">
<meta property="og:site_name" content="WinBox - HTML5 window manager">
<meta property="og:image" content="https://nextapps-de.github.io/winbox/demo/og-image.png">
<meta property="og:title" content="WinBox - HTML5 window manager">
<meta property="og:description" content="WinBox is a modern HTML5 window manager for the web. Lightweight, outstanding performance, no dependencies, fully customizable, free and open source!">
<meta property="og:type" content="Software">
<meta property="og:url" content="https://nextapps-de.github.io/winbox/">
<link rel="icon" sizes="16x16 32x32 48x48 64x64" type="image/png" href="https://nextapps-de.github.io/winbox/demo/favicon.png">
<link rel="icon" sizes="512x512 1024x1024" type="image/png" href="https://nextapps-de.github.io/winbox/demo/og-image.png">
</head>
<body>
<div class="background"></div>
<div class="scroll">
<header>
<a href="https://github.com/nextapps-de/winbox">Goto Github</a>
</header>
<div class="wrapper">
<h1 style="margin-bottom: 0"><img src="demo/winbox-gradient.svg" alt="WinBox.js: HTML5 Window Manager for the Web." width="2400" height="811"></h1>
<h2>WinBox is a modern HTML5 window manager for the web. Lightweight, outstanding performance, no dependencies, fully customizable, free and open source!</h2>
<br>
<div class="button" onclick="window.examples['theme-modern']()" style="background-color: #ca00b4">Show Example</div>
<br><br>
<hr>
<br>
Load Library (Bundle)
<br><br>
<pre><code class="language-html"><head>
<script src="dist/winbox.bundle.js"></script>
</head></code></pre>
<div class="break"></div>
<br>
Load Library (Non-Bundle)
<br><br>
<pre><code class="language-html"><head>
<link rel="stylesheet" href="dist/css/winbox.min.css">
<script src="dist/js/winbox.min.js"></script>
</head></code></pre>
<div class="break"></div>
<hr>
<br>
Class Constructor
<br><br>
<pre><code class="language-js">WinBox(title, options<key: value>)</code></pre>
<br>
<hr>
<br>
<div style="color: #79c0ff; line-height: 22px;">You can open the browser dev tools and copy and paste the js-code blocks into the console and play with them.</div>
<hr>
<br>
Basic Window
<br><br>
<pre><code class="language-js">new WinBox("Basic Window");</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['basic']()">Run Code</div>
<br><br>
<hr>
<br>
Custom Root
<br><br>
<pre><code class="language-js">new WinBox("Custom Root", {
root: document.body
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['root']()">Run Code</div>
<br><br>
<hr>
<br>
Custom Border
<br><br>
<pre><code class="language-js">new WinBox("Custom Border", {
border: "0.3em"
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['border']()">Run Code</div>
<br><br>
<hr>
<br>
Custom Color
<br><br>
<pre><code class="language-js">new WinBox({
title: "Custom Color",
background: "#ff005d",
border: 4
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['color']()">Run Code</div>
<br><br>
<hr>
<br>
Limit Viewport
<br><br>
<pre><code class="language-js">new WinBox("Limit Viewport", {
top: 50,
right: 50,
bottom: 0,
left: 50
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['viewport']()">Run Code</div>
<br><br>
<hr>
<br>
Splitscreen
<br><br>
<pre><code class="language-js">new WinBox("Splitscreen (Left)", {
right: "50%",
max: true
});
new WinBox("Splitscreen (Right)", {
x: "100%",
left: "50%",
max: true
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['splitscreen']()">Run Code</div>
<br><br>
<hr>
<br>
Custom Position / Size
<br><br>
<pre><code class="language-js">new WinBox({
title: "Custom Position / Size",
x: "center",
y: "center",
width: "50%",
height: "50%"
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['position']()">Run Code</div>
<br><br>
<hr>
<br>
Modal Window
<br><br>
<pre><code class="language-js">new WinBox("Modal Window", {
modal: true
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['modal']()">Run Code</div>
<br><br>
<hr>
<br>
Set innerHTML
<br><br>
<pre><code class="language-js">new WinBox({
title: "Set innerHTML",
html: "<h1>Lorem Ipsum</h1>"
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['innerhtml']()">Run Code</div>
<br><br>
<hr>
<br>
Mount DOM (Cloned)
<br><br>
<pre><code class="language-html"><div id="backstore" style="display: none">
<div id="content">
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum [...]</p>
<p>Duis autem vel [...]</p>
<p>Ut wisi enim [...]</p>
</div>
</div></code></pre>
<div class="break"></div>
<pre><code class="language-js">new WinBox("Mount DOM", {
mount: document.getElementById("content")
.cloneNode(true)
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['mount-clone']()">Run Code</div>
<br><br>
<hr>
<br>
Mount DOM (Singleton) + Auto-Unmount
<br><br>
<pre><code class="language-js">new WinBox("Mount DOM", {
mount: document.getElementById("content")
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['mount-auto']()">Run Code</div>
<br><br>
<hr>
<br>
Open URI / URL
<br><br>
<pre><code class="language-js">new WinBox("WinBox.js", {
url: "https://nextapps-de.github.io/winbox/"
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['iframe']()">Run Code</div>
<br><br>
<hr>
<br>
All Options
<br><br>
<pre><code class="language-js">new WinBox({
id: "my-window",
class: ["no-full", "my-theme"],
root: document.body,
title: "All Options",
background: "#fff",
border: 4,
width: 200,
height: 200,
x: "center",
y: "center",
max: false,
splitscreen: true,
top: 50,
right: 50,
bottom: 0,
left: 50,
html: "width: 200, height: 200",
onfocus: function(){
this.setBackground("#fff");
},
onblur: function(){
this.setBackground("#999");
},
onresize: function(width, height){
this.body.textContent = (
"width: " + width + ", " +
"height: " + height
);
},
onmove: function(x, y){
this.body.textContent = (
"x: " + x + ", " +
"y: " + y
);
},
onclose: function(force){
return !confirm("Close window?");
}
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['all-options']()">Run Code</div>
<br><br>
<hr>
<br>
Control Programmatically
<br><br>
<pre><code class="language-html"><div id="controls">
<button onclick="buttons.minimize()">Minimize (Toggle)</button>
<button onclick="buttons.maximize()">Maximize (Toggle)</button>
<button onclick="buttons.fullscreen()">Fullscreen (Toggle)</button>
<button onclick="buttons.move()">Move (Center, Center)</button>
<button onclick="buttons.resize()">Resize (50%, 50%)</button>
<button onclick="buttons.title()">Set Title</button>
<button onclick="buttons.color()">Set Color</button>
<button onclick="buttons.close()">Close</button>
</div></code></pre>
<div class="break"></div>
<pre><code class="language-js">var winbox = new WinBox("Controls", {
mount: document.getElementById("controls"),
border: 4,
onclose: function(force){
return !force && !confirm("Close window?");
}
});</code></pre>
<div class="break"></div>
<pre><code class="language-js">window.buttons = {
minimize: function(){
winbox.minimize();
},
maximize: function(){
winbox.maximize();
},
fullscreen: function(){
winbox.fullscreen();
},
move: function(){
winbox.move("center", "center");
},
resize: function(){
winbox.resize("50%", "50%");
},
title: function(){
winbox.setTitle("Title-" + Math.random());
},
color: function(){
winbox.setBackground(
"rgb(" + (Math.random() * 255 | 0) + "," +
(Math.random() * 255 | 0) + "," +
(Math.random() * 255 | 0) + ")"
);
},
modal: function(){
winbox.body.parentNode.classList.toggle("modal");
},
close: function(){
winbox.close();
},
force_close: function(){
winbox.close(true);
}
};</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['controls']()">Run Code</div>
<br><br>
<hr>
<br>
Window Boilerplate
<br><br>
<img src="demo/boilerplate.svg" width="100%" alt="WinBox Boilerplate">
<hr>
<br>
Custom Styles (Global)
<br><br>
<pre><code class="language-css">.winbox {
background: linear-gradient(90deg, #ff00f0, #0050ff);
border-radius: 12px 12px 0 0;
box-shadow: none;
}
.winbox.min {
border-radius: 0;
}
.wb-body {
/* the width of window border: */
margin: 4px;
color: #fff;
background: #131820;
}
.wb-title {
font-size: 13px;
text-transform: uppercase;
font-weight: 600;
}</code></pre>
<div class="break"></div>
Custom Icons
<br><br>
<pre><code class="language-css">.wb-icon * {
opacity: 0.65;
}
.wb-icon *:hover {
opacity: 1;
}
.wb-min {
background-image: url(src/img/min.svg);
background-size: 15px center;
}
.wb-max {
background-image: url(src/img/max.svg);
}
.wb-close {
background-image: url(src/img/close.svg);
}
.wb-full {
display: none;
}</code></pre>
<div class="break"></div>
Custom Scrollbars
<br><br>
<pre><code class="language-css">.wb-body::-webkit-scrollbar {
width: 12px;
}
.wb-body::-webkit-scrollbar-track {
background: transparent;
}
.wb-body::-webkit-scrollbar-thumb {
border-radius: 10px;
background: #263040;
}
.wb-body::-webkit-scrollbar-thumb:window-inactive {
background: #181f2a;
}
.wb-body::-webkit-scrollbar-corner {
background: transparent;
}</code></pre>
<div class="break"></div>
<pre><code class="language-js">new WinBox("Custom CSS", {
mount: document.getElementById("content")
.cloneNode(true)
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['custom-css']()">Run Code</div>
<br><br>
<hr>
<br>
Custom Styles By Classname
<br><br>
<pre><code class="language-css">.winbox.my-theme{
background: #fff;
}
.winbox.my-theme .wb-body {
color: #fff;
background: #131820;
}
.winbox.my-theme .wb-title {
color: #000;
}
.winbox.my-theme .wb-icon {
filter: invert(1);
}</code></pre>
<div class="break"></div>
<pre><code class="language-js">new WinBox("Custom CSS (Class)", {
class: "my-theme",
mount: document.getElementById("content")
.cloneNode(true)
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['custom-class']()">Run Code</div>
<br><br>
<hr>
<br>
Use Theme
<br><br>
<pre><code class="language-html"><head>
<link rel="stylesheet" href="dist/css/winbox.min.css">
<link rel="stylesheet" href="dist/css/themes/modern.min.css">
<script src="dist/js/winbox.min.js"></script>
</head></code></pre>
<div class="break"></div>
<pre><code class="language-js">new WinBox("Theme", {
class: "modern",
mount: document.getElementById("content")
.cloneNode(true)
});</code></pre>
<div class="break"></div>
<div class="button" onclick="window.examples['theme-modern']()">Run Code</div>
<br><br>
</div>
</div>
<div id="backstore" style="display: none">
<div id="content">
<h1>Lorem Ipsum</h1>
<p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.</p>
<p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>
<p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.</p>
</div>
<div id="controls">
<button onclick="window.buttons['minimize']()">Minimize (Toggle)</button>
<button onclick="window.buttons['maximize']()">Maximize (Toggle)</button>
<button onclick="window.buttons['fullscreen']()">Fullscreen (Toggle)</button>
<button onclick="window.buttons['modal']()">Modal (Toggle)</button>
<button onclick="window.buttons['center']()">Move (Center, Center)</button>
<button onclick="window.buttons['move']()">Move (Right, Bottom)</button>
<button onclick="window.buttons['resize']()">Resize (50%, 50%)</button>
<button onclick="window.buttons['title']()">Set Title</button>
<button onclick="window.buttons['color']()">Set Color</button>
<button onclick="window.buttons['add']()">Add Class (my-theme)</button>
<button onclick="window.buttons['remove']()">Remove Class (my-theme)</button>
<button onclick="window.buttons['close']()">Close</button>
<button onclick="window.buttons['force_close']()">Force Close</button>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.7.2/highlight.min.js"></script>
<script>
(function(){
let winbox;
window.examples = {
"basic": function(){
new WinBox("Basic Window");
},
"root": function(){
new WinBox("Custom Root", {
root: document.body
});
},
"border": function(){
new WinBox("Custom Border", {
border: "0.3em"
});
},
"color": function(){
new WinBox({
title: "Custom Color",
background: "#ff005d",
border: 4
});
},
"viewport": function(){
new WinBox("Limit Viewport", {
top: 50,
right: 50,
bottom: 0,
left: 50
});
},
"splitscreen": function(){
new WinBox("Splitscreen (Left)", {
right: "50%",
max: true
});
new WinBox("Splitscreen (Right)", {
x: "100%",
left: "50%",
max: true
});
},
"position": function(){
new WinBox({
title: "Custom Position / Size",
x: "center",
y: "center",
width: "50%",
height: "50%"
});
},
"modal": function(){
new WinBox("Modal Window", {
modal: true
});
},
"innerhtml": function(){
new WinBox({
title: "Set innerHTML",
html: "<h1>Lorem Ipsum</h1>"
});
},
"mount-clone": function(){
new WinBox("Mount DOM", {
mount: document.getElementById("content")
.cloneNode(true)
});
},
"mount-auto": function(){
new WinBox("Mount DOM", {
mount: document.getElementById("content")
});
},
"iframe": function(){
new WinBox("WinBox.js", {
url: "https://nextapps-de.github.io/winbox/",
class: "iframe"
});
},
"all-options": function(){
new WinBox({
id: "my-window",
class: ["no-full", "my-theme"],
root: document.body,
title: "All Options",
background: "#fff",
border: 4,
index: 50,
width: 200,
height: 200,
minheight: 100,
minwidth: 100,
x: "center",
y: "center",
max: false,
splitscreen: true,
top: 50,
right: 50,
bottom: 0,
left: 50,
html: "width: 200, height: 200",
onfocus: function(){
this.setBackground("#fff");
},
onblur: function(){
this.setBackground("#999");
},
onresize: function(width, height){
this.body.textContent = (
"width: " + width + ", " +
"height: " + height
);
},
onmove: function(x, y){
this.body.textContent = (
"x: " + x + ", " +
"y: " + y
);
},
onclose: function(force){
return !confirm("Close window?");
}
});
},
"custom-css": function(){
new WinBox("Custom CSS", {
class: "custom",
mount: document.getElementById("content")
.cloneNode(true)
});
},
"custom-class": function(){
new WinBox("Custom CSS (Class)", {
class: "my-theme",
mount: document.getElementById("content")
.cloneNode(true)
});
},
"theme-modern": function(){
new WinBox("Theme: Modern", {
class: "modern",
mount: document.getElementById("content")
.cloneNode(true)
});
},
"controls": function(){
winbox = new WinBox("Controls", {
mount: document.getElementById("controls"),
border: 4,
onclose: function(force){
return !force && !confirm("Close window?");
}
});
}
};
window.buttons = {
minimize: function(){
winbox.minimize();
},
maximize: function(){
winbox.maximize();
},
fullscreen: function(){
winbox.fullscreen();
},
center: function(){
winbox.move("center", "center");
},
move: function(){
winbox.move("right", "bottom");
},
resize: function(){
winbox.resize("50%", "50%");
},
title: function(){
winbox.setTitle("Title-" + Math.random());
},
color: function(){
winbox.setBackground(
"rgb(" + (Math.random() * 255 | 0) + "," +
(Math.random() * 255 | 0) + "," +
(Math.random() * 255 | 0) + ")"
);
},
modal: function(){
winbox.body.parentNode.classList.toggle("modal");
},
add: function(){
winbox.addClass("my-theme");
},
remove: function(){
winbox.removeClass("my-theme");
},
close: function(){
winbox.close();
},
force_close: function () {
winbox.close(true);
}
};
}());
hljs.highlightAll();
</script>
</body>
</html>