Skip to content

Commit eb533a3

Browse files
author
minjk-bl
committed
Add protector hide button for user
1 parent d0f2925 commit eb533a3

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

visualpython/js/MainFrame.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ define([
8888
top: colabHeaderHeight + 'px'
8989
});
9090
});
91+
} else if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
92+
$('#vp_protectorShowWithoutKernel').click(function(evt) {
93+
// just hide protector
94+
vpConfig.hideProtector();
95+
});
9196
}
9297

9398
window.vpEvent = new com_Event(this);
@@ -250,6 +255,19 @@ define([
250255
{ vp_note_display: vp_note_display, vp_note_width: vp_note_width },
251256
{ parent: this }
252257
);
258+
259+
// load protector for jupyterlite
260+
if (vpConfig.extensionType === 'lab' || vpConfig.extensionType === 'lite') {
261+
$('#vp_wrapper').append(`<div id="vp_protector" class="vp-protector">
262+
<div class="vp-protector-info">
263+
<div class="vp-protector-title">No kernel</div>
264+
<div class="vp-protector-content">You have to open the notebook or console to use Visual Python.</div>
265+
<div class="vp-protector-footer">
266+
<button id="vp_protectorShowWithoutKernel" class="vp-button cancel">Show without Kernel</button>
267+
</div>
268+
</div>
269+
</div>`)
270+
}
253271

254272
// consider height and width
255273
this._resizeWindow();

0 commit comments

Comments
 (0)