Skip to content

Commit

Permalink
0.3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffsu committed Apr 15, 2011
1 parent 5ee2d66 commit 48a04bd
Show file tree
Hide file tree
Showing 16 changed files with 209 additions and 62 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
@@ -1,3 +1,8 @@
0.3.18
* COMMAND: updaters should be using targetDir instead of outDir
* JSML: fixed empty space problem
* JSML: support for self-closing tags: area, base, basefont, br, hr, input, img, link, meta

0.3.17
* CORE: Adding counter to foreach "foreach (var item:i in items) { }"
* COMMAND: Fixing compile to use targetDir instead of outDir
Expand Down
25 changes: 18 additions & 7 deletions dist/browser/js2-full.js
Expand Up @@ -1242,9 +1242,9 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.outDir = this.fs.canonical(outDir);
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.targetDir = this.fs.canonical(outDir);
this.verbose = true;
});

Expand All @@ -1261,14 +1261,14 @@ JS2.Class.extend('Updater', function(KLASS, OO){
for(var _i1=0,_c1=subs,_l1=_c1.length,sub;(sub=_c1[_i1])||(_i1<_l1);_i1++){
var path = dir + '/' + sub;
if (this.fs.isDirectory(path)) {
this.fs.mkdir(path.replace(this.inDir, this.outDir));
this.fs.mkdir(path.replace(this.inDir, this.targetDir));
this.matchDirs(path);
}
}
});

OO.addMember("tryUpdate",function (file, force, funct) {
var outFile = file.replace(this.inDir, this.outDir).replace(/\.js2$/, '.js');
var outFile = file.replace(this.inDir, this.targetDir).replace(/\.js2$/, '.js');

var dir = this.fs.dirname(file);
if (! this.fs.isDirectory(dir)) this.fs.mkpath(dir);
Expand Down Expand Up @@ -1518,6 +1518,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
});

