gina 0.1.1-alpha.161 → 0.1.1-alpha.163

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 (327) hide show
  1. package/README.md +1 -1
  2. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/AUTHORS +0 -0
  3. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/LICENSE +0 -0
  4. package/framework/v0.1.1-alpha.163/VERSION +1 -0
  5. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/html/nolayout.html +0 -0
  6. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/html/static.html +0 -0
  7. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/android-chrome-192x192.png +0 -0
  8. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/android-chrome-512x512.png +0 -0
  9. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/apple-touch-icon.png +0 -0
  10. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/favicon-16x16.png +0 -0
  11. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/favicon-32x32.png +0 -0
  12. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/img/favicon.ico +0 -0
  13. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/gina.js +543 -420
  14. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/gina.min.css +0 -0
  15. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/gina.min.css.map +0 -0
  16. package/framework/v0.1.1-alpha.163/core/asset/plugin/dist/gina.min.js +742 -0
  17. package/framework/v0.1.1-alpha.163/core/asset/plugin/dist/gina.min.js.map +8 -0
  18. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/gina.onload.min.js +0 -0
  19. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/gina.onload.min.js.map +0 -0
  20. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/css/toolbar-min.css +0 -0
  21. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/css/toolbar.css +0 -0
  22. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/css/toolbar.css.map +0 -0
  23. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/js/jquery-3.1.0.min.js +0 -0
  24. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/main.js +0 -0
  25. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/dist/toolbar/toolbar.html +0 -0
  26. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/readme.md +0 -0
  27. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/asset/plugin/uuid.json +0 -0
  28. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/config.js +28 -4
  29. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/index.js +1 -1
  30. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/connector.js +0 -0
  31. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/connector.v2.js +0 -0
  32. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/connector.v3.js +0 -0
  33. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/connector.v4.js +0 -0
  34. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/n1ql.js +0 -0
  35. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/session-store.js +0 -0
  36. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/session-store.v2.js +0 -0
  37. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/session-store.v3.js +0 -0
  38. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/connectors/couchbase/lib/session-store.v4.js +0 -0
  39. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/controller/controller.framework.js +0 -0
  40. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/controller/controller.js +29 -18
  41. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/controller/index.js +0 -0
  42. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/.travis.yml +0 -0
  43. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/LICENSE +0 -0
  44. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/README.md +0 -0
  45. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/deps/encoding/encoding-indexes.js +0 -0
  46. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/deps/encoding/encoding.js +0 -0
  47. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/lib/main.js +0 -0
  48. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/lib/types/multipart.js +0 -0
  49. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/lib/types/urlencoded.js +0 -0
  50. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/lib/utils.js +0 -0
  51. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/busboy/package.json +0 -0
  52. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/deps/swig-client/swig-2.0.0.min.js +0 -0
  53. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/dev/index.js +0 -0
  54. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/dev/lib/class.js +0 -0
  55. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/dev/lib/factory.js +0 -0
  56. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/dev/lib/tools.js +0 -0
  57. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/gna.js +6 -1
  58. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/README.md +5 -0
  59. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/currency.json +0 -0
  60. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/dist/language/en.json +0 -0
  61. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/dist/language/fr.json +0 -0
  62. package/framework/v0.1.1-alpha.163/core/locales/dist/region/en.json +5727 -0
  63. package/framework/v0.1.1-alpha.163/core/locales/dist/region/fr.json +11452 -0
  64. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/index.js +0 -0
  65. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/src/make.js +39 -41
  66. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/src/resources/currency.csv +0 -0
  67. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/locales/src/resources/region.csv +0 -0
  68. package/framework/v0.1.1-alpha.163/core/locales/src/resources/region.mapping.json +33 -0
  69. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/mime.types +0 -0
  70. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/model/entity.js +0 -0
  71. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/model/index.js +0 -0
  72. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/model/template/entityFactory.js +0 -0
  73. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/model/template/index.js +0 -0
  74. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/README.md +0 -0
  75. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/index.js +0 -0
  76. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/file/README.md +0 -0
  77. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/file/build.json +0 -0
  78. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/file/package.json +0 -0
  79. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/intl/README.md +0 -0
  80. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/intl/build.json +0 -0
  81. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/intl/package.json +0 -0
  82. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/intl/src/main.js +0 -0
  83. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/storage/README.md +0 -0
  84. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/storage/build.json +0 -0
  85. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/storage/package.json +0 -0
  86. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/storage/src/main.js +0 -0
  87. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/validator/README.md +0 -0
  88. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/validator/build.json +0 -0
  89. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/validator/package.json +0 -0
  90. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/validator/src/form-validator.js +383 -284
  91. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/plugins/lib/validator/src/main.js +0 -0
  92. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/router.js +0 -0
  93. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/server.express.js +0 -0
  94. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/server.isaac.js +0 -0
  95. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/server.js +28 -28
  96. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/status.codes +0 -0
  97. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/config/app.json +0 -0
  98. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/config/routing.json +0 -0
  99. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/config/settings.json +0 -0
  100. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/config/settings.server.json +4 -4
  101. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/config/templates.json +0 -0
  102. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/controllers/controller.content.js +0 -0
  103. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/controllers/controller.js +0 -0
  104. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/controllers/setup.js +0 -0
  105. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle/index.js +0 -0
  106. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_namespace/controllers/controller.js +0 -0
  107. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_public/css/default.css +0 -0
  108. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_public/css/vendor/readme.md +0 -0
  109. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_public/favicon.ico +0 -0
  110. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_public/js/vendor/readme.md +0 -0
  111. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_public/readme.md +0 -0
  112. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_templates/handlers/main.js +0 -0
  113. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_templates/html/content/homepage.html +0 -0
  114. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_templates/html/includes/error-msg-noscript.html +0 -0
  115. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_templates/html/includes/error-msg-outdated-browser.html +0 -0
  116. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/boilerplate/bundle_templates/html/layouts/main.html +0 -0
  117. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/command/gina.bat.tpl +0 -0
  118. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/command/gina.tpl +0 -0
  119. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/env.json +11 -0
  120. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/manifest.json +0 -0
  121. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/package.json +0 -0
  122. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/settings.json +0 -0
  123. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/statics.json +0 -0
  124. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/conf/templates.json +0 -0
  125. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/client/json/401.json +0 -0
  126. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/client/json/403.json +0 -0
  127. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/client/json/404.json +0 -0
  128. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/server/html/50x.html +0 -0
  129. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/server/json/500.json +0 -0
  130. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/error/server/json/503.json +0 -0
  131. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/core/template/extensions/logger/config.json +0 -0
  132. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/console.js +0 -0
  133. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/context.js +0 -0
  134. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/dateFormat.js +0 -0
  135. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/index.js +0 -0
  136. package/framework/v0.1.1-alpha.163/helpers/json/LICENSE +9 -0
  137. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/json/README.md +0 -0
  138. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/json/package.json +1 -1
  139. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/json/src/main.js +1 -1
  140. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/path.js +0 -0
  141. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/plugins/README.md +0 -0
  142. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/plugins/package.json +1 -1
  143. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/plugins/src/api-error.js +0 -0
  144. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/plugins/src/main.js +0 -0
  145. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/prototypes.js +11 -2
  146. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/task.js +0 -0
  147. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/helpers/text.js +0 -0
  148. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/archiver/README.md +0 -0
  149. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/archiver/build.json +0 -0
  150. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/archiver/package.json +0 -0
  151. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/archiver/src/dep/jszip.min.js +0 -0
  152. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/archiver/src/main.js +0 -0
  153. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/aliases.json +0 -0
  154. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/add.js +0 -0
  155. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/arguments.json +0 -0
  156. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/copy.js +0 -0
  157. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/cp.js +0 -0
  158. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/help.js +0 -0
  159. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/help.txt +0 -0
  160. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/list.js +0 -0
  161. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/remove.js +0 -0
  162. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/rename.js +0 -0
  163. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/restart.js +0 -0
  164. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/rm.js +0 -0
  165. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/start.js +9 -2
  166. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/status.js +0 -0
  167. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/bundle/stop.js +0 -0
  168. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/add.js +0 -0
  169. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/get.js +0 -0
  170. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/help.js +0 -0
  171. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/help.txt +0 -0
  172. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/link-dev.js +0 -0
  173. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/list.js +20 -4
  174. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/remove.js +0 -0
  175. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/rm.js +0 -0
  176. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/set.js +0 -0
  177. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/unset.js +0 -0
  178. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/env/use.js +0 -0
  179. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/build.js +0 -0
  180. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/dot.js +0 -0
  181. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/get.js +0 -0
  182. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/help.js +0 -0
  183. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/help.txt +0 -0
  184. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/init.js +22 -8
  185. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/link-node-modules.js +0 -0
  186. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/link.js +0 -0
  187. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/msg.json +0 -0
  188. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/open.js +0 -0
  189. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/restart.js +0 -0
  190. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/set.js +0 -0
  191. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/start.js +0 -0
  192. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/status.js +0 -0
  193. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/stop.js +0 -0
  194. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/tail.js +26 -2
  195. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/update.js +0 -0
  196. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/framework/version.js +0 -0
  197. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/gina-dev.1.md +0 -0
  198. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/gina-framework.1.md +0 -0
  199. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/gina.1.md +0 -0
  200. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/helper.js +0 -0
  201. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/index.js +0 -0
  202. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/msg.json +0 -0
  203. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/help.js +0 -0
  204. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/help.txt +0 -0
  205. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/inc/scan.js +0 -0
  206. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/list.js +15 -2
  207. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/reset.js +0 -0
  208. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/port/set.js +0 -0
  209. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/add.js +0 -0
  210. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/arguments.json +0 -0
  211. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/build.js +0 -0
  212. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/help.js +0 -0
  213. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/help.txt +0 -0
  214. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/import.js +0 -0
  215. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/list.js +0 -0
  216. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/move.js +0 -0
  217. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/remove.js +0 -0
  218. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/rename.js +0 -0
  219. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/restart.js +0 -0
  220. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/rm.js +0 -0
  221. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/start.js +0 -0
  222. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/status.js +0 -0
  223. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/project/stop.js +0 -0
  224. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/protocol/help.js +0 -0
  225. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/protocol/help.txt +0 -0
  226. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/protocol/list.js +0 -0
  227. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/protocol/set.js +0 -0
  228. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/help.js +0 -0
  229. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/help.txt +0 -0
  230. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/link-local.js +0 -0
  231. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/list.js +24 -8
  232. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/remove.js +0 -0
  233. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/rm.js +0 -0
  234. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/set.js +0 -0
  235. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/unset.js +0 -0
  236. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/scope/use.js +0 -0
  237. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cmd/view/add.js +0 -0
  238. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/collection/README.md +0 -0
  239. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/collection/build.json +0 -0
  240. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/collection/package.json +0 -0
  241. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/collection/src/main.js +0 -0
  242. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/config.js +0 -0
  243. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cron/README.md +0 -0
  244. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cron/package.json +0 -0
  245. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/cron/src/main.js +0 -0
  246. package/framework/v0.1.1-alpha.163/lib/domain/LICENSE +9 -0
  247. package/framework/v0.1.1-alpha.163/lib/domain/README.md +46 -0
  248. package/framework/v0.1.1-alpha.163/lib/domain/dist/public_suffix_list.dat +14186 -0
  249. package/framework/{v0.1.1-alpha.161/lib/routing/README.md → v0.1.1-alpha.163/lib/domain/exemples/backend.js} +0 -0
  250. package/framework/{v0.1.1-alpha.161/lib/routing/build.json → v0.1.1-alpha.163/lib/domain/exemples/frontend.html} +0 -0
  251. package/framework/v0.1.1-alpha.163/lib/domain/package.json +20 -0
  252. package/framework/v0.1.1-alpha.163/lib/domain/src/main.js +335 -0
  253. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/generator/index.js +0 -0
  254. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/index.js +1 -0
  255. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/LICENSE +0 -0
  256. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/README.md +0 -0
  257. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/example/inheriting_eventemitter.js +0 -0
  258. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/example/protected_inheritance.js +0 -0
  259. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/example/simple_inheritance.js +0 -0
  260. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/example/super_attribute_overridden_by_child_on_init.js +0 -0
  261. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/package.json +0 -0
  262. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/inherits/src/main.js +0 -0
  263. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/README.md +0 -0
  264. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/package.json +1 -1
  265. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/default/index.js +0 -0
  266. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/file/index.js +0 -0
  267. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/file/lib/logrotator/README.md +0 -0
  268. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/file/lib/logrotator/index.js +0 -0
  269. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/mq/index.js +5 -0
  270. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/mq/listener.js +0 -0
  271. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/containers/mq/speaker.js +0 -0
  272. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/helper.js +1 -0
  273. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/logger/src/main.js +20 -3
  274. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/math/index.js +0 -0
  275. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/README.md +0 -0
  276. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/example/merge.js +0 -0
  277. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/example/merge_2_literal objects.js +0 -0
  278. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/example/merge_and_preserve_first.js +0 -0
  279. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/package.json +0 -0
  280. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/merge/src/main.js +0 -0
  281. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/model.js +0 -0
  282. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/proc.js +10 -0
  283. package/framework/{v0.1.1-alpha.161/lib/swig-filters → v0.1.1-alpha.163/lib/routing}/README.md +0 -0
  284. package/framework/{v0.1.1-alpha.161/lib/url/README.md → v0.1.1-alpha.163/lib/routing/build.json} +0 -0
  285. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/routing/package.json +0 -0
  286. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/routing/src/main.js +0 -0
  287. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/session-store.js +0 -0
  288. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/shell.js +0 -0
  289. package/framework/v0.1.1-alpha.163/lib/swig-filters/README.md +0 -0
  290. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/swig-filters/package.json +0 -0
  291. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/swig-filters/src/main.js +0 -0
  292. package/framework/v0.1.1-alpha.163/lib/url/README.md +0 -0
  293. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/url/index.js +0 -0
  294. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/url/mocks.json +0 -0
  295. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/url/routing.json +0 -0
  296. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/url/test.js +0 -0
  297. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/lib/validator.js +0 -0
  298. package/framework/{v0.1.1-alpha.161 → v0.1.1-alpha.163}/package.json +0 -0
  299. package/package.json +2 -2
  300. package/script/post_publish.js +2 -1
  301. package/script/prepare_version.js +54 -3
  302. package/services/.gna/67fdf1b224a2ed5597e63d4b64283834468e05e3.txt +0 -0
  303. package/services/.gna/arch +1 -0
  304. package/services/.gna/locals.json +14 -0
  305. package/services/.gna/platform +1 -0
  306. package/services/configure +6 -0
  307. package/services/env.json +10 -0
  308. package/services/manifest.json +18 -0
  309. package/services/package.json +11 -0
  310. package/services/src/proxy/config/app.json +6 -0
  311. package/services/src/proxy/config/routing.json +11 -0
  312. package/services/src/proxy/config/settings.json +9 -0
  313. package/services/src/proxy/config/settings.server.json +31 -0
  314. package/services/src/proxy/config/statics.json +3 -0
  315. package/services/src/proxy/controllers/controller.content.js +58 -0
  316. package/services/src/proxy/controllers/controller.js +30 -0
  317. package/services/src/proxy/controllers/setup.js +111 -0
  318. package/services/src/proxy/index.js +31 -0
  319. package/services/src/proxy/lib/domain/README.md +48 -0
  320. package/services/src/proxy/lib/domain/src/config/public_suffix_list.dat +14186 -0
  321. package/framework/v0.1.1-alpha.161/VERSION +0 -1
  322. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/gina.js.map +0 -56
  323. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/gina.min.js +0 -739
  324. package/framework/v0.1.1-alpha.161/core/asset/plugin/dist/gina.min.js.map +0 -8
  325. package/framework/v0.1.1-alpha.161/core/locales/dist/region/en.json +0 -9492
  326. package/framework/v0.1.1-alpha.161/core/locales/dist/region/fr.json +0 -9492
  327. package/framework/v0.1.1-alpha.161/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
 
