Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recover OS notification #736

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/package/config.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ config =
{value:'block', description:'Display results under code'}
{value:'console', description:'Display results in the REPL'}
]
order: 1
order: 0
scrollToResult:
title: 'Scroll to Inline Results'
type: 'boolean'
default: false
order: 2
order: 1
docsDisplayMode:
title: 'Documentation Display Mode'
type: 'string'
Expand All @@ -166,6 +166,12 @@ config =
{value: 'inline', description: 'Show documentation in the editor'}
{value: 'pane', description: 'Show documentation in the documentation pane'}
]
order: 2
notifications:
title: 'Notifications'
type: 'boolean'
default: true
description: 'Enable notifications for evaluation.'
order: 3
errorNotifications:
title: 'Error Notifications'
Expand Down
28 changes: 14 additions & 14 deletions lib/ui/notifications.coffee
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
remote = require 'remote'

module.exports =
# notes: []
# window: remote.getCurrentWindow()
notes: []
window: remote.getCurrentWindow()

activate: ->
# document.addEventListener 'focusin', =>
# @clear()
document.addEventListener 'focusin', =>
@clear()

enabled: -> atom.config.get('julia-client.uiOptions.notifications')

show: (msg, force) ->
# return unless force or (@enabled() and not document.hasFocus())
# n = new Notification "Julia Client",
# body: msg
# n.onclick = =>
# @window.focus()
# @notes.push(n)
return unless force or (@enabled() and not document.hasFocus())
n = new Notification "Julia Client",
body: msg
n.onclick = =>
@window.focus()
@notes.push(n)

# clear: ->
# for note in @notes
# note.close()
# @notes = []
clear: ->
for note in @notes
note.close()
@notes = []