jsf.js_next_gen 4.0.0-beta-23 → 4.0.1-alpha.0

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 (214) hide show
  1. package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
  2. package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
  3. package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
  4. package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
  5. package/.nyc_output/processinfo/index.json +1 -1
  6. package/README.md +13 -21
  7. package/dist/docs/assets/main.js +56 -52
  8. package/dist/docs/assets/search.js +1 -1
  9. package/dist/docs/assets/style.css +23 -0
  10. package/dist/docs/functions/faces.ajax.addOnError.html +2 -0
  11. package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
  12. package/dist/docs/functions/faces.push.close.html +4 -2
  13. package/dist/docs/functions/faces.push.init.html +19 -7
  14. package/dist/docs/functions/faces.push.open.html +4 -2
  15. package/dist/docs/functions/myfaces.ab.html +9 -4
  16. package/dist/docs/functions/myfaces.onDomReady.html +72 -0
  17. package/dist/docs/index.html +16 -18
  18. package/dist/docs/modules/myfaces.html +3 -1
  19. package/dist/docs/variables/myfaces.oam.html +2 -1
  20. package/dist/window/faces-development.js +2846 -2085
  21. package/dist/window/faces-development.js.br +0 -0
  22. package/dist/window/faces-development.js.gz +0 -0
  23. package/dist/window/faces-development.js.map +1 -1
  24. package/dist/window/faces.js +1 -1
  25. package/dist/window/faces.js.LICENSE.txt +17 -2
  26. package/dist/window/faces.js.br +0 -0
  27. package/dist/window/faces.js.gz +0 -0
  28. package/dist/window/faces.js.map +1 -1
  29. package/dist/window/jsf-development.js +2856 -2084
  30. package/dist/window/jsf-development.js.br +0 -0
  31. package/dist/window/jsf-development.js.gz +0 -0
  32. package/dist/window/jsf-development.js.map +1 -1
  33. package/dist/window/jsf.js +1 -1
  34. package/dist/window/jsf.js.LICENSE.txt +17 -2
  35. package/dist/window/jsf.js.br +0 -0
  36. package/dist/window/jsf.js.gz +0 -0
  37. package/dist/window/jsf.js.map +1 -1
  38. package/package.json +19 -18
  39. package/plans for 4.0.1.txt +8 -0
  40. package/src/main/test.xml +23 -0
  41. package/src/main/typescript/@types/definitions/index.d.ts +19 -2
  42. package/src/main/typescript/api/_api.ts +68 -25
  43. package/src/main/typescript/api/jsf.ts +18 -0
  44. package/src/main/typescript/impl/AjaxImpl.ts +204 -100
  45. package/src/main/typescript/impl/PushImpl.ts +63 -38
  46. package/src/main/typescript/impl/core/Const.ts +56 -40
  47. package/src/main/typescript/impl/util/Assertions.ts +16 -8
  48. package/src/main/typescript/impl/util/AsyncRunnable.ts +85 -10
  49. package/src/main/typescript/impl/util/ExtDomQuery.ts +65 -54
  50. package/src/main/typescript/impl/util/FileUtils.ts +108 -0
  51. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +93 -0
  52. package/src/main/typescript/impl/util/Lang.ts +91 -35
  53. package/src/main/typescript/impl/util/XhrQueueController.ts +112 -0
  54. package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
  55. package/src/main/typescript/impl/xhrCore/EventData.ts +3 -3
  56. package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
  57. package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
  58. package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
  59. package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
  60. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +211 -138
  61. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +92 -166
  62. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +111 -120
  63. package/src/main/typescript/myfaces/OamSubmit.ts +30 -14
  64. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +163 -27
  65. package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +4 -4
  66. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/blank.css +0 -0
  67. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +921 -0
  68. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +108 -0
  69. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +111 -3
  70. package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
  71. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/jakarta.faces.resource/faces.js.jsf +0 -0
  72. package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
  73. package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
  74. package/src/main/typescript/test/myfaces/OnLoadSpec.ts +52 -0
  75. package/src/main/typescript/test/queue/AsynchronousProbe.ts +5 -5
  76. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +4 -3
  77. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +28 -22
  78. package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
  79. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
  80. package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
  81. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
  82. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +320 -15
  83. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +45 -4
  84. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +374 -35
  85. package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
  86. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
  87. package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
  88. package/src/main/typescript/test.xml +6 -0
  89. package/src/main/typescript/tsconfig.json +1 -1
  90. package/src/test/resources/jsf-development.js +1 -1
  91. package/src/tmp/test.html +12 -88
  92. package/target/api/_api.js +63 -21
  93. package/target/api/_api.js.map +1 -1
  94. package/target/api/jsf.js +11 -0
  95. package/target/api/jsf.js.map +1 -1
  96. package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
  97. package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
  98. package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
  99. package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
  100. package/target/impl/AjaxImpl.js +177 -81
  101. package/target/impl/AjaxImpl.js.map +1 -1
  102. package/target/impl/PushImpl.js +66 -35
  103. package/target/impl/PushImpl.js.map +1 -1
  104. package/target/impl/core/Const.js +54 -39
  105. package/target/impl/core/Const.js.map +1 -1
  106. package/target/impl/core/Context.js +10 -0
  107. package/target/impl/core/Context.js.map +1 -0
  108. package/target/impl/util/Assertions.js +12 -7
  109. package/target/impl/util/Assertions.js.map +1 -1
  110. package/target/impl/util/AsyncQueue.js.map +1 -1
  111. package/target/impl/util/AsyncRunnable.js +60 -0
  112. package/target/impl/util/AsyncRunnable.js.map +1 -1
  113. package/target/impl/util/ExtDomQuery.js +66 -48
  114. package/target/impl/util/ExtDomQuery.js.map +1 -1
  115. package/target/impl/util/FileUtils.js +97 -0
  116. package/target/impl/util/FileUtils.js.map +1 -0
  117. package/target/impl/util/HiddenElementBuilder.js +7 -0
  118. package/target/impl/util/HiddenElementBuilder.js.map +1 -0
  119. package/target/impl/util/HiddenInputBuilder.js +83 -0
  120. package/target/impl/util/HiddenInputBuilder.js.map +1 -0
  121. package/target/{types/index.js → impl/util/IAsyncRunnable.js} +11 -2
  122. package/target/impl/util/IAsyncRunnable.js.map +1 -0
  123. package/target/impl/util/Lang.js +81 -31
  124. package/target/impl/util/Lang.js.map +1 -1
  125. package/target/impl/util/URLCodec.js +77 -0
  126. package/target/impl/util/URLCodec.js.map +1 -0
  127. package/target/impl/util/XhrQueueController.js +107 -0
  128. package/target/impl/util/XhrQueueController.js.map +1 -0
  129. package/target/impl/xhrCore/ErrorData.js +10 -8
  130. package/target/impl/xhrCore/ErrorData.js.map +1 -1
  131. package/target/impl/xhrCore/EventData.js +2 -2
  132. package/target/impl/xhrCore/EventData.js.map +1 -1
  133. package/target/impl/xhrCore/RequestContext.js +11 -0
  134. package/target/impl/xhrCore/RequestContext.js.map +1 -0
  135. package/target/impl/xhrCore/RequestDataResolver.js +70 -23
  136. package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
  137. package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
  138. package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
  139. package/target/impl/xhrCore/Response.js +44 -29
  140. package/target/impl/xhrCore/Response.js.map +1 -1
  141. package/target/impl/xhrCore/ResponseProcessor.js +187 -119
  142. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  143. package/target/impl/xhrCore/XhrFormData.js +82 -156
  144. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  145. package/target/impl/xhrCore/XhrQueHandler.js +11 -0
  146. package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
  147. package/target/impl/xhrCore/XhrQueueController.js +62 -0
  148. package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
  149. package/target/impl/xhrCore/XhrRequest.js +94 -106
  150. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  151. package/target/myfaces/OamSubmit.js +25 -14
  152. package/target/myfaces/OamSubmit.js.map +1 -1
  153. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +124 -23
  154. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  155. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
  156. package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
  157. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +4 -4
  158. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  159. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
  160. package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
  161. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
  162. package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
  163. package/target/test/frameworkBase/_ext/shared/StandardInits.js +103 -3
  164. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  165. package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
  166. package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
  167. package/target/test/impl/ImplTest.spec.js +2 -2
  168. package/target/test/impl/ImplTest.spec.js.map +1 -1
  169. package/target/test/impl/ImplTest_23.spec.js +2 -2
  170. package/target/test/impl/ImplTest_23.spec.js.map +1 -1
  171. package/target/test/myfaces/OnLoadSpec.js +57 -0
  172. package/target/test/myfaces/OnLoadSpec.js.map +1 -0
  173. package/target/test/queue/AsynchronousQueueTest.spec.js +3 -3
  174. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  175. package/target/test/xhrCore/EventTests.spec.js +26 -19
  176. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  177. package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
  178. package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
  179. package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
  180. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
  181. package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
  182. package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
  183. package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
  184. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  185. package/target/test/xhrCore/RequestTest.spec.js +288 -11
  186. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  187. package/target/test/xhrCore/RequestTest_23.spec.js +40 -2
  188. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  189. package/target/test/xhrCore/ResponseTest.spec.js +315 -24
  190. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  191. package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
  192. package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
  193. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
  194. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
  195. package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
  196. package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
  197. package/target/test-classes/.gz +0 -0
  198. package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
  199. package/target/test-classes/fileuploadtest.html +24 -0
  200. package/target/test-classes/jsf-development.js +3559 -0
  201. package/target/test-classes/jsf-development.js.br +0 -0
  202. package/target/test-classes/jsf-development.js.gz +0 -0
  203. package/target/test-classes/jsf-development.js.map +1 -0
  204. package/target/test-classes/jsf.js +3 -0
  205. package/target/test-classes/jsf.js.br +0 -0
  206. package/target/test-classes/jsf.js.gz +0 -0
  207. package/tmp.xml +36 -0
  208. package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
  209. package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
  210. package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
  211. package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
  212. package/src/main/typescript/impl/util/AsyncQueue.ts +0 -133
  213. package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +0 -231
  214. package/target/types/index.js.map +0 -1
