hobo_jquery 2.0.0.pre2 → 2.0.0.pre3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.pre2
1
+ 2.0.0.pre3
@@ -8,7 +8,8 @@
8
8
  // you should be able to call this externally:
9
9
  // $(foo).hjq('submit'); It can be called on the form or any
10
10
  // child of the form
11
- submit: function () {
11
+ submit: function (e) {
12
+ e.preventDefault();
12
13
  var form = $(this).closest("form");
13
14
  if(form.length==0) return false;
14
15
  var annotations = form.data('rapid').form;
@@ -19,7 +20,7 @@
19
20
 
20
21
  if(form.attr('enctype') == 'multipart/form-data') {
21
22
  if(form.ajaxSubmit) {
22
- options = $.extend(options, {preamble: '<textarea>', postamble: '</textarea>', content_type: 'text/html'});
23
+ options = $.extend(options, {preamble: "<textarea>", postamble: '</textarea>', fix_quotes: true, content_type: 'text/html'});
23
24
  var roptions = form.hjq('buildRequestData', options);
24
25
 
25
26
  if(!roptions) return false;
@@ -244,8 +244,9 @@
244
244
  result.data = {"render_options[preamble]": o.preamble || '',
245
245
  "render_options[contexts_function]": 'hjq.ajax.updatePartContexts'
246
246
  }; */
247
- if(o.preamble) result.data["render_options[preamble]"] = o.postamble;
247
+ if(o.preamble) result.data["render_options[preamble]"] = o.preamble;
248
248
  if(o.postamble) result.data["render_options[postamble]"] = o.postamble;
249
+ if(o.fix_quotes) result.data["render_options[fix_quotes]"] = o.fix_quotes;
249
250
  if(o.content_type) result.data["render_options[content_type]"] = o.content_type;
250
251
  if(o.attrs['errors-ok']) result.data["render_options[errors_ok]"] = 1;
251
252
  result.dataType = 'script';
@@ -297,6 +298,7 @@
297
298
  if(o.attrs.error) error_dfd.done(methods.createFunction.call(that, o.attrs.error));
298
299
  if(o.extra_callbacks.error) error_dfd.done(methods.createFunction.call(that, o.extra_callbacks.error));
299
300
  error_dfd.done(function() {
301
+ if(window.console&&window.console.log){window.console.log('ajax failed');}
300
302
  if(that.parents("body").length==0) $(document).trigger('rapid:ajax:error', [that]);
301
303
  else that.trigger('rapid:ajax:error', [that]);
302
304
  });