Special characters popup window (palette)

A popup window for web applications to insert XChars markup easily in text fields.

Usage

This maven 2 module can be used as a dependency by any other webapp:
<dependency>
	<groupId>uk.ac.ebi.xchars</groupId>
	<artifactId>xchars-palette</artifactId>
	<version>1.0</version>
	<type>war</type>
</dependency>
Specifying the type 'war' does the trick: every resource in this module - jsp, js, css, properties, gif - is imported, overlaying the war files. Note that this module's web.xml must be excluded from the overlay:
<build>
	...
	<plugins>
		<plugin>
			<groupId>
				org.apache.maven.plugins
			</groupId>
			<artifactId>
				maven-war-plugin
			</artifactId>
			<version>2.0</version>
			<configuration>
				<dependentWarExcludes>
					WEB-INF/web.xml
				</dependentWarExcludes>
			</configuration>
		</plugin>
	</plugins>
	...
</build>
In the dependent webapp, the popup window can be called using this javascript:
<script type="text/javascript" src="xcharsPalette/xcharsPopup.js" />
<form name="theForm">
	<textarea name="theTextarea">blah</textarea>
	<a href="javascript:openSpecialCharacterWindow('theForm', 'theTextarea');">
		xchars
	</a>
</form>
(or any onClick handler instead of this hyperlink)

Current limitations and issues

  • The javascript call must be done from a page at the root of the application context.