@@ -5819,14 +5828,14 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5819
5828
 
5820
5829
  // if (isGFFCtx && !$fields )
5821
5830
  // throw new Error('No `Validator` instance found.\nTry:\nvar FormValidator = require("gina/validator"):\nvar formValidator = new FormValidator(...);')
5822
-
5831
+
5823
5832
  var merge = (isGFFCtx) ? require('utils/merge') : require('../../../../../lib/merge');
5824
5833
  var helpers = (isGFFCtx) ? {} : require('../../../../../helpers');
5825
5834
  var dateFormat = (isGFFCtx) ? require('helpers/dateFormat') : helpers.dateFormat;
5826
5835
  var routing = (isGFFCtx) ? require('utils/routing') : require('../../../../../lib/routing');
5827
-
5836
+
5828
5837
  var hasUserValidators = function() {
5829
-
5838
+
5830
5839
  var _hasUserValidators = false, formsContext = null;
5831
5840
  // backend validation check
5832
5841
  if (!isGFFCtx) {
@@ -5839,7 +5848,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5839
5848
  _hasUserValidators = true
5840
5849
  }
5841
5850
  return _hasUserValidators;
5842
- }
5851
+ }
5843
5852
  /**@js_externs local*/
5844
5853
  var local = {
5845
5854
  'errors': {},
@@ -5888,12 +5897,12 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5888
5897
  self = merge( JSON.clone(data), self );
5889
5898
  local.data = merge( JSON.clone(data), local.data);
5890
5899
  }
5891
-
5900
+
5892
5901
  var getElementByName = function($form, name) { // frontend only
5893
5902
  var $foundElement = null;
5894
5903
  for (let f in fieldsSet) {
5895
5904
  if (fieldsSet[f].name !== name) continue;
5896
-
5905
+
5897
5906
  $foundElement = new DOMParser()
5898
5907
  .parseFromString($form.innerHTML , 'text/html')
5899
5908
  .getElementById( fieldsSet[f].id );
@@ -5901,16 +5910,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5901
5910
  }
5902
5911
  if ($foundElement)
5903
5912
  return $foundElement;
5904
-
5913
+
5905
5914
  throw new Error('Field `'+ name +'` not found in fieldsSet');
5906
5915
  }
5907
-
5916
+
5908
5917
  /**
5909
5918
  * bufferToString - Convert Buffer to String
5910
5919
  * Will apply `Utf8Array` to `String`
5911
- * @param {array} arrayBuffer
5920
+ * @param {array} arrayBuffer
5912
5921
  */
