Skip to content

Commit

Permalink
Fixes bug rlamana#7
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Lamana committed Apr 24, 2013
1 parent 31c75a0 commit e5c82de
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 87 deletions.
4 changes: 3 additions & 1 deletion build/ventus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1688,13 +1688,15 @@ define('ventus/wm/windowmanager',['require','$','ventus/wm/window','ventus/core/

/**
* Ventus
* Copyright © 2012 Ramón Lamana
* Copyright © 2012-2013 Ramón Lamana
* https://github.com/rlamana
*/
define('ventus',['require','ventus/wm/windowmanager','ventus/wm/window'],function(require) {


return {
version: '0.1',

WindowManager: require('ventus/wm/windowmanager'),
Window: require('ventus/wm/window')
};
Expand Down
8 changes: 7 additions & 1 deletion build/ventus.min.js

Large diffs are not rendered by default.

168 changes: 92 additions & 76 deletions examples/desktop/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,80 +3,96 @@
* Copyright © 2012 Ramón Lamana
*/
(function($, Ventus) {
$(document).ready(function() {
var wm = new Ventus.WindowManager();

window.wm = wm; // For debugging reasons

var terminalWin = wm.createWindow.fromQuery('.terminal-app', {
title: 'Terminal',
classname: 'terminal-window',
width: 600,
height: 300,
x: 50,
y: 60
});

terminalWin.signals.on('click', function(win){
terminal.display.focus();
});

var todoWin = wm.createWindow.fromQuery('.todo-app', {
title: 'Todo',
width: 330,
height: 400,
x: 670,
y: 60
});

var playerWin = wm.createWindow.fromQuery('.player-app', {
title: 'Video Player',
classname: 'player-window',
width: 635,
height: 300,
x: 490,
y: 320,
resizable: false,
opacity: 1 // To fix problems with chrome video on Linux
});

/*playerWin.titlebar = false;
playerWin.widget = true;*/

var aboutWin = wm.createWindow.fromQuery('.about-app', {
title: 'About Ventus',
width: 250,
height: 280,
x: 140,
y: 380
});

// Hide loader when loaded
var loader = $("#loading-screen");

// For look & feel reasons
function openWithDelay(win, delay) {
setTimeout(function(){win.open();}, delay);
}

setTimeout(function() {
loader.addClass('hide');
loader.on('webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() {
loader.hide();

// Open windows
openWithDelay(terminalWin, 0);
openWithDelay(todoWin, 200);
openWithDelay(aboutWin, 400);
openWithDelay(playerWin, 600);
});
}, 3000);


// Exposé test button
$(".expose-button").click(_.throttle(function(){
wm.mode = 'expose';
return false;
}, 1000));
});
$(document).ready(function() {
var wm = new Ventus.WindowManager();

window.wm = wm; // For debugging reasons

// Terminal
var terminalWin = wm.createWindow.fromQuery('.terminal-app', {
title: 'Terminal',
classname: 'terminal-window',
width: 600,
height: 300,
x: 50,
y: 60
});

terminalWin.signals.on('click', function(win){
terminal.display.focus();
});

var terminal = new Terminus('.terminal-app', {
welcome: '<div class="identity"><img src="terminal/img/logo.png" /><h1>Terminus.js</h1> ' +
Terminus.version +
'</div>Copyright 2012-2013 Ramón Lamana.<br/>' +
'Press <span style="color:green">&lt; tab &gt;</span> to see a list of available commands.'
});
terminal.shell.include([TestCommands, ShapeCommands]);

terminal.display.events.on('prompt', function() {
terminalWin.$content.animate({
scrollTop:terminalWin.el.find('.terminusjs').height()
}, 300);
});


var todoWin = wm.createWindow.fromQuery('.todo-app', {
title: 'Todo',
width: 330,
height: 400,
x: 670,
y: 60
});

var playerWin = wm.createWindow.fromQuery('.player-app', {
title: 'Video Player',
classname: 'player-window',
width: 635,
height: 300,
x: 490,
y: 320,
resizable: false,
opacity: 1 // To fix problems with chrome video on Linux
});

/*playerWin.titlebar = false;
playerWin.widget = true;*/

var aboutWin = wm.createWindow.fromQuery('.about-app', {
title: 'About Ventus',
width: 250,
height: 280,
x: 140,
y: 380
});

// Hide loader when loaded
var loader = $("#loading-screen");

// For look & feel reasons
function openWithDelay(win, delay) {
setTimeout(function(){win.open();}, delay);
}

setTimeout(function() {
loader.addClass('hide');
loader.on('webkitAnimationEnd oAnimationEnd MSAnimationEnd', function() {
loader.hide();

// Open windows
openWithDelay(terminalWin, 0);
openWithDelay(todoWin, 200);
openWithDelay(aboutWin, 400);
openWithDelay(playerWin, 600);
});
}, 3000);


// Exposé test button
$(".expose-button").click(_.throttle(function(){
wm.mode = 'expose';
return false;
}, 1000));
});
})($, Ventus);
7 changes: 0 additions & 7 deletions examples/desktop/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@
<script type="text/javascript" src="terminal/commands/vendor/three.js"></script>
<script type="text/javascript" src="terminal/commands/vendor/supertags.js"></script>
<script type="text/javascript" src="terminal/commands/shapecommands.js"></script>
<script type="text/javascript">
var terminal = new Terminus('.terminal-app', {
welcome: "<div class='identity'><img src='terminal/img/logo.png' /><h1>Terminus.js</h1> "+Terminus.version+"</div>Copyright 2012 Ramón Lamana.<br/>Press <span style='color:green'>&lt; tab &gt;</span> to see a list of available commands."
});

terminal.shell.include([TestCommands, ShapeCommands]);
</script>

<!-- Video Player App -->

Expand Down
Loading

0 comments on commit e5c82de

Please sign in to comment.