修訂 | 118 (tree) |
---|---|
時間 | 2008-09-15 16:27:18 |
作者 | junkikuchi |
updated.
@@ -14,11 +14,8 @@ | ||
14 | 14 | def render_html(head, body) |
15 | 15 | body.tag( |
16 | 16 | 'iframe', |
17 | - html_attr.merge('src' => uri(resource.resource.view)) | |
17 | + html_attr.merge('src' => @service.uri(resource.resource.view)) | |
18 | 18 | ) do |iframe| |
19 | - #@preview = true | |
20 | - #resource.resource.content.preview(@service, [], head, div) | |
21 | - #div.text('') if div.empty? | |
22 | 19 | iframe.text('') |
23 | 20 | end |
24 | 21 | end |
@@ -134,7 +134,7 @@ | ||
134 | 134 | form.tag('h4').text(css.name) |
135 | 135 | form.tag('dl') do |dl| |
136 | 136 | css.value.each do |selector| |
137 | - _form_id = [val.name, css.name, selector].join('.') | |
137 | + _form_id = [val.name, css.name, selector].join("_") | |
138 | 138 | _id = form_id(_form_id) |
139 | 139 | value = if widget.css.key?(_form_id) then |
140 | 140 | widget.css[_form_id].value |
@@ -172,7 +172,6 @@ | ||
172 | 172 | |
173 | 173 | def post(query={}) |
174 | 174 | css = resource.content.css |
175 | - | |
176 | 175 | query.each do |key, val| |
177 | 176 | if val.empty? |
178 | 177 | css.delete(key) |
@@ -1,54 +0,0 @@ | ||
1 | -# | |
2 | -# Copyright (C) 2008 Jun Kikuchi <kikuchi@bonnou.com> | |
3 | -# | |
4 | - | |
5 | -Tenarai::ClassLoader.load_class('Widget::View') | |
6 | - | |
7 | -class Widget | |
8 | - class View | |
9 | - class List < ::Widget | |
10 | - extend Tenarai::ClassLoader | |
11 | - | |
12 | - preference_css 'box' | |
13 | - preference_list | |
14 | - | |
15 | - def build_uri(param, query) | |
16 | - service.build_uri( | |
17 | - path.inject([]) do |ret, val| | |
18 | - if val.equal?(resource) | |
19 | - val.widget_uri(ret, query, param) | |
20 | - else | |
21 | - val.widget_uri(ret, query) | |
22 | - end | |
23 | - ret | |
24 | - end, | |
25 | - query | |
26 | - ) | |
27 | - end | |
28 | - | |
29 | - def uri(*param, &block) | |
30 | - query = Tenarai::CGI::Query.new | |
31 | - block.call(query) if block_given? | |
32 | - build_uri(param, query) | |
33 | - end | |
34 | - | |
35 | - def render_html(xml, builder, content=nil) | |
36 | - content = resource.content.parent if content.nil? | |
37 | - | |
38 | - xml.tag('div', 'id' => html_id) do |div| | |
39 | - div.tag('ul') do |ul| | |
40 | - content.node.each do |c| | |
41 | - ul.tag('li') do |li| | |
42 | - li.tag('a') do |a| | |
43 | - a['href'] = uri(c.id) | |
44 | - a['class'] = 'selected' if resource.content.equal?(c) | |
45 | - end.text(c.name) | |
46 | - render_html(li, builder, c) unless c.node.empty? | |
47 | - end | |
48 | - end | |
49 | - end | |
50 | - end | |
51 | - end | |
52 | - end | |
53 | - end | |
54 | -end |
@@ -153,7 +153,7 @@ | ||
153 | 153 | |
154 | 154 | def render_css(_css) |
155 | 155 | css.each do |val| |
156 | - a = val.name.split('.') | |
156 | + a = val.name.split('_') | |
157 | 157 | _css.selector( |
158 | 158 | css_id(a.shift), |
159 | 159 | a.pop => val.value |