ende 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/build/build.css +112 -0
- data/build/build.js +36465 -0
- data/component.json +11 -15
- data/components/chaijs/assertion-error/1.0.0/component.json +18 -0
- data/components/chaijs/chai/1.9.1/.gitignore +22 -0
- data/components/chaijs/chai/1.9.1/.mailmap +1 -0
- data/components/chaijs/chai/1.9.1/.npmignore +14 -0
- data/components/chaijs/chai/1.9.1/.travis.yml +14 -0
- data/components/chaijs/chai/1.9.1/CONTRIBUTING.md +173 -0
- data/components/chaijs/chai/1.9.1/History.md +895 -0
- data/components/chaijs/chai/1.9.1/Makefile +93 -0
- data/components/chaijs/chai/1.9.1/README.md +99 -0
- data/components/chaijs/chai/1.9.1/ReleaseNotes.md +482 -0
- data/components/chaijs/chai/1.9.1/bower.json +27 -0
- data/components/chaijs/chai/1.9.1/chai.js +4782 -0
- data/components/chaijs/chai/1.9.1/component.json +50 -0
- data/components/chaijs/chai/1.9.1/karma.conf.js +28 -0
- data/components/chaijs/chai/1.9.1/karma.sauce.js +41 -0
- data/components/chaijs/chai/1.9.1/lib/chai/assertion.js +130 -0
- data/components/chaijs/chai/1.9.1/lib/chai/config.js +50 -0
- data/components/chaijs/chai/1.9.1/lib/chai/core/assertions.js +1314 -0
- data/components/chaijs/chai/1.9.1/lib/chai/interface/assert.js +1056 -0
- data/components/chaijs/chai/1.9.1/lib/chai/interface/expect.js +12 -0
- data/components/chaijs/chai/1.9.1/lib/chai/interface/should.js +78 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addChainableMethod.js +111 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addMethod.js +43 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/addProperty.js +40 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/flag.js +32 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getActual.js +18 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getEnumerableProperties.js +25 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getMessage.js +49 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getName.js +20 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getPathValue.js +102 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/getProperties.js +35 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/index.js +114 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/objDisplay.js +49 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteChainableMethod.js +53 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteMethod.js +51 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/overwriteProperty.js +54 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/test.js +26 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/transferFlags.js +44 -0
- data/components/chaijs/chai/1.9.1/lib/chai/utils/type.js +45 -0
- data/components/chaijs/chai/1.9.1/lib/chai.js +87 -0
- data/components/chaijs/chai/1.9.1/package.json +42 -0
- data/components/chaijs/chai/1.9.1/sauce.browsers.js +128 -0
- data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_block.sh +7 -0
- data/components/chaijs/chai/1.9.1/support/sauce/sauce_connect_setup.sh +53 -0
- data/components/chaijs/chai/1.9.1/test/assert.js +638 -0
- data/components/chaijs/chai/1.9.1/test/bootstrap/index.js +22 -0
- data/components/chaijs/chai/1.9.1/test/bootstrap/karma.js +22 -0
- data/components/chaijs/chai/1.9.1/test/configuration.js +133 -0
- data/components/chaijs/chai/1.9.1/test/display/errors.js +14 -0
- data/components/chaijs/chai/1.9.1/test/display/message.js +47 -0
- data/components/chaijs/chai/1.9.1/test/expect.js +814 -0
- data/components/chaijs/chai/1.9.1/test/globalShould.js +15 -0
- data/components/chaijs/chai/1.9.1/test/plugins.js +24 -0
- data/components/chaijs/chai/1.9.1/test/should.js +744 -0
- data/components/chaijs/chai/1.9.1/test/utilities.js +309 -0
- data/components/chaijs/deep-eql/0.1.3/component.json +20 -0
- data/components/chaijs/deep-eql/0.1.3/lib/eql.js +257 -0
- data/components/chaijs/type-detect/0.1.1/component.json +18 -0
- data/components/chaijs/type-detect/0.1.1/lib/type.js +142 -0
- data/{vendor/components/indefinido-indemma/components/component-bind → components/component/bind/0.0.1}/component.json +1 -1
- data/{vendor/components/component-classes → components/component/classes/1.1.2}/component.json +1 -1
- data/components/component/classes/1.2.1/component.json +19 -0
- data/components/component/classes/1.2.1/index.js +184 -0
- data/{vendor/components/component-css → components/component/css/0.0.2}/component.json +2 -2
- data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/component.json +2 -2
- data/components/component/dialog/0.2.0/component.json +35 -0
- data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/index.js +74 -40
- data/components/component/dialog/0.2.0/template.html +9 -0
- data/{vendor/components/component-dom → components/component/dom/0.7.1}/component.json +6 -4
- data/{vendor/components/component-domify → components/component/domify/1.0.0}/component.json +6 -4
- data/components/component/domify/1.2.2/component.json +22 -0
- data/components/component/domify/1.2.2/index.js +87 -0
- data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/component.json +1 -1
- data/{vendor/components/component-event → components/component/event/0.1.0}/component.json +3 -3
- data/components/component/event/0.1.0/index.js +40 -0
- data/components/component/event/0.1.3/component.json +13 -0
- data/{vendor/components/component-event → components/component/event/0.1.3}/index.js +3 -5
- data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/component.json +1 -1
- data/{vendor/components/indefinido-indemma/components/component-jquery → components/component/jquery/1.9.1}/component.json +1 -1
- data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/component.json +6 -4
- data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/component.json +1 -1
- data/{vendor/components/component-query → components/component/query/0.0.1}/component.json +6 -4
- data/components/component/query/0.0.3/component.json +23 -0
- data/components/component/query/0.0.3/index.js +21 -0
- data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/component.json +4 -3
- data/{vendor/components/component-querystring → components/component/querystring/1.3.0}/index.js +26 -2
- data/{vendor/components/component-sort → components/component/sort/0.0.3}/component.json +2 -2
- data/{vendor/components/component-trim → components/component/trim/0.0.1}/component.json +1 -1
- data/{vendor/components/indefinido-indemma/components/component-type → components/component/type/1.0.0}/component.json +4 -2
- data/{vendor/components/component-value → components/component/value/1.1.0}/component.json +6 -4
- data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/component.json +2 -3
- data/{vendor/components/indefinido-indemma/components/indefinido-advisable → components/indefinido/advisable/master}/component.json +2 -2
- data/components/indefinido/indemma/master/History.md +0 -0
- data/components/indefinido/indemma/master/build/build.js +26288 -0
- data/components/indefinido/indemma/master/build/development.js +22200 -0
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/build/release.js +264 -273
- data/components/indefinido/indemma/master/build/test.js +22200 -0
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/component.json +6 -6
- data/components/indefinido/indemma/master/components/chaijs-assertion-error/index.js +110 -0
- data/components/indefinido/indemma/master/components/chaijs-chai/index.js +1 -0
- data/components/indefinido/indemma/master/components/chaijs-chai/lib/chai/utils/inspect.js +320 -0
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/associable.js +2 -14
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/rest.js +2 -7
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/restfulable.js +9 -33
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/scopable.js +45 -16
- data/components/indefinido/indemma/master/lib/record/validatable.js +1100 -0
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/associable_spec.js +2 -3
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/scopable_spec.js +53 -83
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/cpf_spec.js +6 -5
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/associable.coffee +0 -6
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/persistable.coffee +0 -2
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/queryable.coffee +2 -1
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/resource.coffee +2 -3
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/rest.coffee +1 -7
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/restfulable.coffee +8 -34
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/scopable.coffee +31 -32
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validatable.coffee +1 -12
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/associable_spec.coffee +2 -3
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/scopable_spec.coffee +43 -76
- data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/cpf_spec.coffee +4 -3
- data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/component.json +2 -2
- data/{vendor/components/paulmillr-es6-shim → components/paulmillr/es6-shim/0.10.1}/component.json +11 -4
- data/components/paulmillr/es6-shim/0.10.1/es6-shim.js +1833 -0
- data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/component.json +3 -3
- data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/component.json +3 -3
- data/lib/assets/javascripts/aura/extensions/models.js.coffee.erb +14 -14
- data/lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee +1 -1
- data/lib/assets/javascripts/aura/extensions/rivets.js.coffee +3 -3
- data/lib/assets/javascripts/aura/extensions/stamps/stampit.js +568 -242
- data/lib/assets/javascripts/aura/extensions/widget/#composable.js.coffee# +135 -0
- data/lib/assets/javascripts/aura/extensions/widget/composable.js.coffee +2 -2
- data/lib/assets/javascripts/config/load_components.js.coffee +10 -10
- data/lib/assets/javascripts/ende.js.coffee +21 -18
- data/lib/assets/javascripts/widgets/support/adapters/olark.js +1 -4
- data/lib/assets/javascripts/widgets/viewer/main.js.coffee +8 -4
- data/lib/assets/javascripts/widgets/viewer/plugins/scopable.js.coffee +6 -7
- data/lib/ende/version.rb +1 -1
- data/vendor/assets/components/build.css +4 -3
- data/vendor/assets/components/ende_build.js +29772 -21943
- metadata +284 -217
- data/vendor/components/KapIT-observe-utils/component.json +0 -16
- data/vendor/components/KapIT-observe-utils/lib/observe-utils.js +0 -780
- data/vendor/components/component-dialog/component.json +0 -23
- data/vendor/components/component-dialog/template.js +0 -1
- data/vendor/components/indefinido-indemma/build/development.js +0 -343
- data/vendor/components/indefinido-indemma/build/test.js +0 -343
- data/vendor/components/indefinido-indemma/lib/record/validatable.js +0 -224
- data/vendor/components/indefinido-observable/component.json +0 -24
- data/vendor/components/indefinido-observable/index.js +0 -1
- data/vendor/components/indefinido-observable/lib/adapters/rivets.js +0 -28
- data/vendor/components/indefinido-observable/lib/observable.js +0 -390
- data/vendor/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -92
- data/vendor/components/indefinido-observable/vendor/shims/accessors.js +0 -248
- data/vendor/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -8
- data/vendor/components/indefinido-observable/vendor/shims/object.create.js +0 -77
- data/vendor/components/paulmillr-es6-shim/es6-shim.js +0 -996
- /data/{vendor/components/indefinido-indemma/components/chaijs-assertion-error → components/chaijs/assertion-error/1.0.0}/index.js +0 -0
- /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/index.js +0 -0
- /data/{vendor/components/indefinido-indemma/components/chaijs-chai → components/chaijs/chai/1.9.1}/lib/chai/utils/inspect.js +0 -0
- /data/{vendor/components/indefinido-indemma/History.md → components/chaijs/chai/1.9.1/test/auth/.gitkeep} +0 -0
- /data/{vendor/components/component-bind → components/component/bind/0.0.1}/index.js +0 -0
- /data/{vendor/components/component-classes → components/component/classes/1.1.2}/index.js +0 -0
- /data/{vendor/components/component-css → components/component/css/0.0.2}/index.js +0 -0
- /data/{vendor/components/component-delegate → components/component/delegate/0.1.0}/index.js +0 -0
- /data/{vendor/components/component-dialog → components/component/dialog/0.2.0}/dialog.css +0 -0
- /data/{vendor/components/component-dom → components/component/dom/0.7.1}/index.js +0 -0
- /data/{vendor/components/component-domify → components/component/domify/1.0.0}/index.js +0 -0
- /data/{vendor/components/component-emitter → components/component/emitter/1.0.0}/index.js +0 -0
- /data/{vendor/components/component-indexof → components/component/indexof/0.0.1}/index.js +0 -0
- /data/{vendor/components/component-jquery → components/component/jquery/1.9.1}/index.js +0 -0
- /data/{vendor/components/component-matches-selector → components/component/matches-selector/0.1.2}/index.js +0 -0
- /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/index.js +0 -0
- /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/overlay.css +0 -0
- /data/{vendor/components/component-overlay → components/component/overlay/0.1.1}/template.js +0 -0
- /data/{vendor/components/component-query → components/component/query/0.0.1}/index.js +0 -0
- /data/{vendor/components/component-sort → components/component/sort/0.0.3}/index.js +0 -0
- /data/{vendor/components/component-trim → components/component/trim/0.0.1}/index.js +0 -0
- /data/{vendor/components/component-type → components/component/type/1.0.0}/index.js +0 -0
- /data/{vendor/components/component-value → components/component/value/1.1.0}/index.js +0 -0
- /data/{vendor/components/components-modernizr → components/components/modernizr/2.6.2}/modernizr.js +0 -0
- /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/index.js +0 -0
- /data/{vendor/components/indefinido-advisable → components/indefinido/advisable/master}/lib/advisable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.gitignore +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-gemset +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/.ruby-version +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Gemfile +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Guardfile +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/Readme.md +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-assertion-error/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/assertion.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/core/assertions.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/assert.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/expect.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/interface/should.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addChainableMethod.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addMethod.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/addProperty.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/eql.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/flag.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getActual.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getEnumerableProperties.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getMessage.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getName.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getPathValue.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/getProperties.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/index.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/objDisplay.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteMethod.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/overwriteProperty.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/test.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/transferFlags.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai/utils/type.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/chaijs-chai/lib/chai.js +0 -0
- /data/{vendor → components/indefinido/indemma/master}/components/component-bind/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-bind/index.js +0 -0
- /data/{vendor → components/indefinido/indemma/master}/components/component-jquery/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-jquery/index.js +0 -0
- /data/{vendor → components/indefinido/indemma/master}/components/component-type/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/component-type/index.js +0 -0
- /data/{vendor → components/indefinido/indemma/master}/components/indefinido-advisable/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/index.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-advisable/lib/advisable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/components/cjohansen-sinon/sinon.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/index.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/adapters/rivets.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/lib/observable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors-legacy.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/accessors.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/array.indexOf.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/indefinido-observable/vendor/shims/object.create.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/kapit-observe-utils/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/paulmillr-es6-shim/es6-shim.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/component.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/components/pluma-assimilate/dist/assimilate.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/index.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/karma.conf.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/extensions/rivets.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/errors.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/maid.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/persistable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/queryable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/resource.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/storable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/translationable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/associated.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/confirmation.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/cpf.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/presence.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/remote.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/type.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record/validations/validatorable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/lib/record.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/package.json +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/persistable_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/queryable_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/resource_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/rest_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/restfulable_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/storable_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/translationable.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validatable_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/associated_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/confirmation_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/presence_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/remote_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record/validations/type_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/record_spec.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/spec_helper.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/spec/support/value_objects/phone.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/extensions/rivets.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/errors.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/maid.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/storable.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/translationable.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/associated.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/confirmation.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/cpf.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/presence.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/remote.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/type.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record/validations/validatorable.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/lib/record.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/persistable_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/queryable_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/resource_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/rest_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/restfulable_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/storable_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/translationable.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validatable_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/associated_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/confirmation_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/presence_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/remote_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record/validations/type_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/record_spec.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/spec_helper.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/src/spec/support/value_objects/phone.coffee +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/object/mixin.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/owl/pluralize.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/sinon.js +0 -0
- /data/{vendor/components/indefinido-indemma → components/indefinido/indemma/master}/vendor/stampit.js +0 -0
- /data/{vendor/components/mikeric-rivets → components/mikeric/rivets/v0.5.12}/dist/rivets.js +0 -0
- /data/{vendor/components/pluma-assimilate → components/pluma/assimilate/0.3.0}/dist/assimilate.js +0 -0
- /data/{vendor/components/segmentio-extend → components/segmentio/extend/1.0.0}/index.js +0 -0
@@ -0,0 +1,142 @@
|
|
1
|
+
/*!
|
2
|
+
* type-detect
|
3
|
+
* Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
|
4
|
+
* MIT Licensed
|
5
|
+
*/
|
6
|
+
|
7
|
+
/*!
|
8
|
+
* Primary Exports
|
9
|
+
*/
|
10
|
+
|
11
|
+
var exports = module.exports = getType;
|
12
|
+
|
13
|
+
/*!
|
14
|
+
* Detectable javascript natives
|
15
|
+
*/
|
16
|
+
|
17
|
+
var natives = {
|
18
|
+
'[object Array]': 'array'
|
19
|
+
, '[object RegExp]': 'regexp'
|
20
|
+
, '[object Function]': 'function'
|
21
|
+
, '[object Arguments]': 'arguments'
|
22
|
+
, '[object Date]': 'date'
|
23
|
+
};
|
24
|
+
|
25
|
+
/**
|
26
|
+
* ### typeOf (obj)
|
27
|
+
*
|
28
|
+
* Use several different techniques to determine
|
29
|
+
* the type of object being tested.
|
30
|
+
*
|
31
|
+
*
|
32
|
+
* @param {Mixed} object
|
33
|
+
* @return {String} object type
|
34
|
+
* @api public
|
35
|
+
*/
|
36
|
+
|
37
|
+
function getType (obj) {
|
38
|
+
var str = Object.prototype.toString.call(obj);
|
39
|
+
if (natives[str]) return natives[str];
|
40
|
+
if (obj === null) return 'null';
|
41
|
+
if (obj === undefined) return 'undefined';
|
42
|
+
if (obj === Object(obj)) return 'object';
|
43
|
+
return typeof obj;
|
44
|
+
}
|
45
|
+
|
46
|
+
exports.Library = Library;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* ### Library
|
50
|
+
*
|
51
|
+
* Create a repository for custom type detection.
|
52
|
+
*
|
53
|
+
* ```js
|
54
|
+
* var lib = new type.Library;
|
55
|
+
* ```
|
56
|
+
*
|
57
|
+
*/
|
58
|
+
|
59
|
+
function Library () {
|
60
|
+
this.tests = {};
|
61
|
+
}
|
62
|
+
|
63
|
+
/**
|
64
|
+
* #### .of (obj)
|
65
|
+
*
|
66
|
+
* Expose replacement `typeof` detection to the library.
|
67
|
+
*
|
68
|
+
* ```js
|
69
|
+
* if ('string' === lib.of('hello world')) {
|
70
|
+
* // ...
|
71
|
+
* }
|
72
|
+
* ```
|
73
|
+
*
|
74
|
+
* @param {Mixed} object to test
|
75
|
+
* @return {String} type
|
76
|
+
*/
|
77
|
+
|
78
|
+
Library.prototype.of = getType;
|
79
|
+
|
80
|
+
/**
|
81
|
+
* #### .define (type, test)
|
82
|
+
*
|
83
|
+
* Add a test to for the `.test()` assertion.
|
84
|
+
*
|
85
|
+
* Can be defined as a regular expression:
|
86
|
+
*
|
87
|
+
* ```js
|
88
|
+
* lib.define('int', /^[0-9]+$/);
|
89
|
+
* ```
|
90
|
+
*
|
91
|
+
* ... or as a function:
|
92
|
+
*
|
93
|
+
* ```js
|
94
|
+
* lib.define('bln', function (obj) {
|
95
|
+
* if ('boolean' === lib.of(obj)) return true;
|
96
|
+
* var blns = [ 'yes', 'no', 'true', 'false', 1, 0 ];
|
97
|
+
* if ('string' === lib.of(obj)) obj = obj.toLowerCase();
|
98
|
+
* return !! ~blns.indexOf(obj);
|
99
|
+
* });
|
100
|
+
* ```
|
101
|
+
*
|
102
|
+
* @param {String} type
|
103
|
+
* @param {RegExp|Function} test
|
104
|
+
* @api public
|
105
|
+
*/
|
106
|
+
|
107
|
+
Library.prototype.define = function (type, test) {
|
108
|
+
if (arguments.length === 1) return this.tests[type];
|
109
|
+
this.tests[type] = test;
|
110
|
+
return this;
|
111
|
+
};
|
112
|
+
|
113
|
+
/**
|
114
|
+
* #### .test (obj, test)
|
115
|
+
*
|
116
|
+
* Assert that an object is of type. Will first
|
117
|
+
* check natives, and if that does not pass it will
|
118
|
+
* use the user defined custom tests.
|
119
|
+
*
|
120
|
+
* ```js
|
121
|
+
* assert(lib.test('1', 'int'));
|
122
|
+
* assert(lib.test('yes', 'bln'));
|
123
|
+
* ```
|
124
|
+
*
|
125
|
+
* @param {Mixed} object
|
126
|
+
* @param {String} type
|
127
|
+
* @return {Boolean} result
|
128
|
+
* @api public
|
129
|
+
*/
|
130
|
+
|
131
|
+
Library.prototype.test = function (obj, type) {
|
132
|
+
if (type === getType(obj)) return true;
|
133
|
+
var test = this.tests[type];
|
134
|
+
|
135
|
+
if (test && 'regexp' === getType(test)) {
|
136
|
+
return test.test(obj);
|
137
|
+
} else if (test && 'function' === getType(test)) {
|
138
|
+
return test(obj);
|
139
|
+
} else {
|
140
|
+
throw new ReferenceError('Type test "' + type + '" not defined or invalid.');
|
141
|
+
}
|
142
|
+
};
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"name": "classes",
|
3
|
+
"version": "1.2.1",
|
4
|
+
"description": "Cross-browser element class list",
|
5
|
+
"keywords": [
|
6
|
+
"dom",
|
7
|
+
"html",
|
8
|
+
"classList",
|
9
|
+
"class",
|
10
|
+
"ui"
|
11
|
+
],
|
12
|
+
"scripts": [
|
13
|
+
"index.js"
|
14
|
+
],
|
15
|
+
"dependencies": {
|
16
|
+
"component/indexof": "*"
|
17
|
+
},
|
18
|
+
"repository": "component/classes"
|
19
|
+
}
|
@@ -0,0 +1,184 @@
|
|
1
|
+
/**
|
2
|
+
* Module dependencies.
|
3
|
+
*/
|
4
|
+
|
5
|
+
var index = require('indexof');
|
6
|
+
|
7
|
+
/**
|
8
|
+
* Whitespace regexp.
|
9
|
+
*/
|
10
|
+
|
11
|
+
var re = /\s+/;
|
12
|
+
|
13
|
+
/**
|
14
|
+
* toString reference.
|
15
|
+
*/
|
16
|
+
|
17
|
+
var toString = Object.prototype.toString;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Wrap `el` in a `ClassList`.
|
21
|
+
*
|
22
|
+
* @param {Element} el
|
23
|
+
* @return {ClassList}
|
24
|
+
* @api public
|
25
|
+
*/
|
26
|
+
|
27
|
+
module.exports = function(el){
|
28
|
+
return new ClassList(el);
|
29
|
+
};
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Initialize a new ClassList for `el`.
|
33
|
+
*
|
34
|
+
* @param {Element} el
|
35
|
+
* @api private
|
36
|
+
*/
|
37
|
+
|
38
|
+
function ClassList(el) {
|
39
|
+
if (!el) throw new Error('A DOM element reference is required');
|
40
|
+
this.el = el;
|
41
|
+
this.list = el.classList;
|
42
|
+
}
|
43
|
+
|
44
|
+
/**
|
45
|
+
* Add class `name` if not already present.
|
46
|
+
*
|
47
|
+
* @param {String} name
|
48
|
+
* @return {ClassList}
|
49
|
+
* @api public
|
50
|
+
*/
|
51
|
+
|
52
|
+
ClassList.prototype.add = function(name){
|
53
|
+
// classList
|
54
|
+
if (this.list) {
|
55
|
+
this.list.add(name);
|
56
|
+
return this;
|
57
|
+
}
|
58
|
+
|
59
|
+
// fallback
|
60
|
+
var arr = this.array();
|
61
|
+
var i = index(arr, name);
|
62
|
+
if (!~i) arr.push(name);
|
63
|
+
this.el.className = arr.join(' ');
|
64
|
+
return this;
|
65
|
+
};
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Remove class `name` when present, or
|
69
|
+
* pass a regular expression to remove
|
70
|
+
* any which match.
|
71
|
+
*
|
72
|
+
* @param {String|RegExp} name
|
73
|
+
* @return {ClassList}
|
74
|
+
* @api public
|
75
|
+
*/
|
76
|
+
|
77
|
+
ClassList.prototype.remove = function(name){
|
78
|
+
if ('[object RegExp]' == toString.call(name)) {
|
79
|
+
return this.removeMatching(name);
|
80
|
+
}
|
81
|
+
|
82
|
+
// classList
|
83
|
+
if (this.list) {
|
84
|
+
this.list.remove(name);
|
85
|
+
return this;
|
86
|
+
}
|
87
|
+
|
88
|
+
// fallback
|
89
|
+
var arr = this.array();
|
90
|
+
var i = index(arr, name);
|
91
|
+
if (~i) arr.splice(i, 1);
|
92
|
+
this.el.className = arr.join(' ');
|
93
|
+
return this;
|
94
|
+
};
|
95
|
+
|
96
|
+
/**
|
97
|
+
* Remove all classes matching `re`.
|
98
|
+
*
|
99
|
+
* @param {RegExp} re
|
100
|
+
* @return {ClassList}
|
101
|
+
* @api private
|
102
|
+
*/
|
103
|
+
|
104
|
+
ClassList.prototype.removeMatching = function(re){
|
105
|
+
var arr = this.array();
|
106
|
+
for (var i = 0; i < arr.length; i++) {
|
107
|
+
if (re.test(arr[i])) {
|
108
|
+
this.remove(arr[i]);
|
109
|
+
}
|
110
|
+
}
|
111
|
+
return this;
|
112
|
+
};
|
113
|
+
|
114
|
+
/**
|
115
|
+
* Toggle class `name`, can force state via `force`.
|
116
|
+
*
|
117
|
+
* For browsers that support classList, but do not support `force` yet,
|
118
|
+
* the mistake will be detected and corrected.
|
119
|
+
*
|
120
|
+
* @param {String} name
|
121
|
+
* @param {Boolean} force
|
122
|
+
* @return {ClassList}
|
123
|
+
* @api public
|
124
|
+
*/
|
125
|
+
|
126
|
+
ClassList.prototype.toggle = function(name, force){
|
127
|
+
// classList
|
128
|
+
if (this.list) {
|
129
|
+
if ("undefined" !== typeof force) {
|
130
|
+
if (force !== this.list.toggle(name, force)) {
|
131
|
+
this.list.toggle(name); // toggle again to correct
|
132
|
+
}
|
133
|
+
} else {
|
134
|
+
this.list.toggle(name);
|
135
|
+
}
|
136
|
+
return this;
|
137
|
+
}
|
138
|
+
|
139
|
+
// fallback
|
140
|
+
if ("undefined" !== typeof force) {
|
141
|
+
if (!force) {
|
142
|
+
this.remove(name);
|
143
|
+
} else {
|
144
|
+
this.add(name);
|
145
|
+
}
|
146
|
+
} else {
|
147
|
+
if (this.has(name)) {
|
148
|
+
this.remove(name);
|
149
|
+
} else {
|
150
|
+
this.add(name);
|
151
|
+
}
|
152
|
+
}
|
153
|
+
|
154
|
+
return this;
|
155
|
+
};
|
156
|
+
|
157
|
+
/**
|
158
|
+
* Return an array of classes.
|
159
|
+
*
|
160
|
+
* @return {Array}
|
161
|
+
* @api public
|
162
|
+
*/
|
163
|
+
|
164
|
+
ClassList.prototype.array = function(){
|
165
|
+
var str = this.el.className.replace(/^\s+|\s+$/g, '');
|
166
|
+
var arr = str.split(re);
|
167
|
+
if ('' === arr[0]) arr.shift();
|
168
|
+
return arr;
|
169
|
+
};
|
170
|
+
|
171
|
+
/**
|
172
|
+
* Check if class `name` is present.
|
173
|
+
*
|
174
|
+
* @param {String} name
|
175
|
+
* @return {ClassList}
|
176
|
+
* @api public
|
177
|
+
*/
|
178
|
+
|
179
|
+
ClassList.prototype.has =
|
180
|
+
ClassList.prototype.contains = function(name){
|
181
|
+
return this.list
|
182
|
+
? this.list.contains(name)
|
183
|
+
: !! ~index(this.array(), name);
|
184
|
+
};
|
@@ -0,0 +1,35 @@
|
|
1
|
+
{
|
2
|
+
"name": "dialog",
|
3
|
+
"description": "Dialog component",
|
4
|
+
"version": "0.2.0",
|
5
|
+
"keywords": [
|
6
|
+
"dialog",
|
7
|
+
"ui",
|
8
|
+
"modal"
|
9
|
+
],
|
10
|
+
"dependencies": {
|
11
|
+
"component/emitter": "1.0.0",
|
12
|
+
"component/overlay": "0.1.1",
|
13
|
+
"component/domify": "*",
|
14
|
+
"component/event": "*",
|
15
|
+
"component/classes": "*",
|
16
|
+
"component/query": "*"
|
17
|
+
},
|
18
|
+
"development": {
|
19
|
+
"dependencies": {
|
20
|
+
"visionmedia/mocha": "*",
|
21
|
+
"dominicbarnes/expect.js": "*"
|
22
|
+
}
|
23
|
+
},
|
24
|
+
"scripts": [
|
25
|
+
"index.js"
|
26
|
+
],
|
27
|
+
"styles": [
|
28
|
+
"dialog.css"
|
29
|
+
],
|
30
|
+
"templates": [
|
31
|
+
"template.html"
|
32
|
+
],
|
33
|
+
"demo": "http://component.github.io/dialog/",
|
34
|
+
"repository": "component/dialog"
|
35
|
+
}
|
@@ -5,7 +5,10 @@
|
|
5
5
|
|
6
6
|
var Emitter = require('emitter')
|
7
7
|
, overlay = require('overlay')
|
8
|
-
,
|
8
|
+
, domify = require('domify')
|
9
|
+
, events = require('event')
|
10
|
+
, classes = require('classes')
|
11
|
+
, query = require('query');
|
9
12
|
|
10
13
|
/**
|
11
14
|
* Active dialog.
|
@@ -26,7 +29,7 @@ exports = module.exports = dialog;
|
|
26
29
|
exports.Dialog = Dialog;
|
27
30
|
|
28
31
|
/**
|
29
|
-
* Return a new `Dialog` with the given
|
32
|
+
* Return a new `Dialog` with the given
|
30
33
|
* (optional) `title` and `msg`.
|
31
34
|
*
|
32
35
|
* @param {String} title or msg
|
@@ -64,8 +67,9 @@ function dialog(title, msg){
|
|
64
67
|
function Dialog(options) {
|
65
68
|
Emitter.call(this);
|
66
69
|
options = options || {};
|
67
|
-
this.template = require('./template');
|
68
|
-
this.el =
|
70
|
+
this.template = require('./template.html');
|
71
|
+
this.el = domify(this.template);
|
72
|
+
this._classes = classes(this.el);
|
69
73
|
this.render(options);
|
70
74
|
if (active && !active.hiding) active.hide();
|
71
75
|
if (exports.effect) this.effect(exports.effect);
|
@@ -87,30 +91,34 @@ Dialog.prototype = new Emitter;
|
|
87
91
|
*/
|
88
92
|
|
89
93
|
Dialog.prototype.render = function(options){
|
90
|
-
var
|
94
|
+
var self = this
|
95
|
+
, el = self.el
|
91
96
|
, title = options.title
|
92
|
-
,
|
93
|
-
,
|
97
|
+
, titleEl = query('.title', el)
|
98
|
+
, pEl = query('p', el)
|
99
|
+
, msg = options.message;
|
94
100
|
|
95
|
-
|
101
|
+
events.bind(query('.close', el), 'click', function (ev) {
|
102
|
+
ev.preventDefault();
|
96
103
|
self.emit('close');
|
97
104
|
self.hide();
|
98
|
-
return false;
|
99
105
|
});
|
100
106
|
|
101
|
-
|
102
|
-
|
107
|
+
if (titleEl) {
|
108
|
+
if (!title) {
|
109
|
+
titleEl.parentNode.removeChild(titleEl);
|
110
|
+
} else {
|
111
|
+
titleEl.textContent = title;
|
112
|
+
}
|
113
|
+
}
|
103
114
|
|
104
115
|
// message
|
105
116
|
if ('string' == typeof msg) {
|
106
|
-
|
117
|
+
pEl.textContent = msg;
|
107
118
|
} else if (msg) {
|
108
|
-
|
119
|
+
pEl.parentNode.insertBefore(msg.el || msg, pEl);
|
120
|
+
pEl.parentNode.removeChild(pEl);
|
109
121
|
}
|
110
|
-
|
111
|
-
setTimeout(function(){
|
112
|
-
el.removeClass('hide');
|
113
|
-
}, 0);
|
114
122
|
};
|
115
123
|
|
116
124
|
/**
|
@@ -121,8 +129,7 @@ Dialog.prototype.render = function(options){
|
|
121
129
|
*/
|
122
130
|
|
123
131
|
Dialog.prototype.closable = function(){
|
124
|
-
this.
|
125
|
-
return this;
|
132
|
+
return this.addClass('closable');
|
126
133
|
};
|
127
134
|
|
128
135
|
/**
|
@@ -134,7 +141,7 @@ Dialog.prototype.closable = function(){
|
|
134
141
|
*/
|
135
142
|
|
136
143
|
Dialog.prototype.addClass = function(name){
|
137
|
-
this.
|
144
|
+
this._classes.add(name);
|
138
145
|
return this;
|
139
146
|
};
|
140
147
|
|
@@ -171,9 +178,10 @@ Dialog.prototype.modal = function(){
|
|
171
178
|
* @api public
|
172
179
|
*/
|
173
180
|
|
174
|
-
Dialog.prototype.overlay = function(){
|
181
|
+
Dialog.prototype.overlay = function(opts){
|
175
182
|
var self = this;
|
176
|
-
|
183
|
+
opts = opts || { closable: true };
|
184
|
+
var o = overlay(opts);
|
177
185
|
o.on('hide', function(){
|
178
186
|
self._overlay = null;
|
179
187
|
self.hide();
|
@@ -185,17 +193,33 @@ Dialog.prototype.overlay = function(){
|
|
185
193
|
/**
|
186
194
|
* Close the dialog when the escape key is pressed.
|
187
195
|
*
|
188
|
-
* @api
|
196
|
+
* @api public
|
189
197
|
*/
|
190
198
|
|
191
199
|
Dialog.prototype.escapable = function(){
|
192
200
|
var self = this;
|
193
|
-
|
194
|
-
|
201
|
+
// Save reference to remove listener later
|
202
|
+
self._escKeyCallback = self._escKeyCallback || function (e) {
|
203
|
+
e.which = e.which || e.keyCode;
|
204
|
+
if (27 !== e.which) return;
|
195
205
|
self.emit('escape');
|
196
|
-
}
|
206
|
+
};
|
207
|
+
events.bind(document, 'keydown', self._escKeyCallback);
|
208
|
+
return this;
|
197
209
|
};
|
198
210
|
|
211
|
+
/**
|
212
|
+
* Fixed dialogs position can be manipulated through CSS.
|
213
|
+
*
|
214
|
+
* @return {Dialog} for chaining
|
215
|
+
* @api public
|
216
|
+
*/
|
217
|
+
|
218
|
+
Dialog.prototype.fixed = function(){
|
219
|
+
this._fixed = true;
|
220
|
+
return this;
|
221
|
+
}
|
222
|
+
|
199
223
|
/**
|
200
224
|
* Show the dialog.
|
201
225
|
*
|
@@ -207,20 +231,25 @@ Dialog.prototype.escapable = function(){
|
|
207
231
|
|
208
232
|
Dialog.prototype.show = function(){
|
209
233
|
var overlay = this._overlay;
|
234
|
+
var self = this;
|
210
235
|
|
211
236
|
// overlay
|
212
237
|
if (overlay) {
|
213
238
|
overlay.show();
|
214
|
-
this.
|
239
|
+
this._classes.add('modal');
|
215
240
|
}
|
216
241
|
|
217
242
|
// escape
|
218
243
|
if (!overlay || overlay.closable) this.escapable();
|
219
244
|
|
220
245
|
// position
|
221
|
-
this.el
|
222
|
-
|
223
|
-
|
246
|
+
document.body.appendChild(this.el);
|
247
|
+
if (!this._fixed) {
|
248
|
+
setTimeout(function() {
|
249
|
+
self.el.style.marginLeft = -(self.el.offsetWidth / 2) + 'px'
|
250
|
+
}, 0);
|
251
|
+
}
|
252
|
+
this._classes.remove('hide');
|
224
253
|
this.emit('show');
|
225
254
|
return this;
|
226
255
|
};
|
@@ -250,22 +279,25 @@ Dialog.prototype.hideOverlay = function(){
|
|
250
279
|
|
251
280
|
Dialog.prototype.hide = function(ms){
|
252
281
|
var self = this;
|
253
|
-
o(document).unbind('keydown.dialog');
|
254
282
|
|
255
|
-
|
256
|
-
|
283
|
+
if (self._escKeyCallback) {
|
284
|
+
events.unbind(document, 'keydown', self._escKeyCallback);
|
285
|
+
}
|
286
|
+
|
287
|
+
// prevent thrashing - this isn't used
|
288
|
+
self.hiding = true;
|
257
289
|
|
258
290
|
// duration
|
259
291
|
if (ms) {
|
260
292
|
setTimeout(function(){
|
261
293
|
self.hide();
|
262
294
|
}, ms);
|
263
|
-
return
|
295
|
+
return self;
|
264
296
|
}
|
265
297
|
|
266
298
|
// hide / remove
|
267
|
-
|
268
|
-
if (
|
299
|
+
self._classes.add('hide');
|
300
|
+
if (self._effect) {
|
269
301
|
setTimeout(function(){
|
270
302
|
self.remove();
|
271
303
|
}, 500);
|
@@ -274,9 +306,9 @@ Dialog.prototype.hide = function(ms){
|
|
274
306
|
}
|
275
307
|
|
276
308
|
// overlay
|
277
|
-
|
309
|
+
self.hideOverlay();
|
278
310
|
|
279
|
-
return
|
311
|
+
return self;
|
280
312
|
};
|
281
313
|
/**
|
282
314
|
* Hide the dialog without potential animation.
|
@@ -286,7 +318,9 @@ Dialog.prototype.hide = function(ms){
|
|
286
318
|
*/
|
287
319
|
|
288
320
|
Dialog.prototype.remove = function(){
|
289
|
-
this.
|
290
|
-
|
321
|
+
if (this.el.parentNode) {
|
322
|
+
this.emit('hide');
|
323
|
+
this.el.parentNode.removeChild(this.el);
|
324
|
+
}
|
291
325
|
return this;
|
292
326
|
};
|
@@ -24,10 +24,12 @@
|
|
24
24
|
"component/query": "0.0.1"
|
25
25
|
},
|
26
26
|
"development": {
|
27
|
-
"
|
28
|
-
|
29
|
-
|
27
|
+
"dependencies": {
|
28
|
+
"component/assert": "*",
|
29
|
+
"component/enumerable": "*",
|
30
|
+
"visionmedia/mocha-matrix": "*"
|
31
|
+
}
|
30
32
|
},
|
31
33
|
"license": "MIT",
|
32
|
-
"
|
34
|
+
"repository": "component/dom"
|
33
35
|
}
|