T
Trevor
I'd really appreciate it if someone could please help me understand the
code below. The only question I have about c_table() is about the t &&
range( 1 )... line; what does the t && part mean? The range() is a
textRange, so what does the t && mean?
I'm having a hard time figuring out how the range() function works. I
know it returns a textRange, but I'd like to understand how it works.
function c_table( e, v ) {
var t = showModalDialog( path + 'aiTable.html', v,
'scroll:0;help:0;status:0;dialogWidth:378px;dialogHeight:496px' );
active();
t && range( 1 ).pasteHTML( t );
}
function range( v ) {
var s = d.selection;
v && ( s.type != 'None' ) && s.clear();
var r = s.createRange();
r.parents = [];
if( s.type == 'Control' ) {
r.control = true;
r.parents.push( r.item(0) );
r.parent = r.item(0).parentElement;
} else {
r.control = false;
r.parent = r.parentElement();
}
while( r.parent && r.parent.id != 'aiEdit' ) {
r.parents.push( r.parent );
r.parent = r.parent.parentElement;
}
return r;
}
Your help is appreciated.
Trevor
code below. The only question I have about c_table() is about the t &&
range( 1 )... line; what does the t && part mean? The range() is a
textRange, so what does the t && mean?
I'm having a hard time figuring out how the range() function works. I
know it returns a textRange, but I'd like to understand how it works.
function c_table( e, v ) {
var t = showModalDialog( path + 'aiTable.html', v,
'scroll:0;help:0;status:0;dialogWidth:378px;dialogHeight:496px' );
active();
t && range( 1 ).pasteHTML( t );
}
function range( v ) {
var s = d.selection;
v && ( s.type != 'None' ) && s.clear();
var r = s.createRange();
r.parents = [];
if( s.type == 'Control' ) {
r.control = true;
r.parents.push( r.item(0) );
r.parent = r.item(0).parentElement;
} else {
r.control = false;
r.parent = r.parentElement();
}
while( r.parent && r.parent.id != 'aiEdit' ) {
r.parents.push( r.parent );
r.parent = r.parent.parentElement;
}
return r;
}
Your help is appreciated.
Trevor