rsence 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. data/VERSION +1 -1
  2. data/js/comm/queue/queue.js +17 -8
  3. data/js/comm/transporter/transporter.js +11 -10
  4. data/js/controls/button/themes/bright/button_parts1.png +0 -0
  5. data/js/controls/button/themes/default/button_parts1.png +0 -0
  6. data/js/controls/checkbox/themes/default/checkbox_parts1.png +0 -0
  7. data/js/controls/dialogs/sheet/themes/default/sheet_bg.png +0 -0
  8. data/js/controls/dialogs/sheet/themes/default/sheet_dim.png +0 -0
  9. data/js/controls/dialogs/sheet/themes/default/sheet_parts1.png +0 -0
  10. data/js/controls/dialogs/sheet/themes/default/sheet_parts2.png +0 -0
  11. data/js/controls/dialogs/sheet/themes/default/sheet_warning.png +0 -0
  12. data/js/controls/radiobutton/themes/default/radiobutton_parts1.png +0 -0
  13. data/js/controls/searchfield/themes/default/searchfield_parts1.png +0 -0
  14. data/js/controls/sliders/slider/themes/default/hslider_tracks.png +0 -0
  15. data/js/controls/sliders/slider/themes/default/slider_thumbs.png +0 -0
  16. data/js/controls/sliders/vslider/themes/default/vslider_tracks.png +0 -0
  17. data/js/controls/tab/tab.js +4 -3
  18. data/js/controls/tab/themes/bright/tab_bg_color.png +0 -0
  19. data/js/controls/tab/themes/bright/tab_border_pattern.png +0 -0
  20. data/js/controls/tab/themes/bright/tab_parts1.png +0 -0
  21. data/js/controls/tab/themes/default/tab_bg_color.png +0 -0
  22. data/js/controls/tab/themes/default/tab_border_pattern.png +0 -0
  23. data/js/controls/tab/themes/default/tab_parts1.png +0 -0
  24. data/js/controls/textcontrol/textcontrol.js +3 -1
  25. data/js/controls/textcontrol/themes/default/textcontrol_parts1.png +0 -0
  26. data/js/controls/textcontrol/themes/default/textcontrol_parts2.png +0 -0
  27. data/js/controls/textcontrol/themes/default/textcontrol_parts3.png +0 -0
  28. data/js/controls/validatorview/themes/default/validator.png +0 -0
  29. data/js/controls/window/themes/default/window.css +66 -54
  30. data/js/controls/window/themes/default/window.html +6 -2
  31. data/js/controls/window/themes/default/window_bg_active.png +0 -0
  32. data/js/controls/window/themes/default/window_bg_inactive.png +0 -0
  33. data/js/controls/window/themes/default/window_buttons.png +0 -0
  34. data/js/controls/window/themes/default/window_parts1.png +0 -0
  35. data/js/controls/window/themes/default/window_parts2.png +0 -0
  36. data/js/controls/window/window.js +167 -40
  37. data/js/core/class/class.js +3 -0
  38. data/js/core/elem/elem.coffee +36 -16
  39. data/js/datetime/calendar/calendar.coffee +24 -8
  40. data/js/datetime/calendar/themes/default/calendar.html +2 -2
  41. data/js/datetime/calendar/themes/default/calendar_arrows.png +0 -0
  42. data/js/datetime/calendar/themes/default/calendar_bg.png +0 -0
  43. data/js/datetime/calendar/themes/default/calendar_parts1.png +0 -0
  44. data/js/datetime/calendar/themes/default/calendar_parts2.png +0 -0
  45. data/js/datetime/timesheet_item/themes/default/timesheet_item_icons.png +0 -0
  46. data/js/datetime/timesheet_item/timesheet_item.js +1 -1
  47. data/js/foundation/geom/rect/rect.js +83 -47
  48. data/js/foundation/thememanager/thememanager.js +3 -0
  49. data/js/foundation/view/markupview/markupview.js +1 -1
  50. data/js/foundation/view/view.js +136 -37
  51. data/js/lists/propertylist/propertylist.js +33 -31
  52. data/js/menus/minimenu/minimenu.js +4 -2
  53. data/js/menus/minimenu/themes/default/minimenu.png +0 -0
  54. data/js/menus/minimenuitem/themes/default/minimenuitem_checkmark.png +0 -0
  55. data/js/menus/popupmenu/themes/default/popupmenu.png +0 -0
  56. data/js/util/reloadapp/themes/default/reloadapp_warning.png +0 -0
  57. data/lib/rsence/argv/startup_argv.rb +1 -1
  58. data/lib/rsence/default_config.rb +2 -2
  59. data/lib/rsence/plugins/plugin.rb +0 -1
  60. data/plugins/client_pkg/client_pkg.rb +7 -9
  61. data/plugins/client_pkg/lib/client_pkg_build.rb +214 -99
  62. data/plugins/main/main.rb +5 -1
  63. metadata +4 -4
