jsf.js_next_gen 1.0.0-beta-20 → 4.0.0-beta-4
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/.mocharc.json +2 -1
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +1 -0
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/.nycrc +2 -1
- package/README.md +12 -0
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/functions/{jsf.ajax.addOnError.html → faces.ajax.addOnError.html} +11 -11
- package/dist/docs/functions/{jsf.ajax.addOnEvent.html → faces.ajax.addOnEvent.html} +11 -11
- package/dist/docs/functions/{jsf.ajax.request.html → faces.ajax.request.html} +11 -11
- package/dist/docs/functions/{jsf.ajax.response.html → faces.ajax.response.html} +11 -11
- package/dist/docs/functions/{jsf.getClientWindow.html → faces.getClientWindow.html} +12 -12
- package/dist/docs/functions/{jsf.getProjectStage.html → faces.getProjectStage.html} +13 -13
- package/dist/docs/functions/{jsf.getViewState.html → faces.getViewState.html} +13 -13
- package/dist/docs/functions/{jsf.push.close.html → faces.push.close.html} +10 -10
- package/dist/docs/functions/{jsf.push.init.html → faces.push.init.html} +10 -10
- package/dist/docs/functions/{jsf.push.open.html → faces.push.open.html} +10 -10
- package/dist/docs/functions/{jsf.util.chain.html → faces.util.chain.html} +8 -8
- package/dist/docs/functions/myfaces.ab.html +6 -6
- package/dist/docs/index.html +13 -4
- package/dist/docs/modules/{jsf.ajax.html → faces.ajax.html} +14 -14
- package/dist/docs/modules/{jsf.html → faces.html} +22 -22
- package/dist/docs/modules/{jsf.push.html → faces.push.html} +12 -12
- package/dist/docs/modules/{jsf.util.html → faces.util.html} +8 -8
- package/dist/docs/modules/myfaces.html +4 -4
- package/dist/docs/modules.html +5 -5
- package/dist/docs/variables/{jsf.implversion.html → faces.implversion.html} +12 -12
- package/dist/docs/variables/{jsf.separatorchar.html → faces.separatorchar.html} +12 -12
- package/dist/docs/variables/{jsf.specversion.html → faces.specversion.html} +13 -13
- package/dist/docs/variables/myfaces.oam.html +4 -4
- package/dist/window/faces-development.js +7699 -0
- 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 -0
- package/dist/window/faces.js +3 -0
- package/dist/window/faces.js.LICENSE.txt +70 -0
- package/dist/window/faces.js.br +0 -0
- package/dist/window/faces.js.gz +0 -0
- package/dist/window/faces.js.map +1 -0
- package/dist/window/jsf-development.js +244 -150
- 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 +2 -1
- package/dist/window/jsf.js.LICENSE.txt +70 -0
- 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 +6 -6
- package/src/main/types/typedefs.d.ts +2 -0
- package/src/main/typescript/api/{Jsf.ts → faces.ts} +15 -11
- package/src/main/typescript/api/jsf.ts +30 -0
- package/src/main/typescript/impl/AjaxImpl.ts +18 -16
- package/src/main/typescript/impl/PushImpl.ts +4 -4
- package/src/main/typescript/impl/core/Const.ts +53 -15
- package/src/main/typescript/impl/core/ImplTypes.ts +1 -1
- package/src/main/typescript/impl/i18n/Messages.ts +2 -2
- package/src/main/typescript/impl/util/Assertions.ts +2 -2
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +1 -1
- package/src/main/typescript/impl/util/ExtDomQuery.ts +33 -22
- package/src/main/typescript/impl/util/IListener.ts +1 -1
- package/src/main/typescript/impl/util/Lang.ts +1 -1
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +1 -1
- package/src/main/typescript/impl/xhrCore/EventData.ts +3 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +1 -1
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +2 -2
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +1 -1
- package/src/main/typescript/impl/xhrCore/Response.ts +3 -3
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +5 -3
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +3 -3
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +5 -6
- package/src/main/typescript/myfaces/OamSubmit.ts +1 -2
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/LangTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingProbes.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MappingTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +1 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +59 -28
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +4 -4
- package/src/main/typescript/test/impl/ImplTest.spec.ts +13 -13
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +134 -0
- package/src/main/typescript/test/impl/SeparatorCharsTest.spec.ts +7 -4
- package/src/main/typescript/test/myfaces/OamSubmit.spec.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousProbe.ts +1 -1
- package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +2 -2
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +8 -8
- package/src/main/typescript/test/xhrCore/FakeWebsocket.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +6 -6
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +23 -23
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +12 -12
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +27 -27
- package/src/main/typescript/test/xhrCore/ShadowDomTest.spec.ts +4 -6
- package/src/main/typescript/test/xhrCore/WebsocketTest.ts +9 -9
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +1 -1
- package/src/main/typescript/tsconfig-typedoc.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/target/api/Jsf.js +17 -245
- package/target/api/Jsf.js.map +1 -1
- package/target/api/faces.js +265 -0
- package/target/api/faces.js.map +1 -0
- package/target/impl/AjaxImpl.js +15 -14
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +4 -4
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +52 -15
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/ImplTypes.js +1 -1
- package/target/impl/i18n/Messages.js +2 -2
- package/target/impl/i18n/Messages.js.map +1 -1
- package/target/impl/util/Assertions.js +2 -2
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncRunnable.js +1 -1
- package/target/impl/util/ExtDomQuery.js +28 -17
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/Lang.js +1 -1
- package/target/impl/xhrCore/ErrorData.js +1 -1
- package/target/impl/xhrCore/EventData.js +3 -2
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestDataResolver.js +2 -2
- package/target/impl/xhrCore/ResonseDataResolver.js +1 -1
- package/target/impl/xhrCore/Response.js +3 -3
- package/target/impl/xhrCore/ResponseProcessor.js +11 -11
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +3 -3
- package/target/impl/xhrCore/XhrRequest.js +5 -4
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +1 -2
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/monadish/LangTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingProbes.js +1 -1
- package/target/test/frameworkBase/_ext/monadish/MappingTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/monadish/StreamTest.spec.js +1 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +64 -26
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +4 -4
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +54 -13
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +165 -0
- package/target/test/impl/ImplTest_23.spec.js.map +1 -0
- package/target/test/impl/ImplTest_23.spec_.js +165 -0
- package/target/test/impl/ImplTest_23.spec_.js.map +1 -0
- package/target/test/impl/SeparatorCharsTest.spec.js +7 -3
- package/target/test/impl/SeparatorCharsTest.spec.js.map +1 -1
- package/target/test/myfaces/OamSubmit.spec.js +1 -1
- package/target/test/queue/AsynchronousProbe.js +1 -1
- package/target/test/queue/AsynchronousQueueTest.spec.js +2 -2
- package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
- package/target/test/xhrCore/EventTests.spec.js +7 -7
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FakeWebsocket.js +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +5 -5
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestParamsTest.spec.js +23 -23
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +11 -11
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +22 -22
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ShadowDomTest.spec.js +3 -4
- package/target/test/xhrCore/ShadowDomTest.spec.js.map +1 -1
- package/target/test/xhrCore/WebsocketTest.js +8 -8
- package/target/test/xhrCore/WebsocketTest.js.map +1 -1
- package/target/test/xhrCore/XhrFormDataTest.spec.js +1 -1
- package/webpack.config.ts +23 -4
- package/integrationdeploy.cmd +0 -4
- package/integrationsdeploy.sh +0 -5
- package/remap.js +0 -44
- package/remap.js.map +0 -1
- package/webpack.config.js +0 -68
- package/webpack.config.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -45,8 +45,8 @@ export module Response {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
|
-
* Standardized
|
|
49
|
-
* this one is called straight from
|
|
48
|
+
* Standardized faces.js response
|
|
49
|
+
* this one is called straight from faces.js.response
|
|
50
50
|
*
|
|
51
51
|
* The processing follows the spec by going for the responseXML
|
|
52
52
|
* and processing its tags
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -55,6 +55,8 @@ import {
|
|
|
55
55
|
import trim = Lang.trim;
|
|
56
56
|
import {ExtDomquery} from "../util/ExtDomQuery";
|
|
57
57
|
|
|
58
|
+
declare const window: any;
|
|
59
|
+
|
|
58
60
|
/**
|
|
59
61
|
* Response processor
|
|
60
62
|
*
|
|
@@ -438,7 +440,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
438
440
|
* @returns true of it ii
|
|
439
441
|
*/
|
|
440
442
|
private static isViewStateNode(node: XMLQuery): boolean {
|
|
441
|
-
let separatorChar = (
|
|
443
|
+
let separatorChar = (window?.faces ?? window?.jsf).separatorchar;
|
|
442
444
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == P_VIEWSTATE ||
|
|
443
445
|
node?.id?.value?.indexOf([separatorChar, P_VIEWSTATE].join(EMPTY_STR)) != -1 ||
|
|
444
446
|
node?.id?.value?.indexOf([P_VIEWSTATE, separatorChar].join(EMPTY_STR)) != -1);
|
|
@@ -451,7 +453,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
451
453
|
* @returns true of it ii
|
|
452
454
|
*/
|
|
453
455
|
private static isClientWindowNode(node: XMLQuery): boolean {
|
|
454
|
-
let separatorChar = (
|
|
456
|
+
let separatorChar = (window?.faces ?? window?.jsf).separatorchar;
|
|
455
457
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == P_CLIENT_WINDOW ||
|
|
456
458
|
node?.id?.value?.indexOf([separatorChar, P_CLIENT_WINDOW].join(EMPTY_STR)) != -1 ||
|
|
457
459
|
node?.id?.value?.indexOf([P_CLIENT_WINDOW, separatorChar].join(EMPTY_STR)) != -1);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -24,7 +24,7 @@ import isString = Lang.isString;
|
|
|
24
24
|
*
|
|
25
25
|
* We cannot use standard html5 forms everywhere
|
|
26
26
|
* due to api constraints on the HTML Form object in IE11
|
|
27
|
-
* and due to the url encoding constraint given by the
|
|
27
|
+
* and due to the url encoding constraint given by the faces.js spec
|
|
28
28
|
*
|
|
29
29
|
* probably only one needed and one overlay!
|
|
30
30
|
* the entire file input storing probably is redundant now
|
|
@@ -201,7 +201,7 @@ export class XhrFormData extends Config {
|
|
|
201
201
|
/*
|
|
202
202
|
* Spec. 13.3.1
|
|
203
203
|
* Collect and encode input elements.
|
|
204
|
-
* Additionally the hidden element
|
|
204
|
+
* Additionally the hidden element jakarta.faces.ViewState
|
|
205
205
|
* Enhancement partial page submit
|
|
206
206
|
*
|
|
207
207
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -46,7 +46,7 @@ import {resolveFinalUrl, resolveHandlerFunc} from "./RequestDataResolver";
|
|
|
46
46
|
import failSaveExecute = ExtLang.failSaveExecute;
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Faces XHR Request Wrapper
|
|
50
50
|
* as Asyncrunnable for our Asynchronous queue
|
|
51
51
|
*
|
|
52
52
|
* The idea is that we basically just enqueue
|
|
@@ -54,8 +54,7 @@ import failSaveExecute = ExtLang.failSaveExecute;
|
|
|
54
54
|
* and let the queue do the processing.
|
|
55
55
|
*
|
|
56
56
|
*/
|
|
57
|
-
|
|
58
|
-
declare let jsf: any;
|
|
57
|
+
declare const window: any;
|
|
59
58
|
|
|
60
59
|
export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
61
60
|
|
|
@@ -118,7 +117,7 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
118
117
|
try {
|
|
119
118
|
|
|
120
119
|
let formElement = this.sourceForm.getAsElem(0).value;
|
|
121
|
-
let viewState = jsf.getViewState(formElement);
|
|
120
|
+
let viewState = (window?.faces ?? window?.jsf).getViewState(formElement);
|
|
122
121
|
//encoded we need to decode
|
|
123
122
|
//We generated a base representation of the current form
|
|
124
123
|
//in case someone has overloaded the viewstate with addtional decorators we merge
|
|
@@ -275,7 +274,7 @@ export class XhrRequest implements AsyncRunnable<XMLHttpRequest> {
|
|
|
275
274
|
return;
|
|
276
275
|
}
|
|
277
276
|
|
|
278
|
-
jsf.ajax.response(this.xhrObject, this.responseContext.value ?? {});
|
|
277
|
+
(window?.faces ?? window.jsf).ajax.response(this.xhrObject, this.responseContext.value ?? {});
|
|
279
278
|
}
|
|
280
279
|
|
|
281
280
|
private handleMalFormedXML(resolve: Function) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -30,7 +30,6 @@ import {DQ, Stream} from "mona-dish";
|
|
|
30
30
|
declare const window: any;
|
|
31
31
|
declare const myfaces: any;
|
|
32
32
|
|
|
33
|
-
//TODO add unit tests to check all this here that it works just as before
|
|
34
33
|
export module oam {
|
|
35
34
|
/**
|
|
36
35
|
* sets a hidden input field
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// noinspection HtmlUnknownAttribute
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
4
4
|
* contributor license agreements. See the NOTICE file distributed with
|
|
5
5
|
* this work for additional information regarding copyright ownership.
|
|
6
6
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
import {DomQuery} from "mona-dish";
|
|
19
|
+
import {remapNamespacesFor23, remapNamespacesFor40} from "../../../../impl/core/Const";
|
|
19
20
|
|
|
20
21
|
declare let global;
|
|
21
|
-
declare let
|
|
22
|
+
declare let faces: any;
|
|
22
23
|
declare let myfaces: any;
|
|
23
24
|
|
|
24
25
|
/**
|
|
@@ -60,7 +61,7 @@ export module StandardInits {
|
|
|
60
61
|
<body>
|
|
61
62
|
<form id="blarg">
|
|
62
63
|
<input type="text" id="blarg:input_1" name="blarg:input_1" value="input_1_val"></input>
|
|
63
|
-
<input type="hidden" id="
|
|
64
|
+
<input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
|
|
64
65
|
<input type="button" id="blarg:input_2" name="blarg:input_2" value="input_1_val"></input>
|
|
65
66
|
<div id="shadowDomArea">
|
|
66
67
|
<input type="button" id="blarg:input_3" name="blarg:input_3" value="input_3_val"></input>
|
|
@@ -70,7 +71,7 @@ export module StandardInits {
|
|
|
70
71
|
</html>`;
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
|
-
* a page simulating basically a simple
|
|
74
|
+
* a page simulating basically a simple faces form
|
|
74
75
|
*/
|
|
75
76
|
const HTML_FORM_DEFAULT = `<!DOCTYPE html>
|
|
76
77
|
<html lang="en">
|
|
@@ -81,14 +82,16 @@ export module StandardInits {
|
|
|
81
82
|
<body>
|
|
82
83
|
<form id="blarg">
|
|
83
84
|
<input type="text" id="input_1" name="input_1" value="input_1_val"></input>
|
|
84
|
-
<input type="hidden" id="
|
|
85
|
+
<input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
|
|
85
86
|
<input type="button" id="input_2" name="input_2" value="input_1_val"></input>
|
|
86
87
|
</form>
|
|
87
88
|
</body>
|
|
88
89
|
</html>`;
|
|
89
90
|
|
|
91
|
+
|
|
92
|
+
|
|
90
93
|
/**
|
|
91
|
-
* a page simulating basically a simple
|
|
94
|
+
* a page simulating basically a simple faces form
|
|
92
95
|
*/
|
|
93
96
|
const HTML_FILE_FORM_DEFAULT = `<!DOCTYPE html>
|
|
94
97
|
<html lang="en">
|
|
@@ -100,7 +103,7 @@ export module StandardInits {
|
|
|
100
103
|
<form id="blarg" enctype="multipart/form-data">
|
|
101
104
|
<input type="file" id="fíleupload"></input>
|
|
102
105
|
<input type="text" id="input_1" name="input_1" value="input_1_val"></input>
|
|
103
|
-
<input type="hidden" id="
|
|
106
|
+
<input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
|
|
104
107
|
<input type="button" id="input_2" name="input_2" value="input_1_val"></input>
|
|
105
108
|
</form>
|
|
106
109
|
</body>
|
|
@@ -108,21 +111,21 @@ export module StandardInits {
|
|
|
108
111
|
|
|
109
112
|
|
|
110
113
|
|
|
111
|
-
export const STD_XML = `<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="value_1"><![CDATA[<span id="out1">2</span>]]></update><update id="
|
|
114
|
+
export const STD_XML = `<?xml version="1.0" encoding="utf-8"?><partial-response><changes><update id="value_1"><![CDATA[<span id="out1">2</span>]]></update><update id="jakarta.faces.ViewState"><![CDATA[j_id1:j_id3]]></update></changes></partial-response>`;
|
|
112
115
|
|
|
113
116
|
/**
|
|
114
|
-
* a page containing a
|
|
117
|
+
* a page containing a faces.js input with a new separator char
|
|
115
118
|
* @param separatorChar
|
|
116
119
|
* @constructor
|
|
117
120
|
*/
|
|
118
|
-
function HTML_DEFAULT_SEPARATOR_CHAR(separatorChar: string) {
|
|
121
|
+
function HTML_DEFAULT_SEPARATOR_CHAR(separatorChar: string, IS_40=true) {
|
|
119
122
|
return `<!DOCTYPE html>
|
|
120
123
|
<html lang="en">
|
|
121
124
|
<head>
|
|
122
125
|
<meta charset="UTF-8">
|
|
123
126
|
<title>Title</title>
|
|
124
127
|
<script type="text/javascript"
|
|
125
|
-
src="/wfmportal
|
|
128
|
+
src="/wfmportal/${IS_40 ? 'jakarta' : 'javax'}.faces.resource/${IS_40 ? 'faces': 'jsf'}.js.jsf?ln=jakarta.faces&separator=${separatorChar}"></script>
|
|
126
129
|
</head>
|
|
127
130
|
<body>
|
|
128
131
|
<form id="blarg">
|
|
@@ -140,7 +143,7 @@ export module StandardInits {
|
|
|
140
143
|
* testing the various aspects of the protocol
|
|
141
144
|
* under pure html conditions
|
|
142
145
|
*
|
|
143
|
-
* We get the jsf out of the way and
|
|
146
|
+
* We get the jsf out of the way and basically simulate what the browser sees
|
|
144
147
|
*/
|
|
145
148
|
export const PROTOCOL_PAGE = `<!DOCTYPE html>
|
|
146
149
|
<html lang="en">
|
|
@@ -183,7 +186,7 @@ export module StandardInits {
|
|
|
183
186
|
|
|
184
187
|
<form id="form1" action="boog.html">
|
|
185
188
|
|
|
186
|
-
<input type="hidden" id="
|
|
189
|
+
<input type="hidden" id="jakarta.faces.ViewState" name="jakarta.faces.ViewState" value="blubbblubblubb"></input>
|
|
187
190
|
|
|
188
191
|
<input type="button" id="cmd_eval" value="eval"
|
|
189
192
|
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'eval1');"/>
|
|
@@ -213,7 +216,7 @@ export module StandardInits {
|
|
|
213
216
|
onclick="emitPPR(this, ('undefined' == typeof event)? null: event, 'errors');"/>
|
|
214
217
|
|
|
215
218
|
<input type="button" id="cmd_error_component" value="Error: no component given"
|
|
216
|
-
onclick="
|
|
219
|
+
onclick="faces.ajax.request(null, event, {}); return false"/>
|
|
217
220
|
|
|
218
221
|
</form>
|
|
219
222
|
|
|
@@ -225,7 +228,7 @@ export module StandardInits {
|
|
|
225
228
|
function emitPPR(source, event, action, useIframe, formName) {
|
|
226
229
|
document.getElementById(formName || "form1").action = target;
|
|
227
230
|
|
|
228
|
-
|
|
231
|
+
faces.ajax.request(/*String|Dom Node*/ source, /*|EVENT|*/ (window.event) ? window.event : event, /*{|OPTIONS|}*/ {op: action});
|
|
229
232
|
}
|
|
230
233
|
</script>
|
|
231
234
|
</div>
|
|
@@ -254,13 +257,22 @@ export module StandardInits {
|
|
|
254
257
|
export function defaultHtml(withJsf = true): Promise<() => void> {
|
|
255
258
|
return init(HTML_DEFAULT, withJsf);
|
|
256
259
|
}
|
|
260
|
+
export function defaultHtml_23(withJsf = true): Promise<() => void> {
|
|
261
|
+
return init(HTML_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
262
|
+
}
|
|
257
263
|
|
|
258
264
|
export function defaultMyFaces(withJsf = true): Promise<() => void> {
|
|
259
265
|
return init(HTML_FORM_DEFAULT, withJsf);
|
|
260
266
|
}
|
|
267
|
+
export function defaultMyFaces23(withJsf = true): Promise<() => void> {
|
|
268
|
+
return init(HTML_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
269
|
+
}
|
|
261
270
|
export function defaultFileForm(withJsf = true): Promise<() => void> {
|
|
262
271
|
return init(HTML_FILE_FORM_DEFAULT, withJsf);
|
|
263
272
|
}
|
|
273
|
+
export function defaultFileForm_23(withJsf = true): Promise<() => void> {
|
|
274
|
+
return init(HTML_FILE_FORM_DEFAULT.replace(/jakarta/gi, "javax"), withJsf, false);
|
|
275
|
+
}
|
|
264
276
|
|
|
265
277
|
export function shadowDomMyFaces(withJsf = true): Promise<() => void> {
|
|
266
278
|
return <Promise<() => void>>init(HTML_SHADOW, withJsf).then((close) => {
|
|
@@ -273,12 +285,12 @@ export module StandardInits {
|
|
|
273
285
|
});
|
|
274
286
|
}
|
|
275
287
|
|
|
276
|
-
export function protocolPage(withJsf = true): Promise<() => void> {
|
|
277
|
-
return <any>init(PROTOCOL_PAGE, withJsf);
|
|
288
|
+
export function protocolPage(withJsf = true, IS_40 = true): Promise<() => void> {
|
|
289
|
+
return <any>init((IS_40) ? PROTOCOL_PAGE : PROTOCOL_PAGE.replace(/jakarta/gi,"javax"), withJsf, IS_40);
|
|
278
290
|
}
|
|
279
291
|
|
|
280
|
-
export function defaultSeparatorChar(separatorChar: string, withJsf = true): Promise<() => void> {
|
|
281
|
-
let template = HTML_DEFAULT_SEPARATOR_CHAR(separatorChar);
|
|
292
|
+
export function defaultSeparatorChar(separatorChar: string, withJsf = true, IS_40 = true): Promise<() => void> {
|
|
293
|
+
let template = HTML_DEFAULT_SEPARATOR_CHAR(separatorChar, IS_40);
|
|
282
294
|
return init(template, withJsf);
|
|
283
295
|
}
|
|
284
296
|
|
|
@@ -296,17 +308,31 @@ export module StandardInits {
|
|
|
296
308
|
* @param Implementation
|
|
297
309
|
*/
|
|
298
310
|
let applyJsfToGlobals = function (data, Implementation, PushImpl) {
|
|
311
|
+
(<any>global).faces = data.faces;
|
|
312
|
+
(<any>global).myfaces = data.myfaces;
|
|
313
|
+
(<any>global).window.faces = data.faces;
|
|
314
|
+
(<any>global).window.myfaces = data.myfaces;
|
|
315
|
+
(<any>global).Implementation = Implementation.Implementation;
|
|
316
|
+
(<any>global).PushImpl = PushImpl.PushImpl;
|
|
317
|
+
//bypass a bug on windows jsdom, domparser not an auto global but on window only
|
|
318
|
+
(<any>global).DOMParser = (<any>global)?.DOMParser ?? window.DOMParser;
|
|
319
|
+
(<any>global).document = (<any>global)?.document ?? window.document;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
let applyJsfToGlobals23 = function (data, Implementation, PushImpl) {
|
|
299
323
|
(<any>global).jsf = data.jsf;
|
|
300
324
|
(<any>global).myfaces = data.myfaces;
|
|
301
325
|
(<any>global).window.jsf = data.jsf;
|
|
302
326
|
(<any>global).window.myfaces = data.myfaces;
|
|
303
327
|
(<any>global).Implementation = Implementation.Implementation;
|
|
328
|
+
(<any>global).window.Implementation = Implementation.Implementation;
|
|
304
329
|
(<any>global).PushImpl = PushImpl.PushImpl;
|
|
305
330
|
//bypass a bug on windows jsdom, domparser not an auto global but on window only
|
|
306
331
|
(<any>global).DOMParser = (<any>global)?.DOMParser ?? window.DOMParser;
|
|
307
332
|
(<any>global).document = (<any>global)?.document ?? window.document;
|
|
308
333
|
};
|
|
309
334
|
|
|
335
|
+
|
|
310
336
|
/**
|
|
311
337
|
* init the jsdom global
|
|
312
338
|
* @param clean
|
|
@@ -320,19 +346,22 @@ export module StandardInits {
|
|
|
320
346
|
runScripts: "dangerously"
|
|
321
347
|
};
|
|
322
348
|
//we have two different apis depending whether we allow module interop with sinon or not
|
|
323
|
-
return domIt?.default
|
|
349
|
+
return (domIt?.default ?? domIt)?.(template, params) ;
|
|
324
350
|
});
|
|
325
351
|
};
|
|
326
352
|
|
|
327
353
|
/**
|
|
328
354
|
* init the jsf subsystem
|
|
329
355
|
*/
|
|
330
|
-
let initJSF = async function () {
|
|
356
|
+
let initJSF = async function (IS_40: boolean = true) {
|
|
331
357
|
// @ts-ignore
|
|
332
|
-
|
|
358
|
+
|
|
359
|
+
const facesImport = IS_40 ? import("../../../../api/faces") : import("../../../../api/jsf");
|
|
360
|
+
|
|
361
|
+
return facesImport.then((data) => {
|
|
333
362
|
let Implementation = require("../../../../impl/AjaxImpl");
|
|
334
363
|
let PushImpl = require("../../../../impl/PushImpl");
|
|
335
|
-
applyJsfToGlobals(data, Implementation, PushImpl);
|
|
364
|
+
IS_40 ? applyJsfToGlobals(data, Implementation, PushImpl): applyJsfToGlobals23(data, Implementation, PushImpl);
|
|
336
365
|
}).catch(err => {
|
|
337
366
|
console.error(err);
|
|
338
367
|
});
|
|
@@ -345,10 +374,12 @@ export module StandardInits {
|
|
|
345
374
|
(<any>global)?.Implementation?.reset();
|
|
346
375
|
(<any>global)?.PushImpl?.reset();
|
|
347
376
|
|
|
348
|
-
delete (<any>global).
|
|
377
|
+
((<any>global).faces) ? delete (<any>global).faces : null;
|
|
378
|
+
((<any>global).jsf) ? delete (<any>global).jsf : null;
|
|
349
379
|
delete (<any>global).myfaces;
|
|
350
|
-
delete (<any>global).Implementation;
|
|
380
|
+
((<any>global).Implementation) ? delete (<any>global).Implementation : null;
|
|
351
381
|
delete (<any>global).PushImpl;
|
|
382
|
+
remapNamespacesFor40();
|
|
352
383
|
};
|
|
353
384
|
|
|
354
385
|
/**
|
|
@@ -357,7 +388,7 @@ export module StandardInits {
|
|
|
357
388
|
* @param template
|
|
358
389
|
* @param withJsf
|
|
359
390
|
*/
|
|
360
|
-
async function init(template: string, withJsf = true): Promise<() => void> {
|
|
391
|
+
async function init(template: string, withJsf = true, IS_JSF_40 = true): Promise<() => void> {
|
|
361
392
|
//let dom2 = new JSDOM(template)
|
|
362
393
|
//return initMyFacesFromDom(dom2);
|
|
363
394
|
let clean = null;
|
|
@@ -368,11 +399,11 @@ export module StandardInits {
|
|
|
368
399
|
resetGlobals();
|
|
369
400
|
// @ts-ignore
|
|
370
401
|
await initJSDOM(template).then(data => clean = data);
|
|
371
|
-
await initJSF();
|
|
402
|
+
await initJSF(IS_JSF_40);
|
|
372
403
|
} else {
|
|
373
404
|
// @ts-ignore
|
|
374
405
|
await import('jsdom-global').then((domIt) => {
|
|
375
|
-
clean = domIt(template);
|
|
406
|
+
clean = (domIt?.default ?? domIt)?.(template);
|
|
376
407
|
});
|
|
377
408
|
}
|
|
378
409
|
//the async is returning a promise on the caller level
|
|
@@ -59,7 +59,7 @@ export class XmlResponses {
|
|
|
59
59
|
static VIEWSTATE_1 = `
|
|
60
60
|
<partial-response>
|
|
61
61
|
<changes>
|
|
62
|
-
<update id="
|
|
62
|
+
<update id="jakarta.faces.ViewState"><![CDATA[hello world]]></update>
|
|
63
63
|
</changes>
|
|
64
64
|
</partial-response>
|
|
65
65
|
`;
|
|
@@ -94,7 +94,7 @@ export class XmlResponses {
|
|
|
94
94
|
|
|
95
95
|
static BODY_REPLACEMENT = `<partial-response>
|
|
96
96
|
<changes>
|
|
97
|
-
<update id="
|
|
97
|
+
<update id="jakarta.faces.ViewBody"><![CDATA[
|
|
98
98
|
<body id="the_id" class="tundra">
|
|
99
99
|
<div id='centerDiv'>
|
|
100
100
|
<h1>Test for body change done</h1>
|
|
@@ -121,7 +121,7 @@ export class XmlResponses {
|
|
|
121
121
|
|
|
122
122
|
static HEAD_REPLACEMENT = `<partial-response>
|
|
123
123
|
<changes>
|
|
124
|
-
<update id="
|
|
124
|
+
<update id="jakarta.faces.ViewHead"><![CDATA[
|
|
125
125
|
<head>
|
|
126
126
|
<meta blarg="blarg2"></meta>
|
|
127
127
|
<script type='text/javascript'>
|
|
@@ -137,7 +137,7 @@ export class XmlResponses {
|
|
|
137
137
|
|
|
138
138
|
static VIEW_ROOT_REPLACEMENT = `<partial-response>
|
|
139
139
|
<changes>
|
|
140
|
-
<update id="
|
|
140
|
+
<update id="jakarta.faces.ViewRoot"><![CDATA[
|
|
141
141
|
<html>
|
|
142
142
|
<head>
|
|
143
143
|
<meta blarg="blarg2"></meta>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/*! Licensed to the Apache Software Foundation (ASF) under one or more
|
|
2
2
|
* contributor license agreements. See the NOTICE file distributed with
|
|
3
3
|
* this work for additional information regarding copyright ownership.
|
|
4
4
|
* The ASF licenses this file to you under the Apache License, Version 2.0
|
|
@@ -27,35 +27,35 @@ import {P_EXECUTE, P_RENDER} from "../../impl/core/Const";
|
|
|
27
27
|
|
|
28
28
|
sinon.reset();
|
|
29
29
|
|
|
30
|
-
declare var
|
|
30
|
+
declare var faces: any;
|
|
31
31
|
declare var Implementation: any;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
* testing the
|
|
34
|
+
* testing the faces.ajax.request api without triggering any
|
|
35
35
|
* xhr request...
|
|
36
36
|
* the idea is to shim the code which triggers the request out and check what is going in
|
|
37
37
|
* and what is coming out
|
|
38
38
|
*/
|
|
39
39
|
|
|
40
|
-
describe('
|
|
40
|
+
describe('faces.ajax.request test suite', () => {
|
|
41
41
|
|
|
42
|
-
beforeEach(() => {
|
|
43
|
-
return defaultMyFaces();
|
|
42
|
+
beforeEach(async () => {
|
|
43
|
+
return await defaultMyFaces();
|
|
44
44
|
});
|
|
45
45
|
|
|
46
|
-
it("
|
|
46
|
+
it("faces.ajax.request can be called", () => {
|
|
47
47
|
//we stub the addRequestToQueue, to enable the request check only
|
|
48
48
|
//without any xhr and response, both will be tested separately for
|
|
49
49
|
//proper behavior
|
|
50
50
|
const Impl = Implementation;
|
|
51
51
|
const addRequestToQueue = sinon.stub(Impl.queueHandler, "addRequestToQueue");
|
|
52
|
-
//now the
|
|
52
|
+
//now the faces.ajax.request should trigger but should not go into
|
|
53
53
|
//the asynchronous event loop.
|
|
54
54
|
//lets check it out
|
|
55
55
|
|
|
56
56
|
try {
|
|
57
57
|
DomQuery.byId("input_2").addEventListener("click", (event: Event) => {
|
|
58
|
-
|
|
58
|
+
faces.ajax.request(null, event, {render: '@all', execute: '@form'})
|
|
59
59
|
}).click();
|
|
60
60
|
|
|
61
61
|
expect(addRequestToQueue.called).to.be.true;
|
|
@@ -74,12 +74,12 @@ describe('jsf.ajax.request test suite', () => {
|
|
|
74
74
|
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
it("
|
|
77
|
+
it("faces.ajax.request passthroughs must end up in passthrough", (done) => {
|
|
78
78
|
//TODO implementation
|
|
79
79
|
done();
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
it("
|
|
82
|
+
it("faces.util.chain must work", () => {
|
|
83
83
|
let called = {};
|
|
84
84
|
(<any>window).called = called;
|
|
85
85
|
|
|
@@ -108,7 +108,7 @@ describe('jsf.ajax.request test suite', () => {
|
|
|
108
108
|
return false;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
|
|
111
|
+
faces.util.chain(this, called, func1, func2, func3, func4, func5);
|
|
112
112
|
|
|
113
113
|
expect(called["func1"]).to.be.true;
|
|
114
114
|
expect(called["func2"]).to.be.true;
|
|
@@ -117,7 +117,7 @@ describe('jsf.ajax.request test suite', () => {
|
|
|
117
117
|
expect(!!called["func5"]).to.be.false;
|
|
118
118
|
|
|
119
119
|
called = {};
|
|
120
|
-
|
|
120
|
+
faces.util.chain(this, called, func1, func2, func4, func5);
|
|
121
121
|
expect(called["func1"]).to.be.true;
|
|
122
122
|
expect(called["func2"]).to.be.true;
|
|
123
123
|
expect(!!called["func4"]).to.be.true;
|