• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂77 (tree)
時間2008-04-11 20:41:59
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/test/test_xml.rb (revision 76)
+++ trunk/test/test_xml.rb (revision 77)
@@ -55,7 +55,7 @@
5555 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5656 <html lang="ja" xml:lang="ja" xmlns="http://www.w3.org/1999/xhtml">
5757 <head>
58- <title>Title&nbsp;Text</title>
58+ <title>Title Text</title>
5959 <link href="/style.css" rel="stylesheet" type="text/css" />
6060 <script type="text/javascript"></script>
6161 <script type="text/javascript">
@@ -67,8 +67,8 @@
6767 </script>
6868 </head>
6969 <body>
70- <h1 class="title">H1&nbsp;Text</h1>
71- <p>&quot;a&quot;,&nbsp;&lt;b&gt;&nbsp;and&nbsp;&#039;c&#039;</p>
70+ <h1 class="title">H1 Text</h1>
71+ <p>&quot;a&quot;, &lt;b&gt; and &#039;c&#039;</p>
7272 <!--
7373 Comment Text
7474 -->Text<![CDATA[CDATA Text]]>Text</body>
@@ -76,10 +76,10 @@
7676 END
7777
7878 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&nbsp;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() {
8080 alert('Hello');
8181 }
82-</script></head><body><h1 class="title">H1&nbsp;Text</h1><p>&quot;a&quot;,&nbsp;&lt;b&gt;&nbsp;and&nbsp;&#039;c&#039;</p><!-- Comment Text -->Text<![CDATA[CDATA Text]]>Text</body></html>
82+</script></head><body><h1 class="title">H1 Text</h1><p>&quot;a&quot;, &lt;b&gt; and &#039;c&#039;</p><!-- Comment Text -->Text<![CDATA[CDATA Text]]>Text</body></html>
8383 END
8484
8585 #puts(@xml.to_xml)
--- trunk/test/test_wiki.rb (revision 76)
+++ trunk/test/test_wiki.rb (revision 77)
@@ -64,7 +64,7 @@
6464 </ol>
6565 <dl>
6666 <dt>aaa</dt>
67- <dd>a&nbsp;description</dd>
67+ <dd>a description</dd>
6868 <dt>bbb</dt>
6969 <dd>b:description</dd>
7070 </dl>
@@ -73,7 +73,7 @@
7373 <p>aaabbbccc</p>
7474 <dl>
7575 <dt>aaa</dt>
76- <dd>a&nbsp;description</dd>
76+ <dd>a description</dd>
7777 <dt>bbb</dt>
7878 <dd>b:description</dd>
7979 </dl>
--- trunk/init_model.rb (revision 76)
+++ trunk/init_model.rb (revision 77)
@@ -29,7 +29,55 @@
2929 :class => 'Content',
3030 :row => {
3131 '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+',
3381 },
3482 :relation => {'view' => 'view:resource.index.view'},
3583 },
@@ -155,16 +203,6 @@
155203 :preference => {}
156204 },
157205 {
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- {
168206 :name => 'session.user.content.view.html.doc.hd.menu',
169207 :class => 'Widget::View::Menu',
170208 :row => {},
@@ -171,39 +209,16 @@
171209 :relation => {'view' => 'view:resource.index'},
172210 :preference => {
173211 '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',
176213 'li.layout.display' => 'inline',
177214 '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',
186219 }
187220 },
188221 {
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- {
207222 :name => 'session.user.content.view.html.doc.bd.sidebar',
208223 :class => 'Widget::Panel',
209224 :row => {},
@@ -237,12 +252,50 @@
237252 }
238253 },
239254 {
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+ {
240294 :name => 'session.user.content.view.html.doc.bd.client.view',
241295 :class => 'Widget::Content::Wiki',
242296 :row => {},
243297 :relation => {'view' => 'view:resource.index.view'},
244298 :preference => {
245- 'box.size.width' => '100%',
246299 'h2.font.font_size' => '189%',
247300 'h3.font.font_size' => '174%',
248301 'h4.font.font_size' => '161.6%',
@@ -255,11 +308,11 @@
255308 'h5.padding.padding_top' => '5px',
256309 'h6.padding.padding_top' => '5px',
257310
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',
263316
264317 'h2.padding.padding_bottom' => '5px',
265318 'h3.padding.padding_bottom' => '5px',
@@ -273,12 +326,18 @@
273326 'h5.padding.padding_left' => '5px',
274327 'h6.padding.padding_left' => '5px',
275328
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',
281334
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+
282341 'h2.border.border_bottom' => 'solid 1px silver',
283342 'h3.border.border_bottom' => 'solid 1px silver',
284343 'h4.border.border_bottom' => 'solid 1px silver',
@@ -285,6 +344,12 @@
285344 'h5.border.border_bottom' => 'solid 1px silver',
286345 'h6.border.border_bottom' => 'solid 1px silver',
287346
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+
288353 'h2.margin.margin_bottom' => '10px',
289354 'h3.margin.margin_bottom' => '10px',
290355 'h4.margin.margin_bottom' => '10px',
@@ -291,7 +356,57 @@
291356 'h5.margin.margin_bottom' => '10px',
292357 'h6.margin.margin_bottom' => '10px',
293358
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+
294364 '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',
295410 }
296411 },
297412 {
--- trunk/lib/tenarai/xml.rb (revision 76)
+++ trunk/lib/tenarai/xml.rb (revision 77)
@@ -161,7 +161,7 @@
161161 "'" => '&#039;',
162162 '>' => '&gt;',
163163 '<' => '&lt;',
164- ' ' => '&nbsp;'
164+ #' ' => '&nbsp;'
165165 }
166166
167167 ESC_STR = ESC.inject('') do |ret, (key, val)|
--- trunk/main.rb (revision 76)
+++ trunk/main.rb (revision 77)
@@ -118,7 +118,6 @@
118118
119119 a = map[key][v[:name]]
120120 a.row[col] = map[table][name]
121- a.save
122121 end if v[:relation]
123122
124123 v[:preference].each do |pk, pv|
@@ -131,9 +130,10 @@
131130 a = map[key][v[:name]]
132131 if pref = a.preference.find(pk)
133132 pref.value = pv
134- a.save
135133 end
136134 end if v[:preference]
135+
136+ map[key][v[:name]].save
137137 end
138138 end
139139 end
--- trunk/webapp/Widget/Content/Wiki.rb (revision 76)
+++ trunk/webapp/Widget/Content/Wiki.rb (revision 77)
@@ -26,10 +26,18 @@
2626 preference_css 'dt', 'dt'
2727 preference_css 'dd', 'dd'
2828 preference_css 'ul', 'ul'
29+ preference_css 'li_ul', 'li ul'
2930 preference_css 'ul_li', 'ul li'
3031 preference_css 'ol', 'ol'
32+ preference_css 'li_ol', 'li ol'
3133 preference_css 'ol_li', 'ol li'
3234
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+
3341 def render_html(xml, builder)
3442 xml.tag('div', 'id' => html_id) do |div|
3543 div << Tenarai::Wiki.new(resource.content.body)
Show on old repository browser