|
From: <bs...@in...> - 2003-08-15 01:56:03
|
Hi
This is a mail basicly for Raymond Irving as you have implementet the Blueprint
model in dynLayer.inline.js.
I would like to get string of generateBlueprint() *without* opening a
window. This would give me the possability to send the blueprint
directly to the server without the overhead of manualy coping the text
from the popup window that is currently created now.
Question:
Could you add following modification to dynLayer.inline.js
- replacing the generateBlueprint-function.
- adding getBlueprint-function
NEW: (untested, but actually only refactoring)
----------------------------------------------------
DynElement.prototype.getBlueprint = function(type) {
var i,c,ht,str =[];
var ch=this.children;
for(i=0;i<ch.length;i++) {
c = ch[i];
DynElement._flagPreCreate(c);
ht=c.getOuterHTML();
if(!type || type=='css') str[i]=ht;
else {
ht=ht.replace(/\'/g,'\\\'');
ht=ht.replace(/\r/g,'\\r');
ht=ht.replace(/\n/g,'\\n');
str[str.length]='_bw(\''+ht+'\');';
}
}
if(!type || type=='css') str=str.join('');
else str=str.join('\n');
if(type=='css') { // generate style sheet from blueprints
var ar=str.split('<div');
for(i=0;i<ar.length;i++){
ar[i]=ar[i].replace(/(.+)id="(.+)" style="(.+)"(.+)/g,'#$2 {$3}');
}
str=ar.join('');
}
return str;
}
DynElement.prototype.generateBlueprint = function(type) {
var url=dynapi.library.path+'ext/blueprint.html';
var win=window.open(url,'blueprint','width=500,height=350,scrollbars=no,status=no,toolbar=no');
var f=win.document.forms['frm'];
f.txtout.value=DynLayer.getBlueprint(type);
};
Thanks
--
S. Blum <bs...@in...>
|