{"action":"created","comment":{"url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/comments/82045073","pull_request_review_id":2979419,"id":82045073,"diff_hunk":"@@ -0,0 +1,290 @@\n+// Copyright (c) Jupyter Development Team.\n+// Distributed under the terms of the Modified BSD License.\n+\n+import {\n+  JSONObject\n+} from 'phosphor/lib/algorithm/json';\n+\n+import {\n+  DisposableDelegate, IDisposable\n+} from 'phosphor/lib/core/disposable';\n+\n+import {\n+  h, VNode\n+} from 'phosphor/lib/ui/vdom';\n+\n+import {\n+  Widget\n+} from 'phosphor/lib/ui/widget';\n+\n+import {\n+  ObservableList\n+} from '../common/observablelist';\n+\n+import {\n+  VDomModel, VDomWidget\n+} from '../common/vdom';\n+\n+import {\n+  JupyterLab, JupyterLabPlugin\n+} from '../application';\n+\n+import {\n+  ICommandPalette\n+} from '../commandpalette';\n+\n+import {\n+  IPathTracker\n+} from '../filebrowser';\n+\n+import {\n+  IServiceManager\n+} from '../services';\n+\n+import {\n+  ILauncher\n+} from './';\n+\n+\n+/**\n+ * The class name added to LauncherWidget instances.\n+ */\n+const LAUNCHER_CLASS = 'jp-LauncherWidget';\n+\n+/**\n+ * The class name added to LauncherWidget image nodes.\n+ */\n+const IMAGE_CLASS = 'jp-LauncherWidget-image';\n+\n+/**\n+ * The class name added to LauncherWidget text nodes.\n+ */\n+const TEXT_CLASS = 'jp-LauncherWidget-text';\n+\n+/**\n+ * The class name added to LauncherWidget column nodes.\n+ */\n+const COLUMN_CLASS = 'jp-LauncherWidget-column';\n+\n+/**\n+ * The class name added to LauncherWidget folder node.\n+ */\n+const FOLDER_CLASS = 'jp-LauncherWidget-folder';\n+\n+/**\n+ * The class name added to LauncherWidget path nodes.\n+ */\n+const PATH_CLASS = 'jp-LauncherWidget-path';\n+\n+/**\n+ * The class name added to LauncherWidget current working directory node.\n+ */\n+const CWD_CLASS = 'jp-LauncherWidget-cwd';\n+\n+/**\n+ * The class name added to LauncherWidget body nodes.\n+ */\n+const BODY_CLASS = 'jp-LauncherWidget-body';\n+\n+/**\n+ * The class name added to LauncherWidget dialog node.\n+ */\n+const DIALOG_CLASS = 'jp-LauncherWidget-dialog';\n+\n+\n+/**\n+ * A service providing an interface to the the launcher.\n+ */\n+export\n+const launcherExtension: JupyterLabPlugin<ILauncher> = {\n+  id: 'jupyter.extensions.launcher',\n+  requires: [IServiceManager, IPathTracker, ICommandPalette],\n+  provides: ILauncher,\n+  activate: activateLauncher,\n+  autoStart: true\n+};\n+\n+\n+/**\n+ * Activate the launcher.\n+ */\n+function activateLauncher(app: JupyterLab, services: IServiceManager, pathTracker: IPathTracker, palette: ICommandPalette): ILauncher {\n+  let launcherModel = new LauncherModel();\n+\n+  launcherModel.setDir(pathTracker.path);\n+  launcherModel.setApp(app);\n+\n+  pathTracker.pathChanged.connect(() => {\n+    launcherModel.setDir(pathTracker.path);\n+  });\n+\n+  let launcherWidget = new LauncherWidget()\n+\n+  launcherWidget.model = launcherModel;\n+  launcherWidget.id = 'landing-jupyterlab-widget';\n+  launcherWidget.title.label = 'Launcher';\n+\n+  // Hardcoded defaults.\n+  let names = [\n+    'Notebook',\n+    'Console',\n+    'Terminal',\n+    'Text Editor',\n+  ];\n+\n+  let actions = [\n+    'file-operations:new-notebook',\n+    `console:create-${services.kernelspecs.default}`,\n+    'terminal:create-new',\n+    'file-operations:new-text-file',\n+  ]\n+\n+  app.commands.addCommand('jupyterlab-launcher:add-item', {\n+    label: 'Add Launcher Item',\n+    execute: (args) => {\n+      launcherModel.add(args['name'] as string, args['action'] as string,\n+                        args['args'] as JSONObject, args['imgName'] as string);\n+    }\n+  });\n+\n+  for (let i in names) {\n+    // Note: we do not retain a handle on the items added by default, which\n+    // means we have to way of removing them after the fact.\n+    //launcherModel.add(names[i], actions[i]);\n+    //launcherModel.add(names[i], actions[i]);\n+    app.commands.execute('jupyterlab-launcher:add-item', {name: names[i], action: actions[i]});\n+  }\n+\n+    app.commands.execute('jupyterlab-launcher:add-item', {name: 'larger font', action: 'terminal:increase-font', imgName: \"jp-ImageTerminal fa fa-plus\"})\n+\n+    app.commands.execute('jupyterlab-launcher:add-item', {name: 'smaller font', action: 'terminal:decrease-font', imgName: \"jp-ImageTerminal fa fa-minus\"})\n+\n+\n+  app.commands.addCommand('jupyterlab-launcher:show', {\n+    label: 'Show Launcher',\n+    execute: () => {\n+      if (!launcherWidget.isAttached) {\n+        app.shell.addToLeftArea(launcherWidget);\n+      }\n+      app.shell.activateLeft(launcherWidget.id);\n+    }\n+  });\n+\n+  palette.addItem({\n+    command: 'jupyterlab-launcher:show',\n+    category: 'Help'\n+  });\n+\n+  app.shell.addToLeftArea(launcherWidget);\n+  return launcherModel;\n+}\n+\n+\n+/**\n+ * Simple encapsulation of name and callback of launcher entries.\n+ */\n+class LauncherItem {","path":"src/launcher/plugin.ts","position":186,"original_position":186,"commit_id":"7a81fb0a508950573d887de765776c0f74c33525","original_commit_id":"7a81fb0a508950573d887de765776c0f74c33525","user":{"login":"blink1073","id":2096628,"avatar_url":"https://avatars.githubusercontent.com/u/2096628?v=3","gravatar_id":"","url":"https://api.github.com/users/blink1073","html_url":"https://github.com/blink1073","followers_url":"https://api.github.com/users/blink1073/followers","following_url":"https://api.github.com/users/blink1073/following{/other_user}","gists_url":"https://api.github.com/users/blink1073/gists{/gist_id}","starred_url":"https://api.github.com/users/blink1073/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blink1073/subscriptions","organizations_url":"https://api.github.com/users/blink1073/orgs","repos_url":"https://api.github.com/users/blink1073/repos","events_url":"https://api.github.com/users/blink1073/events{/privacy}","received_events_url":"https://api.github.com/users/blink1073/received_events","type":"User","site_admin":false},"body":"implements ILauncherItem","created_at":"2016-10-05T18:56:44Z","updated_at":"2016-10-05T18:58:07Z","html_url":"https://github.com/jupyter/jupyterlab/pull/925#discussion_r82045073","pull_request_url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925","_links":{"self":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/comments/82045073"},"html":{"href":"https://github.com/jupyter/jupyterlab/pull/925#discussion_r82045073"},"pull_request":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925"}}},"pull_request":{"url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925","id":86193798,"html_url":"https://github.com/jupyter/jupyterlab/pull/925","diff_url":"https://github.com/jupyter/jupyterlab/pull/925.diff","patch_url":"https://github.com/jupyter/jupyterlab/pull/925.patch","issue_url":"https://api.github.com/repos/jupyter/jupyterlab/issues/925","number":925,"state":"open","locked":false,"title":"Launcher implementation with add/remove","user":{"login":"ivanov","id":118211,"avatar_url":"https://avatars.githubusercontent.com/u/118211?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanov","html_url":"https://github.com/ivanov","followers_url":"https://api.github.com/users/ivanov/followers","following_url":"https://api.github.com/users/ivanov/following{/other_user}","gists_url":"https://api.github.com/users/ivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanov/subscriptions","organizations_url":"https://api.github.com/users/ivanov/orgs","repos_url":"https://api.github.com/users/ivanov/repos","events_url":"https://api.github.com/users/ivanov/events{/privacy}","received_events_url":"https://api.github.com/users/ivanov/received_events","type":"User","site_admin":false},"body":"This is a work in progress, there is code that I'll only use for the demo, but\nI wanted to put it up for feedback.","created_at":"2016-09-21T16:08:51Z","updated_at":"2016-10-05T18:58:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"02f7dbcda047173454bcf997067a9cb46444a132","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925/commits","review_comments_url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925/comments","review_comment_url":"https://api.github.com/repos/jupyter/jupyterlab/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyter/jupyterlab/issues/925/comments","statuses_url":"https://api.github.com/repos/jupyter/jupyterlab/statuses/7a81fb0a508950573d887de765776c0f74c33525","head":{"label":"ivanov:launcher","ref":"launcher","sha":"7a81fb0a508950573d887de765776c0f74c33525","user":{"login":"ivanov","id":118211,"avatar_url":"https://avatars.githubusercontent.com/u/118211?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanov","html_url":"https://github.com/ivanov","followers_url":"https://api.github.com/users/ivanov/followers","following_url":"https://api.github.com/users/ivanov/following{/other_user}","gists_url":"https://api.github.com/users/ivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanov/subscriptions","organizations_url":"https://api.github.com/users/ivanov/orgs","repos_url":"https://api.github.com/users/ivanov/repos","events_url":"https://api.github.com/users/ivanov/events{/privacy}","received_events_url":"https://api.github.com/users/ivanov/received_events","type":"User","site_admin":false},"repo":{"id":68213998,"name":"jupyterlab","full_name":"ivanov/jupyterlab","owner":{"login":"ivanov","id":118211,"avatar_url":"https://avatars.githubusercontent.com/u/118211?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanov","html_url":"https://github.com/ivanov","followers_url":"https://api.github.com/users/ivanov/followers","following_url":"https://api.github.com/users/ivanov/following{/other_user}","gists_url":"https://api.github.com/users/ivanov/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanov/subscriptions","organizations_url":"https://api.github.com/users/ivanov/orgs","repos_url":"https://api.github.com/users/ivanov/repos","events_url":"https://api.github.com/users/ivanov/events{/privacy}","received_events_url":"https://api.github.com/users/ivanov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ivanov/jupyterlab","description":"JupyterLab computational environment. This is a very early preview, and is not suitable for general usage yet.","fork":true,"url":"https://api.github.com/repos/ivanov/jupyterlab","forks_url":"https://api.github.com/repos/ivanov/jupyterlab/forks","keys_url":"https://api.github.com/repos/ivanov/jupyterlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ivanov/jupyterlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ivanov/jupyterlab/teams","hooks_url":"https://api.github.com/repos/ivanov/jupyterlab/hooks","issue_events_url":"https://api.github.com/repos/ivanov/jupyterlab/issues/events{/number}","events_url":"https://api.github.com/repos/ivanov/jupyterlab/events","assignees_url":"https://api.github.com/repos/ivanov/jupyterlab/assignees{/user}","branches_url":"https://api.github.com/repos/ivanov/jupyterlab/branches{/branch}","tags_url":"https://api.github.com/repos/ivanov/jupyterlab/tags","blobs_url":"https://api.github.com/repos/ivanov/jupyterlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ivanov/jupyterlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ivanov/jupyterlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/ivanov/jupyterlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ivanov/jupyterlab/statuses/{sha}","languages_url":"https://api.github.com/repos/ivanov/jupyterlab/languages","stargazers_url":"https://api.github.com/repos/ivanov/jupyterlab/stargazers","contributors_url":"https://api.github.com/repos/ivanov/jupyterlab/contributors","subscribers_url":"https://api.github.com/repos/ivanov/jupyterlab/subscribers","subscription_url":"https://api.github.com/repos/ivanov/jupyterlab/subscription","commits_url":"https://api.github.com/repos/ivanov/jupyterlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/ivanov/jupyterlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/ivanov/jupyterlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/ivanov/jupyterlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/ivanov/jupyterlab/contents/{+path}","compare_url":"https://api.github.com/repos/ivanov/jupyterlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ivanov/jupyterlab/merges","archive_url":"https://api.github.com/repos/ivanov/jupyterlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ivanov/jupyterlab/downloads","issues_url":"https://api.github.com/repos/ivanov/jupyterlab/issues{/number}","pulls_url":"https://api.github.com/repos/ivanov/jupyterlab/pulls{/number}","milestones_url":"https://api.github.com/repos/ivanov/jupyterlab/milestones{/number}","notifications_url":"https://api.github.com/repos/ivanov/jupyterlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ivanov/jupyterlab/labels{/name}","releases_url":"https://api.github.com/repos/ivanov/jupyterlab/releases{/id}","deployments_url":"https://api.github.com/repos/ivanov/jupyterlab/deployments","created_at":"2016-09-14T14:35:54Z","updated_at":"2016-09-14T14:35:55Z","pushed_at":"2016-10-04T00:41:31Z","git_url":"git://github.com/ivanov/jupyterlab.git","ssh_url":"git@github.com:ivanov/jupyterlab.git","clone_url":"https://github.com/ivanov/jupyterlab.git","svn_url":"https://github.com/ivanov/jupyterlab","homepage":"","size":32790,"stargazers_count":0,"watchers_count":0,"language":"TypeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyter:master","ref":"master","sha":"5e4e335b87307012491adee2c150aaeebceba85c","user":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"repo":{"id":60374819,"name":"jupyterlab","full_name":"jupyter/jupyterlab","owner":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyter/jupyterlab","description":"JupyterLab computational environment. This is a very early preview, and is not suitable for general usage yet.","fork":false,"url":"https://api.github.com/repos/jupyter/jupyterlab","forks_url":"https://api.github.com/repos/jupyter/jupyterlab/forks","keys_url":"https://api.github.com/repos/jupyter/jupyterlab/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyter/jupyterlab/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyter/jupyterlab/teams","hooks_url":"https://api.github.com/repos/jupyter/jupyterlab/hooks","issue_events_url":"https://api.github.com/repos/jupyter/jupyterlab/issues/events{/number}","events_url":"https://api.github.com/repos/jupyter/jupyterlab/events","assignees_url":"https://api.github.com/repos/jupyter/jupyterlab/assignees{/user}","branches_url":"https://api.github.com/repos/jupyter/jupyterlab/branches{/branch}","tags_url":"https://api.github.com/repos/jupyter/jupyterlab/tags","blobs_url":"https://api.github.com/repos/jupyter/jupyterlab/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyter/jupyterlab/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyter/jupyterlab/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyter/jupyterlab/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyter/jupyterlab/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyter/jupyterlab/languages","stargazers_url":"https://api.github.com/repos/jupyter/jupyterlab/stargazers","contributors_url":"https://api.github.com/repos/jupyter/jupyterlab/contributors","subscribers_url":"https://api.github.com/repos/jupyter/jupyterlab/subscribers","subscription_url":"https://api.github.com/repos/jupyter/jupyterlab/subscription","commits_url":"https://api.github.com/repos/jupyter/jupyterlab/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyter/jupyterlab/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyter/jupyterlab/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyter/jupyterlab/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyter/jupyterlab/contents/{+path}","compare_url":"https://api.github.com/repos/jupyter/jupyterlab/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyter/jupyterlab/merges","archive_url":"https://api.github.com/repos/jupyter/jupyterlab/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyter/jupyterlab/downloads","issues_url":"https://api.github.com/repos/jupyter/jupyterlab/issues{/number}","pulls_url":"https://api.github.com/repos/jupyter/jupyterlab/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyter/jupyterlab/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyter/jupyterlab/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyter/jupyterlab/labels{/name}","releases_url":"https://api.github.com/repos/jupyter/jupyterlab/releases{/id}","deployments_url":"https://api.github.com/repos/jupyter/jupyterlab/deployments","created_at":"2016-06-03T20:09:17Z","updated_at":"2016-10-05T15:46:09Z","pushed_at":"2016-10-05T18:45:22Z","git_url":"git://github.com/jupyter/jupyterlab.git","ssh_url":"git@github.com:jupyter/jupyterlab.git","clone_url":"https://github.com/jupyter/jupyterlab.git","svn_url":"https://github.com/jupyter/jupyterlab","homepage":"","size":37399,"stargazers_count":1189,"watchers_count":1189,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":165,"mirror_url":null,"open_issues_count":197,"forks":165,"open_issues":197,"watchers":1189,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925"},"html":{"href":"https://github.com/jupyter/jupyterlab/pull/925"},"issue":{"href":"https://api.github.com/repos/jupyter/jupyterlab/issues/925"},"comments":{"href":"https://api.github.com/repos/jupyter/jupyterlab/issues/925/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyter/jupyterlab/pulls/925/commits"},"statuses":{"href":"https://api.github.com/repos/jupyter/jupyterlab/statuses/7a81fb0a508950573d887de765776c0f74c33525"}}}}
{"actor":{"display_login":"blink1073"}}