status-react/resources/dapp.js

34 lines
763 B
JavaScript
Raw Normal View History

2016-12-24 10:15:35 +00:00
I18n.translations = {
en: {
browse_title: 'Browser',
browse_description: 'Open web browser'
}
2016-12-24 10:15:35 +00:00
};
status.command({
name: "browse",
title: I18n.t('browse_title'),
description: I18n.t('browse_description'),
color: "#ffa500",
fullscreen: true,
params: [{
name: "url",
optional: true,
2016-12-24 10:15:35 +00:00
type: status.types.TEXT
}],
onSend: function (params, context) {
var url = params.url || params.metadata.url;
if (!/^[a-zA-Z-_]+:/.test(url)) {
url = 'http://' + url;
}
return {
title: params.metadata.name,
dynamicTitle: true,
markup: status.components.bridgedWebView(url)
};
}
2016-12-24 10:15:35 +00:00
});
status.autorun("browse");