• R/O
  • SSH
  • HTTPS

tenarai: 提交


Commit MetaInfo

修訂135 (tree)
時間2008-11-04 07:23:10
作者junkikuchi

Log Message

updated.

Change Summary

差異

--- trunk/pub/admin.js (revision 134)
+++ trunk/pub/admin.js (revision 135)
@@ -69,7 +69,7 @@
6969
7070 App.Layout.prototype = {
7171 init: function(app) {
72- this.app = app;
72+ this.app = app;
7373
7474 this.units = {
7575 top: {
@@ -80,7 +80,7 @@
8080 right: {
8181 position: 'right',
8282 body: 'right',
83- width: 200,
83+ width: 250,
8484 resize: true,
8585 scroll: true,
8686 gutter: '0 0 0 5px'
@@ -93,7 +93,7 @@
9393 left: {
9494 position: 'left',
9595 body: 'left',
96- width: 200,
96+ width: 250,
9797 resize: true,
9898 scroll: true,
9999 gutter: '0 5px 0 0'
@@ -163,7 +163,7 @@
163163
164164 $('#right').append('<h2>Property</h2>');
165165 $('#right').append('<div id="property"></div>');
166- this.property = new App.View.Property(
166+ this.property = new App.View.DataTable(
167167 this,
168168 'property',
169169 config.property.url
@@ -171,7 +171,7 @@
171171
172172 $('#right').append('<h2>CSS</h2>');
173173 $('#right').append('<div id="css"></div>');
174- this.css = new App.View.CSS(
174+ this.css = new App.View.DataTable(
175175 this,
176176 'css',
177177 config.css.url
@@ -272,13 +272,13 @@
272272 }
273273
274274 /*
275- * App.View.Property
275+ * App.View.DataTable
276276 */
277- App.View.Property = function() {
277+ App.View.DataTable = function() {
278278 this.init.apply(this, arguments);
279279 }
280280
281- App.View.Property.prototype = {
281+ App.View.DataTable.prototype = {
282282 init: function(client, tag_id, url) {
283283 this.client = client;
284284 this.tag_id = tag_id;
@@ -286,55 +286,6 @@
286286 },
287287
288288 update: function(widget_id) {
289- src = new YAHOO.util.XHRDataSource(this.url + widget_id);
290- src.responseType = YAHOO.util.DataSource.TYPE_JSON;
291- src.responseSchema = {
292- resultsList: 'results',
293- fields: ['name', 'value']
294- }
295-
296- YAHOO.widget.DataTable._bStylesheetFallback = !!YAHOO.env.ua.ie;
297- table = new YAHOO.widget.DataTable(
298- this.tag_id,
299- [
300- {
301- key: 'name'
302- },
303- {
304- key: 'value',
305- editor: new YAHOO.widget.TextboxCellEditor({disableBtns: true})
306- }
307- ],
308- src
309- );
310- table.subscribe('cellMouseoverEvent', function(args) {
311- var cell = args.target;
312- if(YAHOO.util.Dom.hasClass(cell, 'yui-dt-editable')) {
313- this.highlightCell(cell);
314- }
315- });
316- table.subscribe('cellMouseoutEvent', table.onEventUnhighlightCell);
317- table.subscribe('cellClickEvent', table.onEventShowCellEditor);
318- },
319-
320- render: function() {}
321- }
322-
323- /*
324- * App.View.CSS
325- */
326- App.View.CSS = function() {
327- this.init.apply(this, arguments);
328- }
329-
330- App.View.CSS.prototype = {
331- init: function(client, tag_id, url) {
332- this.client = client;
333- this.tag_id = tag_id;
334- this.url = url;
335- },
336-
337- update: function(widget_id) {
338289 var url = this.url + widget_id;
339290
340291 src = new YAHOO.util.XHRDataSource(url);
--- trunk/webapp/Widget/Widget/Property/JSON.rb (revision 134)
+++ trunk/webapp/Widget/Widget/Property/JSON.rb (revision 135)
@@ -21,6 +21,7 @@
2121 ak.to_s <=> bk.to_s
2222 end.each do |key, val|
2323 properties << {
24+ 'id' => form_id(key),
2425 'name' => key,
2526 'value' => val
2627 }
@@ -30,6 +31,17 @@
3031 'results' => properties
3132 })
3233 end
34+
35+ def post(query)
36+ query.each do |key, val|
37+ model.content.property[key.to_sym] = if val.empty?
38+ nil
39+ else
40+ val
41+ end
42+ end
43+ model.content.save
44+ end
3345 end
3446 end
3547 end
--- trunk/webapp/Widget/Widget/CSS.rb (nonexistent)
+++ trunk/webapp/Widget/Widget/CSS.rb (revision 135)
@@ -0,0 +1,120 @@
1+#
2+# Copyright (C) 2008 Jun Kikuchi <kikuchi@bonnou.com>
3+#
4+
5+Tenarai::ClassLoader.load_class('Widget::Widget')
6+
7+class Widget
8+ class Widget
9+ class CSS < ::Widget
10+ extend Tenarai::ClassLoader
11+
12+ CSS = Tenarai::Container.new
13+ CSS << Tenarai::Container::Value.new(
14+ 'font',
15+ [
16+ 'font-family',
17+ 'font-weight',
18+ 'font-size',
19+ 'font-style',
20+ 'font-variant',
21+ ]
22+ )
23+ CSS << Tenarai::Container::Value.new(
24+ 'text',
25+ [
26+ 'color',
27+ 'text-indent',
28+ 'text-align',
29+ 'line-height',
30+ 'vertical-align',
31+ 'word-spacing',
32+ 'letter-spacing',
33+ 'text-transform',
34+ 'text-decoration',
35+ 'white-space',
36+ ]
37+ )
38+ CSS << Tenarai::Container::Value.new(
39+ 'background',
40+ [
41+ 'background-color',
42+ 'background-image',
43+ 'background-repeat',
44+ 'background-position',
45+ 'background-attachment',
46+ ]
47+ )
48+ CSS << Tenarai::Container::Value.new(
49+ 'margin',
50+ [
51+ 'margin',
52+ 'margin-top',
53+ 'margin-right',
54+ 'margin-bottom',
55+ 'margin-left',
56+ ]
57+ )
58+ CSS << Tenarai::Container::Value.new(
59+ 'border',
60+ [
61+ 'border',
62+ 'border-top',
63+ 'border-right',
64+ 'border-bottom',
65+ 'border-left',
66+ ]
67+ )
68+ CSS << Tenarai::Container::Value.new(
69+ 'padding',
70+ [
71+ 'padding',
72+ 'padding-top',
73+ 'padding-right',
74+ 'padding-bottom',
75+ 'padding-left',
76+ ]
77+ )
78+ CSS << Tenarai::Container::Value.new(
79+ 'size',
80+ [
81+ 'width',
82+ 'height',
83+ 'min-width',
84+ 'min-height',
85+ 'max-width',
86+ 'max-height',
87+ ]
88+ )
89+ CSS << Tenarai::Container::Value.new(
90+ 'layout',
91+ [
92+ 'float',
93+ 'clear',
94+ 'position',
95+ 'top',
96+ 'right',
97+ 'bottom',
98+ 'left',
99+ 'overflow',
100+ 'clip',
101+ 'visibility',
102+ 'z-index',
103+ 'display',
104+ ]
105+ )
106+ CSS << Tenarai::Container::Value.new(
107+ 'list',
108+ [
109+ 'list-style-type',
110+ ]
111+ )
112+ CSS << Tenarai::Container::Value.new(
113+ 'ui',
114+ [
115+ 'cursor',
116+ ]
117+ )
118+ end
119+ end
120+end
Show on old repository browser