diff --git a/chrome-extension/js/etherwallet-master.js b/chrome-extension/js/etherwallet-master.js index 90bcbc01d2..8817814d32 100644 --- a/chrome-extension/js/etherwallet-master.js +++ b/chrome-extension/js/etherwallet-master.js @@ -75,7 +75,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; @@ -85,7 +85,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]]'; @@ -156,7 +156,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 = ""; @@ -359,7 +359,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 () { @@ -410,7 +410,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 () { @@ -446,7 +446,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')); @@ -621,7 +621,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; @@ -720,7 +720,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 { @@ -752,7 +752,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"; @@ -917,13 +917,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); } @@ -944,7 +945,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 = ""; @@ -1080,10 +1081,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, @@ -1146,7 +1147,7 @@ module.exports = decryptWalletCtrl; },{"buffer":146}],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"; @@ -1167,7 +1168,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 = ''; @@ -1254,7 +1255,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; @@ -1337,7 +1340,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')); @@ -1366,7 +1369,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') { @@ -1533,7 +1539,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 () { @@ -1592,7 +1598,7 @@ module.exports = signMsgCtrl; },{"buffer":146}],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; @@ -1605,7 +1611,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; @@ -1628,7 +1634,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; }; @@ -1640,11 +1646,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; @@ -1664,27 +1671,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", @@ -1797,7 +1804,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'; @@ -1830,9 +1837,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) { @@ -1874,7 +1883,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(); @@ -1942,8 +1953,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 () { @@ -2031,7 +2045,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; @@ -2042,7 +2056,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"; @@ -2089,7 +2103,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: "", @@ -2124,7 +2138,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; @@ -2164,7 +2178,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 = []; @@ -2252,7 +2266,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 () { @@ -2278,7 +2292,7 @@ module.exports = QRCodeDrtv; },{}],26:[function(require,module,exports){ 'use strict'; -var balanceDrtv = function () { +var balanceDrtv = function balanceDrtv() { return { restrict: "E", template: '