volt 0.8.1 → 0.8.2

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: 0dad3f59c1318c304efbfc3cb4395ce5cbedc740
4
- data.tar.gz: d206e4807b67d5f56d415b8378989c5ef0e5d5bf
3
+ metadata.gz: 151e9fd7b7262c2b6ae7dc51fe4974ffb1c65628
4
+ data.tar.gz: d43d340ea71cb98295ec0d3c5682676254b23ad5
5
5
  SHA512:
6
- metadata.gz: e9e9bb7ca7e6f37113196c462ae39f1730b99b1f9729c8d12613c9594db555b450d554d866bd7140e19a2f483e50e79f6babd07d9d7045e8ea95d9a11e5df21d
7
- data.tar.gz: 6165475a15dcd04fb419ed57e22b8e1317a66699a6dc8e4dc75a6b2e2f695c2e838bed7ac8c52c9833c91a868f9c167ef9e1e10739210f2d2585f67b1bf112b8
6
+ metadata.gz: ffbae1aa4a8653a2a9a7b36ef302aa32cbf81fe1f4aeb1d8f86e471d22bb27083cf1c018d3d5e6f89aa520f72e1f89a4b0ae21391701d6f1916726b909cbc3e8
7
+ data.tar.gz: b6eefeb6b8fc07eabcc9f65ad6c0d28d577ff54409c8a16afdfdc13ef48b0f2b4296cd4c3c8c1734abe875f366c543fdcd1f1491454fdba45efd6020684e72cb
data/Readme.md CHANGED
@@ -71,8 +71,8 @@ You can access the Volt console with:
71
71
 
