htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Small TableOperations patch


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


Hipikat
User

Jan 12, 2005, 11:00 PM

Post #1 of 1 (2367 views)
Shortcut
Small TableOperations patch Can't Post

It's always annoyed me that one can create a table in htmlArea, and because it doesn't have any explicit properties, it defaults to a normally border'd table... But upon going to Table Properties, not changing anything, and hitting 'Ok', everything that was specified in that dialog is assumed, including the lack of borders.

The attached patch, at least for IE, defaults table border properties to what the default border properties are, if they're missing when the Table Properties dialog is opened.

Gecko, however, seems to be another story. I don't know how to fix that and don't really have time to try any more at the moment, but if anyone else can do it I'd be infinitely appreciative =)


Code
*************** 
*** 158,163 ****
var f_spacing = table.cellSpacing;
! var f_padding = table.cellPadding;
var f_borders = table.border;
! var f_frames = table.frame;
! var f_rules = table.rules;

--- 158,163 ----
var f_spacing = table.cellSpacing;
! var f_padding = table.cellPadding ? table.cellPadding : '1';
var f_borders = table.border;
! var f_frames = table.frame ? table.frame : 'box';
! var f_rules = table.rules ? table.rules : 'all';

***************
*** 1072,1073 ****
--- 1072,1074 ----
(currentBorderStyle.match(/([^\s]*)\s/)) && (currentBorderStyle = RegExp.$1);
+ if (!currentBorderStyle) currentBorderStyle = "outset";
for (var i in options) {
***************
*** 1098,1099 ****
--- 1099,1101 ----
input.value = TableOperations.getLength(el.style.borderWidth);
+ if ( !input.value ) input.value = '1';
input.size = "5";

Attachments: tableop-borderfix.diff (0.99 KB)
  table-operations.js (35.0 KB)

 
 
 


Search for (options)