From be9ade19fca4a3ffc2c91b35f90b87526b8dc993 Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Fri, 16 May 2014 12:05:41 -0400 Subject: [PATCH] Don't assume jQuery in embeds. Closes #127. --- snipts/templates/snipts/embed.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snipts/templates/snipts/embed.html b/snipts/templates/snipts/embed.html index c24116d..982a685 100644 --- a/snipts/templates/snipts/embed.html +++ b/snipts/templates/snipts/embed.html @@ -1,3 +1,2 @@ -{% if 'snipt' in request.GET %}$(function() { - $('div#snipt-embed-{{ snipt.key }}').html('
{% for line in lines %}{{ line|safe }}\n{% endfor %}
'); -});{% else %}document.open();document.writeln('
');{% for line in lines %}document.writeln('{{ line|safe }}');{% endfor %}document.writeln('');document.writeln('
');document.close();{% endif %} +{% if 'snipt' in request.GET %}document.addEventListener('DOMContentLoaded', function() { document.getElementById('snipt-embed-{{ snipt.key }}').innerHTML = '
{% for line in lines %}{{ line|safe }}\n{% endfor %}
'; }); +{% else %}document.open();document.writeln('
');{% for line in lines %}document.writeln('{{ line|safe }}');{% endfor %}document.writeln('');document.writeln('
');document.close();{% endif %}