cleanup
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
Malte Grosse 2024-02-05 15:41:23 +00:00
parent 92b4415b11
commit a5ca4ba0dd
1 changed files with 8 additions and 24 deletions

View File

@ -3,18 +3,16 @@ import {
JupyterFrontEndPlugin
} from '@jupyterlab/application';
import { Widget } from '@lumino/widgets';
import { LogoAnnounce} from './images';
import { LogoAnnounce } from './images';
import { MainAreaWidget } from '@jupyterlab/apputils';
function generateContent(): string {
return 'Welcome to Sandbox Playground';
}
function createNode(): HTMLElement {
let node = document.createElement('div');
node.className = "sandbox-announcement-container"
let content = document.createElement('div');
content.className = "sandbox-announcement-content"
let image = document.createElement('img');
image.src=LogoAnnounce;
image.src = LogoAnnounce;
image.className = "sandbox-announcement-icon"
content.appendChild(image);
let text = document.createElement('h2');
@ -36,34 +34,20 @@ const plugin: JupyterFrontEndPlugin<void> = {
const widget = new Widget();
widget.id = "sandbox-announce"
widget.addClass('sandbox-announcement-contentheader-widget');
//widget.node.textContent = generateContent();
console.log(generateContent())
widget.node.appendChild(createNode())
setInterval(() => {
const main = app.shell.currentWidget;
if (main !=null){
console.log(main);
}
if (main instanceof MainAreaWidget) {
// if (main.title.label == 'Launcher'){
// console.log(main.title.label);
// }
let add = true;
// and insert it into the header
main.contentHeader.widgets.forEach(function (w: Widget) {
if (w.id=="sandbox-announce"){
//w.dispose()
if (w.id == "sandbox-announce") {
add = false
}
});
if (add){
console.log("add")
if (add) {
main.contentHeader.addWidget(widget);
}
}
}, 200);