ninjs 0.13.6 → 0.13.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. data/VERSION +1 -1
  2. data/ninjs.gemspec +5 -290
  3. metadata +52 -345
  4. data/.bundle/config +0 -2
  5. data/CNAME +0 -1
  6. data/Gemfile +0 -16
  7. data/Gemfile.lock +0 -36
  8. data/LICENSE +0 -29
  9. data/README.md +0 -348
  10. data/bin/ninjs +0 -218
  11. data/lib/ninjs.rb +0 -10
  12. data/lib/ninjs/command.rb +0 -91
  13. data/lib/ninjs/configuration.rb +0 -72
  14. data/lib/ninjs/dependencies.rb +0 -16
  15. data/lib/ninjs/generator.rb +0 -57
  16. data/lib/ninjs/helpers.rb +0 -17
  17. data/lib/ninjs/manifest.rb +0 -9
  18. data/lib/ninjs/notification.rb +0 -37
  19. data/lib/ninjs/project.rb +0 -233
  20. data/repository/jquery/1.1.4.js +0 -2508
  21. data/repository/jquery/1.2.6.js +0 -32
  22. data/repository/jquery/1.3.2.js +0 -19
  23. data/repository/jquery/1.4.2.js +0 -154
  24. data/repository/jquery/1.4.3.js +0 -166
  25. data/repository/jquery/1.4.4.js +0 -167
  26. data/repository/jquery/1.5.js +0 -16
  27. data/repository/jquery/fancybox/1.3.1.js +0 -1079
  28. data/repository/jquery/fancybox/assets/1.3.1/css/fancybox.css +0 -363
  29. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/blank.gif +0 -0
  30. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_close.png +0 -0
  31. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_loading.png +0 -0
  32. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_left.png +0 -0
  33. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_nav_right.png +0 -0
  34. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_e.png +0 -0
  35. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_n.png +0 -0
  36. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_ne.png +0 -0
  37. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_nw.png +0 -0
  38. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_s.png +0 -0
  39. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_se.png +0 -0
  40. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_sw.png +0 -0
  41. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_shadow_w.png +0 -0
  42. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_left.png +0 -0
  43. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_main.png +0 -0
  44. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_over.png +0 -0
  45. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancy_title_right.png +0 -0
  46. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-x.png +0 -0
  47. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox-y.png +0 -0
  48. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/fancybox.png +0 -0
  49. data/repository/jquery/fancybox/assets/1.3.1/images/fancybox/jquery.easing-1.3.pack.js +0 -72
  50. data/repository/jquery/fancybox/latest.js +0 -1
  51. data/repository/jquery/latest.js +0 -1
  52. data/repository/jquery/mobile/1.0a3.js +0 -123
  53. data/repository/jquery/mobile/1.0a3/assets/css/jquery.mobile.css +0 -1652
  54. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/ajax-loader.png +0 -0
  55. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-off.png +0 -0
  56. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-check-on.png +0 -0
  57. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-off.png +0 -0
  58. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/form-radio-on.png +0 -0
  59. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icon-search-black.png +0 -0
  60. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-black.png +0 -0
  61. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-18-white.png +0 -0
  62. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-black.png +0 -0
  63. data/repository/jquery/mobile/1.0a3/assets/images/jquerymobile/icons-36-white.png +0 -0
  64. data/repository/jquery/mobile/latest.js +0 -1
  65. data/repository/jquery/mousewheel/3.0.2.js +0 -11
  66. data/repository/jquery/mousewheel/latest.js +0 -1
  67. data/repository/jquery/ui/1.8.7.js +0 -783
  68. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.accordion.css +0 -19
  69. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.all.css +0 -11
  70. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.autocomplete.css +0 -53
  71. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.base.css +0 -11
  72. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.button.css +0 -38
  73. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.core.css +0 -41
  74. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.datepicker.css +0 -68
  75. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.dialog.css +0 -21
  76. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.progressbar.css +0 -11
  77. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.resizable.css +0 -20
  78. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.selectable.css +0 -10
  79. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.slider.css +0 -24
  80. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.tabs.css +0 -18
  81. data/repository/jquery/ui/assets/1.8.7/css/jqueryui/jquery.ui.theme.css +0 -252
  82. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  83. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_flat_75_ffffff_40x100.png +0 -0
  84. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  85. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_65_ffffff_1x400.png +0 -0
  86. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_dadada_1x400.png +0 -0
  87. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  88. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  89. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  90. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_222222_256x240.png +0 -0
  91. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_2e83ff_256x240.png +0 -0
  92. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_454545_256x240.png +0 -0
  93. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_888888_256x240.png +0 -0
  94. data/repository/jquery/ui/assets/1.8.7/images/jqueryui/ui-icons_cd0a0a_256x240.png +0 -0
  95. data/repository/jquery/ui/latest.js +0 -1
  96. data/repository/json2.js +0 -482
  97. data/repository/modernizr/1.5.js +0 -28
  98. data/repository/modernizr/latest.js +0 -1
  99. data/repository/ninjs/core/.core.pdoc.yaml +0 -0
  100. data/repository/ninjs/core/.existence.pdoc.yaml +0 -12
  101. data/repository/ninjs/core/.extend.pdoc.yaml +0 -0
  102. data/repository/ninjs/core/.nin.pdoc.yaml +0 -0
  103. data/repository/ninjs/core/application.js +0 -47
  104. data/repository/ninjs/core/existence.js +0 -277
  105. data/repository/ninjs/core/extend.js +0 -77
  106. data/repository/ninjs/core/module.js +0 -135
  107. data/repository/ninjs/core/nin.js +0 -4
  108. data/repository/ninjs/docs/Data/ClassHierarchy.nd +0 -0
  109. data/repository/ninjs/docs/Data/ConfigFileInfo.nd +0 -0
  110. data/repository/ninjs/docs/Data/FileInfo.nd +0 -16
  111. data/repository/ninjs/docs/Data/ImageFileInfo.nd +0 -0
  112. data/repository/ninjs/docs/Data/ImageReferenceTable.nd +0 -0
  113. data/repository/ninjs/docs/Data/IndexInfo.nd +0 -0
  114. data/repository/ninjs/docs/Data/PreviousMenuState.nd +0 -0
  115. data/repository/ninjs/docs/Data/PreviousSettings.nd +0 -0
  116. data/repository/ninjs/docs/Data/SymbolTable.nd +0 -0
  117. data/repository/ninjs/docs/Languages.txt +0 -113
  118. data/repository/ninjs/docs/Menu.txt +0 -63
  119. data/repository/ninjs/docs/Topics.txt +0 -81
  120. data/repository/ninjs/docs/files/core/application-js.html +0 -44
  121. data/repository/ninjs/docs/files/core/existence-js.html +0 -60
  122. data/repository/ninjs/docs/files/core/extend-js.html +0 -55
  123. data/repository/ninjs/docs/files/core/module-js.html +0 -80
  124. data/repository/ninjs/docs/files/core/nin-js.html +0 -38
  125. data/repository/ninjs/docs/index.html +0 -1
  126. data/repository/ninjs/docs/index/Classes.html +0 -33
  127. data/repository/ninjs/docs/index/Files.html +0 -45
  128. data/repository/ninjs/docs/index/Functions.html +0 -65
  129. data/repository/ninjs/docs/index/General.html +0 -85
  130. data/repository/ninjs/docs/index/Variables.html +0 -45
  131. data/repository/ninjs/docs/javascript/main.js +0 -841
  132. data/repository/ninjs/docs/javascript/prettify.js +0 -1526
  133. data/repository/ninjs/docs/javascript/searchdata.js +0 -152
  134. data/repository/ninjs/docs/search/ClassesN.html +0 -20
  135. data/repository/ninjs/docs/search/FilesA.html +0 -20
  136. data/repository/ninjs/docs/search/FilesE.html +0 -20
  137. data/repository/ninjs/docs/search/FilesM.html +0 -20
  138. data/repository/ninjs/docs/search/FilesN.html +0 -20
  139. data/repository/ninjs/docs/search/FunctionsA.html +0 -20
  140. data/repository/ninjs/docs/search/FunctionsC.html +0 -20
  141. data/repository/ninjs/docs/search/FunctionsE.html +0 -20
  142. data/repository/ninjs/docs/search/FunctionsI.html +0 -20
  143. data/repository/ninjs/docs/search/FunctionsM.html +0 -20
  144. data/repository/ninjs/docs/search/FunctionsR.html +0 -20
  145. data/repository/ninjs/docs/search/FunctionsS.html +0 -20
  146. data/repository/ninjs/docs/search/FunctionsSymbols.html +0 -20
  147. data/repository/ninjs/docs/search/FunctionsU.html +0 -20
  148. data/repository/ninjs/docs/search/GeneralA.html +0 -20
  149. data/repository/ninjs/docs/search/GeneralC.html +0 -20
  150. data/repository/ninjs/docs/search/GeneralD.html +0 -20
  151. data/repository/ninjs/docs/search/GeneralE.html +0 -20
  152. data/repository/ninjs/docs/search/GeneralF.html +0 -20
  153. data/repository/ninjs/docs/search/GeneralI.html +0 -20
  154. data/repository/ninjs/docs/search/GeneralM.html +0 -20
  155. data/repository/ninjs/docs/search/GeneralN.html +0 -20
  156. data/repository/ninjs/docs/search/GeneralR.html +0 -20
  157. data/repository/ninjs/docs/search/GeneralS.html +0 -20
  158. data/repository/ninjs/docs/search/GeneralSymbols.html +0 -20
  159. data/repository/ninjs/docs/search/GeneralT.html +0 -20
  160. data/repository/ninjs/docs/search/GeneralU.html +0 -20
  161. data/repository/ninjs/docs/search/GeneralV.html +0 -20
  162. data/repository/ninjs/docs/search/NoResults.html +0 -15
  163. data/repository/ninjs/docs/search/VariablesD.html +0 -20
  164. data/repository/ninjs/docs/search/VariablesN.html +0 -20
  165. data/repository/ninjs/docs/search/VariablesR.html +0 -20
  166. data/repository/ninjs/docs/search/VariablesT.html +0 -20
  167. data/repository/ninjs/docs/styles/main.css +0 -828
  168. data/repository/ninjs/extensions/jquery.elements.js +0 -60
  169. data/repository/ninjs/tests/index.html +0 -21
  170. data/repository/ninjs/tests/ninjs.test.js +0 -188
  171. data/repository/ninjs/tests/ninjs.utilities.test.js +0 -137
  172. data/repository/ninjs/tests/qunit/qunit.css +0 -197
  173. data/repository/ninjs/tests/qunit/qunit.js +0 -1415
  174. data/repository/ninjs/utilities/all.js +0 -5
  175. data/repository/ninjs/utilities/array.js +0 -29
  176. data/repository/ninjs/utilities/cookie.js +0 -0
  177. data/repository/ninjs/utilities/css.js +0 -51
  178. data/repository/ninjs/utilities/number.js +0 -11
  179. data/repository/ninjs/utilities/string.js +0 -61
  180. data/repository/nullconsole.js +0 -7
  181. data/repository/qunit/assets/css/qunit.css +0 -196
  182. data/repository/qunit/qunit.js +0 -1374
  183. data/repository/selectivizr/1.0.js +0 -5
  184. data/repository/selectivizr/latest.js +0 -1
  185. data/repository/syntaxhighlighter/all.js +0 -11
  186. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCore.css +0 -226
  187. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDefault.css +0 -328
  188. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreDjango.css +0 -331
  189. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEclipse.css +0 -339
  190. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreEmacs.css +0 -324
  191. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreFadeToGrey.css +0 -328
  192. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMDUltra.css +0 -324
  193. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreMidnight.css +0 -324
  194. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shCoreRDark.css +0 -324
  195. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDefault.css +0 -117
  196. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeDjango.css +0 -120
  197. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEclipse.css +0 -128
  198. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeEmacs.css +0 -113
  199. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeFadeToGrey.css +0 -117
  200. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMDUltra.css +0 -113
  201. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeMidnight.css +0 -113
  202. data/repository/syntaxhighlighter/assets/css/syntaxhighlighter/shThemeRDark.css +0 -113
  203. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCore.scss +0 -216
  204. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDefault.scss +0 -2
  205. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreDjango.scss +0 -2
  206. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEclipse.scss +0 -2
  207. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreEmacs.scss +0 -2
  208. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreFadeToGrey.scss +0 -2
  209. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMDUltra.scss +0 -2
  210. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreMidnight.scss +0 -2
  211. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shCoreRDark.scss +0 -2
  212. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDefault.scss +0 -7
  213. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeDjango.scss +0 -36
  214. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEclipse.scss +0 -48
  215. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeEmacs.scss +0 -32
  216. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeFadeToGrey.scss +0 -36
  217. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMDUltra.scss +0 -32
  218. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeMidnight.scss +0 -32
  219. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_shThemeRDark.scss +0 -32
  220. data/repository/syntaxhighlighter/assets/scss/syntaxhighlighter/_theme_template.scss +0 -120
  221. data/repository/syntaxhighlighter/shAutoloader.js +0 -17
  222. data/repository/syntaxhighlighter/shBrushAS3.js +0 -59
  223. data/repository/syntaxhighlighter/shBrushAppleScript.js +0 -75
  224. data/repository/syntaxhighlighter/shBrushBash.js +0 -59
  225. data/repository/syntaxhighlighter/shBrushCSharp.js +0 -65
  226. data/repository/syntaxhighlighter/shBrushColdFusion.js +0 -100
  227. data/repository/syntaxhighlighter/shBrushCpp.js +0 -97
  228. data/repository/syntaxhighlighter/shBrushCss.js +0 -91
  229. data/repository/syntaxhighlighter/shBrushDelphi.js +0 -55
  230. data/repository/syntaxhighlighter/shBrushDiff.js +0 -41
  231. data/repository/syntaxhighlighter/shBrushErlang.js +0 -52
  232. data/repository/syntaxhighlighter/shBrushGroovy.js +0 -67
  233. data/repository/syntaxhighlighter/shBrushJScript.js +0 -52
  234. data/repository/syntaxhighlighter/shBrushJava.js +0 -57
  235. data/repository/syntaxhighlighter/shBrushJavaFX.js +0 -58
  236. data/repository/syntaxhighlighter/shBrushPerl.js +0 -72
  237. data/repository/syntaxhighlighter/shBrushPhp.js +0 -88
  238. data/repository/syntaxhighlighter/shBrushPlain.js +0 -33
  239. data/repository/syntaxhighlighter/shBrushPowerShell.js +0 -74
  240. data/repository/syntaxhighlighter/shBrushPython.js +0 -64
  241. data/repository/syntaxhighlighter/shBrushRuby.js +0 -55
  242. data/repository/syntaxhighlighter/shBrushSass.js +0 -94
  243. data/repository/syntaxhighlighter/shBrushScala.js +0 -51
  244. data/repository/syntaxhighlighter/shBrushSql.js +0 -66
  245. data/repository/syntaxhighlighter/shBrushVb.js +0 -56
  246. data/repository/syntaxhighlighter/shBrushXml.js +0 -69
  247. data/repository/syntaxhighlighter/shCore.js +0 -17
  248. data/repository/syntaxhighlighter/shLegacy.js +0 -17
  249. data/spec/fixtures/global.js +0 -7
  250. data/spec/fixtures/global.module.js +0 -7
  251. data/spec/fixtures/myapplication.js +0 -576
  252. data/spec/fixtures/nin.js +0 -573
  253. data/spec/fixtures/ninjs.conf +0 -6
  254. data/spec/fixtures/test.elements.js +0 -4
  255. data/spec/fixtures/test.js +0 -15
  256. data/spec/fixtures/test.model.js +0 -3
  257. data/spec/fixtures/test.module.js +0 -10
  258. data/spec/fixtures/updated.myapplication.js +0 -27
  259. data/spec/fixtures/utilities.js +0 -162
  260. data/spec/helpers_spec.rb +0 -11
  261. data/spec/integration_spec.rb +0 -257
  262. data/spec/manifest_spec.rb +0 -8
  263. data/spec/ninjs_spec.rb +0 -36
  264. data/spec/notification_spec.rb +0 -27
  265. data/spec/spec_helper.rb +0 -5
  266. data/tmp/ff9e83aa019b712b90200b8d1b8fa0c7e14576af.json +0 -1
  267. data/tmp/metric_fu/_data/20110305.yml +0 -1548
  268. data/tmp/metric_fu/output/bluff-min.js +0 -1
  269. data/tmp/metric_fu/output/excanvas.js +0 -35
  270. data/tmp/metric_fu/output/js-class.js +0 -1
  271. data/tmp/metric_fu/output/lib_ninjs_dependencies.rb.html +0 -34
  272. data/tmp/metric_fu/output/lib_ninjs_helpers.rb.html +0 -34
  273. data/tmp/metric_fu/output/lib_ninjs_manifest.rb.html +0 -27
  274. data/tmp/metric_fu/output/rails_best_practices.js +0 -11
  275. data/tmp/metric_fu/scratch/rcov/rcov.txt +0 -1
