Last active
December 11, 2015 02:59
-
-
Save frightenedmonkey/4534375 to your computer and use it in GitHub Desktop.
Simple Fan Converter Implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script | |
type="text/html" id="myTemplate"> | |
<div id="wetpaint-fan-converter"> | |
<div class="wrapper"> | |
<div class="cta">{{{fb}}}</div> | |
<div class="content"> | |
<div class="primary-message">Welcome to my world.</div> | |
<ul> | |
<li><a id="fc-no-thanks">No Thanks</a></li> | |
<li><a id="fc-already-like">Already Like</a></li> | |
<li><a id="fc-close">Close</a></li> | |
</ul> | |
</div> | |
</div> | |
</div> | |
</script> | |
<script> | |
window.WetpaintLoaded = function () { | |
var fanConverter = new window.Wetpaint.FanConverter.App ({ | |
accountId: 1, | |
el: $('#important'), | |
socialUrls: ['http://www.facebook.com/Wetpaint'], | |
debug: true, | |
template: { | |
jsTemplate: $('#myTemplate').html(), | |
afterRender: function (viewObj) { | |
$('#fc-no-thanks').on('click', function (e) { | |
viewObj.noThanks(); | |
}); | |
$('#fc-already-like').on('click', function (e) { | |
viewObj.alreadyLike(); | |
}); | |
$('#fc-close').on('click', function (e) { | |
viewObj.close(); | |
}); | |
}, | |
} | |
}); | |
}; | |
</script> | |
<script> | |
(function () { | |
var script, scriptTag; | |
script = document.createElement('script'); | |
script.src = | |
'http://fanconverter.wetpaint.me/1.1/application-fanconverter.js'; | |
scriptTag = document.getElementsByTagName('script')[0]; | |
scriptTag.parentNode.insertBefore(script, | |
scriptTag); | |
}()); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment