hmath-commits Mailing List for HMath - MathML Wiki/BLOG (Page 2)
Status: Pre-Alpha
Brought to you by:
jsurfer
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
(28) |
Mar
(121) |
Apr
(49) |
May
(11) |
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|---|
|
From: Klaus H. <js...@us...> - 2004-04-14 20:07:29
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hmath/server/macro/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22933/WEB-INF/src/org/hmath/server/macro/code Removed Files: CHashCodeFilter.java Log Message: misc changes --- CHashCodeFilter.java DELETED --- |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:07:13
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/test/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22843/WEB-INF/src/org/hartmath/server/test/filter Modified Files: WikipediaFilterTest.java Log Message: misc changes Index: WikipediaFilterTest.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/test/filter/WikipediaFilterTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** WikipediaFilterTest.java 2 Apr 2004 18:16:42 -0000 1.3 --- WikipediaFilterTest.java 14 Apr 2004 20:06:57 -0000 1.4 *************** *** 39,48 **** public void testParser() { ! assertEquals(" ", filter.filter("==te\"\'?st==", context)); assertEquals(" \ ", filter.filter(" \\\\\\ ", context)); ! assertEquals("<h2><a name=\"test_head\"> test head </a></h2>", filter.filter("== test head ==", context)); assertEquals("test <span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span><br/><span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span>", filter.filter("test http://www.hmath.org<br/>http://www.hmath.org", context)); --- 39,62 ---- public void testParser() { ! assertEquals("More generally, given an infinite collection of finite sets \n"+ ! "{''S''<sub>''i''</sub>} typically", ""); ! ! ! assertEquals("test me < >&& 1234öäü", ! filter.filter("test me < >& 1234öäü", context)); ! assertEquals("<em>f</em>test me ~~f~~ < >&& ", ! filter.filter("''f''<nowiki>test me ~~f~~ < >& </nowiki>", context)); ! ! assertEquals("<table id=\"toc\" border=\"0\"><tr><th>Table of contents</th></tr><tr><td><ol><li><a href=\"space/#atest\">te"'?st</a></li></ol></td></tr></table><hr/><h2><a name=\"atest\">te\"\'?st</a></h2>", filter.filter("==te\"\'?st==", context)); + + + + assertEquals(" \ ", filter.filter(" \\\\\\ ", context)); ! assertEquals("<table id=\"toc\" border=\"0\"><tr><th>Table of contents</th></tr><tr><td><ol><li><a href=\"space/#atesthead\"> test head </a></li></ol></td></tr></table><hr/><h2><a name=\"atesthead\"> test head </a></h2>", filter.filter("== test head ==", context)); + assertEquals("test <span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span><br/><span class=\"nobr\"><a href=\"http://www.hmath.org\">http://www.hmath.org</a></span>", filter.filter("test http://www.hmath.org<br/>http://www.hmath.org", context)); *************** *** 56,63 **** assertEquals("〹", filter.filter("〹", context)); ! assertEquals("<h2><a name=\"test_head\"> test head </a></h2>", ! filter.filter("== test head ==", context)); ! assertEquals("hhhhw\n<h3><a name=\"test_head_2\"> test head 2 </a></h3>", ! filter.filter("hhhhw\n=== test head 2 ===", context)); assertEquals( "<em>em test</em> <strong>strong test</strong>", --- 70,75 ---- assertEquals("〹", filter.filter("〹", context)); ! ! assertEquals( "<em>em test</em> <strong>strong test</strong>", *************** *** 84,114 **** assertEquals( ! "<i class=\"italic\">italic <b class=\"bold\">bold <u class=\"underline\">underline</u></b></i>", filter.filter("<i>italic <B>bold <u>underline", context)); ! assertEquals("<hr class=\"line\"/>\r\n<hr class=\"line\"/>", filter.filter("<Hr>\r\n<hR/>", context)); assertEquals("<br/>\r\n<br/>", filter.filter("<br>\r\n<br/>", context)); ! assertEquals("<h1 class=\"h1\">hh</h1>", filter.filter("<h1>hh</h1>", context)); ! assertEquals("<strike class=\"strike\">test </strike>", filter.filter("<strike>test </strike>", context)); assertEquals( ! "<i class=\"italic\">italic</i> <b class=\"bold\">bold</b> <u class=\"underline\">underline</u>", filter.filter("<i>italic</i> <B>bold</B> <u>underline</u>", context)); assertEquals( ! "<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("~~em test~~ __ strong test__", context)); assertEquals( ! "<sub class=\"sub\">subtest</sub> <sup class=\"sup\">suppenTest</sup>", filter.filter("<sub>subtest</sub> <sup>suppenTest</sup>", context)); assertEquals( ! "<i class=\"italic\">em test</i> <b class=\"bold\"> strong test</b>", filter.filter("<em>em test</em> <strong> strong test</strong>", context)); assertEquals("__ and ~~", filter.filter("\\_\\_ and \\~\\~", context)); ! ((WikipediaFilter) filter).setContext(context); ! assertEquals( ! "field:expr|<expr>|snipsnap-eval|Evaluate", ! ((WikipediaFilter) filter).parseParameters("field:expr|$expr|snipsnap-eval|Evaluate")); } --- 96,126 ---- assertEquals( ! "<i>italic <b>bold <u>underline</u></b></i>", filter.filter("<i>italic <B>bold <u>underline", context)); ! assertEquals("<hr/>\r\n<hr/>", filter.filter("<Hr>\r\n<hR/>", context)); assertEquals("<br/>\r\n<br/>", filter.filter("<br>\r\n<br/>", context)); ! assertEquals("<h1>hh</h1>", filter.filter("<h1>hh</h1>", context)); ! assertEquals("<strike>test </strike>", filter.filter("<strike>test </strike>", context)); assertEquals( ! "<i>italic</i> <b>bold</b> <u>underline</u>", filter.filter("<i>italic</i> <B>bold</B> <u>underline</u>", context)); assertEquals( ! "<i>em test</i> <b> strong test</b>", filter.filter("~~em test~~ __ strong test__", context)); assertEquals( ! "<sub>subtest</sub> <sup>suppenTest</sup>", filter.filter("<sub>subtest</sub> <sup>suppenTest</sup>", context)); assertEquals( ! "<i>em test</i> <b> strong test</b>", filter.filter("<em>em test</em> <strong> strong test</strong>", context)); assertEquals("__ and ~~", filter.filter("\\_\\_ and \\~\\~", context)); ! // ((WikipediaFilter) filter).setContext(context); ! // assertEquals( ! // "field:expr|<expr>|snipsnap-eval|Evaluate", ! // ((WikipediaFilter) filter).parseParameters("field:expr|$expr|snipsnap-eval|Evaluate")); } |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:06:34
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22664/WEB-INF/src/org/hartmath/server/filter Modified Files: WikipediaFilter.java Log Message: misc changes Index: WikipediaFilter.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter/WikipediaFilter.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** WikipediaFilter.java 2 Apr 2004 18:12:13 -0000 1.6 --- WikipediaFilter.java 14 Apr 2004 20:06:24 -0000 1.7 *************** *** 61,67 **** public class WikipediaFilter extends FilterSupport implements CacheFilter, IWikipediaFilterConstants { - private FilterContext fContext; - private RenderEngine fWikiEngine; - private Snip fSnip; public class InvalidInputException extends Exception { --- 61,64 ---- *************** *** 77,80 **** --- 74,80 ---- public class Parser { + private FilterContext fContext; + private RenderEngine fWikiEngine; + private Snip fSnip; public static final String INVALID_CHAR_IN_PLUGIN_IDENTIFIER = "Invalid_Char_In_Plugin_Identifier"; *************** *** 110,114 **** // table of content private ArrayList fToC = null; ! public Parser(String stringSource, StringBuffer result, int recursionLevel) { fResult = result; fStringSource = stringSource; --- 110,122 ---- // table of content private ArrayList fToC = null; ! public Parser(String stringSource, StringBuffer result, FilterContext context, int recursionLevel) { ! fContext = context; ! fWikiEngine = context.getRenderContext().getRenderEngine(); ! try { ! SnipMacroParameter params = (SnipMacroParameter) fContext.getMacroParameter(); ! fSnip = params.getSnipRenderContext().getSnip(); ! } catch (ClassCastException e) { ! e.printStackTrace(); ! } fResult = result; fStringSource = stringSource; *************** *** 151,214 **** private void copyWhite(boolean whiteStart, final int whiteStartPosition, final int diff) { if (whiteStart) { ! final int len = fCurrentPosition - whiteStartPosition - diff; ! // char[] whiteChars = new char[len]; ! char ch; ! int indx = whiteStartPosition; ! while (indx < whiteStartPosition + len) { ! ch = fSource[indx++]; ! switch (ch) { ! // TODO activate if macros are integrated correctly case '<' : // special html escape character ! fResult.append(Encoder.toEntity('<')); break; case '>' : // special html escape character ! fResult.append(Encoder.toEntity('>')); break; case '&' : // special html escape character ! fResult.append(Encoder.toEntity('&')); break; case '\'' : // special html escape character ! fResult.append(Encoder.toEntity('\'')); break; case '\"' : // special html escape character ! fResult.append(Encoder.toEntity('\"')); break; - default : - fResult.append(ch); } } fWhiteStart = false; - // fResult.append(fSource, whiteStartPosition, currentPosition - whiteStartPosition - diff); } } private void copyWhite(String text) { ! char ch; ! for (int i = 0; i < text.length(); i++) { ! ch = text.charAt(i); ! switch (ch) { case '<' : // special html escape character ! fResult.append(Encoder.toEntity('<')); break; case '>' : // special html escape character ! fResult.append(Encoder.toEntity('>')); break; case '&' : // special html escape character ! fResult.append(Encoder.toEntity('&')); break; case '\'' : // special html escape character ! fResult.append(Encoder.toEntity('\'')); break; case '\"' : // special html escape character ! fResult.append(Encoder.toEntity('\"')); break; - default : - fResult.append(ch); } } } /** ! * Render the MTML token which are defined in the OPNE_TAGS and CLOSE_TAGS map * * @return --- 159,315 ---- private void copyWhite(boolean whiteStart, final int whiteStartPosition, final int diff) { if (whiteStart) { ! final int len = fCurrentPosition - diff; ! int currentIndex = whiteStartPosition; ! int lastIndex = currentIndex; ! while (currentIndex < len) { ! switch (fSource[currentIndex++]) { case '<' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(fSource, lastIndex, currentIndex - lastIndex - 1); ! lastIndex = currentIndex; ! } ! fResult.append("<"); break; case '>' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(fSource, lastIndex, currentIndex - lastIndex - 1); ! lastIndex = currentIndex; ! } ! fResult.append(">"); break; case '&' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(fSource, lastIndex, currentIndex - lastIndex - 1); ! lastIndex = currentIndex; ! } ! fResult.append("&"); break; case '\'' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(fSource, lastIndex, currentIndex - lastIndex - 1); ! lastIndex = currentIndex; ! } ! fResult.append("'"); break; case '\"' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(fSource, lastIndex, currentIndex - lastIndex - 1); ! lastIndex = currentIndex; ! } ! fResult.append("""); break; } } + if (lastIndex < (currentIndex)) { + fResult.append(fSource, lastIndex, currentIndex - lastIndex); + } fWhiteStart = false; } } private void copyWhite(String text) { ! final int len = text.length(); ! int currentIndex = 0; ! int lastIndex = currentIndex; ! while (currentIndex < len) { ! switch (text.charAt(currentIndex++)) { case '<' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(text.substring(lastIndex, currentIndex-1)); ! lastIndex = currentIndex; ! } ! fResult.append("<"); break; case '>' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(text.substring(lastIndex, currentIndex-1)); ! lastIndex = currentIndex; ! } ! fResult.append(">"); break; case '&' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(text.substring(lastIndex, currentIndex-1)); ! lastIndex = currentIndex; ! } ! fResult.append("&"); break; case '\'' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(text.substring(lastIndex, currentIndex-1)); ! lastIndex = currentIndex; ! } ! fResult.append("'"); break; case '\"' : // special html escape character ! if (lastIndex < (currentIndex - 1)) { ! fResult.append(text.substring(lastIndex, currentIndex-1)); ! lastIndex = currentIndex; ! } ! fResult.append("""); break; } } + if (lastIndex < (currentIndex)) { + fResult.append(text.substring(lastIndex, currentIndex)); + } } + private void copyWhiteNewLine(String text) { + final int len = text.length(); + int currentIndex = 0; + int lastIndex = currentIndex; + while (currentIndex < len) { + switch (text.charAt(currentIndex++)) { + case '\n' : + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append("<br/>"); + break; + case '<' : // special html escape character + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append("<"); + break; + case '>' : // special html escape character + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append(">"); + break; + case '&' : // special html escape character + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append("&"); + break; + case '\'' : // special html escape character + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append("'"); + break; + case '\"' : // special html escape character + if (lastIndex < (currentIndex - 1)) { + fResult.append(text.substring(lastIndex, currentIndex-1)); + lastIndex = currentIndex; + } + fResult.append("""); + break; + } + } + if (lastIndex < (currentIndex)) { + fResult.append(text.substring(lastIndex, currentIndex)); + } + } /** ! * Render the MTML token which are defined in the OPEN_TAGS and CLOSE_TAGS map * * @return *************** *** 436,440 **** fWhiteStart = false; stopList(); ! fResult.append("<p class=\"paragraph\"/>"); } continue; --- 537,541 ---- fWhiteStart = false; stopList(); ! fResult.append("<p/>"); } continue; *************** *** 611,615 **** fResult.append("\">"); // System.out.println(heading); ! fResult.append(filter(heading, fRecursionLevel)); fResult.append("</h3>"); continue; --- 712,716 ---- fResult.append("\">"); // System.out.println(heading); ! fResult.append(filter(heading, fContext, fRecursionLevel)); fResult.append("</h3>"); continue; *************** *** 764,772 **** if (fSource[tempCurrPosition] == '\n') { fCurrentPosition = tempCurrPosition + 1; ! fResult.append("<hr class=\"line\"/>"); continue; } else if (fSource[tempCurrPosition++] == '\r' && fSource[tempCurrPosition++] == '\n') { fCurrentPosition = tempCurrPosition; ! fResult.append("<hr class=\"line\"/>"); continue; } --- 865,873 ---- if (fSource[tempCurrPosition] == '\n') { fCurrentPosition = tempCurrPosition + 1; ! fResult.append("<hr/>"); continue; } else if (fSource[tempCurrPosition++] == '\r' && fSource[tempCurrPosition++] == '\n') { fCurrentPosition = tempCurrPosition; ! fResult.append("<hr/>"); continue; } *************** *** 913,933 **** int htmlStartPosition = fCurrentPosition; try { ! String urlString = fStringSource.substring(fCurrentPosition - 1, fCurrentPosition + 5); ! if (urlString.equals("<math>")) { ! fCurrentPosition += 5; ! if (readUntilString("</math>")) { ! String mathContent = new String(fSource, htmlStartPosition + 5, fCurrentPosition - htmlStartPosition - 12); ! if (mathContent != null) { ! copyWhite(fWhiteStart, fWhiteStartPosition, fCurrentPosition - htmlStartPosition + 1); ! fWhiteStart = false; ! if (startOfIndent) { ! startOfIndent = false; ! handleTeXMath(mathContent, false); ! } else { ! handleTeXMath(mathContent, true); } - continue; } ! } } } catch (IndexOutOfBoundsException e) { --- 1014,1055 ---- int htmlStartPosition = fCurrentPosition; try { ! switch (fStringSource.charAt(fCurrentPosition)) { ! case 'm' : // math ! String mathString = fStringSource.substring(fCurrentPosition - 1, fCurrentPosition + 5); ! ! if (mathString.equals("<math>")) { ! fCurrentPosition += 5; ! if (readUntilString("</math>")) { ! String mathContent = new String(fSource, htmlStartPosition + 5, fCurrentPosition - htmlStartPosition - 12); ! if (mathContent != null) { ! copyWhite(fWhiteStart, fWhiteStartPosition, fCurrentPosition - htmlStartPosition + 1); ! fWhiteStart = false; ! if (startOfIndent) { ! startOfIndent = false; ! handleTeXMath(mathContent, false); ! } else { ! handleTeXMath(mathContent, true); ! } ! continue; ! } } } ! break; ! case 'n' : // nowiki ! String nowikiString = fStringSource.substring(fCurrentPosition - 1, fCurrentPosition + 7); ! ! if (nowikiString.equals("<nowiki>")) { ! fCurrentPosition += 7; ! if (readUntilString("</nowiki>")) { ! String nowikiContent = new String(fSource, htmlStartPosition + 7, fCurrentPosition - htmlStartPosition - 16); ! if (nowikiContent != null) { ! copyWhite(fWhiteStart, fWhiteStartPosition, fCurrentPosition - htmlStartPosition + 1); ! fWhiteStart = false; ! copyWhiteNewLine(nowikiContent); ! continue; ! } ! } ! } ! break; } } catch (IndexOutOfBoundsException e) { *************** *** 1126,1130 **** public String createAnchor(String head) { ! StringBuffer result = new StringBuffer(); char ch; result.append('a'); --- 1248,1252 ---- public String createAnchor(String head) { ! StringBuffer result = new StringBuffer(head.length() + 1); char ch; result.append('a'); *************** *** 1173,1182 **** * @param headLevel */ ! private void addToC(ArrayList toc, String head, String anchor, int headLevel) { int level = 1; if (level == headLevel) { ! StringBuffer link = new StringBuffer(); link.append("<li>"); ! SnipLink.appendLink(link, fSnip.getName(), head, anchor); link.append("</li>"); toc.add(link.toString()); --- 1295,1309 ---- * @param headLevel */ ! private void addToTableOfContent(ArrayList toc, String head, String anchor, int headLevel) { int level = 1; if (level == headLevel) { ! String snipName = ""; ! if (fSnip!=null) { ! snipName = fSnip.getName(); ! } ! ! StringBuffer link = new StringBuffer(snipName.length() + 40 + head.length() + anchor.length()); link.append("<li>"); ! SnipLink.appendLink(link, snipName, head, anchor); link.append("</li>"); toc.add(link.toString()); *************** *** 1184,1188 **** if (toc.size() > 0) { if (toc.get(toc.size() - 1) instanceof ArrayList) { ! addToC((ArrayList) toc.get(toc.size() - 1), head, anchor, --headLevel); return; } --- 1311,1315 ---- if (toc.size() > 0) { if (toc.get(toc.size() - 1) instanceof ArrayList) { ! addToTableOfContent((ArrayList) toc.get(toc.size() - 1), head, anchor, --headLevel); return; } *************** *** 1190,1197 **** ArrayList list = new ArrayList(); toc.add(list); ! addToC(list, head, anchor, --headLevel); } } private void handleHead(String head, int headLevel) { if (head != null) { --- 1317,1330 ---- ArrayList list = new ArrayList(); toc.add(list); ! addToTableOfContent(list, head, anchor, --headLevel); } } + /** + * handle head for table of content + * + * @param head + * @param headLevel + */ private void handleHead(String head, int headLevel) { if (head != null) { *************** *** 1205,1209 **** fResult = new StringBuffer(fResult.capacity()); } ! addToC(fToC, head, anchor, headLevel); fResult.append("<h"); --- 1338,1342 ---- fResult = new StringBuffer(fResult.capacity()); } ! addToTableOfContent(fToC, head, anchor, headLevel); fResult.append("<h"); *************** *** 1345,1349 **** // recursively filter macros within macros if (null != mParams.getContent() && !(macro instanceof INoParserBodyFilterMacro)) { ! mParams.setContent(filter(mParams.getContent(), fRecursionLevel)); } StringBufferWriter writer = new StringBufferWriter(new StringBuffer(256)); --- 1478,1482 ---- // recursively filter macros within macros if (null != mParams.getContent() && !(macro instanceof INoParserBodyFilterMacro)) { ! mParams.setContent(filter(mParams.getContent(), fContext, fRecursionLevel)); } StringBufferWriter writer = new StringBufferWriter(new StringBuffer(256)); *************** *** 1351,1355 **** StringBuffer buffer = writer.getBuffer(); if (macro instanceof IRenderResultMacro) { ! fResult.append(filter(buffer.toString(), fRecursionLevel)); } else { fResult.append(buffer); --- 1484,1488 ---- StringBuffer buffer = writer.getBuffer(); if (macro instanceof IRenderResultMacro) { ! fResult.append(filter(buffer.toString(), fContext, fRecursionLevel)); } else { fResult.append(buffer); *************** *** 1364,1368 **** // Filter paramFilter = new ParamFilter(mParams); // included = paramFilter.filter(included, null); ! fResult.append(include); } else { fResult.append(command.substring(1) + " not found."); --- 1497,1502 ---- // Filter paramFilter = new ParamFilter(mParams); // included = paramFilter.filter(included, null); ! // fResult.append(include); ! fResult.append(filter(include, fContext, fRecursionLevel)); } else { fResult.append(command.substring(1) + " not found."); *************** *** 1410,1414 **** } else { fTokenStack.push(BOLD); ! fResult.append("<b class=\"bold\">"); } break; --- 1544,1548 ---- } else { fTokenStack.push(BOLD); ! fResult.append("<b>"); } break; *************** *** 1419,1423 **** } else { fTokenStack.push(ITALIC); ! fResult.append("<i class=\"italic\">"); } break; --- 1553,1557 ---- } else { fTokenStack.push(ITALIC); ! fResult.append("<i>"); } break; *************** *** 1446,1450 **** } else { fTokenStack.push(STRIKETHROUGH); ! fResult.append("<strike class=\"strike\">"); } break; --- 1580,1584 ---- } else { fTokenStack.push(STRIKETHROUGH); ! fResult.append("<strike>"); } break; *************** *** 1585,1588 **** --- 1719,1752 ---- fResult.append("<div class=\"error\">Unexpected end for tag: <" + tag + "></div>"); } + + /** + * @return Returns the context. + */ + public FilterContext getContext() { + return fContext; + } + + /** + * @param context + * The context to set. + */ + public void setContext(FilterContext context) { + fContext = context; + } + + /** + * @return Returns the wikiEngine. + */ + public RenderEngine getWikiEngine() { + return fWikiEngine; + } + + /** + * @param wikiEngine + * The wikiEngine to set. + */ + public void setWikiEngine(RenderEngine wikiEngine) { + fWikiEngine = wikiEngine; + } } *************** *** 1776,1818 **** final static Token HTML_BR_OPEN = new SpecialTagToken(TokenHTML_BR_OPEN, "br", "<br/>"); ! final static Token HTML_HR_OPEN = new SpecialTagToken(TokenHTML_HR_OPEN, "hr", "<hr class=\"line\"/>"); final static Token HTML_EM_CLOSE = new CloseTagToken(TokenHTML_EM_CLOSE, "em", "</i>"); ! final static Token HTML_EM_OPEN = new OpenTagToken(TokenHTML_EM_OPEN, "em", "<i class=\"italic\">"); final static Token HTML_H1_CLOSE = new CloseTagToken(TokenHTML_H1_CLOSE, "h1", "</h1>"); ! final static Token HTML_H1_OPEN = new OpenTagToken(TokenHTML_H1_OPEN, "h1", "<h1 class=\"h1\">"); final static Token HTML_H2_CLOSE = new CloseTagToken(TokenHTML_H2_CLOSE, "h2", "</h2>"); ! final static Token HTML_H2_OPEN = new OpenTagToken(TokenHTML_H2_OPEN, "h2", "<h2 class=\"h2\">"); final static Token HTML_H3_CLOSE = new CloseTagToken(TokenHTML_H3_CLOSE, "h3", "</h3>"); ! final static Token HTML_H3_OPEN = new OpenTagToken(TokenHTML_H3_OPEN, "h3", "<h3 class=\"h3\">"); final static Token HTML_H4_CLOSE = new CloseTagToken(TokenHTML_H4_CLOSE, "h4", "</h4>"); ! final static Token HTML_H4_OPEN = new OpenTagToken(TokenHTML_H4_OPEN, "h4", "<h4 class=\"h4\">"); final static Token HTML_H5_CLOSE = new CloseTagToken(TokenHTML_H5_CLOSE, "h5", "</h5>"); ! final static Token HTML_H5_OPEN = new OpenTagToken(TokenHTML_H5_OPEN, "h5", "<h5 class=\"h5\">"); final static Token HTML_H6_CLOSE = new CloseTagToken(TokenHTML_H6_CLOSE, "h6", "</h6>"); ! final static Token HTML_H6_OPEN = new OpenTagToken(TokenHTML_H6_OPEN, "h6", "<h6 class=\"h6\">"); final static Token HTML_ITALIC_CLOSE = new CloseTagToken(TokenHTML_ITALIC_CLOSE, "i", "</i>"); ! final static Token HTML_ITALIC_OPEN = new OpenTagToken(TokenHTML_ITALIC_OPEN, "i", "<i class=\"italic\">"); final static Token HTML_BOLD_CLOSE = new CloseTagToken(TokenHTML_BOLD_CLOSE, "b", "</b>"); ! final static Token HTML_BOLD_OPEN = new OpenTagToken(TokenHTML_BOLD_OPEN, "b", "<b class=\"bold\">"); // final static Token HTML_PARAGRAPH_CLOSE = new CloseTagToken(TokenHTML_PARAGRAPH_CLOSE, "p", "</p>"); ! final static Token HTML_PARAGRAPH_OPEN = new OpenTagToken(TokenHTML_PARAGRAPH_OPEN, "p", "<p class=\"paragraph\">"); final static Token HTML_PRE_CLOSE = new CloseTagToken(TokenHTML_PRE_CLOSE, "pre", "</pre>"); final static Token HTML_PRE_OPEN = new OpenTagToken(TokenHTML_PRE_OPEN, "pre", "<pre class=\"pre\">"); final static Token HTML_BLOCKQUOTE_CLOSE = new CloseTagToken(TokenHTML_BLOCKQUOTE_CLOSE, "blockquote", "</blockquote>"); ! final static Token HTML_BLOCKQUOTE_OPEN = ! new OpenTagToken(TokenHTML_BLOCKQUOTE_OPEN, "blockquote", "<blockquote class=\"blockquote\">"); final static Token HTML_STRIKE_CLOSE = new CloseTagToken(TokenHTML_STRIKE_CLOSE, "strike", "</strike>"); ! final static Token HTML_STRIKE_OPEN = new OpenTagToken(TokenHTML_STRIKE_OPEN, "strike", "<strike class=\"strike\">"); final static Token HTML_STRONG_CLOSE = new CloseTagToken(TokenHTML_STRONG_CLOSE, "strong", "</b>"); ! final static Token HTML_STRONG_OPEN = new OpenTagToken(TokenHTML_STRONG_OPEN, "strong", "<b class=\"bold\">"); final static Token HTML_UNDERLINE_CLOSE = new CloseTagToken(TokenHTML_UNDERLINE_CLOSE, "u", "</u>"); ! final static Token HTML_UNDERLINE_OPEN = new OpenTagToken(TokenHTML_UNDERLINE_OPEN, "u", "<u class=\"underline\">"); final static Token HTML_SUB_CLOSE = new CloseTagToken(TokenHTML_SUB_CLOSE, "sub", "</sub>"); ! final static Token HTML_SUB_OPEN = new OpenTagToken(TokenHTML_SUB_OPEN, "sub", "<sub class=\"sub\">"); final static Token HTML_SUP_CLOSE = new CloseTagToken(TokenHTML_SUP_CLOSE, "sup", "</sup>"); ! final static Token HTML_SUP_OPEN = new OpenTagToken(TokenHTML_SUP_OPEN, "sup", "<sup class=\"sup\">"); final static Token HTML_MATH_OPEN = new OpenTagToken(TokenHTML_MATH_CLOSE, "math", "<math>"); --- 1940,1981 ---- final static Token HTML_BR_OPEN = new SpecialTagToken(TokenHTML_BR_OPEN, "br", "<br/>"); ! final static Token HTML_HR_OPEN = new SpecialTagToken(TokenHTML_HR_OPEN, "hr", "<hr/>"); final static Token HTML_EM_CLOSE = new CloseTagToken(TokenHTML_EM_CLOSE, "em", "</i>"); ! final static Token HTML_EM_OPEN = new OpenTagToken(TokenHTML_EM_OPEN, "em", "<i>"); final static Token HTML_H1_CLOSE = new CloseTagToken(TokenHTML_H1_CLOSE, "h1", "</h1>"); ! final static Token HTML_H1_OPEN = new OpenTagToken(TokenHTML_H1_OPEN, "h1", "<h1>"); final static Token HTML_H2_CLOSE = new CloseTagToken(TokenHTML_H2_CLOSE, "h2", "</h2>"); ! final static Token HTML_H2_OPEN = new OpenTagToken(TokenHTML_H2_OPEN, "h2", "<h2>"); final static Token HTML_H3_CLOSE = new CloseTagToken(TokenHTML_H3_CLOSE, "h3", "</h3>"); ! final static Token HTML_H3_OPEN = new OpenTagToken(TokenHTML_H3_OPEN, "h3", "<h3>"); final static Token HTML_H4_CLOSE = new CloseTagToken(TokenHTML_H4_CLOSE, "h4", "</h4>"); ! final static Token HTML_H4_OPEN = new OpenTagToken(TokenHTML_H4_OPEN, "h4", "<h4>"); final static Token HTML_H5_CLOSE = new CloseTagToken(TokenHTML_H5_CLOSE, "h5", "</h5>"); ! final static Token HTML_H5_OPEN = new OpenTagToken(TokenHTML_H5_OPEN, "h5", "<h5>"); final static Token HTML_H6_CLOSE = new CloseTagToken(TokenHTML_H6_CLOSE, "h6", "</h6>"); ! final static Token HTML_H6_OPEN = new OpenTagToken(TokenHTML_H6_OPEN, "h6", "<h6>"); final static Token HTML_ITALIC_CLOSE = new CloseTagToken(TokenHTML_ITALIC_CLOSE, "i", "</i>"); ! final static Token HTML_ITALIC_OPEN = new OpenTagToken(TokenHTML_ITALIC_OPEN, "i", "<i>"); final static Token HTML_BOLD_CLOSE = new CloseTagToken(TokenHTML_BOLD_CLOSE, "b", "</b>"); ! final static Token HTML_BOLD_OPEN = new OpenTagToken(TokenHTML_BOLD_OPEN, "b", "<b>"); // final static Token HTML_PARAGRAPH_CLOSE = new CloseTagToken(TokenHTML_PARAGRAPH_CLOSE, "p", "</p>"); ! final static Token HTML_PARAGRAPH_OPEN = new OpenTagToken(TokenHTML_PARAGRAPH_OPEN, "p", "<p>"); final static Token HTML_PRE_CLOSE = new CloseTagToken(TokenHTML_PRE_CLOSE, "pre", "</pre>"); final static Token HTML_PRE_OPEN = new OpenTagToken(TokenHTML_PRE_OPEN, "pre", "<pre class=\"pre\">"); final static Token HTML_BLOCKQUOTE_CLOSE = new CloseTagToken(TokenHTML_BLOCKQUOTE_CLOSE, "blockquote", "</blockquote>"); ! final static Token HTML_BLOCKQUOTE_OPEN = new OpenTagToken(TokenHTML_BLOCKQUOTE_OPEN, "blockquote", "<blockquote>"); final static Token HTML_STRIKE_CLOSE = new CloseTagToken(TokenHTML_STRIKE_CLOSE, "strike", "</strike>"); ! final static Token HTML_STRIKE_OPEN = new OpenTagToken(TokenHTML_STRIKE_OPEN, "strike", "<strike>"); final static Token HTML_STRONG_CLOSE = new CloseTagToken(TokenHTML_STRONG_CLOSE, "strong", "</b>"); ! final static Token HTML_STRONG_OPEN = new OpenTagToken(TokenHTML_STRONG_OPEN, "strong", "<b>"); final static Token HTML_UNDERLINE_CLOSE = new CloseTagToken(TokenHTML_UNDERLINE_CLOSE, "u", "</u>"); ! final static Token HTML_UNDERLINE_OPEN = new OpenTagToken(TokenHTML_UNDERLINE_OPEN, "u", "<u>"); final static Token HTML_SUB_CLOSE = new CloseTagToken(TokenHTML_SUB_CLOSE, "sub", "</sub>"); ! final static Token HTML_SUB_OPEN = new OpenTagToken(TokenHTML_SUB_OPEN, "sub", "<sub>"); final static Token HTML_SUP_CLOSE = new CloseTagToken(TokenHTML_SUP_CLOSE, "sup", "</sup>"); ! final static Token HTML_SUP_OPEN = new OpenTagToken(TokenHTML_SUP_OPEN, "sup", "<sup>"); final static Token HTML_MATH_OPEN = new OpenTagToken(TokenHTML_MATH_CLOSE, "math", "<math>"); *************** *** 1943,1958 **** public String filter(String input, FilterContext context) { ! fContext = context; ! fWikiEngine = context.getRenderContext().getRenderEngine(); ! try { ! SnipMacroParameter params = (SnipMacroParameter) fContext.getMacroParameter(); ! fSnip = params.getSnipRenderContext().getSnip(); ! } catch (ClassCastException e) { ! e.printStackTrace(); ! } ! return filter(input, 0); } ! protected String filter(String input, int recursionLevel) { try { if (++recursionLevel > RECURSION_LIMIT) { --- 2106,2121 ---- public String filter(String input, FilterContext context) { ! // fContext = context; ! // fWikiEngine = context.getRenderContext().getRenderEngine(); ! // try { ! // SnipMacroParameter params = (SnipMacroParameter) fContext.getMacroParameter(); ! // fSnip = params.getSnipRenderContext().getSnip(); ! // } catch (ClassCastException e) { ! // e.printStackTrace(); ! // } ! return filter(input, context, 0); } ! public String filter(String input, FilterContext context, int recursionLevel) { try { if (++recursionLevel > RECURSION_LIMIT) { *************** *** 1961,1965 **** StringBuffer result = new StringBuffer(input.length() + input.length() / 10); // instantiate inner Parser class ! Parser parser = new Parser(input, result, recursionLevel); parser.parse(); return result.toString(); --- 2124,2128 ---- StringBuffer result = new StringBuffer(input.length() + input.length() / 10); // instantiate inner Parser class ! Parser parser = new Parser(input, result, context, recursionLevel); parser.parse(); return result.toString(); *************** *** 1968,1971 **** --- 2131,2135 ---- //log.warn("<span class=\"error\">Exception</span>: " + this + ": " + e); log.warn("Exception for: " + this +" " + e); + e.printStackTrace(); } catch (Error err) { //log.warn("<span class=\"error\">Error</span>: " + this + ": " + err); *************** *** 1977,2026 **** } ! private void filterParams(StringBuffer buffer, String name) { ! Map param = fContext.getRenderContext().getParameters(); ! if (param != null) { ! if (param.containsKey(name)) { ! Object value = param.get(name); ! if (value instanceof String[]) { ! buffer.append(((String[]) value)[0]); ! } else { ! buffer.append(value); ! } ! } else { ! buffer.append("<"); ! buffer.append(name); ! buffer.append(">"); ! } ! } else { ! buffer.append("<"); ! buffer.append(name); ! buffer.append(">"); ! } ! } ! public String parseParameters(String unsplittedMacroParameters) { ! int currPos = 0; ! int currEndPos = 0; ! int len = unsplittedMacroParameters.length(); ! StringBuffer buffer = new StringBuffer(len); ! char ch; ! while (currPos < len) { ! ch = unsplittedMacroParameters.charAt(currPos++); ! if (ch != '$') { ! buffer.append(ch); ! } else { ! if ((currEndPos = unsplittedMacroParameters.indexOf('|', currPos)) >= 1) { ! filterParams(buffer, unsplittedMacroParameters.substring(currPos, currEndPos)); ! currPos = currEndPos + 1; ! buffer.append('|'); ! } else { ! if (currPos < len) { ! filterParams(buffer, unsplittedMacroParameters.substring(currPos, len)); ! } ! } ! } ! } ! return buffer.toString(); ! } protected Repository getMacroRepository() { --- 2141,2190 ---- } ! // private void filterParams(StringBuffer buffer, String name) { ! // Map param = fContext.getRenderContext().getParameters(); ! // if (param != null) { ! // if (param.containsKey(name)) { ! // Object value = param.get(name); ! // if (value instanceof String[]) { ! // buffer.append(((String[]) value)[0]); ! // } else { ! // buffer.append(value); ! // } ! // } else { ! // buffer.append("<"); ! // buffer.append(name); ! // buffer.append(">"); ! // } ! // } else { ! // buffer.append("<"); ! // buffer.append(name); ! // buffer.append(">"); ! // } ! // } ! // public String parseParameters(String unsplittedMacroParameters) { ! // int currPos = 0; ! // int currEndPos = 0; ! // int len = unsplittedMacroParameters.length(); ! // StringBuffer buffer = new StringBuffer(len); ! // char ch; ! // while (currPos < len) { ! // ch = unsplittedMacroParameters.charAt(currPos++); ! // if (ch != '$') { ! // buffer.append(ch); ! // } else { ! // if ((currEndPos = unsplittedMacroParameters.indexOf('|', currPos)) >= 1) { ! // filterParams(buffer, unsplittedMacroParameters.substring(currPos, currEndPos)); ! // currPos = currEndPos + 1; ! // buffer.append('|'); ! // } else { ! // if (currPos < len) { ! // filterParams(buffer, unsplittedMacroParameters.substring(currPos, len)); ! // } ! // } ! // } ! // } ! // return buffer.toString(); ! // } protected Repository getMacroRepository() { *************** *** 2033,2065 **** } - /** - * @return Returns the context. - */ - public FilterContext getContext() { - return fContext; - } - - /** - * @param context - * The context to set. - */ - public void setContext(FilterContext context) { - fContext = context; - } - - /** - * @return Returns the wikiEngine. - */ - public RenderEngine getWikiEngine() { - return fWikiEngine; - } - - /** - * @param wikiEngine - * The wikiEngine to set. - */ - public void setWikiEngine(RenderEngine wikiEngine) { - fWikiEngine = wikiEngine; - } - } --- 2197,2199 ---- |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:06:33
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/macro In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22664/WEB-INF/src/org/hartmath/server/macro Modified Files: CodeMacro.java Log Message: misc changes Index: CodeMacro.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/macro/CodeMacro.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CodeMacro.java 2 Apr 2004 18:12:31 -0000 1.2 --- CodeMacro.java 14 Apr 2004 20:06:24 -0000 1.3 *************** *** 1,25 **** /* * This file is part of "SnipSnap Radeox Rendering Engine". ! * ! * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel ! * All Rights Reserved. ! * * Please visit http://radeox.org/ for updates and contact. ! * ! * --LICENSE NOTICE-- ! * This library is free software; you can redistribute it and/or ! * modify it under the terms of the GNU Lesser General Public ! * License as published by the Free Software Foundation; either ! * version 2.1 of the License, or (at your option) any later version. ! * ! * This library is distributed in the hope that it will be useful, ! * but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ! * Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public ! * License along with this library; if not, write to the Free Software ! * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * --LICENSE NOTICE-- */ --- 1,18 ---- /* * This file is part of "SnipSnap Radeox Rendering Engine". ! * ! * Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel All Rights Reserved. ! * * Please visit http://radeox.org/ for updates and contact. ! * ! * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser ! * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any ! * later version. ! * ! * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of ! * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. ! * ! * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free ! * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ *************** *** 37,40 **** --- 30,34 ---- import org.apache.commons.logging.LogFactory; import org.hartmath.server.filter.INoParserBodyFilterMacro; + import org.hartmath.server.macro.code.AbstractCPPBasedCodeFilter; import org.radeox.api.engine.context.InitialRenderContext; import org.radeox.api.engine.context.RenderContext; *************** *** 48,57 **** /* ! * Macro for displaying programming language source code. CodeMacro knows about ! * different source code formatters which can be plugged into radeox to ! * display more languages. CodeMacro displays Java, Ruby or SQL code. ! * ! * @author stephan ! * @team sonicteam * @version $Id$ */ --- 42,50 ---- /* ! * Macro for displaying programming language source code. CodeMacro knows about different source code formatters which can be ! * plugged into radeox to display more languages. CodeMacro displays Java, Ruby or SQL code. ! * ! * @author stephan @team sonicteam ! * * @version $Id$ */ *************** *** 66,71 **** private String end; ! private String[] paramDescription = ! {"?1: syntax highlighter to use, defaults to java"}; public String[] getParamDescription() { --- 59,63 ---- private String end; ! private String[] paramDescription = { "?1: syntax highlighter to use, defaults to java" }; public String[] getParamDescription() { *************** *** 103,107 **** } else { formatters.put(name, formatter); ! log.debug("Loaded formatter: " + formatter.getClass() + " (" + name +")"); } } catch (Exception e) { --- 95,99 ---- } else { formatters.put(name, formatter); ! log.debug("Loaded formatter: " + formatter.getClass() + " (" + name + ")"); } } catch (Exception e) { *************** *** 119,124 **** } ! public void execute(Writer writer, MacroParameter params) ! throws IllegalArgumentException, IOException { SourceCodeFormatter formatter = null; --- 111,115 ---- } ! public void execute(Writer writer, MacroParameter params) throws IllegalArgumentException, IOException { SourceCodeFormatter formatter = null; *************** *** 129,137 **** System.err.println("Formatter not found."); formatter = (SourceCodeFormatter) formatters.get("java"); } - result = formatter.filter(Encoder.escape( params.getContent() ), nullContext); } else { formatter = (SourceCodeFormatter) formatters.get(params.get("0")); ! result = formatter.filter( params.getContent() , nullContext); } --- 120,132 ---- System.err.println("Formatter not found."); formatter = (SourceCodeFormatter) formatters.get("java"); + result = formatter.filter(params.getContent(), nullContext); + } else if (formatter instanceof AbstractCPPBasedCodeFilter) { + result = formatter.filter(params.getContent(), nullContext); + } else { + result = formatter.filter(Encoder.escape(params.getContent()), nullContext); } } else { formatter = (SourceCodeFormatter) formatters.get(params.get("0")); ! result = formatter.filter(params.getContent(), nullContext); } |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:06:32
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/macro/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22664/WEB-INF/src/org/hartmath/server/macro/code Added Files: JavaCodeFilter.java PHPCodeFilter.java CHashCodeFilter.java AbstractCPPBasedCodeFilter.java Log Message: misc changes --- NEW FILE: AbstractCPPBasedCodeFilter.java --- /* * This file is part of "HMath Project". * * Copyright (c) 2004 Klaus Hartlage * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hartmath.server.macro.code; import java.util.HashMap; import java.util.HashSet; import org.radeox.filter.context.FilterContext; import org.radeox.macro.code.SourceCodeFormatter; /* * Abstract C++ syntax based code filter * */ abstract public class AbstractCPPBasedCodeFilter implements SourceCodeFormatter { public static void appendChar(StringBuffer result, char currentChar) { switch (currentChar) { case '\"' : // special html escape character result.append("""); break; case '<' : // special html escape character result.append("<"); break; case '>' : // special html escape character result.append(">"); break; case '&' : // special html escape character result.append("&"); break; case '\'' : // special html escape character result.append("'"); break; default : result.append(currentChar); } } public static void createHashMap(HashMap map, String str) { map.put(str, "<b><font color=\"#750055\">"+str+"</font></b>"); } public AbstractCPPBasedCodeFilter() { } private int appendIdentifier( String input, int identStart, int currentPosition, HashMap keywords, HashSet objectWords, StringBuffer result) { String originalIdent = input.substring(identStart, --currentPosition); String keywordIdent = originalIdent; if (!isKeywordLowerCase()) { keywordIdent = keywordIdent.toLowerCase(); } String keywordValue = (String) keywords.get(keywordIdent); if (keywordValue!=null) { result.append(keywordValue); // } else if (objectWords != null && objectWords.contains(originalIdent)) { // result.append("<font color=\"#7F9FBF\">"); // result.append(originalIdent); // result.append("</font>"); } else { result.append(originalIdent); } return currentPosition; } public String filter(String input, FilterContext context) { char[] source = input.toCharArray(); int currentPosition = 0; int identStart = 0; char currentChar = ' '; HashMap keywordsSet = getKeywordSet(); HashSet objectsSet = getObjectSet(); StringBuffer result = new StringBuffer(input.length() + input.length() / 4); boolean identFound = false; result.append("<font color=\"#000000\">"); try { while (true) { currentChar = source[currentPosition++]; // if (currentChar >= 'a' && currentChar <= 'z' && isKeywordLowerCase()) { // identStart = currentPosition - 1; // identFound = true; // // start of identifier ? // while (currentChar >= 'a' && currentChar <= 'z') { // currentChar = source[currentPosition++]; // } // currentPosition = appendIdentifier(input, identStart, currentPosition, keywordsSet, objectsSet, result); // identFound = false; // continue; // while loop // } else if ((currentChar >= 'A' && currentChar <= 'Z') || (currentChar == '_') || (currentChar >= 'a' && currentChar <= 'z')) { identStart = currentPosition - 1; identFound = true; // start of identifier ? while ((currentChar >= 'a' && currentChar <= 'z') || (currentChar >= 'A' && currentChar <= 'Z') || currentChar == '_') { currentChar = source[currentPosition++]; } currentPosition = appendIdentifier(input, identStart, currentPosition, keywordsSet, objectsSet, result); identFound = false; continue; // while loop } else if (currentChar == '\"') { //strings result.append("<font color=\"#2A00FF\">"); appendChar(result, currentChar); while (currentPosition < input.length()) { currentChar = source[currentPosition++]; appendChar(result, currentChar); if (currentChar == '\"' && source[currentPosition - 2] != '\\') { break; } } result.append("</font>"); continue; } else if (currentChar == '/' && currentPosition < input.length() && source[currentPosition] == '/') { // line comment result.append("<font color=\"#3F7F5F\">"); appendChar(result, currentChar); appendChar(result, source[currentPosition++]); while (currentPosition < input.length()) { currentChar = source[currentPosition++]; appendChar(result, currentChar); if (currentChar == '\n') { break; } } result.append("</font>"); continue; } else if (currentChar == '/' && currentPosition < input.length() && source[currentPosition] == '*') { if (currentPosition < (input.length() - 1) && source[currentPosition + 1] == '*') { // javadoc style result.append("<font color=\"#3F5FBF\">"); } else { // multiline comment result.append("<font color=\"#3F7F5F\">"); } appendChar(result, currentChar); appendChar(result, source[currentPosition++]); while (currentPosition < input.length()) { currentChar = source[currentPosition++]; appendChar(result, currentChar); if (currentChar == '/' && source[currentPosition - 2] == '*') { break; } } result.append("</font>"); continue; } else if (currentChar == '<' && isPHPTag() && currentPosition+3 < input.length() && source[currentPosition] == '?' && source[currentPosition+1] == 'p' && source[currentPosition+2] == 'h' && source[currentPosition+3] == 'p') { // php start tag currentPosition++; result.append("<font color=\"#7F0000\"><?php</font>"); continue; } else if (currentChar == '?' && isPHPTag() && currentPosition < input.length() && source[currentPosition] == '>') { // php start tag currentPosition += 4; result.append("<font color=\"#7F0000\">?></font>"); continue; } appendChar(result, currentChar); } } catch (IndexOutOfBoundsException e) { if (identFound) { currentPosition = appendIdentifier(input, identStart, currentPosition, keywordsSet, null, result); } } result.append("</font>"); return result.toString(); } /** * @return Returns the KEYWORD_SET. */ abstract public HashMap getKeywordSet(); /** * @return Returns the OBJECT_SET. */ abstract public HashSet getObjectSet(); public int getPriority() { return 0; } /** * @return Returns the KEYWORD_MAP. */ public boolean isKeywordLowerCase() { return true; } /** * */ public boolean isPHPTag() { return false; } } --- NEW FILE: JavaCodeFilter.java --- /* * This file is part of "HMath Project". * * Copyright (c) 2004 Klaus Hartlage * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hartmath.server.macro.code; import java.util.HashMap; import java.util.HashSet; import org.radeox.macro.code.SourceCodeFormatter; /** * Java CodeFilter colourizes C# source code * */ public class JavaCodeFilter extends AbstractCPPBasedCodeFilter implements SourceCodeFormatter { private static HashMap KEYWORD_SET = new HashMap(); private static final String[] KEYWORDS = { "class", "abstract", "break", "byvalue", "case", "cast", "catch", "const", "continue", "default", "do", "else", "extends", "false", "final", "finally", "for", "future", "generic", "goto", "if", "implements", "import", "inner", "instanceof", "interface", "native", "new", "null", "operator", "outer", "package", "private", "protected", "public", "rest", "return", "static", "super", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "var", "volatile", "while", "assert", "enum" }; private static final String[] OBJECT_WORDS = { "Boolean", "Byte", "Character", "Class", "ClassLoader", "Cloneable", "Compiler", "Double", "Float", "Integer", "Long", "Math", "Number", "Object", "Process", "Runnable", "Runtime", "SecurityManager", "Short", "String", "StringBuffer", "System", "Thread", "ThreadGroup", "Void", "boolean", "char", "byte", "short", "int", "long", "float", "double", "void"}; private static HashSet OBJECT_SET = new HashSet(); { for (int i = 0; i < KEYWORDS.length; i++) { //KEYWORD_SET.put(KEYWORDS[i], ""+KEYWORDS[i]+""); createHashMap(KEYWORD_SET, KEYWORDS[i]); } for (int i = 0; i < OBJECT_WORDS.length; i++) { OBJECT_SET.add(OBJECT_WORDS[i]); } } public JavaCodeFilter() { } /** * @return Returns the KEYWORD_SET. */ public HashMap getKeywordSet() { return KEYWORD_SET; } public String getName() { return "java"; } /** * @return Returns the OBJECT_SET. */ public HashSet getObjectSet() { return OBJECT_SET; } } --- NEW FILE: PHPCodeFilter.java --- /* * This file is part of "HMath Project". * * Copyright (c) 2004 Klaus Hartlage * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hartmath.server.macro.code; import java.util.HashMap; import java.util.HashSet; import org.radeox.macro.code.SourceCodeFormatter; /** * Java CodeFilter colourizes C# source code * */ public class PHPCodeFilter extends AbstractCPPBasedCodeFilter implements SourceCodeFormatter { private static HashMap KEYWORD_SET = new HashMap(); private static final String[] KEYWORDS = { "if", "elseif", "else", "endif", "for", "endfor", "while", "endwhile", "switch", "case", "endswitch", "break", "continue", "return", "include", "include_once", "require", "require_once", "function", "class", "new", "do", "old_function", "default", "global", "static", "foreach", "endforeach", "extends", "empty", "array", "echo", "var", "as", "print", "unset", "exit", "and", "or", "xor", "list", "null", "false", "true", "abstract", "catch", "finally", "try", "private", "protected", "public", "interface", "implements", "instanceof", "super", "throw", "const", "declare", "enddeclare", "eval", "use", "isset", "final" }; { for (int i = 0; i < KEYWORDS.length; i++) { //KEYWORD_SET.put(KEYWORDS[i], ""+KEYWORDS[i]+""); createHashMap(KEYWORD_SET, KEYWORDS[i]); } } public PHPCodeFilter() { } /** * @return Returns the KEYWORD_SET. */ public HashMap getKeywordSet() { return KEYWORD_SET; } public String getName() { return "php"; } /** * @return Returns the OBJECT_SET. */ public HashSet getObjectSet() { return null; } /* * (non-Javadoc) * * @see org.hartmath.server.macro.code.AbstractCPPBasedCodeFilter#isKeywordLowerCase() */ public boolean isKeywordLowerCase() { return false; } /** * */ public boolean isPHPTag() { return true; } } --- NEW FILE: CHashCodeFilter.java --- /* * This file is part of "HMath Project". * * Copyright (c) 2004 Klaus Hartlage * * Please visit http://radeox.org/ for updates and contact. * * --LICENSE NOTICE-- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser * General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any * later version. * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA --LICENSE NOTICE-- */ package org.hartmath.server.macro.code; import java.util.HashMap; import java.util.HashSet; import org.radeox.macro.code.SourceCodeFormatter; /** * C# CodeFilter colourizes C# source code * */ public class CHashCodeFilter extends AbstractCPPBasedCodeFilter implements SourceCodeFormatter { private static HashMap KEYWORD_SET = new HashMap(); private static final String[] KEYWORDS = { "class", "abstract", "event", "new", "struct", "as", "explicit", "null", "switch", "base", "extern", "this", "false", "operator", "throw", "break", "finally", "out", "true", "fixed", "override", "try", "case", "float", "params", "typeof", "catch", "for", "private", "foreach", "protected", "checked", "goto", "public", "unchecked", "if", "readonly", "unsafe", "const", "implicit", "ref", "continue", "in", "return", "using", "virtual", "default", "interface", "sealed", "volatile", "delegate", "internal", "do", "is", "sizeof", "while", "lock", "stackalloc", "else", "static", "enum", "namespace", }; private static final String[] OBJECT_WORDS = { "object", "bool", "byte", "float", "uint", "char", "ulong", "ushort", "decimal", "int", "sbyte", "short", "void", "double", "long", "string" }; private static HashSet OBJECT_SET = new HashSet(); { for (int i = 0; i < KEYWORDS.length; i++) { //KEYWORD_SET.put(KEYWORDS[i], ""+KEYWORDS[i]+""); createHashMap(KEYWORD_SET, KEYWORDS[i]); } for (int i = 0; i < OBJECT_WORDS.length; i++) { OBJECT_SET.add(OBJECT_WORDS[i]); } } public CHashCodeFilter() { } /** * @return Returns the KEYWORD_SET. */ public HashMap getKeywordSet() { return KEYWORD_SET; } public String getName() { return "chash"; } /** * @return Returns the OBJECT_SET. */ public HashSet getObjectSet() { return OBJECT_SET; } } |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:05:46
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/macro/code In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22631/WEB-INF/src/org/hartmath/server/macro/code Log Message: Directory /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/macro/code added to the repository |
|
From: Klaus H. <js...@us...> - 2004-04-14 20:04:55
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF/services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22426/WEB-INF/src/META-INF/services Modified Files: org.radeox.macro.code.SourceCodeFormatter org.radeox.filter.Filter Log Message: misc changes Index: org.radeox.filter.Filter =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF/services/org.radeox.filter.Filter,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** org.radeox.filter.Filter 9 Mar 2004 20:13:09 -0000 1.1 --- org.radeox.filter.Filter 14 Apr 2004 20:04:47 -0000 1.2 *************** *** 1,3 **** ! org.radeox.filter.ParamFilter #org.radeox.filter.MacroFilter #org.snipsnap.render.filter.CalendarFilter --- 1,3 ---- ! #org.radeox.filter.ParamFilter #org.radeox.filter.MacroFilter #org.snipsnap.render.filter.CalendarFilter *************** *** 22,26 **** #org.radeox.filter.EscapeFilter # ! org.snipsnap.render.filter.CalendarFilter #org.snipsnap.render.filter.LateMacroFilter #org.snipsnap.render.filter.PgpFilter --- 22,26 ---- #org.radeox.filter.EscapeFilter # ! #org.snipsnap.render.filter.CalendarFilter #org.snipsnap.render.filter.LateMacroFilter #org.snipsnap.render.filter.PgpFilter Index: org.radeox.macro.code.SourceCodeFormatter =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF/services/org.radeox.macro.code.SourceCodeFormatter,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** org.radeox.macro.code.SourceCodeFormatter 2 Apr 2004 18:21:11 -0000 1.2 --- org.radeox.macro.code.SourceCodeFormatter 14 Apr 2004 20:04:46 -0000 1.3 *************** *** 1,2 **** ! org.snipsnap.render.macro.code.Java2HtmlCodeFilter ! org.hmath.server.macro.code.CHashCodeFilter \ No newline at end of file --- 1,4 ---- ! #org.snipsnap.render.macro.code.Java2HtmlCodeFilter ! org.hartmath.server.macro.code.CHashCodeFilter ! org.hartmath.server.macro.code.JavaCodeFilter ! org.hartmath.server.macro.code.PHPCodeFilter \ No newline at end of file |
|
From: Klaus H. <js...@us...> - 2004-04-14 19:54:32
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20339/src/org/hartmath/tex2mml Modified Files: Identifier.java Row.java Scanner.java Operator.java TeX2MathMLFactory.java Text.java Number.java Node.java TeXParser.java Added Files: Space.java Log Message: misc changes --- NEW FILE: Space.java --- package org.hartmath.tex2mml; public class Space extends Node { String fWidth; public Space(String mmlWidth, String cssOutput) { super("mspace", cssOutput); fWidth = mmlWidth; } public int getType() { return TeX2MathMLFactory.CONSTANT; } public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { f.tagStart(buf, fTag+" width=\""+fWidth+"\"/"); } public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOutput); } } Index: Operator.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Operator.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Operator.java 19 Mar 2004 20:19:03 -0000 1.3 --- Operator.java 14 Apr 2004 19:54:22 -0000 1.4 *************** *** 12,15 **** --- 12,22 ---- } + public Operator(String oper, Map attributes) { + super("mo", ""); + fOperator = oper; + fType = TeX2MathMLFactory.CONSTANT; + fCSSOperator = ""; + fAttributes = attributes; + } public Operator(String oper, int type) { super("mo", ""); *************** *** 27,31 **** fAttributes = attributes; } ! public Operator(String oper, String cssOper, int type) { super("mo", ""); --- 34,38 ---- fAttributes = attributes; } ! public Operator(String oper, String cssOper, int type) { super("mo", ""); *************** *** 44,54 **** } ! public void convert2MML(TeX2MathMLFactory f,StringBuffer buf) { ! f.tagStart(buf, "mo"); ! buf.append(fOperator.toString()); ! f.tagEnd(buf, "mo"); } ! ! public void convert2CSS(StringBuffer buf,boolean noTags) { buf.append(fOperator.toString()); } --- 51,82 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { ! ! if (containsAttribute(TeX2MathMLFactory.APPLY_FUNCTION)) { ! if (!noMrowTags) { ! f.tagStart(buf, "mrow"); ! } ! f.tagStart(buf, "mi"); ! buf.append(fOperator.toString()); ! f.tagEnd(buf, "mi"); ! f.tagStart(buf, "mo"); ! buf.append("⁡"); ! f.tagEnd(buf, "mo"); ! if (!noMrowTags) { ! f.tagEnd(buf, "mrow"); ! } ! } else { ! if (containsAttribute(TeX2MathMLFactory.STRETCHY_FALSE)) { ! f.tagStart(buf, "mo stretchy=\"false\""); ! } else { ! f.tagStart(buf, "mo"); ! } ! buf.append(fOperator.toString()); ! f.tagEnd(buf, "mo"); ! ! } } ! ! public void convert2CSS(StringBuffer buf, boolean noTags) { buf.append(fOperator.toString()); } *************** *** 87,91 **** return (String) fAttributes.get(key); } ! /** * @return Returns the cSSOperator. --- 115,119 ---- return (String) fAttributes.get(key); } ! /** * @return Returns the cSSOperator. *************** *** 96,100 **** /** ! * @param operator The cSSOperator to set. */ public void setCSSOperator(String operator) { --- 124,129 ---- /** ! * @param operator ! * The cSSOperator to set. */ public void setCSSOperator(String operator) { Index: Scanner.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Scanner.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Scanner.java 2 Apr 2004 21:07:01 -0000 1.5 --- Scanner.java 14 Apr 2004 19:54:22 -0000 1.6 *************** *** 60,63 **** --- 60,64 ---- final static public int TT_LEFT = 62; final static public int TT_RIGHT = 63; + final static public int TT_TEXT = 64; final static public int TT_ARGUMENTS_OPEN = 126; *************** *** 223,226 **** --- 224,244 ---- fCurrentPosition++; getBackslashSymbol(); + if (token == TT_TEXT) { + int startPosition = -1; + try { + while (Character.isWhitespace(fSourceString.charAt(fCurrentPosition))) { + fCurrentPosition++; + } + startPosition = fCurrentPosition; + if (fSourceString.charAt(fCurrentPosition++) == '{') { + startPosition = fCurrentPosition; + while (fSourceString.charAt(fCurrentPosition++) != '}') { + } + fBackslashSymbol = fSourceString.substring(startPosition, fCurrentPosition - 1); + } + } catch (IndexOutOfBoundsException e) { + token = TT_DOUBLE_BACKSLASH; + } + } return; } *************** *** 245,248 **** --- 263,286 ---- fBackslashSymbol = ";"; return; + case '{' : + fCurrentPosition++; + token = TT_BACKSLASH_SYMBOL; + fBackslashSymbol = "{"; + return; + case '}' : + fCurrentPosition++; + token = TT_BACKSLASH_SYMBOL; + fBackslashSymbol = "}"; + return; + case '^' : + fCurrentPosition++; + token = TT_BACKSLASH_SYMBOL; + fBackslashSymbol = "^"; + return; + case '_' : + fCurrentPosition++; + token = TT_BACKSLASH_SYMBOL; + fBackslashSymbol = "_"; + return; } } *************** *** 385,389 **** } break; ! case 4 : // \left if (fSourceString.charAt(index) == 'l' && fSourceString.charAt(++index) == 'e' --- 423,427 ---- } break; ! case 4 : // \left \text \mbox if (fSourceString.charAt(index) == 'l' && fSourceString.charAt(++index) == 'e' *************** *** 393,396 **** --- 431,450 ---- return fBackslashSymbol; } + index = startPosition; + if (fSourceString.charAt(index) == 't' + && fSourceString.charAt(++index) == 'e' + && fSourceString.charAt(++index) == 'x' + && fSourceString.charAt(++index) == 't') { + token = TT_TEXT; + return fBackslashSymbol; + } + index = startPosition; + if (fSourceString.charAt(index) == 'm' + && fSourceString.charAt(++index) == 'b' + && fSourceString.charAt(++index) == 'o' + && fSourceString.charAt(++index) == 'x') { + token = TT_TEXT; + return fBackslashSymbol; + } break; case 5 : // \begin \right Index: TeXParser.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeXParser.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TeXParser.java 2 Apr 2004 21:07:01 -0000 1.7 --- TeXParser.java 14 Apr 2004 19:54:22 -0000 1.8 *************** *** 30,42 **** } - public class Attribute { - String fKey; - String fValue; - public Attribute(String key, String value) { - fKey = key; - fValue = value; - } - } - private Node createOperationNode(String str, Row stack) { Node temp; --- 30,33 ---- *************** *** 168,181 **** getNextToken(); Row result = MML_FACTORY.getRow(); ! result.add(new Operator("(")); result.add(temp); ! result.add(new Operator(")")); return result; } else if (temp != null) { Row list = MML_FACTORY.getRow(); ! list.add(new Operator("(")); list.add(temp); appendRowNodePrecedence(list); ! list.add(new Operator(")")); return list; } --- 159,172 ---- getNextToken(); Row result = MML_FACTORY.getRow(); ! result.add(new Operator("(",TeX2MathMLFactory.STRETCHY_FALSE_ATTR)); result.add(temp); ! result.add(new Operator(")",TeX2MathMLFactory.STRETCHY_FALSE_ATTR)); return result; } else if (temp != null) { Row list = MML_FACTORY.getRow(); ! list.add(new Operator("(",TeX2MathMLFactory.STRETCHY_FALSE_ATTR)); list.add(temp); appendRowNodePrecedence(list); ! list.add(new Operator(")",TeX2MathMLFactory.STRETCHY_FALSE_ATTR)); return list; } *************** *** 206,210 **** --- 197,205 ---- return MML_FACTORY.getIdentifier(str); case TT_AMPERSAND : + getNextToken(); + return new Operator("&"); case TT_COMMA: + getNextToken(); + return new Operator(","); case TT_CHARACTER : str = fOperatorString; *************** *** 212,219 **** return MML_FACTORY.getText(str); case TT_BACKSLASH_SYMBOL : ! str = fBackslashSymbol; getNextToken(); temp = createOperationNode(str, stack); return temp; case TT_BEGIN : getNextToken(); --- 207,218 ---- return MML_FACTORY.getText(str); case TT_BACKSLASH_SYMBOL : ! str = '\\'+fBackslashSymbol; getNextToken(); temp = createOperationNode(str, stack); return temp; + case TT_TEXT : + str = fBackslashSymbol; + getNextToken(); + return MML_FACTORY.getText(str); case TT_BEGIN : getNextToken(); Index: Text.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Text.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Text.java 19 Mar 2004 20:19:03 -0000 1.3 --- Text.java 14 Apr 2004 19:54:22 -0000 1.4 *************** *** 13,18 **** return TeX2MathMLFactory.CONSTANT; } ! ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); --- 13,19 ---- return TeX2MathMLFactory.CONSTANT; } ! ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { ! //<mtext>is divergent, but</mtext> f.tagStart(buf, fTag); buf.append(fOutput); Index: Number.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Number.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Number.java 19 Mar 2004 20:19:03 -0000 1.3 --- Number.java 14 Apr 2004 19:54:22 -0000 1.4 *************** *** 14,18 **** } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); --- 14,18 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { f.tagStart(buf, fTag); buf.append(fOutput); Index: Row.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Row.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Row.java 28 Mar 2004 19:14:39 -0000 1.4 --- Row.java 14 Apr 2004 19:54:22 -0000 1.5 *************** *** 77,81 **** } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { IRowMMLConverter converter = getMMLConverter(fTeXSymbol); --- 77,81 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { IRowMMLConverter converter = getMMLConverter(fTeXSymbol); *************** *** 84,90 **** } f.tagStart(buf, fTag); for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert2MML(f, buf); } f.tagEnd(buf, fTag); --- 84,91 ---- } + boolean noMROW = fTag.equals("mrow"); f.tagStart(buf, fTag); for (int i = 0; i < fList.size(); i++) { ! ((Node) fList.get(i)).convert2MML(f, buf, noMROW); } f.tagEnd(buf, fTag); Index: Node.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Node.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Node.java 19 Mar 2004 20:19:03 -0000 1.3 --- Node.java 14 Apr 2004 19:54:22 -0000 1.4 *************** *** 31,35 **** } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); --- 31,35 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { f.tagStart(buf, fTag); buf.append(fOutput); Index: TeX2MathMLFactory.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeX2MathMLFactory.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TeX2MathMLFactory.java 2 Apr 2004 21:07:01 -0000 1.8 --- TeX2MathMLFactory.java 14 Apr 2004 19:54:22 -0000 1.9 *************** *** 23,26 **** --- 23,30 ---- public final static String CSS_OPEN_SUB = "css_open_sub"; public final static String CSS_CLOSE_SUB = "css_close_sub"; + public final static String APPLY_FUNCTION = "apply_function"; + public final static String STRETCHY_FALSE = "stretchy_false"; + + public final static Map STRETCHY_FALSE_ATTR = new HashMap(); public final static boolean USE_IDENTIFIERS = true; *************** *** 73,77 **** public void convert2MML(Node node, StringBuffer buf) { ! node.convert2MML(this, buf); } --- 77,81 ---- public void convert2MML(Node node, StringBuffer buf) { ! node.convert2MML(this, buf, false); } *************** *** 142,241 **** // greek Symbols: ! CONSTANT_SYMBOLS.put("alpha", new Identifier(toEntity('\u03B1'))); ! CONSTANT_SYMBOLS.put("beta", new Identifier(toEntity('\u03B2'))); ! CONSTANT_SYMBOLS.put("chi", new Identifier(toEntity('\u03C7'))); ! CONSTANT_SYMBOLS.put("delta", new Identifier(toEntity('\u03B4'))); ! CONSTANT_SYMBOLS.put("Delta", new Identifier(toEntity('\u0394'))); ! CONSTANT_SYMBOLS.put("epsilon", new Identifier(toEntity('\u03B5'))); ! CONSTANT_SYMBOLS.put("varepsilon", new Identifier(toEntity('\u025B'))); ! CONSTANT_SYMBOLS.put("eta", new Identifier(toEntity('\u03B7'))); ! ! CONSTANT_SYMBOLS.put("gamma", new Identifier(toEntity('\u03B3'))); ! CONSTANT_SYMBOLS.put("Gamma", new Identifier(toEntity('\u0393'))); ! CONSTANT_SYMBOLS.put("iota", new Identifier(toEntity('\u03B9'))); ! CONSTANT_SYMBOLS.put("kappa", new Identifier(toEntity('\u03BA'))); ! CONSTANT_SYMBOLS.put("lambda", new Identifier(toEntity('\u03BB'))); ! CONSTANT_SYMBOLS.put("lambda", new Identifier(toEntity('\u039B'))); ! CONSTANT_SYMBOLS.put("mu", new Identifier(toEntity('\u03BC'))); ! CONSTANT_SYMBOLS.put("nu", new Identifier(toEntity('\u03BD'))); ! CONSTANT_SYMBOLS.put("omega", new Identifier(toEntity('\u03C9'))); ! CONSTANT_SYMBOLS.put("Omega", new Identifier(toEntity('\u03A9'))); ! CONSTANT_SYMBOLS.put("phi", new Identifier(toEntity('\u03C6'))); ! CONSTANT_SYMBOLS.put("varphi", new Identifier(toEntity('\u03D5'))); ! CONSTANT_SYMBOLS.put("Phi", new Identifier(toEntity('\u03A6'))); ! CONSTANT_SYMBOLS.put("pi", new Identifier(toEntity('\u03C0'))); ! CONSTANT_SYMBOLS.put("Pi", new Identifier(toEntity('\u03A0'))); ! CONSTANT_SYMBOLS.put("psi", new Identifier(toEntity('\u03C8'))); ! CONSTANT_SYMBOLS.put("rho", new Identifier(toEntity('\u03C1'))); ! CONSTANT_SYMBOLS.put("sigma", new Identifier(toEntity('\u03C3'))); ! CONSTANT_SYMBOLS.put("Sigma", new Identifier(toEntity('\u03A3'))); ! CONSTANT_SYMBOLS.put("tau", new Identifier(toEntity('\u03C4'))); ! CONSTANT_SYMBOLS.put("theta", new Identifier(toEntity('\u03B8'))); ! CONSTANT_SYMBOLS.put("vartheta", new Identifier(toEntity('\u03D1'))); ! CONSTANT_SYMBOLS.put("Theta", new Identifier(toEntity('\u0398'))); ! CONSTANT_SYMBOLS.put("upsilon", new Identifier(toEntity('\u0398'))); ! CONSTANT_SYMBOLS.put("xi", new Identifier(toEntity('\u03BE'))); ! CONSTANT_SYMBOLS.put("Xi", new Identifier(toEntity('\u039E'))); ! CONSTANT_SYMBOLS.put("zeta", new Identifier(toEntity('\u03B6'))); ! //standard functions ! CONSTANT_SYMBOLS.put("sin", new Operator("sin", CONSTANT)); ! CONSTANT_SYMBOLS.put("cos", new Operator("cos", CONSTANT)); ! CONSTANT_SYMBOLS.put("tan", new Operator("tan", CONSTANT)); ! CONSTANT_SYMBOLS.put("arcsin", new Operator("sin", CONSTANT)); ! CONSTANT_SYMBOLS.put("arccos", new Operator("cos", CONSTANT)); ! CONSTANT_SYMBOLS.put("arctan", new Operator("tan", CONSTANT)); ! CONSTANT_SYMBOLS.put("sinh", new Operator("sinh", CONSTANT)); ! CONSTANT_SYMBOLS.put("cosh", new Operator("cosh", CONSTANT)); ! CONSTANT_SYMBOLS.put("tanh", new Operator("tanh", CONSTANT)); ! CONSTANT_SYMBOLS.put("cot", new Operator("cot", CONSTANT)); ! CONSTANT_SYMBOLS.put("sec", new Operator("sec", CONSTANT)); ! CONSTANT_SYMBOLS.put("csc", new Operator("csc", CONSTANT)); ! CONSTANT_SYMBOLS.put("log", new Operator("log", CONSTANT)); ! CONSTANT_SYMBOLS.put("ln", new Operator("ln", CONSTANT)); ! CONSTANT_SYMBOLS.put("det", new Operator("det", CONSTANT)); ! CONSTANT_SYMBOLS.put("dim", new Operator("dim", CONSTANT)); ! CONSTANT_SYMBOLS.put("mod", new Operator("mod", CONSTANT)); ! CONSTANT_SYMBOLS.put("gcd", new Operator("gcd", CONSTANT)); ! CONSTANT_SYMBOLS.put("lcm", new Operator("lcm", CONSTANT)); //miscellaneous symbols ! CONSTANT_SYMBOLS.put("partial", new Operator(toEntity('\u2202'), CONSTANT)); ! CONSTANT_SYMBOLS.put("nabla", new Operator(toEntity('\u2207'), CONSTANT)); ! CONSTANT_SYMBOLS.put("pm", new Operator(toEntity('\u00B1'), CONSTANT)); ! CONSTANT_SYMBOLS.put("emptyset", new Operator(toEntity('\u2205'), CONSTANT)); ! CONSTANT_SYMBOLS.put("infty", new Operator(toEntity('\u221E'), CONSTANT)); ! CONSTANT_SYMBOLS.put("aleph", new Operator(toEntity('\u2135'), CONSTANT)); ! CONSTANT_SYMBOLS.put("ldots", new Operator(toEntity('\u222B'), CONSTANT)); String quad = toEntity('\u00A0') + toEntity('\u00A0'); ! // TODO find a beter way to distinguish the different spacings: ! CONSTANT_SYMBOLS.put("!", new Operator(toEntity(' '), CONSTANT)); ! CONSTANT_SYMBOLS.put(",", new Operator(toEntity('\u00A0'), CONSTANT)); ! CONSTANT_SYMBOLS.put(";", new Operator(toEntity('\u00A0'), CONSTANT)); ! CONSTANT_SYMBOLS.put("quad", new Operator(quad, CONSTANT)); ! CONSTANT_SYMBOLS.put("qquad", new Operator(quad + quad, CONSTANT)); ! CONSTANT_SYMBOLS.put("cdots", new Operator(toEntity('\u22EF'), CONSTANT)); ! CONSTANT_SYMBOLS.put("diamond", new Operator(toEntity('\u22C4'), CONSTANT)); ! CONSTANT_SYMBOLS.put("square", new Operator(toEntity('\u25A1'), CONSTANT)); ! CONSTANT_SYMBOLS.put("lfloor", new Operator(toEntity('\u230A'), CONSTANT)); ! CONSTANT_SYMBOLS.put("rfloor", new Operator(toEntity('\u230B'), CONSTANT)); ! CONSTANT_SYMBOLS.put("lceiling", new Operator(toEntity('\u2308'), CONSTANT)); ! CONSTANT_SYMBOLS.put("rceiling", new Operator(toEntity('\u2309'), CONSTANT)); ! CONSTANT_SYMBOLS.put("mid", new Operator(toEntity('\u2223'), CONSTANT)); ! CONSTANT_SYMBOLS.put("circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("bigcirc", new Operator("◯", CONSTANT)); ! CONSTANT_SYMBOLS.put("wr", new Operator("≀", CONSTANT)); ! CONSTANT_SYMBOLS.put("odot", new Operator("⊙", CONSTANT)); ! CONSTANT_SYMBOLS.put("uplus", new Operator("⊎", CONSTANT)); ! CONSTANT_SYMBOLS.put("circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("sqcup", new Operator("⊔", CONSTANT)); ! CONSTANT_SYMBOLS.put("sqcap", new Operator("⊓", CONSTANT)); ! CONSTANT_SYMBOLS.put("rhd", new Operator("⊳", CONSTANT)); ! CONSTANT_SYMBOLS.put("lhd", new Operator("⊲", CONSTANT)); ! CONSTANT_SYMBOLS.put("unrhd", new Operator("⊵", CONSTANT)); ! CONSTANT_SYMBOLS.put("unlhd", new Operator("⊴", CONSTANT)); // {input:"\\ ", tag:"mo", output:"\u00A0"}, --- 146,224 ---- // greek Symbols: ! CONSTANT_SYMBOLS.put("\\alpha", new Identifier(toEntity('\u03B1'))); ! CONSTANT_SYMBOLS.put("\\beta", new Identifier(toEntity('\u03B2'))); ! CONSTANT_SYMBOLS.put("\\chi", new Identifier(toEntity('\u03C7'))); ! CONSTANT_SYMBOLS.put("\\delta", new Identifier(toEntity('\u03B4'))); ! CONSTANT_SYMBOLS.put("\\Delta", new Identifier(toEntity('\u0394'))); ! CONSTANT_SYMBOLS.put("\\epsilon", new Identifier(toEntity('\u03B5'))); ! CONSTANT_SYMBOLS.put("\\varepsilon", new Identifier(toEntity('\u025B'))); ! CONSTANT_SYMBOLS.put("\\eta", new Identifier(toEntity('\u03B7'))); ! CONSTANT_SYMBOLS.put("\\gamma", new Identifier(toEntity('\u03B3'))); ! CONSTANT_SYMBOLS.put("\\Gamma", new Identifier(toEntity('\u0393'))); ! CONSTANT_SYMBOLS.put("\\iota", new Identifier(toEntity('\u03B9'))); ! CONSTANT_SYMBOLS.put("\\kappa", new Identifier(toEntity('\u03BA'))); ! CONSTANT_SYMBOLS.put("\\lambda", new Identifier(toEntity('\u03BB'))); ! CONSTANT_SYMBOLS.put("\\Lambda", new Identifier(toEntity('\u039B'))); ! CONSTANT_SYMBOLS.put("\\mu", new Identifier(toEntity('\u03BC'))); ! CONSTANT_SYMBOLS.put("\\nu", new Identifier(toEntity('\u03BD'))); ! CONSTANT_SYMBOLS.put("\\omega", new Identifier(toEntity('\u03C9'))); ! CONSTANT_SYMBOLS.put("\\Omega", new Identifier(toEntity('\u03A9'))); ! CONSTANT_SYMBOLS.put("\\phi", new Identifier(toEntity('\u03C6'))); ! CONSTANT_SYMBOLS.put("\\varphi", new Identifier(toEntity('\u03D5'))); ! CONSTANT_SYMBOLS.put("\\Phi", new Identifier(toEntity('\u03A6'))); ! CONSTANT_SYMBOLS.put("\\pi", new Identifier(toEntity('\u03C0'))); ! CONSTANT_SYMBOLS.put("\\Pi", new Identifier(toEntity('\u03A0'))); ! CONSTANT_SYMBOLS.put("\\psi", new Identifier(toEntity('\u03C8'))); ! CONSTANT_SYMBOLS.put("\\rho", new Identifier(toEntity('\u03C1'))); ! CONSTANT_SYMBOLS.put("\\sigma", new Identifier(toEntity('\u03C3'))); ! CONSTANT_SYMBOLS.put("\\Sigma", new Identifier(toEntity('\u03A3'))); ! CONSTANT_SYMBOLS.put("\\tau", new Identifier(toEntity('\u03C4'))); ! CONSTANT_SYMBOLS.put("\\theta", new Identifier(toEntity('\u03B8'))); ! CONSTANT_SYMBOLS.put("\\vartheta", new Identifier(toEntity('\u03D1'))); ! CONSTANT_SYMBOLS.put("\\Theta", new Identifier(toEntity('\u0398'))); ! CONSTANT_SYMBOLS.put("\\upsilon", new Identifier(toEntity('\u0398'))); ! CONSTANT_SYMBOLS.put("\\xi", new Identifier(toEntity('\u03BE'))); ! CONSTANT_SYMBOLS.put("\\Xi", new Identifier(toEntity('\u039E'))); ! CONSTANT_SYMBOLS.put("\\zeta", new Identifier(toEntity('\u03B6'))); //miscellaneous symbols ! CONSTANT_SYMBOLS.put("\\partial", new Operator(toEntity('\u2202'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\nabla", new Operator(toEntity('\u2207'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\pm", new Operator(toEntity('\u00B1'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\emptyset", new Operator(toEntity('\u2205'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\infty", new Operator(toEntity('\u221E'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\aleph", new Operator(toEntity('\u2135'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\ldots", new Operator(toEntity('\u222B'), CONSTANT)); String quad = toEntity('\u00A0') + toEntity('\u00A0'); ! // TODO find a better way to distinguish the different spacings: ! CONSTANT_SYMBOLS.put("\\!", new Space("-0.1667 em", "​")); ! CONSTANT_SYMBOLS.put("\\,", new Space("thinmathspace"," ")); ! CONSTANT_SYMBOLS.put("\\;", new Space("mediummathspace","  ")); ! CONSTANT_SYMBOLS.put("\\quad", new Space("thickmathspace", quad)); ! CONSTANT_SYMBOLS.put("\\qquad", new Space("verythickmathspace",quad+quad)); ! CONSTANT_SYMBOLS.put("\\cdots", new Operator(toEntity('\u22EF'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\diamond", new Operator(toEntity('\u22C4'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\square", new Operator(toEntity('\u25A1'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\lfloor", new Operator(toEntity('\u230A'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\rfloor", new Operator(toEntity('\u230B'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\lceiling", new Operator(toEntity('\u2308'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\rceiling", new Operator(toEntity('\u2309'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\mid", new Operator(toEntity('\u2223'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\bigcirc", new Operator("◯", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\wr", new Operator("≀", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\odot", new Operator("⊙", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\uplus", new Operator("⊎", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\circ", new Operator("∘", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\sqcup", new Operator("⊔", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\sqcap", new Operator("⊓", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\rhd", new Operator("⊳", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\lhd", new Operator("⊲", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\unrhd", new Operator("⊵", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\unlhd", new Operator("⊴", CONSTANT)); // {input:"\\ ", tag:"mo", output:"\u00A0"}, *************** *** 247,297 **** //arrows ! CONSTANT_SYMBOLS.put("uparrow", new Operator(toEntity('\u2191'), CONSTANT)); ! CONSTANT_SYMBOLS.put("downarrow", new Operator(toEntity('\u2193'), CONSTANT)); ! CONSTANT_SYMBOLS.put("rightarrow", new Operator(toEntity('\u2192'), CONSTANT)); ! CONSTANT_SYMBOLS.put("to", new Operator(toEntity('\u2192'), CONSTANT)); ! CONSTANT_SYMBOLS.put("leftarrow", new Operator(toEntity('\u2190'), CONSTANT)); ! CONSTANT_SYMBOLS.put("leftrightarrow", new Operator(toEntity('\u2194'), CONSTANT)); ! CONSTANT_SYMBOLS.put("Rightarrow", new Operator(toEntity('\u21D2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("Leftarrow", new Operator(toEntity('\u21D0'), CONSTANT)); ! CONSTANT_SYMBOLS.put("Leftrightarrow", new Operator(toEntity('\u21D4'), CONSTANT)); //binary relation symbols ! CONSTANT_SYMBOLS.put("ne", new Operator(toEntity('\u2260'), CONSTANT)); CONSTANT_SYMBOLS.put("<", new Operator(toEntity('<'), CONSTANT)); CONSTANT_SYMBOLS.put(">", new Operator(toEntity('>'), CONSTANT)); ! CONSTANT_SYMBOLS.put("le", new Operator(toEntity('\u2264'), CONSTANT)); ! CONSTANT_SYMBOLS.put("leq", new Operator(toEntity('\u2264'), CONSTANT)); ! CONSTANT_SYMBOLS.put("gne", new Operator(toEntity('\u2265'), CONSTANT)); ! CONSTANT_SYMBOLS.put("geq", new Operator(toEntity('\u2265'), CONSTANT)); ! CONSTANT_SYMBOLS.put("prec", new Operator(toEntity('\u227A'), CONSTANT)); ! CONSTANT_SYMBOLS.put("succ", new Operator(toEntity('\u227B'), CONSTANT)); ! CONSTANT_SYMBOLS.put("in", new Operator(toEntity('\u2208'), CONSTANT)); ! CONSTANT_SYMBOLS.put("notin", new Operator(toEntity('\u2209'), CONSTANT)); ! CONSTANT_SYMBOLS.put("subset", new Operator(toEntity('\u2282'), CONSTANT)); ! CONSTANT_SYMBOLS.put("supset", new Operator(toEntity('\u2283'), CONSTANT)); ! CONSTANT_SYMBOLS.put("subseteq", new Operator(toEntity('\u2286'), CONSTANT)); ! CONSTANT_SYMBOLS.put("supseteq", new Operator(toEntity('\u2287'), CONSTANT)); ! CONSTANT_SYMBOLS.put("equiv", new Operator(toEntity('\u2261'), CONSTANT)); ! CONSTANT_SYMBOLS.put("cong", new Operator(toEntity('\u2245'), CONSTANT)); ! CONSTANT_SYMBOLS.put("approx", new Operator(toEntity('\u2248'), CONSTANT)); ! CONSTANT_SYMBOLS.put("propto", new Operator(toEntity('\u221D'), CONSTANT)); // {input:"lt", tag:"mo", output:"<"}, //logical symbols // {input:"and", tag:"mtext", output:"and", space:"1ex"}, // {input:"or", tag:"mtext", output:"or", space:"1ex"}, ! CONSTANT_SYMBOLS.put("neg", new Operator(toEntity('\u00AC'), CONSTANT)); ! CONSTANT_SYMBOLS.put("implies", new Operator(toEntity('\u21D2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("forall", new Operator(toEntity('\u2200'), CONSTANT)); ! CONSTANT_SYMBOLS.put("exists", new Operator(toEntity('\u2203'), CONSTANT)); ! CONSTANT_SYMBOLS.put("bot", new Operator(toEntity('\u22A5'), CONSTANT)); ! CONSTANT_SYMBOLS.put("top", new Operator(toEntity('\u22A4'), CONSTANT)); ! CONSTANT_SYMBOLS.put("vdash", new Operator(toEntity('\u22A2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("vdash", new Operator(toEntity('\u22A8'), CONSTANT)); // {input:"if", tag:"mo", output:"if", space:"1ex"}, // {input:"iff", tag:"mo", output:"\u21D4"}, ! // div = {input:"/", tag:"mfrac", output:"/", infix:true}, // sub = {input:"_", tag:"msub", output:"_", infix:true}, --- 230,286 ---- //arrows ! CONSTANT_SYMBOLS.put("\\uparrow", new Operator(toEntity('\u2191'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\downarrow", new Operator(toEntity('\u2193'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\rightarrow", new Operator(toEntity('\u2192'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\to", new Operator(toEntity('\u2192'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\leftarrow", new Operator(toEntity('\u2190'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\leftrightarrow", new Operator(toEntity('\u2194'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\Rightarrow", new Operator(toEntity('\u21D2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\Leftarrow", new Operator(toEntity('\u21D0'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\Leftrightarrow", new Operator(toEntity('\u21D4'), CONSTANT)); //binary relation symbols ! CONSTANT_SYMBOLS.put("\\ne", new Operator(toEntity('\u2260'), CONSTANT)); CONSTANT_SYMBOLS.put("<", new Operator(toEntity('<'), CONSTANT)); CONSTANT_SYMBOLS.put(">", new Operator(toEntity('>'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\le", new Operator(toEntity('\u2264'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\leq", new Operator(toEntity('\u2264'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\gne", new Operator(toEntity('\u2265'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\geq", new Operator(toEntity('\u2265'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\prec", new Operator(toEntity('\u227A'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\succ", new Operator(toEntity('\u227B'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\in", new Operator(toEntity('\u2208'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\notin", new Operator(toEntity('\u2209'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\subset", new Operator(toEntity('\u2282'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\supset", new Operator(toEntity('\u2283'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\subseteq", new Operator(toEntity('\u2286'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\supseteq", new Operator(toEntity('\u2287'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\equiv", new Operator(toEntity('\u2261'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\cong", new Operator(toEntity('\u2245'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\approx", new Operator(toEntity('\u2248'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\propto", new Operator(toEntity('\u221D'), CONSTANT)); // {input:"lt", tag:"mo", output:"<"}, + CONSTANT_SYMBOLS.put("\\lt", new Operator(toEntity('<'), CONSTANT)); + CONSTANT_SYMBOLS.put("\\gt", new Operator(toEntity('>'), CONSTANT)); //logical symbols // {input:"and", tag:"mtext", output:"and", space:"1ex"}, // {input:"or", tag:"mtext", output:"or", space:"1ex"}, ! CONSTANT_SYMBOLS.put("\\and", new Operator("∧", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\or", new Operator("∨", CONSTANT)); ! ! CONSTANT_SYMBOLS.put("\\neg", new Operator(toEntity('\u00AC'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\implies", new Operator(toEntity('\u21D2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\forall", new Operator(toEntity('\u2200'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\exists", new Operator(toEntity('\u2203'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\bot", new Operator(toEntity('\u22A5'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\top", new Operator(toEntity('\u22A4'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\vdash", new Operator(toEntity('\u22A2'), CONSTANT)); ! CONSTANT_SYMBOLS.put("\\vdash", new Operator(toEntity('\u22A8'), CONSTANT)); // {input:"if", tag:"mo", output:"if", space:"1ex"}, // {input:"iff", tag:"mo", output:"\u21D4"}, ! CONSTANT_SYMBOLS.put("\\iff", new Operator("⇔", CONSTANT)); ! CONSTANT_SYMBOLS.put("\\sim", new Operator("∼", CONSTANT)); // div = {input:"/", tag:"mfrac", output:"/", infix:true}, // sub = {input:"_", tag:"msub", output:"_", infix:true}, *************** *** 301,305 **** Map underoverAttr = new HashMap(); underoverAttr.put(UNDEROVER, "true"); ! Map intAttr = new HashMap(); intAttr.put(UNDEROVER, "true"); --- 290,294 ---- Map underoverAttr = new HashMap(); underoverAttr.put(UNDEROVER, "true"); ! Map intAttr = new HashMap(); intAttr.put(UNDEROVER, "true"); *************** *** 339,355 **** bigcupAttr.put(CSS_CLOSE, "</CuP>"); ! CONSTANT_SYMBOLS.put("int", new Operator(toEntity('\u222B'), CONSTANT, intAttr)); ! // CONSTANT_SYMBOLS.put("oint", new Operator("∮", CONSTANT, ointAttr)); ! CONSTANT_SYMBOLS.put("oint", new Operator(toEntity('\u222E'), CONSTANT, ointAttr)); ! CONSTANT_SYMBOLS.put("sum", new Operator(toEntity('\u2211'), CONSTANT, sumAttr)); ! CONSTANT_SYMBOLS.put("prod", new Operator(toEntity('\u220F'), CONSTANT, prodAttr)); ! CONSTANT_SYMBOLS.put("bigoplus", new Operator(toEntity('\u2295'), CONSTANT, bigoplusAttr)); ! CONSTANT_SYMBOLS.put("bigotimes", new Operator(toEntity('\u2297'), CONSTANT, bigotimesAttr)); ! CONSTANT_SYMBOLS.put("lim", new Operator("lim", CONSTANT, limAttr)); ! CONSTANT_SYMBOLS.put("bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("bigcap", new Operator(toEntity('\u22C2'), CONSTANT, bigcapAttr)); ! CONSTANT_SYMBOLS.put("bigcup", new Operator(toEntity('\u22C3'), CONSTANT, bigcupAttr)); CONSTANT_SYMBOLS.put("+", new Operator("+", CONSTANT)); --- 328,344 ---- bigcupAttr.put(CSS_CLOSE, "</CuP>"); ! CONSTANT_SYMBOLS.put("\\int", new Operator(toEntity('\u222B'), CONSTANT, intAttr)); ! // CONSTANT_SYMBOLS.put("\\oint", new Operator("∮", CONSTANT, ointAttr)); ! CONSTANT_SYMBOLS.put("\\oint", new Operator(toEntity('\u222E'), CONSTANT, ointAttr)); ! CONSTANT_SYMBOLS.put("\\sum", new Operator(toEntity('\u2211'), CONSTANT, sumAttr)); ! CONSTANT_SYMBOLS.put("\\prod", new Operator(toEntity('\u220F'), CONSTANT, prodAttr)); ! CONSTANT_SYMBOLS.put("\\bigoplus", new Operator(toEntity('\u2295'), CONSTANT, bigoplusAttr)); ! CONSTANT_SYMBOLS.put("\\bigotimes", new Operator(toEntity('\u2297'), CONSTANT, bigotimesAttr)); ! CONSTANT_SYMBOLS.put("\\lim", new Operator("lim", CONSTANT, limAttr)); ! CONSTANT_SYMBOLS.put("\\bigwedge", new Operator(toEntity('\u22C0'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("\\bigvee", new Operator(toEntity('\u22C1'), CONSTANT, underoverAttr)); ! CONSTANT_SYMBOLS.put("\\bigcap", new Operator(toEntity('\u22C2'), CONSTANT, bigcapAttr)); ! CONSTANT_SYMBOLS.put("\\bigcup", new Operator(toEntity('\u22C3'), CONSTANT, bigcupAttr)); CONSTANT_SYMBOLS.put("+", new Operator("+", CONSTANT)); *************** *** 360,384 **** CONSTANT_SYMBOLS.put("!", new Operator("!", CONSTANT)); CONSTANT_SYMBOLS.put("|", new Operator(toEntity('\u2223'), CONSTANT)); ! CONSTANT_SYMBOLS.put("sqrt", new Row("sqrt", "msqrt", UNARY)); ! CONSTANT_SYMBOLS.put("root", new Row("root", "mroot", BINARY)); ! CONSTANT_SYMBOLS.put("frac", new Row("frac", "mfrac", BINARY)); ! CONSTANT_SYMBOLS.put("mathbb", new Row("mathbb", "mathbb", UNARY)); ! CONSTANT_SYMBOLS.put("hat", new Row("hat", "hat", UNARY)); ! CONSTANT_SYMBOLS.put("bar", new Row("bar", "bar", UNARY)); ! CONSTANT_SYMBOLS.put("vec", new Row("vec", "vec", UNARY)); ! CONSTANT_SYMBOLS.put("dot", new Row("dot", "dot", UNARY)); ! CONSTANT_SYMBOLS.put("ddot", new Row("ddot", "ddot", UNARY)); ! CONSTANT_SYMBOLS.put("ul", new Row("ul", "ul", UNARY)); ! CONSTANT_SYMBOLS.put("text", new Row("text", "text", UNARY)); ! CONSTANT_SYMBOLS.put("mbox", new Row("mbox", "mbox", UNARY)); // text = {input:"text", tag:"mtext", output:"text", unary:true}, // mbox = {input:"mbox", tag:"mtext", output:"mbox", unary:true}, ! ! CONSTANT_SYMBOLS.put("^", new Row("sup", "msup", INFIX)); ! CONSTANT_SYMBOLS.put("_", new Row("sub", "msub", INFIX)); } } --- 349,406 ---- CONSTANT_SYMBOLS.put("!", new Operator("!", CONSTANT)); CONSTANT_SYMBOLS.put("|", new Operator(toEntity('\u2223'), CONSTANT)); + CONSTANT_SYMBOLS.put("^", new Row("sup", "msup", INFIX)); + CONSTANT_SYMBOLS.put("_", new Row("sub", "msub", INFIX)); + CONSTANT_SYMBOLS.put("\\_", new Operator("_", CONSTANT)); + CONSTANT_SYMBOLS.put("\\^", new Operator("^", CONSTANT)); + CONSTANT_SYMBOLS.put("\\{", new Operator("{", CONSTANT)); + CONSTANT_SYMBOLS.put("\\}", new Operator("}", CONSTANT)); + + CONSTANT_SYMBOLS.put("\\sqrt", new Row("sqrt", "msqrt", UNARY)); + CONSTANT_SYMBOLS.put("\\root", new Row("root", "mroot", BINARY)); + CONSTANT_SYMBOLS.put("\\frac", new Row("frac", "mfrac", BINARY)); ! CONSTANT_SYMBOLS.put("\\mathbb", new Row("mathbb", "mathbb", UNARY)); ! CONSTANT_SYMBOLS.put("\\hat", new Row("hat", "hat", UNARY)); ! CONSTANT_SYMBOLS.put("\\bar", new Row("bar", "bar", UNARY)); ! CONSTANT_SYMBOLS.put("\\vec", new Row("vec", "vec", UNARY)); ! CONSTANT_SYMBOLS.put("\\dot", new Row("dot", "dot", UNARY)); ! CONSTANT_SYMBOLS.put("\\ddot", new Row("ddot", "ddot", UNARY)); ! CONSTANT_SYMBOLS.put("\\ul", new Row("ul", "ul", UNARY)); ! // text and mbox are hard coded: ! // CONSTANT_SYMBOLS.put("\\text", new Row("text", "text", UNARY)); ! // CONSTANT_SYMBOLS.put("\\mbox", new Row("mbox", "mbox", UNARY)); // text = {input:"text", tag:"mtext", output:"text", unary:true}, // mbox = {input:"mbox", tag:"mtext", output:"mbox", unary:true}, ! ! ! //standard functions ! Map applyFunctionAttr = new HashMap(); ! applyFunctionAttr.put(APPLY_FUNCTION, "true");//"⁡" + CONSTANT_SYMBOLS.put("\\sin", new Operator("sin", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\cos", new Operator("cos", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\tan", new Operator("tan", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\arcsin", new Operator("sin", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\arccos", new Operator("cos", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\arctan", new Operator("tan", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\sinh", new Operator("sinh", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\cosh", new Operator("cosh", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\tanh", new Operator("tanh", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\cot", new Operator("cot", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\sec", new Operator("sec", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\csc", new Operator("csc", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\log", new Operator("log", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\ln", new Operator("ln", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\det", new Operator("det", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\dim", new Operator("dim", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\mod", new Operator("mod", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\gcd", new Operator("gcd", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\lcm", new Operator("lcm", CONSTANT, applyFunctionAttr)); + CONSTANT_SYMBOLS.put("\\ker", new Operator("ker", CONSTANT, applyFunctionAttr)); + + + STRETCHY_FALSE_ATTR.put(STRETCHY_FALSE, "true"); } } Index: Identifier.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Identifier.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Identifier.java 19 Mar 2004 20:19:03 -0000 1.3 --- Identifier.java 14 Apr 2004 19:54:22 -0000 1.4 *************** *** 14,18 **** } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf) { f.tagStart(buf, fTag); buf.append(fOutput); --- 14,18 ---- } ! public void convert2MML(TeX2MathMLFactory f, StringBuffer buf, boolean noMrowTags) { f.tagStart(buf, fTag); buf.append(fOutput); |
|
From: Klaus H. <js...@us...> - 2004-04-14 19:53:23
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20065/src/org/hartmath/tex2mml/reflection/convert Modified Files: Root.java Mathbf.java Hat.java Bar.java Sup.java Sqrt.java Vector.java Ul.java Mathsf.java Dot.java Sub.java Vec.java Ddot.java Matrix.java Mbox.java Mathtt.java Log Message: misc changes Index: Hat.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Hat.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hat.java 19 Mar 2004 20:19:03 -0000 1.3 --- Hat.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u005E')); // '^' Index: Bar.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Bar.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Bar.java 19 Mar 2004 20:19:03 -0000 1.3 --- Bar.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u00AF')); // Index: Matrix.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Matrix.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Matrix.java 19 Mar 2004 20:19:03 -0000 1.1 --- Matrix.java 14 Apr 2004 19:53:12 -0000 1.2 *************** *** 27,31 **** f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); ! temp.convert2MML(f, buf); f.tagEnd(buf, "mtd"); } --- 27,31 ---- f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); ! temp.convert2MML(f, buf, false); f.tagEnd(buf, "mtd"); } Index: Mathtt.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathtt.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mathtt.java 19 Mar 2004 20:19:03 -0000 1.3 --- Mathtt.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"monospace\""); ! row.get(0).convert2MML(f, buf, false); f.tagEnd(buf, "mstyle"); return true; Index: Vec.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Vec.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Vec.java 19 Mar 2004 20:19:03 -0000 1.3 --- Vec.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u2192')); // '^' Index: Sup.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sup.java 19 Mar 2004 20:19:03 -0000 1.3 --- Sup.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 24,30 **** if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSub0.convert2MML(f, buf); ! rowSub0.get(1).convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "munderover"); return true; --- 24,30 ---- if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSub0.convert2MML(f, buf, false); ! rowSub0.get(1).convert2MML(f, buf, false); ! row.get(1).convert2MML(f, buf, false); f.tagEnd(buf, "munderover"); return true; *************** *** 34,39 **** if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "mover"); ! nSup0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "mover"); return true; --- 34,39 ---- if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "mover"); ! nSup0.convert2MML(f, buf, false); ! row.get(1).convert2MML(f, buf, false); f.tagEnd(buf, "mover"); return true; Index: Mbox.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mbox.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mbox.java 19 Mar 2004 20:19:03 -0000 1.3 --- Mbox.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 6,10 **** public class Mbox implements IRowMMLConverter { ! /* * (non-Javadoc) --- 6,10 ---- public class Mbox implements IRowMMLConverter { ! /* * (non-Javadoc) *************** *** 15,21 **** public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! f.tagStart(buf, "mbox"); ! row.get(0).convert2MML(f, buf); ! f.tagEnd(buf, "mbox"); return true; } --- 15,21 ---- public boolean convert(StringBuffer buf, Row row, TeX2MathMLFactory f) { if (row.size() == 1) { ! f.tagStart(buf, "mtext"); ! buf.append(row.get(0).getOutput()); ! f.tagEnd(buf, "mtext"); return true; } Index: Ul.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ul.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ul.java 19 Mar 2004 20:19:03 -0000 1.3 --- Ul.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "munder"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "munder"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append(TeX2MathMLFactory.toEntity('\u0332')); // '^' Index: Vector.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Vector.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Vector.java 19 Mar 2004 20:19:03 -0000 1.1 --- Vector.java 14 Apr 2004 19:53:12 -0000 1.2 *************** *** 27,31 **** f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); ! temp.convert2MML(f, buf); f.tagEnd(buf, "mtd"); } --- 27,31 ---- f.tagStart(buf, "mtd"); temp = (Node) oneRow.get(j); ! temp.convert2MML(f, buf, false); f.tagEnd(buf, "mtd"); } Index: Mathbf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathbf.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mathbf.java 19 Mar 2004 20:19:03 -0000 1.3 --- Mathbf.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontweight=\"bold\""); ! row.get(0).convert2MML(f, buf, false); f.tagEnd(buf, "mstyle"); return true; Index: Ddot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Ddot.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Ddot.java 19 Mar 2004 20:19:03 -0000 1.3 --- Ddot.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append(".."); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append(".."); // '^' Index: Mathsf.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Mathsf.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Mathsf.java 19 Mar 2004 20:19:03 -0000 1.3 --- Mathsf.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "mstyle"); return true; --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mstyle", "fontfamily=\"sans-serif\""); ! row.get(0).convert2MML(f, buf, false); f.tagEnd(buf, "mstyle"); return true; Index: Dot.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Dot.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Dot.java 19 Mar 2004 20:19:03 -0000 1.3 --- Dot.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 16,20 **** if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf); f.tagStart(buf, "mo"); buf.append("."); // '^' --- 16,20 ---- if (row.size() == 1) { f.tagStart(buf, "mover"); ! row.get(0).convert2MML(f, buf, false); f.tagStart(buf, "mo"); buf.append("."); // '^' Index: Sqrt.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sqrt.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Sqrt.java 28 Mar 2004 19:16:07 -0000 1.2 --- Sqrt.java 14 Apr 2004 19:53:12 -0000 1.3 *************** *** 21,31 **** if (args != null && args.size() > 0) { f.tagStart(buf, "mroot"); ! row.get(0).convert2MML(f, buf); ! ((Node) args.get(0)).convert2MML(f, buf); // nth root f.tagEnd(buf, "mroot"); return true; } else { f.tagStart(buf, "msqrt"); ! row.get(0).convert2MML(f, buf); f.tagEnd(buf, "msqrt"); return true; --- 21,31 ---- if (args != null && args.size() > 0) { f.tagStart(buf, "mroot"); ! row.get(0).convert2MML(f, buf, false); ! ((Node) args.get(0)).convert2MML(f, buf, false); // nth root f.tagEnd(buf, "mroot"); return true; } else { f.tagStart(buf, "msqrt"); ! row.get(0).convert2MML(f, buf, false); f.tagEnd(buf, "msqrt"); return true; Index: Root.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Root.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Root.java 19 Mar 2004 20:19:03 -0000 1.1 --- Root.java 14 Apr 2004 19:53:12 -0000 1.2 *************** *** 16,21 **** if (row.size() == 2) { f.tagStart(buf, "mroot"); ! row.get(0).convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "mroot"); return true; --- 16,21 ---- if (row.size() == 2) { f.tagStart(buf, "mroot"); ! row.get(0).convert2MML(f, buf, false); ! row.get(1).convert2MML(f, buf, false); f.tagEnd(buf, "mroot"); return true; Index: Sub.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/reflection/convert/Sub.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Sub.java 19 Mar 2004 20:19:03 -0000 1.3 --- Sub.java 14 Apr 2004 19:53:12 -0000 1.4 *************** *** 23,29 **** if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSup0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); ! rowSup0.get(1).convert2MML(f, buf); f.tagEnd(buf, "munderover"); return true; --- 23,29 ---- if (nSup0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munderover"); ! nSup0.convert2MML(f, buf, false); ! row.get(1).convert2MML(f, buf, false); ! rowSup0.get(1).convert2MML(f, buf, false); f.tagEnd(buf, "munderover"); return true; *************** *** 33,38 **** if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munder"); ! nSub0.convert2MML(f, buf); ! row.get(1).convert2MML(f, buf); f.tagEnd(buf, "munder"); return true; --- 33,38 ---- if (nSub0.containsAttribute(TeX2MathMLFactory.UNDEROVER)) { f.tagStart(buf, "munder"); ! nSub0.convert2MML(f, buf, false); ! row.get(1).convert2MML(f, buf, false); f.tagEnd(buf, "munder"); return true; |
|
From: Klaus H. <js...@us...> - 2004-04-02 21:28:22
|
Update of /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17038/src/org/hartmath/tex2css/test Modified Files: Parse2CSSTestCase.java Log Message: misc changes Index: Parse2CSSTestCase.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2css/test/Parse2CSSTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Parse2CSSTestCase.java 19 Mar 2004 20:59:20 -0000 1.1 --- Parse2CSSTestCase.java 2 Apr 2004 21:16:10 -0000 1.2 *************** *** 16,25 **** public void testParser() { ! tex2mml("\\infty", "∞"); ! tex2mml("\\sum_{k = 0}^{n}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); ! tex2mml("\\sum^{n}_{k = 0}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); ! tex2mml("\\left { \\right] \\left { \\right]", "<m>{]{]</m>"); ! tex2mml("\\begin{array}{cc}" + "a & b \\\\" + "c & d \\\\" + "\\end{array}", "<M><r><n>a</n><n>b</n></r><r><n>c</n><n>d</n></r></M>"); ! tex2mml("\\frac{1}{2}", "<f><r>1</r><r>2</r></f>"); // --- 16,29 ---- public void testParser() { ! tex2css("\\lim_{x \\rightarrow \\infty}", "<m><Lim>x→∞</Lim></m>"); ! ! tex2css("\\sqrt[3]{x}", "x<t>1/3</t>"); ! ! tex2css("\\infty", "∞"); ! tex2css("\\sum_{k = 0}^{n}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); ! tex2css("\\sum^{n}_{k = 0}", "<m><SuM><x>n</x><x>k=0</x></SuM></m>"); ! tex2css("\\left { \\right] \\left { \\right]", "<m>{]{]</m>"); ! tex2css("\\begin{array}{cc}" + "a & b \\\\" + "c & d \\\\" + "\\end{array}", "<M><r><n>a</n><n>b</n></r><r><n>c</n><n>d</n></r></M>"); ! tex2css("\\frac{1}{2}", "<f><r>1</r><r>2</r></f>"); // *************** *** 53,60 **** } ! public void tex2mml(String tex, String mml) { StringBuffer buf = new StringBuffer(); parser.initialize(tex); ! parser.parse2CSS(buf); assertEquals(buf.toString(), mml); } --- 57,64 ---- } ! public void tex2css(String tex, String mml) { StringBuffer buf = new StringBuffer(); parser.initialize(tex); ! parser.parse2CSS(buf, false); assertEquals(buf.toString(), mml); } |
|
From: Klaus H. <js...@us...> - 2004-04-02 21:28:08
|
Update of /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2mml/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16965/src/org/hartmath/tex2mml/test Modified Files: Parse2MMLTestCase.java Log Message: misc changes Index: Parse2MMLTestCase.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml.test/src/org/hartmath/tex2mml/test/Parse2MMLTestCase.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Parse2MMLTestCase.java 19 Mar 2004 21:01:32 -0000 1.1 --- Parse2MMLTestCase.java 2 Apr 2004 21:15:57 -0000 1.2 *************** *** 16,19 **** --- 16,21 ---- public void testParser() { + tex2mml("\\sqrt[3]{x}", "<m:mroot><m:mi>x</m:mi><m:mn>3</m:mn></m:mroot>"); + tex2mml("\\frac{1}{x_2}", "<m:mfrac><m:mn>1</m:mn><m:mrow><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:mrow></m:mfrac>"); |
|
From: Klaus H. <js...@us...> - 2004-04-02 21:19:12
|
Update of /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14950/src/org/hartmath/tex2mml Modified Files: Scanner.java TeX2MathMLFactory.java TeXParser.java Log Message: misc changes Index: Scanner.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/Scanner.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Scanner.java 28 Mar 2004 19:14:54 -0000 1.4 --- Scanner.java 2 Apr 2004 21:07:01 -0000 1.5 *************** *** 55,60 **** final static public int TT_DOUBLE_BACKSLASH = 56; final static public int TT_AMPERSAND = 57; ! ! final static public int TT_BEGIN = 60; final static public int TT_END = 61; --- 55,59 ---- final static public int TT_DOUBLE_BACKSLASH = 56; final static public int TT_AMPERSAND = 57; ! final static public int TT_BEGIN = 60; final static public int TT_END = 61; *************** *** 226,236 **** return; } ! if (fChar == '\\') { ! fCurrentPosition++; ! token = TT_DOUBLE_BACKSLASH; ! return; } } ! break; case '^' : token = TT_OPERATOR; --- 225,254 ---- return; } ! switch (fChar) { ! case '\\' : ! fCurrentPosition++; ! token = TT_DOUBLE_BACKSLASH; ! return; ! case '!' : ! fCurrentPosition++; ! token = TT_BACKSLASH_SYMBOL; ! fBackslashSymbol = "!"; ! return; ! case ',' : ! fCurrentPosition++; ! token = TT_BACKSLASH_SYMBOL; ! fBackslashSymbol = ","; ! return; ! case ';' : ! fCurrentPosition++; ! token = TT_BACKSLASH_SYMBOL; ! fBackslashSymbol = ";"; ! return; } } ! fCurrentPosition++; ! token = TT_BACKSLASH_SYMBOL; ! fBackslashSymbol = " "; ! return; case '^' : token = TT_OPERATOR; *************** *** 343,349 **** // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! // if (fChar == '$') { ! // getChar(); ! // } while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); --- 361,367 ---- // special identifiers beginning with "$$" are JSP/servlet specific variables !!! // see org.hmath.servlet.HMTag ! // if (fChar == '$') { ! // getChar(); ! // } while ((fChar >= 'a' && fChar <= 'z') || (fChar >= 'A' && fChar <= 'Z') || (fChar >= '0' && fChar <= '9')) { getChar(); *************** *** 352,402 **** int endPosition = fCurrentPosition--; int length = (--endPosition) - startPosition; ! // if (length == 1) { ! // return optimizedCurrentTokenSource1(startPosition, endPosition); ! // } // set default token: token = TT_BACKSLASH_SYMBOL; fBackslashSymbol = fSourceString.substring(startPosition, endPosition); ! if (fBackslashSymbol.length()>=3 && fBackslashSymbol.length()<=5) { ! int index = startPosition; ! switch(fBackslashSymbol.length()){ ! case 3: // \end ! if (fSourceString.charAt(index)=='e' && ! fSourceString.charAt(++index)=='n' && ! fSourceString.charAt(++index)=='d') { ! token = TT_END; ! return fBackslashSymbol; ! } ! break; ! case 4: // \left ! if (fSourceString.charAt(index)=='l' && ! fSourceString.charAt(++index)=='e' && ! fSourceString.charAt(++index)=='f' && ! fSourceString.charAt(++index)=='t') { ! token = TT_LEFT; ! return fBackslashSymbol; ! } ! break; ! case 5: // \begin \right ! if (fSourceString.charAt(index)=='b' && ! fSourceString.charAt(++index)=='e' && ! fSourceString.charAt(++index)=='g' && ! fSourceString.charAt(++index)=='i' && ! fSourceString.charAt(++index)=='n') { ! token = TT_BEGIN; ! return fBackslashSymbol; ! } ! index = startPosition; ! if (fSourceString.charAt(index)=='r' && ! fSourceString.charAt(++index)=='i' && ! fSourceString.charAt(++index)=='g' && ! fSourceString.charAt(++index)=='h' && ! fSourceString.charAt(++index)=='t') { ! token = TT_RIGHT; ! return fBackslashSymbol; ! } ! break; ! } ! } return fBackslashSymbol; } --- 370,418 ---- int endPosition = fCurrentPosition--; int length = (--endPosition) - startPosition; ! // if (length == 1) { ! // return optimizedCurrentTokenSource1(startPosition, endPosition); ! // } // set default token: token = TT_BACKSLASH_SYMBOL; fBackslashSymbol = fSourceString.substring(startPosition, endPosition); ! if (fBackslashSymbol.length() >= 3 && fBackslashSymbol.length() <= 5) { ! int index = startPosition; ! switch (fBackslashSymbol.length()) { ! case 3 : // \end ! if (fSourceString.charAt(index) == 'e' && fSourceString.charAt(++index) == 'n' && fSourceString.charAt(++index) == 'd') { ! token = TT_END; ! return fBackslashSymbol; ! } ! break; ! case 4 : // \left ! if (fSourceString.charAt(index) == 'l' ! && fSourceString.charAt(++index) == 'e' ! && fSourceString.charAt(++index) == 'f' ! && fSourceString.charAt(++index) == 't') { ! token = TT_LEFT; ! return fBackslashSymbol; ! } ! break; ! case 5 : // \begin \right ! if (fSourceString.charAt(index) == 'b' ! && fSourceString.charAt(++index) == 'e' ! && fSourceString.charAt(++index) == 'g' ! && fSourceString.charAt(++index) == 'i' ! && fSourceString.charAt(++index) == 'n') { ! token = TT_BEGIN; ! return fBackslashSymbol; ! } ! index = startPosition; ! if (fSourceString.charAt(index) == 'r' ! && fSourceString.charAt(++index) == 'i' ! && fSourceString.charAt(++index) == 'g' ! && fSourceString.charAt(++index) == 'h' ! && fSourceString.charAt(++index) == 't') { ! token = TT_RIGHT; ! return fBackslashSymbol; ! } ! break; ! } ! } return fBackslashSymbol; } Index: TeX2MathMLFactory.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeX2MathMLFactory.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** TeX2MathMLFactory.java 28 Mar 2004 19:15:09 -0000 1.7 --- TeX2MathMLFactory.java 2 Apr 2004 21:07:01 -0000 1.8 *************** *** 210,213 **** --- 210,217 ---- CONSTANT_SYMBOLS.put("ldots", new Operator(toEntity('\u222B'), CONSTANT)); String quad = toEntity('\u00A0') + toEntity('\u00A0'); + // TODO find a beter way to distinguish the different spacings: + CONSTANT_SYMBOLS.put("!", new Operator(toEntity(' '), CONSTANT)); + CONSTANT_SYMBOLS.put(",", new Operator(toEntity('\u00A0'), CONSTANT)); + CONSTANT_SYMBOLS.put(";", new Operator(toEntity('\u00A0'), CONSTANT)); CONSTANT_SYMBOLS.put("quad", new Operator(quad, CONSTANT)); CONSTANT_SYMBOLS.put("qquad", new Operator(quad + quad, CONSTANT)); Index: TeXParser.java =================================================================== RCS file: /cvsroot/hmath/org.hartmath.tex2mml/src/org/hartmath/tex2mml/TeXParser.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TeXParser.java 28 Mar 2004 19:15:50 -0000 1.6 --- TeXParser.java 2 Apr 2004 21:07:01 -0000 1.7 *************** *** 230,233 **** --- 230,236 ---- getNextToken(); return new Operator("["); + } else if (token == TT_OPERATOR && fOperatorString=="|") { + getNextToken(); + return new Operator(TeX2MathMLFactory.toEntity('\u2223')); // '|' or \mid } case TT_RIGHT : *************** *** 242,250 **** getNextToken(); return new Operator("]"); } } return null; } ! /** * --- 245,256 ---- getNextToken(); return new Operator("]"); + } else if (token == TT_OPERATOR && fOperatorString=="|") { + getNextToken(); + return new Operator(TeX2MathMLFactory.toEntity('\u2223')); // '|' or \mid } } return null; } ! /** * |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:44:07
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12916/WEB-INF/src/org/hartmath/server/filter Modified Files: ParserFilter.java Log Message: misc changes Index: ParserFilter.java =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/org/hartmath/server/filter/ParserFilter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ParserFilter.java 9 Mar 2004 20:13:03 -0000 1.1 --- ParserFilter.java 2 Apr 2004 18:31:56 -0000 1.2 *************** *** 47,52 **** /** * Parse the input and transform it for the most used wiki patterns ! */ ! public class ParserFilter extends FilterSupport implements CacheFilter { private FilterContext fContext; --- 47,53 ---- /** * Parse the input and transform it for the most used wiki patterns ! * ! * @deprected use WikipediaFilter instead ! **/ public class ParserFilter extends FilterSupport implements CacheFilter { private FilterContext fContext; |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:41:53
|
Update of /cvsroot/hmath/org.hmath.server/admin/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12546/admin/images Added Files: snipsnap-logo.png attention.jpg Log Message: misc changes --- NEW FILE: attention.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: snipsnap-logo.png --- (This appears to be a binary file; contents omitted.) |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:41:34
|
Update of /cvsroot/hmath/org.hmath.server/admin/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12523/admin/css Added Files: config.css Log Message: misc changes --- NEW FILE: config.css --- /** * Design of the configurator. * @author Matthias L. Jugel * @version $Id: config.css,v 1.12 2004/02/06 13:41:30 leo Exp $ */ body { background-color: #ffffff; color: #4c4c4c; font-size: 12pt; font-family: "Lucida Grande", "Trebuchet MS", Verdana, Geneva, Lucida, Helvetica, sans-serif; font-weight: normal; margin: 0px; padding: 0px; } .header { position: relative; padding: 5px; display: block; } .info { vertical-align: top; float: right; color: #999999; font-size: x-small; position: relative; } .info ul { padding-top: 0px; margin-top: 0px; list-style-type: none; } .content { clear: both; width: 100%; } .configuration { clear: both; padding: 0px; border-bottom: 1px solid #999999; border-top: 1px solid #999999; display: block; width: 100%; } .guide { width: 30%; padding: 10px 5px 5px 5px; border-right: 1px solid #999999; vertical-align: top; } .guide a:link { color: #999999; text-decoration: none; } .guide a:visited { color: #999999; text-decoration: none; } .guide a:active { color: #000000; } .guide a:hover { color: #000000; } .guide ul { list-style-type: circle; } li.current-step { font-weight: bold; } .step-info { border: 1px dashed #999999; color: black; padding: 5px; font-size: 90%; } .edit { width: 70%; background: white; color: black; padding-left: 10px; padding-right: 0px; padding-bottom: 5px; margin: 0px; } .edit .step { font-size: large; padding: 10px; padding-left: 5px; } .errors { padding-left: 5px; font-size: x-small; font-weight: normal; } .errors li { display: block; font-weight: bold; padding: 0px; margin: 0px; color: red; } .errors ul { padding-top: 0px; margin-top: 0px; list-style-type: none; } .navigation { vertical-align: bottom; text-align: right; width: 100%; } .edit > table { border-collapse: collapse; border-spacing: 0px; border: 0px; padding: 0px; width: 100%; } .edit td { margin: 0px; padding-top: 5px; padding-bottom: 5px; padding-left: 5px; padding-right: 5px; vertical-align: top; font-size: x-small; font-weight: bold; line-height: 1.6em; border: 1px solid white; color: black; } .edit > table td:first-child { background: #eeeeee; /*color: black;*/ text-align: justify; width: 40%; font-size: x-small; font-weight: normal; line-height: 1.2em; } .edit .hint { font-size: x-small; font-weight: normal; color: #999999; } .finish { font-size: small; padding: 5px; } .finish .start { margin-left: 20%; width: 60%; text-alignment: center; padding: 7px; } .start input { font-size: 150%; padding: 3px; background-color: #eeeeee; color: green; } .advanced { margin-left: 40px; margin-top: 10px; align: center; background: #eeeeee; padding: 5px; font-size: x-small; width: 60%; } .advanced ul { list-style-type: none; } .users { width: 100%; } .users-pages { font-size: x-small; margin-bottom: 5px; } .users table { width: 100%; margin: 0px; padding: 0px; border: 1px; } .users td { padding-left: 2px; padding-right: 2px; padding-top: 1px; padding-bottom: 1px; margin: 0px; border: 0px; text-align: left; } .users th { text-align: left; } .users-even { background: #eeeeee; } .statusbar { width: 200px; border: 1px solid black; } .statusbar td { width: 5px; height: 10px; background-color: #eeeeee; } .statusbar td.completed { background-color: #999999; } |
Update of /cvsroot/hmath/org.hmath.server/admin/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12321/admin/config Added Files: users.jsp users.edit.jsp users.list.jsp finish.jsp search.jsp administrator.jsp localization.jsp proxy.jsp mail.jsp moblog.jsp export.jsp statusbar.jsp application.jsp theme.jsp database.jsp info.jsp import.jsp expert.jsp login.jsp permissions.jsp nav.jsp guide.jsp maintenance.jsp Log Message: misc changes --- NEW FILE: users.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration, org.snipsnap.app.Application, org.snipsnap.container.Components, org.snipsnap.user.UserManager"%> <%-- ** User management ** @author Matthias L. Jugel ** @version $Id: users.jsp,v 1.5 2004/01/17 21:36:27 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <c:choose> <c:when test="${not empty edit}"> <c:import url="config/users.edit.jsp"/> </c:when> <c:otherwise> <div class="users"> <c:import url="config/users.list.jsp"/> </div> </c:otherwise> </c:choose> --- NEW FILE: users.list.jsp --- <%@ page import="org.snipsnap.user.UserManager, org.snipsnap.container.Components, java.util.List" %> <%-- ** User management: list existing users ** @author Matthias L. Jugel ** @version $Id: users.list.jsp,v 1.5 2004/01/17 22:00:01 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="users-pages"> <fmt:message key="config.users.page"/> <% UserManager um = (UserManager) Components.getComponent(UserManager.class); String startStr = request.getParameter("start"); if (startStr != null && !"".equals(startStr)) { session.setAttribute("__usersStart", startStr); } else { session.setAttribute("__usersStart", "0"); } int start = Integer.parseInt((String) session.getAttribute("__usersStart")); String displayCountStr = request.getParameter("show"); if (displayCountStr != null && !"".equals(displayCountStr)) { session.setAttribute("__displayCount", displayCountStr); } else { session.setAttribute("__displayCount", "15"); } int displayCount = Integer.parseInt((String) session.getAttribute("__displayCount")); int pageCounter = 1; List usersList = um.getAll(); for (int count = 0; count < usersList.size(); count += displayCount) { if (count < start || count >= start + displayCount) { out.print(" <a href=\"configure?select=users&start=" + count + "\">" + (pageCounter++) + "</a>"); } else { out.print(" " + pageCounter++); } } pageContext.setAttribute("users", usersList.subList(start, Math.min(usersList.size(), start + displayCount))); %> </div> <table> <tr> <th><fmt:message key="config.users.login"/></th> <th><fmt:message key="config.users.email"/></th> <th><fmt:message key="config.users.roles"/></th> <th><fmt:message key="config.users.lastlogin"/></th> <th colspan="2"><fmt:message key="config.users.action"/></th> </tr> <tr> <td colspan="5"> [<a href="configure?step=users&edit=true&login="><fmt:message key="config.users.create"/></a>]<br/> </td> </tr> <c:forEach items="${users}" var="user" varStatus="idx"> <tr <c:choose> <c:when test="${idx.count mod 2 == 0}">class="users-odd"</c:when> <c:otherwise>class="users-even"</c:otherwise> </c:choose>> <td> <span class="nobr"><b><a href="../space/<c:out value='${user.login}'/>"><c:out value="${user.login}"/></a></b></span> <c:if test="${not empty user.status && user.status != 'not set'}"><br/><fmt:message key="config.users.status"/> <i><c:out value="${user.status}"/></i></c:if><br/> </td> <td> <c:if test="${user.email != null}"> <a href="mailto:<c:out value="${user.email}"/>"><c:out value="${user.email}"/></a> </c:if> </td> <td><span class="nobr"><c:out value="${user.roles}"/></span></td> <td><fmt:formatDate pattern="yyyy-MM-dd hh:mm" value="${user.lastLogin}"/></td> <td> [<a href="configure?step=users&edit=true&login=<c:out value='${user.login}'/>"><fmt:message key="config.users.edit"/></a>] </td> <td> <c:if test="${configuser.login != user.login}"> [<a style="color:red" href="configure?step=users&remove=<c:out value='${user.login}'/>"><fmt:message key="config.users.remove"/></a>] </c:if> </td> </tr> </c:forEach> </table> --- NEW FILE: finish.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** The Finish ** @author Matthias L. Jugel ** @version $Id: finish.jsp,v 1.6 2004/01/22 07:22:21 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="finish"> <div><fmt:message key="config.finish"/></div> <div class="start"><center><input type="submit" name="finish" value="<fmt:message key="config.nav.finish"/>"></center></div> <c:choose> <c:when test="${empty advanced}"> <script type="text/javascript" language="Javascript"> <!-- function enableOnCheck(checkbox) { document.getElementById("submit.advanced").disabled = !checkbox.checked; if(checkbox.name == 'advanced.all') { <%-- document.getElementById("advanced.application").disabled = checkbox.checked;--%> document.getElementById("advanced.theme").disabled = checkbox.checked; document.getElementById("advanced.localization").disabled = checkbox.checked; document.getElementById("advanced.moblog").disabled = checkbox.checked; document.getElementById("advanced.mail").disabled = checkbox.checked; document.getElementById("advanced.proxy").disabled = checkbox.checked; document.getElementById("advanced.database").disabled = checkbox.checked; } } --> </script> <div class="advanced"> <fmt:message key="config.advanced"/> <ul> <%-- <li> <input onClick="enableOnCheck(this);" id="advanced.application" type="checkbox" name="advanced.step.application"> <fmt:message key="config.advanced.application"/> </li> --%> <li> <input onClick="enableOnCheck(this);" id="advanced.theme" type="checkbox" name="advanced.step.theme"> <fmt:message key="config.advanced.theme"/> </li> <li> <input onClick="enableOnCheck(this);" id="advanced.localization" type="checkbox" name="advanced.step.localization"> <fmt:message key="config.advanced.localization"/> </li> <li> <input onClick="enableOnCheck(this);" id="advanced.moblog" type="checkbox" name="advanced.step.moblog"> <fmt:message key="config.advanced.moblog"/> </li> <li> <input onClick="enableOnCheck(this);" id="advanced.mail" type="checkbox" name="advanced.step.mail"> <fmt:message key="config.advanced.mail"/> </li> <li> <input onClick="enableOnCheck(this);" id="advanced.proxy" type="checkbox" name="advanced.step.proxy"> <fmt:message key="config.advanced.proxy"/> </li> <%-- <li>--%> <%-- <input onClick="enableOnCheck(this);" id="advanced.database" type="checkbox" name="advanced.step.database">--%> <%-- <fmt:message key="config.advanced.database"/>--%> <%-- </li>--%> <li> <input onClick="enableOnCheck(this);" type="checkbox" name="advanced.all"> <fmt:message key="config.advanced.all"/> </li> </ul> </div> </c:when> <c:otherwise> <div class="advanced"><fmt:message key="config.advanced.forgot"/></div> </c:otherwise> </c:choose> </div> --- NEW FILE: export.jsp --- <%-- ** Mail Settings ** @author Matthias L. Jugel ** @version $Id: export.jsp,v 1.5 2004/02/11 14:13:57 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <c:choose> <c:when test="${not empty running && not empty running.export}"> <tr> <td> <fmt:message key="config.export.running"/> <fmt:message key="config.refresh.text"/> </td> <td> <c:import url="config/statusbar.jsp"> <c:param name="statusMessage" value="config.status"/> <c:param name="statusMax" value="${running.max}"/> <c:param name="statusCurrent" value="${running.current}"/> </c:import> <br/> <a href="configure?step=export"><fmt:message key="config.refresh"/></a> </td> </tr> </c:when> <c:otherwise> <tr> <td><fmt:message key="config.export.file.text"/></td> <td> <input type="radio" name="export.file" value="download" <c:if test="${empty exportFile || exportFile == 'download'}">checked="checked"</c:if>> <fmt:message key="config.export.download"/> <c:if test="${!empty errors['export.file']}"><img src="images/attention.jpg"></c:if> <input type="radio" name="export.file" value="webinf" <c:if test="${exportFile == 'webinf'}">checked="checked"</c:if>> <fmt:message key="config.export.webinf"/><br/> <div class="hint"> (<c:out value="${newconfig.webInfDir}"/>) </div><br/> </td> </tr> <tr> <td><fmt:message key="config.export.types.text"/></td> <td> <table class="export-options"> <tr><td> <c:if test="${!empty errors['export.types']}"><img src="images/attention.jpg"><br/></c:if> <input type="checkbox" name="export.types" value="snips" <c:if test="${empty exportTypes || exportTypeSnips == 'true'}">checked="checked"</c:if>> <fmt:message key="config.export.types.snips"/> <td><td> <fmt:message key="config.export.match"/><br/> <input type="text" name="export.match" value="<c:out value="${exportMatch}"/>"><br/> <fmt:message key="config.export.ignore"/><br/> <input type="text" name="export.ignore" value="<c:out value="${exportIgnore}"/>"> </td></tr> <tr><td colspan="2"> <input type="checkbox" name="export.types" value="users" <c:if test="${empty exportTypes || exportTypeUsers == 'true'}">checked="checked"</c:if>> <fmt:message key="config.export.types.users"/> </td></tr> </table> </td> </tr> <tr> <td></td> <td> <input type="submit" name="export" value="<fmt:message key="config.export"/>"> </td> </tr> </c:otherwise> </c:choose> </table> --- NEW FILE: statusbar.jsp --- <%-- ** status bar ** @author Matthias L. Jugel ** @version $Id: statusbar.jsp,v 1.2 2004/02/11 14:13:57 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <c:set var="percentage" value="${param.statusCurrent * 100 / param.statusMax}" scope="request"/> <fmt:message key="${param.statusMessage}"> <fmt:param><fmt:formatNumber maxFractionDigits="0" value="${percentage}"/></fmt:param> </fmt:message><br/> <table class="statusbar"> <tr> <c:forEach begin="0" end="99" step="10" var="completed" > <td <c:if test="${percentage > completed}">class="completed"</c:if>></td> </c:forEach> </tr> </table> --- NEW FILE: mail.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** Mail Settings ** @author Matthias L. Jugel ** @version $Id: mail.jsp,v 1.4 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.mail.host.text"/></td> <td> <fmt:message key="config.app.mail.host"/><br/> <input type="text" name="app.mail.host" size="40" value="<c:out value='${newconfig.mailHost}'/>"> <c:if test="${!empty errors['app.mail.host']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.mail.domain.text"/></td> <td> <fmt:message key="config.app.mail.domain"/><br/> <input type="text" name="app.mail.domain" size="40" value="<c:out value='${newconfig.mailDomain}'/>"> <c:if test="${!empty errors['app.mail.domain']}"><img src="images/attention.jpg"></c:if> </td> </tr> </table> --- NEW FILE: permissions.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** Permission settings ** @author Matthias L. Jugel ** @version $Id: permissions.jsp,v 1.5 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.perm.register.text"/></td> <td> <fmt:message key="config.app.perm.register"/><br/> <input type="checkbox" name="app.perm.register" value="allow" <c:if test="${newconfig.permRegister == 'allow'}">checked="checked"</c:if>> </td> </tr> <tr> <td><fmt:message key="config.app.perm.weblogsPing.text"/></td> <td> <fmt:message key="config.app.perm.weblogsPing"/><br/> <input type="checkbox" name="app.perm.weblogsPing" value="allow" <c:if test="${newconfig.permWeblogsPing == 'allow'}">checked="checked"</c:if>> </td> </tr> <tr> <td><fmt:message key="config.app.perm.notification.text"/></td> <td> <fmt:message key="config.app.perm.notification"/><br/> <input type="checkbox" name="app.perm.notification" value="allow" <c:if test="${newconfig.permNotification == 'allow'}">checked="checked"</c:if>> </td> </tr> <tr> <td><fmt:message key="config.app.perm.externalImages.text"/></td> <td> <fmt:message key="config.app.perm.externalImages"/><br/> <input type="checkbox" name="app.perm.externalImages" value="allow" <c:if test="${newconfig.permExternalImages == 'allow'}">checked="checked"</c:if>> </td> </tr> <tr> <td><fmt:message key="config.app.perm.multiplePosts.text"/></td> <td> <fmt:message key="config.app.perm.multiplePosts"/><br/> <input disabled="disabled" type="checkbox" name="app.perm.multiplePosts" value="allow" <c:if test="${newconfig.permMultiplePosts == 'allow'}">checked="checked"</c:if>> </td> </tr> </table> --- NEW FILE: maintenance.jsp --- <%-- ** Maintenance ** @author Matthias L. Jugel ** @version $Id: maintenance.jsp,v 1.4 2004/02/11 14:13:57 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <c:choose> <c:when test="${not empty running && not empty running.maintenance}"> <tr> <td> <fmt:message key="config.maint.${running.maintenance}"/> <fmt:message key="config.refresh.text"/> </td> <td> <c:import url="config/statusbar.jsp"> <c:param name="statusMessage" value="config.status"/> <c:param name="statusMax" value="${running.max}"/> <c:param name="statusCurrent" value="${running.current}"/> </c:import> <br/> <a href="configure?step=maintenance"><fmt:message key="config.refresh"/></a> </td> </tr> </c:when> <c:otherwise> <c:if test="${not empty fixComments}"> <tr> <td><fmt:message key="config.maint.fix.comments"/></td> <td> <select name="fixComments" size="5" disabled="disabled"> <c:forEach items="${fixComments}" var="comment"> <option selected="selected" value="<c:out value='${comment.name}' escapeXml='true'/>"><c:out value="${comment.name}" escapeXml="true"/></option> </c:forEach> </select> </td> </tr> </c:if> <c:if test="${not empty fixParents}"> <tr> <td><fmt:message key="config.maint.fix.parents"/></td> <td> <select name="fixParents" size="5" disabled="disabled"> <c:forEach items="${fixParents}" var="post"> <option selected="selected" value="<c:out value='${post.name}' escapeXml='true'/>"><c:out value="${post.name}" escapeXml="true"/></option> </c:forEach> </select> </td> </tr> </c:if> <c:if test="${not empty duplicates}"> <tr> <td><fmt:message key="config.maint.fix.duplicates"/></td> <td> <select name="duplicates" size="5" disabled="disabled"> <c:forEach items="${duplicates}" var="snip"> <option selected="selected" value="<c:out value='${snip.name}' escapeXml='true'/>"><c:out value="${snip.name}" escapeXml="true"/></option> </c:forEach> </select> </td> </tr> </c:if> <c:if test="${not empty notFixable}"> <tr> <td><fmt:message key="config.maint.not.fixable"/></td> <td> <select name="notFixable" size="5" disabled="disabled"> <c:forEach items="${notFixable}" var="snip"> <option selected="selected" value="<c:out value='${snip.name}' escapeXml='true'/>"><c:out value="${snip.name}" escapeXml="true"/></option> </c:forEach> </select> </td> </tr> </c:if> <tr> <td><fmt:message key="config.maint.info"/></td> <td> <input type="hidden" name="step" value="maintenance"/> <input type="submit" name="check" value="<fmt:message key="config.maint.check"/>" <c:if test="${not empty status}">disabled="disabled"</c:if> /> <input type="submit" name="dorepair" value="<fmt:message key="config.maint.fix"/>" <c:if test="${empty fixComments && empty fixParents}">disabled="disabled"</c:if> /> </td> </tr> </c:otherwise> </c:choose> </table> --- NEW FILE: proxy.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** Proxy Settings ** @author Matthias L. Jugel ** @version $Id: proxy.jsp,v 1.5 2004/01/08 10:29:28 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <script type="text/javascript" language="Javascript"> <!-- function disableOnCheck(checkbox) { document.getElementById("app.real.host").disabled = checkbox.checked; document.getElementById("app.real.port").disabled = checkbox.checked; } --> </script> <table> <tr> <td><fmt:message key="config.app.real.autodetect.text"/></td> <td> <fmt:message key="config.app.real.autodetect"/><br/> <input onClick="disableOnCheck(this);" type="checkbox" name="app.real.autodetect" <c:if test="${newconfig.realAutodetect == 'true'}">checked=checked</c:if>> <div class="hint">(<fmt:message key="config.detected"/>: <c:out value="${newconfig.url}"/>)</div> </td> </tr> <tr> <td><fmt:message key="config.app.real.protocol.text"/></td> <td> <fmt:message key="config.app.real.protocol"/><br/> <select size="1" name="app.real.protocol"> <option value="http" <c:if test="${newconfig.properties['app.real.protocol'] == 'http'}">selected="selected"</c:if>>http</option> <option value="https" <c:if test="${newconfig.properties['app.real.protocol'] == 'https'}">selected="selected"</c:if>>https</option> </select> </td> </tr> <tr> <td><fmt:message key="config.app.real.host.text"/></td> <td> <fmt:message key="config.app.real.host"/><br/> <input <c:if test="${newconfig.realAutodetect == 'true'}">disabled="disabled"</c:if> id="app.real.host" type="text" name="app.real.host" size="40" value="<c:out value='${newconfig.properties["app.real.host"]}'/>"> </td> </tr> <tr> <td><fmt:message key="config.app.real.port.text"/></td> <td> <fmt:message key="config.app.real.port"/><br/> <input <c:if test="${newconfig.realAutodetect == 'true'}">disabled="disabled"</c:if> id="app.real.port" type="text" name="app.real.port" size="40" value="<c:out value='${newconfig.properties["app.real.port"]}'/>"> <c:if test="${!empty errors['app.real.port']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.real.path.text"/></td> <td> <fmt:message key="config.app.real.path"/><br/> <input type="text" name="app.real.path" size="40" value="<c:out value='${newconfig.properties["app.real.path"]}'/>"> </td> </tr> </table> --- NEW FILE: database.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** Database Settings ** @author Matthias L. Jugel ** @version $Id: database.jsp,v 1.4 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <% // put known drivers in session context if(null == session.getAttribute("jdbcDriver")) { Map knownJdbcDriver = new HashMap(); knownJdbcDriver.put("jdbc.mckoi", "com.mckoi.JDBCDriver"); knownJdbcDriver.put("jdbc.mysql", "com.mysql.jdbc.Driver"); knownJdbcDriver.put("jdbc.postgresql", "org.postgresql.Driver"); //knownJdbcDriver.put("jdbc.oracle", "com.oracle.jdbc.Driver"); Iterator driverIt = knownJdbcDriver.keySet().iterator(); while (driverIt.hasNext()) { String driver = (String) driverIt.next(); try { Class.forName((String)knownJdbcDriver.get(driver)); } catch (Exception e) { driverIt.remove(); } catch(Error err) { driverIt.remove(); } } session.setAttribute("jdbcDriver", knownJdbcDriver); } %> <script type="text/javascript" language="Javascript"> <!-- function selectOptions(select) { var driver = select.options[select.selectedIndex].value; if(driver == 'file') { showParts(document.getElementsByName("file")); hideParts(document.getElementsByName("jdbc")); hideParts(document.getElementsByName("mckoi")); } else if(driver == 'jdbc.mckoi') { showParts(document.getElementsByName("mckoi")); hideParts(document.getElementsByName("file")); hideParts(document.getElementsByName("jdbc")); } else { showParts(document.getElementsByName("jdbc")); hideParts(document.getElementsByName("file")); hideParts(document.getElementsByName("mckoi")); var jdbcField = document.getElementById('app.jdbc.driver'); var jdbcUrl = document.getElementById('app.jdbc.url'); <c:forEach items="${jdbcDriver}" var="driver"> if(driver == '<c:out value="${driver.key}"/>') { jdbcField.value = '<c:out value="${driver.value}"/>'; } </c:forEach> if(driver != 'jdbc') { hideParts(document.getElementsByName("jdbcDriver")); driver = driver.substring(5, driver.length); } else { showParts(document.getElementsByName("jdbcDriver")); jdbcField.value = 'enter driver class here'; driver = 'driver'; } jdbcUrl.value = 'jdbc:' + driver + '://server/snipsnapdb' if(driver == 'postgresql') { jdbcUrl.value = jdbcUrl.value + '?charSet=utf-8'; } } } function showParts(elements) { // iterator over elements and show for(var e = 0; e < elements.length; e++) { elements[e].style.visibility = "visible"; elements[e].style.display = "table-row"; } } function hideParts(elements) { // iterator over elements and for(var e = 0; e < elements.length; e++) { elements[e].style.visibility = "hidden"; elements[e].style.display = "none"; } } --> </script> <table> <tr> <td><fmt:message key="config.app.database.text"/></td> <td> <fmt:message key="config.app.database"/><br/> <select name="app.database" size="1" onChange="selectOptions(this)"> <option value="file" <c:if test="${newconfig.database == 'file'}">selected="selected"</c:if>><fmt:message key="config.app.database.file"/></option> <c:forEach items="${jdbcDriver}" var="driver"> <option value="<c:out value='${driver.key}'/>" <c:if test="${newconfig.database == driver.key}">selected="selected"</c:if>><fmt:message key="config.app.database.${driver.key}"/></option> </c:forEach> <option value="jdbc" <c:if test="${newconfig.database == 'jdbc'}">selected="selected"</c:if>><fmt:message key="config.app.database.jdbc"/></option> </select> </td> </tr> <tr name="jdbc" <c:if test="${newconfig.database == 'file' || newconfig.database == 'jdbc.mckoi'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.jdbc.url.text"/></td> <td> <fmt:message key="config.app.jdbc.url"/><br/> <input id="app.jdbc.url" type="text" name="app.jdbc.url" size="40" value="<%= ((Configuration)pageContext.findAttribute("newconfig")).getGlobals().getProperty(Configuration.APP_JDBC_URL) %>"> <c:if test="${!empty errors['app.jdbc.url']}"><img src="images/attention.jpg"></c:if> <%--<div class="hint">(<c:out value="${newconfig.jdbcUrl}"/>)</div>--%> </td> </tr> <tr name="jdbcDriver" <c:if test="${newconfig.database == 'file' || newconfig.database == 'jdbc.postgresql' || newconfig.database == 'jdbc.mckoi'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.jdbc.driver.text"/></td> <td> <fmt:message key="config.app.jdbc.driver"/><br/> <input id="app.jdbc.driver" type="text" name="app.jdbc.driver" size="40" value="<c:out value='${newconfig.jdbcDriver}'/>"> <c:if test="${!empty errors['app.jdbc.driver']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr name="jdbc" <c:if test="${newconfig.database == 'file' || newconfig.database == 'jdbc.mckoi'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.jdbc.user.text"/></td> <td> <fmt:message key="config.app.jdbc.user"/><br/> <input id="app.jdbc.user" type="text" name="app.jdbc.user" value="<c:out value='${newconfig.jdbcUser}'/>"> <c:if test="${!empty errors['app.jdbc.user']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr name="jdbc" <c:if test="${newconfig.database == 'file' || newconfig.database == 'jdbc.mckoi'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.jdbc.password.text"/></td> <td> <fmt:message key="config.app.jdbc.password"/><br/> <input id="app.jdbc.password" type="password" name="app.jdbc.password"> <c:if test="${!empty errors['app.jdbc.password']}"><img src="images/attention.jpg"></c:if><br/> <div class="hint"> <c:if test="${not empty newconfig.jdbcPassword}"> <fmt:message key="config.password.set" /> </c:if> </div> </td> </tr> <tr name="file" <c:if test="${newconfig.database != 'file'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.database.file.text"/></td> <td> <input type="hidden" name="app.file.store" value="<%= ((Configuration) pageContext.findAttribute("newconfig")).getGlobals().getProperty(Configuration.APP_FILE_STORE) %>"> <fmt:message key="config.app.database.noconfig"/><br/> </td> </tr> <tr name="mckoi" <c:if test="${newconfig.database != 'jdbc.mckoi'}">style="visibility:hidden; display:none"</c:if>> <td><fmt:message key="config.app.database.mckoi.text"/></td> <td> <fmt:message key="config.app.database.noconfig"/><br/> </td> </tr> </table> --- NEW FILE: application.jsp --- <%@ page import="org.snipsnap.config.Configuration"%> <%-- ** Basic Settings of the Application ** @author Matthias L. Jugel ** @version $Id: application.jsp,v 1.7 2004/01/22 07:22:21 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.name.text"/></td> <td> <fmt:message key="config.app.name"/><br/> <input type="text" name="app.name" value="<c:out value='${newconfig.name}'/>" size="40"> <c:if test="${!empty errors['app.name']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.tagline.text"/></td> <td> <fmt:message key="config.app.tagline"/><br/> <input type="text" name="app.tagline" value="<c:out value='${newconfig.tagline}'/>" size="40"> <c:if test="${!empty errors['app.tagline']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.logo.text"/></td> <td> <fmt:message key="config.app.logo"/><br/> <input type="file" name="file" value="<c:out value='${newconfig.logo}'/>" accept="image/*"> <c:if test="${!empty errors['app.logo']}"><img src="images/attention.jpg"></c:if> </td> </tr> <c:if test="${not newconfig.configured}"> <tr> <td><fmt:message key="config.usage.text"/></td> <td> <input type="radio" name="usage" value="public" <c:if test="${usage == 'public'}">checked="checked"</c:if> ><fmt:message key="config.usage.public"/><br/> <input type="radio" name="usage" value="closed" <c:if test="${usage == 'closed'}">checked="checked"</c:if> ><fmt:message key="config.usage.closed"/><br/> <input type="radio" name="usage" value="intranet" <c:if test="${usage == 'intranet'}">checked="checked"</c:if> ><fmt:message key="config.usage.intranet"/><br/> <input type="radio" name="usage" value="custom" <c:if test="${usage == 'custom'}">checked="checked"</c:if> ><fmt:message key="config.usage.custom"/> </td> </tr> </c:if> </table> --- NEW FILE: theme.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration, java.io.File, org.dom4j.Document, org.dom4j.io.SAXReader, java.io.FileReader, java.io.InputStreamReader, org.dom4j.Element, org.dom4j.Node, java.io.FilenameFilter, org.snipsnap.snip.Snip, org.snipsnap.container.Components, org.snipsnap.snip.SnipSpace, org.snipsnap.net.admin.ThemeHelper"%> <%-- ** Theme selection. ** @author Matthias L. Jugel ** @version $Id: theme.jsp,v 1.7 2004/01/22 07:22:21 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <% Configuration conf = (Configuration) session.getAttribute("newconfig"); Map themes = new HashMap(); if (conf.isConfigured()) { Map installedThemes = ThemeHelper.getInstalledThemes(); Iterator themeIt = installedThemes.keySet().iterator(); while (themeIt.hasNext()) { String themeName = (String) themeIt.next(); themes.put(themeName, ((Snip)installedThemes.get(themeName)).getContent()); } } request.setAttribute("themes", themes); Map newThemes = ThemeHelper.getThemeDocuments(conf, ThemeHelper.CONTENT); Iterator instThemeIt = themes.keySet().iterator(); while (instThemeIt.hasNext()) { String themeName = (String) instThemeIt.next(); if(newThemes.containsKey(themeName)) { newThemes.remove(themeName); } } request.setAttribute("newthemes", newThemes); %> <script type="text/javascript" language="Javascript"> <!-- function selectOptions(select) { var themes = document.getElementsByName("theme"); hideParts(themes); showPart(document.getElementById(select.options[select.selectedIndex].value)); } function showPart(element) { element.style.visibility = "visible"; element.style.display = "table-row"; } function hideParts(elements) { // iterator over elements and for(var e = 0; e < elements.length; e++) { elements[e].style.visibility = "hidden"; elements[e].style.display = "none"; } } --> </script> <table> <tr> <td><fmt:message key="config.app.theme.text"/></td> <td> <fmt:message key="config.app.theme"/><br/> <select name="app.theme" size="1" onChange="selectOptions(this)"> <c:forEach items="${themes}" var="theme"> <option value="<c:out value='${theme.key}'/>" <c:if test="${newconfig.theme == theme.key}">selected="selected"</c:if>><c:out value="${theme.key}"/></option> </c:forEach> <c:forEach items="${newthemes}" var="theme"> <option value="<c:out value='${theme.key}'/>" <c:if test="${newconfig.theme == theme.key}">selected="selected"</c:if>> <c:out value="${theme.key}" escapeXml="true"/> <fmt:message key="config.app.theme.new"/> </option> </c:forEach> </select> </td> </tr> <c:forEach items="${themes}" var="theme"> <tr id="<c:out value='${theme.key}'/>" name="theme" <c:if test="${newconfig.theme != theme.key}">style="visibility:hidden; display:none"</c:if>> <td><c:out value="${theme.value}"/></td> <td> <c:out value="${theme.key}"/> <input type="submit" name="export" value="<fmt:message key='config.app.theme.export'/>"/><br/> <img src="themeimage?name=<c:out value='${theme.key}'/>" alt="<c:out value='${theme.key}'/>" border="0"> </td> </tr> </c:forEach> <c:forEach items="${newthemes}" var="theme"> <tr id="<c:out value='${theme.key}'/>" name="theme" <c:if test="${newconfig.theme != theme.key}">style="visibility:hidden; display:none"</c:if>> <td><c:out value="${theme.value}"/></td> <td> <c:out value="${theme.key}"/><br/> <img src="themeimage?name=<c:out value='${theme.key}'/>" alt="<c:out value='${theme.key}'/>" border="0"> </td> </tr> </c:forEach> </table> --- NEW FILE: nav.jsp --- <%@ page import="java.util.List"%> <%-- ** Navigation ** @author Matthias L. Jugel ** @version $Id: nav.jsp,v 1.10 2004/02/04 16:52:39 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <input type="hidden" name="step" value="<c:out value='${step}'/>"/> <input type="hidden" name="prefix" value="<c:out value="${prefix}"/>"/> <c:choose> <c:when test="${not empty configuser && configuser.admin}"> <c:if test="${not(step == 'import' || step == 'export' || step == 'users' || step == 'search' || step == 'maintenance')}"> <input type="submit" name="save" value="<fmt:message key="config.nav.save"/>"/> </c:if> </c:when> <c:otherwise> <c:if test="${step != 'database' && step != 'login'}"> <input type="submit" name="previous" value="<fmt:message key="config.nav.previous"/>"> </c:if> <c:choose> <c:when test="${step == 'finish'}"> <c:if test="${empty advanced}"> <input type="hidden" name="advanced" value="true"> <input disabled="disabled" id="submit.advanced" type="submit" name="next" value="<fmt:message key="config.nav.advanced"/>"> </c:if> </c:when> <c:otherwise> <input type="submit" name="next" value="<fmt:message key="config.nav.next"/>"> </c:otherwise> </c:choose> </c:otherwise> </c:choose> --- NEW FILE: info.jsp --- <%-- ** Guide Menu ** @author Matthias L. Jugel ** @version $Id: info.jsp,v 1.5 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="info"> <ul> <li><c:out value="${newconfig.name}"/></li> <li><c:out value="${newconfig.url}"/></li> <li><c:out value="${newconfig.country}(${newconfig.language}) ${newconfig.timezone} ${newconfig.encoding}"/></li> <li><c:out value="${newconfig.theme}"/> <li> <c:out value="${newconfig.adminLogin}"/> <c:if test="${not empty newconfig.adminEmail}"> (<c:out value="${newconfig.adminEmail}"/>) </c:if> </li> </ul> </div> --- NEW FILE: search.jsp --- <%-- ** Search Engine Parameter settings ** @author Matthias L. Jugel ** @version $Id: search.jsp,v 1.3 2004/02/11 14:13:57 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td> <fmt:message key="config.search.reset.text"/> </td> <td> <input <c:if test="${indexerThread.alive}">disabled="disabled"</c:if> type="submit" name="reset" value="<fmt:message key="config.search.reset"/>"/> <c:if test="${indexerThread.alive}"> <br/><span class="hint"><fmt:message key="config.search.running"/></span> </c:if> </td> </tr> </table> --- NEW FILE: expert.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration, java.text.SimpleDateFormat"%> <%-- ** Expert Settings ** @author Matthias L. Jugel ** @version $Id: expert.jsp,v 1.7 2004/01/22 15:01:32 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.start.snip.text"/></td> <td> <fmt:message key="config.app.start.snip"/><br/> <input type="text" name="app.start.snip" value="<c:out value='${newconfig.startSnip}'/>"> </td> </tr> <tr> <td><fmt:message key="config.app.perm.createSnip.text"/></td> <td> <fmt:message key="config.app.perm.createSnip"/><br/> <input type="checkbox" value="allow" name="app.perm.createSnip" <c:if test="${newconfig.permCreateSnip == 'allow'}">checked="checked"</c:if>> </td> </tr> <tr> <td><fmt:message key="config.app.logger.text"/></td> <td> <fmt:message key="config.app.logger"/><br/> <select name="app.logger"> <option value="org.radeox.util.logging.NullLogger" <c:if test="${newconfig.logger == 'org.radeox.util.logging.NullLogger'}">selected="selected"</c:if>> <fmt:message key="config.logger.none"/></option> <option value="org.radeox.util.logging.SystemErrLogger" <c:if test="${newconfig.logger == 'org.radeox.util.logging.SystemErrLogger'}">selected="selected"</c:if>> <fmt:message key="config.logger.system.err"/></option> <option value="org.radeox.util.logging.SystemOutLogger" <c:if test="${newconfig.logger == 'org.radeox.util.logging.SystemOutLogger'}">selected="selected"</c:if>> <fmt:message key="config.logger.system.out"/></option> <%-- <option value="org.snipsnap.util.log.ApplicationLogger"--%> <%-- <c:if test="${newconfig.logger == 'org.snipsnap.util.log.ApplicationLogger'}">selected="selected"</c:if>>--%> <%-- <fmt:message key="config.logger.application"/></option>--%> </input> </td> </tr> <tr> <td><fmt:message key="config.app.cache.text"/></td> <td> <fmt:message key="config.app.cache"/><br/> <select disabled="disabled" name="app.cache"> <option value="full" <c:if test="${newconfig.cache == 'full'}">checked="checked"</c:if>> <fmt:message key="config.caching.full"/></option> <option value="cache" <c:if test="${newconfig.cache == 'cache'}">checked="checked"</c:if>> <fmt:message key="config.caching.cache"/></option> </input> </td> </tr> <tr> <td><fmt:message key="config.app.encoding.text"/></td> <td> <fmt:message key="config.app.encoding"/><br/> <select disabled="disabled" name="app.encoding"> <option value="UTF-8" <c:if test="${newconfig.encoding == 'UTF-8'}">checked="checked"</c:if>>UTF-8</option> <option value="UTF-16" <c:if test="${newconfig.encoding == 'UTF-16'}">checked="checked"</c:if>>UTF-16</option> <option value="ISO-8859-1" <c:if test="${newconfig.encoding == 'ISO-8859-1'}">checked="checked"</c:if>>ISO 8859-1</option> <option value="US-ASCII" <c:if test="${newconfig.encoding == 'US-ASCII'}">checked="checked"</c:if>>US-ASCII</option> </input> </td> </tr> </table> --- NEW FILE: import.jsp --- <%-- ** Mail Settings ** @author Matthias L. Jugel ** @version $Id: import.jsp,v 1.3 2004/02/11 14:13:57 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <c:choose> <c:when test="${not empty running && not empty running.import}"> <tr> <td> <fmt:message key="config.import.running"/> <fmt:message key="config.refresh.text"/> </td> <td> <c:import url="config/statusbar.jsp"> <c:param name="statusMessage" value="config.status"/> <c:param name="statusMax" value="${running.max}"/> <c:param name="statusCurrent" value="${running.current}"/> </c:import> <br/> <a href="configure?step=import"><fmt:message key="config.refresh"/></a> </td> </tr> </c:when> <c:otherwise> <tr> <td><fmt:message key="config.import.file.text"/></td> <td> <fmt:message key="config.import.file"/><br/> <input type="file" name="import.file" accept="text/xml" value="<c:out value="${importFile}"/>"> <c:if test="${!empty errors['import.file']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.import.types.text"/></td> <td> <c:if test="${!empty errors['import.types']}"><img src="images/attention.jpg"><br/></c:if> <input type="checkbox" name="import.types" value="snips" <c:if test="${empty importTypes || importTypeSnips == 'true'}">checked="checked"</c:if>> <fmt:message key="config.import.types.snips"/><br/> <input type="checkbox" name="import.types" value="users" <c:if test="${empty importTypes || importTypeUsers == 'true'}">checked="checked"</c:if>> <fmt:message key="config.import.types.users"/> </td> </tr> <tr> <td><fmt:message key="config.import.overwrite.text"/></td> <td> <input type="checkbox" name="import.overwrite" <c:if test="${empty importOverwrite || importOverwrite == 'true'}">checked="checked"</c:if>> <c:if test="${!empty errors['config.import.overwrite']}"><img src="images/attention.jpg"></c:if> <fmt:message key="config.import.overwrite"/><br/> </td> </tr> <tr> <td></td> <td> <input type="submit" name="import" value="<fmt:message key="config.import"/>"> </td> </tr> </c:otherwise> </c:choose> </table> --- NEW FILE: moblog.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration"%> <%-- ** Mobile Blogging Settings ** @author Matthias L. Jugel ** @version $Id: moblog.jsp,v 1.4 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.mail.blog.password.text"/></td> <td> <fmt:message key="config.app.mail.blog.password"/><br/> <input type="text" name="app.mail.blog.password" value="<c:out value='${newconfig.mailBlogPassword}'/>"> <c:if test="${!empty errors['app.mail.blog.password']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.mail.pop3.host.text"/></td> <td> <fmt:message key="config.app.mail.pop3.host"/><br/> <input type="text" name="app.mail.pop3.host" size="40" value="<c:out value='${newconfig.mailPop3Host}'/>"> <c:if test="${!empty errors['app.mail.pop3.host']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.mail.pop3.user.text"/></td> <td> <fmt:message key="config.app.mail.pop3.user"/><br/> <input type="text" name="app.mail.pop3.user" size="40" value="<c:out value='${newconfig.mailPop3User}'/>"> <c:if test="${!empty errors['app.mail.pop3.user']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.mail.pop3.password.text"/></td> <td> <fmt:message key="config.app.mail.pop3.password"/><br/> <input type="password" name="app.mail.pop3.password" value="<c:out value='${newconfig.mailPop3Password}'/>"> <c:if test="${!empty errors['app.mail.pop3.password']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.mail.pop3.interval.text"/></td> <td> <fmt:message key="config.app.mail.pop3.interval"/><br/> <input type="text" name="app.mail.pop3.interval" size="5" value="<c:out value='${newconfig.mailPop3Interval}'/>"> <c:if test="${!empty errors['app.mail.pop3.interval']}"><img src="images/attention.jpg"></c:if> </td> </tr> </table> --- NEW FILE: guide.jsp --- <%@ page import="java.util.List"%> <%-- ** Guide Menu ** @author Matthias L. Jugel ** @version $Id: guide.jsp,v 1.7 2004/01/20 12:24:37 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <div class="guide-menu"> <div class="guide-title"> <c:choose> <c:when test="${step == 'login'}"> <!-- nothing --> </c:when> <c:when test="${not empty configuser && configuser.admin}"> <fmt:message key="config.guide.setup"/> </c:when> <c:otherwise> <fmt:message key="config.guide.title"> <fmt:param><%= ((List) pageContext.findAttribute("steps")).size() %></fmt:param> </fmt:message> </c:otherwise> </c:choose> </div> <ul> <c:forEach items="${steps}" var="current" varStatus="status" > <li <c:if test="${step == current}">class="current-step"</c:if>> <c:choose> <c:when test="${not(step == current) && not empty configuser && configuser.admin}"> <a href="configure?select=<c:out value="${current}"/>"> <fmt:message key="config.step.${current}"/> </a> </c:when> <c:otherwise><fmt:message key="config.step.${current}"/></c:otherwise> </c:choose> </li> </c:forEach> </ul> <ul> <c:if test="${not empty configuser && configuser.admin}"> <li><a href="../space/start"><fmt:message key="config.step.back" /></a></li> </c:if> </ul> </div> --- NEW FILE: login.jsp --- <%-- ** login dialog ** @author Matthias L. Jugel ** @version $Id: login.jsp,v 1.1 2004/01/20 12:24:37 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.login.text"/></td> <td> <fmt:message key="config.login"/><br/> <input type="password" name="key" value=""/> </td> </tr> </table> --- NEW FILE: localization.jsp --- <%@ page import="java.util.*, org.snipsnap.config.Configuration, java.text.SimpleDateFormat, java.text.DateFormat"%> <%-- ** Localization settings. ** @author Matthias L. Jugel ** @version $Id: localization.jsp,v 1.6 2004/01/15 10:22:11 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <% Locale[] locales; Map countries = new TreeMap(); Map languages = new TreeMap(); locales = Locale.getAvailableLocales(); for (int count = 0; count < locales.length; count++) { if(!"".equals(locales[count].getDisplayCountry())) { countries.put(locales[count].getDisplayCountry(), locales[count]); } languages.put(locales[count].getDisplayLanguage(), locales[count]); } pageContext.setAttribute("countries", countries.values()); pageContext.setAttribute("languages", languages.values()); %> <table> <tr> <td><fmt:message key="config.app.country.text"/></td> <td> <fmt:message key="config.app.country"/><br/> <select size="1" name="app.country"> <c:forEach items="${countries}" var="country"> <option value="<c:out value='${country.country}'/>" <c:if test="${newconfig.country == country.country}">selected="selected"</c:if>><c:out value="${country.displayCountry}" /></option> </c:forEach> </select> </td> </tr> <tr> <td><fmt:message key="config.app.language.text"/></td> <td> <fmt:message key="config.app.language"/><br/> <select size="1" name="app.language"> <c:forEach items="${languages}" var="language"> <option value="<c:out value='${language.language}'/>" <c:if test="${newconfig.language == language.language}">selected="selected"</c:if>><c:out value="${language.displayLanguage}" /></option> </c:forEach> </select> </td> </tr> <tr> <td><fmt:message key="config.app.timezone.text"/></td> <td> <fmt:message key="config.app.timezone"/><br/> <select size="1" name="app.timezone"> <% Map timezones = new TreeMap(); for(int count = 0; count <= 12; count++) { String tzString = "GMT+"+count; TimeZone tz = TimeZone.getTimeZone(tzString); timezones.put(tz.getID().substring(0, 6), tz); } for (int count = 11; count > 0; count--) { String tzString = "GMT-" + count; TimeZone tz = TimeZone.getTimeZone(tzString); timezones.put(tz.getID().substring(0, 6), tz); } pageContext.setAttribute("timezones", timezones); %> <c:forEach items="${timezones}" var="timezone"> <option value="<c:out value='${timezone.value.ID}'/>" <c:if test="${newconfig.timezone == timezone.value.ID}">selected="selected"</c:if>><fmt:message key="${timezone.key}"/></option> </c:forEach> </select> </td> </tr> <tr> <td><fmt:message key="config.app.weblogDateFormat.text"/></td> <td> <fmt:message key="config.app.weblogDateFormat"/><br/> <input type="text" name="app.weblogDateFormat" value="<c:out value='${newconfig.weblogDateFormat}'/>"> <c:if test="${!empty errors['app.weblogDateFormat']}"><img src="images/attention.jpg"></c:if> <% Locale current = Locale.getDefault(); Configuration cfg = (Configuration)pageContext.findAttribute("newconfig"); Locale.setDefault(cfg.getLocale()); try { DateFormat df = new SimpleDateFormat(cfg.getWeblogDateFormat()); df.setTimeZone(TimeZone.getTimeZone(cfg.getTimezone())); pageContext.setAttribute("date", df.format(new Date())); } catch (Exception e) { pageContext.setAttribute("date", "???"); } Locale.setDefault(current); %> <div class="hint"> (<c:out value="${date}"/>) <input type="submit" name="preview" value="<fmt:message key='config.nav.preview'/>"> </div> </td> </tr> <tr> <td><fmt:message key="config.app.geoCoordinates.text"/></td> <td> <fmt:message key="config.app.geoCoordinates"/><br/> <input type="text" name="app.geoCoordinates" value="<c:out value='${newconfig.geoCoordinates}'/>"> <c:if test="${!empty errors['app.geoCoordinates']}"><img src="images/attention.jpg"></c:if> </td> </tr> </table> --- NEW FILE: administrator.jsp --- <%-- ** First Login / Admin ** @author Matthias L. Jugel ** @version $Id: administrator.jsp,v 1.6 2003/12/11 13:24:56 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.app.admin.login.text"/></td> <td> <fmt:message key="config.app.admin.login"/><br/> <input type="text" name="app.admin.login" value="<c:out value='${newconfig.adminLogin}' default=""/>"> <c:if test="${!empty errors['app.admin.login']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.app.admin.password.text"/></td> <td> <fmt:message key="config.app.admin.password"/><br/> <input type="password" name="app.admin.password" value=""> <c:if test="${!empty errors['app.admin.password']}"><img src="images/attention.jpg"></c:if><br/> <fmt:message key="config.app.admin.password.vrfy"/><br/> <input type="password" name="app.admin.password.vrfy" value=""> <c:if test="${!empty errors['app.admin.password']}"><img src="images/attention.jpg"></c:if><br/> <div class="hint"> <c:if test="${not empty newconfig.adminPassword}"> <fmt:message key="config.password.set" /> </c:if> </div> </td> </tr> <tr> <td><fmt:message key="config.app.admin.email.text"/></td> <td> <fmt:message key="config.app.admin.email"/><br/> <input type="text" name="app.admin.email" value="<c:out value='${newconfig.adminEmail}' default=""/>"> <c:if test="${!empty errors['app.admin.email']}"><img src="images/attention.jpg"></c:if> </td> </tr> </table> --- NEW FILE: users.edit.jsp --- <%@ page import="java.util.Set"%> <%-- ** User management: edit/create user ** @author Matthias L. Jugel ** @version $Id: users.edit.jsp,v 1.2 2004/01/17 21:36:27 leo Exp $ --%> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <table> <tr> <td><fmt:message key="config.users.login.text"/></td> <td> <fmt:message key="config.users.login"/><br/> <c:choose> <c:when test="${not empty create}"> <input type="text" name="config.users.login" value="<c:out value='${editUser.login}' default=""/>"> </c:when> <c:otherwise> <input type="hidden" name="config.users.login" value="<c:out value='${editUser.login}' default=""/>"> <input type="text" name="disabled" value="<c:out value='${editUser.login}' default=""/>" disabled="disabled"> </c:otherwise> </c:choose> <c:if test="${!empty errors['users.login']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.users.password.text"/></td> <td> <fmt:message key="config.users.password"/><br/> <input type="password" name="config.users.password" value=""> <c:if test="${!empty errors['users.password']}"><img src="images/attention.jpg"></c:if><br/> <fmt:message key="config.users.password.vrfy"/><br/> <input type="password" name="config.users.password.vrfy" value=""> <c:if test="${!empty errors['users.password']}"><img src="images/attention.jpg"></c:if><br/> <div class="hint"> <c:if test="${not empty editUser.passwd}"> <fmt:message key="config.password.set" /> </c:if> </div> </td> </tr> <tr> <td><fmt:message key="config.users.email.text"/></td> <td> <fmt:message key="config.users.email"/><br/> <input type="text" name="config.users.email" value="<c:out value='${editUser.email}' default=""/>"> <c:if test="${!empty errors['users.email']}"><img src="images/attention.jpg"></c:if> </td> </tr> <tr> <td><fmt:message key="config.users.roles.text"/></td> <td> <fmt:message key="config.users.roles"/><br/> <c:set var="userRoles" value="${editUser.roles.roleSet}"/> <% Set userRoles = (Set) pageContext.findAttribute("userRoles"); %> <c:forEach items="${editUser.roles.allRoles}" var="role"> <input type="checkbox" name="config.users.roles" value="<c:out value='${role}'/>" <%= userRoles.contains(pageContext.findAttribute("role")) ? "checked=\"checked\"" : "" %>/> <c:out value="${role}"/><br/> </c:forEach> </td> </tr> <tr> <td><fmt:message key="config.users.status.text"/></td> <td> <fmt:message key="config.users.status"/><br/> <input name="config.users.status" type="text" size="20" value="<c:out value='${editUser.status}'/>"/> </td> <tr> <td></td> <td> <c:choose> <c:when test="${empty create}"> <input type="submit" name="save" value="<fmt:message key="config.users.save"/>"> </c:when> <c:otherwise> <input type="submit" name="create" value="<fmt:message key="config.users.create"/>"> </c:otherwise> </c:choose> <input type="submit" name="cancel" value="<fmt:message key="config.users.cancel"/>"> </td> </tr> </table> |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:40:01
|
Update of /cvsroot/hmath/org.hmath.server/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12201/admin Added Files: configure.jsp Log Message: misc changes --- NEW FILE: configure.jsp --- <!-- ** Initial installation ... ** @author Matthias L. Jugel ** @version $Id: configure.jsp,v 1.10 2004/02/11 14:13:57 leo Exp $ --> <%@ page pageEncoding="iso-8859-1" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %> <% response.setContentType("text/html; charset=UTF-8"); %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <c:if test="${not empty running && not empty running[step]}"> <meta http-equiv="refresh" content="2; URL=configure?step=<c:out value='${step}'/>"/> </c:if> <title><fmt:message key="config.title"/> :: <fmt:message key="config.step.${step}"/></title> <link type="text/css" href="css/config.css" rel="STYLESHEET"/> </head> <body> <div class="header"> <c:import url="config/info.jsp"/> <img src="images/snipsnap-logo.png"/> </div> <div class="content"> <form action="configure" method="POST" enctype="multipart/form-data"> <table class="configuration"> <tr> <td rowspan="2" class="guide"> <c:import url="config/guide.jsp"/> <div class="step-info"><fmt:message key="config.guide.${step}"/></div> </td> <td class="edit"> <div class="step"><fmt:message key="config.step.${step}"/></div> <c:if test="${not empty errors}"> <div class="errors"> <c:if test="${empty errors.message}"> <fmt:message key="config.errors"/> </c:if> <ul> <c:forEach items="${errors}" var="error"> <li> <fmt:message key="config.error.${error.value}"> <fmt:param><c:out value="${newconfig.properties[error.key]}"/></fmt:param> </fmt:message> </li> </c:forEach> </ul> </div> </c:if> <c:import url="config/${step}.jsp"/> </td> </tr> <tr><td class="navigation"><c:import url="config/nav.jsp"/></td></tr> </table> </form> </div> </body> </html> |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:39:35
|
Update of /cvsroot/hmath/org.hmath.server/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12102/admin Log Message: Directory /cvsroot/hmath/org.hmath.server/admin added to the repository |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:39:35
|
Update of /cvsroot/hmath/org.hmath.server/admin/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12102/admin/images Log Message: Directory /cvsroot/hmath/org.hmath.server/admin/images added to the repository |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:39:34
|
Update of /cvsroot/hmath/org.hmath.server/admin/config In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12102/admin/config Log Message: Directory /cvsroot/hmath/org.hmath.server/admin/config added to the repository |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:39:34
|
Update of /cvsroot/hmath/org.hmath.server/admin/css In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12102/admin/css Log Message: Directory /cvsroot/hmath/org.hmath.server/admin/css added to the repository |
Update of /cvsroot/hmath/org.hmath.server/static/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11613/static/images Added Files: icon_redface.gif icon_mad.gif icon_surprised.gif tag_4.gif icon_smile.gif icon_arrow.gif icon_neutral.gif icon_sad.gif icon_twisted.gif icon_biggrin.gif icon_frown.gif icon_razz.gif icon_eek.gif tag_3.gif icon_exclaim.gif icon_wink.gif icon_cry.gif icon_lol.gif icon_confused.gif tag_7.gif icon_rolleyes.gif note.gif rss-small.png icon_mrgreen.gif tryit.gif icon_question.gif tag_1.gif tip.gif tag_2.gif icon_evil.gif icon_cool.gif tag_6.gif tag_5.gif icon_idea.gif Log Message: misc changes --- NEW FILE: note.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_frown.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_smile.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_cry.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_lol.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_3.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_mad.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_question.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_redface.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_5.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_biggrin.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_arrow.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_razz.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_evil.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_neutral.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_mrgreen.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_1.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_4.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_wink.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_sad.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_surprised.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_exclaim.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_confused.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_eek.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tip.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_idea.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_twisted.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tryit.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_rolleyes.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_2.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: rss-small.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_6.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tag_7.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon_cool.gif --- (This appears to be a binary file; contents omitted.) |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:36:16
|
Update of /cvsroot/hmath/org.hmath.server/static/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11579/static/images Log Message: Directory /cvsroot/hmath/org.hmath.server/static/images added to the repository |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:35:35
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11421/WEB-INF Added Files: application.conf Log Message: misc changes --- NEW FILE: application.conf --- #SnipSnap Globals Configuration $Revision: 1.23 $ #Mon Feb 09 22:34:38 CET 2004 admin.password= app.cache=full app.jdbc.password= app.jdbc.url=jdbc\:mysql\://localhost/hmath2 app.jdbc.user=root app.install.key=5714a app.name=HMath app.perm.notification=deny app.weblogDateFormat=EEEE, dd. MMMM yyyy app.mail.host= app.mail.domain= app.theme=/blue app.url.auto=false app.url= app.database=jdbc.mysql app.port=8080 app.jdbc.driver=com.mysql.jdbc.Driver app.tagline=HMath - A MathML Wiki for Mozilla and Netscape browsers admin.login=root app.timezone=+1.00 app.perm.weblogsPing=deny app.installed=true adm...@gm... app.host=localhost app.path=/org.hmath.server app.file.store=%WEBINF%/files app.logger=org.radeox.util.logging.SystemOutLogger |
|
From: Klaus H. <js...@us...> - 2004-04-02 18:33:48
|
Update of /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF/services In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11117/WEB-INF/src/META-INF/services Modified Files: org.radeox.macro.Macro Log Message: misc changes Index: org.radeox.macro.Macro =================================================================== RCS file: /cvsroot/hmath/org.hmath.server/WEB-INF/src/META-INF/services/org.radeox.macro.Macro,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** org.radeox.macro.Macro 28 Mar 2004 17:23:23 -0000 1.3 --- org.radeox.macro.Macro 2 Apr 2004 18:21:31 -0000 1.4 *************** *** 17,21 **** org.snipsnap.render.macro.CalendarMacro org.snipsnap.render.macro.HotSnipMacro - org.snipsnap.render.macro.ImageMacro org.snipsnap.render.macro.IndexSnipMacro org.snipsnap.render.macro.LastLoginMacro --- 17,20 ---- *************** *** 43,46 **** --- 42,46 ---- org.hartmath.server.macro.FieldMacro org.hartmath.server.macro.GraphMacro + org.hartmath.server.macro.ImageMacro org.hartmath.server.macro.JViewMacro org.hartmath.server.macro.MacroListMacro *************** *** 49,52 **** --- 49,53 ---- org.hartmath.server.macro.MMLMacro org.hartmath.server.macro.QuoteMacro + org.hartmath.server.macro.STableMacro org.hartmath.server.macro.TableMacro org.hartmath.server.macro.WikipediaMacro |