forked from ethereum/meteor-dapp-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding wallet alert for mist users (ethereum#435)
- Loading branch information
1 parent
31f8a9d
commit 30ac582
Showing
4 changed files
with
169 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template name="mist_alert"> | ||
<div class="alert-banner {{alertViewState}}"> | ||
<section> | ||
<h1> ⚠︎ Warning</h1> | ||
<button type="button" class="hide-alert close-button">×</button> | ||
<p> | ||
Due to a vulnerability affecting all released versions of the Mist beta browser, we urge you for the time being, not to browse untrusted websites with Mist. Users of "Ethereum Wallet" desktop app are not affected. | ||
</p> | ||
<p> | ||
<a class="hide-alert button" href="javascript:void(0)">Close this message</a> | ||
<a class="hide-alert button download-button" href="https://github.com/ethereum/mist/releases">Download Ethereum Wallet</a> | ||
</p> | ||
</section> | ||
</div> | ||
|
||
<div class="show-alert alert-bubble {{bubbleViewState}}"> | ||
<button> | ||
<span class="icon-bell"></span> | ||
</button> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
var alertKey = 'alert_20171104-hidden'; | ||
console.log('mistAlert started'); | ||
Template['mist_alert'].onRendered(function(){ | ||
console.log(window.navigator, window.navigator.userAgent); | ||
|
||
TemplateVar.set('hidden', localStorage.getItem(alertKey)); | ||
console.log(TemplateVar.get('hidden')); | ||
}); | ||
|
||
Template['mist_alert'].helpers({ | ||
alertViewState: function() { | ||
return (!!TemplateVar.get('hidden'))? 'is-hidden' : ''; | ||
}, | ||
bubbleViewState: function() { | ||
return (!TemplateVar.get('hidden'))? 'is-hidden' : ''; | ||
} | ||
}); | ||
|
||
Template['mist_alert'].events({ | ||
'click .hide-alert': function() { | ||
localStorage.setItem(alertKey, true); | ||
TemplateVar.set('hidden', localStorage.getItem(alertKey)); | ||
}, | ||
|
||
'click .show-alert button': function() { | ||
localStorage.setItem(alertKey, ''); | ||
TemplateVar.set('hidden', localStorage.getItem(alertKey)); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters