http mosaic wizard rewrited for IE 6
Posted: 28 Mar 2006 16:13
Hello,
I found some bugs in http mosaic wizard when used with Internet Explorer 6.
I suppose there was a problem with DOM structures when mosaic table was created: tbody was needed (see http://msdn.microsoft.com/library/defau ... tables.asp)
and I had to do some changes in code about setting CSS classes [function setclass()] and setAttributes for IE. IE6 uses expressions like element.className=value and element[sName]=sValue
Please test this with Mozilla family browsers.
changed content of mosaic.js:
Albert
I found some bugs in http mosaic wizard when used with Internet Explorer 6.
I suppose there was a problem with DOM structures when mosaic table was created: tbody was needed (see http://msdn.microsoft.com/library/defau ... tables.asp)
and I had to do some changes in code about setting CSS classes [function setclass()] and setAttributes for IE. IE6 uses expressions like element.className=value and element[sName]=sValue
Please test this with Mozilla family browsers.
changed content of mosaic.js:
Code: Select all
function mosaic_size_change()
{
var x,y;
var bg_width = check_and_replace_int( "bg_width", "400" );
var bg_height = check_and_replace_int( "bg_height", "300" );
mosaic_height = check_and_replace_int( "mosaic_height", "100" );
mosaic_width = check_and_replace_int( "mosaic_width", "100" );
mosaic_xoffset = check_and_replace_int( "mosaic_xoffset", "10" );
mosaic_yoffset = check_and_replace_int( "mosaic_yoffset", "10" );
mosaic_vborder = check_and_replace_int( "mosaic_vborder", "5" );
mosaic_hborder = check_and_replace_int( "mosaic_hborder", "10" );
mosaic_rows = check_and_replace_int( "mosaic_rows", "1" );
mosaic_cols = check_and_replace_int( "mosaic_cols", "1" );
cell_width = Math.floor((mosaic_width-(mosaic_cols-1)*mosaic_hborder)/mosaic_cols);
cell_height = Math.floor((mosaic_height-(mosaic_rows-1)*mosaic_vborder)/mosaic_rows);
var mlayout = document.getElementById( "mosaic_layout" );
/* TODO: keep 'common' cells when resizing */
while( mlayout.hasChildNodes() )
mlayout.removeChild( mlayout.firstChild );
mlayout.style.width = bg_width + "px";
mlayout.style.height = bg_height + "px";
/* rewrited */
var mdt = document.createElement("div");
mdt.id='mosaic.dt';
mdt.className='mosaic_tbl';
mdt.style.width = mosaic_width + "px";
mdt.style.height = mosaic_height + "px";
mdt.style.top = mosaic_yoffset + "px";
mdt.style.left = mosaic_xoffset + "px";
var mtable = document.createElement("table");
mtable.border="1";
mtable.style.top = "-" + mosaic_vborder + "px";
mtable.style.left = "-" + mosaic_hborder + "px";
mtable.style.width = (1*mosaic_width +2*mosaic_hborder) + "px";
mtable.style.height = (1*mosaic_height+2*mosaic_vborder) + "px";
mtable.style.borderSpacing = mosaic_hborder + "px " +
mosaic_vborder + "px";
var mtbody = document.createElement("tbody");
mtable.appendChild(mtbody);
var mrow, mcol, i, j;
for (i=0; i<mosaic_rows; i++)
{
mrow = document.createElement("tr");
mtbody.appendChild(mrow);
for (j=0; j<mosaic_cols; j++)
{
mcell = document.createElement("td");
mcell.className='mosaic_itm';
mcell.style.width = cell_width + "px";
mcell.style.height = cell_height + "px";
var id = i+'_'+j;
var btn = create_button( cells[id] ? cells[id] : '?', 'mosaic_elt_choose(\"'+id+'\");' );
btn.id=id;
btn.title='Click to choose stream';
mcell.appendChild(btn);
mrow.appendChild(mcell);
}
}
// Ins into the document tree
mosaic_layout.appendChild(mtable);
mosaic_code_update();
}