jspwiki-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From juanpa...@apache.org
Subject [06/16] jspwiki git commit: extract external, footnote[ref] and attachment css class names to constants, so they can be reused elsewhere
Date Sun, 16 Jul 2017 11:54:51 GMT
extract external, footnote[ref] and attachment css class names to constants, so they can be
reused elsewhere


Project: http://git-wip-us.apache.org/repos/asf/jspwiki/repo
Commit: http://git-wip-us.apache.org/repos/asf/jspwiki/commit/0c2b4d9f
Tree: http://git-wip-us.apache.org/repos/asf/jspwiki/tree/0c2b4d9f
Diff: http://git-wip-us.apache.org/repos/asf/jspwiki/diff/0c2b4d9f

Branch: refs/heads/master
Commit: 0c2b4d9f330c1107496aa9288ff95cfc21e13828
Parents: 8f9b8ba
Author: juanpablo <juanpablo@apache.org>
Authored: Sun Jun 4 20:15:06 2017 +0200
Committer: juanpablo <juanpablo@apache.org>
Committed: Sun Jul 16 13:26:31 2017 +0200

----------------------------------------------------------------------
 .../apache/wiki/parser/JSPWikiMarkupParser.java | 28 +++++++++++++++-----
 1 file changed, 22 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jspwiki/blob/0c2b4d9f/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
----------------------------------------------------------------------
diff --git a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
index 4ceb241..675e68d 100644
--- a/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
+++ b/jspwiki-war/src/main/java/org/apache/wiki/parser/JSPWikiMarkupParser.java
@@ -97,6 +97,22 @@ public class JSPWikiMarkupParser extends MarkupParser {
       * for interwiki page links. The value is "interwiki". */
     public static final String CLASS_INTERWIKI = "interwiki";
 
+    /** The value for anchor element <tt>class</tt> attributes when used
+      * for footnote links. The value is "footnote". */
+    public static final String CLASS_FOOTNOTE = "footnote";
+
+    /** The value for anchor element <tt>class</tt> attributes when used
+      * for footnote links. The value is "footnote". */
+    public static final String CLASS_FOOTNOTE_REF = "footnoteref";
+
+    /** The value for anchor element <tt>class</tt> attributes when used
+      * for external links. The value is "external". */
+    public static final String CLASS_EXTERNAL = "external";
+
+    /** The value for anchor element <tt>class</tt> attributes when used
+      * for attachments. The value is "attachment". */
+    public static final String CLASS_ATTACHMENT = "attachment";
+
     protected static final int              READ          = 0;
     protected static final int              EDIT          = 1;
     protected static final int              EMPTY         = 2;  // Empty message
@@ -223,14 +239,14 @@ public class JSPWikiMarkupParser extends MarkupParser {
        CLASS_WIKIPAGE,
        CLASS_EDITPAGE,
        "",
-       "footnote",
-       "footnoteref",
+       CLASS_FOOTNOTE,
+       CLASS_FOOTNOTE_REF,
        "",
-       "external",
+       CLASS_EXTERNAL,
        CLASS_INTERWIKI,
-       "external",
+       CLASS_EXTERNAL,
        CLASS_WIKIPAGE,
-       "attachment"
+       CLASS_ATTACHMENT
     };
 
 
@@ -517,7 +533,7 @@ public class JSPWikiMarkupParser extends MarkupParser {
                 break;
 
             case LOCAL:
-                el = new Element("a").setAttribute("class","footnote");
+                el = new Element("a").setAttribute("class",CLASS_FOOTNOTE);
                 el.setAttribute("name", "ref-"+m_context.getName()+"-"+link.substring(1));
                 el.addContent("["+text+"]");
                 break;


Mime
View raw message