Skip to content

Commit

Permalink
upgrading to Rails 3.1.1 solved some problems, but uglifier still cau…
Browse files Browse the repository at this point in the history
…sing problems, so disabling it. reverting to old cycle widget solved the problem we were getting with 'Cannot read property 'cycleW' of undefined'
  • Loading branch information
Daniel Nelson committed Nov 17, 2011
1 parent be73403 commit 8c38370
Show file tree
Hide file tree
Showing 26 changed files with 87 additions and 212 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org'

gem 'rails', '3.1.0'
gem 'rails'
gem 'paperclip', '2.3.11'
gem 'rmagick'
gem 'jquery-rails'
Expand Down
125 changes: 63 additions & 62 deletions Gemfile.lock
@@ -1,39 +1,37 @@
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.0)
actionpack (= 3.1.0)
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
actionpack (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.0.3)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.0)
activemodel (3.1.0)
activesupport (= 3.1.0)
bcrypt-ruby (~> 3.0.0)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.0)
activemodel (= 3.1.0)
activesupport (= 3.1.0)
activesupport (3.1.0)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (~> 1.0)
addressable (2.2.6)
archive-tar-minitar (0.5.2)
arel (2.2.1)
bcrypt-ruby (3.0.0)
builder (3.0.0)
capybara (1.0.0)
mime-types (>= 1.16)
Expand All @@ -44,35 +42,36 @@ GEM
xpath (~> 0.1.4)
childprocess (0.2.2)
ffi (~> 1.0.6)
coffee-rails (3.1.0)
coffee-rails (3.1.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0.rc1)
railties (~> 3.1.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.2)
coffee-script-source (1.1.3)
columnize (0.3.4)
database_cleaner (0.6.7)
database_cleaner (0.7.0)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.2.4)
execjs (1.2.9)
multi_json (~> 1.0)
ffi (1.0.9)
ffi (1.0.11)
haml (3.1.3)
hike (1.2.1)
i18n (0.6.0)
jasmine (1.0.2.1)
json_pure (>= 1.4.3)
jasmine (1.1.2)
jasmine-core (>= 1.1.0)
rack (>= 1.1)
rspec (>= 1.3.1)
selenium-webdriver (>= 0.1.3)
jasminerice (0.0.7)
jasmine-core (1.1.0)
jasminerice (0.0.8)
haml
jquery-rails (1.0.14)
jquery-rails (1.0.17)
railties (~> 3.0)
thor (~> 0.14)
json_pure (1.5.4)
spruz (~> 0.2.8)
json (1.6.1)
json_pure (1.6.1)
launchy (2.0.5)
addressable (~> 2.2.6)
linecache19 (0.5.12)
Expand All @@ -81,53 +80,54 @@ GEM
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mime-types (1.17.2)
multi_json (1.0.3)
nokogiri (1.5.0)
paperclip (2.3.11)
activerecord (>= 2.3.0)
activesupport (>= 2.3.2)
polyglot (0.3.2)
rack (1.3.2)
rack-cache (1.0.3)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.0)
actionmailer (= 3.1.0)
actionpack (= 3.1.0)
activerecord (= 3.1.0)
activeresource (= 3.1.0)
activesupport (= 3.1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
bundler (~> 1.0)
railties (= 3.1.0)
railties (3.1.0)
actionpack (= 3.1.0)
activesupport (= 3.1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2)
rdoc (3.9.4)
rake (0.9.2.2)
rdoc (3.11)
json (~> 1.4)
rmagick (2.13.1)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
rspec-mocks (~> 2.6.0)
rspec-core (2.6.4)
rspec-expectations (2.6.0)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
rspec-rails (2.6.1)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.6.0)
rspec (~> 2.7.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
Expand All @@ -139,30 +139,31 @@ GEM
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rubyzip (0.9.4)
sass (3.1.7)
sass-rails (3.1.0)
sass (3.1.10)
sass-rails (3.1.4)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
selenium-webdriver (0.2.2)
childprocess (>= 0.1.9)
ffi (>= 1.0.7)
json_pure
rubyzip
spork (0.9.0.rc9)
sprockets (2.0.0)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
spruz (0.2.13)
sqlite3 (1.3.4)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.29)
uglifier (1.0.3)
tzinfo (0.3.31)
uglifier (1.1.0)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
xpath (0.1.4)
Expand All @@ -180,7 +181,7 @@ DEPENDENCIES
jquery-rails
launchy
paperclip (= 2.3.11)
rails (= 3.1.0)
rails
rmagick
rspec-rails
ruby-debug19
Expand Down
7 changes: 7 additions & 0 deletions README.md
Expand Up @@ -3,6 +3,8 @@ Note: Updated to AngularJS 0.10 branch

The documentation for the AngularJS 0.10 branch is at [http://docs-next.angularjs.org/](http://docs-next.angularjs.org/). The AngularJS changelog is at [https://github.com/angular/angular.js/blob/master/CHANGELOG.md](https://github.com/angular/angular.js/blob/master/CHANGELOG.md).

There is currently an error with jQuery cycle in production. I'm trying to figure out what, in the asset pipeline, is causing the problem, but thus far without success.

Angular.js in Rails
================

Expand Down Expand Up @@ -71,6 +73,11 @@ In order to use [Jasmine](https://github.com/pivotal/jasmine) for our javascript
* see spec/javascripts/angular/controllersSpec.js for an example


Note the following change to config/environments/production.rb:

# angular.js change: uglifying was causing problems. not sure why
config.assets.js_compressor = Sprockets::LazyCompressor.new { Uglifier.new(:mangle => false) }

Wrap Params
===========

Expand Down
31 changes: 13 additions & 18 deletions app/assets/javascripts/widgets.js
@@ -1,21 +1,16 @@
/* http://docs.angularjs.org/#!angular.widget */

angular.directive("my:cycle", function(expr,el){
return function(container){
var scope = this;
var $defer = scope.$service("$defer");

scope.$watch(expr, function(value) {
if (value < 1) return;

$defer(function() {
$(container).cycle({ fx: 'fade',
speed: 500,
timeout: 3000,
pause: 1,
next: '#next',
prev: '#prev'});
});
});
}
angular.directive('my:cycle', function(expr,el){
return function(container){
this.$watch(function() {
if ($(container).children().length) {
$(container).cycle({ fx: 'fade',
speed: 500,
timeout: 3000,
pause: 1,
next: '#next',
prev: '#prev' });
}
});
}
});
2 changes: 1 addition & 1 deletion app/views/layouts/dynamic.html.erb
Expand Up @@ -10,7 +10,7 @@

<ng:view></ng:view>

<script src="/assets/angular.min.js" ng:autobind></script>
<script src="/javascripts/angular.min.js" ng:autobind></script>
<%= javascript_include_tag "application" -%>
</body>
</html>
5 changes: 2 additions & 3 deletions config/environments/production.rb
Expand Up @@ -17,9 +17,8 @@
# Compress JavaScripts and CSS
config.assets.compress = true

# angular.js change: don't uglify because the HTML templates need to know the names of variables
# and methods in controller.js
# config.assets.js_compressor = Sprockets::LazyCompressor.new { Uglifier.new(:mangle => false) }
# angular.js change: uglifying was causing problems. not sure why
config.assets.js_compressor = Sprockets::LazyCompressor.new { Uglifier.new(:mangle => false) }

# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
Expand Down
8 changes: 0 additions & 8 deletions public/assets/angular-370720a1b8d37783a8d5a03a2b96c0c4.min.js

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.
21 changes: 0 additions & 21 deletions public/assets/application-c4f3e42bdc641eb93cbb92b850b0b560.js

This file was deleted.

Binary file not shown.
7 changes: 0 additions & 7 deletions public/assets/galleries-1f3fd796ef152c68151cd37b0ca5c400.html

This file was deleted.

10 changes: 0 additions & 10 deletions public/assets/jquery-5c5f90ee142dc52c37000f9a4a6bbb7e.cycle.js

This file was deleted.

Binary file not shown.
18 changes: 0 additions & 18 deletions public/assets/jquery-8a50feed8d29566738ad005e19fe1c2d.min.js

This file was deleted.

Binary file not shown.
16 changes: 0 additions & 16 deletions public/assets/jquery-ui-7e33882a28fc84ad0e0e47e46cbf901c.min.js

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions public/assets/manifest.yml

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions public/assets/photos-6dcee642ba01c7341c1d5296abd34d92.html

This file was deleted.

Binary file not shown.
1 change: 0 additions & 1 deletion public/assets/version-bb56fde4d7fb80915b376614cbb6b1c3.txt

This file was deleted.

File renamed without changes.
File renamed without changes.

0 comments on commit 8c38370

Please sign in to comment.