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
// Setup global objects | |
window.SITE = {} | |
window.SITE.decoration = {}; | |
// Setup the decoration method | |
SITE.decoration.selects = function( $wrapper ) { | |
// Search within the wrapper | |
// Or search wihin the body if $wrapper is undefined | |
$wrapper.or().find('select').chosen(); |
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
@countries = Country.find( :all, :order => 'name' ) | |
@countries_with_tips = [] | |
@countries.each do |country| | |
if country.tips.any? | |
@countries_with_tips.push( country ) | |
end | |
end |
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
describe("A Model should", function() { | |
// FETCH | |
describe( "have a fetch method that", function() { | |
beforeEach(function() { | |
urls = ['url1', 'url2', 'url3', 'url4', 'url5'] | |
spyOn( $, 'ajax'); |
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($) { | |
// console.log('RPCHANGE'); | |
// RPCHANGE: | |
// Updating a query string on a HREF string | |
// http://stackoverflow.com/questions/5999118/add-or-update-query-string-parameter | |
// Use this to add/remove 'openfacet' paramater to each HREF inside the facets | |
// Add when facet is open | |
// Remove when facet is closed |
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
// The purpose of this javascript is | |
// to wrap every letter inside a the #logo-text span in a span | |
// Unless it is already wrapped in a span | |
// in which case we ignore it | |
// We wrap every letter in a span so we can animate it seperately | |
// HTML: | |
// <span id="logo-text" class="text"> | |
// tap<span class="and">+</span>hold | |
// </span> |
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
<article> | |
<section class="stats"> | |
<h1>Why Mobile?</h1> | |
<img class="stats-bg" src="" alt="Reasons to go mobile" /> | |
<ul> | |
<li> | |
<strong class="stats-diamond">1.4</strong> |
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
// Cycle through these URL's | |
// We update the models URL using these | |
// Then we fetch data using it | |
var nextUrl = function() { | |
var urls = [ | |
'js/_data/api/tags/index.json%3frange=21-30', | |
'js/_data/api/tags/index.json%3frange=31-40', | |
'js/_data/api/tags/index.json%3frange=0-10', | |
'js/_data/api/tags/index.json%3frange=11-20' |
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
// Out of bounds | |
// Checks wether the element has been hidden by the user scrolling its parent | |
// Returns an object with, if above | |
// above : true | |
// crop : 92 | |
// If below | |
// below : true | |
// crop 182 | |
// Where crop is the no of pixels is it cropped by | |
// Object will be empty if its not out of bounds |
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() { | |
// Add ALL the decoration | |
// e.g jquery chosen | |
_.each(site.decoration, function(decorate) { | |
decorate(); | |
}); |
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
/* MESSAGES | |
A container for message from the app to the user | |
These appear between the header and main content | |
*/ | |
.messages {position:fixed; top: @line * 6; left:50%; width:480px; margin-left:-240px; text-align:left; z-index:700;} | |
.messages .box:hover {.shadow(0, 0, 6px, 0.5)} | |
/* State */ | |
.fullscreen { |