Skip to content

Instantly share code, notes, and snippets.

@aribeiro
Last active May 3, 2017 17:05
Show Gist options
  • Save aribeiro/fc714322dda12f6e1823ea85355b438a to your computer and use it in GitHub Desktop.
Save aribeiro/fc714322dda12f6e1823ea85355b438a to your computer and use it in GitHub Desktop.
Cloudsponge Widget Reference - The skipContactsDisplay option with beforeDisplayContacts callback
<!DOCTYPE html>
<html>
<head>
<!--·
Include the script anywhere on your page, usually in the head
(don't forget to replace `localhost-only` with your CloudSponge key)
-->
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script>
<script>
// extra widget options go here:
cloudsponge.init({
skipContactsDisplay: true
});
</script>
<head>
<body>
<a class="cloudsponge-launch">Add from Address Book</a>
<!--·
do something with the user's contacts:
This textarea will be populated with all contacts returned by CloudSponge.
-->
<textarea class="cloudsponge-contacts"></textarea>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<!--·
Include the script anywhere on your page, usually in the head
(don't forget to replace `localhost-only` with your own CloudSponge Widget Key)
-->
<script src="//api.cloudsponge.com/widget/localhost-only.js"></script>
<script>
// variable to hold the complete address book returned from api.cloudsponge.com
var complete_address_book;
// extra widget options go here:
cloudsponge.init({
skipContactsDisplay: true,
beforeDisplayContacts:function(contacts, source, owner) {
// do something with the contacts array
complete_address_book = contacts;
}
});
</script>
</head>
<body>
<a class="cloudsponge-launch">Add from Address Book</a>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment