now the readmill script works on the lightbox too

pull/1/head
Andromeda Yelton 2012-09-19 12:08:27 -04:00
parent efa3187535
commit 5419c869ed
4 changed files with 13 additions and 12 deletions

View File

@ -6,7 +6,7 @@
{% endblock %}
{% block extra_js %}
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/readmill.js"></script>
{% endblock %}
{% block content %}
@ -61,16 +61,8 @@
<h4>Readmill users</h4>
<p>If you're a <a href="http://readmill.com/">Readmill</a> member, you can send unglued ebooks to your iPad with one click. Here you go:</p>
<div class="send-to-readmill" data-download-url="{{ unglued_epub_url }}"; data-buy-url="{{ base_url }}{% url work work.id %}"; data-display="small" ></div>
<div class="send-to-readmill" data-download-url="{{ unglued_epub_url }}"; data-buy-url="{{ base_url }}{% url work work.id %}"; data-display="small" onload="/static/js/readmill.js"></div>
<script type="text/javascript">
(function() {
var st = document.createElement('script'); st.type = 'text/javascript'; st.async = true;
st.src = 'https://platform.readmill.com/send.js';
var p = document.getElementsByTagName('script')[0]; p.parentNode.insertBefore(st, p);
})();
</script>
<h4>Android devices</h4>
<p class="ebook_download logo"><img src="/static/images/aldiko_logo.png">Aldiko</p>

View File

@ -7,14 +7,14 @@
<link type="text/css" rel="stylesheet" href="/static/css/campaign.css" />
{% endblock %}
{% block base_js %}
<script type="text/javascript" src="{{ jquery_home }}"></script>
{% block extra_js %}
<script type="text/javascript" src="{{ jquery_ui_home }}"></script>
<script type="text/javascript" src="/static/js/wishlist.js"></script>
<script type="text/javascript" src="/static/js/tabs4.js"></script>
<script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
<script type="text/javascript" src="/static/js/counter.js"></script>
<script type="text/javascript" src="/static/js/embed.js"></script>
<script type="text/javascript" src="/static/js/readmill.js"></script>
<script>
var $j = jQuery.noConflict();

View File

@ -8,6 +8,10 @@ $j(document).ready(function() {
event.preventDefault();
$j("#lightbox").load( $j(this).attr("href") + " #lightbox_content");
if ($j(this).attr("href").substr(-9,8) == "download") {
jQuery.getScript('/static/js/readmill.js');
}
// fade-out rest of page elements on expand
$j('#js-topsection').css({"opacity": "0.07"});
$j('.launch_top').css({"opacity": "0.07"});

5
static/js/readmill.js Normal file
View File

@ -0,0 +1,5 @@
(function() {
var st = document.createElement('script'); st.type = 'text/javascript'; st.async = true;
st.src = 'https://platform.readmill.com/send.js';
var p = document.getElementsByTagName('script')[0]; p.parentNode.insertBefore(st, p);
})();