Commit 98366f3d authored by Aron Carroll's avatar Aron Carroll

Inject cross frame constructors into CF service

parent 553836a8
...@@ -34,7 +34,7 @@ class CrossFrameBridge ...@@ -34,7 +34,7 @@ class CrossFrameBridge
channel = this._buildChannel channelOptions channel = this._buildChannel channelOptions
# Attach channel message listeners # Attach channel message listeners
for method, callback of @channelListeners for own method, callback of @channelListeners
channel.bind method, callback channel.bind method, callback
# Store the newly created channel in our collection # Store the newly created channel in our collection
...@@ -107,3 +107,6 @@ class CrossFrameBridge ...@@ -107,3 +107,6 @@ class CrossFrameBridge
(options.origin.match /^resource:\/\//) (options.origin.match /^resource:\/\//)
options = $.extend {}, options, {origin: '*'} options = $.extend {}, options, {origin: '*'}
channel = Channel.build(options) channel = Channel.build(options)
if typeof angular != 'undefined'
angular.module('h').value('CrossFrameBridge', CrossFrameBridge)
...@@ -106,3 +106,6 @@ class CrossFrameDiscovery ...@@ -106,3 +106,6 @@ class CrossFrameDiscovery
@requestInProgress = false # value should not actually matter anymore. @requestInProgress = false # value should not actually matter anymore.
discovered = true discovered = true
return {reply: reply, discovered: discovered, token: token} return {reply: reply, discovered: discovered, token: token}
if typeof angular != 'undefined'
angular.module('h').value('CrossFrameDiscovery', CrossFrameDiscovery)
...@@ -2,8 +2,16 @@ ...@@ -2,8 +2,16 @@
class CrossFrameService class CrossFrameService
providers: null providers: null
this.inject = ['$rootScope', '$document', '$window', 'store', 'annotationUI'] this.inject = [
constructor: ($rootScope, $document, $window, store, annotationUI) -> '$rootScope', '$document', '$window', 'store', 'annotationUI'
'CrossFrameDiscovery', 'CrossFrameBridge',
'AnnotationSync', 'AnnotationUISync'
]
constructor: (
$rootScope, $document, $window, store, annotationUI
CrossFrameDiscovery, CrossFrameBridge,
AnnotationSync, AnnotationUISync
) ->
@providers = [] @providers = []
createDiscovery = -> createDiscovery = ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment