Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Going back to requirejs 0.24 build tool for internal builds.

  • Loading branch information...
commit 13d1e19bd8e2f48263361405e84ba277ee5ff56d 1 parent 7350d11
Jens Arps authored
Showing with 33,952 additions and 0 deletions.
  1. +58 −0 libs/requirejs-0.24/LICENSE
  2. +17 −0 libs/requirejs-0.24/README.md
  3. +45 −0 libs/requirejs-0.24/adapt/dist.js
  4. +77 −0 libs/requirejs-0.24/adapt/node.js
  5. +26 −0 libs/requirejs-0.24/adapt/rhino.js
  6. +49 −0 libs/requirejs-0.24/adapt/tests/all.js
  7. +3 −0  libs/requirejs-0.24/adapt/tests/alpha.js
  8. +6 −0 libs/requirejs-0.24/adapt/tests/beta.js
  9. +37 −0 libs/requirejs-0.24/adapt/tests/node/canvasTest.js
  10. +11 −0 libs/requirejs-0.24/adapt/tests/node/index.js
  11. +6 −0 libs/requirejs-0.24/adapt/tests/node/tests/alpha/foo.js
  12. +9 −0 libs/requirejs-0.24/adapt/tests/node/tests/alpha/hello.html
  13. +3 −0  libs/requirejs-0.24/adapt/tests/node/tests/foo.js
  14. +11 −0 libs/requirejs-0.24/adapt/tests/node/tests/server.js
  15. +10 −0 libs/requirejs-0.24/adapt/tests/relative.js
  16. +3 −0  libs/requirejs-0.24/adapt/tests/sub/betaSub.js
  17. +6 −0 libs/requirejs-0.24/bin/x
  18. +2 −0  libs/requirejs-0.24/bin/x.bat
  19. +124 −0 libs/requirejs-0.24/bin/x.js
  20. +7 −0 libs/requirejs-0.24/bin/xdebug
  21. +2 −0  libs/requirejs-0.24/bin/xdebug.bat
  22. +6 −0 libs/requirejs-0.24/bin/xj
  23. +2 −0  libs/requirejs-0.24/bin/xj.bat
  24. +4 −0 libs/requirejs-0.24/bin/xjdebug
  25. +2 −0  libs/requirejs-0.24/bin/xjdebug.bat
  26. +2 −0  libs/requirejs-0.24/build/build.bat
  27. +39 −0 libs/requirejs-0.24/build/build.js
  28. +4 −0 libs/requirejs-0.24/build/build.sh
  29. +2 −0  libs/requirejs-0.24/build/buildebug.bat
  30. +4 −0 libs/requirejs-0.24/build/buildebug.sh
  31. +4 −0 libs/requirejs-0.24/build/buildebugj.sh
  32. +2 −0  libs/requirejs-0.24/build/buildj.bat
  33. +4 −0 libs/requirejs-0.24/build/buildj.sh
  34. +2 −0  libs/requirejs-0.24/build/buildjdebug.bat
  35. +2 −0  libs/requirejs-0.24/build/convert/commonjs/convert.bat
  36. +33 −0 libs/requirejs-0.24/build/convert/commonjs/convert.js
  37. +4 −0 libs/requirejs-0.24/build/convert/commonjs/convert.sh
  38. +214 −0 libs/requirejs-0.24/build/convert/stealjs/parse.js
  39. +23 −0 libs/requirejs-0.24/build/convert/stealjs/tests/all.js
  40. +20 −0 libs/requirejs-0.24/build/convert/stealjs/tests/parse.js
  41. +187 −0 libs/requirejs-0.24/build/example.build.js
  42. +745 −0 libs/requirejs-0.24/build/jslib/build.js
  43. +23 −0 libs/requirejs-0.24/build/jslib/commandLine.js
  44. +152 −0 libs/requirejs-0.24/build/jslib/commonJs.js
  45. +47 −0 libs/requirejs-0.24/build/jslib/env.js
  46. +49 −0 libs/requirejs-0.24/build/jslib/lang.js
  47. +53 −0 libs/requirejs-0.24/build/jslib/logger.js
  48. +15 −0 libs/requirejs-0.24/build/jslib/node/args.js
  49. +223 −0 libs/requirejs-0.24/build/jslib/node/file.js
  50. +17 −0 libs/requirejs-0.24/build/jslib/node/load.js
  51. +10 −0 libs/requirejs-0.24/build/jslib/node/optimize.js
  52. +16 −0 libs/requirejs-0.24/build/jslib/node/print.js
  53. +253 −0 libs/requirejs-0.24/build/jslib/optimize.js
  54. +361 −0 libs/requirejs-0.24/build/jslib/parse.js
  55. +117 −0 libs/requirejs-0.24/build/jslib/pragma.js
  56. +199 −0 libs/requirejs-0.24/build/jslib/requirePatch.js
  57. +16 −0 libs/requirejs-0.24/build/jslib/rhino/args.js
  58. +239 −0 libs/requirejs-0.24/build/jslib/rhino/file.js
  59. +12 −0 libs/requirejs-0.24/build/jslib/rhino/load.js
  60. +92 −0 libs/requirejs-0.24/build/jslib/rhino/optimize.js
  61. +12 −0 libs/requirejs-0.24/build/jslib/rhino/print.js
  62. +13 −0 libs/requirejs-0.24/build/jslib/uglifyjs/README.md
  63. +5 −0 libs/requirejs-0.24/build/jslib/uglifyjs/index.js
  64. +1,249 −0 libs/requirejs-0.24/build/jslib/uglifyjs/parse-js.js
  65. +1,568 −0 libs/requirejs-0.24/build/jslib/uglifyjs/process.js
  66. +26 −0 libs/requirejs-0.24/build/jslib/uglifyjs/squeeze-more.js
  67. +202 −0 libs/requirejs-0.24/build/lib/closure/COPYING
  68. +261 −0 libs/requirejs-0.24/build/lib/closure/README
  69. BIN  libs/requirejs-0.24/build/lib/closure/compiler.jar
  70. +4 −0 libs/requirejs-0.24/build/lib/rhino/LICENSE
  71. BIN  libs/requirejs-0.24/build/lib/rhino/js.jar
  72. +43 −0 libs/requirejs-0.24/build/tests/all.js
  73. +7 −0 libs/requirejs-0.24/build/tests/anonSimple.build.js
  74. +143 −0 libs/requirejs-0.24/build/tests/builds.js
  75. +18 −0 libs/requirejs-0.24/build/tests/circular.build.js
  76. +18 −0 libs/requirejs-0.24/build/tests/convert.js
  77. +6 −0 libs/requirejs-0.24/build/tests/css.build.js
  78. +4 −0 libs/requirejs-0.24/build/tests/css/common/common.css
  79. +10 −0 libs/requirejs-0.24/build/tests/css/master.css
  80. +7 −0 libs/requirejs-0.24/build/tests/css/sub/sub1.css
  81. +13 −0 libs/requirejs-0.24/build/tests/cssTestCompare.css
  82. +10 −0 libs/requirejs-0.24/build/tests/hasTestModule.build.js
  83. +30 −0 libs/requirejs-0.24/build/tests/hasTestModule.js
  84. +17 −0 libs/requirejs-0.24/build/tests/i18n.build.js
  85. +8 −0 libs/requirejs-0.24/build/tests/indexBuilder.build.js
  86. +16 −0 libs/requirejs-0.24/build/tests/order.build.js
  87. +59 −0 libs/requirejs-0.24/build/tests/packages.build.js
  88. +97 −0 libs/requirejs-0.24/build/tests/parse.js
  89. +14 −0 libs/requirejs-0.24/build/tests/simple.build.js
  90. +15 −0 libs/requirejs-0.24/build/tests/text.build.js
  91. +30 −0 libs/requirejs-0.24/dist/Markdown-License.text
  92. +1,450 −0 libs/requirejs-0.24/dist/Markdown.pl
  93. +40 −0 libs/requirejs-0.24/dist/README.md
  94. +59 −0 libs/requirejs-0.24/dist/dist-build.sh
  95. +124 −0 libs/requirejs-0.24/dist/dist-site.js
  96. BIN  libs/requirejs-0.24/dist/fonts/Inconsolata.ttf
  97. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans.ttf
  98. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Bold.ttf
  99. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Bold_Italic.ttf
  100. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Caption.ttf
  101. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Caption_Bold.ttf
  102. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Italic.ttf
  103. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Narrow.ttf
  104. BIN  libs/requirejs-0.24/dist/fonts/PT-Sans/PT_Sans_Narrow_Bold.ttf
  105. +26 −0 libs/requirejs-0.24/dist/fonts/PT-Sans/Paratype PT Sans Free Font License.txt
  106. +9 −0 libs/requirejs-0.24/dist/ie.css
  107. +28 −0 libs/requirejs-0.24/dist/init.js
  108. +686 −0 libs/requirejs-0.24/dist/main.css
  109. +10 −0 libs/requirejs-0.24/dist/post.html
  110. +163 −0 libs/requirejs-0.24/dist/pre.html
  111. +913 −0 libs/requirejs-0.24/docs/api.html
  112. +94 −0 libs/requirejs-0.24/docs/commonjs.html
  113. +56 −0 libs/requirejs-0.24/docs/contributing.html
  114. +3 −0  libs/requirejs-0.24/docs/design/packages.md
  115. +28 −0 libs/requirejs-0.24/docs/dojo.html
  116. +271 −0 libs/requirejs-0.24/docs/download.html
  117. +76 −0 libs/requirejs-0.24/docs/faq-advanced.html
  118. +136 −0 libs/requirejs-0.24/docs/faq-optimization.html
  119. +8 −0 libs/requirejs-0.24/docs/faq.html
  120. +15 −0 libs/requirejs-0.24/docs/history.html
  121. +47 −0 libs/requirejs-0.24/docs/jquery-require-sample/dist.sh
  122. +11 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/app.html
  123. +19 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/app.build.js
  124. +278 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/jquery-GPL-LICENSE.txt
  125. +20 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/jquery-MIT-LICENSE.txt
  126. +3 −0  libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/jquery.alpha.js
  127. +3 −0  libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/jquery.beta.js
  128. +16 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/jquery.js
  129. +14 −0 libs/requirejs-0.24/docs/jquery-require-sample/webapp/scripts/main.js
  130. +144 −0 libs/requirejs-0.24/docs/jquery.html
  131. +64 −0 libs/requirejs-0.24/docs/node.html
  132. +290 −0 libs/requirejs-0.24/docs/optimization.html
  133. +272 −0 libs/requirejs-0.24/docs/plugins.html
  134. +116 −0 libs/requirejs-0.24/docs/requirements.html
  135. +115 −0 libs/requirejs-0.24/docs/start.html
  136. +209 −0 libs/requirejs-0.24/docs/why.html
  137. +143 −0 libs/requirejs-0.24/i18n.js
  138. +21 −0 libs/requirejs-0.24/index.html
  139. +140 −0 libs/requirejs-0.24/order.js
  140. +1,884 −0 libs/requirejs-0.24/require.js
  141. +119 −0 libs/requirejs-0.24/tasks.txt
  142. +11 −0 libs/requirejs-0.24/testBaseUrl.js
  143. +51 −0 libs/requirejs-0.24/tests/README.md
  144. +116 −0 libs/requirejs-0.24/tests/afterload.html
  145. +2 −0  libs/requirejs-0.24/tests/afterloadreadystate.js
  146. +68 −0 libs/requirejs-0.24/tests/all-server.js
  147. +80 −0 libs/requirejs-0.24/tests/all.js
  148. +7 −0 libs/requirejs-0.24/tests/anon/a.js
  149. +57 −0 libs/requirejs-0.24/tests/anon/anon-tests.js
  150. +14 −0 libs/requirejs-0.24/tests/anon/anonSimple.html
  151. +5 −0 libs/requirejs-0.24/tests/anon/blue.js
  152. +7 −0 libs/requirejs-0.24/tests/anon/c.js
  153. +3 −0  libs/requirejs-0.24/tests/anon/green.js
  154. +16 −0 libs/requirejs-0.24/tests/anon/magenta.js
  155. +1 −0  libs/requirejs-0.24/tests/anon/message.txt
  156. +5 −0 libs/requirejs-0.24/tests/anon/red.js
  157. +3 −0  libs/requirejs-0.24/tests/anon/sub/b.js
  158. +3 −0  libs/requirejs-0.24/tests/anon/yellow.js
  159. +5 −0 libs/requirejs-0.24/tests/bar
  160. +13 −0 libs/requirejs-0.24/tests/baseUrl.html
  161. +5 −0 libs/requirejs-0.24/tests/browsertests/appendbeforeload/one.dphpd
  162. +49 −0 libs/requirejs-0.24/tests/browsertests/appendbeforeload/test.html
  163. +1 −0  libs/requirejs-0.24/tests/browsertests/appendbeforeload/two.js
  164. +94 −0 libs/requirejs-0.24/tests/browsertests/async/async.php
  165. +5 −0 libs/requirejs-0.24/tests/browsertests/async/one.php
  166. +1 −0  libs/requirejs-0.24/tests/browsertests/async/two.js
  167. +47 −0 libs/requirejs-0.24/tests/browsertests/common.js
  168. +28 −0 libs/requirejs-0.24/tests/browsertests/docwritenested/index.html
  169. +7 −0 libs/requirejs-0.24/tests/browsertests/docwritenested/one.js
  170. +3 −0  libs/requirejs-0.24/tests/browsertests/docwritenested/two.js
  171. +49 −0 libs/requirejs-0.24/tests/browsertests/functionToString.html
  172. +74 −0 libs/requirejs-0.24/tests/browsertests/onerror/index.html
  173. +1 −0  libs/requirejs-0.24/tests/browsertests/onerror/ok.js
  174. +4 −0 libs/requirejs-0.24/tests/browsertests/onerror/parseError.js
  175. +4 −0 libs/requirejs-0.24/tests/browsertests/onerror/scriptError.js
  176. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/eight.js
  177. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/five.js
  178. +2,520 −0 libs/requirejs-0.24/tests/browsertests/scriptload/four.js
  179. +98 −0 libs/requirejs-0.24/tests/browsertests/scriptload/index.html
  180. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/nine.js
  181. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/one.js
  182. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/seven.js
  183. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/six.js
  184. +1 −0  libs/requirejs-0.24/tests/browsertests/scriptload/three.js
  185. +4 −0 libs/requirejs-0.24/tests/browsertests/scriptload/two.js
  186. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/eight.js
  187. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/five.js
  188. +2,524 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/four.js
  189. +2,527 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/four.php
  190. +149 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/index-php.html
  191. +149 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/index.html
  192. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/nine.js
  193. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/one.js
  194. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/seven.js
  195. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/six.js
  196. +9 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/six.php
  197. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/three.js
  198. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractive/two.js
  199. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/eight.js
  200. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/five.js
  201. +2,524 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/four.js
  202. +2,527 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/four.php
  203. +149 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/index-php.html
  204. +153 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/index.html
  205. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/nine.js
  206. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/one.js
  207. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/seven.js
  208. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/six.js
  209. +9 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/six.php
  210. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/three.js
  211. +5 −0 libs/requirejs-0.24/tests/browsertests/scriptloadinteractiveattach/two.js
  212. +31 −0 libs/requirejs-0.24/tests/circular-tests.js
  213. +14 −0 libs/requirejs-0.24/tests/circular.html
  214. +4 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/absolute/b.js
  215. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/absolute/program.html
  216. +8 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/absolute/program.js
  217. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/absolute/submodule/a.js
  218. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/absolute/test.js
  219. +22 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/all.html
  220. +7 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/cyclic/a.js
  221. +7 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/cyclic/b.js
  222. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/cyclic/program.html
  223. +13 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/cyclic/program.js
  224. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/cyclic/test.js
  225. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/determinism/program.html
  226. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/determinism/program.js
  227. +12 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/determinism/submodule/a.js
  228. +5 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/determinism/submodule/b.js
  229. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/determinism/test.js
  230. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/exactExports/a.js
  231. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/exactExports/program.html
  232. +7 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/exactExports/program.js
  233. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/exactExports/test.js
  234. +3 −0  libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/hasOwnProperty/hasOwnProperty.js
  235. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/hasOwnProperty/program.html
  236. +7 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/hasOwnProperty/program.js
  237. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/hasOwnProperty/test.js
  238. +3 −0  libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/hasOwnProperty/toString.js
  239. +15 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/method/a.js
  240. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/method/program.html
  241. +11 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/method/program.js
  242. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/method/test.js
  243. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/missing/program.html
  244. +11 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/missing/program.js
  245. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/missing/test.js
  246. +4 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/monkeys/a.js
  247. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/monkeys/program.html
  248. +7 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/monkeys/program.js
  249. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/monkeys/test.js
  250. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/nested/a/b/c/d.js
  251. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/nested/program.html
  252. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/nested/program.js
  253. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/nested/test.js
  254. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/relative/program.html
  255. +8 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/relative/program.js
  256. +4 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/relative/submodule/a.js
  257. +5 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/relative/submodule/b.js
  258. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/relative/test.js
  259. +8 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/system.js
  260. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/test.js
  261. +4 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/a.js
  262. +4 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/b.js
  263. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/c.js
  264. +20 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/program.html
  265. +6 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/program.js
  266. +18 −0 libs/requirejs-0.24/tests/commonjs/tests/modules/1.0/transitive/test.js
  267. +43 −0 libs/requirejs-0.24/tests/config.html
  268. +13 −0 libs/requirejs-0.24/tests/dataMain.html
  269. +16 −0 libs/requirejs-0.24/tests/dataMain.js
  270. +15 −0 libs/requirejs-0.24/tests/depoverlap.html
  271. +35 −0 libs/requirejs-0.24/tests/depoverlap.js
  272. +5 −0 libs/requirejs-0.24/tests/dimple.js
  273. +195 −0 libs/requirejs-0.24/tests/doh/LICENSE
  274. +12 −0 libs/requirejs-0.24/tests/doh/README
  275. +855 −0 libs/requirejs-0.24/tests/doh/_browserRunner.js
  276. +20 −0 libs/requirejs-0.24/tests/doh/_nodeRunner.js
  277. +17 −0 libs/requirejs-0.24/tests/doh/_rhinoRunner.js
  278. +10 −0 libs/requirejs-0.24/tests/doh/_sounds/LICENSE
  279. BIN  libs/requirejs-0.24/tests/doh/_sounds/doh.wav
  280. BIN  libs/requirejs-0.24/tests/doh/_sounds/dohaaa.wav
  281. BIN  libs/requirejs-0.24/tests/doh/_sounds/woohoo.wav
  282. +316 −0 libs/requirejs-0.24/tests/doh/runner.html
  283. +1,499 −0 libs/requirejs-0.24/tests/doh/runner.js
  284. +3 −0  libs/requirejs-0.24/tests/doh/runner.sh
  285. BIN  libs/requirejs-0.24/tests/doh/small_logo.png
  286. +13 −0 libs/requirejs-0.24/tests/dos.js
  287. +5 −0 libs/requirejs-0.24/tests/exports/assign.js
  288. +4 −0 libs/requirejs-0.24/tests/exports/assign2.js
  289. +19 −0 libs/requirejs-0.24/tests/exports/exports-tests.js
  290. +14 −0 libs/requirejs-0.24/tests/exports/exports.html
  291. +5 −0 libs/requirejs-0.24/tests/exports/funcSet.js
  292. +5 −0 libs/requirejs-0.24/tests/exports/vanilla.js
  293. +5 −0 libs/requirejs-0.24/tests/foo
  294. +7 −0 libs/requirejs-0.24/tests/func.js
  295. +14 −0 libs/requirejs-0.24/tests/funcFour.js
  296. +15 −0 libs/requirejs-0.24/tests/funcOne.js
  297. +14 −0 libs/requirejs-0.24/tests/funcThree.js
  298. +15 −0 libs/requirejs-0.24/tests/funcTwo.js
  299. +51 −0 libs/requirejs-0.24/tests/i18n/common.html
  300. +3 −0  libs/requirejs-0.24/tests/i18n/commonA.js
