Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of git://github.com/bitovi/canjs

  • Loading branch information...
commit 8088b28a5ba9902d301a4ff7cfd6a490206ddb49 2 parents 5710d45 + 089cb3e
@imjoshdean imjoshdean authored
Showing with 22,988 additions and 53,158 deletions.
  1. +1 −0  .gitignore
  2. +0 −6 .gitmodules
  3. +4 −4 .travis.yml
  4. +77 −24 build/build.js
  5. +2 −2 build/ci/init.sh
  6. +11 −2 build/ci/stealconfig.js
  7. +63 −0 build/downloads.json
  8. +10 −3 build/make/all.js
  9. +9 −0 build/make/amd.js
  10. +7 −7 build/plugins.js
  11. +12 −14 build/settings.js
  12. +0 −39 build/tasks/build.js
  13. +0 −19 build/tasks/docco.js
  14. +0 −48 build/tasks/minify.js
  15. +0 −91 build/tasks/release/descriptions.json
  16. +0 −27 build/tasks/release/gitdeploy.js
  17. 0  build/tasks/release/index.js
  18. +0 −43 build/tasks/release/jakefile.js
  19. +0 −15 build/tasks/release/package.json
  20. +0 −304 build/tasks/release/release.js
  21. +0 −105 build/tasks/release/s3-post.js
  22. +0 −28 build/tasks/strip.js
  23. +0 −30 build/tasks/utils.js
  24. +0 −47 build/templates/index.html
  25. +235 −0 build/templates/qunit.css
  26. +11 −9 build/templates/test.html.ejs
  27. +0 −1,200 build/underscore.js
  28. +1 −1  can.js
  29. +75 −2 changelog.md
  30. +1 −1  construct/construct.js
  31. +8 −0 construct/proxy/proxy.js
  32. +21 −6 construct/proxy/proxy_test.js
  33. +1 −1  construct/proxy/qunit.html
  34. +13 −14 control/control.js
  35. +23 −4 control/control_test.js
  36. +1 −1  control/modifier/key/key.js
  37. +5 −12 control/modifier/modifier.js
  38. +59 −41 control/modifier/modifier_test.js
  39. +0 −3  control/modifier/qunit.html
  40. +0 −189 control/pages/listening.md
  41. +0 −101 control/pages/plugin.md
  42. +0 −3  control/plugin/plugin.js
  43. +1 −1  control/view/qunit.html
  44. +4 −4 control/view/test/{qunit → }/view_test.js
  45. 0  control/view/test/{qunit → }/views/init.micro
  46. +1 −0  control/view/view.js
  47. +4 −1 control/view/view.md
  48. +51 −13 grunt.js
  49. +9,472 −0 lib/jquery.1.8.3.js
  50. 0  {util/mootools → lib}/mootools-core-1.4.3.js
  51. 0  {util/yui → lib}/yui-3.7.3.js
  52. 0  {util/zepto → lib}/zepto.1.0rc1.js
  53. +5 −5 model/list/list.js
  54. +2 −10 model/list/list_test.js
  55. +1 −1  model/list/local/local.js
  56. +20 −5 model/model.js
  57. +52 −7 model/model_test.js
  58. +143 −0 observe/batch_events.md
  59. +107 −0 observe/compute/compute.html
  60. +38 −0 observe/compute/compute.js
  61. +56 −8 observe/compute/compute_test.js
  62. +1 −2  observe/delegate/delegate.js
  63. +0 −140 observe/demo.html
  64. +237 −47 observe/observe.js
  65. +115 −3 observe/observe_test.js
  66. BIN  observe/remove.png
  67. +23 −22 observe/sort/sort.js
  68. +49 −10 observe/sort/sort_test.js
  69. +9 −15 package.json
  70. +3 −3 readme.md
  71. +1 −1  route/route.js
  72. +3 −2 route/route_test.js
  73. +1 −0  test/can_test.js
  74. +0 −8 test/configuration.js
  75. +195 −0 test/demo.html
  76. +2,444 −0 test/ie shims/a.ie8.js
  77. +72 −0 test/ie shims/a.ielt8.htc
  78. +3,429 −0 test/ie shims/a.ielt8.js
  79. +59 −0 test/ie shims/a.js
  80. +1 −0  test/ie shims/readme.txt
  81. +9 −7 test/index.html
  82. +35 −1 test/plugin_test.html
  83. +9 −4 test/plugin_test.js
  84. +45 −42 test/setup.js
  85. +11 −5 test/test.html
  86. +5 −3 util/array/each.js
  87. +605 −0 util/can.js
  88. +25 −16 util/deferred.js
  89. +1 −1  util/demos/demos.css
  90. +383 −226 util/dojo/dojo.js
  91. +1 −1  util/dojo/nodelist-traverse.js
  92. +1 −1  util/dojo/trigger.js
  93. +1 −1  util/event.js
  94. +250 −99 util/fixture/fixture.js
  95. +4 −2 util/fixture/fixture.md
  96. +4 −4 util/fixture/fixture_test.js
  97. +19 −18 util/fragment.js
  98. +258 −112 util/hashchange.js
  99. +0 −9,266 util/jquery/jquery.1.7.1.js
  100. +0 −9,227 util/jquery/jquery.1.8.0.js
  101. +0 −9,301 util/jquery/jquery.1.8.1.js
  102. +0 −9,440 util/jquery/jquery.1.8.2.js
  103. +3 −3 util/jquery/jquery.js
  104. +4 −0 util/library.js
  105. +0 −6,447 util/mootools/mootools-core-1.4.5.js
  106. +16 −5 util/mootools/mootools.js
  107. +1 −10 util/mvc.js
  108. +3 −3 util/string/deparam/deparam.js
  109. +11 −6 util/string/string.js
  110. +9 −4 util/string/string_test.js
  111. +2 −623 util/util.js
  112. +96 −112 util/yui/yui.js
  113. +0 −49 util/zepto/data.js
  114. +111 −74 util/zepto/zepto.js
  115. +0 −7 view/compress.js
  116. +91 −0 view/ejs/demo.html
  117. +11 −20 view/ejs/ejs.js
  118. +168 −80 view/ejs/test/ejs_test.js
  119. +0 −57 view/ejs/test/indirect2.html
  120. +0 −6 view/ejs/test/indirect3.ejs
  121. +0 −3  view/ejs/test/indirect4.ejs
  122. +0 −47 view/ejs/test/indirectEJS.html
  123. +0 −11 view/ejs/test/indirectEJS2.ejs
  124. +0 −61 view/ejs/test/inlineEJS.html
  125. +1 −1  view/ejs/test/qunit.html
  126. +22 −0 view/ejs/test/table_test.ejs
  127. +17 −0 view/ejs/test/todo_comments.ejs
  128. +0 −3,774 view/fulljslint.js
  129. +3 −3 view/modifiers/modifiers_test.js
  130. +46 −0 view/mustache/doc/acquisition.md
  131. +120 −0 view/mustache/doc/basics.md
  132. +276 −0 view/mustache/doc/helpers.md
  133. +50 −0 view/mustache/doc/livebinding.md
  134. +66 −0 view/mustache/doc/mustache.md
  135. +94 −0 view/mustache/doc/partials.md
  136. +108 −0 view/mustache/doc/sections.md
  137. +646 −209 view/mustache/mustache.js
  138. +0 −503 view/mustache/mustache.md
  139. +0 −1  view/mustache/spec
  140. +31 −0 view/mustache/spec/Changes
  141. +65 −0 view/mustache/spec/README.md
  142. +27 −0 view/mustache/spec/Rakefile
  143. +47 −0 view/mustache/spec/TESTING.md
  144. +1 −0  view/mustache/spec/specs/comments.json
  145. +103 −0 view/mustache/spec/specs/comments.yml
  146. +1 −0  view/mustache/spec/specs/delimiters.json
  147. +158 −0 view/mustache/spec/specs/delimiters.yml
  148. +1 −0  view/mustache/spec/specs/interpolation.json
  149. +230 −0 view/mustache/spec/specs/interpolation.yml
  150. +1 −0  view/mustache/spec/specs/inverted.json
  151. +193 −0 view/mustache/spec/specs/inverted.yml
  152. +1 −0  view/mustache/spec/specs/partials.json
  153. +101 −0 view/mustache/spec/specs/partials.yml
  154. +1 −0  view/mustache/spec/specs/sections.json
  155. +256 −0 view/mustache/spec/specs/sections.yml
  156. +1 −0  view/mustache/spec/specs/~lambdas.json
  157. +139 −0 view/mustache/spec/specs/~lambdas.yml
  158. +313 −92 view/mustache/test/mustache_test.js
  159. +1 −0  view/mustache/test/partial.mustache
  160. +1 −0  view/mustache/test/table.mustache
  161. +1 −8 view/mustache/test/test_template.mustache
  162. +26 −22 view/qunit.html
  163. +75 −42 view/render.js
  164. +5 −4 view/scanner.js
  165. 0  view/test/{qunit → }/deferred.ejs
  166. 0  view/test/{qunit → }/deferreds.ejs
  167. +1 −0  view/test/helpers.ejs
  168. +1 −0  view/test/helpers.mustache
  169. 0  view/test/{qunit → }/hookup.ejs
  170. +4 −0 view/test/hookupvalcall.ejs
  171. 0  view/test/{qunit → }/large.ejs
  172. 0  view/test/{qunit → }/nested_plugin.ejs
  173. +1 −0  view/test/plugin.ejs
  174. +0 −4 view/test/qunit/hookupvalcall.ejs
  175. +0 −1  view/test/qunit/plugin.ejs
  176. +0 −8 view/test/qunit/qunit.js
  177. +0 −201 view/test/qunit/view_test.js
  178. 0  view/test/{qunit → }/temp.ejs
  179. 0  view/test/{qunit → }/template.ejs
  180. 0  view/test/{qunit → }/template.jaml
  181. 0  view/test/{qunit → }/template.micro
  182. +1 −0  view/test/template.mustache
  183. 0  view/test/{qunit → }/template.tmpl
  184. +0 −1  view/tmpl/test.tmpl
  185. +0 −11 view/tmpl/tmpl_test.js
  186. +1 −1  view/view.html
  187. +164 −53 view/view.js
  188. +33 −2 view/view.md
  189. +113 −58 view/view_test.js
