Skip to content

Commit

Permalink
Merge pull request #37 from coshx/sea-shell-newt
Browse files Browse the repository at this point in the history
Sea shell newt
  • Loading branch information
acadet committed Mar 14, 2016
2 parents 9763997 + 8dae66b commit 7bb8ad4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Caravel.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pod::Spec.new do |s|
# summary should be tweet-length, and the description more in depth.
#

version = "1.1.0"
version = "1.1.1"

s.name = "Caravel"
s.version = version
Expand Down
2 changes: 1 addition & 1 deletion caravel/internal/proxies/WKScriptMessageHandlerProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal class WKScriptMessageHandlerProxy: NSObject, WKScriptMessageHandler {
let eventData = body["eventData"]

iterateOverDelegates { e in
background { e.onMessage(busName, eventName: eventName, eventData: eventData) }
e.onMessage(busName, eventName: eventName, eventData: eventData)
}
}
}
2 changes: 1 addition & 1 deletion caravel/js/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = function (grunt) {
'use strict';

var version = '1.1.0';
var version = 'sea-shell-newt-v1.1.1';

// Project configuration
grunt.initConfig({
Expand Down
9 changes: 6 additions & 3 deletions caravel/js/caravel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ class Caravel

# Internal method for posting
_post: (eventName, data) ->
action = null

if @isUsingWKWebView
body =
busName: @name
eventName: eventName
eventData: data
setTimeout (() => window.webkit.messageHandlers.caravel.postMessage(body)), 0
action = () => window.webkit.messageHandlers.caravel.postMessage(body)
else
# shouldLoadRequest is only triggered when a new content is required
# Ajax requests are useless
setTimeout (() =>
action = () =>
iframe = document.createElement 'iframe'
src = "caravel://host.com?busName=#{encodeURIComponent(@name)}&eventName=#{encodeURIComponent(eventName)}"
if data?
Expand All @@ -33,7 +35,8 @@ class Caravel
iframe.setAttribute 'src', src
document.documentElement.appendChild iframe
iframe.parentNode.removeChild iframe
), 0

setTimeout(action, 0)

getName: () ->
@name
Expand Down
4 changes: 2 additions & 2 deletions caravel/js/caravel.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ disabled_rules: # rule identifiers to exclude from running
- trailing_whitespace
# - type_body_length
# - type_name
# - variable_name
- variable_name
- variable_name_min_length
# - variable_name_max_length
included: # paths to include during linting. `--path` is ignored if present. takes precendence over `excluded`.
Expand Down

0 comments on commit 7bb8ad4

Please sign in to comment.