OO.addMember("processLine",function (line) {
if (line.match(/^\s*$/)) return;

var ele = new JS2.JSMLElement(line);
var scope = this.getScope();

Expand Down Expand Up @@ -1555,6 +1557,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
OO.addMember("SELF_CLOSING",{ area: null, basefont: null, br: null, hr: null, input: null, img: null, link: null, meta: null });

OO.addMember("initialize",function (line) {
this.children = [];
Expand Down Expand Up @@ -1614,6 +1617,12 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}

if (this.SELF_CLOSING.hasOwnProperty(this.nodeType) && this.children.length == 0) {
this.selfClose = '/';
} else {
this.selfClose = '';
}
});

OO.addMember("flatten",function () {
Expand All @@ -1629,8 +1638,10 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (this.nodeType) {
this.handleJsEQ(out);
this.handleContent(out);
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+">");\n');
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+"' + this.selfClose + '>");\n');
if (this.selfClose == '') {
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
}
} else {
this.handleJsExec(out);
this.handleJsEQ(out);
Expand Down
15 changes: 13 additions & 2 deletions dist/browser/js2.js
Expand Up @@ -299,6 +299,8 @@ JS2.Array.prototype.any = function() {
});

OO.addMember("processLine",function (line) {
if (line.match(/^\s*$/)) return;

var ele = new JS2.JSMLElement(line);
var scope = this.getScope();

Expand Down Expand Up @@ -336,6 +338,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
OO.addMember("SELF_CLOSING",{ area: null, basefont: null, br: null, hr: null, input: null, img: null, link: null, meta: null });

OO.addMember("initialize",function (line) {
this.children = [];
Expand Down Expand Up @@ -395,6 +398,12 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}

if (this.SELF_CLOSING.hasOwnProperty(this.nodeType) && this.children.length == 0) {
this.selfClose = '/';
} else {
this.selfClose = '';
}
});

OO.addMember("flatten",function () {
Expand All @@ -410,8 +419,10 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (this.nodeType) {
this.handleJsEQ(out);
this.handleContent(out);
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+">");\n');
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+"' + this.selfClose + '>");\n');
if (this.selfClose == '') {
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
}
} else {
this.handleJsExec(out);
this.handleJsEQ(out);
Expand Down
7 changes: 7 additions & 0 deletions dist/gem/CHANGELOG
@@ -1,3 +1,10 @@
0.3.19
* JSML: fixed empty space problem
* JSML: support for self-closing tags: area, base, basefont, br, hr, input, img, link, meta

0.3.18
* COMMAND: updaters should be using targetDir instead of outDir

0.3.17
* CORE: Adding counter to foreach "foreach (var item:i in items) { }"
* COMMAND: Fixing compile to use targetDir instead of outDir
Expand Down
25 changes: 18 additions & 7 deletions dist/gem/lib/js2/js2.js
Expand Up @@ -1238,9 +1238,9 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.outDir = this.fs.canonical(outDir);
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.targetDir = this.fs.canonical(outDir);
this.verbose = true;
});

Expand All @@ -1257,14 +1257,14 @@ JS2.Class.extend('Updater', function(KLASS, OO){
for(var _i1=0,_c1=subs,_l1=_c1.length,sub;(sub=_c1[_i1])||(_i1<_l1);_i1++){
var path = dir + '/' + sub;
if (this.fs.isDirectory(path)) {
this.fs.mkdir(path.replace(this.inDir, this.outDir));
this.fs.mkdir(path.replace(this.inDir, this.targetDir));
this.matchDirs(path);
}
}
});

OO.addMember("tryUpdate",function (file, force, funct) {
var outFile = file.replace(this.inDir, this.outDir).replace(/\.js2$/, '.js');
var outFile = file.replace(this.inDir, this.targetDir).replace(/\.js2$/, '.js');

var dir = this.fs.dirname(file);
if (! this.fs.isDirectory(dir)) this.fs.mkpath(dir);
Expand Down Expand Up @@ -1514,6 +1514,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
});

OO.addMember("processLine",function (line) {
if (line.match(/^\s*$/)) return;

var ele = new JS2.JSMLElement(line);
var scope = this.getScope();

Expand Down Expand Up @@ -1551,6 +1553,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
OO.addMember("SELF_CLOSING",{ area: null, basefont: null, br: null, hr: null, input: null, img: null, link: null, meta: null });

OO.addMember("initialize",function (line) {
this.children = [];
Expand Down Expand Up @@ -1610,6 +1613,12 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}

if (this.SELF_CLOSING.hasOwnProperty(this.nodeType) && this.children.length == 0) {
this.selfClose = '/';
} else {
this.selfClose = '';
}
});

OO.addMember("flatten",function () {
Expand All @@ -1625,8 +1634,10 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (this.nodeType) {
this.handleJsEQ(out);
this.handleContent(out);
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+">");\n');
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+"' + this.selfClose + '>");\n');
if (this.selfClose == '') {
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
}
} else {
this.handleJsExec(out);
this.handleJsEQ(out);
Expand Down
7 changes: 7 additions & 0 deletions dist/npm/CHANGELOG
@@ -1,3 +1,10 @@
0.3.19
* JSML: fixed empty space problem
* JSML: support for self-closing tags: area, base, basefont, br, hr, input, img, link, meta

0.3.18
* COMMAND: updaters should be using targetDir instead of outDir

0.3.17
* CORE: Adding counter to foreach "foreach (var item:i in items) { }"
* COMMAND: Fixing compile to use targetDir instead of outDir
Expand Down
25 changes: 18 additions & 7 deletions dist/npm/lib/js2.js
Expand Up @@ -1238,9 +1238,9 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.outDir = this.fs.canonical(outDir);
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.targetDir = this.fs.canonical(outDir);
this.verbose = true;
});

Expand All @@ -1257,14 +1257,14 @@ JS2.Class.extend('Updater', function(KLASS, OO){
for(var _i1=0,_c1=subs,_l1=_c1.length,sub;(sub=_c1[_i1])||(_i1<_l1);_i1++){
var path = dir + '/' + sub;
if (this.fs.isDirectory(path)) {
this.fs.mkdir(path.replace(this.inDir, this.outDir));
this.fs.mkdir(path.replace(this.inDir, this.targetDir));
this.matchDirs(path);
}
}
});

OO.addMember("tryUpdate",function (file, force, funct) {
var outFile = file.replace(this.inDir, this.outDir).replace(/\.js2$/, '.js');
var outFile = file.replace(this.inDir, this.targetDir).replace(/\.js2$/, '.js');

var dir = this.fs.dirname(file);
if (! this.fs.isDirectory(dir)) this.fs.mkpath(dir);
Expand Down Expand Up @@ -1514,6 +1514,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
});

OO.addMember("processLine",function (line) {
if (line.match(/^\s*$/)) return;

var ele = new JS2.JSMLElement(line);
var scope = this.getScope();

Expand Down Expand Up @@ -1551,6 +1553,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
OO.addMember("SELF_CLOSING",{ area: null, basefont: null, br: null, hr: null, input: null, img: null, link: null, meta: null });

OO.addMember("initialize",function (line) {
this.children = [];
Expand Down Expand Up @@ -1610,6 +1613,12 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}

if (this.SELF_CLOSING.hasOwnProperty(this.nodeType) && this.children.length == 0) {
this.selfClose = '/';
} else {
this.selfClose = '';
}
});

OO.addMember("flatten",function () {
Expand All @@ -1625,8 +1634,10 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (this.nodeType) {
this.handleJsEQ(out);
this.handleContent(out);
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+">");\n');
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+"' + this.selfClose + '>");\n');
if (this.selfClose == '') {
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
}
} else {
this.handleJsExec(out);
this.handleJsEQ(out);
Expand Down
25 changes: 18 additions & 7 deletions flavors/browser-full.js
Expand Up @@ -1242,9 +1242,9 @@ JS2.Class.extend('FileSystem', function(KLASS, OO){
JS2.Class.extend('Updater', function(KLASS, OO){
OO.addMember("initialize",function (fs, inDir, outDir, recursive) {
this.recursive = recursive;
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.outDir = this.fs.canonical(outDir);
this.fs = fs;
this.inDir = this.fs.canonical(inDir);
this.targetDir = this.fs.canonical(outDir);
this.verbose = true;
});

Expand All @@ -1261,14 +1261,14 @@ JS2.Class.extend('Updater', function(KLASS, OO){
for(var _i1=0,_c1=subs,_l1=_c1.length,sub;(sub=_c1[_i1])||(_i1<_l1);_i1++){
var path = dir + '/' + sub;
if (this.fs.isDirectory(path)) {
this.fs.mkdir(path.replace(this.inDir, this.outDir));
this.fs.mkdir(path.replace(this.inDir, this.targetDir));
this.matchDirs(path);
}
}
});

OO.addMember("tryUpdate",function (file, force, funct) {
var outFile = file.replace(this.inDir, this.outDir).replace(/\.js2$/, '.js');
var outFile = file.replace(this.inDir, this.targetDir).replace(/\.js2$/, '.js');

var dir = this.fs.dirname(file);
if (! this.fs.isDirectory(dir)) this.fs.mkpath(dir);
Expand Down Expand Up @@ -1518,6 +1518,8 @@ JS2.Class.extend('JSML', function(KLASS, OO){
});

OO.addMember("processLine",function (line) {
if (line.match(/^\s*$/)) return;

var ele = new JS2.JSMLElement(line);
var scope = this.getScope();

Expand Down Expand Up @@ -1555,6 +1557,7 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
OO.addMember("TOKEN_REGEX",/(\%|\#|\.)([\w][\w\-]*)/g);
OO.addMember("JS_REGEX",/^(-|=)(.*)$/g);
OO.addMember("SCOPE_OFFSET",1);
OO.addMember("SELF_CLOSING",{ area: null, basefont: null, br: null, hr: null, input: null, img: null, link: null, meta: null });

OO.addMember("initialize",function (line) {
this.children = [];
Expand Down Expand Up @@ -1614,6 +1617,12 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (!this.nodeType && (this.classes.length || this.nodeID)) {
this.nodeType = 'div';
}

if (this.SELF_CLOSING.hasOwnProperty(this.nodeType) && this.children.length == 0) {
this.selfClose = '/';
} else {
this.selfClose = '';
}
});

OO.addMember("flatten",function () {
Expand All @@ -1629,8 +1638,10 @@ JS2.Class.extend('JSMLElement', function(KLASS, OO){
if (this.nodeType) {
this.handleJsEQ(out);
this.handleContent(out);
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+">");\n');
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
out.unshift('out.push("<' + this.nodeType + '"+JS2.JSMLElement.parseAttributes(' + (this.attributes || "{}") + ', ' + JSON.stringify(this.classes || []) + ', ' + JSON.stringify(this.id || null) + ')+"' + this.selfClose + '>");\n');
if (this.selfClose == '') {
out.push('out.push(' + JSON.stringify("</"+(this.nodeType)+">") + ');\n');
}
} else {
this.handleJsExec(out);
this.handleJsEQ(out);
Expand Down

0 comments on commit 48a04bd

Please sign in to comment.