• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂129 (tree)
時間2008-10-28 22:46:27
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/init_model.rb (revision 128)
+++ trunk/init_model.rb (revision 129)
@@ -5,8 +5,14 @@
55 :name => 'yui-layout',
66 :class => 'Service',
77 :row => {'name' => 'yui-layout'},
8- :relation => {'default_view' => 'view:html.yui-layout'},
8+ :relation => {'default_view' => 'view:html.yui.layout'},
99 },
10+ {
11+ :name => 'yui-treeview',
12+ :class => 'Service',
13+ :row => {'name' => 'yui-treeview'},
14+ :relation => {'default_view' => 'view:html.yui.treeview'},
15+ },
1016 ],
1117
1218 'view' => [
@@ -17,11 +23,23 @@
1723 :relation => {'resource' => 'widget:html'},
1824 },
1925 {
20- :name => 'html.yui-layout',
26+ :name => 'html.yui',
2127 :class => 'View',
22- :row => {'name' => 'yui-layout'},
23- :relation => {'resource' => 'widget:html.view.widget'},
28+ :row => {'name' => 'yui'},
29+ :relation => {'resource' => 'widget:html'},
2430 },
31+ {
32+ :name => 'html.yui.layout',
33+ :class => 'View',
34+ :row => {'name' => 'layout'},
35+ :relation => {'resource' => 'widget:html'},
36+ },
37+ {
38+ :name => 'html.yui.treeview',
39+ :class => 'View',
40+ :row => {'name' => 'treeview'},
41+ :relation => {'resource' => 'widget:html'},
42+ },
2543 ],
2644
2745 'widget' => [
@@ -37,17 +55,17 @@
3755 {
3856 :name => 'html.yui',
3957 :class => 'Widget::Yahoo::UI::Loader',
40- :relation => {'view' => 'view:html.yui-layout'},
58+ :relation => {'view' => 'view:html.yui'},
4159 },
4260 {
4361 :name => 'html.yui.reset_css',
4462 :class => 'Widget::Yahoo::UI::ResetCSS',
45- :relation => {'view' => 'view:html.yui-layout'},
63+ :relation => {'view' => 'view:html.yui'},
4664 },
4765 {
4866 :name => 'html.yui.layout',
4967 :class => 'Widget::Yahoo::UI::Layout',
50- :relation => {'view' => 'view:html.yui-layout'},
68+ :relation => {'view' => 'view:html.yui.layout'},
5169 :css => [
5270 ['.yui-layout-unit-top_background_background-color', '#c3d9ff'],
5371 ['.yui-layout-unit-right_background_background-color', '#e1ecfe'],
@@ -90,7 +108,7 @@
90108 {
91109 :name => 'html.doc',
92110 :class => 'Widget::Panel',
93- :relation => {'view' => 'view:html.yui-layout'},
111+ :relation => {'view' => 'view:html.yui.layout'},
94112 :property => {
95113 :html_attr_id => 'doc3'
96114 }
@@ -98,7 +116,7 @@
98116 {
99117 :name => 'html.doc.hd',
100118 :class => 'Widget::Panel',
101- :relation => {'view' => 'view:html.yui-layout'},
119+ :relation => {'view' => 'view:html.yui.layout'},
102120 :property => {
103121 :html_attr_id => 'hd'
104122 }
@@ -106,7 +124,7 @@
106124 {
107125 :name => 'html.doc.bd',
108126 :class => 'Widget::Panel',
109- :relation => {'view' => 'view:html.yui-layout'},
127+ :relation => {'view' => 'view:html.yui.layout'},
110128 :property => {
111129 :html_attr_id => 'bd'
112130 }
@@ -114,7 +132,7 @@
114132 {
115133 :name => 'html.doc.bd.yui-main',
116134 :class => 'Widget::Panel',
117- :relation => {'view' => 'view:html.yui-layout'},
135+ :relation => {'view' => 'view:html.yui.layout'},
118136 :property => {
119137 :html_attr_id => 'yui-main'
120138 }
@@ -122,7 +140,7 @@
122140 {
123141 :name => 'html.doc.bd.yui-main.yui-b',
124142 :class => 'Widget::Panel',
125- :relation => {'view' => 'view:html.yui-layout'},
143+ :relation => {'view' => 'view:html.yui.layout'},
126144 :property => {
127145 :html_attr_class => 'yui-b'
128146 }
@@ -130,7 +148,7 @@
130148 {
131149 :name => 'html.doc.bd.yui-main.yui-b.yui-gb',
132150 :class => 'Widget::Panel',
133- :relation => {'view' => 'view:html.yui-layout'},
151+ :relation => {'view' => 'view:html.yui.layout'},
134152 :property => {
135153 :html_attr_class => 'yui-gb'
136154 }
@@ -138,7 +156,7 @@
138156 {
139157 :name => 'html.doc.bd.yui-main.yui-b.yui-gb.left',
140158 :class => 'Widget::Panel',
141- :relation => {'view' => 'view:html.yui-layout'},
159+ :relation => {'view' => 'view:html.yui.layout'},
142160 :property => {
143161 :html_attr_id => 'left',
144162 :html_attr_class => 'yui-u first'
@@ -147,7 +165,7 @@
147165 {
148166 :name => 'html.doc.bd.yui-main.yui-b.yui-gb.center',
149167 :class => 'Widget::Panel',
150- :relation => {'view' => 'view:html.yui-layout'},
168+ :relation => {'view' => 'view:html.yui.layout'},
151169 :property => {
152170 :html_attr_id => 'center',
153171 :html_attr_class => 'yui-u'
@@ -156,7 +174,7 @@
156174 {
157175 :name => 'html.doc.bd.yui-main.yui-b.yui-gb.right',
158176 :class => 'Widget::Panel',
159- :relation => {'view' => 'view:html.yui-layout'},
177+ :relation => {'view' => 'view:html.yui.layout'},
160178 :property => {
161179 :html_attr_id => 'right',
162180 :html_attr_class => 'yui-u'
@@ -165,11 +183,17 @@
165183 {
166184 :name => 'html.doc.ft',
167185 :class => 'Widget::Panel',
168- :relation => {'view' => 'view:html.yui-layout'},
186+ :relation => {'view' => 'view:html.yui.layout'},
169187 :property => {
170188 :html_attr_id => 'ft'
171189 }
172190 },
191+
192+ {
193+ :name => 'html.yui.treeview',
194+ :class => 'Widget::Yahoo::UI::TreeView',
195+ :relation => {'view' => 'view:html.yui.treeview'},
196+ },
173197 ],
174198
175199 'content' => [
--- trunk/webapp/Widget/Yahoo/UI/Layout.rb (revision 128)
+++ trunk/webapp/Widget/Yahoo/UI/Layout.rb (revision 129)
@@ -118,7 +118,7 @@
118118 ret
119119 end.join(', ')
120120
121- body.code <<-END
121+ head.code <<-END
122122 var Dom = YAHOO.util.Dom;
123123 var Event = YAHOO.util.Event;
124124
--- trunk/webapp/Widget/Yahoo/UI/Loader.rb (revision 128)
+++ trunk/webapp/Widget/Yahoo/UI/Loader.rb (revision 129)
@@ -39,7 +39,7 @@
3939 onSuccess: function() {
4040 END
4141
42- super(head, script)
42+ super(script, body)
4343
4444 script.code <<-END
4545 }
--- trunk/webapp/Widget/Yahoo/UI/TreeView.rb (nonexistent)
+++ trunk/webapp/Widget/Yahoo/UI/TreeView.rb (revision 129)
@@ -0,0 +1,51 @@
1+#
2+# Copyright (C) 2008 Jun Kikuchi <kikuchi@bonnou.com>
3+#
4+
5+Tenarai::ClassLoader.load_class('Widget::Yahoo::UI::Loader')
6+
7+class Widget
8+ class Yahoo
9+ class UI
10+ class TreeView < ::Widget
11+ extend Tenarai::ClassLoader
12+
13+ resource 'Widget::Yahoo::UI::Loader'
14+
15+ css
16+
17+ def init(builder, service, *param)
18+ super
19+ resource.modules << 'treeview'
20+ end
21+
22+ def render_html(head, body)
23+ body.tag('div', html_attr) do |div|
24+ if @builder.empty?(self)
25+ div.text('')
26+ else
27+ super(head, div)
28+ end
29+ end
30+
31+ head.code <<-END
32+new YAHOO.widget.TreeView('#{html_id}', [
33+ {type:"text", label:"List 0", children: [
34+ {type:"text", label:"List 0-0", children: [
35+ "item 0-0-0",
36+ "item 0-0-1"
37+ ]},
38+ {type:"text", label:"item 0-1", children: [
39+ {type:"text", label:"elsewhere", href:"www.elsewhere.com", target:"_new", title:"go elsewhere", children: [
40+ "item 0-1-0",
41+ "item 0-1-1"
42+ ]}
43+ ]}
44+ ]}
45+]).render();
46+ END
47+ end
48+ end
49+ end
50+ end
51+end
Show on old repository browser