Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Commit

Permalink
Many updates
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass authored and jsjohnst committed Sep 19, 2010
1 parent 45987fa commit 599e7b4
Show file tree
Hide file tree
Showing 14 changed files with 280 additions and 143 deletions.
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
sandbox
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ bootstrap:
dev:
./scripts/dev.sh

publish:
./scripts/publish.sh

publish: bootstrap
npm publish .

install: bootstrap
./scripts/install.sh
npm install .

link: bootstrap
npm link .
Expand Down
22 changes: 22 additions & 0 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,28 @@ All of the examples and tests assume you have @node@ in your path and they are a

h2. Dependancies

All dependencies are installed when you install the yui3 package via @npm@

For server side dom manipulation, you need the following packages installed:

"JSDom":http://github.com/tmpvar/jsdom : "LICENSE":http://github.com/tmpvar/jsdom/blob/master/LICENSE.txt

<pre class="console">npm install jsdom</pre>

"HTML Parser":http://github.com/tautologistics/node-htmlparser : "LICENSE":http://github.com/tautologistics/node-htmlparser/blob/master/LICENSE

<pre class="console">npm install htmlparser</pre>

h2. Optional Dependancies

"Express":http://expressjs.com/ : LICENSE (MIT)

<pre class="console">npm install express</pre>

"Connect"http://github.com/senchalabs/connect : LICENSE (MIT)

<pre class="console">npm install connect</pre>

h2. Installing - via NPM

<pre class="console">
Expand All @@ -27,8 +46,11 @@ npm install yui3

h2. Installing - as a developer

You must have git and npm installed before you can develop.

<pre class="console">
git clone git://github.com/davglass/nodejs-yui3.git
cd nodejs-yui3/
make dev
make install
</pre>
Expand Down
12 changes: 12 additions & 0 deletions cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node

var express = require('express');
process.chdir(__dirname + '/lib/yui3/api/');

var app = express.createServer();
app.configure(function() {
app.use(express.staticProvider(process.cwd()));
});
app.listen(8000);
console.log('YUI3 API Docs are available:');
console.log('http://localhost:8000');
25 changes: 2 additions & 23 deletions examples/failing/tabview-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,13 @@

var sys = require('sys');

var YUI = require("../../lib/node-yui3").YUI;

// TODO: This should pass, but currently doesn't.
// This will work for YUI core, but any submodules are in different files
// This will work better once the 3.1.0 version of YUI is available
// And you can combo handle all the submodules into one request.


var YUI = require("yui3").YUI;
//require("assert").equal( global.YUI, undefined, "global yui created");


