Skip to content

Commit 7cc15df

Browse files
committed
show release note in as an usual pane
1 parent ce1e26e commit 7cc15df

File tree

7 files changed

+17
-73
lines changed

7 files changed

+17
-73
lines changed

keymaps/julia-client.cson.cmd

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ Any global commands should either be non-default or, ideally, prefixed with `C-J
4141
'ctrl-c': 'julia-client:interrupt-julia'
4242
'cmd-j cmd-m': 'julia-client:set-working-module'
4343

44-
# release note
45-
'.julia-client-release-note':
46-
'escape': 'julia-client:cancel-release-note'
47-
4844
# atom-workspace
4945
'.platform-darwin atom-workspace':
5046
'cmd-j cmd-r': 'julia-client:open-external-REPL'

keymaps/julia-client.cson.ctrl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ Any global commands should either be non-default or, ideally, prefixed with `C-J
4646
'ctrl-shift-c': 'julia-client:copy-or-interrupt'
4747
'ctrl-v': 'ink-terminal:paste'
4848

49-
# release note
50-
'.julia-client-release-note':
51-
'escape': 'julia-client:cancel-release-note'
52-
5349
# atom-workspace
5450
'.platform-win32 atom-workspace,
5551
.platform-linux atom-workspace':

lib/julia-client.coffee

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ module.exports = JuliaClient =
3737
if atom.config.get('julia-client.uiOptions.layouts.openDefaultPanesOnStartUp')
3838
setTimeout (=> @ui.layout.restoreDefaultLayout()), 150
3939

40-
try
41-
v = atom.config.get('julia-client.currentVersion')
42-
if v isnt LATEST_RELEASE_NOTE_VERSION
43-
release.activate(LATEST_RELEASE_NOTE_VERSION)
44-
else
45-
release.activate()
46-
catch err
47-
console.log(err)
48-
finally
49-
atom.config.set('julia-client.currentVersion', LATEST_RELEASE_NOTE_VERSION)
50-
5140
requireDeps: (fn) ->
5241
isLoaded = atom.packages.isPackageLoaded("ink") and atom.packages.isPackageLoaded("language-julia")
5342

@@ -131,6 +120,16 @@ module.exports = JuliaClient =
131120
consumeInk: (ink) ->
132121
commands.ink = ink
133122
x.consumeInk ink for x in [@connection, @runtime, @ui]
123+
try
124+
v = atom.config.get('julia-client.currentVersion')
125+
if v isnt LATEST_RELEASE_NOTE_VERSION
126+
release.activate(ink, LATEST_RELEASE_NOTE_VERSION)
127+
else
128+
release.activate(ink)
129+
catch err
130+
console.log(err)
131+
finally
132+
atom.config.set('julia-client.currentVersion', LATEST_RELEASE_NOTE_VERSION)
134133

135134
consumeStatusBar: (bar) -> @runtime.consumeStatusBar bar
136135

lib/package/release-note.js

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,17 @@ import { readCode } from '../misc/paths'
1010
let subs
1111
const RELEASE_NOTE_DIR = path.join(__dirname, '..', '..', 'release-notes')
1212

13-
export function activate (startupNoteVersion) {
13+
export function activate (ink, startupNoteVersion) {
14+
const pane = ink.NotePane.fromId('Note')
1415
subs = new CompositeDisposable()
15-
const view = document.createElement('div')
16-
const panel = atom.workspace.addModalPanel({ item: view })
1716

18-
const inner = document.createElement('div')
19-
inner.classList.add('julia-client-release-note')
20-
inner.setAttribute('tabindex', "1")
21-
22-
const closeButton = document.createElement('button')
23-
closeButton.classList.add('btn', 'icon', 'icon-remove-close', 'release-note-close-button')
24-
25-
view.appendChild(closeButton)
26-
view.appendChild(inner)
27-
28-
const showNote = (version, versions) => {
17+
const showNote = (version) => {
2918
const p = path.join(RELEASE_NOTE_DIR, version + '.md')
3019
const markdown = readCode(p)
31-
inner.innerHTML = marked(markdown)
32-
panel.show()
33-
view.focus()
20+
pane.setNote(markdown)
21+
pane.setTitle(`Juno release note – v${version}`)
22+
pane.ensureVisible()
3423
}
35-
const close = () => panel.hide()
36-
closeButton.onclick = close
37-
const panelView = panel.getElement()
38-
panelView.style['max-width'] = '75em'
3924

4025
subs.add(
4126
atom.commands.add('atom-workspace', 'julia-client:open-release-note', () => {
@@ -45,18 +30,9 @@ export function activate (startupNoteVersion) {
4530
show(versions)
4631
.then(version => showNote(version.replace(/v\s(.+)/, '$1')))
4732
.catch(err => console.log(err))
48-
}),
49-
atom.commands.add(panelView, 'julia-client:cancel-release-note', (event) => {
50-
close()
51-
event.stopPropagation()
52-
}),
53-
atom.packages.onDidActivateInitialPackages(() => {
54-
if (startupNoteVersion) setTimeout(() => showNote(startupNoteVersion), 500)
55-
}),
56-
new Disposable(() => {
57-
panel.destroy()
5833
})
5934
)
35+
if (startupNoteVersion) showNote(startupNoteVersion)
6036
}
6137

6238
export function deactivate () {

package-lock.json

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"atom-select-list": "^0.7.2",
3030
"etch": "^0.14",
3131
"fuzzaldrin-plus": "^0.6.0",
32-
"marked": "^0.8.2",
3332
"node-pty-prebuilt-multiarch": "0.9.0",
3433
"object-hash": "^2.0.3",
3534
"physical-cpu-count": "*",

styles/julia-client.less

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,3 @@ atom-text-editor.editor[data-grammar$="source weave latex"] {
191191
position: absolute;
192192
border: 1px solid fade(@text-color, 70%);
193193
}
194-
195-
.julia-client-release-note {
196-
font-size: var(--editor-font-size);
197-
padding: 1em;
198-
img {
199-
max-height: 20em;
200-
display: block;
201-
}
202-
203-
max-height: 90vh;
204-
overflow: auto;
205-
}
206-
207-
.release-note-close-button {
208-
position: absolute;
209-
right: 1em;
210-
}

0 commit comments

Comments
 (0)