Skip to content
This repository has been archived by the owner on Nov 21, 2019. It is now read-only.

Commit

Permalink
Merge branch 'mercury' of https://github.com/kvhnuke/etherwallet into…
Browse files Browse the repository at this point in the history
… mercury
  • Loading branch information
tayvano committed May 31, 2016
2 parents 0a7db82 + 2c0c740 commit a4c2071
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 119 deletions.
43 changes: 20 additions & 23 deletions app/scripts/controllers/theDaoProposalCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,27 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
}
});
}

$scope.comparator = globalFuncs.urlGet('id') != null;
$scope.filters = {
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '',
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '',
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : ''
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : (function () { return; })(),
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : (function () { return; })(),
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') :(function () { return; })()
};
$scope.comparator = globalFuncs.urlGet('id') != null;
if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) {
if ($scope.filters.id == '' && $scope.filters.open == undefined && $scope.filters.split == undefined && $scope.filters.description == undefined ) {
$scope.filters.split = 'false';
$scope.filters.open = 'true';
}

$scope.$watch('filters', function(newValue, oldValue) {
if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false;
if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = '';
if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = '';
}, true);
if ((newValue.id != oldValue.id) && ($scope.filters.id == '' || $scope.filters.id == null)) {
$scope.filters = {}
$scope.comparator = false;
}
if (newValue.id != '' && newValue.id != null) {
$scope.filters = {id:newValue.id};
$scope.comparator = true;
}
}, true);
$scope.initValues();
$scope.showProposal = function(id) {
if (!$scope.AllProposals[id].showprop) {
Expand Down Expand Up @@ -142,14 +145,11 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
objProposal.totalVotes = yeaBN.plus(nayBN)
objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber();
objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber();

objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised;
objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised;

objProposal.openEnglish = objProposal.open == true ? "Yes" : "No";
objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No";
objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No";

if (objProposal.description.indexOf('\n') > 0) {
var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n'));
objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || ""));
Expand All @@ -158,21 +158,18 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
return objProposal;
}
$scope.generateTx = function() {
uiFuncs.generateTx($scope, $sce, function(){
$scope.sendTx();
uiFuncs.generateTx($scope, $sce, function() {
$scope.sendTx();
});
}
$scope.sendTx = function() {
ajaxReq.sendRawTx($scope.signedTx, function(data) {
if (data.error) {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17] ));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17]));
} else {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data));
}
});
}

};


module.exports = theDaoProposalCtrl;
module.exports = theDaoProposalCtrl;
44 changes: 20 additions & 24 deletions chrome-extension/js/etherwallet-master-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,24 +1287,27 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
}
});
}

$scope.comparator = globalFuncs.urlGet('id') != null;
$scope.filters = {
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '',
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '',
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : ''
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : (function () { return; })(),
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : (function () { return; })(),
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') :(function () { return; })()
};
$scope.comparator = globalFuncs.urlGet('id') != null;
if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) {
if ($scope.filters.id == '' && $scope.filters.open == undefined && $scope.filters.split == undefined && $scope.filters.description == undefined ) {
$scope.filters.split = 'false';
$scope.filters.open = 'true';
}

$scope.$watch('filters', function(newValue, oldValue) {
if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false;
if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = '';
if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = '';
}, true);
if ((newValue.id != oldValue.id) && ($scope.filters.id == '' || $scope.filters.id == null)) {
$scope.filters = {}
$scope.comparator = false;
}
if (newValue.id != '' && newValue.id != null) {
$scope.filters = {id:newValue.id};
$scope.comparator = true;
}
}, true);
$scope.initValues();
$scope.showProposal = function(id) {
if (!$scope.AllProposals[id].showprop) {
Expand Down Expand Up @@ -1367,14 +1370,11 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
objProposal.totalVotes = yeaBN.plus(nayBN)
objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber();
objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber();

objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised;
objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised;

objProposal.openEnglish = objProposal.open == true ? "Yes" : "No";
objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No";
objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No";

if (objProposal.description.indexOf('\n') > 0) {
var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n'));
objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || ""));
Expand All @@ -1383,25 +1383,21 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
return objProposal;
}
$scope.generateTx = function() {
uiFuncs.generateTx($scope, $sce, function(){
$scope.sendTx();
uiFuncs.generateTx($scope, $sce, function() {
$scope.sendTx();
});
}
$scope.sendTx = function() {
ajaxReq.sendRawTx($scope.signedTx, function(data) {
if (data.error) {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17] ));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17]));
} else {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data));
}
});
}

};


module.exports = theDaoProposalCtrl;

module.exports = theDaoProposalCtrl;
},{}],15:[function(require,module,exports){
'use strict';
var viewCtrl = function($scope, globalService) {
Expand Down
44 changes: 20 additions & 24 deletions chrome-extension/js/etherwallet-master.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,24 +1287,27 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
}
});
}