72
72
  1. [Getting Help](#getting-help)
73
73
  2. [Rendering](#rendering)
74
- 1. [States and Computations](#states-and-computations)
75
- 1. [Computations](#states-and-computations)
74
+ 1. [States and Computations](#state-and-computations)
75
+ 1. [Computations](#computations)
76
76
  3. [Views](#views)
77
77
  1. [Bindings](#bindings)
78
78
  1. [Content Binding](#content-binding)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.8.1
1
+ 0.8.2
@@ -88,6 +88,10 @@ class ModelController
88
88
  $page.params
89
89
  end
90
90
 
91
+ def local_store
92
+ $page.local_store
93
+ end
94
+
91
95
  def url
92
96
  $page.url
93
97
  end
@@ -7,13 +7,4 @@ class Array
7
7
 
8
8
  return total
9
9
  end
10
-
11
- def deep_cur
12
- new_array = []
13
- each do |item|
14
- new_array << item.deep_cur
15
- end
16
-
17
- return new_array
18
- end
19
10
  end
@@ -1,6 +1,5 @@
1
1
  require 'volt/extra_core/log'
2
2
  require 'volt/extra_core/array'
3
- require 'volt/extra_core/hash'
4
3
  require 'volt/extra_core/object'
5
4
  require 'volt/extra_core/blank'
6
5
  require 'volt/extra_core/stringify_keys'
@@ -259,11 +259,6 @@ class Model
259
259
  return str
260
260
  end
261
261
 
262
- def deep_cur
263
- attributes
264
- end
265
-
266
-
267
262
  def save!
268
263
  # Compute the erros once
269
264
  errors = self.errors
@@ -57,7 +57,7 @@ module Persistors
57
57
  def save_all
58
58
  return if @loading_data
59
59
 
60
- json_data = JSON.dump(@model.to_h.deep_cur)
60
+ json_data = JSON.dump(@model.to_h)
61
61
 
62
62
  LocalStorage['volt-store'] = json_data
63
63
  end
@@ -1,12 +1,12 @@
1
1
  module CommentSearchers
2
2
  if RUBY_PLATFORM == 'opal'
3
- PHANTOM = `!!window._phantom`
3
+ NO_XPATH = `!!window._phantom || !document.evaluate`
4
4
  else
5
- PHANTOM = false
5
+ NO_XPATH = false
6
6
  end
7
7
 
8
8
  def find_by_comment(text, in_node=`document`)
9
- if PHANTOM
9
+ if NO_XPATH
10
10
  return find_by_comment_without_xml(text, in_node)
11
11
  else
12
12
  node = nil
@@ -25,6 +25,12 @@
25
25
  <td><input type="text" id="routesName2" value="{params._route_test}"></td>
26
26
  <td id="routesName3">{params._route_test}</td>
27
27
  </tr>
28
+ <tr>
29
+ <td>Local Store</td>
30
+ <td><input type="text" id="localstoreName1" value="{local_store._name}"></td>
31
+ <td><input type="text" id="localstoreName2" value="{local_store._name}"></td>
32
+ <td id="localstoreName3">{local_store._name}</td>
33
+ </tr>
28
34
  </table>
29
35
 
30
36
  <h2>Checkbox</h2>
@@ -61,6 +67,25 @@
61
67
  </tr>
62
68
  </table>
63
69
 
70
+ <h2>Select</h2>
71
+ <table class="table">
72
+ <tr>
73
+ <td>Page</td>
74
+ <td>
75
+ <select id="pageSelect1" value="{page._select}">
76
+ <option value="one">One</option>
77
+ <option value="two">Two</option>
78
+ <option value="three">Three</option>
79
+ </select>
80
+ </td>
81
+ <td>
82
+ <input type="text" id="pageSelect2" value="{page._select}" />
83
+ </td>
84
+ <td id="pageSelect3">{page._select}</td>
85
+ </tr>
86
+ </table>
87
+
88
+
64
89
  <h2>Textarea</h2>
65
90
  <table class="table">
66
91
  <tr>
@@ -104,6 +104,43 @@ if ENV['BROWSER']
104
104
  expect(find('#textareaName3')).to have_content('Update everywhere')
105
105
  end
106
106
 
107
+ it 'should update local_store bindings' do
108
+ visit '/'
109
+
110
+ click_link 'Bindings'
111
+
112
+ # Fill in one field and see if it updates the rest
113
+ fill_in('localstoreName1', :with => 'Page bindings')
114
+ expect(find('#localstoreName1').value).to eq('Page bindings')
115
+ expect(find('#localstoreName2').value).to eq('Page bindings')
116
+ expect(find('#localstoreName3')).to have_content('Page bindings')
117
+
118
+ fill_in('localstoreName2', :with => 'Update everywhere')
119
+ expect(find('#localstoreName1').value).to eq('Update everywhere')
120
+ expect(find('#localstoreName2').value).to eq('Update everywhere')
121
+ expect(find('#localstoreName3')).to have_content('Update everywhere')
122
+ end
123
+
124
+ # it 'should update local_store bindings' do
125
+ # visit '/'
126
+ #
127
+ # click_link 'Bindings'
128
+ #
129
+ # within '#pageSelect1' do
130
+ # find("option[value='two']").click
131
+ # end
132
+ #
133
+ # # Fill in one field and see if it updates the rest
134
+ # expect(find('#pageSelect1').value).to eq('two')
135
+ # expect(find('#pageSelect2').value).to eq('two')
136
+ # expect(find('#pageSelect3')).to have_content('two')
137
+ #
138
+ # # Fill in one field and see if it updates the rest
139
+ # fill_in('pageSelect2', :with => 'three')
140
+ # expect(find('#pageSelect1').value).to eq('three')
141
+ # expect(find('#pageSelect2').value).to eq('three')
142
+ # expect(find('#pageSelect3')).to have_content('three')
143
+ # end
107
144
  end
108
145
 
109
146
  describe "check boxes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: volt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Stout
@@ -382,7 +382,6 @@ files:
382
382
  - lib/volt/extra_core/array.rb
383
383
  - lib/volt/extra_core/blank.rb
384
384
  - lib/volt/extra_core/extra_core.rb
385
- - lib/volt/extra_core/hash.rb
386
385
  - lib/volt/extra_core/inflections.rb
387
386
  - lib/volt/extra_core/inflector.rb
388
387
  - lib/volt/extra_core/inflector/inflections.rb
@@ -1,11 +0,0 @@
1
- class Hash
2
- def deep_cur
3
- new_hash = {}
4
-
5
- each_pair do |key, value|
6
- new_hash[key.deep_cur] = value.deep_cur
7
- end
8
-
9
- return new_hash
10
- end
11
- end