ende 0.2.3 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. checksums.yaml +4 -4
  2. data/component.json +2 -1
  3. data/lib/assets/javascripts/aura/extensions/devise.js.coffee +3 -2
  4. data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +1 -2
  5. data/lib/assets/javascripts/aura/extensions/widget/lifecycleable.js.coffee +37 -16
  6. data/lib/assets/javascripts/ende.js.coffee +1 -1
  7. data/lib/assets/javascripts/widgets/dialog/main.js.coffee +100 -0
  8. data/lib/assets/javascripts/widgets/dialog/presenter.js.coffee +18 -0
  9. data/lib/assets/javascripts/widgets/dialog/states/default.html +2 -0
  10. data/lib/assets/javascripts/widgets/dialog/states/index.js.coffee +2 -0
  11. data/lib/assets/javascripts/widgets/list/main.js.coffee +1 -0
  12. data/lib/assets/stylesheets/ende.styl +1 -0
  13. data/lib/ende/version.rb +1 -1
  14. data/lib/ende.rb +6 -2
  15. data/vendor/assets/components/build.css +111 -0
  16. data/vendor/{components/indefinido-indemma/build/release.js → assets/components/build.js} +25468 -17590
  17. data/vendor/assets/components/ende_build.css +111 -0
  18. data/vendor/assets/components/ende_build.js +29571 -0
  19. data/vendor/assets/javascripts/ende/build.js +1962 -0
  20. data/vendor/components/component-classes/component.json +19 -0
  21. data/vendor/components/component-classes/index.js +165 -0
  22. data/vendor/components/component-css/component.json +18 -0
  23. data/vendor/components/component-css/index.js +34 -0
  24. data/vendor/components/component-delegate/component.json +2 -2
  25. data/vendor/components/component-delegate/index.js +4 -4
  26. data/vendor/components/component-dialog/component.json +23 -0
  27. data/vendor/components/component-dialog/dialog.css +92 -0
  28. data/vendor/components/component-dialog/index.js +292 -0
  29. data/vendor/components/component-dialog/template.js +1 -0
  30. data/vendor/components/component-dom/component.json +33 -0
  31. data/vendor/components/component-dom/index.js +725 -0
  32. data/vendor/components/component-domify/component.json +22 -0
  33. data/vendor/components/component-domify/index.js +71 -0
  34. data/vendor/components/component-emitter/component.json +13 -0
  35. data/vendor/components/component-emitter/index.js +156 -0
  36. data/vendor/components/component-event/index.js +8 -11
  37. data/vendor/components/component-indexof/component.json +15 -0
  38. data/vendor/components/component-indexof/index.js +10 -0
  39. data/vendor/components/component-overlay/component.json +22 -0
  40. data/vendor/components/component-overlay/index.js +111 -0
  41. data/vendor/components/component-overlay/overlay.css +19 -0
  42. data/vendor/components/component-overlay/template.js +1 -0
  43. data/vendor/components/component-query/component.json +2 -1
  44. data/vendor/components/component-sort/component.json +20 -0
  45. data/vendor/components/component-sort/index.js +43 -0
  46. data/vendor/components/component-value/component.json +25 -0
  47. data/vendor/components/component-value/index.js +95 -0
  48. data/vendor/components/indefinido-indemma/component.json +2 -3
  49. data/vendor/components/indefinido-indemma/lib/record/resource.js +2 -4
  50. data/vendor/components/mikeric-rivets/component.json +1 -1
  51. data/vendor/components/mikeric-rivets/dist/rivets.js +64 -44
  52. data/vendor/components/paulmillr-es6-shim/component.json +1 -1
  53. data/vendor/components/paulmillr-es6-shim/es6-shim.js +22 -11
  54. data/vendor/components/pluma-assimilate/component.json +1 -1
  55. data/vendor/components/pluma-assimilate/dist/assimilate.js +103 -63
  56. metadata +35 -246
  57. data/lib/tasks/component.thor +0 -63
  58. data/vendor/assets/components/KapIT-observe-utils/component.json +0 -16
  59. data/vendor/assets/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
  60. data/vendor/assets/components/chaijs-assertion-error/component.json +0 -18
  61. data/vendor/assets/components/chaijs-assertion-error/index.js +0 -110
  62. data/vendor/assets/components/chaijs-chai/component.json +0 -47
  63. data/vendor/assets/components/chaijs-chai/index.js +0 -1
  64. data/vendor/assets/components/chaijs-chai/lib/chai/assertion.js +0 -130
  65. data/vendor/assets/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  66. data/vendor/assets/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  67. data/vendor/assets/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  68. data/vendor/assets/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  69. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  70. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  71. data/vendor/assets/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  72. data/vendor/assets/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  73. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  74. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  75. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  76. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  77. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  78. data/vendor/assets/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  79. data/vendor/assets/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  80. data/vendor/assets/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  81. data/vendor/assets/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  82. data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  83. data/vendor/assets/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  84. data/vendor/assets/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  85. data/vendor/assets/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  86. data/vendor/assets/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  87. data/vendor/assets/components/chaijs-chai/lib/chai.js +0 -80
  88. data/vendor/assets/components/chaijs-deep-eql/component.json +0 -18
  89. data/vendor/assets/components/chaijs-deep-eql/lib/eql.js +0 -257
  90. data/vendor/assets/components/chaijs-type-detect/component.json +0 -16
  91. data/vendor/assets/components/chaijs-type-detect/lib/type.js +0 -142
  92. data/vendor/assets/components/component-bind/component.json +0 -14
  93. data/vendor/assets/components/component-bind/index.js +0 -24
  94. data/vendor/assets/components/component-delegate/component.json +0 -19
  95. data/vendor/assets/components/component-delegate/index.js +0 -42
  96. data/vendor/assets/components/component-event/component.json +0 -13
  97. data/vendor/assets/components/component-event/index.js +0 -40
  98. data/vendor/assets/components/component-jquery/component.json +0 -14
  99. data/vendor/assets/components/component-jquery/index.js +0 -9601
  100. data/vendor/assets/components/component-link-delegate/component.json +0 -23
  101. data/vendor/assets/components/component-link-delegate/index.js +0 -60
  102. data/vendor/assets/components/component-matches-selector/component.json +0 -20
  103. data/vendor/assets/components/component-matches-selector/index.js +0 -45
  104. data/vendor/assets/components/component-query/component.json +0 -21
  105. data/vendor/assets/components/component-query/index.js +0 -21
  106. data/vendor/assets/components/component-type/component.json +0 -18
  107. data/vendor/assets/components/component-type/index.js +0 -32
  108. data/vendor/assets/components/component-url/component.json +0 -17
  109. data/vendor/assets/components/component-url/index.js +0 -63
  110. data/vendor/assets/components/discore-closest/component.json +0 -14
  111. data/vendor/assets/components/discore-closest/index.js +0 -18
  112. data/vendor/assets/components/indefinido-advisable/component.json +0 -21
  113. data/vendor/assets/components/indefinido-advisable/index.js +0 -1
  114. data/vendor/assets/components/indefinido-advisable/lib/advisable.js +0 -60
  115. data/vendor/assets/components/indefinido-indemma/component.json +0 -40
  116. data/vendor/assets/components/indefinido-indemma/index.js +0 -1
  117. data/vendor/assets/components/indefinido-indemma/lib/extensions/rivets.js +0 -23
  118. data/vendor/assets/components/indefinido-indemma/lib/record/associable.js +0 -217
  119. data/vendor/assets/components/indefinido-indemma/lib/record/maid.js +0 -24
  120. data/vendor/assets/components/indefinido-indemma/lib/record/resource.js +0 -104
  121. data/vendor/assets/components/indefinido-indemma/lib/record/rest.js +0 -36
  122. data/vendor/assets/components/indefinido-indemma/lib/record/restfulable.js +0 -326
  123. data/vendor/assets/components/indefinido-indemma/lib/record/scopable.js +0 -279
  124. data/vendor/assets/components/indefinido-indemma/lib/record/translationable.js +0 -19
  125. data/vendor/assets/components/indefinido-indemma/lib/record/validatable.js +0 -216
  126. data/vendor/assets/components/indefinido-indemma/lib/record/validations/associated.js +0 -30
  127. data/vendor/assets/components/indefinido-indemma/lib/record/validations/confirmation.js +0 -19
  128. data/vendor/assets/components/indefinido-indemma/lib/record/validations/cpf.js +0 -60
  129. data/vendor/assets/components/indefinido-indemma/lib/record/validations/presence.js +0 -19
  130. data/vendor/assets/components/indefinido-indemma/lib/record/validations/remote.js +0 -71
  131. data/vendor/assets/components/indefinido-indemma/lib/record.js +0 -167
  132. data/vendor/assets/components/indefinido-indemma/vendor/sinon.js +0 -4290
  133. data/vendor/assets/components/indefinido-indemma/vendor/stampit.js +0 -392
  134. data/vendor/assets/components/indefinido-observable/component.json +0 -25
  135. data/vendor/assets/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
  136. data/vendor/assets/components/indefinido-observable/index.js +0 -1
  137. data/vendor/assets/components/indefinido-observable/lib/adapters/rivets.js +0 -26
  138. data/vendor/assets/components/indefinido-observable/lib/observable.js +0 -320
  139. data/vendor/assets/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  140. data/vendor/assets/components/indefinido-observable/vendor/shims/accessors.js +0 -173
  141. data/vendor/assets/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  142. data/vendor/assets/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  143. data/vendor/assets/components/mikeric-rivets/component.json +0 -15
  144. data/vendor/assets/components/mikeric-rivets/dist/rivets.js +0 -1020
  145. data/vendor/assets/components/paulmillr-es6-shim/component.json +0 -17
  146. data/vendor/assets/components/paulmillr-es6-shim/es6-shim.js +0 -985
  147. data/vendor/assets/components/pluma-assimilate/component.json +0 -25
  148. data/vendor/assets/components/pluma-assimilate/dist/assimilate.js +0 -87
  149. data/vendor/assets/components/segmentio-extend/component.json +0 -13
  150. data/vendor/assets/components/segmentio-extend/index.js +0 -15
  151. data/vendor/components/chaijs-assertion-error/component.json +0 -18
  152. data/vendor/components/chaijs-assertion-error/index.js +0 -110
  153. data/vendor/components/chaijs-chai/component.json +0 -47
  154. data/vendor/components/chaijs-chai/index.js +0 -1
  155. data/vendor/components/chaijs-chai/lib/chai/assertion.js +0 -130
  156. data/vendor/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  157. data/vendor/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  158. data/vendor/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  159. data/vendor/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  160. data/vendor/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  161. data/vendor/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  162. data/vendor/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  163. data/vendor/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  164. data/vendor/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  165. data/vendor/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  166. data/vendor/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  167. data/vendor/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  168. data/vendor/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  169. data/vendor/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  170. data/vendor/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  171. data/vendor/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  172. data/vendor/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  173. data/vendor/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  174. data/vendor/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  175. data/vendor/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  176. data/vendor/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  177. data/vendor/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  178. data/vendor/components/chaijs-chai/lib/chai.js +0 -80
  179. data/vendor/components/chaijs-deep-eql/component.json +0 -18
  180. data/vendor/components/chaijs-deep-eql/lib/eql.js +0 -257
  181. data/vendor/components/chaijs-type-detect/component.json +0 -16
  182. data/vendor/components/chaijs-type-detect/lib/type.js +0 -142
  183. data/vendor/components/component-link-delegate/component.json +0 -23
  184. data/vendor/components/component-link-delegate/index.js +0 -60
  185. data/vendor/components/component-url/component.json +0 -17
  186. data/vendor/components/component-url/index.js +0 -63
  187. data/vendor/components/discore-closest/component.json +0 -14
  188. data/vendor/components/discore-closest/index.js +0 -18
  189. data/vendor/components/indefinido-indemma/.gitignore +0 -14
  190. data/vendor/components/indefinido-indemma/.ruby-gemset +0 -1
  191. data/vendor/components/indefinido-indemma/.ruby-version +0 -1
  192. data/vendor/components/indefinido-indemma/Gemfile +0 -13
  193. data/vendor/components/indefinido-indemma/Guardfile +0 -39
  194. data/vendor/components/indefinido-indemma/History.md +0 -0
  195. data/vendor/components/indefinido-indemma/Readme.md +0 -443
  196. data/vendor/components/indefinido-indemma/build/development.js +0 -331
  197. data/vendor/components/indefinido-indemma/build/test.js +0 -331
  198. data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/component.json +0 -18
  199. data/vendor/components/indefinido-indemma/components/chaijs-assertion-error/index.js +0 -110
  200. data/vendor/components/indefinido-indemma/components/chaijs-chai/component.json +0 -47
  201. data/vendor/components/indefinido-indemma/components/chaijs-chai/index.js +0 -1
  202. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/assertion.js +0 -130
  203. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/core/assertions.js +0 -1270
  204. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/assert.js +0 -1080
  205. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/expect.js +0 -12
  206. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/interface/should.js +0 -76
  207. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -94
  208. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -37
  209. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -40
  210. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/eql.js +0 -129
  211. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/flag.js +0 -32
  212. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getActual.js +0 -19
  213. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -25
  214. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -49
  215. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getName.js +0 -20
  216. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -102
  217. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -35
  218. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/index.js +0 -108
  219. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/inspect.js +0 -320
  220. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -48
  221. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -51
  222. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -54
  223. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/test.js +0 -26
  224. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -44
  225. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/type.js +0 -45
  226. data/vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai.js +0 -80
  227. data/vendor/components/indefinido-indemma/components/component-bind/component.json +0 -14
  228. data/vendor/components/indefinido-indemma/components/component-bind/index.js +0 -24
  229. data/vendor/components/indefinido-indemma/components/component-jquery/component.json +0 -14
  230. data/vendor/components/indefinido-indemma/components/component-jquery/index.js +0 -9601
  231. data/vendor/components/indefinido-indemma/components/component-type/component.json +0 -18
  232. data/vendor/components/indefinido-indemma/components/component-type/index.js +0 -32
  233. data/vendor/components/indefinido-indemma/components/indefinido-advisable/component.json +0 -21
  234. data/vendor/components/indefinido-indemma/components/indefinido-advisable/index.js +0 -1
  235. data/vendor/components/indefinido-indemma/components/indefinido-advisable/lib/advisable.js +0 -60
  236. data/vendor/components/indefinido-indemma/components/indefinido-observable/component.json +0 -25
  237. data/vendor/components/indefinido-indemma/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -4290
  238. data/vendor/components/indefinido-indemma/components/indefinido-observable/index.js +0 -1
  239. data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/adapters/rivets.js +0 -26
  240. data/vendor/components/indefinido-indemma/components/indefinido-observable/lib/observable.js +0 -323
  241. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
  242. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/accessors.js +0 -173
  243. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
  244. data/vendor/components/indefinido-indemma/components/indefinido-observable/vendor/shims/object.create.js +0 -77
  245. data/vendor/components/indefinido-indemma/components/kapit-observe-utils/component.json +0 -13
  246. data/vendor/components/indefinido-indemma/components/pluma-assimilate/component.json +0 -25
  247. data/vendor/components/indefinido-indemma/components/pluma-assimilate/dist/assimilate.js +0 -87
  248. data/vendor/components/indefinido-indemma/karma.conf.js +0 -86
  249. data/vendor/components/indefinido-indemma/lib/record/errors.js +0 -1
  250. data/vendor/components/indefinido-indemma/spec/record/associable_spec.js +0 -76
  251. data/vendor/components/indefinido-indemma/spec/record/resource_spec.js +0 -90
  252. data/vendor/components/indefinido-indemma/spec/record/rest_spec.js +0 -32
  253. data/vendor/components/indefinido-indemma/spec/record/restfulable_spec.js +0 -232
  254. data/vendor/components/indefinido-indemma/spec/record/scopable_spec.js +0 -201
  255. data/vendor/components/indefinido-indemma/spec/record/translationable.js +0 -28
  256. data/vendor/components/indefinido-indemma/spec/record/validatable_spec.js +0 -111
  257. data/vendor/components/indefinido-indemma/spec/record/validations/associated_spec.js +0 -43
  258. data/vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js +0 -36
  259. data/vendor/components/indefinido-indemma/spec/record/validations/cpf_spec.js +0 -35
  260. data/vendor/components/indefinido-indemma/spec/record/validations/presence_spec.js +0 -28
  261. data/vendor/components/indefinido-indemma/spec/record/validations/remote_spec.js +0 -86
  262. data/vendor/components/indefinido-indemma/spec/record/validations/type_spec.js +0 -48
  263. data/vendor/components/indefinido-indemma/spec/record_spec.js +0 -37
  264. data/vendor/components/indefinido-indemma/spec/spec_helper.js +0 -11
  265. data/vendor/components/indefinido-indemma/spec/support/value_objects/phone.js +0 -45
  266. data/vendor/components/indefinido-indemma/src/lib/extensions/rivets.coffee +0 -17
  267. data/vendor/components/indefinido-indemma/src/lib/record/associable.coffee +0 -173
  268. data/vendor/components/indefinido-indemma/src/lib/record/errors.coffee +0 -20
  269. data/vendor/components/indefinido-indemma/src/lib/record/maid.coffee +0 -16
  270. data/vendor/components/indefinido-indemma/src/lib/record/resource.coffee +0 -103
  271. data/vendor/components/indefinido-indemma/src/lib/record/rest.coffee +0 -28
  272. data/vendor/components/indefinido-indemma/src/lib/record/restfulable.coffee +0 -314
  273. data/vendor/components/indefinido-indemma/src/lib/record/scopable.coffee +0 -266
  274. data/vendor/components/indefinido-indemma/src/lib/record/translationable.coffee +0 -18
  275. data/vendor/components/indefinido-indemma/src/lib/record/validatable.coffee +0 -209
  276. data/vendor/components/indefinido-indemma/src/lib/record/validations/associated.coffee +0 -32
  277. data/vendor/components/indefinido-indemma/src/lib/record/validations/confirmation.coffee +0 -19
  278. data/vendor/components/indefinido-indemma/src/lib/record/validations/cpf.coffee +0 -58
  279. data/vendor/components/indefinido-indemma/src/lib/record/validations/presence.coffee +0 -19
  280. data/vendor/components/indefinido-indemma/src/lib/record/validations/remote.coffee +0 -65
  281. data/vendor/components/indefinido-indemma/src/lib/record/validations/type.coffee +0 -32
  282. data/vendor/components/indefinido-indemma/src/lib/record.coffee +0 -123
  283. data/vendor/components/indefinido-indemma/src/spec/record/associable_spec.coffee +0 -63
  284. data/vendor/components/indefinido-indemma/src/spec/record/resource_spec.coffee +0 -64
  285. data/vendor/components/indefinido-indemma/src/spec/record/rest_spec.coffee +0 -22
  286. data/vendor/components/indefinido-indemma/src/spec/record/restfulable_spec.coffee +0 -164
  287. data/vendor/components/indefinido-indemma/src/spec/record/scopable_spec.coffee +0 -181
  288. data/vendor/components/indefinido-indemma/src/spec/record/translationable.coffee +0 -19
  289. data/vendor/components/indefinido-indemma/src/spec/record/validatable_spec.coffee +0 -100
  290. data/vendor/components/indefinido-indemma/src/spec/record/validations/associated_spec.coffee +0 -35
  291. data/vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee +0 -25
  292. data/vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee +0 -28
  293. data/vendor/components/indefinido-indemma/src/spec/record/validations/presence_spec.coffee +0 -24
  294. data/vendor/components/indefinido-indemma/src/spec/record/validations/remote_spec.coffee +0 -72
  295. data/vendor/components/indefinido-indemma/src/spec/record/validations/type_spec.coffee +0 -33
  296. data/vendor/components/indefinido-indemma/src/spec/record_spec.coffee +0 -23
  297. data/vendor/components/indefinido-indemma/src/spec/spec_helper.coffee +0 -9
  298. data/vendor/components/indefinido-indemma/src/spec/support/value_objects/phone.coffee +0 -30
  299. data/vendor/components/indefinido-indemma/vendor/owl/pluralize.js +0 -190
