Permalink
Please sign in to comment.
Showing
with
557 additions
and 0 deletions.
- +16 −0 css/style.css
- +18 −0 js/js.dev.js
- +474 −0 kickstart.php
- +23 −0 readme.md
- +5 −0 templates/ballot.php
- +21 −0 templating.php
@@ -0,0 +1,16 @@ | ||
+.kickstart-ballot { float: left; width: 50px; border: 1px solid #ccc; padding: 5px 0 5px 5px; margin-right: 10px; } | ||
+ | ||
+.kickstart-ballot .kickstart-vote { | ||
+ width: 0; | ||
+ height: 0; | ||
+ border-left: 10px solid transparent; | ||
+ border-right: 10px solid transparent; | ||
+ float: left; | ||
+ cursor: pointer; | ||
+ clear: both; | ||
+ margin-right: 10px; | ||
+} | ||
+ | ||
+.kickstart-ballot .up { border-bottom: 10px solid green; margin-bottom; 5px; } | ||
+.kickstart-ballot .down { border-top: 10px solid red; margin-top: 5px; } | ||
+.kickstart-ballot .kickstart-score { font-weight: bold; } |
18
js/js.dev.js
@@ -0,0 +1,18 @@ | ||
+jQuery(document).ready(function($){ | ||
+ | ||
+ $('.kickstart-vote').click( function(){ | ||
+ | ||
+ var score = $(this).siblings( '.kickstart-score'); | ||
+ | ||
+ $.ajax({ | ||
+ url: kickstart.ajaxEndpoint, | ||
+ data: { | ||
+ direction: $(this).attr( 'data-vote-direction' ), | ||
+ action: 'kickstart_vote', | ||
+ post_ID: $(this).parent().attr( 'data-post-id' ) | ||
+ }, | ||
+ success: function( data ) { score.text( data ); } | ||
+ }) | ||
+ }); | ||
+ | ||
+}); |

Oops, something went wrong.
0 comments on commit
f0dc78c