Debian Codegraph @

src/web/www/js/lay_main.js

raw symbols SCIP
1 YUI().use('node',
2 'yui2-utilities',
3 'yui2-layout',
4 'yui2-resize',
5 'yui2-menu',
6 function(Y) {
7
8 Y.one('body').addClass('yui-skin-sam');
9
10 //This will make your YUI 2 code run unmodified
11 var YAHOO = Y.YUI2;
12
13
14 var Event = YAHOO.util.Event;
15
16 Event.onDOMReady(function() {
17 var layout = new YAHOO.widget.Layout({
18 units: [
19 { position: 'top', body: 'top1', height: 34, resize: false, scroll: true, gutter: '0px' },
20 { position: 'center', body: 'edTabs', scroll: true, gutter: '5px' },
21 { position: 'right', body: 'fvTabs', width: 300, resize: true, scroll: true, gutter: '5px' },
22 { position: 'bottom', body: 'resTabs', height: 300, resize: true, scroll: true, gutter: '5px' },
23 ]
24 });
25 layout.on('render', function() {
26 });
27 layout.render();
28 document['lay_main'] = layout;
29
30 function cu_size_change(e) {
31 var x = 25;
32 var node = layout.getUnitByPosition('center');
33 var h = node.get('height');
34 var w = node.get('width');
35 var ed_tv = document['ed_tv'];
36 ed_tv.set('height', h - x);
37 ed_tv.set('width', w - x - 2);
38
39 }
40 function bu_size_change(e) {
41 var x = 25;
42 var h2 = layout.getUnitByPosition('bottom').get('height');
43 //var w2 = layout.getUnitByPosition('bottom').get('width');
44 //var w2 = document.documentElement.clientWidth;
45 var w2 = YAHOO.util.Dom.getViewportWidth();
46 var res_tv = document['res_tv'];
47 res_tv.set('height', h2 - x);
48 res_tv.set('width', w2 - x - 2);
49 }
50 function ru_size_change(e) {
51 var x = 25;
52 var h2 = layout.getUnitByPosition('right').get('height');
53 var w2 = layout.getUnitByPosition('right').get('width');
54 //var w2 = document.documentElement.clientWidth;
55 var fv_tv = document['fv_tv'];
56 fv_tv.set('height', h2 - x);
57 fv_tv.set('width', w2 - x - 2);
58 }
59
60 var bu = layout.getUnitByPosition('bottom');
61 var ru = layout.getUnitByPosition('right');
62 bu.on('heightChange', function(e) {
63 cu_size_change(e);
64 ru_size_change(e);
65 bu_size_change(e);
66 });
67 ru.on('widthChange', function(e) {
68 cu_size_change(e);
69 ru_size_change(e);
70 });
71
72 var e = null;
73 cu_size_change(e);
74 ru_size_change(e);
75 bu_size_change(e);
76
77
78 plist_dlg_show(function(pargs) {
79 document['project'] = pargs.project;
80 Y.one('#project_name').setHTML(pargs.project);
81
82 flist_query();
83
84 // var qargs = {
85 // qtype : 'REF',
86 // symbol : 'query',
87 // opt : [],
88 // };
89 // start_query(qargs);
90 });
91
92 });
93
94 function g_do_resize(e) {
95 confirm('g_do_resize');
96 var e = null;
97 cu_size_change(e);
98 ru_size_change(e);
99 bu_size_change(e);
100 }
101 Y.after('windowresize', g_do_resize);
102
103 });