Skip to content
Closed
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
42 changes: 0 additions & 42 deletions lib/ui.coffee

This file was deleted.

73 changes: 73 additions & 0 deletions lib/ui.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
'use babel'
import { CompositeDisposable, Disposable } from 'atom';

// TODO use babel to export ... from ...
import notifications from './ui/notifications'
import * as selector from './ui/selector'
import views from './ui/views'
import progress from './ui/progress'
import * as layout from './ui/layout'
import * as docpane from './ui/docs'
import * as focusutils from './ui/focusutils'
import * as cellhighlighter from './ui/cellhighlighter'

exports.notifications = notifications
exports.selector = selector
exports.views = views
exports.progress = progress
exports.layout = layout
exports.docpane = docpane
exports.focusutils = focusutils
exports.cellhighlighter = cellhighlighter

let client;
let subs;
let ink;

export function activate(client_in) {
client = client_in;
subs = new CompositeDisposable;

notifications.activate();
subs.add(atom.config.observe('julia-client.uiOptions.highlightCells', val => {
if (val) {
cellhighlighter.activate();
} else {
cellhighlighter.deactivate();
}
})
);
subs.add(new Disposable(() => {
cellhighlighter.deactivate();
})
);

subs.add(client.onAttached(() => {
notifications.show("Client Connected");
})
);
subs.add(client.onDetached(() => {
if (ink) {
ink.Result.invalidateAll()
}
})
);
}

export function deactivate() {
subs.dispose();
}

export function consumeInk(ink_in) {
ink = ink_in;
views.ink = ink;
selector.activate(ink);
docpane.activate(ink);
progress.activate(ink);
focusutils.activate(ink);
subs.add(new Disposable(() => {
docpane.deactivate();
progress.deactivate();
focusutils.deactivate();
}));
}
6 changes: 3 additions & 3 deletions lib/ui/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const repl = () => {
const workspace = () => {
return require('../runtime').workspace
}
const documentation = () => {
return require('../ui').docpane
}

import {docpane as documentation} from '../ui'

const plotPane = () => {
return require('../runtime').plots
}
Expand Down