Skip to content

Commit

Permalink
refs #6 add svg support in three places - hopefully nothing is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mgoellnitz committed Feb 19, 2019
1 parent 834ea65 commit 4ee81c8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 3 additions & 1 deletion core/src/org/tangram/Constants.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2011-2015 Martin Goellnitz
* Copyright 2011-2019 Martin Goellnitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -54,6 +54,8 @@ public final class Constants {

public static final String MIME_TYPE_MARKDOWN = "text/x-markdown";

public static final String MIME_TYPE_SVG = "image/svg+xml";

/**
* Default date format string for http headers and the like.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
*
* Copyright 2013-2016 Martin Goellnitz
* Copyright 2013-2019 Martin Goellnitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -52,6 +52,7 @@ public AbstractRepositoryTemplateResolver() {
supportedContentTypes = new HashSet<>();
supportedContentTypes.add(Constants.MIME_TYPE_HTML);
supportedContentTypes.add(Constants.MIME_TYPE_XML);
supportedContentTypes.add(Constants.MIME_TYPE_SVG);
} // AbstractRepositoryTemplateResolver()


Expand Down
12 changes: 11 additions & 1 deletion mutable/src/org/tangram/mutable/CodeHelper.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
*
* Copyright 2013-2016 Martin Goellnitz
* Copyright 2013-2019 Martin Goellnitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
Expand Down Expand Up @@ -53,6 +53,7 @@ private CodeHelper() {
MIME_TYPES.add(Constants.MIME_TYPE_XML);
MIME_TYPES.add(Constants.MIME_TYPE_HTML);
MIME_TYPES.add(Constants.MIME_TYPE_CSS);
MIME_TYPES.add(Constants.MIME_TYPE_SVG);
MIME_TYPES.add(Constants.MIME_TYPE_JS);
MIME_TYPES.add(Constants.MIME_TYPE_GROOVY);
MIME_TYPES.add(Constants.MIME_TYPE_MARKDOWN);
Expand Down Expand Up @@ -85,6 +86,9 @@ public static String getExtension(String mimeType) {
if (Constants.MIME_TYPE_XML.equals(mimeType)) {
mimeType = "text/vtl";
} // if
if (Constants.MIME_TYPE_SVG.equals(mimeType)) {
mimeType = "text/vtl";
} // if
if (Constants.MIME_TYPE_JS.equals(mimeType)) {
mimeType = "text/js";
} // if
Expand Down Expand Up @@ -120,6 +124,9 @@ public static String getFolder(String mimeType) {
if (Constants.MIME_TYPE_XML.equals(mimeType)) {
mimeType = "text/velocity-xml";
} // if
if (Constants.MIME_TYPE_SVG.equals(mimeType)) {
mimeType = "text/velocity-svg";
} // if
if (Constants.MIME_TYPE_JS.equals(mimeType)) {
mimeType = "text/js";
} // if
Expand Down Expand Up @@ -153,6 +160,9 @@ public static String getMimetype(String directoryName) {
if ("css".equals(directoryName)) {
result = Constants.MIME_TYPE_CSS;
} // if
if ("velocity-svg".equals(directoryName)) {
result = Constants.MIME_TYPE_SVG;
} // if
if ("js".equals(directoryName)) {
result = Constants.MIME_TYPE_JS;
} // if
Expand Down

0 comments on commit 4ee81c8

Please sign in to comment.