diff --git a/README b/README
index 12846a17..19b1dfba 100644
--- a/README
+++ b/README
@@ -10,15 +10,15 @@ A. How to get (and contribute) JMVC
http://github.com/jupiterjs/steal and
http://github.com/jupiterjs/jquerymx
- 3. Add steal and javascriptmvc as submodules of your project...
+ 3. Add steal and jquerymx as submodules of your project...
git submodule add git@github.com:_YOU_/steal.git steal
git submodule add git@github.com:_YOU_/jquerymx.git jquery
- * Notice javascriptmvc is under the jquery folder
+ * Notice jquerymx is under the jquery folder
4. Learn a little more about submodules ...
http://johnleach.co.uk/words/archives/2008/10/12/323/git-submodules-in-n-easy-steps
- 5. Make changes in steal or jmvc, and push them back to your fork.
+ 5. Make changes in steal or jquerymx, and push them back to your fork.
6. Make a pull request to your fork.
diff --git a/build.js b/build.js
index 60737856..b19adbda 100644
--- a/build.js
+++ b/build.js
@@ -1,13 +1,13 @@
// load('jquery/build.js')
-load('steal/rhino/steal.js')
+load('steal/rhino/rhino.js')
-var i, fileName, cmd,
+var i, fileName, cmd,
plugins = [
- "class" ,
+ "class" ,
"controller",
{
- plugin: "controller/subscribe",
+ plugin: "controller/subscribe",
exclude: ["jquery/controller/controller.js",
"jquery/class/class.js",
"jquery/lang/lang.js",
@@ -16,17 +16,19 @@ var i, fileName, cmd,
"event/default",
"event/destroyed",
"event/drag",
+ "event/pause",
+ "event/resize",
{
- plugin: "event/drag/limit",
+ plugin: "event/drag/limit",
exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
{
- plugin: "event/drag/scroll",
+ plugin: "event/drag/scroll",
exclude: ["jquery/dom/within/within.js", "jquery/dom/compare/compare.js", "jquery/event/drop/drop.js","jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
{
plugin: "event/drop",
exclude: ["jquery/lang/vector/vector.js", "jquery/event/livehack/livehack.js", "jquery/event/drag/drag.js"]},
"event/hover",
- "view/ejs",
+ "view/ejs",
"dom/closest",
"dom/compare",
{
@@ -35,17 +37,9 @@ var i, fileName, cmd,
},
"dom/fixture",
"dom/form_params",
- "dom/within",
+ "dom/within",
"dom/cur_styles",
"model",
- {
- plugin: "model/associations",
- exclude: ["jquery/class/class.js",
- "jquery/lang/lang.js",
- "jquery/event/destroyed/destroyed.js",
- "jquery/lang/openajax/openajax.js",
- "jquery/model/model.js"]
- },
{
plugin: "model/backup",
exclude: ["jquery/class/class.js",
@@ -96,7 +90,8 @@ var i, fileName, cmd,
]
-steal.plugins('steal/build/pluginify').then( function(s){
+steal.File('jquery/dist').mkdir();
+steal('steal/build/pluginify').then( function(s){
var plugin, exclude, fileDest, fileName;
for(i=0; i< plugins.length; i++) {
}
fileName = fileName || "jquery." + plugin.replace(/\//g, ".").replace(/dom\./, "").replace(/\_/, "") + ".js";
fileDest = "jquery/dist/" + fileName
- // compress
+ // compress
var outBaos = new java.io.ByteArrayOutputStream();
var output = new java.io.PrintStream(outBaos);
runCommand("java", "-jar", "steal/build/scripts/compiler.jar", "--compilation_level", "SIMPLE_OPTIMIZATIONS", "--warning_level", "QUIET", "--js", fileDest, {
output: output
});
-
+
var minFileDest = fileDest.replace(".js", ".min.js")
new steal.File(minFileDest).save(outBaos.toString());
print("***" + fileName + " pluginified and compressed")
diff --git a/buildAll.js b/buildAll.js
index 06cbf45e..ba130056 100644
--- a/buildAll.js
+++ b/buildAll.js
@@ -1,39 +1,86 @@
-// load('jquery/build.js')
+// load('jquery/buildAll.js')
-load('steal/rhino/steal.js')
+load('steal/rhino/rhino.js')
// load every plugin in a single app
// get dependency graph
// generate single script
-steal.plugins('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( function(s){
+steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( function(s){
var ignore = /\.\w+|test|generate|dist|qunit|fixtures|pages/
-
- var plugins = [];
-
+
+ var plugins = [],
+ /**
+ * {"path/to/file.js" : ["file2/thing.js", ...]}
+ */
+ files = {};
+
s.File('jquery').contents(function( name, type, current ) {
if (type !== 'file' && !ignore.test(name)) {
var folder = current+"/"+name;
- print(folder);
- plugins.push(folder);
- steal.File(folder).contents(arguments.callee, folder)
+ if(readFile(folder+"/"+name+".js")){
+ print(folder);
+ plugins.push(folder);
+ steal.File(folder).contents(arguments.callee, folder)
+ }
+
//steal.File(path + "/" + (current ? current + "/" : "") + name).contents(arguments.callee, (current ? current + "/" : "") + name);
}
},"jquery");
-
+
// tell it to load all plugins into this page
- rhinoLoader = {
- callback: function( s ) {
- s.plugins.apply(s,plugins);
- }
- };
-
- steal.win().build_in_progress = true;
+
+
+ //steal.win().build_in_progress = true;
print(" LOADING APP ")
+ steal.build.open('steal/rhino/blank.html', {
+ startFiles: plugins
+ }, function(opener){
+
+ opener.each('js', function(options, text, stl){
+ print(options.rootSrc)
+ var dependencies = files[options.rootSrc] = [];
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if (depend.options.rootSrc !== "jquery/jquery.js") {
+ dependencies.push(depend.options.rootSrc);
+ }
+ }
+ }
+ })
+
+ s.File("jquery/dist/standalone").mkdirs();
+ s.File("jquery/dist/standalone/dependencies.json").save($.toJSON(files));
+ //get each file ...
+ print("Creating jquery/dist/standalone/")
+ var compressor = s.build.builders.scripts.compressors[ "localClosure"]()
+ for(var path in files){
+ if(path == "jquery/jquery.js"){
+ continue;
+ }
+ var content = readFile(path);
+ var funcContent = s.build.pluginify.getFunction(content);
+ if(typeof funcContent == "undefined"){
+ content = "";
+ } else {
+ content = "("+s.build.pluginify.getFunction(content)+")(Foundry);";
+ }
+ var out = path.replace(/\/\w+\.js/,"").replace(/\//g,".");
+ content = s.build.builders.scripts.clean(content);
+ print(" "+out+"");
+ content = s.build.builders.scripts.clean(content);
+ s.File("jquery/dist/standalone/"+out+".js").save(content);
+ // s.File("jquery/dist/standalone/"+out+".min.js").save(compressor(content));
+ }
+
+ })
+
+ /*
var pageSteal = steal.build.open("steal/rhino/empty.html").steal,
steals = pageSteal.total,
- //hash of names to steals
+
files = {},
depends = function(stl, steals){
if(stl.dependencies){
@@ -41,24 +88,24 @@ steal.plugins('steal/build/pluginify','steal/build/apps','steal/build/scripts').
var depend = stl.dependencies[d];
if(!steals[depend.path]){
steals[depend.path] = true;
- print(" " + depend.path);
+ print("123 " + depend.path);
//depends(depend, steals);
}
-
-
+
+
}
}
},
all = function(c){
for(var i =0; i < steals.length; i++){
var pSteal =steals[i];
-
+
if(!pSteal.func){
c(pSteal)
}
-
+
}
-
+
};
print(" LOADED, GETTING DEPENDS");
all(function(stl){
@@ -70,33 +117,14 @@ steal.plugins('steal/build/pluginify','steal/build/apps','steal/build/scripts').
if(stl.dependencies){
for (var d = 0; d < stl.dependencies.length; d++) {
var depend = stl.dependencies[d];
- dependencies.push(depend.path);
+ if (depend.path !== "jquery/jquery.js") {
+ dependencies.push(depend.path);
+ }
}
}
- })
-
- steal.File("jquery/dist/standalone/dependencies.json").save($.toJSON(files));
- //get each file ...
- print("Creating jquery/dist/standalone/")
- var compressor = steal.build.builders.scripts.compressors[ "localClosure"]()
- for(var path in files){
- if(path == "jquery/jquery.js"){
- continue;
- }
- var content = readFile(path);
- var funcContent = s.build.pluginify.getFunction(content);
- if(typeof funcContent == "undefined"){
- content = "";
- } else {
- content = "("+s.build.pluginify.getFunction(content)+")(jQuery);";
- }
- var out = path.replace(/\/\w+\.js/,"").replace(/\//g,".");
- content = steal.build.builders.scripts.clean(content);
- print(" "+out+"");
- content = steal.build.builders.scripts.clean(content);
- s.File("jquery/dist/standalone/"+out+".js").save(content);
- s.File("jquery/dist/standalone/"+out+".min.js").save(compressor(content));
- }
-
-
-})
\ No newline at end of file
+ })*/
+
+
+
+
+})
diff --git a/buildModule.js b/buildModule.js
new file mode 100644
index 00000000..5c813136
--- /dev/null
+++ b/buildModule.js
@@ -0,0 +1,179 @@
+// load('jquery/buildAll.js')
+
+load('steal/rhino/rhino.js')
+
+
+// load every plugin in a single app
+// get dependency graph
+// generate single script
+
+steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( function(s){
+ var ignore = /\.\w+|test|generate|dist|qunit|fixtures|pages/
+
+ var plugins = [],
+ /**
+ * {"path/to/file.js" : ["file2/thing.js", ...]}
+ */
+ files = {};
+
+ s.File('jquery').contents(function( name, type, current ) {
+ if (type !== 'file' && !ignore.test(name)) {
+ var folder = current+"/"+name;
+ if(readFile(folder+"/"+name+".js")){
+ print(folder);
+ plugins.push(folder);
+ steal.File(folder).contents(arguments.callee, folder)
+ }
+
+ //steal.File(path + "/" + (current ? current + "/" : "") + name).contents(arguments.callee, (current ? current + "/" : "") + name);
+ }
+ },"jquery");
+
+ // tell it to load all plugins into this page
+
+
+ //steal.win().build_in_progress = true;
+ print(" LOADING APP ")
+ steal.build.open('steal/rhino/blank.html', {
+ startFiles: plugins
+ }, function(opener){
+
+ opener.each('js', function(options, text, stl){
+ print(options.rootSrc)
+ var dependencies = files[options.rootSrc] = [];
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if (depend.options.rootSrc !== "jquery/jquery.js") {
+ dependencies.push(depend.options.rootSrc);
+ }
+ }
+ }
+ });
+
+ var toModuleName = function(path) {
+ return path.replace(/\/\w+\.js/,"").replace(/\//g,".").replace("jquery.","");
+ };
+
+ var excludeModule = "";
+
+ s.File("jquery/dist/modules/mvc").mkdirs();
+
+ //get each file ...
+ print("Creating jquery/dist/modules/")
+
+ for (var path in files) {
+
+ if (path=="jquery/jquery.js") {
+ continue;
+ }
+
+ var name = toModuleName(path),
+ content = readFile(path),
+ deps = files[path],
+ exports = s.build.pluginify.getFunctionBody(content);
+
+ var module = "",
+ moduleName = "mvc/" + name;
+
+ // Do not build empty scripts.
+ if(typeof exports == "undefined") {
+ excludeModule += moduleName + ",";
+ continue;
+ }
+
+ // Translate dependencies
+ var moduleDeps = [];
+ for (var i in deps) {
+ var moduleDep = "mvc/" + toModuleName(deps[i]);
+
+ if (moduleDep == moduleName || excludeModule.indexOf(moduleDep) > -1) {
+ continue;
+ }
+
+ moduleDeps.push(moduleDep);
+ }
+
+ var moduleFile = "jquery/dist/modules/"+moduleName+".js",
+ rawModuleFile = "jquery/dist/modules/"+moduleName+".js.raw"
+
+ s.File(rawModuleFile).save(exports);
+
+ var args = ["-n", moduleName];
+
+ if (moduleDeps.length > 0) {
+ args.push("-d")
+ args.push(moduleDeps.join(","));
+ }
+
+ args.push(rawModuleFile);
+
+ var result = {
+ args: args,
+ input: "",
+ output: "",
+ err: ""
+ };
+
+ runCommand("../../build/modularize", result);
+
+ module = s.build.builders.scripts.clean(result.output);
+
+ print(" "+moduleName+"");
+
+ s.File("jquery/dist/modules/"+moduleName+".js").save(module);
+ }
+
+ })
+
+ /*
+ var pageSteal = steal.build.open("steal/rhino/empty.html").steal,
+ steals = pageSteal.total,
+
+ files = {},
+ depends = function(stl, steals){
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if(!steals[depend.path]){
+ steals[depend.path] = true;
+ print("123 " + depend.path);
+ //depends(depend, steals);
+ }
+
+
+ }
+ }
+ },
+ all = function(c){
+ for(var i =0; i < steals.length; i++){
+ var pSteal =steals[i];
+
+ if(!pSteal.func){
+ c(pSteal)
+ }
+
+ }
+
+ };
+ print(" LOADED, GETTING DEPENDS");
+ all(function(stl){
+ files[stl.path] = stl;
+ })
+ all(function(stl){
+ print(stl.path)
+ var dependencies = files[stl.path] = [];
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if (depend.path !== "jquery/jquery.js") {
+ dependencies.push(depend.path);
+ }
+ }
+ }
+ })*/
+
+
+
+
+})
diff --git a/buildScripts.js b/buildScripts.js
new file mode 100644
index 00000000..681de0e0
--- /dev/null
+++ b/buildScripts.js
@@ -0,0 +1,179 @@
+// load('jquery/buildAll.js')
+
+load('steal/rhino/rhino.js')
+
+
+// load every plugin in a single app
+// get dependency graph
+// generate single script
+
+steal('steal/build/pluginify','steal/build/apps','steal/build/scripts').then( function(s){
+ var ignore = /\.\w+|test|generate|dist|qunit|fixtures|pages/
+
+ var plugins = [],
+ /**
+ * {"path/to/file.js" : ["file2/thing.js", ...]}
+ */
+ files = {};
+
+ s.File('jquery').contents(function( name, type, current ) {
+ if (type !== 'file' && !ignore.test(name)) {
+ var folder = current+"/"+name;
+ if(readFile(folder+"/"+name+".js")){
+ print(folder);
+ plugins.push(folder);
+ steal.File(folder).contents(arguments.callee, folder)
+ }
+
+ //steal.File(path + "/" + (current ? current + "/" : "") + name).contents(arguments.callee, (current ? current + "/" : "") + name);
+ }
+ },"jquery");
+
+ // tell it to load all plugins into this page
+
+
+ //steal.win().build_in_progress = true;
+ print(" LOADING APP ")
+ steal.build.open('steal/rhino/blank.html', {
+ startFiles: plugins
+ }, function(opener){
+
+ opener.each('js', function(options, text, stl){
+ print(options.rootSrc)
+ var dependencies = files[options.rootSrc] = [];
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if (depend.options.rootSrc !== "jquery/jquery.js") {
+ dependencies.push(depend.options.rootSrc);
+ }
+ }
+ }
+ });
+
+ var toModuleName = function(path) {
+ return path.replace(/\/\w+\.js/,"").replace(/\//g,".").replace("jquery.","");
+ };
+
+ var excludeModule = "";
+
+ s.File("jquery/dist/modules/mvc").mkdirs();
+
+ //get each file ...
+ print("Creating jquery/dist/modules/")
+
+ for (var path in files) {
+
+ if (path=="jquery/jquery.js") {
+ continue;
+ }
+
+ var name = toModuleName(path),
+ content = readFile(path),
+ deps = files[path],
+ exports = s.build.pluginify.getFunctionBody(content);
+
+ var module = "",
+ moduleName = "mvc/" + name;
+
+ // Do not build empty scripts.
+ if(typeof exports == "undefined") {
+ excludeModule += moduleName + ",";
+ continue;
+ }
+
+ // Translate dependencies
+ var moduleDeps = [];
+ for (var i in deps) {
+ var moduleDep = "mvc/" + toModuleName(deps[i]);
+
+ if (moduleDep == moduleName || excludeModule.indexOf(moduleDep) > -1) {
+ continue;
+ }
+
+ moduleDeps.push(moduleDep);
+ }
+
+ // var moduleFile = "jquery/dist/modules/"+moduleName+".js",
+ // rawModuleFile = "jquery/dist/modules/"+moduleName+".js.raw"
+
+ // s.File(rawModuleFile).save(exports);
+
+ // var args = ["-n", moduleName];
+
+ // if (moduleDeps.length > 0) {
+ // args.push("-d")
+ // args.push(moduleDeps.join(","));
+ // }
+
+ // args.push(rawModuleFile);
+
+ // var result = {
+ // args: args,
+ // input: "",
+ // output: "",
+ // err: ""
+ // };
+
+ // runCommand("../../build/modularize", result);
+
+ module = s.build.builders.scripts.clean("(function(){" + exports + "})();");
+
+ print(" "+moduleName+"");
+
+ s.File("jquery/dist/modules/"+moduleName+".js").save(module);
+ }
+
+ })
+
+ /*
+ var pageSteal = steal.build.open("steal/rhino/empty.html").steal,
+ steals = pageSteal.total,
+
+ files = {},
+ depends = function(stl, steals){
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if(!steals[depend.path]){
+ steals[depend.path] = true;
+ print("123 " + depend.path);
+ //depends(depend, steals);
+ }
+
+
+ }
+ }
+ },
+ all = function(c){
+ for(var i =0; i < steals.length; i++){
+ var pSteal =steals[i];
+
+ if(!pSteal.func){
+ c(pSteal)
+ }
+
+ }
+
+ };
+ print(" LOADED, GETTING DEPENDS");
+ all(function(stl){
+ files[stl.path] = stl;
+ })
+ all(function(stl){
+ print(stl.path)
+ var dependencies = files[stl.path] = [];
+ if(stl.dependencies){
+ for (var d = 0; d < stl.dependencies.length; d++) {
+ var depend = stl.dependencies[d];
+ if (depend.path !== "jquery/jquery.js") {
+ dependencies.push(depend.path);
+ }
+ }
+ }
+ })*/
+
+
+
+
+})
diff --git a/class/class.html b/class/class.html
index a4386612..ef16143d 100644
--- a/class/class.html
+++ b/class/class.html
@@ -61,11 +61,9 @@
History Tabs
-