5913
- var bufferToString = function(arrayBuffer) {
5922
+ var bufferToString = function(arrayBuffer) {
5914
5923
  var out = null
5915
5924
  , i = null
5916
5925
  , len = null
@@ -5923,7 +5932,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5923
5932
  i = 0;
5924
5933
  while(i < len) {
5925
5934
  c = arrayBuffer[i++];
5926
- switch (c >> 4) {
5935
+ switch (c >> 4) {
5927
5936
  case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
5928
5937
  // 0xxxxxxx
5929
5938
  out += String.fromCharCode(c);
@@ -5946,22 +5955,40 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5946
5955
 
5947
5956
  return out;
5948
5957
  };
5949
-
5958
+
5959
+ var compileError = function(error, data) {
5960
+ var varArr = error.match(/\{\{([^{{}}]+)\}\}/g );
5961
+ for (let v=0, vLen=varArr.length; v<vLen; v++) {
5962
+ let localValue = varArr[v]
5963
+ .replace(/\[/g, '["')
5964
+ .replace(/\]/g, '"]')
5965
+ .replace(/\{|\}/g, '')
5966
+ .trim();
5967
+
5968
+ try {
5969
+ localValue = eval('data.'+ localValue).replace(/^\"|\"$/g, '');
5970
+ error = error.replace( new RegExp( varArr[v].replace(/\{|\[|\]|\}/g, '\\$&') , 'g'), localValue);
5971
+ } catch(e) {}
5972
+ }
5973
+
5974
+ return error
5975
+ };
5976
+
5950
5977
  // TODO - One method for the front, and one for the server
5951
5978
  var queryFromFrontend = function(options, errorMessage) {
5952
- var errors = self[this['name']]['errors'] || {};
5979
+ var errors = self[this['name']]['errors'] || {};
5953
5980
  var id = this.target.id || this.target.getAttribute('id');
5954
-
5955
-
5956
- // stop if
5957
- // - previous error detected
5958
- if ( !self.isValid() ) {
5981
+
5982
+
5983
+ // stop if
5984
+ // - previous error detected
5985
+ if ( !self.isValid() ) {
5959
5986
  console.debug('stopping on errors ...');
5960
5987
  triggerEvent(gina, this.target, 'asyncCompleted.' + id, self[this['name']]);
5961
5988
  //return self[this.name];
5962
5989
  return;
5963
5990
  }
5964
-
5991
+
5965
5992
  var testedValue = this.target.dataset.ginaFormValidatorTestedValue;
5966
5993
  console.debug('[ '+ this['name'] +' ]', 'TESTED VALUE -> ' + this.value +' vs '+ testedValue);
5967
5994
  var _evt = 'asyncCompleted.' + id;
@@ -5971,53 +5998,54 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
5971
5998
  && typeof(gina.validator.$forms[currentFormId]) != 'undefined'
5972
5999
  && typeof(gina.validator.$forms[currentFormId].cachedErrors) != 'undefined'
5973
6000
  )
5974
- ? gina.validator.$forms[currentFormId].cachedErrors
6001
+ ? gina.validator.$forms[currentFormId].cachedErrors
5975
6002
  : null;
5976
6003
  if ( !testedValue || typeof(testedValue) == 'undefined' || testedValue !== this.value ) {
5977
6004
  this.target.dataset.ginaFormValidatorTestedValue = this.value;
5978
6005
  // remove cachedErrors
5979
- if (
5980
- cachedErrors
6006
+ if (
6007
+ cachedErrors
5981
6008
  && typeof(cachedErrors[this.name]) != 'undefined'
5982
6009
  && typeof(cachedErrors[this.name].query) != 'undefined'
5983
6010
  ) {
5984
6011
  delete cachedErrors[this.name].query;
5985
- if (
6012
+ if (
5986
6013
  typeof(gina.validator.$forms[currentFormId]) != 'undefined'
5987
6014
  &&
5988
6015
  typeof(gina.validator.$forms[currentFormId].errors) != 'undefined'
5989
6016
  ) {
5990
6017
  delete gina.validator.$forms[currentFormId].errors.query;
5991
6018
  }
5992
-
6019
+
5993
6020
  }
5994
6021
  } else if (testedValue === this.value) {
5995
6022
  // not resending to backend, but in case of cached errors, re display same error message
5996
- var hasCachedErrors = false;
5997
- if (
5998
- cachedErrors
6023
+ var hasCachedErrors = false;
6024
+ if (
6025
+ cachedErrors
5999
6026
  && typeof(cachedErrors[this.name]) != 'undefined'
6000
- && typeof(cachedErrors[this.name].query) != 'undefined'
6001
- && typeof(cachedErrors[this.name].query[this.value]) != 'undefined'
6027
+ && typeof(cachedErrors[this.name].query) != 'undefined'
6028
+ && typeof(cachedErrors[this.name].query[this.value]) != 'undefined'
6002
6029
  ) {
6003
6030
  this.error = errorMessage = cachedErrors[this.name].query[this.value].slice(0);
6004
6031
  hasCachedErrors = true;
6005
6032
  }
6006
6033
  errors['query'] = replace( this.error || errorMessage || local.errorLabels['query'], this);
6007
-
6034
+ console.debug('[2] potential cached error detected !! ', hasCachedErrors, cachedErrors, ' vs ', errors['query']);
6035
+
6008
6036
  if (hasCachedErrors) {
6009
6037
  this['errors'] = errors;
6010
6038
  this.valid = false;
6011
6039
  }
6012
- // Do not remove this test
6040
+ // Do not remove this test
6013
6041
  if ( typeof( gina.events[_evt]) != 'undefined' ) {
6014
6042
  triggerEvent(gina, this.target, _evt, self[this['name']]);
6015
- }
6016
-
6043
+ }
6044
+
6017
6045
  return self[this.name];
6018
6046
  }
6019
6047
  //console.debug('Did not return !!!');
6020
-
6048
+
6021
6049
  var xhr = null, _this = this;
6022
6050
  // setting up AJAX
6023
6051
  if (window.XMLHttpRequest) { // Mozilla, Safari, ...
@@ -6032,17 +6060,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6032
6060
  catch (e) {}
6033
6061
  }
6034
6062
  }
6035
-
6063
+
6036
6064
  // forcing to sync mode
6037
- var queryOptions = { isSynchrone: false, headers: {} };
6065
+ var queryOptions = { isSynchrone: false, headers: {} };
6038
6066
  var queryData = options.data || null, strData = null;
6039
6067
  var isInlineValidation = (/^true$/i.test(this.target.form.dataset.ginaFormLiveCheckEnabled)) ? true : false; // TRUE if liveCheckEnabled
6040
-
6068
+
6041
6069
  // replace placeholders by field values
6042
6070
  strData = JSON.stringify(queryData);
6043
6071
  if ( /\$/.test(strData) ) {
6044
6072
  var variables = strData.match(/\$[-_\[\]a-z 0-9]+/g) || [];
6045
- var value = null, key = null;
6073
+ var value = null, key = null;
6046
6074
  for (let i = 0, len = variables.length; i < len; i++) {
6047
6075
  key = variables[i].replace(/\$/g, '');
6048
6076
  re = new RegExp("\\"+ variables[i].replace(/\[|\]/g, '\\$&'), "g");
@@ -6051,26 +6079,26 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6051
6079
  // Retrieving live value instead of using fieldsSet.value
6052
6080
  value = getElementByName(this.target.form, key).value;
6053
6081
  }
6054
-
6082
+
6055
6083
  strData = strData.replace( re, value );
6056
6084
  }
6057
6085
  }
6058
6086
  // cleanup before sending
6059
- queryData = strData.replace(/\\"/g, '');
6087
+ queryData = strData.replace(/\\"/g, '');
6060
6088
  // TODO - support regexp for validIf
6061
6089
  var validIf = ( typeof(options.validIf) == 'undefined' ) ? true : options.validIf;
6062
-
6090
+
6063
6091
  queryOptions = merge(queryOptions, options, xhrOptions);
6064
6092
  delete queryOptions.data;
6065
6093
  delete queryOptions.validIf;
6066
-
6094
+
6067
6095
  var enctype = queryOptions.headers['Content-Type'];
6068
6096
  var result = null
6069
6097
  , $target = this.target
6070
6098
  //, id = $target.getAttribute('id')
6071
6099
  ;
6072
6100
  id = $target.getAttribute('id')
6073
-
6101
+
6074
6102
  // checking url
6075
6103
  if (!/^http/.test(queryOptions.url) && /\@/.test(queryOptions.url) ) {
6076
6104
  try {
@@ -6080,7 +6108,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6080
6108
  throw routingError;
6081
6109
  }
6082
6110
  }
6083
-
6111
+
6084
6112
  if ( queryOptions.withCredentials ) {
6085
6113
  if ('withCredentials' in xhr) {
6086
6114
  // XHR for Chrome/Firefox/Opera/Safari.
@@ -6096,7 +6124,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6096
6124
  // xhr.open(queryOptions.method, queryOptions.url, queryOptions.isSynchrone);
6097
6125
  // } else {
6098
6126
  xhr.open(queryOptions.method, queryOptions.url);
6099
- // }
6127
+ // }
6100
6128
  } else {
6101
6129
  // CORS not supported.
6102
6130
  xhr = null;
@@ -6104,10 +6132,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6104
6132
  //triggerEvent(gina, $target, 'error.' + id, result);
6105
6133
  throw new Error(result);
6106
6134
  }
6107
-
6135
+
6108
6136
  if ( typeof(queryOptions.responseType) != 'undefined' ) {
6109
6137
  /**
6110
- * Note: We expect to remove support for synchronous use of XMLHTTPRequest() during page unloads in Chrome in version 88,
6138
+ * Note: We expect to remove support for synchronous use of XMLHTTPRequest() during page unloads in Chrome in version 88,
6111
6139
  * scheduled to ship in January 2021.
6112
6140
  * The XMLHttpRequest2 spec was recently changed to prohibit sending a synchronous request when XMLHttpRequest.responseType
6113
6141
  */
@@ -6124,132 +6152,212 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6124
6152
  xhr.open(queryOptions.method, queryOptions.url)
6125
6153
  }
6126
6154
  }
6127
-
6155
+
6128
6156
  // setting up headers - all but Content-Type ; it will be set right before .send() is called
6129
6157
  for (var hearder in queryOptions.headers) {
6130
6158
  if (hearder == 'Content-Type' && typeof (enctype) != 'undefined' && enctype != null && enctype != '')
6131
6159
  continue;
6132
6160
 
6133
6161
  xhr.setRequestHeader(hearder, queryOptions.headers[hearder]);
6134
- }
6162
+ }
6135
6163
  if (typeof (enctype) != 'undefined' && enctype != null && enctype != '') {
6136
6164
  xhr.setRequestHeader('Content-Type', enctype);
6137
6165
  }
6138
-
6139
- if (xhr) {
6140
-
6141
- xhr.onload = function () {
6142
-
6143
- var onResult = function(result) {
6144
-
6145
- _this.value = local['data'][_this.name] = (_this.value) ? _this.value.toLowerCase() : _this.value;
6146
-
6147
- var isValid = result.isValid || false;
6148
- if (validIf != isValid) {
6149
- isValid = false;
6150
- } else {
6151
- isValid = true;
6166
+
6167
+ var onResult = function(result) {
6168
+
6169
+ _this.value = local['data'][_this.name] = (_this.value) ? _this.value.toLowerCase() : _this.value;
6170
+
6171
+ var isValid = result.isValid || false;
6172
+ if (validIf != isValid) {
6173
+ isValid = false;
6174
+ } else {
6175
+ isValid = true;
6176
+ }
6177
+ self[_this['name']].valid = isValid;
6178
+ var errors = self[_this['name']]['errors'] || {};
6179
+
6180
+ var errorFields = ( typeof(result.error) != 'undefined' && typeof(result.fields) != 'undefined' ) ? result.fields : {};
6181
+
6182
+ if (errorFields.count() > 0 && !isValid || !isValid) {
6183
+
6184
+ if (!isValid) {
6185
+ var systemError = null;
6186
+ if ( typeof(errorFields[_this.name]) != 'undefined') {
6187
+
6188
+ // compiling against rules[field].query.data
6189
+ local.errorLabels['query'] = compileError(errorFields[_this.name], options.data);
6190
+
6191
+
6192
+ } else if ( typeof(result.error) != 'undefined' && /^5/.test(result.status) ) {
6193
+ // system error
6194
+ systemError = result.error;
6152
6195
  }
6153
- self[_this['name']].valid = isValid;
6154
- var errors = self[_this['name']]['errors'] || {};
6155
-
6156
- var errorFields = ( typeof(result.error) != 'undefined' && typeof(result.fields) != 'undefined' ) ? result.fields : {};
6157
-
6158
- if (errorFields.count() > 0 && !isValid || !isValid) {
6159
-
6160
- if (!isValid) {
6161
- var systemError = null;
6162
- if ( typeof(errorFields[_this.name]) != 'undefined') {
6163
- local.errorLabels['query'] = errorFields[_this.name];
6164
- } else if ( typeof(result.error) != 'undefined' && /^5/.test(result.status) ) {
6165
- // system error
6166
- //console.debug('found system error: ', result);
6167
- systemError = result.error;
6168
- }
6169
- errors['query'] = replace(systemError || _this['error'] || options['error'] || local.errorLabels['query'], _this);
6170
- console.debug('query error detected !! ', result);
6171
- }
6172
-
6173
- if ( !errors['query'] && _this.value == '' ) {
6174
- isValid = true;
6175
- }
6196
+ // Fixed on 2023-01-10
6197
+ // We want `local.errorLabels['query']` before the generic|user defined `rule` error
6198
+ errors['query'] = replace(systemError || _this['error'] || local.errorLabels['query'] || options['error'], _this);
6199
+ console.debug('[1] query error detected !! ', result);
6200
+ }
6201
+
6202
+ if ( !errors['query'] && _this.value == '' ) {
6203
+ isValid = true;
6204
+ }
6205
+ }
6206
+
6207
+ // if error tagged by a previous validation, remove it when isValid == true
6208
+ if ( isValid && typeof(errors['query']) != 'undefined' ) {
6209
+ delete errors['query'];
6210
+ }
6211
+
6212
+ // To handle multiple errors from backend
6213
+ // for (var f in errorFields.length) {
6214
+ // if ( !errors['query'] && _this.value == '' ) {
6215
+ // isValid = true;
6216
+ // }
6217
+
6218
+ // if (!isValid) {
6219
+ // errors['query'] = replace(_this['error'] || local.errorLabels['query'], _this)
6220
+ // }
6221
+ // // if error tagged by a previous validation, remove it when isValid == true
6222
+ // else if ( isValid && typeof(errors['query']) != 'undefined' ) {
6223
+ // delete errors['query'];
6224
+ // }
6225
+ // }
6226
+
6227
+ _this.valid = isValid;
6228
+ var cachedErrors = gina.validator.$forms[_this.target.form.getAttribute('id')].cachedErrors || {};
6229
+ if ( errors.count() > 0 ) {
6230
+
6231
+ _this['errors'] = errors;
6232
+ if ( typeof(self[_this['name']].errors) == 'undefined' ) {
6233
+ self[_this['name']].errors = {};
6234
+ }
6235
+
6236
+ self[_this['name']].errors = merge(self[_this['name']].errors, errors);
6237
+
6238
+ if ( typeof(errors.query) != 'undefined' && errors.query ) {
6239
+
6240
+ if ( typeof(cachedErrors[_this.name]) == 'undefined' ) {
6241
+ cachedErrors[_this.name] = {}
6176
6242
  }
6177
-
6178
- // if error tagged by a previous validation, remove it when isValid == true
6179
- if ( isValid && typeof(errors['query']) != 'undefined' ) {
6180
- delete errors['query'];
6243
+ if ( typeof(cachedErrors[_this.name].query) == 'undefined' ) {
6244
+ cachedErrors[_this.name].query = {}
6181
6245
  }
6182
-
6183
- // To handle multiple errors from backend
6184
- // for (var f in errorFields.length) {
6185
- // if ( !errors['query'] && _this.value == '' ) {
6186
- // isValid = true;
6187
- // }
6188
-
6189
- // if (!isValid) {
6190
- // errors['query'] = replace(_this['error'] || local.errorLabels['query'], _this)
6191
- // }
6192
- // // if error tagged by a previous validation, remove it when isValid == true
6193
- // else if ( isValid && typeof(errors['query']) != 'undefined' ) {
6194
- // delete errors['query'];
6195
- // }
6196
- // }
6197
-
6198
- _this.valid = isValid;
6199
- var cachedErrors = gina.validator.$forms[_this.target.form.getAttribute('id')].cachedErrors || {};
6200
- if ( errors.count() > 0 ) {
6201
-
6202
- _this['errors'] = errors;
6203
- if ( typeof(self[_this['name']].errors) == 'undefined' ) {
6204
- self[_this['name']].errors = {};
6205
- }
6206
-
6207
- self[_this['name']].errors = merge(self[_this['name']].errors, errors);
6208
-
6209
- if ( typeof(errors.query) != 'undefined' && errors.query ) {
6210
-
6211
- if ( typeof(cachedErrors[_this.name]) == 'undefined' ) {
6212
- cachedErrors[_this.name] = {}
6213
- }
6214
- if ( typeof(cachedErrors[_this.name].query) == 'undefined' ) {
6215
- cachedErrors[_this.name].query = {}
6216
- }
6217
-
6218
- cachedErrors[_this.name].query[_this.value] = errors.query.slice(0);
6219
- }
6220
-
6221
- var errClass = _this.target.getAttribute('data-gina-form-errors');
6222
- if ( !/query/.test(errClass) ) {
6223
- if ( !errClass || errClass =='' ) {
6224
- errClass = 'query'
6225
- } else {
6226
- errClass +=' query'
6246
+
6247
+ cachedErrors[_this.name].query[_this.value] = errors.query.slice(0);
6248
+ }
6249
+
6250
+ var errClass = _this.target.getAttribute('data-gina-form-errors');
6251
+ if ( !/query/.test(errClass) ) {
6252
+ if ( !errClass || errClass =='' ) {
6253
+ errClass = 'query'
6254
+ } else {
6255
+ errClass +=' query'
6256
+ }
6257
+ _this.target.setAttribute('data-gina-form-errors', errClass);
6258
+ }
6259
+ } else if (
6260
+ typeof(cachedErrors[_this.name]) != 'undefined'
6261
+ && typeof(cachedErrors[_this.name].query) != 'undefined'
6262
+ && typeof(cachedErrors[_this.name].query[_this.value]) != 'undefined'
6263
+ ) {
6264
+ delete cachedErrors[_this.name].query[_this.value];
6265
+ }
6266
+
6267
+ var id = _this.target.id || _this.target.getAttribute('id');
6268
+ console.debug('prematurely completed event `'+ 'asyncCompleted.' + id +'`');
6269
+ return triggerEvent(gina, _this.target, 'asyncCompleted.' + id, self[_this['name']]);
6270
+ } // EO onResult
6271
+
6272
+
6273
+ if (xhr) {
6274
+
6275
+ xhr.onerror = function(event, err) {
6276
+
6277
+ var error = 'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.';
6278
+ var result = {
6279
+ 'status': xhr.status, //500,
6280
+ 'error' : error
6281
+ };
6282
+
6283
+ console.debug('query error [2] detected !! ', err, error);
6284
+ isOnException = true;
6285
+ result = this.responseText;
6286
+ var contentType = this.getResponseHeader("Content-Type");
6287
+ if ( /\/json/.test( contentType ) ) {
6288
+ result = JSON.parse(this.responseText);
6289
+
6290
+ if ( typeof(result.status) == 'undefined' )
6291
+ result.status = this.status;
6292
+
6293
+ //triggerEvent(gina, $target, 'success.' + id, result);
6294
+ return onResult(result)
6295
+ } else {
6296
+ result = { 'status': xhr.status, 'message': '' };
6297
+ if ( /^(\{|\[)/.test( xhr.responseText ) ) {
6298
+ try {
6299
+ result = merge( result, JSON.parse(xhr.responseText) );
6300
+ } catch (err) {
6301
+ result = merge(result, err);
6227
6302
  }
6228
- _this.target.setAttribute('data-gina-form-errors', errClass);
6229
6303
  }
6230
- } else if (
6231
- typeof(cachedErrors[_this.name]) != 'undefined'
6232
- && typeof(cachedErrors[_this.name].query) != 'undefined'
6233
- && typeof(cachedErrors[_this.name].query[_this.value]) != 'undefined'
6234
- ) {
6235
- delete cachedErrors[_this.name].query[_this.value];
6304
+ return onResult(result);
6236
6305
  }
6237
-
6238
- var id = _this.target.id || _this.target.getAttribute('id');
6239
- console.debug('prematurely completed event `'+ 'asyncCompleted.' + id +'`');
6240
- return triggerEvent(gina, _this.target, 'asyncCompleted.' + id, self[_this['name']]);
6241
- }
6242
-
6306
+
6307
+ }// Eo xhr.onerror
6308
+
6309
+ // catching ready state cb
6310
+ // var isOnException = false;
6311
+ // xhr.onreadystatechange = function (event) {
6312
+ // if (xhr.readyState == 4) {
6313
+
6314
+ // console.warn(xhr.status, xhr.responseText);
6315
+
6316
+ // if (xhr.status === 200) {
6317
+ // console.log("-> Success [3]" + xhr.responseText);
6318
+ // try {
6319
+ // result = this.responseText;
6320
+ // var contentType = this.getResponseHeader("Content-Type");
6321
+ // if ( /\/json/.test( contentType ) ) {
6322
+ // result = JSON.parse(this.responseText);
6323
+
6324
+ // if ( typeof(result.status) == 'undefined' )
6325
+ // result.status = this.status;
6326
+
6327
+ // //triggerEvent(gina, $target, 'success.' + id, result);
6328
+ // return onResult(result)
6329
+ // } else {
6330
+ // result = { 'status': xhr.status, 'message': '' };
6331
+ // if ( /^(\{|\[)/.test( xhr.responseText ) ) {
6332
+ // try {
6333
+ // result = merge( result, JSON.parse(xhr.responseText) );
6334
+ // } catch (err) {
6335
+ // result = merge(result, err);
6336
+ // }
6337
+ // }
6338
+ // return onResult(result);
6339
+ // }
6340
+ // } catch (err) {
6341
+ // throw err;
6342
+ // }
6343
+ // } else {
6344
+ // isOnException = true;
6345
+ // console.log("-> Error [3]", xhr.statusText, 'isOnException: '+ isOnException);
6346
+ // }
6347
+ // }
6348
+ // } // EO xhr.onreadystatechange = function (event) {
6349
+
6350
+ xhr.onload = function () {
6243
6351
  try {
6244
6352
  result = this.responseText;
6245
6353
  var contentType = this.getResponseHeader("Content-Type");
6246
6354
  if ( /\/json/.test( contentType ) ) {
6247
6355
  result = JSON.parse(this.responseText);
6248
-
6356
+
6249
6357
  if ( typeof(result.status) == 'undefined' )
6250
6358
  result.status = this.status;
6251
-
6252
- //triggerEvent(gina, $target, 'success.' + id, result);
6359
+
6360
+ //triggerEvent(gina, $target, 'success.' + id, result);
6253
6361
  return onResult(result)
6254
6362
  } else {
6255
6363
  result = { 'status': xhr.status, 'message': '' };
@@ -6264,32 +6372,32 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6264
6372
  }
6265
6373
  } catch (err) {
6266
6374
  throw err;
6267
- }
6268
- }
6269
-
6375
+ }
6376
+ }// xhr.onload = function () {
6377
+
6270
6378
  if (data) {
6271
6379
  xhr.send( queryData ); // stringyfied
6272
6380
  } else {
6273
6381
  xhr.send();
6274
- }
6382
+ }
6275
6383
  }
6276
6384
  }
6277
-
6385
+
6278
6386
  /**
6279
6387
  * queryFromBackend
6280
- *
6281
- *
6282
- * @param {object} options
6283
- * @param {object} request
6284
- * @param {object} response
6388
+ *
6389
+ *
6390
+ * @param {object} options
6391
+ * @param {object} request
6392
+ * @param {object} response
6285
6393
  * @param {callback} next
6286
- *
6287
- *
6394
+ *
6395
+ *
6288
6396
  */
6289
6397
  var queryFromBackend = async function(options, request, response, next) {
6290
6398
  var Config = require(_(GINA_FRAMEWORK_DIR +'/core/config.js', true));
6291
6399
  var config = new Config().getInstance();
6292
-
6400
+
6293
6401
  var opt = null
6294
6402
  //appConf.proxy.<bundle>;
6295
6403
  , rule = null
@@ -6298,7 +6406,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6298
6406
  ;
6299
6407
  // trying to retrieve proxy conf
6300
6408
  if ( /\@/.test(options.url) ) {
6301
- var attr = options.url.split(/@/);
6409
+ var attr = options.url.split(/@/);
6302
6410
  rule = attr[0];
6303
6411
  bundle = attr[1];
6304
6412
  var proxyConf = getConfig( currentBundle, 'app' ).proxy;
@@ -6306,11 +6414,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6306
6414
  if (config.bundle !== bundle) { // ignore if same bundle
6307
6415
  // getting proxy conf when available
6308
6416
  opt = getConfig( currentBundle, 'app' ).proxy[bundle];
6309
- }
6417
+ }
6310
6418
  } catch (proxyError) {
6311
6419
  throw new Error('Could not retrieve `proxy` configuration for bundle `'+ bundle +'`. Please check your `/config/app.json`.\n'+proxyError.stack);
6312
6420
  }
6313
-
6421
+
6314
6422
  attr = null;
6315
6423
  } else {
6316
6424
  // TODO - handle else; when it is an external domain/url
@@ -6318,7 +6426,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6318
6426
  }
6319
6427
  var route = JSON.clone(routing.getRoute(options.url, options.data));
6320
6428
  var env = config.env;
6321
- var conf = config[bundle][env];
6429
+ var conf = config[bundle][env];
6322
6430
  if (!opt) { // setup opt by default if no proxy conf found
6323
6431
  if (config.bundle == bundle) {
6324
6432
  var credentials = getConfig( currentBundle, 'settings' ).server.credentials;
@@ -6328,13 +6436,13 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6328
6436
  options.protocol = conf.server.protocol;
6329
6437
  options.rejectUnauthorized = false;
6330
6438
  }
6331
- opt = {
6439
+ opt = {
6332
6440
  "ca" : options.ca,
6333
- "hostname" : options.hostname,
6334
- "port" : options.port,
6441
+ "hostname" : options.hostname,
6442
+ "port" : options.port,
6335
6443
  "path" : options.path
6336
6444
  };
6337
-
6445
+
6338
6446
  if ( typeof(options.protocol) != 'undefined' ) {
6339
6447
  opt.protocol = options.protocol
6340
6448
  }
@@ -6342,7 +6450,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6342
6450
  opt.rejectUnauthorized = options.rejectUnauthorized
6343
6451
  }
6344
6452
  }
6345
-
6453
+
6346
6454
  /**
6347
6455
  * BO routing configuration
6348
6456
  * Attention: this portion of code is from `router.js`
@@ -6361,7 +6469,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6361
6469
  isXMLRequest : request.isXMLRequest,
6362
6470
  isWithCredentials : request.isWithCredentials
6363
6471
  };
6364
-
6472
+
6365
6473
  var templateName = params.rule.replace('\@'+ bundle, '') || '_common';
6366
6474
  var routeHasViews = ( typeof(conf.content.templates) != 'undefined' ) ? true : false;
6367
6475
  var controllerOptions = {
@@ -6384,9 +6492,9 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6384
6492
  //path: params.param.path || null, // user custom path : namespace should be ignored | left blank
6385
6493
  //assets: {}
6386
6494
  };
6387
-
6388
- controllerOptions = merge(controllerOptions, params);
6389
-
6495
+
6496
+ controllerOptions = merge(controllerOptions, params);
6497
+
6390
6498
  // BO - Template outside of namespace fix added on 2021-08-19
6391
6499
  // We want to keep original conf untouched
6392
6500
  controllerOptions.conf = JSON.clone(conf);
@@ -6397,7 +6505,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6397
6505
  && typeof(controllerOptions.template.ginaLoader) == 'undefined'
6398
6506
  ) {
6399
6507
  controllerOptions.template.ginaLoader = controllerOptions.conf.content.templates._common.ginaLoader;
6400
- }
6508
+ }
6401
6509
  controllerOptions.conf.content.routing[controllerOptions.rule].param = params.param;
6402
6510
  delete controllerOptions.middleware;
6403
6511
  delete controllerOptions.param;
@@ -6406,17 +6514,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6406
6514
  /**
6407
6515
  * EO routing configuration
6408
6516
  */
6409
-
6517
+
6410
6518
  var Controller = require(_(GINA_FRAMEWORK_DIR +'/core/controller/controller.js'), true);
6411
6519
  var controller = new Controller(controllerOptions);
6412
- controller.name = route.param.control;
6520
+ controller.name = route.param.control;
6413
6521
  //controller.serverInstance = serverInstance;
6414
6522
  controller.setOptions(request, response, next, controllerOptions);
6415
-
6416
-
6523
+
6524
+
6417
6525
  var data = ( typeof(options.data) == 'object' && options.data.count() > 0 )
6418
6526
  ? options.data
6419
- : {};
6527
+ : {};
6420
6528
  // inherited data from current query asking for validation
6421
6529
  var urlParams = '';
6422
6530
  if ( /^get|delete|put$/i.test(options.method) ) {
@@ -6434,11 +6542,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6434
6542
  opt.method = options.method;
6435
6543
  //opt.path = route.url + urlParams;
6436
6544
  opt.path = route.url;
6437
-
6545
+
6438
6546
  var util = require('util');
6439
6547
  var promisify = util.promisify;
6440
6548
  var result = { isValid: false }, err = false;
6441
-
6549
+
6442
6550
  await promisify(controller.query)(opt, data)
6443
6551
  .then(function onResult(_result) {
6444
6552
  result = _result;
@@ -6450,10 +6558,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6450
6558
  //throw err;
6451
6559
  console.error(err);
6452
6560
  result.error = err;
6453
- }
6561
+ }
6454
6562
  return result;
6455
6563
  };
6456
-
6564
+
6457
6565
  /**
6458
6566
  * query
6459
6567
  */
@@ -6468,16 +6576,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6468
6576
  /**
6469
6577
  * addField
6470
6578
  * Add field to the validation context
6471
- * @param {string} el
6472
- * @param {string|boolean|number|object} [value]
6579
+ * @param {string} el
6580
+ * @param {string|boolean|number|object} [value]
6473
6581
  */
6474
- var addField = function(el, value) {
6582
+ var addField = function(el, value) {
6475
6583
  var val = null, label = null;
6476
-
6584
+
6477
6585
  if ( typeof(self[el]) == 'undefined' && typeof(value) != 'undefined' ) {
6478
6586
  self[el] = val = value;
6479
6587
  }
6480
-
6588
+
6481
6589
  if ( typeof(self[el]) == 'object' ) {
6482
6590
  try {
6483
6591
  val = JSON.parse( JSON.stringify( self[el] ))
@@ -6527,17 +6635,17 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6527
6635
  var alias = ( typeof(window) != 'undefined' && typeof(window._currentValidatorAlias) != 'undefined' ) ? window._currentValidatorAlias : 'is';
6528
6636
  if ( typeof(window) != 'undefined' && window._currentValidatorAlias)
6529
6637
  delete window._currentValidatorAlias;
6530
-
6531
- var errors = self[this['name']]['errors'] || {};
6638
+
6639
+ var errors = self[this['name']]['errors'] || {};
6532
6640
  local.data[this.name] = self[this.name].value;
6533
-
6534
- if (
6641
+
6642
+ if (
6535
6643
  typeof(errors['isRequired']) == 'undefined'
6536
6644
  && this.value == ''
6537
- && !/^false$/i.test(this.value)
6538
- && this.value != 0
6645
+ && !/^false$/i.test(this.value)
6646
+ && this.value != 0
6539
6647
  ||
6540
- !errors['isRequired']
6648
+ !errors['isRequired']
6541
6649
  && this.value == ''
6542
6650
  && !/^false$/i.test(this.value)
6543
6651
  && this.value != 0
@@ -6546,14 +6654,14 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6546
6654
  } else if (!errors['isRequired'] && typeof(this.value) == 'string' && this.value == '') {
6547
6655
  isValid = true;
6548
6656
  }
6549
-
6657
+
6550
6658
  if ( !isValid && /^(true|false)$/i.test(condition) ) { // because it can be evaluated on backend validation
6551
6659
  isValid = condition;
6552
6660
  } else if (!isValid) {
6553
6661
  var re = null, flags = null;
6554
6662
  // Fixed on 2021-03-13: $variable now replaced with real value beafore validation
6555
6663
  if ( /[\!\=>\>\<a-z 0-9]+/i.test(condition) ) {
6556
- var variables = condition.match(/\${0}[-_,.\[\]a-z0-9]+/ig); // without space(s)
6664
+ var variables = condition.match(/\${0}[-_,.\[\]a-z0-9]+/ig); // without space(s)
6557
6665
  if (variables && variables.length > 0) {
6558
6666
  var compiledCondition = condition;
6559
6667
  for (var i = 0, len = variables.length; i < len; ++i) {
@@ -6569,7 +6677,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6569
6677
  }
6570
6678
  }
6571
6679
  }
6572
-
6680
+
6573
6681
  try {
6574
6682
  // security checks
6575
6683
  compiledCondition = compiledCondition.replace(/(\(|\)|return)/g, '');
@@ -6578,7 +6686,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6578
6686
  } else {
6579
6687
  isValid = eval(compiledCondition)
6580
6688
  }
6581
-
6689
+
6582
6690
  } catch (err) {
6583
6691
  throw new Error(err.stack||err.message)
6584
6692
  }
@@ -6602,7 +6710,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6602
6710
  } else {
6603
6711
  isValid = eval(condition);
6604
6712
  }
6605
-
6713
+
6606
6714
  //valid = new RegExp(condition.replace(/\//g, '')).test(this.value)
6607
6715
  } catch (err) {
6608
6716
  throw new Error(err.stack||err.message)
@@ -6615,7 +6723,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6615
6723
  if ( typeof(errorStack) != 'undefined' )
6616
6724
  errors['stack'] = errorStack;
6617
6725
  }
6618
- // if error tagged by a previous vlaidation, remove it when isValid == true
6726
+ // if error tagged by a previous vlaidation, remove it when isValid == true
6619
6727
  else if ( isValid && typeof(errors[alias]) != 'undefined' ) {
6620
6728
  delete errors[alias];
6621
6729
  //delete errors['stack'];
@@ -6625,16 +6733,16 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6625
6733
  if ( errors.count() > 0 )
6626
6734
  this['errors'] = errors;
6627
6735
 
6628
-
6736
+
6629
6737
  return self[this.name]
6630
6738
  }
6631
-
6739
+
6632
6740
  self[el]['set'] = function(value) {
6633
6741
  this.value = local['data'][this.name] = value;
6634
- // html
6742
+ // html
6635
6743
  this.target.setAttribute('value', value);
6636
6744
  // Todo : select and radio case to apply change
6637
-
6745
+
6638
6746
  return self[this.name]
6639
6747
  }
6640
6748
 
@@ -6643,15 +6751,15 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6643
6751
 
6644
6752
  this.value = local['data'][this.name] = (this.value) ? this.value.toLowerCase() : this.value;
6645
6753
  // Apply on current field upper -> lower
6646
- if (
6754
+ if (
6647
6755
  isGFFCtx
6648
6756
  && this.target
6649
- && this.target.value != ''
6650
- && /[A-Z]+/.test(this.target.value)
6757
+ && this.target.value != ''
6758
+ && /[A-Z]+/.test(this.target.value)
6651
6759
  ) {
6652
6760
  this.target.value = this.value;
6653
6761
  }
6654
-
6762
+
6655
6763
 
6656
6764
  var rgx = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
6657
6765
  var isValid = rgx.test(this['value']) ? true : false;
@@ -6664,7 +6772,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6664
6772
  if (!isValid) {
6665
6773
  errors['isEmail'] = replace(this['error'] || local.errorLabels['isEmail'], this)
6666
6774
  }
6667
- // if error tagged by a previous vlaidation, remove it when isValid == true
6775
+ // if error tagged by a previous vlaidation, remove it when isValid == true
6668
6776
  else if ( isValid && typeof(errors['isEmail']) != 'undefined' ) {
6669
6777
  delete errors['isEmail'];
6670
6778
  //delete errors['stack'];
@@ -6683,11 +6791,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6683
6791
 
6684
6792
  this.value = local['data'][this.name] = (this.value) ? this.value.toLowerCase() : this.value;
6685
6793
  // Apply on current field upper -> lower
6686
- if (
6794
+ if (
6687
6795
  isGFFCtx
6688
6796
  && this.target
6689
- && this.target.value != ''
6690
- && /[A-Z]+/.test(this.target.value)
6797
+ && this.target.value != ''
6798
+ && /[A-Z]+/.test(this.target.value)
6691
6799
  ) {
6692
6800
  this.target.value = this.value;
6693
6801
  }
@@ -6703,7 +6811,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6703
6811
  if (!isValid) {
6704
6812
  errors['isJsonWebToken'] = replace(this['error'] || local.errorLabels['isJsonWebToken'], this)
6705
6813
  }
6706
- // if error tagged by a previous vlaidation, remove it when isValid == true
6814
+ // if error tagged by a previous vlaidation, remove it when isValid == true
6707
6815
  else if ( isValid && typeof(errors['isJsonWebToken']) != 'undefined' ) {
6708
6816
  delete errors['isJsonWebToken'];
6709
6817
  //delete errors['stack'];
@@ -6716,7 +6824,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6716
6824
 
6717
6825
  return self[this['name']]
6718
6826
  }
6719
-
6827
+
6720
6828
  /**
6721
6829
  * Check if boolean and convert to `true/false` booloean if value is a string or a number
6722
6830
  * Will include `false` value if isRequired
@@ -6744,13 +6852,13 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6744
6852
  val = this.value = local.data[this.name] = false;
6745
6853
  break;
6746
6854
  }
6747
-
6855
+
6748
6856
  var isValid = (val !== null) ? true : false;
6749
6857
 
6750
6858
  if (!isValid) {
6751
6859
  errors['isBoolean'] = replace(this.error || local.errorLabels['isBoolean'], this)
6752
6860
  }
6753
- // if error tagged by a previous vlaidation, remove it when isValid == true
6861
+ // if error tagged by a previous vlaidation, remove it when isValid == true
6754
6862
  else if ( isValid && typeof(errors['isBoolean']) != 'undefined' ) {
6755
6863
  delete errors['isBoolean'];
6756
6864
  //delete errors['stack'];
@@ -6782,7 +6890,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6782
6890
  , isMaxLength = true
6783
6891
  , errors = self[this['name']]['errors'] || {}
6784
6892
  ;
6785
-
6893
+
6786
6894
  // test if val is a number
6787
6895
  try {
6788
6896
  // if val is a string replaces comas by points
@@ -6831,7 +6939,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6831
6939
 
6832
6940
  isValid = false;
6833
6941
  }
6834
- // if error tagged by a previous vlaidation, remove it when isValid == true
6942
+ // if error tagged by a previous vlaidation, remove it when isValid == true
6835
6943
  if ( isValid && typeof(errors['isNumberLength']) != 'undefined') {
6836
6944
  delete errors['isNumberLength'];
6837
6945
  }
@@ -6937,7 +7045,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
6937
7045
  // document.getElementById(this.target.id).value = this.value;
6938
7046
  // //triggerEvent(gina, this.target, 'change', self[this['name']]);
6939
7047
  // }
6940
-
7048
+
6941
7049
  } else {
6942
7050
  this.value = this.value.replace(/\,/g,'');
6943
7051
  }
@@ -7050,7 +7158,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7050
7158
  if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {
7051
7159
 
7052
7160
  this.valid = true;
7053
-
7161
+
7054
7162
  // is in excluded ?
7055
7163
  var excludedIndex = local.excluded.indexOf(this.name);
7056
7164
  if ( excludedIndex > -1 ) {
@@ -7061,12 +7169,12 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7061
7169
  }
7062
7170
 
7063
7171
  // radio group case
7064
- if (
7065
- isGFFCtx
7066
- && this.target
7067
- && this.target.tagName == 'INPUT'
7068
- && typeof(this.target.type) != 'undefined'
7069
- && this.target.type == 'radio'
7172
+ if (
7173
+ isGFFCtx
7174
+ && this.target
7175
+ && this.target.tagName == 'INPUT'
7176
+ && typeof(this.target.type) != 'undefined'
7177
+ && this.target.type == 'radio'
7070
7178
  ) {
7071
7179
  var radios = document.getElementsByName(this.name);
7072
7180
  for (var i = 0, len = radios.length; i < len; ++i) {
@@ -7091,7 +7199,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7091
7199
  if (!isValid) {
7092
7200
  errors['isRequired'] = replace(this.error || local.errorLabels['isRequired'], this)
7093
7201
  }
7094
- // if error tagged by a previous vlaidation, remove it when isValid == true
7202
+ // if error tagged by a previous vlaidation, remove it when isValid == true
7095
7203
  else if ( isValid ) {
7096
7204
  if (typeof(errors['isRequired']) != 'undefined' )
7097
7205
  delete errors['isRequired'];
@@ -7116,7 +7224,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7116
7224
  * {
7117
7225
  * "password": {
7118
7226
  * "isRequired": true,
7119
- *
7227
+ *
7120
7228
  * "isString": true // Means that we just want a string and we don't care of its length
7121
7229
  * // OR
7122
7230
  * "isString": 7 // Means at least 7 chars length
@@ -7196,7 +7304,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7196
7304
  *
7197
7305
  * @returns {date} date - extended by gina::utils::dateFormat; an adaptation of Steven Levithan's code
7198
7306
  * */
7199
- self[el]['isDate'] = function(mask) {
7307
+ self[el]['isDate'] = function(mask) {
7200
7308
  var val = this.value
7201
7309
  , isValid = false
7202
7310
  , errors = self[this['name']]['errors'] || {}
@@ -7204,37 +7312,37 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7204
7312
  , date = null
7205
7313
  ;
7206
7314
  // Default validation on livecheck & invalid init value
7207
- if (!val || val == '' || /NaN|Invalid Date/i.test(val) ) {
7315
+ if (!val || val == '' || /NaN|Invalid Date/i.test(val) ) {
7208
7316
  if ( /NaN|Invalid Date/i.test(val) ) {
7209
7317
  console.warn('[FormValidator::isDate] Provided value for field `'+ this.name +'` is not allowed: `'+ val +'`');
7210
7318
  errors['isDate'] = replace(this.error || local.errorLabels['isDate'], this);
7211
-
7319
+
7212
7320
  }
7213
7321
  this.valid = isValid;
7214
7322
  if ( errors.count() > 0 )
7215
- this['errors'] = errors;
7216
-
7323
+ this['errors'] = errors;
7324
+
7217
7325
  return self[this.name];
7218
7326
  }
7219
-
7220
- if (
7327
+
7328
+ if (
7221
7329
  typeof(mask) == 'undefined'
7222
7330
  ||
7223
7331
  typeof(mask) != 'undefined' && /true/i.test(mask)
7224
7332
  ) {
7225
7333
  mask = "yyyy-mm-dd"; // by default
7226
7334
  }
7227
-
7335
+
7228
7336
  if (val instanceof Date) {
7229
7337
  date = val.format(mask);
7230
7338
  } else {
7231
-
7339
+
7232
7340
  try {
7233
7341
  m = mask.match(/[^\/\- ]+/g);
7234
7342
  } catch (err) {
7235
7343
  throw new Error('[FormValidator::isDate] Provided mask not allowed: `'+ mask +'`');
7236
7344
  }
7237
-
7345
+
7238
7346
  try {
7239
7347
  val = val.match(/[^\/\- ]+/g);
7240
7348
  var dic = {}, d, len;
@@ -7248,10 +7356,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7248
7356
  } catch (err) {
7249
7357
  throw new Error('[FormValidator::isDate] Provided value not allowed: `'+ val +'`' + err);
7250
7358
  }
7251
-
7359
+
7252
7360
 
7253
7361
  date = this.value = local.data[this.name] = new Date(formatedDate);
7254
-
7362
+
7255
7363
  if ( /Invalid Date/i.test(date) || date instanceof Date === false ) {
7256
7364
  if ( !errors['isRequired'] && this.value == '' ) {
7257
7365
  isValid = true
@@ -7313,7 +7421,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7313
7421
  }
7314
7422
  return self[this.name]
7315
7423
  }
7316
-
7424
+
7317
7425
  /**
7318
7426
  * Trim when string starts or ends with white space(s)
7319
7427
  *
@@ -7337,11 +7445,11 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7337
7445
  self[el]['exclude'] = function(isApplicable) {
7338
7446
 
7339
7447
  if ( typeof(isApplicable) == 'boolean' && !isApplicable ) {
7340
-
7448
+
7341
7449
  if ( /^true|false$/i.test(this.value)) {
7342
7450
  this.value = (/^true$/i.test(this.value)) ? true : false;
7343
7451
  local.data[this.name] = this.value;
7344
- }
7452
+ }
7345
7453
 
7346
7454
  return self[this.name]
7347
7455
  }
@@ -7351,8 +7459,8 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7351
7459
  local.excluded.push(this.name);
7352
7460
  this.isExcluded = true;
7353
7461
  }
7354
-
7355
-
7462
+
7463
+
7356
7464
  // remove existing errors
7357
7465
  return self[this.name];
7358
7466
  }
@@ -7362,8 +7470,8 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7362
7470
  * a request to the remote host if previous rules failed
7363
7471
  */
7364
7472
  self[el]['query'] = query;
7365
-
7366
-
7473
+
7474
+
7367
7475
  self[el]['getValidationContext'] = function() {
7368
7476
  return {
7369
7477
  'isGFFCtx' : isGFFCtx,
@@ -7373,10 +7481,10 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7373
7481
  }
7374
7482
  }
7375
7483
  // Merging user validators
7376
- // To debug, open inspector and look into `Extra Scripts`
7484
+ // To debug, open inspector and look into `Extra Scripts`
7377
7485
  if ( hasUserValidators() ) {
7378
7486
  var userValidator = null, filename = null;
7379
- try {
7487
+ try {
7380
7488
  for (let v in gina.forms.validators) {
7381
7489
  filename = '/validators/'+ v + '/main.js';
7382
7490
  // setting default local error
@@ -7387,12 +7495,12 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7387
7495
  userValidator = bufferToString(gina.forms.validators[v].data); // ok
7388
7496
  var passedContext = 'var validationContext = this.getValidationContext(),isGFFCtx = validationContext.isGFFCtx,self = validationContext.self,local = validationContext.local,replace = validationContext.replace;';
7389
7497
  userValidator = userValidator.replace(/(\)\s+\{|\)\{){1}/, '$&\n\t'+ passedContext);
7390
-
7498
+
7391
7499
  //userValidator += '\n//#sourceURL='+ v +'.js';
7392
7500
  } else {
7393
7501
  userValidator = gina.forms.validators[v].toString();
7394
7502
  }
7395
-
7503
+
7396
7504
  self[el][v] = eval('(' + userValidator + ')\n//# sourceURL='+ v +'.js');
7397
7505
  //self[el][v] = Function('errorMessage', 'errorStack', userValidator);
7398
7506
  }
@@ -7400,22 +7508,22 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7400
7508
  throw new Error('[UserFormValidator] Could not evaluate: `'+ filename +'`\n'+userValidatorError.stack);
7401
7509
  }
7402
7510
  }
7403
- } // EO addField(el, value)
7404
-
7405
-
7406
- for (let el in self) {
7511
+ } // EO addField(el, value)
7512
+
7513
+
7514
+ for (let el in self) {
7407
7515
  // Adding fields & validators to context
7408
7516
  addField(el, self[el]);
7409
7517
  }
7410
-
7518
+
7411
7519
  self['addField'] = function(el, value) {
7412
7520
  if ( typeof(self[el]) != 'undefined' ) {
7413
7521
  return
7414
7522
  }
7415
7523
  addField(el, value);
7416
7524
  };
7417
-
7418
-
7525
+
7526
+
7419
7527
  // self['getExcludedFields'] = function() {
7420
7528
  // return local.excluded;
7421
7529
  // };
@@ -7445,33 +7553,33 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7445
7553
  // }
7446
7554
  for (var r in self[field]) {
7447
7555
  // no error for the current field rule
7448
- if (
7556
+ if (
7449
7557
  typeof(errors[field]) != 'object'
7450
7558
  ||
7451
7559
  typeof(errors[field][r]) == 'undefined'
7452
7560
  ) {
7453
7561
  continue;
7454
7562
  }
7455
-
7456
-
7457
- if (
7458
- typeof(self[field].valid) != 'undefined'
7459
- && /^true$/i.test(self[field].valid)
7563
+
7564
+
7565
+ if (
7566
+ typeof(self[field].valid) != 'undefined'
7567
+ && /^true$/i.test(self[field].valid)
7460
7568
  ) {
7461
7569
  delete errors[field][r];
7462
7570
  continue;
7463
7571
  }
7464
-
7465
-
7572
+
7573
+
7466
7574
  if ( typeof( self[field]['errors']) == 'undefined' ) {
7467
7575
  self[field]['errors'] = {}
7468
7576
  }
7469
-
7470
- self[field]['errors'][r] = errors[field][r];
7577
+
7578
+ self[field]['errors'][r] = errors[field][r];
7471
7579
  }
7472
-
7580
+
7473
7581
  // if field does not have errors, remove errors[field]
7474
- if (
7582
+ if (
7475
7583
  typeof(self[field]['errors']) == 'undefined'
7476
7584
  && typeof(errors[field]) != 'undefined'
7477
7585
  ||
@@ -7488,34 +7596,34 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7488
7596
  /**
7489
7597
  * getErrors
7490
7598
  * NB.: This portion is shared between the front & the back
7491
- *
7599
+ *
7492
7600
  * @param {string} [fieldName]
7493
- *
7601
+ *
7494
7602
  * @returns errors
7495
7603
  */
7496
7604
  self['getErrors'] = function(fieldName) {
7497
7605
  var errors = {};
7498
-
7606
+
7499
7607
  if ( typeof(fieldName) != 'undefined' ) {
7500
7608
  if ( typeof(self[fieldName]) != 'undefined' && self[fieldName] && typeof(self[fieldName]['errors']) != 'undefined' && self[fieldName]['errors'].count() > 0 ) {
7501
7609
  errors[fieldName] = self[fieldName]['errors'];
7502
- }
7610
+ }
7503
7611
  return errors
7504
7612
  }
7505
-
7613
+
7506
7614
  for (var field in self) {
7507
- if (
7615
+ if (
7508
7616
  typeof(self[field]) != 'object'
7509
7617
  ) {
7510
7618
  continue;
7511
7619
  }
7512
-
7620
+
7513
7621
  if ( typeof(self[field]['errors']) != 'undefined' ) {
7514
7622
  if ( self[field]['errors'].count() > 0)
7515
7623
  errors[field] = self[field]['errors'];
7516
7624
  }
7517
7625
  }
7518
-
7626
+
7519
7627
  return errors
7520
7628
  }
7521
7629
 
@@ -7532,7 +7640,7 @@ function FormValidatorUtil(data, $fields, xhrOptions, fieldsSet) {
7532
7640
  // local.data = JSON.parse(JSON.stringify(local.data).replace(/\"(true|false)\"/gi, '$1'))
7533
7641
  return local.data
7534
7642
  }
7535
-
7643
+
7536
7644
  /**@js_externs replace*/
7537
7645
  var replace = function(target, fieldObj) {
7538
7646
  var keys = target.match(/%[a-z]+/gi);
@@ -16478,7 +16586,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16478
16586
 
16479
16587
  /**
16480
16588
  * Toolbar plugin
16481
- *
16589
+ *
16482
16590
  * TODO - search using `datatables` plugin (https://stackoverflow.com/questions/10400033/is-there-a-jquery-plugin-like-datatables-for-a-ul)
16483
16591
  */
16484
16592
  function Toolbar() {
@@ -16649,39 +16757,41 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16649
16757
  * */
16650
16758
  var loadData = function (section, data, ginaData) {
16651
16759
 
16652
- var $currentForms = null;
16760
+ var $currentForms = null, txt = null;
16653
16761
  try {
16654
- var txt = ($json) ? $json.text() : '';
16762
+
16763
+ txt = ($json) ? $json.text() : '';
16655
16764
  if (txt == '' || txt == 'null' ) {
16656
16765
  $json.text('Empty')
16657
16766
  } else {
16658
16767
  jsonObject = JSON.parse( txt );
16659
16768
  ginaJsonObject = JSON.parse($ginaJson.text());
16660
-
16769
+
16661
16770
  $json.text('');
16662
16771
 
16663
16772
  // backing up document data for restore action
16664
16773
  if (!originalData) {
16665
-
16774
+
16666
16775
  originalData = {
16667
16776
  jsonObject : JSON.clone(jsonObject),
16668
16777
  ginaJsonObject : JSON.clone( ginaJsonObject)
16669
16778
  };
16670
16779
  lastJsonObjectState = {}; // jsonObject.data
16671
-
16780
+
16672
16781
  }
16673
16782
  }
16674
16783
 
16675
16784
  } catch (err) {
16676
-
16785
+
16677
16786
  var sectionStr = ( section ) ? ' [ '+ section + ' ] ' : ' ';
16678
- 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;
16679
16789
  if ($json) {
16680
16790
  $json.text(_err);
16681
16791
  } else {
16682
16792
  throw _err;
16683
16793
  }
16684
-
16794
+
16685
16795
  }
16686
16796
 
16687
16797
  if (jsonObject) {
@@ -16739,7 +16849,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16739
16849
  }
16740
16850
 
16741
16851
  if ( !section || /^(data)$/.test(section) ) {
16742
-
16852
+
16743
16853
 
16744
16854
  // -> Data
16745
16855
  $htmlData.html('<ul class="gina-toolbar-code">' + parseObject(userObject.data, ginaObject.data, null, isXHR) +'</ul>');
@@ -16752,11 +16862,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16752
16862
  '</div>';
16753
16863
 
16754
16864
  $htmlView.html(htmlProp);
16755
-
16865
+
16756
16866
  $htmlView.html( parseView(userObject.view, ginaObject.view, null, isXHR, $htmlView) );
16757
16867
 
16758
16868
  // -> Forms
16759
- $currentForms = $forms;
16869
+ $currentForms = $forms;
16760
16870
  $htmlForms.html('');
16761
16871
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR) );
16762
16872
  // Form binding
@@ -16770,9 +16880,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16770
16880
  });
16771
16881
 
16772
16882
  //$htmlForms.html( parseView(jsonObject.forms, ginaJsonObject.forms, null, $htmlForms) );
16773
- } //else
16883
+ } //else
16774
16884
  if ( /^(data-xhr|view-xhr)$/.test(section) ) {
16775
-
16885
+
16776
16886
  // reset case
16777
16887
  if ( typeof(jsonObject[section]) == 'undefined' || !jsonObject[section] || jsonObject[section] == 'null' ) {
16778
16888
  return false;
@@ -16781,11 +16891,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16781
16891
  // -> XHR Data
16782
16892
  isXHR = true;
16783
16893
  isXHRViewData = (typeof (jsonObject[section].isXHRViewData) != 'undefined') ? true : isXHRViewData;
16784
-
16785
-
16894
+
16895
+
16786
16896
  // update data section without erasing old data
16787
16897
  if (!isXHRViewData && !/^(view-xhr)$/.test(section)) {
16788
-
16898
+
16789
16899
  // also update original data to handle restore action
16790
16900
  if ( typeof (jsonObject['el-xhr']) != 'undefined' ) {
16791
16901
  lastJsonObjectState.data = JSON.clone(jsonObject[section]);
@@ -16811,11 +16921,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16811
16921
  $htmlView.html(htmlProp);
16812
16922
  $htmlView.html( parseView(jsonObject[section], ginaJsonObject[section], null, isXHR, $htmlView) );
16813
16923
  }
16814
-
16815
- } //else
16924
+
16925
+ } //else
16816
16926
  if ( /^(el-xhr)$/.test(section) ) {
16817
16927
  // -> XHR Forms
16818
- isXHR = true;
16928
+ isXHR = true;
16819
16929
  $currentForms = $('#' + data).find('form:not(' + formsIgnored + ')');
16820
16930
  $htmlForms.html('');
16821
16931
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR ) );
@@ -16828,16 +16938,16 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16828
16938
  .find('ul').first()
16829
16939
  .slideToggle();
16830
16940
  });
16831
- } //else
16941
+ } //else
16832
16942
  if ( /^(forms)$/.test(section) ) {
16833
16943
  isXHR = true;
16834
16944
  self.isValidator = true;
16835
-
16945
+
16836
16946
  var $form = $('#gina-toolbar-form-' + data.id);
16837
16947
  // for live changes (eg.: on `Validator::getFormById()` call)
16838
16948
  if ( !$form.length ) {
16839
16949
  // crearte toolbar entry for the new form
16840
- $currentForms = $forms;
16950
+ $currentForms = $forms;
16841
16951
  $htmlForms.html('');
16842
16952
  $htmlForms.html( parseForms(userObject.forms, ginaObject.forms, $htmlForms, 0, $currentForms, $currentForms.length, isXHR) );
16843
16953
  // Form binding
@@ -16850,12 +16960,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16850
16960
  .slideToggle();
16851
16961
  });
16852
16962
  }
16853
-
16963
+
16854
16964
  // form data sent
16855
16965
  if ( typeof(data.rules) != 'undefined' ) {
16856
16966
  updateForm(data.id, 'rules', data.rules, isXHR)
16857
16967
  }
16858
-
16968
+
16859
16969
  // form errors
16860
16970
  if ( typeof(data.errors) != 'undefined' && data.errors.count() > 0 ) {
16861
16971
  updateForm(data.id, 'errors', data.errors, isXHR)
@@ -16878,7 +16988,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16878
16988
  if (jsonObject.file == settings.currentFile) {
16879
16989
  // If current page is the same as the previous page, unfold code as neede
16880
16990
  $(document).ready(function () {
16881
-
16991
+
16882
16992
  if (self.isValidator ) {
16883
16993
  self.isXHR = true;
16884
16994
  if (settings.isUnfolded.length > 0 && !self.initiatedXhrFoldingState) {
@@ -16905,12 +17015,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
16905
17015
  }
16906
17016
  })
16907
17017
  }
16908
- }
16909
-
17018
+ }
17019
+
16910
17020
  if ( !section || section == 'el-xhr' && !self.hasParsedUrls) {
16911
17021
  self.hasParsedUrls = (section && section == 'el-xhr' ) ? true : false;
16912
17022
  parseUrls(section);
16913
- }
17023
+ }
16914
17024
  }
16915
17025
 
16916
17026
 
@@ -17048,8 +17158,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17048
17158
  });
17049
17159
 
17050
17160
  // Show/hide toolbar using gg shorcut
17051
- $('body').off('keypress').on('keypress', function onKeypressed(event){
17052
-
17161
+ $('body').off('keypress').on('keypress', function onKeypressed(event){
17162
+
17053
17163
  if (!/INPUT|TEXTAREA/.test(event.target.tagName )) {
17054
17164
  if (event.keyCode) {
17055
17165
  // IE
@@ -17078,10 +17188,10 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17078
17188
  lastPressedKey.pressTime = now.getTime();
17079
17189
  lastPressedKey.keynum = keynum;
17080
17190
  }
17081
-
17191
+
17082
17192
  });
17083
17193
 
17084
-
17194
+
17085
17195
  // Updates Toolbar with current values
17086
17196
 
17087
17197
  // Select the current tab
@@ -17157,7 +17267,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17157
17267
  }
17158
17268
 
17159
17269
  var toggleCodeFolding = function ($el, cb, toggledByClick) {
17160
-
17270
+
17161
17271
  if ( typeof(toggledByClick) == 'undefined' ) {
17162
17272
  var toggledByClick = false
17163
17273
  }
@@ -17169,7 +17279,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17169
17279
  var hasXhrFlag = false;
17170
17280
 
17171
17281
  if ( /(gina-toolbar-folding-state-[a-z 0-9_-]+|gina-toolbar-xhr-folding-state-[a-z 0-9_-]+)/i.test(self.foldingClass) ) {
17172
-
17282
+
17173
17283
  if ( /gina-toolbar-folding-state-[a-z0-9_-]+/i.test(self.foldingClass) ) {
17174
17284
  self.foldingClass = self.foldingClass.match(/gina-toolbar-folding-state-[a-z0-9_-]+/i)[0].replace(/gina-toolbar-folding-state-/, '');
17175
17285
  } else {
@@ -17179,15 +17289,15 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17179
17289
  }
17180
17290
 
17181
17291
  if ( settings.isUnfolded.indexOf(self.foldingClass) < 0 ) {
17182
-
17292
+
17183
17293
  settings.isUnfolded.push(self.foldingClass);
17184
17294
  settings.save();
17185
-
17295
+
17186
17296
  if (!$el.hasClass('gina-toolbar-unfolded')) {
17187
17297
  $el.addClass('gina-toolbar-unfolded');
17188
17298
  $el.next('ul').slideToggle('fast');
17189
17299
  }
17190
-
17300
+
17191
17301
  } else {
17192
17302
 
17193
17303
  if ( settings.isUnfolded.indexOf(self.foldingClass) > -1 && $el.hasClass('gina-toolbar-unfolded') ) {
@@ -17202,22 +17312,22 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17202
17312
  }
17203
17313
  }
17204
17314
  }
17205
-
17315
+
17206
17316
  settings.save(true);
17207
-
17317
+
17208
17318
  if ( settings.isUnfolded.indexOf(self.foldingClass) < 0 ) {
17209
17319
  $el.removeClass('gina-toolbar-unfolded');
17210
17320
  $el.next('ul').slideToggle('fast');
17211
17321
  }
17212
-
17322
+
17213
17323
 
17214
17324
  } else {
17215
17325
  $el.addClass('gina-toolbar-unfolded');
17216
17326
  $el.next('ul').slideToggle('fast');
17217
- }
17327
+ }
17218
17328
  }
17219
17329
  }
17220
-
17330
+
17221
17331
  }
17222
17332
 
17223
17333
  if (typeof (cb) != 'undefined' && cb != null )
@@ -17252,11 +17362,11 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17252
17362
  }
17253
17363
 
17254
17364
  var normalizeFoldingStateName = function(stateSection, stateName) {
17255
-
17365
+
17256
17366
  var foldingStateName = '', section = null, name = null;
17257
17367
 
17258
17368
  if ( typeof(stateSection) != 'undefined' && stateSection != '' ) {
17259
-
17369
+
17260
17370
  section = stateSection;
17261
17371
  if ( typeof(stateSection) == 'string' ) {
17262
17372
  section = stateSection
@@ -17264,7 +17374,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17264
17374
  .replace(/\]/, '')
17265
17375
  .replace(/[^A-Za-z0-9_-]/g, '_')
17266
17376
  }
17267
-
17377
+
17268
17378
  foldingStateName += section + '-'
17269
17379
  }
17270
17380
 
@@ -17276,12 +17386,12 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17276
17386
  .replace(/(\]\[|\[)/g, '-')
17277
17387
  .replace(/\]/, '')
17278
17388
  }
17279
-
17389
+
17280
17390
  foldingStateName += name
17281
17391
  } else {
17282
17392
  foldingStateName = foldingStateName.substr(0, foldingStateName.length-1)
17283
17393
  }
17284
-
17394
+
17285
17395
  return foldingStateName.trim()
17286
17396
  }
17287
17397
 
@@ -17361,14 +17471,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17361
17471
  var section = ( typeof(elSection) != 'undefined' && elSection != null ) ? elSection : '';
17362
17472
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
17363
17473
 
17364
- // patch
17474
+ // patch
17365
17475
  if (!ginaArr) {
17366
17476
  ginaArr = [];
17367
17477
  }
17368
17478
  for (var i = 0, len = arr.length; i<len; ++i) {
17369
17479
  if ( typeof(arr[i]) == 'object' && !Array.isArray(arr[i]) ) {
17370
17480
  //id += i + '-';
17371
- // patch
17481
+ // patch
17372
17482
  if (!ginaArr[i]) {
17373
17483
  ginaArr[i] = arr[i]
17374
17484
  }
@@ -17405,7 +17515,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17405
17515
  }
17406
17516
 
17407
17517
  var parseView = function (obj, ginaObj, elId, elIsXHR, $html, $root) {
17408
-
17518
+
17409
17519
  var id = (elId != null) ? elId.replace(/[^A-Za-z0-9_-]/g, '_') : '';
17410
17520
  var section = null;
17411
17521
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
@@ -17421,7 +17531,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17421
17531
  if (!$root)
17422
17532
  $root = $html;
17423
17533
 
17424
- for (var i in obj) {
17534
+ for (var i in obj) {
17425
17535
  section = i;
17426
17536
  if ( typeof(obj[i]) == 'object' && !Array.isArray(obj[i]) && obj[i] !== null ) { // parse
17427
17537
 
@@ -17431,7 +17541,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17431
17541
  if (!hasParent ) {
17432
17542
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17433
17543
 
17434
- if (i == 'params') { // force to top
17544
+ if (i == 'params') { // force to top
17435
17545
  var htmlParams = '<div id="gina-toolbar-view-'+ id.substr(0, id.length - 1) +'" class="gina-toolbar-section">' +
17436
17546
  '<h2 class="gina-toolbar-section-title">'+ id.substr(0, id.length - 1) +'</h2>' +
17437
17547
  '<ul class="'+ id.substr(0, id.length - 1) +'"></ul>' +
@@ -17440,9 +17550,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17440
17550
  $('#gina-toolbar-view-html-properties')
17441
17551
  .before(htmlParams);
17442
17552
  } else {
17443
-
17553
+
17444
17554
  if ( !/^html/.test(id) ) {
17445
-
17555
+
17446
17556
  var htmlOther = '<div id="gina-toolbar-view-'+ id.substr(0, id.length - 1) +'" class="gina-toolbar-section">' +
17447
17557
  '<h2 class="gina-toolbar-section-title">'+ id.substr(0, id.length - 1) +'</h2>' +
17448
17558
  '<ul class="'+ id.substr(0, id.length - 1) +'"></ul>' +
@@ -17455,7 +17565,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17455
17565
  .find('.gina-toolbar-properties')
17456
17566
  .append('ul.' + id.substr(0, id.length - 1))
17457
17567
  }*/
17458
-
17568
+
17459
17569
  }
17460
17570
 
17461
17571
  parseView(obj[i], ginaObj[i], id, elIsXHR, $html.find('ul.'+ id.substr(0, id.length - 1)), $root );
@@ -17480,14 +17590,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17480
17590
 
17481
17591
  } else if ( Array.isArray(obj[i]) ) { // parse collection
17482
17592
 
17483
-
17484
-
17593
+
17594
+
17485
17595
  $parent = $('#gina-toolbar-view-' + id.substr(0, id.length - 1));
17486
-
17596
+
17487
17597
  hasParent = ( $parent.length ) ? true : false;
17488
-
17489
- if ( !hasParent || /^html/.test(id) ) {
17490
-
17598
+
17599
+ if ( !hasParent || /^html/.test(id) ) {
17600
+
17491
17601
  $parent = $('.' + id);
17492
17602
  parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17493
17603
 
@@ -17495,17 +17605,17 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17495
17605
  //.find('ul.'+ id.substr(0, id.length - 1))
17496
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>');
17497
17607
 
17498
-
17608
+
17499
17609
  //parentId = parentId.substr(0, parentId.length - 1)+ '-';
17500
- //parentId = id.substr(0, id.length - i.length - 1);
17610
+ //parentId = id.substr(0, id.length - i.length - 1);
17501
17611
  //parseView(obj[i], ginaObj[i], parentId, elIsXHR, $parent.find('ul.'+ parentId.substr(0, parentId.length - 1)), $root );
17502
17612
 
17503
17613
  //id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17504
17614
  //$parent = $('#gina-toolbar-view-' + id.substr(0, id.length - 1));
17505
17615
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17506
- } else {
17507
-
17508
-
17616
+ } else {
17617
+
17618
+
17509
17619
  parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17510
17620
 
17511
17621
  $parent
@@ -17513,20 +17623,20 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17513
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>');
17514
17624
 
17515
17625
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17516
-
17626
+
17517
17627
  }
17518
-
17519
17628
 
17520
- // if ( !hasParent || /^html/.test(id) ) {
17629
+
17630
+ // if ( !hasParent || /^html/.test(id) ) {
17521
17631
  // id = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17522
17632
  // $root
17523
17633
  // .find('.gina-toolbar-properties')
17524
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>');
17525
17635
 
17526
17636
 
17527
- // } else {
17528
-
17529
-
17637
+ // } else {
17638
+
17639
+
17530
17640
  // parentId = id + i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17531
17641
 
17532
17642
  // $parent
@@ -17539,17 +17649,17 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17539
17649
  // clear one level
17540
17650
  id = id.substr(0, id.length - i.length - 1);
17541
17651
  } else {
17542
-
17543
-
17544
-
17652
+
17653
+
17654
+
17545
17655
  objType = (ginaObj[i] === null) ? 'null' : typeof(ginaObj[i]);
17546
17656
  if ( objType == 'undefined' ) { // new key declaration added by user
17547
17657
  if (/\-$/.test(id)) {
17548
17658
  id = id.substr(0, id.length - 1);
17549
17659
  }
17550
-
17660
+
17551
17661
  if (!id) continue;
17552
-
17662
+
17553
17663
  $html
17554
17664
  .find('ul.' + id)
17555
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>');
@@ -17562,7 +17672,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17562
17672
  if (!id) {
17563
17673
  id += i.replace(/[^A-Za-z0-9_-]/g, '_') + '-';
17564
17674
  }
17565
-
17675
+
17566
17676
  try {
17567
17677
  $html
17568
17678
  .find('ul.' + id)
@@ -17575,7 +17685,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17575
17685
  } catch (err) {
17576
17686
  throw new Error('GinaToolbarError: `ul.'+ id +'` not found');
17577
17687
  }
17578
-
17688
+
17579
17689
  } else {
17580
17690
 
17581
17691
  if ( !id || /^html\-properties/.test(id) ) { // properties case
@@ -17587,10 +17697,10 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17587
17697
  $root
17588
17698
  .find('.gina-toolbar-properties')
17589
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>')
17590
- //}
17591
-
17700
+ //}
17701
+
17592
17702
  } else {
17593
-
17703
+
17594
17704
  $root
17595
17705
  .find('ul.' + id.substr(0, id.length - 1))
17596
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>')
@@ -17607,9 +17717,9 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17607
17717
 
17608
17718
  return parseObject(rules, rules, id, elIsXHR, section)
17609
17719
  }
17610
-
17720
+
17611
17721
  var parseUrls = function(section) {
17612
-
17722
+
17613
17723
  var $el = null;
17614
17724
  var $currentPopin = (gina.hasPopinHandler) ? gina.popin.getActivePopin() : null;
17615
17725
  var isPopinContext = ( gina.hasPopinHandler ) ? true : false;
@@ -17618,7 +17728,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17618
17728
  } else {
17619
17729
  $el = $('body');
17620
17730
  }
17621
-
17731
+
17622
17732
  // look for `404: `
17623
17733
  var found = {}
17624
17734
  , foundStr = null
@@ -17632,19 +17742,19 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17632
17742
  for (; f < fLen; ++f) {
17633
17743
  foundStr = matched[f].replace(/\"(.*)|\"/g, '');
17634
17744
  formMethod = foundStr.match(/\[(.*)\]/g, '')[0].replace(/\[|\]/g,'');
17635
-
17745
+
17636
17746
  routing.getRouteByUrl(foundStr, formMethod)
17637
17747
  }
17638
- }
17639
-
17748
+ }
17749
+
17640
17750
  printLogs();
17641
-
17751
+
17642
17752
  //console.debug('popinIsActive: '+ isPopinContext +'isXHR: ', self.isXHR, ' -> ' + section, routing.notFound);
17643
17753
  }
17644
-
17754
+
17645
17755
  var printLogs = function() {
17646
17756
  fLen = routing.notFound.count();
17647
- if ( fLen > 0 ) {
17757
+ if ( fLen > 0 ) {
17648
17758
  for (f in routing.notFound) {
17649
17759
  console.warn( '(x'+ routing.notFound[f].count +') ' + f + ' => ' + routing.notFound[f].message );
17650
17760
  }
@@ -17652,13 +17762,13 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17652
17762
  }
17653
17763
 
17654
17764
  var parseForms = function (obj, ginaObj, $html, i, $forms, len, elIsXHR) {
17655
-
17765
+
17656
17766
  if (!len) return false;
17657
17767
 
17658
17768
  var attributes = $forms[i].attributes;
17659
17769
  var formMethod = null;
17660
17770
  var attrClass = 'gina-toolbar-form-attributes';
17661
- var id = $forms[i].getAttribute('id') || $forms[i].id;
17771
+ var id = $forms[i].getAttribute('id') || $forms[i].id;
17662
17772
  var section = attrClass; // by default
17663
17773
  var isXHR = ( typeof(elIsXHR) != 'undefined' && elIsXHR != null ) ? '-xhr' : '';
17664
17774
  // form fields set
@@ -17684,8 +17794,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17684
17794
  , routeObj = null
17685
17795
  ;
17686
17796
 
17687
- // testing for action attr to add action route
17688
-
17797
+ // testing for action attr to add action route
17798
+
17689
17799
 
17690
17800
  // adding form attributes
17691
17801
  for ( var a = 0, aLen = attributes.length; a < aLen; ++a ) {
@@ -17701,14 +17811,14 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17701
17811
  val = '<ul><li>'+ val.replace(/\s+/g, '</li><li>') +'</li></ul>';
17702
17812
 
17703
17813
  if ( /^action$/.test(key) ) {
17704
-
17705
- formMethod = ( typeof(attributes['method']) != 'undefined' ) ? attributes['method'].nodeValue : undefined;
17706
-
17814
+
17815
+ formMethod = ( typeof(attributes['method']) != 'undefined' ) ? attributes['method'].nodeValue : undefined;
17816
+
17707
17817
  if (!formMethod) {
17708
- 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 !');
17709
17819
  }
17710
-
17711
- routeObj = routing.getRouteByUrl(val, formMethod);
17820
+
17821
+ routeObj = routing.getRouteByUrl(val, formMethod);
17712
17822
 
17713
17823
  if ( typeof(routeObj) == 'undefined' || !routeObj ) {
17714
17824
  routeObj = {
@@ -17719,8 +17829,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17719
17829
  file: 'not found'
17720
17830
  }
17721
17831
  }
17722
- }
17723
-
17832
+ }
17833
+
17724
17834
  val = '<ul>' +
17725
17835
  '<li>' +
17726
17836
  '<span class="gina-toolbar-key">url</span>' +
@@ -17773,7 +17883,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17773
17883
 
17774
17884
  }
17775
17885
 
17776
-
17886
+
17777
17887
  content = '<li>' +
17778
17888
  '<span class="gina-toolbar-key">'+ key +':</span>' +
17779
17889
  '<span class="gina-toolbar-value">'+ val +'</span>' +
@@ -17808,15 +17918,15 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17808
17918
  var rules = null;
17809
17919
 
17810
17920
  try {
17811
-
17921
+
17812
17922
  var dataRule = $forms[i].getAttribute('data-gina-form-rule');
17813
-
17923
+
17814
17924
  if ( typeof(dataRule) != 'undefined' && dataRule!= null ) {
17815
17925
  rules = eval('gina.forms.rules.' + dataRule.replace(/-/g, '.'))
17816
17926
  } else {
17817
17927
  rules = eval('gina.forms.rules.' + id.replace(/-/g, '.'))
17818
17928
  }
17819
-
17929
+
17820
17930
  } catch (err) {}
17821
17931
 
17822
17932
  if ( rules ) {
@@ -17826,8 +17936,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17826
17936
  .append('<li class="gina-toolbar-form-'+ section +'">' +
17827
17937
  '<h3 class="gina-toolbar-sub-section-title">'+ section +'</h3>' +
17828
17938
  '<ul class="gina-toolbar-properties">'+ parseSection( rules, id, elIsXHR, section ) +'</ul>' +
17829
- '</li>');
17830
-
17939
+ '</li>');
17940
+
17831
17941
  }
17832
17942
 
17833
17943
 
@@ -17878,7 +17988,7 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17878
17988
  if ( !$sectionContent.is(':visible') ) {
17879
17989
  $sectionContent.slideToggle()
17880
17990
  }
17881
-
17991
+
17882
17992
  }
17883
17993
 
17884
17994
  var createInputFile = function(id, label) {
@@ -17988,13 +18098,13 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
17988
18098
  if (lastJsonObjectState && typeof (lastJsonObjectState.data) != 'undefined' ) {
17989
18099
  originalData.jsonObject.data = lastJsonObjectState.data;
17990
18100
  }
17991
-
18101
+
17992
18102
  loadData('data', originalData.jsonObject, originalData.ginaJsonObject);
17993
18103
  self.hasParsedUrls = false;
17994
18104
  routing.notFound = {};
17995
18105
  }
17996
18106
 
17997
-
18107
+
17998
18108
  if ( typeof(gina.validator) != 'undefined' ) {
17999
18109
  gina.validator.on('initialized', function onValidatorReady(){
18000
18110
  console.log('toolbar validator ready');
@@ -18002,8 +18112,8 @@ define('gina/toolbar', ['require', 'jquery', 'vendor/uuid'/**, 'utils/merge'*/,
18002
18112
  })
18003
18113
  } else {
18004
18114
  init();
18005
- }
18006
-
18115
+ }
18116
+
18007
18117
  }
18008
18118
 
18009
18119
  return Toolbar
@@ -19423,10 +19533,10 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19423
19533
  function updateToolbar(result, resultIsObject) {
19424
19534
  // update toolbar errors
19425
19535
  var $popin = getActivePopin();
19426
-
19536
+ var XHRData = null;
19427
19537
  if ( gina && typeof(window.ginaToolbar) != 'undefined' && window.ginaToolbar && typeof(result) != 'undefined' && typeof(resultIsObject) != 'undefined' && result ) {
19428
19538
 
19429
- var XHRData = result;
19539
+ XHRData = result;
19430
19540
 
19431
19541
  try {
19432
19542
  var XHRDataNew = null;
@@ -19461,7 +19571,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19461
19571
 
19462
19572
  // update toolbar
19463
19573
  try {
19464
- var $popin = getPopinById(instance.activePopinId);
19574
+ $popin = getPopinById(instance.activePopinId);
19465
19575
  var $el = $popin.target;
19466
19576
  } catch (err) {
19467
19577
  ginaToolbar.update('data-xhr', err );
@@ -19469,7 +19579,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19469
19579
 
19470
19580
 
19471
19581
  // XHRData
19472
- var XHRData = null;
19582
+ XHRData = null;
19473
19583
  if ( typeof(result) == 'string' && /\<(.*)\>/.test(result) ) {
19474
19584
  // converting Element to DOM object
19475
19585
  XHRData = new DOMParser().parseFromString(result, 'text/html').getElementById('gina-without-layout-xhr-data');
@@ -19510,6 +19620,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19510
19620
  // reset data-xhr
19511
19621
  //ginaToolbar.update("view-xhr", null);
19512
19622
  ginaToolbar.update('view-xhr', XHRView);
19623
+ return;
19513
19624
  }
19514
19625
 
19515
19626
  // popin content
@@ -19602,7 +19713,14 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19602
19713
  // proxy external urls
19603
19714
  // 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/
19604
19715
  //url = url.match(/^(https|http)\:/)[0] + '//cors.io/?' + url;
19605
- url = url.match(/^(https|http)\:/)[0] + '//corsacme.herokuapp.com/?'+ url;
19716
+
19717
+
19718
+ // url = url.match(/^(https|http)\:/)[0] + '//corsacme.herokuapp.com/?'+ url;
19719
+ // url = url.match(/^(https|http)\:/)[0] + '//localhost:4100/proxy/?'+ url;
19720
+ url = 'http://localhost:4100/proxy/?'+ url;
19721
+
19722
+
19723
+
19606
19724
  //url = url.match(/^(https|http)\:/)[0] + '//cors-anywhere.herokuapp.com/' + url;
19607
19725
 
19608
19726
  //delete options.headers['X-Requested-With']
@@ -19616,7 +19734,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19616
19734
  // updating popin options
19617
19735
  $popin.options = merge(options, $popin.options);
19618
19736
 
19619
-
19737
+ var result = null;
19620
19738
  if ( options.withCredentials ) { // Preflighted requests
19621
19739
  if ('withCredentials' in xhr) {
19622
19740
  // XHR for Chrome/Firefox/Opera/Safari.
@@ -19632,7 +19750,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19632
19750
  } else {
19633
19751
  // CORS not supported.
19634
19752
  xhr = null;
19635
- var result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
19753
+ result = 'CORS not supported: the server is missing the header `"Access-Control-Allow-Credentials": true` ';
19636
19754
  triggerEvent(gina, $el, 'error.' + id, result)
19637
19755
  }
19638
19756
  } else { // simple requests
@@ -19645,7 +19763,7 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19645
19763
  }
19646
19764
 
19647
19765
 
19648
-
19766
+ var resultIsObject = false;
19649
19767
  if (xhr) {
19650
19768
  // setting up headers
19651
19769
  xhr.withCredentials = ( typeof(options.withCredentials) != 'undefined' ) ? options.withCredentials : false;
@@ -19653,12 +19771,12 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19653
19771
  xhr.onerror = function(event, err) {
19654
19772
 
19655
19773
  var error = 'Transaction error: might be due to the server CORS settings.\nPlease, check the console for more details.';
19656
- var result = {
19774
+ result = {
19657
19775
  'status': xhr.status, //500,
19658
19776
  'error' : error
19659
19777
  };
19660
19778
 
19661
- var resultIsObject = true;
19779
+ resultIsObject = true;
19662
19780
  instance.eventData.error = result +'\n'+ err;
19663
19781
  updateToolbar(result, resultIsObject);
19664
19782
  triggerEvent(gina, $el, 'error.' + id, result)
@@ -19674,11 +19792,11 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19674
19792
  xhr.onreadystatechange = function (event) {
19675
19793
  if (xhr.readyState == 4) {
19676
19794
  // 200, 201, 201' etc ...
19795
+ var result = null
19677
19796
  if( /^2/.test(xhr.status) ) {
19678
-
19679
19797
  try {
19680
- var result = xhr.responseText
19681
- , contentType = xhr.getResponseHeader("Content-Type")
19798
+ result = xhr.responseText;
19799
+ var contentType = xhr.getResponseHeader("Content-Type")
19682
19800
  , isJsonContent = (/application\/json/.test( contentType )) ? true : false
19683
19801
  , isRedirecting = true // by default
19684
19802
  ;
@@ -19788,10 +19906,15 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19788
19906
  //return
19789
19907
  //}
19790
19908
  if ( !isJsonContent ) {
19909
+ if (GINA_ENV_IS_DEV)
19910
+ updateToolbar(result);
19791
19911
  triggerEvent(gina, $el, 'loaded.' + id, result);
19792
19912
  return
19793
19913
  }
19794
19914
 
19915
+ if (GINA_ENV_IS_DEV)
19916
+ updateToolbar(result);
19917
+
19795
19918
  triggerEvent(gina, $forms[0], 'success.' + id, result);
19796
19919
 
19797
19920
  }
@@ -19801,9 +19924,9 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19801
19924
 
19802
19925
  } catch (err) {
19803
19926
 
19804
- var resultIsObject = false;
19927
+ resultIsObject = false;
19805
19928
 
19806
- var result = {
19929
+ result = {
19807
19930
  'status': 422,
19808
19931
  'error' : err.description || err.stack
19809
19932
  };
@@ -19822,8 +19945,8 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
19822
19945
 
19823
19946
  } else {
19824
19947
  //console.log('error event triggered ', event.target, $form);
19825
- var resultIsObject = false;
19826
- var result = {
19948
+ resultIsObject = false;
19949
+ result = {
19827
19950
  'status': xhr.status,
19828
19951
  'error' : xhr.responseText
19829
19952
  };
@@ -20030,8 +20153,8 @@ define('gina/popin', [ 'require', 'jquery', 'vendor/uuid','utils/merge', 'utils/
20030
20153
  instance.activePopinId = $popin.id;
20031
20154
 
20032
20155
  // update toolbar
20033
- if (GINA_ENV_IS_DEV)
20034
- updateToolbar();
20156
+ // if (GINA_ENV_IS_DEV)
20157
+ // updateToolbar();
20035
20158
  // var XHRData = document.getElementById('gina-without-layout-xhr-data');
20036
20159
  // if ( gina && typeof(window.ginaToolbar) != 'undefined' && window.ginaToolbar && XHRData ) {
20037
20160
  // try {