rsence 2.0.8.19 → 2.0.9.20.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.8.19
1
+ 2.0.9.20.pre
@@ -395,17 +395,24 @@ HDynControl = HControl.extend({
395
395
  var i,
396
396
  _actionPoint = this._startPoint.subtract(this.rect.left,this.rect.top),
397
397
  _actionRects = this._actionRects;
398
- if(this.options.noResize && _actionRects[8].contains(_actionPoint)){
399
- this._actionFlag = 8;
400
- this.setStyle('cursor',this._actionCrsr[8]);
401
- return;
402
- }
403
- for(i=0;i!==9;i++){
404
- if(_actionRects[i].contains(_actionPoint)){
405
- this._actionFlag=i;
406
- this.setStyle('cursor',this._actionCrsr[i]);
398
+ if(this.options.noResize){
399
+ if(_actionRects[8].contains(_actionPoint)){
400
+ this._actionFlag = 8;
401
+ this.setStyle('cursor',this._actionCrsr[8]);
407
402
  return;
408
403
  }
404
+ else {
405
+ this._actionFlag = -1;
406
+ }
407
+ }
408
+ else{
409
+ for(i=0;i!==9;i++){
410
+ if(_actionRects[i].contains(_actionPoint)){
411
+ this._actionFlag=i;
412
+ this.setStyle('cursor',this._actionCrsr[i]);
413
+ return;
414
+ }
415
+ }
409
416
  }
410
417
  },
411
418
 
@@ -329,6 +329,7 @@ EVENT = {
329
329
  _ctrl.onResize();
330
330
  }
331
331
  }
332
+ HSystem._updateFlexibleRects();
332
333
  },
333
334
 
334
335
  /* Element-specific mouse over/out event receiver. */
@@ -58,7 +58,7 @@ HRect = HClass.extend({
58
58
  *
59
59
  **/
60
60
  constructor: function() {
61
- this.type = '[HRect]';
61
+ this.viewIds = [];
62
62
  var _args=arguments;
63
63
 
64
64
  if (_args.length === 0) {
@@ -106,6 +106,43 @@ HRect = HClass.extend({
106
106
  this.bottom = _rect.bottom;
107
107
  this.right = _rect.right;
108
108
  },
109
+
110
+ _updateFlexibleDimensions: function(){
111
+ var
112
+ _this = this,
113
+ _viewIds = _this.viewIds,
114
+ _parentElemId,
115
+ _parentSize,
116
+ _parentWidth,
117
+ _parentHeight,
118
+ _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.flushLoop();
126
+ _parentElemId = _view.parent.elemId;
127
+ _parentSize = _view.parentSize();
128
+ _parentWidth = _parentSize[0];
129
+ if(_view.flexRight){
130
+ _this.right = _parentWidth - _view.flexRightOffset;
131
+ }
132
+ if(!_view.flexLeft){
133
+ _this.left = _this.right - _this.width;
134
+ }
135
+ _parentHeight = _parentSize[1];
136
+ if(_view.flexBottom){
137
+ _this.bottom = _parentWidth - _view.flexBottomOffset - _this.top;
138
+ }
139
+ if(!_view.flexTop){
140
+ _this.top = _this.bottom - _this.height;
141
+ }
142
+ _this.updateSecondaryValues();
143
+ }
144
+ }
145
+ },
109
146
 
110
147
  /** = Description
111
148
  * You should call this on the instance to update secondary values, like
@@ -118,6 +155,9 @@ HRect = HClass.extend({
118
155
  *
119
156
  **/
120
157
  updateSecondaryValues: function() {
158
+
159
+ // this._updateFlexibleDimensions();
160
+
121
161
  /**
122
162
  * isValid is true if the Rect's right side is greater than or equal to its left
123
163
  * and its bottom is greater than or equal to its top, and false otherwise.
@@ -550,7 +590,6 @@ HRect = HClass.extend({
550
590
 
551
591
  // HValue and HView support
552
592
  valueObj: null,
553
- viewIds: [],
554
593
 
555
594
  /** = Description
556
595
  * Bind function
@@ -560,9 +599,10 @@ HRect = HClass.extend({
560
599
  *
561
600
  **/
562
601
  bind: function(_view){
563
- if(this.viewIds.indexOf(_view.viewId) !== -1){
602
+ if(this.viewIds.indexOf( _view.viewId ) === -1){
564
603
  this.viewIds.push( _view.viewId );
565
604
  }
605
+ this._updateFlexibleDimensions();
566
606
  },
567
607
 
568
608
  /** = Description
@@ -91,6 +91,17 @@ HSystem = {
91
91
 
92
92
  },
93
93
 
94
+ _updateFlexibleRects: function(){
95
+ var
96
+ _view,
97
+ i = 0;
98
+ for( ; i < this.views.length; i++ ){
99
+ _view = this.views[i];
100
+ if(_view.flexRight || _view.flexBottom){
101
+ _view.rect._updateFlexibleDimensions();
102
+ }
103
+ }
104
+ },
94
105
 
95
106
  /** Calls the scheduler and then calls itself after a timeout to keep
96
107
  * the loop going on.
@@ -628,14 +628,7 @@ HView = HClass.extend({
628
628
  _styl( _elemId, 'bottom', _this.flexBottom?(_this.flexBottomOffset+'px'):'auto', true);
629
629
  _styl( _elemId, 'width', (_this.flexLeft&&_this.flexRight)?'auto':(_rect.width+'px'), true);
630
630
  _styl( _elemId, 'height', (_this.flexTop&&_this.flexBottom)?'auto':(_rect.height+'px'), true);
631
-
632
- if(_this.flexLeft&&_this.flexRight){
633
- _styl( _elemId, 'min-width', _rect.width+'px', true);
634
- }
635
- if(_this.flexTop&&_this.flexBottom){
636
- _styl( _elemId, 'min-height', _rect.height+'px', true);
637
- }
638
-
631
+
639
632
  // Show the rectangle once it gets created, unless visibility was set to
640
633
  // hidden in the constructor.
641
634
  if(_this.isHidden === undefined || _this.isHidden === false) {
@@ -873,6 +866,28 @@ HView = HClass.extend({
873
866
  return [ 0, 0, _parentSize[0], _parentSize[1] ];
874
867
  },
875
868
 
869
+ parentSize: function(){
870
+ var _parentElemId = this.parent.elemId;
871
+ if ( _parentElemId === 0 ) {
872
+ return ELEM.windowSize();
873
+ }
874
+ else {
875
+ ELEM.flushLoop();
876
+ return ELEM.getSize( _parentElemId );
877
+ }
878
+ },
879
+
880
+ minWidth: 0,
881
+ setMinWidth: function(_minWidth){
882
+ this.minWidth = _minWidth;
883
+ ELEM.setStyle( this.elemId, 'min-width', this.minWidth+'px', true);
884
+ },
885
+ minHeight: 0,
886
+ setMinHeight: function(_minHeight){
887
+ this.minHeight = _minHeight;
888
+ ELEM.setStyle( this.elemId, 'min-height', this.minHeight+'px', true);
889
+ },
890
+
876
891
  /** = Description
877
892
  * Replaces the rect of the component with a new HRect instance and
878
893
  * then refreshes the display.
@@ -896,20 +911,28 @@ HView = HClass.extend({
896
911
  var _arrLen = _rect.length,
897
912
  _throwPrefix = 'HView.setRect: If the HRect instance is replaced by an array, ';
898
913
  if((_arrLen === 4) || (_arrLen === 6)){
899
- var _leftOffset = _rect[0],
900
- _topOffset = _rect[1],
901
- _width = _rect[2],
902
- _height = _rect[3],
903
- _rightOffset = ((_arrLen === 6)?_rect[4]:null),
904
- _bottomOffset = ((_arrLen === 6)?_rect[5]:null),
905
- _validLeftOffset = (typeof _leftOffset === 'number'),
906
- _validTopOffset = (typeof _topOffset === 'number'),
907
- _validRightOffset = (typeof _rightOffset === 'number'),
908
- _validBottomOffset = (typeof _bottomOffset === 'number'),
909
- _validWidth = (typeof _width === 'number'),
910
- _validHeight = (typeof _height === 'number'),
911
- _right,
912
- _bottom;
914
+ var
915
+ _leftOffset = _rect[0],
916
+ _topOffset = _rect[1],
917
+ _width = _rect[2],
918
+ _height = _rect[3],
919
+ _rightOffset = ((_arrLen === 6)?_rect[4]:null),
920
+ _bottomOffset = ((_arrLen === 6)?_rect[5]:null),
921
+ _validLeftOffset = (typeof _leftOffset === 'number'),
922
+ _validTopOffset = (typeof _topOffset === 'number'),
923
+ _validRightOffset = (typeof _rightOffset === 'number'),
924
+ _validBottomOffset = (typeof _bottomOffset === 'number'),
925
+ _validWidth = (typeof _width === 'number'),
926
+ _validHeight = (typeof _height === 'number'),
927
+ _right,
928
+ _bottom;
929
+
930
+ if(_arrLen === 6){
931
+ var
932
+ _parentSize = this.parentSize(),
933
+ _parentWidth = _parentSize[0],
934
+ _parentHeight = _parentSize[1];
935
+ }
913
936
 
914
937
  if( (!_validLeftOffset && !_validRightOffset) ||
915
938
  (!_validTopOffset && !_validBottomOffset) ){
@@ -925,42 +948,30 @@ HView = HClass.extend({
925
948
  this.setFlexRight(_validRightOffset,_rightOffset);
926
949
  this.setFlexBottom(_validBottomOffset,_bottomOffset);
927
950
 
928
- // default, makes a correct rect
929
951
  if(_validLeftOffset && _validWidth && !_validRightOffset){
930
952
  _right = _leftOffset + _width;
931
953
  }
932
- // can't be entirely correct rect unless parent size is calculated
933
954
  else if(!_validLeftOffset && _validWidth && _validRightOffset){
934
- _leftOffset = 0;
935
- _right = _width;
955
+ _right = _parentWidth-_validRightOffset;
956
+ _leftOffset = _right-_width;
936
957
  }
937
- // can't be entirely correct rect unless parent size is calculated
938
- else if(_validLeftOffset && !_validWidth && _validRightOffset){
939
- _right = _leftOffset + _rightOffset;
958
+ else if(_validLeftOffset && _validRightOffset){
959
+ _right = _parentWidth - _rightOffset;
960
+ _validWidth && this.setMinWidth( _width );
961
+ _right = _parentWidth - _rightOffset;
940
962
  }
941
963
 
942
- // use minimum width based on the height information given
943
- else if(_validLeftOffset && _validWidth && _validRightOffset){
944
- _right = _leftOffset + _width;
945
- }
946
-
947
- // default, makes a correct rect
948
964
  if(_validTopOffset && _validHeight && !_validBottomOffset){
949
965
  _bottom = _topOffset + _height;
950
966
  }
951
- // can't be entirely correct rect unless parent size is calculated
952
967
  else if(!_validTopOffset && _validHeight && _validBottomOffset){
953
- _topOffset = 0;
954
- _bottom = _height;
955
- }
956
- // can't be entirely correct rect unless parent size is calculated
957
- else if(_validTopOffset && !_validHeight && _validBottomOffset){
958
- _bottom = _topOffset + _bottomOffset;
968
+ _bottom = _parentHeight-_validBottomOffset;
969
+ _topOffset = _bottom-_height;
959
970
  }
960
-
961
- // use minimum height based on the height information given
962
- else if(_validTopOffset && _validHeight && _validBottomOffset){
963
- _bottom = _topOffset + _height;
971
+ else if(_validTopOffset && _validBottomOffset){
972
+ _bottom = _parentHeight - _bottomOffset;
973
+ _validHeight && this.setMinHeight( _height );
974
+ _bottom = _parentHeight - _bottomOffset;
964
975
  }
965
976
 
966
977
  this.rect = HRect.nu(_leftOffset,_topOffset,_right,_bottom);
@@ -1114,7 +1125,10 @@ HView = HClass.extend({
1114
1125
  var _setStyl = ELEM.setStyle,
1115
1126
  _elemId = this.elemId;
1116
1127
  _setStyl(_elemId,'visibility', 'hidden');
1117
- _setStyl(_elemId,'display', 'none');
1128
+ // Required for the old, buggy Mozilla engines ( Firefox versions below 3.0 )
1129
+ // At least text fields would show through from hidden parent elements.
1130
+ // Disabled, because keeping the display as none causes hidden views to have no dimensions at all.
1131
+ // _setStyl(_elemId,'display', 'none');
1118
1132
  this.isHidden = true;
1119
1133
  }
1120
1134
  return this;
@@ -136,11 +136,22 @@ module RSence
136
136
  super
137
137
  end
138
138
  end
139
- plugin_src = params[:src]
140
- unless RUBY_VERSION.to_f >= 1.9
141
- plugin_src = "_bundle_path = #{params[:bundle_path].inspect};" + plugin_src
139
+ begin
140
+ plugin_src = params[:src]
141
+ unless RUBY_VERSION.to_f >= 1.9
142
+ plugin_src = "_bundle_path = #{params[:bundle_path].inspect};" + plugin_src
143
+ end
144
+ m.module_eval( plugin_src )
145
+ rescue => e
146
+ src_path = params[:src_path]
147
+ src_path = "<undefined src_path>" if src_path == nil
148
+ params[:plugin_manager].plugin_error(
149
+ e,
150
+ 'BundleLoaderEvalError',
151
+ "An error occurred while evaluating the plugin bundle #{params[:bundle_name]}.",
152
+ src_path
153
+ )
142
154
  end
143
- m.module_eval( plugin_src )
144
155
  end
145
156
  return mod
146
157
  rescue => e
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence
3
3
  version: !ruby/object:Gem::Version
4
- hash: 105
5
- prerelease: false
4
+ hash: 961916140
5
+ prerelease: true
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 8
10
- - 19
11
- version: 2.0.8.19
9
+ - 9
10
+ - 20
11
+ - pre
12
+ version: 2.0.9.20.pre
12
13
  platform: ruby
13
14
  authors:
14
15
  - Riassence Inc.
@@ -16,7 +17,7 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2010-07-26 00:00:00 +03:00
20
+ date: 2010-08-15 00:00:00 +03:00
20
21
  default_executable: rsence
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
@@ -384,18 +385,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
384
385
  required_rubygems_version: !ruby/object:Gem::Requirement
385
386
  none: false
386
387
  requirements:
387
- - - ">="
388
+ - - ">"
388
389
  - !ruby/object:Gem::Version
389
- hash: 3
390
+ hash: 25
390
391
  segments:
391
- - 0
392
- version: "0"
392
+ - 1
393
+ - 3
394
+ - 1
395
+ version: 1.3.1
393
396
  requirements: []
394
397
 
395
398
  rubyforge_project:
396
399
  rubygems_version: 1.3.7
397
400
  signing_key:
398
401
  specification_version: 3
399
- summary: Release 2.0 version of the RSence framework.
402
+ summary: Pre-Release 2.0 version of the RSence framework.
400
403
  test_files: []
401
404