@@ -11,15 +11,16 @@
11
11
  ## and weeks as rows. Its value is a date/time number specified in seconds
12
12
  ## since or before epoch (1970-01-01 00:00:00 UTC).
13
13
  ####
14
- HCalendar = HControl.extend(
14
+ HCalendar = HControl.extend
15
15
 
16
16
  componentName: 'calendar'
17
+ markupElemNames: [ 'control', 'state', 'label', 'value', 'prevMonth', 'nextMonth' ]
17
18
 
18
19
  ## Disable the mouseWheel event to prevent prev/next -month switching with
19
20
  ## the mouse wheel or equivalent content-scrolling user interface gesture
20
21
  defaultEvents:
21
22
  mouseWheel: true
22
- click: true
23
+ # click: true
23
24
 
24
25
  ## Calls HCalendar#nextMonth or HCalendar#prevMonth based on delta change
25
26
  ## of the mouseWheel event
@@ -33,6 +34,15 @@ HCalendar = HControl.extend(
33
34
  click: ->
34
35
  false
35
36
 
37
+ drawSubviews: ->
38
+ _this = @
39
+ Event.observe( @elemOfPart( 'prevMonth' ), 'click', ->
40
+ _this.prevMonth()
41
+ )
42
+ Event.observe( @elemOfPart( 'nextMonth' ), 'click', ->
43
+ _this.nextMonth()
44
+ )
45
+
36
46
  ## Returns an array of week day names starting with the short name of the word "week".
37
47
  ## The default locale returns: ['Wk','Mon','Tue','Wed','Thu','Fri','Sat','Sun']
38
48
  ## See HLocale for more details
@@ -244,6 +254,7 @@ HCalendar = HControl.extend(
244
254
  _parentElem = @markupElemIds.value
245
255
  ELEM.setStyle( _parentElem, 'visibility', 'hidden', true )
246
256
  _elems = []
257
+ _this = @
247
258
  for _row in [0..5]
248
259
  _weekElem = ELEM.make( _parentElem )
249
260
  _elems.push( _weekElem )
@@ -276,7 +287,11 @@ HCalendar = HControl.extend(
276
287
  ELEM.addClassName( _colElem, 'calendar_weeks_week_col_no' )
277
288
  else
278
289
  ELEM.addClassName( _colElem, 'calendar_weeks_week_col_yes' )
279
- ELEM.setAttr( _colElem, 'href', "javascript:HSystem.views[#{@viewId}].setValue(#{_colSecs})" )
290
+ ELEM.setAttr( _colElem, '_colSecs', _colSecs )
291
+ Event.observe( ELEM.get( _colElem ), 'click', ->
292
+ _this.setValue( @_colSecs )
293
+ )
294
+ # ELEM.setAttr( _colElem, 'href', "javascript:HSystem.views[#{@viewId}].setValue(#{_colSecs})" )
280
295
  _left = (_col*_colWidth+_leftPlus)
281
296
  ELEM.setStyle( _colElem, 'left', _left+'px' )
282
297
  ELEM.setStyle( _colElem, 'width', (_colWidth-1)+'px' )
@@ -286,22 +301,23 @@ HCalendar = HControl.extend(
286
301
  ELEM.setStyle( _parentElem, 'visibility', 'inherit' )
287
302
  _stateElem = @markupElemIds.state
288
303
 
289
- @_monthMenu = ELEM.make( _stateElem, 'a' )
304
+ @_monthMenu = ELEM.make( _stateElem, 'span' )#, 'a' )
290
305
  _elems.push( @_monthMenu )
291
- ELEM.setAttr( @_monthMenu, 'href', "javascript:HSystem.views[#{@viewId}].monthMenu()" )
306
+ # ELEM.setAttr( @_monthMenu, 'href', "javascript:HSystem.views[#{@viewId}].monthMenu()" )
307
+ Event.observe( ELEM.get( @_monthMenu ), 'click', ( -> _this.monthMenu() ), false )
292
308
  ELEM.setHTML( @_monthMenu, @monthName( _date ) )
293
309
 
294
310
  _spacer = ELEM.make( _stateElem, 'span' )
295
311
  _elems.push( _spacer )
296
312
  ELEM.setHTML( _spacer, ' ' )
297
313
 
298
- @_yearMenu = ELEM.make( _stateElem, 'a' )
314
+ @_yearMenu = ELEM.make( _stateElem, 'span' )#, 'a' )
299
315
  _elems.push( @_yearMenu )
300
- ELEM.setAttr( @_yearMenu, 'href', "javascript:HSystem.views[#{@viewId}].yearMenu()" )
316
+ Event.observe( ELEM.get( @_yearMenu ), 'click', ( -> _this.yearMenu() ), false )
317
+ # ELEM.setAttr( @_yearMenu, 'href', "javascript:HSystem.views[#{@viewId}].yearMenu()" )
301
318
  ELEM.setHTML( @_yearMenu, @year( _date ) )
302
319
 
303
320
  @viewMonth = [ _monthFirst.getUTCFullYear(), _monthFirst.getUTCMonth() ]
304
321
  @_drawCalendarElems = _elems
305
- )
306
322
 
307
323
  HCalendar.implement( HDateTime )
@@ -11,9 +11,9 @@
11
11
  </div>
12
12
  <div class="calendar_control" id="control#{_ID}">
13
13
  <div class="calendar_head">
14
- <div class="calendar_head_prev_month" onclick="HSystem.views[#{this.viewId}].prevMonth();"></div>
14
+ <div class="calendar_head_prev_month" id="prevMonth#{_ID}"></div>
15
15
  <div class="calender_head_month_year" id="state#{_ID}"></div>
16
- <div class="calendar_head_next_month" onclick="HSystem.views[#{this.viewId}].nextMonth();"></div>
16
+ <div class="calendar_head_next_month" id="nextMonth#{_ID}"></div>
17
17
  </div>
18
18
  <div class="calendar_weekdays" id="label#{_ID}"></div>
19
19
  <div class="calendar_weeks" id="value#{_ID}"></div>
@@ -73,7 +73,7 @@ HTimeSheetItem = HControl.extend({
73
73
  ELEM.addClassName( this.elemId, 'locked' );
74
74
  }
75
75
  else {
76
- ELEM.removeClassName( this.elemId, 'locked' );
76
+ ELEM.delClassName( this.elemId, 'locked' );
77
77
  }
78
78
  this.refreshState();
79
79
  this.clearAllIcons();
@@ -8,7 +8,7 @@
8
8
 
9
9
  /*** = Description
10
10
  ** A Rect object represents a rectangle. Rects are used throughout the
11
- ** Components to define the frames of windows, views, bitmaps even the
11
+ ** Components to define the frames of windows, views, bitmaps even the
12
12
  ** screen itself. A HRect is defined by its four sides, expressed as the public
13
13
  ** data members left, top, right, and bottom.
14
14
  **
@@ -26,7 +26,7 @@
26
26
  ** +rightBottom+:: A HPoint representing the coordinate of the rect's right bottom corner
27
27
  ** +width+:: The width of the rect.
28
28
  ** +height+:: The height of the rect.
29
- ***/
29
+ ***/
30
30
  var//RSence.Foundation.Geom
31
31
  HRect = HClass.extend({
32
32
  /** = Description
@@ -35,7 +35,7 @@ HRect = HClass.extend({
35
35
  * any initial values is invalid, until a specific assignment is made, either
36
36
  * through a set() function or by setting the object's data members directly.
37
37
  *
38
- * = Parameters
38
+ * = Parameters
39
39
  * using a HRect instance:
40
40
  * +rect+:: Another HRect.
41
41
  *
@@ -106,6 +106,29 @@ HRect = HClass.extend({
106
106
  this.bottom = _rect.bottom;
107
107
  this.right = _rect.right;
108
108
  },
109
+
110
+ toArray: function(){
111
+ var
112
+ _arr = new Array(6,null),
113
+ _this = this,
114
+ _view = HSystem.views[_this.viewIds[0]],
115
+ _parentSize = _view.parentSize();
116
+ if( _view && ( _view.flexRight || _view.flexBottom ) ){
117
+ if(_this.viewIds.length > 1){
118
+ console.log("warning: HRect#toArray doesn't work reliably with several views bound.");
119
+ }
120
+ _arr[0] = _view.flexLeft?_this.left:null;
121
+ _arr[1] = _view.flexTop?_this.top:null;
122
+ _arr[2] = ( _view.minWidth !== 0 )?_view.minWidth:null;
123
+ _arr[3] = ( _view.minHeight !== 0 )?_view.minHeight:null;
124
+ _arr[4] = _view.flexRight?_view.flexRightOffset:null;
125
+ _arr[5] = _view.flexBottom?_view.flexBottomOffset:null;
126
+ return _arr;
127
+ }
128
+ else {
129
+ return [ _this.left, _this.top, _this.width, _this.height ];
130
+ }
131
+ },
109
132
 
110
133
  _updateFlexibleDimensions: function(){
111
134
  var
@@ -115,44 +138,55 @@ HRect = HClass.extend({
115
138
  _parentSize,
116
139
  _parentWidth,
117
140
  _parentHeight,
141
+ _virtualWidth,
142
+ _virtualHeight,
118
143
  _viewId,
119
- _view,
120
- i = 0;
121
- for(;i<_viewIds.length;i++){
122
- _viewId = _viewIds[i];
123
- _view = HSystem.views[_viewId];
124
- if(_view.flexRight || _view.flexBottom){
125
- ELEM.flush();
126
- if( !_view.parent ){
127
- _this.updateSecondaryValues();
128
- return;
129
- }
130
- _parentElemId = _view.parent.elemId;
131
- _parentSize = _view.parentSize();
132
- // console.log('parentSize:',JSON.stringify(_parentSize));
133
- _parentWidth = _parentSize[0];
134
- if(_view.flexRight){
135
- _this.right = _parentWidth - _view.flexRightOffset;
136
- }
137
- if(!_view.flexLeft){
138
- _this.left = _this.right - _this.width;
139
- }
140
- _parentHeight = _parentSize[1];
141
- if(_view.flexBottom){
142
- _this.bottom = _parentHeight - _view.flexBottomOffset - _this.top;
144
+ _view;
145
+ if(_this.viewIds.length > 1){
146
+ console.log("warning: HRect#_updateFlexibleDimensions doesn't work reliably with several views bound.");
147
+ }
148
+ _viewId = _viewIds[0];
149
+ _view = HSystem.views[_viewId];
150
+ if(_view.flexRight || _view.flexBottom){
151
+ ELEM.flush();
152
+ _parentSize = _view.parentSize();
153
+ if( _view.flexRight && _view.flexLeft ){ // calculate width and right
154
+ _virtualWidth = _parentSize[0] - _this.left - _view.flexRightOffset;
155
+ if( _view.minWidth !== null && _virtualWidth < _view.minWidth ){
156
+ _this.width = _view.minWidth;
143
157
  }
144
- if(!_view.flexTop){
145
- _this.top = _this.bottom - _this.height;
158
+ else{
159
+ _this.width = _virtualWidth;
146
160
  }
147
- if( _this.bottom-_this.top < 0 ){
148
- _this.bottom = _this.top;
161
+ _this.right = _this.left+_this.width;
162
+ }
163
+ else if( _view.flexRight ){ // calculate left and right
164
+ _this.width = _view.minWidth;
165
+ _this.left = _parentSize[0] - _this.width - _view.flexRightOffset;
166
+ _this.right = _this.width + _this.left;
167
+ }
168
+ else { // calculate width
169
+ _this.width = _this.right - _this.left;
170
+ }
171
+ if( _view.flexTop && _view.flexBottom ){ // calculate height and bottom
172
+ _virtualHeight = _parentSize[1] - _this.top - _view.flexBottomOffset;
173
+ if( _view.minHeight !== null && _virtualHeight < _view.minHeight ){
174
+ _this.height = _view.minHeight;
149
175
  }
150
- if( _this.right-_this.left < 0 ){
151
- _this.right = _this.left;
176
+ else{
177
+ _this.height = _virtualHeight;
152
178
  }
153
- // console.log(_this.left,this.top,this.right-this.left,this.bottom-this.top);
154
- _this.updateSecondaryValues();
179
+ _this.bottom = _this.top+_this.height;
180
+ }
181
+ else if( _view.flexBottom ){ // calculate top and bottom
182
+ _this.height = _view.minHeight;
183
+ _this.top = _parentSize[1] - _this.height - _view.flexBottomOffset;
184
+ _this.bottom = _this.height + _this.top;
185
+ }
186
+ else { // calculate height
187
+ _this.height = _this.bottom - _this.top;
155
188
  }
189
+ _this.updateSecondaryValues( true );
156
190
  }
157
191
  },
158
192
 
@@ -166,7 +200,7 @@ HRect = HClass.extend({
166
200
  * Use the accompanied methods instead.
167
201
  *
168
202
  **/
169
- updateSecondaryValues: function() {
203
+ updateSecondaryValues: function(_noSize) {
170
204
 
171
205
  // this._updateFlexibleDimensions();
172
206
 
@@ -181,7 +215,7 @@ HRect = HClass.extend({
181
215
  /**
182
216
  *
183
217
  * The Point-returning functions return the coordinates of one of the
184
- * rectangle's four corners.
218
+ * rectangle's four corners.
185
219
  **/
186
220
  this.leftTop = new HPoint(this.left, this.top);
187
221
  this.leftBottom = new HPoint(this.left, this.bottom);
@@ -192,8 +226,10 @@ HRect = HClass.extend({
192
226
  * The width and height of a Rect's rectangle, as returned through these
193
227
  * properties.
194
228
  **/
195
- this.width = (this.right - this.left);
196
- this.height = (this.bottom - this.top);
229
+ if(!_noSize){
230
+ this.width = (this.right - this.left);
231
+ this.height = (this.bottom - this.top);
232
+ }
197
233
  },
198
234
 
199
235
  /** = Description
@@ -363,7 +399,7 @@ HRect = HClass.extend({
363
399
  /** = Description
364
400
  * Moves the rects right and bottom sides to new coordinates. Does not affect the position.
365
401
  *
366
- * = Parameters
402
+ * = Parameters
367
403
  * by separate numeric values:
368
404
  * +_width+:: A numeric value representing the new target width of the rect.
369
405
  * +_height+:: A numeric value representing the new target height of the rect.
@@ -391,7 +427,7 @@ HRect = HClass.extend({
391
427
  },
392
428
 
393
429
  /** = Description
394
- * Returns true if the Rect has any area even a corner or part
430
+ * Returns true if the Rect has any area even a corner or part
395
431
  * of a side in common with rect, and false if it doesn't.
396
432
  *
397
433
  * = Parameters
@@ -414,7 +450,7 @@ HRect = HClass.extend({
414
450
  return (
415
451
  ( ( _rect.left >= this.left && _rect.left <= this.right ) ||
416
452
  ( _rect.right >= this.left && _rect.right <= this.right )
417
- ) &&
453
+ ) &&
418
454
  ( ( _rect.top >= this.top && _rect.top <= this.bottom) ||
419
455
  ( _rect.bottom >= this.top && _rect.bottom <= this.bottom)
420
456
  )
@@ -467,12 +503,12 @@ HRect = HClass.extend({
467
503
  * left side moves (to the right) four units and the right side moves (to the
468
504
  * left) four units (and similarly with the top and bottom).
469
505
  *
470
- * = Parameters
506
+ * = Parameters
471
507
  * using a HPoint:
472
508
  * +point+:: A HPoint to inset by.
473
509
  *
474
510
  * using separate x and y coordinates:
475
- * +x+:: x Coordinate
511
+ * +x+:: x Coordinate
476
512
  * +y+:: y Coordinate
477
513
  *
478
514
  **/
@@ -501,7 +537,7 @@ HRect = HClass.extend({
501
537
  * Moves the Rect horizontally by x units and vertically by y
502
538
  * units. The rectangle's size doesn't change.
503
539
  *
504
- * = Parameters
540
+ * = Parameters
505
541
  * using a HPoint:
506
542
  * +point+:: A HPoint to offset by.
507
543
  *
@@ -534,12 +570,12 @@ HRect = HClass.extend({
534
570
  /** = Description
535
571
  * Moves the Rect to the location (x,y).
536
572
  *
537
- * = Parameters
573
+ * = Parameters
538
574
  * using a HPoint:
539
575
  * +point+:: A HPoint to offset to.
540
576
  *
541
577
  * using separate x and y coordinates):
542
- * +x+:: X coordinate
578
+ * +x+:: X coordinate
543
579
  * +y+:: Y coordinate
544
580
  *
545
581
  **/
@@ -289,6 +289,9 @@ HThemeManager = HClass.extend({
289
289
  if (null === _markup || undefined === _markup) {
290
290
  _markup = "";
291
291
  }
292
+ if( this._tmplCache[_themeName] === undefined ){
293
+ this._tmplCache[_themeName] = {};
294
+ }
292
295
  this._tmplCache[_themeName][_componentName] = _markup;
293
296
  return _markup;
294
297
  },
@@ -101,7 +101,7 @@ HMarkupView = HClass.extend({
101
101
  ELEM.addClassName(_elementId, _cssClass);
102
102
  }
103
103
  else {
104
- ELEM.removeClassName(_elementId, _cssClass);
104
+ ELEM.delClassName(_elementId, _cssClass);
105
105
  }
106
106
  }
107
107
  return this;
@@ -541,6 +541,8 @@ HView = HClass.extend({
541
541
  **/
542
542
  _makeElem: function(_parentElemId){
543
543
  this.elemId = ELEM.make(_parentElemId,'div');
544
+ ELEM.setAttr( this.elemId, 'view_id', this.viewId );
545
+ ELEM.setAttr( this.elemId, 'elem_id', this.elemId );
544
546
  },
545
547
 
546
548
  /** --
@@ -613,10 +615,10 @@ HView = HClass.extend({
613
615
  *
614
616
  **/
615
617
  drawRect: function() {
616
- if(!this.rect.isValid){
618
+ if(!this.rect.isValid && !this.isProduction){
617
619
  console.log('invalid rect:',this.rect);//,ELEM.get(this.elemId));
618
620
  }
619
- if(!this.parent){
621
+ if(!this.parent && !this.isProduction){
620
622
  console.log('no parent:',ELEM.get(this.elemId));
621
623
  }
622
624
  if (this.parent && this.rect.isValid) {
@@ -759,7 +761,7 @@ HView = HClass.extend({
759
761
  _themeName = HThemeManager.currentTheme;
760
762
  }
761
763
  _markup = HThemeManager.getMarkup( _themeName, this.componentName, this.themePath );
762
- if(_markup === false){
764
+ if(_markup === false && !this.isProduction){
763
765
  console.log('Warning: Markup template for "'+this.componentName+'" using theme "'+_themeName+'" not loaded.');
764
766
  }
765
767
  this.markup = _markup;
@@ -925,13 +927,23 @@ HView = HClass.extend({
925
927
 
926
928
  minWidth: 0,
927
929
  setMinWidth: function(_minWidth){
928
- this.minWidth = _minWidth;
929
- ELEM.setStyle( this.elemId, 'min-width', this.minWidth+'px', true);
930
+ if( typeof _minWidth === 'number' ){
931
+ this.minWidth = _minWidth;
932
+ ELEM.setStyle( this.elemId, 'min-width', this.minWidth+'px', true);
933
+ }
934
+ else if ( !this.isProduction) {
935
+ console.log('warning: setMinWidth( '+(typeof _minWidth)+' '+_minWidth+' ) should be a number; value ignored!');
936
+ }
930
937
  },
931
938
  minHeight: 0,
932
939
  setMinHeight: function(_minHeight){
933
- this.minHeight = _minHeight;
934
- ELEM.setStyle( this.elemId, 'min-height', this.minHeight+'px', true);
940
+ if( typeof _minHeight === 'number' ){
941
+ this.minHeight = _minHeight;
942
+ ELEM.setStyle( this.elemId, 'min-height', this.minHeight+'px', true);
943
+ }
944
+ else if ( !this.isProduction) {
945
+ console.log('warning: setMinHeight( '+(typeof _minHeight)+' '+_minHeight+' ) should be a number; value ignored!');
946
+ }
935
947
  },
936
948
 
937
949
  /** = Description
@@ -981,33 +993,54 @@ HView = HClass.extend({
981
993
  _parentHeight = _parentSize[1];
982
994
  }
983
995
 
984
- if( (!_validLeftOffset && !_validRightOffset) ||
985
- (!_validTopOffset && !_validBottomOffset) ){
986
- console.log(_throwPrefix + '(left or top) and (top or bottom) must be specified.');
987
- }
988
- else if( (!_validWidth && !(_validLeftOffset && _validRightOffset)) ||
989
- (!_validHeight && !(_validTopOffset && _validBottomOffset)) ){
990
- console.log(_throwPrefix + 'the (height or width) must be specified unless both (left and top) or (top and bottom) are specified.');
996
+ if( !this.isProduction ){
997
+ if( (!_validLeftOffset && !_validRightOffset) ||
998
+ (!_validTopOffset && !_validBottomOffset) ){
999
+ console.log(_throwPrefix + '(left or top) and (top or bottom) must be specified.');
1000
+ }
1001
+ else if( (!_validWidth && !(_validLeftOffset && _validRightOffset)) ||
1002
+ (!_validHeight && !(_validTopOffset && _validBottomOffset)) ){
1003
+ console.log(_throwPrefix + 'the (height or width) must be specified unless both (left and top) or (top and bottom) are specified.');
1004
+ }
991
1005
  }
992
1006
 
993
- this.setFlexLeft(_validLeftOffset,_leftOffset);
994
- this.setFlexTop(_validTopOffset,_topOffset);
995
- this.setFlexRight(_validRightOffset,_rightOffset);
996
- this.setFlexBottom(_validBottomOffset,_bottomOffset);
997
-
998
1007
  if(_validLeftOffset && _validWidth && !_validRightOffset){
999
1008
  _right = _leftOffset + _width;
1000
1009
  }
1001
1010
  else if(!_validLeftOffset && _validWidth && _validRightOffset){
1002
1011
  _right = _parentWidth-_validRightOffset;
1003
1012
  _leftOffset = _right-_width;
1013
+ this.setMinWidth( _width );
1004
1014
  }
1005
1015
  else if(_validLeftOffset && _validRightOffset){
1006
1016
  _right = _parentWidth - _rightOffset;
1007
1017
  if( _validWidth ){
1008
1018
  this.setMinWidth( _width );
1019
+ if( _parentWidth - _leftOffset < _width ){
1020
+ if( !this.isProduction ){
1021
+ console.log('warning: the minWidth('+
1022
+ _width+
1023
+ ') is less than available width('+
1024
+ (_parentWidth-_leftOffset-_rightOffset)+
1025
+ '); right ('+_right+') yields to: '+_leftOffset+_width+'!');
1026
+ }
1027
+ _right = _leftOffset+_width;
1028
+ }
1029
+ }
1030
+ else if ( _right < _leftOffset ) {
1031
+ if( !this.isProduction ){
1032
+ console.log('warning: there is not enough width ('+
1033
+ _parentWidth+') to fit flexRightOffset ('+
1034
+ _rightOffset+
1035
+ ') and left ('+
1036
+ _leftOffset+
1037
+ '). right yields to ('+
1038
+ _leftOffset+') and flexRightOffset yields to ('+
1039
+ (_parentWidth-_leftOffset)+')!');
1040
+ }
1041
+ _rightOffset = _parentWidth-_leftOffset;
1042
+ _right = _leftOffset;
1009
1043
  }
1010
- _right = _parentWidth - _rightOffset;
1011
1044
  }
1012
1045
 
1013
1046
  if(_validTopOffset && _validHeight && !_validBottomOffset){
@@ -1016,13 +1049,37 @@ HView = HClass.extend({
1016
1049
  else if(!_validTopOffset && _validHeight && _validBottomOffset){
1017
1050
  _bottom = _parentHeight-_validBottomOffset;
1018
1051
  _topOffset = _bottom-_height;
1052
+ this.setMinHeight( _height );
1019
1053
  }
1020
1054
  else if(_validTopOffset && _validBottomOffset){
1021
1055
  _bottom = _parentHeight - _bottomOffset;
1022
1056
  if( _validHeight ){
1023
1057
  this.setMinHeight( _height );
1058
+ if( _parentHeight - _topOffset < _height ){
1059
+ if( !this.isProduction ){
1060
+ console.log('warning: the minHeight('+
1061
+ _height+
1062
+ ') is less than available height('+
1063
+ (_parentHeight-_topOffset-_bottom)+
1064
+ '). bottom('+_bottom+') yields: '+(_topOffset + _height)+'!');
1065
+ }
1066
+ _bottom = _topOffset + _height;
1067
+ }
1068
+ }
1069
+ else if ( _bottom < _topOffset ) {
1070
+ if( !this.isProduction ){
1071
+ console.log('warning: there is not enough height ('+
1072
+ _parentHeight+') to fit flexBottomOffset ('+
1073
+ _bottom+
1074
+ ') and bottom ('+
1075
+ _bottomOffset+
1076
+ ') bottom yields to ('+
1077
+ _topOffset+') and flexBottomOffset yields to ('+
1078
+ (_parentHeight-_topOffset)+')!');
1079
+ }
1080
+ _bottomOffset = _parentHeight-_topOffset;
1081
+ _bottom = _topOffset;
1024
1082
  }
1025
- _bottom = _parentHeight - _bottomOffset;
1026
1083
  }
1027
1084
  if( _leftOffset > _right ){
1028
1085
  _right = _leftOffset;
@@ -1030,8 +1087,14 @@ HView = HClass.extend({
1030
1087
  if( _topOffset > _bottom ){
1031
1088
  _bottom = _topOffset;
1032
1089
  }
1090
+ this.setMinWidth(this.minWidth);
1091
+ this.setMinHeight(this.minHeight);
1092
+ this.setFlexLeft(_validLeftOffset,_leftOffset);
1093
+ this.setFlexTop(_validTopOffset,_topOffset);
1094
+ this.setFlexRight(_validRightOffset,_rightOffset);
1095
+ this.setFlexBottom(_validBottomOffset,_bottomOffset);
1033
1096
  this.rect = HRect.nu(_leftOffset,_topOffset,_right,_bottom);
1034
- if(!this.rect.isValid){
1097
+ if(!this.rect.isValid && !this.isProduction){
1035
1098
  console.log('---------------------------------------------');
1036
1099
  console.log('invalid rect:', this.rect.left, ',', this.rect.top, ',', this.rect.width, ',', this.rect.height, ',', this.rect.right, ',', this.rect.bottom );
1037
1100
  console.log(' parent size:', this.parentSize() );
@@ -1040,7 +1103,7 @@ HView = HClass.extend({
1040
1103
  }
1041
1104
 
1042
1105
  }
1043
- else {
1106
+ else if (!this.isProduction){
1044
1107
  console.log(_throwPrefix + 'the length has to be either 4 or 6.');
1045
1108
  }
1046
1109
  }
@@ -1080,7 +1143,7 @@ HView = HClass.extend({
1080
1143
  else if(_stylesObjType==='h'){
1081
1144
  this.setStylesHash(_styles);
1082
1145
  }
1083
- else {
1146
+ else if (!this.isProduction){
1084
1147
  console.log('HView#setStyles: Invalid data, expected array or hash; type: '+h+', data:',_styles);
1085
1148
  }
1086
1149
  return this;
@@ -1141,10 +1204,10 @@ HView = HClass.extend({
1141
1204
  **/
1142
1205
  setStyleOfPart: function(_partName, _name, _value, _force) {
1143
1206
  if (!this['markupElemIds']){
1144
- console.log('Warning, setStyleOfPart: no markupElemIds');
1207
+ !this.isProduction && console.log('Warning, setStyleOfPart: no markupElemIds');
1145
1208
  }
1146
1209
  else if (this.markupElemIds[_partName]===undefined) {
1147
- console.log('Warning, setStyleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1210
+ !this.isProduction && console.log('Warning, setStyleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1148
1211
  }
1149
1212
  else {
1150
1213
  ELEM.setStyle(this.markupElemIds[_partName], _name, _value, _force);
@@ -1166,7 +1229,7 @@ HView = HClass.extend({
1166
1229
  **/
1167
1230
  styleOfPart: function(_partName, _name, _force) {
1168
1231
  if (this.markupElemIds[_partName]===undefined) {
1169
- console.log('Warning, styleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1232
+ !this.isProduction && console.log('Warning, styleOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1170
1233
  return '';
1171
1234
  }
1172
1235
  return ELEM.getStyle(this.markupElemIds[_partName], _name, _force);
@@ -1186,7 +1249,7 @@ HView = HClass.extend({
1186
1249
  **/
1187
1250
  setMarkupOfPart: function( _partName, _value ) {
1188
1251
  if (this.markupElemIds[_partName]===undefined) {
1189
- console.log('Warning, setMarkupOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1252
+ !this.isProduction && console.log('Warning, setMarkupOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1190
1253
  }
1191
1254
  else {
1192
1255
  ELEM.setHTML( this.markupElemIds[_partName], _value );
@@ -1207,30 +1270,64 @@ HView = HClass.extend({
1207
1270
  **/
1208
1271
  markupOfPart: function(_partName) {
1209
1272
  if (this.markupElemIds[_partName]===undefined) {
1210
- console.log('Warning, markupOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1273
+ !this.isProduction && console.log('Warning, markupOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1211
1274
  return '';
1212
1275
  }
1213
1276
  return ELEM.getHTML(this.markupElemIds[_partName]);
1214
1277
  },
1215
1278
 
1279
+ /** = Description
1280
+ * Sets a element attribute of the view's cell.
1281
+ *
1282
+ * = Parameters
1283
+ * +_key+:: The attribute key to set.
1284
+ * +_value+:: Value for markup element.
1285
+ * +_force+:: Optional force switch, defaults to false
1286
+ *
1287
+ * = Returns
1288
+ * +self+
1289
+ *
1290
+ **/
1291
+ setAttr: function( _key, _value, _force ){
1292
+ ELEM.setAttr( this.elemId, _key, _value, _force );
1293
+ return this;
1294
+ },
1295
+
1296
+ /** = Description
1297
+ * Gets a element attribute of the view's cell.
1298
+ *
1299
+ * = Parameters
1300
+ * +_key+:: The attribute key to get.
1301
+ * +_force+:: Optional force switch, defaults to false
1302
+ *
1303
+ * = Returns
1304
+ * The attribute value.
1305
+ *
1306
+ **/
1307
+ attr: function( _key, _force ){
1308
+ return ELEM.getAttr( this.elemId, _key, _force );
1309
+ },
1310
+
1216
1311
  /** = Description
1217
1312
  * Sets a element attribute of a specified markup element that has been bound to this
1218
1313
  * view.
1219
1314
  *
1220
1315
  * = Parameters
1221
1316
  * +_partName+:: The identifier of the markup element.
1317
+ * +_key+:: The attribute key to set
1222
1318
  * +_value+:: Value for markup element.
1319
+ * +_force+:: Optional force switch, defaults to false
1223
1320
  *
1224
1321
  * = Returns
1225
1322
  * +self+
1226
1323
  *
1227
1324
  **/
1228
- setAttrOfPart: function( _partName, _value, _force ) {
1325
+ setAttrOfPart: function( _partName, _key, _value, _force ) {
1229
1326
  if (this.markupElemIds[_partName]===undefined) {
1230
- console.log('Warning, setAttrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1327
+ !this.isProduction && console.log('Warning, setAttrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1231
1328
  }
1232
1329
  else {
1233
- ELEM.setAttr( this.markupElemIds[_partName], _value, _force );
1330
+ ELEM.setAttr( this.markupElemIds[_partName], _key, _value, _force );
1234
1331
  }
1235
1332
  return this;
1236
1333
  },
@@ -1241,17 +1338,19 @@ HView = HClass.extend({
1241
1338
  *
1242
1339
  * = Parameters
1243
1340
  * +_partName+:: The identifier of the markup element.
1341
+ * +_key+:: The attribute key to get.
1342
+ * +_force+:: Optional force switch, defaults to false
1244
1343
  *
1245
1344
  * = Returns
1246
1345
  * The attribute of a specified markup element.
1247
1346
  *
1248
1347
  **/
1249
- attrOfPart: function(_partName, _force) {
1348
+ attrOfPart: function(_partName, _key, _force) {
1250
1349
  if (this.markupElemIds[_partName]===undefined) {
1251
- console.log('Warning, attrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1350
+ !this.isProduction && console.log('Warning, attrOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1252
1351
  return '';
1253
1352
  }
1254
- return ELEM.getAttr(this.markupElemIds[_partName], _force);
1353
+ return ELEM.getAttr(this.markupElemIds[_partName], _key, _force);
1255
1354
  },
1256
1355
 
1257
1356
  /** = Description
@@ -1267,7 +1366,7 @@ HView = HClass.extend({
1267
1366
  **/
1268
1367
  elemOfPart: function(_partName) {
1269
1368
  if (this.markupElemIds[_partName]===undefined) {
1270
- console.log('Warning, elemOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1369
+ !this.isProduction && console.log('Warning, elemOfPart: partName "'+_partName+'" does not exist for viewId '+this.viewId+'.');
1271
1370
  return '';
1272
1371
  }
1273
1372
  return ELEM.get( this.markupElemIds[_partName] );
@@ -1362,7 +1461,7 @@ HView = HClass.extend({
1362
1461
  this.stopAnimation();
1363
1462
  // Delete the children first.
1364
1463
  var _childViewId, i;
1365
- if(!this.views){
1464
+ if(!this.views && !this.isProduction){
1366
1465
  console.log('HView#die: no subviews for component name: ',this.componentName,', self:',this);
1367
1466
  }
1368
1467
  while (this.views.length !== 0) {