Load our paddle.js if their CDN doesn't work

This commit is contained in:
Son NK 2020-01-10 18:36:31 +01:00
parent 75ccc337a9
commit 47bf6646fc
1 changed files with 8 additions and 1 deletions

View File

@ -7,6 +7,14 @@
{% endblock %}
{% block head %}
<script src="https://cdn.paddle.com/paddle/paddle.js"></script>
<script>
if (window.Paddle === undefined) {
console.log("cannot load Paddle from CDN");
document.write('<script src="/static/vendor/paddle.js"><\/script>')
}
</script>
{% endblock %}
{% block default_content %}
@ -66,7 +74,6 @@
</div>
</div>
<script src="https://cdn.paddle.com/paddle/paddle.js"></script>
<script type="text/javascript">
Paddle.Setup({vendor: {{ PADDLE_VENDOR_ID }}});