修訂 | 77 (tree) |
---|---|
時間 | 2008-04-11 20:41:59 |
作者 | junkikuchi |
updated.
@@ -55,7 +55,7 @@ | ||
55 | 55 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
56 | 56 | <html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"> |
57 | 57 | <head> |
58 | - <title>Title Text</title> | |
58 | + <title>Title Text</title> | |
59 | 59 | <link href="/style.css" rel="stylesheet" type="text/css" /> |
60 | 60 | <script type="text/javascript"></script> |
61 | 61 | <script type="text/javascript"> |
@@ -67,8 +67,8 @@ | ||
67 | 67 | </script> |
68 | 68 | </head> |
69 | 69 | <body> |
70 | - <h1 class="title">H1 Text</h1> | |
71 | - <p>"a", <b> and 'c'</p> | |
70 | + <h1 class="title">H1 Text</h1> | |
71 | + <p>"a", <b> and 'c'</p> | |
72 | 72 | <!-- |
73 | 73 | Comment Text |
74 | 74 | -->Text<![CDATA[CDATA Text]]>Text</body> |
@@ -76,10 +76,10 @@ | ||
76 | 76 | END |
77 | 77 | |
78 | 78 | xml =<<END |
79 | -<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"><head><title>Title Text</title><link href="/style.css" rel="stylesheet" type="text/css" /><script type="text/javascript"></script><script type="text/javascript">function hello() { | |
79 | +<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml"><head><title>Title Text</title><link href="/style.css" rel="stylesheet" type="text/css" /><script type="text/javascript"></script><script type="text/javascript">function hello() { | |
80 | 80 | alert('Hello'); |
81 | 81 | } |
82 | -</script></head><body><h1 class="title">H1 Text</h1><p>"a", <b> and 'c'</p><!-- Comment Text -->Text<![CDATA[CDATA Text]]>Text</body></html> | |
82 | +</script></head><body><h1 class="title">H1 Text</h1><p>"a", <b> and 'c'</p><!-- Comment Text -->Text<![CDATA[CDATA Text]]>Text</body></html> | |
83 | 83 | END |
84 | 84 | |
85 | 85 | #puts(@xml.to_xml) |
@@ -64,7 +64,7 @@ | ||
64 | 64 | </ol> |
65 | 65 | <dl> |
66 | 66 | <dt>aaa</dt> |
67 | - <dd>a description</dd> | |
67 | + <dd>a description</dd> | |
68 | 68 | <dt>bbb</dt> |
69 | 69 | <dd>b:description</dd> |
70 | 70 | </dl> |
@@ -73,7 +73,7 @@ | ||
73 | 73 | <p>aaabbbccc</p> |
74 | 74 | <dl> |
75 | 75 | <dt>aaa</dt> |
76 | - <dd>a description</dd> | |
76 | + <dd>a description</dd> | |
77 | 77 | <dt>bbb</dt> |
78 | 78 | <dd>b:description</dd> |
79 | 79 | </dl> |
@@ -29,7 +29,55 @@ | ||
29 | 29 | :class => 'Content', |
30 | 30 | :row => { |
31 | 31 | 'title' => 'index', |
32 | - 'body' => '', | |
32 | + 'body' => ' | |
33 | +コンテンツについて記述。サマリー。 | |
34 | + | |
35 | +*ヘッダー1 | |
36 | + | |
37 | +ここにコンテンツを記述します。 | |
38 | + | |
39 | +-リスト1 | |
40 | +--リスト1-1 | |
41 | +---リスト1-1-1 | |
42 | +--リスト1-2 | |
43 | +--リスト1-3 | |
44 | +-リスト2 | |
45 | + | |
46 | + class A | |
47 | + def aaa | |
48 | + a = b = 1 | |
49 | + end | |
50 | + end | |
51 | + | |
52 | +==== | |
53 | + | |
54 | +> これは引用された | |
55 | +> 文章です。 | |
56 | +> よ。 | |
57 | + | |
58 | +1.リスト | |
59 | +1.1.リスト | |
60 | +1.1.1.リスト | |
61 | +1.1.リスト | |
62 | +1.1.リスト | |
63 | +1.リスト | |
64 | + | |
65 | +1.List1 | |
66 | +1.1.List2 | |
67 | +1.1.1.List3 | |
68 | + | |
69 | +**ヘッダー2 | |
70 | + | |
71 | +:レモン:すっぱくて黄色いフルーツである。 | |
72 | +:りんご:赤いが皮を向くと白っぽい。蜜入りのりんごはおいしい。都会の人は痛んでいると勘違いして捨ててしまう場合がある。もったいなし。 | |
73 | +:梨:ジューシーである。 | |
74 | + | |
75 | +***ヘッダー3 | |
76 | + | |
77 | +****ヘッダー4 | |
78 | + | |
79 | +*****ヘッダー5 | |
80 | +', | |
33 | 81 | }, |
34 | 82 | :relation => {'view' => 'view:resource.index.view'}, |
35 | 83 | }, |
@@ -155,16 +203,6 @@ | ||
155 | 203 | :preference => {} |
156 | 204 | }, |
157 | 205 | { |
158 | - :name => 'session.user.content.view.html.doc.hd.header', | |
159 | - :class => 'Widget::Content::Header', | |
160 | - :row => {}, | |
161 | - :relation => {'view' => 'view:resource.index'}, | |
162 | - :preference => { | |
163 | - 'box.padding.padding_top' => '10px', | |
164 | - 'box.font.font_size' => '197%', | |
165 | - } | |
166 | - }, | |
167 | - { | |
168 | 206 | :name => 'session.user.content.view.html.doc.hd.menu', |
169 | 207 | :class => 'Widget::View::Menu', |
170 | 208 | :row => {}, |
@@ -171,39 +209,16 @@ | ||
171 | 209 | :relation => {'view' => 'view:resource.index'}, |
172 | 210 | :preference => { |
173 | 211 | 'ul.text.text_align' => 'right', |
174 | - 'ul.padding.padding_bottom' => '3px', | |
175 | - 'ul.border.border_bottom' => '1px solid silver', | |
212 | + 'ul.padding.padding_bottom' => '5px', | |
176 | 213 | 'li.layout.display' => 'inline', |
177 | 214 | 'a.text.text_decoration' => 'none', |
178 | - 'a.padding.padding_top' => '3px', | |
179 | - 'a.padding.padding_right' => '3px', | |
180 | - 'a.padding.padding_bottom' => '3px', | |
181 | - 'a.padding.padding_left' => '3px', | |
182 | - 'a.border.border_top' => '1px solid silver', | |
183 | - 'a.border.border_right' => '1px solid silver', | |
184 | - 'a.border.border_bottom' => 'none', | |
185 | - 'a.border.border_left' => '1px solid silver', | |
215 | + 'a.padding.padding_top' => '5px', | |
216 | + 'a.padding.padding_right' => '5px', | |
217 | + 'a.padding.padding_bottom' => '5px', | |
218 | + 'a.padding.padding_left' => '5px', | |
186 | 219 | } |
187 | 220 | }, |
188 | 221 | { |
189 | - :name => 'session.user.content.view.html.doc.hd.path', | |
190 | - :class => 'Widget::Content::Path', | |
191 | - :row => {}, | |
192 | - :relation => {'view' => 'view:resource.index'}, | |
193 | - :preference => { | |
194 | - 'box.margin.margin_top' => '10px', | |
195 | - 'box.margin.margin_bottom' => '10px', | |
196 | - 'ul.layout.display' => 'inline', | |
197 | - 'ul.padding.padding_top' => '10px', | |
198 | - 'ul.padding.padding_bottom' => '10px', | |
199 | - 'li.layout.display' => 'inline', | |
200 | - 'a.text.text_decoration' => 'none', | |
201 | - 'a.padding.padding_top' => '10px', | |
202 | - 'a.padding.padding_right' => '10px', | |
203 | - 'a.padding.padding_bottom' => '10px', | |
204 | - } | |
205 | - }, | |
206 | - { | |
207 | 222 | :name => 'session.user.content.view.html.doc.bd.sidebar', |
208 | 223 | :class => 'Widget::Panel', |
209 | 224 | :row => {}, |
@@ -237,12 +252,50 @@ | ||
237 | 252 | } |
238 | 253 | }, |
239 | 254 | { |
255 | + :name => 'session.user.content.view.html.doc.bd.client.path', | |
256 | + :class => 'Widget::Content::Path', | |
257 | + :row => {}, | |
258 | + :relation => {'view' => 'view:resource.index'}, | |
259 | + :preference => { | |
260 | + 'box.margin.margin_top' => '10px', | |
261 | + 'box.margin.margin_bottom' => '10px', | |
262 | + 'ul.layout.display' => 'inline', | |
263 | + 'ul.padding.padding_top' => '10px', | |
264 | + 'ul.padding.padding_bottom' => '10px', | |
265 | + 'li.layout.display' => 'inline', | |
266 | + 'a.text.text_decoration' => 'none', | |
267 | + 'a.padding.padding_top' => '10px', | |
268 | + 'a.padding.padding_right' => '10px', | |
269 | + 'a.padding.padding_bottom' => '10px', | |
270 | + } | |
271 | + }, | |
272 | + { | |
273 | + :name => 'session.user.content.view.html.doc.bd.client.header', | |
274 | + :class => 'Widget::Content::Header', | |
275 | + :row => {}, | |
276 | + :relation => {'view' => 'view:resource.index'}, | |
277 | + :preference => { | |
278 | + 'box.font.font_size' => '197%', | |
279 | +=begin | |
280 | + 'box.padding.padding_top' => '5px', | |
281 | + 'box.padding.padding_right' => '10px', | |
282 | + 'box.padding.padding_bottom' => '5px', | |
283 | + 'box.padding.padding_left' => '5px', | |
284 | + | |
285 | + 'box.border.border_top' => 'solid 1px silver', | |
286 | + 'box.border.border_right' => 'solid 1px silver', | |
287 | + 'box.border.border_bottom' => 'solid 1px silver', | |
288 | + 'box.border.border_left' => 'solid 10px red', | |
289 | +=end | |
290 | + 'box.margin.margin_bottom' => '10px', | |
291 | + } | |
292 | + }, | |
293 | + { | |
240 | 294 | :name => 'session.user.content.view.html.doc.bd.client.view', |
241 | 295 | :class => 'Widget::Content::Wiki', |
242 | 296 | :row => {}, |
243 | 297 | :relation => {'view' => 'view:resource.index.view'}, |
244 | 298 | :preference => { |
245 | - 'box.size.width' => '100%', | |
246 | 299 | 'h2.font.font_size' => '189%', |
247 | 300 | 'h3.font.font_size' => '174%', |
248 | 301 | 'h4.font.font_size' => '161.6%', |
@@ -255,11 +308,11 @@ | ||
255 | 308 | 'h5.padding.padding_top' => '5px', |
256 | 309 | 'h6.padding.padding_top' => '5px', |
257 | 310 | |
258 | - 'h2.padding.padding_right' => '5px', | |
259 | - 'h3.padding.padding_right' => '5px', | |
260 | - 'h4.padding.padding_right' => '5px', | |
261 | - 'h5.padding.padding_right' => '5px', | |
262 | - 'h6.padding.padding_right' => '5px', | |
311 | + 'h2.padding.padding_right' => '10px', | |
312 | + 'h3.padding.padding_right' => '10px', | |
313 | + 'h4.padding.padding_right' => '10px', | |
314 | + 'h5.padding.padding_right' => '10px', | |
315 | + 'h6.padding.padding_right' => '10px', | |
263 | 316 | |
264 | 317 | 'h2.padding.padding_bottom' => '5px', |
265 | 318 | 'h3.padding.padding_bottom' => '5px', |
@@ -273,12 +326,18 @@ | ||
273 | 326 | 'h5.padding.padding_left' => '5px', |
274 | 327 | 'h6.padding.padding_left' => '5px', |
275 | 328 | |
276 | - 'h2.border.border_left' => 'solid 10px red', | |
277 | - 'h3.border.border_left' => 'solid 10px red', | |
278 | - 'h4.border.border_left' => 'solid 10px red', | |
279 | - 'h5.border.border_left' => 'solid 10px red', | |
280 | - 'h6.border.border_left' => 'solid 10px red', | |
329 | + 'h2.border.border_top' => 'solid 1px silver', | |
330 | + 'h3.border.border_top' => 'solid 1px silver', | |
331 | + 'h4.border.border_top' => 'solid 1px silver', | |
332 | + 'h5.border.border_top' => 'solid 1px silver', | |
333 | + 'h6.border.border_top' => 'solid 1px silver', | |
281 | 334 | |
335 | + 'h2.border.border_right' => 'solid 1px silver', | |
336 | + 'h3.border.border_right' => 'solid 1px silver', | |
337 | + 'h4.border.border_right' => 'solid 1px silver', | |
338 | + 'h5.border.border_right' => 'solid 1px silver', | |
339 | + 'h6.border.border_right' => 'solid 1px silver', | |
340 | + | |
282 | 341 | 'h2.border.border_bottom' => 'solid 1px silver', |
283 | 342 | 'h3.border.border_bottom' => 'solid 1px silver', |
284 | 343 | 'h4.border.border_bottom' => 'solid 1px silver', |
@@ -285,6 +344,12 @@ | ||
285 | 344 | 'h5.border.border_bottom' => 'solid 1px silver', |
286 | 345 | 'h6.border.border_bottom' => 'solid 1px silver', |
287 | 346 | |
347 | + 'h2.border.border_left' => 'solid 10px red', | |
348 | + 'h3.border.border_left' => 'solid 10px red', | |
349 | + 'h4.border.border_left' => 'solid 10px red', | |
350 | + 'h5.border.border_left' => 'solid 10px red', | |
351 | + 'h6.border.border_left' => 'solid 10px red', | |
352 | + | |
288 | 353 | 'h2.margin.margin_bottom' => '10px', |
289 | 354 | 'h3.margin.margin_bottom' => '10px', |
290 | 355 | 'h4.margin.margin_bottom' => '10px', |
@@ -291,7 +356,57 @@ | ||
291 | 356 | 'h5.margin.margin_bottom' => '10px', |
292 | 357 | 'h6.margin.margin_bottom' => '10px', |
293 | 358 | |
359 | + 'hr.border.border_top' => 'dotted 1px silver', | |
360 | + 'hr.border.border_right' => 'none', | |
361 | + 'hr.border.border_bottom' => 'none', | |
362 | + 'hr.border.border_left' => 'none', | |
363 | + | |
294 | 364 | 'p.margin.margin_bottom' => '10px', |
365 | + | |
366 | + 'pre.padding.padding_top' => '5px', | |
367 | + 'pre.padding.padding_right' => '5px', | |
368 | + 'pre.padding.padding_bottom' => '5px', | |
369 | + 'pre.padding.padding_left' => '5px', | |
370 | + | |
371 | + 'pre.border.border_top' => 'solid 1px gray', | |
372 | + 'pre.border.border_right' => 'solid 1px gray', | |
373 | + 'pre.border.border_bottom' => 'solid 1px gray', | |
374 | + 'pre.border.border_left' => 'solid 1px gray', | |
375 | + | |
376 | + 'pre.background.background_color' => 'silver', | |
377 | + | |
378 | + 'pre.margin.margin_bottom' => '10px', | |
379 | + | |
380 | + 'blockquote.padding.padding_top' => '5px', | |
381 | + 'blockquote.padding.padding_right' => '5px', | |
382 | + 'blockquote.padding.padding_bottom' => '5px', | |
383 | + 'blockquote.padding.padding_left' => '5px', | |
384 | + | |
385 | + 'blockquote.border.border_top' => 'dotted 1px gray', | |
386 | + 'blockquote.border.border_right' => 'dotted 1px gray', | |
387 | + 'blockquote.border.border_bottom' => 'dotted 1px gray', | |
388 | + 'blockquote.border.border_left' => 'dotted 1px gray', | |
389 | + | |
390 | + 'blockquote.margin.margin_bottom' => '10px', | |
391 | + | |
392 | + 'dl.margin.margin_bottom' => '10px', | |
393 | + | |
394 | + 'dt.font.font_weight' => 'bold', | |
395 | + | |
396 | + 'dd.margin.margin_left' => '20px', | |
397 | + 'dd.margin.margin_bottom' => '10px', | |
398 | + | |
399 | + 'ul.margin.margin_bottom' => '10px', | |
400 | + 'ul.margin.margin_left' => '10px', | |
401 | + | |
402 | + 'li_ul.margin.margin_bottom' => '0', | |
403 | + 'ul_li.margin.margin_left' => '1em', | |
404 | + | |
405 | + 'ol.margin.margin_bottom' => '10px', | |
406 | + 'ol.margin.margin_left' => '10px', | |
407 | + | |
408 | + 'li_ol.margin.margin_bottom' => '0', | |
409 | + 'ol_li.margin.margin_left' => '1em', | |
295 | 410 | } |
296 | 411 | }, |
297 | 412 | { |
@@ -161,7 +161,7 @@ | ||
161 | 161 | "'" => ''', |
162 | 162 | '>' => '>', |
163 | 163 | '<' => '<', |
164 | - ' ' => ' ' | |
164 | + #' ' => ' ' | |
165 | 165 | } |
166 | 166 | |
167 | 167 | ESC_STR = ESC.inject('') do |ret, (key, val)| |
@@ -118,7 +118,6 @@ | ||
118 | 118 | |
119 | 119 | a = map[key][v[:name]] |
120 | 120 | a.row[col] = map[table][name] |
121 | - a.save | |
122 | 121 | end if v[:relation] |
123 | 122 | |
124 | 123 | v[:preference].each do |pk, pv| |
@@ -131,9 +130,10 @@ | ||
131 | 130 | a = map[key][v[:name]] |
132 | 131 | if pref = a.preference.find(pk) |
133 | 132 | pref.value = pv |
134 | - a.save | |
135 | 133 | end |
136 | 134 | end if v[:preference] |
135 | + | |
136 | + map[key][v[:name]].save | |
137 | 137 | end |
138 | 138 | end |
139 | 139 | end |
@@ -26,10 +26,18 @@ | ||
26 | 26 | preference_css 'dt', 'dt' |
27 | 27 | preference_css 'dd', 'dd' |
28 | 28 | preference_css 'ul', 'ul' |
29 | + preference_css 'li_ul', 'li ul' | |
29 | 30 | preference_css 'ul_li', 'ul li' |
30 | 31 | preference_css 'ol', 'ol' |
32 | + preference_css 'li_ol', 'li ol' | |
31 | 33 | preference_css 'ol_li', 'ol li' |
32 | 34 | |
35 | + def render_css(css, builder) | |
36 | + css.selector('%s ul li' % css_id)['list-style-type'] = 'disc' | |
37 | + css.selector('%s ol li' % css_id)['list-style-type'] = 'decimal' | |
38 | + super | |
39 | + end | |
40 | + | |
33 | 41 | def render_html(xml, builder) |
34 | 42 | xml.tag('div', 'id' => html_id) do |div| |
35 | 43 | div << Tenarai::Wiki.new(resource.content.body) |