Skip to content

Instantly share code, notes, and snippets.

@rtekie
rtekie / janrain500.js
Created August 29, 2012 22:25
LoyaltyPlus Janrain Backplane integration
function janrainWidgetOnload(){
_ffLoyalty.initialize("YOUR_ACCOUNT_ID");
_ffLoyalty.initializeBackplane("500friends");
_ffLoyalty.backplaneJanrainIntegration();
}
@rtekie
rtekie / member_page_janrain.html
Created August 29, 2012 22:22
LoyaltyPlus Member Page with Janrain Backplane integration
<script src="https://d3aa0ztdn3oibi.cloudfront.net/javascripts/ff.loyalty.widget.js" type="text/javascript"></script>
<iframe id="ff_member_iframe" style="width:760px;height:1045px;border:0" frameBorder="0"></iframe>
<script type="text/javascript">
_ffLoyalty.initialize( "YOUR_ACCOUNT_ID" );
_ffLoyalty.initializeBackplane("500friends");
_ffLoyalty.loadBackplaneIframe({ email: 'CUSTOMER_EMAIL', auto_resize: true });
</script>
@rtekie
rtekie / bv500iFrame.html
Created August 29, 2012 21:47
LoyaltyPlus Bazaarvoice iFrame integration
<script src="https://d3aa0ztdn3oibi.cloudfront.net/javascripts/ff.loyalty.widget.js" type="text/javascript">
<script type="text/javascript">
_ffLoyalty.initialize("YOUR_ACCOUNT_ID");
function BVAnalytics(json) {
if (json.pageType = "Preview") {
_ffLoyalty.setUserEmail();
}
if (json.pageStatus == "REVIEW_THANKYOU" && json.eventSource == "Display") {
_ffLoyalty.submitReview(json.productId, {});
p.center {
text-align: center;
}
img.center {
display: block;
margin-left: auto;
margin-right: auto;
}
#delurl fieldset {
text-align: center;
<!DOCTYPE html>
<html>
<head>
<title>Share QR</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<link rel="stylesheet" href="shareqr3.3.css" />
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
<script src="shareqr3.3.js"></script>
// When a url is deleted, remove it from the local storage and display the home page.
$("#delurl").live("submit" , function(e, data) {
var url = $("#url_value").val();
delUrl(url);
$.mobile.changePage("#home");
return false;
});
// Delete URL from the list.
function delUrl(url) {
// Listen for any attempts to call changePage().
$(document).bind( "pagebeforechange", function(e, data) {
// We only want to handle changePage() calls where the caller is
// asking us to load a page by URL.
if (typeof data.toPage === "string") {
// We only want to handle a subset of URLs.
var u = $.mobile.path.parseUrl(data.toPage);
var home = /^#home/;
var qrcode = /^#qrcode/;
var delurl = /^#delurl/;
<div data-role="page" id="delurl">
<div data-role="header" data-theme="b" data-position="fixed">
<h1>Delete URL?</h1>
</div>
<div data-role="content">
<p class="center" id="url_prompt">url</p>
<form action="#home" method="POST" name="delurl" id="delurl">
<div data-role="fieldcontain">
<input type="hidden" name="url_value" id="url_value" value="url" />
<fieldset class="ui-grid-a">
// Build the list of urls.
var markup = "<ul data-role='listview' data-split-icon='delete'>";
for (var i=0; i<myUrls.length; i++) {
markup = markup + "<li><a href='#qrcode?url=" + myUrls[i] + "'>" + getHostname(myUrls[i]) + "</a>" + "<a href='#delurl?url=" + myUrls[i] + "' data-rel='dialog'>Delete</a></li>";
}
markup = markup + "</ul>";
// When a new url is added, save it in the local storage and display the home page.
$("#addurl").live("submit" , function(e, data) {
var url = $("#url").val();
addUrl(url);
$.mobile.changePage("#home");
return false;
});
// Add a URL to the list.
function addUrl(url) {