gina 0.0.9-p91c → 0.1.1-alpha.3
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.
- package/INSTALL.md +46 -0
- package/{core/asset/html/static.html → Icon/r} +0 -0
- package/LICENSE +1 -1
- package/README-4Contributors.md +96 -0
- package/README.md +296 -104
- package/bin/cli +287 -0
- package/bin/cli-debug +60 -0
- package/bin/cmd +184 -0
- package/bin/gina +180 -0
- package/config/logger.json +17 -0
- package/doc/framework/cli/doc.json +9 -0
- package/doc/framework/index.md +60 -0
- package/framework/v0.1.1-alpha.3/AUTHORS +7 -0
- package/{core/utils/lib/inherits → framework/v0.1.1-alpha.3}/LICENSE +1 -1
- package/framework/v0.1.1-alpha.3/VERSION +1 -0
- package/{core/locales/dist/language/en.json → framework/v0.1.1-alpha.3/core/asset/html/nolayout.html} +0 -0
- package/{core/locales/dist/language/fr.json → framework/v0.1.1-alpha.3/core/asset/html/static.html} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-192x192.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/android-chrome-512x512.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/apple-touch-icon.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-16x16.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon-32x32.png +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/asset/img/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js +20904 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.css.map +1 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js +736 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.min.js.map +56 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js +5 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/dist/gina.onload.min.js.map +8 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/readme.md +192 -0
- package/framework/v0.1.1-alpha.3/core/asset/js/plugin/uuid.json +23 -0
- package/framework/v0.1.1-alpha.3/core/config.js +2308 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/index.js +757 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.js +20 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v2.js +429 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/connector.v3.js +432 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/n1ql.js +14 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.js +21 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v2.js +258 -0
- package/framework/v0.1.1-alpha.3/core/connectors/couchbase/lib/session-store.v3.js +341 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/controller.framework.js +3 -2
- package/framework/v0.1.1-alpha.3/core/controller/controller.js +3990 -0
- package/{core → framework/v0.1.1-alpha.3/core}/controller/index.js +5 -5
- package/framework/v0.1.1-alpha.3/core/deps/busboy/.travis.yml +17 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/LICENSE +19 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/README.md +225 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding-indexes.js +73 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/deps/encoding/encoding.js +2391 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/main.js +89 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/multipart.js +328 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/types/urlencoded.js +214 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/lib/utils.js +191 -0
- package/framework/v0.1.1-alpha.3/core/deps/busboy/package.json +69 -0
- package/framework/v0.1.1-alpha.3/core/deps/swig-client/swig-2.0.0.min.js +5 -0
- package/{core → framework/v0.1.1-alpha.3/core}/dev/index.js +5 -5
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/class.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/factory.js +1 -1
- package/{core → framework/v0.1.1-alpha.3/core}/dev/lib/tools.js +0 -0
- package/framework/v0.1.1-alpha.3/core/gna.js +1070 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/README.md +41 -2
- package/{core → framework/v0.1.1-alpha.3/core}/locales/currency.json +0 -0
- package/{core/plugins/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/en.json} +0 -0
- package/{core/plugins/lib/intl/README.md → framework/v0.1.1-alpha.3/core/locales/dist/language/fr.json} +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/dist/region/en.json +0 -0
- package/framework/v0.1.1-alpha.3/core/locales/dist/region/fr.json +9492 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/index.js +5 -4
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/make.js +15 -12
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/currency.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.csv +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/locales/src/resources/region.mapping.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/mime.types +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/model/entity.js +156 -196
- package/{core → framework/v0.1.1-alpha.3/core}/model/index.js +67 -48
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/entityFactory.js +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/model/template/index.js +8 -10
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins}/README.md +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/index.js +3 -3
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/file}/README.md +0 -0
- package/{core/plugins/lib/intl → framework/v0.1.1-alpha.3/core/plugins/lib/file}/build.json +0 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/file/package.json +25 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/README.md +0 -0
- package/{core/plugins/lib/storage → framework/v0.1.1-alpha.3/core/plugins/lib/intl}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/package.json +3 -3
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/intl/src/main.js +17 -1
- package/{core/utils/lib/routing → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/README.md +0 -0
- package/{core/plugins/lib/validator → framework/v0.1.1-alpha.3/core/plugins/lib/storage}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/package.json +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/storage/src/main.js +91 -85
- package/{core/utils/lib/url → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/README.md +0 -0
- package/{core/utils/lib/collection → framework/v0.1.1-alpha.3/core/plugins/lib/validator}/build.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/plugins/lib/validator/package.json +3 -3
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/form-validator.js +1762 -0
- package/framework/v0.1.1-alpha.3/core/plugins/lib/validator/src/main.js +6917 -0
- package/framework/v0.1.1-alpha.3/core/router.js +664 -0
- package/framework/v0.1.1-alpha.3/core/server.express.js +213 -0
- package/framework/v0.1.1-alpha.3/core/server.isaac.js +386 -0
- package/framework/v0.1.1-alpha.3/core/server.js +3010 -0
- package/{core → framework/v0.1.1-alpha.3/core}/status.codes +8 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/app.json +6 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/routing.json +11 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.json +9 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/settings.server.json +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/config/templates.json +42 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.content.js +39 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/controller.js +30 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle/controllers/setup.js +111 -0
- package/{core/template/samples → framework/v0.1.1-alpha.3/core/template/boilerplate}/bundle/index.js +0 -0
- package/{core/template/samples/bundle → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_namespace}/controllers/controller.js +9 -7
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/default.css +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/css/vendor/readme.md +0 -0
- package/{core/template/views → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public}/favicon.ico +0 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/js/vendor/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_public/readme.md +1 -0
- package/framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/handlers/main.js +24 -0
- package/{core/template/views/html/default.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/homepage.html} +0 -0
- package/{core/template/views/html/layout.html → framework/v0.1.1-alpha.3/core/template/boilerplate/bundle_templates/html/layout/main.html} +2 -2
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.bat.tpl +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/command/gina.tpl +1 -1
- package/framework/v0.1.1-alpha.3/core/template/conf/env.json +76 -0
- package/{core/template/conf/project.json → framework/v0.1.1-alpha.3/core/template/conf/manifest.json} +1 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/conf/package.json +2 -2
- package/framework/v0.1.1-alpha.3/core/template/conf/settings.json +92 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/statics.json +10 -0
- package/framework/v0.1.1-alpha.3/core/template/conf/templates.json +37 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/401.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/403.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/client/json/404.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/html/50x.html +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/500.json +0 -0
- package/{core → framework/v0.1.1-alpha.3/core}/template/error/server/json/503.json +0 -0
- package/{core/utils/lib/routing/build.json → framework/v0.1.1-alpha.3/core/template/extensions/logger/config.json} +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/console.js +3 -3
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/context.js +240 -49
- package/framework/v0.1.1-alpha.3/helpers/dateFormat.js +528 -0
- package/framework/v0.1.1-alpha.3/helpers/index.js +79 -0
- package/framework/v0.1.1-alpha.3/helpers/json/README.md +0 -0
- package/framework/v0.1.1-alpha.3/helpers/json/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/json/src/main.js +97 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/path.js +342 -140
- package/framework/v0.1.1-alpha.3/helpers/plugins/README.md +4 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/package.json +20 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/api-error.js +160 -0
- package/framework/v0.1.1-alpha.3/helpers/plugins/src/main.js +32 -0
- package/framework/v0.1.1-alpha.3/helpers/prototypes.js +218 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/task.js +49 -29
- package/{core/utils → framework/v0.1.1-alpha.3}/helpers/text.js +7 -7
- package/framework/v0.1.1-alpha.3/lib/archiver/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/build.json +0 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/dep/jszip.min.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/archiver/src/main.js +499 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/aliases.json +13 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/add.js +507 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/arguments.json +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/copy.js +15 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/cp.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/help.txt +67 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/list.js +129 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/remove.js +229 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rename.js +4 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/restart.js +235 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/start.js +394 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/bundle/stop.js +232 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/add.js +436 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/get.js +62 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/link-dev.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/list.js +111 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/env/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/dot.js +70 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/get.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.js +39 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/init.js +514 -0
- package/{core/utils/lib/cmd → framework/v0.1.1-alpha.3/lib/cmd/framework}/msg.json +3 -3
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/open.js +50 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/restart.js +124 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/set.js +161 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/start.js +96 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/status.js +72 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/stop.js +159 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/tail.js +183 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/update.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/framework/version.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-dev.1.md +66 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina-framework.1.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/gina.1.md +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/helper.js +1147 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/index.js +170 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/msg.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/help.txt +31 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/inc/scan.js +108 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/list.js +176 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/port/set.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/add.js +528 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/arguments.json +9 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/build.js +115 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/help.txt +76 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/import.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/list.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/move.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/remove.js +144 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rename.js +162 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/restart.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/start.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/status.js +3 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/project/stop.js +0 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.js +27 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/help.txt +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/list.js +239 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/protocol/set.js +631 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.js +28 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/help.txt +33 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/link-local.js +80 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/list.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/remove.js +150 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/rm.js +2 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/set.js +57 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/unset.js +44 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/scope/use.js +79 -0
- package/framework/v0.1.1-alpha.3/lib/cmd/view/add.js +311 -0
- package/framework/v0.1.1-alpha.3/lib/collection/README.md +5 -0
- package/framework/v0.1.1-alpha.3/lib/collection/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/collection/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/collection/src/main.js +1459 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/config.js +49 -34
- package/framework/v0.1.1-alpha.3/lib/cron/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/cron/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/cron/src/main.js +176 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/generator/index.js +8 -4
- package/framework/v0.1.1-alpha.3/lib/index.js +116 -0
- package/framework/v0.1.1-alpha.3/lib/inherits/LICENSE +19 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/inheriting_eventemitter.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/protected_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/simple_inheritance.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/package.json +2 -2
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/inherits/src/main.js +18 -19
- package/framework/v0.1.1-alpha.3/lib/logger/README.md +7 -0
- package/framework/v0.1.1-alpha.3/lib/logger/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/default/index.js +55 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/index.js +251 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/README.md +100 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/file/lib/logrotator/index.js +274 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/index.js +52 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/listener.js +302 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/containers/mq/speaker.js +118 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/helper.js +131 -0
- package/framework/v0.1.1-alpha.3/lib/logger/src/main.js +739 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/math/index.js +58 -35
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/README.md +5 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge.js +1 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_2_literal objects.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/example/merge_and_preserve_first.js +2 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/merge/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/merge/src/main.js +531 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/model.js +42 -19
- package/framework/v0.1.1-alpha.3/lib/proc.js +518 -0
- package/framework/v0.1.1-alpha.3/lib/routing/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/routing/build.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/routing/package.json +2 -2
- package/framework/v0.1.1-alpha.3/lib/routing/src/main.js +1492 -0
- package/framework/v0.1.1-alpha.3/lib/session-store.js +33 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/shell.js +43 -30
- package/framework/v0.1.1-alpha.3/lib/swig-filters/README.md +0 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/package.json +20 -0
- package/framework/v0.1.1-alpha.3/lib/swig-filters/src/main.js +322 -0
- package/framework/v0.1.1-alpha.3/lib/url/README.md +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/index.js +2 -1
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/mocks.json +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/routing.json +9 -9
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/url/test.js +0 -0
- package/{core/utils → framework/v0.1.1-alpha.3}/lib/validator.js +7 -7
- package/framework/v0.1.1-alpha.3/package.json +14 -0
- package/package.json +35 -33
- package/resources/etc/init.d/debian/gina +117 -0
- package/resources/home/framework/env.json +34 -0
- package/resources/home/framework/locals.json +14 -0
- package/resources/home/framework/project.json +48 -0
- package/resources/home/framework/projects.json +6 -0
- package/resources/home/main.json +47 -0
- package/resources/home/settings.json +22 -0
- package/resources/home/user/extensions/logger/default/config.json +77 -0
- package/resources/home/user/extensions/logger/file/config.json +11 -0
- package/resources/img/android-chrome-192x192.png +0 -0
- package/resources/img/android-chrome-512x512.png +0 -0
- package/resources/img/apple-touch-icon.png +0 -0
- package/resources/img/favicon-16x16.png +0 -0
- package/resources/img/favicon-32x32.png +0 -0
- package/resources/img/favicon.ico +0 -0
- package/resources/package.json.template +50 -0
- package/script/lib.js +24 -0
- package/script/post_install.js +449 -157
- package/script/pre_install.js +277 -36
- package/script/prepare_version.js +425 -0
- package/utils/helper.js +438 -0
- package/utils/prototypes.js +239 -0
- package/utils/prototypes.json_clone.js +175 -0
- package/.npmignore +0 -6
- package/MIDDLEWARE +0 -1
- package/SUCCESS +0 -1
- package/VERSION +0 -1
- package/core/asset/html/nolayout.html +0 -1
- package/core/asset/js/plugin/build.dev.json +0 -28
- package/core/asset/js/plugin/build.json +0 -31
- package/core/asset/js/plugin/dist/gina.min.css +0 -1
- package/core/asset/js/plugin/dist/gina.min.css.map +0 -1
- package/core/asset/js/plugin/dist/gina.min.js +0 -13732
- package/core/asset/js/plugin/dist/gina.min.js.map +0 -42
- package/core/asset/js/plugin/dist/gina.onload.min.js +0 -3
- package/core/asset/js/plugin/dist/gina.onload.min.js.map +0 -8
- package/core/asset/js/plugin/readme.md +0 -152
- package/core/asset/js/plugin/src/gina/main.js +0 -132
- package/core/asset/js/plugin/src/gina/popin/css/design.css +0 -23
- package/core/asset/js/plugin/src/gina/popin/css/main.css +0 -1112
- package/core/asset/js/plugin/src/gina/popin/css/popin.css +0 -3
- package/core/asset/js/plugin/src/gina/popin/css/popin.css.map +0 -1
- package/core/asset/js/plugin/src/gina/popin/doc/TOC.md +0 -29
- package/core/asset/js/plugin/src/gina/popin/doc/css.md +0 -162
- package/core/asset/js/plugin/src/gina/popin/doc/extend.md +0 -663
- package/core/asset/js/plugin/src/gina/popin/doc/faq.md +0 -46
- package/core/asset/js/plugin/src/gina/popin/doc/html.md +0 -227
- package/core/asset/js/plugin/src/gina/popin/doc/js.md +0 -37
- package/core/asset/js/plugin/src/gina/popin/doc/misc.md +0 -178
- package/core/asset/js/plugin/src/gina/popin/doc/usage.md +0 -130
- package/core/asset/js/plugin/src/gina/popin/main.js +0 -783
- package/core/asset/js/plugin/src/gina/popin/sass/config.sass +0 -37
- package/core/asset/js/plugin/src/gina/popin/sass/gina-design.sass +0 -622
- package/core/asset/js/plugin/src/gina/popin/sass/gina-popin.sass +0 -54
- package/core/asset/js/plugin/src/gina/popin/sass/helper.scss +0 -73
- package/core/asset/js/plugin/src/gina/toolbar/.npmignore +0 -19
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css +0 -433
- package/core/asset/js/plugin/src/gina/toolbar/css/toolbar.css.map +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/index.html +0 -285
- package/core/asset/js/plugin/src/gina/toolbar/index.kit +0 -120
- package/core/asset/js/plugin/src/gina/toolbar/jquery-3.1.0.min.js +0 -4
- package/core/asset/js/plugin/src/gina/toolbar/main.js +0 -693
- package/core/asset/js/plugin/src/gina/toolbar/mock.gina.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/mock.user.json +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/readme.md +0 -7
- package/core/asset/js/plugin/src/gina/toolbar/sass/toolbar.sass +0 -563
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/Info-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/error-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/info-optim.svg +0 -13
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/logo-gina.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings-big.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.afdesign +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/settings.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-calendar.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-card.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock-optim.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/stripe-lock.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-color.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/svg-src/warning-grey.svg +0 -1
- package/core/asset/js/plugin/src/gina/toolbar/test.jpg +0 -0
- package/core/asset/js/plugin/src/gina/toolbar/toolbar.html +0 -104
- package/core/asset/js/plugin/src/gina/utils/dom.js +0 -24
- package/core/asset/js/plugin/src/gina/utils/events.js +0 -201
- package/core/asset/js/plugin/src/gina/utils/loader.js +0 -57
- package/core/asset/js/plugin/src/main.js +0 -235
- package/core/asset/js/plugin/src/vendor/jquery/1.11.1-css-event_alias.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/1.12.4.min.js +0 -5
- package/core/asset/js/plugin/src/vendor/jquery/2.1.1-css-event_alias-sizzle.min.js +0 -4
- package/core/asset/js/plugin/src/vendor/jquery/README.md +0 -14
- package/core/asset/js/plugin/src/vendor/jquery/slim-3.1.1.min.js +0 -4
- package/core/config.js +0 -1225
- package/core/controller/controller.js +0 -1860
- package/core/gna.js +0 -908
- package/core/plugins/lib/validator/src/form-validator.js +0 -789
- package/core/plugins/lib/validator/src/main.js +0 -2056
- package/core/router.js +0 -717
- package/core/server.js +0 -1363
- package/core/template/conf/env.json +0 -70
- package/core/template/conf/settings.json +0 -48
- package/core/template/conf/statics.json +0 -6
- package/core/template/conf/views.json +0 -16
- package/core/template/samples/bundle/config/app.json +0 -4
- package/core/template/samples/bundle/config/routing.json +0 -9
- package/core/template/samples/bundle/controllers/setup.js +0 -33
- package/core/template/views/js/vendor/readme.md +0 -1
- package/core/template/views/readme.md +0 -1
- package/core/utils/helpers/dateFormat.js +0 -264
- package/core/utils/helpers/index.js +0 -202
- package/core/utils/index.js +0 -75
- package/core/utils/lib/cmd/app.js +0 -686
- package/core/utils/lib/cmd/basic.help.txt +0 -40
- package/core/utils/lib/cmd/basic.js +0 -141
- package/core/utils/lib/cmd/gina-add-bundle.js +0 -328
- package/core/utils/lib/cmd/gina-add-views.js +0 -99
- package/core/utils/lib/cmd/gina-build.js +0 -218
- package/core/utils/lib/cmd/gina-clean.js +0 -26
- package/core/utils/lib/cmd/gina-connect.js +0 -176
- package/core/utils/lib/cmd/gina-delete-bundle.js +0 -176
- package/core/utils/lib/cmd/gina-deploy.js +0 -452
- package/core/utils/lib/cmd/gina-init-project.js +0 -83
- package/core/utils/lib/cmd/gina-start-bundle.js +0 -3
- package/core/utils/lib/cmd/gina-start.js +0 -3
- package/core/utils/lib/cmd/index.js +0 -157
- package/core/utils/lib/cmd/project.js +0 -14
- package/core/utils/lib/collection/src/main.js +0 -650
- package/core/utils/lib/logger/containers/file.js +0 -11
- package/core/utils/lib/logger/index.js +0 -260
- package/core/utils/lib/merge/src/main.js +0 -344
- package/core/utils/lib/proc.js +0 -416
- package/core/utils/lib/routing/src/main.js +0 -165
- package/documentation/css/default.css +0 -3
- package/documentation/html/home.html +0 -6
- package/documentation/html/inc/_footer.html +0 -5
- package/documentation/html/layout.html +0 -21
- package/documentation/img/debug-conf1.png +0 -0
- package/documentation/img/debug-conf2.png +0 -0
- package/documentation/img/debug-conf3.png +0 -0
- package/documentation/img/debug-conf4.png +0 -0
- package/documentation/img/debug-conf5.png +0 -0
- package/documentation/img/debug-conf6.png +0 -0
- package/documentation/img/debug-conf7.png +0 -0
- package/documentation/img/debug-new1.png +0 -0
- package/documentation/img/debug-new2.png +0 -0
- package/documentation/img/debug-start.png +0 -0
- package/documentation/md/api/controller/main.md +0 -74
- package/migration_note.md +0 -7
- package/package-lock.json +0 -611
- package/script/pre_publish.js +0 -207
- package/tutorial/Commands/README.md +0 -56
- package/tutorial/Commands/add-bundle-result.png +0 -0
- package/tutorial/Commands/add-bundle.png +0 -0
- package/tutorial/Commands/delete-bundle.png +0 -0
- package/tutorial/Commands/help.png +0 -0
- package/tutorial/Commands/init-project.png +0 -0
- package/tutorial/Commands/start-bundle-result.png +0 -0
- package/tutorial/Commands/start-bundle-stop.png +0 -0
- package/tutorial/Commands/start-bundle.png +0 -0
- package/tutorial/Commands/version.png +0 -0
- package/tutorial/ETC/README.md +0 -74
- package/tutorial/ETC/add-bundle-result.png +0 -0
- package/tutorial/ETC/add-bundle.png +0 -0
- package/tutorial/ETC/init-project.png +0 -0
- package/tutorial/Install/README.md +0 -54
- package/tutorial/Install/git-get.png +0 -0
- package/tutorial/Install/git-install-end.png +0 -0
- package/tutorial/Install/git-install-result.png +0 -0
- package/tutorial/Install/git-install-start.png +0 -0
- package/tutorial/Install/install-end.png +0 -0
- package/tutorial/Install/install-result.png +0 -0
- package/tutorial/Install/install-start.png +0 -0
- package/tutorial/WebStorm/README.md +0 -30
- package/tutorial/WebStorm/closure-compiler.png +0 -0
- package/tutorial/WebStorm/sass.png +0 -0
|
@@ -1,783 +0,0 @@
|
|
|
1
|
-
define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/events' ], function (require) {
|
|
2
|
-
|
|
3
|
-
var $ = require('jquery');
|
|
4
|
-
var uuid = require('vendor/uuid');
|
|
5
|
-
var merge = require('utils/merge');
|
|
6
|
-
|
|
7
|
-
require('utils/events'); // events
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Gina Popin Handler
|
|
11
|
-
*
|
|
12
|
-
* @param {object} options
|
|
13
|
-
* */
|
|
14
|
-
function Popin(options) {
|
|
15
|
-
|
|
16
|
-
this.plugin = 'popin';
|
|
17
|
-
|
|
18
|
-
var events = ['loaded', 'ready', 'open', 'close', 'destroy', 'success', 'error', 'progress'];
|
|
19
|
-
registerEvents(this.plugin, events);
|
|
20
|
-
|
|
21
|
-
var self = { // local use only
|
|
22
|
-
'options' : {
|
|
23
|
-
'name' : undefined,
|
|
24
|
-
'class': 'gina-popin-default'
|
|
25
|
-
},
|
|
26
|
-
autorizedEvents : ['ready', 'error'],
|
|
27
|
-
events: {}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
var instance = {
|
|
31
|
-
plugin : this.plugin,
|
|
32
|
-
id : 'gina-popins-' + uuid.v1(),
|
|
33
|
-
on : on,
|
|
34
|
-
eventData : {},
|
|
35
|
-
|
|
36
|
-
target : document, // by default
|
|
37
|
-
isReady : false,
|
|
38
|
-
initialized : false
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// popin proto
|
|
42
|
-
var $popin = { // is on main `gina-popins` container (first level)
|
|
43
|
-
'plugin' : this.plugin,
|
|
44
|
-
'on' : on,
|
|
45
|
-
'eventData' : {},
|
|
46
|
-
'target' : document, // by default
|
|
47
|
-
|
|
48
|
-
'name' : null,
|
|
49
|
-
'load' : null,
|
|
50
|
-
'loadContent' : null,
|
|
51
|
-
'open' : null,
|
|
52
|
-
'isOpen' : false,
|
|
53
|
-
'close' : null,
|
|
54
|
-
'$forms' : []
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
var $validator = null; // validator instance
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
// XML Request
|
|
61
|
-
var xhr = null;
|
|
62
|
-
|
|
63
|
-
var registeredPopins = [];
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* popinCreateContainer
|
|
68
|
-
*
|
|
69
|
-
* Creates HTML container and add it to the DOM
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* */
|
|
73
|
-
var popinCreateContainer = function() {
|
|
74
|
-
|
|
75
|
-
// creating template
|
|
76
|
-
// <div class="gina-popins">
|
|
77
|
-
// <div class="gina-popins-overlay gina-popin-is-active"></div>
|
|
78
|
-
// </div>
|
|
79
|
-
var $container = document.createElement('div');
|
|
80
|
-
$container.id = instance.id;
|
|
81
|
-
$container.setAttribute('id', instance.id);
|
|
82
|
-
$container.setAttribute('class', 'gina-popins');
|
|
83
|
-
|
|
84
|
-
var $overlay = document.createElement('div');
|
|
85
|
-
$overlay.setAttribute('id', 'gina-popins-overlay');
|
|
86
|
-
$overlay.setAttribute('class', 'gina-popins-overlay');
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
$container.appendChild( $overlay );
|
|
90
|
-
|
|
91
|
-
// adding to DOM
|
|
92
|
-
document.body.appendChild($container);
|
|
93
|
-
|
|
94
|
-
instance.target = $container;
|
|
95
|
-
instance.on = on;
|
|
96
|
-
|
|
97
|
-
gina.popinContainer = instance.id;
|
|
98
|
-
gina.hasPopinHandler = true;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
var popinGetContainer = function () {
|
|
102
|
-
//instance.id = gina.popinContainer
|
|
103
|
-
instance.target = document.getElementById(gina.popinContainer);
|
|
104
|
-
instance.on = on;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
var bindOpen = function() {
|
|
108
|
-
var attr = 'data-gina-popin-name';
|
|
109
|
-
var $els = getElementsByAttribute(attr);
|
|
110
|
-
var $el = null, name = null;
|
|
111
|
-
var url = null;
|
|
112
|
-
var proceed = null, evt = null;
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
for (var i = 0, len = $els.length; i < len; ++i) {
|
|
116
|
-
$el = $els[i];
|
|
117
|
-
name = $el.getAttribute(attr);
|
|
118
|
-
if ( $el.tagName == 'A' ) {
|
|
119
|
-
url = $el.getAttribute('href');
|
|
120
|
-
if (url == '' || url =='#' || /\#/.test(url) ) {
|
|
121
|
-
url = null
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if ( !url && typeof( $el.getAttribute('data-gina-popin-url') ) != 'undefined') {
|
|
126
|
-
url = $el.getAttribute('data-gina-popin-url');
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (!url) {
|
|
131
|
-
throw new Error('Found `data-gina-popin-name` without `url` !')
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
if ( !$el['url'] ) {
|
|
135
|
-
$el['url'] = url;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
if ( !$el['popinName'] ) {
|
|
139
|
-
$el['popinName'] = name;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (name == $popin.name) {
|
|
143
|
-
evt = 'popin.click.'+ 'gina-popin-' + instance.id +'-'+ uuid.v1() +'-'+ name;
|
|
144
|
-
$el['id'] = evt;
|
|
145
|
-
$el.setAttribute( 'id', evt);
|
|
146
|
-
|
|
147
|
-
if (!gina.events[evt]) {
|
|
148
|
-
//proceed = function () {
|
|
149
|
-
// attach submit events
|
|
150
|
-
addListener(gina, $el, evt, function(e) {
|
|
151
|
-
cancelEvent(e);
|
|
152
|
-
|
|
153
|
-
var fired = false;
|
|
154
|
-
$popin.on('loaded', function (e) {
|
|
155
|
-
e.preventDefault();
|
|
156
|
-
|
|
157
|
-
if (!fired) {
|
|
158
|
-
fired = true;
|
|
159
|
-
|
|
160
|
-
e.target.innerHTML = e.detail;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
// bind with formValidator if forms are found
|
|
164
|
-
if ( /<form/i.test(e.target.innerHTML) && typeof($validator) != 'undefined' ) {
|
|
165
|
-
var _id = null;
|
|
166
|
-
var $forms = e.target.getElementsByTagName('form');
|
|
167
|
-
for (var i = 0, len = $forms.length; i < len; ++i) {
|
|
168
|
-
|
|
169
|
-
if ( !$forms[i]['id'] || typeof($forms[i]) != 'string' ) {
|
|
170
|
-
_id = $forms[i].getAttribute('id') || 'form.' + uuid.v1();
|
|
171
|
-
$forms[i].setAttribute('id', _id);// just in case
|
|
172
|
-
$forms[i]['id'] = _id
|
|
173
|
-
} else {
|
|
174
|
-
_id = $forms[i]['id']
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
//console.log('pushing ', _id, $forms[i]['id'], typeof($forms[i]['id']), $forms[i].getAttribute('id'));
|
|
178
|
-
if ($popin['$forms'].indexOf(_id) < 0)
|
|
179
|
-
$popin['$forms'].push(_id);
|
|
180
|
-
|
|
181
|
-
$forms[i].close = popinClose;
|
|
182
|
-
$validator.validateFormById($forms[i].getAttribute('id')) //$forms[i]['id']
|
|
183
|
-
|
|
184
|
-
removeListener(gina, $popin.target, e.type);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
popinOpen($popin.name);
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
// loading & binding popin
|
|
193
|
-
popinLoad($popin.name, e.target.url);
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// if ( typeof(instance.events[evt]) != 'undefined' && instance.events[evt] == $el.id ) {
|
|
199
|
-
// removeListener(gina, $el, evt, proceed);
|
|
200
|
-
// delete instance.events[evt]
|
|
201
|
-
// } else {
|
|
202
|
-
// proceed()
|
|
203
|
-
// }
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// proxies
|
|
209
|
-
// click on main document
|
|
210
|
-
evt = 'click';// click proxy
|
|
211
|
-
// for proxies, use popinInstance.id as target is always `document`
|
|
212
|
-
addListener(gina, document, evt, function(event) {
|
|
213
|
-
|
|
214
|
-
if ( typeof(event.target.id) == 'undefined' ) {
|
|
215
|
-
event.target.setAttribute('id', evt +'.'+ uuid.v1() );
|
|
216
|
-
event.target.id = event.target.getAttribute('id')
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
if ( /^popin\.close\./.test(event.target.id) ) {
|
|
220
|
-
cancelEvent(event);
|
|
221
|
-
|
|
222
|
-
var _evt = event.target.id;
|
|
223
|
-
|
|
224
|
-
triggerEvent(gina, event.target, _evt, event.detail);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
if ( /^popin\.click\./.test(event.target.id) ) {
|
|
228
|
-
cancelEvent(event);
|
|
229
|
-
//console.log('popin.click !! ', event.target);
|
|
230
|
-
var _evt = event.target.id;
|
|
231
|
-
|
|
232
|
-
if ( new RegExp( '^popin.click.gina-popin-' + instance.id).test(_evt) )
|
|
233
|
-
triggerEvent(gina, event.target, _evt, event.detail);
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
gina.popinIsBindinded = true
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* XML Request options
|
|
245
|
-
* */
|
|
246
|
-
var xhrOptions = {
|
|
247
|
-
'url' : '',
|
|
248
|
-
'method' : 'GET',
|
|
249
|
-
'isSynchrone' : false,
|
|
250
|
-
'withCredentials': true, // if should be enabled under a trusted env
|
|
251
|
-
'headers' : {
|
|
252
|
-
// cross domain is enabled by default, but you need to setup `Access-Control-Allow-Origin`
|
|
253
|
-
'X-Requested-With': 'XMLHttpRequest' // in case of cross domain origin
|
|
254
|
-
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* popinLoad
|
|
260
|
-
*
|
|
261
|
-
* @param {string} name
|
|
262
|
-
* @param {string} url
|
|
263
|
-
* @param {object} [options]
|
|
264
|
-
* */
|
|
265
|
-
function popinLoad(name, url, options) {
|
|
266
|
-
|
|
267
|
-
var id = 'gina-popin-' + instance.id +'-'+ name;
|
|
268
|
-
|
|
269
|
-
// popin element
|
|
270
|
-
var $el = document.getElementById(id) || null;
|
|
271
|
-
|
|
272
|
-
if ( $el == null ) {
|
|
273
|
-
|
|
274
|
-
var className = self.options.class +' '+ id;
|
|
275
|
-
$el = document.createElement('div');
|
|
276
|
-
$el.setAttribute('id', id);
|
|
277
|
-
$el.setAttribute('class', className);
|
|
278
|
-
instance.target.firstChild.appendChild($el);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
if ( typeof(options) != 'undefined' ) {
|
|
282
|
-
var options = merge(options, xhrOptions);
|
|
283
|
-
} else {
|
|
284
|
-
var options = xhrOptions;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
options.url = url;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if ( options.withCredentials ) {
|
|
291
|
-
if ('withCredentials' in xhr) {
|
|
292
|
-
// XHR for Chrome/Firefox/Opera/Safari.
|
|
293
|
-
if (options.isSynchrone) {
|
|
294
|
-
xhr.open(options.method, options.url, options.isSynchrone)
|
|
295
|
-
} else {
|
|
296
|
-
xhr.open(options.method, options.url)
|
|
297
|
-
}
|
|
298
|
-
} else if ( typeof XDomainRequest != 'undefined' ) {
|
|
299
|
-
// XDomainRequest for IE.
|
|
300
|
-
xhr = new XDomainRequest();
|
|
301
|
-
xhr.open(options.method, options.url);
|
|
302
|
-
} else {
|
|
303
|
-
// CORS not supported.
|
|
304
|
-
xhr = null;
|
|
305
|
-
var result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
|
|
306
|
-
triggerEvent(gina, $el, 'error.' + id, result)
|
|
307
|
-
}
|
|
308
|
-
} else {
|
|
309
|
-
if (options.isSynchrone) {
|
|
310
|
-
xhr.open(options.method, options.url, options.isSynchrone)
|
|
311
|
-
} else {
|
|
312
|
-
xhr.open(options.method, options.url)
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
// setting up headers
|
|
317
|
-
for (var hearder in options.headers) {
|
|
318
|
-
xhr.setRequestHeader(hearder, options.headers[hearder]);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
if (xhr) {
|
|
322
|
-
// catching ready state cb
|
|
323
|
-
xhr.onreadystatechange = function (event) {
|
|
324
|
-
if (xhr.readyState == 4) {
|
|
325
|
-
// 200, 201, 201' etc ...
|
|
326
|
-
if( /^2/.test(xhr.status) ) {
|
|
327
|
-
|
|
328
|
-
try {
|
|
329
|
-
var result = xhr.responseText;
|
|
330
|
-
if ( /json$/.test( xhr.getResponseHeader("Content-Type") ) ) {
|
|
331
|
-
result = JSON.parse(xhr.responseText)
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
instance.eventData.success = result;
|
|
336
|
-
|
|
337
|
-
triggerEvent(gina, $el, 'loaded.' + id, result);
|
|
338
|
-
|
|
339
|
-
} catch (err) {
|
|
340
|
-
var result = {
|
|
341
|
-
'status': 422,
|
|
342
|
-
'error' : err.description
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
instance.eventData.error = result;
|
|
346
|
-
|
|
347
|
-
triggerEvent(gina, $el, 'error.' + id, result)
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
} else {
|
|
351
|
-
//console.log('error event triggered ', event.target, $form);
|
|
352
|
-
var result = {
|
|
353
|
-
'status': xhr.status,
|
|
354
|
-
'error' : xhr.responseText
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
instance.eventData.error = result;
|
|
358
|
-
|
|
359
|
-
// update toolbar
|
|
360
|
-
var XHRData = result;
|
|
361
|
-
if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
|
|
362
|
-
try {
|
|
363
|
-
if ( XHRData.error && /^(\{|\[).test(XHRData.error) /)
|
|
364
|
-
XHRData.error = JSON.parse(XHRData.error);
|
|
365
|
-
|
|
366
|
-
// bad .. should not happen
|
|
367
|
-
if ( typeof(XHRData.error.error) != 'undefined' )
|
|
368
|
-
XHRData.error = XHRData.error.error;
|
|
369
|
-
|
|
370
|
-
ginaToolbar.update("data-xhr", XHRData )
|
|
371
|
-
} catch (err) {
|
|
372
|
-
throw err
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
triggerEvent(gina, $el, 'error.' + id, result)
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
};
|
|
381
|
-
|
|
382
|
-
// catching request progress
|
|
383
|
-
// xhr.onprogress = function(event) {
|
|
384
|
-
// //console.log(
|
|
385
|
-
// // 'progress position '+ event.position,
|
|
386
|
-
// // '\nprogress total size '+ event.totalSize
|
|
387
|
-
// //);
|
|
388
|
-
//
|
|
389
|
-
// var percentComplete = (event.position / event.totalSize)*100;
|
|
390
|
-
// var result = {
|
|
391
|
-
// 'status': 100,
|
|
392
|
-
// 'progress': percentComplete
|
|
393
|
-
// };
|
|
394
|
-
//
|
|
395
|
-
// instance.eventData.onprogress = result;
|
|
396
|
-
//
|
|
397
|
-
// triggerEvent(gina, $el, 'progress.' + id, result)
|
|
398
|
-
// };
|
|
399
|
-
|
|
400
|
-
// catching timeout
|
|
401
|
-
// xhr.ontimeout = function (event) {
|
|
402
|
-
// var result = {
|
|
403
|
-
// 'status': 408,
|
|
404
|
-
// 'error': 'Request Timeout'
|
|
405
|
-
// };
|
|
406
|
-
//
|
|
407
|
-
// instance.eventData.ontimeout = result;
|
|
408
|
-
//
|
|
409
|
-
// triggerEvent(gina, $el, 'error.' + id, result)
|
|
410
|
-
// };
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
// sending
|
|
414
|
-
xhr.send();
|
|
415
|
-
|
|
416
|
-
return {
|
|
417
|
-
'open': function () {
|
|
418
|
-
var fired = false;
|
|
419
|
-
addListener(gina, $el, 'loaded.' + id, function(e) {
|
|
420
|
-
//$popin.on('loaded', function (e) {
|
|
421
|
-
e.preventDefault();
|
|
422
|
-
|
|
423
|
-
if (!fired) {
|
|
424
|
-
fired = true;
|
|
425
|
-
|
|
426
|
-
e.target.innerHTML = e.detail;
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
// bind with formValidator if forms are found
|
|
430
|
-
if ( /<form/i.test(e.target.innerHTML) && typeof($validator) != 'undefined' ) {
|
|
431
|
-
var _id = null;
|
|
432
|
-
var $forms = e.target.getElementsByTagName('form');
|
|
433
|
-
for (var i = 0, len = $forms.length; i < len; ++i) {
|
|
434
|
-
|
|
435
|
-
if ( !$forms[i]['id'] || typeof($forms[i]) != 'string' ) {
|
|
436
|
-
_id = $forms[i].getAttribute('id') || 'form.' + uuid.v1();
|
|
437
|
-
$forms[i].setAttribute('id', _id);// just in case
|
|
438
|
-
$forms[i]['id'] = _id
|
|
439
|
-
} else {
|
|
440
|
-
_id = $forms[i]['id']
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
//console.log('pushing ', _id, $forms[i]['id'], typeof($forms[i]['id']), $forms[i].getAttribute('id'));
|
|
444
|
-
if ($popin['$forms'].indexOf(_id) < 0)
|
|
445
|
-
$popin['$forms'].push(_id);
|
|
446
|
-
|
|
447
|
-
$forms[i].close = popinClose;
|
|
448
|
-
$validator.validateFormById($forms[i].getAttribute('id')) //$forms[i]['id']
|
|
449
|
-
|
|
450
|
-
removeListener(gina, $popin.target, e.type);
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
popinOpen($popin.name);
|
|
455
|
-
}
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
function popinLoadContent() {
|
|
464
|
-
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* popinOpen
|
|
469
|
-
*
|
|
470
|
-
* Opens a popin by name
|
|
471
|
-
*
|
|
472
|
-
* @parama {string} name
|
|
473
|
-
*
|
|
474
|
-
* */
|
|
475
|
-
function popinOpen(name) {
|
|
476
|
-
|
|
477
|
-
// bind overlay on click
|
|
478
|
-
var $overlay = instance.target.childNodes[0];
|
|
479
|
-
|
|
480
|
-
addListener(gina, $overlay, 'click', function(event) {
|
|
481
|
-
|
|
482
|
-
// don't cancel here, it will corrupt child elements behaviors such as checkboxes and radio buttons
|
|
483
|
-
|
|
484
|
-
if ( /gina-popin-is-active/.test(event.target.className) ) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
// remove listeners
|
|
488
|
-
removeListener(gina, event.target, 'click');
|
|
489
|
-
|
|
490
|
-
// binding popin close
|
|
491
|
-
var $close = [], $buttonsTMP = [];
|
|
492
|
-
|
|
493
|
-
$buttonsTMP = $el.getElementsByTagName('button');
|
|
494
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
495
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
496
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
497
|
-
$close.push($buttonsTMP[b])
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
|
|
501
|
-
$buttonsTMP = $el.getElementsByTagName('div');
|
|
502
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
503
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
504
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
505
|
-
$close.push($buttonsTMP[b])
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
$buttonsTMP = $el.getElementsByTagName('a');
|
|
510
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
511
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
512
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
513
|
-
$close.push($buttonsTMP[b])
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
for (var b = 0, len = $close.length; b < len; ++b) {
|
|
518
|
-
removeListener(gina, $close[b], $close[b].getAttribute('id') )
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
popinClose(name);
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
var id = null, $el = null;
|
|
527
|
-
if ( typeof(name) == 'string' && name != '' ) {
|
|
528
|
-
id = 'gina-popin-' + instance.id +'-'+ name;
|
|
529
|
-
if (id !== $popin.id)
|
|
530
|
-
throw new Error('Popin `'+name+'` not found !')
|
|
531
|
-
} else if ( typeof(name) == 'undefined' ) {
|
|
532
|
-
id = $popin.id
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
$el = document.getElementById(id);
|
|
536
|
-
|
|
537
|
-
if ( !/gina-popin-is-active/.test($el.className) )
|
|
538
|
-
$el.className += ' gina-popin-is-active';
|
|
539
|
-
|
|
540
|
-
if ( !/gina-popin-is-active/.test(instance.target.firstChild.className) )
|
|
541
|
-
instance.target.firstChild.className += ' gina-popin-is-active';
|
|
542
|
-
|
|
543
|
-
// binding popin close
|
|
544
|
-
var $close = [], $buttonsTMP = [];
|
|
545
|
-
|
|
546
|
-
$buttonsTMP = $el.getElementsByTagName('button');
|
|
547
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
548
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
549
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
550
|
-
$close.push($buttonsTMP[b])
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
$buttonsTMP = $el.getElementsByTagName('div');
|
|
555
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
556
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
557
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
558
|
-
$close.push($buttonsTMP[b])
|
|
559
|
-
}
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
$buttonsTMP = $el.getElementsByTagName('a');
|
|
563
|
-
if ( $buttonsTMP.length > 0 ) {
|
|
564
|
-
for(var b = 0, len = $buttonsTMP.length; b < len; ++b) {
|
|
565
|
-
if ( /gina-popin-close/.test($buttonsTMP[b].className) )
|
|
566
|
-
$close.push($buttonsTMP[b])
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
var onclickAttribute = null, evt = null;
|
|
570
|
-
for (var b = 0, len = $close.length; b < len; ++b) {
|
|
571
|
-
if ($close[b].tagName == 'A') {
|
|
572
|
-
onclickAttribute = $close[b].getAttribute('onclick');
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
if ( !onclickAttribute ) {
|
|
576
|
-
$close[b].setAttribute('onclick', 'return false;')
|
|
577
|
-
} else if ( !/return false/) {
|
|
578
|
-
if ( /\;$/.test(onclickAttribute) ) {
|
|
579
|
-
onclickAttribute += 'return false;'
|
|
580
|
-
} else {
|
|
581
|
-
onclickAttribute += '; return false;'
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
if (!$close[b]['id']) {
|
|
586
|
-
|
|
587
|
-
evt = 'popin.close.'+ uuid.v1();
|
|
588
|
-
$close[b]['id'] = evt;
|
|
589
|
-
$close[b].setAttribute( 'id', evt);
|
|
590
|
-
|
|
591
|
-
} else {
|
|
592
|
-
evt = $close[b]['id'];
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
var register = function (evt, $close) {
|
|
596
|
-
// attach submit events
|
|
597
|
-
addListener(gina, $close, evt, function(event) {
|
|
598
|
-
|
|
599
|
-
cancelEvent(event);
|
|
600
|
-
|
|
601
|
-
popinClose(name);
|
|
602
|
-
removeListener(gina, event.target, event.type)
|
|
603
|
-
});
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
if ( typeof(gina.events[evt]) == 'undefined' || gina.events[evt] != $close[b].id ) {
|
|
608
|
-
register(evt, $close[b])
|
|
609
|
-
}
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
if ( /gina-popin-is-active/.test(event.target.className) ) {
|
|
614
|
-
removeListener(gina, event.target, event.target.getAttribute('id'))
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
$popin.isOpen = true;
|
|
618
|
-
// so it can be forwarded to the handler who is listening
|
|
619
|
-
$popin.target = $el;
|
|
620
|
-
|
|
621
|
-
// update toolbar
|
|
622
|
-
var XHRData = document.getElementById('gina-without-layout-xhr-data');
|
|
623
|
-
if ( gina && typeof(window.ginaToolbar) == "object" && XHRData ) {
|
|
624
|
-
try {
|
|
625
|
-
|
|
626
|
-
if ( typeof(XHRData.value) != 'undefined' && XHRData.value ) {
|
|
627
|
-
XHRData = JSON.parse( decodeURIComponent( XHRData.value ) );
|
|
628
|
-
// reset data-xhr
|
|
629
|
-
ginaToolbar.update("data-xhr", null);
|
|
630
|
-
|
|
631
|
-
ginaToolbar.update("data-xhr", XHRData);
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
} catch (err) {
|
|
635
|
-
throw err
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
triggerEvent(gina, instance.target, 'open.'+ $popin.id, $popin);
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* popinClose
|
|
645
|
-
*
|
|
646
|
-
* Closes a popin by `name` or all `is-active`
|
|
647
|
-
*
|
|
648
|
-
* @parama {string} [name]
|
|
649
|
-
*
|
|
650
|
-
* */
|
|
651
|
-
function popinClose(name) {
|
|
652
|
-
var id = null, $el = null;
|
|
653
|
-
if ( typeof(name) == 'string' && name != '' ) {
|
|
654
|
-
if (name !== $popin.name)
|
|
655
|
-
throw new Error('Popin `'+name+'` not found !');
|
|
656
|
-
}
|
|
657
|
-
// by default
|
|
658
|
-
id = $popin.id;
|
|
659
|
-
|
|
660
|
-
$el = $popin.target;
|
|
661
|
-
|
|
662
|
-
if ( $el != null && /gina-popin-is-active/.test($el.className) ) {
|
|
663
|
-
instance.target.firstChild.className = instance.target.firstChild.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/, '');
|
|
664
|
-
$el.className = $el.className.replace(/\sgina-popin-is-active|gina-popin-is-active|gina-popin-is-active\s/, '');
|
|
665
|
-
$el.innerHTML = '';
|
|
666
|
-
|
|
667
|
-
// removing from FormValidator instance
|
|
668
|
-
var i = 0, formsLength = $popin['$forms'].length;
|
|
669
|
-
if ($validator['$forms'] && formsLength > 0) {
|
|
670
|
-
for (; i < formsLength; ++i) {
|
|
671
|
-
$validator['$forms'][ $popin['$forms'][i] ].destroy();
|
|
672
|
-
$popin['$forms'].splice( i, 1);
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
// remove listeners
|
|
676
|
-
removeListener(gina, $popin.target, 'loaded.' + $popin.id);
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
$popin.isOpen = false;
|
|
682
|
-
|
|
683
|
-
// restore toolbar
|
|
684
|
-
if ( gina && typeof(window.ginaToolbar) == "object" )
|
|
685
|
-
ginaToolbar.restore();
|
|
686
|
-
|
|
687
|
-
triggerEvent(gina, $popin.target, 'close.'+ id, $popin);
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* popinDestroy
|
|
693
|
-
*
|
|
694
|
-
* Destroyes a popin by name
|
|
695
|
-
*
|
|
696
|
-
* @parama {string} name
|
|
697
|
-
*
|
|
698
|
-
* */
|
|
699
|
-
function popinDestroy(name) {
|
|
700
|
-
var id = null, $el = null;
|
|
701
|
-
if ( typeof(name) == 'string' && name != '' ) {
|
|
702
|
-
id = 'gina-popin-' + instance.id +'-'+ name;
|
|
703
|
-
if (id !== $popin.id)
|
|
704
|
-
throw new Error('Popin `'+name+'` not found !')
|
|
705
|
-
} else if ( typeof(name) == 'undefined' ) {
|
|
706
|
-
id = $popin.id
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
var init = function(options) {
|
|
711
|
-
|
|
712
|
-
instance.on('init', function(event) {
|
|
713
|
-
|
|
714
|
-
if ( typeof(options) != 'object' ) {
|
|
715
|
-
throw new Error('`options` must be an object')
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
self.options = merge(options, self.options);
|
|
719
|
-
|
|
720
|
-
if ( typeof(self.options['name']) != 'string' || self.options['name'] == '' ) {
|
|
721
|
-
throw new Error('`options.name` can not be left `empty` or `undefined`')
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
if ( registeredPopins.indexOf(self.options['name']) > -1 ) {
|
|
725
|
-
throw new Error('`popin '+self.options['name']+'` already exists !')
|
|
726
|
-
}
|
|
727
|
-
|
|
728
|
-
if ( typeof(self.options['validator']) != 'undefined' ) {
|
|
729
|
-
$validator = self.options['validator']
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
self.options['class'] = 'gina-popin-container ' + self.options['class'];
|
|
733
|
-
|
|
734
|
-
$popin.id = 'gina-popin-' + instance.id +'-'+ self.options['name'];
|
|
735
|
-
$popin.name = self.options['name'];
|
|
736
|
-
$popin.load = popinLoad;
|
|
737
|
-
$popin.loadContent = popinLoadContent;
|
|
738
|
-
$popin.open = popinOpen;
|
|
739
|
-
$popin.close = popinClose;
|
|
740
|
-
|
|
741
|
-
if ( typeof($validator) != 'undefined' )
|
|
742
|
-
$popin.validateFormById = $validator.validateFormById;
|
|
743
|
-
|
|
744
|
-
// setting up AJAX
|
|
745
|
-
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
|
|
746
|
-
xhr = new XMLHttpRequest();
|
|
747
|
-
} else if (window.ActiveXObject) { // IE
|
|
748
|
-
try {
|
|
749
|
-
xhr = new ActiveXObject("Msxml2.XMLHTTP");
|
|
750
|
-
} catch (e) {
|
|
751
|
-
try {
|
|
752
|
-
xhr = new ActiveXObject("Microsoft.XMLHTTP");
|
|
753
|
-
}
|
|
754
|
-
catch (e) {}
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
bindOpen();
|
|
759
|
-
|
|
760
|
-
instance.isReady = true;
|
|
761
|
-
|
|
762
|
-
// trigger validator ready event
|
|
763
|
-
triggerEvent(gina, instance.target, 'ready.' + instance.id, $popin);
|
|
764
|
-
});
|
|
765
|
-
|
|
766
|
-
instance.initialized = true;
|
|
767
|
-
|
|
768
|
-
return instance
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if ( !gina.hasPopinHandler ) {
|
|
774
|
-
popinCreateContainer();
|
|
775
|
-
} else {
|
|
776
|
-
popinGetContainer()
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
return init(options)
|
|
780
|
-
};
|
|
781
|
-
|
|
782
|
-
return Popin
|
|
783
|
-
})
|