-
Notifications
You must be signed in to change notification settings - Fork 0
/
98lib.js
70 lines (63 loc) · 1.9 KB
/
98lib.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
/* add theese for it to work
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script>
<script src="https://ianrenton.github.io/web3point1/code.js"></script>
*/
// New window: show and bring to top
//<!--
function newWindow(element) {
$(element).show();
$(element).selectWindow();
}
$( function() {
// Window drag
$( ".window" ).draggable({ handle: "div.title-bar" });
// Window resize
$( ".window" ).resizable({ handles: "all", alsoresize: ".window-body" });
// Window close
$('.windowclose').on("click", function () { $(this).parents('div.window').hide(); });
// Window click-to-bring-to-top
(function() {
var highest = 100;
$.fn.selectWindow = function() {
// Make top
this.css('z-index', ++highest);
// Make this window selected and others not
this.addClass('selectedwindow');
$('.window').not(this).each(function(){
$(this).removeClass('selectedwindow');
});
};
})();
$('.window').mousedown(function() {
$(this).selectWindow();
});
// Icon single click
$('.icon').click(function() {
$(this).find('p').toggleClass('highlight');
});
} );
// make _ button work
function foldElement(tid){
let btn = document.getElementById(`${tid}content`);
if (btn) {
let disabled = btn.hasAttribute('hidden');
if (disabled) {
btn.removeAttribute("hidden");
} else {
btn.setAttribute("hidden", "");
}
}
}
function foldWindow(tid){
let btn = document.getElementById(tid);
if (btn) {
let disabled = btn.hasAttribute('hidden');
if (disabled) {
btn.removeAttribute("hidden");
} else {
btn.setAttribute("hidden", "");
}
}
}