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> | |
window.hq.postDialog = function(form){ | |
var params = hq.serialize(form); | |
var center = hq.initDialog(); | |
window.hq.post(form.action, center, params); | |
}; | |
// General post ajax method | |
window.hq.post = function(url, el, params){ | |
if(!el){ el = document.getElementById('content');} | |
hq.ajax(url, { |
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> | |
window.hq.postDialog = function(form){ | |
var params = hq.serialize(form); | |
var center = hq.initDialog(); | |
window.hq.post(form.action, center, params); | |
}; | |
// General post ajax method | |
window.hq.post = function(url, el, params){ | |
if(!el){ el = document.getElementById('content');} | |
hq.ajax(url, { |
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
<div class="normal"> | |
<h3>Normal content</h3> | |
<p>This is what the user normally sees</p> | |
<a href="/test/liquid#invite">Invite</a> | |
</div> | |
<div class="invite" style="display:none"> | |
<h3>Invite form</h3> | |
<p>The invite page</p> | |
<a href="/test/liquid#">Back</a> |
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
<!-- This is an example on how to update contributions with jQuery from within your site --> | |
<p>The API says:</p> | |
<div id="response"></div> | |
<div id="error"></div> | |
<script> | |
document.addEventListener('DOMContentLoaded', function() { | |
var response = document.getElementById('response') |
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
{% if current_user %} | |
{% assign contributed = campaign.contributions | where: user_id: current_user.id | first %} | |
{% if contributed %} | |
Already contributed! | |
<script> | |
// Redirect back | |
window.location = '{{ request.referer }}' | |
</script> | |
{% else %} | |
Not contributed. |
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
{% Options for the option_list filter %} | |
<!-- Default, no options --> | |
{{ settings.countries | option_list }} | |
<!-- With empty prompt --> | |
{{ settings.countries | option_list: prompt: true }} | |
<!-- With selected --> | |
{{ settings.countries | option_list: selected: 'BR' }} |
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
{% comment %} Search by custom field {% endcomment %} | |
{% assign campaigns = current_site.campaigns | where: 'custom_fields.phone', '555-1234' | all %} |
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> | |
// Add this to the bottom of the contribution/new liquid template | |
var inputs = document.querySelectorAll('#selectable input'); | |
var amount = document.querySelector('#contribution_amount'); | |
// Sets the amount to be the same as the reward you chose | |
var select = function (event) { | |
var input = event.target; | |
var value = input.getAttribute('data-amount'); | |
if (value) { |
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> | |
document.addEventListener('DOMContentLoaded', function(){ | |
if(hq.isMobile()) { | |
var campaignContent = document.getElementById('campaign_content'); | |
if(campaignContent) { | |
var campaignSidebar = document.getElementById('campaign_sidebar'); | |
var stats = document.getElementById('stats'); | |
campaignSidebar.insertBefore(campaignContent, stats); | |
campaignContent.style.marginBottom = '2em'; | |
} |
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
<!-- How to set up the Froala editor (https://froala.com) on CrowdfundHQ (https://crowdfundhq.com) if it's not working --> | |
<!-- First go to Manage Site > Configuration > Settings > General and make sure Text Editor is set to Froala --> | |
<!-- Froala requires FontAwesome (http://fontawesome.io) and jQuery (https://jquery.com), install them if you don't have them already --> | |
<!-- Include jQuery by pasting the following line into Manage Site > Design > Scripts --> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<!-- Include FontAwesome by pasting the following line into Manage Site > Design > Libraries --> |
NewerOlder