gina 0.1.1-alpha.162 → 0.1.1-alpha.164

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/README.md +1 -1
  2. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/AUTHORS +0 -0
  3. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/LICENSE +0 -0
  4. package/framework/v0.1.1-alpha.164/VERSION +1 -0
  5. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/html/nolayout.html +0 -0
  6. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/html/static.html +0 -0
  7. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/android-chrome-192x192.png +0 -0
  8. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/android-chrome-512x512.png +0 -0
  9. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/apple-touch-icon.png +0 -0
  10. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/favicon-16x16.png +0 -0
  11. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/favicon-32x32.png +0 -0
  12. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/img/favicon.ico +0 -0
  13. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/gina.js +640 -150
  14. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/gina.min.css +0 -0
  15. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/gina.min.css.map +0 -0
  16. package/framework/v0.1.1-alpha.164/core/asset/plugin/dist/gina.min.js +752 -0
  17. package/framework/v0.1.1-alpha.164/core/asset/plugin/dist/gina.min.js.map +8 -0
  18. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/gina.onload.min.js +0 -0
  19. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/gina.onload.min.js.map +0 -0
  20. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/css/toolbar-min.css +0 -0
  21. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/css/toolbar.css +0 -0
  22. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/css/toolbar.css.map +0 -0
  23. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/js/jquery-3.1.0.min.js +0 -0
  24. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/main.js +0 -0
  25. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/dist/toolbar/toolbar.html +0 -0
  26. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/readme.md +0 -0
  27. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/asset/plugin/uuid.json +0 -0
  28. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/config.js +58 -19
  29. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/index.js +1 -1
  30. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/connector.js +0 -0
  31. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  32. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  33. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/connector.v4.js +0 -0
  34. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/n1ql.js +0 -0
  35. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/session-store.js +0 -0
  36. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  37. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  38. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
  39. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/controller/controller.framework.js +0 -0
  40. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/controller/controller.js +29 -18
  41. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/controller/index.js +0 -0
  42. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/.travis.yml +0 -0
  43. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/LICENSE +0 -0
  44. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/README.md +0 -0
  45. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  46. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  47. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/lib/main.js +0 -0
  48. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/lib/types/multipart.js +0 -0
  49. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  50. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/lib/utils.js +0 -0
  51. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/busboy/package.json +0 -0
  52. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  53. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/dev/index.js +0 -0
  54. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/dev/lib/class.js +0 -0
  55. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/dev/lib/factory.js +0 -0
  56. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/dev/lib/tools.js +0 -0
  57. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/gna.js +6 -1
  58. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/README.md +5 -0
  59. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/currency.json +0 -0
  60. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/dist/language/en.json +0 -0
  61. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/dist/language/fr.json +0 -0
  62. package/framework/v0.1.1-alpha.164/core/locales/dist/region/en.json +5727 -0
  63. package/framework/v0.1.1-alpha.164/core/locales/dist/region/fr.json +11452 -0
  64. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/index.js +0 -0
  65. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/src/make.js +39 -41
  66. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/src/resources/currency.csv +0 -0
  67. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/locales/src/resources/region.csv +0 -0
  68. package/framework/v0.1.1-alpha.164/core/locales/src/resources/region.mapping.json +43 -0
  69. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/mime.types +0 -0
  70. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/model/entity.js +0 -0
  71. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/model/index.js +0 -0
  72. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/model/template/entityFactory.js +0 -0
  73. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/model/template/index.js +0 -0
  74. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/README.md +0 -0
  75. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/index.js +0 -0
  76. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/file/README.md +0 -0
  77. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/file/build.json +0 -0
  78. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/file/package.json +0 -0
  79. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/intl/README.md +0 -0
  80. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/intl/build.json +0 -0
  81. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/intl/package.json +0 -0
  82. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/intl/src/main.js +0 -0
  83. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/storage/README.md +0 -0
  84. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/storage/build.json +0 -0
  85. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/storage/package.json +0 -0
  86. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/storage/src/main.js +0 -0
  87. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/validator/README.md +0 -0
  88. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/validator/build.json +0 -0
  89. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/validator/package.json +0 -0
  90. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/validator/src/form-validator.js +0 -0
  91. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/plugins/lib/validator/src/main.js +0 -0
  92. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/router.js +0 -0
  93. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/server.express.js +0 -0
  94. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/server.isaac.js +0 -0
  95. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/server.js +28 -28
  96. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/status.codes +0 -0
  97. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/config/app.json +0 -0
  98. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/config/routing.json +0 -0
  99. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/config/settings.json +0 -0
  100. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  101. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/config/templates.json +0 -0
  102. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  103. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  104. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  105. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle/index.js +0 -0
  106. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  107. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  108. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  109. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  110. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  111. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_public/readme.md +0 -0
  112. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  113. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  114. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  115. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  116. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  117. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/command/gina.bat.tpl +0 -0
  118. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/command/gina.tpl +0 -0
  119. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/env.json +11 -0
  120. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/manifest.json +0 -0
  121. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/package.json +0 -0
  122. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/settings.json +0 -0
  123. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/statics.json +0 -0
  124. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/conf/templates.json +0 -0
  125. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/client/json/401.json +0 -0
  126. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/client/json/403.json +0 -0
  127. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/client/json/404.json +0 -0
  128. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/server/html/50x.html +0 -0
  129. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/server/json/500.json +0 -0
  130. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/error/server/json/503.json +0 -0
  131. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/core/template/extensions/logger/config.json +0 -0
  132. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/console.js +0 -0
  133. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/context.js +0 -0
  134. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/dateFormat.js +0 -0
  135. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/index.js +0 -0
  136. package/framework/v0.1.1-alpha.164/helpers/json/LICENSE +9 -0
  137. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/json/README.md +0 -0
  138. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/json/package.json +1 -1
  139. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/json/src/main.js +1 -1
  140. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/path.js +0 -0
  141. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/plugins/README.md +0 -0
  142. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/plugins/package.json +1 -1
  143. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/plugins/src/api-error.js +0 -0
  144. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/plugins/src/main.js +0 -0
  145. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/prototypes.js +11 -2
  146. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/task.js +0 -0
  147. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/helpers/text.js +0 -0
  148. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/archiver/README.md +0 -0
  149. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/archiver/build.json +0 -0
  150. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/archiver/package.json +0 -0
  151. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/archiver/src/dep/jszip.min.js +0 -0
  152. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/archiver/src/main.js +0 -0
  153. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/aliases.json +0 -0
  154. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/add.js +0 -0
  155. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/arguments.json +0 -0
  156. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/copy.js +0 -0
  157. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/cp.js +0 -0
  158. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/help.js +0 -0
  159. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/help.txt +0 -0
  160. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/list.js +0 -0
  161. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/remove.js +0 -0
  162. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/rename.js +0 -0
  163. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/restart.js +0 -0
  164. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/rm.js +0 -0
  165. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/start.js +9 -2
  166. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/status.js +0 -0
  167. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/bundle/stop.js +0 -0
  168. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/add.js +0 -0
  169. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/get.js +0 -0
  170. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/help.js +0 -0
  171. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/help.txt +0 -0
  172. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/link-dev.js +0 -0
  173. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/list.js +20 -4
  174. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/remove.js +0 -0
  175. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/rm.js +0 -0
  176. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/set.js +0 -0
  177. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/unset.js +0 -0
  178. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/env/use.js +0 -0
  179. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/build.js +1 -1
  180. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/dot.js +0 -0
  181. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/get.js +0 -0
  182. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/help.js +0 -0
  183. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/help.txt +0 -0
  184. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/init.js +160 -67
  185. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/link-node-modules.js +0 -0
  186. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/link.js +0 -0
  187. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/msg.json +0 -0
  188. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/open.js +0 -0
  189. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/restart.js +0 -0
  190. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/set.js +0 -0
  191. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/start.js +0 -0
  192. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/status.js +0 -0
  193. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/stop.js +0 -0
  194. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/tail.js +26 -2
  195. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/update.js +0 -0
  196. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/framework/version.js +0 -0
  197. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/gina-dev.1.md +0 -0
  198. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/gina-framework.1.md +0 -0
  199. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/gina.1.md +0 -0
  200. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/helper.js +0 -0
  201. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/index.js +0 -0
  202. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/msg.json +0 -0
  203. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/help.js +0 -0
  204. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/help.txt +0 -0
  205. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/inc/scan.js +0 -0
  206. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/list.js +15 -2
  207. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/reset.js +0 -0
  208. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/port/set.js +0 -0
  209. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/add.js +0 -0
  210. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/arguments.json +0 -0
  211. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/build.js +0 -0
  212. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/help.js +0 -0
  213. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/help.txt +0 -0
  214. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/import.js +0 -0
  215. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/list.js +0 -0
  216. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/move.js +0 -0
  217. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/remove.js +0 -0
  218. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/rename.js +0 -0
  219. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/restart.js +0 -0
  220. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/rm.js +0 -0
  221. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/start.js +0 -0
  222. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/status.js +0 -0
  223. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/project/stop.js +0 -0
  224. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/protocol/help.js +0 -0
  225. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/protocol/help.txt +0 -0
  226. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/protocol/list.js +0 -0
  227. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/protocol/set.js +0 -0
  228. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/help.js +0 -0
  229. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/help.txt +0 -0
  230. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/link-local.js +0 -0
  231. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/list.js +24 -8
  232. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/remove.js +0 -0
  233. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/rm.js +0 -0
  234. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/set.js +0 -0
  235. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/unset.js +0 -0
  236. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/scope/use.js +0 -0
  237. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cmd/view/add.js +0 -0
  238. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/collection/README.md +0 -0
  239. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/collection/build.json +0 -0
  240. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/collection/package.json +0 -0
  241. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/collection/src/main.js +0 -0
  242. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/config.js +0 -0
  243. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cron/README.md +0 -0
  244. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cron/package.json +0 -0
  245. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/cron/src/main.js +7 -7
  246. package/framework/v0.1.1-alpha.164/lib/domain/LICENSE +9 -0
  247. package/framework/v0.1.1-alpha.164/lib/domain/README.md +46 -0
  248. package/framework/v0.1.1-alpha.164/lib/domain/dist/public_suffix_list.dat +14186 -0
  249. package/framework/{v0.1.1-alpha.162/lib/routing/README.md → v0.1.1-alpha.164/lib/domain/exemples/backend.js} +0 -0
  250. package/framework/{v0.1.1-alpha.162/lib/routing/build.json → v0.1.1-alpha.164/lib/domain/exemples/frontend.html} +0 -0
  251. package/framework/v0.1.1-alpha.164/lib/domain/package.json +20 -0
  252. package/framework/v0.1.1-alpha.164/lib/domain/src/main.js +438 -0
  253. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/generator/index.js +0 -0
  254. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/index.js +1 -0
  255. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/LICENSE +0 -0
  256. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/README.md +0 -0
  257. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  258. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/example/protected_inheritance.js +0 -0
  259. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/example/simple_inheritance.js +0 -0
  260. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  261. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/package.json +0 -0
  262. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/inherits/src/main.js +0 -0
  263. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/README.md +0 -0
  264. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/package.json +1 -1
  265. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/default/index.js +0 -0
  266. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/file/index.js +0 -0
  267. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  268. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  269. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/mq/index.js +5 -0
  270. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/mq/listener.js +0 -0
  271. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/containers/mq/speaker.js +0 -0
  272. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/helper.js +1 -0
  273. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/logger/src/main.js +20 -3
  274. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/math/index.js +0 -0
  275. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/README.md +0 -0
  276. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/example/merge.js +0 -0
  277. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/example/merge_2_literal objects.js +0 -0
  278. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/example/merge_and_preserve_first.js +0 -0
  279. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/package.json +0 -0
  280. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/merge/src/main.js +0 -0
  281. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/model.js +0 -0
  282. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/proc.js +10 -0
  283. package/framework/{v0.1.1-alpha.162/lib/swig-filters → v0.1.1-alpha.164/lib/routing}/README.md +0 -0
  284. package/framework/{v0.1.1-alpha.162/lib/url/README.md → v0.1.1-alpha.164/lib/routing/build.json} +0 -0
  285. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/routing/package.json +0 -0
  286. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/routing/src/main.js +0 -0
  287. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/session-store.js +0 -0
  288. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/shell.js +0 -0
  289. package/framework/v0.1.1-alpha.164/lib/swig-filters/README.md +0 -0
  290. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/swig-filters/package.json +0 -0
  291. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/swig-filters/src/main.js +0 -0
  292. package/framework/v0.1.1-alpha.164/lib/url/README.md +0 -0
  293. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/url/index.js +0 -0
  294. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/url/mocks.json +0 -0
  295. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/url/routing.json +0 -0
  296. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/url/test.js +0 -0
  297. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/lib/validator.js +0 -0
  298. package/framework/{v0.1.1-alpha.162 → v0.1.1-alpha.164}/package.json +0 -0
  299. package/package.json +2 -2
  300. package/script/post_install.js +1 -1
  301. package/script/post_publish.js +1 -1
  302. package/script/pre_install.js +1 -1
  303. package/script/prepare_version.js +1 -1
  304. package/services/.gna/67fdf1b224a2ed5597e63d4b64283834468e05e3.txt +0 -0
  305. package/services/.gna/arch +1 -0
  306. package/services/.gna/locals.json +14 -0
  307. package/services/.gna/platform +1 -0
  308. package/services/configure +6 -0
  309. package/services/env.json +10 -0
  310. package/services/manifest.json +18 -0
  311. package/services/package.json +11 -0
  312. package/services/src/proxy/config/app.json +6 -0
  313. package/services/src/proxy/config/routing.json +11 -0
  314. package/services/src/proxy/config/settings.json +9 -0
  315. package/services/src/proxy/config/settings.server.json +31 -0
  316. package/services/src/proxy/config/statics.json +3 -0
  317. package/services/src/proxy/controllers/controller.content.js +58 -0
  318. package/services/src/proxy/controllers/controller.js +30 -0
  319. package/services/src/proxy/controllers/setup.js +111 -0
  320. package/services/src/proxy/index.js +31 -0
  321. package/services/src/proxy/lib/domain/README.md +48 -0
  322. package/services/src/proxy/lib/domain/src/config/public_suffix_list.dat +14186 -0
  323. package/framework/v0.1.1-alpha.162/VERSION +0 -1
  324. package/framework/v0.1.1-alpha.162/core/asset/plugin/dist/gina.min.js +0 -741
  325. package/framework/v0.1.1-alpha.162/core/asset/plugin/dist/gina.min.js.map +0 -8
  326. package/framework/v0.1.1-alpha.162/core/locales/dist/region/en.json +0 -9492
  327. package/framework/v0.1.1-alpha.162/core/locales/dist/region/fr.json +0 -9492
  328. package/framework/v0.1.1-alpha.162/core/locales/src/resources/region.mapping.json +0 -28
