Skip to content

Commit abc7e62

Browse files
scribble new changes
1 parent df6cd87 commit abc7e62

File tree

20 files changed

+443
-540
lines changed

20 files changed

+443
-540
lines changed

bundles/af-core/src/main/java/com/adobe/cq/forms/core/components/internal/models/v1/form/ScribbleImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ public class ScribbleImpl extends AbstractFieldImpl implements Scribble {
4545
public String getValue() {
4646
return value;
4747
}
48-
48+
4949
}

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/scribble/v1/scribble/_cq_dialog/.content.xml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<content
2929
granite:class="cmp-adaptiveform-scribble__editdialog"
3030
jcr:primaryType="nt:unstructured"
31+
jcr:title="Adaptive Form Scribble"
3132
sling:resourceType="granite/ui/components/coral/foundation/container">
3233
<items jcr:primaryType="nt:unstructured">
3334
<tabs
@@ -49,38 +50,12 @@
4950
jcr:primaryType="nt:unstructured"
5051
sling:resourceType="granite/ui/components/coral/foundation/container">
5152
<items jcr:primaryType="nt:unstructured">
52-
<label
53+
<readonly
5354
jcr:primaryType="nt:unstructured"
54-
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
55-
fieldLabel="Label"
56-
name="./jcr:title"/>
57-
<name
55+
sling:hideResource="{Boolean}true" />
56+
<placeholder
5857
jcr:primaryType="nt:unstructured"
59-
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
60-
fieldLabel="Name"
61-
name="./name"/>
62-
<description
63-
jcr:primaryType="nt:unstructured"
64-
sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
65-
fieldLabel="Description"
66-
name="./description"/>
67-
<required
68-
jcr:primaryType="nt:unstructured"
69-
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
70-
fieldLabel="Required"
71-
name="./required"
72-
value="{Boolean}true"/>
73-
<requiredMessage
74-
jcr:primaryType="nt:unstructured"
75-
sling:resourceType="granite/ui/components/coral/foundation/form/textarea"
76-
fieldLabel="Required Message"
77-
name="./requiredMessage"/>
78-
<readOnly
79-
jcr:primaryType="nt:unstructured"
80-
sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
81-
fieldLabel="Read Only"
82-
name="./readOnly"
83-
value="{Boolean}true"/>
58+
sling:hideResource="{Boolean}true" />
8459
</items>
8560
</column>
8661
</items>

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/scribble/v1/scribble/_cq_template.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"
33
jcr:primaryType="nt:unstructured"
44
jcr:title="Scribble"
5-
fieldType="scribble"/>
5+
fieldType="text-input"/>

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/scribble/v1/scribble/clientlibs/site/css/scribbleview.css

