diff --git a/app/includes/header.tpl b/app/includes/header.tpl index 9e037d50f0..014721cbb9 100644 --- a/app/includes/header.tpl +++ b/app/includes/header.tpl @@ -43,7 +43,7 @@
Open-Source & Client-Side Ether Wallet - · v3.5.3    + · v3.5.4    diff --git a/chrome-extension/cx-wallet.html b/chrome-extension/cx-wallet.html index 8c855668be..94128dc667 100644 --- a/chrome-extension/cx-wallet.html +++ b/chrome-extension/cx-wallet.html @@ -43,7 +43,7 @@
Open-Source & Client-Side Ether Wallet - · v3.5.3    + · v3.5.4    diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js index a24849a880..033973ed09 100644 --- a/chrome-extension/js/etherwallet-master.js +++ b/chrome-extension/js/etherwallet-master.js @@ -97,7 +97,7 @@ module.exports=[{ },{}],4:[function(require,module,exports){ 'use strict'; -var ajaxReq = function () {}; +var ajaxReq = function ajaxReq() {}; ajaxReq.http = null; ajaxReq.postSerializer = null; ajaxReq.getETHvalue = null; @@ -107,7 +107,7 @@ module.exports = ajaxReq; },{}],5:[function(require,module,exports){ 'use strict'; -var bity = function () {}; +var bity = function bity() {}; bity.SERVERURL = "https://bity.myetherapi.com"; bity.decimals = 6; bity.ethExplorer = 'https://etherscan.io/tx/[[txHash]]'; @@ -178,7 +178,7 @@ module.exports = bity; },{}],6:[function(require,module,exports){ 'use strict'; -var addWalletCtrl = function ($scope, $sce) { +var addWalletCtrl = function addWalletCtrl($scope, $sce) { $scope.showBtnGen = $scope.showBtnUnlock = $scope.showBtnAdd = $scope.showBtnAddWallet = $scope.showAddWallet = $scope.requireFPass = $scope.requirePPass = $scope.showPassTxt = false; $scope.nickNames = []; $scope.filePassword = $scope.fileContent = ""; @@ -381,7 +381,7 @@ module.exports = addWalletCtrl; },{}],7:[function(require,module,exports){ 'use strict'; -var cxDecryptWalletCtrl = function ($scope, $sce, walletService) { +var cxDecryptWalletCtrl = function cxDecryptWalletCtrl($scope, $sce, walletService) { $scope.allWallets = []; $scope.selectedWallet = $scope.password = ""; $scope.setAllWallets = function () { @@ -432,7 +432,7 @@ module.exports = cxDecryptWalletCtrl; },{}],8:[function(require,module,exports){ 'use strict'; -var mainPopCtrl = function ($scope, $sce) { +var mainPopCtrl = function mainPopCtrl($scope, $sce) { $scope.allWallets = []; $scope.allWatchOnly = []; $scope.setAllWallets = function () { @@ -468,7 +468,7 @@ module.exports = mainPopCtrl; },{}],9:[function(require,module,exports){ 'use strict'; -var myWalletsCtrl = function ($scope, $sce) { +var myWalletsCtrl = function myWalletsCtrl($scope, $sce) { $scope.editModal = new Modal(document.getElementById('editWallet')); $scope.viewModal = new Modal(document.getElementById('viewWalletDetails')); $scope.removeModal = new Modal(document.getElementById('removeWallet')); @@ -643,7 +643,7 @@ module.exports = myWalletsCtrl; },{}],10:[function(require,module,exports){ 'use strict'; -var quickSendCtrl = function ($scope, $sce) { +var quickSendCtrl = function quickSendCtrl($scope, $sce) { $scope.allWallets = []; $scope.selectedWallet = ""; $scope.showConfirm = false; @@ -742,7 +742,7 @@ module.exports = quickSendCtrl; },{}],11:[function(require,module,exports){ 'use strict'; -var bulkGenCtrl = function ($scope) { +var bulkGenCtrl = function bulkGenCtrl($scope) { $scope.showWallets = false; $scope.genWallets = function () { if ($scope.amount == '' || $scope.amount != parseInt($scope.amount, 10)) alert(globalFuncs.errorMsgs[0]);else { @@ -774,7 +774,7 @@ module.exports = bulkGenCtrl; },{}],12:[function(require,module,exports){ 'use strict'; -var contractsCtrl = function ($scope, $sce, walletService) { +var contractsCtrl = function contractsCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; walletService.wallet = null; $scope.visibility = "interactView"; @@ -939,13 +939,14 @@ var contractsCtrl = function ($scope, $sce, walletService) { if (!$scope.Validator.isValidAddress($scope.contract.address)) throw globalFuncs.errorMsgs[5];else if (!$scope.Validator.isJSON($scope.contract.abi)) throw globalFuncs.errorMsgs[26]; $scope.contract.functions = []; var tAbi = JSON.parse($scope.contract.abi); - for (var i in tAbi) if (tAbi[i].type == "function") { - tAbi[i].inputs.map(function (i) { - i.value = ''; - }); - $scope.contract.functions.push(tAbi[i]); - } - $scope.showReadWrite = true; + for (var i in tAbi) { + if (tAbi[i].type == "function") { + tAbi[i].inputs.map(function (i) { + i.value = ''; + }); + $scope.contract.functions.push(tAbi[i]); + } + }$scope.showReadWrite = true; } catch (e) { $scope.notifier.danger(e); } @@ -966,7 +967,7 @@ module.exports = contractsCtrl; (function (Buffer){ 'use strict'; -var decryptWalletCtrl = function ($scope, $sce, walletService) { +var decryptWalletCtrl = function decryptWalletCtrl($scope, $sce, walletService) { $scope.walletType = ""; $scope.requireFPass = $scope.requirePPass = $scope.showFDecrypt = $scope.showPDecrypt = $scope.showAOnly = $scope.showParityDecrypt = false; $scope.filePassword = ""; @@ -1102,10 +1103,10 @@ var decryptWalletCtrl = function ($scope, $sce, walletService) { $scope.wallet = { type: "addressOnly", address: $scope.addressOnly, - getAddressString: function () { + getAddressString: function getAddressString() { return this.address; }, - getChecksumAddressString: function () { + getChecksumAddressString: function getChecksumAddressString() { return ethUtil.toChecksumAddress(this.getAddressString()); }, setBalance: tempWallet.setBalance, @@ -1168,7 +1169,7 @@ module.exports = decryptWalletCtrl; },{"buffer":153}],14:[function(require,module,exports){ 'use strict'; -var footerCtrl = function ($scope, globalService) { +var footerCtrl = function footerCtrl($scope, globalService) { $scope.footerModal = new Modal(document.getElementById('disclaimerModal')); $scope.ethBlockNumber = "loading"; $scope.etcBlockNumber = "loading"; @@ -1189,7 +1190,7 @@ module.exports = footerCtrl; },{}],15:[function(require,module,exports){ 'use strict'; -var offlineTxCtrl = function ($scope, $sce, walletService) { +var offlineTxCtrl = function offlineTxCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; walletService.wallet = null; walletService.password = ''; @@ -1276,7 +1277,9 @@ var offlineTxCtrl = function ($scope, $sce, walletService) { $scope.dropdownEnabled = true; } }, true); - $scope.setSendMode = function (index, tokenSymbol = '') { + $scope.setSendMode = function (index) { + var tokenSymbol = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + $scope.tokenTx.id = index; if (index == 'ether') { $scope.unitReadable = ajaxReq.type; @@ -1352,7 +1355,7 @@ module.exports = offlineTxCtrl; },{}],16:[function(require,module,exports){ 'use strict'; -var sendTxCtrl = function ($scope, $sce, walletService) { +var sendTxCtrl = function sendTxCtrl($scope, $sce, walletService) { $scope.ajaxReq = ajaxReq; $scope.unitReadable = ajaxReq.type; $scope.sendTxModal = new Modal(document.getElementById('sendTransaction')); @@ -1381,7 +1384,10 @@ var sendTxCtrl = function ($scope, $sce, walletService) { tokenSymbol: globalFuncs.urlGet('tokenSymbol') == null ? false : globalFuncs.urlGet('tokenSymbol'), readOnly: globalFuncs.urlGet('readOnly') == null ? false : true }; - $scope.setSendMode = function (sendMode, tokenId = '', tokenSymbol = '') { + $scope.setSendMode = function (sendMode) { + var tokenId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; + var tokenSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; + $scope.tx.sendMode = sendMode; $scope.unitReadable = ''; if (sendMode == 'ether') { @@ -1548,7 +1554,7 @@ module.exports = sendTxCtrl; (function (Buffer){ 'use strict'; -var signMsgCtrl = function ($scope, $sce, walletService) { +var signMsgCtrl = function signMsgCtrl($scope, $sce, walletService) { walletService.wallet = null; $scope.visibility = "signView"; $scope.$watch(function () { @@ -1607,7 +1613,7 @@ module.exports = signMsgCtrl; },{"buffer":153}],18:[function(require,module,exports){ 'use strict'; -var swapCtrl = function ($scope, $sce, walletService) { +var swapCtrl = function swapCtrl($scope, $sce, walletService) { var lStorageKey = "swapOrder"; $scope.ajaxReq = ajaxReq; $scope.Validator = Validator; @@ -1620,7 +1626,7 @@ var swapCtrl = function ($scope, $sce, walletService) { }, 30000); $scope.priceTicker = { ETHBTC: 1, ETHREP: 1, BTCREP: 1, BTCETH: 1, REPBTC: 1, REPETH: 1 }; $scope.availableCoins = ["ETH", "BTC", "REP"]; - var initValues = function () { + var initValues = function initValues() { $scope.showStage1 = true; $scope.showStage2 = $scope.showStage3Eth = $scope.showStage3Btc = false; $scope.orderResult = null; @@ -1643,7 +1649,7 @@ var swapCtrl = function ($scope, $sce, walletService) { greaterThanMax: 2, noErrors: 3 }; - var verify = function () { + var verify = function verify() { if (!$scope.bity.priceLoaded) return errors.priceNotLoaded;else if ($scope.swapOrder.toVal < bity.min || $scope.swapOrder.fromVal < bity.min) return errors.lessThanMin;else if ($scope.swapOrder.toCoin == "BTC" && $scope.swapOrder.toVal > bity.max || $scope.swapOrder.fromCoin == "BTC" && $scope.swapOrder.fromVal > bity.max) return errors.greaterThanMax;else if ($scope.swapOrder.toCoin == "ETH" && $scope.swapOrder.toVal * $scope.bity.curRate['ETHBTC'] > bity.max || $scope.swapOrder.fromCoin == "ETH" && $scope.swapOrder.fromVal * $scope.bity.curRate['ETHBTC'] > bity.max) return errors.greaterThanMax;else if ($scope.swapOrder.toCoin == "REP" && $scope.swapOrder.toVal * $scope.bity.curRate['REPBTC'] > bity.max || $scope.swapOrder.fromCoin == "REP" && $scope.swapOrder.fromVal * $scope.bity.curRate['REPBTC'] > bity.max) return errors.greaterThanMax; return errors.noErrors; }; @@ -1655,11 +1661,12 @@ var swapCtrl = function ($scope, $sce, walletService) { }; $scope.setOrderCoin = function (isFrom, coin) { if (isFrom) $scope.swapOrder.fromCoin = coin;else $scope.swapOrder.toCoin = coin; - if ($scope.swapOrder.fromCoin == $scope.swapOrder.toCoin) for (var i in $scope.availableCoins) if ($scope.availableCoins[i] != $scope.swapOrder.fromCoin) { - $scope.swapOrder.toCoin = $scope.availableCoins[i]; - break; - } - $scope.swapOrder.swapRate = $scope.bity.curRate[$scope.swapOrder.fromCoin + $scope.swapOrder.toCoin]; + if ($scope.swapOrder.fromCoin == $scope.swapOrder.toCoin) for (var i in $scope.availableCoins) { + if ($scope.availableCoins[i] != $scope.swapOrder.fromCoin) { + $scope.swapOrder.toCoin = $scope.availableCoins[i]; + break; + } + }$scope.swapOrder.swapRate = $scope.bity.curRate[$scope.swapOrder.fromCoin + $scope.swapOrder.toCoin]; $scope.swapOrder.swapPair = $scope.swapOrder.fromCoin + "/" + $scope.swapOrder.toCoin; $scope.updateEstimate(isFrom); $scope.dropdownFrom = $scope.dropdownTo = false; @@ -1679,27 +1686,27 @@ var swapCtrl = function ($scope, $sce, walletService) { $scope.notifier.danger(e); } }; - var getProgressBarArr = function (index, len) { + var getProgressBarArr = function getProgressBarArr(index, len) { var tempArr = []; for (var i = 0; i < len; i++) { if (i < index) tempArr.push('progress-true');else if (i == index) tempArr.push('progress-active');else tempArr.push(''); } return tempArr; }; - var isStorageOrderExists = function () { + var isStorageOrderExists = function isStorageOrderExists() { var order = localStorage.getItem(lStorageKey); return order && $scope.Validator.isJSON(order); }; - var setOrderFromStorage = function () { + var setOrderFromStorage = function setOrderFromStorage() { var order = JSON.parse(localStorage.getItem(lStorageKey)); $scope.orderResult = order; $scope.swapOrder = order.swapOrder; processOrder(); }; - var saveOrderToStorage = function (order) { + var saveOrderToStorage = function saveOrderToStorage(order) { localStorage.setItem(lStorageKey, JSON.stringify(order)); }; - var processOrder = function () { + var processOrder = function processOrder() { var orderResult = $scope.orderResult; orderResult.progress = { status: "OPEN", @@ -1812,7 +1819,7 @@ module.exports = swapCtrl; },{}],19:[function(require,module,exports){ 'use strict'; -var tabsCtrl = function ($scope, globalService, $translate, $sce) { +var tabsCtrl = function tabsCtrl($scope, globalService, $translate, $sce) { $scope.gService = globalService; $scope.tabNames = $scope.gService.tabs; $scope.curLang = 'English'; @@ -1845,9 +1852,11 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { $scope.dropdownNode = false; Token.popTokens = $scope.curNode.tokenList; ajaxReq['key'] = key; - for (var attrname in $scope.curNode.lib) ajaxReq[attrname] = $scope.curNode.lib[attrname]; - for (var attrname in $scope.curNode) if (attrname != 'name' && attrname != 'tokenList' && attrname != 'lib') ajaxReq[attrname] = $scope.curNode[attrname]; - localStorage.setItem('curNode', JSON.stringify({ + for (var attrname in $scope.curNode.lib) { + ajaxReq[attrname] = $scope.curNode.lib[attrname]; + }for (var attrname in $scope.curNode) { + if (attrname != 'name' && attrname != 'tokenList' && attrname != 'lib') ajaxReq[attrname] = $scope.curNode[attrname]; + }localStorage.setItem('curNode', JSON.stringify({ key: key })); ajaxReq.getCurrentBlock(function (data) { @@ -1889,7 +1898,9 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { var localNodes = localStorage.getItem('localNodes'); if (localNodes) { localNodes = JSON.parse(localNodes); - for (var i = 0; i < localNodes.length; i++) $scope.addCustomNodeToList(localNodes[i]); + for (var i = 0; i < localNodes.length; i++) { + $scope.addCustomNodeToList(localNodes[i]); + } } }; $scope.getCustomNodesFromStorage(); @@ -1957,8 +1968,11 @@ var tabsCtrl = function ($scope, globalService, $translate, $sce) { }; $scope.setErrorMsgLanguage = function () { - for (var i = 0; i < globalFuncs.errorMsgs.length; i++) $scope.setLanguageVal('ERROR_' + i, 'errorMsgs', i); - for (var i = 0; i < globalFuncs.successMsgs.length; i++) $scope.setLanguageVal('SUCCESS_' + (i + 1), 'successMsgs', i); + for (var i = 0; i < globalFuncs.errorMsgs.length; i++) { + $scope.setLanguageVal('ERROR_' + i, 'errorMsgs', i); + }for (var i = 0; i < globalFuncs.successMsgs.length; i++) { + $scope.setLanguageVal('SUCCESS_' + (i + 1), 'successMsgs', i); + } }; $scope.setGethErrMsgLanguage = function () { @@ -2046,7 +2060,7 @@ module.exports = tabsCtrl; },{}],20:[function(require,module,exports){ 'use strict'; -var viewCtrl = function ($scope, globalService, $sce) { +var viewCtrl = function viewCtrl($scope, globalService, $sce) { $scope.globalService = globalService; $scope.notifier = uiFuncs.notifier; $scope.notifier.sce = $sce; @@ -2057,7 +2071,7 @@ module.exports = viewCtrl; },{}],21:[function(require,module,exports){ 'use strict'; -var viewWalletCtrl = function ($scope, walletService) { +var viewWalletCtrl = function viewWalletCtrl($scope, walletService) { $scope.usdBalance = "loading"; $scope.eurBalance = "loading"; $scope.btcBalance = "loading"; @@ -2104,7 +2118,7 @@ module.exports = viewWalletCtrl; },{}],22:[function(require,module,exports){ 'use strict'; -var walletBalanceCtrl = function ($scope, $sce) { +var walletBalanceCtrl = function walletBalanceCtrl($scope, $sce) { $scope.ajaxReq = ajaxReq; $scope.localToken = { contractAdd: "", @@ -2139,7 +2153,7 @@ module.exports = walletBalanceCtrl; },{}],23:[function(require,module,exports){ 'use strict'; -var walletGenCtrl = function ($scope) { +var walletGenCtrl = function walletGenCtrl($scope) { $scope.password = ""; $scope.wallet = null; $scope.showWallet = false; @@ -2179,7 +2193,7 @@ module.exports = walletGenCtrl; },{}],24:[function(require,module,exports){ 'use strict'; -var cxFuncs = function () {}; +var cxFuncs = function cxFuncs() {}; cxFuncs.storage = chrome.storage.sync; cxFuncs.getAllNickNames = function (callback) { var nickNames = []; @@ -2267,7 +2281,7 @@ module.exports = cxFuncs; },{}],25:[function(require,module,exports){ 'use strict'; -var QRCodeDrtv = function () { +var QRCodeDrtv = function QRCodeDrtv() { return function (scope, element, attrs) { var watchVar = attrs.watchVar; scope.$watch(watchVar, function () { @@ -2293,15 +2307,15 @@ module.exports = QRCodeDrtv; },{}],26:[function(require,module,exports){ 'use strict'; -var addressFieldDrtv = function ($compile) { +var addressFieldDrtv = function addressFieldDrtv($compile) { return { restrict: "E", - link: function (scope, element, attrs) { + link: function link(scope, element, attrs) { var varName = attrs.varName; var varArr = varName.split('.'); var readOnly = attrs.readOnly ? attrs.readOnly : false; var placeholder = attrs.placeholder; - var setValue = function (value) { + var setValue = function setValue(value) { var temp = scope; for (var i in varArr) { if (i == varArr.length - 1) temp[varArr[i]] = value;else { @@ -2342,7 +2356,7 @@ module.exports = addressFieldDrtv; },{}],27:[function(require,module,exports){ 'use strict'; -var balanceDrtv = function () { +var balanceDrtv = function balanceDrtv() { return { restrict: "E", template: '