@@ -3665,10 +3665,19 @@ function PrototypesHelper(instance) {
3665
3665
  }
3666
3666
 
3667
3667
  if ( typeof(JSON.clone) == 'undefined' && !isGFFCtx ) {
3668
- if ( typeof(envVars) != 'undefined' ) {
3668
+ if ( typeof(envVars) != 'undefined' && envVars != null ) {
3669
3669
  JSON.clone = require( envVars.GINA_DIR +'/utils/prototypes.json_clone');
3670
3670
  } else {
3671
- JSON.clone = require( GINA_DIR +'/utils/prototypes.json_clone');
3671
+ // For unit tests
3672
+ if (!envVars) {
3673
+ var ginaDir = process.cwd().match(/.*\/gina/)[0];
3674
+ require(ginaDir +'/utils/helper');
3675
+ setEnvVar('GINA_DIR', ginaDir, true);
3676
+ envVars = getEnvVars();
3677
+ }
3678
+
3679
+ // JSON.clone = require( GINA_DIR +'/utils/prototypes.json_clone');
3680
+ JSON.clone = require( getEnvVar('GINA_DIR') +'/utils/prototypes.json_clone');
3672
3681
  }
3673
3682
  }
3674
3683
 
@@ -16577,7 +16586,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16577
16586
 
16578
16587
  /**
16579
16588
  * Toolbar plugin
16580
- *
16589
+ *
16581
16590
  * TODO - search using `datatables` plugin (https://stackoverflow.com/questions/10400033/is-there-a-jquery-plugin-like-datatables-for-a-ul)
16582
16591
  */
16583
16592
  function Toolbar() {
@@ -16748,39 +16757,41 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16748
16757
  * */
16749
16758
  var loadData = function (section, data, ginaData) {
16750
16759
 
16751
- var $currentForms = null;
16760
+ var $currentForms = null, txt = null;
16752
16761
  try {
16753
- var txt = ($json) ? $json.text() : '';
16762
+
16763
+ txt = ($json) ? $json.text() : '';
16754
16764
  if (txt == '' || txt == 'null' ) {
16755
16765
  $json.text('Empty')
16756
16766
  } else {
16757
16767
  jsonObject = JSON.parse( txt );
16758
16768
  ginaJsonObject = JSON.parse($ginaJson.text());
16759
-
16769
+
16760
16770
  $json.text('');
16761
16771
 
16762
16772
  // backing up document data for restore action
16763
16773
  if (!originalData) {
16764
-
16774
+
16765
16775
  originalData = {
16766
16776
  jsonObject : JSON.clone(jsonObject),
16767
16777
  ginaJsonObject : JSON.clone( ginaJsonObject)
16768
16778
  };
16769
16779
  lastJsonObjectState = {}; // jsonObject.data
16770
-
16780
+
16771
16781
  }
16772
16782
  }
16773
16783
 
16774
16784
  } catch (err) {
16775
-
16785
+
16776
16786
  var sectionStr = ( section ) ? ' [ '+ section + ' ] ' : ' ';
16777
- var _err = 'Could not load'+ sectionStr +'json\n' + (err.stack||err.message||err);
16787
+ // var _err = 'Could not load'+ sectionStr +'json\n' + (err.stack||err.message||err);
16788
+ var _err = 'Could not load'+ sectionStr +'json\n' + err.message +'\n'+ err.stack;
16778
16789
  if ($json) {
16779
16790
  $json.text(_err);
16780
16791
  } else {
16781
16792
  throw _err;
16782
16793
  }
16783
-
16794
+
16784
16795
  }
16785
16796
 
16786
16797
  if (jsonObject) {
@@ -16838,7 +16849,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16838
16849
  }
16839
16850
 
16840
16851
  if ( !section || /^(data)$/.test(section) ) {
16841
-
16852
+
16842
16853
 
16843
16854
  // -> Data
16844
16855
  $htmlData.html('<ul class="gina-toolbar-code">' + parseObject(userObject.data, ginaObject.data, null, isXHR) +'</ul>');
@@ -16851,11 +16862,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16851
16862
  '</div>';
16852
16863
 
16853
16864
  $htmlView.html(htmlProp);
16854
-
16865
+
16855
16866
  $htmlView.html( parseView(userObject.view, ginaObject.view, null, isXHR, $htmlView) );
16856
16867
 
16857
16868
  // -> Forms
16858
- $currentForms = $forms;
16869
+ $currentForms = $forms;
16859
16870
  $htmlForms.html('');
16860
16871
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR) );
16861
16872
  // Form binding
@@ -16869,9 +16880,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16869
16880
  });
