opal-jquery 0.4.6 → 0.5.1

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
  SHA256:
3
- metadata.gz: 17e1701d287a5fb7acf42bbeb048aa016cd6d8227f0934553bba451497f19137
4
- data.tar.gz: fc349c46157151fc8d61f29c353d8e9f4ea52ac961a6046b8895d4aa1fbb995f
3
+ metadata.gz: 8220192e9c7a03b794d83b818155e7c144c6881e97f30b53f9cee261c42b7ad2
4
+ data.tar.gz: 79f4b1b236a8eb41b680887171b72e72320d433dfd404774d6332c502b1c96bc
5
5
  SHA512:
6
- metadata.gz: bf2238899bdcd262622da77911e9ec21486130386b7cf4cb1abf01fee14379f180e11cdc67f5f25e69a718294cf11ebf8e05f11c15ac5585f5386d684a0200a6
7
- data.tar.gz: c6832e7ce09f567586f234ce1a94c447f602f0a792ced7dee29f7d827f24058796ec8015eff2fd4d15376edbe2cf61c020f03b14cfe4ee8ffe980989e9ce73be
6
+ metadata.gz: d261c7d9d80b07e9c0eb7484d8e89f0b601d909741f38ff6a815ef5bccbefb9d2546149b71da3780544a750699297ca7892f3264273a7cb44ce0295b7c7ef971
7
+ data.tar.gz: e65068218c4e6680e87a48796f026c305fc9f0184da0c8ba112745d607ba59224074d218985d045e19acbb833c750625db6d16e09940d99f92fab1194071b444
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,19 @@
1
- ## [0.5.0](https://github.com/opal/opal-jquery/compare/v0.4.6...HEAD) Unreleased
1
+ ## [0.5.1](https://github.com/opal/opal-jquery/compare/v0.5.0...v0.5.1) 2024-01-08
2
2
 
3
- *see diff*
3
+ * Added `# backtick_javascript: true` where needed to satisfy new Opal requirement (#xxx)
4
4
 
5
- ## [0.4.6](https://github.com/opal/opal-jquery/compare/v0.4.5...v0.4.6) Unreleased
5
+ ## [0.5.0](https://github.com/opal/opal-jquery/compare/v0.4.6...v0.5.0) 2024-01-05
6
6
 
7
- * Initialize @@__isReady (#115)
7
+ * Added `Event#location` (#114)
8
+ * Add `Event#touch_count`; access each point via an optional `index` on `Event#touch_x`/`Event#touch_y` (#117)
9
+ * Add setting to prevent payload automatic processing (#103) **breaking**
10
+ * Remove untaint method for Ruby 3.2 compatibility (#119) **breaking**
8
11
 
9
- * Added `Element#select` (#111)
12
+ ## [0.4.6](https://github.com/opal/opal-jquery/compare/v0.4.5...v0.4.6) 2021-10-11
13
+
14
+ * Initialize @@__isReady (#115)
15
+
16
+ * Added `Element#select` (#111)
10
17
 
11
18
  ## [0.4.5](https://github.com/opal/opal-jquery/compare/v0.4.4...v0.4.5) 2021-07-28
12
19
 
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|
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'native'
2
4
 
3
5
  unless defined?(JQUERY_CLASS)
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'opal/jquery/constants'
2
4
  require 'opal/jquery/element'
3
5
 
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'native'
2
4
  require 'opal/jquery/constants'
3
5
 
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'opal/jquery/constants'
2
4
 
3
5
  # {Event} wraps native jQuery events into a ruby api. Instances of events
@@ -163,12 +165,20 @@ class Event
163
165
  `#@native.pageY`
164
166
  end
165
167
 
166
- def touch_x
167
- `#@native.originalEvent.touches[0].pageX`
168
+ def touch_count
169
+ `#@native.originalEvent.touches.length`
170
+ end
171
+
172
+ def touch_x(index = 0)
173
+ `#@native.originalEvent.touches[#{index}].pageX` if index < touch_count
174
+ end
175
+
176
+ def touch_y(index = 0)
177
+ `#@native.originalEvent.touches[#{index}].pageY` if index < touch_count
168
178
  end
169
179
 
170
- def touch_y
171
- `#@native.originalEvent.touches[0].pageY`
180
+ def location
181
+ `#@native.originalEvent.location`
172
182
  end
173
183
 
174
184
  def ctrl_key
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'json'
2
4
  require 'native'
3
5
  require 'promise'
@@ -161,14 +163,14 @@ class HTTP
161
163
 
162
164
  @settings.update options
163
165
 
164
- settings, payload = @settings.to_n, @payload
166
+ settings, payload = @settings.to_n, @payload.to_n
165
167
 
166
168
  %x{
167
- if (typeof(#{payload}) === 'string') {
169
+ if (typeof(payload) === 'string' || settings.processData === false) {
168
170
  settings.data = payload;
169
171
  }
170
172
  else if (payload != nil) {
171
- settings.data = payload.$to_json();
173
+ settings.data = JSON.stringify(payload);
172
174
  settings.contentType = 'application/json';
173
175
  }
174
176
 
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  module Kernel
2
4
  # Alert the given message using `window.alert()`. This is a blocking
3
5
  # method.
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  module Browser
2
4
  # {Browser::LocalStorage} is a simple wrapper around `localStorage` in the
3
5
  # browser.
@@ -1,5 +1,5 @@
1
1
  module Opal
2
2
  module JQuery
3
- VERSION = '0.4.6'
3
+ VERSION = '0.5.1'
4
4
  end
5
5
  end
@@ -1,3 +1,5 @@
1
+ # backtick_javascript: true
2
+
1
3
  require 'opal/jquery/element'
2
4
 
3
5
  module Browser
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.1
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-08 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