Skip to content
Browse files

change default to use jQuery.noConflict

  • Loading branch information...
1 parent b4c2101 commit ea8b56b446f3e55236c25b04eb6c9a10c9a189e6 @aaronchi aaronchi committed
Showing with 21 additions and 34 deletions.
  1. +1 −1 VERSION.yml
  2. +2 −8 bin/jrails
  3. +2 −2 jrails.gemspec
  4. +1 −1 lib/jrails.rb
  5. +2 −6 rails/init.rb
  6. +13 −16 tasks/jrails.rake
View
2 VERSION.yml
@@ -1,4 +1,4 @@
---
-:patch: 0
+:patch: 1
:major: 0
:minor: 5
View
10 bin/jrails
@@ -14,22 +14,16 @@ task :help do
rakeapp.display_tasks_and_comments
end
-desc "Copies the jQuery and jRails javascripts to public/javascripts"
-task :update do
- Rake::Task['jrails:update:javascripts'].invoke
-end
-
desc 'Installs the jQuery and jRails javascripts to public/javascripts'
task :install do
- Rake::Task['jrails:update:javascripts'].invoke
+ Rake::Task['jrails:js:install'].invoke
end
desc 'Remove the prototype / script.aculo.us javascript files'
task :scrub do
- Rake::Task['jrails:update:scrub'].invoke
+ Rake::Task['jrails:js:scrub'].invoke
end
-
rakeapp.init("jrails")
task :default => [:help]
View
4 jrails.gemspec
@@ -5,11 +5,11 @@
Gem::Specification.new do |s|
s.name = %q{jrails}
- s.version = "0.5.0"
+ s.version = "0.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Aaron Eisenberger", "Patrick Hurley"]
- s.date = %q{2009-08-05}
+ s.date = %q{2009-08-07}
s.default_executable = %q{jrails}
s.description = %q{Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library.}
s.email = %q{aaronchi@gmail.com}
View
2 lib/jrails.rb
@@ -33,7 +33,7 @@ module PrototypeHelper
USE_PROTECTION = const_defined?(:DISABLE_JQUERY_FORGERY_PROTECTION) ? !DISABLE_JQUERY_FORGERY_PROTECTION : true
unless const_defined? :JQUERY_VAR
- JQUERY_VAR = '$'
+ JQUERY_VAR = 'jQuery'
end
unless const_defined? :JQCALLBACKS
View
8 rails/init.rb
@@ -1,18 +1,14 @@
-# ====
# The following options can be changed by creating an initializer in config/initializers/jrails.rb
-# ====
-# ActionView::Helpers::PrototypeHelper::JQUERY_VAR
+
# jRails uses jQuery.noConflict() by default
-# to use the regular jQuery syntax, use:
+# to use the default jQuery varibale, use:
# ActionView::Helpers::PrototypeHelper::JQUERY_VAR = '$'
-ActionView::Helpers::PrototypeHelper::JQUERY_VAR = 'jQuery'
# ActionView::Helpers::PrototypeHelper:: DISABLE_JQUERY_FORGERY_PROTECTION
# Set this to disable forgery protection in ajax calls
# This is handy if you want to use caching with ajax by injecting the forgery token via another means
# for an example, see http://henrik.nyh.se/2008/05/rails-authenticity-token-with-jquery
# ActionView::Helpers::PrototypeHelper::DISABLE_JQUERY_FORGERY_PROTECTION = true
-# ====
ActionView::Helpers::AssetTagHelper::JAVASCRIPT_DEFAULT_SOURCES = ['jquery','jquery-ui','jrails']
ActionView::Helpers::AssetTagHelper::reset_javascript_include_default
View
29 tasks/jrails.rake
@@ -1,28 +1,25 @@
namespace :jrails do
- namespace :update do
+
+ namespace :js do
desc "Copies the jQuery and jRails javascripts to public/javascripts"
- task :javascripts do
+ task :install do
puts "Copying files..."
project_dir = RAILS_ROOT + '/public/javascripts/'
scripts = Dir[File.join(File.dirname(__FILE__), '..', '/javascripts/', '*.js')]
FileUtils.cp(scripts, project_dir)
puts "files copied successfully."
end
- end
-
- namespace :install do
- desc "Installs the jQuery and jRails javascripts to public/javascripts"
- task :javascripts do
- Rake::Task['jrails:update:javascripts'].invoke
- end
- end
- desc 'Remove the prototype / script.aculo.us javascript files'
- task :scrub do
- files = %W[controls.js dragdrop.js effects.js prototype.js]
- project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
- files.each do |fname|
- FileUtils.rm File.join(project_dir, fname)
+ desc 'Remove the prototype / script.aculo.us javascript files'
+ task :scrub do
+ puts "Removing files..."
+ files = %W[controls.js dragdrop.js effects.js prototype.js]
+ project_dir = File.join(RAILS_ROOT, 'public', 'javascripts')
+ files.each do |fname|
+ FileUtils.rm(File.join(project_dir, fname)) if File.exists?(File.join(project_dir, fname))
+ end
+ puts "files removed successfully."
end
end
+
end

0 comments on commit ea8b56b

Please sign in to comment.
Something went wrong with that request. Please try again.