rsence-pre 2.1.0.21 → 2.1.8.0

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.
Files changed (43) hide show
  1. data/INSTALL.rdoc +61 -46
  2. data/README.rdoc +17 -1
  3. data/VERSION +1 -1
  4. data/conf/rsence_command_strings.yaml +16 -16
  5. data/js/comm/sessionwatcher/sessionwatcher.js +5 -4
  6. data/js/comm/transporter/transporter.js +62 -4
  7. data/js/comm/values/values.js +62 -0
  8. data/js/controls/button/themes/default/button.css +7 -7
  9. data/js/controls/imageview/imageview.js +15 -6
  10. data/js/controls/stringview/stringview.js +16 -2
  11. data/js/controls/textcontrol/textcontrol.js +56 -3
  12. data/js/core/elem/elem.js +38 -12
  13. data/js/datetime/timesheet/timesheet.js +141 -32
  14. data/js/datetime/timesheet_item/timesheet_item.js +82 -22
  15. data/js/foundation/application/application.js +10 -4
  16. data/js/foundation/control/control.js +5 -3
  17. data/js/foundation/control/dyncontrol/dyncontrol.js +17 -3
  18. data/js/foundation/control/eventresponder/eventresponder.js +31 -2
  19. data/js/foundation/eventmanager/eventmanager.js +202 -74
  20. data/js/foundation/json_renderer/json_renderer.js +5 -2
  21. data/js/foundation/system/system.js +13 -11
  22. data/js/foundation/view/morphanimation/morphanimation.js +9 -5
  23. data/js/foundation/view/view.js +22 -10
  24. data/js/lists/propertylist/propertylist.js +5 -0
  25. data/js/menus/minimenu/minimenu.js +3 -8
  26. data/lib/conf/default.rb +0 -3
  27. data/lib/http/broker.rb +6 -5
  28. data/lib/http/rackup.rb +3 -3
  29. data/lib/http/response.rb +28 -2
  30. data/lib/session/msg.rb +30 -18
  31. data/lib/transporter/transporter.rb +4 -0
  32. data/lib/values/hvalue.rb +4 -134
  33. data/lib/values/valuemanager.rb +36 -22
  34. data/plugins/client_pkg/lib/client_pkg_serve.rb +195 -152
  35. data/plugins/main/main.rb +8 -10
  36. data/plugins/ticket/lib/common.rb +4 -4
  37. data/plugins/ticket/lib/favicon.rb +1 -1
  38. data/plugins/ticket/lib/rsrc.rb +1 -1
  39. data/plugins/ticket/lib/upload.rb +2 -2
  40. data/plugins/ticket/ticket.rb +3 -3
  41. data/setup/welcome/gui/welcome.yaml +1 -1
  42. metadata +10 -11
  43. data/lib/util/ruby19_fixes.rb +0 -18
