From 827084cef2d8f2bb2de435c9ec0574e96b3fa78b Mon Sep 17 00:00:00 2001 From: Christoffer Hamberg Date: Thu, 30 Jun 2016 15:58:06 +0300 Subject: [PATCH] chore (ModuleBridge) remove bridge --- src/bridges/Bridge.coffee | 1 - src/bridges/ModuleBridge.coffee | 61 --------------------------------- 2 files changed, 62 deletions(-) delete mode 100644 src/bridges/ModuleBridge.coffee diff --git a/src/bridges/Bridge.coffee b/src/bridges/Bridge.coffee index 1cd9cfb..096f62e 100644 --- a/src/bridges/Bridge.coffee +++ b/src/bridges/Bridge.coffee @@ -11,7 +11,6 @@ class Bridge prioritizedList = [ FreshAndroidBridge - ModuleBridge TizenBridge WebBridge AndroidBridge diff --git a/src/bridges/ModuleBridge.coffee b/src/bridges/ModuleBridge.coffee deleted file mode 100644 index a3b81aa..0000000 --- a/src/bridges/ModuleBridge.coffee +++ /dev/null @@ -1,61 +0,0 @@ -debug = switch - when localStorage.debug? and (localStorage.debug || "").indexOf("steroids") isnt -1 - (args...) -> - console.log "ModuleBridge: ", args... - else - -> - # Swallow debug messages - - -class ModuleBridge extends Bridge - - constructor: ()-> - window.AG_SCREEN_ID = 0 - window.AG_LAYER_ID = 0 - window.AG_VIEW_ID = 0 - return @ - - @isUsable: ()-> - return /gyver\.com$/.test(location.hostname) - - sendMessageToNative:(messageString)-> - message = JSON.parse(messageString) - - debug message - - failed = false - - successOptions = {} - failureOptions = {} - failSilentlyMethods = [ - "userFilesPath" - "getApplicationPath" - "getEndpointURL" - "addEventListener" - "broadcastJavascript" - "getApplicationState" - ] - - switch message.method - when "ping" - successOptions.message = "PONG" - when "popLayer" - window.history.back() - when "openLayer" - window.location.href = message.parameters.url - when "openURL" - window.open message.parameters.url, "_blank" - when "openModal" - #window.open message.parameters.url, "_blank" - steroids.component.helper.openModal message.parameters.url, {} - when "closeModal" - steroids.component.helper.closeModal() - else - debug "unsupported API method: #{message.method}" unless message.method in failSilentlyMethods - failed = true - - - if failed - #@callbacks[message.callbacks.failure].call(@) - else - @callbacks[message.callbacks.success].call(@, successOptions)