Skip to content

Commit

Permalink
Different implementation for fix ticket #125 to ensure the same load …
Browse files Browse the repository at this point in the history
…order across all OS/ruby versions.
  • Loading branch information
lawrencepit authored and Erich Ocean committed Sep 30, 2008
1 parent f016d78 commit d35e259
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/sproutcore/helpers/static_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ def stylesheets_for_client(bundle_name = nil, opts = {})
urls = []
all_bundles.each do |b|
urls += b.sorted_stylesheet_entries(opts).map { |x| x.cacheable_url }
urls += (b.stylesheet_libs || [])
end
all_bundles.each do |b|
urls += b.stylesheet_libs.reject { |lib| urls.include? lib } if b.stylesheet_libs
end

# Convert to HTML and return
urls = urls.uniq.map do |url|
urls = urls.map do |url|
if include_method == :import
%( @import url('#{url}');)
else
Expand Down Expand Up @@ -73,11 +75,13 @@ def javascripts_for_client(bundle_name = nil, opts = {})
urls = []
all_bundles.each do |b|
urls += b.sorted_javascript_entries(opts).map { |x| x.cacheable_url }
urls += (b.javascript_libs || [])
end
all_bundles.each do |b|
urls += b.javascript_libs.reject { |lib| urls.include? lib } if b.javascript_libs
end

# Convert to HTML and return
urls = urls.uniq.map do |url|
urls = urls.map do |url|
%( <script type="text/javascript" src="#{url}"></script>)
end

Expand Down

0 comments on commit d35e259

Please sign in to comment.