$scope.comparator = globalFuncs.urlGet('id') != null;
$scope.filters = {
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '',
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '',
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : ''
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : (function () { return; })(),
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : (function () { return; })(),
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') :(function () { return; })()
};
$scope.comparator = globalFuncs.urlGet('id') != null;
if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) {
if ($scope.filters.id == '' && $scope.filters.open == undefined && $scope.filters.split == undefined && $scope.filters.description == undefined ) {
$scope.filters.split = 'false';
$scope.filters.open = 'true';
}

$scope.$watch('filters', function(newValue, oldValue) {
if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false;
if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = '';
if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = '';
}, true);
if ((newValue.id != oldValue.id) && ($scope.filters.id == '' || $scope.filters.id == null)) {
$scope.filters = {}
$scope.comparator = false;
}
if (newValue.id != '' && newValue.id != null) {
$scope.filters = {id:newValue.id};
$scope.comparator = true;
}
}, true);
$scope.initValues();
$scope.showProposal = function(id) {
if (!$scope.AllProposals[id].showprop) {
Expand Down Expand Up @@ -1367,14 +1370,11 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
objProposal.totalVotes = yeaBN.plus(nayBN)
objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber();
objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber();

objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised;
objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised;

objProposal.openEnglish = objProposal.open == true ? "Yes" : "No";
objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No";
objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No";

if (objProposal.description.indexOf('\n') > 0) {
var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n'));
objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || ""));
Expand All @@ -1383,25 +1383,21 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
return objProposal;
}
$scope.generateTx = function() {
uiFuncs.generateTx($scope, $sce, function(){
$scope.sendTx();
uiFuncs.generateTx($scope, $sce, function() {
$scope.sendTx();
});
}
$scope.sendTx = function() {
ajaxReq.sendRawTx($scope.signedTx, function(data) {
if (data.error) {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17] ));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17]));
} else {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data));
}
});
}

};


module.exports = theDaoProposalCtrl;

module.exports = theDaoProposalCtrl;
},{}],15:[function(require,module,exports){
'use strict';
var viewCtrl = function($scope, globalService) {
Expand Down
44 changes: 20 additions & 24 deletions dist/js/etherwallet-master-min.js
Original file line number Diff line number Diff line change
Expand Up @@ -1287,24 +1287,27 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
}
});
}

$scope.comparator = globalFuncs.urlGet('id') != null;
$scope.filters = {
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : '',
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : '',
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') : ''
id: globalFuncs.urlGet('id') != null ? parseInt(globalFuncs.urlGet('id')) : '',
open: globalFuncs.urlGet('open') != null ? globalFuncs.urlGet('open') : (function () { return; })(),
split: globalFuncs.urlGet('split') != null ? globalFuncs.urlGet('split') : (function () { return; })(),
description: globalFuncs.urlGet('description') != null ? globalFuncs.urlGet('description') :(function () { return; })()
};
$scope.comparator = globalFuncs.urlGet('id') != null;
if ($scope.filters.id == '' && $scope.filters.open == '' && $scope.filters.split == '' && $scope.filters.description == '' ) {
if ($scope.filters.id == '' && $scope.filters.open == undefined && $scope.filters.split == undefined && $scope.filters.description == undefined ) {
$scope.filters.split = 'false';
$scope.filters.open = 'true';
}

$scope.$watch('filters', function(newValue, oldValue) {
if ((newValue.id!=oldValue.id)&&($scope.filters.id == '' || $scope.filters.id == null)) $scope.comparator = false;
if (newValue.open!=oldValue.open && $scope.filters.open == '') $scope.filters.id = '';
if (newValue.split!=oldValue.split && $scope.filters.split != '') $scope.filters.id = '';
}, true);
if ((newValue.id != oldValue.id) && ($scope.filters.id == '' || $scope.filters.id == null)) {
$scope.filters = {}
$scope.comparator = false;
}
if (newValue.id != '' && newValue.id != null) {
$scope.filters = {id:newValue.id};
$scope.comparator = true;
}
}, true);
$scope.initValues();
$scope.showProposal = function(id) {
if (!$scope.AllProposals[id].showprop) {
Expand Down Expand Up @@ -1367,14 +1370,11 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
objProposal.totalVotes = yeaBN.plus(nayBN)
objProposal.yeaPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : yeaBN.div(objProposal.totalVotes).times(100).toNumber();
objProposal.nayPer = yeaBN.plus(nayBN).toNumber() == '0' ? 0 : nayBN.div(objProposal.totalVotes).times(100).toNumber();

objProposal.quorumCurrent = (objProposal.totalVotes * 100) / $scope.totRaised;
objProposal.quorumPer = (objProposal.minQuroum() * 100) / $scope.totRaised;

objProposal.openEnglish = objProposal.open == true ? "Yes" : "No";
objProposal.splitEnglish = objProposal.split == true ? "Yes" : "No";
objProposal.proposalPassedEnglish = objProposal.proposalPassed == true ? "Yes" : "No";

if (objProposal.description.indexOf('\n') > 0) {
var firstLine = objProposal.description.substring(0, objProposal.description.indexOf('\n'));
objProposal.descriptionHTML = $sce.trustAsHtml(marked(objProposal.description.substring(firstLine.length + 1) || ""));
Expand All @@ -1383,25 +1383,21 @@ var theDaoProposalCtrl = function($scope, $sce, walletService) {
return objProposal;
}
$scope.generateTx = function() {
uiFuncs.generateTx($scope, $sce, function(){
$scope.sendTx();
uiFuncs.generateTx($scope, $sce, function() {
$scope.sendTx();
});
}
$scope.sendTx = function() {
ajaxReq.sendRawTx($scope.signedTx, function(data) {
if (data.error) {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17] ));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getDangerText(data.msg + "<br />" + globalFuncs.errorMsgs[17]));
} else {
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " +globalFuncs.successMsgs[2] + " " + data.data));
$scope.sendTxStatus = $sce.trustAsHtml(globalFuncs.getSuccessText(globalFuncs.successMsgs[4] + " " + globalFuncs.successMsgs[2] + " " + data.data));
}
});
}

};


module.exports = theDaoProposalCtrl;

module.exports = theDaoProposalCtrl;
},{}],15:[function(require,module,exports){
'use strict';
var viewCtrl = function($scope, globalService) {
Expand Down
Loading

0 comments on commit a4c2071

Please sign in to comment.