Created
January 4, 2009 23:48
-
-
Save jsmestad/43219 to your computer and use it in GitHub Desktop.
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
$(document).ready(function() { | |
$("div.votes a").click(function() { | |
$.post( this.href, {"vote[vote]": (this.className == "vote_up") ? 1 : -1} ); | |
$(this).parent().children("a").hide(); | |
$(this).parent().html("<img src=\"/images/accept.png\" />Voted"); | |
var count = intParse($(this).parent().parent().children("div.count").text()); | |
$(this).parent().parent().children("div.count").text((count+1)); | |
return false; | |
}); | |
}) |
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> | |
<h3>jdoe</h3> | |
<ul> | |
<li>2009-01-03</li> | |
<li>Refactors: 2</li> | |
</ul> | |
</div> | |
<div> | |
<div> | |
<div class='count'>0</div> | |
<div class='votes'> | |
<a class="vote_up" href="/snippets/1/refactors/2/votes"><img src="/images/add.png?010416490230" /></a> | |
<a class="vote_down" href="/snippets/1/refactors/2/votes"><img src="/images/delete.png?010416490219" /></a> | |
</div> | |
</div> | |
<table class="CodeRay"><tr> | |
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }"><pre><tt>
</tt></pre></td> | |
<td class="code"><pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }"><span class="r">def</span> <span class="fu">hello</span><span class="er">\</span>n<span class="er">\</span>tprint <span class="s"><span class="dl">"</span><span class="k">hello</span><span class="dl">"</span></span><span class="er">\</span>nend</pre></td> | |
</tr></table> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment