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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 47404a3a4ac95a5fed9ca7eaeb2c0e511c3a7d36d3cd6b4749a8e7a1c5abf3d9
4
- data.tar.gz: 59abb517cdfa20936bfc042526f4bc65636cf5c2863e0b20ca34109b88055b70
3
+ metadata.gz: c330a24c75844ffac7637f592ce2a1f133896e22f2b87e26bc8c40cd1f39a53f
4
+ data.tar.gz: c4cfd722576e8b7bdef6f3fa6741d21cf1e845541bb7574aa7447628d41825d0
5
5
  SHA512:
6
- metadata.gz: 34b2cfe70c7302ec508ffc9871f6e8959d8fb4c2549812b3ac39ca89428703272b716f636794a06737e6cea31a9e00d7edcc7732c592ddb9768dacec06fb5907
7
- data.tar.gz: b2c4b214e68dad35454279453b8c9b8186eb1595426482acc1b62ddb0289b175464e175f1afcda731878512b6f94836b21b79178298c694c978efeb1f1ff9d20
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, target_element = x
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
- document.getElementById('#{target_element[:id]}').innerHTML = xhttp.responseText;
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
@@ -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.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file