thin_man 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 5d00329ddfe51a637f6088d3b89b079785f96712
4
- data.tar.gz: 086eabbc3e3e40ac4f47c66283a437d8fa34b346
3
+ metadata.gz: c3b67ae0441447a51a48fde3c3527002711452d8
4
+ data.tar.gz: cfeb07034950207df27ce26e3b02bffffa601ffd
5
5
  SHA512:
6
- metadata.gz: d326aab5823d229956a95ed9b25f3ccce815882b4bc9beffe49cce10bbcceaf7fe3a389c1e7a11b8026f3193d5ee247baad6e28520f6e02cf19e040d9ddfb9ab
7
- data.tar.gz: f514f44a1af282a4f440d7ecc10563f23b76745ead1e26fbf9d14f52a853e577b062e7a163f41b048bba7275a0cdaae2ab8e6a1816fcd6c3972ecfb063163ce5
6
+ metadata.gz: 15421866996528de47dd3bc6b58332f143819903587a26db2af056825bbf2068293628b8ed3f2f79190a6a2dd87a542ec4ce9170c7c93f135fe8f9b6c00d0768
7
+ data.tar.gz: 177e75fbf90266e21e5dae64142dcf4c06f94dd00275fdcd01b1a6f817afca9568c6b9df5b5bbc71587b277c05eaeb49c4349ddd11d3621c628918bff07e9ea4
@@ -113,15 +113,18 @@ var AjaxSubmission = Class.extend({
113
113
  }
114
114
  },
115
115
  ajaxComplete: function(jqXHR) {
116
- response_data = JSON.parse(jqXHR.responseText)
117
116
  this.showTrigger();
118
117
  if(this.progress_indicator){
119
118
  this.progress_indicator.stop();
120
119
  }
120
+ try{
121
+ response_data = JSON.parse(jqXHR.responseText)
122
+ } catch(err) {
123
+ response_data = {}
124
+ // hmmm, the response is not JSON, so there's no flash.
125
+ }
121
126
  if(typeof response_data.flash_message != 'undefined'){
122
- console.log('got a flash')
123
127
  flash_style = this.httpResponseToFlashStyle(jqXHR.status)
124
- console.log(flash_style)
125
128
  new AjaxFlash(flash_style, response_data.flash_message,this.target);
126
129
  }
127
130
  },
@@ -175,9 +178,6 @@ var AjaxBrowserPushFlash = Class.extend({
175
178
  this.message = $flash.data('ajax-browser-push-flash')
176
179
  this.$target = $($flash.data('ajax-browser-push-flash-target'));
177
180
  this.$target.data('ajax-browser-push-flash',this.message);
178
- console.log("AjaxBrowserPushFlash: ")
179
- console.log(this.message)
180
- console.log(this.$target.data());
181
181
  }
182
182
  });
183
183
  var AjaxProgress = Class.extend({
@@ -211,10 +211,6 @@ var AjaxProgress = Class.extend({
211
211
  });
212
212
  var AjaxFlash = Class.extend({
213
213
  init: function(type,message,elem){
214
- console.log('ajaxflash:')
215
- console.log(type)
216
- console.log(message)
217
- console.log(elem)
218
214
  this.flash_container = $('#ajax_flash_container').clone();
219
215
  $('body').append(this.flash_container);
220
216
  this.flash_container.css({position:'absolute',visibility: 'hidden'});
@@ -1,3 +1,3 @@
1
1
  module ThinMan
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Draut, Adam Bialek