-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #6423 expose full bootstrap styles for lab, and fix font path issue * #6423 Create and register BeakerxTree JupyterLabPlugin * #6423 BeakerXTreeWidget - recreate layout using "@phosphor/widgets" Panel * #6423 BannerWidget - implementation using "@phosphor/widgets" * #6423 SyncIndicatorWidget * #6423 JVMOptionsWidget * #6423 BeakerxApi and Urls for BeakerxTree * #6423 add overflow to Widget * #6423 remove unused code * #6423 DefaultOptionsWidget, DefaultOptionsModel and HeapGBValidator * #6423 PropertiesWidget, PropertiesModel * #6423 SyncIndicatorWidget * #6423 Messages * #6423 OtherOptionsWidget, OtherOptionsModel * #6423 BeakerxApi * #6423 BeakerxApi JVMOptionsWidget * #6423 Restore widget state on reload * #6423 change => keyup * #6423 change command label * #6423 wip * #6423 move tree source from js/lab to js/notebook * #6423 packages, tsconfig, jquery * #6423 fix compilation errors * #6423 working tree widget in notebook * #6423 remove not needed files * #6423 remove paths from .gitignore * #6423 use BeakerXTreeWidget in lab * #6423 fix missed baseUrl TODO; BeakerxApi => BeakerXApi; fix NaN showing when changing heap size to empty string * #6423 fix * #6214 add UIOptionsWidget, UIOptionsModel, messages and logic * #6214 remove console.log * #6214 change widget template * #6214 add show_publication to IUIOptions * #6214 add show_publication UIOptionsWidget * #6214 add JVMOptionsChangedMessage * #6214 refactor ui_options are not part of jvm_options, load and save are performed on TreeModel/Widget level * #6214 rename BeakerXTreeWidget => TreeWidget; introduce isLab and CodeCell options; move BeakerXApi creation into TreeWidget * #6214 extract IApiSettingsResponse * #6214 extract IJVMOptions * #6214 extract IUIOptions * #6214 extract ITreeWidgetOptions * #6214 DefaultOptionsWidgetInterface * #6214 PropertiesWidgetInterface * #6214 OtherOptionsWidgetInterface * #6214 DefaultOptionsModel * #6214 OtherOptionsModel * #6214 PropertiesModel * #6214 export default * #6214 remove extracted OtherOptionsModel class from file * #6214 JVMOptionsModel * #6214 remove types/interfaces there were extracted * #6214 HeapGBValidator * #6214 fix import * #6214 add TreeWidgetModel; UIOptionsModel * #6214 add UIOptionsWidget, UIOptionsWidgetInterface * #6214 fix after move * #6214 extract model * #6214 add banner fix imports * #6214 pass CodeCell to TreeWidget * #6214 use saved ui_options * #6214 remove not needed code * #6214 handle show_publication * #6214 move UIOptionsHelper to extension directory * #6214 remove comment * #6214 remove not needed option in lab * #6214 cs fixes * #6214 fix uiOptionsModel undefined case * #6214 show publication should be enabled by default; set default options in the backend * #6214 add margin to wide cells * #6214 better handling of autoCloseBrackets; disable improve fonts handle * #6214 hide improve fonts checkbox * #6214 fix margins
- Loading branch information
1 parent
afd129b
commit fa28a12
Showing
33 changed files
with
1,043 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import './../global.env'; | ||
|
||
import BeakerXApi from "../tree/Utils/BeakerXApi"; | ||
import * as GistPublish from "./gistPublish/index"; | ||
|
||
|
||
export function registerFeature(baseUrl: string): void { | ||
if (!!Jupyter.NotebookList) { | ||
return; | ||
} | ||
|
||
const api = new BeakerXApi(baseUrl); | ||
api.loadSettings() | ||
.then((data) => { | ||
|
||
setupAutoCloseBrackets(data.ui_options.auto_close); | ||
setupWideCells(data.ui_options.wide_cells); | ||
// setupImproveFonts(data.ui_options.improve_fonts); | ||
setupShowPublication(data.ui_options.show_publication); | ||
|
||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
}); | ||
} | ||
|
||
function setupAutoCloseBrackets(autoCloseBrackets: boolean): void { | ||
// new cells | ||
Jupyter.CodeCell.options_default.cm_config.autoCloseBrackets = autoCloseBrackets; | ||
|
||
// existing | ||
const code_cells = Jupyter.notebook.get_cells().filter((cell) => { | ||
return cell.cell_type = 'code'; | ||
}); | ||
|
||
for (let cell of code_cells) { | ||
let cm = cell.code_mirror; | ||
if (cm.getOption('autoCloseBrackets') !== autoCloseBrackets) { | ||
cm.setOption('autoCloseBrackets', autoCloseBrackets); | ||
} | ||
} | ||
|
||
} | ||
|
||
function setupWideCells(wideCells: boolean): void { | ||
if (!wideCells) { | ||
return; | ||
} | ||
|
||
let s = document.createElement('style'); | ||
s.innerText = `#notebook_panel .container { width:auto; margin: 0 16px; }`; | ||
|
||
document.body.appendChild(s); | ||
} | ||
|
||
// function setupImproveFonts(improveFonts: boolean) { | ||
// // TODO; | ||
// console.log('handle improve fonts', improveFonts); | ||
// } | ||
|
||
function setupShowPublication(showPublication: boolean) { | ||
if (!showPublication) { | ||
return; | ||
} | ||
GistPublish.registerFeature(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,21 @@ | ||
import BeakerXTreeWidget from './tree/TreeWidget'; | ||
import BeakerXApi from "./tree/BeakerXApi"; | ||
/* | ||
* Copyright 2017 TWO SIGMA OPEN SOURCE, LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import TreeWidget from "./tree/TreeWidget"; | ||
|
||
export default { | ||
BeakerXTreeWidget: BeakerXTreeWidget, | ||
BeakerXApi: BeakerXApi, | ||
} | ||
TreeWidget: TreeWidget, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.