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 +3 -2
- data/generators/jelly/templates/javascripts/ajax_with_jelly.js +1 -1
- data/generators/jelly/templates/javascripts/jelly.js +128 -125
- data/jelly.gemspec +18 -17
- metadata +58 -20
data/VERSION.yml
CHANGED
@@ -11,160 +11,163 @@
|
|
11
11
|
*
|
12
12
|
*/
|
13
13
|
|
14
|
-
|
15
|
-
if (!
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
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,
|
49
|
+
Jelly.Observers.pushIfObserver.call(this, component);
|
45
50
|
}
|
46
51
|
} else {
|
47
|
-
Jelly.Observers.pushIfObserver.call(this,
|
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
|
-
|
56
|
-
|
57
|
-
|
57
|
+
evaluateComponent: function(component) {
|
58
|
+
return eval(component);
|
59
|
+
},
|
58
60
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
61
|
+
pushIfObserver: function(observer) {
|
62
|
+
if (observer) {
|
63
|
+
this.push(observer);
|
64
|
+
}
|
65
|
+
},
|
64
66
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
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
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
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
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
-
|
96
|
-
|
97
|
+
if (instruction.attach) {
|
98
|
+
Jelly.Observers.attach.apply(this, instruction.attach);
|
99
|
+
}
|
97
100
|
}
|
98
|
-
}
|
99
101
|
|
100
|
-
|
101
|
-
|
102
|
+
Jelly.Observers.notifying = previousNotifying;
|
103
|
+
},
|
102
104
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
-
|
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
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
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
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
},
|
131
|
+
Pages: {
|
132
|
+
init: function() {
|
133
|
+
this.all = {};
|
134
|
+
Jelly.all = this.all; // Deprecated
|
135
|
+
},
|
128
136
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
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
|
-
|
158
|
-
|
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
|
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.
|
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-
|
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.
|
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/
|
48
|
-
"spec/
|
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/
|
55
|
-
"spec/rails_root/
|
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/
|
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::
|
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
|
-
|
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-
|
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
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
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.
|
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/
|
85
|
-
- spec/
|
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/
|
92
|
-
- spec/rails_root/
|
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/
|
100
|
-
- spec/spec_suite.rb
|
138
|
+
- spec/rails_root/test/performance/browsing_test.rb
|