Giter Site home page Giter Site logo

hackur / ventus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rlamana/ventus

0.0 2.0 0.0 39.23 MB

A window manager written in Javascript, HTML5 and CSS3

Home Page: http://www.rlamana.es/ventus/

License: MIT License

JavaScript 67.63% CSS 30.09% HTML 2.28%

ventus's Introduction

Ventus WM Build Status Join the chat at https://gitter.im/rlamana/Ventus

A window manager written in Javascript, HTML5 and CSS3.

Live Demo! (http://www.rlamana.es/ventus) | Video Demo

Creating a new window manager

var wm = new Ventus.WindowManager();

Creating a new empty window

var window = wm.createWindow({
	title: 'A new window',
	x: 50,
	y: 50,
	width: 400,
	height: 250
});

window.open();

Creating a new window wrapping a DOM Element

Using a query
wm.createWindow.fromQuery('#element .selector', {
	title: 'My App',
	width: 330,
	height: 400,
	x: 670,
	y: 60
});
Using a reference
wm.createWindow.fromElement(domElement, {
	title: 'My App',
	width: 500,
	height: 500,
	x: 0,
	y: 0
});

Listening to events

Defining handlers in constructor
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');
		},
	}
});
Using the 'signals' property
var window = wm.createWindow({
	title: 'A new window'
});

window.signals.on('open', function() {
	console.log('The window was open');
});

Destroying a window

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();
		}
	}
});

ventus's People

Contributors

rlamana avatar maciek-codes avatar gitter-badger avatar m-elbably avatar

Watchers

Jeremy Sarda avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.