@@ -273,9 +273,11 @@ HControl = HView.extend({
273
273
  setValueRange: function(_value, _minValue, _maxValue) {
274
274
  this.minValue = _minValue;
275
275
  this.maxValue = _maxValue;
276
- _value = (_value < _minValue) ? _minValue : _value;
277
- _value = (_value > _maxValue) ? _maxValue : _value;
278
- this.setValue(_value);
276
+ if( typeof _value === 'number' ) {
277
+ _value = (_value < _minValue) ? _minValue : _value;
278
+ _value = (_value > _maxValue) ? _maxValue : _value;
279
+ this.setValue(_value);
280
+ }
279
281
  return this;
280
282
  },
281
283
 
@@ -431,7 +431,13 @@ HDynControl = HControl.extend({
431
431
  **/
432
432
  startDrag: function(x,y,_isRightButton){
433
433
  var _parent = this.parent;
434
- if(_parent.elemId){
434
+ // parent outer position
435
+ // parent inner position, if it has subviews with different offset.
436
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
437
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
438
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
439
+ }
440
+ else if(_parent.elemId){
435
441
  x-=_parent.pageX();
436
442
  y-=_parent.pageY();
437
443
  }
@@ -459,7 +465,11 @@ HDynControl = HControl.extend({
459
465
  **/
460
466
  drag: function(x,y){
461
467
  var _parent = this.parent;
462
- if(_parent.elemId){
468
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
469
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
470
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
471
+ }
472
+ else if(_parent.elemId){
463
473
  x-=_parent.pageX();
464
474
  y-=_parent.pageY();
465
475
  }
@@ -485,7 +495,11 @@ HDynControl = HControl.extend({
485
495
  endDrag: function(x,y,_isRightButton){
486
496
  this.base();
487
497
  var _parent = this.parent;
488
- if(_parent.elemId){
498
+ if ( _parent.markupElemIds && _parent.markupElemIds.subview ) {
499
+ x -= ELEM._getVisibleLeftPosition( _parent.markupElemIds.subview );
500
+ y -= ELEM._getVisibleTopPosition( _parent.markupElemIds.subview );
501
+ }
502
+ else if(_parent.elemId){
489
503
  x-=_parent.pageX();
490
504
  y-=_parent.pageY();
491
505
  }
@@ -118,6 +118,8 @@ HEventResponder = HClass.extend({
118
118
  * method for it is +keyDown+ and it receives the ascii key
119
119
  * code whenever a keyboard key is pressed. Can also be
120
120
  * toggled separately by using the +setKeyDown+ method.
121
+ * Also supports special mode 'repeat', when listening to
122
+ * key repetitions is needed.
121
123
  * +keyUp+:: The local +keyUp+ event state. The component receives
122
124
  * this event only if it's focused. The event responder
123
125
  * method for it is +keyUp+ and it receives the ascii key
@@ -151,7 +153,8 @@ HEventResponder = HClass.extend({
151
153
  textEnter: false,
152
154
  click: false,
153
155
  resize: false,
154
- doubleClick: false
156
+ doubleClick: false,
157
+ contextMenu: false
155
158
  } ).extend( this.defaultEvents ).extend( _events?_events:{} ).nu();
156
159
  }
157
160
  this.events.ctrl = this;
@@ -282,6 +285,24 @@ HEventResponder = HClass.extend({
282
285
  return this;
283
286
  },
284
287
 
288
+ /** = Description
289
+ * Registers or releases event listening for contextMenu events depending on
290
+ * the value of the flag argument.
291
+ *
292
+ * = Parameters
293
+ * +_flag+:: Set the contextMenu event listening on/off (true/false) for
294
+ * the component instance.
295
+ *
296
+ * = Returns
297
+ * +self+
298
+ *
299
+ **/
300
+ setContextMenu: function(_flag) {
301
+ this.events.contextMenu = _flag;
302
+ this.setEvents();
303
+ return this;
304
+ },
305
+
285
306
  /** = Description
286
307
  * Registers or releases event listening for mouseUp events depending on the
287
308
  * value of the flag argument.
@@ -361,7 +382,8 @@ HEventResponder = HClass.extend({
361
382
  *
362
383
  * = Parameters
363
384
  * +_flag+:: Set the keyDown event listening on/off (true/false) for
364
- * the component instance.
385
+ * the component instance. Also supports special mode 'repeat',
386
+ * when listening to key repetitions is needed.
365
387
  *
366
388
  * = Returns
367
389
  * +self+
@@ -534,6 +556,13 @@ HEventResponder = HClass.extend({
534
556
  **/
535
557
  doubleClick: function(x,y,_isLeftButton){},
536
558
 
559
+ /** = Description
560
+ * Default contextMenu event responder method. Does nothing by default.
561
+ * Extend to return true to allow the default action of the browser.
562
+ *
563
+ **/
564
+ contextMenu: function(x,y,_isLeftButton){},
565
+
537
566
  /** = Description
538
567
  * Default mouseDown event responder method. Does nothing by default.
539
568
  *
@@ -28,7 +28,8 @@ EVENT = {
28
28
  mouseWheel: false,
29
29
  resize: false,
30
30
  textEnter: false,
31
- doubleClick: false
31
+ doubleClick: false,
32
+ contextMenu: false
32
33
  },
33
34
 
34
35
  /** = Description
@@ -149,7 +150,10 @@ EVENT = {
149
150
  Event.observe( _globalEventTargetElement, 'click', _this.click );
150
151
  Event.observe( _globalEventTargetElement, 'keyup', _this.keyUp );
151
152
  Event.observe( _globalEventTargetElement, 'keydown', _this.keyDown );
152
- Event.observe( _globalEventTargetElement, 'keypress', _this.keyPress );
153
+ // IE and WebKit browsers don't need keyPress for repeat
154
+ if( !BROWSER_TYPE.safari && !BROWSER_TYPE.ie){
155
+ Event.observe( _globalEventTargetElement, 'keypress', _this.keyPress );
156
+ }
153
157
  Event.observe( _globalEventTargetElement, 'contextmenu', _this.contextMenu );
154
158
  Event.observe( _globalEventTargetElement, 'resize', _this.resize );
155
159
  Event.observe( _globalEventTargetElement, 'mousewheel', _this.mouseWheel );
@@ -320,10 +324,12 @@ EVENT = {
320
324
  * controls registered for the event.
321
325
  **/
322
326
  resize: function(e) {
323
- var i = 0,
324
- _this = EVENT,
325
- _ctrlID,
326
- _ctrl;
327
+ var
328
+ i = 0,
329
+ _this = EVENT,
330
+ _ctrlID,
331
+ _ctrl;
332
+ HSystem._updateFlexibleRects();
327
333
  for (; i < _this.resizeListeners.length; i++) {
328
334
  _ctrlID = _this.resizeListeners[i];
329
335
  _ctrl = HSystem.views[_ctrlID];
@@ -836,14 +842,13 @@ EVENT = {
836
842
  **/
837
843
  doubleClick: function(e) {
838
844
  var _this = EVENT,
839
- _didEndDrag = false,
840
845
  x = _this.status[_this.crsrX],
841
846
  y = _this.status[_this.crsrY],
842
847
  _elemId,
843
848
  _ctrl,
844
849
  i = 0;
845
850
  _this._modifiers(e);
846
- // Check for mouseUp listeners.
851
+ // Check for doubleClick listeners.
847
852
  for (i = 0; i !== _this.focused.length; i++) {
848
853
  if (_this.focused[i] === true) {
849
854
  if (_this.focusOptions[i].doubleClick === true) {
@@ -855,36 +860,103 @@ EVENT = {
855
860
  },
856
861
 
857
862
 
863
+ /** Mid-level mouse scroll wheel event manager.
864
+ * Delegates mouseWheel calls to the high-level event receivers of all
865
+ * controls registered for that event.
866
+ **/
867
+ mouseWheel: function(e) {
868
+ var _this = EVENT,
869
+ _delta = 0,
870
+ i = 0;
871
+ if (!e) {
872
+ e = window.event;
873
+ }
874
+ if (e.wheelDelta) {
875
+ _delta = 0 - (e.wheelDelta / 120);
876
+ }
877
+ else if (e.detail) {
878
+ _delta = 0 - (e.detail / 3);
879
+ }
880
+ if (BROWSER_TYPE.opera || BROWSER_TYPE.safari) {
881
+ _delta = 0 - _delta;
882
+ }
883
+ for (; i !== _this.focused.length; i++) {
884
+ if (_this.focused[i] === true) {
885
+ if (_this.focusOptions[i].mouseWheel === true) {
886
+ Event.stop(e);
887
+ _this.focusOptions[i].ctrl.mouseWheel(_delta);
888
+ }
889
+ }
890
+ }
891
+ },
892
+
893
+ /** Mid-level context menu manager.
894
+ * Gets called on the onContextMenu event.
895
+ * Delegates the following call to the high-level event receivers of all
896
+ * enabled controls registered, depending on the events they registered:
897
+ * - contextMenu
898
+ *
899
+ * Just make a component return true to allow the browser's default action.
900
+ *
901
+ **/
902
+ contextMenu: function(e) {
903
+ var _this = EVENT,
904
+ x = _this.status[_this.crsrX],
905
+ y = _this.status[_this.crsrY],
906
+ _preventDefault = true,
907
+ _elemId,
908
+ _ctrl,
909
+ i = 0;
910
+ _this._modifiers(e);
911
+ // Check for contextMenu listeners.
912
+ for (i = 0; i !== _this.focused.length; i++) {
913
+ if (_this.focused[i] === true) {
914
+ if (_this.focusOptions[i].contextMenu === true) {
915
+ if( _this.focusOptions[i].ctrl.contextMenu() ){
916
+ _preventDefault = false;
917
+ }
918
+ }
919
+ }
920
+ }
921
+ if( _preventDefault ){
922
+ Event.stop( e );
923
+ }
924
+ return true;
925
+ },
926
+
927
+
858
928
  /** Mid-level key press manager.
859
929
  * Gets called on the onKeyDown event.
860
930
  * Delegates keyDown calls to the high-level event receivers of all
861
931
  * controls registered for that event.
862
932
  **/
863
933
  keyDown: function(e) {
864
- var _this = EVENT,
865
- _theKeyCode = e.keyCode,
866
- _keyDownStateForActiveControl = _this.activeControl?(_this.focusOptions[_this.activeControl.elemId]?_this.focusOptions[_this.activeControl.elemId].keyDown:false):false,
867
- _repeat = (_keyDownStateForActiveControl === 'repeat'),
868
- _stopEvent = false;
934
+ var
935
+ _this = EVENT,
936
+ _keyCode = _this.translateKeyCodes(e.keyCode),
937
+ _keyDownStateForActiveControl = _this.activeControl?(_this.focusOptions[_this.activeControl.elemId]?_this.focusOptions[_this.activeControl.elemId].keyDown:false):false,
938
+ _repeat = (_keyDownStateForActiveControl === 'repeat'),
939
+ _stopEvent = false;
869
940
  _this._modifiers(e);
870
- if(!_this.status[_this.cmdKeyDown] && _this._detectCmdKey(e.keyCode)){
941
+ _this._lastKeyPressTime = new Date().getTime();
942
+ if(!_this.status[_this.cmdKeyDown] && _this._detectCmdKey(_keyCode)){
871
943
  _this.status[_this.cmdKeyDown] = true;
872
944
  }
873
945
  if (_this.activeControl && _keyDownStateForActiveControl) {
874
- if ((_this._lastKeyDown !== _theKeyCode) || _repeat) {
875
- if(_this.activeControl.keyDown(_theKeyCode)){
946
+ if ((_this._lastKeyDown !== _keyCode) || _repeat) {
947
+ if(_this.activeControl.keyDown(_keyCode)){
876
948
  _stopEvent = true;
877
949
  }
878
950
  }
879
951
  }
880
952
  // Insert key to the realtime array, remove in keyUp
881
- if (_this.status[_this.keysDown].indexOf(_theKeyCode) === -1) {
882
- _this.status[_this.keysDown].push(_theKeyCode);
953
+ if (_this.status[_this.keysDown].indexOf(_keyCode) === -1) {
954
+ _this.status[_this.keysDown].push(_keyCode);
883
955
  }
884
956
  if (!_this.status[_this.cmdKeyDown] && _stopEvent){
885
957
  Event.stop(e);
886
958
  }
887
- _this._lastKeyDown = _theKeyCode;
959
+ _this._lastKeyDown = _keyCode;
888
960
  },
889
961
 
890
962
 
@@ -896,17 +968,18 @@ EVENT = {
896
968
  * registered for that event.
897
969
  **/
898
970
  keyUp: function(e) {
899
- var _this = EVENT,
900
- _theKeyCode = e.keyCode,
901
- _keyCodeIndex,
902
- i = 0,
903
- _stopEvent = false,
904
- _ctrlId,
905
- _ctrl;
971
+ var
972
+ _this = EVENT,
973
+ _keyCode = _this.translateKeyCodes(e.keyCode),
974
+ _keyCodeIndex,
975
+ i = 0,
976
+ _stopEvent = false,
977
+ _ctrlId,
978
+ _ctrl;
906
979
  _this._modifiers(e);
907
980
  _this._lastKeyDown = null;
908
981
  if (_this.activeControl && _this.activeControl.elemId && _this.focusOptions[_this.activeControl.elemId].keyUp === true) {
909
- if(_this.activeControl.keyUp(_theKeyCode)){
982
+ if(_this.activeControl.keyUp(_keyCode)){
910
983
  _stopEvent = true;
911
984
  }
912
985
  }
@@ -922,81 +995,136 @@ EVENT = {
922
995
  if (!_this.status[_this.cmdKeyDown] && _stopEvent){
923
996
  Event.stop(e);
924
997
  }
925
- if(_this.status[_this.cmdKeyDown] && _this._detectCmdKey(e.keyCode)){
998
+ if(_this.status[_this.cmdKeyDown] && _this._detectCmdKey(_keyCode)){
926
999
  _this.status[_this.cmdKeyDown] = false;
927
1000
  }
928
1001
  // Remove the key from the realtime array, inserted in keyDown
929
- _keyCodeIndex = _this.status[_this.keysDown].indexOf(_theKeyCode);
1002
+ _keyCodeIndex = _this.status[_this.keysDown].indexOf(_keyCode);
930
1003
  if (_keyCodeIndex !== -1) {
931
1004
  _this.status[_this.keysDown].splice(_keyCodeIndex, 1);
932
1005
  }
933
1006
  },
934
1007
 
935
- /* Using keyPress as an alias for the keyDown event */
1008
+ /* The keyPress itself is ignored per se and used only as a repetition event for the last keyDown. */
936
1009
  keyPress: function(e) {
937
- var _this = EVENT;
938
- _this.keyDown(e);
939
- },
940
-
941
-
942
- /** Mid-level mouse scroll wheel event manager.
943
- * Delegates mouseWheel calls to the high-level event receivers of all
944
- * controls registered for that event.
945
- **/
946
- mouseWheel: function(e) {
947
- var _this = EVENT,
948
- _delta = 0,
949
- i = 0;
950
- if (!e) {
951
- e = window.event;
952
- }
953
- if (e.wheelDelta) {
954
- _delta = 0 - (e.wheelDelta / 120);
955
- }
956
- else if (e.detail) {
957
- _delta = 0 - (e.detail / 3);
958
- }
959
- if (BROWSER_TYPE.opera || BROWSER_TYPE.safari) {
960
- _delta = 0 - _delta;
1010
+ var
1011
+ _this = EVENT,
1012
+ _timeNow = new Date().getTime();
1013
+ _this._modifiers(e);
1014
+ // Prevent non-repeat behaviour by waiting at least 100ms before repeating
1015
+ if(_this._lastKeyPressTime > (_timeNow-100)){
1016
+ return;
961
1017
  }
962
- for (; i !== _this.focused.length; i++) {
963
- if (_this.focused[i] === true) {
964
- if (_this.focusOptions[i].mouseWheel === true) {
965
- Event.stop(e);
966
- _this.focusOptions[i].ctrl.mouseWheel(_delta);
1018
+ if(_this._lastKeyDown !== null){
1019
+ var
1020
+ _keyCode = _this.translateKeyCodes(_this._lastKeyDown),
1021
+ _keyDownStateForActiveControl = _this.activeControl?(_this.focusOptions[_this.activeControl.elemId]?_this.focusOptions[_this.activeControl.elemId].keyDown:false):false,
1022
+ _repeat = (_keyDownStateForActiveControl === 'repeat'),
1023
+ _stopEvent = false;
1024
+ if (_this.activeControl && _keyDownStateForActiveControl && _repeat) {
1025
+ if(_this.activeControl.keyDown(_keyCode)){
1026
+ _stopEvent = true;
967
1027
  }
968
1028
  }
1029
+ if(_stopEvent){
1030
+ Event.stop(e);
1031
+ }
969
1032
  }
970
1033
  },
971
1034
 
972
- /* Alternative right button detection, wrapper for the mouseDown method */
973
- contextMenu: function(e) {
974
- // EVENT.mouseDown(e, false);
975
- Event.stop(e);
1035
+
1036
+ // Normalization map of keyCodes for Opera specifically
1037
+ _operaKeyCodeTranslations: {
1038
+
1039
+ // Symbol keys:
1040
+ 59: 186, // [;:]
1041
+ 61: 187, // [=+]
1042
+ 44: 188, // [,<]
1043
+ 45: 189, // [-_]
1044
+ 46: 190, // [.>]
1045
+ 47: 191, // [/?]
1046
+ 96: 192, // [`~]
1047
+ 91: 219, // [[{]
1048
+ 92: 220, // [\|]
1049
+ 93: 221, // []}]
1050
+ 39: 222, // ['"]
976
1051
 
977
- /***
1052
+ // Numeric keypad keys can't be mapped on Opera, because Opera
1053
+ // doesn't differentiate between the keys on the numeric keypad
1054
+ // versus the functionally same keys elsewhere on the keyboard.
978
1055
 
979
- IMPLEMENT SEPARATE CONTEXT-MENU EVENT HANDLING HERE
1056
+ // Branded keys:
1057
+ // Apple Command keys are same as ctrl, but ctrl is 0; Can't be re-mapped reliably.
1058
+ // The Windows Menu key also return 0, so it can't be re-mapped either.
1059
+ 219: 91, // Left Windows key (Start)
1060
+ 220: 92 // Right Windows key (Start)
1061
+ },
1062
+
1063
+ // Normalization map of keyCodes for Gecko (Mozilla) browsers specifically
1064
+ _mozillaKeyCodeTranslations: {
980
1065
 
981
- ***/
1066
+ // Symbol keys:
1067
+ 59: 186, // [;:]
1068
+ 61: 187, // [=+]
1069
+ 109: 189, // [-_]
982
1070
 
983
- // if(Event.isLeftClick(e)){
984
- // EVENT.status[EVENT.button2] = false;
1071
+ // Branded keys:
1072
+ 224: 91 // Apple Command key to left windows key mapping
1073
+
1074
+ },
1075
+
1076
+ /** Translates keyCodes to the normalized pseudo-ascii used by IE and WebKit browsers.
1077
+ * Opera and Mozilla browsers use different codes, so they'll need translations.
1078
+ **/
1079
+ translateKeyCodes: function(_keyCode){
1080
+ var
1081
+ _this = EVENT,
1082
+ _transCode;
1083
+
1084
+ // We use the WebKit and IE browsers as the normalization base, because
1085
+ // there is no variance between in these. Returns the keyCode as-is for
1086
+ // browsers in this category.
1087
+ if(BROWSER_TYPE.safari || BROWSER_TYPE.ie){
1088
+ return _keyCode;
1089
+ }
1090
+ // Opera has its own keyCodes, which are different from all others.
1091
+ else if(BROWSER_TYPE.opera){
1092
+ _transCode = _this._operaKeyCodeTranslations[_keyCode];
1093
+ }
1094
+ // The assumption is that the other browsers do what mozille does.
1095
+ else {
1096
+ _transCode = _this._mozillaKeyCodeTranslations[_keyCode];
1097
+ }
1098
+ if(_transCode === undefined || _transCode === null){
1099
+ return _keyCode;
1100
+ }
1101
+ // else {
1102
+ // console.log('key map from:',_keyCode,' to:',_transCode);
985
1103
  // }
1104
+ return _transCode;
986
1105
  },
987
1106
 
988
1107
  _cmdKeys: [
989
- 224, // Mozilla Left or Right Command Key
990
- 219, // Opera Left Windows Key
991
- 220, // Opera Right Windows Key
992
- 0, // Opera Menu Key or Linux Gecko: any Windows Key
993
- 17, // Opera
1108
+ 17, // Ctrl
994
1109
  91, // Others (Left Start Key or Left Command Key)
995
1110
  92, // Others (Right Start Key)
996
1111
  93 // Others (Menu Key or Right Command Key)
997
1112
  ],
998
1113
  _detectCmdKey: function( _keyCode ) {
999
- return (EVENT._cmdKeys.indexOf(_keyCode) !== -1);
1114
+
1115
+ // On Opera, return true on any of the keycodes
1116
+ if(BROWSER_TYPE.opera){
1117
+ return (EVENT._cmdKeys.indexOf(_keyCode) !== -1);
1118
+ }
1119
+ // Any mac browser (except opera, above) uses left or right windows key
1120
+ // equivalent as the Command key.
1121
+ else if(BROWSER_TYPE.mac){
1122
+ return ((_keyCode === 91) || (_keyCode === 93));
1123
+ }
1124
+ // Other platforms use CTRL as the command key.
1125
+ else {
1126
+ return (_keyCode === 17);
1127
+ }
1000
1128
  },
1001
1129
 
1002
1130
  /* Handle the event modifiers. */
@@ -24,7 +24,7 @@
24
24
  //var//RSence.Foundation
25
25
  COMM.JSONRenderer = HClass.extend({
26
26
 
27
- version: 0.7,
27
+ version: 0.8,
28
28
 
29
29
  /** = Description
30
30
  * Renders JSON structured data, see some of the demos for usage examples.
@@ -77,7 +77,10 @@ COMM.JSONRenderer = HClass.extend({
77
77
  for( _key in _definition ){
78
78
  if( _reserved.indexOf( _key ) === -1 ){
79
79
  _value = _definition[_key];
80
- _extension[_key] = this.extEval( _value );
80
+ if( typeof _value === 'string' ){
81
+ _value = this.extEval( _value );
82
+ }
83
+ _extension[_key] = _value;
81
84
  }
82
85
  }
83
86
  _scope[ _className ] = _extend.extend( _extension );
@@ -302,17 +302,19 @@ HSystem = {
302
302
  **/
303
303
  _flushUpdateZIndexOfChilden: function() {
304
304
 
305
- var j=0, // buffer index
306
-
307
- // reference to the HSystem namespace
308
- _this = HSystem,
309
-
310
- // reference to the buffer
311
- _buffer = _this._updateZIndexOfChildrenBuffer,
312
-
313
- // the length of the buffer
314
- _bufLen = _buffer.length;
315
-
305
+ var
306
+
307
+ j = 0, // buffer index
308
+
309
+ // reference to the HSystem namespace
310
+ _this = HSystem,
311
+
312
+ // reference to the buffer
313
+ _buffer = _this._updateZIndexOfChildrenBuffer,
314
+
315
+ // the length of the buffer
316
+ _bufLen = _buffer.length;
317
+
316
318
  // loop buffer length times to get the items
317
319
  for ( ; j < _bufLen; j++ ) {
318
320
 
@@ -168,7 +168,9 @@ HMorphAnimation = HClass.extend({
168
168
  // --Moves the view for one step. This gets called repeatedly when the animation++
169
169
  // --is happening.++
170
170
  _animateStep: function(_obj) {
171
- var _time = new Date().getTime(), i;
171
+ var
172
+ _time = new Date().getTime(),
173
+ i;
172
174
  if (_time < _obj.startTime + _obj.duration) {
173
175
  var _cTime = _time - _obj.startTime;
174
176
 
@@ -189,14 +191,16 @@ HMorphAnimation = HClass.extend({
189
191
  if(_unit){
190
192
  _propNow += _unit;
191
193
  }
192
- ELEM.setStyle(this.elemId,_key, _propNow);
194
+ ELEM.setStyle( this.elemId, _key, _propNow );
193
195
  }
194
196
  }
195
-
196
- } else {
197
+ }
198
+ else {
197
199
  // Animation is done, clear the interval and finalize the animation.
198
200
  for (i = 0; i < _obj.props.length; i++) {
199
- ELEM.setStyle(this.elemId,_obj.props[i].prop,
201
+ ELEM.setStyle(
202
+ this.elemId,
203
+ _obj.props[i].prop,
200
204
  _obj.props[i].to + _obj.props[i].unit);
201
205
  }
202
206
  this._animationDone = true;
@@ -657,7 +657,7 @@ HView = HClass.extend({
657
657
  }
658
658
  _styl(_elemId,_key,_value,true);
659
659
  }
660
- (this.drown === false) && _this._updateZIndex();
660
+ (this.drawn === false) && _this._updateZIndex();
661
661
 
662
662
  if ( _this._cachedLeft !== _rect.left || _this._cachedTop !== _rect.top) {
663
663
  _this.invalidatePositionCache();
@@ -882,13 +882,20 @@ HView = HClass.extend({
882
882
  else {
883
883
  var
884
884
  _rect = this.parent.rect,
885
- _width = _rect.width,
886
- _height = _rect.height;
887
- if (this.parent.flexLeft && this.parent.flexRight){
888
- _width = parseInt( ELEM.getStyle(this.parent.elemId,'width',true), 10 );
885
+ _width, // = _rect.width,
886
+ _height, // = _rect.height;
887
+ _parentElemId = ( this.parent.markupElemIds && this.parent.markupElemIds.subview ) ? this.parent.markupElemIds.subview : this.parent.elemId;
888
+ if (this.parent.flexLeft && this.parent.flexRight){
889
+ _width = parseInt( ELEM.getStyle( _parentElemId, 'width', true ), 10 );
890
+ }
891
+ else {
892
+ _width = _rect.width;
889
893
  }
890
894
  if (this.parent.flexBottom && this.parent.flexTop){
891
- _height = parseInt( ELEM.getStyle(this.parent.elemId,'height',true), 10 );
895
+ _height = parseInt( ELEM.getStyle( _parentElemId, 'height', true ), 10 );
896
+ }
897
+ else {
898
+ _height = _rect.height;
892
899
  }
893
900
  return [ _width, _height ];
894
901
  }
@@ -998,6 +1005,14 @@ HView = HClass.extend({
998
1005
  }
999
1006
  this.rect = HRect.nu(_leftOffset,_topOffset,_right,_bottom);
1000
1007
 
1008
+ if(!this.rect.isValid){
1009
+ console.log('---------------------------------------------');
1010
+ console.log('invalid rect:', this.rect.left, ',', this.rect.top, ',', this.rect.width, ',', this.rect.height, ',', this.rect.right, ',', this.rect.bottom );
1011
+ console.log(' parent size:', this.parentSize() );
1012
+ console.log(' rect array:', _rect );
1013
+ console.log('---------------------------------------------');
1014
+ }
1015
+
1001
1016
  }
1002
1017
  else {
1003
1018
  console.log(_throwPrefix + 'the length has to be either 4 or 6.');
@@ -1350,10 +1365,7 @@ HView = HClass.extend({
1350
1365
  // Could be cached.
1351
1366
  var _bounds = new HRect(this.rect);
1352
1367
 
1353
- _bounds.right -= _bounds.left;
1354
- _bounds.left = 0;
1355
- _bounds.bottom -= _bounds.top;
1356
- _bounds.top = 0;
1368
+ _bounds.offsetTo(0,0);
1357
1369
 
1358
1370
  return _bounds;
1359
1371
  },
@@ -13,6 +13,11 @@
13
13
  ** - Type
14
14
  ** - Value
15
15
  **
16
+ ** Its current purpose is to view JSON data in a structured way. I'll be
17
+ ** extended later as a full, generic JSON data editor.
18
+ **
19
+ ** NOTE: HPropertyList does not work in any version of Internet Explorer yet.
20
+ **
16
21
  ***/
17
22
  var//RSence.Lists
18
23
  HPropertyList = HControl.extend({
@@ -102,14 +102,9 @@ HMiniMenu = HRadioButtonList.extend({
102
102
  },
103
103
 
104
104
  drawSubviews: function(){
105
- this.markupElemIds.subview = 0;
106
- this.menuItemView = HView.extend({
107
- bringToFront: function(){
108
- this.setStyle('z-index',10000);//this.app.views.length);
109
- }
110
- }).nu(
111
- [ this.rect.left, this.rect.top, this.rect.width, 500 ],
112
- this, {
105
+ this.menuItemView = HView.nu(
106
+ [ this.rect.left, this.rect.top, this.rect.width, 10 ],
107
+ this.app, {
113
108
  visible: false,
114
109
  style: [
115
110
  ['background-color','#f6f6f6'],