ajaxlibs 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/ajaxlibs/libraries/ext_core.rb +12 -0
- data/lib/ajaxlibs/libraries/jrails.rb +9 -0
- data/lib/ajaxlibs/library.rb +1 -1
- data/lib/ajaxlibs.rb +1 -0
- data/public/jrails/0.5.0/jrails.js +1 -0
- data/spec/library_spec.rb +11 -2
- metadata +6 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/lib/ajaxlibs/library.rb
CHANGED
@@ -71,7 +71,7 @@ class Ajaxlibs::Library
|
|
71
71
|
|
72
72
|
# Javascript include path regarding source (call either local_path or google_cdn_include_path)
|
73
73
|
def include_path
|
74
|
-
source == :local ? local_path : google_cdn_include_path
|
74
|
+
(source == :local or local_only?) ? local_path : google_cdn_include_path
|
75
75
|
end
|
76
76
|
|
77
77
|
def local_only?
|
data/lib/ajaxlibs.rb
CHANGED
@@ -5,6 +5,7 @@ require 'ajaxlibs/library'
|
|
5
5
|
require 'ajaxlibs/libraries/dojo'
|
6
6
|
require 'ajaxlibs/libraries/jquery'
|
7
7
|
require 'ajaxlibs/libraries/jqueryui'
|
8
|
+
require 'ajaxlibs/libraries/jrails'
|
8
9
|
require 'ajaxlibs/libraries/mootools'
|
9
10
|
require 'ajaxlibs/libraries/prototype'
|
10
11
|
require 'ajaxlibs/libraries/scriptaculous'
|
@@ -0,0 +1 @@
|
|
1
|
+
(function($){$.ajaxSettings.accepts._default="text/javascript, text/html, application/xml, text/xml, */*"})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({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({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(){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);(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);
|
data/spec/library_spec.rb
CHANGED
@@ -85,8 +85,17 @@ describe "Ajaxlibs::Library" do
|
|
85
85
|
|
86
86
|
example "while calling include_path" do
|
87
87
|
@library.include_path.should == @library.local_path
|
88
|
-
end
|
89
|
-
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
it "will return a local path if library is local only" do
|
92
|
+
@library = Ajaxlibs::Library::Jrails.new
|
93
|
+
@library.include_path.should == @library.local_path
|
94
|
+
end
|
95
|
+
|
96
|
+
it "will return a local path if library is local only even if asked for remote source" do
|
97
|
+
@library = Ajaxlibs::Library::Jrails.new(:source => :remote)
|
98
|
+
@library.include_path.should == @library.local_path
|
90
99
|
end
|
91
100
|
|
92
101
|
context "will return a javascript code to load from google cdn with library_name and version" do
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Fabien Jakimowicz
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-18 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -52,8 +52,10 @@ files:
|
|
52
52
|
- lib/ajaxlibs/exceptions.rb
|
53
53
|
- lib/ajaxlibs/includes_helper.rb
|
54
54
|
- lib/ajaxlibs/libraries/dojo.rb
|
55
|
+
- lib/ajaxlibs/libraries/ext_core.rb
|
55
56
|
- lib/ajaxlibs/libraries/jquery.rb
|
56
57
|
- lib/ajaxlibs/libraries/jqueryui.rb
|
58
|
+
- lib/ajaxlibs/libraries/jrails.rb
|
57
59
|
- lib/ajaxlibs/libraries/mootools.rb
|
58
60
|
- lib/ajaxlibs/libraries/prototype.rb
|
59
61
|
- lib/ajaxlibs/libraries/scriptaculous.rb
|
@@ -81,6 +83,7 @@ files:
|
|
81
83
|
- public/jqueryui/1.7.0/jquery-ui.js
|
82
84
|
- public/jqueryui/1.7.1/jquery-ui.js
|
83
85
|
- public/jqueryui/1.7.2/jquery-ui.js
|
86
|
+
- public/jrails/0.5.0/jrails.js
|
84
87
|
- public/mootools/1.1.1/mootools.js
|
85
88
|
- public/mootools/1.1.2/mootools.js
|
86
89
|
- public/mootools/1.2.1/mootools.js
|