@@ -26937,6 +26937,1923 @@ exports.mixin = function(object) {
26937
26937
  return $.extend(object, mixin);
26938
26938
  };
26939
26939
 
26940
+ });
26941
+ require.register("component-emitter/index.js", function(exports, require, module){
26942
+
26943
+ /**
26944
+ * Expose `Emitter`.
26945
+ */
26946
+
26947
+ module.exports = Emitter;
26948
+
26949
+ /**
26950
+ * Initialize a new `Emitter`.
26951
+ *
26952
+ * @api public
26953
+ */
26954
+
26955
+ function Emitter(obj) {
26956
+ if (obj) return mixin(obj);
26957
+ };
26958
+
26959
+ /**
26960
+ * Mixin the emitter properties.
26961
+ *
26962
+ * @param {Object} obj
26963
+ * @return {Object}
26964
+ * @api private
26965
+ */
26966
+
26967
+ function mixin(obj) {
26968
+ for (var key in Emitter.prototype) {
26969
+ obj[key] = Emitter.prototype[key];
26970
+ }
26971
+ return obj;
26972
+ }
26973
+
26974
+ /**
26975
+ * Listen on the given `event` with `fn`.
26976
+ *
26977
+ * @param {String} event
26978
+ * @param {Function} fn
26979
+ * @return {Emitter}
26980
+ * @api public
26981
+ */
26982
+
26983
+ Emitter.prototype.on = function(event, fn){
26984
+ this._callbacks = this._callbacks || {};
26985
+ (this._callbacks[event] = this._callbacks[event] || [])
26986
+ .push(fn);
26987
+ return this;
26988
+ };
26989
+
26990
+ /**
26991
+ * Adds an `event` listener that will be invoked a single
26992
+ * time then automatically removed.
26993
+ *
26994
+ * @param {String} event
26995
+ * @param {Function} fn
26996
+ * @return {Emitter}
26997
+ * @api public
26998
+ */
26999
+
27000
+ Emitter.prototype.once = function(event, fn){
27001
+ var self = this;
27002
+ this._callbacks = this._callbacks || {};
27003
+
27004
+ function on() {
27005
+ self.off(event, on);
27006
+ fn.apply(this, arguments);
27007
+ }
27008
+
27009
+ fn._off = on;
27010
+ this.on(event, on);
27011
+ return this;
27012
+ };
27013
+
27014
+ /**
27015
+ * Remove the given callback for `event` or all
27016
+ * registered callbacks.
27017
+ *
27018
+ * @param {String} event
27019
+ * @param {Function} fn
27020
+ * @return {Emitter}
27021
+ * @api public
27022
+ */
27023
+
27024
+ Emitter.prototype.off =
27025
+ Emitter.prototype.removeListener =
27026
+ Emitter.prototype.removeAllListeners = function(event, fn){
27027
+ this._callbacks = this._callbacks || {};
27028
+
27029
+ // all
27030
+ if (0 == arguments.length) {
27031
+ this._callbacks = {};
27032
+ return this;
27033
+ }
27034
+
27035
+ // specific event
27036
+ var callbacks = this._callbacks[event];
27037
+ if (!callbacks) return this;
27038
+
27039
+ // remove all handlers
27040
+ if (1 == arguments.length) {
27041
+ delete this._callbacks[event];
27042
+ return this;
27043
+ }
27044
+
27045
+ // remove specific handler
27046
+ var i = callbacks.indexOf(fn._off || fn);
27047
+ if (~i) callbacks.splice(i, 1);
27048
+ return this;
27049
+ };
27050
+
27051
+ /**
27052
+ * Emit `event` with the given args.
27053
+ *
27054
+ * @param {String} event
27055
+ * @param {Mixed} ...
27056
+ * @return {Emitter}
27057
+ */
27058
+
27059
+ Emitter.prototype.emit = function(event){
27060
+ this._callbacks = this._callbacks || {};
27061
+ var args = [].slice.call(arguments, 1)
27062
+ , callbacks = this._callbacks[event];
27063
+
27064
+ if (callbacks) {
27065
+ callbacks = callbacks.slice(0);
27066
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
27067
+ callbacks[i].apply(this, args);
27068
+ }
27069
+ }
27070
+
27071
+ return this;
27072
+ };
27073
+
27074
+ /**
27075
+ * Return array of callbacks for `event`.
27076
+ *
27077
+ * @param {String} event
27078
+ * @return {Array}
27079
+ * @api public
27080
+ */
27081
+
27082
+ Emitter.prototype.listeners = function(event){
27083
+ this._callbacks = this._callbacks || {};
27084
+ return this._callbacks[event] || [];
27085
+ };
27086
+
27087
+ /**
27088
+ * Check if this emitter has `event` handlers.
27089
+ *
27090
+ * @param {String} event
27091
+ * @return {Boolean}
27092
+ * @api public
27093
+ */
27094
+
27095
+ Emitter.prototype.hasListeners = function(event){
27096
+ return !! this.listeners(event).length;
27097
+ };
27098
+
27099
+ });
27100
+ require.register("component-event/index.js", function(exports, require, module){
27101
+
27102
+ /**
27103
+ * Bind `el` event `type` to `fn`.
27104
+ *
27105
+ * @param {Element} el
27106
+ * @param {String} type
27107
+ * @param {Function} fn
27108
+ * @param {Boolean} capture
27109
+ * @return {Function}
27110
+ * @api public
27111
+ */
27112
+
27113
+ exports.bind = function(el, type, fn, capture){
27114
+ if (el.addEventListener) {
27115
+ el.addEventListener(type, fn, capture || false);
27116
+ } else {
27117
+ el.attachEvent('on' + type, fn);
27118
+ }
27119
+ return fn;
27120
+ };
27121
+
27122
+ /**
27123
+ * Unbind `el` event `type`'s callback `fn`.
27124
+ *
27125
+ * @param {Element} el
27126
+ * @param {String} type
27127
+ * @param {Function} fn
27128
+ * @param {Boolean} capture
27129
+ * @return {Function}
27130
+ * @api public
27131
+ */
27132
+
27133
+ exports.unbind = function(el, type, fn, capture){
27134
+ if (el.removeEventListener) {
27135
+ el.removeEventListener(type, fn, capture || false);
27136
+ } else {
27137
+ el.detachEvent('on' + type, fn);
27138
+ }
27139
+ return fn;
27140
+ };
27141
+
27142
+ });
27143
+ require.register("component-matches-selector/index.js", function(exports, require, module){
27144
+ /**
27145
+ * Module dependencies.
27146
+ */
27147
+
27148
+ var query = require('query');
27149
+
27150
+ /**
27151
+ * Element prototype.
27152
+ */
27153
+
27154
+ var proto = Element.prototype;
27155
+
27156
+ /**
27157
+ * Vendor function.
27158
+ */
27159
+
27160
+ var vendor = proto.matches
27161
+ || proto.webkitMatchesSelector
27162
+ || proto.mozMatchesSelector
27163
+ || proto.msMatchesSelector
27164
+ || proto.oMatchesSelector;
27165
+
27166
+ /**
27167
+ * Expose `match()`.
27168
+ */
27169
+
27170
+ module.exports = match;
27171
+
27172
+ /**
27173
+ * Match `el` to `selector`.
27174
+ *
27175
+ * @param {Element} el
27176
+ * @param {String} selector
27177
+ * @return {Boolean}
27178
+ * @api public
27179
+ */
27180
+
27181
+ function match(el, selector) {
27182
+ if (vendor) return vendor.call(el, selector);
27183
+ var nodes = query.all(selector, el.parentNode);
27184
+ for (var i = 0; i < nodes.length; ++i) {
27185
+ if (nodes[i] == el) return true;
27186
+ }
27187
+ return false;
27188
+ }
27189
+
27190
+ });
27191
+ require.register("discore-closest/index.js", function(exports, require, module){
27192
+ var matches = require('matches-selector')
27193
+
27194
+ module.exports = function (element, selector, checkYoSelf, root) {
27195
+ element = checkYoSelf ? element : element.parentNode
27196
+ root = root || document
27197
+
27198
+ do {
27199
+ if (matches(element, selector))
27200
+ return element
27201
+ // After `matches` on the edge case that
27202
+ // the selector matches the root
27203
+ // (when the root is not the document)
27204
+ if (element === root)
27205
+ return
27206
+ // Make sure `element !== document`
27207
+ // otherwise we get an illegal invocation
27208
+ } while ((element = element.parentNode) && element !== document)
27209
+ }
27210
+ });
27211
+ require.register("component-delegate/index.js", function(exports, require, module){
27212
+ /**
27213
+ * Module dependencies.
27214
+ */
27215
+
27216
+ var closest = require('closest')
27217
+ , event = require('event');
27218
+
27219
+ /**
27220
+ * Delegate event `type` to `selector`
27221
+ * and invoke `fn(e)`. A callback function
27222
+ * is returned which may be passed to `.unbind()`.
27223
+ *
27224
+ * @param {Element} el
27225
+ * @param {String} selector
27226
+ * @param {String} type
27227
+ * @param {Function} fn
27228
+ * @param {Boolean} capture
27229
+ * @return {Function}
27230
+ * @api public
27231
+ */
27232
+
27233
+ exports.bind = function(el, selector, type, fn, capture){
27234
+ return event.bind(el, type, function(e){
27235
+ var target = e.target || e.srcElement;
27236
+ e.delegateTarget = closest(target, selector, true, el);
27237
+ if (e.delegateTarget) fn.call(el, e);
27238
+ }, capture);
27239
+ };
27240
+
27241
+ /**
27242
+ * Unbind event `type`'s callback `fn`.
27243
+ *
27244
+ * @param {Element} el
27245
+ * @param {String} type
27246
+ * @param {Function} fn
27247
+ * @param {Boolean} capture
27248
+ * @api public
27249
+ */
27250
+
27251
+ exports.unbind = function(el, type, fn, capture){
27252
+ event.unbind(el, type, fn, capture);
27253
+ };
27254
+
27255
+ });
27256
+ require.register("component-indexof/index.js", function(exports, require, module){
27257
+
27258
+ var indexOf = [].indexOf;
27259
+
27260
+ module.exports = function(arr, obj){
27261
+ if (indexOf) return arr.indexOf(obj);
27262
+ for (var i = 0; i < arr.length; ++i) {
27263
+ if (arr[i] === obj) return i;
27264
+ }
27265
+ return -1;
27266
+ };
27267
+ });
27268
+ require.register("component-domify/index.js", function(exports, require, module){
27269
+
27270
+ /**
27271
+ * Expose `parse`.
27272
+ */
27273
+
27274
+ module.exports = parse;
27275
+
27276
+ /**
27277
+ * Wrap map from jquery.
27278
+ */
27279
+
27280
+ var map = {
27281
+ option: [1, '<select multiple="multiple">', '</select>'],
27282
+ optgroup: [1, '<select multiple="multiple">', '</select>'],
27283
+ legend: [1, '<fieldset>', '</fieldset>'],
27284
+ thead: [1, '<table>', '</table>'],
27285
+ tbody: [1, '<table>', '</table>'],
27286
+ tfoot: [1, '<table>', '</table>'],
27287
+ colgroup: [1, '<table>', '</table>'],
27288
+ caption: [1, '<table>', '</table>'],
27289
+ tr: [2, '<table><tbody>', '</tbody></table>'],
27290
+ td: [3, '<table><tbody><tr>', '</tr></tbody></table>'],
27291
+ th: [3, '<table><tbody><tr>', '</tr></tbody></table>'],
27292
+ col: [2, '<table><tbody></tbody><colgroup>', '</colgroup></table>'],
27293
+ _default: [0, '', '']
27294
+ };
27295
+
27296
+ /**
27297
+ * Parse `html` and return the children.
27298
+ *
27299
+ * @param {String} html
27300
+ * @return {Array}
27301
+ * @api private
27302
+ */
27303
+
27304
+ function parse(html) {
27305
+ if ('string' != typeof html) throw new TypeError('String expected');
27306
+
27307
+ // tag name
27308
+ var m = /<([\w:]+)/.exec(html);
27309
+ if (!m) throw new Error('No elements were generated.');
27310
+ var tag = m[1];
27311
+
27312
+ // body support
27313
+ if (tag == 'body') {
27314
+ var el = document.createElement('html');
27315
+ el.innerHTML = html;
27316
+ return el.removeChild(el.lastChild);
27317
+ }
27318
+
27319
+ // wrap map
27320
+ var wrap = map[tag] || map._default;
27321
+ var depth = wrap[0];
27322
+ var prefix = wrap[1];
27323
+ var suffix = wrap[2];
27324
+ var el = document.createElement('div');
27325
+ el.innerHTML = prefix + html + suffix;
27326
+ while (depth--) el = el.lastChild;
27327
+
27328
+ var els = el.children;
27329
+ if (1 == els.length) {
27330
+ return el.removeChild(els[0]);
27331
+ }
27332
+
27333
+ var fragment = document.createDocumentFragment();
27334
+ while (els.length) {
27335
+ fragment.appendChild(el.removeChild(els[0]));
27336
+ }
27337
+
27338
+ return fragment;
27339
+ }
27340
+
27341
+ });
27342
+ require.register("component-classes/index.js", function(exports, require, module){
27343
+
27344
+ /**
27345
+ * Module dependencies.
27346
+ */
27347
+
27348
+ var index = require('indexof');
27349
+
27350
+ /**
27351
+ * Whitespace regexp.
27352
+ */
27353
+
27354
+ var re = /\s+/;
27355
+
27356
+ /**
27357
+ * toString reference.
27358
+ */
27359
+
27360
+ var toString = Object.prototype.toString;
27361
+
27362
+ /**
27363
+ * Wrap `el` in a `ClassList`.
27364
+ *
27365
+ * @param {Element} el
27366
+ * @return {ClassList}
27367
+ * @api public
27368
+ */
27369
+
27370
+ module.exports = function(el){
27371
+ return new ClassList(el);
27372
+ };
27373
+
27374
+ /**
27375
+ * Initialize a new ClassList for `el`.
27376
+ *
27377
+ * @param {Element} el
27378
+ * @api private
27379
+ */
27380
+
27381
+ function ClassList(el) {
27382
+ this.el = el;
27383
+ this.list = el.classList;
27384
+ }
27385
+
27386
+ /**
27387
+ * Add class `name` if not already present.
27388
+ *
27389
+ * @param {String} name
27390
+ * @return {ClassList}
27391
+ * @api public
27392
+ */
27393
+
27394
+ ClassList.prototype.add = function(name){
27395
+ // classList
27396
+ if (this.list) {
27397
+ this.list.add(name);
27398
+ return this;
27399
+ }
27400
+
27401
+ // fallback
27402
+ var arr = this.array();
27403
+ var i = index(arr, name);
27404
+ if (!~i) arr.push(name);
27405
+ this.el.className = arr.join(' ');
27406
+ return this;
27407
+ };
27408
+
27409
+ /**
27410
+ * Remove class `name` when present, or
27411
+ * pass a regular expression to remove
27412
+ * any which match.
27413
+ *
27414
+ * @param {String|RegExp} name
27415
+ * @return {ClassList}
27416
+ * @api public
27417
+ */
27418
+
27419
+ ClassList.prototype.remove = function(name){
27420
+ if ('[object RegExp]' == toString.call(name)) {
27421
+ return this.removeMatching(name);
27422
+ }
27423
+
27424
+ // classList
27425
+ if (this.list) {
27426
+ this.list.remove(name);
27427
+ return this;
27428
+ }
27429
+
27430
+ // fallback
27431
+ var arr = this.array();
27432
+ var i = index(arr, name);
27433
+ if (~i) arr.splice(i, 1);
27434
+ this.el.className = arr.join(' ');
27435
+ return this;
27436
+ };
27437
+
27438
+ /**
27439
+ * Remove all classes matching `re`.
27440
+ *
27441
+ * @param {RegExp} re
27442
+ * @return {ClassList}
27443
+ * @api private
27444
+ */
27445
+
27446
+ ClassList.prototype.removeMatching = function(re){
27447
+ var arr = this.array();
27448
+ for (var i = 0; i < arr.length; i++) {
27449
+ if (re.test(arr[i])) {
27450
+ this.remove(arr[i]);
27451
+ }
27452
+ }
27453
+ return this;
27454
+ };
27455
+
27456
+ /**
27457
+ * Toggle class `name`.
27458
+ *
27459
+ * @param {String} name
27460
+ * @return {ClassList}
27461
+ * @api public
27462
+ */
27463
+
27464
+ ClassList.prototype.toggle = function(name){
27465
+ // classList
27466
+ if (this.list) {
27467
+ this.list.toggle(name);
27468
+ return this;
27469
+ }
27470
+
27471
+ // fallback
27472
+ if (this.has(name)) {
27473
+ this.remove(name);
27474
+ } else {
27475
+ this.add(name);
27476
+ }
27477
+ return this;
27478
+ };
27479
+
27480
+ /**
27481
+ * Return an array of classes.
27482
+ *
27483
+ * @return {Array}
27484
+ * @api public
27485
+ */
27486
+
27487
+ ClassList.prototype.array = function(){
27488
+ var str = this.el.className.replace(/^\s+|\s+$/g, '');
27489
+ var arr = str.split(re);
27490
+ if ('' === arr[0]) arr.shift();
27491
+ return arr;
27492
+ };
27493
+
27494
+ /**
27495
+ * Check if class `name` is present.
27496
+ *
27497
+ * @param {String} name
27498
+ * @return {ClassList}
27499
+ * @api public
27500
+ */
27501
+
27502
+ ClassList.prototype.has =
27503
+ ClassList.prototype.contains = function(name){
27504
+ return this.list
27505
+ ? this.list.contains(name)
27506
+ : !! ~index(this.array(), name);
27507
+ };
27508
+
27509
+ });
27510
+ require.register("component-css/index.js", function(exports, require, module){
27511
+
27512
+ /**
27513
+ * Properties to ignore appending "px".
27514
+ */
27515
+
27516
+ var ignore = {
27517
+ columnCount: true,
27518
+ fillOpacity: true,
27519
+ fontWeight: true,
27520
+ lineHeight: true,
27521
+ opacity: true,
27522
+ orphans: true,
27523
+ widows: true,
27524
+ zIndex: true,
27525
+ zoom: true
27526
+ };
27527
+
27528
+ /**
27529
+ * Set `el` css values.
27530
+ *
27531
+ * @param {Element} el
27532
+ * @param {Object} obj
27533
+ * @return {Element}
27534
+ * @api public
27535
+ */
27536
+
27537
+ module.exports = function(el, obj){
27538
+ for (var key in obj) {
27539
+ var val = obj[key];
27540
+ if ('number' == typeof val && !ignore[key]) val += 'px';
27541
+ el.style[key] = val;
27542
+ }
27543
+ return el;
27544
+ };
27545
+
27546
+ });
27547
+ require.register("component-sort/index.js", function(exports, require, module){
27548
+
27549
+ /**
27550
+ * Expose `sort`.
27551
+ */
27552
+
27553
+ exports = module.exports = sort;
27554
+
27555
+ /**
27556
+ * Sort `el`'s children with the given `fn(a, b)`.
27557
+ *
27558
+ * @param {Element} el
27559
+ * @param {Function} fn
27560
+ * @api public
27561
+ */
27562
+
27563
+ function sort(el, fn) {
27564
+ var arr = [].slice.call(el.children).sort(fn);
27565
+ var frag = document.createDocumentFragment();
27566
+ for (var i = 0; i < arr.length; i++) {
27567
+ frag.appendChild(arr[i]);
27568
+ }
27569
+ el.appendChild(frag);
27570
+ };
27571
+
27572
+ /**
27573
+ * Sort descending.
27574
+ *
27575
+ * @param {Element} el
27576
+ * @param {Function} fn
27577
+ * @api public
27578
+ */
27579
+
27580
+ exports.desc = function(el, fn){
27581
+ sort(el, function(a, b){
27582
+ return ~fn(a, b) + 1;
27583
+ });
27584
+ };
27585
+
27586
+ /**
27587
+ * Sort ascending.
27588
+ */
27589
+
27590
+ exports.asc = sort;
27591
+
27592
+ });
27593
+ require.register("component-value/index.js", function(exports, require, module){
27594
+
27595
+ /**
27596
+ * Module dependencies.
27597
+ */
27598
+
27599
+ var typeOf = require('type');
27600
+
27601
+ /**
27602
+ * Set or get `el`'s' value.
27603
+ *
27604
+ * @param {Element} el
27605
+ * @param {Mixed} val
27606
+ * @return {Mixed}
27607
+ * @api public
27608
+ */
27609
+
27610
+ module.exports = function(el, val){
27611
+ if (2 == arguments.length) return set(el, val);
27612
+ return get(el);
27613
+ };
27614
+
27615
+ /**
27616
+ * Get `el`'s value.
27617
+ */
27618
+
27619
+ function get(el) {
27620
+ switch (type(el)) {
27621
+ case 'checkbox':
27622
+ case 'radio':
27623
+ if (el.checked) {
27624
+ var attr = el.getAttribute('value');
27625
+ return null == attr ? true : attr;
27626
+ } else {
27627
+ return false;
27628
+ }
27629
+ case 'radiogroup':
27630
+ for (var i = 0, radio; radio = el[i]; i++) {
27631
+ if (radio.checked) return radio.value;
27632
+ }
27633
+ break;
27634
+ case 'select':
27635
+ for (var i = 0, option; option = el.options[i]; i++) {
27636
+ if (option.selected) return option.value;
27637
+ }
27638
+ break;
27639
+ default:
27640
+ return el.value;
27641
+ }
27642
+ }
27643
+
27644
+ /**
27645
+ * Set `el`'s value.
27646
+ */
27647
+
27648
+ function set(el, val) {
27649
+ switch (type(el)) {
27650
+ case 'checkbox':
27651
+ case 'radio':
27652
+ if (val) {
27653
+ el.checked = true;
27654
+ } else {
27655
+ el.checked = false;
27656
+ }
27657
+ break;
27658
+ case 'radiogroup':
27659
+ for (var i = 0, radio; radio = el[i]; i++) {
27660
+ radio.checked = radio.value === val;
27661
+ }
27662
+ break;
27663
+ case 'select':
27664
+ for (var i = 0, option; option = el.options[i]; i++) {
27665
+ option.selected = option.value === val;
27666
+ }
27667
+ break;
27668
+ default:
27669
+ el.value = val;
27670
+ }
27671
+ }
27672
+
27673
+ /**
27674
+ * Element type.
27675
+ */
27676
+
27677
+ function type(el) {
27678
+ var group = 'array' == typeOf(el) || 'object' == typeOf(el);
27679
+ if (group) el = el[0];
27680
+ var name = el.nodeName.toLowerCase();
27681
+ var type = el.getAttribute('type');
27682
+
27683
+ if (group && type && 'radio' == type.toLowerCase()) return 'radiogroup';
27684
+ if ('input' == name && type && 'checkbox' == type.toLowerCase()) return 'checkbox';
27685
+ if ('input' == name && type && 'radio' == type.toLowerCase()) return 'radio';
27686
+ if ('select' == name) return 'select';
27687
+ return name;
27688
+ }
27689
+
27690
+ });
27691
+ require.register("component-query/index.js", function(exports, require, module){
27692
+
27693
+ function one(selector, el) {
27694
+ return el.querySelector(selector);
27695
+ }
27696
+
27697
+ exports = module.exports = function(selector, el){
27698
+ el = el || document;
27699
+ return one(selector, el);
27700
+ };
27701
+
27702
+ exports.all = function(selector, el){
27703
+ el = el || document;
27704
+ return el.querySelectorAll(selector);
27705
+ };
27706
+
27707
+ exports.engine = function(obj){
27708
+ if (!obj.one) throw new Error('.one callback required');
27709
+ if (!obj.all) throw new Error('.all callback required');
27710
+ one = obj.one;
27711
+ exports.all = obj.all;
27712
+ };
27713
+
27714
+ });
27715
+ require.register("component-dom/index.js", function(exports, require, module){
27716
+ /**
27717
+ * Module dependencies.
27718
+ */
27719
+
27720
+ var delegate = require('delegate');
27721
+ var classes = require('classes');
27722
+ var indexof = require('indexof');
27723
+ var domify = require('domify');
27724
+ var events = require('event');
27725
+ var value = require('value');
27726
+ var query = require('query');
27727
+ var type = require('type');
27728
+ var css = require('css');
27729
+
27730
+ /**
27731
+ * Attributes supported.
27732
+ */
27733
+
27734
+ var attrs = [
27735
+ 'id',
27736
+ 'src',
27737
+ 'rel',
27738
+ 'cols',
27739
+ 'rows',
27740
+ 'name',
27741
+ 'href',
27742
+ 'title',
27743
+ 'style',
27744
+ 'width',
27745
+ 'height',
27746
+ 'tabindex',
27747
+ 'placeholder'
27748
+ ];
27749
+
27750
+ /**
27751
+ * Expose `dom()`.
27752
+ */
27753
+
27754
+ exports = module.exports = dom;
27755
+
27756
+ /**
27757
+ * Expose supported attrs.
27758
+ */
27759
+
27760
+ exports.attrs = attrs;
27761
+
27762
+ /**
27763
+ * Return a dom `List` for the given
27764
+ * `html`, selector, or element.
27765
+ *
27766
+ * @param {String|Element|List}
27767
+ * @return {List}
27768
+ * @api public
27769
+ */
27770
+
27771
+ function dom(selector, context) {
27772
+ // array
27773
+ if (Array.isArray(selector)) {
27774
+ return new List(selector);
27775
+ }
27776
+
27777
+ // List
27778
+ if (selector instanceof List) {
27779
+ return selector;
27780
+ }
27781
+
27782
+ // node
27783
+ if (selector.nodeName) {
27784
+ return new List([selector]);
27785
+ }
27786
+
27787
+ if ('string' != typeof selector) {
27788
+ throw new TypeError('invalid selector');
27789
+ }
27790
+
27791
+ // html
27792
+ if ('<' == selector.charAt(0)) {
27793
+ return new List([domify(selector)], selector);
27794
+ }
27795
+
27796
+ // selector
27797
+ var ctx = context
27798
+ ? (context.els ? context.els[0] : context)
27799
+ : document;
27800
+
27801
+ return new List(query.all(selector, ctx), selector);
27802
+ }
27803
+
27804
+ /**
27805
+ * Expose `List` constructor.
27806
+ */
27807
+
27808
+ exports.List = List;
27809
+
27810
+ /**
27811
+ * Initialize a new `List` with the
27812
+ * given array-ish of `els` and `selector`
27813
+ * string.
27814
+ *
27815
+ * @param {Mixed} els
27816
+ * @param {String} selector
27817
+ * @api private
27818
+ */
27819
+
27820
+ function List(els, selector) {
27821
+ this.els = els || [];
27822
+ this.selector = selector;
27823
+ }
27824
+
27825
+ /**
27826
+ * Enumerable iterator.
27827
+ */
27828
+
27829
+ List.prototype.__iterate__ = function(){
27830
+ var self = this;
27831
+ return {
27832
+ length: function(){ return self.els.length },
27833
+ get: function(i){ return new List([self.els[i]]) }
27834
+ }
27835
+ };
27836
+
27837
+ /**
27838
+ * Remove elements from the DOM.
27839
+ *
27840
+ * @api public
27841
+ */
27842
+
27843
+ List.prototype.remove = function(){
27844
+ for (var i = 0; i < this.els.length; i++) {
27845
+ var el = this.els[i];
27846
+ var parent = el.parentNode;
27847
+ if (parent) parent.removeChild(el);
27848
+ }
27849
+ };
27850
+
27851
+ /**
27852
+ * Set attribute `name` to `val`, or get attr `name`.
27853
+ *
27854
+ * @param {String} name
27855
+ * @param {String} [val]
27856
+ * @return {String|List} self
27857
+ * @api public
27858
+ */
27859
+
27860
+ List.prototype.attr = function(name, val){
27861
+ // get
27862
+ if (1 == arguments.length) {
27863
+ return this.els[0] && this.els[0].getAttribute(name);
27864
+ }
27865
+
27866
+ // remove
27867
+ if (null == val) {
27868
+ return this.removeAttr(name);
27869
+ }
27870
+
27871
+ // set
27872
+ return this.forEach(function(el){
27873
+ el.setAttribute(name, val);
27874
+ });
27875
+ };
27876
+
27877
+ /**
27878
+ * Remove attribute `name`.
27879
+ *
27880
+ * @param {String} name
27881
+ * @return {List} self
27882
+ * @api public
27883
+ */
27884
+
27885
+ List.prototype.removeAttr = function(name){
27886
+ return this.forEach(function(el){
27887
+ el.removeAttribute(name);
27888
+ });
27889
+ };
27890
+
27891
+ /**
27892
+ * Set property `name` to `val`, or get property `name`.
27893
+ *
27894
+ * @param {String} name
27895
+ * @param {String} [val]
27896
+ * @return {Object|List} self
27897
+ * @api public
27898
+ */
27899
+
27900
+ List.prototype.prop = function(name, val){
27901
+ if (1 == arguments.length) {
27902
+ return this.els[0] && this.els[0][name];
27903
+ }
27904
+
27905
+ return this.forEach(function(el){
27906
+ el[name] = val;
27907
+ });
27908
+ };
27909
+
27910
+ /**
27911
+ * Get the first element's value or set selected
27912
+ * element values to `val`.
27913
+ *
27914
+ * @param {Mixed} [val]
27915
+ * @return {Mixed}
27916
+ * @api public
27917
+ */
27918
+
27919
+ List.prototype.val =
27920
+ List.prototype.value = function(val){
27921
+ if (0 == arguments.length) {
27922
+ return this.els[0]
27923
+ ? value(this.els[0])
27924
+ : undefined;
27925
+ }
27926
+
27927
+ return this.forEach(function(el){
27928
+ value(el, val);
27929
+ });
27930
+ };
27931
+
27932
+ /**
27933
+ * Return a cloned `List` with all elements cloned.
27934
+ *
27935
+ * @return {List}
27936
+ * @api public
27937
+ */
27938
+
27939
+ List.prototype.clone = function(){
27940
+ var arr = [];
27941
+ for (var i = 0, len = this.els.length; i < len; ++i) {
27942
+ arr.push(this.els[i].cloneNode(true));
27943
+ }
27944
+ return new List(arr);
27945
+ };
27946
+
27947
+ /**
27948
+ * Prepend `val`.
27949
+ *
27950
+ * @param {String|Element|List} val
27951
+ * @return {List} new list
27952
+ * @api public
27953
+ */
27954
+
27955
+ List.prototype.prepend = function(val){
27956
+ var el = this.els[0];
27957
+ if (!el) return this;
27958
+ val = dom(val);
27959
+ for (var i = 0; i < val.els.length; ++i) {
27960
+ if (el.children.length) {
27961
+ el.insertBefore(val.els[i], el.firstChild);
27962
+ } else {
27963
+ el.appendChild(val.els[i]);
27964
+ }
27965
+ }
27966
+ return val;
27967
+ };
27968
+
27969
+ /**
27970
+ * Append `val`.
27971
+ *
27972
+ * @param {String|Element|List} val
27973
+ * @return {List} new list
27974
+ * @api public
27975
+ */
27976
+
27977
+ List.prototype.append = function(val){
27978
+ var el = this.els[0];
27979
+ if (!el) return this;
27980
+ val = dom(val);
27981
+ for (var i = 0; i < val.els.length; ++i) {
27982
+ el.appendChild(val.els[i]);
27983
+ }
27984
+ return val;
27985
+ };
27986
+
27987
+ /**
27988
+ * Append self's `el` to `val`
27989
+ *
27990
+ * @param {String|Element|List} val
27991
+ * @return {List} self
27992
+ * @api public
27993
+ */
27994
+
27995
+ List.prototype.appendTo = function(val){
27996
+ dom(val).append(this);
27997
+ return this;
27998
+ };
27999
+
28000
+ /**
28001
+ * Return a `List` containing the element at `i`.
28002
+ *
28003
+ * @param {Number} i
28004
+ * @return {List}
28005
+ * @api public
28006
+ */
28007
+
28008
+ List.prototype.at = function(i){
28009
+ return new List([this.els[i]], this.selector);
28010
+ };
28011
+
28012
+ /**
28013
+ * Return a `List` containing the first element.
28014
+ *
28015
+ * @param {Number} i
28016
+ * @return {List}
28017
+ * @api public
28018
+ */
28019
+
28020
+ List.prototype.first = function(){
28021
+ return new List([this.els[0]], this.selector);
28022
+ };
28023
+
28024
+ /**
28025
+ * Return a `List` containing the last element.
28026
+ *
28027
+ * @param {Number} i
28028
+ * @return {List}
28029
+ * @api public
28030
+ */
28031
+
28032
+ List.prototype.last = function(){
28033
+ return new List([this.els[this.els.length - 1]], this.selector);
28034
+ };
28035
+
28036
+ /**
28037
+ * Return an `Element` at `i`.
28038
+ *
28039
+ * @param {Number} i
28040
+ * @return {Element}
28041
+ * @api public
28042
+ */
28043
+
28044
+ List.prototype.get = function(i){
28045
+ return this.els[i || 0];
28046
+ };
28047
+
28048
+ /**
28049
+ * Return list length.
28050
+ *
28051
+ * @return {Number}
28052
+ * @api public
28053
+ */
28054
+
28055
+ List.prototype.length = function(){
28056
+ return this.els.length;
28057
+ };
28058
+
28059
+ /**
28060
+ * Return element text.
28061
+ *
28062
+ * @param {String} str
28063
+ * @return {String|List}
28064
+ * @api public
28065
+ */
28066
+
28067
+ List.prototype.text = function(str){
28068
+ // TODO: real impl
28069
+ if (1 == arguments.length) {
28070
+ this.forEach(function(el){
28071
+ el.textContent = str;
28072
+ });
28073
+ return this;
28074
+ }
28075
+
28076
+ var str = '';
28077
+ for (var i = 0; i < this.els.length; ++i) {
28078
+ str += this.els[i].textContent;
28079
+ }
28080
+ return str;
28081
+ };
28082
+
28083
+ /**
28084
+ * Return element html.
28085
+ *
28086
+ * @return {String} html
28087
+ * @api public
28088
+ */
28089
+
28090
+ List.prototype.html = function(html){
28091
+ if (1 == arguments.length) {
28092
+ this.forEach(function(el){
28093
+ el.innerHTML = html;
28094
+ });
28095
+ }
28096
+ // TODO: real impl
28097
+ return this.els[0] && this.els[0].innerHTML;
28098
+ };
28099
+
28100
+ /**
28101
+ * Bind to `event` and invoke `fn(e)`. When
28102
+ * a `selector` is given then events are delegated.
28103
+ *
28104
+ * @param {String} event
28105
+ * @param {String} [selector]
28106
+ * @param {Function} fn
28107
+ * @param {Boolean} capture
28108
+ * @return {List}
28109
+ * @api public
28110
+ */
28111
+
28112
+ List.prototype.on = function(event, selector, fn, capture){
28113
+ if ('string' == typeof selector) {
28114
+ for (var i = 0; i < this.els.length; ++i) {
28115
+ fn._delegate = delegate.bind(this.els[i], selector, event, fn, capture);
28116
+ }
28117
+ return this;
28118
+ }
28119
+
28120
+ capture = fn;
28121
+ fn = selector;
28122
+
28123
+ for (var i = 0; i < this.els.length; ++i) {
28124
+ events.bind(this.els[i], event, fn, capture);
28125
+ }
28126
+
28127
+ return this;
28128
+ };
28129
+
28130
+ /**
28131
+ * Unbind to `event` and invoke `fn(e)`. When
28132
+ * a `selector` is given then delegated event
28133
+ * handlers are unbound.
28134
+ *
28135
+ * @param {String} event
28136
+ * @param {String} [selector]
28137
+ * @param {Function} fn
28138
+ * @param {Boolean} capture
28139
+ * @return {List}
28140
+ * @api public
28141
+ */
28142
+
28143
+ List.prototype.off = function(event, selector, fn, capture){
28144
+ if ('string' == typeof selector) {
28145
+ for (var i = 0; i < this.els.length; ++i) {
28146
+ // TODO: add selector support back
28147
+ delegate.unbind(this.els[i], event, fn._delegate, capture);
28148
+ }
28149
+ return this;
28150
+ }
28151
+
28152
+ capture = fn;
28153
+ fn = selector;
28154
+
28155
+ for (var i = 0; i < this.els.length; ++i) {
28156
+ events.unbind(this.els[i], event, fn, capture);
28157
+ }
28158
+ return this;
28159
+ };
28160
+
28161
+ /**
28162
+ * Iterate elements and invoke `fn(list, i)`.
28163
+ *
28164
+ * @param {Function} fn
28165
+ * @return {List} self
28166
+ * @api public
28167
+ */
28168
+
28169
+ List.prototype.each = function(fn){
28170
+ for (var i = 0; i < this.els.length; ++i) {
28171
+ fn(new List([this.els[i]], this.selector), i);
28172
+ }
28173
+ return this;
28174
+ };
28175
+
28176
+ /**
28177
+ * Iterate elements and invoke `fn(el, i)`.
28178
+ *
28179
+ * @param {Function} fn
28180
+ * @return {List} self
28181
+ * @api public
28182
+ */
28183
+
28184
+ List.prototype.forEach = function(fn){
28185
+ for (var i = 0; i < this.els.length; ++i) {
28186
+ fn(this.els[i], i);
28187
+ }
28188
+ return this;
28189
+ };
28190
+
28191
+ /**
28192
+ * Map elements invoking `fn(list, i)`.
28193
+ *
28194
+ * @param {Function} fn
28195
+ * @return {Array}
28196
+ * @api public
28197
+ */
28198
+
28199
+ List.prototype.map = function(fn){
28200
+ var arr = [];
28201
+ for (var i = 0; i < this.els.length; ++i) {
28202
+ arr.push(fn(new List([this.els[i]], this.selector), i));
28203
+ }
28204
+ return arr;
28205
+ };
28206
+
28207
+ /**
28208
+ * Filter elements invoking `fn(list, i)`, returning
28209
+ * a new `List` of elements when a truthy value is returned.
28210
+ *
28211
+ * @param {Function} fn
28212
+ * @return {List}
28213
+ * @api public
28214
+ */
28215
+
28216
+ List.prototype.select =
28217
+ List.prototype.filter = function(fn){
28218
+ var el;
28219
+ var list = new List([], this.selector);
28220
+ for (var i = 0; i < this.els.length; ++i) {
28221
+ el = this.els[i];
28222
+ if (fn(new List([el], this.selector), i)) list.els.push(el);
28223
+ }
28224
+ return list;
28225
+ };
28226
+
28227
+ /**
28228
+ * Filter elements invoking `fn(list, i)`, returning
28229
+ * a new `List` of elements when a falsey value is returned.
28230
+ *
28231
+ * @param {Function} fn
28232
+ * @return {List}
28233
+ * @api public
28234
+ */
28235
+
28236
+ List.prototype.reject = function(fn){
28237
+ var el;
28238
+ var list = new List([], this.selector);
28239
+ for (var i = 0; i < this.els.length; ++i) {
28240
+ el = this.els[i];
28241
+ if (!fn(new List([el], this.selector), i)) list.els.push(el);
28242
+ }
28243
+ return list;
28244
+ };
28245
+
28246
+ /**
28247
+ * Add the given class `name`.
28248
+ *
28249
+ * @param {String} name
28250
+ * @return {List} self
28251
+ * @api public
28252
+ */
28253
+
28254
+ List.prototype.addClass = function(name){
28255
+ var el;
28256
+ for (var i = 0; i < this.els.length; ++i) {
28257
+ el = this.els[i];
28258
+ el._classes = el._classes || classes(el);
28259
+ el._classes.add(name);
28260
+ }
28261
+ return this;
28262
+ };
28263
+
28264
+ /**
28265
+ * Remove the given class `name`.
28266
+ *
28267
+ * @param {String|RegExp} name
28268
+ * @return {List} self
28269
+ * @api public
28270
+ */
28271
+
28272
+ List.prototype.removeClass = function(name){
28273
+ var el;
28274
+
28275
+ if ('regexp' == type(name)) {
28276
+ for (var i = 0; i < this.els.length; ++i) {
28277
+ el = this.els[i];
28278
+ el._classes = el._classes || classes(el);
28279
+ var arr = el._classes.array();
28280
+ for (var j = 0; j < arr.length; j++) {
28281
+ if (name.test(arr[j])) {
28282
+ el._classes.remove(arr[j]);
28283
+ }
28284
+ }
28285
+ }
28286
+ return this;
28287
+ }
28288
+
28289
+ for (var i = 0; i < this.els.length; ++i) {
28290
+ el = this.els[i];
28291
+ el._classes = el._classes || classes(el);
28292
+ el._classes.remove(name);
28293
+ }
28294
+
28295
+ return this;
28296
+ };
28297
+
28298
+ /**
28299
+ * Toggle the given class `name`,
28300
+ * optionally a `bool` may be given
28301
+ * to indicate that the class should
28302
+ * be added when truthy.
28303
+ *
28304
+ * @param {String} name
28305
+ * @param {Boolean} bool
28306
+ * @return {List} self
28307
+ * @api public
28308
+ */
28309
+
28310
+ List.prototype.toggleClass = function(name, bool){
28311
+ var el;
28312
+ var fn = 'toggle';
28313
+
28314
+ // toggle with boolean
28315
+ if (2 == arguments.length) {
28316
+ fn = bool ? 'add' : 'remove';
28317
+ }
28318
+
28319
+ for (var i = 0; i < this.els.length; ++i) {
28320
+ el = this.els[i];
28321
+ el._classes = el._classes || classes(el);
28322
+ el._classes[fn](name);
28323
+ }
28324
+
28325
+ return this;
28326
+ };
28327
+
28328
+ /**
28329
+ * Check if the given class `name` is present.
28330
+ *
28331
+ * @param {String} name
28332
+ * @return {Boolean}
28333
+ * @api public
28334
+ */
28335
+
28336
+ List.prototype.hasClass = function(name){
28337
+ var el;
28338
+ for (var i = 0; i < this.els.length; ++i) {
28339
+ el = this.els[i];
28340
+ el._classes = el._classes || classes(el);
28341
+ if (el._classes.has(name)) return true;
28342
+ }
28343
+ return false;
28344
+ };
28345
+
28346
+ /**
28347
+ * Set CSS `prop` to `val` or get `prop` value.
28348
+ * Also accepts an object (`prop`: `val`)
28349
+ *
28350
+ * @param {String} prop
28351
+ * @param {Mixed} val
28352
+ * @return {List|String}
28353
+ * @api public
28354
+ */
28355
+
28356
+ List.prototype.css = function(prop, val){
28357
+ if (2 == arguments.length) {
28358
+ var obj = {};
28359
+ obj[prop] = val;
28360
+ return this.setStyle(obj);
28361
+ }
28362
+
28363
+ if ('object' == type(prop)) {
28364
+ return this.setStyle(prop);
28365
+ }
28366
+
28367
+ return this.getStyle(prop);
28368
+ };
28369
+
28370
+ /**
28371
+ * Set CSS `props`.
28372
+ *
28373
+ * @param {Object} props
28374
+ * @return {List} self
28375
+ * @api private
28376
+ */
28377
+
28378
+ List.prototype.setStyle = function(props){
28379
+ for (var i = 0; i < this.els.length; ++i) {
28380
+ css(this.els[i], props);
28381
+ }
28382
+ return this;
28383
+ };
28384
+
28385
+ /**
28386
+ * Get CSS `prop` value.
28387
+ *
28388
+ * @param {String} prop
28389
+ * @return {String}
28390
+ * @api private
28391
+ */
28392
+
28393
+ List.prototype.getStyle = function(prop){
28394
+ var el = this.els[0];
28395
+ if (el) return el.style[prop];
28396
+ };
28397
+
28398
+ /**
28399
+ * Find children matching the given `selector`.
28400
+ *
28401
+ * @param {String} selector
28402
+ * @return {List}
28403
+ * @api public
28404
+ */
28405
+
28406
+ List.prototype.find = function(selector){
28407
+ return dom(selector, this);
28408
+ };
28409
+
28410
+ /**
28411
+ * Empty the dom list
28412
+ *
28413
+ * @return self
28414
+ * @api public
28415
+ */
28416
+
28417
+ List.prototype.empty = function(){
28418
+ var elem, el;
28419
+
28420
+ for (var i = 0; i < this.els.length; ++i) {
28421
+ el = this.els[i];
28422
+ while (el.firstChild) {
28423
+ el.removeChild(el.firstChild);
28424
+ }
28425
+ }
28426
+
28427
+ return this;
28428
+ }
28429
+
28430
+ /**
28431
+ * Attribute accessors.
28432
+ */
28433
+
28434
+ attrs.forEach(function(name){
28435
+ List.prototype[name] = function(val){
28436
+ if (0 == arguments.length) return this.attr(name);
28437
+ return this.attr(name, val);
28438
+ };
28439
+ });
28440
+
28441
+
28442
+ });
28443
+ require.register("component-overlay/index.js", function(exports, require, module){
28444
+
28445
+ /**
28446
+ * Module dependencies.
28447
+ */
28448
+
28449
+ var Emitter = require('emitter');
28450
+ var tmpl = require('./template');
28451
+ var o = require('dom');
28452
+
28453
+ /**
28454
+ * Expose `overlay()`.
28455
+ */
28456
+
28457
+ exports = module.exports = overlay;
28458
+
28459
+ /**
28460
+ * Expose `Overlay`.
28461
+ */
28462
+
28463
+ exports.Overlay = Overlay;
28464
+
28465
+ /**
28466
+ * Return a new `Overlay` with the given `options`.
28467
+ *
28468
+ * @param {Object|Element} options
28469
+ * @return {Overlay}
28470
+ * @api public
28471
+ */
28472
+
28473
+ function overlay(options){
28474
+ options = options || {};
28475
+
28476
+ // element
28477
+ if (options.nodeName) {
28478
+ options = { target: options };
28479
+ }
28480
+
28481
+ return new Overlay(options);
28482
+ };
28483
+
28484
+ /**
28485
+ * Initialize a new `Overlay`.
28486
+ *
28487
+ * @param {Object} options
28488
+ * @api public
28489
+ */
28490
+
28491
+ function Overlay(options) {
28492
+ Emitter.call(this);
28493
+ options = options || {};
28494
+ this.target = options.target || 'body';
28495
+ this.closable = options.closable;
28496
+ this.el = o(tmpl);
28497
+ this.el.appendTo(this.target);
28498
+ if (this.closable) this.el.on('click', this.hide.bind(this));
28499
+ }
28500
+
28501
+ /**
28502
+ * Mixin emitter.
28503
+ */
28504
+
28505
+ Emitter(Overlay.prototype);
28506
+
28507
+ /**
28508
+ * Show the overlay.
28509
+ *
28510
+ * Emits "show" event.
28511
+ *
28512
+ * @return {Overlay}
28513
+ * @api public
28514
+ */
28515
+
28516
+ Overlay.prototype.show = function(){
28517
+ this.emit('show');
28518
+ this.el.removeClass('hide');
28519
+ return this;
28520
+ };
28521
+
28522
+ /**
28523
+ * Hide the overlay.
28524
+ *
28525
+ * Emits "hide" event.
28526
+ *
28527
+ * @return {Overlay}
28528
+ * @api public
28529
+ */
28530
+
28531
+ Overlay.prototype.hide = function(){
28532
+ this.emit('hide');
28533
+ return this.remove();
28534
+ };
28535
+
28536
+ /**
28537
+ * Hide the overlay without emitting "hide".
28538
+ *
28539
+ * Emits "close" event.
28540
+ *
28541
+ * @return {Overlay}
28542
+ * @api public
28543
+ */
28544
+
28545
+ Overlay.prototype.remove = function(){
28546
+ var self = this;
28547
+ this.emit('close');
28548
+ this.el.addClass('hide');
28549
+ setTimeout(function(){
28550
+ self.el.remove();
28551
+ }, 2000);
28552
+ return this;
28553
+ };
28554
+
28555
+
28556
+ });
28557
+ require.register("component-overlay/template.js", function(exports, require, module){
28558
+ module.exports = '<div class="overlay hide"></div>\n';
28559
+ });
28560
+ require.register("component-dialog/index.js", function(exports, require, module){
28561
+
28562
+ /**
28563
+ * Module dependencies.
28564
+ */
28565
+
28566
+ var Emitter = require('emitter')
28567
+ , overlay = require('overlay')
28568
+ , o = require('jquery');
28569
+
28570
+ /**
28571
+ * Active dialog.
28572
+ */
28573
+
28574
+ var active;
28575
+
28576
+ /**
28577
+ * Expose `dialog()`.
28578
+ */
28579
+
28580
+ exports = module.exports = dialog;
28581
+
28582
+ /**
28583
+ * Expose `Dialog`.
28584
+ */
28585
+
28586
+ exports.Dialog = Dialog;
28587
+
28588
+ /**
28589
+ * Return a new `Dialog` with the given
28590
+ * (optional) `title` and `msg`.
28591
+ *
28592
+ * @param {String} title or msg
28593
+ * @param {String} msg
28594
+ * @return {Dialog}
28595
+ * @api public
28596
+ */
28597
+
28598
+ function dialog(title, msg){
28599
+ switch (arguments.length) {
28600
+ case 2:
28601
+ return new Dialog({ title: title, message: msg });
28602
+ case 1:
28603
+ return new Dialog({ message: title });
28604
+ }
28605
+ };
28606
+
28607
+ /**
28608
+ * Initialize a new `Dialog`.
28609
+ *
28610
+ * Options:
28611
+ *
28612
+ * - `title` dialog title
28613
+ * - `message` a message to display
28614
+ *
28615
+ * Emits:
28616
+ *
28617
+ * - `show` when visible
28618
+ * - `hide` when hidden
28619
+ *
28620
+ * @param {Object} options
28621
+ * @api public
28622
+ */
28623
+
28624
+ function Dialog(options) {
28625
+ Emitter.call(this);
28626
+ options = options || {};
28627
+ this.template = require('./template');
28628
+ this.el = o(this.template);
28629
+ this.render(options);
28630
+ if (active && !active.hiding) active.hide();
28631
+ if (exports.effect) this.effect(exports.effect);
28632
+ this.on('escape', this.hide.bind(this));
28633
+ active = this;
28634
+ };
28635
+
28636
+ /**
28637
+ * Inherit from `Emitter.prototype`.
28638
+ */
28639
+
28640
+ Dialog.prototype = new Emitter;
28641
+
28642
+ /**
28643
+ * Render with the given `options`.
28644
+ *
28645
+ * @param {Object} options
28646
+ * @api public
28647
+ */
28648
+
28649
+ Dialog.prototype.render = function(options){
28650
+ var el = this.el
28651
+ , title = options.title
28652
+ , msg = options.message
28653
+ , self = this;
28654
+
28655
+ el.find('.close').click(function(){
28656
+ self.emit('close');
28657
+ self.hide();
28658
+ return false;
28659
+ });
28660
+
28661
+ el.find('.title').text(title);
28662
+ if (!title) el.find('.title').remove();
28663
+
28664
+ // message
28665
+ if ('string' == typeof msg) {
28666
+ el.find('p').text(msg);
28667
+ } else if (msg) {
28668
+ el.find('p').replaceWith(msg.el || msg);
28669
+ }
28670
+
28671
+ setTimeout(function(){
28672
+ el.removeClass('hide');
28673
+ }, 0);
28674
+ };
28675
+
28676
+ /**
28677
+ * Enable the dialog close link.
28678
+ *
28679
+ * @return {Dialog} for chaining
28680
+ * @api public
28681
+ */
28682
+
28683
+ Dialog.prototype.closable = function(){
28684
+ this.el.addClass('closable');
28685
+ return this;
28686
+ };
28687
+
28688
+ /**
28689
+ * Add class `name`.
28690
+ *
28691
+ * @param {String} name
28692
+ * @return {Dialog}
28693
+ * @api public
28694
+ */
28695
+
28696
+ Dialog.prototype.addClass = function(name){
28697
+ this.el.addClass(name);
28698
+ return this;
28699
+ };
28700
+
28701
+ /**
28702
+ * Set the effect to `type`.
28703
+ *
28704
+ * @param {String} type
28705
+ * @return {Dialog} for chaining
28706
+ * @api public
28707
+ */
28708
+
28709
+ Dialog.prototype.effect = function(type){
28710
+ this._effect = type;
28711
+ this.addClass(type);
28712
+ return this;
28713
+ };
28714
+
28715
+ /**
28716
+ * Make it modal!
28717
+ *
28718
+ * @return {Dialog} for chaining
28719
+ * @api public
28720
+ */
28721
+
28722
+ Dialog.prototype.modal = function(){
28723
+ this._overlay = overlay();
28724
+ return this;
28725
+ };
28726
+
28727
+ /**
28728
+ * Add an overlay.
28729
+ *
28730
+ * @return {Dialog} for chaining
28731
+ * @api public
28732
+ */
28733
+
28734
+ Dialog.prototype.overlay = function(){
28735
+ var self = this;
28736
+ var o = overlay({ closable: true });
28737
+ o.on('hide', function(){
28738
+ self._overlay = null;
28739
+ self.hide();
28740
+ });
28741
+ this._overlay = o;
28742
+ return this;
28743
+ };
28744
+
28745
+ /**
28746
+ * Close the dialog when the escape key is pressed.
28747
+ *
28748
+ * @api private
28749
+ */
28750
+
28751
+ Dialog.prototype.escapable = function(){
28752
+ var self = this;
28753
+ o(document).bind('keydown.dialog', function(e){
28754
+ if (27 != e.which) return;
28755
+ self.emit('escape');
28756
+ });
28757
+ };
28758
+
28759
+ /**
28760
+ * Show the dialog.
28761
+ *
28762
+ * Emits "show" event.
28763
+ *
28764
+ * @return {Dialog} for chaining
28765
+ * @api public
28766
+ */
28767
+
28768
+ Dialog.prototype.show = function(){
28769
+ var overlay = this._overlay;
28770
+
28771
+ // overlay
28772
+ if (overlay) {
28773
+ overlay.show();
28774
+ this.el.addClass('modal');
28775
+ }
28776
+
28777
+ // escape
28778
+ if (!overlay || overlay.closable) this.escapable();
28779
+
28780
+ // position
28781
+ this.el.appendTo('body');
28782
+ this.el.css({ marginLeft: -(this.el.width() / 2) + 'px' });
28783
+
28784
+ this.emit('show');
28785
+ return this;
28786
+ };
28787
+
28788
+ /**
28789
+ * Hide the overlay.
28790
+ *
28791
+ * @api private
28792
+ */
28793
+
28794
+ Dialog.prototype.hideOverlay = function(){
28795
+ if (!this._overlay) return;
28796
+ this._overlay.remove();
28797
+ this._overlay = null;
28798
+ };
28799
+
28800
+ /**
28801
+ * Hide the dialog with optional delay of `ms`,
28802
+ * otherwise the dialog is removed immediately.
28803
+ *
28804
+ * Emits "hide" event.
28805
+ *
28806
+ * @return {Number} ms
28807
+ * @return {Dialog} for chaining
28808
+ * @api public
28809
+ */
28810
+
28811
+ Dialog.prototype.hide = function(ms){
28812
+ var self = this;
28813
+ o(document).unbind('keydown.dialog');
28814
+
28815
+ // prevent thrashing
28816
+ this.hiding = true;
28817
+
28818
+ // duration
28819
+ if (ms) {
28820
+ setTimeout(function(){
28821
+ self.hide();
28822
+ }, ms);
28823
+ return this;
28824
+ }
28825
+
28826
+ // hide / remove
28827
+ this.el.addClass('hide');
28828
+ if (this._effect) {
28829
+ setTimeout(function(){
28830
+ self.remove();
28831
+ }, 500);
28832
+ } else {
28833
+ self.remove();
28834
+ }
28835
+
28836
+ // overlay
28837
+ this.hideOverlay();
28838
+
28839
+ return this;
28840
+ };
28841
+ /**
28842
+ * Hide the dialog without potential animation.
28843
+ *
28844
+ * @return {Dialog} for chaining
28845
+ * @api public
28846
+ */
28847
+
28848
+ Dialog.prototype.remove = function(){
28849
+ this.emit('hide');
28850
+ this.el.remove();
28851
+ return this;
28852
+ };
28853
+
28854
+ });
28855
+ require.register("component-dialog/template.js", function(exports, require, module){
28856
+ module.exports = '<div id="dialog" class="hide">\n <div class="content">\n <span class="title">Title</span>\n <a href="#" class="close">× <em>close</em></a>\n <div class="body">\n <p>Message</p>\n </div>\n </div>\n</div>';
26940
28857
  });
