forked from warsus/lions-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
js.js
49 lines (46 loc) · 1.04 KB
/
js.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
$(document).ready(function() {
alert("shortkeys: a -> focus commentary s -> toggle horizontal/vertical layout d -> show both f -> show source")
var vertical = true;
var alignment = "cols";
var focusDoc = function () {
$("frameset").attr(alignment,"100%,0%")
}
var focusSrc = function () {
$("frameset").attr(alignment,"0%,100%")
}
var focusBoth = function () {
$("frameset").attr(alignment,"50%,50%")
}
var switchAlignment = function () {
$("frameset").removeAttr(alignment)
vertical = !vertical;
if (vertical){
alignment="cols";
}
else{
alignment="rows";
}
$("frameset").attr(alignment,"50%,50%")
}
$("frame").dblclick(function() {
$("frameset").attr(alignment,"80%,20%")
});
$("*").keydown(function(e) {
// console.log("fsdfsd" + e.which);
if(e.which == 65){
focusDoc();
}
if(e.which == 70){
focusSrc();
}
if(e.which == 83){
focusBoth();
}
if(e.which == 68){
switchAlignment();
}
});
$("a dt").hover(function() {
alert("lol")
});
});