Skip to content

Instantly share code, notes, and snippets.

var m_td = [];
$.each( tabletop.sheets("Members").all(), function(i, member) {
m_td.push('<tr><td>' + member.office + '</td><td>' + member.name + '</td><td>' + member.state + '-' + member.district + '</td><td>' + member.party + '</td><td>' + member.phone + '</td><td><a href=" ' + member.website + ' " '+ member.website +'</a></td><td><a href="'+ member.contactform +'">Contact</a></td></tr>');
console.log(m_td)
})
$(".members_list").html(m_td.join(""))
propublica.views.stickyNav = propublica.View.extend({
cssClass : "sticky_nav",
render : function() {
_.bindAll(this, "stick");
this.jWindow = $(window);
this.jFooter = $("footer");
this.offsetTop = this.el.offset().top;
this.elHeight = this.el.height();
this.jWindow.scroll(this.stick);
<html>
<head>
<link rel="stylesheet" href="//s3.amazonaws.com/cdn.propublica.net/deploy/css/reset.css?1347485481" type="text/css" media="all" charset="utf-8" />
<link rel="stylesheet" href="//www.propublica.org/css/headfoot2011.css?2012101501" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="//s3.amazonaws.com/cdn.propublica.net/deploy/css/propublica-text.css?1347485481" type="text/css" media="all" charset="utf-8" />
<link rel="stylesheet" href="//s3.amazonaws.com/cdn.propublica.net/deploy/css/print.css?1347485481" type="text/css" media="print" charset="utf-8" />
<script type="text/javascript" src="//www.propublica.org/js/public/assets/typekit.js?1349797800"></script>
<script type="text/javascript" src="http://pixel.propublica.org/pixel.js" async="true"></script>
<title>Nursing Home Inspect Widget - ProPublica</title>
task :import => :environment do
Member.delete_all
f = FasterCSV.open("#{Rails.root.to_s}/db/initial/membersgrades.csv", :headers => true)
f.each do |row|
m = Member.new
m.grade = row["grade"]
m.nra_rating = row["rating"]
m.full_name = row["full_name"]
m.lastname = row["lastname"]
m.firstname = row["firstname"]
function showInfo(data, tabletop) {
var m_td = [];
var senators = [];
$.each( tabletop.sheets("Members").all(), function(i, member) {
if (member.office == "Senate") {
if (member.twitter) {
var twitter = "@" + member.twitter
} else {
var twitter = ""
}
@lenagroeger
lenagroeger / prevent scrolling on iframe
Last active December 21, 2015 09:39
prevent scrolling on iframe
$('.overlaydiv').bind('mousewheel', function (e) {
$(this).scrollTop($(this).scrollTop() - e.originalEvent.wheelDeltaY);
//prevent page fom scrolling
return false;
});
.annotation {
background: #cecbc3 ;
border-radius: 3px;
padding: 0px 3px;
transition: all 0.10s ease-in-out;
-webkit-transition: all 0.10s ease-in-out;
-moz-transition: all 0.10s ease-in-out;
cursor:pointer;
}
@lenagroeger
lenagroeger / takeaways box
Created November 19, 2013 21:52
Takeaways Box
<!-- TAKEAWAY BOX
make sure you include the socialsnippet.js, get-involved.css, and socialsnippet.css
-->
<script type="text/javascript" src="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.propublica.org/css/get-involved.css?20130301" type="text/css" media="all" charset="utf-8" />
<link rel="stylesheet" href="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.css">
<div class="right-sidebar-media" id="some-id">
<h2>Takeaways</h2>
@lenagroeger
lenagroeger / social sharing buttons
Created November 19, 2013 21:53
Social Sharing Buttons
<!-- SOCIAL SHARING SNIPPET
make sure you include the socialsnippet.js, get-involved.css, and socialsnippet.css
-->
<script type="text/javascript" src="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.js"></script>
<link type="text/css" rel="stylesheet" href="http://www.propublica.org/css/get-involved.css?20130301" type="text/css" media="all" charset="utf-8" />
<link rel="stylesheet" href="http://propublica.s3.amazonaws.com/assets/social/socialsnippet.css">
<div class="social_section">
@lenagroeger
lenagroeger / typeahead autocomplete
Last active December 28, 2015 22:09
Typeahead Autofill AutoComplete
<script type="text/javascript" src="http://propublica.s3.amazonaws.com/projects/projectx/jquerytypeahead.js"></script>
<script type="text/javascript">
propublica.views.nameTypeahead = propublica.View.extend({
tag : "input",
cssClass : "name_typeahead",
render : function(){
var typeaheadName = [