26941
28858
  require.register("ened/vendor/assets/javascripts/lennon/lennon.js", function(exports, require, module){
26942
28859
  /*!
@@ -27760,3 +29677,48 @@ require.alias("indefinido-advisable/lib/advisable.js", "ened/deps/advisable/lib/
27760
29677
  require.alias("indefinido-advisable/index.js", "advisable/index.js");
27761
29678
  require.alias("component-jquery/index.js", "indefinido-advisable/deps/jquery/index.js");
27762
29679
 
29680
+ require.alias("component-dialog/index.js", "ened/deps/dialog/index.js");
29681
+ require.alias("component-dialog/template.js", "ened/deps/dialog/template.js");
29682
+ require.alias("component-dialog/index.js", "dialog/index.js");
29683
+ require.alias("component-emitter/index.js", "component-dialog/deps/emitter/index.js");
29684
+
29685
+ require.alias("component-jquery/index.js", "component-dialog/deps/jquery/index.js");
29686
+
29687
+ require.alias("component-overlay/index.js", "component-dialog/deps/overlay/index.js");
29688
+ require.alias("component-overlay/template.js", "component-dialog/deps/overlay/template.js");
29689
+ require.alias("component-emitter/index.js", "component-overlay/deps/emitter/index.js");
29690
+
29691
+ require.alias("component-dom/index.js", "component-overlay/deps/dom/index.js");
29692
+ require.alias("component-type/index.js", "component-dom/deps/type/index.js");
29693
+
29694
+ require.alias("component-event/index.js", "component-dom/deps/event/index.js");
29695
+
29696
+ require.alias("component-delegate/index.js", "component-dom/deps/delegate/index.js");
29697
+ require.alias("discore-closest/index.js", "component-delegate/deps/closest/index.js");
29698
+ require.alias("discore-closest/index.js", "component-delegate/deps/closest/index.js");
29699
+ require.alias("component-matches-selector/index.js", "discore-closest/deps/matches-selector/index.js");
29700
+ require.alias("component-query/index.js", "component-matches-selector/deps/query/index.js");
29701
+
29702
+ require.alias("discore-closest/index.js", "discore-closest/index.js");
29703
+
29704
+ require.alias("component-event/index.js", "component-delegate/deps/event/index.js");
29705
+
29706
+ require.alias("component-indexof/index.js", "component-dom/deps/indexof/index.js");
29707
+
29708
+ require.alias("component-domify/index.js", "component-dom/deps/domify/index.js");
29709
+
29710
+ require.alias("component-classes/index.js", "component-dom/deps/classes/index.js");
29711
+ require.alias("component-indexof/index.js", "component-classes/deps/indexof/index.js");
29712
+
29713
+ require.alias("component-css/index.js", "component-dom/deps/css/index.js");
29714
+
29715
+ require.alias("component-sort/index.js", "component-dom/deps/sort/index.js");
29716
+
29717
+ require.alias("component-value/index.js", "component-dom/deps/value/index.js");
29718
+ require.alias("component-value/index.js", "component-dom/deps/value/index.js");
29719
+ require.alias("component-type/index.js", "component-value/deps/type/index.js");
29720
+
29721
+ require.alias("component-value/index.js", "component-value/index.js");
29722
+
29723
+ require.alias("component-query/index.js", "component-dom/deps/query/index.js");
29724
+