GithubHelp home page GithubHelp logo

rlamana / ventus Goto Github PK

View Code? Open in Web Editor NEW
335.0 28.0 96.0 41.04 MB

A window manager written in Javascript, HTML5 and CSS3

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

License: MIT License

JavaScript 76.25% Less 23.75%

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.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!

Version 0.3.0 migrates code to webpack and ES6 and is available in branch: https://github.com/rlamana/Ventus/tree/v0.3.0.

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 empty window without animations and staying inside of the space

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

	animations: false,
	stayinspace: true,
});

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

amatiasq avatar andreybutenko avatar brammittendorff-dd avatar crazyjul avatar dakshshah96 avatar dependabot[bot] avatar dragonnn avatar dravenshorst avatar dustinbrett avatar gingerbear avatar gitter-badger avatar joshuacwebdeveloper avatar m-elbably avatar maciek-codes avatar rlamana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ventus's Issues

Is this project still in development?

Hi, I would like to know if this project is still under development and if You plan to update it and add more functionalities like other ways to load content into windows (es. from an Ajax call) or other types of windows (like modals, alerts etc).

in any case, congratulations, it's really quite fascinating

Incorrect assumption that a WebKit-based browser can only be Chrome or Safari

Incorrect assumption that a WebKit-based browser can only be Chrome or Safari

These lines are used in the incorrect assumption:

var isChrome = /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);
var isSafari = /Safari/.test(navigator.userAgent) && /Apple Computer/.test(navigator.vendor);

https://github.com/rlamana/Ventus/blob/master/examples/desktop/desktop.js#L92
https://github.com/rlamana/Ventus/blob/master/examples/simple/index.html#L44

There are WebKit-based browsers that are not from Google or Apple. Perhaps, you should be checking for WebKit instead of particular browsers?

Context menus for windows

User can have a context menu in windows, like option to paste commands to Terminus. This will need a new command to open exposé.

Window title custom content

Like an browser and other apps does in operating systems, can insert custom content to appear in window title bar.

Ignore dist/ folder and move to CDN hosting

I just had a thought that it isn't perhaps the best idea to keep builds in dist folder. Sooner or later it will lead to conflicts with merge. Maybe instead the folder should be ignored and the latest build could be hosted over a content delivery network? This seems to be a good place to look at: jsDelivr.

Display in FF

I had a problem displaying windows under FF24

To make it work I had to move the header INSIDE the section instead of BELOW :
src/ventus/tpl/window.tpl.js

Popunders

Feature popunders feature like Windows and WS.js does.

Windows' popunder:

WS.js' popunder:

Separated/own CSS/JS file for effects/animations

Some environments want more the system than the effects/animations, then is an good option offer Ventus withtout effects enabled by default, with instructions for activating effects/animations.

Icons for openned windows

Support to environment/OS using icons/links for openned apps. If not has links, collapse windows when minimize. If has links, disapear window for be clicked again when user need restore window.

load ventus with require

Hi, how do i load ventus with requirejs. I tried to load like this without any success:
ventus: '../assets/libs/Ventus/build/ventus.min'

Usage questions.

Hello,

Thank you for creating Ventus! I'm trying to use it but struggling with some configurations options. Please advice me on the following:

  • How can bind window managing to a particular div? I don't want it to take over the entire document.
  • How can I turn off the window shaking when selected by the mouse? While it looks quite cool, I don't want it there all the time.
  • How can I enable horizontal scrolling within the windows? Vertical is already there, but not quite sure when it's not doing the horizontal.

Thanks in advance,
Mike.

Window menus

The windows will have a dropdown menu for user select options.

Windowing wrappers

Developer can make wrappers for prevent windows dragged trought elements, such as an bottom bar.

Script for independent apps

People will can run own apps in web with the power of this WM, like sandwich menu, window menu and context menu.

Own repository to Todo

And giving link for Terminus and Todo in sandwich menu for downloading/go to own repository.

Window remains in drag state when mouse moved really quickly during dragging

Steps to reproduce:

  1. Create a draggable window
  2. Left click and hold the title bar to start moving the window
  3. Now move mouse rather rapidly - notice window stopped being dragged, but the pointer continues to move outside the window area
  4. Release the mouse button
  5. Move the pointer back above the window

What I see:
Window stopped being moved and as soon as I go back with the mouse pointer above the window, dragging continues even though I don't hold left mouse button.

What I expected:
Either dragging continues until mouse button is released, or window stops moving, but is not in "dragging state".

I noticed it when working on Chrome 40, also reproduces on Safari, but I believe it's not something browser specific.

Frameless windows

Give example and option to user create frameless windows.
31/07/2016 Edit: I've removed the part "with possibility to activate option to click throught transparency" due to the separated issue #56.

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.