Browse Source

CHART-18102 JXBrowser资源请求增加文件类型

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
27de15b8be
  1. 14
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  2. 4
      designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

14
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -6,14 +6,12 @@ import com.teamdev.jxbrowser.chromium.BrowserContext;
import com.teamdev.jxbrowser.chromium.ProtocolService;
import com.teamdev.jxbrowser.chromium.URLResponse;
import javax.activation.MimetypesFileTypeMap;
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/**
* @author richie
@ -50,6 +48,18 @@ public class Assistant {
if (path.endsWith(".svg")) {
return "image/svg+xml";
}
if (path.endsWith(".png")) {
return "image/png";
}
if (path.endsWith(".woff")) {
return "font/woff";
}
if (path.endsWith(".ttf")) {
return "truetype";
}
if (path.endsWith(".eot")) {
return "embedded-opentype";
}
Path file = new File(path).toPath();
try {
return Files.probeContentType(file);

4
designer-chart/src/main/resources/com/fr/design/editor/rich_editor.html

@ -3,8 +3,8 @@
<head>
<meta charset="utf-8"/>
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="./rich_editor.css"/>
<link rel="stylesheet" type="text/css" href="emb:/com/fr/web/ui/fineui.min.css"/>
<link rel="stylesheet" type="text/css" href="emb:/com/fr/web/ui/materials.min.css"/>
</head>
<body>
<script src="script/enums.js"></script>

Loading…
Cancel
Save