Skip to content

Commit

Permalink
rename widget identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Apr 29, 2021
1 parent 6393313 commit c0c9a09
Show file tree
Hide file tree
Showing 7 changed files with 4,681 additions and 14,954 deletions.
2 changes: 1 addition & 1 deletion dist/tonicpow.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/widget.js

Large diffs are not rendered by default.

32 changes: 30 additions & 2 deletions examples/basic/basic-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@
<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;
Expand All @@ -28,8 +50,14 @@ <h3 class="title">Normal Widget (300 x 250)</h3>
</div>

<div class="example">
<h3 class="title">Invalid Widget ID</h3>
<div class="tonicpow-widget" data-widget-id="invalid-id"></div>
<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>
Loading

0 comments on commit c0c9a09

Please sign in to comment.