jsf.js_next_gen 4.0.0-RC.1 → 4.0.0-RC.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/docs/functions/faces.push.init.html +5 -1
- package/dist/docs/functions/myfaces.ab.html +2 -2
- package/dist/window/faces-development.js +2784 -2036
- package/dist/window/faces-development.js.br +0 -0
- package/dist/window/faces-development.js.gz +0 -0
- package/dist/window/faces-development.js.map +1 -1
- package/dist/window/faces.js +1 -1
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -1
- package/dist/window/jsf-development.js +2796 -2037
- package/dist/window/jsf-development.js.br +0 -0
- package/dist/window/jsf-development.js.gz +0 -0
- package/dist/window/jsf-development.js.map +1 -1
- package/dist/window/jsf.js +1 -1
- package/dist/window/jsf.js.br +0 -0
- package/dist/window/jsf.js.gz +0 -0
- package/dist/window/jsf.js.map +1 -1
- package/package.json +2 -2
- package/src/main/typescript/@types/definitions/index.d.ts +13 -1
- package/src/main/typescript/api/_api.ts +4 -2
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +22 -2
- package/src/main/typescript/impl/PushImpl.ts +38 -12
- package/src/main/typescript/impl/core/Const.ts +2 -0
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +2 -2
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +24 -12
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +172 -8
- package/src/main/typescript/tsconfig.json +1 -1
- package/target/api/_api.js +28 -13
- package/target/api/_api.js.map +1 -1
- package/target/api/faces.js +4 -4
- package/target/api/faces.js.map +1 -1
- package/target/api/jsf.js +16 -5
- package/target/api/jsf.js.map +1 -1
- package/target/impl/AjaxImpl.js +79 -53
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +81 -48
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +5 -4
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +14 -9
- package/target/impl/core/ImplTypes.js.map +1 -1
- package/target/impl/i18n/Messages.js +4 -3
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +18 -9
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js +36 -28
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +219 -144
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +28 -21
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/xhrCore/ErrorData.js +61 -36
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +13 -10
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +18 -16
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +16 -16
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +16 -16
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +133 -119
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +114 -69
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrRequest.js +95 -85
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +15 -15
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/LangTest.spec.js +32 -46
- package/target/test/frameworkBase/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +228 -238
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +31 -45
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +33 -24
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +8 -8
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +31 -31
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +48 -50
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +132 -247
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +22 -199
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +59 -32
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +59 -32
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/impl/SeparatorCharsTest.spec.js +17 -17
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +25 -25
- package/target/test/myfaces/OamSubmit.spec.js.map +1 -1
- package/target/test/queue/AsynchronousProbe.js +29 -23
- package/target/test/queue/AsynchronousProbe.js.map +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +70 -39
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +73 -42
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +16 -14
- package/target/test/xhrCore/FakeWebsocket.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +77 -46
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +68 -37
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +268 -84
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +140 -93
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +91 -122
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +83 -114
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +61 -30
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +93 -60
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +15 -41
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- package/target/classes/com/example/jsfs_js_ts/DecoratedFacesJS.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/DecoratingResourceHandlerWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMapFileResourceWrapper.class +0 -0
- package/target/classes/com/example/jsfs_js_ts/FacesJSMappingDecorator.class +0 -0
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +0 -4
- package/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +0 -4
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +0 -1
- package/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +0 -1
- package/target/surefire-reports/TEST-com.example.jsfs_js_ts.JsfsJsTsApplicationTests.xml +0 -78
- package/target/surefire-reports/com.example.jsfs_js_ts.JsfsJsTsApplicationTests.txt +0 -7
- package/target/test-classes/.gz +0 -0
- package/target/test-classes/com/example/jsfs_js_ts/JsfsJsTsApplicationTests.class +0 -0
- package/target/test-classes/fileuploadtest.html +0 -24
- package/target/test-classes/jsf-development.js +0 -3559
- package/target/test-classes/jsf-development.js.br +0 -0
- package/target/test-classes/jsf-development.js.gz +0 -0
- package/target/test-classes/jsf-development.js.map +0 -1
- package/target/test-classes/jsf.js +0 -3
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
|
@@ -39,8 +39,10 @@ let issueStdReq = function (element) {
|
|
|
39
39
|
faces.ajax.request(element, null, {
|
|
40
40
|
execute: "input_1",
|
|
41
41
|
render: "@form",
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
params: {
|
|
43
|
+
pass1: "pass1",
|
|
44
|
+
pass2: "pass2"
|
|
45
|
+
}
|
|
44
46
|
});
|
|
45
47
|
};
|
|
46
48
|
/**
|
|
@@ -103,7 +105,6 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
103
105
|
});
|
|
104
106
|
|
|
105
107
|
it('it must have the pass through values properly passed', function (done) {
|
|
106
|
-
|
|
107
108
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
108
109
|
try {
|
|
109
110
|
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
@@ -135,6 +136,35 @@ describe('Tests on the xhr core when it starts to call the request', function ()
|
|
|
135
136
|
done();
|
|
136
137
|
});
|
|
137
138
|
|
|
139
|
+
it('it must handle resetValues properly', function (done) {
|
|
140
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
141
|
+
try {
|
|
142
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
143
|
+
faces.ajax.request(element, null, {
|
|
144
|
+
execute: "input_1",
|
|
145
|
+
resetValues: true,
|
|
146
|
+
render: "@form",
|
|
147
|
+
params: {
|
|
148
|
+
pass1: "pass1",
|
|
149
|
+
pass2: "pass2"
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
expect(send.called).to.be.true;
|
|
154
|
+
let argsVal: any = send.args[0][0];
|
|
155
|
+
let arsArr = argsVal.split("&");
|
|
156
|
+
let resultsMap = {};
|
|
157
|
+
for (let val of arsArr) {
|
|
158
|
+
let keyVal = val.split("=");
|
|
159
|
+
resultsMap[keyVal[0]] = keyVal[1];
|
|
160
|
+
}
|
|
161
|
+
expect(resultsMap["jakarta.faces.partial.resetValues"]).to.eq("true");
|
|
162
|
+
} finally {
|
|
163
|
+
send.restore();
|
|
164
|
+
}
|
|
165
|
+
done();
|
|
166
|
+
});
|
|
167
|
+
|
|
138
168
|
it('it must have the proper target type', function (done) {
|
|
139
169
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
140
170
|
try {
|
|
@@ -196,16 +226,24 @@ describe('Tests after core when it hits response', function () {
|
|
|
196
226
|
faces.ajax.request(element, null, {
|
|
197
227
|
execute: "input_1",
|
|
198
228
|
render: "@form",
|
|
199
|
-
|
|
200
|
-
|
|
229
|
+
params: {
|
|
230
|
+
pass1: "pass1",
|
|
231
|
+
pass2: "pass2"
|
|
232
|
+
},
|
|
233
|
+
message: "Hello World",
|
|
201
234
|
onevent: (evt: any) => {
|
|
202
235
|
localCnt++;
|
|
203
236
|
}
|
|
204
237
|
});
|
|
205
238
|
|
|
206
239
|
let xhrReq = this.requests[0];
|
|
240
|
+
let requestBody = xhrReq.requestBody.split("&");
|
|
207
241
|
|
|
208
242
|
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
243
|
+
expect(requestBody.indexOf("pass1=pass1")).not.to.eq(-1);
|
|
244
|
+
expect(requestBody.indexOf("pass2=pass2")).not.to.eq(-1);
|
|
245
|
+
expect(requestBody.indexOf("message=Hello%20World")).not.to.eq(-1);
|
|
246
|
+
|
|
209
247
|
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
210
248
|
//success ommitted due to fake response
|
|
211
249
|
expect(globalCnt == 3).to.eq(true);
|
|
@@ -220,7 +258,8 @@ describe('Tests after core when it hits response', function () {
|
|
|
220
258
|
|
|
221
259
|
});
|
|
222
260
|
|
|
223
|
-
it('it must have called request and the pass through values must be properly transferred
|
|
261
|
+
it('it must have called request and the pass through values must be properly transferred ' +
|
|
262
|
+
'into the context, via the old non spec conform behavior', function (done) {
|
|
224
263
|
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
225
264
|
let globalCnt = 0;
|
|
226
265
|
let localCnt = 0;
|
|
@@ -273,6 +312,67 @@ describe('Tests after core when it hits response', function () {
|
|
|
273
312
|
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
274
313
|
|
|
275
314
|
|
|
315
|
+
} catch (e) {
|
|
316
|
+
console.error(e);
|
|
317
|
+
|
|
318
|
+
} finally {
|
|
319
|
+
send.restore();
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it('it must have allow array key value pairs as passthroughs', function (done) {
|
|
324
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
325
|
+
let globalCnt = 0;
|
|
326
|
+
let localCnt = 0;
|
|
327
|
+
let xhrReq = null;
|
|
328
|
+
|
|
329
|
+
try {
|
|
330
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
331
|
+
faces.ajax.addOnEvent(() => {
|
|
332
|
+
globalCnt++;
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
faces.ajax.request(element, null, {
|
|
337
|
+
execute: "input_1",
|
|
338
|
+
render: "@form",
|
|
339
|
+
params: [["pass1", "pass1"],
|
|
340
|
+
["pass2", "pass2"]],
|
|
341
|
+
|
|
342
|
+
onevent: (evt: any) => {
|
|
343
|
+
localCnt++;
|
|
344
|
+
if (evt.status == COMPLETE) {
|
|
345
|
+
expect(!!xhrReq.responseXML).to.be.true;
|
|
346
|
+
}
|
|
347
|
+
if (evt.status == SUCCESS) {
|
|
348
|
+
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
349
|
+
|
|
350
|
+
expect(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
351
|
+
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
352
|
+
expect(lastArg.onevent != null).to.be.true;
|
|
353
|
+
expect(lastArg.onevent instanceof Function).to.be.true;
|
|
354
|
+
expect(!!lastArg.onError).to.be.false;
|
|
355
|
+
expect(lastArg.pass1 == "pass1").to.be.true;
|
|
356
|
+
expect(lastArg.pass2 == "pass2").to.be.true;
|
|
357
|
+
expect(!!lastArg[P_PARTIAL_SOURCE]).to.be.true;
|
|
358
|
+
expect(!!lastArg[P_AJAX]).to.be.true;
|
|
359
|
+
expect(!!lastArg[P_EXECUTE]).to.be.true;
|
|
360
|
+
expect(!!lastArg[P_RENDER]).to.be.true;
|
|
361
|
+
|
|
362
|
+
expect(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
363
|
+
|
|
364
|
+
expect(globalCnt == 2).to.eq(true); //local before global
|
|
365
|
+
expect(localCnt == 3).to.eq(true);
|
|
366
|
+
|
|
367
|
+
done();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
xhrReq = this.requests[0];
|
|
373
|
+
xhrReq.responsetype = "text/xml";
|
|
374
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
375
|
+
|
|
276
376
|
|
|
277
377
|
} catch (e) {
|
|
278
378
|
console.error(e);
|
|
@@ -282,6 +382,68 @@ describe('Tests after core when it hits response', function () {
|
|
|
282
382
|
}
|
|
283
383
|
});
|
|
284
384
|
|
|
385
|
+
it('it must have called request and the pass through values must be properly transferred into the context', function (done) {
|
|
386
|
+
let send = sinon.spy(XMLHttpRequest.prototype, "send");
|
|
387
|
+
let globalCnt = 0;
|
|
388
|
+
let localCnt = 0;
|
|
389
|
+
let xhrReq = null;
|
|
390
|
+
|
|
391
|
+
try {
|
|
392
|
+
let element = DomQuery.byId("input_2").getAsElem(0).value;
|
|
393
|
+
faces.ajax.addOnEvent(() => {
|
|
394
|
+
globalCnt++;
|
|
395
|
+
});
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
faces.ajax.request(element, null, {
|
|
399
|
+
execute: "input_1",
|
|
400
|
+
render: "@form",
|
|
401
|
+
params: {
|
|
402
|
+
pass1: "pass1",
|
|
403
|
+
pass2: "pass2",
|
|
404
|
+
},
|
|
405
|
+
onevent: (evt: any) => {
|
|
406
|
+
localCnt++;
|
|
407
|
+
if (evt.status == COMPLETE) {
|
|
408
|
+
expect(!!xhrReq.responseXML).to.be.true;
|
|
409
|
+
}
|
|
410
|
+
if (evt.status == SUCCESS) {
|
|
411
|
+
expect(this.jsfAjaxResponse.callCount).to.eq(1);
|
|
412
|
+
|
|
413
|
+
expect(this.jsfAjaxResponse.firstCall.args[0] instanceof XMLHttpRequest).to.be.true;
|
|
414
|
+
let lastArg = this.jsfAjaxResponse.firstCall.args[1];
|
|
415
|
+
expect(lastArg.onevent != null).to.be.true;
|
|
416
|
+
expect(lastArg.onevent instanceof Function).to.be.true;
|
|
417
|
+
expect(!!lastArg.onError).to.be.false;
|
|
418
|
+
expect(lastArg.pass1 == "pass1").to.be.true;
|
|
419
|
+
expect(lastArg.pass2 == "pass2").to.be.true;
|
|
420
|
+
expect(!!lastArg[P_PARTIAL_SOURCE]).to.be.true;
|
|
421
|
+
expect(!!lastArg[P_AJAX]).to.be.true;
|
|
422
|
+
expect(!!lastArg[P_EXECUTE]).to.be.true;
|
|
423
|
+
expect(!!lastArg[P_RENDER]).to.be.true;
|
|
424
|
+
|
|
425
|
+
expect(this.jsfAjaxResponse.firstCall.args.length).to.eq(2);
|
|
426
|
+
|
|
427
|
+
expect(globalCnt == 2).to.eq(true); //local before global
|
|
428
|
+
expect(localCnt == 3).to.eq(true);
|
|
429
|
+
|
|
430
|
+
done();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
|
|
435
|
+
xhrReq = this.requests[0];
|
|
436
|
+
xhrReq.responsetype = "text/xml";
|
|
437
|
+
xhrReq.respond(200, {'Content-Type': 'text/xml'}, STD_XML);
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
} catch (e) {
|
|
441
|
+
console.error(e);
|
|
442
|
+
|
|
443
|
+
} finally {
|
|
444
|
+
send.restore();
|
|
445
|
+
}
|
|
446
|
+
});
|
|
285
447
|
|
|
286
448
|
|
|
287
449
|
it('it must have called onError in the error case', function (done) {
|
|
@@ -296,8 +458,10 @@ describe('Tests after core when it hits response', function () {
|
|
|
296
458
|
faces.ajax.request(element, null, {
|
|
297
459
|
execute: "input_1",
|
|
298
460
|
render: "@form",
|
|
299
|
-
|
|
300
|
-
|
|
461
|
+
params: {
|
|
462
|
+
pass1: "pass1",
|
|
463
|
+
pass2: "pass2",
|
|
464
|
+
},
|
|
301
465
|
onerror: (error: any) => {
|
|
302
466
|
expect(error.type).to.eq("error");
|
|
303
467
|
expect(!!error.status).to.eq(true);
|
package/target/api/_api.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
4
|
+
if (ar || !(i in from)) {
|
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
6
|
+
ar[i] = from[i];
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.myfaces = exports.faces = void 0;
|
|
4
13
|
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
@@ -16,10 +25,10 @@ exports.myfaces = exports.faces = void 0;
|
|
|
16
25
|
* See the License for the specific language governing permissions and
|
|
17
26
|
* limitations under the License.
|
|
18
27
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
var AjaxImpl_1 = require("../impl/AjaxImpl");
|
|
29
|
+
var PushImpl_1 = require("../impl/PushImpl");
|
|
30
|
+
var OamSubmit_1 = require("../myfaces/OamSubmit");
|
|
31
|
+
var Const_1 = require("../impl/core/Const");
|
|
23
32
|
//we use modules to get a proper jsdoc and static/map structure in the calls
|
|
24
33
|
//as per spec requirement
|
|
25
34
|
var faces;
|
|
@@ -97,13 +106,13 @@ var faces;
|
|
|
97
106
|
faces.getClientWindow = getClientWindow;
|
|
98
107
|
//private helper functions
|
|
99
108
|
function getSeparatorChar() {
|
|
100
|
-
|
|
109
|
+
var sep = '#{facesContext.namingContainerSeparatorChar}';
|
|
101
110
|
//We now enable standalone mode, the separator char was not mapped we make a fallback to 2.3 behavior
|
|
102
111
|
//the idea is that the separator char is provided from the underlying container, but if not then we
|
|
103
112
|
//will perform a fallback (aka 2.3 has the url fallback behavior)
|
|
104
113
|
return (sep.match(/\#\{facesContext.namingContainerSeparatorChar\}/gi)) ? AjaxImpl_1.Implementation.getSeparatorChar() : sep;
|
|
105
114
|
}
|
|
106
|
-
|
|
115
|
+
var ajax;
|
|
107
116
|
(function (ajax) {
|
|
108
117
|
"use strict";
|
|
109
118
|
/**
|
|
@@ -168,7 +177,7 @@ var faces;
|
|
|
168
177
|
}
|
|
169
178
|
ajax.addOnEvent = addOnEvent;
|
|
170
179
|
})(ajax = faces.ajax || (faces.ajax = {}));
|
|
171
|
-
|
|
180
|
+
var util;
|
|
172
181
|
(function (util) {
|
|
173
182
|
/**
|
|
174
183
|
* varargs function which executes a chain of code (functions or any other code)
|
|
@@ -181,12 +190,16 @@ var faces;
|
|
|
181
190
|
* @param funcs ... arbitrary array of functions or strings
|
|
182
191
|
* @returns true if the chain has succeeded false otherwise
|
|
183
192
|
*/
|
|
184
|
-
function chain(source, event
|
|
185
|
-
|
|
193
|
+
function chain(source, event) {
|
|
194
|
+
var funcs = [];
|
|
195
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
196
|
+
funcs[_i - 2] = arguments[_i];
|
|
197
|
+
}
|
|
198
|
+
return AjaxImpl_1.Implementation.chain.apply(AjaxImpl_1.Implementation, __spreadArray([source, event], funcs, false));
|
|
186
199
|
}
|
|
187
200
|
util.chain = chain;
|
|
188
201
|
})(util = faces.util || (faces.util = {}));
|
|
189
|
-
|
|
202
|
+
var push;
|
|
190
203
|
(function (push) {
|
|
191
204
|
/**
|
|
192
205
|
* @param socketClientId the sockets client identifier
|
|
@@ -194,12 +207,13 @@ var faces;
|
|
|
194
207
|
* @param channel the channel name/id
|
|
195
208
|
* @param onopen The function to be invoked when the web socket is opened.
|
|
196
209
|
* @param onmessage The function to be invoked when a message is received.
|
|
210
|
+
* @param onerror The function to be invoked when an error occurs.
|
|
197
211
|
* @param onclose The function to be invoked when the web socket is closed.
|
|
198
212
|
* @param behaviors functions which are invoked whenever a message is received
|
|
199
213
|
* @param autoConnect Whether or not to automatically open the socket. Defaults to <code>false</code>.
|
|
200
214
|
*/
|
|
201
|
-
function init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect) {
|
|
202
|
-
PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onclose, behaviors, autoConnect);
|
|
215
|
+
function init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect) {
|
|
216
|
+
PushImpl_1.PushImpl.init(socketClientId, url, channel, onopen, onmessage, onerror, onclose, behaviors, autoConnect);
|
|
203
217
|
}
|
|
204
218
|
push.init = init;
|
|
205
219
|
/**
|
|
@@ -236,8 +250,9 @@ var myfaces;
|
|
|
236
250
|
* @param render
|
|
237
251
|
* @param options
|
|
238
252
|
*/
|
|
239
|
-
function ab(source, event, eventName, execute, render, options
|
|
253
|
+
function ab(source, event, eventName, execute, render, options) {
|
|
240
254
|
var _a;
|
|
255
|
+
if (options === void 0) { options = {}; }
|
|
241
256
|
if (eventName) {
|
|
242
257
|
options[(0, Const_1.$nsp)(Const_1.P_BEHAVIOR_EVENT)] = eventName;
|
|
243
258
|
}
|
package/target/api/_api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_api.js","sourceRoot":"","sources":["../../src/main/typescript/api/_api.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;GAcG;AACH,6CAAgD;AAChD,6CAA0C;AAC1C,kDAAiD;AACjD,4CAA+F;AAI/F,4EAA4E;AAC5E,yBAAyB;AACzB,IAAc,KAAK,CAuNlB;AAvND,WAAc,KAAK;IAGf;;;;;;;;;;OAUG;IACQ,iBAAW,GAAG,MAAM,CAAC;IAChC;;;;;;;OAOG;IACQ,iBAAW,GAAG,CAAC,CAAC;IAE3B;;OAEG;IACQ,mBAAa,GAAW,gBAAgB,EAAE,CAAC;IAEtD,qCAAqC;IACrC;;OAEG;IACQ,iBAAW,GAAW,oDAAoD,CAAC;IACtF,0CAA0C;IAE1C;;;;;;;;;;;;;;OAcG;IACH,SAAgB,eAAe;QAC3B,OAAO,yBAAc,CAAC,eAAe,EAAE,CAAC;IAC5C,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED;;;;;;;OAOG;IACH,SAAgB,YAAY,CAAC,WAA6B;QACtD,OAAO,yBAAc,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACpD,CAAC;IAFe,kBAAY,eAE3B,CAAA;IAED;;;;OAIG;IACH,SAAgB,eAAe,CAAC,QAA2B;QACvD,OAAO,yBAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;IACpD,CAAC;IAFe,qBAAe,kBAE9B,CAAA;IAED,0BAA0B;IAC1B,SAAS,gBAAgB;QACrB,IAAM,GAAG,GAAG,8CAA8C,CAAC;QAC3D,qGAAqG;QACrG,mGAAmG;QACnG,iEAAiE;QACjE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,mDA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;QAED,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;IAZe,UAAE,KAYjB,CAAA;IAED;;OAEG;IACU,WAAG,GAAG,eAAI,CAAC;AAC5B,CAAC,EA/Ba,OAAO,GAAP,eAAO,KAAP,eAAO,QA+BpB"}
|
package/target/api/faces.js
CHANGED
|
@@ -31,14 +31,14 @@ exports.myfaces = exports.faces = void 0;
|
|
|
31
31
|
*/
|
|
32
32
|
if (!window.faces) {
|
|
33
33
|
//we lazily load the code to prevent ram bloat
|
|
34
|
-
|
|
35
|
-
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a :
|
|
34
|
+
var faces_1 = require("./_api").faces;
|
|
35
|
+
window['faces'] = (_a = window === null || window === void 0 ? void 0 : window.faces) !== null && _a !== void 0 ? _a : faces_1;
|
|
36
36
|
}
|
|
37
37
|
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
38
|
-
|
|
38
|
+
var myfaces_1 = require("./_api").myfaces;
|
|
39
39
|
//namespace might be extended is not exclusively reserved so we merge
|
|
40
40
|
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
41
|
-
Object.keys(
|
|
41
|
+
Object.keys(myfaces_1).forEach(function (key) { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces_1[key]; });
|
|
42
42
|
}
|
|
43
43
|
exports.faces = window.faces;
|
|
44
44
|
exports.myfaces = window.myfaces;
|
package/target/api/faces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/faces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AAEb;;;;;;;;;;;GAWG;AACH,IAAG,CAAC,MAAM,CAAC,KAAK,EAAE;IACd,8CAA8C;IAC9C,
|
|
1
|
+
{"version":3,"file":"faces.js","sourceRoot":"","sources":["../../src/main/typescript/api/faces.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AAEb;;;;;;;;;;;GAWG;AACH,IAAG,CAAC,MAAM,CAAC,KAAK,EAAE;IACd,8CAA8C;IAC9C,IAAM,OAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACtC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,OAAK,CAAC;CAC5C;AACD,IAAG,CAAC,CAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,EAAE,CAAA,EAAE;IACrB,IAAM,SAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;IAE1C,qEAAqE;IACpE,MAAc,CAAC,SAAS,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,mCAAI,EAAE,CAAC;IACnD,MAAM,CAAC,IAAI,CAAC,SAAO,CAAC,CAAC,OAAO,CAAC,UAAA,GAAG,gBAAI,OAAA,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAG,GAAG,CAAC,mCAAI,SAAO,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CAAC;CACpG;AACU,QAAA,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;AACrB,QAAA,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC"}
|
package/target/api/jsf.js
CHANGED
|
@@ -24,20 +24,31 @@ exports.myfaces = exports.jsf = void 0;
|
|
|
24
24
|
* on jsf2.3 or earlier level, for 4.0+ please include faces.js
|
|
25
25
|
*/
|
|
26
26
|
if (!(window === null || window === void 0 ? void 0 : window.jsf)) {
|
|
27
|
-
|
|
28
|
-
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a :
|
|
27
|
+
var faces_1 = require("./_api").faces;
|
|
28
|
+
window['jsf'] = (_a = window === null || window === void 0 ? void 0 : window.jsf) !== null && _a !== void 0 ? _a : faces_1;
|
|
29
29
|
window.jsf.specversion = 230000;
|
|
30
30
|
delete window.jsf.contextpath;
|
|
31
|
+
var faces4Init_1 = faces_1.push.init;
|
|
32
|
+
/*
|
|
33
|
+
* we shim back the breaking api change from 3.0 to 4.0
|
|
34
|
+
* onerror is gone
|
|
35
|
+
*/
|
|
36
|
+
faces_1.push.init = function (socketClientId, url, channel, onopen, onmessage,
|
|
37
|
+
// no on error api change for 4.0
|
|
38
|
+
//onerror: Function,
|
|
39
|
+
onclose, behaviors, autoConnect) {
|
|
40
|
+
faces4Init_1(socketClientId, url, channel, onopen, onmessage, null, onclose, behaviors, autoConnect);
|
|
41
|
+
};
|
|
31
42
|
}
|
|
32
43
|
if (!((_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.ab)) {
|
|
33
|
-
|
|
44
|
+
var myfaces_1 = require("./_api").myfaces;
|
|
34
45
|
//namespace might be extended is not exclusively reserved so we merge
|
|
35
46
|
window["myfaces"] = (_c = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _c !== void 0 ? _c : {};
|
|
36
47
|
if (!((_d = window === null || window === void 0 ? void 0 : window.myfaces) === null || _d === void 0 ? void 0 : _d.ab)) {
|
|
37
|
-
|
|
48
|
+
var myfaces_2 = require("./_api").myfaces;
|
|
38
49
|
//namespace might be extended is not exclusively reserved so we merge
|
|
39
50
|
window["myfaces"] = (_e = window === null || window === void 0 ? void 0 : window.myfaces) !== null && _e !== void 0 ? _e : {};
|
|
40
|
-
Object.keys(
|
|
51
|
+
Object.keys(myfaces_2).forEach(function (key) { var _a, _b; return window.myfaces[key] = (_b = (_a = window.myfaces) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : myfaces_2[key]; });
|
|
41
52
|
}
|
|
42
53
|
}
|
|
43
54
|
exports.jsf = window.jsf;
|
package/target/api/jsf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,
|
|
1
|
+
{"version":3,"file":"jsf.js","sourceRoot":"","sources":["../../src/main/typescript/api/jsf.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,YAAY,CAAC;;;;AACb;;;;;GAKG;AACH,IAAG,CAAC,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,CAAA,EAAE;IACb,IAAM,OAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACrC,MAAc,CAAC,KAAK,CAAC,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,GAAG,mCAAI,OAAK,CAAC;IAC9C,MAAM,CAAC,GAAG,CAAC,WAAW,GAAG,MAAM,CAAC;IAChC,OAAO,MAAM,CAAC,GAAG,CAAC,WAAW,CAAC;IAE9B,IAAI,YAAU,GAAG,OAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACjC;;;OAGG;IACH,OAAK,CAAC,IAAI,CAAC,IAAI,GAAG,UAAC,cAAsB,EACtB,GAAW,EACX,OAAe,EACf,MAAgB,EAChB,SAAmB;IACnB,iCAAiC;IACjC,oBAAoB;IACpB,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