Ms Wiki

MsWiki is a wiki (or at least a Wiki-like system) built using ASP and client-side JScript. It is designed to run in an essentially 100% Microsoft intranet environment. The primary goal was to do a wiki that used MicrosoftFrontPage for WYSIWYG editing.

Since editing is WYSIWYG (as much as possible using HTML), most of the traditional Wiki text formatting code is not needed. Right now MsWiki only does special formatting for links, although in the future it may support other special formatting.

In order to facilitate working with MicrosoftFrontPage, each page needs to be an HTML file, which precludes server side processing for formatting the links. Instead, MsWiki does all the formatting on the client-side, using JScript. This is either very cool or very kludgey depending on how you look at it. One big advantage of doing the text formatting in JScript over server-side VBScript is that JScript has half way decent regular expression support.

Page creation is handled in ASP as will be Recent Changes support when I get that implemented.

-- CurtisBartley


I haven't released anything yet. I may sometime in the future, assuming time and my employer permit. So far very little of what I've done is rocket science, and I'll explain that part.

There's nothing interesting about the ASP. The JScript used on the client side is more notable. There's some example prototype code at http://www.almostinfinite.com/preprocess.htm. As you might suspect, you'll need IE 4.0 or above to see it work. After the page has loaded, view source to see how the reformatting works. Here's a simplified (and partly omitted example). The interesting part is the "<SCRIPT FOR=window...>" section. This script segment is executed after the page finishes loading. The code which actually does the reformatting is the statement

	body.innerHTML = Reformat(body.innerHTML);

The innerHTML attribute is the raw HTML code that appears between the <body> and </body> tags. When you set it to a new value, IE reparses, and displays the new text.

	<html>
	<head>
		<title>This Is a Test</title>
	<script>
		function Reformat(html)
		{
			[[[ lots of interesting code ]]]
			return reformattedHTML;
		}
	</script>
	<SCRIPT FOR=window EVENT=onload LANGUAGE="JScript">
		body.innerHTML = Reformat(body.innerHTML);
	</SCRIPT>
	</head>
	<body id=body>
		[[[ body HTML ]]]
	</body>
	</html>

-- CB


...As you might suspect, you'll need IE 4.0 or above to see it work.

Has the WorldWideWeb come to this? I can read the real WikiWikiWeb from lynx or Netscape or w3 or IE3 or IE4, on NT or Linux or MacOs... Please note above that this particular wiki is intended for use on a corporate intranet where everybody already has IE. I'd be perfectly happy to do a browser-agnostic solution if such were possible, though.

It is. ASP code gets processed strictly on the server and generates nothing but HTML to the browser. The browser can be IE or Netscape or anything. It's the server that has to be IIS. But there are products like ChiliSoft? that implement ASP on many servers including Apache and Netscape. err, what he's complaining about is the JavaScript code served to allow the WYSIWYG editing I don't see any way to do a browser agnostic client and still support WYSIWYG editing using MicrosoftFrontPage (or any other WYSIWYG editor for that matter). Might be possible, but I'm not sure how.

You can't be totally browser agnostic and still support WYSIWYG. However, you can provide both an agnostic version and a WYSIWYG version, and have the server pick the proper version based on requesting browser. That's what I do when I want to support browser specific features.

I wanted to see the whole thing because I don't understand how a wiki in general is implemented. MsWiki probably wouldn't be a good example. I'd recommend taking a look at the PyWiki code. -- cb


I think that not much would be gained by having WysiWyg editing. The strength of wiki seems to be in its lightness. I have deployed several instantiations of a home grown MsWiki for various project teams and have had no negative feedback on using the elementary markup. Several folks suggested table formatting.

I would be happy to share the ASP code, but alas, I am trapped behind the firewall. Any ideas on collaboration?

-- JimBrosnan


We used TimVoght's PyWiki initially, which works pretty much like this one. That experiment was successful as a proof of concept, but we were just about to bring our MicrosoftFrontPage/Office 2000 Web server on-line, and I did not believe that PyWiki would survive the competition. Only a few of us used PyWiki, so I wanted something that more people on our development team would use. And to be perfectly honest, I wanted WYSIWYG editing capability myself, so I wasn't sure I'd use PyWiki once FP became an option. One final factor was that PyWiki was so slow.

I would like to release the stuff I have at some point, but I'd like to spend another month or two refining it. In the meantime if anybody else wants to something similar, I'd be happy to share what I know so far.

-- CB


See http://msdn.microsoft.com/downloads/samples/internet/browser/editcntrl/default.asp# for an interesting example of how Microsoft approaches the WysiWyg editing problem. -- JB

Yup. The IE5 engine can also be used as an editor (Outlook Express and Visual InterDev? are both built on top of it, as is Vizact, a program I worked on when I was at Microsoft. Interestingly, most, if not all of the editing functionality can be accessed through script (VBScript or JScript). This is pretty cool, as long as you don't CutAgainstTheGrain?. -- CB


You might be interested in this experimental page that uses IE's (v. 4+) TextRange object and methods to accomplish in-situ WYSIWYG editing: http://standardbrains.editthispage.com/. Jeff Yates has recently (April '01) written a DOM Range emulator in JavaScript, for implementing the same kind of in-the-browser WYSIWYG editing in Mozilla/NS6 - see http://www.pbwizard.com/Articles/Moz_Range_Object_Article.htm. The Range interface is a W3C DOM Level 2 standard, but the Mozilla implementation is still very incomplete and buggy; thus Jeff's patch.

The advantages over other solutions (such as the MSHTML 'edit-mode' in IE 5.5, replacing the IE4+ 'design-mode') are a certain degree of cross-browser and cross-version-number compatibility, greater flexibility in designing a custom UI, and low scripting overhead. -- Derek Robinson


See WysiwygWiki, WikiWikiClone, GroupWare


CategoryWikiImplementation

EditText of this page (last edited November 30, 2005) or FindPage with title or text search