<% 'abitwhizzy.asp - whizzywig web page editor, demonstrating whizzywig.js 'Copyright © 2005, John Goodman - john.goodman(at)unverse.net *date 051108 - This program is free software you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GNU General Public License can be obtained at: http:'www.gnu.org/licenses/gpl.html 'CONFIGURE HERE ==================================================================== const whizzywig = "inc/whizzywig.js" ' path to whizzywig.js required const cssFile = "inc/0.css" ' choose your stylesheet, or set to "" const buttonPath = "btn/" ' toolbar images live here. "" for text buttons const imageBrowse = "" ' "" for no image browser const linkBrowse = "" ' "" for no link browser const toolbar = "formatblock bold italic color bullet number image link clean html" 'try "all" if you need more const editarea = "width:100%; height:80%" 'css to size/format editarea const xhtml = "" 'path to xhtml converter, or set to "" for HTML 4.01 'END CONFIG ======================================================================== const version="" response.buffer=true set f = Request("f") if Request("action") = "save" then 'write page and go there edited = Request("edited") if xhtml <> "" then html = "" & vbLf html = html & "" & vbLf &"" &vbLf else html = "" & vbLf html = html & "" & vbLf & "" & vbLf end if html = html & "" & Request("t") & "" & vbLf if cssFile <> "" then html = html & " "" then html = html & """ \>" else html = html & """>" end if html = html & vbLf end if html = html & "" & vbLf & "" & vbLf html = html & edited html = html & vbLf & "" & vbLf & "" & version set fs=Server.CreateObject("Scripting.FileSystemObject") set page=fs.CreateTextFile(Server.MapPath(f),true) page.Write(html) page.Close Response.Redirect(f) else if f <> "" then const openForReading = 1 fileName = Server.Mappath(f) set fso = Server.CreateObject("Scripting.FileSystemObject") if fso.FileExists(filename) then set fp = fso.GetFile(fileName) set txtStream = fp.OpenAsTextStream(openForReading) do while not txtStream.AtEndOfStream strText = txtStream.ReadLine content= content & strText loop txtStream.Close title = "" set re = New RegExp re.Pattern = ".*([^<]*)<\/title>.*" re.IgnoreCase = True re.Global = False title = re.Replace(content,"$1") 'grab the title else Response.Write(f & " not found") end if end if end if %> <html> <head> <title>aBitWhizzy: the Whizzywig page editor <% if xhtml <> "" then response.write "" end if %>
" method="post" >

More about this free editor at unverse.net

<% response.write version %>