rsence 2.1.11 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/INSTALL.rdoc +5 -3
- data/README.rdoc +23 -22
- data/VERSION +1 -1
- data/conf/default_conf.yaml +65 -29
- data/conf/rsence_command_strings.yaml +101 -71
- data/js/comm/autosync/autosync.js +3 -3
- data/js/comm/jsloader/jsloader.js +16 -3
- data/js/comm/queue/queue.js +1 -1
- data/js/comm/transporter/transporter.js +106 -83
- data/js/comm/values/values.js +8 -2
- data/js/controls/button/button.js +9 -4
- data/js/controls/button/themes/default/button.css +1 -1
- data/js/controls/checkbox/themes/default/checkbox.css +1 -1
- data/js/controls/dialogs/sheet/sheet.js +27 -18
- data/js/controls/radiobutton/themes/default/radiobutton.css +1 -1
- data/js/controls/searchfield/searchfield.coffee +2 -0
- data/js/controls/searchfield/themes/default/searchfield.css +96 -0
- data/js/controls/searchfield/themes/default/searchfield.html +12 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1-ie6.gif +0 -0
- data/js/controls/searchfield/themes/default/searchfield_parts1.png +0 -0
- data/js/controls/sliders/slider/slider.js +7 -1
- data/js/controls/stepper/stepper.js +6 -1
- data/js/controls/stringview/stringview.js +50 -39
- data/js/controls/tab/tab.js +103 -7
- data/js/controls/tab/themes/default/tab.css +2 -0
- data/js/controls/textarea/themes/default/textarea.css +4 -0
- data/js/controls/textcontrol/textcontrol.js +32 -2
- data/js/controls/textcontrol/themes/default/textcontrol.css +17 -2
- data/js/controls/uploader/themes/default/uploader.css +3 -3
- data/js/controls/uploader/themes/default/uploader.html +1 -1
- data/js/controls/uploader/uploader.coffee +110 -0
- data/js/controls/window/themes/default/window.css +28 -5
- data/js/controls/window/themes/default/window.html +2 -0
- data/js/controls/window/window.js +5 -1
- data/js/core/class/class.js +22 -4
- data/js/core/elem/elem.coffee +816 -0
- data/js/core/event/event.js +2 -2
- data/js/core/rsence_ns/rsence_ns.coffee +31 -0
- data/js/core/rsence_ns/rsence_ns.js +6 -6
- data/js/datetime/calendar/calendar.coffee +307 -0
- data/js/datetime/calendar/themes/default/calendar.css +90 -9
- data/js/datetime/calendar/themes/default/calendar.html +11 -0
- data/js/datetime/calendar/themes/default/calendar_bg-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_bg.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts1.png +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2-ie6.gif +0 -0
- data/js/datetime/calendar/themes/default/calendar_parts2.png +0 -0
- data/js/datetime/datetimepicker/datetimepicker.js +217 -0
- data/js/datetime/datetimevalue/datetimevalue.js +22 -5
- data/js/datetime/timesheet/themes/default/timesheet.css +51 -22
- data/js/datetime/timesheet/themes/default/timesheet.html +4 -2
- data/js/datetime/timesheet/timesheet.js +782 -192
- data/js/datetime/timesheet_item/themes/default/timesheet_item.css +42 -11
- data/js/datetime/timesheet_item/themes/default/timesheet_item.html +4 -2
- data/js/datetime/timesheet_item/themes/default/timesheet_item_icons.png +0 -0
- data/js/datetime/timesheet_item/timesheet_item.js +158 -254
- data/js/datetime/timesheet_item_edit/timesheet_item_edit.js +0 -274
- data/js/foundation/application/application.js +52 -9
- data/js/foundation/control/eventresponder/eventresponder.js +7 -4
- data/js/foundation/control/valueaction/valueaction.js +71 -0
- data/js/foundation/eventmanager/eventmanager.js +71 -33
- data/js/foundation/geom/rect/rect.js +39 -7
- data/js/foundation/json_renderer/json_renderer.js +278 -62
- data/js/foundation/locale_settings/locale_settings.js +131 -0
- data/js/foundation/system/system.js +40 -13
- data/js/foundation/thememanager/thememanager.js +21 -0
- data/js/foundation/view/markupview/markupview.js +12 -12
- data/js/foundation/view/view.js +221 -27
- data/js/graphics/svgcontrol/svgcontrol.js +400 -0
- data/js/lists/checkboxlist/checkboxlist.js +18 -7
- data/js/lists/listitems/listitems.js +52 -38
- data/js/lists/radiobuttonlist/radiobuttonlist.js +23 -7
- data/js/menus/menuitem/menuitem.js +5 -0
- data/js/menus/menuitem/themes/default/menuitem.css +45 -0
- data/js/menus/menuitem/themes/default/menuitem.html +4 -0
- data/js/menus/minimenu/minimenu.js +47 -16
- data/js/menus/minimenuitem/minimenuitem.js +62 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.css +2 -2
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem.html +0 -0
- data/js/menus/{minimenu/minimenuitem → minimenuitem}/themes/default/minimenuitem_checkmark.png +0 -0
- data/js/menus/popupmenu/popupmenu.js +14 -0
- data/js/menus/popupmenu/themes/default/popupmenu.css +65 -0
- data/js/menus/popupmenu/themes/default/popupmenu.html +7 -0
- data/js/menus/popupmenu/themes/default/popupmenu.png +0 -0
- data/js/no_pkg/no_pkg.js +2 -0
- data/js/util/reloadapp/reloadapp.js +1 -1
- data/js/views/scrollview/scrollview.js +6 -0
- data/lib/rsence.rb +136 -3
- data/lib/rsence/argv.rb +218 -0
- data/lib/rsence/argv/argv_util.rb +58 -0
- data/lib/rsence/argv/env_check.rb +58 -0
- data/lib/rsence/argv/help_argv.rb +15 -0
- data/lib/rsence/argv/initenv_argv.rb +218 -0
- data/lib/rsence/argv/save_argv.rb +92 -0
- data/lib/rsence/argv/startup_argv.rb +118 -0
- data/lib/rsence/argv/status_argv.rb +132 -0
- data/lib/rsence/argv/test_port.rb +32 -0
- data/lib/{daemon → rsence}/daemon.rb +67 -23
- data/lib/{conf/default.rb → rsence/default_config.rb} +18 -10
- data/lib/{plugins → rsence}/dependencies.rb +0 -0
- data/lib/{util → rsence}/gzstring.rb +0 -0
- data/lib/rsence/http.rb +3 -0
- data/lib/{http → rsence/http}/broker.rb +106 -19
- data/lib/{http → rsence/http}/rackup.rb +0 -0
- data/lib/{http → rsence/http}/request.rb +0 -4
- data/lib/{http → rsence/http}/response.rb +0 -1
- data/lib/{session → rsence}/msg.rb +17 -1
- data/lib/{plugins → rsence}/pluginmanager.rb +29 -12
- data/lib/{plugins → rsence}/plugins.rb +7 -7
- data/lib/{plugins → rsence/plugins}/gui_plugin.rb +8 -3
- data/lib/{plugins → rsence/plugins}/guiparser.rb +9 -6
- data/lib/{plugins → rsence/plugins}/plugin.rb +23 -4
- data/lib/{plugins → rsence/plugins}/plugin_base.rb +11 -1
- data/lib/{plugins → rsence/plugins}/plugin_plugins.rb +2 -2
- data/lib/{plugins → rsence/plugins}/plugin_sqlite_db.rb +0 -0
- data/lib/{plugins → rsence/plugins}/servlet.rb +0 -0
- data/lib/{session → rsence}/sessionmanager.rb +101 -39
- data/lib/{session → rsence}/sessionstorage.rb +30 -16
- data/lib/{daemon → rsence}/sigcomm.rb +0 -0
- data/lib/{transporter → rsence}/transporter.rb +13 -11
- data/lib/{values/hvalue.rb → rsence/value.rb} +6 -1
- data/lib/{values → rsence}/valuemanager.rb +1 -1
- data/plugins/client_pkg/client_pkg.rb +14 -4
- data/plugins/client_pkg/info.yaml +2 -2
- data/plugins/client_pkg/lib/client_pkg_build.rb +145 -45
- data/plugins/client_pkg/lib/client_pkg_cache.rb +1 -1
- data/plugins/client_pkg/lib/client_pkg_serve.rb +1 -1
- data/plugins/main/main.rb +43 -3
- data/plugins/main/tmpl/index.html +2 -10
- data/plugins/main/values.yaml +3 -1
- data/plugins/ticket/lib/common.rb +6 -3
- data/plugins/ticket/ticket.rb +11 -3
- metadata +144 -174
- data/js/comm/autosync/js.inc +0 -0
- data/js/comm/js.inc +0 -0
- data/js/comm/jsloader/js.inc +0 -0
- data/js/comm/queue/js.inc +0 -0
- data/js/comm/session/js.inc +0 -0
- data/js/comm/sessionwatcher/js.inc +0 -0
- data/js/comm/transporter/js.inc +0 -0
- data/js/comm/urlresponder/js.inc +0 -0
- data/js/comm/values/js.inc +0 -0
- data/js/controls/button/js.inc +0 -0
- data/js/controls/checkbox/js.inc +0 -0
- data/js/controls/dialogs/alert_sheet/js.inc +0 -0
- data/js/controls/dialogs/confirm_sheet/js.inc +0 -0
- data/js/controls/dialogs/sheet/js.inc +0 -0
- data/js/controls/imageview/js.inc +0 -0
- data/js/controls/passwordcontrol/js.inc +0 -0
- data/js/controls/progress/progressbar/js.inc +0 -0
- data/js/controls/progress/progressindicator/js.inc +0 -0
- data/js/controls/radiobutton/js.inc +0 -0
- data/js/controls/sliders/slider/js.inc +0 -0
- data/js/controls/sliders/vslider/js.inc +0 -0
- data/js/controls/stepper/js.inc +0 -0
- data/js/controls/stringview/js.inc +0 -0
- data/js/controls/tab/js.inc +0 -0
- data/js/controls/textarea/js.inc +0 -0
- data/js/controls/textcontrol/js.inc +0 -0
- data/js/controls/uploader/js.inc +0 -0
- data/js/controls/uploader/uploader.js +0 -154
- data/js/controls/validatorview/js.inc +0 -0
- data/js/controls/window/js.inc +0 -0
- data/js/core/class/js.inc +0 -0
- data/js/core/elem/elem.js +0 -1325
- data/js/core/elem/js.inc +0 -0
- data/js/core/event/js.inc +0 -0
- data/js/core/iefix/js.inc +0 -0
- data/js/core/rsence_ns/js.inc +0 -0
- data/js/datetime/calendar/calendar.js +0 -198
- data/js/datetime/calendar/js.inc +0 -0
- data/js/datetime/datetimevalue/js.inc +0 -0
- data/js/datetime/timesheet/js.inc +0 -0
- data/js/datetime/timesheet/old_timesheet.js +0 -292
- data/js/datetime/timesheet/themes/default/old_timesheet.css +0 -30
- data/js/datetime/timesheet/themes/default/old_timesheet.html +0 -2
- data/js/datetime/timesheet_item/js.inc +0 -0
- data/js/datetime/timesheet_item/old_timesheet_item.js +0 -308
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.css +0 -42
- data/js/datetime/timesheet_item/themes/default/old_timesheet_item.html +0 -8
- data/js/datetime/timesheet_item_edit/js.inc +0 -0
- data/js/datetime/timesheet_item_edit/old_timesheet_item_edit.js +0 -274
- data/js/foundation/application/js.inc +0 -0
- data/js/foundation/control/controldefaults/js.inc +0 -0
- data/js/foundation/control/dummyvalue/js.inc +0 -0
- data/js/foundation/control/dyncontrol/js.inc +0 -0
- data/js/foundation/control/eventresponder/js.inc +0 -0
- data/js/foundation/control/js.inc +0 -0
- data/js/foundation/control/valuematrix/js.inc +0 -0
- data/js/foundation/control/valueresponder/js.inc +0 -0
- data/js/foundation/eventmanager/js.inc +0 -0
- data/js/foundation/geom/point/js.inc +0 -0
- data/js/foundation/geom/rect/js.inc +0 -0
- data/js/foundation/json_renderer/js.inc +0 -0
- data/js/foundation/system/js.inc +0 -0
- data/js/foundation/thememanager/js.inc +0 -0
- data/js/foundation/value/js.inc +0 -0
- data/js/foundation/view/js.inc +0 -0
- data/js/foundation/view/markupview/js.inc +0 -0
- data/js/foundation/view/morphanimation/js.inc +0 -0
- data/js/foundation/view/viewdefaults/js.inc +0 -0
- data/js/lists/checkboxlist/js.inc +0 -0
- data/js/lists/listitems/js.inc +0 -0
- data/js/lists/propertylist/js.inc +0 -0
- data/js/lists/propertylist/propertylisteditor/js.inc +0 -0
- data/js/lists/radiobuttonlist/js.inc +0 -0
- data/js/menus/minimenu/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/js.inc +0 -0
- data/js/menus/minimenu/minimenuitem/minimenuitem.js +0 -33
- data/js/util/reloadapp/js.inc +0 -0
- data/js/util/sha/js.inc +0 -0
- data/js/views/centerview/js.inc +0 -0
- data/js/views/inlineview/js.inc +0 -0
- data/js/views/scrollview/js.inc +0 -0
- data/lib/conf/argv.rb +0 -880
@@ -0,0 +1,400 @@
|
|
1
|
+
/* RSence
|
2
|
+
* Copyright 2009 Riassence Inc.
|
3
|
+
* http://riassence.com/
|
4
|
+
*
|
5
|
+
* You should have received a copy of the GNU General Public License along
|
6
|
+
* with this software package. If not, contact licensing@riassence.com
|
7
|
+
*/
|
8
|
+
|
9
|
+
var//RSence.Graphics
|
10
|
+
SVGControl = HControl.extend({
|
11
|
+
isSVGContainer: true,
|
12
|
+
_svgNS: 'http://www.w3.org/2000/svg',
|
13
|
+
_pictElemStyle: [
|
14
|
+
// 'width:100%',
|
15
|
+
// 'height:100%',
|
16
|
+
'position:absolute',
|
17
|
+
'top:0px',
|
18
|
+
'left:0px',
|
19
|
+
'right:0px',
|
20
|
+
'bottom:0px'
|
21
|
+
].join(';'),
|
22
|
+
getPictElem: function(){
|
23
|
+
return ELEM.get( this.pictId );
|
24
|
+
},
|
25
|
+
getPictElemById: function( _pictElemId ){
|
26
|
+
return this._pictElemIds[ _pictElemId ];
|
27
|
+
},
|
28
|
+
_pictElemIds: null,
|
29
|
+
_freePictElemIds: null,
|
30
|
+
|
31
|
+
_nextPictElemId: function(){
|
32
|
+
var
|
33
|
+
_this = this,
|
34
|
+
_nodeId = ( _this._freePictElemIds.length === 0 )?_this._pictElemIds.length:_this._freePictElemIds.shift();
|
35
|
+
// console.log( 'nodeId:', _nodeId );
|
36
|
+
return _nodeId;
|
37
|
+
},
|
38
|
+
|
39
|
+
_makePictElem: function( _parentId, _type ){
|
40
|
+
_parentId = _parentId?_parentId:0;
|
41
|
+
var
|
42
|
+
_this = this,
|
43
|
+
_nodeId = _this._nextPictElemId(),
|
44
|
+
_objectNode = document.createElementNS( _this._svgNS, _type ),
|
45
|
+
_parentNode = _this._pictElemIds[_parentId];
|
46
|
+
if(_parentNode === undefined || _parentNode === null){
|
47
|
+
// console.log('invalid parent',_parentNode,', parentId:',_parentId,', type:',_type,', nodeId:',_nodeId,', pictElemIds:',_this._pictElemIds);
|
48
|
+
_parentNode = _this._pictElemIds[0];
|
49
|
+
}
|
50
|
+
_this._pictElemIds[_nodeId] = _objectNode;
|
51
|
+
// if ( !_parentNode ) {
|
52
|
+
// console.log('no parent', _parentNode);
|
53
|
+
// _parentNode = _this._pictElemIds[0];
|
54
|
+
// }
|
55
|
+
_parentNode.appendChild( _objectNode );
|
56
|
+
return _nodeId;
|
57
|
+
},
|
58
|
+
|
59
|
+
_deletePictElem: function(_nodeId){
|
60
|
+
var
|
61
|
+
_this = this,
|
62
|
+
_objectNode = _this._pictElemIds[_nodeId],
|
63
|
+
_parentNode = _objectNode.parentNode;
|
64
|
+
_parentNode.removeChild(_objectNode);
|
65
|
+
_this._pictElemIds[_nodeId] = null;
|
66
|
+
_this._freePictElemIds.push(_nodeId);
|
67
|
+
},
|
68
|
+
|
69
|
+
makeGroupElem: function( _rect, _parentId, _options ){
|
70
|
+
var
|
71
|
+
_this = this,
|
72
|
+
_nodeId = _this._makePictElem( _parentId, 'g' );
|
73
|
+
_this.setAttrsOfPictElem(
|
74
|
+
_nodeId,
|
75
|
+
_this._attrParse(
|
76
|
+
_options.attr, {
|
77
|
+
// x: _rect[0],
|
78
|
+
// y: _rect[1],
|
79
|
+
// width: _rect[2],
|
80
|
+
// height: _rect[3]
|
81
|
+
},
|
82
|
+
_options.style
|
83
|
+
)
|
84
|
+
);
|
85
|
+
return _nodeId;
|
86
|
+
},
|
87
|
+
|
88
|
+
// rect: [0,10,100,200] => [x=0,y=10,w=100,h=200]
|
89
|
+
// parentId: pictIds[n] || null => 0
|
90
|
+
// options: {
|
91
|
+
// style: { fill: 'rgb(0,0,255)', 'stroke-width': 1, stroke: 'rgb(0,0,0)' }
|
92
|
+
// attrs: { x: 0, y: 10, width: 100, height: 200 }
|
93
|
+
makeRectElem: function( _rect, _parentId, _options ){
|
94
|
+
var
|
95
|
+
_this = this,
|
96
|
+
_nodeId = _this._makePictElem( _parentId, 'rect' );
|
97
|
+
_this.setAttrsOfPictElem(
|
98
|
+
_nodeId,
|
99
|
+
_this._attrParse(
|
100
|
+
_options.attr, {
|
101
|
+
x: _rect[0],
|
102
|
+
y: _rect[1],
|
103
|
+
width: _rect[2],
|
104
|
+
height: _rect[3]
|
105
|
+
},
|
106
|
+
_options.style
|
107
|
+
)
|
108
|
+
);
|
109
|
+
return _nodeId;
|
110
|
+
},
|
111
|
+
// circle: [50,60,100] => [centerX=50,centerY=60,radius=100]
|
112
|
+
makeCircleElem: function( _circle, _parentId, _options ){
|
113
|
+
var
|
114
|
+
_this = this,
|
115
|
+
_nodeId = _this._makePictElem( _parentId, 'circle' );
|
116
|
+
_this.setAttrsOfPictElem(
|
117
|
+
_nodeId,
|
118
|
+
_this._attrParse(
|
119
|
+
_options.attr, {
|
120
|
+
cx: _circle[0],
|
121
|
+
cy: _circle[1],
|
122
|
+
r: _circle[2]
|
123
|
+
},
|
124
|
+
_options.style
|
125
|
+
)
|
126
|
+
);
|
127
|
+
return _nodeId;
|
128
|
+
},
|
129
|
+
// _ellipse: [ 50, 60, 25, 40 ] => [centerX=50,centerY=60,radiusX=25,radiusY=40]
|
130
|
+
makeEllipseElem: function( _ellipse, _parentId, _options ){
|
131
|
+
var
|
132
|
+
_this = this,
|
133
|
+
_nodeId = _this._makePictElem( _parentId, 'ellipse' );
|
134
|
+
_this.setAttrsOfPictElem(
|
135
|
+
_nodeId,
|
136
|
+
_this._attrParse(
|
137
|
+
_options.attr, {
|
138
|
+
cx: _ellipse[0],
|
139
|
+
cy: _ellipse[1],
|
140
|
+
rx: _ellipse[2],
|
141
|
+
ry: _ellipse[3]
|
142
|
+
},
|
143
|
+
_options.style
|
144
|
+
)
|
145
|
+
);
|
146
|
+
return _nodeId;
|
147
|
+
},
|
148
|
+
// _line: [ 50, 60, 25, 40 ] => [x1=50,y1=60,x2=25,y2=40]
|
149
|
+
makeLineElem: function( _line, _parentId, _options ){
|
150
|
+
var
|
151
|
+
_this = this,
|
152
|
+
_nodeId = _this._makePictElem( _parentId, 'line' );
|
153
|
+
_this.setAttrsOfPictElem(
|
154
|
+
_nodeId,
|
155
|
+
_this._attrParse(
|
156
|
+
_options.attr, {
|
157
|
+
x1: _line[0],
|
158
|
+
y1: _line[1],
|
159
|
+
x2: _line[2],
|
160
|
+
y2: _line[3]
|
161
|
+
},
|
162
|
+
_options.style
|
163
|
+
)
|
164
|
+
);
|
165
|
+
return _nodeId;
|
166
|
+
},
|
167
|
+
// _points: [ [50, 60], [25, 40] ] => [point1=[x:50,y1:60],point2=[x:25,y:40]]
|
168
|
+
makePolylineElem: function( _points, _parentId, _options ){
|
169
|
+
var
|
170
|
+
_this = this,
|
171
|
+
_nodeId = _this._makePictElem( _parentId, 'polyline' ),
|
172
|
+
_pointsArr = [],
|
173
|
+
i = 0;
|
174
|
+
for(;i<_points.length;i++){
|
175
|
+
_pointsArr.push( _points[i].join(',') );
|
176
|
+
}
|
177
|
+
_this.setAttrsOfPictElem(
|
178
|
+
_nodeId,
|
179
|
+
_this._attrParse(
|
180
|
+
_options.attr, {
|
181
|
+
points: _pointsArr.join(' ')
|
182
|
+
},
|
183
|
+
_options.style
|
184
|
+
)
|
185
|
+
);
|
186
|
+
return _nodeId;
|
187
|
+
},
|
188
|
+
makePolyLineElem: function( _points, _parentId, _options ){
|
189
|
+
return this.makePolylineElem( _points, _parentId, _options );
|
190
|
+
},
|
191
|
+
// _points: [ [50, 60], [25, 40] ] => [point1=[x:50,y1:60],point2=[x:25,y:40]]
|
192
|
+
makePolygonElem: function( _points, _parentId, _options ){
|
193
|
+
var
|
194
|
+
_this = this,
|
195
|
+
_nodeId = _this._makePictElem( _parentId, 'polygon' ),
|
196
|
+
_pointsArr = [],
|
197
|
+
i = 0;
|
198
|
+
for(;i<_points.length;i++){
|
199
|
+
_pointsArr.push( _points[i].join(',') );
|
200
|
+
}
|
201
|
+
_this.setAttrsOfPictElem(
|
202
|
+
_nodeId,
|
203
|
+
_this._attrParse(
|
204
|
+
_options.attr, {
|
205
|
+
points: _pointsArr.join(' ')
|
206
|
+
},
|
207
|
+
_options.style
|
208
|
+
)
|
209
|
+
);
|
210
|
+
return _nodeId;
|
211
|
+
},
|
212
|
+
// _path: "M0.208,16.918c0,0,126.866-58.208,126.866,132.836"
|
213
|
+
makePathElem: function( _path, _parentId, _options ){
|
214
|
+
var
|
215
|
+
_this = this,
|
216
|
+
_nodeId = _this._makePictElem( _parentId, 'path' );
|
217
|
+
|
218
|
+
_this.setAttrsOfPictElem(
|
219
|
+
_nodeId,
|
220
|
+
_this._attrParse(
|
221
|
+
_options.attr, {
|
222
|
+
d: _path
|
223
|
+
},
|
224
|
+
_options.style
|
225
|
+
)
|
226
|
+
);
|
227
|
+
return _nodeId;
|
228
|
+
},
|
229
|
+
_styleAttrParse: function( _style, _optStyle ) {
|
230
|
+
if ( !_style ) {
|
231
|
+
_style = {};
|
232
|
+
}
|
233
|
+
if ( !_optStyle ) {
|
234
|
+
_optStyle = {};
|
235
|
+
}
|
236
|
+
var _styleList = [],
|
237
|
+
i;
|
238
|
+
for( i in _optStyle ) {
|
239
|
+
if( _optStyle[i] !== null && _optStyle[i] !== undefined ){
|
240
|
+
_style[i] = _optStyle[i];
|
241
|
+
}
|
242
|
+
}
|
243
|
+
for( i in _style ) {
|
244
|
+
if( _style[i] !== null && _style[i] !== undefined ){
|
245
|
+
_styleList.push( [ i, _style[i] ].join(':') );
|
246
|
+
}
|
247
|
+
}
|
248
|
+
return _styleList.join(';');
|
249
|
+
},
|
250
|
+
_attrParse: function( _attrs, _defaultAttrs, _styleAttrs ) {
|
251
|
+
if ( !_attrs ) {
|
252
|
+
_attrs = {};
|
253
|
+
}
|
254
|
+
for( var i in _defaultAttrs ){
|
255
|
+
if( _attrs[i] === null ||
|
256
|
+
_attrs[i] === undefined ) {
|
257
|
+
_attrs[i] = _defaultAttrs[i];
|
258
|
+
}
|
259
|
+
}
|
260
|
+
_attrs.style = this._styleAttrParse( _attrs.style, _styleAttrs );
|
261
|
+
return _attrs;
|
262
|
+
},
|
263
|
+
setAttrsOfPictElem: function( _pictElemId, _attrs ) {
|
264
|
+
for ( i in _attrs ) {
|
265
|
+
if( _attrs[i] !== null && _attrs[i] !== undefined ){
|
266
|
+
this.setAttrOfPictElem( _pictElemId, i, _attrs[i] );
|
267
|
+
}
|
268
|
+
}
|
269
|
+
},
|
270
|
+
setAttrOfPictElem: function( _pictElemId, _pictAttrName, _pictAttrValue ) {
|
271
|
+
this._pictElemIds[_pictElemId].setAttributeNS( null, _pictAttrName, _pictAttrValue );
|
272
|
+
},
|
273
|
+
drawRect: function(){
|
274
|
+
if(!this.drawn){
|
275
|
+
this.makeSvgElem();
|
276
|
+
}
|
277
|
+
this.base();
|
278
|
+
// this.setViewBox( 0, 0, this.rect.width, this.rect.height );
|
279
|
+
},
|
280
|
+
// setViewBox: function( left, top, right, bottom ){
|
281
|
+
// ELEM.get(this.pictId).setAttribute( 'viewBox', '0 0 '+this.rect.width+' '+this.rect.height );
|
282
|
+
// },
|
283
|
+
makeSvgElem: function(){
|
284
|
+
var _this = this,
|
285
|
+
_pict = document.createElementNS( _this._svgNS, 'svg' ),
|
286
|
+
_pictElemId = ELEM._add( _pict );
|
287
|
+
_this._pictElemIds = [];
|
288
|
+
_this._freePictElemIds = [];
|
289
|
+
|
290
|
+
// parentId not used as elemId elsewhere
|
291
|
+
_this.pictId = _pictElemId;
|
292
|
+
|
293
|
+
_this._pictElemIds[0] = _pict;
|
294
|
+
ELEM.append( _pictElemId, _this.elemId );
|
295
|
+
_pict.setAttribute( 'xmlns', _this._svgNS );
|
296
|
+
// console.log('options:',this.options);
|
297
|
+
if(this.options['viewBox'] !== undefined){
|
298
|
+
this.viewBox = this.options.viewBox.join(' ');
|
299
|
+
}
|
300
|
+
else {
|
301
|
+
this.viewBox = '0 0 '+this.rect.width+' '+this.rect.height;
|
302
|
+
}
|
303
|
+
if(this.options['preserveAspectRatio'] !== undefined){
|
304
|
+
this.preserveAspectRatio = this.options.preserveAspectRatio;
|
305
|
+
}
|
306
|
+
else {
|
307
|
+
this.preserveAspectRatio = 'xMidYMid slice';
|
308
|
+
}
|
309
|
+
_pict.setAttribute( 'viewBox', this.viewBox );
|
310
|
+
_pict.setAttribute( 'preserveAspectRatio', this.preserveAspectRatio );
|
311
|
+
_pict.setAttribute( 'version', '1.1' );
|
312
|
+
_pict.style.cssText = _this._pictElemStyle;
|
313
|
+
_this.setAttrsOfPictElem(
|
314
|
+
0, {
|
315
|
+
// viewBox: '0 0 320 240',
|
316
|
+
// width: '100%',
|
317
|
+
// height: '100%'
|
318
|
+
}
|
319
|
+
);
|
320
|
+
}
|
321
|
+
}),
|
322
|
+
HPict = SVGControl; // Compatibility for legacy code.
|
323
|
+
|
324
|
+
var//RSence.Graphics
|
325
|
+
SVGItemBase = HClass.extend({
|
326
|
+
constructor: function( _shape, _parent, _options ){
|
327
|
+
this.shape = _shape;
|
328
|
+
this.parent = _parent;
|
329
|
+
this.options = _options;
|
330
|
+
this.parents = [];
|
331
|
+
var i = 0;
|
332
|
+
for( ; i < this.parent.parents.length; i++ ){
|
333
|
+
this.parents.push( this.parent.parents[i] );
|
334
|
+
}
|
335
|
+
this.parents.push( this.parent );
|
336
|
+
for( i = this.parents.length-1; i > -1; i-- ){
|
337
|
+
if( this.parents[i].isSVGContainer ){
|
338
|
+
this.pict = this.parents[i];
|
339
|
+
break;
|
340
|
+
}
|
341
|
+
}
|
342
|
+
|
343
|
+
// parentId not used as elemId elsewhere
|
344
|
+
this.pictId = this.makeItem( _shape, _parent.pictId, _options );
|
345
|
+
|
346
|
+
//console.log(_parent.pictId);
|
347
|
+
this.extAction();
|
348
|
+
},
|
349
|
+
pictItemType: '',
|
350
|
+
makeItem: function( _shape, _parentId, _options ){
|
351
|
+
return this.pict['make'+this.pictItemType+'Elem']( _shape, _parentId, _options );
|
352
|
+
},
|
353
|
+
extAction: function(){}
|
354
|
+
}, {
|
355
|
+
factory: function(_pictItemType){
|
356
|
+
var _ext = {};
|
357
|
+
_ext['pictItemType'] = _pictItemType;
|
358
|
+
return SVGItemBase.extend(_ext);
|
359
|
+
}
|
360
|
+
}),
|
361
|
+
HPictItem = SVGItemBase; // Compatibility for legacy code.
|
362
|
+
|
363
|
+
var//RSence.Graphics
|
364
|
+
SVGRect = SVGItemBase.factory('Rect'),
|
365
|
+
HPictRect = SVGRect; // Compatibility for legacy code.
|
366
|
+
|
367
|
+
var//RSence.Graphics
|
368
|
+
SVGCircle = SVGItemBase.factory('Circle'),
|
369
|
+
HPictCircle = SVGCircle; // Compatibility for legacy code.
|
370
|
+
|
371
|
+
var//RSence.Graphics
|
372
|
+
SVGEllipse = SVGItemBase.factory('Ellipse'),
|
373
|
+
HPictEllipse = SVGEllipse; // Compatibility for legacy code.
|
374
|
+
|
375
|
+
var//RSence.Graphics
|
376
|
+
SVGOval = HPictEllipse,
|
377
|
+
HPictOval = SVGOval; // Compatibility for legacy code.
|
378
|
+
|
379
|
+
var//RSence.Graphics
|
380
|
+
SVGLine = SVGItemBase.factory('Line'),
|
381
|
+
HPictLine = SVGLine; // Compatibility for legacy code.
|
382
|
+
|
383
|
+
var//RSence.Graphics
|
384
|
+
SVGPolyLine = SVGItemBase.factory('Polyline'),
|
385
|
+
HPictPolyLine = SVGPolyLine, // Compatibility for legacy code.
|
386
|
+
SVGPolyline = SVGPolyLine, // Aliases
|
387
|
+
HPictPolyline = SVGPolyLine; // Aliases
|
388
|
+
|
389
|
+
var//RSence.Graphics
|
390
|
+
SVGPolygon = SVGItemBase.factory('Polygon'),
|
391
|
+
HPictPolygon = SVGPolygon; // Compatibility for legacy code.
|
392
|
+
|
393
|
+
var//RSence.Graphics
|
394
|
+
SVGGroup = SVGItemBase.factory('Group'),
|
395
|
+
HPictGroup = SVGGroup; // Compatibility for legacy code.
|
396
|
+
|
397
|
+
var//RSence.Graphics
|
398
|
+
SVGPath = SVGItemBase.factory('Path'),
|
399
|
+
HPictPath = SVGPath; // Compatibility for legacy code.
|
400
|
+
|
@@ -13,7 +13,7 @@
|
|
13
13
|
**
|
14
14
|
***/
|
15
15
|
var//RSence.Lists
|
16
|
-
HCheckboxList =
|
16
|
+
HCheckboxList = HListItemControl.extend({
|
17
17
|
|
18
18
|
/** = Description
|
19
19
|
* Draws borders with 1px and sets 'overflow' to 'auto'.
|
@@ -21,16 +21,17 @@ HCheckboxList = HControl.extend({
|
|
21
21
|
**/
|
22
22
|
drawSubviews: function(){
|
23
23
|
this.setStyle('border','1px solid #999');
|
24
|
+
this.setStyle('border-radius','3px');
|
24
25
|
this.setStyle('overflow','auto');
|
25
26
|
},
|
26
27
|
listItems: [],
|
27
28
|
listItemViews: [],
|
28
29
|
ListCheckbox: HCheckbox.extend({
|
29
30
|
|
30
|
-
/** = Description
|
31
|
-
|
32
|
-
|
33
|
-
|
31
|
+
/** = Description
|
32
|
+
* Adds listValues to the parent if they are true otherwise deletes them.
|
33
|
+
*
|
34
|
+
**/
|
34
35
|
refreshValue: function(){
|
35
36
|
this.base();
|
36
37
|
if(this.value === true){
|
@@ -40,7 +41,15 @@ HCheckboxList = HControl.extend({
|
|
40
41
|
this.parent.delItem( this.options.listValue );
|
41
42
|
}
|
42
43
|
}
|
43
|
-
}),
|
44
|
+
}), // End ListCheckbox
|
45
|
+
|
46
|
+
setEnabled: function(_state){
|
47
|
+
this.base(_state);
|
48
|
+
if(!this['listItemViews']){ return; }
|
49
|
+
for(var i=0;i<this.listItems.length;i++){
|
50
|
+
this.listItemViews[i].setEnabled(_state)
|
51
|
+
}
|
52
|
+
},
|
44
53
|
|
45
54
|
/** = Description
|
46
55
|
* Checks if +_listValue+ can be found from the values. Adds the value
|
@@ -95,6 +104,7 @@ HCheckboxList = HControl.extend({
|
|
95
104
|
*
|
96
105
|
**/
|
97
106
|
setListItems: function(_listItems){
|
107
|
+
_listItems = this._cleanListItems(_listItems);
|
98
108
|
var _listItem,
|
99
109
|
_value,
|
100
110
|
_label,
|
@@ -121,7 +131,8 @@ HCheckboxList = HControl.extend({
|
|
121
131
|
this, {
|
122
132
|
label: _label,
|
123
133
|
value: _checked,
|
124
|
-
listValue: _value
|
134
|
+
listValue: _value,
|
135
|
+
enabled: this.enabled
|
125
136
|
}
|
126
137
|
);
|
127
138
|
this.listItemViews[i] = _checkbox;
|