outpost-asset_host 1.1.0 → 1.1.1

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: 0b057234884be99db3aa56824d86d30feb805b5c
4
- data.tar.gz: 698ef6151d5ad6a3cdf287b38c3d6277cdfc683c
3
+ metadata.gz: 5d1f535609de521469e11aecb8a285454f2030fd
4
+ data.tar.gz: 6f8dc01efc6410374ff458804ace068295224dce
5
5
  SHA512:
6
- metadata.gz: 0f8879c7a9e081de29e1706b0fecabc625c8fb4a6ee2ff627b3c8a29cf00bd8661d25edc6dd76eff746b1f1965ceb1191e79997e14428123d6d3be2977deda6e
7
- data.tar.gz: dc1b6e608bf178f74bb4afa7c1b029501278608868bf1c8f2bee892333eca222bc148db963053c91c052935e9b68b870accdc4e440fe6d6db40c39bd49dbc1c2
6
+ metadata.gz: 6608c0c56506c27c01feeaf9bbf7c49f11a4bd1c13fdab69eaf0ec075749f92f01c58e93cc9eb970ed3cea9b92cd18bb1c5cbafc7e0599f4807bcbda53f73157
7
+ data.tar.gz: 4d8512418aacf5a8ee7e70d646ea355c7d8b502ebdcf723c445cb8664de97f481e8808414f1f52964f6947101fc245e724ea483f042da23000e6c1ed7ef66fed
@@ -1,3 +1,8 @@
1
+ ## 1.1.1
2
+ ### Fixes
3
+ * Added a check to make sure messages are coming from AssetHost. This fixes conflicts with anything else sending messages to the window (such as the Evernote Web Clipper Chrome extension).
4
+
5
+
1
6
  ## 1.1.0
2
7
  ### Changes
3
8
  * Removed old Secretary hooks.
@@ -23,7 +23,9 @@ class outpost.AssetManager
23
23
  # Register listener for AssetHost message
24
24
  window.addEventListener "message", (event) =>
25
25
  # If the data is an object (i.e. not "LOADED"), do things
26
- if _.isObject(event.data)
26
+ # Also make sure the origin is from AssetHost, otherwise
27
+ # other messages could trigger this callback.
28
+ if event.origin == assethost.SERVER and _.isObject(event.data)
27
29
  @assets.reset(event.data)
28
30
  @assets.sort()
29
31
  @assetsView.render()
@@ -81,7 +83,9 @@ class outpost.AssetManager
81
83
 
82
84
  # attach a listener to wait for the LOADED message
83
85
  window.addEventListener "message", (evt) =>
84
- if evt.data == "LOADED" and @chooserIsAvailable()
86
+ if evt.origin == assethost.SERVER and
87
+ evt.data == "LOADED" and
88
+ @chooserIsAvailable()
85
89
  console.log @collection.toJSON()
86
90
  # dispatch our event with the asset data
87
91
  window.assethostChooser.postMessage @collection.toJSON(), assethost.SERVER
@@ -1,5 +1,5 @@
1
1
  module Outpost
2
2
  module AssetHost
3
- VERSION = "1.1.0"
3
+ VERSION = "1.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: outpost-asset_host
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan Ricker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler