/*
 * $Id: StringBufferResourceStream.java 3307 2005-11-30 15:57:34 -0800 (Wed, 30
 * Nov 2005) ivaynberg $ $Revision: 3307 $ $Date: 2005-11-30 15:57:34 -0800
 * (Wed, 30 Nov 2005) $
 * 
 * ==============================================================================
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package wicket.extensions.util.resource;

import wicket.util.string.Strings;

/**
 * Decorates the template with javascript tags.
 * 
 * @author Eelco Hillenius
 */
public final class JavaScriptTemplate extends TextTemplateDecorator
{
	private static final long serialVersionUID = 1L;

	/** Start tag for JavaScript body. */
	private static final String JAVASCRIPT_START_TAG = "<script type=\"text/javascript\">"
			+ Strings.LINE_SEPARATOR;

	/** End tag for JavaScript body. */
	private static final String JAVASCRIPT_END_TAG = Strings.LINE_SEPARATOR + "</script>";

	/**
	 * Construct.
	 * 
	 * @param textTemplate
	 *            The template to decorate
	 */
	public JavaScriptTemplate(TextTemplate textTemplate)
	{
		super(textTemplate);
	}

	/**
	 * @see wicket.extensions.util.resource.TextTemplateDecorator#getBeforeTemplateContents()
	 */
	@Override
	public String getBeforeTemplateContents()
	{
		return JAVASCRIPT_START_TAG;
	}

	/**
	 * @see wicket.extensions.util.resource.TextTemplateDecorator#getAfterTemplateContents()
	 */
	@Override
	public String getAfterTemplateContents()
	{
		return JAVASCRIPT_END_TAG;
	}
}
@@ -887,22 +887,30 @@
 .string.
-String
+JavascriptUtil
 s;%0A%0A/**%0A
@@ -1117,291 +1117,8 @@
 L;%0A%0A
-%09/** Start tag for JavaScript body. */%0A%09private static final String JAVASCRIPT_START_TAG = %22%3Cscript type=%5C%22text/javascript%5C%22%3E%22%0A%09%09%09+ Strings.LINE_SEPARATOR;%0A%0A%09/** End tag for JavaScript body. */%0A%09private static final String JAVASCRIPT_END_TAG = Strings.LINE_SEPARATOR + %22%3C/script%3E%22;%0A%0A
 %09/**
@@ -1463,23 +1463,34 @@
 rn J
-AVA
+avascriptUtils.
 SCRIPT_
-START
+OPEN
 _TAG
@@ -1665,21 +1665,35 @@
 rn J
-AVA
+avascriptUtils.
 SCRIPT_
-END
+CLOSE
 _TAG

use javascript util