Skip to content

Commit

Permalink
Add appeal for Stumptown Syndicate year-end matching campaign
Browse files Browse the repository at this point in the history
  • Loading branch information
reidab committed Dec 30, 2014
1 parent da85c2c commit aa6429a
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions app/views/site/index.html.erb
Expand Up @@ -37,4 +37,75 @@
<h3><%= link_to("View future events &raquo;".html_safe, events_path(:anchor => "event-#{@overview.more.id}")) if @overview.more %></h3>
</div>
</div>

<style>
#matching {
position: relative;
padding: 1em;
background: #EAF9FE;
border: 1px solid #5EB8FF;
}

#matching a {
color: #5EB8FF;
}

#matching .close_link {
float: right;
}

#matching .thermometer {
float: right;
margin-left: 1em;
}
</style>
<script type="text/javascript">
function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}

$(function() {
var hideCookieName = "hideMatchingAppeal";
var wasHidden = readCookie(hideCookieName) == 1;
var endTime = Date.parse("2014-12-31T05:30:00-08:00");

if(!wasHidden && endTime > Date.now()) {
var matching_div = $("<div id='matching'><h3>A Brief Appeal</h3></div>");
var close_link = $("<a class='close_link' href='#' title='Hide'>x</a>");
var appeal_text = "<p>Calagator is hosted and supported by <strong><a href='http://stumptownsyndicate.org'>Stumptown Syndicate</a></strong>, the Portland nonprofit that stewards <a href='http://opensourcebridge.org'>Open Source Bridge</a>, <a href='http://barcampportland.org'>BarCamp Portland</a>, <a href='http://igniteportland.org'>Ignite Portland</a>, and <a href='http://wherecamppdx.org'>WhereCampPDX</a>. They've been <a href='http://stumptownsyndicate.org/2014/12/18/please-match-this-15000-donation-by-december-29th/'>offered a donation of up to <strong>$15,000</strong></a> — matching funds raised by the community by <strong>1:30pm on December 31</strong>.</p><p>If you find Calagator useful, or if you've enjoyed their programs over the years, <strong>please <a href='https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RC8MN7P54KEPY'>donate</a> to help reach this goal</strong>.</p>";
var thermometer_image = '<a href="http://stumptownsyndicate.org/2014/12/18/please-match-this-15000-donation-by-december-29th/"><img class="thermometer" src="http://stumptownsyndicate.org/wp-content/plugins/olimometer/thermometer.php?olimometer_id=1" border="0"></a>';

close_link.click(function(e) {
matching_div.hide();
createCookie(hideCookieName, "1", 999);
});

matching_div.prepend(close_link);
matching_div.append(thermometer_image);
matching_div.append(appeal_text);
matching_div.prependTo($("#whats_happening"));
}
});
</script>
<% end %>

0 comments on commit aa6429a

Please sign in to comment.