% \subsubsection{JavaScript}

% \DescribeEnv{javascript}{Code inside a javascript environment is printed on paper, but executed on the web.}

%    \begin{macrocode}
%<*classXimera>
\DefineVerbatimEnvironment{javascript}{Verbatim}{numbers=left,frame=lines,label=JavaScript,labelposition=topline}
%</classXimera>
%    \end{macrocode}

%    \begin{macrocode}
%<*htXimera>
% for programming javascript
\renewenvironment{javascript}{\NoFonts}{\EndNoFonts}
\ScriptEnv{javascript}{\stepcounter{identification}\ifvmode \IgnorePar\fi \EndP\HCode{<div class="javascript" id="javascript\arabic{identification}"><script type="text/javascript">}\HtmlParOff}{\HtmlParOn\HCode{</script></div>}}
%</htXimera>
%    \end{macrocode}

% \DescribeMacro{\js}{Code inside a |\js| macro is evaluated and replaced with its value.}
%    \begin{macrocode}
%<*classXimera>
\def\js#1{\mbox{\texttt{\detokenize{#1}}}}
%</classXimera>
%    \end{macrocode}

%    \begin{macrocode}
%<*htXimera>
\def\js#1{\stepcounter{identification}\HCode{<span class="inline-javascript" id="javascript\arabic{identification}"><script type="text/javascript"> function javascript\arabic{identification}() }\{\HCode{ return \detokenize{#1}; }\}\HCode{</script></span>}}
%</htXimera>
%    \end{macrocode}

