Skip to content

Instantly share code, notes, and snippets.

@philippTheCat
Created July 11, 2012 17:52
Show Gist options
  • Save philippTheCat/3092013 to your computer and use it in GitHub Desktop.
Save philippTheCat/3092013 to your computer and use it in GitHub Desktop.
UIWidget: function(funcarguments){
this.template = '<span class="UIWidget" id="UIWidget_%(name)s" style="height:%(size.y)s;width:%(size.x)s;">'+
'%(content)s</span>';
var children = [];
var arguments = $.extend(true,funcarguments,
{
"name":"untitled",
"icon":"None",
"frame":$("#body"),
"size":
{"x":"800px",
"y":"600px"}
}
);
console.log(arguments); //prints out updated arguments dict
navbar = UI.UITitlebar(this.arguments);
children.push(navbar);
this.render = function(){
content = "";
for (child in children){
console.log(children);
content = content + children[child].render() + "\n";
}
arguments.content = content;
console.log(arguments); //logs empty dict
htmlcontent = sprintf(this.template,arguments);
arguments.frame.html(htmlcontent);
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment