semantics_splitters.js
3.26 KB
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
/////////////////////////// Splitters ///////////////////////////
var hSplitterId = 'semantics-hsplit';
var topSplitId = 'semantics-hsplit-top';
var bottomSplitId = 'semantics-hsplit-bottom';
var topVSplitterId = 'semantics-vsplit-top';
var bottomVSplitterId = 'semantics-vsplit-bottom';
var topLeftSplitId = 'frames';
var topRightSplitId = 'schemas';
var bottomLeftSplitId = 'control';
var bottomRightSplitId = 'semantics-examples';
function createHSplitter() {
$('#'+hSplitterId).height($('#right').height() - 70);
if ($.fn.splitter) {
$(window).resize(function() {
$('#'+hSplitterId).height($('#right').height() - 70);
});
$('#'+hSplitterId).bind('resize', function(e) {
var resizeEvt;
clearTimeout(resizeEvt);
resizeEvt = setTimeout(function() {
$('#'+topVSplitterId).trigger('resize', $('#'+topLeftSplitId).width());
$('#'+bottomVSplitterId).trigger('resize', $('#'+bottomLeftSplitId).width()+7);
}, 50);
e.stopPropagation();
});
$('#'+topSplitId).bind('resize', function(e) {
$('#'+topVSplitterId).height($('#'+topSplitId).height());
$('#'+topVSplitterId).children().each(function () {
$(this).height($('#'+topSplitId).height() - 7);
});
$('#'+bottomVSplitterId).height($('#'+bottomSplitId).height());
$('#'+bottomVSplitterId).children().each(function () {
$(this).height($('#'+bottomSplitId).height() - 7);
});
e.stopPropagation();
});
$('#'+bottomSplitId).bind('resize', function(e) {
e.stopPropagation();
});
$('#'+hSplitterId).splitter({
type: "h",
minTop: 200,
minBottom: 100,
sizeBottom: 170,
resizeToWidth: true,
outline: true
});
}
}
function createVTopSplitter() {
var w=$('#'+topVSplitterId).width();
$('#'+topVSplitterId).height(2*$('#right').height()/3);
if ($.fn.splitter) {
$('#'+topLeftSplitId).bind('resize', function(e) {
$('#'+topVSplitterId).height($('#'+topSplitId).height());
$('#'+topVSplitterId).children().each(function () {
$(this).height($('#'+topSplitId).height() - 7);
});
$('#'+topRightSplitId).width($('#'+topRightSplitId).width() - 20);
e.stopPropagation();
});
$('#'+topRightSplitId).bind('resize', function(e) {
e.stopPropagation();
});
$('#'+topVSplitterId).splitter({
type: "v",
minLeft: 50,
sizeLeft: w/2,
resizeToWidth: true,
outline: true
});
}
}
function createVBottomSplitter() {
var w=$('#'+bottomVSplitterId).width();
$('#'+bottomVSplitterId).height($('#right').height()/3);
if ($.fn.splitter) {
$('#'+bottomLeftSplitId).bind('resize', function(e) {
$('#'+bottomVSplitterId).height($('#'+bottomSplitId).height());
$('#'+bottomVSplitterId).children().each(function () {
$(this).height($('#'+bottomSplitId).height()-7);
});
$('#'+bottomLeftSplitId).width($('#'+bottomLeftSplitId).width() - 7);
$('#'+bottomRightSplitId).width($('#'+bottomRightSplitId).width() - 20);
e.stopPropagation();
});
$('#'+bottomRightSplitId).bind('resize', function(e) {
e.stopPropagation();
});
$('#'+bottomVSplitterId).splitter({
type: "v",
sizeLeft: w/3,
minLeft: 200,
resizeToWidth: true,
outline: true
});
}
}