View
1  .gitignore
@@ -11,3 +11,4 @@ docs*
build/ci/can
build/ci/funcunit
build/ci/steal
+build/gh-pages
View
6 .gitmodules
@@ -1,6 +0,0 @@
-[submodule "util/docco/docco"]
- path = util/docco/docco
- url = https://github.com/jupiterjs/docco.git
-[submodule "view/mustache/spec"]
- path = view/mustache/spec
- url = https://github.com/mustache/spec.git
View
8 .travis.yml
@@ -3,8 +3,8 @@ node_js: 0.8
before_script: build/ci/init.sh
script:
# TODO Zepto running in Phantom - phantomjs build/ci/phantom.js http://localhost:8000/can/test/can_zepto.html
- # TODO - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?dojo
- - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?jquery
- - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?mootools
- - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?yui
+ - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?library=dojo
+ - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?library=jquery
+ - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?library=mootools
+ - phantomjs build/ci/phantom.js http://localhost:8000/can/test/test.html?library=yui
- phantomjs build/ci/phantom.js http://localhost:8000/can/test/plugin_test.html
View
101 build/build.js
@@ -1,42 +1,47 @@
-load("can/build/underscore.js");
+load("build/underscore.js");
var _ = this._;
load("steal/rhino/rhino.js");
-steal("can/test/configuration.js", 'steal/build/pluginify', "steal/generate/ejs.js", 'can/build/settings.js',
-function (testConfig, pluginify, EJS, libs) {
+steal('can/test/configuration.js',
+ 'steal/build/pluginify',
+ 'steal/build/amdify',
+ 'steal/generate/ejs.js',
+ 'can/build/settings.js',
+function (testConfig, pluginify, amdify, EJS, libs) {
// Use with ./js can/build/dist.js <outputfolder> <version> <library1> <library2>
var version = _args[1] || 'edge';
var libraries = _args[2] ? _args.slice(2) : _.keys(libs);
var outFolder = (_args[0] || 'can/dist/') + version + '/';
- var testFolder = outFolder + '/test/';
- var render = function (from, to, data) {
- var text = readFile(from);
- var res = new EJS({
- text : text,
- name : from
- }).render(data);
- steal.File(to).save(res);
- }
-
- console.log(libraries);
- steal.File(outFolder).mkdirs();
- steal.File(testFolder).mkdirs();
-
- _.each(libraries, function (lib) {
+ /**
+ * Build CanJS and test files for a given library
+ *
+ * @param lib
+ */
+ var buildLibrary = function (lib) {
var options = libs[lib],
- outFile = outFolder + "/can." + lib + "-" + version + ".js",
- testFile = testFolder + lib + '.html',
+ outFile = outFolder + '/can.' + lib,
+ // testFile = testFolder + lib + '.html',
+ buildFile = "can/build/make/" + lib + ".js",
defaults = {
- out : outFile,
+ out : outFile + '.js',
onefunc : true,
compress : false,
skipAll : true
};
console.log('Building ' + lib + ' ' + version + ' to ' + outFile);
- steal.build.pluginify("can/build/make/" + lib + ".js", _.extend(defaults, options));
+ steal.build.pluginify(buildFile, _.extend(defaults, options));
+ steal.build.pluginify(buildFile, _.extend(defaults, options, {
+ compress : true,
+ out : outFile + '.min.js'
+ }));
+ };
+ /*
+ var generateTestFiles = function() {
+ _.each(libs, function(lib) {
+ });
console.log('Creating distributable test HTML file ' + testFile);
render('can/build/templates/test.html.ejs', testFile, {
name : testConfig[lib].name,
@@ -45,6 +50,54 @@ function (testConfig, pluginify, EJS, libs) {
type : lib
});
new steal.File('can/build/templates/qunit.js').copyTo(testFolder + '/qunit.js');
- new steal.File('can/build/templates/index.html').copyTo(testFolder + '/index.html');
- });
+ new steal.File('can/build/templates/qunit.css').copyTo(testFolder + '/qunit.css');
+ }
+ */
+ /**
+ * Build can.jquery-all.js with all plugins.
+ */
+ var buildjQueryAll = function() {
+ var options = libs.jquery,
+ outFile = outFolder + '/can.jquery-all',
+ buildFile = "can/build/make/all.js",
+ defaults = {
+ out : outFile + '.js',
+ // onefunc : true,
+ shim : {
+ jquery : 'jQuery',
+ 'jquery/jquery.js' : 'jQuery'
+ },
+ compress : false,
+ skipAll : true
+ };
+
+ console.log('Building ' + outFile + ' ' + version + ' to ' + outFile);
+ steal.build.pluginify(buildFile, _.extend(defaults, options));
+ steal.build.pluginify(buildFile, _.extend(defaults, options, {
+ compress : true,
+ out : outFile + '.min.js'
+ }));
+ };
+ /**
+ * Build the AMD module distributable
+ */
+ var buildAmd = function() {
+ var excludes = [ "can/build/make/amd.js", "can/util/util.js" ];
+ _.each(_.values(libs), function(val) {
+ excludes = excludes.concat(val.exclude);
+ });
+ steal.build.amdify('can/build/make/amd.js', {
+ out: outFolder + '/amd',
+ exclude: excludes,
+ map : {
+ 'can/util' : 'can/util/library'
+ }
+ });
+ };
+
+ steal.File(outFolder).mkdirs();
+
+ _.each(libraries, buildLibrary);
+ buildjQueryAll();
+ buildAmd();
});
View
4 build/ci/init.sh
@@ -10,8 +10,8 @@ cd $BASEDIR
../../node_modules/.bin/http-server -p 8000 &
# We only need shallow clones for Steal and FuncUnit
-git clone https://github.com/jupiterjs/steal.git --depth=1 --quiet
-git clone https://github.com/jupiterjs/funcunit.git --depth=1 --quiet
+git clone https://github.com/bitovi/steal.git --depth=1 --quiet
+git clone https://github.com/bitovi/funcunit.git --depth=1 --quiet
# Initialize submodule (Syn)
cd funcunit
View
13 build/ci/stealconfig.js
@@ -1,12 +1,21 @@
steal.config({
map: {
"*": {
- 'jquery/jquery.js' : "jquery",
+ "jquery/jquery.js" : "jquery",
"can/util/util.js": "can/util/jquery/jquery.js"
}
},
paths: {
- "jquery": "can/util/jquery/jquery.1.8.2.js"
+ "jquery": "can/lib/jquery.1.8.3.js",
+ "mootools/mootools.js" : "can/lib/mootools-core-1.4.3.js",
+ "dojo/dojo.js" : "can/util/dojo/dojo-1.8.1.js",
+ "yui/yui.js" : "can/lib/yui-3.7.3.js",
+ "zepto/zepto.js" : "can/lib/zepto.1.0rc1.js"
+ },
+ shim : {
+ jquery: {
+ exports: "jQuery"
+ }
},
ext: {
js: "js",
View
63 build/downloads.json
@@ -0,0 +1,63 @@
+{
+ "jquery": {
+ "src": "dist/<%= pkg.version %>/can.jquery.js",
+ "description": "Can jQuery <%= pkg.version %> Development",
+ "filename": "can.jquery-<%= pkg.version %>.js"
+ },
+ "jqueryMin": {
+ "src": "dist/<%= pkg.version %>/can.jquery.min.js",
+ "description": "Can jQuery <%= pkg.version %> Production",
+ "filename": "can.jquery-<%= pkg.version %>.min.js"
+ },
+ "zepto": {
+ "src": "dist/<%= pkg.version %>/can.zepto.js",
+ "description": "Can Zepto <%= pkg.version %> Development",
+ "filename": "can.zepto-<%= pkg.version %>.js"
+ },
+ "zeptoMin": {
+ "src": "dist/<%= pkg.version %>/can.zepto.min.js",
+ "description": "Can Zepto <%= pkg.version %> Production",
+ "filename": "can.zepto-<%= pkg.version %>.min.js"
+ },
+ "yui": {
+ "src": "dist/<%= pkg.version %>/can.yui.js",
+ "description": "Can YUI <%= pkg.version %> Development",
+ "filename": "can.yui-<%= pkg.version %>.js"
+ },
+ "yuiMin": {
+ "src": "dist/<%= pkg.version %>/can.yui.min.js",
+ "description": "Can YUI <%= pkg.version %> Production",
+ "filename": "can.yui-<%= pkg.version %>.min.js"
+ },
+ "mootools": {
+ "src": "dist/<%= pkg.version %>/can.mootools.js",
+ "description": "Can Mootools <%= pkg.version %> Development",
+ "filename": "can.mootools-<%= pkg.version %>.js"
+ },
+ "mootoolsMin": {
+ "src": "dist/<%= pkg.version %>/can.mootools.min.js",
+ "description": "Can Mootools <%= pkg.version %> Production",
+ "filename": "can.mootools-<%= pkg.version %>.min.js"
+ },
+ "dojo": {
+ "src": "dist/<%= pkg.version %>/can.dojo.js",
+ "description": "Can Dojo <%= pkg.version %> Development",
+ "filename": "can.dojo-<%= pkg.version %>.js"
+ },
+ "dojoMin": {
+ "src": "dist/<%= pkg.version %>/can.dojo.min.js",
+ "description": "Can Dojo <%= pkg.version %> Production",
+ "filename": "can.dojo-<%= pkg.version %>.min.js"
+ },
+ "dist" : {
+ "src" : "dist/can.js.<%= pkg.version %>.zip",
+ "description" : "CanJS <%= pkg.version %>",
+ "filename" : "can.js.<%= pkg.version %>.zip",
+ "content_type" : "application/zip"
+ },
+ "_options" : {
+ "repository" : "canjs",
+ "user" : "bitovi",
+ "overwrite" : true
+ }
+}
View
13 build/make/all.js
@@ -1,4 +1,11 @@
+steal.config({
+ map: {
+ "*": {
+ "can/util/util.js": "can/util/jquery/jquery.js"
+ }
+ }
+});
steal('can/util', 'can/construct/proxy', 'can/construct/super', 'can/control', 'can/control/plugin',
- 'can/control/modifier', 'can/view/modifiers', 'can/model', 'can/view/ejs', 'can/route', function(can) {
- return can;
-});
+ 'can/view/mustache', 'can/view/modifiers', 'can/model', 'can/view/ejs',
+ 'can/observe/attributes', 'can/observe/delegate', 'can/observe/setter',
+ 'can/observe/validations', 'can/route', 'can/view/modifiers', 'can/observe/backup');
View
9 build/make/amd.js
@@ -0,0 +1,9 @@
+steal('can/can.js', 'can/construct/proxy', 'can/construct/super', 'can/control/plugin', 'can/view/modifiers',
+ 'can/view/mustache', 'can/observe/attributes', 'can/observe/delegate', 'can/observe/list',
+ 'can/observe/setter', 'can/observe/validations', 'can/view/modifiers', 'can/observe/backup',
+ 'can/util/fixture', 'can/util/library.js', 'can/util/mootools', 'can/util/dojo', 'can/util/yui',
+ 'can/util/zepto', 'can/util/jquery',
+
+function(can) {
+ return can;
+});
View
14 build/plugins.js
@@ -1,11 +1,11 @@
-load("can/build/underscore.js");
+load("build/underscore.js");
var _ = this._;
load("steal/rhino/rhino.js");
steal('steal/build/pluginify', 'can/build/settings.js', function () {
- // Use with ./js can/build/dist.js <outputfolder> <version> <library1> <library2>
+ // Use with ./js can/build/dist.js <outputfolder> <version> <library1> <library2> <libraryN>
var version = _args[1] || 'edge';
- var outFolder = (_args[0] || 'can/dist/') + version + '/plugins/';
+ var outFolder = (_args[0] || 'can/dist/') + version + '/';
var wrapjQuery = {
wrapInner : ['(function(window, $, can, undefined) {\n', '\n})(this, jQuery, can);']
};
@@ -23,9 +23,6 @@ steal('steal/build/pluginify', 'can/build/settings.js', function () {
name : "control.plugin",
options : wrapjQuery
},
- "control/view/view" : {
- name : "control.view"
- },
"observe/attributes/attributes" : {
name : "observe.attributes"
},
@@ -38,6 +35,9 @@ steal('steal/build/pluginify', 'can/build/settings.js', function () {
"observe/validations/validations" : {
name : "observe.validations"
},
+ "view/mustache/mustache" : {
+ name : "view.mustache"
+ },
"view/modifiers/modifiers" : {
name : "view.modifiers",
options : wrapjQuery
@@ -54,7 +54,7 @@ steal('steal/build/pluginify', 'can/build/settings.js', function () {
_.each(plugins, function (config, module) {
var fileName = "can/" + module + ".js";
- var pluginName = outFolder + "/can." + config.name + "-" + version + ".js"
+ var pluginName = outFolder + "/can." + config.name + ".js"
console.log("Building plugin " + fileName + " to " + pluginName);
steal.build.pluginify(fileName, _.extend({
out : pluginName,
View
26 build/settings.js
@@ -1,31 +1,29 @@
steal(function () {
return {
"jquery" : {
- exclude : ["jquery"],
+ exclude : ["jquery", "jquery/jquery.js"],
wrapInner : ['(function(window, $, undefined) {\n', '\n})(this, jQuery);']
},
"zepto" : {
- exclude : ["zepto.1.0rc1.js"],
+ exclude : ["zepto", "zepto/zepto.js"],
wrapInner : ['(function(window, $, undefined) {\n', '\n})(this, Zepto)']
},
"mootools" : {
- exclude : [ "can/util/mootools/mootools-core-1.4.5.js", "mootools-core-1.4.3.js" ]
+ exclude : ["mootools", "mootools/mootools.js"]
},
"dojo" : {
- wrapInner : [
- '\ndefine("can/dojo", ["dojo/query", "dojo/NodeList-dom", "dojo/NodeList-traverse"], function(){\n',
- '\nreturn can;\n});\n'
- ]
+ exclude : ["dojo", "dojo/dojo.js"]
},
"yui" : {
+ exclude : ["yui", "yui/yui.js"]
/* TODO probably needs to look somehow like this
- wrapInner : [
- '(function(can, window, undefined){\nYUI().add("can", function(Y) {\ncan.Y = Y;\n',
- '}, "0.0.1", {\n' +
- 'requires: ["node", "io-base", "querystring", "event-focus", "array-extras"],' +
- '\n optional: ["selector-css2", "selector-css3"]\n});\n})(can = {}, this );'
- ]
- */
+ wrapInner : [
+ '(function(can, window, undefined){\nYUI().add("can", function(Y) {\ncan.Y = Y;\n',
+ '}, "0.0.1", {\n' +
+ 'requires: ["node", "io-base", "querystring", "event-focus", "array-extras"],' +
+ '\n optional: ["selector-css2", "selector-css3"]\n});\n})(can = {}, this );'
+ ]
+ */
}
}
});
View
39 build/tasks/build.js
@@ -1,39 +0,0 @@
-var path = require("path");
-var jsDir = path.join( __dirname, "../../..");
-
-module.exports = function( grunt ) {
- grunt.registerMultiTask('build', 'Runs build files.', function() {
- var done = this.async();
- var target = this.target;
- var files = Array.isArray(this.file.src) ? this.file.src : [this.file.src];
- // TODO grunt.file.expandFiles(this.file.src);
- var series = files.map(function (file) {
- return function(callback) {
- var options = grunt.config.process(['build', target]);
- var args = [file, options.out || 'dist/', options.version || 'edge'];
- var libraries = Array.isArray(options.libraries) ? options.libraries : [];
-
- args.push.apply(args, libraries);
-
- grunt.verbose.writeflags(options, 'Options');
- grunt.log.writeln('Running ./js ' + args.toString());
-
- grunt.utils.exec({
- cmd : "./js",
- args : args,
- opts : {
- cwd: jsDir
- }
- }, function(error, result, code) {
- callback(error, result, code);
- });
-
- grunt.log.write("Building " + file + " with Steal...\n");
- }
- });
- grunt.utils.async.parallel(series, function(error, results) {
- grunt.log.writeln('Done building');
- done();
- })
- });
-};
View
19 build/tasks/docco.js
@@ -1,19 +0,0 @@
-/**
- * Grunt Docco task. Based on https://github.com/DavidSouther/grunt-docco
- */
-var docco = require('docco');
-
-module.exports = function(grunt) {
- grunt.registerMultiTask('docco', 'Docco processor.', function() {
- var options = grunt.config(['docco', this.target]);
- grunt.verbose.writeflags(options, 'Options');
-
- var done = this.async();
- var src = grunt.file.expandFiles(this.file.src);
-
- docco.document(src, options.docco || {}, function(err, result, code){
- grunt.log.writeln("Doccoed [" + src.join(", ") + "]; " + err ? err : "(No errors)" + "\n" + result + " " + code);
- done();
- });
- });
-}
View
48 build/tasks/minify.js
@@ -1,48 +0,0 @@
-var path = require('path');
-var fs = require('fs');
-
-module.exports = function( grunt ) {
- grunt.registerMultiTask("minify", "Minifies CanJS, then outputs filesize information", function() {
- var done = this.async();
- var minPostfix = '.min';
- var tasks = [];
- grunt.file.expandFiles(this.file.src).forEach(function (file) {
- if(new RegExp(minPostfix).test(file)) {
- console.log('Ignoring already minified file ' + file);
- return;
- }
-
- tasks.push(function(callback) {
- var minFile = path.join(path.dirname(file), path.basename(file, '.js') + minPostfix + '.js');
- var gzFile = minFile + '.gz';
- fs.stat(file, function(err, stats) {
- if(err) return callback(err);
-
- var originalSize = (stats.size / 1024).toFixed(2);
- console.log('Minifying ' + file + ' original size is ' + originalSize + 'Kb');
- grunt.utils.exec({
- cmd : 'closure',
- args : [file, '--js_output_file', minFile]
- }, function(error, result, code) {
- fs.stat(minFile, function(err, stats) {
- if(err) return callback(err);
-
- var minifiedSize = (stats.size / 1024).toFixed(2);
- var saved = 100 - Math.round((minifiedSize/originalSize) * 100);
- console.log('Created ' + minFile + ' minified size is ' +
- minifiedSize + 'Kb, saved ' + saved + '%')
- return callback(null, result);
- });
- });
- });
- });
- });
-
- console.log(tasks.length);
-
- grunt.utils.async.series(tasks, function(error, results) {
- console.log(results);
- done();
- });
- });
-};
View
91 build/tasks/release/descriptions.json
@@ -1,91 +0,0 @@
-{
- "can.construct.proxy.js": {
- "description": "Can Construct Proxy #{VERSION} Plugin",
- "filename": "can.construct.proxy-#{VERSION}.js"
- },
- "can.observe.validations.js": {
- "description": "Can Observe Validations #{VERSION} Plugin",
- "filename": "can.observe.validations-#{VERSION}.js"
- },
- "can.construct.super.js": {
- "description": "Can Construct Super #{VERSION} Plugin",
- "filename": "can.construct.super-#{VERSION}.js"
- },
- "can.fixture.js": {
- "description": "Can Fixture #{VERSION} Plugin",
- "filename": "can.fixture-#{VERSION}.js"
- },
- "can.observe.attributes.js": {
- "description": "Can Observe Attributes #{VERSION} Plugin",
- "filename": "can.observe.attributes-#{VERSION}.js"
- },
- "can.view.modifiers.js": {
- "description": "Can View Modifiers #{VERSION} Plugin",
- "filename": "can.view.modifiers-#{VERSION}.js"
- },
- "can.control.plugin.js": {
- "description": "Can Control #{VERSION} Plugin",
- "filename": "can.control.plugin-#{VERSION}.js"
- },
- "can.observe.backup.js": {
- "description": "Can Observe #{VERSION} Backup Plugin",
- "filename": "can.observe.backup-#{VERSION}.js"
- },
- "can.control.view.js": {
- "description": "Can Control #{VERSION} View Plugin",
- "filename": "can.control.view-#{VERSION}.js"
- },
- "can.observe.delegate.js": {
- "description": "Can Observe #{VERSION} Delegate Plugin",
- "filename": "can.observe.delegate-#{VERSION}.js"
- },
- "can.observe.setter.js": {
- "description": "Can Observe #{VERSION} Setter Plugin",
- "filename": "can.observe.setter-#{VERSION}.js"
- },
- "can.yui.js": {
- "description": "Can YUI #{VERSION} Development",
- "filename": "can.yui-#{VERSION}.js"
- },
- "can.mootools.js": {
- "description": "Can MooTools #{VERSION} Development",
- "filename": "can.mootools-#{VERSION}.js"
- },
- "can.dojo.js": {
- "description": "Can Dojo #{VERSION} Development",
- "filename": "can.dojo-#{VERSION}.js"
- },
- "can.jquery.js": {
- "description": "Can jQuery #{VERSION} Development",
- "filename": "can.jquery-#{VERSION}.js"
- },
- "can.zepto.js": {
- "description": "Can Zepto #{VERSION} Development",
- "filename": "can.zepto-#{VERSION}.js"
- },
- "can.yui.min.js": {
- "description": "Can YUI #{VERSION} Production",
- "filename": "can.yui-#{VERSION}.min.js"
- },
- "can.mootools.min.js": {
- "description": "Can MooTools #{VERSION} Production",
- "filename": "can.mootools-#{VERSION}.min.js"
- },
- "can.dojo.min.js": {
- "description": "Can Dojo #{VERSION} Production",
- "filename": "can.dojo-#{VERSION}.min.js"
- },
- "can.jquery.min.js": {
- "description": "Can jQuery #{VERSION} Production",
- "filename": "can.jquery-#{VERSION}.min.js"
- },
- "can.zepto.min.js": {
- "description": "Can Zepto #{VERSION} Production",
- "filename": "can.zepto-#{VERSION}.min.js"
- },
- "can.js.zip" : {
- "description": "CanJS v#{VERSION}",
- "filename" : "can.js.#{VERSION}.zip",
- "content_type" : "application/zip"
- }
-}
View
27 build/tasks/release/gitdeploy.js
@@ -1,27 +0,0 @@
-module.exports = function( grunt ) {
- grunt.registerMultiTask("gitdeploy", "Deploys files/folders to a Git repository", function() {
- var done = this.async();
- var options = grunt.config(['gitdeploy', this.target]);
-
- grunt.utils.spawn({
- cmd : 'git',
- args : ['clone', options.repository, '__deploy']
- }, function(error, result, code) {
-
- });
-
- exec('git', function () {
- exec('git', ['checkout', 'gh-pages'], function() {
- jake.cpR(path.join(rootPath + 'can/dist/edge/'), './canjs/release/');
- exec('git', ['add', '.', '--all'], function() {
- exec('git', ['commit', '-m', '"Updating edge"'], function() {
- exec('git', ['push', 'origin', 'gh-pages'], function () {
- exec('rm', [ '-rf', './canjs' ], function() {});
- }, { cwd : './canjs' });
- }, { cwd : './canjs' });
- }, { cwd : './canjs' });
- complete();
- }, { cwd : './canjs' });
- });
- });
-};
View
0  build/tasks/release/index.js
No changes.
View
43 build/tasks/release/jakefile.js
@@ -1,43 +0,0 @@
-var path = require("path"),
- spawn = require("child_process").spawn,
- rootPath = path.join(__dirname, "../../../"),
- exec = function (cmd, args, callback, options) {
- console.log(cmd + ' ' + args.join(' '));
- var spawned = spawn(cmd, args, options || {});
-
- spawned.stdout.pipe(process.stdout, { end : false });
- spawned.stderr.pipe(process.stderr, { end : false });
-
- spawned.on('exit', function () {
- callback();
- });
- };
-
-desc('Runs make.js to build edge');
-task('build', function (params) {
- var executable = process.platform == 'win32' ? 'js.bat' : './js';
- console.log('Building...');
- exec(executable, ['can/util/make.js'], function () {
- complete();
- }, { cwd : rootPath });
-}, { async : true });
-
-namespace('deploy', function () {
- desc('Checkout gh-pages branch and update latest release');
- task('edge', [ 'build' ], function () {
- console.log('Cloning CanUI repository');
- exec('git', ['clone', 'git@github.com:jupiterjs/canjs.git'], function () {
- exec('git', ['checkout', 'gh-pages'], function() {
- jake.cpR(path.join(rootPath + 'can/dist/edge/'), './canjs/release/');
- exec('git', ['add', '.', '--all'], function() {
- exec('git', ['commit', '-m', '"Updating edge"'], function() {
- exec('git', ['push', 'origin', 'gh-pages'], function () {
- exec('rm', [ '-rf', './canjs' ], function() {});
- }, { cwd : './canjs' });
- }, { cwd : './canjs' });
- }, { cwd : './canjs' });
- complete();
- }, { cwd : './canjs' });
- });
- }, { async : true });
-});
View
15 build/tasks/release/package.json
@@ -1,15 +0,0 @@
-{
- "name": "github-download-updater",
- "version" : "0.0.1",
- "dependencies": {
- "commander": ">= 0.1.x",
- "github": ">= 0.1.x",
- "underscore" : ">= 0.1.x",
-<<<<<<< HEAD
-=======
- "underscore.deferred" : ">= 0.1.x",
->>>>>>> 0d3375f89151efa4d70b9e7860d76a4c3cb65e53
- "tafa-misc-util" : ">= 0.1.x"
- },
- "engine": "node >= 0.6.x"
-}
View
304 build/tasks/release/release.js
@@ -1,304 +0,0 @@
-var path = require("path"),
- fs = require("fs"),
- spawn = require("child_process").spawn,
- zlib = require("zlib"),
-
- // Third party modules
- program = require("commander"),
- GitHubApi = require("github"),
- _ = require("underscore"),
- s3p = require("./s3-post.js"),
-
- // Get the current version of CanJS
- version = fs.readFileSync( path.join( __dirname, "../version" )).toString("utf8").trim(),
-
- // Describe all the files we'll be uploading to Github
- descriptions = require("./descriptions.json"),
-
- // Figure out some paths
- rhinoPath = path.join(__dirname, "../../.."),
- distPath = path.join(__dirname, "../../dist/edge"),
-
- // Github client
- github = new GitHubApi({
- version: "3.0.0"
- }),
- canJSRemote = "git@github.com:jupiterjs/canjs.git",
-
- // Timeouts
- stealTimeout,
-
- // For Github credentials
- username,
- password,
-
- // For steal build process
- pluginify;
-
-// Get deferreds
-_.mixin( require("underscore.deferred") );
-
-var buildDfd = new _.Deferred()
-
-// Update canjs.us dist
-function updateDist() {
- process.stdout.write("Copying built files to gh-pages...");
-
- var clone = spawn("git", [ "clone", canJSRemote ], {
- cwd : __dirname
- }), dfd = new _.Deferred();
-
- clone.on("exit", function() {
-
- var clonePath = path.join( __dirname, "canjs" ),
- checkout = spawn("git", [ "checkout", "gh-pages"], {
- cwd : clonePath
- });
-
- checkout.on("exit", function() {
- var cloneReleasePath = path.join( clonePath, "release" ),
- latestPath = path.join( cloneReleasePath, "latest" ),
- versionPath = path.join( cloneReleasePath, version );
-
- // Make sure directories exist
- [ cloneReleasePath, versionPath, latestPath ].forEach( function( dir ) {
- if ( ! path.existsSync( dir )) {
- fs.mkdirSync( dir );
- }
- });
-
- fs.readdir( distPath, function( err, files ) {
- var dfds = files.map(function( file ) {
- var dfd = new _.Deferred(),
- inPath = path.join( distPath, file ),
- outPath = path.join( versionPath, file ),
- latestOutPath = path.join( latestPath, file ),
- inStream = fs.createReadStream( inPath );
-
- inStream.pipe( fs.createWriteStream( outPath ));
- inStream.pipe( fs.createWriteStream( latestOutPath ));
-
- inStream.on("end", function() {
- dfd.resolve();
- });
-
- return dfd.promise();
-
- });
-
- _.when.apply( _, dfds ).done(function() {
-
- process.stdout.write(" Done!\n");
- process.stdout.write("Pushing to Github...");
- var add = spawn("git", ["add", "release/*"], {
- cwd : clonePath
- });
-
- add.on("exit", function() {
- var commit = spawn("git", ["commit", "-m", "Generated release files for " + version ], {
- cwd : clonePath
- });
-
- commit.on("exit", function() {
- var push = spawn("git", ["push", "origin", "gh-pages"], {
- cwd : clonePath
- });
-
- push.on("exit", function() {
- process.stdout.write(" Done!\n");
-
- process.stdout.write("Cleaning up...");
- var remove = spawn("rm", ["-rf", "canjs"], {
- cwd : __dirname
- });
- process.stdout.write(" Done!\nUpdating canjs.us/release directory complete.\n");
- dfd.resolve();
-
- });
- });
- });
- });
- });
- });
-
- });
-
- return dfd.promise();
-}
-
-function createZipArchive() {
-
- var dfd = new _.Deferred(),
- zip = spawn("zip", [ "-r", "edge/can.js.zip", "edge" ], {
- cwd : path.join( distPath, ".." )
- });
-
- zip.on("exit", function() {
- dfd.resolve();
- });
-
- return dfd.promise();
-}
-
-// Upload files to the Github downloads page
-function uploadFiles() {
-
- var outerDfd = new _.Deferred();
-
- _.when( getCredentials(), createZipArchive() ).done(function() {
- var dfds = _.map( descriptions, function( parts, filename ) {
-
- var dfd = new _.Deferred(),
- desc = parts.description.replace("#{VERSION}", version),
- name = parts.filename.replace("#{VERSION}", version);
-
- fs.readFile( path.join( distPath, filename ), function( err, buf ) {
-
- if ( err ) {
- console.log( err );
- process.exit(1);
- }
-
- github.httpSend({
- "user" : "jupiterjs",
- "repo" : "canjs",
- "name" : name,
- "size" : buf.length,
- "description" : desc,
- "content_type" : parts.content_type || "text/javascript"
- }, {
- "url": "/repos/:user/:repo/downloads",
- "method": "POST",
- "params": {
- "$user": null,
- "$repo": null,
- "$name": null,
- "$size": null,
- "description": null,
- "$content_type": null
- }
- }, function( err, socket ) {
-
- var data = JSON.parse( socket.data );
-
-
- s3p.postToS3({
- key : data.path,
- acl : data.acl,
- success_action_status : "201",
- Filename : data.name,
- AWSAccessKeyId : data.accesskeyid,
- policy64 : data.policy,
- signature64 : data.signature,
- contentType : data.mime_type,
- data : buf,
- bucket: "github"
- }, function( e ) {
- if ( e ) {
- console.log( e );
- }
- dfd.resolve();
- })
-
- });
-
- });
-
- dfd.resolve();
- return dfd.promise();
- });
-
- _.when.apply( _, dfds ).done(outerDfd.resolve.bind( outerDfd ));
-
-
- });
-
- return outerDfd.promise();
-
-}
-
-// Clean up on process exit
-process.on("exit", function() {
- process.stdout.write("\n")
-})
-
-// Get Github credentials
-function getCredentials() {
-
- var dfd = new _.Deferred();
-
- program.prompt("Github Username: ", function( name ) {
- username = name;
-
- program.password("Github Password: ", "*", function( pass ) {
- var timeout;
- password = pass;
- process.stdin.pause();
-
- github.authenticate({
- type: "basic",
- username: username,
- password: password
- });
-
- dfd.resolve();
- })
-
- });
-
- return dfd.promise();
-}
-
-function stealBuild() {
-
- var timeout;
-
-
- if ( ! buildDfd.isResolved() ) {
-
- process.stdout.write("Building CanJS " + version );
-
- // Run Steal build script
- pluginify = spawn( "js", ["can/util/make.js"], {
- cwd: rhinoPath
- });
-
- pluginify.on("exit", function() {
- clearTimeout( timeout );
- process.stdout.write(" Done!\n")
- buildDfd.resolve();
- });
-
- timeout = setInterval(function() {
- process.stdout.write(".");
- }, 2000);
-
- }
-
- return buildDfd.promise();
-}
-
-function choose() {
- console.log("\nWhat would you like to do?")
- program.choose([
- "Update Github Downloads",
- "Update canjs.us/release directory",
- "Exit"
- ], function( i ) {
- if ( i == 0 ) {
- stealBuild().done(function() {
- uploadFiles().done( choose );
- });
- } else if ( i == 1 ) {
- stealBuild().done(function() {
- updateDist().done( choose )
- });
- } else if ( i == 2 ){
- console.log("Okay, exiting...")
- process.exit(0);
- }
- });
-}
-
-console.log("CanJS Release Script -- Releasing version " + version );
-choose();
View
105 build/tasks/release/s3-post.js
@@ -1,105 +0,0 @@
-// Generated by CoffeeScript 1.3.1
-(function() {
- var crypto, https, joinBuffers, postToS3, readText, signPolicy, url, _ref;
-
- url = require('url');
-
- https = require('https');
-
- crypto = require('crypto');
-
- _ref = require('tafa-misc-util'), joinBuffers = _ref.joinBuffers, readText = _ref.readText;
-
- signPolicy = function(secretKey, policy) {
- var data, hmac, json, key, policy64, signature64;
- json = JSON.stringify(policy);
- policy64 = new Buffer(json).toString('base64');
- data = new Buffer(policy64, 'utf-8');
- key = new Buffer(secretKey, 'utf-8');
- hmac = crypto.createHmac('sha1', key);
- hmac.update(data);
- signature64 = hmac.digest('base64');
- return {
- signature64: signature64,
- policy64: policy64
- };
- };
-
- postToS3 = function(_arg, callback) {
- var AWSAccessKeyId, Filename, acl, addParam, arr, boundary, bucket, buf, ca, contentType, customUrl, data, host, hostname, key, options, policy64, port, protocol, req, req_body, signature64, success_action_status, _ref1;
- AWSAccessKeyId = _arg.AWSAccessKeyId, policy64 = _arg.policy64, signature64 = _arg.signature64, bucket = _arg.bucket, key = _arg.key, data = _arg.data, boundary = _arg.boundary, customUrl = _arg.customUrl, ca = _arg.ca, acl = _arg.acl, success_action_status = _arg.success_action_status, Filename = _arg.Filename, contentType = _arg.contentType;
- if (callback == null) {
- callback = (function() {});
- }
- if (customUrl) {
- _ref1 = url.parse(customUrl), protocol = _ref1.protocol, hostname = _ref1.hostname, port = _ref1.port;
- if (protocol !== "https:") {
- return callback(new Error("customUrl must be https://"));
- }
- host = hostname;
- port || (port = 443);
- } else {
- host = "" + bucket + ".s3.amazonaws.com";
- port = 443;
- }
- boundary || (boundary = '----------R46EARkAg4SAXSjufGsb6m');
- buf = function(x) {
- return new Buffer(x);
- };
- arr = [];
- addParam = function(k, v) {
- arr.push(buf('--' + boundary + '\r\n'));
- arr.push(buf('Content-Disposition: form-data; name="' + k + '"\r\n\r\n'));
- return arr.push(buf(v), buf('\r\n'));
- };
- addParam('key', key);
- addParam('acl', acl);
- addParam('success_action_status', success_action_status);
- addParam('Filename', Filename);
- addParam('AWSAccessKeyId', AWSAccessKeyId);
- addParam('Policy', policy64);
- addParam('Signature', signature64);
- addParam('Content-Type', contentType);
- arr.push(buf('--' + boundary + '\r\n'));
- arr.push(buf('Content-Disposition: form-data; name="file"; filename="data"\r\n'));
- arr.push(buf("Content-Length: " + data.length + "\r\n"));
- arr.push(buf('Content-Transfer-Encoding: binary\r\n\r\n'));
- arr.push(data, buf('\r\n'));
- arr.push(buf('--' + boundary + '--'));
- req_body = joinBuffers(arr);
- options = {
- host: host,
- port: port,
- path: '/',
- method: 'POST',
- headers: {
- 'Host': "" + bucket + ".s3.amazonaws.com",
- 'Content-Type': 'multipart/form-data; boundary=' + boundary,
- 'Content-Length': req_body.length
- }
- };
- if (ca) {
- options.ca = ca;
- }
- req = https.request(options, function(res) {
- var _ref2;
- if ((200 <= (_ref2 = res.statusCode) && _ref2 < 300)) {
- return callback(null);
- } else {
- return readText(res, function(text) {
- return callback({
- responseCode: res.statusCode,
- responseText: text
- });
- });
- }
- });
- return req.end(req_body);
- };
-
- module.exports = {
- postToS3: postToS3,
- signPolicy: signPolicy
- };
-
-}).call(this);
View
28 build/tasks/strip.js
@@ -1,28 +0,0 @@
-var path = require('path');
-
-// A grunt task that strips multiline comments
-module.exports = function (grunt) {
- grunt.registerMultiTask('strip', 'Remove multiline comments from files', function () {
- var options = grunt.config.process(['strip', this.target]);
- grunt.file.expandFiles(this.file.src).forEach(function (file) {
- var outFile = options.out ? path.join(options.out, path.basename(file)) : file;
- // TODO use Grunt internals
- grunt.log.writeln('Stripping ' + file + ' of all multiline comments, writing result to ' + outFile);
-
- // Put new index.html into production mode
- var code = grunt.file.read(file);
-
- // Remove multiline comments
- code = code.replace(/\/\*([\s\S]*?)\*\//gim, "");
-
- // Remove double semicolons from steal pluginify
- code = code.replace(/;[\s]*;/gim, ";");
- code = code.replace(/(\/\/.*)\n[\s]*;/gi, "$1");
-
- // Only single new lines
- code = code.replace(/(\n){3,}/gim, "\n\n");
-
- grunt.file.write(outFile, code);
- });
- });
-}
View
30 build/tasks/utils.js
@@ -1,30 +0,0 @@
-var spawn = require("child_process").spawn;
-
-// {
-// // The command to execute. It should be in the system path.
-// cmd: commandToExecute,
-// // An array of arguments to pass to the command.
-// args: arrayOfArguments,
-// // Additional options for the Node.js child_process spawn method.
-// opts: nodeSpawnOptions
-// }
-
-module.exports = function(grunt) {
- grunt.utils.exec = function(options, callback) {
- var build = grunt.utils.spawn(options, callback);
-
- build.stdout.on("data", function( buf ) {
- grunt.log.write( "" + buf );
- });
-
- build.stderr.on("data", function( buf ) {
- grunt.log.write( "" + buf );
- });
-
- build.on("exit", function( code ) {
- callback(null, code);
- });
-
- return build;
- }
-}
View
47 build/templates/index.html
@@ -1,47 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <style>
- * {
- -moz-box-sizing: border-box;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- padding: 0;
- margin: 0;
- }
- body {
- background-color: black;
- }
- iframe {
- float: left;
- width: 32%;
- height: 50%;
- border-color: #eee;
- border-style: dashed;
- border-width: 0 2px 2px 0;
- }
- #mootools {
- border-right: 0;
- }
- #dojo {
- border-bottom: 0;
- }
- #yui {
- border-bottom: 0;
- }
- #plugins {
- border-bottom: 0;
- border-right: 0;
- }
- </style>
- <title>Test... EVERYTHING</title>
- </head>
- <body>
- <!--[if !IE]> -->
- <iframe src="zepto.html" id="zepto"></iframe>
- <!-- <![endif]-->
- <iframe src="mootools.html" id="mootools"></iframe>
- <iframe src="dojo.html" id="dojo"></iframe>
- <iframe src="yui.html" id="yui"></iframe>
- </body>
-</html>
View
235 build/templates/qunit.css
@@ -0,0 +1,235 @@
+/**
+ * QUnit 1.1.0 - A JavaScript Unit Testing Framework
+ *
+ * http://docs.jquery.com/QUnit
+ *
+ * Copyright (c) 2011 John Resig, Jörn Zaefferer
+ * Dual licensed under the MIT (MIT-LICENSE.txt)
+ * or GPL (GPL-LICENSE.txt) licenses.
+ */
+#funcunit_app{
+ position:fixed;
+ right:0px;
+ top: 0px;
+ width:960px;
+ height:800px;
+ border:1px solid black;
+}
+
+
+/** Font Family and Sizes */
+
+#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
+ font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
+}
+
+#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
+#qunit-tests { font-size: smaller; }
+
+
+/** Resets */
+
+#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
+ margin: 0;
+ padding: 0;
+}
+
+
+/** Header */
+
+#qunit-header {
+ padding: 0.5em 0 0.5em 1em;
+
+ color: #8699a4;
+ background-color: #0d3349;
+
+ font-size: 1.5em;
+ line-height: 1em;
+ font-weight: normal;
+
+ border-radius: 15px 15px 0 0;
+ -moz-border-radius: 15px 15px 0 0;
+ -webkit-border-top-right-radius: 15px;
+ -webkit-border-top-left-radius: 15px;
+}
+
+#qunit-header a {
+ text-decoration: none;
+ color: #c2ccd1;
+}
+
+#qunit-header a:hover,
+#qunit-header a:focus {
+ color: #fff;
+}
+
+#qunit-banner {
+ height: 5px;
+}
+
+#qunit-testrunner-toolbar {
+ padding: 0.5em 0 0.5em 2em;
+ color: #5E740B;
+ background-color: #eee;
+}
+
+#qunit-userAgent {
+ padding: 0.5em 0 0.5em 2.5em;
+ background-color: #2b81af;
+ color: #fff;
+ text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
+}
+
+
+/** Tests: Pass/Fail */
+
+#qunit-tests {
+ list-style-position: inside;
+}
+
+#qunit-tests li {
+ padding: 0.4em 0.5em 0.4em 2.5em;
+ border-bottom: 1px solid #fff;
+ list-style-position: inside;
+}
+
+#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
+ display: none;
+}
+
+#qunit-tests li strong {
+ cursor: pointer;
+}
+
+#qunit-tests li a {
+ padding: 0.5em;
+ color: #c2ccd1;
+ text-decoration: none;
+}
+#qunit-tests li a:hover,
+#qunit-tests li a:focus {
+ color: #000;
+}
+
+#qunit-tests ol {
+ margin-top: 0.5em;
+ padding: 0.5em;
+
+ background-color: #fff;
+
+ border-radius: 15px;
+ -moz-border-radius: 15px;
+ -webkit-border-radius: 15px;
+
+ box-shadow: inset 0px 2px 13px #999;
+ -moz-box-shadow: inset 0px 2px 13px #999;
+ -webkit-box-shadow: inset 0px 2px 13px #999;
+}
+
+#qunit-tests table {
+ border-collapse: collapse;
+ margin-top: .2em;
+}
+
+#qunit-tests th {
+ text-align: right;
+ vertical-align: top;
+ padding: 0 .5em 0 0;
+}
+
+#qunit-tests td {
+ vertical-align: top;
+}
+
+#qunit-tests pre {
+ margin: 0;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+
+#qunit-tests del {
+ background-color: #e0f2be;
+ color: #374e0c;
+ text-decoration: none;
+}
+
+#qunit-tests ins {
+ background-color: #ffcaca;
+ color: #500;
+ text-decoration: none;
+}
+
+/*** Test Counts */
+
+#qunit-tests b.counts { color: black; }
+#qunit-tests b.passed { color: #5E740B; }
+#qunit-tests b.failed { color: #710909; }
+
+#qunit-tests li li {
+ margin: 0.5em;
+ padding: 0.4em 0.5em 0.4em 0.5em;
+ background-color: #fff;
+ border-bottom: none;
+ list-style-position: inside;
+}
+
+/*** Passing Styles */
+
+#qunit-tests li li.pass {
+ color: #5E740B;
+ background-color: #fff;
+ border-left: 26px solid #C6E746;
+}
+
+#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
+#qunit-tests .pass .test-name { color: #366097; }
+
+#qunit-tests .pass .test-actual,
+#qunit-tests .pass .test-expected { color: #999999; }
+
+#qunit-banner.qunit-pass { background-color: #C6E746; }
+
+/*** Failing Styles */
+
+#qunit-tests li li.fail {
+ color: #710909;
+ background-color: #fff;
+ border-left: 26px solid #EE5757;
+ white-space: pre;
+}
+
+#qunit-tests > li:last-child {
+ border-radius: 0 0 15px 15px;
+ -moz-border-radius: 0 0 15px 15px;
+ -webkit-border-bottom-right-radius: 15px;
+ -webkit-border-bottom-left-radius: 15px;
+}
+
+#qunit-tests .fail { color: #000000; background-color: #EE5757; }
+#qunit-tests .fail .test-name,
+#qunit-tests .fail .module-name { color: #000000; }
+
+#qunit-tests .fail .test-actual { color: #EE5757; }
+#qunit-tests .fail .test-expected { color: green; }
+
+#qunit-banner.qunit-fail { background-color: #EE5757; }
+
+
+/** Result */
+
+#qunit-testresult {
+ padding: 0.5em 0.5em 0.5em 2.5em;
+
+ color: #2b81af;
+ background-color: #D2E0E6;
+
+ border-bottom: 1px solid white;
+}
+
+/** Fixture */
+
+#qunit-fixture {
+ position: absolute;
+ top: -10000px;
+ left: -10000px;
+}
View
20 build/templates/test.html.ejs
@@ -2,21 +2,23 @@
<html>
<head>
<base href="../../../../" />
- <link rel="stylesheet" type="text/css" href="funcunit/qunit/qunit.css" />
+ <meta http-equiv="X-UA-Compatible" content="IE=9">
+
+ <link rel="stylesheet" type="text/css" href="can/dist/<%= version %>/test/qunit.css" />
<title>Can <%= name %> Distributable Tests</title>
<script type="text/javascript" src="can/dist/<%= version %>/test/qunit.js"></script>
<script type="text/javascript" src="<%= dist %>"></script>
- <script type="text/javascript" src="can/dist/<%= version %>/can.<%= type %>-<%= version %>.js"></script>
- <script type="text/javascript" src="can/dist/<%= version %>/plugins/can.fixture-<%= version %>.js"></script>
+ <script type="text/javascript" src="can/dist/<%= version %>/can.<%= type %>.js"></script>
+ <script type="text/javascript" src="can/dist/<%= version %>/can.fixture.js"></script>
<script type="text/javascript" src="can/test/mvc_test.js"></script>
<script type="text/javascript" src="can/construct/construct_test.js"></script>
- <!--<script type="text/javascript" src="can/observe/observe_test.js"></script>-->
- <!--<script type="text/javascript" src="can/observe/compute/compute_test.js"></script>-->
- <!--<script type="text/javascript" src="can/control/control_test.js"></script>-->
- <!--<script type="text/javascript" src="can/view/view_test.js"></script>-->
- <!--<script type="text/javascript" src="can/model/model_test.js"></script>-->
- <!--<script type="text/javascript" src="can/view/ejs/test/ejs_test.js"></script>-->
+ <script type="text/javascript" src="can/observe/observe_test.js"></script>
+ <script type="text/javascript" src="can/observe/compute/compute_test.js"></script>
+ <script type="text/javascript" src="can/control/control_test.js"></script>
+ <script type="text/javascript" src="can/view/view_test.js"></script>
+ <script type="text/javascript" src="can/view/ejs/test/ejs_test.js"></script>
+ <script type="text/javascript" src="can/model/model_test.js"></script>
</head>
<body>
<h1 id="qunit-header">Can <%= name %> Distributable Tests</h1>
View
1,200 build/underscore.js
@@ -1,1200 +0,0 @@
-// Underscore.js 1.4.2
-// http://underscorejs.org
-// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
-// Underscore may be freely distributed under the MIT license.
-
-(function() {
-
- // Baseline setup
- // --------------
-
- // Establish the root object, `window` in the browser, or `global` on the server.
- var root = this;
-
- // Save the previous value of the `_` variable.
- var previousUnderscore = root._;
-
- // Establish the object that gets returned to break out of a loop iteration.
- var breaker = {};
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
-
- // Create quick reference variables for speed access to core prototypes.
- var push = ArrayProto.push,
- slice = ArrayProto.slice,
- concat = ArrayProto.concat,
- unshift = ArrayProto.unshift,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // All **ECMAScript 5** native function implementations that we hope to use
- // are declared here.
- var
- nativeForEach = ArrayProto.forEach,
- nativeMap = ArrayProto.map,
- nativeReduce = ArrayProto.reduce,
- nativeReduceRight = ArrayProto.reduceRight,
- nativeFilter = ArrayProto.filter,
- nativeEvery = ArrayProto.every,
- nativeSome = ArrayProto.some,
- nativeIndexOf = ArrayProto.indexOf,
- nativeLastIndexOf = ArrayProto.lastIndexOf,
- nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeBind = FuncProto.bind;
-
- // Create a safe reference to the Underscore object for use below.
- var _ = function(obj) {
- if (obj instanceof _) return obj;
- if (!(this instanceof _)) return new _(obj);
- this._wrapped = obj;
- };
-
- // Export the Underscore object for **Node.js**, with
- // backwards-compatibility for the old `require()` API. If we're in
- // the browser, add `_` as a global object via a string identifier,
- // for Closure Compiler "advanced" mode.
- if (typeof exports !== 'undefined') {
- if (typeof module !== 'undefined' && module.exports) {
- exports = module.exports = _;
- }
- exports._ = _;
- } else {
- root['_'] = _;
- }
-
- // Current version.
- _.VERSION = '1.4.2';
-
- // Collection Functions
- // --------------------
-
- // The cornerstone, an `each` implementation, aka `forEach`.
- // Handles objects with the built-in `forEach`, arrays, and raw objects.
- // Delegates to **ECMAScript 5**'s native `forEach` if available.
- var each = _.each = _.forEach = function(obj, iterator, context) {
- if (obj == null) return;
- if (nativeForEach && obj.forEach === nativeForEach) {
- obj.forEach(iterator, context);
- } else if (obj.length === +obj.length) {
- for (var i = 0, l = obj.length; i < l; i++) {
- if (iterator.call(context, obj[i], i, obj) === breaker) return;
- }
- } else {
- for (var key in obj) {
- if (_.has(obj, key)) {
- if (iterator.call(context, obj[key], key, obj) === breaker) return;
- }
- }
- }
- };
-
- // Return the results of applying the iterator to each element.
- // Delegates to **ECMAScript 5**'s native `map` if available.
- _.map = _.collect = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
- each(obj, function(value, index, list) {
- results[results.length] = iterator.call(context, value, index, list);
- });
- return results;
- };
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
- _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduce && obj.reduce === nativeReduce) {
- if (context) iterator = _.bind(iterator, context);
- return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
- }
- each(obj, function(value, index, list) {
- if (!initial) {
- memo = value;
- initial = true;
- } else {
- memo = iterator.call(context, memo, value, index, list);
- }
- });
- if (!initial) throw new TypeError('Reduce of empty array with no initial value');
- return memo;
- };
-
- // The right-associative version of reduce, also known as `foldr`.
- // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
- _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
- var initial = arguments.length > 2;
- if (obj == null) obj = [];
- if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
- if (context) iterator = _.bind(iterator, context);
- return arguments.length > 2 ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
- }
- var length = obj.length;
- if (length !== +length) {
- var keys = _.keys(obj);
- length = keys.length;
- }
- each(obj, function(value, index, list) {
- index = keys ? keys[--length] : --length;
- if (!initial) {
- memo = obj[index];
- initial = true;
- } else {
- memo = iterator.call(context, memo, obj[index], index, list);
- }
- });
- if (!initial) throw new TypeError('Reduce of empty array with no initial value');
- return memo;
- };
-
- // Return the first value which passes a truth test. Aliased as `detect`.
- _.find = _.detect = function(obj, iterator, context) {
- var result;
- any(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) {
- result = value;
- return true;
- }
- });
- return result;
- };
-
- // Return all the elements that pass a truth test.
- // Delegates to **ECMAScript 5**'s native `filter` if available.
- // Aliased as `select`.
- _.filter = _.select = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
- each(obj, function(value, index, list) {
- if (iterator.call(context, value, index, list)) results[results.length] = value;
- });
- return results;
- };
-
- // Return all the elements for which a truth test fails.
- _.reject = function(obj, iterator, context) {
- var results = [];
- if (obj == null) return results;
- each(obj, function(value, index, list) {
- if (!iterator.call(context, value, index, list)) results[results.length] = value;
- });
- return results;
- };
-
- // Determine whether all of the elements match a truth test.
- // Delegates to **ECMAScript 5**'s native `every` if available.
- // Aliased as `all`.
- _.every = _.all = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = true;
- if (obj == null) return result;
- if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
- each(obj, function(value, index, list) {
- if (!(result = result && iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if at least one element in the object matches a truth test.
- // Delegates to **ECMAScript 5**'s native `some` if available.
- // Aliased as `any`.
- var any = _.some = _.any = function(obj, iterator, context) {
- iterator || (iterator = _.identity);
- var result = false;
- if (obj == null) return result;
- if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
- each(obj, function(value, index, list) {
- if (result || (result = iterator.call(context, value, index, list))) return breaker;
- });
- return !!result;
- };
-
- // Determine if the array or object contains a given value (using `===`).
- // Aliased as `include`.
- _.contains = _.include = function(obj, target) {
- var found = false;
- if (obj == null) return found;
- if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
- found = any(obj, function(value) {
- return value === target;
- });
- return found;
- };
-
- // Invoke a method (with arguments) on every item in a collection.
- _.invoke = function(obj, method) {
- var args = slice.call(arguments, 2);
- return _.map(obj, function(value) {
- return (_.isFunction(method) ? method : value[method]).apply(value, args);
- });
- };
-
- // Convenience version of a common use case of `map`: fetching a property.
- _.pluck = function(obj, key) {
- return _.map(obj, function(value){ return value[key]; });
- };
-
- // Convenience version of a common use case of `filter`: selecting only objects
- // with specific `key:value` pairs.
- _.where = function(obj, attrs) {
- if (_.isEmpty(attrs)) return [];
- return _.filter(obj, function(value) {
- for (var key in attrs) {
- if (attrs[key] !== value[key]) return false;
- }
- return true;
- });
- };
-
- // Return the maximum element or (element-based computation).
- // Can't optimize arrays of integers longer than 65,535 elements.
- // See: https://bugs.webkit.org/show_bug.cgi?id=80797
- _.max = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.max.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return -Infinity;
- var result = {computed : -Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed >= result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Return the minimum element (or element-based computation).
- _.min = function(obj, iterator, context) {
- if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
- return Math.min.apply(Math, obj);
- }
- if (!iterator && _.isEmpty(obj)) return Infinity;
- var result = {computed : Infinity};
- each(obj, function(value, index, list) {
- var computed = iterator ? iterator.call(context, value, index, list) : value;
- computed < result.computed && (result = {value : value, computed : computed});
- });
- return result.value;
- };
-
- // Shuffle an array.
- _.shuffle = function(obj) {
- var rand;
- var index = 0;
- var shuffled = [];
- each(obj, function(value) {
- rand = _.random(index++);
- shuffled[index - 1] = shuffled[rand];
- shuffled[rand] = value;
- });
- return shuffled;
- };
-
- // An internal function to generate lookup iterators.
- var lookupIterator = function(value) {
- return _.isFunction(value) ? value : function(obj){ return obj[value]; };
- };
-
- // Sort the object's values by a criterion produced by an iterator.
- _.sortBy = function(obj, value, context) {
- var iterator = lookupIterator(value);
- return _.pluck(_.map(obj, function(value, index, list) {
- return {
- value : value,
- index : index,
- criteria : iterator.call(context, value, index, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index < right.index ? -1 : 1;
- }), 'value');
- };
-
- // An internal function used for aggregate "group by" operations.
- var group = function(obj, value, context, behavior) {
- var result = {};
- var iterator = lookupIterator(value);
- each(obj, function(value, index) {
- var key = iterator.call(context, value, index, obj);
- behavior(result, key, value);
- });
- return result;
- };
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- _.groupBy = function(obj, value, context) {
- return group(obj, value, context, function(result, key, value) {
- (_.has(result, key) ? result[key] : (result[key] = [])).push(value);
- });
- };
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- _.countBy = function(obj, value, context) {
- return group(obj, value, context, function(result, key, value) {
- if (!_.has(result, key)) result[key] = 0;
- result[key]++;
- });
- };
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- _.sortedIndex = function(array, obj, iterator, context) {
- iterator = iterator == null ? _.identity : lookupIterator(iterator);
- var value = iterator.call(context, obj);
- var low = 0, high = array.length;
- while (low < high) {
- var mid = (low + high) >>> 1;
- iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
- }
- return low;
- };
-
- // Safely convert anything iterable into a real, live array.
- _.toArray = function(obj) {
- if (!obj) return [];
- if (obj.length === +obj.length) return slice.call(obj);
- return _.values(obj);
- };
-
- // Return the number of elements in an object.
- _.size = function(obj) {
- return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
- };
-
- // Array Functions
- // ---------------
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. Aliased as `head` and `take`. The **guard** check
- // allows it to work with `_.map`.
- _.first = _.head = _.take = function(array, n, guard) {
- return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
- };
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N. The **guard** check allows it to work with
- // `_.map`.
- _.initial = function(array, n, guard) {
- return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
- };
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array. The **guard** check allows it to work with `_.map`.
- _.last = function(array, n, guard) {
- if ((n != null) && !guard) {
- return slice.call(array, Math.max(array.length - n, 0));
- } else {
- return array[array.length - 1];
- }
- };
-
- // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
- // Especially useful on the arguments object. Passing an **n** will return
- // the rest N values in the array. The **guard**
- // check allows it to work with `_.map`.
- _.rest = _.tail = _.drop = function(array, n, guard) {
- return slice.call(array, (n == null) || guard ? 1 : n);
- };
-
- // Trim out all falsy values from an array.
- _.compact = function(array) {
- return _.filter(array, function(value){ return !!value; });
- };
-
- // Internal implementation of a recursive `flatten` function.
- var flatten = function(input, shallow, output) {
- each(input, function(value) {
- if (_.isArray(value)) {
- shallow ? push.apply(output, value) : flatten(value, shallow, output);
- } else {
- output.push(value);
- }
- });
- return output;
- };
-
- // Return a completely flattened version of an array.
- _.flatten = function(array, shallow) {
- return flatten(array, shallow, []);
- };
-
- // Return a version of the array that does not contain the specified value(s).
- _.without = function(array) {
- return _.difference(array, slice.call(arguments, 1));
- };
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // Aliased as `unique`.
- _.uniq = _.unique = function(array, isSorted, iterator, context) {
- var initial = iterator ? _.map(array, iterator, context) : array;
- var results = [];
- var seen = [];
- each(initial, function(value, index) {
- if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
- seen.push(value);
- results.push(array[index]);
- }
- });
- return results;
- };
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- _.union = function() {
- return _.uniq(concat.apply(ArrayProto, arguments));
- };
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- _.intersection = function(array) {