Skip to content

Instantly share code, notes, and snippets.

CrowdfundHQ crowdfundhq

Block or report user

Report or block crowdfundhq

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View redirect_with_parser.html
<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, {
View customize_redirects.html
<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, {
@crowdfundhq
crowdfundhq / hash_page_in_url.html
Last active Oct 7, 2018
Add page to CrowdfundHQ using hash in URL
View hash_page_in_url.html
<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>
View api_update_contribution_jquery.html
<!-- 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')
View redirect_if_already_contributed.liquid
{% 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.
View country_select_options.liquid
{% 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' }}
View advanced_search_liquid.liquid
{% comment %} Search by custom field {% endcomment %}
{% assign campaigns = current_site.campaigns | where: 'custom_fields.phone', '555-1234' | all %}
View set_contribution_reward_amount.html
<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) {
View about_to_top_mobile.html
<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';
}
@crowdfundhq
crowdfundhq / setup_froala_editor.html
Last active Nov 9, 2016
How to set up the Froala editor on existing CrowdfundHQ sites
View setup_froala_editor.html
<!-- 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 -->
You can’t perform that action at this time.