Skip to content

Instantly share code, notes, and snippets.

@pfgithub
Last active November 15, 2015 02:04
Show Gist options
  • Save pfgithub/99e79bbbd2b3fd88bad4 to your computer and use it in GitHub Desktop.
Save pfgithub/99e79bbbd2b3fd88bad4 to your computer and use it in GitHub Desktop.
const wm = require('./api/windowman.js');
console.log(wm);
var window = new wm.Window("My window");
var $ = require('jquery');
function panel(x,y,w,h){
return $('<li>').attr("style","top:"+x+"px;left:"+y+"px;width:"+w+"px;height:"+h+"px;").addClass('contained');
}
var Window = function(title, w, h, x, y){
this.title=title;
this.w=w;
this.h=h;
this.x=x;
this.y=y;
if(!this.title){this.title = "Untitled Window";}
if(!this.w){this.w = 100;}
if(!this.h){this.h = 100;}
if(!this.x){this.x = 50;}
if(!this.y){this.y = 50;}
this.panel = panel(x,y,w,h);
$('#container').append(
this.panel
);
this.panel.append($("<h1>").text("hi"));
}
module.exports = {
Window: Window,
astring: "astring"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment