Permalink
Browse files

upgrading installed version of jrails

  • Loading branch information...
1 parent 9facfaa commit dd5af923ff52cce2130814cc39d2bc2ea0d83986 @rick committed Jul 24, 2010
@@ -0,0 +1,2 @@
+pkg/*
+versions
@@ -0,0 +1,43 @@
+0.5.0 (31 July 2009)
+* Gemification
+* Support for Ruby 1.9.X
+* Updated to jQuery 1.3.2
+* Updated to jQuery UI 1.7.2
+* Created a jrails binary (runs rake tasks) because rails does not (yet?) pickup
+tasks from gem plugins
+* Changed default to use jQuery compatibility name (not $)
+* Created a scrub task that will remove the prototype / script.aculo.us
+javascript files
+* better approximate scriptaculous effect names
+* add support for page[:element_id].visual_effect(:effect) as well as page.visual_effect(:effect, :element_id)
+* added a reset form function to jrails.js (stolen from jquery form)
+* can now use jquery selectors in all functions
+* added javascript_function helper to render inline rjs helpers
+* better support for sortable_element
+
+0.4.0 (16 June 2008)
+* updated to jquery-ui 1.5 & merged js into single file
+* Added jQuery.noConflict support
+* support for value/val
+* additional support for update/delete methods
+* support for success/failure hash
+* setRequestHeader now gets called globally
+* Better support for droppables, sortables
+* Add support for prototype AJAX callbacks
+* better support for AJAX form calls
+
+0.3.0 (22 Feb 2008)
+* updated to jquery-fx 1.0b and jquery-ui 1.5b
+* Add text/javascript request header to fix format.js
+* Added Tasks (thanks ggarside)
+* Improve visual_effects methods
+* Fixed some RJS calls
+* Fixed observer code for ie
+
+0.2.0 (26 Nov 2007)
+* Vastly Improved FX
+* Improved Form Observers
+* Fixed Rails <= 1.2.6 Compatibility
+
+0.1.0 (15 Nov 2007)
+* Initial release
@@ -0,0 +1,18 @@
+Copyright (c) 2008 Aaron Eisenberger
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
+= jRails
+
+jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers.
+
+== Resources
+
+Install
+
+* .script/plugin install git://github.com/aaronchi/jrails.git
+
+Project Site
+
+* http://code.google.com/p/ennerchi
+
+Web Site
+
+* http://www.ennerchi.com/projects/jrails
+
+Group Site
+
+* http://groups.google.com/group/jrails
@@ -0,0 +1,19 @@
+require 'rubygems'
+require 'rake'
+
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |gem|
+ gem.name = "jrails"
+ gem.summary = "jRails is a drop-in jQuery replacement for the Rails Prototype/script.aculo.us helpers."
+ gem.description = "Using jRails, you can get all of the same default Rails helpers for javascript functionality using the lighter jQuery library."
+ gem.email = "aaronchi@gmail.com"
+ gem.homepage = "http://ennerchi.com/projects/jrails"
+ gem.authors = ["Aaron Eisenberger", "Patrick Hurley"]
+ gem.rubyforge_project = "jrails"
+ gem.files = FileList["[A-Z]*.rb","{bin,javascripts,lib,rails,tasks}/**/*"]
+ end
+ Jeweler::GemcutterTasks.new
+rescue LoadError
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
+end
@@ -0,0 +1,5 @@
+---
+:build:
+:patch: 0
+:major: 0
+:minor: 6
@@ -0,0 +1,30 @@
+#!/usr/bin/env ruby
+
+require 'rubygems'
+require 'rake'
+
+RAILS_ROOT = Dir.pwd
+rakeapp = Rake.application
+fname =File.join(File.dirname(__FILE__), '..', 'tasks', 'jrails.rake')
+load fname
+
+task :help do
+ puts "jrails [command]\n\n"
+ rakeapp.options.show_task_pattern = Regexp.new('^[hius]')
+ rakeapp.display_tasks_and_comments
+end
+
+desc 'Installs the jQuery and jRails javascripts to public/javascripts'
+task :install do
+ Rake::Task['jrails:js:install'].invoke
+end
+
+desc 'Remove the prototype / script.aculo.us javascript files'
+task :scrub do
+ Rake::Task['jrails:js:scrub'].invoke
+end
+
+rakeapp.init("jrails")
+task :default => [:help]
+
+rakeapp.top_level
@@ -0,0 +1 @@
+require 'rails/init.rb'
@@ -0,0 +1,9 @@
+# Install hook code here
+puts "Copying files..."
+dir = "javascripts"
+["jquery-ui.js", "jquery.js", "jrails.js"].each do |js_file|
+ dest_file = File.join(RAILS_ROOT, "public", dir, js_file)
+ src_file = File.join(File.dirname(__FILE__) , dir, js_file)
+ FileUtils.cp_r(src_file, dest_file)
+end
+puts "Files copied - Installation complete!"

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,197 @@
+/*
+*
+* jRails ajax extras
+* version 0.1
+* <aaron@ennerchi.com> | http://www.ennerchi.com
+*
+*/
+
+(function($) {
+ $.ajaxSettings.accepts._default = "text/javascript, text/html, application/xml, text/xml, */*";
+})(jQuery);
+
+
+/*
+*
+* jRails form extras
+* <aaron@ennerchi.com> | http://www.ennerchi.com
+*
+*/
+
+
+(function($) {
+ // reset a form
+ $.fn.reset = function() {
+ return this.each(function() {
+ // guard against an input with the name of 'reset'
+ // note that IE reports the reset function as an 'object'
+ if (typeof this.reset == 'function' || (typeof this.reset == 'object' && !this.reset.nodeType))
+ this.reset();
+ });
+ };
+ // enable a form element
+ $.fn.enable = function() {
+ return this.each(function() {
+ this.disabled = false;
+ });
+ };
+ // disable a form element
+ $.fn.disable = function() {
+ return this.each(function() {
+ this.disabled = true;
+ });
+ };
+
+})(jQuery);
+
+/*
+*
+* jRails form observer plugin
+* version 0.2
+* <aaron@ennerchi.com> | http://www.ennerchi.com
+*
+*/
+
+(function($) {
+ $.extend({ // Translate field to event
+ fieldEvent: function(el, obs) {
+ var field = el[0] || el, e = 'change';
+ if (field.type == 'radio' || field.type == 'checkbox') e = 'click';
+ else if (obs && (field.type == 'text' || field.type == 'textarea' || field.type == 'password')) e = 'keyup';
+ return e;
+ }
+ });
+ $.fn.extend({ // Delayed observer for fields and forms
+ delayedObserver: function(delay, callback){
+ var el = $(this);
+ if (typeof window.delayedObserverStack == 'undefined') window.delayedObserverStack = [];
+ if (typeof window.delayedObserverCallback == 'undefined') {
+ window.delayedObserverCallback = function(stackPos) {
+ var observed = window.delayedObserverStack[stackPos];
+ if (observed.timer) clearTimeout(observed.timer);
+ observed.timer = setTimeout(function(){
+ observed.timer = null;
+ observed.callback(observed.obj, observed.obj.formVal());
+ }, observed.delay * 1000);
+ observed.oldVal = observed.obj.formVal();
+ };
+ }
+ window.delayedObserverStack.push({
+ obj: el, timer: null, delay: delay,
+ oldVal: el.formVal(), callback: callback
+ });
+ var stackPos = window.delayedObserverStack.length-1;
+ if (el[0].tagName == 'FORM') {
+ $(':input', el).each(function(){
+ var field = $(this);
+ field.bind($.fieldEvent(field, delay), function(){
+ var observed = window.delayedObserverStack[stackPos];
+ if (observed.obj.formVal() == observed.oldVal) return;
+ else window.delayedObserverCallback(stackPos);
+ });
+ });
+ } else {
+ el.bind($.fieldEvent(el, delay), function(){
+ var observed = window.delayedObserverStack[stackPos];
+ if (observed.obj.formVal() == observed.oldVal) return;
+ else window.delayedObserverCallback(stackPos);
+ });
+ };
+ },
+ formVal: function() { // Gets form values
+ var el = this[0];
+ if(el.tagName == 'FORM') return this.serialize();
+ if(el.type == 'checkbox' || el.type == 'radio') return this.filter('input:checked').val() || '';
+ else return this.val();
+ }
+ });
+})(jQuery);
+
+/*
+*
+* jRails visual effects stubs
+* version 0.2
+* <aaron@ennerchi.com> | http://www.ennerchi.com
+*
+*/
+
+(function($) {
+ $.fn.extend({
+ visualEffect : function(o, options) {
+ if (options) {
+ speed = options.duration * 1000;
+ } else {
+ speed = null;
+ }
+ e = o.replace(/\_(.)/g, function(m, l){return l.toUpperCase()});
+ return eval('$(this).'+e+'('+ speed + ')');
+ },
+ appear : function(speed, callback) {
+ return this.fadeIn(speed, callback);
+ },
+ blindDown : function(speed, callback) {
+ return this.show('blind', { direction: 'vertical' }, speed, callback);
+ },
+ blindUp : function(speed, callback) {
+ return this.hide('blind', { direction: 'vertical' }, speed, callback);
+ },
+ blindRight : function(speed, callback) {
+ return this.show('blind', { direction: 'horizontal' }, speed, callback);
+ },
+ blindLeft : function(speed, callback) {
+ this.hide('blind', { direction: 'horizontal' }, speed, callback);
+ return this;
+ },
+ dropOut : function(speed, callback) {
+ return this.hide('drop', {direction: 'down' }, speed, callback);
+ },
+ dropIn : function(speed, callback) {
+ return this.show('drop', { direction: 'up' }, speed, callback);
+ },
+ fade : function(speed, callback) {
+ return this.fadeOut(speed, callback);
+ },
+ fadeToggle : function(speed, callback) {
+ return this.animate({opacity: 'toggle'}, speed, callback);
+ },
+ fold : function(speed, callback) {
+ return this.hide('fold', {}, speed, callback);
+ },
+ foldOut : function(speed, callback) {
+ return this.show('fold', {}, speed, callback);
+ },
+ grow : function(speed, callback) {
+ return this.show('scale', {}, speed, callback);
+ },
+ highlight : function(speed, callback) {
+ return this.show('highlight', {}, speed, callback);
+ },
+ puff : function(speed, callback) {
+ return this.hide('puff', {}, speed, callback);
+ },
+ pulsate : function(speed, callback) {
+ return this.show('pulsate', {}, speed, callback);
+ },
+ shake : function(speed, callback) {
+ return this.show('shake', {}, speed, callback);
+ },
+ shrink : function(speed, callback) {
+ return this.hide('scale', {}, speed, callback);
+ },
+ squish : function(speed, callback) {
+ return this.hide('scale', { origin: ['top', 'left'] }, speed, callback);
+ },
+ slideUp : function(speed, callback) {
+ return this.hide('slide', { direction: 'up'}, speed, callback);
+ },
+ slideDown : function(speed, callback) {
+ return this.show('slide', { direction: 'up'}, speed, callback);
+ },
+ switchOff : function(speed, callback) {
+ return this.hide('clip', {}, speed, callback);
+ },
+ switchOn : function(speed, callback) {
+ return this.show('clip', {}, speed, callback);
+ }
+ });
+})(jQuery);
Oops, something went wrong.

0 comments on commit dd5af92

Please sign in to comment.