@@ -1,60 +0,0 @@
1
- (function($) {
2
- NinjsModule.prototype.elements = function(elements, force) {
3
- var self = this;
4
-
5
- unless(is_defined(force), function() {
6
- force = false;
7
- });
8
-
9
- if (is_string(elements)) {
10
- var key = elements;
11
- if (is_undefined(self.dom[key])) {
12
- throw new SyntaxError("NinjsModule.elements('" + key + "'): " + self.name + ".dom." + key + " is undefined");
13
- }
14
-
15
- if (is_string(self.dom[key])) {
16
- var selection = $(self.dom[key]);
17
-
18
- unless(selection.length === 0, function() {
19
- return self.dom[key] = selection;
20
- }, function() {
21
- return self.dom[key];
22
- });
23
- }
24
- else {
25
- if (self.dom[key].length === 0 || force) {
26
-
27
- var return_obj = undefined;
28
-
29
- if (is_string(force)) {
30
- var selector = self.dom[key].selector;
31
- self.dom[key] = $(force).find(selector);
32
- self.dom[key].selector = selector;
33
-
34
- return_obj = self.dom[key];
35
- }
36
-
37
- var selection = $(self.dom[key].selector);
38
-
39
- unless(selection.length === 0, function() {
40
- return_obj = selection;
41
- });
42
-
43
- return return_obj;
44
- }
45
- else {
46
- return self.dom[key];
47
- }
48
- }
49
- }
50
- else if (is_typeof(Object, elements)) {
51
- self.call_on_ready(function() {
52
- for(var key in elements) {
53
- if (elements.hasOwnProperty(key)) {
54
- self.dom[key] = elements[key];
55
- }
56
- }
57
- });
58
- }
59
- };
60
- })(jQuery);
@@ -1,21 +0,0 @@
1
- <!DOCTYPE html>
2
- <head>
3
- <title>All Ninjs tests</title>
4
-
5
- <link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen"/>
6
-
7
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
8
- <script src="qunit/qunit.js"></script>
9
-
10
- <script src="../lib/nin.js"></script>
11
- <script src="../lib/utilities.js"></script>
12
-
13
- <script src="ninjs.test.js"></script>
14
- <script src="ninjs.utilities.test.js"></script>
15
- </head>
16
- <body>
17
- <h1 id="qunit-header">Ninjs tests</h1>
18
- <h2 id="qunit-banner"></h2>
19
- <h2 id="qunit-userAgent"></h2>
20
- <ol id="qunit-tests"></ol>
21
- </body>
@@ -1,188 +0,0 @@
1
- module("existence tests");
2
-
3
- test("existence sanity check", function() {
4
- ok(is_defined !== undefined, 'is_defined is defined');
5
- ok(is_undefined !== undefined, 'is_undefined is defined');
6
- ok(is_typeof !== undefined, 'is_typeof is defined');
7
- });
8
-
9
- test("can test for existence", function() {
10
- var nonexistent;
11
- var existent = 'I think';
12
- equals(is_defined(existent), true, 'existent variable is_defined');
13
- equals(is_defined(nonexistent), false, 'non-existent variable does not exist');
14
- });
15
-
16
- test("can test for non-existence", function() {
17
- var existent = 'I think';
18
- var nonexistent;
19
- equals(is_undefined(nonexistent), true, 'non-existent variable does not exist');
20
- equals(is_undefined(existent), false, 'existent variable does exist');
21
- });
22
-
23
- test("can check the type strictly with is_typeof", function() {
24
- var foo = function(){};
25
- var bar = {
26
- name: 'SomeObject',
27
- method: function() {}
28
- };
29
- var SomeClass = function(){};
30
- var some_instance = new SomeClass();
31
- equals(is_typeof(Number, 4), true, 'can check against Number');
32
- equals(is_typeof(String, 'Hello World'), true, 'can check against String');
33
- equals(is_typeof(Array, ['one', 'two', 'three']), true, 'can check against Array');
34
- equals(is_typeof(Function, foo), true, 'can check against Function');
35
- equals(is_typeof(Object, bar), true, 'can check against Object');
36
- equals(is_typeof(RegExp, /pattern/), true, 'can check against Regexp');
37
- equals(is_typeof(SomeClass, some_instance), true, 'can check against custom object');
38
- });
39
-
40
- module("typeof proxys");
41
-
42
- test("can check for default types", function() {
43
- var today = new Date();
44
- var easy_as = [1,2,3];
45
- var pattern = new RegExp(/pattern/);
46
-
47
- ok(is_string('hello'), 'hello is_string');
48
- ok(is_number(42), '42 is_number');
49
- ok(is_array(easy_as), 'easy_as is_array');
50
- ok(is_bool(false), 'false is_bool');
51
- ok(is_date(today), 'today is_date');
52
- ok(is_regex(pattern), 'pattern is_regex');
53
-
54
- equals(is_regex('hello'), false, 'hello fails is_regex');
55
- equals(is_date(42), false, '42 fails is_date');
56
- equals(is_bool(easy_as), false, 'easy_as fails is_bool');
57
- equals(is_array(today), false, 'today fails is_array');
58
- equals(is_number(true), false, 'true fails is_number');
59
- equals(is_string(pattern), false, 'pattern fails is_string');
60
- });
61
-
62
- test("can determine a number", function() {
63
- ok(is_numeric(2), '2 is a number');
64
- ok(is_numeric(-2), '-2 is a number');
65
- ok(is_numeric(45.6), '45.6 is a number');
66
- ok(is_numeric(-45.6), '-45.6 is a number');
67
- equals(is_numeric('45.6'), true, "'45.6 is a number'");
68
- equals(is_numeric('Hello'), false, 'Hello is not a number');
69
- });
70
-
71
- module("extend tests");
72
-
73
- test("can add a method to the prototype", function() {
74
- ok(is_defined(Function.prototype.method), "Object.prototype.method is defined");
75
-
76
- String.method('test_method', function() {
77
- return 'This is a test';
78
- });
79
-
80
- equals('Hello'.test_method(), 'This is a test', 'can create a prototype method with method');
81
- });
82
-
83
- test("can test a condition with unless", function() {
84
- var is_true = false;
85
-
86
- unless (false,
87
- function() {
88
- is_true = true;
89
- }
90
- );
91
-
92
- ok(is_true, "unless works");
93
-
94
- var does_fallback_work = false;
95
-
96
- unless (true,
97
- function() {
98
-
99
- },
100
- function() {
101
- does_fallback_work = true;
102
- }
103
- );
104
-
105
- ok(does_fallback_work, 'fallback works');
106
- });
107
-
108
- module("Ninjs application tests");
109
-
110
- test("can create a ninjs application object", function() {
111
- var testapp = new NinjsApplication();
112
- ok(is_defined(testapp), 'testapp is defined');
113
- ok(is_typeof(NinjsApplication, testapp), 'testapp is a valid NinjsApplication');
114
- });
115
-
116
- test("can create a NinjsModule", function() {
117
- var testapp = new NinjsApplication();
118
- testapp.add_module('testmodule');
119
- ok(is_defined(testapp.testmodule), 'testapp.testmodule is defined');
120
- ok(is_typeof(NinjsModule, testapp.testmodule), 'testapp.testmodule is a valid NinjsModule');
121
- });
122
-
123
- module('Ninjs Module tests');
124
-
125
- test("module defaults", function() {
126
- var testapp = new NinjsApplication();
127
- testapp.add_module('testmodule');
128
-
129
- // properties
130
- ok(is_defined(testapp.testmodule.run_tests), 'testapp.testmodule.run_tests is defined');
131
- equals(testapp.testmodule.run_tests, false, 'testapp.testmodule.run_tests defaults to false');
132
- ok(is_defined(testapp.testmodule.data), "testapp.testmodule.data is defined");
133
- ok(is_defined(testapp.testmodule.name), 'testapp.testmodule.name is defined');
134
- equals(testapp.testmodule.name, 'testmodule', 'testapp.testmodule.name is correct');
135
- ok(is_defined(testapp.testmodule.tests), 'testapp.testmodule.tests is defined');
136
- ok(is_array(testapp.testmodule.tests), 'testapp.testmodule.tests is_array');
137
- ok(testapp.testmodule.tests.is_empty(), 'testapp.testmodule.tests is empty');
138
- ok(is_defined(app), 'app is defined');
139
-
140
- // methods
141
- ok(is_defined(testapp.testmodule.actions), 'testapp.testmodule.actions is defined');
142
- ok(is_typeof(Function, testapp.testmodule.actions), "testapp.testmodule.actions is a valid Function");
143
- ok(is_defined(testapp.testmodule.run), 'testapp.testmodule.run is defined');
144
- ok(is_typeof(Function, testapp.testmodule.run), "testapp.testmodule.run is a valid Function");
145
- ok(is_defined(testapp.testmodule.call_on_ready), 'testmodule.testapp.call_on_ready is defined');
146
- ok(is_defined(testapp.testmodule.execute), 'testmodule.testapp.execute is defined');
147
- ok(is_defined(testapp.testmodule.elements), 'testapp.testmodule.elements is defined');
148
- ok(is_defined(testapp.testmodule.set_data), 'testapp.testmodule.set_data is defined');
149
- });
150
-
151
- test("add_module returns the created module", function() {
152
- var testapp = new NinjsApplication();
153
- var module = testapp.add_module('some_module');
154
- equals(module, testapp.some_module, 'hey');
155
- });
156
-
157
- // Qunit waits for DOM to load before running tests
158
- // to test DOM wait feature, we need to run some code outside the tests
159
- (function() {
160
- var testapp = new NinjsApplication();
161
- testapp.add_module('testmodule');
162
- testapp.testmodule.actions = function() {
163
- // append an element to be sure the DOM is ready for manipulation and test for the element's existence
164
- $('body').append('<div id="made-by-actions"/>');
165
-
166
- test("Ninjs module can run actions", function() {
167
- equals($('#made-by-actions').length, 1,'testapp.test.actions ran after DOM was ready');
168
- });
169
- };
170
-
171
- testapp.testmodule.run();
172
- }());
173
-
174
- // Qunit waits for DOM to load before running tests
175
- // to test DOM wait feature, we need to run some code outside the tests
176
- (function() {
177
- var testapp = new NinjsApplication();
178
- testapp.add_module('testmodule');
179
- testapp.testmodule.elements(function() {
180
- testapp.testmodule.qunit_header = $('#qunit-header');
181
- testapp.testmodule.qunit_banner = $('#qunit-banner');
182
-
183
- test('Ninjs module can cache elements', function() {
184
- equals(testapp.testmodule.qunit_header[0].tagName, 'H1', '#qunit-header returns an h1');
185
- equals(testapp.testmodule.qunit_banner[0].tagName, 'H2', '#qunit-banner returns an h2');
186
- });
187
- });
188
- }());
@@ -1,137 +0,0 @@
1
- module("array utility tests");
2
-
3
- test("can test for emptiness", function() {
4
- expect(4);
5
-
6
- ok([].is_empty(), "[].is_empty() is true");
7
- equals(['one', 'two', 'three'].is_empty(), false, "['one', 'two', 'three'].is_empty()");
8
- ok(['one', 'two', 'three'].not_empty(), "['one', 'two', 'three'].not_empty() is false");
9
- equals([].not_empty(), false, "[].not_empty() is false");
10
- });
11
-
12
- test("can iterate over each element", function() {
13
- expect(7);
14
-
15
- var iteration_count = 0;
16
- var test_array_values = [];
17
- var test_array_indices = [];
18
-
19
- ['one', 'two', 'three'].each(function(value, index) {
20
- iteration_count++;
21
- test_array_values.push(value);
22
- test_array_indices.push(index);
23
- });
24
-
25
- equals(test_array_values[0], 'one', 'value at index 0 is correct');
26
- equals(test_array_values[1], 'two', 'value at index 1 is correct');
27
- equals(test_array_values[2], 'three', 'value at index 2 is correct');
28
-
29
- equals(test_array_indices[0], 0, 'first index is correct');
30
- equals(test_array_indices[1], 1, 'second index is correct');
31
- equals(test_array_indices[2], 2, 'third index is correct');
32
-
33
- equals(iteration_count, 3, 'made only three iterations');
34
- });
35
-
36
- test("can test if an array contains an element", function() {
37
- var array = ['one', 'two', 'three'];
38
- var string = 'hello';
39
- var object = {
40
- name: 'some object'
41
- };
42
- var number = 45;
43
- var date = new Date();
44
-
45
- var test_array = [array, string, object, number, date];
46
-
47
- ok(test_array.contains(array), 'array.contains(array)');
48
- ok(test_array.contains(string), 'array.contains(string)');
49
- ok(test_array.contains(object), 'array.contains(object)');
50
- ok(test_array.contains(number), 'array.contains(number)');
51
- ok(test_array.contains(date), 'array.contains(date)');
52
- equals(test_array.contains('not in there'), false, 'non-existent value is false');
53
- });
54
-
55
- module("string utility tests");
56
-
57
- test("can test for emptiness", function() {
58
- ok(''.is_empty(), "''.is_empty() is true");
59
- equals('hey there'.is_empty(), false, "'hey there'.is_empty() is false");
60
- ok('hey there'.not_empty(), "'hey there'.not_empty() is false");
61
- equals(''.not_empty(), false, "''.not_empty() is false");
62
- });
63
-
64
- test('can test for number', function() {
65
- equals('34'.is_numeric(), true, "34 is numeric");
66
- equals('0.5'.is_numeric(), true, ".5 is numeric");
67
- equals('-34'.is_numeric(), true, '-34 is numeric');
68
- equals('-0.5'.is_numeric(), true, '-.05 is numeric');
69
- equals('hello'.is_numeric(), false, 'hello is numeric');
70
- });
71
-
72
- test('can trim a string', function() {
73
- equals(' hello '.trim(), 'hello', "' hello '.trim()");
74
- equals(' hello '.ltrim(), 'hello ', "' hello '.ltrim()");
75
- equals(' hello '.rtrim(), ' hello', "' hello '.rtrim()");
76
- });
77
-
78
- test("can iterate over each character", function() {
79
- var iteration_count = 0;
80
- var test_chars = [];
81
- var test_indices = [];
82
- '123'.each(function(character, index) {
83
- test_chars.push(character);
84
- test_indices.push(index);
85
- iteration_count++;
86
- });
87
-
88
- equals(test_chars[0], '1', 'first character of 123 is 1');
89
- equals(test_chars[1], '2', 'second character of 123 is 2');
90
- equals(test_chars[2], '3', 'second character of 123 is 3');
91
-
92
- equals(test_indices[0], 0, 'first index is correct');
93
- equals(test_indices[1], 1, 'second index is correct');
94
- equals(test_indices[2], 2, 'third index is correct');
95
-
96
- equals(iteration_count, 3, 'made only three iterations');
97
- });
98
-
99
- test('can capitalize a string', function() {
100
- equals('hello world'.capitalize(), 'Hello world', 'capitalized string correctly');
101
- });
102
-
103
- test('can reverse a string', function() {
104
- equals('hello world'.reverse(), 'dlrow olleh', 'reversed string correctly');
105
- equals('satan oscillate my metallic sonatas'.reverse(), 'satanos cillatem ym etallicso natas', 'fucking palindromes, how do they work?');
106
- });
107
-
108
- test("can convert to number", function() {
109
- var whole_number = '32';
110
- var decimal = '0.08';
111
- var negative_number = '-32';
112
- var negative_float = '-0.08';
113
-
114
- same(whole_number.to_n(), 32, "whole_number.to_n() is 32");
115
- same(decimal.to_n(), 0.08, "decimal.to_n() is 0.08");
116
- same(negative_number.to_n(), -32, "negative_number.to_n() is -32");
117
- same(negative_float.to_n(), -0.08, "negative_float.to_n() -0.08");
118
- });
119
-
120
- test("can pluck a string", function() {
121
- equals('one, two, three'.pluck(','), 'one two three', "'one, two, three'.pluck(',')");
122
- });
123
-
124
- test("can single space a string", function() {
125
- var hard_space = 'one&nbsp;two&nbsp;&nbsp;three&nbsp;&nbsp;&nbsp;four&nbsp;&nbsp;&nbsp;&nbsp;five&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;six';
126
- var soft_space = 'one two three four five six';
127
- var mixed_space = 'one two &nbsp; three &nbsp;&nbsp;four &nbsp;&nbsp;&nbsp;five &nbsp;&nbsp;&nbsp;&nbsp;six';
128
-
129
- equals(hard_space.single_space(), 'one two three four five six', 'correctly spaced &nbsp;');
130
- equals(soft_space.single_space(), 'one two three four five six', "correctly spaced soft spaces");
131
- equals(mixed_space.single_space(), 'one two three four five six', "correctly spaced mixed spaces");
132
- });
133
-
134
- test("can compress a string", function() {
135
- var string = "satan\n\t oscillate\n\t my\n\t metallic\n sonatas";
136
- same(string.compress(), 'satanoscillatemymetallicsonatas', "string is compressed correctly");
137
- });
@@ -1,197 +0,0 @@
1
- /** Font Family and Sizes */
2
-
3
- #qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
4
- font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial;
5
- }
6
-
7
- #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
8
- #qunit-tests { font-size: smaller; }
9
-
10
-
11
- /** Resets */
12
-
13
- #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
14
- margin: 0;
15
- padding: 0;
16
- }
17
-
18
-
19
- /** Header */
20
-
21
- #qunit-header {
22
- padding: 0.5em 0 0.5em 1em;
23
-
24
- color: #8699a4;
25
- background-color: #0d3349;
26
-
27
- font-size: 1.5em;
28
- line-height: 1em;
29
- font-weight: normal;
30
-
31
- border-radius: 15px 15px 0 0;
32
- -moz-border-radius: 15px 15px 0 0;
33
- -webkit-border-top-right-radius: 15px;
34
- -webkit-border-top-left-radius: 15px;
35
- }
36
-
37
- #qunit-header a {
38
- text-decoration: none;
39
- color: #c2ccd1;
40
- }
41
-
42
- #qunit-header a:hover,
43
- #qunit-header a:focus {
44
- color: #fff;
45
- }
46
-
47
- #qunit-banner {
48
- height: 5px;
49
- }
50
-
51
- #qunit-testrunner-toolbar {
52
- padding: 0.5em 0 0.5em 2em;
53
- color: #5E740B;
54
- background-color: #eee;
55
- }
56
-
57
- #qunit-userAgent {
58
- padding: 0.5em 0 0.5em 2.5em;
59
- background-color: #2b81af;
60
- color: #fff;
61
- text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
62
- }
63
-
64
-
65
- /** Tests: Pass/Fail */
66
-
67
- #qunit-tests {
68
- list-style-position: inside;
69
- }
70
-
71
- #qunit-tests li {
72
- padding: 0.4em 0.5em 0.4em 2.5em;
73
- border-bottom: 1px solid #fff;
74
- list-style-position: inside;
75
- }
76
-
77
- #qunit-tests li strong {
78
- cursor: pointer;
79
- }
80
-
81
- #qunit-tests ol {
82
- margin-top: 0.5em;
83
- padding: 0.5em;
84
-
85
- background-color: #fff;
86
-
87
- border-radius: 15px;
88
- -moz-border-radius: 15px;
89
- -webkit-border-radius: 15px;
90
-
91
- box-shadow: inset 0px 2px 13px #999;
92
- -moz-box-shadow: inset 0px 2px 13px #999;
93
- -webkit-box-shadow: inset 0px 2px 13px #999;
94
- }
95
-
96
- #qunit-tests table {
97
- border-collapse: collapse;
98
- margin-top: .2em;
99
- }
100
-
101
- #qunit-tests th {
102
- text-align: right;
103
- vertical-align: top;
104
- padding: 0 .5em 0 0;
105
- }
106
-
107
- #qunit-tests td {
108
- vertical-align: top;
109
- }
110
-
111
- #qunit-tests pre {
112
- margin: 0;
113
- white-space: pre-wrap;
114
- word-wrap: break-word;
115
- }
116
-
117
- #qunit-tests del {
118
- background-color: #e0f2be;
119
- color: #374e0c;
120
- text-decoration: none;
121
- }
122
-
123
- #qunit-tests ins {
124
- background-color: #ffcaca;
125
- color: #500;
126
- text-decoration: none;
127
- }
128
-
129
- /*** Test Counts */
130
-
131
- #qunit-tests b.counts { color: black; }
132
- #qunit-tests b.passed { color: #5E740B; }
133
- #qunit-tests b.failed { color: #710909; }
134
-
135
- #qunit-tests li li {
136
- margin: 0.5em;
137
- padding: 0.4em 0.5em 0.4em 0.5em;
138
- background-color: #fff;
139
- border-bottom: none;
140
- list-style-position: inside;
141
- }
142
-
143
- /*** Passing Styles */
144
-
145
- #qunit-tests li li.pass {
146
- color: #5E740B;
147
- background-color: #fff;
148
- border-left: 26px solid #C6E746;
149
- }
150
-
151
- #qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
152
- #qunit-tests .pass .test-name { color: #366097; }
153
-
154
- #qunit-tests .pass .test-actual,
155
- #qunit-tests .pass .test-expected { color: #999999; }
156
-
157
- #qunit-banner.qunit-pass { background-color: #C6E746; }
158
-
159
- /*** Failing Styles */
160
-
161
- #qunit-tests li li.fail {
162
- color: #710909;
163
- background-color: #fff;
164
- border-left: 26px solid #EE5757;
165
- }
166
-
167
- #qunit-tests .fail { color: #000000; background-color: #EE5757; }
168
- #qunit-tests .fail .test-name,
169
- #qunit-tests .fail .module-name { color: #000000; }
170
-
171
- #qunit-tests .fail .test-actual { color: #EE5757; }
172
- #qunit-tests .fail .test-expected { color: green; }
173
-
174
- #qunit-banner.qunit-fail { background-color: #EE5757; }
175
-
176
-
177
- /** Footer */
178
-
179
- #qunit-testresult {
180
- padding: 0.5em 0.5em 0.5em 2.5em;
181
-
182
- color: #2b81af;
183
- background-color: #D2E0E6;
184
-
185
- border-radius: 0 0 15px 15px;
186
- -moz-border-radius: 0 0 15px 15px;
187
- -webkit-border-bottom-right-radius: 15px;
188
- -webkit-border-bottom-left-radius: 15px;
189
- }
190
-
191
- /** Fixture */
192
-
193
- #qunit-fixture {
194
- position: absolute;
195
- top: -10000px;
196
- left: -10000px;
197
- }