-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
50 lines (44 loc) · 1.65 KB
/
test.html
File metadata and controls
50 lines (44 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document Editor</title>
<link rel="stylesheet" href="https://unpkg.com/legalesign-document-viewer/ls-document-viewer.css" />
<script type="module" src="https://unpkg.com/legalesign-document-viewer"></script>
</head>
<body style="padding: 0; margin: 0">
<ls-document-viewer
id="my-editor"
templateid="<YOUR_LEGALESIGN_TEMPLATE_ID_HERE>"
token="<YOUR_LEGALESIGN_JWT_TOKEN_HERE>"
mode="compose"
recipients='[{"email": "alice@smashtest.com", "firstName": "Alice", "lastName": "Test", "signerIndex": 1}, {"email": "bob@smashtest.com", "firstName": "Bob", "lastName": "Test", "signerIndex": 2}]'
filtertoolbox="signature|initials|date"
>
<span slot="left-button">
<button onclick="handleCancel()">Cancel</button>
</span>
<span slot="right-button">
<button onclick="handleSend()">Send</button>
</span>
</ls-document-viewer>
<script>
const editor = document.querySelector('ls-document-viewer');
editor.addEventListener('update', (event) => {
console.log('Document updated:', event.detail);
});
editor.addEventListener('validate', (event) => {
console.log('Document validation:', event.detail);
});
function handleCancel() {
// Implement the cancel logic, e.g. go to a home page
console.log('Cancelled...');
}
function handleSend() {
// Implement send logic if required.
console.log('Redirect...');
}
</script>
</body>
</html>