Lines changed: 49 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ textarea.cmp-adaptiveform-scribble__widget{
4848
.cmp-adaptiveform-scribble__canvas-signed-container {
4949
position: relative;
5050
border: 1px solid #AAAAAA;
51-
height: 210px;
51+
height: 280px;
52+
padding: 10px;
5253
min-width: 50px;
5354
width: 100%;
5455
border-radius: 0.5rem;
@@ -190,7 +191,7 @@ textarea.cmp-adaptiveform-scribble__widget{
190191
}
191192

192193
.cmp-adaptiveform-scribble__control-brush{
193-
background-image:url('../resources/images/iEBox_brush.png');
194+
background-image:url('../resources/images/signIcon.png');
194195
}
195196

196197
.cmp-adaptiveform-scribble__control-submit {
@@ -264,7 +265,7 @@ textarea.cmp-adaptiveform-scribble__widget{
264265
}
265266
}
266267

267-
#iEBox_moveframe{
268+
/* #iEBox_moveframe{
268269
padding:0px;
269270
margin:0px;
270271
border:0px dotted rgba(0,0,0,0.5);
@@ -275,10 +276,8 @@ margin:0px;
275276
-moz-box-shadow: 10px 10px 5px #888888;
276277
-webkit-box-shadow: 10px 10px 5px #888888;
277278
box-shadow: 0px 0px 15px #888888;
278-
279-
/* display:none; */;
280279
position:absolute;
281-
}
280+
} */
282281
.disable_button {
283282
filter: grayscale(100%); /* Apply grayscale effect */
284283
-webkit-filter: grayscale(100%); /* For Safari and older versions of Chrome */
@@ -289,25 +288,23 @@ margin:0px;
289288
opacity: 0.6; /* Optional: Adjust opacity to give a faded look */
290289
pointer-events: none; /* Disable all mouse events */
291290
}
292-
.sc_popUpMenu {
291+
.cmp-adaptiveform-scribble__clear-sign {
293292
position: absolute;
294293
width:20px;
295294
height:20px;
296295
background:no-repeat;
297296
background-size:20px 20px;
298-
background-image:url('../resources/images/iEBox_no.png');
299-
left:2px;
300-
top:2px;
297+
background-image:url('../resources/images/clearSignButton.png');
298+
right: 5px;
299+
top: 5px;
301300
}
302301
.cmp-adaptiveform-scribble__brushlist{
303302
position:absolute;
304303
z-index:99999;
305304
background-color:white;
306-
-moz-box-shadow: 10px 10px 5px #888888;
307-
-webkit-box-shadow: 10px 10px 5px #888888;
308305
box-shadow: 0px 0px 15px #888888;
309-
display:none;
310-
bottom: 60px;
306+
display: none;
307+
left: 45px;
311308
}
312309
.cmp-adaptiveform-scribble__brushlist :hover{
313310
background-color:gray;
@@ -328,24 +325,19 @@ margin:0px;
328325
background-color: #FFFFFF;
329326
padding: 2px;
330327
}
331-
.emptyScribble {
332-
background: url('../resources/images/signature.png') no-repeat;
333-
}
334328

335329
.cmp-adaptiveform-scribble__canvases {
336330
white-space:nowrap;
337331
}
338332

339-
#msgBox_container {
340-
font-family: Arial, sans-serif;
341-
font-size: 12px;
342-
min-width: 50px; /* Dialog will be no smaller than this */
343-
max-width: 600px; /* Dialog will wrap after this width */
333+
.cmp-adaptiveform-scribble__clearsign-container {
334+
font-size: 14px;
335+
padding: 25px;
336+
width: 280px;
337+
height: 148px;
344338
background: #FFF;
345-
border: solid 5px #999;
339+
border: solid 1px #E6E6E6;
346340
color: #000;
347-
-moz-border-radius: 5px;
348-
-webkit-border-radius: 5px;
349341
border-radius: 5px;
350342
position: absolute;
351343
top: 50%;
@@ -354,61 +346,61 @@ margin:0px;
354346
transform: translate(-50%, -50%);
355347
}
356348

357-
#msgBox_title {
349+
.cmp-adaptiveform-scribble__clearsign-title {
358350
font-size: 14px;
359351
font-weight: bold;
360-
text-align: center;
361352
line-height: 1.75em;
362-
color: #666;
363-
background: #CCC top repeat-x;
364-
border: solid 1px #FFF;
365-
border-bottom: solid 1px #999;
353+
color: #000;
366354
cursor: default;
367-
padding: 0em;
355+
padding-bottom: 10px;
368356
margin: 0em;
369357
}
370358

371-
#msgBox_content {
359+
.cmp-adaptiveform-scribble__clearsign-content {
372360
background: 16px 16px no-repeat ;
373361
padding: 1em 1.75em;
374362
margin: 0em;
375363
}
376364

377-
#msgBox_message {
378-
text-align: center;
365+
.cmp-adaptiveform-scribble__clearsign-message {
366+
font-size: 14px;
379367
}
380368

381-
#msgBox_panel {
382-
text-align: center;
369+
.cmp-adaptiveform-scribble__clearsign-panel {
370+
text-align: right;
383371
margin: 1em 0em 0em 1em;
384372
}
385373

386-
#msgBox_prompt {
387-
margin: .5em 0em;
374+
.cmp-adaptiveform-scribble__clearsign-yes{
375+
width: 54px;
376+
height: 24px;
377+
margin: 5px;
378+
font-size: 12px;
379+
font-weight: 700;
380+
border: 1px transparent;
381+
border-radius: 20px;
382+
background-color: #0265DC;
383+
color: white;
388384
}
389385

390-
input#msgBox_Ok,input#msgBox_Yes,input#msgBox_No,input#msgBox_Cancel{
391-
background-color: buttonFace;
392-
padding: 5px 10px;
393-
-webkit-box-shadow: rgba(0,0,0,1) 0 1px 0;
394-
-moz-box-shadow: rgba(0,0,0,1) 0 1px 0;
395-
box-shadow: rgba(0,0,0,1) 0 1px 0;
396-
text-shadow: rgba(0,0,0,.4) 0 1px 0;
397-
color: buttonText;
398-
font-size: 14px;
399-
font-family: Georgia, serif;
400-
text-decoration: none;
401-
vertical-align: middle;
402-
outline:none;
403-
border: 2px outset buttonface;
404-
border-radius: 1rem;
386+
387+
.cmp-adaptiveform-scribble__clearsign-no{
388+
width: 54px;
389+
height: 24px;
390+
font-weight: 700;
391+
font-size: 12px;
392+
margin: 5px;
393+
background-color: #FFF;
394+
border: 2px solid #D5D5D5;
395+
color: #4b4b4b;
396+
border-radius: 20px;
405397
}
406398

407-
input#msgBox_Ok:focus,input#msgBox_Yes:focus,input#msgBox_No:focus,input#msgBox_Cancel:focus{
399+
/* .cmp-adaptiveform-scribble__clearsign-yes:focus,.cmp-adaptiveform-scribble__clearsign-no:focus{
408400
outline:highlight;
409401
}
410402
411-
input#msgBox_Ok:hover,input#msgBox_Yes:hover,input#msgBox_No:hover,input#msgBox_Cancel:hover{
403+
.cmp-adaptiveform-scribble__clearsign-yes:hover,.cmp-adaptiveform-scribble__clearsign-no:hover{
412404
outline:none;
413405
border: 2px outset buttonface;
414-
}
406+
} */

ui.af.apps/src/main/content/jcr_root/apps/core/fd/components/form/scribble/v1/scribble/clientlibs/site/js.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@
1515
###############################################################################
1616

1717
#base=js
18+
GeoLocQuery.js
1819
scribbleview.js
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*******************************************************************************
2+
* Copyright 2024 Adobe
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
******************************************************************************/
16+
17+
if(window.GeoLocationQuery === undefined) {
18+
window.GeoLocationQuery = class GeoLocationQuery {
19+
constructor() {
20+
this._active = false;
21+
}
22+
23+
init(success, failure) {
24+
this._successHandler = success;
25+
this._errorHandler = failure;
26+
this._active = true;
27+
return this;
28+
}
29+
30+
_handleSuccess(data) {
31+
if (this._successHandler) {
32+
this._successHandler(data);
33+
}
34+
}
35+
36+
_handleError(err) {
37+
if (this._errorHandler) {
38+
this._errorHandler(err);
39+
}
40+
}
41+
42+
query() {
43+
const onSuccess = (pos) => {
44+
if (this._active) {
45+
this._handleSuccess(pos);
46+
}
47+
this._active = false;
48+
};
49+
50+
const onError = (err) => {
51+
if (this._active) {
52+
this._handleError(err);
53+
}
54+
this._active = false;
55+
};
56+
57+
navigator.geolocation.getCurrentPosition(onSuccess, onError, { timeout: 10000 });
58+
}
59+
60+
cancel() {
61+
this._active = false;
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)