Skip to content
This repository was archived by the owner on Apr 6, 2021. It is now read-only.

Commit 8c614a8

Browse files
committed
Merge pull request #5 from c9/welcome
Add a crude welcome screen
2 parents 403c8db + c65412a commit 8c614a8

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

__installed__.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ define(function(require, exports, module) {
88
"plugins/google.cloud/plugin_google.vfs.credentials",
99
"plugins/google.cloud/plugin_google.menu",
1010
"plugins/google.cloud/plugin_google.run",
11+
"plugins/google.cloud/plugin_google.welcome",
1112
];
12-
});
13-
13+
});

plugin_google.welcome.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
define(function(require, exports, module) {
2+
main.consumes = [
3+
"Plugin", "tabManager", "settings"
4+
];
5+
main.provides = ["google.welcome"];
6+
return main;
7+
8+
function main(options, imports, register) {
9+
var Plugin = imports["Plugin"];
10+
var settings = imports.settings;
11+
var tabs = imports.tabManager;
12+
var plugin = new Plugin("Cloud9 IDE, Inc.", main.consumes);
13+
14+
function load() {
15+
tabs.once("ready", function() {
16+
if (settings.getBool("user/welcome/@first_google"))
17+
return;
18+
19+
settings.set("user/welcome/@first_google", true);
20+
tabs.open({
21+
editorType: "preview",
22+
active: true,
23+
document: {
24+
preview: { path: "https://docs.c9.io/v1.0/docs/google" }
25+
}
26+
});
27+
});
28+
}
29+
30+
plugin.on("load", load);
31+
plugin.on("unload", function() {});
32+
33+
register(null, {
34+
"google.welcome": plugin
35+
});
36+
}
37+
38+
});

0 commit comments

Comments
 (0)