A window manager written in Javascript, HTML5 and CSS3.
Live Demo! (http://www.rlamana.com/ventus) | Video Demo
This project started as an experiment and even though it was stable enough it was never meant to be mantained over time. However, feel free to fork and send PRs!
var wm = new Ventus.WindowManager();
Set rightClick on true to disable expose on right click. Default is false (right click shows expose).
var wm = new Ventus.WindowManager({
rightClick: true
});
var window = wm.createWindow({
title: 'A new window',
x: 50,
y: 50,
width: 400,
height: 250
});
window.open();
var window = wm.createWindow({
title: 'A new window',
x: 50,
y: 50,
width: 400,
height: 250
animations: false,
stayinspace: true,
});
window.open();
To create a window with a refresh button, you have to add a event-listener to the options when creating a window.
A working example is added to examples/simple/index.html
var window = wm.createWindow({
title: 'A new window',
x: 50,
y: 50,
width: 400,
height: 250
animations: false,
stayinspace: true,
events: {
reload: function () {
// Add logic here that will be executed
// when refresh button is clicked.
}
}
});
window.open();
wm.createWindow.fromQuery('#element .selector', {
title: 'My App',
width: 330,
height: 400,
x: 670,
y: 60
});
wm.createWindow.fromElement(domElement, {
title: 'My App',
width: 500,
height: 500,
x: 0,
y: 0
});
var window = wm.createWindow({
title: 'A new window',
events: {
open: function() {
console.log('The window was open');
},
closed: function() {
console.log('The window was closed');
},
}
});
var window = wm.createWindow({
title: 'A new window'
});
window.signals.on('open', function() {
console.log('The window was open');
});
When a window is closed the content is not destroyed by default. This way windows can be open again keeping the wrapped DOM element. To completely destroy the window, the method 'destroy' needs to be called:
var window = wm.createWindow({
title: 'A new window',
events: {
closed: function() {
this.destroy();
}
}
});