[READ-ONLY] Mirror of https://github.com/probablykasper/yt-email-notifier. macOS menubar app for YouTube upload notification emails
email menubar notifications tray youtube
0

Configure Feed

Select the types of activity you want to include in your feed.

add ability to delete emails

Kasper (Nov 17, 2020, 2:50 AM +0100) c8a75ac4 06263779

+60 -10
+7 -6
README.md
··· 36 36 3. Choose the starting time for what videos you'd like to receive email notifications. For example, if you choose 7 days ago, YTEM will notify you about all the videos uploaded since then (maximum the last 50 videos). You'll only be notified for videos uploaded only after the time you set 37 37 6. That's all, hopefully it's worth it! 38 38 39 - ### Limitations (readme) 39 + ### Limitations 40 40 41 41 YTEM is rough around the edges, and there are things that I could have fixed but didn't bother with: 42 42 - Check that you entered valid values. It might not always be obvious what has gone wrong 43 43 - It's not supported to add the same channel multiple times 44 - - Since this runs locally, it obviously won't send you email notifications when your computer is off 45 - - To delete an email, you'd have to go into the settings file, which can be found in `~/Library/Application Support/YouTube Email Notifier`. 44 + - Since this runs locally, it won't send you email notifications when your computer is off 46 45 47 46 ### Menubar options 48 47 ··· 74 73 75 74 1. Update CHANGELOG.md and commit 76 75 2. Bump the version number, commit and tag 77 - 78 76 ``` 79 77 npm version <version> 80 78 ``` 81 - 82 - 3. Create GitHub release with release notes 79 + 3. Build the app 80 + ``` 81 + npm run build 82 + ``` 83 + 4. Create GitHub release with release notes
+4
src/server.js
··· 329 329 instance.minutesBetweenRefreshes = data.minutesBetweenRefreshes 330 330 storeUpdate() 331 331 332 + } else if (type === 'deleteEmail') { 333 + store.instances.splice(data.instanceIndex, 1) 334 + storeUpdate() 335 + 332 336 } else if (type === 'addChannel') { 333 337 const segments = data.channel.split('/') 334 338 const channelIdSegment = segments.indexOf('channel') + 1
+16 -1
web/index.html
··· 100 100 </div> 101 101 </div> 102 102 103 + <div id='delete-email-modal' class="modal"> 104 + <div class="modal-background" onclick="$('#delete-email-modal').removeClass('is-active')"></div> 105 + <div class="modal-content box px-6 py-5"> 106 + <form id='delete-email-form'> 107 + <h1 class='title is-size-4'><b>Delete email "<span id='delete-email-email'></span>"?</b></h1> 108 + <p class='mb-5'>This will remove <span id="delete-email-channels-count">#</span> channel(s)</p> 109 + <button type="submit" class="button is-danger">Delete</button> 110 + <div class="button" onclick="$('#delete-email-modal').removeClass('is-active')">Cancel</div> 111 + </form> 112 + </div> 113 + </div> 114 + 103 115 <div id='setup-modal' class="modal"> 104 116 <div class="modal-background" onclick="$('#setup-modal').removeClass('is-active')"></div> 105 117 <div class="modal-content box px-6 py-5"> ··· 145 157 {{#each instances}} 146 158 <h2 class="title is-3">{{this.email}}</h2> 147 159 <p>Minutes between refreshes: {{this.minutesBetweenRefreshes}}</p> 148 - <p><a class='edit-email-button' data-instance='{{@index}}'>Edit</a></p> 160 + <p> 161 + <a class='edit-email-button' data-instance='{{@index}}'>Edit</a> 162 + <a class='delete-email-button' data-instance='{{@index}}'>Delete</a> 163 + </p> 149 164 <br> 150 165 <h5 class='title is-5'>Channels:</h5> 151 166 <table class="table is-fullwidth is-hoverable mb-3">
+33 -3
web/index.js
··· 28 28 }).catch(() => { 29 29 console.log('err') 30 30 }) 31 - // .then((response) => { 32 - // }) 33 - // $('help-modal-content').load('/README.md') 31 + 32 + }) 33 + 34 + document.addEventListener('keydown', (e) => { 35 + if (e.key === 'Escape') { 36 + const tag = e.target.nodeName 37 + if (tag === 'INPUT' || tag === 'TEXTAREA') { 38 + $(':focus').blur() 39 + } else { 40 + $('.modal.is-active').removeClass('is-active') 41 + } 42 + } 34 43 }) 35 44 36 45 let doneFunc ··· 82 91 }) 83 92 } 84 93 $('#edit-email-modal').removeClass('is-active') 94 + return false 95 + }) 96 + 97 + let deleteInstanceIndex 98 + $('.delete-email-button').click((e) => { 99 + const instanceIndex = Number(e.target.dataset.instance) 100 + deleteInstanceIndex = instanceIndex 101 + const instance = data.instances[instanceIndex] 102 + $('#delete-email-email').text(instance.email) 103 + $('#delete-email-channels-count').text(instance.channels.length) 104 + $('#delete-email-modal').addClass('is-active') 105 + }) 106 + $('#delete-email-form').submit((e) => { 107 + e.preventDefault() 108 + if (typeof deleteInstanceIndex === 'number') { 109 + window.a('deleteEmail', { 110 + instanceIndex: deleteInstanceIndex, 111 + }) 112 + console.log('AHYEP', deleteInstanceIndex) 113 + } 114 + $('#delete-email-modal').removeClass('is-active') 85 115 return false 86 116 }) 87 117