shutterbug 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/shutterbug.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Shutterbug
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  autoload :Rackapp, "shutterbug/rackapp"
4
4
  autoload :Configuration, "shutterbug/configuration"
5
5
  autoload :Storage, "shutterbug/storage"
@@ -207,10 +207,10 @@
207
207
 
208
208
  var htmlFragRequestListen = function(message) {
209
209
  var send_response = function(data) {
210
- // Update timeout. When we receive a request from parent,
211
- // we have to finish nested iframes rendering in that time.
212
- // Otherwise parent rendering will timeout.
213
- shutterbugInstance.iframeReqTimeout = data.iframeReqTimeout;
210
+ // Update timeout. When we receive a request from parent, we have to finish nested iframes
211
+ // rendering in that time. Otherwise parent rendering will timeout.
212
+ // Backward compatibility: Shutterbug v0.1.x don't send iframeReqTimeout.
213
+ shutterbugInstance.iframeReqTimeout = data.iframeReqTimeout != null ? data.iframeReqTimeout : MAX_TIMEOUT;
214
214
  shutterbugInstance.getHtmlFragment(function(html) {
215
215
  var response = {
216
216
  type: 'htmlFragResponse',
@@ -227,7 +227,9 @@
227
227
  var htmlFragResponseListen = function(message) {
228
228
  var send_response = function(data) {
229
229
  if (data.id === shutterbugInstance.id) {
230
- shutterbugInstance._iframeContentRequests[data.iframeReqId].resolve(data.value);
230
+ // Backward compatibility: Shutterbug v0.1.x don't send iframeReqId.
231
+ var ifeameReqId = data.iframeReqId != null ? data.iframeReqId : 0;
232
+ shutterbugInstance._iframeContentRequests[ifeameReqId].resolve(data.value);
231
233
  }
232
234
  };
233
235
  handleMessage(message, 'htmlFragResponse', send_response);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shutterbug
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-12 00:00:00.000000000 Z
12
+ date: 2014-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -239,7 +239,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
239
  version: '0'
240
240
  segments:
241
241
  - 0
242
- hash: -737520193773818108
242
+ hash: 4021893285741860284
243
243
  required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  none: false
245
245
  requirements:
@@ -248,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
248
248
  version: '0'
249
249
  segments:
250
250
  - 0
251
- hash: -737520193773818108
251
+ hash: 4021893285741860284
252
252
  requirements: []
253
253
  rubyforge_project:
254
254
  rubygems_version: 1.8.25