rsence-pre 2.1.0.7.pre → 2.1.0.8.pre

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0.7.pre
1
+ 2.1.0.8.pre
data/js/comm/comm.js CHANGED
@@ -129,16 +129,35 @@ COMM = {
129
129
  _username = _options.username?_options.username:null,
130
130
  _password = _options.username?_options.password:null;
131
131
  if(!_options.onFailure){
132
- _this.onFailure = function(resp){console.log('No failure handler specified, response: ',resp);};
132
+ _this.onFailure = function(resp){
133
+ console.log(
134
+ 'No failure handler specified, response: ',
135
+ resp
136
+ );
137
+ };
133
138
  }
134
139
  if(!_options.onSuccess){
135
- _this.onSuccess = function(resp){console.log('No success handler specified, response: ',resp);};
140
+ _this.onSuccess = function(resp){
141
+ console.log('No success handler specified, response: ',resp);
142
+ };
136
143
  }
137
144
  if(!_options.on302){
138
145
  /** Redirection handler **/
139
146
  _this.on503 = function(_this){
140
- var _retryAfter = parseInt(_this.X.getResponseHeader('Retry-After'),10)*1000,
141
- _timeout = setTimeout(function(){COMM.request(_this.url,_this.options);},_retryAfter);
147
+ var
148
+ _retryAfter = parseInt(
149
+ _this.X.getResponseHeader('Retry-After'),
150
+ 10
151
+ )*1000,
152
+ _timeout = setTimeout(
153
+ function(){
154
+ COMM.request(
155
+ _this.url,
156
+ _this.options
157
+ );
158
+ },
159
+ _retryAfter
160
+ );
142
161
  };
143
162
  }
144
163
  _this.url = _url;
@@ -148,7 +167,10 @@ COMM = {
148
167
  _url += ((_url.indexOf('?')!==-1)?'&':'?')+_comm._arrayToQueryString(_params);
149
168
  }
150
169
  if(!_async){
151
- console.log("WARNING: Synchronous "+_method+" request to "+_url+", these will fail on the Symbian web browser.");
170
+ console.log(
171
+ "WARNING: Synchronous "+_method+" request to "+_url+
172
+ ", these will fail on the Symbian web browser."
173
+ );
152
174
  }
153
175
  _this.X.open(
154
176
  _method,
@@ -60,28 +60,28 @@ HSheet = HControl.extend({
60
60
  _left = 0-Math.floor(_rect.width/2)+_rect.left,
61
61
  _height = _rect.height;
62
62
 
63
- _styl( _elemId, 'left', '0px', true);
64
- _styl( _elemId, 'top', '0px', true);
65
- _styl( _elemId, 'right', '0px', true);
66
- _styl( _elemId, 'bottom', '0px', true);
67
- _styl( _elemId, 'width', 'auto', true);
68
- _styl( _elemId, 'height', 'auto', true);
69
- _styl( _elemId, 'min-width', _width+'px', true);
70
- _styl( _elemId, 'min-height', _height+'px', true);
63
+ _styl( _elemId, 'left', '0px');
64
+ _styl( _elemId, 'top', '0px');
65
+ _styl( _elemId, 'right', '0px');
66
+ _styl( _elemId, 'bottom', '0px');
67
+ _styl( _elemId, 'width', 'auto');
68
+ _styl( _elemId, 'height', 'auto');
69
+ _styl( _elemId, 'min-width', _width+'px');
70
+ _styl( _elemId, 'min-height', _height+'px');
71
71
 
72
72
  if(_this['markupElemIds']){
73
73
  var _stateId = _this.markupElemIds['state'];
74
- _styl( _stateId, 'left', _left+'px', true );
75
- _styl( _stateId, 'top', _top+'px', true );
76
- _styl( _stateId, 'width', _width+'px', true );
77
- _styl( _stateId, 'height', _height+'px', true );
74
+ _styl( _stateId, 'left', _left+'px' );
75
+ _styl( _stateId, 'top', _top+'px' );
76
+ _styl( _stateId, 'width', _width+'px' );
77
+ _styl( _stateId, 'height', _height+'px' );
78
78
  }
79
79
  //-- Show the rectangle once it gets created, unless visibility was set to++
80
80
  //-- hidden in the constructor.++
81
81
  if(undefined === _this.isHidden || _this.isHidden === false) {
82
- _styl( _elemId, 'visibility', 'inherit', true);
82
+ _styl( _elemId, 'visibility', 'inherit');
83
83
  }
84
- _styl( _elemId, 'display', 'block', true);
84
+ _styl( _elemId, 'display', 'block');
85
85
  _this._updateZIndex();
86
86
  _this.drawn = true;
87
87
  }
@@ -18,28 +18,28 @@
18
18
  var//RSence.Controls
19
19
  HImageView = HControl.extend({
20
20
 
21
+ getImgSrc: function(){
22
+ var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
23
+ if (!_value){
24
+ _value = this.getThemeGfxPath() + "/blank.gif";
25
+ }
26
+ return _value;
27
+ },
28
+
21
29
  controlDefaults: (HControlDefaults.extend({
22
30
  scaleToFit: true,
23
- value: null,
24
- constructor: function(_ctrl){
25
- if(this.value===null){
26
- // default to a blank image
27
- this.value = _ctrl.getThemeGfxPath() + "/blank.gif";
28
- }
29
- }
31
+ value: null
30
32
  })),
31
33
 
32
34
  _makeScaleToFit: function(_parentId){
33
- var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
34
35
  this.elemId = ELEM.make(_parentId,'img');
35
- ELEM.setAttr(this.elemId,'src',_value);
36
+ ELEM.setAttr(this.elemId,'src',this.getImgSrc());
36
37
  ELEM.setAttr(this.elemId,'alt',this.label);
37
38
  ELEM.setAttr(this.elemId,'title',this.label);
38
39
  },
39
40
  _makeScaleToOriginal: function(_parentId){
40
- var _value = (this.value!==null)?this.value:(this.options.valueObj?this.options.valueObj.value:this.options.value);
41
41
  this.elemId = ELEM.make(_parentId,'div');
42
- ELEM.setStyle(this.elemId,'background-image','url('+_value+')');
42
+ ELEM.setStyle(this.elemId,'background-image','url('+this.getImgSrc()+')');
43
43
  ELEM.setStyle(this.elemId,'background-position','0px 0px');
44
44
  ELEM.setStyle(this.elemId,'background-repeat','no-repeat');
45
45
  ELEM.setAttr(this.elemId,'title',this.label);
@@ -59,10 +59,10 @@ HImageView = HControl.extend({
59
59
  **/
60
60
  refreshValue: function(){
61
61
  if(this.options.scaleToFit){
62
- ELEM.setAttr(this.elemId,'src',this.value);
62
+ ELEM.setAttr(this.elemId,'src',this.getImgSrc());
63
63
  }
64
64
  else{
65
- ELEM.setStyle(this.elemId,'background-image','url('+this.value+')');
65
+ ELEM.setStyle(this.elemId,'background-image','url('+this.getImgSrc()+')');
66
66
  }
67
67
  },
68
68
 
@@ -19,13 +19,13 @@ HProgressIndicator = HView.extend({
19
19
  _indicator: null,
20
20
  _animDirection: 0,
21
21
  drawSubviews: function(){
22
- var _this = this;
22
+ var _this = this,
23
+ _rect = _this.rect,
24
+ _height = _rect.height,
25
+ _width = _rect.width;
26
+ _width -= 2;
23
27
  _this.setStyle( 'border', '1px solid #999' );
24
28
  _this.setStyle( 'background-color', '#ccc' );
25
- var _height = _this.rect.height,
26
- _visibleWidth = ELEM.getVisibleSize( _this.elemId )[0],
27
- _width = (_visibleWidth===0)?_this.rect.width:_visibleWidth;
28
- _width -= 2;
29
29
  _this['_rect'+0] = HRect.nu( 0,0,_height,_height );
30
30
  _this['_rect'+1] = HRect.nu( _width-_height, 0, _width, _height );
31
31
  _this._indicator = HView.nu( HRect.nu( _this['_rect'+0] ), _this );
@@ -36,7 +36,7 @@ HSlider = HControl.extend({
36
36
 
37
37
  defaultEvents: {
38
38
  draggable: true,
39
- keyDown: true,
39
+ keyDown: 'repeat',
40
40
  keyUp: true,
41
41
  mouseWheel: true
42
42
  },
@@ -44,8 +44,6 @@ HSlider = HControl.extend({
44
44
  controlDefaults: (HControlDefaults.extend({
45
45
  minValue: 0,
46
46
  maxValue: 1,
47
- repeatDelay: 300,
48
- repeatInterval: 50,
49
47
  inverseAxis: false
50
48
  })),
51
49
 
@@ -154,12 +152,10 @@ HSlider = HControl.extend({
154
152
  // Arrow keys move the thumb 5% at a time.
155
153
  if ( (_keycode === Event.KEY_LEFT && !this._isVertical) ||
156
154
  (_keycode === Event.KEY_DOWN && this._isVertical) ) {
157
- this._moving = true;
158
155
  this._moveThumb(-0.05);
159
156
  }
160
157
  else if ( (_keycode === Event.KEY_RIGHT && !this._isVertical) ||
161
158
  (_keycode === Event.KEY_UP && this._isVertical) ) {
162
- this._moving = true;
163
159
  this._moveThumb(0.05);
164
160
  }
165
161
  // Home key moves the thumb to the beginning and end key to the end.
@@ -171,15 +167,12 @@ HSlider = HControl.extend({
171
167
  }
172
168
  // Page up and page down keys move the thumb 25% at a time.
173
169
  else if (_keycode === Event.KEY_PAGEDOWN) {
174
- this._moving = true;
175
170
  this._moveThumb(-0.25);
176
171
  }
177
172
  else if (_keycode === Event.KEY_PAGEUP) {
178
- this._moving = true;
179
173
  this._moveThumb(0.25);
180
174
  }
181
-
182
-
175
+ return true;
183
176
  },
184
177
 
185
178
 
@@ -191,7 +184,7 @@ HSlider = HControl.extend({
191
184
  *
192
185
  **/
193
186
  keyUp: function(_keycode) {
194
- this._moving = false;
187
+ return true;
195
188
  },
196
189
 
197
190
 
@@ -223,29 +216,9 @@ HSlider = HControl.extend({
223
216
 
224
217
  // --private method++
225
218
  _moveThumb: function(_valueChange, _rate) {
226
-
227
- if (!_rate) {
228
- // --If the key is held down, wait for a while before starting repeat.++
229
- _rate = this.options.repeatDelay;
230
- }
231
- else if (_rate === this.options.repeatDelay) {
232
- _rate = this.options.repeatInterval;
233
- }
234
-
235
- if (this._moving && this.active) {
236
-
219
+ if (this.active) {
237
220
  var _value = (this.maxValue - this.minValue) * _valueChange;
238
-
239
221
  this.setValue( this.value + _value);
240
-
241
- var _that = this;
242
- if (this._thumbMoveTimeout) {
243
- window.clearTimeout(this._thumbMoveTimeout);
244
- this._thumbMoveTimeout = null;
245
- }
246
- this._thumbMoveTimeout = window.setTimeout(function(){
247
- _that._moveThumb(_valueChange, _rate);
248
- }, _rate);
249
222
  }
250
223
 
251
224
  },
@@ -42,56 +42,6 @@ HTextControl = HControl.extend({
42
42
  }
43
43
  }
44
44
  },
45
-
46
- // drawSubviews: function(){
47
- // if(this['markupElemIds']!==undefined && this.markupElemIds['value']!==undefined) {
48
- // // this.adjustInputStyle();
49
- // }
50
- // this.setEnabled(this.enabled);
51
- // },
52
- //
53
- // /** = Description
54
- // * Tweaks the input element to fit the match the size properly
55
- // * in different browsers. Can't be done reliably by using just
56
- // * the theme css, because some browsers are broken
57
- // * regarding styling of input elements.
58
- // *
59
- // **/
60
- // adjustInputStyle: function(){
61
- // var _input = this.markupElemIds.value,
62
- // _label = this.markupElemIds.label;
63
- // if(BROWSER_TYPE.firefox){
64
- // if(this.componentName === 'textarea'){
65
- // ELEM.setStyle(_input,'padding-top','0px');
66
- // }
67
- // else {
68
- // ELEM.setStyle(_input,'margin-top','1px');
69
- // }
70
- // ELEM.setStyle(_input,'padding-left','0px');
71
- // ELEM.setStyle(_label,'left','2px');
72
- // ELEM.setStyle(_label,'top','0px');
73
- // ELEM.setStyle(_label,'right','2px');
74
- // ELEM.setStyle(_label,'bottom','2px');
75
- // }
76
- // else if(BROWSER_TYPE.ie){
77
- // ELEM.flushLoop();
78
- // var _size = ELEM.getVisibleSize( this.elemId ),
79
- // _width = _size[0],
80
- // _height = _size[1];
81
- // ELEM.setStyle(_input,'left','2px');
82
- // ELEM.setStyle(_input,'top','1px');
83
- // ELEM.setStyle(_input,'padding-top','0px');
84
- // ELEM.setStyle(_input,'padding-left','0px');
85
- // ELEM.setStyle(_input,'padding-right','8px');
86
- // ELEM.setStyle(_input,'padding-bottom','0px');
87
- // ELEM.setStyle(_input,'width',(_width-10)+'px');
88
- // ELEM.setStyle(_input,'height',(_height-2)+'px');
89
- // ELEM.setStyle(_label,'left','0px');
90
- // ELEM.setStyle(_label,'top','0px');
91
- // ELEM.setStyle(_label,'right','0px');
92
- // ELEM.setStyle(_label,'bottom','0px');
93
- // }
94
- // },
95
45
 
96
46
  setStyle: function(_name, _value, _cacheOverride) {
97
47
  if (!this['markupElemIds']||!this.markupElemIds['value']) {
@@ -1,4 +1,4 @@
1
- <div class="textcontrol_bg"></div>
1
+ <div class="textcontrol_bg" id="bg#{_ID}"></div>
2
2
 
3
3
  <div class="textcontrol_n"></div>
4
4
  <div class="textcontrol_s"></div>
@@ -240,8 +240,8 @@ HWindow = HDynControl.extend({
240
240
  _view, _size, _right, _bottom;
241
241
  for( ; i < _views.length; i++ ){
242
242
  _view = HSystem.views[_views[i]];
243
- _size = ELEM.getVisibleSize(_view.elemId);
244
- _pos = ELEM.getVisiblePosition(_view.elemId);
243
+ _size = ELEM.getSize(_view.elemId);
244
+ _pos = ELEM.getPosition(_view.elemId);
245
245
  _right = _size[0]+_pos[0]-this.pageX();
246
246
  _bottom = _size[1]+_pos[1]-this.pageY();
247
247
  if(_right > _fitsRect.width){