@@ -0,0 +1,108 @@
1
+ export const tobagoSheetWithoutHeader = `<tobago-sheet id="page:mainForm:s1" data-tobago-selection-mode="multi" data-tobago-first="0" rows="0" row-count="88" data-tobago-layout="{&quot;columns&quot;:[1.0]}">
2
+ <style nonce="" id="page:mainForm:s1:j_id_2n">#page\\:mainForm\\:s1{max-height:486px;}
3
+ </style>
4
+ <input id="page:mainForm:s1::widths" name="page:mainForm:s1::widths" type="hidden" value="[]">
5
+ <input id="page:mainForm:s1::rendered" name="page:mainForm:s1::rendered" type="hidden" value="[true]">
6
+ <input id="page:mainForm:s1::scrollPosition" name="page:mainForm:s1::scrollPosition" type="hidden" value="[0,0]">
7
+ <input id="page:mainForm:s1::selected" name="page:mainForm:s1::selected" type="hidden" value="[]">
8
+ <div class="tobago-body">
9
+ <table cellspacing="0" cellpadding="0" summary="" class="table table-sm tobago-tableLayout-fixed">
10
+ <colgroup>
11
+ <col>
12
+ <col>
13
+ </colgroup>
14
+ <tbody>
15
+ <tr row-index="0" id="page:mainForm:s1:0:sample0">
16
+ <td>
17
+ <tobago-out id="page:mainForm:s1:0:t_name"><span class="form-control-plaintext">Sun</span></tobago-out>
18
+ </td>
19
+ <td>
20
+ <div>
21
+ </div>
22
+ <tobago-behavior event="click" client-id="page:mainForm:s1:0:sample0" execute="page:mainForm:s1:0:sample0"></tobago-behavior>
23
+ </td>
24
+ </tr>
25
+ <tr row-index="1" id="page:mainForm:s1:1:sample0">
26
+ <td>
27
+ <tobago-out id="page:mainForm:s1:1:t_name"><span class="form-control-plaintext">Mercury</span></tobago-out>
28
+ </td>
29
+ <td>
30
+ <div>
31
+ </div>
32
+ <tobago-behavior event="click" client-id="page:mainForm:s1:1:sample0" execute="page:mainForm:s1:1:sample0"></tobago-behavior>
33
+ </td>
34
+ </tr>
35
+ <tr row-index="2" id="page:mainForm:s1:2:sample0">
36
+ <td>
37
+ <tobago-out id="page:mainForm:s1:2:t_name"><span class="form-control-plaintext">Venus</span></tobago-out>
38
+ </td>
39
+ <td>
40
+ <div>
41
+ </div>
42
+ <tobago-behavior event="click" client-id="page:mainForm:s1:2:sample0" execute="page:mainForm:s1:2:sample0"></tobago-behavior>
43
+ </td>
44
+ </tr>
45
+ <tr row-index="3" id="page:mainForm:s1:3:sample0">
46
+ <td>
47
+ <tobago-out id="page:mainForm:s1:3:t_name"><span class="form-control-plaintext">Earth</span></tobago-out>
48
+ </td>
49
+ <td>
50
+ <div>
51
+ </div>
52
+ <tobago-behavior event="click" client-id="page:mainForm:s1:3:sample0" execute="page:mainForm:s1:3:sample0"></tobago-behavior>
53
+ </td>
54
+ </tr>
55
+ <tr row-index="4" id="page:mainForm:s1:4:sample0">
56
+ <td>
57
+ <tobago-out id="page:mainForm:s1:4:t_name"><span class="form-control-plaintext">Mars</span></tobago-out>
58
+ </td>
59
+ <td>
60
+ <div>
61
+ </div>
62
+ <tobago-behavior event="click" client-id="page:mainForm:s1:4:sample0" execute="page:mainForm:s1:4:sample0"></tobago-behavior>
63
+ </td>
64
+ </tr>
65
+ <tr row-index="5" id="page:mainForm:s1:5:sample0">
66
+ <td>
67
+ <tobago-out id="page:mainForm:s1:5:t_name"><span class="form-control-plaintext">Jupiter</span></tobago-out>
68
+ </td>
69
+ <td>
70
+ <div>
71
+ </div>
72
+ <tobago-behavior event="click" client-id="page:mainForm:s1:5:sample0" execute="page:mainForm:s1:5:sample0"></tobago-behavior>
73
+ </td>
74
+ </tr>
75
+ <tr row-index="6" id="page:mainForm:s1:6:sample0">
76
+ <td>
77
+ <tobago-out id="page:mainForm:s1:6:t_name"><span class="form-control-plaintext">Saturn</span></tobago-out>
78
+ </td>
79
+ <td>
80
+ <div>
81
+ </div>
82
+ <tobago-behavior event="click" client-id="page:mainForm:s1:6:sample0" execute="page:mainForm:s1:6:sample0"></tobago-behavior>
83
+ </td>
84
+ </tr>
85
+ <tr row-index="7" id="page:mainForm:s1:7:sample0">
86
+ <td>
87
+ <tobago-out id="page:mainForm:s1:7:t_name"><span class="form-control-plaintext">Uranus</span></tobago-out>
88
+ </td>
89
+ <td>
90
+ <div>
91
+ </div>
92
+ <tobago-behavior event="click" client-id="page:mainForm:s1:7:sample0" execute="page:mainForm:s1:7:sample0"></tobago-behavior>
93
+ </td>
94
+ </tr>
95
+ <tr row-index="8" id="page:mainForm:s1:8:sample0">
96
+ <td>
97
+ <tobago-out id="page:mainForm:s1:8:t_name"><span class="form-control-plaintext">Neptune</span></tobago-out>
98
+ </td>
99
+ <td>
100
+ <div>
101
+ </div>
102
+ <tobago-behavior event="click" client-id="page:mainForm:s1:8:sample0" execute="page:mainForm:s1:8:sample0"></tobago-behavior>
103
+ </td>
104
+ </tr>
105
+ </tbody>
106
+ </table>
107
+ </div>
108
+ </tobago-sheet>`;
@@ -83,6 +83,7 @@ export module StandardInits {
83
83
  <body>
84
84
  <form id="blarg">
85
85
  <input type="text" id="input_1" name="input_1" value="input_1_val"></input>
86
+ <input type="text" id="input_2_text" name="input_2_text" value="input_2_text_val"></input>
86
87
  <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
87
88
  <input type="button" id="input_2" name="input_2" value="input_1_val"></input>
88
89
  </form>
@@ -91,6 +92,102 @@ export module StandardInits {
91
92
 
92
93
 
93
94
 
95
+ /**
96
+ * a page simulating basically a simple faces form
97
+ */
98
+ const HTML_FORM_PREFIXED = `<!DOCTYPE html>
99
+ <html lang="en">
100
+ <head>
101
+ <meta charset="UTF-8">
102
+ <title>Title</title>
103
+ </head>
104
+ <body>
105
+ <form id="form1">
106
+ <input type="text" id="form1:input_1::field" name="form1:input_1" value="form1:input_1_val"></input>
107
+ <input type="hidden" id="form1:jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
108
+ <input type="button" id="form1:input_2::field" name="form1:input_2" value="form1:input_1_val"></input>
109
+ <input type="text" id="form1:input_3::field" name="form1:input_23 value="form1:input_1_val"></input>
110
+ </form>
111
+ </body>
112
+ </html>`;
113
+
114
+
115
+ /**
116
+ * a page based on Tobago for a file upload
117
+ */
118
+ const HTML_TOBAGO_FILE_FORM = `<!DOCTYPE html>
119
+ <html lang='de'>
120
+ <head>
121
+ <meta charset='UTF-8'>
122
+ <meta name='viewport' content='width=device-width, initial-scale=1.0'>
123
+ <title>Test</title>
124
+ </head>
125
+ <body>
126
+ <tobago-page locale='de' class='container-fluid' id='page' focus-on-error='true' wait-overlay-delay-full='1000' wait-overlay-delay-ajax='1000'>
127
+ <form action='/content/100-upload/File_Upload.xhtml' id='page::form' method='post' enctype='multipart/form-data' accept-charset='UTF-8' data-tobago-context-path=''>
128
+ <input type='hidden' name='javax.faces.source' id='javax.faces.source' disabled='disabled'>
129
+ <tobago-focus id='page::lastFocusId'>
130
+ <input type='hidden' name='page::lastFocusId' id='page::lastFocusId::field'>
131
+ </tobago-focus>
132
+ <input type='hidden' name='org.apache.myfaces.tobago.webapp.Secret' id='org.apache.myfaces.tobago.webapp.Secret' value='secretValue'>
133
+ <tobago-file id='page:fileAjax' class='tobago-auto-spacing'>
134
+ <div class='input-group'>
135
+ <input type='file' tabindex='-1' id='page:fileAjax::field' class='form-control' name='page:fileAjax'>
136
+ <tobago-behavior event='change' client-id='page:fileAjax' field-id='page:fileAjax::field' execute='page:fileAjax'></tobago-behavior>
137
+ <label class='input-group-text' for='page:fileAjax::field'><span><i class='bi-folder2-open'></i></span></label>
138
+ </div>
139
+ </tobago-file>
140
+ <div class='tobago-page-menuStore'>
141
+ </div>
142
+ <span id='page::jsf-state-container'><input type='hidden' name='javax.faces.ViewState' id='j_id__v_0:javax.faces.ViewState:1' value='viewStateValue' autocomplete='off'><input type='hidden' name='javax.faces.RenderKitId' value='tobago'><input type='hidden' id='j_id__v_0:javax.faces.ClientWindow:1' name='javax.faces.ClientWindow' value='clientWindowValue'></span>
143
+ </form>
144
+ </tobago-page>
145
+ </body>
146
+ </html>`;
147
+
148
+ /**
149
+ * a page simulating basically a simple faces form
150
+ */
151
+ export const HTML_PREFIX_EMBEDDED_BODY = `<form id="form1">
152
+ <tobago-in id="page:input" class="tobago-auto-spacing">
153
+ <input type="text" name="page:input" id="page:input::field" class="form-control" value="input_value">
154
+ <tobago-behavior event="change" client-id="page:input" field-id="page:input::field" execute="page:input" render="page:output"></tobago-behavior>
155
+ </tobago-in>
156
+
157
+ <tobago-out id="page:output" class="tobago-auto-spacing">
158
+ <input type="text" name="page:output" id="page:output::field" class="form-control">
159
+ </tobago-out>
160
+ </form>`;
161
+
162
+ const HTML_FORM_PREFIXED_EMBEDDED = `<!DOCTYPE html>
163
+ <html lang="en">
164
+ <head>
165
+ <meta charset="UTF-8">
166
+ <title>Title</title>
167
+ </head>
168
+ <body>
169
+ ${HTML_PREFIX_EMBEDDED_BODY}
170
+ </body>
171
+ </html>`;
172
+
173
+
174
+ const HTML_FORM_NAMESPACED = `<!DOCTYPE html>
175
+ <html lang="en">
176
+ <head>
177
+ <meta charset="UTF-8">
178
+ <title>Title</title>
179
+ </head>
180
+ <body>
181
+ <form id="jd_0:blarg">
182
+ <input type="text" id="jd_0:input_1" name="jd_0:input_1" value="input_1_val"></input>
183
+ <input type="hidden" id="jd_0:jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
184
+ <input type="button" id="jd_0:input_2" name="input_2" value="input_1_val"></input>
185
+ </form>
186
+ </body>
187
+ </html>`;
188
+
189
+
190
+
94
191
  /**
95
192
  * a page simulating basically a simple faces form
96
193
  */
@@ -102,7 +199,7 @@ export module StandardInits {
102
199
  </head>
103
200
  <body>
104
201
  <form id="blarg" enctype="multipart/form-data">
105
- <input type="file" id="fíleupload"></input>
202
+ <input type="file" id="fíleupload" name="fíleupload"></input>
106
203
  <input type="text" id="input_1" name="input_1" value="input_1_val"></input>
107
204
  <input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
108
205
  <input type="button" id="input_2" name="input_2" value="input_1_val"></input>
@@ -126,7 +223,7 @@ export module StandardInits {
126
223
  <meta charset="UTF-8">
127
224
  <title>Title</title>
128
225
  <script type="text/javascript"
129
- src="/wfmportal/${IS_40 ? 'jakarta' : 'javax'}.faces.resource/${IS_40 ? 'faces': 'jsf'}.js.jsf?ln=jakarta.faces&separator=${separatorChar}"></script>
226
+ src="./fixtures/${IS_40 ? 'jakarta' : 'javax'}.faces.resource/${IS_40 ? 'faces': 'jsf'}.js.jsf?ln=jakarta.faces&separator=${separatorChar}"></script>
130
227
  </head>
131
228
  <body>
132
229
  <form id="blarg">
@@ -277,12 +374,18 @@ export module StandardInits {
277
374
  export function defaultMyFaces(withJsf = true): Promise<() => void> {
278
375
  return init(HTML_FORM_DEFAULT, withJsf);
279
376
  }
377
+ export function defaultMyFacesNamespaces(withJsf = true): Promise<() => void> {
378
+ return init(HTML_FORM_NAMESPACED, withJsf);
379
+ }
280
380
  export function defaultMyFaces23(withJsf = true): Promise<() => void> {
281
381
  return init(HTML_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
282
382
  }
283
383
  export function defaultFileForm(withJsf = true): Promise<() => void> {
284
384
  return init(HTML_FILE_FORM_DEFAULT, withJsf);
285
385
  }
386
+ export function tobagoFileForm(withJsf = true): Promise<() => void> {
387
+ return init(HTML_TOBAGO_FILE_FORM, withJsf);
388
+ }
286
389
  export function defaultFileForm_23(withJsf = true): Promise<() => void> {
287
390
  return init(HTML_FILE_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
288
391
  }
@@ -302,6 +405,11 @@ export module StandardInits {
302
405
  return <any>init((IS_40) ? PROTOCOL_PAGE : PROTOCOL_PAGE.replace(/jakarta/gi,"javax"), withJsf, IS_40);
303
406
  }
304
407
 
408
+ export function prefixEmbeddedPage(withJsf = true, IS_40 = true): Promise<() => void> {
409
+ return <any>init((IS_40) ? HTML_FORM_PREFIXED_EMBEDDED : HTML_FORM_PREFIXED_EMBEDDED.replace(/jakarta/gi,"javax"), withJsf, IS_40);
410
+ }
411
+
412
+
305
413
  export function defaultSeparatorChar(separatorChar: string, withJsf = true, IS_40 = true): Promise<() => void> {
306
414
  let template = HTML_DEFAULT_SEPARATOR_CHAR(separatorChar, IS_40);
307
415
  return init(template, withJsf);
@@ -406,7 +514,7 @@ export module StandardInits {
406
514
  //let dom2 = new JSDOM(template)
407
515
  //return initMyFacesFromDom(dom2);
408
516
  let clean = null;
409
- //we use jsdom global to fullfill our requirements
517
+ //we use jsdom global to fulfill our requirements
410
518
  //we need to import dynamically and use awaits
411
519
  if (withJsf) {
412
520
 
@@ -194,7 +194,7 @@ export class XmlResponses {
194
194
  <partial-response id="j_id__v_0"><changes><update id="jakarta.faces.Resource">
195
195
  <![CDATA[
196
196
  <script src="../../../xhrCore/fixtures/addedViewHead3.js"></script>
197
- <style type="text/css" rel="../../../xhrCore/fixtures/addedViewHead2.css"></style>
197
+ <link rel="stylesheet" href="../../../xhrCore/fixtures/addedViewHead2.css"></link>
198
198
  <script type="text/javascript">
199
199
  document.getElementById('resource_area_1').innerHTML = 'booga';
200
200
  </script>
@@ -204,6 +204,45 @@ export class XmlResponses {
204
204
  </partial-response>
205
205
  `
206
206
 
207
+ static HEAD_REPLACE = `
208
+ <partial-response id="j_id__v_0"><changes><update id="jakarta.faces.ViewHead">
209
+ <![CDATA[
210
+ <head>
211
+ <script type="text/javascript" src="../../../xhrCore/fixtures/addedViewHead3.js"></script>
212
+ <link rel="stylesheet" href="../../../xhrCore/fixtures/addedViewHead2.css"></link>
213
+ <script type="text/javascript">
214
+ setTimeout(() => document.getElementById('resource_area_1').innerHTML = 'booga', 100);
215
+ </script>
216
+ </head>
217
+ ]]>
218
+ </update>
219
+ </changes>
220
+ </partial-response>
221
+ `
222
+
223
+ static HEAD_REPLACE2 = `
224
+ <partial-response id="j_id__v_0"><changes><update id="jakarta.faces.ViewHead">
225
+ <![CDATA[
226
+ <head>
227
+ <title>After Update</title>
228
+ <meta charset="UTF-8">
229
+ <meta name="description" content="Free Web tutorials">
230
+ <meta name="keywords" content="HTML, CSS, JavaScript, JSF">
231
+ <meta name="viewport" content="width=device-width, initial-scale=0.8">
232
+ <meta name="author" content="Whoever">
233
+ <script type="text/javascript" src="../../../xhrCore/fixtures/addedViewHead3.js"></script>
234
+ <link rel="stylesheet" href="../../../xhrCore/fixtures/addedViewHead2.css"></link>
235
+ <script type="text/javascript">
236
+ setTimeout(() => document.getElementById('resource_area_1').innerHTML = 'booga', 100);
237
+ </script>
238
+ </head>
239
+ ]]>
240
+ </update>
241
+ </changes>
242
+ </partial-response>
243
+ `
244
+
245
+
207
246
  static NONCE_REPLY = `
208
247
  <partial-response><changes><update id='nonce_result'>
209
248
  <![CDATA[<script nonce='test12d3' type='text/javascript' src='http://foobaz/nonce_script.js'></script>]]>
@@ -20,7 +20,7 @@ import {expect} from 'chai';
20
20
  import * as sinon from 'sinon';
21
21
 
22
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
23
- import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
23
+ import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
24
24
  import defaultMyFaces = StandardInits.defaultMyFaces;
25
25
 
26
26
 
@@ -60,9 +60,9 @@ describe('faces.ajax.request test suite', () => {
60
60
  expect(addRequestToQueue.callCount).to.eq(1);
61
61
  const context = (<Config>addRequestToQueue.args[0][2]);
62
62
 
63
- expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
63
+ expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_RENDER).value).eq("@all");
64
64
  //Execute issuing form due to @form and always the issuing element
65
- expect(context.getIf("passThrgh", P_EXECUTE).value).eq("blarg input_2");
65
+ expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).value).eq("blarg input_2");
66
66
  } finally {
67
67
  //once done we restore the proper state
68
68
  addRequestToQueue.restore();
@@ -20,7 +20,7 @@ import {expect} from 'chai';
20
20
  import * as sinon from 'sinon';
21
21
 
22
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
23
- import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
23
+ import {CTX_PARAM_REQ_PASS_THR, P_EXECUTE, P_RENDER} from "../../impl/core/Const";
24
24
  import defaultMyFaces23 = StandardInits.defaultMyFaces23;
25
25
 
26
26
 
@@ -60,9 +60,9 @@ describe('javax.ajax.request test suite', () => {
60
60
  expect(addRequestToQueue.callCount).to.eq(1);
61
61
  const context = (<Config>addRequestToQueue.args[0][2]);
62
62
 
63
- expect(context.getIf("passThrgh", P_RENDER).value).eq("@all");
63
+ expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_RENDER).value).eq("@all");
64
64
  //Execute issuing form due to @form and always the issuing element
65
- expect(context.getIf("passThrgh", P_EXECUTE).value).eq("blarg input_2");
65
+ expect(context.getIf(CTX_PARAM_REQ_PASS_THR, P_EXECUTE).value).eq("blarg input_2");
66
66
  } finally {
67
67
  //once done we restore the proper state
68
68
  addRequestToQueue.restore();
@@ -120,10 +120,6 @@ describe('javax.ajax.request test suite', () => {
120
120
  expect(!!called["func5"]).to.be.false;
121
121
 
122
122
  });
123
-
124
-
125
-
126
-
127
123
  });
128
124
 
129
125
 
@@ -0,0 +1,52 @@
1
+ /*! Licensed to the Apache Software Foundation (ASF) under one or more
2
+ * contributor license agreements. See the NOTICE file distributed with
3
+ * this work for additional information regarding copyright ownership.
4
+ * The ASF licenses this file to you under the Apache License, Version 2.0
5
+ * (the "License"); you may not use this file except in compliance with
6
+ * the License. You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import {describe, it} from "mocha";
18
+
19
+ import {expect} from "chai";
20
+ import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
21
+ import defaultMyFaces = StandardInits.defaultMyFaces;
22
+
23
+
24
+
25
+ declare var myfaces: any;
26
+
27
+ /**
28
+ * Adds test s for the newly introduced onload handling
29
+ */
30
+ describe('Tests on the xhr core when it starts to call the request', function () {
31
+
32
+ beforeEach(async () => {
33
+ return
34
+ });
35
+
36
+ it("must be present", async function(done) {
37
+ await defaultMyFaces();
38
+ expect(myfaces?.onDomReady).to.exist;
39
+ done();
40
+ });
41
+
42
+ it("must be called on onDocumentReady", async function(done) {
43
+ let called: boolean = false;
44
+ const onDomCalled = () => {
45
+ expect(true).to.true;
46
+ done();
47
+ }
48
+ myfaces?.onDomReady(onDomCalled);
49
+ await defaultMyFaces();
50
+ });
51
+
52
+ });
@@ -18,10 +18,10 @@
18
18
  * we need a probe to test our asynchronous behavior
19
19
  * the asynchronous behavior needs to be in an asynchronous runnable
20
20
  */
21
- import {AsyncRunnable} from "../../impl/util/AsyncRunnable";
21
+ import {IAsyncRunnable} from "../../impl/util/AsyncRunnable";
22
22
  import {IValueHolder} from "mona-dish";
23
23
 
24
- export class ProbeClass implements AsyncRunnable<Promise<any>>, IValueHolder<Promise<any>> {
24
+ export class ProbeClass implements IAsyncRunnable<Promise<any>>, IValueHolder<Promise<any>> {
25
25
 
26
26
  value: Promise<any>;
27
27
  fCatch: (data: any) => any;
@@ -44,7 +44,7 @@ export class ProbeClass implements AsyncRunnable<Promise<any>>, IValueHolder<Pro
44
44
  });
45
45
  }
46
46
 
47
- catch(func: (data: any) => any): AsyncRunnable<boolean> {
47
+ catch(func: (data: any) => any): IAsyncRunnable<boolean> {
48
48
  let catchFunc = (data: any) => {
49
49
  this.catchPerformed = true;
50
50
  return func(data);
@@ -57,7 +57,7 @@ export class ProbeClass implements AsyncRunnable<Promise<any>>, IValueHolder<Pro
57
57
  return this;
58
58
  }
59
59
 
60
- finally(func: () => void): AsyncRunnable<boolean> {
60
+ finally(func: () => void): IAsyncRunnable<boolean> {
61
61
  let finallyFunc = () => {
62
62
  this.finallyPerformed = true;
63
63
  func();
@@ -88,7 +88,7 @@ export class ProbeClass implements AsyncRunnable<Promise<any>>, IValueHolder<Pro
88
88
  //TODO do something with it
89
89
  }
90
90
 
91
- then(func: (data: any) => any): AsyncRunnable<boolean> {
91
+ then(func: (data: any) => any): IAsyncRunnable<boolean> {
92
92
 
93
93
  let thenFunc = (data: any) => {
94
94
  this.thenPerformed = true;
@@ -18,10 +18,11 @@ import {describe, it} from 'mocha';
18
18
  import {expect} from 'chai';
19
19
  import * as sinon from 'sinon';
20
20
  import {ProbeClass} from "./AsynchronousProbe";
21
- import {AsynchronousQueue} from "../../impl/util/AsyncQueue";
21
+
22
22
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
23
23
  import {Implementation} from "../../impl/AjaxImpl";
24
24
  import defaultMyFaces = StandardInits.defaultMyFaces;
25
+ import {XhrQueueController} from "../../impl/util/XhrQueueController";
25
26
 
26
27
  describe('Asynchronous Queue tests', () => {
27
28
 
@@ -60,7 +61,7 @@ describe('Asynchronous Queue tests', () => {
60
61
 
61
62
  const probe1 = new ProbeClass(setTimeout);
62
63
 
63
- const queue = new AsynchronousQueue();
64
+ const queue = new XhrQueueController();
64
65
  probe1.then(() => {
65
66
  expect(probe1.thenPerformed, "called").to.be.true;
66
67
  done();
@@ -69,7 +70,7 @@ describe('Asynchronous Queue tests', () => {
69
70
  });
70
71
 
71
72
  it('multiple entries', (done) => {
72
- const queue = new AsynchronousQueue();
73
+ const queue = new XhrQueueController();
73
74
  const probe1 = new ProbeClass(setTimeout);
74
75
  const probe2 = new ProbeClass(setTimeout);
75
76
  const probe3 = new ProbeClass(setTimeout);
@@ -87,28 +87,34 @@ describe('tests the addOnEvent and addOnError handling', function () {
87
87
  });
88
88
 
89
89
  it("must have onError called in case of error", function () {
90
- let onErrorCalled1 = 0;
91
- let onErrorCalled2 = 0;
92
-
93
- let errorTitle = '';
94
- let errorMessage = '';
95
- faces.ajax.addOnError((data: any) => {
96
- errorTitle = data.errorName;
97
- errorMessage = data.errorMessage;
98
- onErrorCalled1++
99
- });
100
- faces.ajax.addOnError(() => {
101
- onErrorCalled2++;
102
- });
103
-
104
- //cmd_error_component
105
- DQ.byId("cmd_error_component").click();
106
- this.respond(XmlResponses.ERROR_2);
107
-
108
- expect(onErrorCalled1).to.eq(1);
109
- expect(onErrorCalled2).to.eq(1);
110
- expect(errorTitle).to.eq('Erro21');
111
- expect(errorMessage).to.eq('Error2 Text');
90
+ const oldErr = console.error;
91
+ console.error = () => {}
92
+ try {
93
+ let onErrorCalled1 = 0;
94
+ let onErrorCalled2 = 0;
95
+
96
+ let errorTitle = '';
97
+ let errorMessage = '';
98
+ faces.ajax.addOnError((data: any) => {
99
+ errorTitle = data.errorName;
100
+ errorMessage = data.errorMessage;
101
+ onErrorCalled1++
102
+ });
103
+ faces.ajax.addOnError(() => {
104
+ onErrorCalled2++;
105
+ });
106
+
107
+ //cmd_error_component
108
+ DQ.byId("cmd_error_component").click();
109
+ this.respond(XmlResponses.ERROR_2);
110
+
111
+ expect(onErrorCalled1).to.eq(1);
112
+ expect(onErrorCalled2).to.eq(1);
113
+ expect(errorTitle).to.eq('Erro21');
114
+ expect(errorMessage).to.eq('serverError: Error2 Text');
115
+ } finally {
116
+ console.error = oldErr;
117
+ }
112
118
  });
113
119
 
114
120
  it("must have an id set if there is an emitting element", function () {
@@ -17,7 +17,7 @@ import {describe, it} from "mocha";
17
17
  import * as sinon from "sinon";
18
18
  import {expect} from "chai";
19
19
  import {StandardInits} from "../frameworkBase/_ext/shared/StandardInits";
20
- import {DomQuery} from "mona-dish";
20
+ import {DomQuery, DQ} from "mona-dish";
21
21
  import defaultFileForm = StandardInits.defaultFileForm;
22
22
  import {Implementation} from "../../impl/AjaxImpl";
23
23
 
@@ -66,6 +66,8 @@ describe('Tests on the xhr core when it starts to call the request', function ()
66
66
  const CONTENT_TYPE = "Content-Type";
67
67
  const POST = "POST";
68
68
 
69
+ global["debug_f"] = true;
70
+
69
71
  try {
70
72
 
71
73
  let button = DomQuery.byId("input_1");
@@ -128,11 +130,12 @@ describe('Tests on the xhr core when it starts to call the request', function ()
128
130
  const MULTIPART_FORM = "multipart/form-data";
129
131
  const POST = "POST";
130
132
 
133
+
131
134
  try {
132
135
  let button = DomQuery.byId("input_1");
133
136
 
134
137
  button.addEventListener("click", (event: Event) => {
135
- faces.ajax.request(event.target, event, {render: '@all', execute: 'input_1 fileupload'});
138
+ faces.ajax.request(event.target, event, {render: '@all', execute: '@none'});
136
139
  }).click();
137
140
 
138
141
  expect(this.requests.length).to.eq(1);