- saveHTML : function( )
+ saveHTML : function( )
{
//print("TRAVERSE DOM?");
//print(dom);
var ret = '';
//Roo.select('body > div',true).each(function(el) {
+ // if the tree is not ready yet?
+
+
this.traverseDOMTree(function(s) { ret+=s; }, dom, 1);
- alert("IPC:SAVEHTML:" + ret);
+ alert("IPC:SAVEHTML:" + ret);
return ret;
},
traverseDOMTree : function(cb, currentElement, depth) {
- if (!currentElement) {
+ if (!currentElement ) {
return;
}
- console.log(currentElement);
- if (currentElement.className.match(/roo-dynamic/)) {
+ //console.log(currentElement);
+ if (currentElement.className && currentElement.className.match(/roo-dynamic/)) {
return;
}
return;
}
+ if (nodeName.match(/^#/)) { // comments?
+ return;
+ }
return;
}
if (nodeName != 'BODY') {
-
-
+ //Roo.log(currentElement);
+ if (currentElement.hasAttribute('flexy:include')) {
+
+
+ cb( '<flexy:include src="'+currentElement.getAttribute('flexy:include')+'"></flexy:include>');
+ return;
+ }
var i = 0;
// Prints the node tagName, such as <A>, <IMG>, etc
} else {
tagName = false;
}
+
+
// Traverse the tree
i = 0;
var currentElementChild = currentElement.childNodes.item(i);
}
id = ''+ id;
var bid = id.length ? 'builder-' + id : '';
- console.log('{ "hover-node" : "' + bid + '"}');
+ //console.log('{ "hover-node" : "' + bid + '"}');
this.lastID = id;
},
clearBootstrap : function()
tree.el.attr('xtype', tree['xtype-bootstrap']);
}
+ if (typeof(tree['flexy:include']) != 'undefined') {
+ //Roo.log("add flexy:if");
+ tree.el.attr('flexy:include', tree['flexy:include']);
+ }
+
+ if (typeof(tree['flexy:ignore']) != 'undefined') {
+ //Roo.log("add flexy:if");
+ tree.el.attr('flexy:ignore', tree['flexy:ignore']);
+ }
+ //Roo.log("Add xtype")
+ tree.el.attr('xtype', tree['|xns'] + '.' + tree['xtype']);
if (!tree.items || !tree.items.length) { return; }
-
+ //Roo.log(tree);
for (var i = 0; i < tree.items.length; i++){
this.applyFlexy(tree.items[i]);
}
Roo.onReady(function() { Builder.clearBootstrap(); });
Roo.XComponent.on('buildcomplete', function() {
Roo.log("xcomponent built!");
+ var m = Roo.XComponent.modules;
+ Builder.applyFlexy(m[m.length-1].el);
- Builder.applyFlexy(Roo.XComponent.modules[0].el);
+ Builder.saveHTML.defer(100, Builder);
});
\ No newline at end of file