honkster-jelly 0.8.13 → 0.8.14

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
- :minor: 8
3
- :patch: 13
2
+ :patch: 14
4
3
  :major: 0
4
+ :minor: 8
5
+ :build:
@@ -1,4 +1,4 @@
1
- if(!window.Jelly) Jelly = new Object();
1
+ if(!window.Jelly) window.Jelly = new Object();
2
2
 
3
3
  (Jelly.defineAjaxWithJellyFunctions = function($) {
4
4
  $.ajaxWithJelly = function(params) {
@@ -11,160 +11,163 @@
11
11
  *
12
12
  */
13
13
 
14
- if (!window.Jelly) Jelly = new Object();
15
- if (!Function.prototype.bind) {
16
- Function.prototype.bind = function(object) {
17
- var self = this;
18
- return function() {
19
- return self.apply(object, arguments);
14
+ (function($) {
15
+ if (!window.Jelly) window.Jelly = new Object();
16
+ var Jelly = window.Jelly;
17
+ if (!Function.prototype.bind) {
18
+ Function.prototype.bind = function(object) {
19
+ var self = this;
20
+ return function() {
21
+ return self.apply(object, arguments);
22
+ }
20
23
  }
21
24
  }
22
- }
23
- $.extend(Jelly, {
24
- init: function() {
25
- this.observers = [];
26
- this.attach = this.Observers.attach;
27
- this.notifyObservers = this.Observers.notify;
28
- this.Pages.init();
29
- },
30
-
31
- Observers: {
32
- attach: function() {
33
- if (this == Jelly) {
34
- return Jelly.Observers.attach.apply(this.observers, arguments);
35
- }
36
- for (var i = 0; i < arguments.length; i++) {
37
- var definitionOrComponent = arguments[i];
38
- if (definitionOrComponent.component) {
39
- var component = Jelly.Observers.evaluateComponent(definitionOrComponent.component);
40
- if (component.init) {
41
- var initReturnValue = component.init.apply(component, definitionOrComponent.arguments);
42
- if (initReturnValue === false || initReturnValue === null) {
25
+ $.extend(Jelly, {
26
+ init: function() {
27
+ this.observers = [];
28
+ this.attach = this.Observers.attach;
29
+ this.notifyObservers = this.Observers.notify;
30
+ this.Pages.init();
31
+ },
32
+
33
+ Observers: {
34
+ attach: function() {
35
+ if (this == Jelly) {
36
+ return Jelly.Observers.attach.apply(this.observers, arguments);
37
+ }
38
+ for (var i = 0; i < arguments.length; i++) {
39
+ var definitionOrComponent = arguments[i];
40
+ if (definitionOrComponent.component) {
41
+ var component = Jelly.Observers.evaluateComponent(definitionOrComponent.component);
42
+ if (component.init) {
43
+ var initReturnValue = component.init.apply(component, definitionOrComponent.arguments);
44
+ if (initReturnValue === false || initReturnValue === null) {
45
+ } else {
46
+ Jelly.Observers.pushIfObserver.call(this, initReturnValue || component);
47
+ }
43
48
  } else {
44
- Jelly.Observers.pushIfObserver.call(this, initReturnValue || component);
49
+ Jelly.Observers.pushIfObserver.call(this, component);
45
50
  }
46
51
  } else {
47
- Jelly.Observers.pushIfObserver.call(this, component);
52
+ Jelly.Observers.pushIfObserver.call(this, Jelly.Observers.evaluateComponent(definitionOrComponent));
48
53
  }
49
- } else {
50
- Jelly.Observers.pushIfObserver.call(this, Jelly.Observers.evaluateComponent(definitionOrComponent));
51
54
  }
52
- }
53
- },
55
+ },
54
56
 
55
- evaluateComponent: function(component) {
56
- return eval(component);
57
- },
57
+ evaluateComponent: function(component) {
58
+ return eval(component);
59
+ },
58
60
 
59
- pushIfObserver: function(observer) {
60
- if (observer) {
61
- this.push(observer);
62
- }
63
- },
61
+ pushIfObserver: function(observer) {
62
+ if (observer) {
63
+ this.push(observer);
64
+ }
65
+ },
64
66
 
65
- notify: function(instructions) {
66
- if (this == Jelly) {
67
- return Jelly.Observers.notify.apply(this.observers, arguments);
68
- }
69
- var previousNotifying = Jelly.Observers.notifying;
70
- Jelly.Observers.notifying = true;
71
- if (!$.isArray(instructions)) {
72
- instructions = [instructions];
73
- }
67
+ notify: function(instructions) {
68
+ if (this == Jelly) {
69
+ return Jelly.Observers.notify.apply(this.observers, arguments);
70
+ }
71
+ var previousNotifying = Jelly.Observers.notifying;
72
+ Jelly.Observers.notifying = true;
73
+ if (!$.isArray(instructions)) {
74
+ instructions = [instructions];
75
+ }
74
76
 
75
- var pristineObservers = this.slice(0);
76
- var observers;
77
- for (var i = 0; i < instructions.length; i++) {
78
- var instruction = instructions[i];
77
+ var pristineObservers = this.slice(0);
78
+ var observers;
79
+ for (var i = 0; i < instructions.length; i++) {
80
+ var instruction = instructions[i];
79
81
 
80
- // Deprecate 'on' in favor of making each page action a Component.
81
- if (instruction.on) {
82
- observers = [eval(instruction.on)];
83
- } else {
84
- observers = pristineObservers;
85
- }
82
+ // Deprecate 'on' in favor of making each page action a Component.
83
+ if (instruction.on) {
84
+ observers = [eval(instruction.on)];
85
+ } else {
86
+ observers = pristineObservers;
87
+ }
86
88
 
87
- if (instruction.method) {
88
- for (var j = 0; j < observers.length; j++) {
89
- var observer = observers[j];
90
- Jelly.Observers.notifyObserver.call(this, observer, instruction.method, instruction.arguments);
91
- Jelly.Observers.notifyObserver.call(this, observer, 'on_notify', [instruction]);
89
+ if (instruction.method) {
90
+ for (var j = 0; j < observers.length; j++) {
91
+ var observer = observers[j];
92
+ Jelly.Observers.notifyObserver.call(this, observer, instruction.method, instruction.arguments);
93
+ Jelly.Observers.notifyObserver.call(this, observer, 'on_notify', [instruction]);
94
+ }
92
95
  }
93
- }
94
96
 
95
- if (instruction.attach) {
96
- Jelly.Observers.attach.apply(this, instruction.attach);
97
+ if (instruction.attach) {
98
+ Jelly.Observers.attach.apply(this, instruction.attach);
99
+ }
97
100
  }
98
- }
99
101
 
100
- Jelly.Observers.notifying = previousNotifying;
101
- },
102
+ Jelly.Observers.notifying = previousNotifying;
103
+ },
102
104
 
103
- notifyObserver: function(observer, method, arguments) {
104
- if (observer[method]) {
105
- if (observer.detach && observer.detach()) {
106
- Jelly.Observers.garbageCollectObserver.call(this, observer);
107
- } else {
108
- observer[method].apply(observer, arguments);
105
+ notifyObserver: function(observer, method, arguments) {
106
+ if (observer[method]) {
107
+ if (observer.detach && observer.detach()) {
108
+ Jelly.Observers.garbageCollectObserver.call(this, observer);
109
+ } else {
110
+ observer[method].apply(observer, arguments);
111
+ }
109
112
  }
110
- }
111
- },
113
+ },
112
114
 
113
- notifying: false,
115
+ notifying: false,
116
+
117
+ garbageCollectObserver: function(observer) {
118
+ var index = this.indexOf(observer);
119
+ if (index > -1) {
120
+ Jelly.Observers.remove.call(this, index, index + 1);
121
+ }
122
+ },
114
123
 
115
- garbageCollectObserver: function(observer) {
116
- var index = this.indexOf(observer);
117
- if (index > -1) {
118
- Jelly.Observers.remove.call(this, index, index + 1);
124
+ remove: function(from, to) {
125
+ var rest = this.slice((to || from) + 1 || this.length);
126
+ this.length = from < 0 ? this.length + from : from;
127
+ return this.push.apply(this, rest);
119
128
  }
120
129
  },
121
130
 
122
- remove: function(from, to) {
123
- var rest = this.slice((to || from) + 1 || this.length);
124
- this.length = from < 0 ? this.length + from : from;
125
- return this.push.apply(this, rest);
126
- }
127
- },
131
+ Pages: {
132
+ init: function() {
133
+ this.all = {};
134
+ Jelly.all = this.all; // Deprecated
135
+ },
128
136
 
129
- Pages: {
130
- init: function() {
131
- this.all = {};
132
- Jelly.all = this.all; // Deprecated
137
+ add: function(name) {
138
+ var page = new Jelly.Page.Constructor(name);
139
+ for (var i = 1; i < arguments.length; i++) {
140
+ $.extend(page, arguments[i]);
141
+ }
142
+ return page;
143
+ }
133
144
  },
134
145
 
135
- add: function(name) {
136
- var page = new Jelly.Page.Constructor(name);
137
- for (var i = 1; i < arguments.length; i++) {
138
- $.extend(page, arguments[i]);
146
+ Page: {
147
+ init: function(controllerName, actionName) {
148
+ var page = Jelly.Pages.all[controllerName] || new Jelly.Page.Constructor(controllerName);
149
+ window.page = page;
150
+ if (page.all) page.all();
151
+ if (page[actionName]) page[actionName].call(page);
152
+ page.loaded = true;
153
+ return page;
154
+ },
155
+ Constructor: function(name) {
156
+ this.loaded = false;
157
+ this.documentHref = Jelly.Location.documentHref;
158
+
159
+ this.name = name;
160
+ Jelly.Pages.all[name] = this;
139
161
  }
140
- return page;
141
- }
142
- },
143
-
144
- Page: {
145
- init: function(controllerName, actionName) {
146
- var page = Jelly.Pages.all[controllerName] || new Jelly.Page.Constructor(controllerName);
147
- window.page = page;
148
- if (page.all) page.all();
149
- if (page[actionName]) page[actionName].call(page);
150
- page.loaded = true;
151
- return page;
152
162
  },
153
- Constructor: function(name) {
154
- this.loaded = false;
155
- this.documentHref = Jelly.Location.documentHref;
156
163
 
157
- this.name = name;
158
- Jelly.Pages.all[name] = this;
159
- }
160
- },
161
-
162
- Location: {
163
- on_redirect: function(location) {
164
- top.location.href = location;
164
+ Location: {
165
+ on_redirect: function(location) {
166
+ top.location.href = location;
167
+ }
165
168
  }
166
- }
167
- });
168
- Jelly.add = Jelly.Pages.add; // Deprecated
169
+ });
170
+ Jelly.add = Jelly.Pages.add; // Deprecated
169
171
 
170
- Jelly.init();
172
+ Jelly.init();
173
+ })(jQuery)
data/jelly.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jelly}
8
- s.version = "0.8.13"
8
+ s.version = "0.8.14"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Pivotal Labs, Inc"]
12
- s.date = %q{2010-01-12}
12
+ s.date = %q{2010-05-31}
13
13
  s.description = %q{Jelly provides a set of tools and conventions for creating rich ajax/javascript web applications with jQuery and Ruby on Rails.}
14
14
  s.email = %q{opensource@pivotallabs.com}
15
15
  s.extra_rdoc_files = [
@@ -38,36 +38,36 @@ Gem::Specification.new do |s|
38
38
  s.homepage = %q{http://github.com/pivotal/jelly}
39
39
  s.rdoc_options = ["--charset=UTF-8"]
40
40
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.5}
41
+ s.rubygems_version = %q{1.3.7}
42
42
  s.summary = %q{a sweet unobtrusive javascript framework for jQuery and Rails}
43
43
  s.test_files = [
44
44
  "spec/jelly/common_spec.rb",
45
45
  "spec/jelly/jelly_controller_spec.rb",
46
46
  "spec/jelly/jelly_helper_spec.rb",
47
- "spec/rails_root/app/controllers/application_controller.rb",
48
- "spec/rails_root/app/helpers/application_helper.rb",
47
+ "spec/spec_helper.rb",
48
+ "spec/spec_suite.rb",
49
+ "spec/rails_root/config/initializers/session_store.rb",
50
+ "spec/rails_root/config/initializers/backtrace_silencers.rb",
51
+ "spec/rails_root/config/initializers/mime_types.rb",
52
+ "spec/rails_root/config/initializers/inflections.rb",
53
+ "spec/rails_root/config/initializers/new_rails_defaults.rb",
49
54
  "spec/rails_root/config/boot.rb",
55
+ "spec/rails_root/config/routes.rb",
50
56
  "spec/rails_root/config/environment.rb",
51
57
  "spec/rails_root/config/environments/development.rb",
52
58
  "spec/rails_root/config/environments/production.rb",
53
59
  "spec/rails_root/config/environments/test.rb",
54
- "spec/rails_root/config/initializers/backtrace_silencers.rb",
55
- "spec/rails_root/config/initializers/inflections.rb",
56
- "spec/rails_root/config/initializers/mime_types.rb",
57
- "spec/rails_root/config/initializers/new_rails_defaults.rb",
58
- "spec/rails_root/config/initializers/session_store.rb",
59
- "spec/rails_root/config/routes.rb",
60
- "spec/rails_root/test/performance/browsing_test.rb",
60
+ "spec/rails_root/app/controllers/application_controller.rb",
61
+ "spec/rails_root/app/helpers/application_helper.rb",
61
62
  "spec/rails_root/test/test_helper.rb",
62
- "spec/spec_helper.rb",
63
- "spec/spec_suite.rb"
63
+ "spec/rails_root/test/performance/browsing_test.rb"
64
64
  ]
65
65
 
66
66
  if s.respond_to? :specification_version then
67
67
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
68
68
  s.specification_version = 3
69
69
 
70
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
70
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
71
71
  s.add_runtime_dependency(%q<rails>, [">= 2.3.0"])
72
72
  else
73
73
  s.add_dependency(%q<rails>, [">= 2.3.0"])
@@ -76,3 +76,4 @@ Gem::Specification.new do |s|
76
76
  s.add_dependency(%q<rails>, [">= 2.3.0"])
77
77
  end
78
78
  end
79
+
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkster-jelly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ hash: 35
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 8
9
+ - 14
10
+ version: 0.8.14
5
11
  platform: ruby
6
12
  authors:
7
13
  - Pivotal Labs, Inc
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-01-12 00:00:00 -08:00
18
+ date: 2010-05-31 00:00:00 -07:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: rails
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 2
32
+ - 3
33
+ - 0
23
34
  version: 2.3.0
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  description: Jelly provides a set of tools and conventions for creating rich ajax/javascript web applications with jQuery and Ruby on Rails.
26
38
  email: opensource@pivotallabs.com
27
39
  executables: []
@@ -49,6 +61,26 @@ files:
49
61
  - lib/jelly/jelly_helper.rb
50
62
  - tasks/jelly_tasks.rake
51
63
  - uninstall.rb
64
+ - spec/jelly/common_spec.rb
65
+ - spec/jelly/jelly_controller_spec.rb
66
+ - spec/jelly/jelly_helper_spec.rb
67
+ - spec/spec_helper.rb
68
+ - spec/spec_suite.rb
69
+ - spec/rails_root/config/initializers/session_store.rb
70
+ - spec/rails_root/config/initializers/backtrace_silencers.rb
71
+ - spec/rails_root/config/initializers/mime_types.rb
72
+ - spec/rails_root/config/initializers/inflections.rb
73
+ - spec/rails_root/config/initializers/new_rails_defaults.rb
74
+ - spec/rails_root/config/boot.rb
75
+ - spec/rails_root/config/routes.rb
76
+ - spec/rails_root/config/environment.rb
77
+ - spec/rails_root/config/environments/development.rb
78
+ - spec/rails_root/config/environments/production.rb
79
+ - spec/rails_root/config/environments/test.rb
80
+ - spec/rails_root/app/controllers/application_controller.rb
81
+ - spec/rails_root/app/helpers/application_helper.rb
82
+ - spec/rails_root/test/test_helper.rb
83
+ - spec/rails_root/test/performance/browsing_test.rb
52
84
  has_rdoc: true
53
85
  homepage: http://github.com/pivotal/jelly
54
86
  licenses: []
@@ -59,21 +91,27 @@ rdoc_options:
59
91
  require_paths:
60
92
  - lib
61
93
  required_ruby_version: !ruby/object:Gem::Requirement
94
+ none: false
62
95
  requirements:
63
96
  - - ">="
64
97
  - !ruby/object:Gem::Version
98
+ hash: 3
99
+ segments:
100
+ - 0
65
101
  version: "0"
66
- version:
67
102
  required_rubygems_version: !ruby/object:Gem::Requirement
103
+ none: false
68
104
  requirements:
69
105
  - - ">="
70
106
  - !ruby/object:Gem::Version
107
+ hash: 3
108
+ segments:
109
+ - 0
71
110
  version: "0"
72
- version:
73
111
  requirements: []
74
112
 
75
113
  rubyforge_project:
76
- rubygems_version: 1.3.5
114
+ rubygems_version: 1.3.7
77
115
  signing_key:
78
116
  specification_version: 3
79
117
  summary: a sweet unobtrusive javascript framework for jQuery and Rails
@@ -81,20 +119,20 @@ test_files:
81
119
  - spec/jelly/common_spec.rb
82
120
  - spec/jelly/jelly_controller_spec.rb
83
121
  - spec/jelly/jelly_helper_spec.rb
84
- - spec/rails_root/app/controllers/application_controller.rb
85
- - spec/rails_root/app/helpers/application_helper.rb
122
+ - spec/spec_helper.rb
123
+ - spec/spec_suite.rb
124
+ - spec/rails_root/config/initializers/session_store.rb
125
+ - spec/rails_root/config/initializers/backtrace_silencers.rb
126
+ - spec/rails_root/config/initializers/mime_types.rb
127
+ - spec/rails_root/config/initializers/inflections.rb
128
+ - spec/rails_root/config/initializers/new_rails_defaults.rb
86
129
  - spec/rails_root/config/boot.rb
130
+ - spec/rails_root/config/routes.rb
87
131
  - spec/rails_root/config/environment.rb
88
132
  - spec/rails_root/config/environments/development.rb
89
133
  - spec/rails_root/config/environments/production.rb
90
134
  - spec/rails_root/config/environments/test.rb
91
- - spec/rails_root/config/initializers/backtrace_silencers.rb
92
- - spec/rails_root/config/initializers/inflections.rb
93
- - spec/rails_root/config/initializers/mime_types.rb
94
- - spec/rails_root/config/initializers/new_rails_defaults.rb
95
- - spec/rails_root/config/initializers/session_store.rb
96
- - spec/rails_root/config/routes.rb
97
- - spec/rails_root/test/performance/browsing_test.rb
135
+ - spec/rails_root/app/controllers/application_controller.rb
136
+ - spec/rails_root/app/helpers/application_helper.rb
98
137
  - spec/rails_root/test/test_helper.rb
99
- - spec/spec_helper.rb
100
- - spec/spec_suite.rb
138
+ - spec/rails_root/test/performance/browsing_test.rb