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 - Add-Ons:
Fix for ListType plugin


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.

 


paulbaranowski
New User

Sep 26, 2004, 11:02 PM

Post #1 of 1 (4404 views)
Shortcut
Fix for ListType plugin Can't Post

The ListType plugin does not correctly position the ordered list dropdown all the time. Below is a fix for this problem.

Only two lines changed:
if (a[j] == "orderedlist") {
and
a.splice(j+1, 0, "space", "ListType", "space");


Code
function ListType(editor) { 
this.editor = editor;
var cfg = editor.config;
var toolbar = cfg.toolbar;
var self = this;
var i18n = ListType.I18N;
var options = {};
options[i18n["Decimal"]] = "decimal";
options[i18n["Lower roman"]] = "lower-roman";
options[i18n["Upper roman"]] = "upper-roman";
options[i18n["Lower latin"]] = "lower-alpha";
options[i18n["Upper latin"]] = "upper-alpha";
if (!HTMLArea.is_ie)
// IE doesn't support this property; even worse, it complains
// with a gross error message when we tried to select it,
// therefore let's hide it from the damn "browser".
options[i18n["Lower greek"]] = "lower-greek";
var obj = {
id : "ListType",
tooltip : i18n["ListStyleTooltip"],
options : options,
action : function(editor) { self.onSelect(editor, this); },
refresh : function(editor) { self.updateValue(editor, this); },
context : "ol"
};
cfg.registerDropdown(obj);
var a, i, j, found = false;
for (i = 0; !found && i < toolbar.length; ++i) {
a = toolbar;
for (j = 0; j < a.length; ++j) {
if (a[j] == "orderedlist") {
found = true;
break;
}
}
}
if (found)
a.splice(j+1, 0, "space", "ListType", "space");
};


 
 
 


Search for (options)