16870
16881
 
16871
16882
  //$htmlForms.html( parseView(jsonObject.forms, ginaJsonObject.forms, null, $htmlForms) );
16872
- } //else
16883
+ } //else
16873
16884
  if ( /^(data-xhr|view-xhr)$/.test(section) ) {
16874
-
16885
+
16875
16886
  // reset case
16876
16887
  if ( typeof(jsonObject[section]) == 'undefined' || !jsonObject[section] || jsonObject[section] == 'null' ) {
16877
16888
  return false;
@@ -16880,11 +16891,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16880
16891
  // -> XHR Data
16881
16892
  isXHR = true;
16882
16893
  isXHRViewData = (typeof (jsonObject[section].isXHRViewData) != 'undefined') ? true : isXHRViewData;
16883
-
16884
-
16894
+
16895
+
16885
16896
  // update data section without erasing old data
16886
16897
  if (!isXHRViewData && !/^(view-xhr)$/.test(section)) {
16887
-
16898
+
16888
16899
  // also update original data to handle restore action
16889
16900
  if ( typeof (jsonObject['el-xhr']) != 'undefined' ) {
16890
16901
  lastJsonObjectState.data = JSON.clone(jsonObject[section]);
@@ -16910,11 +16921,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16910
16921
  $htmlView.html(htmlProp);
16911
16922
  $htmlView.html( parseView(jsonObject[section], ginaJsonObject[section], null, isXHR, $htmlView) );
16912
16923
  }
16913
-
16914
- } //else
16924
+
16925
+ } //else
16915
16926
  if ( /^(el-xhr)$/.test(section) ) {
16916
16927
  // -> XHR Forms
16917
- isXHR = true;
16928
+ isXHR = true;
16918
16929
  $currentForms = $('#' + data).find('form:not(' + formsIgnored + ')');
16919
16930
  $htmlForms.html('');
16920
16931
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR ) );
@@ -16927,16 +16938,16 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16927
16938
  .find('ul').first()
16928
16939
  .slideToggle();
16929
16940
  });
16930
- } //else
16941
+ } //else
16931
16942
  if ( /^(forms)$/.test(section) ) {
16932
16943
  isXHR = true;
16933
16944
  self.isValidator = true;
16934
-
16945
+
16935
16946
  var $form = $('#gina-toolbar-form-' + data.id);
16936
16947
  // for live changes (eg.: on `Validator::getFormById()` call)
16937
16948
  if ( !$form.length ) {
16938
16949
  // crearte toolbar entry for the new form
16939
- $currentForms = $forms;
16950
+ $currentForms = $forms;
16940
16951
  $htmlForms.html('');
16941
16952
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR) );
16942
16953
  // Form binding
@@ -16949,12 +16960,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16949
16960
  .slideToggle();
16950
16961
  });
16951
16962
  }
16952
-
16963
+
16953
16964
  // form data sent
16954
16965
  if ( typeof(data.rules) != 'undefined' ) {
16955
16966
  updateForm(data.id, 'rules', data.rules, isXHR)
16956
16967
  }
16957
-
16968
+
16958
16969
  // form errors
16959
16970
  if ( typeof(data.errors) != 'undefined' && data.errors.count() > 0 ) {
16960
16971
  updateForm(data.id, 'errors', data.errors, isXHR)
@@ -16977,7 +16988,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16977
16988
  if (jsonObject.file == settings.currentFile) {
16978
16989
  // If current page is the same as the previous page, unfold code as neede
16979
16990
  $(document).ready(function () {
16980
-
16991
+
16981
16992
  if (self.isValidator ) {
16982
16993
  self.isXHR = true;
16983
16994
  if (settings.isUnfolded.length > 0 && !self.initiatedXhrFoldingState) {
@@ -17004,12 +17015,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17004
17015
  }
17005
17016
  })
17006
17017
  }
17007
- }
17008
-
17018
+ }
17019
+
17009
17020
  if ( !section || section == 'el-xhr' && !self.hasParsedUrls) {
17010
17021
  self.hasParsedUrls = (section && section == 'el-xhr' ) ? true : false;
17011
17022
  parseUrls(section);
17012
- }
17023
+ }
17013
17024
  }
17014
17025
 
17015
17026
 
@@ -17147,8 +17158,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17147
17158
  });
17148
17159
 
17149
17160
  // Show/hide toolbar using gg shorcut
17150
- $('body').off('keypress').on('keypress', function onKeypressed(event){
17151
-
17161
+ $('body').off('keypress').on('keypress', function onKeypressed(event){
17162
+
17152
17163
  if (!/INPUT|TEXTAREA/.test(event.target.tagName )) {
17153
17164
  if (event.keyCode) {
17154
17165
  // IE
@@ -17177,10 +17188,10 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17177
17188
  lastPressedKey.pressTime = now.getTime();
17178
17189
  lastPressedKey.keynum = keynum;
17179
17190
  }
17180
-
17191
+
17181
17192
  });
17182
17193
 
17183
-
17194
+
17184
17195
  // Updates Toolbar with current values
17185
17196
 
17186
17197
  // Select the current tab
@@ -17256,7 +17267,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17256
17267
  }
17257
17268
 
17258
17269
  var toggleCodeFolding = function ($el, cb, toggledByClick) {
17259
-
17270
+
17260
17271
  if ( typeof(toggledByClick) == 'undefined' ) {
17261
17272
  var toggledByClick = false
17262
17273
  }
@@ -17268,7 +17279,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17268
17279
  var hasXhrFlag = false;
17269
17280
 
17270
17281
  if ( /(gina-toolbar-folding-state-[a-z 0-9_-]+|gina-toolbar-xhr-folding-state-[a-z 0-9_-]+)/i.test(self.foldingClass) ) {
17271
-
17282
+
17272
17283
  if ( /gina-toolbar-folding-state-[a-z0-9_-]+/i.test(self.foldingClass) ) {
17273
17284
  self.foldingClass = self.foldingClass.match(/gina-toolbar-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-folding-state-/, '');
17274
17285
  } else {
@@ -17278,15 +17289,15 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17278
17289
  }
17279
17290
 
17280
17291
  if ( settings.isUnfolded.indexOf(self.foldingClass) < 0 ) {
17281
-
17292
+
17282
17293
  settings.isUnfolded.push(self.foldingClass);
17283
17294
  settings.save();
17284
-
17295
+
17285
17296
  if (!$el.hasClass('gina-toolbar-unfolded')) {
17286
17297
  $el.addClass('gina-toolbar-unfolded');
17287
17298
  $el.next('ul').slideToggle('fast');
17288
17299
  }
17289
-
17300
+
17290
17301
  } else {
17291
17302
 
17292
17303
  if ( settings.isUnfolded.indexOf(self.foldingClass) > -1 && $el.hasClass('gina-toolbar-unfolded') ) {
@@ -17301,22 +17312,22 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17301
17312
  }
17302
17313
  }
17303
17314
  }
17304
-
17315
+
17305
17316
  settings.save(true);
17306
-
17317
+
17307
17318
  if ( settings.isUnfolded.indexOf(self.foldingClass) < 0 ) {
17308
17319
  $el.removeClass('gina-toolbar-unfolded');
17309
17320
  $el.next('ul').slideToggle('fast');
17310
17321
  }
17311
-
17322
+
17312
17323
 
17313
17324
  } else {
17314
17325
  $el.addClass('gina-toolbar-unfolded');
17315
17326
  $el.next('ul').slideToggle('fast');
17316
- }
17327
+ }
17317
17328
  }
17318
17329
  }
17319
-
17330
+
17320
17331
  }
17321
17332
 
17322
17333
  if (typeof (cb) != 'undefined' && cb != null )
@@ -17351,11 +17362,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17351
17362
  }
17352
17363
 
17353
17364
  var normalizeFoldingStateName = function(stateSection, stateName) {
17354
-
17365
+
17355
17366
  var foldingStateName = '', section = null, name = null;
17356
17367
 
17357
17368
  if ( typeof(stateSection) != 'undefined' && stateSection != '' ) {
17358
-
17369
+
17359
17370
  section = stateSection;
17360
17371
  if ( typeof(stateSection) == 'string' ) {
17361
17372
  section = stateSection
@@ -17363,7 +17374,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17363
17374
  .replace(/\]/, '')
17364
17375
  .replace(/[^A-Za-z0-9_-]/g, '_')
17365
17376
  }
17366
-
17377
+
17367
17378
  foldingStateName += section + '-'
17368
17379
  }
