Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lifeware
biocham
Commits
c2971907
Commit
c2971907
authored
Apr 25, 2018
by
dcoudrin
Browse files
disabling gui view for now
parent
d3f3287f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
c2971907
...
...
@@ -117,6 +117,7 @@ jupyter: biocham biocham_kernel/commands.js biocham_kernel/commands.py
-
jupyter kernelspec
install
--user
--name
=
biocham biocham_kernel
-
jupyter nbextension
install
--user
biocham_gui/menu
-
jupyter nbextension
enable
--user
menu/main
-
jupyter nbextension disable biocham_gui/dist/bundle
biocham_kernel/commands.py
:
biocham
...
...
biocham_gui/src/main.js
0 → 100644
View file @
c2971907
import
React
from
'
react
'
;
import
ReactDOM
from
'
react-dom
'
;
import
App
from
'
./App
'
;
import
'
./styles/styles.css
'
;
import
'
react-grid-layout/css/styles.css
'
;
import
'
react-resizable/css/styles.css
'
;
import
'
react-tabs/style/react-tabs.css
'
;
/**
*
*/
function
createSwitchButton
()
{
let
toolbarButton
=
document
.
createElement
(
'
button
'
);
toolbarButton
.
id
=
'
switch-btn
'
;
toolbarButton
.
classList
.
add
(
'
btn
'
,
'
btn-xs
'
,
'
navbar-btn
'
,
'
notification_widget
'
);
toolbarButton
.
innerText
=
'
GUI
'
;
let
helpMenu
=
document
.
querySelector
(
'
#help_menu
'
).
parentElement
;
helpMenu
.
parentElement
.
insertBefore
(
toolbarButton
,
helpMenu
);
toolbarButton
.
onclick
=
switchView
;
}
function
switchView
()
{
let
notebookView
=
document
.
getElementById
(
'
notebook_panel
'
);
let
guiPanel
=
document
.
getElementById
(
'
gui_panel
'
);
let
btn
=
document
.
getElementById
(
'
switch-btn
'
);
let
toolbar
=
document
.
getElementById
(
'
maintoolbar
'
);
let
notebookDisplay
=
notebookView
.
style
.
display
;
if
(
!
notebookDisplay
)
{
notebookDisplay
=
'
block
'
;
}
let
guiDisplay
=
guiPanel
.
style
.
display
;
if
(
notebookDisplay
===
'
none
'
&&
guiDisplay
!==
'
none
'
)
{
Jupyter
.
keyboard_manager
.
enable
();
notebookView
.
style
.
display
=
'
block
'
;
guiPanel
.
style
.
display
=
'
none
'
;
toolbar
.
style
.
display
=
'
block
'
;
btn
.
innerText
=
'
GUI
'
;
}
else
if
(
notebookDisplay
===
'
block
'
&&
guiDisplay
===
'
none
'
)
{
// Need to disable the notebook shortcuts when in the GUI
Jupyter
.
keyboard_manager
.
disable
();
notebookView
.
style
.
display
=
'
none
'
;
guiPanel
.
style
.
display
=
'
block
'
;
toolbar
.
style
.
display
=
'
none
'
;
btn
.
innerText
=
'
Notebook
'
;
}
}
function
initGUI
()
{
let
guiPanel
=
document
.
createElement
(
'
div
'
);
guiPanel
.
id
=
'
gui_panel
'
;
guiPanel
.
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
ipython-main-app
'
).
appendChild
(
guiPanel
);
createSwitchButton
();
}
export
function
load_ipython_extension
()
{
//initGUI();
ReactDOM
.
render
(
<
App
/>
,
document
.
getElementById
(
'
gui_panel
'
)
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment