status-react/resources/dapp.js

33 lines
788 B
JavaScript
Raw Normal View History

2016-12-24 10:15:35 +00:00
I18n.translations = {
en: {
browse_title: 'Browser',
browse_description: 'Launch the browser'
}
};
status.command({
name: "browse",
title: I18n.t('browse_title'),
description: I18n.t('browse_description'),
color: "#ffa500",
fullscreen: true,
suggestionsTrigger: 'on-send',
params: [{
name: "url",
suggestions: function(params, context) {
2017-01-02 08:17:44 +00:00
var url = "dapp-url";
if (params.url && params.url !== "undefined" && params.url != "") {
url = params.url;
if (!/^[a-zA-Z-_]+:/.test(url)) {
url = 'http://' + url;
}
}
return {webViewUrl: url};
2016-12-24 10:15:35 +00:00
},
type: status.types.TEXT
}]
});
status.autorun("browse");