17369
17380
 
@@ -17375,12 +17386,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17375
17386
  .replace(/(\]\[|\[)/g, '-')
17376
17387
  .replace(/\]/, '')
17377
17388
  }
17378
-
17389
+
17379
17390
  foldingStateName += name
17380
17391
  } else {
17381
17392
  foldingStateName = foldingStateName.substr(0, foldingStateName.length-1)
17382
17393
  }
17383
-
17394
+
17384
17395
  return foldingStateName.trim()
17385
17396
  }
17386
17397
 
@@ -17460,14 +17471,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17460
17471
  var section = ( typeof(elSection) != 'undefined' && elSection != null ) ? elSection : '';
17461
17472
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
17462
17473
 
17463
- // patch
17474
+ // patch
17464
17475
  if (!ginaArr) {
17465
17476
  ginaArr = [];
17466
17477
  }
17467
17478
  for (var i = 0, len = arr.length; i<len; ++i) {
17468
17479
  if ( typeof(arr[i]) == 'object' && !Array.isArray(arr[i]) ) {
17469
17480
  //id += i + '-';
17470
- // patch
17481
+ // patch
17471
17482
  if (!ginaArr[i]) {
17472
17483
  ginaArr[i] = arr[i]
17473
17484
  }
@@ -17504,7 +17515,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17504
17515
  }
17505
17516
 
17506
17517
  var parseView = function (obj, ginaObj, elId, elIsXHR, $html, $root) {
17507
-
17518
+
17508
17519
  var id = (elId != null) ? elId.replace(/[^A-Za-z0-9_-]/g, '_') : '';
17509
17520
  var section = null;
17510
17521
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
@@ -17520,7 +17531,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17520
17531
  if (!$root)
17521
17532
  $root = $html;
17522
17533
 
17523
- for (var i in obj) {
17534
+ for (var i in obj) {
17524
17535
  section = i;
17525
17536
  if ( typeof(obj[i]) == 'object' && !Array.isArray(obj[i]) && obj[i] !== null ) { // parse
17526
17537
 
@@ -17530,7 +17541,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17530
17541
  if (!hasParent ) {
17531
17542
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17532
17543
 
17533
- if (i == 'params') { // force to top
17544
+ if (i == 'params') { // force to top
17534
17545
  var htmlParams = '<div id="gina-toolbar-view-'+ id.substr(0, id.length - 1) +'" class="gina-toolbar-section">' +
17535
17546
  '<h2 class="gina-toolbar-section-title">'+ id.substr(0, id.length - 1) +'</h2>' +
17536
17547
  '<ul class="'+ id.substr(0, id.length - 1) +'"></ul>' +
@@ -17539,9 +17550,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17539
17550
  $('#gina-toolbar-view-html-properties')
17540
17551
  .before(htmlParams);
17541
17552
  } else {
17542
-
17553
+
17543
17554
  if ( !/^html/.test(id) ) {
17544
-
17555
+
17545
17556
  var htmlOther = '<div id="gina-toolbar-view-'+ id.substr(0, id.length - 1) +'" class="gina-toolbar-section">' +
17546
17557
  '<h2 class="gina-toolbar-section-title">'+ id.substr(0, id.length - 1) +'</h2>' +
17547
17558
  '<ul class="'+ id.substr(0, id.length - 1) +'"></ul>' +
@@ -17554,7 +17565,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17554
17565
  .find('.gina-toolbar-properties')
17555
17566
  .append('ul.' + id.substr(0, id.length - 1))
17556
17567
  }*/
17557
-
17568
+
17558
17569
  }
17559
17570
 
17560
17571
  parseView(obj[i], ginaObj[i], id, elIsXHR, $html.find('ul.'+ id.substr(0, id.length - 1)), $root );
@@ -17579,14 +17590,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17579
17590
 
17580
17591
  } else if ( Array.isArray(obj[i]) ) { // parse collection
17581
17592
 
17582
-
17583
-
17593
+
17594
+
17584
17595
  $parent = $('#gina-toolbar-view-' + id.substr(0, id.length - 1));
17585
-
17596
+
17586
17597
  hasParent = ( $parent.length ) ? true : false;
17587
-
17588
- if ( !hasParent || /^html/.test(id) ) {
17589
-
17598
+
17599
+ if ( !hasParent || /^html/.test(id) ) {
17600
+
17590
17601
  $parent = $('.' + id);
17591
17602
  parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17592
17603
 
@@ -17594,17 +17605,17 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17594
17605
  //.find('ul.'+ id.substr(0, id.length - 1))
17595
17606
  .append('<li class="gina-toolbar-collection"><a href="#" class="gina-toolbar-key gina-toolbar'+ isXHR +'-folding-state-'+ normalizeFoldingStateName( i.replace(/[^A-Za-z0-9_-]/g, '_'), parentId.substr(0, parentId.length - 1) ) +'">'+ i +' <span>['+ obj[i].length +']</span></a><ul> '+ parseCollection(obj[i], ginaObj[i], parentId, $parent.find('li ul.'+ id.substr(0, id.length - 1)), section )+'</ul></li>');
17596
17607
 
17597
-
17608
+
17598
17609
  //parentId = parentId.substr(0, parentId.length - 1)+ '-';
17599
- //parentId = id.substr(0, id.length - i.length - 1);
17610
+ //parentId = id.substr(0, id.length - i.length - 1);
17600
17611
  //parseView(obj[i], ginaObj[i], parentId, elIsXHR, $parent.find('ul.'+ parentId.substr(0, parentId.length - 1)), $root );
17601
17612
 
17602
17613
  //id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17603
17614
  //$parent = $('#gina-toolbar-view-' + id.substr(0, id.length - 1));
17604
17615
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17605
- } else {
17606
-
17607
-
17616
+ } else {
17617
+
17618
+
17608
17619
  parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17609
17620
 
17610
17621
  $parent
@@ -17612,20 +17623,20 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17612
17623
  .append('<li class="gina-toolbar-collection"><a class="gina-toolbar-key gina-toolbar'+ isXHR +'-folding-state-'+ normalizeFoldingStateName( i.replace(/[^A-Za-z0-9_-]/g, '_'), parentId.substr(0, parentId.length - 1) ) +'">'+ i +' <span>['+ obj[i].length +']</span></a><ul>'+ parseCollection(obj[i], ginaObj[i], parentId, $parent.find('li ul.'+ id.substr(0, id.length - 1)), section ) +'</ul></li>');
17613
17624
 
17614
17625
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17615
-
17626
+
17616
17627
  }
17617
-
17618
17628
 
17619
- // if ( !hasParent || /^html/.test(id) ) {
17629
+
17630
+ // if ( !hasParent || /^html/.test(id) ) {
17620
17631
  // id = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17621
17632
  // $root
17622
17633
  // .find('.gina-toolbar-properties')
17623
17634
  // .append('<li class="gina-toolbar-collection"><a class="gina-toolbar-key gina-toolbar'+ isXHR +'-folding-state-'+ normalizeFoldingStateName( i.replace(/[^A-Za-z0-9_-]/g, '_'), id.substr(0, id.length - 1) ) +'">'+ i +' <span>['+ obj[i].length +']</span></a><ul>'+ parseCollection(obj[i], ginaObj[i], parentId, $root.find('.gina-toolbar-properties'), section) +'</ul></li>');
17624
17635
 
17625
17636
 
17626
- // } else {
17627
-
17628
-
17637
+ // } else {
17638
+
17639
+
17629
17640
  // parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17630
17641
 
17631
17642
  // $parent
@@ -17638,17 +17649,17 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17638
17649
  // clear one level
17639
17650
  id = id.substr(0, id.length - i.length - 1);
17640
17651
  } else {
17641
-
17642
-
17643
-
17652
+
17653
+
17654
+
17644
17655
  objType = (ginaObj[i] === null) ? 'null' : typeof(ginaObj[i]);
17645
17656
  if ( objType == 'undefined' ) { // new key declaration added by user
17646
17657
  if (/\-$/.test(id)) {
17647
17658
  id = id.substr(0, id.length - 1);
17648
17659
  }
17649
-
17660
+
17650
17661
  if (!id) continue;
17651
-
17662
+
17652
17663
  $html
17653
17664
  .find('ul.' + id)
17654
17665
  .append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key gina-toolbar-key-added">'+ i +':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'">'+ obj[i]+'</span></li>');
@@ -17661,7 +17672,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17661
17672
  if (!id) {
17662
17673
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17663
17674
  }
17664
-
17675
+
17665
17676
  try {
17666
17677
  $html
17667
17678
  .find('ul.' + id)
@@ -17674,7 +17685,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17674
17685
  } catch (err) {
17675
17686
  throw new Error('GinaToolbarError: `ul.'+ id +'` not found');
17676
17687
  }
17677
-
17688
+
17678
17689
  } else {
17679
17690
 
17680
17691
  if ( !id || /^html\-properties/.test(id) ) { // properties case
@@ -17686,10 +17697,10 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17686
17697
  $root
17687
17698
  .find('.gina-toolbar-properties')
17688
17699
  .append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+ i +':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'">'+ obj[i] +'</span></li>')
17689
- //}
17690
-
17700
+ //}
17701
+
17691
17702
  } else {
17692
-
17703
+
17693
17704
  $root
17694
17705
  .find('ul.' + id.substr(0, id.length - 1))
17695
17706
  .append('<li class="gina-toolbar-key-value"><span class="gina-toolbar-key">'+ i +':</span> <span class="gina-toolbar-value gina-toolbar-value-type-is-'+ objType +'">'+ obj[i] +'</span></li>')
@@ -17706,9 +17717,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17706
17717
 
17707
17718
  return parseObject(rules, rules, id, elIsXHR, section)
17708
17719
  }
17709
-
17720
+
17710
17721
  var parseUrls = function(section) {
17711
-
17722
+
17712
17723
  var $el = null;
17713
17724
  var $currentPopin = (gina.hasPopinHandler) ? gina.popin.getActivePopin() : null;
17714
17725
  var isPopinContext = ( gina.hasPopinHandler ) ? true : false;
@@ -17717,7 +17728,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17717
17728
  } else {
17718
17729
  $el = $('body');
17719
17730
  }
17720
-
17731
+
17721
17732
  // look for `404: `
17722
17733
  var found = {}
17723
17734
  , foundStr = null
@@ -17731,19 +17742,19 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17731
17742
  for (; f < fLen; ++f) {
17732
17743
  foundStr = matched[f].replace(/\"(.*)|\"/g, '');
17733
17744
  formMethod = foundStr.match(/\[(.*)\]/g, '')[0].replace(/\[|\]/g,'');
17734
-
17745
+
17735
17746
  routing.getRouteByUrl(foundStr, formMethod)
17736
17747
  }
17737
- }
17738
-
17748
+ }
17749
+
17739
17750
  printLogs();
17740
-
17751
+
17741
17752
  //console.debug('popinIsActive: '+ isPopinContext +'isXHR: ', self.isXHR, ' -> ' + section, routing.notFound);
17742
17753
  }
17743
-
17754
+
17744
17755
  var printLogs = function() {
17745
17756
  fLen = routing.notFound.count();
17746
- if ( fLen > 0 ) {
17757
+ if ( fLen > 0 ) {
17747
17758
  for (f in routing.notFound) {
17748
17759
  console.warn( '(x'+ routing.notFound[f].count +') ' + f + ' => ' + routing.notFound[f].message );
17749
17760
  }
@@ -17751,13 +17762,13 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17751
17762
  }
17752
17763
 
17753
17764
  var parseForms = function (obj, ginaObj, $html, i, $forms, len, elIsXHR) {
17754
-
17765
+
17755
17766
  if (!len) return false;
17756
17767
 
17757
17768
  var attributes = $forms[i].attributes;
17758
17769
  var formMethod = null;
17759
17770
  var attrClass = 'gina-toolbar-form-attributes';
17760
- var id = $forms[i].getAttribute('id') || $forms[i].id;
17771
+ var id = $forms[i].getAttribute('id') || $forms[i].id;
17761
17772
  var section = attrClass; // by default
17762
17773
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
17763
17774
  // form fields set
@@ -17783,8 +17794,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17783
17794
  , routeObj = null
17784
17795
  ;
17785
17796
 
17786
- // testing for action attr to add action route
17787
-
17797
+ // testing for action attr to add action route
17798
+
17788
17799
 
17789
17800
  // adding form attributes
17790
17801
  for ( var a = 0, aLen = attributes.length; a < aLen; ++a ) {
@@ -17800,14 +17811,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17800
17811
  val = '<ul><li>'+ val.replace(/\s+/g, '</li><li>') +'</li></ul>';
17801
17812
 
17802
17813
  if ( /^action$/.test(key) ) {
17803
-
17804
- formMethod = ( typeof(attributes['method']) != 'undefined' ) ? attributes['method'].nodeValue : undefined;
17805
-
17814
+
17815
+ formMethod = ( typeof(attributes['method']) != 'undefined' ) ? attributes['method'].nodeValue : undefined;
17816
+
17806
17817
  if (!formMethod) {
17807
- console.warn('[ ToolbarFormHelper::UndefinedMethod : form `'+ attributes['id'].nodeValue +'` method attribute cannot be left undefined !');
17818
+ console.warn('[ ToolbarFormHelper::UndefinedMethod : form `'+ attributes['id'].nodeValue +'` method attribute cannot be left undefined !');
17808
17819
  }
17809
-
17810
- routeObj = routing.getRouteByUrl(val, formMethod);
17820
+
17821
+ routeObj = routing.getRouteByUrl(val, formMethod);
17811
17822
 
17812
17823
  if ( typeof(routeObj) == 'undefined' || !routeObj ) {
17813
17824
  routeObj = {
@@ -17818,8 +17829,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17818
17829
  file: 'not found'
17819
17830
  }
17820
17831
  }
17821
- }
17822
-
17832
+ }
17833
+
17823
17834
  val = '<ul>' +
17824
17835
  '<li>' +
17825
17836
  '<span class="gina-toolbar-key">url</span>' +
@@ -17872,7 +17883,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17872
17883
 
17873
17884
  }
17874
17885
 
17875
-
17886
+
17876
17887
  content = '<li>' +
17877
17888
  '<span class="gina-toolbar-key">'+ key +':</span>' +
17878
17889
  '<span class="gina-toolbar-value">'+ val +'</span>' +
@@ -17907,15 +17918,15 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17907
17918
  var rules = null;
17908
17919
 
17909
17920
  try {
17910
-
17921
+
17911
17922
  var dataRule = $forms[i].getAttribute('data-gina-form-rule');
17912
-
17923
+
17913
17924
  if ( typeof(dataRule) != 'undefined' && dataRule!= null ) {
17914
17925
  rules = eval('gina.forms.rules.' + dataRule.replace(/-/g, '.'))
17915
17926
  } else {
17916
17927
  rules = eval('gina.forms.rules.' + id.replace(/-/g, '.'))
17917
17928
  }
17918
-
17929
+
17919
17930
  } catch (err) {}
17920
17931
 
17921
17932
  if ( rules ) {
@@ -17925,8 +17936,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17925
17936
  .append('<li class="gina-toolbar-form-'+ section +'">' +
17926
17937
  '<h3 class="gina-toolbar-sub-section-title">'+ section +'</h3>' +
17927
17938
  '<ul class="gina-toolbar-properties">'+ parseSection( rules, id, elIsXHR, section ) +'</ul>' +
17928
- '</li>');
17929
-
17939
+ '</li>');
17940
+
17930
17941
  }
17931
17942
 
17932
17943
 
@@ -17977,7 +17988,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17977
17988
  if ( !$sectionContent.is(':visible') ) {
17978
17989
  $sectionContent.slideToggle()
17979
17990
  }
17980
-
17991
+
17981
17992
  }
17982
17993
 
17983
17994
  var createInputFile = function(id, label) {
@@ -18087,13 +18098,13 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
18087
18098
  if (lastJsonObjectState && typeof (lastJsonObjectState.data) != 'undefined' ) {
18088
18099
  originalData.jsonObject.data = lastJsonObjectState.data;
18089
18100
  }
18090
-
18101
+
18091
18102
  loadData('data', originalData.jsonObject, originalData.ginaJsonObject);
18092
18103
  self.hasParsedUrls = false;
18093
18104
  routing.notFound = {};
18094
18105
  }
18095
18106
 
18096
-
18107
+
18097
18108
  if ( typeof(gina.validator) != 'undefined' ) {
18098
18109
  gina.validator.on('initialized', function onValidatorReady(){
18099
18110
  console.log('toolbar validator ready');
@@ -18101,8 +18112,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
18101
18112
  })
18102
18113
  } else {
18103
18114
  init();
18104
- }
18105
-
18115
+ }
18116
+
18106
18117
  }
18107
18118
 
18108
18119
  return Toolbar
@@ -18312,12 +18323,453 @@ function BindingHelper(handlerContext) {
18312
18323
  }
18313
18324
  // Publish as AMD module
18314
18325
  define( 'helpers/binding',[],function() { return BindingHelper });
18315
- define('gina/link', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/events' ], function (require) {
18326
+ /*
18327
+ * This file is part of the gina package.
18328
+ * Copyright (c) 2009-2023 Rhinostone <contact@gina.io>
18329
+ *
18330
+ * For the full copyright and license information, please view the LICENSE
18331
+ * file that was distributed with this source code.
18332
+ */
18333
+
18334
+ // nodejs dependencies
18335
+ if ( typeof(module) !== 'undefined' && module.exports) {
18336
+ var fs = require('fs');
18337
+ var execSync = require('child_process').execSync;
18338
+ var util = require('util');
18339
+ var promisify = util.promisify;
18340
+ try {
18341
+ // With gina framework only
18342
+ var console = require('../../logger');
18343
+ } catch (err) {}
18344
+ }
18345
+ /**
18346
+ * Domain
18347
+ * Credits & thanks to the Mozilla Community :)
18348
+ * https://publicsuffix.org/
18349
+ *
18350
+ * This lib is using Fetch API (NodeJS >= 18.0.0)
18351
+ * See: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#browser_compatibility
18352
+ *
18353
+ * TODO - Write a cron to periodically check updates from `https://publicsuffix.org/`
18354
+ * TODO - Finalize AMD module support
18355
+ * TODO - Replace execSync of `curl` to a NodeJS based synchronous request
18356
+ *
18357
+ * @param {string} [options] - {
18358
+ * // `.dat` configuration filename
18359
+ * filename: "./dist/public_suffix_list.dat",
18360
+ * // trigger PSL update pulling
18361
+ * isUpdating: false
18362
+ * }
18363
+ */
18364
+ function Domain(options, cb) {
18365
+
18366
+ var isGFFCtx = ( ( typeof(module) !== 'undefined' ) && module.exports ) ? false : true;
18367
+ // Detect if user is on IE browser
18368
+ var isIE = false;
18369
+ if (isGFFCtx) {
18370
+ isIE = !!window.MSInputMethodContext && !!document.documentMode;
18371
+ }
18372
+
18373
+ if ( typeof(arguments[0]) == 'function' ) {
18374
+ cb = arguments[0];
18375
+ options = undefined;
18376
+ }
18377
+
18378
+ var defaultOptions = {
18379
+ // if isGFFCtx, should be place in the public folder to be served by your own host
18380
+ // e.g.: "./public_suffix_list.dat" located under "/my-www-folder/"
18381
+ filename : "../dist/public_suffix_list.dat",
18382
+ url : "https://publicsuffix.org/list/public_suffix_list.dat",
18383
+ alternativeUrl : "https://raw.githubusercontent.com/publicsuffix/list/master/public_suffix_list.dat",
18384
+ // only available from backend calls
18385
+ isCachingRrequired : false,
18386
+ isUpdating : false
18387
+ }
18388
+
18389
+ var self = {
18390
+ options : null,
18391
+ rawPSL : null,
18392
+ PSL : [],
18393
+ };
18394
+
18395
+
18396
+ var init = function(proto, options, cb) {
18397
+ if ( typeof(options) == 'undefined' ) {
18398
+ options = defaultOptions
18399
+ } else {
18400
+ // merge options
18401
+ for(let opt in defaultOptions) {
18402
+ if ( typeof(options[opt]) == 'undefined' ) {
18403
+ options[opt] = defaultOptions[opt];
18404
+ }
18405
+ }
18406
+ }
18407
+
18408
+ if (!isGFFCtx) {
18409
+ options.filename = __dirname +'/'+ options.filename;
18410
+ }
18411
+
18412
+ if (isGFFCtx && options.isCachingRrequired ) {
18413
+ console.warn('[DOMAIN] `options.isCachingRrequired` is only available for backend');
18414
+ options.isCachingRrequired = false
18415
+ }
18416
+
18417
+ self.options = options;
18418
+
18419
+ if (cb) {
18420
+ return loadPSL(options, function onPSLLoaded(err) {
18421
+ if (err) {
18422
+ cb(err);
18423
+ return
18424
+ }
18425
+
18426
+ console.debug('[DOMAIN] PSL Loaded');
18427
+ // return proto
18428
+
18429
+ cb(err, proto)
18430
+ });
18431
+ }
18432
+
18433
+ // Assuming that you have previously initialized Domain
18434
+ loadPSL(options);
18435
+ console.debug('[DOMAIN] PSL Loaded');
18436
+ return proto
18437
+ }
18438
+
18439
+ // TODO - for frontend calls only
18440
+ var onReady = function() {
18441
+
18442
+ }
18443
+
18444
+ var loadPSL = async function(opt, cb) {
18445
+ var filenameOrUrl = (isGFFCtx || opt.isCachingRrequired) ? opt.url : opt.filename;
18446
+ var isUpdating = ( typeof(opt.isUpdating) != 'undefined' ) ? opt.isUpdating : false;
18447
+ var err = null;
18448
+
18449
+ if (isGFFCtx) {
18450
+
18451
+ if (self.rawPSL && !isUpdating) {
18452
+ cb(false);
18453
+ return;
18454
+ }
18455
+
18456
+ if (!window.fetch) {// just in case
18457
+ err = new Error('[DOMAIN] Fetch API not supported');
18458
+ cb(err);
18459
+ return;
18460
+ }
18461
+
18462
+ var response = null
18463
+ , result = null
18464
+ ;
18465
+ try {
18466
+ response = await fetch(filenameOrUrl);
18467
+ result = await response.text();
18468
+
18469
+ self.rawPSL = result;
18470
+ } catch (PSLErr) {
18471
+ // There was an error
18472
+ // console.warn('[DOMAIN] Could not load PSL', err.stack || err.message || err);
18473
+ err = new Error('[DOMAIN] Could not load PSL\n'+ (PSLErr.stack || PSLErr.message || PSLErr) );
18474
+ cb(err);
18475
+ return;
18476
+ }
18477
+
18478
+ opt.isUpdating = false;
18479
+ cb(false);
18480
+
18481
+ return;
18482
+ }
18483
+
18484
+ // file exists ?
18485
+ var exists = false;
18486
+ if ( typeof(fs.accessSync) != 'undefined' ) {
18487
+ try {
18488
+ fs.accessSync(opt.filename, fs.constants.F_OK);
18489
+ exists = true;
18490
+ } catch (err) {
18491
+ exists = false;
18492
+ // to handle symlinks
18493
+ try {
18494
+ if ( fs.lstatSync(opt.filename).isSymbolicLink() ) {
18495
+ exists = true
18496
+ }
18497
+ } catch (linkErr) {}
18498
+ }
18499
+ } else { // support for old version of nodejs
18500
+ exists = fs.existsSync(opt.filename);
18501
+ }
18502
+
18503
+ if (!exists) {
18504
+ opt.isCachingRrequired = true;
18505
+ }
18506
+
18507
+ if (opt.isCachingRrequired) { // Fetch is only supported from NodeJS >= 18.0.0
18508
+ var cmd = 'curl -o '+opt.filename +' '+ opt.url +' >/dev/null 2>&1';
18509
+ console.debug('[DOMAIN] Running: '+ cmd);
18510
+ try {
18511
+ execSync(cmd);
18512
+ } catch (err) {
18513
+ console.warn('[DOMAIN] could not fetch from `'+ opt.url +'`. Trying with `'+ opt.alternativeUrl +'`');
18514
+ cmd = 'curl -o '+opt.filename +' '+ opt.alternativeUrl +' >/dev/null 2>&1';
18515
+ try {
18516
+ execSync(cmd);
18517
+ } catch (altErr) {
18518
+ cb(altErr);
18519
+ return;
18520
+ }
18521
+ }
18522
+ // Waiting for the file to be written
18523
+ var found = false;
18524
+ nIntervId = setInterval(() => {
18525
+ // Check for modules availability
18526
+ if ( typeof(fs.accessSync) != 'undefined' ) {
18527
+ try {
18528
+ fs.accessSync(opt.filename, fs.constants.F_OK);
18529
+ found = true;
18530
+ } catch (err) {
18531
+ found = false;
18532
+ // to handle symlinks
18533
+ try {
18534
+ if ( fs.lstatSync(opt.filename).isSymbolicLink() ) {
18535
+ found = true
18536
+ }
18537
+ } catch (linkErr) {}
18538
+ }
18539
+ } else { // support for old version of nodejs
18540
+ found = fs.existsSync(opt.filename);
18541
+ }
18542
+
18543
+ if ( found ) {
18544
+ clearInterval(nIntervId);
18545
+ self.rawPSL = fs.readFileSync(opt.filename).toString();
18546
+ cb(false);
18547
+
18548
+ return
18549
+ }
18550
+ }, 200);
18551
+
18552
+
18553
+ // TODO - Synchronize this instead of using CURL
18554
+ // var http = require('http');
18555
+
18556
+ // var port = 80;
18557
+ // var urlArr = opt.url.match(/^(http|https)\:\/\/(.*)\//)[0].split(/\//g);
18558
+ // if ( /\:\d+$/.test(urlArr[1]) ) {
18559
+ // port = ~~(urlArr[1].match(/\:\d+$/)[0].replace(/^\:/, ''));
18560
+ // urlArr[1] = urlArr[1].replace(/\:\d+$/, '');
18561
+ // }
18562
+ // var hostname = urlArr[0] +'//'+ urlArr[1];
18563
+ // var path = '/'+ opt.url.split(/\//g).splice(3).join("/");
18564
+
18565
+ // var data = '';
18566
+
18567
+ // var requestOpt = {
18568
+ // hostname: hostname,
18569
+ // port: port,
18570
+ // path: path,
18571
+ // method: 'GET'
18572
+ // };
18573
+
18574
+ // var req = await http.request(options, (res) => {
18575
+ // res.setEncoding('utf8');
18576
+ // res.on('data', (chunk) => {
18577
+ // console.log(`BODY: ${chunk}`);
18578
+ // data += chunk;
18579
+ // });
18580
+ // res.on('end', () => {
18581
+ // console.log('No more data in response.');
18582
+ // });
18583
+ // });
18584
+
18585
+ // req.on('error', (e) => {
18586
+ // console.error(`problem with request: ${e.message}`);
18587
+ // });
18588
+
18589
+ // req.end();
18590
+
18591
+ // self.rawPSL = data.toString();
18592
+
18593
+
18594
+
18595
+ }
18596
+
18597
+ // Just in case some one delete it once `Domain` has been inatialized
18598
+ try {
18599
+ self.rawPSL = fs.readFileSync(opt.filename).toString();
18600
+ if (cb)
18601
+ cb(false)
18602
+ } catch (err) {
18603
+ console.warn('[DOMAIN] could not read from `'+ opt.filename +'`');
18604
+ loadPSL(options, cb)
18605
+ }
18606
+ }
18607
+
18608
+ var updatePSL = function(cb) {
18609
+ self.options.isUpdating = true;
18610
+ loadPSL(self.options, cb);
18611
+ }
18612
+
18613
+
18614
+ /**
18615
+ * Load a json file and removing comments if found
18616
+ *
18617
+ * @return {string} filename - path
18618
+ * @return {boolean} [jsonFormat] - false by default
18619
+ * */
18620
+ var getRootDomain = function(urlOrHostname, jsonFormat) {
18621
+ if ( typeof(jsonFormat) == 'undefined' ) {
18622
+ jsonFormat = false
18623
+ }
18624
+ var isSLD = false
18625
+ , isRegisteredTldOrSld = false
18626
+ , rootDomain = urlOrHostname.replace(/^(.*)\:\/\/|\/(.*)/g, '')
18627
+ // we don't want sub domains: that's why the `.reverse()` is for
18628
+ , rootDomainArr = rootDomain.split(/\./g).reverse()
18629
+ // TLD by default
18630
+ , rootDomainIndex = (rootDomainArr.length) ? rootDomainArr.length-1 : 0
18631
+ ;
18632
+
18633
+ var list = self.rawPSL
18634
+ // remove comments & empty lines
18635
+ .replace(/\/\/\s*(.*)\n|^\s*\n/gm, '')
18636
+ .split(/\n/)
18637
+ .filter( function onFiltered(item, i, iArr) {
18638
+ // formating ^!, ^. & removing extra junk
18639
+ // this is specific to the ginven extensions list
18640
+ if ( /[^a-z 0-9.]+/.test(item) ) {
18641
+ item = item.replace(/[^a-z 0-9.]+/g, '').replace(/^\./g, '');
18642
+ }
18643
+
18644
+ // retain only SLD
18645
+ if ( /\./.test(item) ) {
18646
+ if ( !isSLD && new RegExp('.'+item +'$').test(rootDomain) ) {
18647
+ // Found SLD
18648
+ isSLD = true;
18649
+ // console.debug('Found '+ item);
18650
+ rootDomainIndex = item.split(/\./g).length;
18651
+ // Stop here
18652
+ iArr.splice(0, iArr.length);
18653
+ return false;
18654
+ }
18655
+
18656
+ return item
18657
+ }
18658
+ // also get tld to check later if valid/registered
18659
+ return item
18660
+ });
18661
+
18662
+ // Local or unregistered domain
18663
+ rootDomain = rootDomainArr[rootDomainIndex];
18664
+
18665
+ // TLD & SLD
18666
+ if (rootDomainIndex > 0 ) {
18667
+ // rootDomainArr = rootDomainArr.splice(0, rootDomainIndex);
18668
+ // rootDomain += '.'+ rootDomainArr.reverse().join('.');
18669
+
18670
+ rootDomainArr = rootDomainArr.splice(0, rootDomainIndex);
18671
+ var suffix = rootDomainArr[0];
18672
+ // Remove port number
18673
+ if ( /\:(.*)$/.test(suffix) ) {
18674
+ suffix = suffix.replace(/\:(.*)$/, '');
18675
+ }
18676
+ isRegisteredTldOrSld = ( isSLD || !isSLD && list.indexOf(suffix) > -1 ) ? true : false;
18677
+ if (isRegisteredTldOrSld /**&& isSLD || !isSLD && list.indexOf(suffix) < 0*/ ) {
18678
+ if (rootDomainIndex > 1 && !isSLD) {
18679
+ // This is a TLD
18680
+ rootDomainArr.splice(2);
18681
+ rootDomain = rootDomainArr.reverse().join('.');
18682
+ } else {
18683
+ rootDomain += '.'+ rootDomainArr.reverse().join('.');
18684
+ }
18685
+
18686
+ } else {
18687
+ if (rootDomainIndex > 1) {
18688
+ // Only allowing pseudo TLD here
18689
+ rootDomainArr.splice(2);
18690
+ rootDomain = rootDomainArr.reverse().join('.');
18691
+ } else {
18692
+ rootDomain += '.'+ rootDomainArr.reverse().join('.');
18693
+ }
18694
+ }
18695
+ }
18696
+
18697
+ // Remove port number
18698
+ if ( /\:(.*)$/.test(rootDomain) ) {
18699
+ rootDomain = rootDomain.replace(/\:(.*)$/, '');
18700
+ }
18701
+
18702
+ console.debug('[DOMAIN] isSLD: '+ isSLD, urlOrHostname, ' -> ', rootDomain);
18703
+ if ( /^true$/i.test(jsonFormat) ) {
18704
+ return {
18705
+ value : rootDomain,
18706
+ isSLD : isSLD,
18707
+ isRegisteredTldOrSld: isRegisteredTldOrSld
18708
+ }
18709
+ }
18710
+ return rootDomain
18711
+ }
18712
+
18713
+ // Both backend & frontend
18714
+ var _proto = {
18715
+ getRootDomain : getRootDomain
18716
+ };
18717
+ // Backend proto only
18718
+ if (!isGFFCtx) {
18719
+ _proto.updatePSL = updatePSL;
18720
+ }
18721
+ // Frontend only
18722
+ else {
18723
+ _proto.onReady = onReady;
18724
+ }
18725
+
18726
+
18727
+ if (isGFFCtx && isIE && !window.fetch) {
18728
+ // Create Promise polyfill script tag
18729
+ var promiseScript = document.createElement("script");
18730
+ promiseScript.type = "text/javascript";
18731
+ promiseScript.src =
18732
+ "https://cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.min.js";
18733
+
18734
+ // Create Fetch polyfill script tag
18735
+ var fetchScript = document.createElement("script");
18736
+ fetchScript.type = "text/javascript";
18737
+ fetchScript.src =
18738
+ "https://cdn.jsdelivr.net/npm/whatwg-fetch@3.4.0/dist/fetch.umd.min.js";
18739
+
18740
+ // Add polyfills to head element
18741
+ document.head.appendChild(promiseScript);
18742
+ document.head.appendChild(fetchScript);
18743
+
18744
+ // Wait for the polyfills to load and run the function.
18745
+ // TODO - add a setinterval to trigger `onFetchReady`event
18746
+ return setTimeout(() => {
18747
+ return init(_proto, options, cb)
18748
+ }, 500);
18749
+ } else {
18750
+ return init(_proto, options, cb)
18751
+ }
18752
+
18316
18753
 
18317
- var $ = require('jquery');
18754
+
18755
+ }//EO Domain.
18756
+
18757
+ if ( ( typeof(module) !== 'undefined' ) && module.exports ) {
18758
+ // Publish as node.js module
18759
+ module.exports = Domain
18760
+ } else if ( typeof(define) === 'function' && define.amd) {
18761
+ // Publish as AMD module
18762
+ define( 'utils/domain',[],function() { return Domain })
18763
+ }
18764
+ ;
18765
+ define('gina/link', [ 'require', 'jquery', 'vendor/uuid', 'utils/domain', 'utils/merge', 'utils/events' ], function (require) {
18766
+
18767
+ var $ = require('jquery');
18318
18768
  $.noConflict();
18319
- var uuid = require('vendor/uuid');
18320
- var merge = require('utils/merge');
18769
+ var uuid = require('vendor/uuid');
18770
+ var Domain = require('utils/domain');
18771
+ var domainInstance = null;
18772
+ var merge = require('utils/merge');
18321
18773
 
18322
18774
  require('utils/events'); // events
18323
18775
 
@@ -18462,9 +18914,14 @@ define('gina/link', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/e
18462
18914
  //options.headers['Origin'] = window.protocol+'//'+window.location.host;
18463
18915
  //options.headers['Origin'] = '*';
18464
18916
  //options.headers['Host'] = 'https://freelancer-app.fr.local:3154';
18465
- var isSameDomain = ( new RegExp(window.location.hostname).test(url) ) ? true : false;
18917
+ var hostRootDomain = domainInstance.getRootDomain(window.location.hostname).value;
18918
+ var urlRootDomain = domainInstance.getRootDomain(url).value;
18919
+ var isSameDomain = (hostRootDomain === urlRootDomain) ? true : false;
18920
+ // var isSameDomain = ( new RegExp(window.location.hostname).test(url) ) ? true : false;
18921
+
18466
18922
  if (gina.config.envIsDev) {
18467
- console.debug('Checking CORS from Link plugin...\TODO - local CORS Proxy');
18923
+ console.debug('Checking CORS from Popin plugin...\TODO - local CORS Proxy');
18924
+ console.debug('Is request from same domain ? ', isSameDomain);
18468
18925
  }
18469
18926
  if (!isSameDomain) {
18470
18927
  // proxy external urls
@@ -18790,18 +19247,28 @@ define('gina/link', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/e
18790
19247
  instance.getLinkByUrl = getLinkByUrl;
18791
19248
  }
18792
19249
 
19250
+ new Domain( function onReady(err, _domainInstance) {
19251
+ if (err) {
19252
+ throw err
19253
+ }
19254
+
19255
+ domainInstance = _domainInstance;
19256
+ });
19257
+
18793
19258
  return init(options)
18794
- };
19259
+ }
18795
19260
 
18796
19261
  return Link
18797
19262
  });
18798
- define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/routing', 'utils/events' ], function (require) {
19263
+ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid', 'utils/domain', 'utils/merge', 'utils/routing', 'utils/events' ], function (require) {
18799
19264
 
18800
- var $ = require('jquery');
19265
+ var $ = require('jquery');
18801
19266
  $.noConflict();
18802
- var uuid = require('vendor/uuid');
18803
- var merge = require('utils/merge');
18804
- var routing = require('utils/routing');
19267
+ var uuid = require('vendor/uuid');
19268
+ var Domain = require('utils/domain');
19269
+ var domainInstance = null;
19270
+ var merge = require('utils/merge');
19271
+ var routing = require('utils/routing');
18805
19272
 
18806
19273
  require('utils/events'); // events
18807
19274
 
@@ -19522,10 +19989,10 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19522
19989
  function updateToolbar(result, resultIsObject) {
19523
19990
  // update toolbar errors
19524
19991
  var $popin = getActivePopin();
19525
-
19992
+ var XHRData = null;
19526
19993
  if ( gina && typeof(window.ginaToolbar) != 'undefined' && window.ginaToolbar && typeof(result) != 'undefined' && typeof(resultIsObject) != 'undefined' && result ) {
19527
19994
 
19528
- var XHRData = result;
19995
+ XHRData = result;
19529
19996
 
19530
19997
  try {
19531
19998
  var XHRDataNew = null;
@@ -19560,7 +20027,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19560
20027
 
19561
20028
  // update toolbar
19562
20029
  try {
19563
- var $popin = getPopinById(instance.activePopinId);
20030
+ $popin = getPopinById(instance.activePopinId);
19564
20031
  var $el = $popin.target;
19565
20032
  } catch (err) {
19566
20033
  ginaToolbar.update('data-xhr', err );
@@ -19568,7 +20035,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19568
20035
 
19569
20036
 
19570
20037
  // XHRData
19571
- var XHRData = null;
20038
+ XHRData = null;
19572
20039
  if ( typeof(result) == 'string' && /\<(.*)\>/.test(result) ) {
19573
20040
  // converting Element to DOM object
19574
20041
  XHRData = new DOMParser().parseFromString(result, 'text/html').getElementById('gina-without-layout-xhr-data');
@@ -19609,6 +20076,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19609
20076
  // reset data-xhr
19610
20077
  //ginaToolbar.update("view-xhr", null);
19611
20078
  ginaToolbar.update('view-xhr', XHRView);
20079
+ return;
19612
20080
  }
19613
20081
 
19614
20082
  // popin content
@@ -19693,16 +20161,25 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19693
20161
  //options.headers['Origin'] = window.protocol+'//'+window.location.host;
19694
20162
  //options.headers['Origin'] = '*';
19695
20163
  //options.headers['Host'] = 'https://domain.local:3154';
19696
- var isSameDomain = ( new RegExp(window.location.hostname).test(url) ) ? true : false;
20164
+ var hostRootDomain = domainInstance.getRootDomain(window.location.hostname).value;
20165
+ var urlRootDomain = domainInstance.getRootDomain(url).value;
20166
+ var isSameDomain = (hostRootDomain === urlRootDomain) ? true : false;
20167
+ // var isSameDomain = ( new RegExp(window.location.hostname).test(url) ) ? true : false;
20168
+
19697
20169
  if (gina.config.envIsDev) {
19698
20170
  console.debug('Checking CORS from Popin plugin...\TODO - local CORS Proxy');
20171
+ console.debug('Is request from same domain ? ', isSameDomain);
19699
20172
  }
19700
20173
  if (!isSameDomain) {
19701
20174
  // proxy external urls
19702
20175
  // TODO - instead of using `cors.io` or similar services, try to intégrate a local CORS proxy similar to : http://oskarhane.com/avoid-cors-with-nginx-proxy_pass/
19703
20176
  //url = url.match(/^(https|http)\:/)[0] + '//cors.io/?' + url;
20177
+
20178
+
19704
20179
  url = url.match(/^(https|http)\:/)[0] + '//corsacme.herokuapp.com/?'+ url;
19705
- //url = url.match(/^(https|http)\:/)[0] + '//cors-anywhere.herokuapp.com/' + url;
20180
+ // url = url.match(/^(https|http)\:/)[0] + '//localhost:4100/proxy/?'+ url;
20181
+
20182
+
19706
20183
 
19707
20184
  //delete options.headers['X-Requested-With']
19708
20185
 
@@ -19715,7 +20192,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19715
20192
  // updating popin options
19716
20193
  $popin.options = merge(options, $popin.options);
19717
20194
 
19718
-
20195
+ var result = null;
19719
20196
  if ( options.withCredentials ) { // Preflighted requests
19720
20197
  if ('withCredentials' in xhr) {
19721
20198
  // XHR for Chrome/Firefox/Opera/Safari.
@@ -19731,7 +20208,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19731
20208
  } else {
19732
20209
  // CORS not supported.
19733
20210
  xhr = null;
19734
- var result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
20211
+ result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
19735
20212
  triggerEvent(gina, $el, 'error.' + id, result)
19736
20213
  }
19737
20214
  } else { // simple requests
@@ -19744,7 +20221,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19744
20221
  }
19745
20222
 
19746
20223
 
19747
-
20224
+ var resultIsObject = false;
19748
20225
  if (xhr) {
19749
20226
  // setting up headers
19750
20227
  xhr.withCredentials = ( typeof(options.withCredentials) != 'undefined' ) ? options.withCredentials : false;
@@ -19752,12 +20229,12 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19752
20229
  xhr.onerror = function(event, err) {
19753
20230
 
19754
20231
  var error = 'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.';
19755
- var result = {
20232
+ result = {
19756
20233
  'status': xhr.status, //500,
19757
20234
  'error' : error
19758
20235
  };
19759
20236
 
19760
- var resultIsObject = true;
20237
+ resultIsObject = true;
19761
20238
  instance.eventData.error = result +'\n'+ err;
19762
20239
  updateToolbar(result, resultIsObject);
19763
20240
  triggerEvent(gina, $el, 'error.' + id, result)
@@ -19773,11 +20250,11 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19773
20250
  xhr.onreadystatechange = function (event) {
19774
20251
  if (xhr.readyState == 4) {
19775
20252
  // 200, 201, 201' etc ...
20253
+ var result = null
19776
20254
  if( /^2/.test(xhr.status) ) {
19777
-
19778
20255
  try {
19779
- var result = xhr.responseText
19780
- , contentType = xhr.getResponseHeader("Content-Type")
20256
+ result = xhr.responseText;
20257
+ var contentType = xhr.getResponseHeader("Content-Type")
19781
20258
  , isJsonContent = (/application\/json/.test( contentType )) ? true : false
19782
20259
  , isRedirecting = true // by default
19783
20260
  ;
@@ -19887,10 +20364,15 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19887
20364
  //return
19888
20365
  //}
19889
20366
  if ( !isJsonContent ) {
20367
+ if (GINA_ENV_IS_DEV)
20368
+ updateToolbar(result);
19890
20369
  triggerEvent(gina, $el, 'loaded.' + id, result);
19891
20370
  return
19892
20371
  }
19893
20372
 
20373
+ if (GINA_ENV_IS_DEV)
20374
+ updateToolbar(result);
20375
+
19894
20376
  triggerEvent(gina, $forms[0], 'success.' + id, result);
19895
20377
 
19896
20378
  }
@@ -19900,9 +20382,9 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19900
20382
 
19901
20383
  } catch (err) {
19902
20384
 
19903
- var resultIsObject = false;
20385
+ resultIsObject = false;
19904
20386
 
19905
- var result = {
20387
+ result = {
19906
20388
  'status': 422,
19907
20389
  'error' : err.description || err.stack
19908
20390
  };
@@ -19921,8 +20403,8 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19921
20403
 
19922
20404
  } else {
19923
20405
  //console.log('error event triggered ', event.target, $form);
19924
- var resultIsObject = false;
19925
- var result = {
20406
+ resultIsObject = false;
20407
+ result = {
19926
20408
  'status': xhr.status,
19927
20409
  'error' : xhr.responseText
19928
20410
  };
@@ -20129,8 +20611,8 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
20129
20611
  instance.activePopinId = $popin.id;
20130
20612
 
20131
20613
  // update toolbar
20132
- if (GINA_ENV_IS_DEV)
20133
- updateToolbar();
20614
+ // if (GINA_ENV_IS_DEV)
20615
+ // updateToolbar();
20134
20616
  // var XHRData = document.getElementById('gina-without-layout-xhr-data');
20135
20617
  // if ( gina && typeof(window.ginaToolbar) != 'undefined' && window.ginaToolbar && XHRData ) {
20136
20618
  // try {
@@ -20451,8 +20933,16 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
20451
20933
  popinGetContainer()
20452
20934
  }
20453
20935
 
20936
+ new Domain( function onReady(err, _domainInstance) {
20937
+ if (err) {
20938
+ throw err
20939
+ }
20940
+
20941
+ domainInstance = _domainInstance;
20942
+ });
20943
+
20454
20944
  return init(options)
20455
- };
20945
+ }
20456
20946
 
20457
20947
  return Popin
20458
20948
  });