|
7 | 7 | "./tooling-shared-components",
|
8 | 8 | ], function (Jupyter, $, dialog, utils, require, sharedComponents) {
|
9 | 9 | // -------- GLOBAL VARIABLES -----------------------
|
10 |
| - var basePathRegex = "^(.*?)/(tree|notebooks|edit|terminals)/"; |
| 10 | + var basePathRegex = "^(.*?)/(tree|notebooks/|edit/|terminals/)"; |
11 | 11 | var basePath =
|
12 | 12 | window.location.pathname.match(basePathRegex) == null
|
13 | 13 | ? ""
|
@@ -129,16 +129,21 @@ define([
|
129 | 129 | }
|
130 | 130 | }
|
131 | 131 |
|
| 132 | + docs_button = '<form action="https://github.com/ml-tooling/ml-workspace#features" target="_blank" style="display: inline-block;margin-left: 2px;"><button class="btn btn-default btn-sm"> <i class="fa-github fa"></i> Docs</button></form>' |
| 133 | + |
132 | 134 | tools_dropwdown =
|
133 |
| - '<div id="start-tool-btn" class="btn-group" style="float: right; margin-right: 2px; margin-left: 2px;"> \ |
| 135 | + '<div id="start-tool-btn" class="btn-group" style="float: right; margin-left: 2px;"> \ |
134 | 136 | <button class="dropdown-toggle btn btn-default btn-xs" data-toggle="dropdown" style="padding: 5px 10px;" aria-expanded="false"> \
|
135 | 137 | <span>Open Tool</span> <span class="caret"></span> </button> \
|
136 | 138 | <ul id="start-tool" class="dropdown-menu" style="right: 0; left: auto;">' +
|
137 | 139 | tools_menu_items +
|
138 |
| - " </ul> </div>"; |
| 140 | + '<li role="presentation" class="divider"></li>' + |
| 141 | + '<li><div style="display: block;padding: 3px 20px;clear: both;font-weight: 400;line-height: 1.42857143;color: #333333;white-space: nowrap;"><div>Do you like ML Workspace?</div><span style="display: block; color: #gray; padding: initial; font-size: 12px;"><a href="https://github.com/ml-tooling/ml-workspace" style="color: #333333;font-weight: 550;" target="_blank">Give us a star</a> or <a href="https://twitter.com/mltooling" style="color: #333333;font-weight: 550;" target="_blank">follow us on Twitter!</a></span></div></li>' + |
| 142 | + " </ul> </div>"; |
139 | 143 |
|
| 144 | + $("#header-container").append(docs_button); |
140 | 145 | $("#header-container").append(tools_dropwdown);
|
141 |
| - |
| 146 | + |
142 | 147 | $("#ssh-access").click(function () {
|
143 | 148 | components.getSSHSetupCommand(window.location.origin, function (data) {
|
144 | 149 | dialog.modal({
|
@@ -201,7 +206,7 @@ define([
|
201 | 206 | ).text();
|
202 | 207 | window.open(
|
203 | 208 | basePath +
|
204 |
| - "terminals/" + |
| 209 | + "terminals/new/" + |
205 | 210 | selecteTool.trim().toLowerCase().replace(/\W/g, "_"),
|
206 | 211 | "_blank"
|
207 | 212 | );
|
|
0 commit comments