houdini/app/views/nonprofits/button/_include_snippet.html.erb

16 lines
574 B
Text
Raw Normal View History

<%- # License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later -%>
<textarea readonly class='codeText' rows='12'>
<script>
(function() {
if(document.getElementById('commitchange-script')) return;
var npo = <%= @nonprofit.id %>;
var script = document.createElement('script');
var first = document.getElementsByTagName('script')[0];
script.setAttribute('data-npo-id', npo);
script.id = 'commitchange-script';
script.src = '<%= request.base_url %>/js/donate-button.v2.js';
first.parentNode.insertBefore(script, first);
})();
</script>
</textarea>