% ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' HTML Editor v1.1 ' Infolink ' Carlos A. Madrigal ' ' This is a What You See Is What You Get HTML Editor that runs in a normal web page. It uses ' the capabilities of Microsoft Internet Explorer for PC to edit HTML. ' ' With this tool, users can edit content in an easy way: ' ' June 11, 2002 ' I added the following features: ' · Native support for browsers that not support HTML editing. ' · HTML source code view. ' · Image support. ' · Color support. ' ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Const TA_ROWS = 35 ' Rows used when rendering text area controls Const TA_COLS = 80 ' Cols used when rendering text area controls Dim g_bIsBrowserCapable ' Tells if browser is capable of displaying the HTML Editor ' Initialize HTML Editor HTMLInit ' Checks browser version and determines if the browser is able to display the HTML Editor. Sub HTMLInit() Dim sUserAgent, i, j ' Initialize variables g_bIsBrowserCapable = False ' Read browser identification string sUserAgent = Request.ServerVariables("HTTP_USER_AGENT") ' Check if we are talking about Internet Explorer 4.0+ i = InStr(1, sUserAgent, "MSIE") If i > 0 Then ' Browser is IE, check version j = InStr(i, sUserAgent, ";") sUserAgent = Mid(sUserAgent, i+4, j-i-4) g_bIsBrowserCapable = CDbl(sUserAgent) >= 4.0 End If sUserAgent = Request.ServerVariables("HTTP_USER_AGENT") mac = InStr(1, sUserAgent, "Mac_PowerPC") If mac > 0 Then g_bIsBrowserCapable = False End If End Sub ' Renders a HTML Editor control. Both, HtmlEdit and HtmlEdit2 do the same. ' ' sName This is the name of a hidden variable where data is copied to and from. ' sJSObjectName This is the name of the control while in Javascript. ' iHeight Control height. ' sImageFolder Folder where images are located. Use vbNullstring if no images are used for this control. ' sImageList A comma-delimited list of file names that are going to be displayed in the control. Use ' GenerateImageList to dynamically generate lists from files stored in a web site folder. ' ' For sakes of simplicity and backwards compatibility, I made two functions for the same purpose. HtmlEdit is the older ' one. This should work with older implementations of HtmlEdit. Use this one if you don't require image support. HtmlEdit2 ' is the newest and fully implemented function, use this one when you require image support. Sub HtmlEdit(sName, sJSObjName, iHeight) HtmlEdit2 sName, sJSObjName, iHeight, vbNullString, vbNullString End Sub Sub HTMLEdit2(sName, sJSObjName, iHeight, sImageFolder, sImageList) If g_bIsBrowserCapable Then%>