<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
		<meta name="generator" content="Adobe GoLive 7" />
		<title>HTML Help</title>
	</head>

	<body>
		<hr />
		<p>ADOBE SYSTEMS INCORPORATED</p>
		<p>Copyright 2000-2003 Adobe Systems Incorporated<br />
			All Rights Reserved</p>
		<p>NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms of the Adobe license agreement accompanying it. If you have received this file from a source other than Adobe, then your use, modification, or distribution of it requires the prior written permission of Adobe.</p>
		<hr />
		<p><b>Extension Name:</b> Tag Help</p>
		<p><b>Folder name:</b> TagHelp</p>
		<hr />
		<p><b>Description:</b></p>
		<p>This sample shows you help pages in a palette window depending on the current selected element in the current active markup document.</p>
		<hr />
		<p><b><u>Tag Help mapping file format<br />
				</u></b></p>
		<p>The GoLive extension <b>Tag Help</b> uses a mapping mechanism to generate a valid URL based on a given name, e.g. a tag name. All needed information for such a mapping is defined in mapping files in the subfolder <b>dat</b>. The file format of these mapping files is <b>XML</b>. This file must contain the element <b>urlmapping</b>. This element must contain the following sub elements:</p>
		<p><b>ident</b> : this element must have the following attributes:</p>
		<ul>
			<li><b>glue</b> : to identify the source context of the mapping</li>
			<li><b>displayname</b> : the name of the mapping</li>
			<li><b>baseurl</b> : an URL which can be used to generate complete URLs</li>
		</ul>
		<p><b>expression</b> : a JavaScript expression to generate complete URLs</p>
		<p>The element <b>mapping</b> is optional and can contain as many sub elements of the type <b>mappentry</b> as you need. A <b>mappentry</b> represents a simple mapping for a given name to another string.</p>
		<p></p>
		<p><u>How does the extension generate an URL<br />
			</u></p>
		<ol>
			<li>get a name from the document, e.g. the current selected tag name of a markup document</li>
			<li>try to find a mapping for this name in the <b>mapping</b> section of the mapping file</li>
			<li>evaluate the <b>expression</b> to generate the complete URL. For this the given <b>expression</b> is executed in a JavaScript sandbox. The <b>expression</b> could contain any JavaScript, additionally there are some variables available:</li>
		</ol>
		<ul>
			<ul>
				<li><b>thName</b> : the name found at 1.</li>
				<li><b>thMapped</b> : the mapped string from 2.</li>
				<li><b>thBase</b> : the base URL from the element <b>ident</b></li>
			</ul>
		</ul>
		<p>The result of the expression should be a complete valid URL which is loaded in the window.</p>
		<hr />
		<p><b>Module Definition:</b></p>
		<jsxmodule info="$$$/info=This extension displays reference information for the selected tag." name="TagHelp" debug="false" version="1.1" />
		<p><b>Scripts:</b></p>
		<script><!--
		////////////////////////////////////////////////////////////////////////////////
		//
		// globals
		//
		var thDataBase = new Array();
		var thDataBaseName	= "";
		var thDataBaseBaseURL = "";
		var thLinkCreator		= "";
		
		var thUseTimer = false;
		
		var thLastLink = "";
		
		var thLoadState = false;
		var thBusyTimer = -1;
		
		var thModuleInit = false;
		
		var thWindow = null;
		
		var thMenuLastActive = "";
		
		var thTempFile = null;
		
		var thWSPageCreation = false;

		////////////////////////////////////////////////////////////////////////////////
		//
		//	init extension
		//
		function startModule()
		{
			thWindow = dialogs['TagHelpPalette'];
			
			//
			// switch on tracing in debug mode
			//
			if( module.debug == true )
				module.trace = true;

			//
			// read extensions preferences
			//
			readPrefs();

			// 
			// install menu item into help menu
			//
			menus['help'].addItem( "-", "-" );
			var menuItem = menus['help'].addChild( "item", "openPalette", module.localize("$$$/title=Tag Help") );

			//
			// menu events
			//
			menuItem.addEventListener
			(
				'menuSetup',
				
				function( evObj )
				{
					evObj.target.enabled = true;
					evObj.target.checked = thWindow != null && thWindow.visible;
				}
			);

			menuItem.addEventListener
			(
				'menuSignal',
				
				function( evObj )
				{
					if( thWindow == null )
						createWindow();
						
					thWindow.visible = !thWindow.visible;
					
					if( thWindow.visible )
						setPreviewContent( module.folder.absurl + "/Default.html" );
				}
			);

			//
			// create window
			//
			initWindow();

			if( thWindow.visible )
				setPreviewContent( module.folder.absurl + "/Default.html" );
			
			thModuleInit = true;
		}

		///////////////////////////////////////////////////////////////////////////////
		//
		// exit extension
		//
		
		function terminateModule()
		{
			//
			// write extensions preferences
			//
			writePrefs();

			//
			// remove temp file
			//
			if( thTempFile != null && thTempFile.exists )
				thTempFile.remove();
		}
				
		////////////////////////////////////////////////////////////////////////////////
		//
		// document events
		//
		function initializeModule()
		{
			//
			// on switching document
			//
			app.addEventListener( 'view',		trackingNewDocument, true );
			app.addEventListener( 'activate',	trackingNewDocument, true );
			app.addEventListener
			( 
				'opened',
				
				function( evObj )
				{
					evObj.document.addEventListener( 'selection', trackingNewDocument );
					trackingNewDocument( evObj );
				}
			);
			
			//
			// on close document
			//
			app.addEventListener
			( 
				'close',
				
				function( evObj )
				{
					setPreviewContent( module.folder.absurl + "/Default.html" );
				}
				
				, true
			);
		}
		
		//
		// content for preview changed
		//
		function trackingNewDocument( evObj )
		{
			if( thUseTimer && thModuleInit )
				showElementHelp();
		}
//-->
</script>
		<script src="ui.js"></script>
		<script src="preference.js"></script>
		
		<script src="view.js"></script>
		<script src="init.js"></script>
		<script src="scan.js"></script>
		<script src="debug.js"></script>
		<script src="hcjp.js"></script>
		<hr />
		<p><b>User interface</b></p>
		<jsxpalette name="TagHelpPalette" title="$$$/title=Tag Help" width="220" height="395" winmenu="false" minheight="100" >
			<jsxcontrol height="20" name="refresh" posx="7" posy="365" type="button" valign="bottom" value="Refresh" width="60"></jsxcontrol>
			 
			<jsxcontrol halign="scale" height="340" name="preview" posx="10" posy="10" type="preview" valign="scale" value="" width="200"></jsxcontrol>
			 
			<jsxcontrol halign="scale" height="350" name="frame" posx="5" posy="5" type="frame" valign="scale" value="" width="210"></jsxcontrol>
			<jsxlayoutline direction="false" x="70" y="365" length="20"/>
			
			<jsxmenu name="paletteMenu">
				<jsxitem name="useTimer" dynamic="true" title="$$$/autoupdate=Automatic Update" />
				<jsxitem name="-" title="-" />
			</jsxmenu>
		</jsxpalette>
		<p></p>
	</body>

</html>