Tips of the day: allow to use external CSS, bundle default CSS implementation

This commit is contained in:
Kirill.Safonov
2011-06-27 18:08:21 +04:00
parent 210700a450
commit afc13d3160
2 changed files with 47 additions and 6 deletions
@@ -28,7 +28,6 @@ import org.jetbrains.annotations.NonNls;
import javax.swing.*;
import javax.swing.text.Document;
import javax.swing.text.html.HTMLDocument;
import java.io.IOException;
import java.io.StringReader;
import java.net.URL;
@@ -65,11 +64,7 @@ public class TipUIUtil {
String replaced = text.toString().replace("&productName;", ApplicationNamesInfo.getInstance().getFullProductName());
replaced = replaced.replace("&majorVersion;", ApplicationInfo.getInstance().getMajorVersion());
replaced = replaced.replace("&minorVersion;", ApplicationInfo.getInstance().getMinorVersion());
browser.read(new StringReader(replaced), null);
final Document document = browser.getDocument();
if (document instanceof HTMLDocument) {
((HTMLDocument)document).setBase(url);
}
browser.read(new StringReader(replaced), url);
}
catch (IOException e) {
setCantReadText(browser);
@@ -0,0 +1,46 @@
body {
background: #ffffff;
margin-bottom: 3px;
}
p, h1 {
font-family: 'Malgun Gothic', 'Meiryo UI', 'MS Reference Sans Serif', verdana, arial, sans-serif;
}
.code, .shortcut, pre {
font-family: "Courier New", Courier, monospace;
}
p, h1, pre {
margin-left: 7px;
margin-top: 3px;
margin-right: 2px;
margin-bottom: 0;
font-size: 10px;
color: #3f3f3f;
}
.image, pre {
margin-top: 6px;
margin-bottom: 3px;
}
pre {
border-style: solid;
border-width: 1px;
border-color: #d0d0d0;
background-color: #fbfbfb;
padding-left: 7px;
padding-top: 3px;
padding-bottom: 6px;
}
h1, .control, .shortcut {
font-weight: bold;
}
h1 .product, .emphasis {
color: #264db5;
}
h1 .version, .caret {
color: #f58220;
}
pre .emphasis, .code .emphasis {
color: #990000;
}
pre .keyword, .code .keyword {
color: #000080;
}