Sorry, we could not display the entire diff because too many files (446) changed.
View
58 libs/requirejs-0.24/LICENSE
@@ -0,0 +1,58 @@
+RequireJS is released under two licenses: new BSD, and MIT. You may pick the
+license that best suits your development needs. The text of both licenses are
+provided below.
+
+
+The "New" BSD License:
+----------------------
+
+Copyright (c) 2010-2011, The Dojo Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Dojo Foundation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+MIT License
+-----------
+
+Copyright (c) 2010-2011, The Dojo Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
View
17 libs/requirejs-0.24/README.md
@@ -0,0 +1,17 @@
+# RequireJS
+
+RequireJS loads plain JavaScript files as well as more defined modules. It is optimized for in-browser use, including in [a Web Worker](requirejs/tree/master/docs/api.md#webworker), but it can be used in other JavaScript environments, like Rhino and [Node](requirejs/tree/master/docs/node.md). It implements the [Asynchronous Module](http://wiki.commonjs.org/wiki/Modules/AsynchronousDefinition) API.
+
+RequireJS uses plain script tags to load modules/files, so it should allow for easy debugging. It can be used [simply to load existing JavaScript files](requirejs/tree/master/docs/api.md#jsfiles), so you can add it to your existing project without having to re-write your JavaScript files.
+
+RequireJS includes [an optimization tool](requirejs/tree/master/docs/optimization.md) you can run as part of your packaging steps for deploying your code. The optimization tool can combine and minify your JavaScript files to allow for better performance.
+
+If the JavaScript file defines a JavaScript module via [define()](requirejs/tree/master/docs/api.md#define), then there are other benefits RequireJS can offer: [better CommonJS support](requirejs/tree/master/docs/commonjs.md) and [loading multiple versions](requirejs/tree/master/docs/api.md#multiversion) of a module in a page. RequireJS also has a plugin system that supports features like [i18n string bundles](requirejs/tree/master/docs/api.md#i18n), and [text file dependencies](requirejs/tree/master/docs/api.md#text).
+
+RequireJS does not have any dependencies on a JavaScript framework. It is dual-licensed -- new BSD or MIT.
+
+The standard require.js file is around 5KB when minified via Closure Compiler and gzipped.
+
+RequireJS works in IE 6+, Firefox 2+, Safari 3.2+, Chrome 3+, and Opera 10+.
+
+Latest Release: [0.24.0](http://requirejs.org/docs/download.html)
View
45 libs/requirejs-0.24/adapt/dist.js
@@ -0,0 +1,45 @@
+/**
+ * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * This script will create the final r.js file used in node projects to use
+ * RequireJS.
+ *
+ * This file uses Node to run:
+ * node dist.js
+ */
+
+/*jslint strict: false */
+/*global require: false */
+
+/**
+ * Escapes a string so it is safe as a JS string
+ * Taken from Dojo's buildUtil.jsEscape
+ * @param {String} str
+ * @returns {String}
+ */
+function jsEscape(str) {
+ return ('"' + str.replace(/(["\\])/g, '\\$1') + '"'
+ ).replace(/[\f]/g, '\\f'
+ ).replace(/[\b]/g, '\\b'
+ ).replace(/[\n]/g, '\\n'
+ ).replace(/[\t]/g, '\\t'
+ ).replace(/[\r]/g, '\\r'); // string
+}
+
+var fs = require('fs'),
+ contents = fs.readFileSync('../bin/x.js', 'utf8'),
+ loadRegExp = /readFile\(requireBuildPath \+ '([\w\/\.]+)'\)/g;
+
+//Inline file contents
+contents = contents.replace(loadRegExp, function (match, fileName) {
+ return jsEscape(fs.readFileSync('../' + fileName, 'utf8'));
+});
+
+//Switch the behavior to "inlined mode"
+contents = contents.replace(/useRequireBuildPath \= true/, 'useRequireBuildPath = false');
+
+fs.writeFileSync('r.js', contents, 'utf8');
View
77 libs/requirejs-0.24/adapt/node.js
@@ -0,0 +1,77 @@
+/**
+ * @license RequireJS node Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint regexp: false, strict: false */
+/*global require: false, define: false, nodeRequire: true, process: false */
+
+/**
+ * This adapter assumes that x.js has loaded it and set up
+ * some variables. This adapter just allows limited RequireJS
+ * usage from within the requirejs directory. The general
+ * node adapater is r.js.
+ */
+(function () {
+ var req = nodeRequire,
+ fs = req('fs'),
+ path = req('path'),
+ vm = req('vm');
+
+ //Clear out the global set by x.js
+ nodeRequire = null;
+
+ //Make nodeRequire available off of require, to allow a script to
+ //add things to its require.paths for example.
+ require.nodeRequire = req;
+
+ //Supply an implementation that allows synchronous get of a module.
+ require.get = function (context, moduleName, relModuleMap) {
+ if (moduleName === "require" || moduleName === "exports" || moduleName === "module") {
+ require.onError(new Error("Explicit require of " + moduleName + " is not allowed."));
+ }
+
+ var ret,
+ moduleMap = context.makeModuleMap(moduleName, relModuleMap);
+
+ //Normalize module name, if it contains . or ..
+ moduleName = moduleMap.fullName;
+
+ if (moduleName in context.defined) {
+ ret = context.defined[moduleName];
+ } else {
+ if (ret === undefined) {
+ //Try to dynamically fetch it.
+ require.load(context, moduleName, moduleMap.url);
+ //The above call is sync, so can do the next thing safely.
+ ret = context.defined[moduleName];
+ }
+ }
+
+ return ret;
+ };
+
+ require.load = function (context, moduleName, url) {
+ var contents;
+
+ //isDone is used by require.ready()
+ require.s.isDone = false;
+
+ //Indicate a the module is in process of loading.
+ context.loaded[moduleName] = false;
+ context.scriptCount += 1;
+
+ if (path.existsSync(url)) {
+ contents = fs.readFileSync(url, 'utf8');
+ vm.runInThisContext(contents, url);
+ } else {
+ define(function () {
+ return req(moduleName);
+ });
+ }
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+}());
View
26 libs/requirejs-0.24/adapt/rhino.js
@@ -0,0 +1,26 @@
+/**
+ * @license RequireJS rhino Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint strict: false */
+/*global require: false, java: false, load: false */
+
+(function () {
+
+ require.load = function (context, moduleName, url) {
+ //isDone is used by require.ready()
+ require.s.isDone = false;
+
+ //Indicate a the module is in process of loading.
+ context.loaded[moduleName] = false;
+ context.scriptCount += 1;
+
+ load(url);
+
+ //Support anonymous modules.
+ context.completeLoad(moduleName);
+ };
+
+}());
View
49 libs/requirejs-0.24/adapt/tests/all.js
@@ -0,0 +1,49 @@
+/**
+ * @license RequireJS Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/**
+ * BUILD r.js IN THIS DIRECTORY FIRST BEFORE RUNNING THIS FILE
+ *
+ * To run in Node:
+ * node ../r.js all.js
+ *
+ * To run in Rhino:
+ * java -jar ../../build/lib/rhino/js.jar ../r.js all.js
+ * Debug:
+ * java -classpath ../../build/lib/rhino/js.jar org.mozilla.javascript.tools.debugger.Main ../r.js all.js
+ */
+
+/*jslint strict: false */
+/*global require: false, doh: false */
+
+//Special global flag used by DOH.
+skipDohSetup = true;
+
+require({
+ paths: {
+ env: '../../build/jslib/env'
+ }
+}, [
+ 'alpha',
+ 'beta',
+ '../../tests/doh/runner.js',
+ 'env!../../tests/doh/_{env}Runner.js'
+], function (alpha, beta) {
+
+ doh.register('rjsTests',
+ [
+ function rjsTests(t) {
+ t.is('alpha', alpha.name);
+ t.is('beta', beta.name);
+ t.is('betaSubName', beta.subName);
+ }
+ ]
+ );
+ doh.run();
+
+ //Print out the test summary.
+ doh.run();
+});
View
3  libs/requirejs-0.24/adapt/tests/alpha.js
@@ -0,0 +1,3 @@
+define(function(require, exports) {
+ exports.name = 'alpha';
+});
View
6 libs/requirejs-0.24/adapt/tests/beta.js
@@ -0,0 +1,6 @@
+define(['./sub/betaSub'], function (betaSub) {
+ return {
+ name: 'beta',
+ subName: betaSub.name
+ };
+});
View
37 libs/requirejs-0.24/adapt/tests/node/canvasTest.js
@@ -0,0 +1,37 @@
+//Tested with nave, node 0.2.5,
+//npm install canvas
+//npm install express
+
+/*jslint strict: false */
+/*global require: false, console: false */
+
+var Canvas = require('canvas'),
+ express = require('express'),
+ canvas = new Canvas(200, 200),
+ ctx = canvas.getContext('2d'),
+ app = express.createServer();
+
+
+app.configure(function () {
+
+ app.get('/', function (req, res) {
+ res.send('hello world');
+ });
+
+ app.use(express.gzip());
+ app.listen(3000);
+});
+
+
+ctx.font = '30px Impact';
+ctx.rotate(0.1);
+ctx.fillText("Awesome!", 50, 100);
+
+var te = ctx.measureText('Awesome!');
+ctx.strokeStyle = 'rgba(0,0,0,0.5)';
+ctx.beginPath();
+ctx.lineTo(50, 102);
+ctx.lineTo(50 + te.width, 102);
+ctx.stroke();
+
+console.log('<img src="' + canvas.toDataURL() + '" />');
View
11 libs/requirejs-0.24/adapt/tests/node/index.js
@@ -0,0 +1,11 @@
+//The traditional nodejs http example
+
+require(['sys', 'http'], function (sys, http) {
+ http.createServer(function (req, res) {
+ setTimeout(function () {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Hello World\n');
+ }, 2000);
+ }).listen(8000);
+ sys.puts('Server running at http://127.0.0.1:8000/');
+});
View
6 libs/requirejs-0.24/adapt/tests/node/tests/alpha/foo.js
@@ -0,0 +1,6 @@
+define(function (require) {
+ var foo = require('../foo');
+ return {
+ name: 'ALPHA' + foo.name
+ };
+});
View
9 libs/requirejs-0.24/adapt/tests/node/tests/alpha/hello.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Hello World</title>
+</head>
+<body>
+ <h1>Hello World</h1>
+</body>
+</html>
View
3  libs/requirejs-0.24/adapt/tests/node/tests/foo.js
@@ -0,0 +1,3 @@
+define({
+ name: 'foo'
+});
View
11 libs/requirejs-0.24/adapt/tests/node/tests/server.js
@@ -0,0 +1,11 @@
+//The traditional nodejs http example
+
+require(['sys', 'foo', 'http', 'alpha/foo', 'text!alpha/hello.html'], function (sys, foo, http, alphaFoo, helloHtml) {
+ http.createServer(function (req, res) {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.write('Hello ' + foo.name + '\nHello ' + alphaFoo.name + '\n');
+ res.write(helloHtml)
+ res.end('\n');
+ }).listen(8000);
+ sys.puts('Server running at http://127.0.0.1:8000/');
+});
View
10 libs/requirejs-0.24/adapt/tests/relative.js
@@ -0,0 +1,10 @@
+/*
+Run this file from a directory that is not the directory containing this file
+to see if the baseUrl of this file is used instead of the current directory.
+*/
+
+require(['alpha', 'beta'], function (alpha, beta) {
+ console.log('alpha === ' + alpha.name);
+ console.log('beta === ' + beta.name);
+ console.log('betaSubName === ' + beta.subName);
+});
View
3  libs/requirejs-0.24/adapt/tests/sub/betaSub.js
@@ -0,0 +1,3 @@
+define({
+ name: 'betaSubName'
+});
View
6 libs/requirejs-0.24/bin/x
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# A command line tool to run some RequireJS scripts via Node
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+node $MYDIR/x.js $MYDIR "$@"
View
2  libs/requirejs-0.24/bin/x.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+node %MYDIR%x.js %MYDIR% %*
View
124 libs/requirejs-0.24/bin/x.js
@@ -0,0 +1,124 @@
+/**
+ * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * This is a bootstrap script to allow running RequireJS in the command line
+ * in either a Java/Rhino or Node environment. It is best to call this script
+ * via the x script that is a sibling to it.
+ */
+
+/*jslint strict: false, evil: true */
+/*global readFile: true, process: false, Packages: false, require: true
+ print: false */
+
+var console;
+(function (args, readFileFunc) {
+
+ var fileName, env, fs, vm, exec, rhinoContext,
+ requireBuildPath = '',
+ jsSuffixRegExp = /\.js$/,
+ //This flag is turned to false by the distribution script,
+ //because a requireBuildPath is not needed since the scripts
+ //are inlined in this script.
+ useRequireBuildPath = true,
+ argOffset = useRequireBuildPath ? 0 : 1,
+ readFile = typeof readFileFunc !== 'undefined' ? readFileFunc : null;
+
+ if (typeof Packages !== 'undefined') {
+ env = 'rhino';
+
+ if (useRequireBuildPath) {
+ requireBuildPath = args[0];
+ }
+ fileName = args[1 - argOffset];
+
+ //Set up execution context.
+ rhinoContext = Packages.org.mozilla.javascript.ContextFactory.getGlobal().enterContext();
+
+ exec = function (string, name) {
+ return rhinoContext.evaluateString(this, string, name, 0, null);
+ };
+
+ //Define a console.log for easier logging. Don't
+ //get fancy though.
+ if (typeof console === 'undefined') {
+ console = {
+ log: function () {
+ print.apply(undefined, arguments);
+ }
+ };
+ }
+ } else if (typeof process !== 'undefined') {
+ env = 'node';
+
+ //Get the fs module via Node's require before it
+ //gets replaced. Used in require/node.js
+ fs = require('fs');
+ vm = require('vm');
+ this.nodeRequire = require;
+ require = null;
+
+ readFile = function (path) {
+ return fs.readFileSync(path, 'utf8');
+ };
+
+ exec = function (string, name) {
+ return vm.runInThisContext(string, name);
+ };
+
+ if (useRequireBuildPath) {
+ requireBuildPath = process.argv[2];
+ }
+
+ fileName = process.argv[3 - argOffset];
+ }
+
+ //Make sure build path ends in a slash.
+ requireBuildPath = requireBuildPath.replace(/\\/g, '/');
+ if (requireBuildPath.charAt(requireBuildPath.length - 1) !== "/") {
+ requireBuildPath += "/";
+ }
+
+ //Actual base directory is up one directory from this script.
+ requireBuildPath += '../';
+
+ exec(readFile(requireBuildPath + 'require.js'), 'require.js');
+
+ //These are written out long-form so that they can be replaced by
+ //the distribution script.
+ if (env === 'rhino') {
+ exec(readFile(requireBuildPath + 'adapt/rhino.js'), 'rhino.js');
+ } else if (env === 'node') {
+ exec(readFile(requireBuildPath + 'adapt/node.js'), 'node.js');
+ }
+
+ if (useRequireBuildPath) {
+ exec("require({" +
+ "baseUrl: '" + requireBuildPath + "build/jslib/'" +
+ "})", 'bootstrap');
+ }
+
+ //Support a default file name to execute. Useful for hosted envs
+ //like Joyent where it defaults to a server.js as the only executed
+ //script.
+ if (!fileName || !jsSuffixRegExp.test(fileName)) {
+ fileName = 'main.js';
+ }
+
+ if (!useRequireBuildPath) {
+ //Use the file name's directory as the baseUrl if available.
+ dir = fileName.replace(/\\/g, '/');
+ if (dir.indexOf('/') !== -1) {
+ dir = dir.split('/');
+ dir.pop();
+ dir.join('/');
+ exec("require({baseUrl: '" + dir + "'});");
+ }
+ }
+
+ exec(readFile(fileName), fileName);
+
+}((typeof Packages !== 'undefined' ? arguments : []), (typeof readFile !== 'undefined' ? readFile: undefined)));
View
7 libs/requirejs-0.24/bin/xdebug
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+# A command line tool to run some scripts used in the RequireJS project, in
+# debug mode.
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+node --debug-brk $MYDIR/x.js $MYDIR "$@"
View
2  libs/requirejs-0.24/bin/xdebug.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+node --debug-brk %MYDIR%x.js %MYDIR% %*
View
6 libs/requirejs-0.24/bin/xj
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+# A command line tool to run some RequireJS scripts via Java/Rhino
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+java -classpath $MYDIR/../build/lib/rhino/js.jar:$MYDIR/../build/lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main $MYDIR/x.js $MYDIR "$@"
View
2  libs/requirejs-0.24/bin/xj.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+java -classpath %MYDIR%..\build\lib\rhino\js.jar;%MYDIR%..\build\lib\closure\compiler.jar org.mozilla.javascript.tools.shell.Main %MYDIR%x.js %MYDIR% %*
View
4 libs/requirejs-0.24/bin/xjdebug
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+java -classpath $MYDIR/../build/lib/rhino/js.jar:$MYDIR/../build/lib/closure/compiler.jar org.mozilla.javascript.tools.debugger.Main $MYDIR/x.js $MYDIR "$@"
View
2  libs/requirejs-0.24/bin/xjdebug.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+java -classpath %MYDIR%..\build\lib\rhino\js.jar;%MYDIR%..\build\lib\closure\compiler.jar org.mozilla.javascript.tools.debugger.Main %MYDIR%x.js %MYDIR% %*
View
2  libs/requirejs-0.24/build/build.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+%MYDIR%..\bin\x.bat %MYDIR%build.js %*
View
39 libs/requirejs-0.24/build/build.js
@@ -0,0 +1,39 @@
+/**
+ * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*
+ * Use the .sh or .bat build scripts to run this script. General use:
+ * executingEnv build.js directory/containing/build.js/ profile.build.js
+ *
+ * General use:
+ *
+ * Create a build.js file that has the build options you want and pass that
+ * build file to this file to do the build. See example.build.js for more information.
+ */
+
+/*jslint strict: false */
+/*global require: false */
+
+require({
+ baseUrl: require.s.contexts._.config.baseUrl,
+ //Use a separate context than the default context so that the
+ //build can use the default context.
+ context: 'build'
+}, ['env!env/args', 'build'],
+function (args, build) {
+ //Take off the first argument since it is for
+ //are a path inside requirejs for use by the bootstrap.
+ var buildArgs = args.slice(1),
+ rjsBuildDir = buildArgs[0].replace(/\\/g, '/');
+
+ //The second arg is the full path for this script. The
+ //directory portion is the only part needed though, so adjust it.
+ rjsBuildDir = rjsBuildDir.split('/');
+ rjsBuildDir.pop();
+ buildArgs[0] = rjsBuildDir.length ? rjsBuildDir.join('/') : '.';
+
+ build(buildArgs);
+});
View
4 libs/requirejs-0.24/build/build.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+$MYDIR/../bin/x $MYDIR/build.js "$@"
View
2  libs/requirejs-0.24/build/buildebug.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+%MYDIR%..\bin\xdebug.bat %MYDIR%build.js %*
View
4 libs/requirejs-0.24/build/buildebug.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+$MYDIR/../bin/xdebug $MYDIR/build.js "$@"
View
4 libs/requirejs-0.24/build/buildebugj.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+$MYDIR/../bin/xjdebug $MYDIR/build.js "$@"
View
2  libs/requirejs-0.24/build/buildj.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+%MYDIR%..\bin\xj.bat %MYDIR%build.js %*
View
4 libs/requirejs-0.24/build/buildj.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+$MYDIR/../bin/xj $MYDIR/build.js "$@"
View
2  libs/requirejs-0.24/build/buildjdebug.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+%MYDIR%..\bin\xjdebug.bat %MYDIR%build.js %*
View
2  libs/requirejs-0.24/build/convert/commonjs/convert.bat
@@ -0,0 +1,2 @@
+set MYDIR=%~dp0
+java -classpath %MYDIR%/../lib/rhino/js.jar;%MYDIR%/../lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main %MYDIR%/convertCommonJs.js %MYDIR% %*
View
33 libs/requirejs-0.24/build/convert/commonjs/convert.js
@@ -0,0 +1,33 @@
+/**
+ * Converts CommonJS modules to be requirejs compliant modules.
+ *
+ * Usage:
+ * ../../../bin/x convert.js path/to/commonjs/modules output/dir
+ *
+ */
+/*jslint strict: false */
+/*global require: false */
+
+require(['env!env/args', 'commonJs', 'env!env/print'],
+function (args, commonJs, print) {
+
+ var foundConvert = false,
+ srcDir, outDir;
+
+ //strip off arguments until there is no more convert.js.
+ //Node and Rhino give different numbers of args.
+ //Revisit this later as other code gets moved around.
+ while(!foundConvert) {
+ foundConvert = args.shift() === 'convert.js';
+ }
+
+ srcDir = args[0];
+ outDir = args[1];
+
+ if (!srcDir || !outDir) {
+ print('Usage: convert.js path/to/commonjs/modules output/dir');
+ return;
+ }
+
+ commonJs.convertDir(args[0], args[1]);
+});
View
4 libs/requirejs-0.24/build/convert/commonjs/convert.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+MYDIR=`cd \`dirname "$0"\`; pwd`
+java -classpath $MYDIR/../lib/rhino/js.jar:$MYDIR/../lib/closure/compiler.jar org.mozilla.javascript.tools.shell.Main $MYDIR/convert.js $MYDIR "$@"
View
214 libs/requirejs-0.24/build/convert/stealjs/parse.js
@@ -0,0 +1,214 @@
+/*jslint plusplus: false, strict: false */
+/*global define: false */
+
+/**
+ * An override for the jslib/parse.js to convert stealjs calls into
+ * require/define calls.
+ */
+
+define(['../../jslib/parse'], function (baseParse) {
+
+ var parse = baseParse,
+ allowedCalls = {
+ plugins: true,
+ views: true
+ },
+ viewStringRegExp = /^\/\//;
+
+ /**
+ * Finds a steal node in a nested, backwards AST tree structure.
+ */
+ function getStealCall(node) {
+ if (!baseParse.isArray(node)) {
+ return false;
+ }
+
+ if (node[0] === 'name' && node[1] === 'steal' && !node.isRequireJSParsed) {
+ return node;
+ } else if (node[0] === 'call') {
+ if (node[1][0] === 'name' && node[1][1] === 'steal') {
+ return getStealCall(node[1]);
+ } else if (node[1][0] === 'dot') {
+ return getStealCall(node[1][1]);
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Mark the steal node tree as processed. Need to do this given the
+ * backwards structure of the AST.
+ */
+ function markStealTreeProcessed(node) {
+ getStealCall(node).isRequireJSParsed = true;
+ }
+
+ /**
+ * Transform a .views depdencency to an ejs! plugin loaded depdendency
+ * @param {String} value the .views string name.
+ * @returns {String} an 'ejs!' string
+ */
+ function viewTransform(value) {
+ return 'ejs!' + value.replace(viewStringRegExp, '');
+ }
+
+ function addStringsToArray(node, array, transform) {
+ var i, item, matches = [];
+ for (i = 0; i < node.length; i++) {
+ item = node[i];
+ if (item && baseParse.isArray(item) && item[0] === 'string') {
+ matches.push((transform ? transform(item[1]) : item[1]));
+ }
+ }
+
+ if (matches.length) {
+ //Build up arguments to splice, since we need to put these
+ //matches before other matches, given the backwards nature of
+ //the call traversal in the AST.
+ matches.unshift(0);
+ matches.unshift(0);
+ array.splice.apply(array, matches);
+ }
+ }
+
+ function generateRequireCall(node, array) {
+ if (!baseParse.isArray(node)) {
+ return;
+ }
+
+ var args, previous, call;
+
+ if (node[0] === 'call' && node[1][0] === 'name' && node[1][1] === 'steal') {
+ //A simple steal() call.
+ addStringsToArray(node[2], array);
+ } else {
+ //A chained call
+ //Need to unwind the call since the dot access shows up "backwards"
+ //in the AST.
+ args = node[node.length - 1];
+ previous = node[node.length - 2];
+ call = previous[previous.length - 1];
+
+ if (typeof call === 'string' && allowedCalls[call]) {
+ if (call === 'plugins') {
+ addStringsToArray(args, array);
+ } else if (call === 'views') {
+ addStringsToArray(args, array, viewTransform);
+ }
+
+ //Find out if there are any other chained calls.
+ previous = previous[previous.length - 2];
+
+ generateRequireCall(previous, array);
+ }
+ }
+ }
+
+ parse.oldParseNode = parse.parseNode;
+
+ parse.parseNode = function (node) {
+ var value;
+
+ if (!this.isArray(node)) {
+ return null;
+ }
+
+ //Allow files with regular define/require calls to be co-mingled
+ //with StealJS APIs.
+ value = this.oldParseNode(node);
+ if (value) {
+ return value;
+ }
+
+ if (getStealCall(node)) {
+ value = [];
+ generateRequireCall(node, value);
+ if (value.length) {
+ markStealTreeProcessed(node);
+ return "require(" + JSON.stringify(value) + ");";
+ } else {
+ return '';
+ }
+ }
+
+ return null;
+ };
+
+/*
+ use console.log(JSON.stringify(node, null, ' ')) to print out AST
+
+ Using this:
+ steal.plugins('foo','bar').views('//abc/init.ejs').then(function(){})
+
+ Has this for one of the nodes.
+
+[
+ "call",
+ [
+ "dot",
+ [
+ "call",
+ [
+ "dot",
+ [
+ "name",
+ "steal"
+ ],
+ "plugins"
+ ],
+ [
+ [
+ "string",
+ "foo"
+ ],
+ [
+ "string",
+ "bar"
+ ]
+ ]
+ ],
+ "views"
+ ],
+ [
+ [
+ "string",
+ "//abc/init.ejs"
+ ]
+ ]
+]
+
+**************************
+
+steal('one', 'two')
+
+[
+ "toplevel",
+ [
+ [
+ "stat",
+ [
+ "call",
+ [
+ "name",
+ "steal"
+ ],
+ [
+ [
+ "string",
+ "one"
+ ],
+ [
+ "string",
+ "two"
+ ]
+ ]
+ ]
+ ]
+ ]
+]
+
+*/
+
+ return parse;
+});
View
23 libs/requirejs-0.24/build/convert/stealjs/tests/all.js
@@ -0,0 +1,23 @@
+/**
+ * Run the tests in Node:
+ * ../../../../bin/x all-node.js
+ */
+
+/*jslint plusplus: false, strict: false */
+/*global load: false, doh: false, skipDohSetup: true */
+
+//A hack to doh to avoid dojo setup stuff in doh/runner.js
+skipDohSetup = true;
+
+require({
+ baseUrl: '../../../jslib/',
+ paths: {
+ parse: '../convert/stealjs/parse'
+ }
+}, [
+ '../../../../tests/doh/runner.js',
+ 'env!../../../../tests/doh/_{env}Runner.js',
+ './parse'
+], function () {
+ doh.run();
+});
View
20 libs/requirejs-0.24/build/convert/stealjs/tests/parse.js
@@ -0,0 +1,20 @@
+/*jslint plusplus: false, strict: false */
+/*global load: false, doh: false, require:false */
+
+define(['require', 'parse'], function (require, parse) {
+
+ doh.register(
+ "parseStealCalls",
+ [
+ function parseStealCalls(t) {
+ var good1 = "steal.plugins('foo','bar').views('//abc/init.ejs').then(function(){})",
+ good2 = "steal('one', 'two')";
+
+ t.is('require(["foo","bar","ejs!abc/init.ejs"]);', parse("good1", good1));
+ t.is('require(["one","two"]);', parse("good2", good2));
+ }
+ ]
+ );
+ doh.run();
+
+});
View
187 libs/requirejs-0.24/build/example.build.js
@@ -0,0 +1,187 @@
+/*
+ * This is an example build file that demonstrates how to use the build system for
+ * require.js.
+ *
+ * THIS BUILD FILE WILL NOT WORK. It is referencing paths that probably
+ * do not exist on your machine. Just use it as a guide.
+ *
+ *
+ */
+
+({
+ //The top level directory that contains your app. If this option is used
+ //then it assumed your scripts are in a subdirectory under this path.
+ //This option is not required. If it is not specified, then baseUrl
+ //below is the anchor point for finding things. If this option is specified,
+ //then all the files from the app directory will be copied to the dir:
+ //output area, and baseUrl will assume to be a relative path under
+ //this directory.
+ appDir: "some/path/",
+
+ //By default, all modules are located relative to this path. If baseUrl
+ //is not explicitly set, then all modules are loaded relative to
+ //the directory that holds the build file.
+ baseUrl: "./",
+
+ //Set paths for modules. If relative paths, set relative to baseUrl above.
+ paths: {
+ "foo.bar": "../scripts/foo/bar",
+ "baz": "../another/path/baz"
+ },
+
+ //Configure CommonJS packages. See http://requirejs.org/docs/api.html#packages
+ //for more information.
+ packagePaths: [],
+ packages: [],
+
+ //The directory path to save the output. If not specified, then
+ //the path will default to be a directory called "build" as a sibling
+ //to the build file. All relative paths are relative to the build file.
+ dir: "../some/path",
+
+ //Used to inline i18n resources into the built file. If no locale
+ //is specified, i18n resources will not be inlined. Only one locale
+ //can be inlined for a build. Root bundles referenced by a build layer
+ //will be included in a build layer regardless of locale being set.
+ locale: "en-us",
+
+ //How to optimize all the JS files in the build output directory.
+ //Right now only the following values
+ //are supported:
+ //- "uglify": (default) uses UglifyJS to minify the code.
+ //- "closure": uses Google's Closure Compiler in simple optimization
+ //mode to minify the code. Only available if running the optimizer using
+ //Java.
+ //- "closure.keepLines": Same as closure option, but keeps line returns
+ //in the minified files.
+ //- "none": no minification will be done.
+ optimize: "uglify",
+
+ //If using UglifyJS for script optimization, these config options can be
+ //used to pass configuration values to UglifyJS.
+ //See https://github.com/mishoo/UglifyJS for the possible values.
+ uglify: {
+ gen_codeOptions: {},
+ strict_semicolons: {},
+ do_toplevel: {},
+ ast_squeezeOptions: {}
+ },
+
+ //If using Closure Compiler for script optimization, these config options
+ //can be used to configure Closure Compiler. See the documentation for
+ //Closure compiler for more information.
+ closure: {
+ CompilerOptions: {},
+ CompilationLevel: 'SIMPLE_OPTIMIZATIONS',
+ loggingLevel: 'WARNING'
+ }
+
+ //Allow CSS optimizations. Allowed values:
+ //- "standard": @import inlining, comment removal and line returns.
+ //Removing line returns may have problems in IE, depending on the type
+ //of CSS.
+ //- "standard.keepLines": like "standard" but keeps line returns.
+ //- "none": skip CSS optimizations.
+ optimizeCss: "standard.keepLines",
+
+ //If optimizeCss is in use, a list of of files to ignore for the @import
+ //inlining. The value of this option should be a comma separated list
+ //of CSS file names to ignore. The file names should match whatever
+ //strings are used in the @import calls.
+ cssImportIgnore: null,
+
+ //Inlines the text for any text! dependencies, to avoid the separate
+ //async XMLHttpRequest calls to load those dependencies.
+ inlineText: true,
+
+ //Allow "use strict"; be included in the RequireJS files.
+ //Default is false because there are not many browsers that can properly
+ //process and give errors on code for ES5 strict mode,
+ //and there is a lot of legacy code that will not work in strict mode.
+ useStrict: false,
+
+ //Specify build pragmas. If the source files contain comments like so:
+ //>>excludeStart("fooExclude", pragmas.fooExclude);
+ //>>excludeEnd("fooExclude");
+ //Then the comments that start with //>> are the build pragmas.
+ //excludeStart/excludeEnd and includeStart/includeEnd work, and the
+ //the pragmas value to the includeStart or excludeStart lines
+ //is evaluated to see if the code between the Start and End pragma
+ //lines should be included or excluded.
+ pragmas: {
+ fooExclude: true
+ },
+
+ //Skip processing for pragmas.
+ skipPragmas: false,
+
+ //If skipModuleInsertion is false, then files that do not use require.def
+ //to define modules will get a require.def() placeholder inserted for them.
+ //Also, require.pause/resume calls will be inserted.
+ //Set it to true to avoid this. This is useful if you are building code that
+ //does not use require() in the built project or in the JS files, but you
+ //still want to use the optimization tool from RequireJS to concatenate modules
+ //together.
+ skipModuleInsertion: false,
+
+ //List the modules that will be optimized. All their immediate and deep
+ //dependencies will be included in the module's file when the build is
+ //done. If that module or any of its dependencies includes i18n bundles,
+ //only the root bundles will be included unless the locale: section is set above.
+ modules: [
+ //Just specifying a module name means that module will be converted into
+ //a built file that contains all of its dependencies. If that module or any
+ //of its dependencies includes i18n bundles, they may not be included in the
+ //built file unless the locale: section is set above.
+ {
+ name: "foo/bar/bop",
+
+ //Should the contents of require.js be included in the optimized module.
+ //Defaults to false.
+ includeRequire: true,
+
+ //For build profiles that contain more than one modules entry,
+ //allow overrides for the properties that set for the whole build,
+ //for example a different set of pragmas for this module.
+ //The override's value is an object that can
+ //contain any of the other build options in this file.
+ override: {
+ pragmas: {
+ fooExclude: true
+ }
+ }
+ },
+
+ //This module entry combines all the dependencies of foo/bar/bop and foo/bar/bee
+ //and any of their dependencies into one file.
+ {
+ name: "foo/bar/bop",
+ include: ["foo/bar/bee"]
+ },
+
+ //This module entry combines all the dependencies of foo/bar/bip into one file,
+ //but excludes foo/bar/bop and its dependencies from the built file. If you want
+ //to exclude a module that is also another module being optimized, it is more
+ //efficient if you define that module optimization entry before using it
+ //in an exclude array.
+ {
+ name: "foo/bar/bip",
+ exclude: [
+ "foo/bar/bop"
+ ]
+ },
+
+ //This module entry shows how to specify a specific module be excluded
+ //from the built module file. excludeShallow means just exclude that
+ //specific module, but if that module has nested dependencies that are
+ //part of the built file, keep them in there. This is useful during
+ //development when you want to have a fast bundled set of modules, but
+ //just develop/debug one or two modules at a time.
+ {
+ name: "foo/bar/bin",
+ excludeShallow: [
+ "foo/bar/bot"
+ ]
+ }
+ ]
+})
View
745 libs/requirejs-0.24/build/jslib/build.js
@@ -0,0 +1,745 @@
+/**
+ * @license Copyright (c) 2010-2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/requirejs for details
+ */
+
+/*jslint regexp: false, plusplus: false, nomen: false, strict: false */
+/*global define: false, require: false */
+
+
+define([ 'lang', 'logger', 'env!env/file', 'parse', 'optimize', 'pragma',
+ 'env!env/load', 'requirePatch'],
+function (lang, logger, file, parse, optimize, pragma,
+ load, requirePatch) {
+ var build, buildBaseConfig;
+
+ buildBaseConfig = {
+ requireBuildPath: "../",
+ appDir: "",
+ pragmas: {},
+ paths: {},
+ optimize: "uglify",
+ optimizeCss: "standard.keepLines",
+ inlineText: true,
+ isBuild: true
+ };
+
+ function endsWithSlash(dirName) {
+ if (dirName.charAt(dirName.length - 1) !== "/") {
+ dirName += "/";
+ }
+ return dirName;
+ }
+
+
+ /**
+ * Main API entry point into the build. The args argument can either be
+ * an array of arguments (like the onese passed on a command-line),
+ * or it can be a JavaScript object that has the format of a build profile
+ * file.
+ *
+ * If it is an object, then in addition to the normal properties allowed in
+ * a build profile file, the object should contain one other property:
+ *
+ * requireBuildPath: a string that is the path to find require.js and the
+ * require/ directory. This should be a pristine require.js with only
+ * require.js contents (no plugins or jQuery).
+ *
+ * The object could also contain a "buildFile" property, which is a string
+ * that is the file path to a build profile that contains the rest
+ * of the build profile directives.
+ *
+ * This function does not return a status, it should throw an error if
+ * there is a problem completing the build.
+ */
+ build = function (args) {
+ var requireBuildPath, buildFile, cmdConfig;
+
+ if (!args || lang.isArray(args)) {
+ if (!args || args.length < 2) {
+ logger.error("build.js directory/containing/build.js/ buildProfile.js\n" +
+ "where buildProfile.js is the name of the build file (see example.build.js for hints on how to make a build file).");
+ return;
+ }
+
+ //Second argument should be the directory on where to find this script.
+ //This path should end in a slash.
+ requireBuildPath = args[0];
+ requireBuildPath = endsWithSlash(requireBuildPath);
+
+ //Next args can include a build file path as well as other build args.
+ //build file path comes first. If it does not contain an = then it is
+ //a build file path. Otherwise, just all build args.
+ if (args[1].indexOf("=") === -1) {
+ buildFile = args[1];
+ args.splice(0, 2);
+ } else {
+ args.splice(0, 1);
+ }
+
+ //Remaining args are options to the build
+ cmdConfig = build.convertArrayToObject(args);
+ cmdConfig.buildFile = buildFile;
+ cmdConfig.requireBuildPath = requireBuildPath;
+ } else {
+ cmdConfig = args;
+ }
+
+ build._run(cmdConfig);
+ };
+
+ build._run = function (cmdConfig) {
+ var buildFileContents = "",
+ buildPaths, fileName, fileNames,
+ prop, paths, i,
+ baseConfig, config,
+ modules, builtModule, srcPath, buildContext,
+ destPath;
+
+ //Can now run the patches to require.js to allow it to be used for
+ //build generation. Do it here instead of at the top of the module
+ //because we want normal require behavior to load the build tool
+ //then want to switch to build mode.
+ requirePatch();
+
+ config = build.createConfig(cmdConfig);
+ paths = config.paths;
+
+ if (!config.out && !config.cssIn) {
+ //This is not just a one-off file build but a full build profile, with
+ //lots of files to process.
+
+ //First copy all the baseUrl content
+ file.copyDir((config.appDir || config.baseUrl), config.dir, /\w/, true);
+
+ //Adjust baseUrl if config.appDir is in play, and set up build output paths.
+ buildPaths = {};
+ if (config.appDir) {
+ //All the paths should be inside the appDir
+ buildPaths = paths;
+ } else {
+ //If no appDir, then make sure to copy the other paths to this directory.
+ for (prop in paths) {
+ if (paths.hasOwnProperty(prop)) {
+ //Set up build path for each path prefix.
+ buildPaths[prop] = prop.replace(/\./g, "/");
+
+ //Make sure source path is fully formed with baseUrl,
+ //if it is a relative URL.
+ srcPath = paths[prop];
+ if (srcPath.indexOf('/') !== 0 && srcPath.indexOf(':') === -1) {
+ srcPath = config.baseUrl + srcPath;
+ }
+
+ destPath = config.dirBaseUrl + buildPaths[prop];
+
+ //If the srcPath is a directory, copy the whole directory.
+ if (file.exists(srcPath) && file.isDirectory(srcPath)) {
+ //Copy files to build area. Copy all files (the /\w/ regexp)
+ file.copyDir(srcPath, destPath, /\w/, true);
+ } else {
+ //Try a .js extension
+ srcPath += '.js';
+ destPath += '.js';
+ file.copyFile(srcPath, destPath);
+ }
+ }
+ }
+ }
+ }
+
+ //Figure out source file location for each module layer. Do this by seeding require
+ //with source area configuration. This is needed so that later the module layers
+ //can be manually copied over to the source area, since the build may be
+ //require multiple times and the above copyDir call only copies newer files.
+ require({
+ baseUrl: config.baseUrl,
+ paths: paths,
+ packagePaths: config.packagePaths,
+ packages: config.packages
+ });
+ buildContext = require.s.contexts._;
+ modules = config.modules;
+
+ if (modules) {
+ modules.forEach(function (module) {
+ if (module.name) {
+ module._sourcePath = buildContext.nameToUrl(module.name);
+ //If the module does not exist, and this is not a "new" module layer,
+ //as indicated by a true "create" property on the module, and
+ //it is not a plugin-loaded resource, then throw an error.
+ if (!file.exists(module._sourcePath) && !module.create &&
+ module.name.indexOf('!') === -1) {
+ throw new Error("ERROR: module path does not exist: " +
+ module._sourcePath + " for module named: " + module.name +
+ ". Path is relative to: " + file.absPath('.'));
+ }
+ }
+ });
+ }
+
+ if (config.out) {
+ //Just set up the _buildPath for the module layer.
+ require(config);
+ if (!config.cssIn) {
+ config.modules[0]._buildPath = config.out;
+ }
+ } else if (!config.cssIn) {
+ //Now set up the config for require to use the build area, and calculate the
+ //build file locations. Pass along any config info too.
+ baseConfig = {
+ baseUrl: config.dirBaseUrl,
+ paths: buildPaths
+ };
+
+ lang.mixin(baseConfig, config);
+ require(baseConfig);
+
+ if (modules) {
+ modules.forEach(function (module) {
+ if (module.name) {
+ module._buildPath = buildContext.nameToUrl(module.name, null);
+ if (!module.create) {
+ file.copyFile(module._sourcePath, module._buildPath);
+ }
+ }
+ });
+ }
+ }
+
+ if (modules) {
+ //For each module layer, call require to calculate dependencies.
+ modules.forEach(function (module) {
+ module.layer = build.traceDependencies(module, config);
+ });
+
+ //Now build up shadow layers for anything that should be excluded.
+ //Do this after tracing dependencies for each module, in case one
+ //of those modules end up being one of the excluded values.
+ modules.forEach(function (module) {
+ if (module.exclude) {
+ module.excludeLayers = [];
+ module.exclude.forEach(function (exclude, i) {
+ //See if it is already in the list of modules.
+ //If not trace dependencies for it.
+ module.excludeLayers[i] = build.findBuildModule(exclude, modules) ||
+ {layer: build.traceDependencies({name: exclude}, config)};
+ });
+ }
+ });
+
+ modules.forEach(function (module) {
+ if (module.exclude) {
+ //module.exclude is an array of module names. For each one,
+ //get the nested dependencies for it via a matching entry
+ //in the module.excludeLayers array.
+ module.exclude.forEach(function (excludeModule, i) {
+ var excludeLayer = module.excludeLayers[i].layer, map = excludeLayer.buildPathMap, prop;
+ for (prop in map) {
+ if (map.hasOwnProperty(prop)) {
+ build.removeModulePath(prop, map[prop], module.layer);
+ }
+ }
+ });
+ }
+ if (module.excludeShallow) {
+ //module.excludeShallow is an array of module names.
+ //shallow exclusions are just that module itself, and not
+ //its nested dependencies.
+ module.excludeShallow.forEach(function (excludeShallowModule) {
+ var path = module.layer.buildPathMap[excludeShallowModule];
+ if (path) {
+ build.removeModulePath(excludeShallowModule, path, module.layer);
+ }
+ });
+ }
+
+ //Flatten them and collect the build output for each module.
+ builtModule = build.flattenModule(module, module.layer, config);
+ file.saveUtf8File(module._buildPath, builtModule.text);
+ buildFileContents += builtModule.buildText;
+ });
+ }
+
+ //Do other optimizations.
+ if (config.out && !config.cssIn) {
+ //Just need to worry about one JS file.
+ fileName = config.modules[0]._buildPath;
+ optimize.jsFile(fileName, fileName, config);
+ } else if (!config.cssIn) {
+ //Normal optimizations across modules.
+
+ //JS optimizations.
+ fileNames = file.getFilteredFileList(config.dir, /\.js$/, true);
+ for (i = 0; (fileName = fileNames[i]); i++) {
+ optimize.jsFile(fileName, fileName, config);
+ }
+
+ //CSS optimizations
+ if (config.optimizeCss && config.optimizeCss !== "none") {
+ optimize.css(config.dir, config);
+ }
+
+ //All module layers are done, write out the build.txt file.
+ file.saveUtf8File(config.dir + "build.txt", buildFileContents);
+ }
+
+ //If just have one CSS file to optimize, do that here.
+ if (config.cssIn) {
+ optimize.cssFile(config.cssIn, config.out, config);
+ }
+
+ //Print out what was built into which layers.
+ if (buildFileContents) {
+ logger.info(buildFileContents);
+ }
+ };
+
+ /**
+ * Converts an array that has String members of "name=value"
+ * into an object, where the properties on the object are the names in the array.
+ * Also converts the strings "true" and "false" to booleans for the values.
+ * member name/value pairs, and converts some comma-separated lists into
+ * arrays.
+ * @param {Array} ary
+ */
+ build.convertArrayToObject = function (ary) {
+ var result = {}, i, separatorIndex, prop, value,
+ needArray = {
+ "include": true,
+ "exclude": true,
+ "excludeShallow": true
+ };
+
+ for (i = 0; i < ary.length; i++) {
+ separatorIndex = ary[i].indexOf("=");
+ if (separatorIndex === -1) {
+ throw "Malformed name/value pair: [" + ary[i] + "]. Format should be name=value";
+ }
+
+ value = ary[i].substring(separatorIndex + 1, ary[i].length);
+ if (value === "true") {
+ value = true;
+ } else if (value === "false") {
+ value = false;
+ }
+
+ prop = ary[i].substring(0, separatorIndex);
+
+ //Convert to array if necessary
+ if (needArray[prop]) {
+ value = value.split(",");
+ }
+
+ if (prop.indexOf("paths.") === 0) {
+ //Special handling of paths properties. paths.foo=bar is transformed
+ //to data.paths = {foo: 'bar'}
+ if (!result.paths) {
+ result.paths = {};
+ }
+ prop = prop.substring("paths.".length, prop.length);
+ result.paths[prop] = value;
+ } else {
+ result[prop] = value;
+ }
+ }
+ return result; //Object
+ };
+
+ build.makeAbsPath = function (path, absFilePath) {
+ //Add abspath if necessary. If path starts with a slash or has a colon,
+ //then already is an abolute path.
+ if (path.indexOf('/') !== 0 && path.indexOf(':') === -1) {
+ path = absFilePath +
+ (absFilePath.charAt(absFilePath.length - 1) === '/' ? '' : '/') +
+ path;
+ path = file.normalize(path);
+ }
+ return path;
+ };
+
+ /**
+ * Creates a config object for an optimization build.
+ * It will also read the build profile if it is available, to create
+ * the configuration.
+ *
+ * @param {Object} cfg config options that take priority
+ * over defaults and ones in the build file. These options could
+ * be from a command line, for instance.
+ *
+ * @param {Object} the created config object.
+ */
+ build.createConfig = function (cfg) {
+ /*jslint evil: true */
+ var config = {}, buildFileContents, buildFileConfig,
+ paths, props, i, prop, buildFile, absFilePath, originalBaseUrl;
+
+ lang.mixin(config, buildBaseConfig);
+ lang.mixin(config, cfg, true);
+
+ //Normalize build directory location, and set up path to require.js
+ if (config.requireBuildPath.charAt(config.requireBuildPath.length - 1) !== "/") {
+ config.requireBuildPath += "/";
+ //Also adjust the override config params, since it
+ //may be re-applied later after reading the build file.
+ if (cfg.requireBuildPath) {
+ cfg.requireBuildPath = config.requireBuildPath;
+ }
+ }
+ config.requireUrl = file.absPath(cfg.requireBuildPath + "../require.js");
+
+ if (config.buildFile) {
+ //A build file exists, load it to get more config.
+ buildFile = file.absPath(config.buildFile);
+
+ //Find the build file, and make sure it exists, if this is a build
+ //that has a build profile, and not just command line args with an in=path
+ if (!file.exists(buildFile)) {
+ throw new Error("ERROR: build file does not exist: " + buildFile);
+ }
+
+ absFilePath = config.baseUrl = file.absPath(file.parent(buildFile));
+ config.dir = config.baseUrl + "/build/";
+
+ //Load build file options.
+ buildFileContents = file.readFile(buildFile);
+ try {
+ buildFileConfig = eval("(" + buildFileContents + ")");
+ } catch(e) {
+ throw new Error("Build file " + buildFile + " is malformed: " + e);
+ }
+ lang.mixin(config, buildFileConfig, true);
+
+ //Re-apply the override config values, things like command line
+ //args should take precedence over build file values.
+ lang.mixin(config, cfg, true);
+ } else {
+ if (!config.out && !config.cssIn) {
+ throw new Error("ERROR: 'out' or 'cssIn' option missing.");
+ }
+ if (!config.out) {
+ throw new Error("ERROR: 'out' option missing.");
+ } else {
+ config.out = config.out.replace(lang.backSlashRegExp, "/");
+ }
+
+ if (!config.cssIn && !cfg.baseUrl) {
+ throw new Error("ERROR: 'baseUrl' option missing.");
+ }
+
+ //In this scenario, the absFile path is current directory
+ absFilePath = file.absPath('.');
+ }
+
+ if (config.out && !config.cssIn) {
+ //Just one file to optimize.
+
+ //Set up dummy module layer to build.
+ config.modules = [
+ {
+ name: config.name,
+ out: config.out,
+ include: config.include,
+ exclude: config.exclude,
+ excludeShallow: config.excludeShallow
+ }
+ ];
+
+ if (config.includeRequire) {
+ config.modules[0].includeRequire = true;
+ }
+
+ //Does not have a build file, so set up some defaults.
+ //Optimizing CSS should not be allowed, unless explicitly
+ //asked for on command line. In that case the only task is
+ //to optimize a CSS file.
+ if (!cfg.optimizeCss) {
+ config.optimizeCss = "none";
+ }
+ }
+
+ //Adjust the path properties as appropriate.
+ //First make sure build paths use front slashes and end in a slash,
+ //and make sure they are aboslute paths.
+ props = ["appDir", "dir", "baseUrl"];
+ for (i = 0; (prop = props[i]); i++) {
+ if (config[prop]) {
+ config[prop] = config[prop].replace(lang.backSlashRegExp, "/");
+
+ //Add abspath if necessary.
+ if (prop === "baseUrl") {
+ originalBaseUrl = config.baseUrl;
+ if (config.appDir) {
+ //If baseUrl with an appDir, the baseUrl is relative to
+ //the appDir, *not* the absFilePath. appDir and dir are
+ //made absolute before baseUrl, so this will work.
+ config.baseUrl = build.makeAbsPath(originalBaseUrl, config.appDir);
+ //Set up dir output baseUrl.
+ config.dirBaseUrl = build.makeAbsPath(originalBaseUrl, config.dir);
+ } else {
+ //The dir output baseUrl is same as regular baseUrl, both
+ //relative to the absFilePath.
+ config.baseUrl = build.makeAbsPath(config[prop], absFilePath);
+ config.dirBaseUrl = config.dir || config.baseUrl;
+ }
+
+ //Make sure dirBaseUrl ends in a slash, since it is
+ //concatenated with other strings.
+ config.dirBaseUrl = endsWithSlash(config.dirBaseUrl);
+ } else {
+ config[prop] = build.makeAbsPath(config[prop], absFilePath);
+ }
+
+ config[prop] = endsWithSlash(config[prop]);
+ }
+ }
+
+ //Make sure some other paths are absolute.
+ props = ["out", "cssIn"];
+ for (i = 0; (prop = props[i]); i++) {
+ if (config[prop]) {
+ config[prop] = build.makeAbsPath(config[prop], absFilePath);
+ }
+ }
+
+ return config;
+ };
+
+ /**
+ * finds the module being built/optimized with the given moduleName,
+ * or returns null.
+ * @param {String} moduleName
+ * @param {Array} modules
+ * @returns {Object} the module object from the build profile, or null.
+ */
+ build.findBuildModule = function (moduleName, modules) {
+ var i, module;
+ for (i = 0; (module = modules[i]); i++) {
+ if (module.name === moduleName) {
+ return module;
+ }
+ }
+ return null;
+ };
+
+ /**
+ * Removes a module name and path from a layer, if it is supposed to be
+ * excluded from the layer.
+ * @param {String} moduleName the name of the module
+ * @param {String} path the file path for the module
+ * @param {Object} layer the layer to remove the module/path from
+ */
+ build.removeModulePath = function (module, path, layer) {
+ var index = layer.buildFilePaths.indexOf(path);
+ if (index !== -1) {
+ layer.buildFilePaths.splice(index, 1);
+ }
+
+ //Take it out of the specified modules. Specified modules are mostly
+ //used to find require modifiers.
+ delete layer.specified[module];
+ };
+
+ /**
+ * Uses the module build config object to trace the dependencies for the
+ * given module.
+ *
+ * @param {Object} module the module object from the build config info.
+ * @param {Object} the build config object.
+ *
+ * @returns {Object} layer information about what paths and modules should
+ * be in the flattened module.
+ */
+ build.traceDependencies = function (module, config) {
+ var include, override, layer, context, baseConfig, oldContext;
+
+ //Reset some state set up in requirePatch.js, and clean up require's
+ //current context.
+ oldContext = require._buildReset();
+
+ //Grab the reset layer and context after the reset, but keep the
+ //old config to reuse in the new context.
+ baseConfig = oldContext.config;
+ layer = require._layer;
+ context = layer.context;
+
+ //Put back basic config, use a fresh object for it.
+ //WARNING: probably not robust for paths and packages/packagePaths,
+ //since those property's objects can be modified. But for basic
+ //config clone it works out.
+ require(lang.delegate(baseConfig));
+
+ logger.trace("\nTracing dependencies for: " + (module.name || module.out));
+ include = module.name && !module.create ? [module.name] : [];
+ if (module.include) {
+ include = include.concat(module.include);
+ }
+
+ //If there are overrides to basic config, set that up now.;
+ if (module.override) {
+ override = lang.delegate(baseConfig);
+ lang.mixin(override, module.override, true);
+ require(override);
+ }
+
+ //Figure out module layer dependencies by calling require to do the work.
+ require(include);
+
+ //Pull out the layer dependencies.
+ layer.specified = context.specified;
+
+ //Reset config
+ if (module.override) {
+ require(baseConfig);
+ }
+
+ return layer;
+ };
+
+ /**
+ * Uses the module build config object to create an flattened version
+ * of the module, with deep dependencies included.
+ *
+ * @param {Object} module the module object from the build config info.
+ *
+ * @param {Object} layer the layer object returned from build.traceDependencies.
+ *
+ * @param {Object} the build config object.
+ *
+ * @returns {Object} with two properties: "text", the text of the flattened
+ * module, and "buildText", a string of text representing which files were
+ * included in the flattened module text.
+ */
+ build.flattenModule = function (module, layer, config) {
+ var buildFileContents = "", requireContents = "",
+ context = layer.context,
+ path, reqIndex, fileContents, currContents,
+ i, moduleName, includeRequire,
+ parts, builder, writeApi;
+
+ //Use override settings, particularly for pragmas
+ if (module.override) {
+ config = lang.delegate(config);
+ lang.mixin(config, module.override, true);
+ }
+
+ //Start build output for the module.
+ buildFileContents += "\n" +
+ (config.dir ? module._buildPath.replace(config.dir, "") : module._buildPath) +
+ "\n----------------\n";
+
+ //If the file wants require.js added to the module, add it now
+ requireContents = "";
+ includeRequire = false;
+ if ("includeRequire" in module) {
+ includeRequire = module