Commit 1aa0b15c authored by Steven Hancock's avatar Steven Hancock Committed by Maxwell Salzberg

Move Javascript to the asset pipeline

* Move all Diaspora-specific javascripts to app/assets/javascripts
* Move all vendored javascripts to vendor/assets/javascripts
* Add the appropriate Sprockets require directives to make sure
  everything gets included in the right order
* Remove Jammit dependencies
* Fix all templates that were using Jammit's include_javascripts helper
* Add handlebars_assets gem for compiling Handlebars templates
* Move all Handlebars templates to app/assets/templates and rename
  from .handlebars to .jst.hbs (this is to keep them in the same
  global JST namespace that they were in under Jammit)
* Add public/assets to .gitignore since these files can and should
  be re-generated by Heroku or Capistrano during each deploy
* Fix a few Handlebars templates that were looking for images in the
  wrong location (I'm sure there are others, but it's late)
* Configure application.rb to precompile all javascript and css assets
  that were compiled by Jammit in the Rails 3.0 code
parent 9dffb426
......@@ -66,3 +66,7 @@ dump.rdb
#Rubinius's JIT
*.rbc
# Ignore precompiled assets
# Heroku or Capistrano can and should regenerate them on every deploy
public/assets
......@@ -64,8 +64,6 @@ gem 'fastercsv', '1.5.4', :require => false
gem 'mini_magick', '3.4'
gem 'rest-client', '1.6.7'
gem 'jammit-s3'
# JSON and API
gem 'json'
......@@ -113,6 +111,7 @@ group :assets do
gem 'sass-rails'
gem 'uglifier'
end
gem 'handlebars_assets'
gem 'jquery-rails'
......
......@@ -37,10 +37,6 @@ GIT
GEM
remote: http://rubygems.org/
specs:
POpen4 (0.1.4)
Platform (>= 0.4.0)
open4
Platform (0.4.0)
SystemTimer (1.2.3)
actionmailer (3.1.4)
actionpack (= 3.1.4)
......@@ -188,6 +184,10 @@ GEM
gherkin (2.9.1)
json (>= 1.4.6)
haml (3.1.4)
handlebars_assets (0.4.1)
execjs (>= 1.2.9)
sprockets (>= 2.0.3)
tilt
hashie (1.2.0)
heroku (2.23.0)
launchy (>= 0.3.2)
......@@ -209,12 +209,6 @@ GEM
actionpack (~> 3.0)
i18n-inflector (~> 2.6)
railties (~> 3.0)
jammit (0.6.5)
yui-compressor (>= 0.9.3)
jammit-s3 (0.6.0.2)
jammit (>= 0.5.4)
mimemagic (>= 0.1.7)
s3 (>= 0.3.7)
jasmine (1.1.2)
jasmine-core (>= 1.1.0)
rack (>= 1.1)
......@@ -245,7 +239,6 @@ GEM
treetop (~> 1.4.8)
messagebus_ruby_api (1.0.3)
mime-types (1.18)
mimemagic (0.1.8)
mini_magick (3.4)
subexec (~> 0.2.1)
mobile-fu (1.0.0)
......@@ -295,14 +288,12 @@ GEM
omniauth-oauth (~> 1.0)
omniauth-twitter (0.0.8)
omniauth-oauth (~> 1.0)
open4 (1.3.0)
orm_adapter (0.0.6)
parallel (0.5.16)
parallel_tests (0.7.2)
parallel
pg (0.13.2)
polyglot (0.3.3)
proxies (0.2.1)
rack (1.3.6)
rack-cache (1.2)
rack (>= 0.4)
......@@ -396,8 +387,6 @@ GEM
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.6.1)
s3 (0.3.11)
proxies (~> 0.2.0)
sass (3.1.15)
sass-rails (3.1.6)
actionpack (~> 3.1.0)
......@@ -460,8 +449,6 @@ GEM
xpath (0.1.4)
nokogiri (~> 1.3)
yard (0.7.5)
yui-compressor (0.9.6)
POpen4 (>= 0.1.4)
PLATFORMS
ruby
......@@ -497,11 +484,11 @@ DEPENDENCIES
foreman (= 0.34.1)
fuubar (= 0.0.6)
haml
handlebars_assets
heroku
heroku_san
http_accept_language (~> 1.0.2)
i18n-inflector-rails (~> 1.0)
jammit-s3
jasmine (~> 1.1.2)
jquery-rails
json
......
//= require_self
//= require_tree ./helpers
//= require ./router
//= require ./views
//= require_tree ./models
//= require_tree ./pages
//= require_tree ./collections
//= require_tree ./views
var app = {
collections: {},
models: {},
......
//= require ../collections/posts
app.models.Stream = Backbone.Collection.extend({
initialize : function(){
this.posts = new app.collections.Posts([], this.postOptions());
......
//= require ./content_view
app.views.Comment = app.views.Content.extend({
templateName: "comment",
......
//= require ./stream_object_view
app.views.Content = app.views.StreamObject.extend({
events: {
......
//= require ./stream_object_view
app.views.LikesInfo = app.views.StreamObject.extend({
templateName : "likes-info",
......
//= require ./stream_object_view
app.views.Photo = app.views.StreamObject.extend({
templateName: "photo",
......
//= require ../feedback_view
app.views.PostViewerFeedback = app.views.Feedback.extend({
id : "user-controls",
......
//= require ./stream_object_view
app.views.Post = app.views.StreamObject.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
......@@ -41,4 +42,4 @@ app.views.Post.Legacy = app.views.Post.extend({
initialize : function(options) {
this.templateName = options.templateName || this.templateName
}
})
\ No newline at end of file
})
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
function toggleAspectTitle(){
$("#aspect_name_title").toggleClass('hidden');
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
$(document).ready(function() {
$('#aspect_nav.left_nav .all_aspects .sub_nav').sortable({
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
var List = {
initialize: function() {
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
(function() {
var Diaspora = {
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require friend-finder
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require publisher
//= require jquery.textchange.min
//= require aspect-edit-pane
//= require fileuploader-custom
\ No newline at end of file
document.createElement('header');
document.createElement('footer');
......@@ -2,6 +2,7 @@
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require jquery.autoSuggest.custom
$(document).ready(function(){
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
jQuery.fn.center = function () {
this.css("position","absolute");
this.css("top", ( $(window).height() - this.height() ) / 2+$(window).scrollTop() + "px");
......
//= require mailchimp/jquery.form
//= require mailchimp/jquery.validate
//= require mailchimp/jquery126.min
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require rails.validations
//= require jquery.hotkeys
//= require jquery.autoresize
//= require jquery-ui-1.8.9.custom.min
//= require jquery.charcount
//= require jquery.placeholder
//= require timeago
//= require facebox
//= require underscore
//= require jquery.events.input
//= require jquery.elastic
//= require jquery.mentionsInput
//= require jquery.idle-timer
//= require jquery.infinitescroll-custom
//= require jquery.autocomplete-custom
//= require keycodes
//= require fileuploader-custom
//= require backbone
//= require handlebars-1.0.0.beta.6
//= require markdown
//= require app/app
//= require diaspora
//= require_tree ./helpers
//= require_tree ./pages
//= require_tree ./widgets
//= require view
//= require aspects-dropdown
//= require contact-edit
//= require contact-list
//= require aspect-sorting
//= require mentions
//= require bootstrap/bootstrap-twipsy
//= require bootstrap/bootstrap-popover
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require jquery.charcount
//= require mbp-helper
$(document).ready(function(){
$('.shield a').click(function(){
......
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require aspect-edit-pane
//= require fileuploader-custom
//= require jquery.autoSuggest.custom
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require photo-show
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require jquery.autoSuggest.custom
\ No newline at end of file
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
//= require_tree ../templates
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
* licensed under the Affero General Public License version 3 or later. See
* the COPYRIGHT file.
*/
var View = {
initialize: function() {
/* Buttons */
......
@import 'vendor/bootstrap.css'
@import 'vendor/bootstrap-responsive.css'
@import 'vendor/bootstrap.css';
@import 'vendor/bootstrap-responsive.css';
@import "_mixins.css.scss";
$blue: #3f8fba;
......
// Workaround to keep "app/templates" out of the template names
// All templates will remain in the JST namespace just as they were
// when we were using Jammit
//= require_tree .
\ No newline at end of file
......@@ -2,7 +2,7 @@
<div class="comment">
<div class="media">
<span class="img">
<img alt="Heart" src="{{imageUrl "heart.png"}}" />
<img alt="Heart" src="{{imageUrl "icons/heart.png"}}" />
</span>
<div class="bd">
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment