diff --git a/app/scripts/controllers/offlineTxCtrl.js b/app/scripts/controllers/offlineTxCtrl.js new file mode 100644 index 0000000000..9ebcf57065 --- /dev/null +++ b/app/scripts/controllers/offlineTxCtrl.js @@ -0,0 +1,7 @@ +'use strict'; +var offlineTxCtrl = function($scope, $sce, walletService) { + //new Modal(document.getElementById('sendTransaction')); + walletService.wallet = null; + walletService.password = ''; +}; +module.exports = offlineTxCtrl; \ No newline at end of file diff --git a/app/scripts/controllers/sendTxCtrl.js b/app/scripts/controllers/sendTxCtrl.js index 474d9f64be..4f624e2d87 100644 --- a/app/scripts/controllers/sendTxCtrl.js +++ b/app/scripts/controllers/sendTxCtrl.js @@ -6,11 +6,11 @@ var sendTxCtrl = function($scope, $sce, walletService) { $scope.showAdvance = false; $scope.showRaw = false; $scope.tx = { - gasLimit: globalFuncs.defaultTxGasLimit, - data: "", - to: "", + gasLimit: globalFuncs.urlGet('gaslimit') == null ? globalFuncs.defaultTxGasLimit : globalFuncs.urlGet('gaslimit'), + data: globalFuncs.urlGet('data') == null ? "" : globalFuncs.urlGet('data'), + to: globalFuncs.urlGet('to') == null ? "" : globalFuncs.urlGet('to'), unit: "ether", - value: '', + value: globalFuncs.urlGet('value') == null ? "" : globalFuncs.urlGet('value'), nonce: null, gasPrice: null, donate: false diff --git a/app/scripts/controllers/tabsCtrl.js b/app/scripts/controllers/tabsCtrl.js index 4aa549cfa8..5de0b32bf3 100644 --- a/app/scripts/controllers/tabsCtrl.js +++ b/app/scripts/controllers/tabsCtrl.js @@ -1,9 +1,25 @@ 'use strict'; var tabsCtrl = function($scope, globalService) { $scope.tabNames = globalService.tabs; - $scope.activeTab = globalService.currentTab; + var hval = window.location.hash; + if(hval!=""){ + hval = hval.replace("#",''); + for (var key in $scope.tabNames) { + if($scope.tabNames[key].url == hval){ + $scope.activeTab = globalService.currentTab = $scope.tabNames[key].id; + break; + } + $scope.activeTab = globalService.currentTab; + } + } else { + $scope.activeTab = globalService.currentTab; + } $scope.tabClick = function(id) { $scope.activeTab = globalService.currentTab = id; + for (var key in $scope.tabNames) { + if($scope.tabNames[key].id == id) + location.hash = $scope.tabNames[key].url; + } } }; module.exports = tabsCtrl; \ No newline at end of file diff --git a/app/scripts/globalFuncs.js b/app/scripts/globalFuncs.js index 25dc641ed6..89a9cffa09 100644 --- a/app/scripts/globalFuncs.js +++ b/app/scripts/globalFuncs.js @@ -8,9 +8,8 @@ globalFuncs.getBlockie = function(address) { }).toDataURL(); } globalFuncs.printPaperWallets = function(strJson) { - console.log(strJson); var win = window.open("about:blank", "_blank"); - var data = "
"); @@ -54,4 +53,15 @@ globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; globalFuncs.isNumeric = function(n) { return !isNaN(parseFloat(n)) && isFinite(n); } +globalFuncs.urlGet = function (name){ + if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search)) + return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str){ + var SCRIPT_REGEX = /"); @@ -717,6 +732,17 @@ globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; globalFuncs.isNumeric = function(n) { return !isNaN(parseFloat(n)) && isFinite(n); } +globalFuncs.urlGet = function (name){ + if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search)) + return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str){ + var SCRIPT_REGEX = /"); @@ -717,6 +732,17 @@ globalFuncs.donateAddress = "0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8"; globalFuncs.isNumeric = function(n) { return !isNaN(parseFloat(n)) && isFinite(n); } +globalFuncs.urlGet = function (name){ + if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search)) + return this.stripTags(decodeURIComponent(name[1])); +} +globalFuncs.stripTags = function(str){ + var SCRIPT_REGEX = /