Skip to content

Commit 2d390ce

Browse files
committed
named export ui
I analyzed these: File ui.js Found usages (10 usages found) Unclassified usage (6 usages found) lib\runtime (6 usages found) console.js (1 usage found) 11 import { selector } from '../ui' debugger.js (1 usage found) 5 import { views } from '../ui' frontend.js (1 usage found) 4 import { selector, notifications } from '../ui' packages.js (1 usage found) 4 import { selector } from '../ui' plots.js (1 usage found) 4 import { views } from '../ui' urihandler.js (1 usage found) 4 import { docpane, views } from '../ui' Usage in string literals (4 usages found) lib (1 usage found) julia-client.coffee (1 usage found) 20 ui: require './ui' lib\runtime (2 usages found) evaluation.coffee (1 usage found) 6 {notifications, views, selector, docpane} = require '../ui' workspace.coffee (1 usage found) 4 {views} = require '../ui' lib\ui (1 usage found) layout.js (1 usage found) documentation (1 usage found) 10 return require('../ui').docpane
1 parent c51638c commit 2d390ce

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

lib/ui.js

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,38 +11,39 @@ import * as docpane from './ui/docs'
1111
import * as focusutils from './ui/focusutils'
1212
import * as cellhighlighter from './ui/cellhighlighter'
1313

14-
export default {
15-
// TODO remove these from the export default and export them directly (prevents expensive copy)
16-
// TODO don't use this.message use message directly (prevents expensive copy)
17-
notifications: notifications,
18-
selector: selector,
19-
views: views,
20-
progress: progress,
21-
layout: layout,
22-
docpane: docpane,
23-
focusutils: focusutils,
24-
cellhighlighter: cellhighlighter,
14+
exports.notifications = notifications
15+
exports.selector = selector
16+
exports.views = views
17+
exports.progress = progress
18+
exports.layout = layout
19+
exports.docpane = docpane
20+
exports.focusutils = focusutils
21+
exports.cellhighlighter = cellhighlighter
2522

26-
activate(client) {
27-
this.client = client;
28-
this.subs = new CompositeDisposable;
23+
let client;
24+
let subs;
25+
let ink;
2926

30-
this.notifications.activate();
31-
this.subs.add(atom.config.observe('julia-client.uiOptions.highlightCells', val => {
27+
export function activate(client_in) {
28+
client = client_in;
29+
subs = new CompositeDisposable;
30+
31+
notifications.activate();
32+
subs.add(atom.config.observe('julia-client.uiOptions.highlightCells', val => {
3233
if (val) {
33-
this.cellhighlighter.activate();
34+
cellhighlighter.activate();
3435
} else {
35-
this.cellhighlighter.deactivate();
36+
cellhighlighter.deactivate();
3637
}
3738
})
3839
);
39-
this.subs.add(new Disposable(() => {
40-
this.cellhighlighter.deactivate();
40+
subs.add(new Disposable(() => {
41+
cellhighlighter.deactivate();
4142
})
4243
);
4344

44-
this.subs.add(this.client.onAttached(() => {
45-
this.notifications.show("Client Connected");
45+
subs.add(client.onAttached(() => {
46+
notifications.show("Client Connected");
4647
})
4748
);
4849
subs.add(client.onDetached(() => {
@@ -51,23 +52,22 @@ export default {
5152
}
5253
})
5354
);
54-
},
55+
}
5556

56-
deactivate() {
57-
this.subs.dispose();
58-
},
57+
export function deactivate() {
58+
subs.dispose();
59+
}
5960

60-
consumeInk(ink) {
61-
this.ink = ink;
62-
this.views.ink = this.ink;
63-
this.selector.activate(this.ink);
64-
this.docpane.activate(this.ink);
65-
this.progress.activate(this.ink);
66-
this.focusutils.activate(this.ink);
67-
this.subs.add(new Disposable(() => {
68-
this.docpane.deactivate();
69-
this.progress.deactivate();
70-
this.focusutils.deactivate();
61+
export function consumeInk(ink_in) {
62+
ink = ink_in;
63+
views.ink = ink;
64+
selector.activate(ink);
65+
docpane.activate(ink);
66+
progress.activate(ink);
67+
focusutils.activate(ink);
68+
subs.add(new Disposable(() => {
69+
docpane.deactivate();
70+
progress.deactivate();
71+
focusutils.deactivate();
7172
}));
72-
}
73-
};
73+
}

lib/ui/layout.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ const repl = () => {
66
const workspace = () => {
77
return require('../runtime').workspace
88
}
9-
const documentation = () => {
10-
return require('../ui').docpane
11-
}
9+
10+
import {docpane as documentation} from '../ui'
11+
1212
const plotPane = () => {
1313
return require('../runtime').plots
1414
}

0 commit comments

Comments
 (0)