-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from osbridge/asset_pipeline
Use the Rails asset pipeline to process JS/CSS assets
- Loading branch information
Showing
138 changed files
with
608 additions
and
10,480 deletions.
There are no files selected for viewing
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
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
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
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//= require jquery | ||
//= require jquery_ujs | ||
//= require jquery-migrate-1.2.1 | ||
//= require jquery.scrollTo | ||
//= require jquery.localScroll | ||
//= require farbtastic | ||
//= require audiojs/audio.min | ||
//= require bootstrap | ||
//= require base | ||
//= require util | ||
//= require favorites | ||
//= require menu | ||
//= require persona | ||
//= require proposals | ||
//= require schedule | ||
//= require spinner | ||
|
||
/*===[ fin ]==========================================================*/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Set up jQuery ajax request to include the CSRF token | ||
$.ajaxSetup({ | ||
headers: { | ||
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content') | ||
} | ||
}); | ||
|
||
// app object used to expose rails variables to javascript | ||
var app = new Object; | ||
|
||
// Is a user logged in? | ||
function logged_in() { | ||
return !app.current_user == 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/*---[ user favorites ]----------------------------------------------*/ | ||
|
||
// Return the proposal_id (e.g., "266") bound to a user favorite control, which | ||
// is a JQuery +element+ object. | ||
var proposal_id_pattern = /^favorite_(\d+)$/; | ||
function proposal_id_for(element) { | ||
var klasses = element.attr('class').split(' '); | ||
for (i in klasses) { | ||
klass = klasses[i]; | ||
var matcher = klass.match(proposal_id_pattern); | ||
if (matcher) { | ||
return matcher[1]; | ||
} | ||
} | ||
return null; | ||
} | ||
|
||
function bind_user_favorite_controls() { | ||
$('.favorite').each(function() { | ||
if( !logged_in() ) { | ||
$(this).addClass('disabled'); | ||
} | ||
}).click(function(event) { | ||
target = $(this); | ||
|
||
if( !logged_in() ) { | ||
alert("You must be logged in to add items to your favorites."); | ||
} else { | ||
target.addClass('working'); | ||
|
||
mode = target.hasClass('checked') ? 'remove' : 'add'; | ||
proposal_id = proposal_id_for(target); | ||
|
||
$.ajax({ | ||
'type': 'PUT', | ||
'url': app.favorites_path + '/modify.json', | ||
'dataType': 'json', | ||
'data': { | ||
'authenticity_token': app.authenticity_token, | ||
'proposal_id': proposal_id, | ||
'mode': mode | ||
}, | ||
'complete': function(request,status){ | ||
target.removeClass('working'); | ||
}, | ||
'success': function(data, status) { | ||
nodes = $('.favorite_'+proposal_id); | ||
switch(mode) { | ||
case 'add': | ||
nodes.addClass('checked'); | ||
break; | ||
case 'remove': | ||
nodes.removeClass('checked'); | ||
break; | ||
} | ||
}, | ||
'error': function(request, status, error) { | ||
alert('There was an error! Status: ' + status + ". Error: " + error); | ||
} | ||
}); | ||
} | ||
return false; | ||
}); | ||
} | ||
|
||
function populate_user_favorites() { | ||
if( logged_in() ) { | ||
$.getJSON( app.favorites_path + '.json?join=1', | ||
function(data) { | ||
jQuery.each( data, function(i, proposal_id) { | ||
$( '.favorite_' + proposal_id ).addClass('checked'); | ||
}); | ||
} | ||
) | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= require html5shiv | ||
//= require respond.min |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// Highlight the active menu item. Works by adding an 'active' class to a | ||
// menu item based on the current URL. Status can be reported via 'console.log' | ||
// if the JavaScript interpreter provides one. | ||
function activate_menu_item () { | ||
var should_log = false; | ||
|
||
var debug = function (message) { | ||
if(should_log && (typeof console == "object")) console.log('activate_menu_item: ' + message); | ||
}; | ||
|
||
// Names of menu item classes and regexp fragments that activate them: | ||
var menu_items_and_activation_patterns = [ | ||
["bofs", "events/.+?bof/.+"], | ||
["proposals_or_sessions", "(events/.+?/)?(proposals|sessions)"], | ||
["schedule", "events/.+?/schedule"], | ||
["speakers", "events/.+?/speakers"] | ||
]; | ||
|
||
// Get the URL pathname from the browser: | ||
var pathname = window.location.pathname; | ||
// Or set a specific one when developing: | ||
// var pathname = "/events/2009/speakers"; | ||
var menu_item_matched = null; | ||
|
||
// Match the first pattern: | ||
for (var i in menu_items_and_activation_patterns) { | ||
var menu_item = menu_items_and_activation_patterns[i][0]; | ||
var pattern = menu_items_and_activation_patterns[i][1]; | ||
var re = new RegExp("^/" + pattern + "(?:/.*)?$"); | ||
if (pathname.match(re)) { | ||
menu_item_matched = menu_item; | ||
debug('Matched menu item "'+menu_item+'" based on pattern: '+ pattern); | ||
break; | ||
} | ||
} | ||
|
||
// Activate the menu item: | ||
if (menu_item_matched) { | ||
$('#header .'+menu_item_matched).parent().addClass('active'); | ||
} else { | ||
debug("No match for pathname: " + pathname); | ||
} | ||
} | ||
|
||
$(document).ready(function () { | ||
activate_menu_item(); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
function personaLogin() { | ||
navigator.id.get(function(assertion) { | ||
if (assertion) { | ||
$('#persona_form input[name=assertion]').val(assertion); | ||
$('#persona_form').submit(); | ||
} else { | ||
window.location = "#{failure_path}" | ||
} | ||
}); | ||
} |
Oops, something went wrong.