Monday, November 08, 2010 at 12:01 AM.

system.verbs.apps.Manila.windowTypes.types.manilaMessage.revert

on revert (adr, adradrwindow=nil) {
	
	local (atts);
	window.attributes.getAll (@atts, adr);
	if not defined (atts.msgnum) {
		dialog.alert ("Can't revert " + atts.title + " because it has never been saved.");
		return (false)};
	
	local (x, y, height, width);
	window.getPosition (adr, @x, @y);
	window.getSize (adr, @width, @height);
	delete (parentOf (adr^));
	
	local (flHomepage = false);
	bundle { //set flHomepage
		local (parts = string.urlSplit (atts.url));
		if not (parts[2] contains ":") {
			atts.url = parts[1] + parts[2] + ":80/" + parts[3]};
		if string.lower (atts.url) == nameOf (atts.adrSiteInfo^) {
			flHomepage = true}};
	
	local (adrType = parentOf (this^));
	adrType^.openMessage (nameOf (atts.adrSiteInfo^), atts.msgnum, true, flHomepage, adradrwindow);
	
	local (t); new (tableType, @t);
	t.type = nameOf (adrtype^);
	t.adrSiteInfo = atts.adrSiteInfo;
	t.msgnum = atts.msgnum;
	if Frontier.tools.windowTypes.findWindowWithMatchingAtts (@t, @adr) {
		edit (adr, atts.title, atts.flReadOnly);
		window.setSize (adr, width, height);
		window.setPosition (adr, x, y);
		return (true)};
	
	if adradrwindow != nil {
		adradrwindow^ = adr};
	
	return (false)};

bundle { //debugging
	revert (window.frontmost ())}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.