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

Commit

Permalink
Merge pull request #2069 from kvhnuke/devop/hotfix-mewconnect
Browse files Browse the repository at this point in the history
devop/hotfix-mewconnect
  • Loading branch information
gamalielhere authored Sep 18, 2018
2 parents bd44d23 + 1e875e7 commit e137499
Show file tree
Hide file tree
Showing 27 changed files with 177,981 additions and 189,123 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### Release v3.22.1
### New
- Hotfix link and icon for MEWconnect, Add PAX token and contract, and dqr30 token [#2069](https://github.com/kvhnuke/etherwallet/pull/2069)

### Release v3.22.0
### New
- MEW connect integration [#2068](https://github.com/kvhnuke/etherwallet/pull/2068)
Expand Down
49 changes: 29 additions & 20 deletions app/images/MEWconnectLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions app/includes/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,18 @@
@@if (site === 'mew' ) {
<a class="brand" href="/" aria-label="Go to homepage">
<img src="images/logo-myetherwallet.svg" height="64px" width="245px" alt="MyEtherWallet" />
<p class="small visible-xs">3.22.0</p>
<p class="small visible-xs">3.22.1</p>
</a>
}
@@if (site === 'cx' ) {
<a class="brand" href="/cx-wallet.html" aria-label="Go to homepage">
<img src="images/logo-myetherwalletcx.svg" height="64px" width="245px" alt="MyEtherWallet" />
<p class="small visible-xs">3.22.0</p>
<p class="small visible-xs">3.22.1</p>
</a>
}
<div class="tagline">
<span class="hidden-xs">3.22.0</span>
<span class="hidden-xs">3.22.1</span>
<span class="dropdown dropdown-lang" ng-cloak>
<a tabindex="0" aria-haspopup="true" aria-expanded="false" aria-label="change language. current language {{curLang}}" class="dropdown-toggle" ng-click="dropdown = !dropdown">{{curLang}}<i class="caret"></i></a>
Expand Down
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MyEtherWallet",
"version": "3.22.0",
"version": "3.22.1",
"manifest_version": 2,
"description": "MyEtherWallet Chrome Extension",
"homepage_url": "https://www.myetherwallet.com/",
Expand Down
6 changes: 4 additions & 2 deletions app/scripts/abiDefinitions/ethAbi.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/scripts/controllers/decryptWalletCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ var decryptWalletCtrl = function($scope, $sce, walletService) {
hwEther1Path: "m/44'/1313114'/0'/0", // first address: m/44'/1313114'/0'/0/0
hwAtheiosPath: "m/44'/1620'/0'/0", // first address: m/44'/1620'/0'/0/0
};
$scope.canUseMewConnect = MewConnectEth.checkWebRTCAvailable();
$scope.mewConnectMayFail = MewConnectEth.checkBrowser();
$scope.canUseMewConnect = MewConnectEth.checkWebRTCAvailable();
$scope.mewConnectMayFail = MewConnectEth.checkBrowser();
$scope.HDWallet.dPath = $scope.HDWallet.defaultDPath;
$scope.mnemonicModel = new Modal(document.getElementById('mnemonicModel'));
$scope.$watch('ajaxReq.type', function() {
Expand Down
26 changes: 13 additions & 13 deletions app/scripts/directives/walletDecryptDrtv.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ <h4 translate="decrypt_Access">
View w/ Address Only
</label>

<!-- MEWconnect -->
<label
class="radio"><!-- todo re-add aria-flowto="aria10" property -->
<input type="radio"
aria-label="MEW Connect"
ng-model="walletType"
value="mewConnect"/>
<span><!-- todo re-add translation property -->
<img src="images/MEWconnectLogo.svg" width="120" height="26">
</span>
</label>

<!-- MetaMask -->
<label aria-flowto="aria2"
class="radio">
Expand Down Expand Up @@ -96,18 +108,6 @@ <h4 translate="decrypt_Access">
</a>
</label>

<!-- MEWconnect -->
<label
class="radio"><!-- todo re-add aria-flowto="aria10" property -->
<input type="radio"
aria-label="MEW Connect"
ng-model="walletType"
value="mewConnect"/>
<span><!-- todo re-add translation property -->
<img src="images/MEWconnectLogo.svg" width="120" height="26">
</span>
</label>

<!-- Mnemonic Phrase -->
<label aria-flowto="aria7"
class="radio">
Expand Down Expand Up @@ -519,7 +519,7 @@ <h4> <!-- todo re-add translation property -->
</li>
<li class="u__protip">
<!-- Todo add path -->
<span> Don't have MEWconnect? <br/> <a href="#" target="_blank" rel="noopener noreferrer"> <img src="images/appstore.png" height="50" width="170"> </a>
<span> Don't have MEWconnect? <br/> <a href="https://itunes.apple.com/us/app/mewconnect/id1391097156" target="_blank" rel="noopener noreferrer"> <img src="images/appstore.png" height="50" width="170"> </a>
</li>
</ul>
<div class="form-group"
Expand Down
125 changes: 29 additions & 96 deletions app/scripts/staticJS/mewConnectEth.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class MewConnectEth {
}

static checkBrowser() {
const browser = window.browser;
const version = browser.version.split(0, 1)[0]
/*
* Chrome > 23
* Firefox > 22
Expand All @@ -128,110 +130,41 @@ class MewConnectEth {
* IE - none
* */
if (typeof window !== 'undefined') {
var UA = window.navigator.userAgent;
var browsersToCheck = {
safari: {
ua: UA.indexOf('Safari') !== -1,
version: /(?<=Version\/)((?<!\.)[\d{1,2}]*)/
},
IE: {
ua: UA.indexOf('MSIE') !== -1 || UA.indexOf('Trident') !== -1,
version: /(?<=MSIE)((?<!\.)[\s\d{1,2}]*)|(?<=rv:)((?<!\.)[\s\d{1,2}]*)/
},
edge: {
ua: UA.indexOf('Edge') !== -1,
version: /(?<=Edge\/)((?<!\.)[\d{1,2}]*)/
},
chrome: {
ua: UA.indexOf('Chrome') !== -1,
version: /(?<=Chrome\/)((?<!\.)[\d{1,2}]*)/,
after: 23
},
android: {
ua: UA.indexOf('Android') !== -1,
version: ''
},
fireFox: {
ua: UA.indexOf('Firefox') !== -1,
version: /(?<=Firefox\/)((?<!\.)[\d{1,2}]*)/,
after: 22
},
opera: {
ua: UA.indexOf('Opera') !== -1,
version: /(?<=OPR\/)((?<!\.)[\d{1,2}]*)/,
after: 18
}
};

if (browsersToCheck.safari.ua && !browsersToCheck.chrome.ua) {
var match_Safari = UA.match(browsersToCheck.safari.version);
if (match_Safari) {
try {
if (+match_Safari[1] >= 12) {
return MewConnectEth.buildBrowserResult(false, '', '');
} else if(+match_Safari[1] === 11) {
return MewConnectEth.buildBrowserResult(true, 'Safari', 'version: ' + match_Safari[1]);
} else {
return MewConnectEth.buildBrowserResult(true, 'Safari', 'version: ' + match_Safari[1], true);
}
} catch (e) {

}
}
} else if (browsersToCheck.IE.ua) {
var match_IE = UA.match(browsersToCheck.IE.version);
if (match_IE) {
try {
if (match_IE[1]) {
return MewConnectEth.buildBrowserResult(true, 'Internet Explorer', '', true);
} else if (match_IE[2]) {
return MewConnectEth.buildBrowserResult(true, 'Internet Explorer', '', true);
}
} catch (e) {

}
}
} else if (browsersToCheck.edge.ua) {
var match_Edge = UA.match(browsersToCheck.edge.version);
if (match_Edge) {
try {
if (+match_Edge[1]) {
return MewConnectEth.buildBrowserResult(true, 'Edge', 'version: ' + match_Edge[1], true);
}
} catch (e) {

}
if (browser.name === 'safari') {
if (+version >= 12) {
return MewConnectEth.buildBrowserResult(false, '', '');
} else if (+version === 11) {
return MewConnectEth.buildBrowserResult(true, 'Safari', 'version: ' + browser.version);
}
} else if (browser.name === 'ie') {
return MewConnectEth.buildBrowserResult(true, 'Internet Explorer', '', true);
} else if (browser.name === 'edge') {
return MewConnectEth.buildBrowserResult(true, 'Edge', 'version: ' + browser.version, true);
} else {
var name = '';
var versionRegex = /.*/;
var minVersion = 0;
if (browsersToCheck.opera.ua) {
let name = '';
let minVersion = 0;

if (browser.name === 'opera') {
name = 'Opera';
versionRegex = browsersToCheck.opera.version;
minVersion = browsersToCheck.opera.after;
} else if (browsersToCheck.fireFox.ua) {
name = 'FireFox';
versionRegex = browsersToCheck.fireFox.version;
minVersion = browsersToCheck.fireFox.after;
} else if (browsersToCheck.chrome.ua) {
minVersion = 18;
} else if (browser.name === 'firefox') {
name = 'Firefox';
minVersion = 22;
} else if (browser.name === 'chrome') {
name = 'Chrome';
versionRegex = browsersToCheck.chrome.version;
minVersion = browsersToCheck.chrome.after;
minVersion = 23;
} else {
return MewConnectEth.buildBrowserResult(false, '', '');
}
var versionCheck = UA.match(versionRegex);
if (versionCheck) {
try {
if (minVersion >= +versionCheck[1]) {
return MewConnectEth.buildBrowserResult(true, name, 'version: ' + versionCheck[1]);
} else {
return MewConnectEth.buildBrowserResult(false, '', '');
}
} catch (e) {
console.error(e); // todo replace with proper error

try {
if (minVersion >= +version) {
return MewConnectEth.buildBrowserResult(true, name, 'version: ' + version);
} else {
return MewConnectEth.buildBrowserResult(false, '', '');
}
} catch(e) {
console.error(e)
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions app/scripts/tokens/ethTokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -2969,6 +2969,12 @@
"decimal": 18,
"type": "default"
},
{
"address": "0x8e870d67f660d95d5be530380d0ec0bd388289e1",
"symbol": "PAX",
"decimal": 18,
"type": "default"
},
{
"address": "0xB97048628DB6B661D4C2aA833e95Dbe1A905B280",
"symbol": "PAY",
Expand Down
20 changes: 14 additions & 6 deletions app/scripts/tokens/ropstenTokens.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
[{
"address":"0x95D7321EdCe519419ba1DbC60A89bAfbF55EAC0D",
"symbol":"💥 PLASMA",
"decimal":6,
"type":"default"
}]
[
{
"address": "0x95D7321EdCe519419ba1DbC60A89bAfbF55EAC0D",
"symbol": "💥 PLASMA",
"decimal": 6,
"type": "default"
},
{
"address": "0xa1bacca0e12d4091ec1f92e7cae3394cc9854d3d",
"symbol": "dqr30",
"decimal": 18,
"type": "default"
}
]
4 changes: 2 additions & 2 deletions chrome-extension/contest.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@

<a class="brand" href="/" aria-label="Go to homepage">
<img src="images/logo-myetherwallet.svg" height="64px" width="245px" alt="MyEtherWallet" />
<p class="small visible-xs">3.22.0</p>
<p class="small visible-xs">3.22.1</p>
</a>


<div class="tagline">

<span class="hidden-xs">3.22.0</span>
<span class="hidden-xs">3.22.1</span>

<span class="dropdown dropdown-lang" ng-cloak>
<a tabindex="0" aria-haspopup="true" aria-expanded="false" aria-label="change language. current language {{curLang}}" class="dropdown-toggle" ng-click="dropdown = !dropdown">{{curLang}}<i class="caret"></i></a>
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/cx-wallet.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@

<a class="brand" href="/cx-wallet.html" aria-label="Go to homepage">
<img src="images/logo-myetherwalletcx.svg" height="64px" width="245px" alt="MyEtherWallet" />
<p class="small visible-xs">3.22.0</p>
<p class="small visible-xs">3.22.1</p>
</a>

<div class="tagline">

<span class="hidden-xs">3.22.0</span>
<span class="hidden-xs">3.22.1</span>

<span class="dropdown dropdown-lang" ng-cloak>
<a tabindex="0" aria-haspopup="true" aria-expanded="false" aria-label="change language. current language {{curLang}}" class="dropdown-toggle" ng-click="dropdown = !dropdown">{{curLang}}<i class="caret"></i></a>
Expand Down
4 changes: 2 additions & 2 deletions chrome-extension/helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@

<a class="brand" href="/" aria-label="Go to homepage">
<img src="images/logo-myetherwallet.svg" height="64px" width="245px" alt="MyEtherWallet" />
<p class="small visible-xs">3.22.0</p>
<p class="small visible-xs">3.22.1</p>
</a>


<div class="tagline">

<span class="hidden-xs">3.22.0</span>
<span class="hidden-xs">3.22.1</span>

<span class="dropdown dropdown-lang" ng-cloak>
<a tabindex="0" aria-haspopup="true" aria-expanded="false" aria-label="change language. current language {{curLang}}" class="dropdown-toggle" ng-click="dropdown = !dropdown">{{curLang}}<i class="caret"></i></a>
Expand Down
Loading

0 comments on commit e137499

Please sign in to comment.