Skip to content

Instantly share code, notes, and snippets.

@dangerouse
dangerouse / stylesheet.html
Last active September 29, 2015 16:17
Cloudsponge Widget - Stylesheet Override
<!DOCTYPE html>
<html>
<body>
<a class="cs_import">Add from Address Book</a>
<textarea id="contact_list" style="width:450px;height:82px"></textarea>
<script type='text/javascript'>
// Asynchronously include the widget library.
// TODO: replace with your widget script
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
@dangerouse
dangerouse / child.html
Last active September 29, 2015 21:08
Cloudsponge Widget Reference - Launch widget from a cross domain iframe
<!DOCTYPE HTML>
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
var parent_domain = "http://parent_domain.com";
function launchCloudspongeInParent() {
window.parent.postMessage("launch", parent_domain);
return false;
}
@dangerouse
dangerouse / debugging_macro.rb
Created February 8, 2012 03:20
Ruby's macro equivalent
module DebuggingMacro
if AppConfig.logging.debugging_enabled
def debug(msg)
puts msg
end
else
def debug(msg); end
end
@dangerouse
dangerouse / zindex.html
Last active October 1, 2015 07:37
CloudSponge Widget Reference - Override base zIndex
<!DOCTYPE html>
<html>
<body>
<a class="cs_import">Add from Address Book</a>
<textarea id="contact_list" style="width:450px;height:82px"></textarea>
<script type='text/javascript'>
// Asynchronously include the widget library.
// TODO replace YOUR_WIDGET_SCRIPT with your widget script
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
@dangerouse
dangerouse / brandedApplet.html
Last active July 20, 2016 20:13
CloudSponge Widget Reference - Use Branded Applet
<!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>
// extra widget configuration
cloudsponge.init({
@dangerouse
dangerouse / nofloatbox.html
Last active October 1, 2015 11:08
CloudSponge Widget Reference - Inline Display
<!DOCTYPE html>
<html>
<head>
<script>
// Asynchronously include the widget library.
// TODO: replace with your widget script
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
a.async=1;a.src=u;m.parentNode.insertBefore(a,m);
})('//api.cloudsponge.com/widget/YOUR_WIDGET_SCRIPT.js');
@dangerouse
dangerouse / spanish_import.html
Last active October 1, 2015 13:57
CloudSponge Widget Reference - Specifying a language
<!DOCTYPE html>
<html>
<head>
<script>
// Asynchronously include the widget library.
// TODO: replace with your widget script
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
a.async=1;a.src=u;m.parentNode.insertBefore(a,m);
})('//api.cloudsponge.com/widget/YOUR_WIDGET_SCRIPT.js');
@dangerouse
dangerouse / sources.html
Last active December 4, 2018 17:59
CloudSponge Widget Reference - Specify Contact Sources
<!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="https://api.cloudsponge.com/widget/localhost-only.js"></script>
<script>
// extra widget options go here:
@dangerouse
dangerouse / deep.html
Last active June 1, 2022 18:08
Cloudsponge Widget Reference - Deep Links
<!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="https://api.cloudsponge.com/widget/localhost-only.js"></script>
</head>
<body>
@dangerouse
dangerouse / asynch.html
Last active March 8, 2016 22:55
Cloudsponge Widget Reference - Asynchronous Loading
<!DOCTYPE html>
<html>
<body onload="loadHandler()">
<script type='text/javascript'>
// Replace the stylesheet with a valid value.
// basic csPageOptions, this variable can be defined anytime before the
// CloudSponge widget has initialized
window.csPageOptions = {
textarea_id:'contact_list',
};