Browse Source

[sjis] and [aa] tags for SJIS or ASCII art

yumi 1 year ago
parent
commit
7adcbd36e4
3 changed files with 31 additions and 10 deletions
  1. 7
    1
      includes/ResourceManager.php
  2. 11
    1
      info/BBCode.txt
  3. 13
    8
      www/css/Base.css

+ 7
- 1
includes/ResourceManager.php View File

@@ -80,7 +80,13 @@ class ResourceManager {
80 80
 		/* [aa] ASCII Art tag */
81 81
 		$builder = new \jBBCode\CodeDefinitionBuilder(
82 82
 			'aa',
83
-			'<pre>{param}</pre>'
83
+			'<samp class=aa>{param}</samp>'
84
+		);
85
+		$bbparser->addCodeDefinition($builder->build());
86
+		/* [sjis] ASCII Art tag */
87
+		$builder = new \jBBCode\CodeDefinitionBuilder(
88
+			'sjis',
89
+			'<samp class=sjis>{param}</samp>'
84 90
 		);
85 91
 		$builder->setParseContent(false);
86 92
 		$bbparser->addCodeDefinition($builder->build());

+ 11
- 1
info/BBCode.txt View File

@@ -66,5 +66,15 @@ reference of BBCode tags which are appropriate in the context of RAL.
66 66
 	<td>Un/attributed quote</td>
67 67
 	<td>&lt;blockquote cite=<em>source</em>&gt;</td>
68 68
 	<td>Optional; provides a source for the quote</td>
69
-</table>
69
+</tr><tr>
70
+	<td>[aa]</td>
71
+	<td>ASCII Art</td>
72
+	<td>&lt;span class=aa&gt;</td>
73
+	<td>N/A</td>
74
+</tr><tr>
75
+	<td>[sjis]</td>
76
+	<td>SJIS Art</td>
77
+	<td>&lt;span class=sjis&gt;</td>
78
+	<td>N/A</td>
79
+</tr></table>
70 80
 </article>

+ 13
- 8
www/css/Base.css View File

@@ -1,11 +1,5 @@
1 1
 body {
2
-	font-family: "Palatino Linotype",
3
-	"Book Antiqua",
4
-	Palatino,
5
-	serif;
6
-}
7
-h1, h2, h3, h4, h5, h6 {
8
-	font-weight: lighter;
2
+	font-family: 'MS Pゴシック', IPAMonaPGothic, Mona;
9 3
 }
10 4
 header img {
11 5
 	border: 1px solid;
@@ -206,11 +200,13 @@ select, button {
206 200
 	outline: 0;
207 201
 }
208 202
 input, select { border: 1px solid; }
209
-.post pre {
203
+.post .aa, .post .sjis {
210 204
 	display: inline-block;
211 205
 	max-width: 100%;
212 206
 	overflow-x: scroll;
213 207
 	padding: 5px;
208
+	white-space: pre;
209
+	letter-spacing: 0;
214 210
 }
215 211
 .post blockquote {
216 212
 	margin: 0;
@@ -234,3 +230,12 @@ input, select { border: 1px solid; }
234 230
 blockquote > * {
235 231
 	display: inline;
236 232
 }
233
+.sjis {
234
+	font-family: 'MS Pゴシック', IPAMonaPGothic, Mona;
235
+	font-size: 12pt;
236
+	line-height: 18px;
237
+}
238
+.aa {
239
+	font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
240
+	line-height: 12px;
241
+}