forked from davglass/nodejs-yui3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabview-markup.js
executable file
·43 lines (30 loc) · 1.13 KB
/
tabview-markup.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
#!/usr/bin/env node
var sys = require('sys');
var YUI = require("yui3").YUI;
//require("assert").equal( global.YUI, undefined, "global yui created");
YUI({
filter: 'debug',
debug: true
}).use('tabview', function(Y) {
var document = Y.Browser.document;
Y.log('JSDom testing..');
//sys.puts('Inside1: ' + sys.inspect(process.memoryUsage()));
var div = document.createElement('div');
div.id = 'demo';
div.innerHTML = '<ul><li><a href="#foo">foo</a></li><li><a href="#bar">bar</a></li><li><a href="#baz">baz</a></li></ul><div><div id="foo"><p>foo content</p></div><div id="bar"><p>bar content</p></div><div id="baz"><p>baz content</p></div></div>';
document.body.appendChild(div);
console.log(div.outerHTML);
Y.log('Creating the TabView from source..');
Y.log(Y.one('#demo'));
var tabview = new Y.TabView({
srcNode: '#demo'
});
Y.log('Rendering..');
tabview.on('render', function() {
console.log(Y.one('doc').get('outerHTML'));
Y.log('Render event listener');
});
tabview.render();
Y.log('Done..');
Y.log(div.outerHTML, 'HTML');
});