jsajax_wizard 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/jsajax_wizard.rb +15 -4
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d47308716886d846f412552df1209e87c256301406d322e51eeb8b524f779d1
|
4
|
+
data.tar.gz: 7226513448a6d28ab34b06ac9e832db49e0e8ea64ff34ef15f0d6bfd0e7cb1cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d577bbacdb719b9c161c6e7e14a64574ccb7f0a390eb7eab134bf052db352c85eec4c9282f8f93c05d15128e3bfc908514bffd4a7dbea5afc2cd2c24ad7b88db
|
7
|
+
data.tar.gz: aaab0ad3519c47d8c4e5700bc6674f795ae3cf6bbe78d18c1d6f274a5305385ea8abcaa707fb862c05e799b1306965c8b8439ba54d4efe600a45530d9c6b111d
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/jsajax_wizard.rb
CHANGED
@@ -26,6 +26,9 @@
|
|
26
26
|
# <button onclick='$[x][/someurl/]'></button><div id='demo'>$x</div>
|
27
27
|
#
|
28
28
|
|
29
|
+
# AJAX triggered from a button press with the text response passed to eval
|
30
|
+
# jaw.add_request server: 'hello', element: {type: 'button', event: 'onclick'}, target_eval: true
|
31
|
+
|
29
32
|
|
30
33
|
require 'rexle'
|
31
34
|
require 'rexle-builder'
|
@@ -67,7 +70,8 @@ class JsAjaxWizard
|
|
67
70
|
|
68
71
|
@requests.each.with_index do |x,i|
|
69
72
|
|
70
|
-
|
73
|
+
puts ('x: ' + x.inspect).debug if @debug
|
74
|
+
element = x[1]
|
71
75
|
|
72
76
|
selector = if element[:id] then
|
73
77
|
'#' + element[:id]
|
@@ -248,15 +252,15 @@ a << "
|
|
248
252
|
def scan_requests(html)
|
249
253
|
|
250
254
|
|
251
|
-
a = html.scan(/\$\[([^\]])
|
255
|
+
a = html.scan(/\$\[([^\]]+)?\]\(([^\)]+)/)
|
252
256
|
|
253
257
|
a.each do |var, url|
|
254
258
|
|
255
259
|
#== fetch the trigger element details
|
256
260
|
|
257
|
-
tag = html[/<[^<]+\$\[([^\]])
|
261
|
+
tag = html[/<[^<]+\$\[([^\]]+)?\]\(#{url}[^\>]+>/]
|
258
262
|
element_name = tag[/(?<=<)\w+/]
|
259
|
-
event = tag[/(\w+)=["']\$\[([^\]])
|
263
|
+
event = tag[/(\w+)=["']\$\[([^\]]+)?\]\(#{url}/,1]
|
260
264
|
|
261
265
|
# is there an id?
|
262
266
|
id = tag[/(?<=id=["'])[^"']+/]
|
@@ -269,6 +273,13 @@ a << "
|
|
269
273
|
|
270
274
|
element = h2.merge(event: event)
|
271
275
|
|
276
|
+
if var.nil? then
|
277
|
+
|
278
|
+
add_request(server: url, element: element, target_eval: true)
|
279
|
+
next
|
280
|
+
|
281
|
+
end
|
282
|
+
|
272
283
|
#== fetch the target element details
|
273
284
|
|
274
285
|
tag2 = html[/<[^<]+>\$#{var}</]
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsajax_wizard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
pZTsghadsRxoGiI7mehrgxkeLLA7q3Zpafsvw3mLrERdifNsVFNBUDMjfE/OnJq8
|
36
36
|
EOz+UVQEw8EJ9wHqaJYIbHBq
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-10-
|
38
|
+
date: 2019-10-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rexle
|
metadata.gz.sig
CHANGED
Binary file
|