| | 271 | |
| | 272 | // Turning this on will turn all "linebreak" and "separator" items in your toolbar into soft-breaks, |
| | 273 | // this means that if the items between that item and the next linebreak/separator can |
| | 274 | // fit on the same line as that which came before then they will, otherwise they will |
| | 275 | // float down to the next line. |
| | 276 | |
| | 277 | // If you put a linebreak and separator next to each other, only the separator will |
| | 278 | // take effect, this allows you to have one toolbar that works for both flowToolbars = true and false |
| | 279 | // infact the toolbar below has been designed in this way, if flowToolbars is false then it will |
| | 280 | // create explictly two lines (plus any others made by plugins) breaking at justifyleft, however if |
| | 281 | // flowToolbars is false and your window is narrow enough then it will create more than one line |
| | 282 | // even neater, if you resize the window the toolbars will reflow. Niiiice. |
| | 283 | |
| | 284 | this.flowToolbars = true; |
| 241 | | ["popupeditor","separator"], |
| 242 | | ["formatblock","fontname","fontsize","bold","italic","underline","strikethrough","separator"], |
| 243 | | ["forecolor","hilitecolor","textindicator","separator"], |
| 244 | | ["subscript","superscript"], |
| 245 | | ["linebreak","justifyleft","justifycenter","justifyright","justifyfull","separator"], |
| 246 | | ["insertorderedlist","insertunorderedlist","outdent","indent","separator"], |
| 247 | | ["inserthorizontalrule","createlink","insertimage","inserttable","separator"], |
| 248 | | ["undo","redo"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]),["selectall"],["separator"], |
| 249 | | ["killword","removeformat","toggleborders","lefttoright", "righttoleft", "separator","htmlmode","about"] |
| | 297 | ["popupeditor"], |
| | 298 | ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"], |
| | 299 | ["separator","forecolor","hilitecolor","textindicator"], |
| | 300 | ["separator","subscript","superscript"], |
| | 301 | ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"], |
| | 302 | ["separator","insertorderedlist","insertunorderedlist","outdent","indent"], |
| | 303 | ["separator","inserthorizontalrule","createlink","insertimage","inserttable"], |
| | 304 | ["separator","undo","redo","selectall"], (HTMLArea.is_gecko ? [] : ["cut","copy","paste","overwrite","saveas"]), |
| | 305 | ["separator","killword","removeformat","toggleborders","lefttoright", "righttoleft","separator","htmlmode","about"] |
| 1115 | | // get the textarea |
| | 1219 | // create the editor framework, yah, table layout I know, but much easier |
| | 1220 | // to get it working correctly this way, sorry about that, patches welcome. |
| | 1221 | |
| | 1222 | this._framework = |
| | 1223 | { |
| | 1224 | 'table' :document.createElement('table'), |
| | 1225 | 'tbody' :document.createElement('tbody'), // IE will not show the table if it doesn't have a tbody! |
| | 1226 | 'tb_row' :document.createElement('tr'), |
| | 1227 | 'tb_cell' :document.createElement('td'), // Toolbar |
| | 1228 | |
| | 1229 | 'tp_row' :document.createElement('tr'), |
| | 1230 | 'tp_cell' :this._panels.top.container, // top panel |
| | 1231 | |
| | 1232 | 'ler_row' :document.createElement('tr'), |
| | 1233 | 'lp_cell' :this._panels.left.container, // left panel |
| | 1234 | 'ed_cell' :document.createElement('td'), // editor |
| | 1235 | 'rp_cell' :this._panels.right.container, // right panel |
| | 1236 | |
| | 1237 | 'bp_row' :document.createElement('tr'), |
| | 1238 | 'bp_cell' :this._panels.bottom.container,// bottom panel |
| | 1239 | |
| | 1240 | 'sb_row' :document.createElement('tr'), |
| | 1241 | 'sb_cell' :document.createElement('td') // status bar |
| | 1242 | } |
| | 1243 | |
| | 1244 | var fw = this._framework; |
| | 1245 | fw.table.border="0"; |
| | 1246 | fw.table.cellPadding="0"; |
| | 1247 | fw.table.cellSpacing="0"; |
| | 1248 | fw.tb_row.style.verticalAlign = 'top'; |
| | 1249 | fw.tp_row.style.verticalAlign = 'top'; |
| | 1250 | fw.ler_row.style.verticalAlign= 'top'; |
| | 1251 | fw.bp_row.style.verticalAlign = 'top'; |
| | 1252 | fw.sb_row.style.verticalAlign = 'top'; |
| | 1253 | |
| | 1254 | // Put the cells in the rows set col & rowspans |
| | 1255 | // note that I've set all these so that all panels are showing |
| | 1256 | // but they will be redone in sizeEditor() depending on which |
| | 1257 | // panels are shown. It's just here to clarify how the thing |
| | 1258 | // is put togethor. |
| | 1259 | fw.tb_row.appendChild(fw.tb_cell); fw.tb_cell.colSpan = 3; |
| | 1260 | |
| | 1261 | fw.tp_row.appendChild(fw.tp_cell); fw.tp_cell.colSpan = 3; |
| | 1262 | |
| | 1263 | fw.ler_row.appendChild(fw.lp_cell); |
| | 1264 | fw.ler_row.appendChild(fw.ed_cell); |
| | 1265 | fw.ler_row.appendChild(fw.rp_cell); |
| | 1266 | |
| | 1267 | fw.bp_row.appendChild(fw.bp_cell); fw.bp_cell.colSpan = 3; |
| | 1268 | |
| | 1269 | fw.sb_row.appendChild(fw.sb_cell); fw.sb_cell.colSpan = 3; |
| | 1270 | |
| | 1271 | // Put the rows in the table body |
| | 1272 | fw.tbody.appendChild(fw.tb_row); // Toolbar |
| | 1273 | fw.tbody.appendChild(fw.tp_row); // Left, Top, Right panels |
| | 1274 | fw.tbody.appendChild(fw.ler_row); // Editor/Textarea |
| | 1275 | fw.tbody.appendChild(fw.bp_row); // Bottom panel |
| | 1276 | fw.tbody.appendChild(fw.sb_row); // Statusbar |
| | 1277 | |
| | 1278 | // and body in the table |
| | 1279 | fw.table.appendChild(fw.tbody); |
| | 1280 | |
| | 1281 | |
| | 1282 | var htmlarea = this._framework.table; |
| | 1283 | this._htmlArea = htmlarea; |
| | 1284 | htmlarea.className = "htmlarea"; |
| | 1285 | |
| | 1286 | // create the toolbar and put in the area |
| | 1287 | var toolbar = this._createToolbar(); |
| | 1288 | this._framework.tb_cell.appendChild(toolbar); |
| | 1289 | |
| | 1290 | // create the IFRAME & add to container |
| | 1291 | var iframe = document.createElement("iframe"); |
| | 1292 | iframe.src = _editor_url + editor.config.URIs["blank"]; |
| | 1293 | this._framework.ed_cell.appendChild(iframe); |
| | 1294 | this._iframe = iframe; |
| | 1295 | |
| | 1296 | // creates & appends the status bar |
| | 1297 | var statusbar = this._createStatusBar(); |
| | 1298 | this._framework.sb_cell.appendChild(statusbar); |
| | 1299 | |
| | 1300 | // insert Xinha before the textarea. |
| 1250 | | // Calculate the starting size, EXCLUDING THE TOOLBAR & STATUS BAR (always) |
| 1251 | | var height = null; |
| 1252 | | var width = null; |
| 1253 | | |
| 1254 | | switch(this.config.height) |
| 1255 | | { |
| 1256 | | // "auto" means the same height as the original textarea |
| 1257 | | case 'auto' : { height = parseInt(this._ta_size.h); break; } |
| 1258 | | // otherwise we expect it to be a PIXEL height |
| 1259 | | default : { height = parseInt(this.config.height); break; } |
| 1260 | | } |
| 1261 | | |
| 1262 | | switch(this.config.width) |
| 1263 | | { |
| 1264 | | // toolbar means the width is the same as the toolbar |
| 1265 | | case 'toolbar': {width = parseInt(this._toolbar.offsetWidth); break; } |
| 1266 | | // auto means the same as the textarea |
| 1267 | | case 'auto' : {width = parseInt(this._ta_size.w); break; } |
| 1268 | | // otherwise it is expected to be a PIXEL width |
| 1269 | | default : {width = parseInt(this.config.width); break; } |
| 1270 | | } |
| 1271 | | |
| 1272 | | if (this.config.sizeIncludesToolbar) |
| 1273 | | { |
| 1274 | | // substract toolbar height |
| 1275 | | height -= this._toolbar.offsetHeight; |
| 1276 | | height -= this._statusBar.offsetHeight; |
| 1277 | | } |
| 1278 | | |
| 1279 | | // Minimal size = 100x100 |
| 1280 | | width = Math.max(width, 100); |
| 1281 | | height = Math.max(height,100); |
| 1282 | | |
| 1283 | | this.setInnerSize(width,height); |
| 1284 | | this.notifyOn('panel_change',function(){editor.setInnerSize();}); |
| 1285 | | |
| | 1381 | // Initalize size |
| | 1382 | editor.initSize(); |
| 1293 | | /** Size the htmlArea according to the available space |
| 1294 | | * Width and Height include toolbar! |
| 1295 | | **/ |
| 1296 | | |
| 1297 | | HTMLArea.prototype.getInnerSize = function() |
| 1298 | | { |
| 1299 | | return this._innerSize; |
| 1300 | | } |
| 1301 | | |
| 1302 | | HTMLArea.prototype.setInnerSize = function(width, height) |
| 1303 | | { |
| 1304 | | if(typeof width == 'undefined' || width == null) |
| 1305 | | { |
| 1306 | | width = this._innerSize.width; |
| 1307 | | } |
| 1308 | | |
| 1309 | | if(typeof height == 'undefined' || height == null) |
| 1310 | | { |
| 1311 | | height = this._innerSize.height; |
| 1312 | | } |
| 1313 | | |
| 1314 | | this._innerSize = {'width':width,'height':height}; |
| 1315 | | |
| 1316 | | var editorWidth = width; |
| 1317 | | var editorHeight = height; |
| 1318 | | var editorLeft = 0; |
| 1319 | | var editorTop = 0; |
| | 1390 | |
| | 1391 | /** |
| | 1392 | * Size the editor according to the INITIAL sizing information. |
| | 1393 | * config.width |
| | 1394 | * The width may be set via three ways |
| | 1395 | * auto = the width is inherited from the original textarea |
| | 1396 | * toolbar = the width is set to be the same size as the toolbar |
| | 1397 | * <set size> = the width is an explicit size (any CSS measurement, eg 100em should be fine) |
| | 1398 | * |
| | 1399 | * config.height |
| | 1400 | * auto = the height is inherited from the original textarea |
| | 1401 | * <set size> = an explicit size measurement (again, CSS measurements) |
| | 1402 | * |
| | 1403 | * config.sizeIncludesBars |
| | 1404 | * true = the tool & status bars will appear inside the width & height confines |
| | 1405 | * false = the tool & status bars will appear outside the width & height confines |
| | 1406 | * |
| | 1407 | */ |
| | 1408 | |
| | 1409 | HTMLArea.prototype.initSize = function() |
| | 1410 | { |
| | 1411 | var editor = this; |
| | 1412 | |
| | 1413 | var width = null; |
| | 1414 | var height = null; |
| | 1415 | switch(this.config.width) |
| | 1416 | { |
| | 1417 | case 'auto': |
| | 1418 | { |
| | 1419 | width = this._initial_ta_size.w; |
| | 1420 | } |
| | 1421 | break; |
| | 1422 | |
| | 1423 | case 'toolbar': |
| | 1424 | { |
| | 1425 | width = this._toolBar.offsetWidth; |
| | 1426 | } |
| | 1427 | break; |
| | 1428 | |
| | 1429 | default : |
| | 1430 | { |
| | 1431 | width = this.config.width; |
| | 1432 | } |
| | 1433 | break; |
| | 1434 | } |
| | 1435 | |
| | 1436 | switch(this.config.height) |
| | 1437 | { |
| | 1438 | case 'auto': |
| | 1439 | { |
| | 1440 | height = this._initial_ta_size.h; |
| | 1441 | } |
| | 1442 | break; |
| | 1443 | |
| | 1444 | default : |
| | 1445 | { |
| | 1446 | height = this.config.height; |
| | 1447 | } |
| | 1448 | break; |
| | 1449 | } |
| | 1450 | |
| | 1451 | this.sizeEditor(width, height, this.config.sizeIncludesBars, this.config.sizeIncludesPanels); |
| | 1452 | HTMLArea._addEvent(window, 'resize', function() { editor.sizeEditor() }); |
| | 1453 | this.notifyOn('panel_change',function(){editor.sizeEditor();}); |
| | 1454 | } |
| | 1455 | |
| | 1456 | /** |
| | 1457 | * Size the editor to a specific size, or just refresh the size (when window resizes for example) |
| | 1458 | * @param width optional width (CSS specification) |
| | 1459 | * @param height optional height (CSS specification) |
| | 1460 | * @param includingBars optional boolean to indicate if the size should include or exclude tool & status bars |
| | 1461 | */ |
| | 1462 | |
| | 1463 | HTMLArea.prototype.sizeEditor = function(width, height, includingBars, includingPanels) |
| | 1464 | { |
| | 1465 | if(includingBars != null) this._htmlArea.sizeIncludesToolbars = includingBars; |
| | 1466 | if(includingPanels != null) this._htmlArea.sizeIncludesPanels = includingPanels; |
| | 1467 | |
| | 1468 | if(width != null) |
| | 1469 | { |
| | 1470 | this._htmlArea.style.width = width; |
| | 1471 | if(!this._htmlArea.sizeIncludesPanels) |
| | 1472 | { |
| | 1473 | // Need to add some for l & r panels |
| | 1474 | var panel = this._panels.right; |
| | 1475 | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| | 1476 | { |
| | 1477 | this._htmlArea.style.width = this._htmlArea.offsetWidth + parseInt(this.config.panel_dimensions.right); |
| | 1478 | } |
| | 1479 | |
| | 1480 | var panel = this._panels.left; |
| | 1481 | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| | 1482 | { |
| | 1483 | this._htmlArea.style.width = this._htmlArea.offsetWidth + parseInt(this.config.panel_dimensions.left); |
| | 1484 | } |
| | 1485 | } |
| | 1486 | } |
| | 1487 | |
| | 1488 | if(height != null) |
| | 1489 | { |
| | 1490 | this._htmlArea.style.height = height; |
| | 1491 | if(!this._htmlArea.sizeIncludesToolbars) |
| | 1492 | { |
| | 1493 | // Need to add some for toolbars |
| | 1494 | this._htmlArea.style.height = this._htmlArea.offsetHeight + this._toolbar.offsetHeight + this._statusBar.offsetHeight; |
| | 1495 | } |
| | 1496 | |
| | 1497 | if(!this._htmlArea.sizeIncludesPanels) |
| | 1498 | { |
| | 1499 | // Need to add some for l & r panels |
| | 1500 | var panel = this._panels.top; |
| | 1501 | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| | 1502 | { |
| | 1503 | this._htmlArea.style.height = this._htmlArea.offsetHeight + parseInt(this.config.panel_dimensions.top); |
| | 1504 | } |
| | 1505 | |
| | 1506 | var panel = this._panels.bottom; |
| | 1507 | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| | 1508 | { |
| | 1509 | this._htmlArea.style.height = this._htmlArea.offsetHeight + parseInt(this.config.panel_dimensions.bottom); |
| | 1510 | } |
| | 1511 | } |
| | 1512 | } |
| | 1513 | |
| | 1514 | // At this point we have this._htmlArea.style.width & this._htmlArea.style.height |
| | 1515 | // which are the size for the OUTER editor area, including toolbars and panels |
| | 1516 | // now we size the INNER area and position stuff in the right places. |
| | 1517 | |
| | 1518 | width = this._htmlArea.offsetWidth; |
| | 1519 | height = this._htmlArea.offsetHeight; |
| | 1520 | |
| | 1521 | // Set colspan for toolbar, and statusbar, rowspan for left & right panels, and insert panels to be displayed |
| | 1522 | // into thier rows |
| 1321 | | |
| 1322 | | var panel = panels.right; |
| 1323 | | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| 1324 | | { |
| 1325 | | panel.div.style.position = 'absolute'; |
| 1326 | | panel.div.style.width = parseInt(this.config.panel_dimensions.right) + (HTMLArea.ie_ie ? -1 : -2) + 'px'; |
| 1327 | | panel.div.style.height = height + (HTMLArea.is_ie ? -1 : -1) + 'px'; |
| 1328 | | panel.div.style.top = '0px'; |
| 1329 | | panel.div.style.right = (HTMLArea.is_ie ? 1 : 2) + 'px'; |
| 1330 | | panel.div.style.padding = "0px"; |
| 1331 | | panel.div.style.overflow = "auto"; |
| 1332 | | panel.div.style.display = 'block'; |
| 1333 | | editorWidth -= parseInt(this.config.panel_dimensions.right) + (HTMLArea.is_ie ? 2 : 0); |
| | 1524 | var col_span = 1; |
| | 1525 | |
| | 1526 | if(panels.left.on && panels.left.panels.length && HTMLArea.hasDisplayedChildren(panels.left.container)) |
| | 1527 | { |
| | 1528 | col_span += 1; |
| | 1529 | if(!panels.left.container.parentNode) |
| | 1530 | { |
| | 1531 | this._framework.ler_row.insertBefore(panels.left.container,this._framework.ed_cell); |
| | 1532 | } |
| 1337 | | panel.div.style.display = 'none'; |
| 1338 | | } |
| 1339 | | |
| 1340 | | var panel = panels.left; |
| 1341 | | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| 1342 | | { |
| 1343 | | panel.div.style.position = 'absolute'; |
| 1344 | | panel.div.style.width = parseInt(this.config.panel_dimensions.left) + (HTMLArea.ie_ie ? -1 : -1) + 'px'; |
| 1345 | | panel.div.style.height = height + (HTMLArea.is_ie ? -1 : -1) + 'px'; |
| 1346 | | panel.div.style.top = '0px'; |
| 1347 | | panel.div.style.left = (HTMLArea.is_ie ? 0 : 0) + 'px'; |
| 1348 | | panel.div.style.padding = "0px"; |
| 1349 | | panel.div.style.overflow = "auto"; |
| 1350 | | panel.div.style.display = "block"; |
| 1351 | | editorWidth -= parseInt(this.config.panel_dimensions.left) + (HTMLArea.is_ie ? 2 : 0); |
| 1352 | | editorLeft = parseInt(this.config.panel_dimensions.left) + (HTMLArea.is_ie ? 2 : 0) + 'px'; |
| | 1536 | if(panels.left.container.parentNode) |
| | 1537 | { |
| | 1538 | panels.left.container.parentNode.removeChild(panels.left.container); |
| | 1539 | } |
| | 1540 | } |
| | 1541 | |
| | 1542 | if(panels.top.on && panels.top.panels.length && HTMLArea.hasDisplayedChildren(panels.top.container)) |
| | 1543 | { |
| | 1544 | if(!panels.top.container.parentNode) |
| | 1545 | { |
| | 1546 | this._framework.tp_row.appendChild(panels.top.container); |
| | 1547 | } |
| 1356 | | panel.div.style.display = 'none'; |
| 1357 | | } |
| 1358 | | |
| 1359 | | var panel = panels.top; |
| 1360 | | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| 1361 | | { |
| 1362 | | panel.div.style.position = 'absolute'; |
| 1363 | | panel.div.style.top = '0px'; |
| 1364 | | panel.div.style.left = '0px'; |
| 1365 | | panel.div.style.width = width + 'px'; |
| 1366 | | panel.div.style.height = parseInt(this.config.panel_dimensions.top) + 'px'; |
| 1367 | | panel.div.style.padding = "0px"; |
| 1368 | | panel.div.style.overflow = "auto"; |
| 1369 | | panel.div.style.display = "block"; |
| 1370 | | editorHeight -= parseInt(this.config.panel_dimensions.top); |
| 1371 | | editorTop = parseInt(this.config.panel_dimensions.top) + 'px'; |
| | 1551 | if(panels.top.container.parentNode) |
| | 1552 | { |
| | 1553 | panels.top.container.parentNode.removeChild(panels.top.container); |
| | 1554 | } |
| | 1555 | } |
| | 1556 | |
| | 1557 | if(panels.right.on && panels.right.panels.length && HTMLArea.hasDisplayedChildren(panels.right.container)) |
| | 1558 | { |
| | 1559 | col_span += 1; |
| | 1560 | if(!panels.right.container.parentNode) |
| | 1561 | { |
| | 1562 | this._framework.ler_row.insertBefore(panels.right.container, this._framework.ed_cell.nextSibling); |
| | 1563 | } |
| 1375 | | panel.div.style.display = 'none'; |
| 1376 | | } |
| 1377 | | |
| 1378 | | var panel = panels.bottom; |
| 1379 | | if(panel.on && panel.panels.length && HTMLArea.hasDisplayedChildren(panel.div)) |
| 1380 | | { |
| 1381 | | panel.div.style.position = 'absolute'; |
| 1382 | | panel.div.style.bottom = '0px'; |
| 1383 | | panel.div.style.left = '0px'; |
| 1384 | | panel.div.style.width = width + 'px'; |
| 1385 | | panel.div.style.height = parseInt(this.config.panel_dimensions.bottom) + 'px'; |
| 1386 | | panel.div.style.padding = "0px"; |
| 1387 | | panel.div.style.overflow = "auto"; |
| 1388 | | panel.div.style.display = "block"; |
| 1389 | | editorHeight -= parseInt(this.config.panel_dimensions.bottom); |
| | 1567 | if(panels.right.container.parentNode) |
| | 1568 | { |
| | 1569 | panels.right.container.parentNode.removeChild(panels.right.container); |
| | 1570 | } |
| | 1571 | } |
| | 1572 | |
| | 1573 | if(panels.bottom.on && panels.bottom.panels.length && HTMLArea.hasDisplayedChildren(panels.bottom.container)) |
| | 1574 | { |
| | 1575 | if(!panels.bottom.container.parentNode) |
| | 1576 | { |
| | 1577 | this._framework.bp_row.appendChild(panels.right.container); |
| | 1578 | } |
| 1393 | | panel.div.style.display = 'none'; |
| 1394 | | } |
| 1395 | | |
| 1396 | | // Set the dimensions of the container |
| 1397 | | this.innerEditor.style.width = width + 'px'; |
| 1398 | | this.innerEditor.style.height = height + 'px'; |
| 1399 | | this.innerEditor.style.position = 'relative'; |
| 1400 | | |
| 1401 | | // and the iframe |
| 1402 | | this._iframe.style.width = editorWidth + 'px'; |
| 1403 | | this._iframe.style.height = editorHeight + 'px'; |
| 1404 | | this._iframe.style.position = 'absolute'; |
| 1405 | | this._iframe.style.left = editorLeft; |
| 1406 | | this._iframe.style.top = editorTop; |
| 1407 | | |
| 1408 | | |
| 1409 | | // the editor including the toolbar now have the same size as the |
| 1410 | | // original textarea.. which means that we need to reduce that a bit. |
| 1411 | | this._textArea.style.width = editorWidth + 'px'; |
| 1412 | | this._textArea.style.height = editorHeight + 'px'; |
| 1413 | | this._textArea.style.position = 'absolute'; |
| 1414 | | this._textArea.style.left = editorLeft; |
| 1415 | | this._textArea.style.top = editorTop; |
| 1416 | | |
| 1417 | | this.notifyOf('resize', {'width':width,'height':height,'editorWidth':editorWidth,'editorHeight':editorHeight,'editorTop':editorTop,'editorLeft':editorLeft}); |
| | 1582 | if(panels.bottom.container.parentNode) |
| | 1583 | { |
| | 1584 | panels.bottom.container.parentNode.removeChild(panels.bottom.container); |
| | 1585 | } |
| | 1586 | } |
| | 1587 | |
| | 1588 | this._framework.tb_cell.colSpan = col_span; |
| | 1589 | this._framework.tp_cell.colSpan = col_span; |
| | 1590 | this._framework.bp_cell.colSpan = col_span; |
| | 1591 | this._framework.sb_cell.colSpan = col_span; |
| | 1592 | |
| | 1593 | // Put in the panel rows, top panel goes above editor row |
| | 1594 | if(!this._framework.tp_row.childNodes.length) |
| | 1595 | { |
| | 1596 | if(this._framework.tp_row.parentNode) |
| | 1597 | { |
| | 1598 | this._framework.tp_row.parentNode.removeChild(this._framework.tp_row); |
| | 1599 | } |
| | 1600 | } |
| | 1601 | else |
| | 1602 | { |
| | 1603 | if(!this._framework.tp_row.parentNode) |
| | 1604 | { |
| | 1605 | this._framework.tbody.insertBefore(this._framework.tp_row, this._framework.ler_row); |
| | 1606 | } |
| | 1607 | } |
| | 1608 | |
| | 1609 | // bp goes after the editor |
| | 1610 | if(!this._framework.bp_row.childNodes.length) |
| | 1611 | { |
| | 1612 | if(this._framework.bp_row.parentNode) |
| | 1613 | { |
| | 1614 | this._framework.bp_row.parentNode.removeChild(this._framework.bp_row); |
| | 1615 | } |
| | 1616 | } |
| | 1617 | else |
| | 1618 | { |
| | 1619 | if(!this._framework.bp_row.parentNode) |
| | 1620 | { |
| | 1621 | this._framework.tbody.insertBefore(this._framework.bp_row, this._framework.ler_row.nextSibling); |
| | 1622 | } |
| | 1623 | } |
| | 1624 | |
| | 1625 | // finally if the statusbar is on, insert it |
| | 1626 | if(this.config.statusBar) |
| | 1627 | { |
| | 1628 | if(!this._framework.sb_row.parentNode) |
| | 1629 | { |
| | 1630 | this._framework.table.appendChild(this._framework.sb_row); |
| | 1631 | } |
| | 1632 | } |
| | 1633 | else |
| | 1634 | { |
| | 1635 | if(this._framework.sb_row.parentNode) |
| | 1636 | { |
| | 1637 | this._framework.sb_row.parentNode.removeChild(this._framework.sb_row); |
| | 1638 | } |
| | 1639 | } |
| | 1640 | |
| | 1641 | // Size and set colspans, link up the framework |
| | 1642 | this._framework.lp_cell.style.width = this.config.panel_dimensions.left; |
| | 1643 | this._framework.rp_cell.style.width = this.config.panel_dimensions.right; |
| | 1644 | this._framework.tp_cell.style.height = this.config.panel_dimensions.top; |
| | 1645 | this._framework.bp_cell.style.height = this.config.panel_dimensions.bottom; |
| | 1646 | this._framework.tb_cell.style.height = this._toolBar.offsetHeight + 'px'; |
| | 1647 | this._framework.sb_cell.style.height = this._statusBar.offsetHeight + 'px'; |
| | 1648 | this._iframe.style.height = '100%'; |
| | 1649 | this._iframe.style.width = '100%'; |
| | 1650 | |
| | 1651 | this._textArea.style.height = '100%'; |
| | 1652 | this._textArea.style.width = '100%'; |