forked from davglass/nodejs-yui3
/
tnt-layout-script.js
executable file
·54 lines (46 loc) · 1.77 KB
/
tnt-layout-script.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
#!/usr/bin/env node
var sys = require('sys'),
fs = require('fs');
var YUI = require("yui3").YUI;
YUI({
filter: 'debug',
logExclude: {
'attribute': true,
'base': true,
'get': true,
'loader': true,
'yui': true,
'widget': true,
'event': true
},
debug: true
}).use('nodejs-dom', function(Y) {
//GLOBALS!!!!
document = Y.Browser.document;
navigator = Y.Browser.navigator;
window = Y.Browser.window;
location = Y.Browser.location;
self = Y.Browser.self;
Y.log('JSDom testing..');
Y.use('yui2-layout', function(Y) {
var YAHOO = Y.YUI2;
fs.readFile('./markup/layout.html', encoding='utf-8', function(err, data) {
Y.log('Markup loaded..');
Y.log(data);
document.body.innerHTML = data;
var layout = new YAHOO.widget.Layout({
units: [
{ position: 'top', height: 50, body: 'top1', header: 'Top', gutter: '5px', collapse: true, resize: true },
{ position: 'right', header: 'Right', width: 300, resize: true, gutter: '5px', footer: 'Footer', collapse: true, scroll: true, body: 'right1', animate: true },
{ position: 'bottom', header: 'Bottom', height: 100, resize: true, body: 'bottom1', gutter: '5px', collapse: true },
{ position: 'left', header: 'Left', width: 200, resize: true, body: 'left1', gutter: '5px', collapse: true, close: true, collapseSize: 50, scroll: true, animate: true },
{ position: 'center', body: 'center1' }
]
});
Y.log('Rendering..');
layout.render();
Y.log('Done..');
Y.log(document.body.outerHTML, 'HTML');
});
});
});