diff --git a/Gemfile b/Gemfile index 6efc0df6c..365f97502 100644 --- a/Gemfile +++ b/Gemfile @@ -107,6 +107,15 @@ gem 'sass' gem 'will_paginate' gem 'client_side_validations' +# assets + +group :assets do + gem 'sass-rails' + gem 'uglifier' +end + +gem 'jquery-rails' + # web gem 'faraday' diff --git a/Gemfile.lock b/Gemfile.lock index d3e313444..a7ee25cda 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -145,6 +145,8 @@ GEM erubis (2.7.0) eventmachine (1.0.0.beta.4) excon (0.12.0) + execjs (1.3.0) + multi_json (~> 1.0) factory_girl (2.6.4) activesupport (>= 2.3.9) factory_girl_rails (1.7.0) @@ -219,7 +221,14 @@ GEM rspec (>= 1.3.1) selenium-webdriver (>= 0.1.3) jasmine-core (1.1.0) +<<<<<<< HEAD json (1.6.6) +======= + jquery-rails (1.0.19) + railties (~> 3.0) + thor (~> 0.14) + json (1.6.5) +>>>>>>> stylesheets are basically now being served from sprockets jsonpath (0.5.0) multi_json jwt (0.1.4) @@ -390,6 +399,11 @@ GEM s3 (0.3.11) proxies (~> 0.2.0) sass (3.1.15) + sass-rails (3.1.6) + actionpack (~> 3.1.0) + railties (~> 3.1.0) + sass (>= 3.1.10) + tilt (~> 1.3.2) selenium-webdriver (2.16.0) childprocess (>= 0.2.5) ffi (~> 1.0.9) @@ -425,6 +439,9 @@ GEM typhoeus (0.3.3) mime-types tzinfo (0.3.32) + uglifier (1.2.3) + execjs (>= 0.3.0) + multi_json (>= 1.0.2) unicorn (4.2.0) kgio (~> 2.6) rack @@ -486,6 +503,7 @@ DEPENDENCIES i18n-inflector-rails (~> 1.0) jammit-s3 jasmine (~> 1.1.2) + jquery-rails json jwt linecache (= 0.46) @@ -528,6 +546,7 @@ DEPENDENCIES ruby-debug19 ruby-oembed (~> 0.8.7) sass + sass-rails selenium-webdriver (~> 2.16.0) settingslogic! sqlite3 @@ -535,6 +554,7 @@ DEPENDENCIES timecop twitter (= 2.0.2) typhoeus + uglifier unicorn (~> 4.2.0) webmock whenever diff --git a/public/stylesheets/.gitkeep b/app/assets/stylesheets/.gitkeep similarity index 100% rename from public/stylesheets/.gitkeep rename to app/assets/stylesheets/.gitkeep diff --git a/public/stylesheets/sass/_mixins.scss b/app/assets/stylesheets/_mixins.css.scss similarity index 100% rename from public/stylesheets/sass/_mixins.scss rename to app/assets/stylesheets/_mixins.css.scss diff --git a/public/stylesheets/sass/application.sass b/app/assets/stylesheets/application.css.sass similarity index 99% rename from public/stylesheets/sass/application.sass rename to app/assets/stylesheets/application.css.sass index 131b247e3..517463089 100644 --- a/public/stylesheets/sass/application.sass +++ b/app/assets/stylesheets/application.css.sass @@ -1,7 +1,7 @@ -// licensed under the Affero General Public License version 3 or later. See -// the COPYRIGHT file. +//= require_self +//= require ui -@import 'mixins' +@import '_mixins.css.scss' /* ====== media ====== */ .media @@ -684,7 +684,7 @@ form p.checkbox_select *:-moz-placeholder @include placeholder_styles -#file-upload +#file-upload input :height 100% :width 100% @@ -777,7 +777,7 @@ form p.checkbox_select :position absolute !important :right 6px :cursor pointer - + input[type='file'] :cursor pointer diff --git a/public/stylesheets/sass/autocomplete.sass b/app/assets/stylesheets/autocomplete.css.sass similarity index 100% rename from public/stylesheets/sass/autocomplete.sass rename to app/assets/stylesheets/autocomplete.css.sass diff --git a/app/assets/stylesheets/blueprint.css b/app/assets/stylesheets/blueprint.css new file mode 100644 index 000000000..3f09fb9c3 --- /dev/null +++ b/app/assets/stylesheets/blueprint.css @@ -0,0 +1,3 @@ +/* +//= require vendor/blueprint/screen +*/ \ No newline at end of file diff --git a/app/assets/stylesheets/bootstrap.css b/app/assets/stylesheets/bootstrap.css new file mode 100644 index 000000000..c9a936437 --- /dev/null +++ b/app/assets/stylesheets/bootstrap.css @@ -0,0 +1,4 @@ +/* +*= require vendor/bootstrap +*= require vendor/bootstrap-responsive +*/ \ No newline at end of file diff --git a/app/assets/stylesheets/default.css b/app/assets/stylesheets/default.css new file mode 100644 index 000000000..b4c66656d --- /dev/null +++ b/app/assets/stylesheets/default.css @@ -0,0 +1,14 @@ +/* +*= require media-box +*= require loader +*= require lightbox +*= require autocomplete +*= require mentions +*= require tags +*= require hovercard + +*= require vendor/interim-bootstrap +*= require vendor/facebox +*= require vendor/fileuploader +*= require vendor/autoSuggest +*/ \ No newline at end of file diff --git a/public/stylesheets/sass/hovercard.scss b/app/assets/stylesheets/hovercard.css.scss similarity index 98% rename from public/stylesheets/sass/hovercard.scss rename to app/assets/stylesheets/hovercard.css.scss index 82b3c4954..0a03c82b3 100644 --- a/public/stylesheets/sass/hovercard.scss +++ b/app/assets/stylesheets/hovercard.css.scss @@ -1,4 +1,4 @@ -@import "mixins"; +@import "_mixins.css.scss"; #hovercard { @include border-radius(2px); diff --git a/public/stylesheets/sass/lightbox.scss b/app/assets/stylesheets/lightbox.css.scss similarity index 98% rename from public/stylesheets/sass/lightbox.scss rename to app/assets/stylesheets/lightbox.css.scss index a7423bb70..d84680a93 100644 --- a/public/stylesheets/sass/lightbox.scss +++ b/app/assets/stylesheets/lightbox.css.scss @@ -1,7 +1,7 @@ // licensed under the Affero General Public License version 3 or later. See // the COPYRIGHT file. -@import 'mixins'; +@import '_mixins.css.scss'; #lightbox{ z-index: 1003; diff --git a/public/stylesheets/sass/loader.scss b/app/assets/stylesheets/loader.css.scss similarity index 100% rename from public/stylesheets/sass/loader.scss rename to app/assets/stylesheets/loader.css.scss diff --git a/public/stylesheets/sass/login.scss b/app/assets/stylesheets/login.css.scss similarity index 97% rename from public/stylesheets/sass/login.scss rename to app/assets/stylesheets/login.css.scss index b4cd1c859..024b8d12b 100644 --- a/public/stylesheets/sass/login.scss +++ b/app/assets/stylesheets/login.css.scss @@ -1,8 +1,10 @@ +//= require_self + // Copyright (c) 2010-2011, Diaspora Inc. This file is // licensed under the Affero General Public License version 3 or later. See // the COPYRIGHT file. -@import "mixins"; +@import "_mixins.css.scss"; #login { width: 400px; diff --git a/public/stylesheets/sass/media-box.scss b/app/assets/stylesheets/media-box.css.scss similarity index 100% rename from public/stylesheets/sass/media-box.scss rename to app/assets/stylesheets/media-box.css.scss diff --git a/public/stylesheets/sass/mentions.scss b/app/assets/stylesheets/mentions.css.scss similarity index 98% rename from public/stylesheets/sass/mentions.scss rename to app/assets/stylesheets/mentions.css.scss index f7589a2d5..39ff4c3a7 100644 --- a/public/stylesheets/sass/mentions.scss +++ b/app/assets/stylesheets/mentions.css.scss @@ -1,5 +1,5 @@ -@import 'mixins'; +@import '_mixins.css.scss'; .mentions-input-box { background: #fff; diff --git a/public/stylesheets/sass/mobile.scss b/app/assets/stylesheets/mobile.css.scss similarity index 98% rename from public/stylesheets/sass/mobile.scss rename to app/assets/stylesheets/mobile.css.scss index addace4e8..f9d2d538d 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/app/assets/stylesheets/mobile.css.scss @@ -1,4 +1,8 @@ -@import "mixins"; +//= require_self +//= require vendor/bootstrap +//= require vendor/bootstrap-responsive + +@import "_mixins.css.scss"; $blue: #3f8fba; diff --git a/public/stylesheets/sass/new-templates.scss b/app/assets/stylesheets/new-templates.css.scss similarity index 99% rename from public/stylesheets/sass/new-templates.scss rename to app/assets/stylesheets/new-templates.css.scss index c8ce38355..d2acb9dea 100644 --- a/public/stylesheets/sass/new-templates.scss +++ b/app/assets/stylesheets/new-templates.css.scss @@ -1,5 +1,6 @@ -/* variables */ +//= require_self +/* variables */ $light-grey: #999; $pane-width: 420px; @@ -808,4 +809,4 @@ text-rendering: optimizelegibility; .headline p{ @include media-text(); -} \ No newline at end of file +} diff --git a/public/stylesheets/sass/popup.scss b/app/assets/stylesheets/popup.css.scss similarity index 100% rename from public/stylesheets/sass/popup.scss rename to app/assets/stylesheets/popup.css.scss diff --git a/public/stylesheets/sass/rtl.sass b/app/assets/stylesheets/rtl.css.sass similarity index 99% rename from public/stylesheets/sass/rtl.sass rename to app/assets/stylesheets/rtl.css.sass index 867225603..6c48be1c0 100644 --- a/public/stylesheets/sass/rtl.sass +++ b/app/assets/stylesheets/rtl.css.sass @@ -1,3 +1,5 @@ +//= require_self + body :direction rtl :text-align right diff --git a/public/stylesheets/sass/sessions.sass b/app/assets/stylesheets/sessions.css.sass similarity index 100% rename from public/stylesheets/sass/sessions.sass rename to app/assets/stylesheets/sessions.css.sass diff --git a/public/stylesheets/sass/tags.sass b/app/assets/stylesheets/tags.css.sass similarity index 100% rename from public/stylesheets/sass/tags.sass rename to app/assets/stylesheets/tags.css.sass diff --git a/public/stylesheets/sass/ui.sass b/app/assets/stylesheets/ui.css.sass similarity index 99% rename from public/stylesheets/sass/ui.sass rename to app/assets/stylesheets/ui.css.sass index 6d10df3dd..12dafcd36 100644 --- a/public/stylesheets/sass/ui.sass +++ b/app/assets/stylesheets/ui.css.sass @@ -2,7 +2,7 @@ // licensed under the Affero General Public License version 3 or later. See // the COPYRIGHT file. -@import 'mixins' +@import '_mixins.css.scss' $button-border-color: #aaa diff --git a/public/stylesheets/vendor/autoSuggest.css b/app/assets/stylesheets/vendor/autoSuggest.css similarity index 100% rename from public/stylesheets/vendor/autoSuggest.css rename to app/assets/stylesheets/vendor/autoSuggest.css diff --git a/public/stylesheets/vendor/blank.gif b/app/assets/stylesheets/vendor/blank.gif similarity index 100% rename from public/stylesheets/vendor/blank.gif rename to app/assets/stylesheets/vendor/blank.gif diff --git a/public/stylesheets/blueprint/AUTHORS.textile b/app/assets/stylesheets/vendor/blueprint/AUTHORS.textile similarity index 100% rename from public/stylesheets/blueprint/AUTHORS.textile rename to app/assets/stylesheets/vendor/blueprint/AUTHORS.textile diff --git a/public/stylesheets/blueprint/LICENSE b/app/assets/stylesheets/vendor/blueprint/LICENSE similarity index 100% rename from public/stylesheets/blueprint/LICENSE rename to app/assets/stylesheets/vendor/blueprint/LICENSE diff --git a/public/stylesheets/blueprint/ie.css b/app/assets/stylesheets/vendor/blueprint/ie.css similarity index 100% rename from public/stylesheets/blueprint/ie.css rename to app/assets/stylesheets/vendor/blueprint/ie.css diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/cross.png b/app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/cross.png similarity index 100% rename from public/stylesheets/blueprint/plugins/buttons/icons/cross.png rename to app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/cross.png diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/key.png b/app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/key.png similarity index 100% rename from public/stylesheets/blueprint/plugins/buttons/icons/key.png rename to app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/key.png diff --git a/public/stylesheets/blueprint/plugins/buttons/icons/tick.png b/app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/tick.png similarity index 100% rename from public/stylesheets/blueprint/plugins/buttons/icons/tick.png rename to app/assets/stylesheets/vendor/blueprint/plugins/buttons/icons/tick.png diff --git a/public/stylesheets/blueprint/plugins/buttons/readme.txt b/app/assets/stylesheets/vendor/blueprint/plugins/buttons/readme.txt similarity index 100% rename from public/stylesheets/blueprint/plugins/buttons/readme.txt rename to app/assets/stylesheets/vendor/blueprint/plugins/buttons/readme.txt diff --git a/public/stylesheets/blueprint/plugins/buttons/screen.css b/app/assets/stylesheets/vendor/blueprint/plugins/buttons/screen.css similarity index 100% rename from public/stylesheets/blueprint/plugins/buttons/screen.css rename to app/assets/stylesheets/vendor/blueprint/plugins/buttons/screen.css diff --git a/public/stylesheets/blueprint/plugins/fancy-type/readme.txt b/app/assets/stylesheets/vendor/blueprint/plugins/fancy-type/readme.txt similarity index 100% rename from public/stylesheets/blueprint/plugins/fancy-type/readme.txt rename to app/assets/stylesheets/vendor/blueprint/plugins/fancy-type/readme.txt diff --git a/public/stylesheets/blueprint/plugins/fancy-type/screen.css b/app/assets/stylesheets/vendor/blueprint/plugins/fancy-type/screen.css similarity index 100% rename from public/stylesheets/blueprint/plugins/fancy-type/screen.css rename to app/assets/stylesheets/vendor/blueprint/plugins/fancy-type/screen.css diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/doc.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/doc.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/doc.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/doc.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/email.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/email.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/email.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/email.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/external.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/external.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/external.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/external.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/feed.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/feed.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/feed.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/feed.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/im.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/im.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/im.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/im.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/pdf.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/pdf.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/visited.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/visited.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/visited.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/visited.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/icons/xls.png b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/xls.png similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/icons/xls.png rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/icons/xls.png diff --git a/public/stylesheets/blueprint/plugins/link-icons/readme.txt b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/readme.txt similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/readme.txt rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/readme.txt diff --git a/public/stylesheets/blueprint/plugins/link-icons/screen.css b/app/assets/stylesheets/vendor/blueprint/plugins/link-icons/screen.css similarity index 100% rename from public/stylesheets/blueprint/plugins/link-icons/screen.css rename to app/assets/stylesheets/vendor/blueprint/plugins/link-icons/screen.css diff --git a/public/stylesheets/blueprint/plugins/rtl/readme.txt b/app/assets/stylesheets/vendor/blueprint/plugins/rtl/readme.txt similarity index 100% rename from public/stylesheets/blueprint/plugins/rtl/readme.txt rename to app/assets/stylesheets/vendor/blueprint/plugins/rtl/readme.txt diff --git a/public/stylesheets/blueprint/plugins/rtl/screen.css b/app/assets/stylesheets/vendor/blueprint/plugins/rtl/screen.css similarity index 100% rename from public/stylesheets/blueprint/plugins/rtl/screen.css rename to app/assets/stylesheets/vendor/blueprint/plugins/rtl/screen.css diff --git a/public/stylesheets/blueprint/print.css b/app/assets/stylesheets/vendor/blueprint/print.css similarity index 100% rename from public/stylesheets/blueprint/print.css rename to app/assets/stylesheets/vendor/blueprint/print.css diff --git a/public/stylesheets/blueprint/screen.css b/app/assets/stylesheets/vendor/blueprint/screen.css similarity index 100% rename from public/stylesheets/blueprint/screen.css rename to app/assets/stylesheets/vendor/blueprint/screen.css diff --git a/public/stylesheets/blueprint/src/forms.css b/app/assets/stylesheets/vendor/blueprint/src/forms.css similarity index 100% rename from public/stylesheets/blueprint/src/forms.css rename to app/assets/stylesheets/vendor/blueprint/src/forms.css diff --git a/public/stylesheets/blueprint/src/grid.css b/app/assets/stylesheets/vendor/blueprint/src/grid.css similarity index 100% rename from public/stylesheets/blueprint/src/grid.css rename to app/assets/stylesheets/vendor/blueprint/src/grid.css diff --git a/public/stylesheets/blueprint/src/grid.png b/app/assets/stylesheets/vendor/blueprint/src/grid.png similarity index 100% rename from public/stylesheets/blueprint/src/grid.png rename to app/assets/stylesheets/vendor/blueprint/src/grid.png diff --git a/public/stylesheets/blueprint/src/ie.css b/app/assets/stylesheets/vendor/blueprint/src/ie.css similarity index 100% rename from public/stylesheets/blueprint/src/ie.css rename to app/assets/stylesheets/vendor/blueprint/src/ie.css diff --git a/public/stylesheets/blueprint/src/print.css b/app/assets/stylesheets/vendor/blueprint/src/print.css similarity index 100% rename from public/stylesheets/blueprint/src/print.css rename to app/assets/stylesheets/vendor/blueprint/src/print.css diff --git a/public/stylesheets/blueprint/src/reset.css b/app/assets/stylesheets/vendor/blueprint/src/reset.css similarity index 100% rename from public/stylesheets/blueprint/src/reset.css rename to app/assets/stylesheets/vendor/blueprint/src/reset.css diff --git a/public/stylesheets/blueprint/src/typography.css b/app/assets/stylesheets/vendor/blueprint/src/typography.css similarity index 100% rename from public/stylesheets/blueprint/src/typography.css rename to app/assets/stylesheets/vendor/blueprint/src/typography.css diff --git a/public/stylesheets/bootstrap-responsive.css b/app/assets/stylesheets/vendor/bootstrap-responsive.css similarity index 100% rename from public/stylesheets/bootstrap-responsive.css rename to app/assets/stylesheets/vendor/bootstrap-responsive.css diff --git a/public/stylesheets/bootstrap.css b/app/assets/stylesheets/vendor/bootstrap.css similarity index 100% rename from public/stylesheets/bootstrap.css rename to app/assets/stylesheets/vendor/bootstrap.css diff --git a/public/stylesheets/vendor/facebox.css b/app/assets/stylesheets/vendor/facebox.css similarity index 100% rename from public/stylesheets/vendor/facebox.css rename to app/assets/stylesheets/vendor/facebox.css diff --git a/public/stylesheets/vendor/fileuploader.css b/app/assets/stylesheets/vendor/fileuploader.css similarity index 100% rename from public/stylesheets/vendor/fileuploader.css rename to app/assets/stylesheets/vendor/fileuploader.css diff --git a/public/stylesheets/vendor/html5-boilerplate-mobile.css b/app/assets/stylesheets/vendor/html5-boilerplate-mobile.css similarity index 100% rename from public/stylesheets/vendor/html5-boilerplate-mobile.css rename to app/assets/stylesheets/vendor/html5-boilerplate-mobile.css diff --git a/public/stylesheets/vendor/images/ajax-loader.png b/app/assets/stylesheets/vendor/images/ajax-loader.png similarity index 100% rename from public/stylesheets/vendor/images/ajax-loader.png rename to app/assets/stylesheets/vendor/images/ajax-loader.png diff --git a/public/stylesheets/vendor/images/icon-search-black.png b/app/assets/stylesheets/vendor/images/icon-search-black.png similarity index 100% rename from public/stylesheets/vendor/images/icon-search-black.png rename to app/assets/stylesheets/vendor/images/icon-search-black.png diff --git a/public/stylesheets/vendor/images/icons-18-black.png b/app/assets/stylesheets/vendor/images/icons-18-black.png similarity index 100% rename from public/stylesheets/vendor/images/icons-18-black.png rename to app/assets/stylesheets/vendor/images/icons-18-black.png diff --git a/public/stylesheets/vendor/images/icons-18-white.png b/app/assets/stylesheets/vendor/images/icons-18-white.png similarity index 100% rename from public/stylesheets/vendor/images/icons-18-white.png rename to app/assets/stylesheets/vendor/images/icons-18-white.png diff --git a/public/stylesheets/vendor/images/icons-36-black.png b/app/assets/stylesheets/vendor/images/icons-36-black.png similarity index 100% rename from public/stylesheets/vendor/images/icons-36-black.png rename to app/assets/stylesheets/vendor/images/icons-36-black.png diff --git a/public/stylesheets/vendor/images/icons-36-white.png b/app/assets/stylesheets/vendor/images/icons-36-white.png similarity index 100% rename from public/stylesheets/vendor/images/icons-36-white.png rename to app/assets/stylesheets/vendor/images/icons-36-white.png diff --git a/public/stylesheets/interim-bootstrap.css b/app/assets/stylesheets/vendor/interim-bootstrap.css similarity index 100% rename from public/stylesheets/interim-bootstrap.css rename to app/assets/stylesheets/vendor/interim-bootstrap.css diff --git a/public/stylesheets/vendor/jquery.mentionsInput.css b/app/assets/stylesheets/vendor/jquery.mentionsInput.css similarity index 100% rename from public/stylesheets/vendor/jquery.mentionsInput.css rename to app/assets/stylesheets/vendor/jquery.mentionsInput.css diff --git a/public/stylesheets/vendor/jquery.mobile-1.0b2.min.css b/app/assets/stylesheets/vendor/jquery.mobile-1.0b2.min.css similarity index 100% rename from public/stylesheets/vendor/jquery.mobile-1.0b2.min.css rename to app/assets/stylesheets/vendor/jquery.mobile-1.0b2.min.css diff --git a/public/stylesheets/vendor/jquery.ui.autocomplete.css b/app/assets/stylesheets/vendor/jquery.ui.autocomplete.css similarity index 100% rename from public/stylesheets/vendor/jquery.ui.autocomplete.css rename to app/assets/stylesheets/vendor/jquery.ui.autocomplete.css diff --git a/public/stylesheets/vendor/tipsy.css b/app/assets/stylesheets/vendor/tipsy.css similarity index 100% rename from public/stylesheets/vendor/tipsy.css rename to app/assets/stylesheets/vendor/tipsy.css diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d19a42b57..c61fafea9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -35,11 +35,4 @@ module ApplicationHelper def diaspora_id_host User.diaspora_id_host end - - def jquery_include_tag - "".html_safe + - content_tag(:script) do - "!window.jQuery && document.write(unescape(\"#{escape_javascript(include_javascripts(:jquery))}\")); jQuery.ajaxSetup({'cache': false});".html_safe - end - end end diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index c1cbc2144..5ea667d2f 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -61,9 +61,9 @@ module LayoutHelper def include_base_css_framework(use_bootstrap=false) if use_bootstrap || @aspect == :getting_started || @page == :logged_out - include_stylesheets :bootstrap + stylesheet_link_tag 'bootstrap' else - include_stylesheets :blueprint, :media => 'screen' + stylesheet_link_tag 'blueprint', :media => 'screen' end end diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7af102126..e36ebc340 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -19,8 +19,7 @@ = page_title yield(:page_title) = include_base_css_framework - = include_stylesheets :login, :media => 'screen' - = include_stylesheets :application, :default, :media => 'all' + = stylesheet_link_tag 'login', 'application', 'default' - if rtl? = include_stylesheets :rtl, :media => 'all' @@ -30,7 +29,8 @@ = include_javascripts :ie - = jquery_include_tag + = javascript_include_tag 'jquery', 'jquery_ujs' + - unless @landing_page = include_javascripts :main, :templates = load_javascript_locales diff --git a/config/application.rb b/config/application.rb index 589e15ca2..444999cf1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -63,5 +63,8 @@ module Diaspora config.filter_parameters += [:text] config.filter_parameters += [:bio] + # Enable the asset pipeline + config.assets.enabled = true + end end diff --git a/config/assets.yml b/config/assets.yml index e7086b92b..49a7e0945 100644 --- a/config/assets.yml +++ b/config/assets.yml @@ -2,14 +2,12 @@ package_assets: on embed_assets: datauri compress_assets: on gzip_assets: off +package_path: jammit template_function: Handlebars.compile template_extension: 'handlebars' javascripts: - jquery: - - public/javascripts/vendor/jquery-1.7.1.min.js - templates: - public/javascripts/app/templates/*.handlebars - public/javascripts/app/templates/**/*.handlebars @@ -111,43 +109,3 @@ javascripts: - public/javascripts/vendor/jquery.autoSuggest.custom.js ie: - public/javascripts/ie.js - -stylesheets: - bootstrap: - - public/stylesheets/bootstrap-responsive.css - - public/stylesheets/bootstrap.css - - blueprint: - - public/stylesheets/blueprint/screen.css - - login: - - public/stylesheets/login.css - - default: - - public/stylesheets/media-box.css - - public/stylesheets/loader.css - - public/stylesheets/lightbox.css - - public/stylesheets/autocomplete.css - - public/stylesheets/mentions.css - - public/stylesheets/tags.css - - public/stylesheets/hovercard.css - - public/stylesheets/vendor/facebox.css - - public/stylesheets/vendor/fileuploader.css - - public/stylesheets/vendor/autoSuggest.css - - public/stylesheets/interim-bootstrap.css - - application: - - public/stylesheets/application.css - - public/stylesheets/ui.css - - new_templates: - - public/stylesheets/new-templates.css - - rtl: - - public/stylesheets/rtl.css - - mobile: - - public/stylesheets/bootstrap2.css - - public/stylesheets/bootstrap-responsive.css - - public/stylesheets/mobile.css - diff --git a/config/environments/development.rb b/config/environments/development.rb index 19ce2b3dd..19e7118d2 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -16,7 +16,12 @@ Diaspora::Application.configure do config.consider_all_requests_local = true config.action_controller.perform_caching = false - + # Do not compress assets + config.assets.compress = false + + # Expands the lines which load the assets + config.assets.debug = true + # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false config.active_support.deprecation = [:stderr, :log] diff --git a/config/environments/production.rb b/config/environments/production.rb index b96fa6252..f4dc824f9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -46,10 +46,17 @@ Diaspora::Application.configure do # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false + # Compress JavaScript and CSS + config.assets.compress = true + + # Don't fallback to assets pipeline + config.assets.compile = false + + # Generate digests for assets URLs + config.assets.digest = true + config.threadsafe! end -# Sacrifice readability for a 10% performance boost -Haml::Template::options[:ugly] = true GC.enable_stats if GC.respond_to?(:enable_stats) GC::Profiler.enable if defined?(GC::Profiler) && GC::Profiler.respond_to?(:enable) diff --git a/config/environments/test.rb b/config/environments/test.rb index d1ab8b3a7..be4ea36b5 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -30,6 +30,13 @@ Diaspora::Application.configure do config.action_mailer.delivery_method = :test config.active_support.deprecation = :stderr + # Configure static asset server for tests with Cache-Control for performance + config.serve_static_assets = true + config.static_cache_control = "public, max-age=3600" + + # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets + config.assets.allow_debugging = true + # fixes url helper issue in rspec #config.threadsafe! diff --git a/public/javascripts/clear-form.js b/public/javascripts/clear-form.js new file mode 100644 index 000000000..70d13f61d --- /dev/null +++ b/public/javascripts/clear-form.js @@ -0,0 +1,18 @@ +/* Clear form plugin - called using $("elem").clearForm(); */ +$.fn.clearForm = function() { + return this.each(function() { + if ($(this).is('form')) { + return $(':input', this).clearForm(); + } + if ($(this).hasClass('clear_on_submit') || $(this).is(':text') || $(this).is(':password') || $(this).is('textarea')) { + $(this).val(''); + } else if ($(this).is(':checkbox') || $(this).is(':radio')) { + $(this).attr('checked', false); + } else if ($(this).is('select')) { + this.selectedIndex = -1; + } else if ($(this).attr('name') == 'photos[]') { + $(this).val(''); + } + $(this).blur(); + }); +}; diff --git a/public/javascripts/rails.js b/public/javascripts/rails.js deleted file mode 100644 index 06b4e0b53..000000000 --- a/public/javascripts/rails.js +++ /dev/null @@ -1,373 +0,0 @@ -(function($, undefined) { - -/** - * Unobtrusive scripting adapter for jQuery - * - * Requires jQuery 1.6.0 or later. - * https://github.com/rails/jquery-ujs - - * Uploading file using rails.js - * ============================= - * - * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields - * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means. - * - * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish. - * - * Ex: - * $('form').live('ajax:aborted:file', function(event, elements){ - * // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`. - * // Returning false in this handler tells rails.js to disallow standard form submission - * return false; - * }); - * - * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value. - * - * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use - * techniques like the iframe method to upload the file instead. - * - * Required fields in rails.js - * =========================== - * - * If any blank required inputs (required="required") are detected in the remote form, the whole form submission - * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission. - * - * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs. - * - * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never - * get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior. - * - * Ex: - * $('form').live('ajax:aborted:required', function(event, elements){ - * // Returning false in this handler tells rails.js to submit the form anyway. - * // The blank required inputs are passed to this function in `elements`. - * return ! confirm("Would you like to submit the form with missing info?"); - * }); - */ - - // Shorthand to make it a little easier to call public rails functions from within rails.js - var rails; - - $.rails = rails = { - // Link elements bound by jquery-ujs - linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]', - - // Select elements bound by jquery-ujs - inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', - - // Form elements bound by jquery-ujs - formSubmitSelector: 'form', - - // Form input elements bound by jquery-ujs - formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])', - - // Form input elements disabled during form submission - disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]', - - // Form input elements re-enabled after form submission - enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled', - - // Form required input elements - requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])', - - // Form file input elements - fileInputSelector: 'input:file', - - // Link onClick disable selector with possible reenable after remote submission - linkDisableSelector: 'a[data-disable-with]', - - // Make sure that every Ajax request sends the CSRF token - CSRFProtection: function(xhr) { - var token = $('meta[name="csrf-token"]').attr('content'); - if (token) xhr.setRequestHeader('X-CSRF-Token', token); - }, - - // Triggers an event on an element and returns false if the event result is false - fire: function(obj, name, data) { - var event = $.Event(name); - obj.trigger(event, data); - return event.result !== false; - }, - - // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm - confirm: function(message) { - return confirm(message); - }, - - // Default ajax function, may be overridden with custom function in $.rails.ajax - ajax: function(options) { - return $.ajax(options); - }, - - // Submits "remote" forms and links with ajax - handleRemote: function(element) { - var method, url, data, - crossDomain = element.data('cross-domain') || null, - dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType), - options; - - if (rails.fire(element, 'ajax:before')) { - - if (element.is('form')) { - method = element.attr('method'); - url = element.attr('action'); - data = element.serializeArray(); - // memoized value from clicked submit button - var button = element.data('ujs:submit-button'); - if (button) { - data.push(button); - element.data('ujs:submit-button', null); - } - } else if (element.is(rails.inputChangeSelector)) { - method = element.data('method'); - url = element.data('url'); - data = element.serialize(); - if (element.data('params')) data = data + "&" + element.data('params'); - } else { - method = element.data('method'); - url = element.attr('href'); - data = element.data('params') || null; - } - - options = { - type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain, - // stopping the "ajax:beforeSend" event will cancel the ajax request - beforeSend: function(xhr, settings) { - if (settings.dataType === undefined) { - xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); - } - return rails.fire(element, 'ajax:beforeSend', [xhr, settings]); - }, - success: function(data, status, xhr) { - element.trigger('ajax:success', [data, status, xhr]); - }, - complete: function(xhr, status) { - element.trigger('ajax:complete', [xhr, status]); - }, - error: function(xhr, status, error) { - element.trigger('ajax:error', [xhr, status, error]); - } - }; - // Only pass url to `ajax` options if not blank - if (url) { options.url = url; } - - return rails.ajax(options); - } else { - return false; - } - }, - - // Handles "data-method" on links such as: - // Delete - handleMethod: function(link) { - var href = link.attr('href'), - method = link.data('method'), - target = link.attr('target'), - csrf_token = $('meta[name=csrf-token]').attr('content'), - csrf_param = $('meta[name=csrf-param]').attr('content'), - form = $('
'), - metadata_input = ''; - - if (csrf_param !== undefined && csrf_token !== undefined) { - metadata_input += ''; - } - - if (target) { form.attr('target', target); } - - form.hide().append(metadata_input).appendTo('body'); - form.submit(); - }, - - /* Disables form elements: - - Caches element value in 'ujs:enable-with' data store - - Replaces element text with value of 'data-disable-with' attribute - - Sets disabled property to true - */ - disableFormElements: function(form) { - form.find(rails.disableSelector).each(function() { - var element = $(this), method = element.is('button') ? 'html' : 'val'; - element.data('ujs:enable-with', element[method]()); - element[method](element.data('disable-with')); - element.prop('disabled', true); - }); - }, - - /* Re-enables disabled form elements: - - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`) - - Sets disabled property to false - */ - enableFormElements: function(form) { - form.find(rails.enableSelector).each(function() { - var element = $(this), method = element.is('button') ? 'html' : 'val'; - if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with')); - element.prop('disabled', false); - }); - }, - - /* For 'data-confirm' attribute: - - Fires `confirm` event - - Shows the confirmation dialog - - Fires the `confirm:complete` event - - Returns `true` if no function stops the chain and user chose yes; `false` otherwise. - Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog. - Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function - return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog. - */ - allowAction: function(element) { - var message = element.data('confirm'), - answer = false, callback; - if (!message) { return true; } - - if (rails.fire(element, 'confirm')) { - answer = rails.confirm(message); - callback = rails.fire(element, 'confirm:complete', [answer]); - } - return answer && callback; - }, - - // Helper function which checks for blank inputs in a form that match the specified CSS selector - blankInputs: function(form, specifiedSelector, nonBlank) { - var inputs = $(), input, - selector = specifiedSelector || 'input,textarea'; - form.find(selector).each(function() { - input = $(this); - // Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs - if (nonBlank ? input.val() : !input.val()) { - inputs = inputs.add(input); - } - }); - return inputs.length ? inputs : false; - }, - - // Helper function which checks for non-blank inputs in a form that match the specified CSS selector - nonBlankInputs: function(form, specifiedSelector) { - return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank - }, - - // Helper function, needed to provide consistent behavior in IE - stopEverything: function(e) { - $(e.target).trigger('ujs:everythingStopped'); - e.stopImmediatePropagation(); - return false; - }, - - // find all the submit events directly bound to the form and - // manually invoke them. If anyone returns false then stop the loop - callFormSubmitBindings: function(form, event) { - var events = form.data('events'), continuePropagation = true; - if (events !== undefined && events['submit'] !== undefined) { - $.each(events['submit'], function(i, obj){ - if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event); - }); - } - return continuePropagation; - }, - - // replace element's html with the 'data-disable-with' after storing original html - // and prevent clicking on it - disableElement: function(element) { - element.data('ujs:enable-with', element.html()); // store enabled state - element.html(element.data('disable-with')); // set to disabled state - element.bind('click.railsDisable', function(e) { // prevent further clicking - return rails.stopEverything(e) - }); - }, - - // restore element to its original state which was disabled by 'disableElement' above - enableElement: function(element) { - if (element.data('ujs:enable-with') !== undefined) { - element.html(element.data('ujs:enable-with')); // set to old enabled state - // this should be element.removeData('ujs:enable-with') - // but, there is currently a bug in jquery which makes hyphenated data attributes not get removed - element.data('ujs:enable-with', false); // clean up cache - } - element.unbind('click.railsDisable'); // enable element - } - - }; - - $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }}); - - $(document).delegate(rails.linkDisableSelector, 'ajax:complete', function() { - rails.enableElement($(this)); - }); - - $(document).delegate(rails.linkClickSelector, 'click.rails', function(e) { - var link = $(this), method = link.data('method'), data = link.data('params'); - if (!rails.allowAction(link)) return rails.stopEverything(e); - - if (link.is(rails.linkDisableSelector)) rails.disableElement(link); - - if (link.data('remote') !== undefined) { - if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; } - - if (rails.handleRemote(link) === false) { rails.enableElement(link); } - return false; - - } else if (link.data('method')) { - rails.handleMethod(link); - return false; - } - }); - - $(document).delegate(rails.inputChangeSelector, 'change.rails', function(e) { - var link = $(this); - if (!rails.allowAction(link)) return rails.stopEverything(e); - - rails.handleRemote(link); - return false; - }); - - $(document).delegate(rails.formSubmitSelector, 'submit.rails', function(e) { - var form = $(this), - remote = form.data('remote') !== undefined, - blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector), - nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); - - if (!rails.allowAction(form)) return rails.stopEverything(e); - - // skip other logic when required values are missing or file upload is present - if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { - return rails.stopEverything(e); - } - - if (remote) { - if (nonBlankFileInputs) { - return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); - } - - // If browser does not support submit bubbling, then this live-binding will be called before direct - // bindings. Therefore, we should directly call any direct bindings before remotely submitting form. - if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e); - - rails.handleRemote(form); - return false; - - } else { - // slight timeout so that the submit button gets properly serialized - setTimeout(function(){ rails.disableFormElements(form); }, 13); - } - }); - - $(document).delegate(rails.formInputClickSelector, 'click.rails', function(event) { - var button = $(this); - - if (!rails.allowAction(button)) return rails.stopEverything(event); - - // register the pressed submit button - var name = button.attr('name'), - data = name ? {name:name, value:button.val()} : null; - - button.closest('form').data('ujs:submit-button', data); - }); - - $(document).delegate(rails.formSubmitSelector, 'ajax:beforeSend.rails', function(event) { - if (this == event.target) rails.disableFormElements($(this)); - }); - - $(document).delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) { - if (this == event.target) rails.enableFormElements($(this)); - }); - -})( jQuery ); diff --git a/public/javascripts/vendor/jquery-1.7.1.min.js b/public/javascripts/vendor/jquery-1.7.1.min.js deleted file mode 100644 index 198b3ff07..000000000 --- a/public/javascripts/vendor/jquery-1.7.1.min.js +++ /dev/null @@ -1,4 +0,0 @@ -/*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g| t |