Skip to content

Commit eb0ab25

Browse files
Merge pull request #7 from code-with-sam/1.0.0
1.0.0
2 parents dd8cefe + df39173 commit eb0ab25

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+151
-1987
lines changed

README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,39 @@
1-
# steem-notifier v 0.3.1
1+
# steem-notifier v 1.0.0
22

33
> Steem Notifier is a minimal taskbar application that send notifications about your [Steem account](http://steemit.com) through your native operating systems notification interface.
44
5-
![Screen](https://i.imgsafe.org/d2/d24295d019.png)
5+
![screen](https://user-images.githubusercontent.com/34964560/35290479-48262cd2-0062-11e8-8dc0-588c67a0f32d.png)
66

77
## How To
8-
Steem Motifer is an electron based app an can run cross platform with windows/osx/linux. ```Version 0.3.0``` is only tested with OSX.
8+
Steem Motifer is an electron based app an can run cross platform with windows/osx/linux. ```Version 1.0.0``` is only tested with OSX.
99

1010
```
1111
git clone git@github.com:code-with-sam/steem-notifier.git
1212
```
1313

14-
setup/install
14+
## Build locally
15+
```
16+
npm install
17+
npm run package-mac
18+
npm run package-win
19+
npm run package-linux
20+
```
21+
find release builds in ```release/```
22+
23+
## setup/install for Development
1524
```
1625
npm install
1726
npm start
1827
```
1928

2029
Steem-notifier will launch automatically to your taskbar. You can click on the taskbar to launch the app. You'll be presented with a input field to enter your username. Select the type of notifications you would like to receive, each time you check/uncheck a selection notifiter updates your prefrences in the background. You will begin receiving native desktop notifications. You can click the notification to be sent to the action in your browser, click close to dismiss it or leave the notification to timeout. to stop receiving notifications exit the app, or click the disable-notifications button.
2130

22-
Check branches & PR's for the latest version
23-
24-
## Why is there a /lib/node-notifer?
25-
The local version of ```node-notifer``` is needed only for the custom notification icon on mac. By default mac uses the icon of the application that is originally sending the notification, in this case it is the module terminal-notifier running through node.js. Creating a clone of ```node-notifier``` which has a clone of ```terminal-notifier.app``` with switched out app icons using this script [https://github.com/code-with-sam/customise-terminal-notifier](https://github.com/code-with-sam/customise-terminal-notifier).
2631

2732

2833
## RoadMap/Ideas
29-
- save default user (so you don’t have to type it in)
30-
- packaged release on app stores
31-
- multiple account support
34+
- multiple account support
3235
- ability to reply and upvote directly to messages in app
3336
- history/feed of recent actions
34-
- replace custom node notifier with other solution
3537
- poll user data for new information
3638
- add estimated earnings
3739
- use username autocomplete API

browser.js

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,21 @@ let notifications = {
1616
}
1717

1818

19+
1920
$(document).ready(()=> {
20-
$('.intro-pane__inner').removeClass('animation-start')
21-
$('.intro-pane__username').focus()
21+
let defaultUser = localStorage.getItem('default-username');
22+
23+
console.log('default user: ', defaultUser)
24+
25+
if(defaultUser !== 'false'){
26+
$('.intro-pane').fadeOut(500)
27+
$('.animation-hidden').removeClass('animation-hidden')
28+
$('.intro-pane__username').val(defaultUser)
29+
updateNotifications(notifications)
30+
} else {
31+
$('.intro-pane__inner').removeClass('animation-start')
32+
$('.intro-pane__username').focus()
33+
}
2234
})
2335

2436
$('.check-box').on('click', (e) => {
@@ -36,13 +48,27 @@ $('.check-box').on('click', (e) => {
3648
updateNotifications(notifications)
3749
})
3850

51+
$('.check-box--intro').on('click', (e) => {
52+
let currentCheckBox = $(e.currentTarget)
53+
let isChecked = currentCheckBox.hasClass('checked--intro');
54+
if( isChecked ) {
55+
currentCheckBox.removeClass('checked--intro')
56+
} else {
57+
currentCheckBox.addClass('checked--intro')
58+
}
59+
})
60+
3961

4062
$('.intro-pane__username').keypress(function(e) {
4163
let val = $('.intro-pane__username').val()
4264
if(e.which == 13 && val != '' ) {
4365
$('.intro-pane').fadeOut(750)
4466
$('.animation-hidden').removeClass('animation-hidden')
4567
updateNotifications(notifications)
68+
69+
if ( $('.check-box--intro').hasClass('checked--intro')){
70+
setDefaultUser(val)
71+
}
4672
}
4773
});
4874

@@ -56,29 +82,42 @@ setInterval(()=> {
5682
ipcRenderer.on('user-data', (event, data) => {
5783
console.log(data)
5884
$('.notifactions__user-name').text(data.name)
59-
$('.notifactions__user-bio').text(data.bio)
85+
$('.notifactions__user-bio').text(data.bio.substring(0, 35))
6086
$('.notifactions__user-stats').text(`Following: ${data.followingCount} | Followers: ${data.followerCount} | Posts: ${data.numOfPosts}`)
6187
$('.notifactions__user-value').text(`Account Value: $${data.usdValue}`)
6288
$('.notifactions__user-image').attr('src', data.image)
6389
})
6490

6591

6692
ipcRenderer.on('vote-power', (event, data) => {
67-
console.log(data);
68-
6993
if (data){
70-
7194
$('.vote-power').text(data.toFixed(2) + '%')
72-
7395
document.querySelector('.vote-ring').style.strokeDashoffset = 200 - data*2
7496
document.querySelector('.vote-ring').style.opacity = 1
7597
}
98+
})
7699

100+
ipcRenderer.on('show-notification', (event, data) => {
101+
let notification = new Notification(data.title , data)
77102

103+
notification.onclick = () => {
104+
if (data.link){
105+
ipcRenderer.send('open-notification', data)
106+
}
107+
}
108+
109+
})
78110

111+
ipcRenderer.on('clear-default-user', (event, data) => {
112+
localStorage.setItem('default-username', 'false');
113+
location.reload();
79114
})
80115
// FUNCTIIONS
81116

117+
function setDefaultUser(defaultUsername){
118+
localStorage.setItem('default-username', defaultUsername);
119+
}
120+
82121
function updateNotifications(notifications){
83122
let username = $('.intro-pane__username').val();
84123
let data = {

img/comment-icon.png

-19.8 KB
Loading

img/follow-icon.png

-24.7 KB
Loading

img/mention-icon.png

1.73 KB
Loading

img/reblog-icon.png

-6.56 KB
Loading

img/reward-icon.png

-10.9 KB
Loading

img/transfer-icon.png

-11.6 KB
Loading

img/vote-icon.png

-7.26 KB
Loading

index.html

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
box-sizing: border-box;
99
}
1010
body {
11+
padding-top: 20px;
12+
-webkit-app-region: drag;
1113
font-family: Inconsolata, 'Courier New', Courier, monospace;
1214
margin: 0;
1315
background-color: #f9f9f9;
@@ -124,6 +126,26 @@
124126
line-height: 33px;
125127
margin-top: 5px;
126128
}
129+
.intro-pane__default {
130+
position: relative;
131+
text-align: center;
132+
}
133+
.intro-pane__default .check-box {
134+
135+
}
136+
.check-box--intro {
137+
float: none;
138+
height: 14px;
139+
width: 14px;
140+
border-radius: 2px;
141+
border: solid 0.12rem #bbb;
142+
display: inline-block;
143+
transform: translateY(3px);
144+
cursor: pointer;
145+
}
146+
.check-box--intro.checked--intro {
147+
background-color: #bbb;
148+
}
127149

128150

129151
.notifactions__user {
@@ -141,12 +163,12 @@
141163

142164
.notifications__select {
143165
width: 95%;
144-
margin: 10px auto;
166+
margin: 8px auto;
145167
box-shadow: 0 0 40px rgba(0,0,0,0.1);
146168
background-color: #fff;
147169
border-radius: 5px;
148170
transition: all 600ms;
149-
transition-delay: 600ms;
171+
transition-delay: 200ms;
150172
transform: translateY(0px);
151173
opacity: 1;
152174
}
@@ -267,6 +289,7 @@ <h1 class="intro-pane__title">Steem Notifier</h1>
267289
<span class="intro-pane__at">@</span>
268290
<input class="intro-pane__username" type="text" placeholder="username"></input>
269291
</div>
292+
<p class="intro-pane__default"> Save as default user? <span class="check-box--intro checked--intro"></span></p>
270293
</div>
271294
</section>
272295

0 commit comments

Comments
 (0)