2016-11-22 12:50:52 +00:00
|
|
|
|
|
|
|
I18n.translations = {
|
|
|
|
en: {
|
|
|
|
browse_title: 'Browser',
|
|
|
|
browse_description: 'Launch the browser'
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2016-11-18 10:19:28 +00:00
|
|
|
function wallet(params, context) {
|
2016-11-10 14:02:12 +00:00
|
|
|
var url = 'http://status.im/dapps/wallet';
|
2016-08-03 13:15:04 +00:00
|
|
|
|
2016-11-18 10:19:28 +00:00
|
|
|
if (context.debug) {
|
|
|
|
url = 'http://127.0.0.1:3450'
|
|
|
|
}
|
|
|
|
|
2016-10-29 20:02:49 +00:00
|
|
|
if (params.url && params.url !== "undefined" && params.url != "") {
|
|
|
|
url = params.url;
|
|
|
|
if (!/^[a-zA-Z-_]+:/.test(url)) {
|
|
|
|
url = 'http://' + url;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-08-03 13:15:04 +00:00
|
|
|
return {webViewUrl: url};
|
|
|
|
}
|
|
|
|
|
|
|
|
status.command({
|
2016-10-18 11:01:22 +00:00
|
|
|
name: "browse",
|
2016-11-22 12:50:52 +00:00
|
|
|
title: I18n.t('browse_title'),
|
|
|
|
description: I18n.t('browse_description'),
|
2016-08-03 13:15:04 +00:00
|
|
|
color: "#ffa500",
|
|
|
|
fullscreen: true,
|
|
|
|
suggestionsTrigger: 'on-send',
|
|
|
|
params: [{
|
2016-10-29 20:02:49 +00:00
|
|
|
name: "url",
|
2016-08-03 13:15:04 +00:00
|
|
|
suggestions: wallet,
|
|
|
|
type: status.types.TEXT
|
|
|
|
}]
|
|
|
|
});
|
|
|
|
|
2016-10-18 11:01:22 +00:00
|
|
|
status.autorun("browse");
|
2016-10-20 13:51:37 +00:00
|
|
|
|
|
|
|
status.registerFunction("send", function (params, context) {
|
|
|
|
var data = {
|
|
|
|
from: context.from,
|
|
|
|
to: params.address,
|
|
|
|
value: web3.toWei(params.amount, "ether")
|
|
|
|
};
|
|
|
|
|
|
|
|
web3.eth.sendTransaction(data);
|
|
|
|
})
|