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:
Plug in Problems


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.

 


brian
New User

Nov 22, 2004, 10:29 AM

Post #1 of 3 (6676 views)
Shortcut
Plug in Problems Can't Post

I am using HTMLAREA 3 RC1 and have added Plugins, TableOperations, DynamicCSS and InsertPicture but have a problem.

The Insert Picture Plugin works as expected in both Netscape 7.2 and IE6 and as I have used similar lines of code to apply the others I'm sure I have set them up correctly. However, DynamicCss shows but is greyed out. The same applies to Table Opertaions, although in this case I can get the table functions to work a little in Netscape insofar as adding a table then makes the Table Properties available but not the other functions no matter what I do within the table. Furthermore the undo command ceases to work. In IE6 they remain greyed out.

Can anyone shed any light on what may be wrong?


brian
New User

Nov 24, 2004, 4:39 AM

Post #2 of 3 (6620 views)
Shortcut
Re: [brian] Plug in Problems [In reply to] Can't Post

I have done some further experimentation and find that some plugins will not work in association with others. It may be that I'm wrongly coding the association with the plugin, so, can someone please clarify.

HTMLArea in in a folder named HTMLArea and the Plugins in a sub folder named Plugins i.e. HTMLArea/Plugins. Each plugin has its default name and is in its own directory within the plugins folder. My typical code will look a bit like this:

<script type="text/javascript">
<!--
// HTMLArea settings

_editor_url = "htmlarea/";
_editor_lang = "en";
_width_multiplier = 12;
_height_multiplier = 25;
_editor_toolbar = [
[ "fontname", "space",
"fontsize", "space",
"formatblock", "space",
"bold", "italic", "underline", "strikethrough", "separator",
"subscript", "superscript", "separator",
"copy", "cut", "paste", "space", "undo", "redo" ],

[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"lefttoright", "righttoleft", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
"popupeditor", "separator", "showhelp", "about" ]
];
var EW_HTMLArea = [];
//-->
</script>
<script type="text/javascript" src="htmlarea/htmlarea.js"></script>
<script language="JavaScript" type="text/javascript">
// add plugins
HTMLArea.loadPlugin("DynamicCSS");
HTMLArea.loadPlugin("InsertPicture");
HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("ContextMenu");
HTMLArea.loadPlugin("FindReplace");
HTMLArea.loadPlugin("CharacterMap");
HTMLArea.loadPlugin("QuickTag");
HTMLArea.loadPlugin("TableToggleBorders");
</script>

more html..... then a form including

<textarea cols="50" rows="16" id="x_bodytext" name="x_bodytext"><%= x_bodytext %></textarea>
<script type="text/javascript">
// Replace TextArea with HTMLArea
var config = new HTMLArea.Config();
config.toolbar = _editor_toolbar;
config.width = 50*_width_multiplier + 'px';
config.height = 16*_height_multiplier + 'px';
var ta = HTMLArea.getElementById("textarea", "x_bodytext");
var ha = ta ? (new HTMLArea(ta, config)) : null;
ha.pageStyle = "@import url(css/taxiadmin.css);";
ha.registerPlugin(DynamicCSS);
ha.registerPlugin(InsertPicture);
ha.registerPlugin(TableOperations);
ha.registerPlugin(ContextMenu);
ha.registerPlugin(FindReplace);
ha.registerPlugin(CharacterMap);
ha.registerPlugin(QuickTag);
ha.registerPlugin(TableToggleBorders);
if (ha) {
ha.generate();
EW_HTMLArea.push(ha);
}

I cannot get Table Operations, TableToggleBorders or DynamicCss to work at all, even if they are the only plugin added. Insert Picture, CharacterMap and FindReplace work as expected and Quick Tags appears to work by bringing up the pop up but fails to insert the text onto the page.

Any help gratefully appreciated.


brian
New User

Nov 26, 2004, 10:25 AM

Post #3 of 3 (6425 views)
Shortcut
Re: [brian] Plug in Problems [In reply to] Can't Post

I really want to get to the bottom of this problem and thought that perhaps some features cause problems with others. So, I created two tables in Access, one for the buttons and the other for the plugins.

TblHTMLAreaButtons with attributes

ID_Button - AutoNumber
Name - Text
Switch - Yes/No
AddSpaceAfter - Yes/No
AddSeperatorAfter - Yes/No
AddLineBreakAfter - Yes/No

And TblHTMLAreaPlugins with attributes

ID_Plugin - AutoNumber
Plugin - Text
Comments - Memo
ExtraText - Memo
Switch - Yes/No

I then have two asp pages which are included in the page I wish to use HTMLArea

<!--#include file="Subs/SubHAButtons.asp"-->
<!--#include file="Subs/SubHAPlugins.asp"-->
<% 'Call the subs for HTMLArea
Call GetButtons()
Call GetPlugins()
%>

Next replace the usual HTMLArea stuff with

