jointjs 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f81115aa1ce8a93aa1629486dd6a6f9c7fe5192b
4
- data.tar.gz: e379c48042f370eae737ed535d1dab71afe08aee
3
+ metadata.gz: 5f4f75852f8db4713003b1cc28e7780d7cebe1ea
4
+ data.tar.gz: d282b4b94e8475c5fab613a72ddf8d5a9636304c
5
5
  SHA512:
6
- metadata.gz: 6dabe31450383d3a69b87cbe490d07ae46d6f01927df7404f812d8b1af2580511fa78a44c5f5836b0a74e9b4a526bb1c67a09d3342326504fc03220b278e159d
7
- data.tar.gz: bfce9aebd8a14f896baf57625a379c602cf0628844936cd604c647ff509cba2d5e99e4f445b9355b89e7fbfd8f9a58e4f150187ceee05762c439f1b4cefa1fc9
6
+ metadata.gz: 0db61a1085e865b0751f05d6f819e561d1287160d6d98d7fe186eec837edd5ffa057e9b80c964b0a2f2586440086639c38ce55df6a704827b8f6ae94c085fba1
7
+ data.tar.gz: 4eee4d270f8b17ad0084a72f16d5c8971bc49bc9fd609464aa8476198aafffecd6e49f7140077e8b07755a44e39c99d57336317601a4cb11507ddf4931dfdde4
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Ethereal
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 'ethereal'
10
+ gem 'jointjs'
11
11
  ```
12
12
 
13
13
  Then add this line to application.js
14
14
 
15
15
  ```js
16
- //= require 'ethereal'
16
+ //= require 'joint'
17
17
  ```
18
18
  ## Usage
19
19
 
20
- Ethereal 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.
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 Todos
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 Ethereal has instantiated an object.
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 ```Ethereal.Models.add Class, 'name'```. The name is the attribute you set in your DOM.
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
 
@@ -10,6 +10,9 @@ class Creator
10
10
  create: (el) =>
11
11
  model = el.getAttribute(Joint.attributeName)
12
12
  if Joint.cache[model]?
13
+ if el.instance?
14
+ return
15
+
13
16
  el.instance = new Joint.cache[model](el)
14
17
 
15
18
  el.instance.element = ->
@@ -1,3 +1,3 @@
1
1
  module JointJS
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-01-06 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler