jsf.js_next_gen 4.0.0-beta-23 → 4.0.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.
- package/.nyc_output/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/09ca9ebc-2305-4357-8db9-48ddfc7dfde2.json +1 -0
- package/.nyc_output/processinfo/7c496a14-166e-4aa5-85b9-47b22b055ad8.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/README.md +7 -22
- package/dist/docs/assets/main.js +56 -52
- package/dist/docs/assets/search.js +1 -1
- package/dist/docs/assets/style.css +23 -0
- package/dist/docs/functions/faces.ajax.addOnError.html +6 -4
- package/dist/docs/functions/faces.ajax.addOnEvent.html +2 -0
- package/dist/docs/functions/faces.ajax.request.html +7 -7
- package/dist/docs/functions/faces.ajax.response.html +0 -1
- package/dist/docs/functions/faces.push.close.html +4 -2
- package/dist/docs/functions/faces.push.init.html +19 -7
- package/dist/docs/functions/faces.push.open.html +4 -2
- package/dist/docs/functions/faces.util.chain.html +3 -3
- package/dist/docs/functions/myfaces.ab.html +9 -4
- package/dist/docs/functions/myfaces.onOnDomReady.html +72 -0
- package/dist/docs/index.html +7 -18
- package/dist/docs/modules/myfaces.html +3 -1
- package/dist/docs/variables/myfaces.oam.html +2 -1
- package/dist/window/faces-development.js +2147 -1779
- 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.LICENSE.txt +17 -2
- 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 +2156 -1777
- 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.LICENSE.txt +17 -2
- 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 +19 -18
- package/pom.xml +1 -1
- package/src/main/test.xml +23 -0
- package/src/main/typescript/@types/definitions/index.d.ts +24 -7
- package/src/main/typescript/api/_api.ts +79 -37
- package/src/main/typescript/api/jsf.ts +18 -0
- package/src/main/typescript/impl/AjaxImpl.ts +168 -78
- package/src/main/typescript/impl/PushImpl.ts +63 -38
- package/src/main/typescript/impl/core/Const.ts +52 -39
- package/src/main/typescript/impl/util/Assertions.ts +16 -8
- package/src/main/typescript/impl/util/AsyncQueue.ts +1 -1
- package/src/main/typescript/impl/util/AsyncRunnable.ts +4 -4
- package/src/main/typescript/impl/util/ExtDomQuery.ts +58 -45
- package/src/main/typescript/impl/util/FileUtils.ts +104 -0
- package/src/main/typescript/impl/util/HiddenInputBuilder.ts +89 -0
- package/src/main/typescript/impl/util/Lang.ts +30 -31
- package/src/main/typescript/impl/xhrCore/ErrorData.ts +15 -10
- package/src/main/typescript/impl/xhrCore/EventData.ts +2 -2
- package/src/main/typescript/impl/xhrCore/IResponseProcessor.ts +25 -11
- package/src/main/typescript/impl/xhrCore/RequestDataResolver.ts +78 -32
- package/src/main/typescript/impl/xhrCore/ResonseDataResolver.ts +10 -10
- package/src/main/typescript/impl/xhrCore/Response.ts +66 -49
- package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +202 -131
- package/src/main/typescript/impl/xhrCore/XhrFormData.ts +79 -166
- package/src/main/typescript/impl/xhrCore/XhrRequest.ts +80 -68
- package/src/main/typescript/myfaces/OamSubmit.ts +29 -13
- package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +19 -22
- package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +108 -1
- package/src/main/typescript/test/frameworkBase/_ext/shared/XmlResponses.ts +40 -1
- package/src/main/typescript/test/impl/ImplTest.spec.ts +3 -3
- package/src/main/typescript/test/impl/ImplTest_23.spec.ts +3 -7
- package/src/main/typescript/test/xhrCore/EventTests.spec.ts +1 -1
- package/src/main/typescript/test/xhrCore/FileUploadTest.spec.ts +5 -2
- package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +203 -0
- package/src/main/typescript/test/xhrCore/OamSubmitTest.spec.ts +177 -0
- package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +158 -17
- package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +242 -11
- package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +39 -3
- package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +373 -35
- package/src/main/typescript/test/xhrCore/ResponseTest23.spec.ts +43 -9
- package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +109 -0
- package/src/main/typescript/test/xhrCore/XhrFormDataTest.spec.ts +67 -49
- package/src/main/typescript/test.xml +6 -0
- package/src/main/typescript/tsconfig.json +1 -1
- package/src/test/resources/jsf-development.js +1 -1
- package/src/tmp/test.html +12 -88
- package/target/api/_api.js +72 -31
- package/target/api/_api.js.map +1 -1
- package/target/api/jsf.js +11 -0
- package/target/api/jsf.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/impl/AjaxImpl.js +144 -59
- package/target/impl/AjaxImpl.js.map +1 -1
- package/target/impl/PushImpl.js +66 -35
- package/target/impl/PushImpl.js.map +1 -1
- package/target/impl/core/Const.js +51 -38
- package/target/impl/core/Const.js.map +1 -1
- package/target/impl/core/Context.js +10 -0
- package/target/impl/core/Context.js.map +1 -0
- package/target/impl/util/Assertions.js +12 -7
- package/target/impl/util/Assertions.js.map +1 -1
- package/target/impl/util/AsyncQueue.js.map +1 -1
- package/target/impl/util/ExtDomQuery.js +58 -40
- package/target/impl/util/ExtDomQuery.js.map +1 -1
- package/target/impl/util/FileUtils.js +96 -0
- package/target/impl/util/FileUtils.js.map +1 -0
- package/target/impl/util/HiddenElementBuilder.js +7 -0
- package/target/impl/util/HiddenElementBuilder.js.map +1 -0
- package/target/impl/util/HiddenInputBuilder.js +79 -0
- package/target/impl/util/HiddenInputBuilder.js.map +1 -0
- package/target/impl/util/Lang.js +29 -30
- package/target/impl/util/Lang.js.map +1 -1
- package/target/impl/util/URLCodec.js +77 -0
- package/target/impl/util/URLCodec.js.map +1 -0
- package/target/impl/util/XhrQueueController.js +82 -0
- package/target/impl/util/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/ErrorData.js +10 -8
- package/target/impl/xhrCore/ErrorData.js.map +1 -1
- package/target/impl/xhrCore/EventData.js +1 -1
- package/target/impl/xhrCore/EventData.js.map +1 -1
- package/target/impl/xhrCore/RequestContext.js +11 -0
- package/target/impl/xhrCore/RequestContext.js.map +1 -0
- package/target/impl/xhrCore/RequestDataResolver.js +70 -23
- package/target/impl/xhrCore/RequestDataResolver.js.map +1 -1
- package/target/impl/xhrCore/ResonseDataResolver.js +9 -9
- package/target/impl/xhrCore/ResonseDataResolver.js.map +1 -1
- package/target/impl/xhrCore/Response.js +44 -29
- package/target/impl/xhrCore/Response.js.map +1 -1
- package/target/impl/xhrCore/ResponseProcessor.js +182 -116
- package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
- package/target/impl/xhrCore/XhrFormData.js +68 -156
- package/target/impl/xhrCore/XhrFormData.js.map +1 -1
- package/target/impl/xhrCore/XhrQueHandler.js +11 -0
- package/target/impl/xhrCore/XhrQueHandler.js.map +1 -0
- package/target/impl/xhrCore/XhrQueueController.js +62 -0
- package/target/impl/xhrCore/XhrQueueController.js.map +1 -0
- package/target/impl/xhrCore/XhrRequest.js +68 -59
- package/target/impl/xhrCore/XhrRequest.js.map +1 -1
- package/target/myfaces/OamSubmit.js +23 -14
- package/target/myfaces/OamSubmit.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +16 -16
- package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js +76 -0
- package/target/test/frameworkBase/_ext/monadish/ExtendedArrayTest.spec.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js +925 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-with-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js +112 -0
- package/target/test/frameworkBase/_ext/monadish/markups/tobago-without-header.js.map +1 -0
- package/target/test/frameworkBase/_ext/shared/StandardInits.js +100 -1
- package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js +37 -1
- package/target/test/frameworkBase/_ext/shared/XmlResponses.js.map +1 -1
- package/target/test/impl/ImplTest.spec.js +2 -2
- package/target/test/impl/ImplTest.spec.js.map +1 -1
- package/target/test/impl/ImplTest_23.spec.js +2 -2
- package/target/test/impl/ImplTest_23.spec.js.map +1 -1
- package/target/test/myfaces/OnLoadSpec.js +57 -0
- package/target/test/myfaces/OnLoadSpec.js.map +1 -0
- package/target/test/xhrCore/EventTests.spec.js +1 -1
- package/target/test/xhrCore/EventTests.spec.js.map +1 -1
- package/target/test/xhrCore/FileUploadTest.spec.js +2 -1
- package/target/test/xhrCore/FileUploadTest.spec.js.map +1 -1
- package/target/test/xhrCore/NamespacesRequestTest.spec.js +204 -0
- package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js +180 -0
- package/target/test/xhrCore/OamSubmitTest.spec.js.map +1 -0
- package/target/test/xhrCore/RequestParamsTest.spec.js +142 -10
- package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest.spec.js +217 -9
- package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
- package/target/test/xhrCore/RequestTest_23.spec.js +34 -2
- package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest.spec.js +308 -24
- package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
- package/target/test/xhrCore/ResponseTest23.spec.js +38 -8
- package/target/test/xhrCore/ResponseTest23.spec.js.map +1 -1
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js +128 -0
- package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -0
- package/target/test/xhrCore/XhrFormDataTest.spec.js +57 -34
- package/target/test/xhrCore/XhrFormDataTest.spec.js.map +1 -1
- 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 +24 -0
- package/target/test-classes/jsf-development.js +3559 -0
- 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 +1 -0
- package/target/test-classes/jsf.js +3 -0
- package/target/test-classes/jsf.js.br +0 -0
- package/target/test-classes/jsf.js.gz +0 -0
- package/tmp.xml +36 -0
- package/.nyc_output/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/.nyc_output/processinfo/2303b649-59d9-485c-9228-73b0ec8787a7.json +0 -1
- package/.nyc_output/processinfo/756f2f03-c85b-4cdb-9b92-5799eb45ef1e.json +0 -1
- package/target/types/index.js +0 -18
- package/target/types/index.js.map +0 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
import {Config, DomQuery, DQ, Lang, Stream, XMLQuery} from "mona-dish";
|
|
17
|
+
import {Config, DomQuery, DomQueryCollector, DQ, DQ$, Lang, LazyStream, Stream, XMLQuery} from "mona-dish";
|
|
18
18
|
import {Implementation} from "../AjaxImpl";
|
|
19
19
|
import {Assertions} from "../util/Assertions";
|
|
20
20
|
import {IResponseProcessor} from "./IResponseProcessor";
|
|
@@ -23,6 +23,7 @@ import {StateHolder} from "../core/ImplTypes";
|
|
|
23
23
|
import {EventData} from "./EventData";
|
|
24
24
|
|
|
25
25
|
import {
|
|
26
|
+
$faces,
|
|
26
27
|
$nsp,
|
|
27
28
|
APPLIED_CLIENT_WINDOW,
|
|
28
29
|
APPLIED_VST,
|
|
@@ -30,32 +31,40 @@ import {
|
|
|
30
31
|
ATTR_NAME,
|
|
31
32
|
ATTR_URL,
|
|
32
33
|
ATTR_VALUE,
|
|
34
|
+
DEFERRED_HEAD_INSERTS,
|
|
33
35
|
EMPTY_FUNC,
|
|
34
36
|
EMPTY_STR,
|
|
35
37
|
ERROR_MESSAGE,
|
|
36
38
|
ERROR_NAME,
|
|
37
|
-
|
|
39
|
+
HTML_TAG_BODY,
|
|
40
|
+
HTML_TAG_FORM,
|
|
41
|
+
HTML_TAG_HEAD,
|
|
42
|
+
HTML_TAG_LINK,
|
|
43
|
+
HTML_TAG_SCRIPT,
|
|
44
|
+
HTML_TAG_STYLE, IDENT_ALL, IDENT_NONE, NAMED_VIEWROOT,
|
|
38
45
|
ON_ERROR,
|
|
39
|
-
ON_EVENT,
|
|
46
|
+
ON_EVENT,
|
|
47
|
+
P_CLIENT_WINDOW,
|
|
48
|
+
P_EXECUTE,
|
|
40
49
|
P_PARTIAL_SOURCE,
|
|
50
|
+
P_RENDER,
|
|
51
|
+
P_RENDER_OVERRIDE,
|
|
41
52
|
P_VIEWSTATE,
|
|
42
|
-
|
|
43
|
-
|
|
53
|
+
NAMING_CONTAINER_ID,
|
|
54
|
+
RESPONSE_XML,
|
|
55
|
+
SEL_CLIENT_WINDOW_ELEM,
|
|
44
56
|
SEL_VIEWSTATE_ELEM,
|
|
45
57
|
SOURCE,
|
|
46
58
|
SUCCESS,
|
|
47
|
-
TAG_AFTER,
|
|
48
|
-
TAG_ATTR,
|
|
49
|
-
TAG_BEFORE,
|
|
50
|
-
TAG_BODY,
|
|
51
|
-
TAG_FORM,
|
|
52
|
-
TAG_HEAD,
|
|
53
59
|
UPDATE_ELEMS,
|
|
54
60
|
UPDATE_FORMS,
|
|
55
|
-
|
|
61
|
+
XML_TAG_AFTER,
|
|
62
|
+
XML_TAG_ATTR,
|
|
63
|
+
XML_TAG_BEFORE
|
|
56
64
|
} from "../core/Const";
|
|
65
|
+
import {ExtConfig, ExtDomQuery} from "../util/ExtDomQuery";
|
|
66
|
+
import {HiddenInputBuilder} from "../util/HiddenInputBuilder";
|
|
57
67
|
import trim = Lang.trim;
|
|
58
|
-
import {ExtConfig, ExtDomquery} from "../util/ExtDomQuery";
|
|
59
68
|
|
|
60
69
|
|
|
61
70
|
/**
|
|
@@ -82,31 +91,38 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
82
91
|
* the data incoming must represent the html representation of the head itself one way or the other
|
|
83
92
|
*/
|
|
84
93
|
replaceHead(shadowDocument: XMLQuery | DQ) {
|
|
85
|
-
|
|
94
|
+
const shadowHead = shadowDocument.querySelectorAll(HTML_TAG_HEAD);
|
|
86
95
|
if (!shadowHead.isPresent()) {
|
|
87
96
|
return;
|
|
88
97
|
}
|
|
98
|
+
const head = ExtDomQuery.querySelectorAll(HTML_TAG_HEAD);
|
|
99
|
+
// full replace we delete everything
|
|
100
|
+
head.childNodes.delete();
|
|
101
|
+
this.addToHead(shadowHead);
|
|
102
|
+
//we copy the attributes as well (just in case myfaces introduces the id in head)
|
|
103
|
+
head.copyAttrs(shadowHead);
|
|
104
|
+
}
|
|
89
105
|
|
|
90
|
-
|
|
106
|
+
addToHead(shadowHead: XMLQuery | DQ) {
|
|
107
|
+
const mappedHeadData = new ExtDomQuery(shadowHead);
|
|
108
|
+
const scriptTags = [HTML_TAG_SCRIPT];
|
|
109
|
+
const nonExecutables = mappedHeadData.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) == -1);
|
|
110
|
+
nonExecutables.runHeadInserts(true);
|
|
91
111
|
|
|
92
|
-
//
|
|
93
|
-
|
|
112
|
+
//incoming either the outer head tag or its children
|
|
113
|
+
const nodesToAdd = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
114
|
+
// this is stored for "post" processing
|
|
115
|
+
// after the rest of the "physical build up", head before body
|
|
116
|
+
const scriptElements = nodesToAdd.stream
|
|
117
|
+
.filter(item => scriptTags.indexOf(item.tagName.orElse("").value) != -1).collect(new DomQueryCollector());
|
|
94
118
|
|
|
95
|
-
|
|
96
|
-
// eval means the scripts will get attached (eval script attach method)
|
|
97
|
-
// but this is done by DomQuery not in this code
|
|
98
|
-
this.storeForEval(shadowHead);
|
|
99
|
-
//incoming either the outer head tag or its childs
|
|
100
|
-
//shadowHead = (shadowHead.tagName.value === "HEAD") ? shadowHead.childNodes : shadowHead;
|
|
101
|
-
//this.addToHead(shadowHead);
|
|
119
|
+
this.addToHeadDeferred(scriptElements);
|
|
102
120
|
}
|
|
103
121
|
|
|
104
|
-
|
|
122
|
+
addToHeadDeferred(newElements: XMLQuery | DQ) {
|
|
105
123
|
this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(newElements);
|
|
106
124
|
}
|
|
107
125
|
|
|
108
|
-
|
|
109
|
-
|
|
110
126
|
/**
|
|
111
127
|
* replaces the body in the expected manner
|
|
112
128
|
* which means the entire body content is refreshed
|
|
@@ -117,30 +133,30 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
117
133
|
*/
|
|
118
134
|
replaceBody(shadowDocument: XMLQuery | DQ) {
|
|
119
135
|
|
|
120
|
-
|
|
136
|
+
const shadowBody = shadowDocument.querySelectorAll(HTML_TAG_BODY);
|
|
121
137
|
if (!shadowBody.isPresent()) {
|
|
122
138
|
return;
|
|
123
139
|
}
|
|
124
140
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
let updateForms = resultingBody.querySelectorAll(TAG_FORM);
|
|
141
|
+
const shadowInnerHTML: string = <string>shadowBody.innerHTML;
|
|
142
|
+
const resultingBody = <DQ>ExtDomQuery.querySelectorAll(HTML_TAG_BODY);
|
|
143
|
+
const updateForms = resultingBody.querySelectorAll(HTML_TAG_FORM);
|
|
129
144
|
|
|
130
145
|
// main difference, we cannot replace the body itself, but only its content
|
|
131
|
-
// we need a separate step for post
|
|
132
|
-
|
|
133
|
-
|
|
146
|
+
// we need a separate step for post-processing the incoming
|
|
147
|
+
// attributes, like classes, styles etc...
|
|
148
|
+
(resultingBody.html(shadowInnerHTML) as DQ).copyAttrs(shadowBody);
|
|
149
|
+
this.externalContext.assign($nsp(P_RENDER_OVERRIDE)).value = "@all";
|
|
134
150
|
this.storeForPostProcessing(updateForms, resultingBody);
|
|
135
151
|
}
|
|
136
152
|
|
|
137
153
|
/**
|
|
138
|
-
* Leaf Tag eval... process whatever is in the
|
|
154
|
+
* Leaf Tag eval... process whatever is in the eval cdata block
|
|
139
155
|
*
|
|
140
156
|
* @param node the node to eval
|
|
141
157
|
*/
|
|
142
158
|
eval(node: XMLQuery) {
|
|
143
|
-
|
|
159
|
+
ExtDomQuery.globalEval(node.cDATAAsString);
|
|
144
160
|
}
|
|
145
161
|
|
|
146
162
|
/**
|
|
@@ -157,22 +173,22 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
157
173
|
* <error>
|
|
158
174
|
*/
|
|
159
175
|
|
|
160
|
-
|
|
176
|
+
const mergedErrorData = new ExtConfig({});
|
|
161
177
|
mergedErrorData.assign(SOURCE).value = this.externalContext.getIf(P_PARTIAL_SOURCE).get(0).value;
|
|
162
178
|
mergedErrorData.assign(ERROR_NAME).value = node.querySelectorAll(ERROR_NAME).textContent(EMPTY_STR);
|
|
163
179
|
mergedErrorData.assign(ERROR_MESSAGE).value = node.querySelectorAll(ERROR_MESSAGE).cDATAAsString;
|
|
164
180
|
|
|
165
|
-
|
|
181
|
+
const hasResponseXML = this.internalContext.get(RESPONSE_XML).isPresent();
|
|
166
182
|
|
|
167
183
|
//we now store the response xml also in the error data for further details
|
|
168
184
|
mergedErrorData.assignIf(hasResponseXML, RESPONSE_XML).value = this.internalContext.getIf(RESPONSE_XML).value.get(0).value;
|
|
169
185
|
|
|
170
|
-
// error post
|
|
171
|
-
|
|
186
|
+
// error post-processing and enrichment (standard messages from keys)
|
|
187
|
+
const errorData = ErrorData.fromServerError(mergedErrorData);
|
|
172
188
|
|
|
173
|
-
// we now trigger an internally stored onError function which might be
|
|
174
|
-
// either we
|
|
175
|
-
//
|
|
189
|
+
// we now trigger an internally stored onError function which might be an attached to the context
|
|
190
|
+
// either we do not have an internal on error, or an on error has been based via params from the outside.
|
|
191
|
+
// In both cases they are attached to our contexts
|
|
176
192
|
|
|
177
193
|
this.triggerOnError(errorData);
|
|
178
194
|
Implementation.sendError(errorData);
|
|
@@ -186,7 +202,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
186
202
|
redirect(node: XMLQuery) {
|
|
187
203
|
Assertions.assertUrlExists(node);
|
|
188
204
|
|
|
189
|
-
|
|
205
|
+
const redirectUrl = trim(node.attr(ATTR_URL).value);
|
|
190
206
|
if (redirectUrl != EMPTY_STR) {
|
|
191
207
|
window.location.href = redirectUrl;
|
|
192
208
|
}
|
|
@@ -198,15 +214,15 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
198
214
|
* @param cdataBlock the cdata block with the new html code
|
|
199
215
|
*/
|
|
200
216
|
update(node: XMLQuery, cdataBlock: string) {
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
const result = ExtDomQuery.byId(node.id.value, true).outerHTML(cdataBlock, false, false);
|
|
218
|
+
const sourceForm = result?.firstParent(HTML_TAG_FORM).orElseLazy(() => result.byTagName(HTML_TAG_FORM, true));
|
|
203
219
|
if (sourceForm) {
|
|
204
220
|
this.storeForPostProcessing(sourceForm, result);
|
|
205
221
|
}
|
|
206
222
|
}
|
|
207
223
|
|
|
208
224
|
/**
|
|
209
|
-
* Delete handler, simply
|
|
225
|
+
* Delete handler, simply deletes the node referenced by the xml data
|
|
210
226
|
* @param node
|
|
211
227
|
*/
|
|
212
228
|
delete(node: XMLQuery) {
|
|
@@ -219,9 +235,9 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
219
235
|
* @param node
|
|
220
236
|
*/
|
|
221
237
|
attributes(node: XMLQuery) {
|
|
222
|
-
|
|
238
|
+
const elem = DQ.byId(node.id.value, true);
|
|
223
239
|
|
|
224
|
-
node.byTagName(
|
|
240
|
+
node.byTagName(XML_TAG_ATTR).each((item: XMLQuery) => {
|
|
225
241
|
elem.attr(item.attr(ATTR_NAME).value).value = item.attr(ATTR_VALUE).value;
|
|
226
242
|
});
|
|
227
243
|
}
|
|
@@ -242,17 +258,16 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
242
258
|
insert(node: XMLQuery) {
|
|
243
259
|
//let insertId = node.id; //not used atm
|
|
244
260
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
let insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);
|
|
261
|
+
const before = node.attr(XML_TAG_BEFORE);
|
|
262
|
+
const after = node.attr(XML_TAG_AFTER);
|
|
263
|
+
const insertNodes = DQ.fromMarkup(<any>node.cDATAAsString);
|
|
249
264
|
|
|
250
265
|
if (before.isPresent()) {
|
|
251
266
|
DQ.byId(before.value, true).insertBefore(insertNodes);
|
|
252
267
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
253
268
|
}
|
|
254
269
|
if (after.isPresent()) {
|
|
255
|
-
|
|
270
|
+
const domQuery = DQ.byId(after.value, true);
|
|
256
271
|
domQuery.insertAfter(insertNodes);
|
|
257
272
|
|
|
258
273
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -264,13 +279,13 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
264
279
|
*
|
|
265
280
|
* @param node the node hosting the insert data
|
|
266
281
|
*/
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
282
|
+
insertWithSubTags(node: XMLQuery) {
|
|
283
|
+
const before = node.querySelectorAll(XML_TAG_BEFORE);
|
|
284
|
+
const after = node.querySelectorAll(XML_TAG_AFTER);
|
|
270
285
|
|
|
271
286
|
before.each(item => {
|
|
272
|
-
|
|
273
|
-
|
|
287
|
+
const insertId = item.attr(ATTR_ID);
|
|
288
|
+
const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);
|
|
274
289
|
if (insertId.isPresent()) {
|
|
275
290
|
DQ.byId(insertId.value, true).insertBefore(insertNodes);
|
|
276
291
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -278,8 +293,8 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
278
293
|
});
|
|
279
294
|
|
|
280
295
|
after.each(item => {
|
|
281
|
-
|
|
282
|
-
|
|
296
|
+
const insertId = item.attr(ATTR_ID);
|
|
297
|
+
const insertNodes = DQ.fromMarkup(<any>item.cDATAAsString);
|
|
283
298
|
if (insertId.isPresent()) {
|
|
284
299
|
DQ.byId(insertId.value, true).insertAfter(insertNodes);
|
|
285
300
|
this.internalContext.assign(UPDATE_ELEMS).value.push(insertNodes);
|
|
@@ -289,12 +304,12 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
289
304
|
|
|
290
305
|
/**
|
|
291
306
|
* Process the viewState update, update the affected
|
|
292
|
-
* forms with their respective new
|
|
307
|
+
* forms with their respective new viewState values
|
|
293
308
|
*
|
|
294
309
|
*/
|
|
295
310
|
processViewState(node: XMLQuery): boolean {
|
|
296
311
|
if (ResponseProcessor.isViewStateNode(node)) {
|
|
297
|
-
|
|
312
|
+
const state = node.cDATAAsString;
|
|
298
313
|
this.internalContext.assign(APPLIED_VST, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
299
314
|
return true;
|
|
300
315
|
}
|
|
@@ -303,7 +318,7 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
303
318
|
|
|
304
319
|
processClientWindow(node: XMLQuery): boolean {
|
|
305
320
|
if (ResponseProcessor.isClientWindowNode(node)) {
|
|
306
|
-
|
|
321
|
+
const state = node.cDATAAsString;
|
|
307
322
|
this.internalContext.assign(APPLIED_CLIENT_WINDOW, node.id.value).value = new StateHolder($nsp(node.id.value), state);
|
|
308
323
|
return true;
|
|
309
324
|
}
|
|
@@ -314,11 +329,11 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
314
329
|
*/
|
|
315
330
|
globalEval() {
|
|
316
331
|
// phase one, if we have head inserts, we build up those before going into the script eval phase
|
|
317
|
-
let insertHeadElems = new
|
|
332
|
+
let insertHeadElems = new ExtDomQuery(...this.internalContext.getIf(DEFERRED_HEAD_INSERTS).value);
|
|
318
333
|
insertHeadElems.runHeadInserts(true);
|
|
319
334
|
|
|
320
335
|
// phase 2 we run a script eval on all updated elements in the body
|
|
321
|
-
let updateElems = new
|
|
336
|
+
let updateElems = new ExtDomQuery(...this.internalContext.getIf(UPDATE_ELEMS).value);
|
|
322
337
|
updateElems.runCss();
|
|
323
338
|
// phase 3, we do the same for the css
|
|
324
339
|
updateElems.runScripts();
|
|
@@ -332,62 +347,78 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
332
347
|
*/
|
|
333
348
|
fixViewStates() {
|
|
334
349
|
Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_VST).orElse({}).value)
|
|
335
|
-
.each((
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
350
|
+
.each(([, value]) => {
|
|
351
|
+
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
352
|
+
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value
|
|
353
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
354
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
340
355
|
|
|
341
|
-
this.appendViewStateToForms(
|
|
356
|
+
this.appendViewStateToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
342
357
|
});
|
|
343
358
|
}
|
|
344
359
|
|
|
360
|
+
|
|
361
|
+
|
|
345
362
|
/**
|
|
346
363
|
* same as with view states before applies the incoming client windows as last step after the rest of the processing
|
|
347
364
|
* is done.
|
|
348
365
|
*/
|
|
349
366
|
fixClientWindow() {
|
|
350
367
|
Stream.ofAssoc<StateHolder>(this.internalContext.getIf(APPLIED_CLIENT_WINDOW).orElse({}).value)
|
|
351
|
-
.each((
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
368
|
+
.each(([, value]) => {
|
|
369
|
+
const namingContainerId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
370
|
+
const namedViewRoot = !!this.internalContext.getIf(NAMED_VIEWROOT).value;
|
|
371
|
+
const affectedForms = this.getContainerForms(namingContainerId)
|
|
372
|
+
.filter(affectedForm => this.isInExecuteOrRender(affectedForm));
|
|
356
373
|
|
|
357
|
-
this.appendClientWindowToForms(
|
|
374
|
+
this.appendClientWindowToForms(affectedForms, namedViewRoot, value.value, namingContainerId.orElse("").value);
|
|
358
375
|
});
|
|
359
376
|
}
|
|
360
377
|
|
|
378
|
+
updateNamedViewRootState() {
|
|
379
|
+
let partialId = this.internalContext.getIf(NAMING_CONTAINER_ID);
|
|
380
|
+
let namedViewRoot = this.internalContext.getIf(NAMED_VIEWROOT);
|
|
381
|
+
if(partialId.isPresent() &&
|
|
382
|
+
(namedViewRoot.isAbsent() ||
|
|
383
|
+
!namedViewRoot.value)) {
|
|
384
|
+
const SEP = $faces().separatorchar;
|
|
385
|
+
this.internalContext.assign(NAMED_VIEWROOT).value = (!!document.getElementById(partialId.value)) || DQ$(`input[name*='${$nsp(P_VIEWSTATE)}']`)
|
|
386
|
+
.filter(node => node.attr("name").value.indexOf(partialId.value + SEP) == 0).length > 0;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
361
390
|
/**
|
|
362
391
|
* all processing done we can close the request and send the appropriate events
|
|
363
392
|
*/
|
|
364
393
|
done() {
|
|
365
|
-
|
|
394
|
+
const eventData = EventData.createFromRequest(this.request.value, this.externalContext, SUCCESS);
|
|
366
395
|
|
|
367
396
|
//because some frameworks might decorate them over the context in the response
|
|
368
|
-
|
|
397
|
+
const eventHandler = this.externalContext.getIf(ON_EVENT).orElseLazy(() => this.internalContext.getIf(ON_EVENT).value).orElse(EMPTY_FUNC).value;
|
|
369
398
|
Implementation.sendEvent(eventData, eventHandler);
|
|
370
399
|
}
|
|
371
400
|
|
|
372
401
|
/**
|
|
373
|
-
* proper
|
|
402
|
+
* proper viewState -> form assignment
|
|
374
403
|
*
|
|
375
|
-
* @param forms the forms to append the
|
|
376
|
-
* @param viewState the final
|
|
404
|
+
* @param forms the forms to append the viewState to
|
|
405
|
+
* @param viewState the final viewState
|
|
406
|
+
* @param namingContainerId
|
|
377
407
|
*/
|
|
378
|
-
private appendViewStateToForms(forms: DQ, viewState: string) {
|
|
379
|
-
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), viewState);
|
|
408
|
+
private appendViewStateToForms(forms: DQ, namedViewRoot: boolean, viewState: string, namingContainerId = "") {
|
|
409
|
+
this.assignState(forms, $nsp(SEL_VIEWSTATE_ELEM), namedViewRoot, viewState, namingContainerId);
|
|
380
410
|
}
|
|
381
411
|
|
|
382
412
|
|
|
383
413
|
/**
|
|
384
|
-
* proper
|
|
414
|
+
* proper clientWindow -> form assignment
|
|
385
415
|
*
|
|
386
|
-
* @param forms the forms to append the
|
|
387
|
-
* @param clientWindow the final
|
|
416
|
+
* @param forms the forms to append the viewState to
|
|
417
|
+
* @param clientWindow the final viewState
|
|
418
|
+
* @param namingContainerId
|
|
388
419
|
*/
|
|
389
|
-
private appendClientWindowToForms(forms: DQ, clientWindow: string) {
|
|
390
|
-
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), clientWindow);
|
|
420
|
+
private appendClientWindowToForms(forms: DQ, namedViewRoot: boolean, clientWindow: string, namingContainerId = "") {
|
|
421
|
+
this.assignState(forms, $nsp(SEL_CLIENT_WINDOW_ELEM), namedViewRoot, clientWindow, namingContainerId);
|
|
391
422
|
}
|
|
392
423
|
|
|
393
424
|
/**
|
|
@@ -395,44 +426,45 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
395
426
|
*
|
|
396
427
|
* @param forms the forms to append or change to
|
|
397
428
|
* @param selector the selector for the state
|
|
429
|
+
* @param namedViewRoot if set to true, the name is also prefixed
|
|
398
430
|
* @param state the state itself which needs to be assigned
|
|
399
431
|
*
|
|
432
|
+
* @param namingContainerId
|
|
400
433
|
* @private
|
|
401
434
|
*/
|
|
402
|
-
private assignState(forms: DQ,
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
435
|
+
private assignState(forms: DQ, selector: string, namedViewRoot: boolean, state: string, namingContainerId: string) {
|
|
436
|
+
/**
|
|
437
|
+
* creates the viewState or client window id element
|
|
438
|
+
* @param form
|
|
439
|
+
*/
|
|
440
|
+
const createAndAppendHiddenInput = (form: DomQuery) => {
|
|
441
|
+
return new HiddenInputBuilder(selector)
|
|
442
|
+
.withNamingContainerId(namingContainerId)
|
|
443
|
+
.withParent(form)
|
|
444
|
+
.withNamedViewRoot(namedViewRoot)
|
|
445
|
+
.build();
|
|
446
|
+
};
|
|
447
|
+
|
|
448
|
+
forms.each(form => {
|
|
449
|
+
const hiddenInput = form.querySelectorAll(selector)
|
|
450
|
+
.orElseLazy(() => createAndAppendHiddenInput(form));
|
|
451
|
+
hiddenInput.val = state;
|
|
408
452
|
});
|
|
409
453
|
}
|
|
410
454
|
|
|
411
455
|
/**
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* @param parent, the parent node to attach the viewstate element to
|
|
415
|
-
* (usually a form node)
|
|
416
|
-
*/
|
|
417
|
-
private static newViewStateElement(parent: DQ): DQ {
|
|
418
|
-
let newViewState = DQ.fromMarkup($nsp(HTML_VIEWSTATE));
|
|
419
|
-
newViewState.appendTo(parent);
|
|
420
|
-
return newViewState;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* Stores certain aspects of the dom for later post processing
|
|
456
|
+
* Stores certain aspects of the dom for later post-processing
|
|
425
457
|
*
|
|
426
458
|
* @param updateForms the update forms which should receive standardized internal jsf data
|
|
427
|
-
* @param
|
|
459
|
+
* @param toBeEvaluated the resulting elements which should be evaluated
|
|
428
460
|
*/
|
|
429
|
-
private storeForPostProcessing(updateForms: DQ,
|
|
461
|
+
private storeForPostProcessing(updateForms: DQ, toBeEvaluated: DQ) {
|
|
430
462
|
this.storeForUpdate(updateForms);
|
|
431
|
-
this.storeForEval(
|
|
463
|
+
this.storeForEval(toBeEvaluated);
|
|
432
464
|
}
|
|
433
465
|
|
|
434
466
|
/**
|
|
435
|
-
* helper to store a given form for the update post
|
|
467
|
+
* helper to store a given form for the update post-processing (viewState)
|
|
436
468
|
*
|
|
437
469
|
* @param updateForms the dom query object pointing to the forms which need to be updated
|
|
438
470
|
*/
|
|
@@ -443,28 +475,23 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
443
475
|
/**
|
|
444
476
|
* same for eval (js and css)
|
|
445
477
|
*
|
|
446
|
-
* @param
|
|
478
|
+
* @param toBeEvaluated
|
|
447
479
|
*/
|
|
448
|
-
private storeForEval(
|
|
449
|
-
this.internalContext.assign(UPDATE_ELEMS).value.push(
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// head eval is always sticky
|
|
453
|
-
private storeForHeadEval(toBeEvaled: DQ, sticky) {
|
|
454
|
-
this.internalContext.assign(DEFERRED_HEAD_INSERTS).value.push(toBeEvaled);
|
|
480
|
+
private storeForEval(toBeEvaluated: DQ) {
|
|
481
|
+
this.internalContext.assign(UPDATE_ELEMS).value.push(toBeEvaluated);
|
|
455
482
|
}
|
|
456
483
|
|
|
457
484
|
/**
|
|
458
|
-
* check whether a given XMLQuery node is an explicit
|
|
485
|
+
* check whether a given XMLQuery node is an explicit viewState node
|
|
459
486
|
*
|
|
460
487
|
* @param node the node to check
|
|
461
|
-
* @returns
|
|
488
|
+
* @returns if it is a viewState node
|
|
462
489
|
*/
|
|
463
490
|
private static isViewStateNode(node: XMLQuery): boolean {
|
|
464
|
-
|
|
491
|
+
const SEP = $faces().separatorchar;
|
|
465
492
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_VIEWSTATE) ||
|
|
466
|
-
node?.id?.value?.indexOf([
|
|
467
|
-
node?.id?.value?.indexOf([$nsp(P_VIEWSTATE),
|
|
493
|
+
node?.id?.value?.indexOf([SEP, $nsp(P_VIEWSTATE)].join(EMPTY_STR)) != -1 ||
|
|
494
|
+
node?.id?.value?.indexOf([$nsp(P_VIEWSTATE), SEP].join(EMPTY_STR)) != -1);
|
|
468
495
|
}
|
|
469
496
|
|
|
470
497
|
/**
|
|
@@ -474,15 +501,59 @@ export class ResponseProcessor implements IResponseProcessor {
|
|
|
474
501
|
* @returns true of it ii
|
|
475
502
|
*/
|
|
476
503
|
private static isClientWindowNode(node: XMLQuery): boolean {
|
|
477
|
-
|
|
504
|
+
const SEP = $faces().separatorchar;
|
|
478
505
|
return "undefined" != typeof node?.id?.value && (node?.id?.value == $nsp(P_CLIENT_WINDOW) ||
|
|
479
|
-
node?.id?.value?.indexOf([
|
|
480
|
-
node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW),
|
|
506
|
+
node?.id?.value?.indexOf([SEP, $nsp(P_CLIENT_WINDOW)].join(EMPTY_STR)) != -1 ||
|
|
507
|
+
node?.id?.value?.indexOf([$nsp(P_CLIENT_WINDOW), SEP].join(EMPTY_STR)) != -1);
|
|
481
508
|
}
|
|
482
509
|
|
|
483
510
|
private triggerOnError(errorData: ErrorData) {
|
|
484
|
-
this.externalContext.getIf(ON_ERROR).
|
|
511
|
+
this.externalContext.getIf(ON_ERROR).orElseLazy(() => this.internalContext.getIf(ON_ERROR).value).orElse(EMPTY_FUNC).value(errorData);
|
|
485
512
|
}
|
|
486
513
|
|
|
514
|
+
/**
|
|
515
|
+
* filters the forms according to being member of the "execute" or "render" cycle
|
|
516
|
+
* @param affectedForm
|
|
517
|
+
* @private
|
|
518
|
+
*/
|
|
519
|
+
private isInExecuteOrRender(affectedForm) {
|
|
520
|
+
const executes = this.externalContext.getIf($nsp(P_EXECUTE)).orElse("@none").value.split(/\s+/gi);
|
|
521
|
+
const renders = this.externalContext.getIf(P_RENDER_OVERRIDE)
|
|
522
|
+
.orElseLazy(() => this.externalContext.getIf($nsp(P_RENDER)).value)
|
|
523
|
+
.orElse(IDENT_NONE).value.split(/\s+/gi);
|
|
524
|
+
const executeAndRenders = executes.concat(...renders);
|
|
525
|
+
return LazyStream.of(...executeAndRenders).filter(nameOrId => {
|
|
526
|
+
if ([IDENT_ALL, IDENT_NONE].indexOf(nameOrId) != -1) {
|
|
527
|
+
return true;
|
|
528
|
+
}
|
|
487
529
|
|
|
530
|
+
const NAME_OR_ID = this.getNameOrIdSelector(nameOrId);
|
|
531
|
+
//either the form directly is in execute or render or one of its children or one of its parents
|
|
532
|
+
return affectedForm.matchesSelector(NAME_OR_ID) ||
|
|
533
|
+
affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
|
|
534
|
+
affectedForm.firstParent(NAME_OR_ID).isPresent();
|
|
535
|
+
}).first().isPresent();
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* gets all forms under a single naming container id
|
|
540
|
+
* @param namingContainerId
|
|
541
|
+
* @private
|
|
542
|
+
*/
|
|
543
|
+
private getContainerForms(namingContainerId: Config) {
|
|
544
|
+
if (namingContainerId.isPresent()) {
|
|
545
|
+
//naming container mode, all forms under naming container id must be processed
|
|
546
|
+
return DQ$(this.getNameOrIdSelector(namingContainerId.value))
|
|
547
|
+
// missing condition if the naming container is not present we have to
|
|
548
|
+
// use the body as fallback
|
|
549
|
+
.orElseLazy(() => DQ.byTagName(HTML_TAG_BODY))
|
|
550
|
+
.byTagName(HTML_TAG_FORM, true);
|
|
551
|
+
} else {
|
|
552
|
+
return DQ.byTagName(HTML_TAG_FORM);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
private getNameOrIdSelector(nameOrId) {
|
|
557
|
+
return `[id='${nameOrId}'], [name='${nameOrId}']`;
|
|
558
|
+
}
|
|
488
559
|
}
|