jsajax_wizard 0.2.3 → 0.2.4
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 +19 -7
- data.tar.gz.sig +0 -0
- metadata +1 -1
- 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: c330a24c75844ffac7637f592ce2a1f133896e22f2b87e26bc8c40cd1f39a53f
|
4
|
+
data.tar.gz: c4cfd722576e8b7bdef6f3fa6741d21cf1e845541bb7574aa7447628d41825d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b395e0bd047e61b40f427a6e497102c6a5b975996c816de4636dad4bf6d9b2f3c322ce35d990c111951fdbc1b0984290fb977f6c324448f3a7217bc3e9d24b88
|
7
|
+
data.tar.gz: dda3bcf7323aee1f13c3e02fc33583fa232a25b0a58c39df7b945bb80bf39f26843d821becb3a5009a916109cd0fa1f9db56f47921df5162bcccea417bb7cb82
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/jsajax_wizard.rb
CHANGED
@@ -43,8 +43,8 @@ class JsAjaxWizard
|
|
43
43
|
|
44
44
|
end
|
45
45
|
|
46
|
-
def add_request(server: '', element: {}, target_element: {})
|
47
|
-
@requests << [server, element, target_element]
|
46
|
+
def add_request(server: '', element: {}, target_element: {}, target_eval: false)
|
47
|
+
@requests << [server, element, target_eval || target_element ]
|
48
48
|
end
|
49
49
|
|
50
50
|
def to_html()
|
@@ -130,8 +130,8 @@ class JsAjaxWizard
|
|
130
130
|
else
|
131
131
|
['']
|
132
132
|
end
|
133
|
-
|
134
|
-
a << "<div id='%s'></div>" % [e2[:id]]
|
133
|
+
|
134
|
+
a << "<div id='%s'></div>" % [e2[:id]] if e2.is_a? Hash
|
135
135
|
a.join("\n")
|
136
136
|
|
137
137
|
end
|
@@ -180,7 +180,7 @@ EOF
|
|
180
180
|
funcs_defined = @requests.map.with_index do |x,i|
|
181
181
|
|
182
182
|
a = []
|
183
|
-
server, element,
|
183
|
+
server, element, target = x
|
184
184
|
|
185
185
|
a << if element[:type] == 'text' then
|
186
186
|
|
@@ -219,9 +219,21 @@ function ajaxCall#{i+1}() {
|
|
219
219
|
|
220
220
|
a << "
|
221
221
|
function ajaxResponse#{i+1}(xhttp) {
|
222
|
-
|
222
|
+
"
|
223
|
+
if target.is_a? Hash and target[:id] then
|
224
|
+
|
225
|
+
a << " document.getElementById('#{target[:id]}')" +
|
226
|
+
".innerHTML = xhttp.responseText;"
|
227
|
+
|
228
|
+
else
|
229
|
+
|
230
|
+
a << " eval(xhttp.responseText);"
|
231
|
+
|
232
|
+
end
|
233
|
+
|
234
|
+
a << "
|
223
235
|
}
|
224
|
-
"
|
236
|
+
"
|
225
237
|
|
226
238
|
a.join
|
227
239
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|