//Now use non-DOM related YUI utilities
YUI({
//Only set these if you want to load locally
loaderPath: 'loader/loader-debug.js',
base: './yui3/build/',
filter: 'debug',
logExclude: {
'attribute': true,
'base': true,
'get': true,
'loader': true,
'yui': true,
'widget': true,
'event': true
},
debug: true
}).use('nodejs-dom', 'event', 'node-base', 'tabview', function(Y) {
}).use('tabview', function(Y) {

var document = Y.Browser.document;
Y.log('JSDom testing..');
Expand Down
5 changes: 1 addition & 4 deletions examples/failing/tnt-datatable-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
var sys = require('sys'),
fs = require('fs');

var YUI = require("../../lib/node-yui3").YUI;
var YUI = require("yui3").YUI;

// TODO: This should pass, but currently doesn't.
// This will work for YUI core, but any submodules are in different files
Expand All @@ -15,9 +15,6 @@ var YUI = require("../../lib/node-yui3").YUI;

//Now use non-DOM related YUI utilities
YUI({
//Only set these if you want to load locally
loaderPath: 'loader/loader-debug.js',
base: './yui3/build/',
filter: 'debug',
_logExclude: {
'attribute': true,
Expand Down
36 changes: 18 additions & 18 deletions examples/general-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,33 @@ YUI({
var foo = Y.one('#foo');
foo.addClass('bar');

Y.log(document.getElementById('foo').outerHTML, 'GEBI');
Y.log(document.getElementById('bax').outerHTML, 'GEBI');
Y.log(document.getElementById('foo').outerHTML, 'info', 'GEBI');
Y.log(document.getElementById('bax').outerHTML, 'info', 'GEBI');

//sys.puts('Inside2: ' + sys.inspect(process.memoryUsage()));
Y.log(Y.Node.getDOMNode(Y.one('strong')));
Y.log(Y.all('em, #bax').toString());
Y.log(Y.Node.getDOMNode(Y.one('strong')));
Y.log(Y.Node.getDOMNode(Y.one('strong')), 'info');
Y.log(Y.all('em, #bax').toString(), 'info');
Y.log(Y.Node.getDOMNode(Y.one('strong')), 'info');

Y.log(Y.all('em, u').toString());
Y.log(Y.all('#foo, em, u, #bax'));
Y.log(Y.all('em, u').toString(), 'info');
Y.log(Y.all('#foo, em, u, #bax'), 'info');
//sys.puts('Inside3: ' + sys.inspect(process.memoryUsage()));

Y.log(i.toString(), 'node-instance');
Y.log(Y.Node.getDOMNode(i).outerHTML, 'HTML');
Y.log(foo.toString(), 'node-instance');
Y.log(foo.get('className'), 'classname');
Y.log(Y.Node.getDOMNode(foo).outerHTML, 'HTML');
Y.log(i.toString(), 'info', 'node-instance');
Y.log(Y.Node.getDOMNode(i).outerHTML, 'info', 'HTML');
Y.log(foo.toString(), 'info', 'node-instance');
Y.log(foo.get('className'), 'info', 'classname');
Y.log(Y.Node.getDOMNode(foo).outerHTML, 'info', 'HTML');

Y.log(Y.one('body'), 'BODY');
Y.log(Y.all('body, div', null, true), 'BODY');
Y.log(Y.one('body'), 'info', 'BODY');
Y.log(Y.all('body, div', null, true), 'info', 'BODY');

Y.log(document.body.outerHTML, 'HTML');
Y.log(document.getElementById('foo\:bar'), 'HTML');
Y.log(document.getElementById('foo:bar'), 'HTML');
Y.log(document.body.outerHTML, 'info', 'HTML');
Y.log(document.getElementById('foo\:bar'), 'info', 'HTML');
Y.log(document.getElementById('foo:bar'), 'info', 'HTML');


Y.log(document.parentNode, 'document.parentNode');
Y.log(document.parentNode, 'info', 'document.parentNode');

//Y.log(document.getElementById('bax').outerHTML, 'HTML');

Expand Down
18 changes: 18 additions & 0 deletions examples/inside.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/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('json', 'base', 'io-nodejs', 'yql', function(Y) {

console.log('YQL1: ', Y.YQL);
var Y2 = YUI({ filter: 'debug', debug: true }).use('*');
console.log('YQL2: ', Y2.YQL);

});
4 changes: 2 additions & 2 deletions examples/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ YUI({

Y.YQL('select * from github.user.info where (id = "davglass")', function(r) {
//Do something here.
sys.puts(sys.inspect(r.query));
Y.log(r.query, 'debug', 'yql');
});

var json = '{ "test": "one" }';
sys.puts(sys.inspect(Y.JSON.parse(json)));
Y.log(Y.JSON.parse(json), 'debug', 'json');

});
8 changes: 4 additions & 4 deletions examples/tabview-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ YUI({
logExclude: {
'attribute': true,
'base': true,
'get': true,
'loader': true,
//'get': true,
//'loader': true,
'yui': true,
'widget': true,
'event': true
Expand Down Expand Up @@ -48,6 +48,6 @@ YUI({
//Y.log(Y.Node.getDOMNode(Y.one('#demo')));
//Y.log(div);
Y.log('Done..');
Y.log(div.outerHTML, 'HTML');

//Y.log(div.outerHTML, 'HTML');
Y.log(Y.config.doc.outerHTML);
});
Loading

0 comments on commit 599e7b4

Please sign in to comment.