-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbasic-example.html
63 lines (58 loc) · 1.63 KB
/
basic-example.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<title>Example - TonicPow Widget</title>
<meta name="bitcoin-address" content="1DnLAqoznKsXkJ1xJrVyr29JSKmfwxC4x5" />
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico" />
<script src="../../dist/tonicpow.js"></script>
<script>
function successCallback(data) {
// data.buttonId === "myButton"
// data.shortLinkUrl === "https://tpow.app/whateva"
console.log('SUCCESS', data)
}
function errorCallback(data) {
// data.buttonId === "myButton"
// data.message === "omg so bad"
console.log('ERROR', data)
}
TonicPow.shareButton('myButton', {
onSuccess: successCallback,
onError: errorCallback,
backgroundColor: 'blue',
height: 400,
})
</script>
<style type="text/css">
.example {
padding: 15px;
}
.title {
margin-bottom: 10px;
}
html {
font-family: Arial, Tahoma, serif;
}
</style>
</head>
<body>
<div class="example">
<h3 class="title">Normal Widget (300 x 250)</h3>
<div
class="tonicpow-widget"
data-environment="staging"
data-widget-id="ff83a7a74a6895f7929bfa1c185ac0a0f5d38e8e071ed3bcc008d8d15b6a6727"
></div>
</div>
<div class="example">
<h3 class="title">Share Button</h3>
<div
class="tonicpow-widget"
data-environment="staging"
data-widget-type="share-button"
data-target-url="https://google.com"
data-button-id="someUniqueString"
></div>
</div>
</body>
</html>