jointjs 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +7 -8
- data/lib/jointjs/app/assets/javascripts/joint/creator.js.coffee +3 -0
- data/lib/jointjs/version.rb +1 -1
- data/test/db/joint_test +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f4f75852f8db4713003b1cc28e7780d7cebe1ea
|
4
|
+
data.tar.gz: d282b4b94e8475c5fab613a72ddf8d5a9636304c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0db61a1085e865b0751f05d6f819e561d1287160d6d98d7fe186eec837edd5ffa057e9b80c964b0a2f2586440086639c38ce55df6a704827b8f6ae94c085fba1
|
7
|
+
data.tar.gz: 4eee4d270f8b17ad0084a72f16d5c8971bc49bc9fd609464aa8476198aafffecd6e49f7140077e8b07755a44e39c99d57336317601a4cb11507ddf4931dfdde4
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# JointJS
|
2
2
|
|
3
3
|
Event based JavaScript framework tailored made for Ruby on rails.
|
4
4
|
|
@@ -7,17 +7,17 @@ Event based JavaScript framework tailored made for Ruby on rails.
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem '
|
10
|
+
gem 'jointjs'
|
11
11
|
```
|
12
12
|
|
13
13
|
Then add this line to application.js
|
14
14
|
|
15
15
|
```js
|
16
|
-
//= require '
|
16
|
+
//= require 'joint'
|
17
17
|
```
|
18
18
|
## Usage
|
19
19
|
|
20
|
-
|
20
|
+
JointJSe is an event based framework that manages the life cycle of JavaScript objects. Here's a simple Todo where you can dynamically add/remove items on the list.
|
21
21
|
|
22
22
|
```erb
|
23
23
|
<!-- views/todos/index.html.erb -->
|
@@ -28,7 +28,7 @@ Ethereal is an event based framework that manages the life cycle of JavaScript o
|
|
28
28
|
|
29
29
|
```coffee
|
30
30
|
# assets/javascripts/todos/list.js.coffee
|
31
|
-
class
|
31
|
+
Joint.bind 'Todo.List', class
|
32
32
|
# @element() always return the element to which your object is bound.
|
33
33
|
|
34
34
|
loaded: =>
|
@@ -41,7 +41,6 @@ class Todos
|
|
41
41
|
delete: (e) =>
|
42
42
|
@element().querySelector("[tid=#{e.todoId}]")?.remove()
|
43
43
|
|
44
|
-
Ethereal.Models.add Todos, 'Todo.List'
|
45
44
|
```
|
46
45
|
|
47
46
|
```ruby
|
@@ -58,9 +57,9 @@ Some notes:
|
|
58
57
|
|
59
58
|
- Automatic instantiation. No need to wrap things in DOMContentReady anymore.
|
60
59
|
- Events are built following the "controller:action" pattern.
|
61
|
-
- A callback (@loaded) is called right after
|
60
|
+
- A callback (@loaded) is called right after JointJS has instantiated an object.
|
62
61
|
- In *.js.erb, an event is created. You can set HTML to the event object.
|
63
62
|
- To ease the process, a toHTML() method has been added to the String object (JS).
|
64
|
-
- You need to register any class you create through the ```
|
63
|
+
- You need to register any class you create through the ```Joint.bind 'name', Class```. The name is the attribute you set in your DOM.
|
65
64
|
|
66
65
|
|
data/lib/jointjs/version.rb
CHANGED
data/test/db/joint_test
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jointjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pier-Olivier Thibault
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|