<script type="text/javascript">
<!--
// HTMLArea settings

_editor_url = "htmlarea/";
_editor_lang = "en";
_width_multiplier = 12;
_height_multiplier = 25;
_editor_toolbar = [<%=strbuttons%>];
var EW_HTMLArea = [];
//-->
</script>

and

<script type="text/javascript">
// Replace TextArea by HTMLArea
var config = new HTMLArea.Config();
config.toolbar = _editor_toolbar;
config.width = 50*_width_multiplier + 'px';
config.height = 16*_height_multiplier + 'px';
var ta = HTMLArea.getElementById("textarea", "x_bodytext");
var ha = ta ? (new HTMLArea(ta, config)) : null;
// Register plugins from SubHTMLAreaPluguns.asp
<%=StrExtraText %>
<%=StrRegister%>
if (ha)
{
ha.generate();
EW_HTMLArea.push(ha);
}
</script>

<% ' Subs/SubHAButtons.asp
' This sub generates the selected HTMLArea buttons for use on the page
Sub GetButtons()
' Open connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
' Build SQL
sSql = "SELECT TblHTMLAreaButtons.ID_Button, TblHTMLAreaButtons.Name, TblHTMLAreaButtons.[Switch], TblHTMLAreaButtons.Add_Space_After, TblHTMLAreaButtons.Add_Seperator_After, TblHTMLAreaButtons.Add_Line_Break_After FROM TblHTMLAreaButtons"
sSql = sSql & " WHERE (TblHTMLAreaButtons.[Switch] = yes)"
' Set up Record Set
Set rsBut = Server.CreateObject("ADODB.Recordset")
rsBut.CursorLocation = 3
rsBut.Open sSql, conn, 1, 2
If Not rsBut.Eof Then
rsBut.MoveFirst
End If
'response.Write("[")
strbuttons = "["
Do While (Not rsBut.Eof)
x_ID_Button = rsBut("ID_Button")
x_Name = rsBut("Name")
x_Switch = rsBut("Switch")
x_Add_Space_After = rsBut("Add_Space_After")
x_Add_Seperator_After = rsBut("Add_Seperator_After")
x_Add_Line_Break_After = rsBut("Add_Line_Break_After")
'Response.Write(q& x_Name &q)
strbuttons = strbuttons & q& x_Name &q
If x_Add_Space_After = True Then
'Response.Write(","&q&"space"&q)
strbuttons = strbuttons & ","&q&"space"&q
End If
If x_Add_Seperator_After = True Then
'Response.Write(","&q&"separator"&q)
strbuttons = strbuttons & ","&q&"separator"&q
End If
If x_Add_Line_Break_After = True Then
'Response.Write("],[")
strbuttons = strbuttons & "],["
End If
rsBut.MoveNext
if not rsBut.EOF AND x_Add_Line_Break_After = False Then
'Response.Write(",")
strbuttons = strbuttons & ","
end if
Loop
'response.Write("]")
strbuttons = strbuttons & "]"
' Close recordset and connection
rsBut.Close
Set rsBut = Nothing
conn.Close
Set conn = Nothing
end sub
%>

<% ' Subs/SubHAPlugins.asp
Sub GetPlugins()
' Open connection to the database
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open xDb_Conn_Str
' Build SQL
sSql = "SELECT TblHTMLAreaPlugin.ID_Plugin, TblHTMLAreaPlugin.Plugin, TblHTMLAreaPlugin.Comments, TblHTMLAreaPlugin.ExtraText, TblHTMLAreaPlugin.[Switch] FROM TblHTMLAreaPlugin"
sSql = sSql & " WHERE (TblHTMLAreaPlugin.[Switch] = yes)"
' Set up Record Set
Set rs = Server.CreateObject("ADODB.Recordset")
rs.CursorLocation = 3
rs.Open sSql, conn, 1, 2
nTotalRecs = rs.RecordCount
If Not rs.Eof Then
rs.MoveFirst
End If
Do While (Not rs.Eof)
x_ID_Plugin = rs("ID_Plugin")
x_Plugin = rs("Plugin")
x_Comments = rs("Comments")
x_ExtraText = rs("ExtraText")
x_Switch = rs("Switch")

If x_Switch = True Then
StrExtraText = StrExtraText & x_ExtraText
StrPlugins =StrPlugins & ("HTMLArea.loadPlugin(" &q& x_Plugin &q& ");")
StrRegister = StrRegister & ("ha.registerPlugin("& x_Plugin &");")
End if
rs.MoveNext
StrExtraText = StrExtraText &Vbcrlf
StrPlugins = StrPlugins &Vbcrlf
StrRegister = StrRegister &vbcrlf
Loop

' Close recordset and connection
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
End sub
%>

The result is that I can now turn on or off any button and any Plugin to monitor the effect. Sadly, although this may well be useful I have not yet found an answer to my problem.

 
 
 


Search for (options)