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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<script src="jquery.js" type="text/javascript"></script> | |
<script src="cufon-yui.js" type="text/javascript"></script> | |
<script src="archer-medium.font.js" type="text/javascript"></script> | |
<script src="archer-semibold.font.js" type="text/javascript"></script> | |
<script src="archer-bold.font.js" type="text/javascript"></script> |
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
$(function() { | |
$('.checkbox input:checkbox').change(function(){ | |
var service = $(this).parent().next().find('label:first'); | |
if($(this).is(':checked')) { | |
service.addClass('active'); | |
} else { | |
service.removeClass('active'); | |
} | |
}).triggerHandler('change'); |
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
.header_wrapper | |
.header.clearfix | |
%h1= link_to "Kashless", "/" | |
%ul.menu | |
%li= link_to "Find a free item", listings_path | |
%li= link_to "Give Away", new_listing_path | |
- if logged_in? && current_user.has_role?(:admin) | |
%li= link_to "Users Admin", admin_users_path |
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 class="header_wrapper"> | |
<div class="header clearfix"> | |
<h1><a href="/">Kashless</a></h1> | |
<ul class="menu"> | |
<li> | |
<%= link_to "Find a free item", listings_path %> | |
</li> | |
<li> | |
<%= link_to "Give Away", new_listing_path %> |
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
// Outer function just allows use of $ or jQuery (for jQuery Plugins) | |
(function($){ | |
// Creates a jQuery wrapper method so methods can be attached to jQuery wrapped sets eg: | |
// $('form').fixieAjaxForm() | |
$.fixieAjaxForm = function(successCallback) { | |
// $(this) == $('form') inside this function | |
$(this).ajaxForm(function(str) { | |
var data = $.parseJSON(str); | |
$(this).find('label.error').removeClass('error'); | |
if (data.errors.length === 0) { |
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
(function($){ | |
$.fixieAjaxForm = function(onSuccess) { | |
// $('form').fixieAjaxForm() | |
// $(this) == $('form') inside this function | |
$(this).ajaxForm(function(str) { | |
var data = $.parseJSON(str); | |
$(this).find('label.error').removeClass('error'); | |
if (data.errors.length === 0) { | |
$(this).resetForm(); | |
onSuccess(data); |
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
Playing with gist | |
Cool? |
NewerOlder