fixes #383
This commit is contained in:
parent
2584b40dae
commit
371c4889ac
|
@ -46,6 +46,8 @@
|
|||
<string></string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
<true/>
|
||||
<key>NSExceptionDomains</key>
|
||||
<dict>
|
||||
<key>api.status.im</key>
|
||||
|
|
|
@ -12,12 +12,12 @@ status.command({
|
|||
fontFamily: "font",
|
||||
color: "black"
|
||||
}
|
||||
}, params.value);
|
||||
}, params.address);
|
||||
var uri = "https://maps.googleapis.com/maps/api/staticmap?center="
|
||||
+ params.value
|
||||
+ params.address
|
||||
+ "&size=100x100&maptype=roadmap&key=AIzaSyBNsj1qoQEYPb3IllmWMAscuXW0eeuYqAA&language=en"
|
||||
+ "&markers=size:mid%7Ccolor:0xff0000%7Clabel:%7C"
|
||||
+ params.value;
|
||||
+ params.address;
|
||||
|
||||
var image = status.components.image(
|
||||
{
|
||||
|
@ -39,8 +39,8 @@ status.command({
|
|||
|
||||
|
||||
function browseSuggestions(params) {
|
||||
if (params.value != "") {
|
||||
var url = params.value;
|
||||
if (params.url && params.url !== "undefined" && params.url != "") {
|
||||
var url = params.url;
|
||||
if (!/^[a-zA-Z-_]+:/.test(url)) {
|
||||
url = 'http://' + url;
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ status.command({
|
|||
fullscreen: true,
|
||||
suggestionsTrigger: 'on-send',
|
||||
params: [{
|
||||
name: "webpage",
|
||||
name: "url",
|
||||
suggestions: browseSuggestions,
|
||||
type: status.types.TEXT
|
||||
}]
|
||||
|
|
|
@ -112,6 +112,13 @@
|
|||
(dispatch [:set-web-view-url url])
|
||||
(dispatch [:set-chat-command-content (str "c " url)])))))
|
||||
|
||||
(defn web-view-error []
|
||||
(r/as-element
|
||||
[view {:justify-content :center
|
||||
:align-items :center
|
||||
:flex-direction :row}
|
||||
[text (label :t/web-view-error)]]))
|
||||
|
||||
(defview suggestions-web-view []
|
||||
[url [:web-view-url]]
|
||||
(when url
|
||||
|
@ -119,6 +126,7 @@
|
|||
{:ref #(dispatch [:set-webview-bridge %])
|
||||
:on-bridge-message #(dispatch [:webview-bridge-message %])
|
||||
:source {:uri url}
|
||||
:render-error web-view-error
|
||||
:java-script-enabled true
|
||||
:injected-java-script (slurp "resources/webview.js")
|
||||
:bounces false
|
||||
|
|
|
@ -206,4 +206,7 @@
|
|||
:recipient "Recipient"
|
||||
:one-more-item "One more item"
|
||||
:fee "Fee"
|
||||
:value "Value"})
|
||||
:value "Value"
|
||||
|
||||
;:webview
|
||||
:web-view-error "oops, error"})
|
||||
|
|
Loading…
Reference in New Issue