opal-jquery 0.4.6 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17e1701d287a5fb7acf42bbeb048aa016cd6d8227f0934553bba451497f19137
4
- data.tar.gz: fc349c46157151fc8d61f29c353d8e9f4ea52ac961a6046b8895d4aa1fbb995f
3
+ metadata.gz: c77dd6b6a0370f6608895f558ed760f3eb3209eaa779cf9d5b0b53ba92025702
4
+ data.tar.gz: 1e5c83c4211904510375188ed3a3439f2e6579007d3e3bdeaf41fd190d2882aa
5
5
  SHA512:
6
- metadata.gz: bf2238899bdcd262622da77911e9ec21486130386b7cf4cb1abf01fee14379f180e11cdc67f5f25e69a718294cf11ebf8e05f11c15ac5585f5386d684a0200a6
7
- data.tar.gz: c6832e7ce09f567586f234ce1a94c447f602f0a792ced7dee29f7d827f24058796ec8015eff2fd4d15376edbe2cf61c020f03b14cfe4ee8ffe980989e9ce73be
6
+ metadata.gz: 3f4338bd0f5c38962cac9b3aba1b39b76849ced9b61702091791296e51e6de9f92e2959becfd6587f62b6fa1fd5af8c951ea473fac13dee22ebba2e329f91b1f
7
+ data.tar.gz: e4eb64e225f66476611cde51b69af4061bf20f47dec47cb1f4cabefdfe27dc3005c6887d93b27d7bfea1d2f08ccfce6861e9f8856ea733cd7847d0d7a82d5428
data/.gitignore CHANGED
@@ -6,3 +6,7 @@ gh-pages
6
6
  /.bundle
7
7
  .yardoc
8
8
  /doc
9
+ .ruby-version
10
+ .ruby-gemset
11
+ .gladiator
12
+ .gladiator-scratchfile
data/CHANGELOG.md CHANGED
@@ -1,12 +1,15 @@
1
- ## [0.5.0](https://github.com/opal/opal-jquery/compare/v0.4.6...HEAD) Unreleased
1
+ ## [0.5.0](https://github.com/opal/opal-jquery/compare/v0.4.6...v0.5.0) 2024-01-05
2
2
 
3
- *see diff*
3
+ * Added `Event#location` (#114)
4
+ * Add `Event#touch_count`; access each point via an optional `index` on `Event#touch_x`/`Event#touch_y` (#117)
5
+ * Add setting to prevent payload automatic processing (#103) **breaking**
6
+ * Remove untaint method for Ruby 3.2 compatibility (#119) **breaking**
4
7
 
5
- ## [0.4.6](https://github.com/opal/opal-jquery/compare/v0.4.5...v0.4.6) Unreleased
8
+ ## [0.4.6](https://github.com/opal/opal-jquery/compare/v0.4.5...v0.4.6) 2021-10-11
6
9
 
7
- * Initialize @@__isReady (#115)
10
+ * Initialize @@__isReady (#115)
8
11
 
9
- * Added `Element#select` (#111)
12
+ * Added `Element#select` (#111)
10
13
 
11
14
  ## [0.4.5](https://github.com/opal/opal-jquery/compare/v0.4.4...v0.4.5) 2021-07-28
12
15
 
data/config.ru CHANGED
@@ -2,6 +2,7 @@ require 'bundler'
2
2
  Bundler.require
3
3
 
4
4
  require 'opal/rspec'
5
+ require 'opal/rspec/sprockets_environment'
5
6
 
6
7
  sprockets_env = Opal::RSpec::SprocketsEnvironment.new
7
8
  run Opal::Server.new(sprockets: sprockets_env) { |s|
@@ -163,12 +163,20 @@ class Event
163
163
  `#@native.pageY`
164
164
  end
165
165
 
166
- def touch_x
167
- `#@native.originalEvent.touches[0].pageX`
166
+ def touch_count
167
+ `#@native.originalEvent.touches.length`
168
168
  end
169
169
 
170
- def touch_y
171
- `#@native.originalEvent.touches[0].pageY`
170
+ def touch_x(index = 0)
171
+ `#@native.originalEvent.touches[#{index}].pageX` if index < touch_count
172
+ end
173
+
174
+ def touch_y(index = 0)
175
+ `#@native.originalEvent.touches[#{index}].pageY` if index < touch_count
176
+ end
177
+
178
+ def location
179
+ `#@native.originalEvent.location`
172
180
  end
173
181
 
174
182
  def ctrl_key
@@ -161,14 +161,14 @@ class HTTP
161
161
 
162
162
  @settings.update options
163
163
 
164
- settings, payload = @settings.to_n, @payload
164
+ settings, payload = @settings.to_n, @payload.to_n
165
165
 
166
166
  %x{
167
- if (typeof(#{payload}) === 'string') {
167
+ if (typeof(payload) === 'string' || settings.processData === false) {
168
168
  settings.data = payload;
169
169
  }
170
170
  else if (payload != nil) {
171
- settings.data = payload.$to_json();
171
+ settings.data = JSON.stringify(payload);
172
172
  settings.contentType = 'application/json';
173
173
  }
174
174
 
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module JQuery
3
- VERSION = '0.4.6'
3
+ VERSION = '0.5.0'
4
4
  end
5
5
  end
data/lib/opal/jquery.rb CHANGED
@@ -9,5 +9,5 @@ else
9
9
  require 'opal'
10
10
  require 'opal/jquery/version'
11
11
 
12
- Opal.append_path File.expand_path('../..', __FILE__).untaint
12
+ Opal.append_path File.expand_path('../..', __FILE__)
13
13
  end
data/opal-jquery.gemspec CHANGED
@@ -4,11 +4,11 @@ require File.expand_path('../lib/opal/jquery/version', __FILE__)
4
4
  Gem::Specification.new do |s|
5
5
  s.name = 'opal-jquery'
6
6
  s.version = Opal::JQuery::VERSION
7
- s.authors = ['Adam Beynon', 'Elia Schito']
7
+ s.authors = ['Adam Beynon', 'Elia Schito', 'Andy Maleh']
8
8
  s.email = 'elia@schito.me'
9
9
  s.homepage = 'https://github.com/opal/opal-jquery#readme'
10
10
  s.summary = 'Opal access to jQuery'
11
- s.description = 'Opal DOM library for jQuery'
11
+ s.description = 'Opal DOM library for jQuery (Use jQuery with Ruby code)'
12
12
 
13
13
  s.files = `git ls-files`.split("\n")
14
14
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opal-jquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Beynon
8
8
  - Elia Schito
9
+ - Andy Maleh
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2021-10-11 00:00:00.000000000 Z
13
+ date: 2024-01-06 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: opal
@@ -99,7 +100,7 @@ dependencies:
99
100
  - - ">="
100
101
  - !ruby/object:Gem::Version
101
102
  version: '0'
102
- description: Opal DOM library for jQuery
103
+ description: Opal DOM library for jQuery (Use jQuery with Ruby code)
103
104
  email: elia@schito.me
104
105
  executables: []
105
106
  extensions: []
@@ -186,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
186
187
  - !ruby/object:Gem::Version
187
188
  version: '0'
188
189
  requirements: []
189
- rubygems_version: 3.2.15
190
+ rubygems_version: 3.3.6
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Opal access to jQuery