eyeballs 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/eyeballs.gemspec +2 -2
- data/lib/eyeballs/app_detector.rb +12 -0
- data/lib/eyeballs/scaffold_generator.rb +2 -2
- data/templates/app_root/config/initializer.js +5 -1
- data/templates/scaffold_edit.html.mustache +4 -2
- data/templates/scaffold_index.html +13 -11
- metadata +4 -4
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -257,17 +257,17 @@ Tasty!
|
|
257
257
|
|
258
258
|
To bind events to these controller actions, use the data-bind attribute:
|
259
259
|
|
260
|
-
<a href="/posts/new" data-
|
260
|
+
<a href="/posts/new" data-bind="posts#new">Click me!</a>
|
261
261
|
|
262
262
|
This binds all clicks on this element to the new action on the PostsController. By default, if you add these attributes to a form, the action is bound to the submit event; to all other elements it binds to a click.
|
263
263
|
|
264
264
|
It also returns false, canceling out the default behavior. If you want the default behavior, prefix with `+` to "add" the action to the propagation chain:
|
265
265
|
|
266
|
-
<a href="/posts/new" data-
|
266
|
+
<a href="/posts/new" data-bind="+posts#new">Click me!</a>
|
267
267
|
|
268
268
|
You can also bind to custom events:
|
269
269
|
|
270
|
-
<a href="/posts/new" data-
|
270
|
+
<a href="/posts/new" data-bind="+mouseover:posts#new">Hover over me!</a>
|
271
271
|
|
272
272
|
You can bind multiple events and actions to a single element:
|
273
273
|
|
data/Rakefile
CHANGED
data/eyeballs.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{eyeballs}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Paul Campbell"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-08-01}
|
13
13
|
s.default_executable = %q{eyeballs}
|
14
14
|
s.email = %q{paul@rslw.com}
|
15
15
|
s.executables = ["eyeballs"]
|
@@ -29,9 +29,9 @@ module Eyeballs
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def build_the_views
|
32
|
-
template "templates/scaffold_index.html", "#{
|
32
|
+
template "templates/scaffold_index.html", "#{public_path}/#{name.downcase.pluralize}.html"
|
33
33
|
template "templates/scaffold_partial.html.mustache", "#{app_path}/app/views/#{name.downcase.pluralize}/_#{name.downcase}.html.mustache"
|
34
|
-
template "
|
34
|
+
template "templates/scaffold_edit.html.mustache", "#{app_path}/app/views/#{name.downcase.pluralize}/edit.html.mustache"
|
35
35
|
end
|
36
36
|
|
37
37
|
def farewell
|
@@ -1,4 +1,8 @@
|
|
1
1
|
// This is a very handy place to put any initial logic
|
2
2
|
// For example, choosing your adapter
|
3
|
+
<% if rack_app? %>
|
3
4
|
o_O.model.adapter = o_O.rest;
|
4
|
-
o_O.config.authenticity_token = $('meta[name=csrf-token]').attr('content')
|
5
|
+
o_O.config.authenticity_token = $('meta[name=csrf-token]').attr('content')
|
6
|
+
<% else %>
|
7
|
+
o_O.model.adapter = o_O.localstorage;
|
8
|
+
<% end %>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<div class="edit-<%= name.downcase %>">
|
2
|
-
<form data-id="{{id}}" data-
|
2
|
+
<form data-id="{{id}}" data-bind="<%= name.downcase.pluralize %>#update">
|
3
3
|
<%- attributes.each do |attribute| %>
|
4
4
|
<label for="<%= name.downcase %>-<%= attribute.name %>"><%= attribute.name.titlecase %></label><br />
|
5
5
|
<%- if attribute.type == 'text' %>
|
@@ -8,6 +8,8 @@
|
|
8
8
|
<input type="text" name="<%= attribute.name %>" value="{{<%= attribute.name %>}}" data-attribute="<%= attribute.name %>"><br />
|
9
9
|
<%- end -%>
|
10
10
|
<%- end -%>
|
11
|
-
<input type="submit" name="commit" value="Save">
|
11
|
+
<input type="submit" name="commit" value="Save">
|
12
|
+
or
|
13
|
+
<a href="#" data-controller="<%= name.downcase.pluralize %>#cancel_edit">Cancel</a>
|
12
14
|
</form>
|
13
15
|
</div>
|
@@ -28,17 +28,19 @@
|
|
28
28
|
|
29
29
|
</div>
|
30
30
|
</body>
|
31
|
-
<script src="vendor/jquery/jquery-1.4.2.min.js"></script>
|
32
|
-
<script src="vendor/
|
33
|
-
<script src="vendor/
|
34
|
-
<script src="vendor/eyeballs/o_O.js"></script>
|
35
|
-
<script src="vendor/eyeballs/
|
36
|
-
<script src="vendor/eyeballs/o_O.
|
37
|
-
<script
|
38
|
-
|
39
|
-
|
40
|
-
<script src="
|
41
|
-
<script src="
|
31
|
+
<script src="<%= prefix %>vendor/jquery/jquery-1.4.2.min.js"></script>
|
32
|
+
<script src="<%= prefix %>vendor/mustache/mustache.0.2.3.js"></script>
|
33
|
+
<script src="<%= prefix %>vendor/eyeballs/o_O.js"></script>
|
34
|
+
<script src="<%= prefix %>vendor/eyeballs/modules/o_O.model.js"></script>
|
35
|
+
<script src="<%= prefix %>vendor/eyeballs/modules/o_O.validations.js"></script>
|
36
|
+
<script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.controller.js"></script>
|
37
|
+
<script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.routes.js"></script>
|
38
|
+
<script src="<%= prefix %>vendor/eyeballs/drivers/jquery/modules/o_O.support.js"></script>
|
39
|
+
<script src="<%= prefix %>vendor/eyeballs/adapters/o_O.localstorage.js"></script>
|
40
|
+
<script src="<%= prefix %>config/initializer.js"></script>
|
41
|
+
<script src="<%= prefix %>config/routes.js"></script>
|
42
|
+
<script src="<%= prefix %>app/models/<%= name.downcase %>.js"></script>
|
43
|
+
<script src="<%= prefix %>app/controllers/<%= name.downcase.pluralize %>_controller.js"></script>
|
42
44
|
<script type="text/javascript" charset="utf-8">
|
43
45
|
$(function(){
|
44
46
|
<%= name.capitalize.pluralize %>Controller.index();
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eyeballs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Campbell
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-08-01 00:00:00 +01:00
|
19
19
|
default_executable: eyeballs
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|