templates/index.html aktualisiert
This commit is contained in:
@@ -93,11 +93,35 @@
|
||||
// Initialisiere GridStack
|
||||
var grid = GridStack.init({
|
||||
cellHeight: 70,
|
||||
acceptWidgets: true,
|
||||
dragIn: '.newWidget',
|
||||
margin: 5,
|
||||
resizable: { handles: 'se, sw, ne, nw, e, w, s, n' }
|
||||
});
|
||||
|
||||
// FUNKTION: Layout laden
|
||||
function loadLayout() {
|
||||
let serialization = localStorage.getItem('grid-layout');
|
||||
if (serialization) {
|
||||
let layout = JSON.parse(serialization);
|
||||
grid.load(layout);
|
||||
}
|
||||
}
|
||||
|
||||
// FUNKTION: Layout speichern
|
||||
function saveLayout() {
|
||||
let serialization = grid.save();
|
||||
localStorage.setItem('grid-layout', JSON.stringify(serialization));
|
||||
}
|
||||
|
||||
// Events: Speichere bei jeder Änderung
|
||||
grid.on('dragstop resizestop', function(event, el) {
|
||||
saveLayout();
|
||||
// Falls du das Terminal-Plugin 'fit' nutzt, hier triggern:
|
||||
// fitAddon.fit();
|
||||
});
|
||||
|
||||
// Beim Start das gespeicherte Layout laden
|
||||
loadLayout();
|
||||
|
||||
// Xterm.js Setup
|
||||
const term = new Terminal({ theme: { background: '#000' }, fontSize: 13, cursorBlink: true });
|
||||
term.open(document.getElementById('terminal'));
|
||||
|
||||
Reference in New Issue
Block a user