rsence 2.2.2 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.2.3
@@ -289,7 +289,7 @@ HSlider = HControl.extend({
289
289
 
290
290
  prevOrientation: 'c',
291
291
 
292
- cssClassPrefix: 'h',
292
+ orientations: ['n','s','c'],
293
293
 
294
294
  /** = Description
295
295
  * Changes the thumb graphic. Possible orientations by default are
@@ -316,17 +316,16 @@ HSlider = HControl.extend({
316
316
  }
317
317
  var _toggleCSS = this.toggleCSSClass,
318
318
  _ctrlId = this.markupElemIds.control,
319
- _orientations = ['n','s','w','e','c'],
319
+ _orientations = this.orientations,
320
320
  _iOrientation = '',
321
321
  _cssClassName = '',
322
- _cssClassPrefix = this.cssClassPrefix,
323
- _cssClassVert = this._isVertical?'v':'',
322
+ _componentName = this.componentName,
324
323
  _activeOrientation = false,
325
324
  i = 0;
326
- for(;i<5;i++){
325
+ for(;i<3;i++){
327
326
  _iOrientation = _orientations[i];
328
327
  _activeOrientation = (_orientation===_iOrientation);
329
- _cssClassName = (_orientation==='c')?_cssClassPrefix+_cssClassVert+'slider_thumb':_cssClassPrefix+'slider_thumb_'+_iOrientation;
328
+ _cssClassName = (_orientation==='c')?_componentName+'_thumb':_componentName+'_thumb_'+_iOrientation;
330
329
  _toggleCSS( _ctrlId, _cssClassName, _activeOrientation );
331
330
  }
332
331
 
@@ -1,108 +1,80 @@
1
- .hslider_track_left,
2
- .hslider_track_right,
3
- .hslider_track {
1
+ .slider_track_left,
2
+ .slider_track_right,
3
+ .slider_track {
4
4
  position: absolute;
5
5
  height: 7px; top: 7px;
6
- font-size: 0px;
6
+ font-size: 0;
7
7
  background-image: #{this.getCssFilePath('hslider_tracks.png')};
8
8
  }
9
9
 
10
- .hslider_track_left {
10
+ .slider_track_left {
11
11
  left: 10px; width: 4px;
12
- background-position: 0px 0px;
12
+ background-position: 0 0;
13
13
  }
14
14
 
15
- .hslider_track_right {
15
+ .slider_track_right {
16
16
  right: 10px; width: 4px;
17
- background-position: -4px 0px;
17
+ background-position: -4px 0;
18
18
  }
19
19
 
20
- .hslider_track {
20
+ .slider_track {
21
21
  left: 14px; right: 14px;
22
- background-position: 0px -14px;
22
+ background-position: 0 -14px;
23
23
  }
24
24
 
25
- .disabled .hslider_track_left {
26
- background-position: 0px -7px;
25
+ .disabled .slider_track_left {
26
+ background-position: 0 -7px;
27
27
  }
28
28
 
29
- .disabled .hslider_track_right {
29
+ .disabled .slider_track_right {
30
30
  background-position: -4px -7px;
31
31
  }
32
32
 
33
- .disabled .hslider_track {
34
- background-position: 0px -21px;
33
+ .disabled .slider_track {
34
+ background-position: 0 -21px;
35
35
  }
36
36
 
37
- .hslider_thumb {
37
+ .slider_thumb {
38
38
  position: absolute;
39
- top: 0px; height: 21px; width: 21px;
40
- font-size: 0px;
41
- background-position: 0px 0px;
39
+ top: 0; height: 21px; width: 21px;
40
+ font-size: 0;
41
+ background-position: 0 0;
42
42
  background-image: #{this.getCssFilePath('slider_thumbs.png')};
43
43
  }
44
44
 
45
- .hslider_thumb:active {
46
- background-position: 0px -22px;
45
+ .slider_thumb:active {
46
+ background-position: 0 -22px;
47
47
  }
48
48
 
49
- .disabled .hslider_thumb {
50
- background-position: 0px -44px;
49
+ .disabled .slider_thumb {
50
+ background-position: 0 -44px;
51
51
  }
52
52
 
53
- .hslider_thumb_n,
54
- .hslider_thumb_s,
55
- .hslider_thumb_e,
56
- .hslider_thumb_w {
53
+ .slider_thumb_n,
54
+ .slider_thumb_s {
57
55
  position: absolute;
58
- top: 0px; height: 21px; width: 21px;
56
+ top: 0; height: 21px; width: 21px;
59
57
  background-image: #{this.getCssFilePath('slider_thumbs.png')};
60
58
  }
61
59
 
62
- .hslider_thumb_e,
63
- .hslider_thumb_w {
64
- left: 0px;
60
+ .slider_thumb_n {
61
+ background-position: -22px 0;
65
62
  }
66
-
67
- .hslider_thumb_n {
68
- background-position: -22px 0px;
69
- }
70
- .hslider_thumb_n:active {
63
+ .slider_thumb_n:active {
71
64
  background-position: -22px -22px;
72
65
  }
73
- .disabled .hslider_thumb_n {
66
+ .disabled .slider_thumb_n {
74
67
  background-position: -22px -44px;
75
68
  }
76
69
 
77
- .hslider_thumb_s {
78
- background-position: -44px 0px;
70
+ .slider_thumb_s {
71
+ background-position: -44px 0;
79
72
  }
80
- .hslider_thumb_s:active {
73
+ .slider_thumb_s:active {
81
74
  background-position: -44px -22px;
82
75
  }
83
- .disabled .hslider_thumb_s {
76
+ .disabled .slider_thumb_s {
84
77
  background-position: -44px -44px;
85
78
  }
86
79
 
87
- .hslider_thumb_w {
88
- background-position: -66px 0px;
89
- }
90
- .hslider_thumb_w:active {
91
- background-position: -66px -22px;
92
- }
93
- .disabled .hslider_thumb_w {
94
- background-position: -66px -44px;
95
- }
96
-
97
- .hslider_thumb_e {
98
- background-position: -88px 0px;
99
- }
100
- .hslider_thumb_e:active {
101
- background-position: -88px -22px;
102
- }
103
- .disabled .hslider_thumb_e {
104
- background-position: -88px -44px;
105
- }
106
-
107
-
108
80
 
@@ -1,5 +1,5 @@
1
- <div class="hslider_track_left"></div>
2
- <div class="hslider_track_right"></div>
3
- <div class="hslider_track"></div>
4
- <div class="hslider_thumb" id="control#{_ID}"></div>
1
+ <div class="slider_track_left"></div>
2
+ <div class="slider_track_right"></div>
3
+ <div class="slider_track"></div>
4
+ <div class="slider_thumb" id="control#{_ID}"></div>
5
5
  ${this.thumbSize=21;}
@@ -3,27 +3,27 @@
3
3
  .vslider_track {
4
4
  position: absolute;
5
5
  width: 7px; left: 7px;
6
- font-size: 0px;
6
+ font-size: 0;
7
7
  background-image: #{this.getCssFilePath('vslider_tracks.png')};
8
8
  }
9
9
 
10
10
  .vslider_track_top {
11
11
  top: 10px; height: 4px;
12
- background-position: 0px 0px;
12
+ background-position: 0 0;
13
13
  }
14
14
 
15
15
  .vslider_track_bottom {
16
16
  bottom: 10px; height: 4px;
17
- background-position: 0px -4px;
17
+ background-position: 0 -4px;
18
18
  }
19
19
 
20
20
  .vslider_track {
21
21
  top: 14px; bottom: 14px;
22
- background-position: -14px 0px;
22
+ background-position: -14px 0;
23
23
  }
24
24
 
25
25
  .disabled .vslider_track_top {
26
- background-position: -7px 0px;
26
+ background-position: -7px 0;
27
27
  }
28
28
 
29
29
  .disabled .vslider_track_bottom {
@@ -31,22 +31,55 @@
31
31
  }
32
32
 
33
33
  .disabled .vslider_track {
34
- background-position: -21px 0px;
34
+ background-position: -21px 0;
35
35
  }
36
36
 
37
37
  .vslider_thumb {
38
38
  position: absolute;
39
39
  font-size: 0px;
40
- left: 0px; width: 21px; height: 21px;
41
- background-position: 0px 0px;
40
+ left: 0; width: 21px; height: 21px;
41
+ background-position: 0 0;
42
42
  background-image: #{this.getCssFilePath('slider_thumbs.png')};
43
43
  }
44
44
 
45
45
  .vslider_thumb:active {
46
- background-position: 0px -22px;
46
+ background-position: 0 -22px;
47
47
  }
48
48
 
49
49
  .disabled .vslider_thumb {
50
- background-position: 0px -44px;
50
+ background-position: 0 -44px;
51
+ }
52
+
53
+ .vslider_thumb_e,
54
+ .vslider_thumb_w {
55
+ position: absolute;
56
+ top: 0; height: 21px; width: 21px;
57
+ background-image: #{this.getCssFilePath('slider_thumbs.png')};
58
+ }
59
+
60
+ .vslider_thumb_e,
61
+ .vslider_thumb_w {
62
+ left: 0;
63
+ }
64
+
65
+ .vslider_thumb_w {
66
+ background-position: -66px 0;
67
+ }
68
+ .vslider_thumb_w:active {
69
+ background-position: -66px -22px;
70
+ }
71
+ .disabled .vslider_thumb_w {
72
+ background-position: -66px -44px;
73
+ }
74
+
75
+ .vslider_thumb_e {
76
+ background-position: -88px 0;
77
+ }
78
+ .vslider_thumb_e:active {
79
+ background-position: -88px -22px;
51
80
  }
81
+ .disabled .vslider_thumb_e {
82
+ background-position: -88px -44px;
83
+ }
84
+
52
85
 
@@ -35,7 +35,9 @@ HVSlider = HSlider.extend({
35
35
  componentName: "vslider",
36
36
 
37
37
  // This overrides the HSlider property.
38
- _isVertical: true
38
+ _isVertical: true,
39
+
40
+ orientations: ['w','e','c']
39
41
 
40
42
  });
41
43
 
@@ -140,7 +140,7 @@ HStepper = HControl.extend({
140
140
  **/
141
141
  mouseDown: function( x, y ){
142
142
  this.setMouseUp(true);
143
- this._setRepeatInterval( ( y - ELEM.getVisiblePosition( this.elemId )[1] ) <= 11 );
143
+ this._setRepeatInterval( ( y - this.pageY() ) <= 11 );
144
144
  return true;
145
145
  },
146
146
 
@@ -43,14 +43,12 @@ var HStringView, HLabel;
43
43
  *
44
44
  **/
45
45
  refreshLabel: function() {
46
- if(this.markupElemIds) {
47
- if(this.markupElemIds.value) {
48
- if( this.value !== undefined ){
49
- this.setAttrOfPart( 'value', 'title', this.label );
50
- }
51
- else {
52
- this.setMarkupOfPart( 'value', this.label );
53
- }
46
+ if(this.markupElemIds && this.markupElemIds.value) {
47
+ if( this.value !== undefined ){
48
+ this.setAttrOfPart( 'value', 'title', this.label );
49
+ }
50
+ else {
51
+ this.setMarkupOfPart( 'value', this.label );
54
52
  }
55
53
  }
56
54
  }
@@ -1 +1 @@
1
- <div class="stringview" id="value#{_ID}" title="#{this.label}"></div>
1
+ <div class="stringview" id="value#{_ID}"></div>
@@ -152,23 +152,16 @@ HTextControl = HControl.extend({
152
152
  textBlur: function(){
153
153
  this.hasTextFocus = false;
154
154
  this._clearChangeEventFn();
155
- this._updateValueFromField();
156
155
  if(this.options.refreshOnBlur){
156
+ this._updateValueFromField();
157
157
  this.refreshValue();
158
158
  }
159
159
  return true;
160
160
  },
161
161
 
162
162
  idle: function(){
163
- if( !this.options.refreshOnIdle ){ return; }
164
- this.hasTextFocus && this._updateValueFromField();
165
- try{
166
- this.base();
167
- }
168
- catch(e){
169
- console.error('HTextControl::onIdle error -> ',e);
170
- debugger;
171
- this.base();
163
+ if( this.hasTextFocus && this.options.refreshOnIdle && this.options.refreshOnInput ){
164
+ this._updateValueFromField();
172
165
  }
173
166
  },
174
167
 
@@ -354,12 +347,12 @@ HTextControl = HControl.extend({
354
347
  *
355
348
  **/
356
349
  textEnter: function(){
357
- this.setValue(
358
- this.validateText(
359
- this.getTextFieldValue()
360
- )
361
- );
362
350
  if(this.options.refreshOnInput){
351
+ this.setValue(
352
+ this.validateText(
353
+ this.getTextFieldValue()
354
+ )
355
+ );
363
356
  this.refreshValue();
364
357
  }
365
358
  return false;
@@ -20,7 +20,7 @@ HCalendar = HControl.extend
20
20
  ## the mouse wheel or equivalent content-scrolling user interface gesture
21
21
  defaultEvents:
22
22
  mouseWheel: true
23
- # click: true
23
+ keyDown: true
24
24
 
25
25
  ## Calls HCalendar#nextMonth or HCalendar#prevMonth based on delta change
26
26
  ## of the mouseWheel event
@@ -29,10 +29,65 @@ HCalendar = HControl.extend
29
29
  @nextMonth()
30
30
  else
31
31
  @prevMonth()
32
+
33
+ ## Draws the next month
34
+ nextMonth: (_set)->
35
+ _dateNext = new Date( @viewMonth[0], @viewMonth[1]+1, 1 )
36
+ _dateMs = _dateNext.getTime() - @tzMs(_dateNext)
37
+ if _set
38
+ @setValue( _dateMs/1000 )
39
+ else
40
+ @drawCalendar( new Date(_dateMs) )
41
+
42
+ ## Draws the prev month
43
+ prevMonth: (_set)->
44
+ _datePrev = new Date( @viewMonth[0], @viewMonth[1]-1, 1 )
45
+ _dateMs = _datePrev.getTime() - @tzMs(_datePrev)
46
+ if _set
47
+ @setValue( _dateMs/1000 )
48
+ else
49
+ @drawCalendar( new Date(_dateMs) )
32
50
 
33
- ## Simple click-through for the themed hyperlinks
34
- click: ->
35
- false
51
+ ## Draws the next year
52
+ nextYear: (_set)->
53
+ _dateNext = new Date( @viewMonth[0]+1, @viewMonth[1], 1 )
54
+ _dateMs = _dateNext.getTime() - @tzMs(_dateNext)
55
+ if _set
56
+ @setValue( _dateMs/1000 )
57
+ else
58
+ @drawCalendar( new Date(_dateMs) )
59
+
60
+ ## Draws the prev year
61
+ prevYear: (_set)->
62
+ _datePrev = new Date( @viewMonth[0]-1, @viewMonth[1], 1 )
63
+ _dateMs = _datePrev.getTime() - @tzMs(_datePrev)
64
+ if _set
65
+ @setValue( _dateMs/1000 )
66
+ else
67
+ @drawCalendar( new Date(_dateMs) )
68
+
69
+ nextDay: -> @setValue( @value + 24*60*60 )
70
+ prevDay: -> @setValue( @value - 24*60*60 )
71
+ nextWeek: -> @setValue( @value + 7*24*60*60 )
72
+ prevWeek: -> @setValue( @value - 7*24*60*60 )
73
+
74
+ ## Keyboard control
75
+ keyDown: (_key)->
76
+ if EVENT.isShiftKeyDown()
77
+ @prevMonth(true) if _key == Event.KEY_LEFT
78
+ @nextMonth(true) if _key == Event.KEY_RIGHT
79
+ @prevYear(true) if _key == Event.KEY_UP
80
+ @nextYear(true) if _key == Event.KEY_DOWN
81
+ else
82
+ @nextDay() if _key == Event.KEY_RIGHT
83
+ @prevDay() if _key == Event.KEY_LEFT
84
+ @nextWeek() if _key == Event.KEY_DOWN
85
+ @prevWeek() if _key == Event.KEY_UP
86
+ @prevMonth(true) if _key == Event.KEY_PAGEUP
87
+ @nextMonth(true) if _key == Event.KEY_PAGEDOWN
88
+ @prevYear(true) if _key == Event.KEY_HOME
89
+ @nextYear(true) if _key == Event.KEY_END
90
+ true
36
91
 
37
92
  drawSubviews: ->
38
93
  _this = @
@@ -128,91 +183,83 @@ HCalendar = HControl.extend
128
183
  }
129
184
  }
130
185
 
186
+ lostActiveStatus: (_obj)->
187
+ if (_obj and @menu and !@menu._killed and !_obj.isChildOf(@menu) and !_obj.isChildOf(@menu.menuItemView))
188
+ @menu.die()
189
+ @base(_obj)
190
+
131
191
  ## Calls #drawCalendar when the value is changed
132
192
  refreshValue: ->
133
193
  @drawCalendar( @date() )
134
194
 
135
- ## Draws the next month
136
- nextMonth: ->
137
- _dateNext = new Date( @viewMonth[0], @viewMonth[1]+1, 1 )
138
- _dateMs = _dateNext.getTime() - @tzMs(_dateNext)
139
- @drawCalendar( new Date(_dateMs) )
140
-
141
- ## Drows the prev month
142
- prevMonth: ->
143
- _datePrev = new Date( @viewMonth[0], @viewMonth[1]-1, 1 )
144
- _dateMs = _datePrev.getTime() - @tzMs(_datePrev)
145
- @drawCalendar( new Date(_dateMs) )
146
-
147
195
  ## Stores the currently viewed year and month
148
196
  viewMonth: [ 1970, 0 ]
149
197
 
150
198
  ## Shows a pulldown menu for month selection
151
199
  monthMenu: ->
152
200
  return unless HMiniMenu?
153
- _calendar = this
201
+ _calendar = @
154
202
  _monthValues = []
155
203
  for _monthName, i in HLocale.dateTime.strings.monthsLong
156
204
  _monthValues.push( [ i, _monthName ] )
157
205
  _rect = ELEM.getBoxCoords( @_monthMenu )
158
206
  _rect[0] += 20
159
207
  _rect[2] = 80 if _rect[2] < 80
160
- HMiniMenu.extend(
161
- _killAfterRefresh: false
208
+ @menu = HMiniMenu.extend(
209
+ click: ->
210
+ console.log('click')
162
211
  menuHide: ->
212
+ return if @_killed?
213
+ @_killed = true
163
214
  @base()
215
+ _calendar.setValue( _calendar.setMonth( @value ) )
216
+ if _calendar.month() != @value
217
+ _calendar.setValue( _calendar.setMday( 30 ) )
218
+ _calendar.setValue( _calendar.setMonth( @value ) )
219
+ if _calendar.month() != @value
220
+ _calendar.setValue( _calendar.setMday( 29 ) )
221
+ _calendar.setValue( _calendar.setMonth( @value ) )
222
+ if _calendar.month() != @value
223
+ _calendar.setValue( _calendar.setMday( 28 ) )
224
+ _calendar.setValue( _calendar.setMonth( @value ) )
164
225
  _menu = @
165
- _menu._killAfterRefresh = true
166
226
  COMM.Queue.push( ->
167
- if _menu._killAfterRefresh
168
- _menu.refreshValue()
227
+ EVENT.changeActiveControl(_calendar)
228
+ _calendar.menu = null
229
+ _menu.die()
169
230
  )
170
- return true;
171
- refreshValue: ->
172
- @base()
173
- if @_killAfterRefresh
174
- @_killAfterRefresh = false
175
- _calendar.setValue( _calendar.setMonth( @value ) )
176
- if _calendar.month() != @value
177
- _calendar.setValue( _calendar.setMday( 30 ) )
178
- _calendar.setValue( _calendar.setMonth( this.value ) )
179
- if _calendar.month() != @value
180
- _calendar.setValue( _calendar.setMday( 29 ) )
181
- _calendar.setValue( _calendar.setMonth( @value ) )
182
- if _calendar.month() != this.value
183
- _calendar.setValue( _calendar.setMday( 28 ) )
184
- _calendar.setValue( _calendar.setMonth( @value ) )
185
- _menu = this
186
- COMM.Queue.push( ->
187
- _menu.die()
188
- )
189
231
  ).new( _rect, @,
190
232
  value: @month()
191
233
  initialVisibility: true
192
- ).setListItems( _monthValues )
234
+ listItems: _monthValues
235
+ )
193
236
 
194
237
  ## Shows a text field for year selection
195
238
  yearMenu: ->
196
239
  _calendar = @
240
+ _calendarEnable = @enabled
197
241
  _rect = ELEM.getBoxCoords( @_yearMenu )
198
242
  _rect[0] += 20
199
243
  _rect[2] = 40 if _rect[2] < 40
200
- _rect[3] = 20
244
+ _rect[3] = 16
245
+ EVENT.changeActiveControl(null)
246
+ @setEnabled(false)
201
247
  HNumericTextControl.extend(
202
248
  refreshValue: ->
203
249
  @base()
204
250
  _calendar.setValue( _calendar.setYear( @value ) )
251
+ gainedActiveStatus: (_obj)->
252
+ @base(_obj)
253
+ _calendar.setEnabled(_calendarEnable)
205
254
  textBlur: ->
206
255
  @base()
207
- _year = this
256
+ _year = @
208
257
  COMM.Queue.push( ->
209
- _year.die() if _year.markupElemIds?
258
+ if _year.markupElemIds?
259
+ _year.die()
210
260
  )
211
- textEnter: ->
212
- @base()
213
- _returnKeyPressed = EVENT.status[ EVENT.keysDown ].indexOf( 13 ) != -1
214
- _noKeysPressed = EVENT.status[ EVENT.keysDown ].length == 0
215
- if _returnKeyPressed or _noKeysPressed
261
+ keyDown: (_key)->
262
+ if _key == Event.KEY_RETURN
216
263
  ELEM.get( @markupElemIds.value ).blur()
217
264
  ).new( _rect, @,
218
265
  value: @year()
@@ -220,6 +267,11 @@ HCalendar = HControl.extend
220
267
  maxValue: 38400
221
268
  focusOnCreate: true
222
269
  refreshOnInput: false
270
+ refreshOnIdle: false
271
+ events:
272
+ keyDown: true
273
+ style:
274
+ fontSize: '11px'
223
275
  )
224
276
 
225
277
  _destroyCalendarElems: ->
@@ -238,7 +290,6 @@ HCalendar = HControl.extend
238
290
  ## Params:
239
291
  ## - _date: The date on which calendar UI is opened at.
240
292
  drawCalendar: (_date)->
241
- @_destroyCalendarElems()
242
293
  _date = @date() unless ( _date instanceof Date )
243
294
  _calendarDateRange = @calendarDateRange( _date )
244
295
  _monthFirst = _calendarDateRange.month.firstDate
@@ -252,7 +303,7 @@ HCalendar = HControl.extend
252
303
  _colWidth = Math.floor( _availWidth / 8 )
253
304
  _rowHeight = Math.floor( _availHeight / 6 )
254
305
  _parentElem = @markupElemIds.value
255
- ELEM.setStyle( _parentElem, 'visibility', 'hidden', true )
306
+ # ELEM.setStyle( _parentElem, 'visibility', 'hidden', true )
256
307
  _elems = []
257
308
  _this = @
258
309
  for _row in [0..5]
@@ -288,9 +339,10 @@ HCalendar = HControl.extend
288
339
  else
289
340
  ELEM.addClassName( _colElem, 'calendar_weeks_week_col_yes' )
290
341
  ELEM.setAttr( _colElem, '_colSecs', _colSecs )
291
- Event.observe( ELEM.get( _colElem ), 'click', ->
292
- _this.setValue( @_colSecs )
293
- )
342
+ if @enabled
343
+ Event.observe( ELEM.get( _colElem ), 'click', ->
344
+ _this.setValue( @_colSecs )
345
+ )
294
346
  # ELEM.setAttr( _colElem, 'href', "javascript:HSystem.views[#{@viewId}].setValue(#{_colSecs})" )
295
347
  _left = (_col*_colWidth+_leftPlus)
296
348
  ELEM.setStyle( _colElem, 'left', _left+'px' )
@@ -298,13 +350,15 @@ HCalendar = HControl.extend
298
350
  ELEM.setStyle( _colElem, 'height', (_rowHeight-1)+'px' )
299
351
  ELEM.setStyle( _colElem, 'line-height', _rowHeight+'px' )
300
352
  ELEM.setHTML( _colElem, @mday( _colDate ) )
301
- ELEM.setStyle( _parentElem, 'visibility', 'inherit' )
353
+ # ELEM.setStyle( _parentElem, 'visibility', 'inherit' )
354
+ ELEM.flush()
302
355
  _stateElem = @markupElemIds.state
303
356
 
304
357
  @_monthMenu = ELEM.make( _stateElem, 'span' )#, 'a' )
305
358
  _elems.push( @_monthMenu )
306
359
  # ELEM.setAttr( @_monthMenu, 'href', "javascript:HSystem.views[#{@viewId}].monthMenu()" )
307
- Event.observe( ELEM.get( @_monthMenu ), 'click', ( -> _this.monthMenu() ), false )
360
+ if @enabled
361
+ Event.observe( ELEM.get( @_monthMenu ), 'click', ( -> _this.monthMenu() ), false )
308
362
  ELEM.setHTML( @_monthMenu, @monthName( _date ) )
309
363
 
310
364
  _spacer = ELEM.make( _stateElem, 'span' )
@@ -313,11 +367,13 @@ HCalendar = HControl.extend
313
367
 
314
368
  @_yearMenu = ELEM.make( _stateElem, 'span' )#, 'a' )
315
369
  _elems.push( @_yearMenu )
316
- Event.observe( ELEM.get( @_yearMenu ), 'click', ( -> _this.yearMenu() ), false )
370
+ if @enabled
371
+ Event.observe( ELEM.get( @_yearMenu ), 'click', ( -> _this.yearMenu() ), false )
317
372
  # ELEM.setAttr( @_yearMenu, 'href', "javascript:HSystem.views[#{@viewId}].yearMenu()" )
318
373
  ELEM.setHTML( @_yearMenu, @year( _date ) )
319
374
 
320
375
  @viewMonth = [ _monthFirst.getUTCFullYear(), _monthFirst.getUTCMonth() ]
376
+ @_destroyCalendarElems()
321
377
  @_drawCalendarElems = _elems
322
378
 
323
379
  HCalendar.implement( HDateTime )
@@ -95,10 +95,12 @@
95
95
  font-weight: bold;
96
96
  border: 1px solid #666;
97
97
  }
98
- .calendar_weeks_week_col_sel,
99
- .calendar_weeks_week_col_yes:hover {
98
+ .calendar_weeks_week_col_sel {
100
99
  background-color: #fff;
101
100
  }
101
+ .calendar_weeks_week_col_yes:hover {
102
+ border: 2px solid black; margin: -1px; z-index: 100; border-radius: 3px;
103
+ }
102
104
  .calendar_bg {
103
105
  position: absolute;
104
106
  left: -1px; right: -1px;
@@ -441,6 +441,11 @@ HDynControl = HControl.extend({
441
441
  x-=_parent.pageX();
442
442
  y-=_parent.pageY();
443
443
  }
444
+ else {
445
+ var _scrollPos = ELEM.getScrollPosition(0);
446
+ x+=_scrollPos[0];
447
+ y+=_scrollPos[1];
448
+ }
444
449
  this._startPoint = new HPoint(x,y);
445
450
  this._startRect = new HRect( this.rect );
446
451
  this._detectActionFlag();
@@ -473,6 +478,11 @@ HDynControl = HControl.extend({
473
478
  x-=_parent.pageX();
474
479
  y-=_parent.pageY();
475
480
  }
481
+ else {
482
+ var _scrollPos = ELEM.getScrollPosition(0);
483
+ x+=_scrollPos[0];
484
+ y+=_scrollPos[1];
485
+ }
476
486
  if(this._actionFlag!==-1){
477
487
  this._actionFns[this._actionFlag](this,x,y);
478
488
  }
@@ -503,6 +513,11 @@ HDynControl = HControl.extend({
503
513
  x-=_parent.pageX();
504
514
  y-=_parent.pageY();
505
515
  }
516
+ else {
517
+ var _scrollPos = ELEM.getScrollPosition(0);
518
+ x+=_scrollPos[0];
519
+ y+=_scrollPos[1];
520
+ }
506
521
  if(this._actionFlag!==-1){
507
522
  this._actionFns[this._actionFlag](this,x,y);
508
523
  }
@@ -431,8 +431,9 @@ EVENT = {
431
431
  **/
432
432
  mouseMove: function(e) {
433
433
  var _this = EVENT,
434
- x = Event.pointerX(e),
435
- y = Event.pointerY(e),
434
+ _scrollPos = ELEM.getScrollPosition(0),
435
+ x = Event.pointerX(e) - _scrollPos[0],
436
+ y = Event.pointerY(e) - _scrollPos[1],
436
437
  _currentlyDragging = _this.flushMouseMove(x, y);
437
438
  _this.status[_this.crsrX] = x;
438
439
  _this.status[_this.crsrY] = y;
@@ -988,7 +989,7 @@ EVENT = {
988
989
  }
989
990
  }
990
991
  // Insert key to the realtime array, remove in keyUp
991
- if (_this.status[_this.keysDown].indexOf(_keyCode) === -1) {
992
+ if (_this.isKeyDown(_keyCode)) {
992
993
  _this.status[_this.keysDown].push(_keyCode);
993
994
  }
994
995
  if (!_this.status[_this.cmdKeyDown] && _stopEvent){
@@ -1037,12 +1038,36 @@ EVENT = {
1037
1038
  _this.status[_this.cmdKeyDown] = false;
1038
1039
  }
1039
1040
  // Remove the key from the realtime array, inserted in keyDown
1040
- _keyCodeIndex = _this.status[_this.keysDown].indexOf(_keyCode);
1041
- if (_keyCodeIndex !== -1) {
1041
+ if(!_this.isKeyDown(_keyCode)){
1042
+ _keyCodeIndex = _this.status[_this.keysDown].indexOf(_keyCode);
1042
1043
  _this.status[_this.keysDown].splice(_keyCodeIndex, 1);
1043
1044
  }
1044
1045
  },
1045
1046
 
1047
+ isKeyDown: function(_keyCode){
1048
+ return ( this.status[this.keysDown].indexOf(_keyCode) !== -1 );
1049
+ },
1050
+
1051
+ isKeyUp: function(_keyCode){
1052
+ return !this.isKeyDown(_keyCode);
1053
+ },
1054
+
1055
+ isAltKeyDown: function(){
1056
+ return this.status[this.altKeyDown];
1057
+ },
1058
+
1059
+ isCtrlKeyDown: function(){
1060
+ return this.status[this.ctrlKeyDown];
1061
+ },
1062
+
1063
+ isShiftKeyDown: function(){
1064
+ return this.status[this.shiftKeyDown];
1065
+ },
1066
+
1067
+ isMetaKeyDown: function(){
1068
+ return this.status[this.metaKeyDown];
1069
+ },
1070
+
1046
1071
  /* The keyPress itself is ignored per se and used only as a repetition event for the last keyDown. */
1047
1072
  keyPress: function(e) {
1048
1073
  var
@@ -1464,7 +1464,7 @@ HView = HClass.extend({
1464
1464
  if(!this.views && !this.isProduction){
1465
1465
  console.log('HView#die: no subviews for component name: ',this.componentName,', self:',this);
1466
1466
  }
1467
- while (this.views.length !== 0) {
1467
+ while (this.views && this.views.length !== 0) {
1468
1468
  _childViewId = this.views[0];
1469
1469
  this.destroyView(_childViewId);
1470
1470
  }
@@ -76,6 +76,13 @@ HListItems = HValueResponder.extend({
76
76
  var
77
77
  HListItemControl = HControl.extend({
78
78
 
79
+ constructor: function( _rect, _parent, _options ){
80
+ this.base( _rect, _parent, _options );
81
+ if( this.options.listItems && this.options.listItems instanceof Array ){
82
+ this.setListItems( this.options.listItems );
83
+ }
84
+ },
85
+
79
86
  _cleanListItems: function(_listItemsIn){
80
87
  var _listItems = [],
81
88
  _row, _rowType,
@@ -29,6 +29,7 @@ HMiniMenu = HRadioButtonList.extend({
29
29
  },
30
30
 
31
31
  repositionMenuItems: function(){
32
+ if(!this.listItems || (this.listItems && !this.listItems.length)){ return; }
32
33
  var
33
34
  x = this.pageX(),
34
35
  y = this.pageY(),
@@ -95,18 +96,12 @@ HMiniMenu = HRadioButtonList.extend({
95
96
  },
96
97
 
97
98
  lostActiveStatus: function(_newActive){
98
- // console.log('menu lost active status',_newActive);
99
99
  if( !_newActive.isChildOf( this.menuItemView ) ){
100
100
  this.menuHide();
101
101
  }
102
102
  this.base(_newActive);
103
103
  },
104
104
 
105
- gainedActiveStatus: function(_prevActive){
106
- // console.log('menu gained active status',_prevActive);
107
- this.base(_prevActive);
108
- },
109
-
110
105
  endDrag: function(x,y){
111
106
  if( (Math.round(this.dragStart[0]*0.2)===Math.round(x*0.2)) &&
112
107
  (Math.round(this.dragStart[1]*0.2)===Math.round(y*0.2))
@@ -154,7 +149,7 @@ HMiniMenu = HRadioButtonList.extend({
154
149
  this.valueMatrix = this.menuItemView.valueMatrix;
155
150
  this.refreshValue();
156
151
  if( this.options.initialVisibility ){
157
- EVENT.changeActiveControl(this);
152
+ EVENT.changeActiveControl(null);
158
153
  this.menuShow();
159
154
  }
160
155
  },
@@ -95,6 +95,7 @@ module RSence
95
95
  end
96
96
  sleep 0.1 until client_pkg.ready?
97
97
  client_pkg.add_packages( @client_pkgs[:packages ] ) if @client_pkgs.has_key?(:packages )
98
+ client_pkg.add_compounds( @client_pkgs[:compound_packages] ) if @client_pkgs.has_key?(:compound_packages)
98
99
  client_pkg.add_themes( @client_pkgs[:theme_names ] ) if @client_pkgs.has_key?(:theme_names )
99
100
  client_pkg.add_gfx_formats( @client_pkgs[:gfx_formats ] ) if @client_pkgs.has_key?(:gfx_formats )
100
101
  client_pkg.add_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
@@ -117,6 +118,7 @@ module RSence
117
118
  client_pkg.del_reserved_names( @client_pkgs[:reserved_names] ) if @client_pkgs.has_key?(:reserved_names)
118
119
  client_pkg.del_gfx_formats( @client_pkgs[:gfx_formats ] ) if @client_pkgs.has_key?(:gfx_formats )
119
120
  client_pkg.del_themes( @client_pkgs[:theme_names ] ) if @client_pkgs.has_key?(:theme_names )
121
+ client_pkg.del_compounds( @client_pkgs[:compound_packages] ) if @client_pkgs.has_key?(:compound_packages)
120
122
  client_pkg.del_packages( @client_pkgs[:packages].keys ) if @client_pkgs.has_key?(:packages )
121
123
  client_pkg.rebuild_client
122
124
  end
@@ -112,6 +112,11 @@ class ClientPkgPlugin < Servlet
112
112
  def del_package( pkg_name ); @client_build.del_package( pkg_name ); end
113
113
  def del_packages( packages ); @client_build.del_packages( packages ); end
114
114
 
115
+ def add_compound( compound_name, pkg_names ); @client_build.add_compound( compound_name, pkg_names ); end
116
+ def add_compounds( compounds ); @client_build.add_compounds( compounds ); end
117
+ def del_compound( compound_name ); @client_build.del_compound( compound_name ); end
118
+ def del_compounds( compounds ); @client_build.del_compounds( compounds ); end
119
+
115
120
  def add_reserved_name( reserved_name ); @client_build.add_reserved_name( reserved_name ); end
116
121
  def add_reserved_names( reserved_names ); @client_build.add_reserved_names( reserved_names ); end
117
122
  def del_reserved_name( reserved_name ); @client_build.del_reserved_name( reserved_name ); end
@@ -213,7 +213,7 @@ class ClientPkgBuild
213
213
  begin
214
214
  coffee_src = read_file( src_path )
215
215
  js_data = CoffeeScript.compile( coffee_src, :bare => true )
216
- rescue CoffeeScript::CompilationError
216
+ rescue CoffeeScript::CompilationError, ExecJS::RuntimeError
217
217
  if has_js
218
218
  js_data = %{console.log( "WARNING: CoffeeScript complilation failed for source file #{src_path.to_json}, using the js variant instead." );}
219
219
  js_data += read_file( File.join( bundle_path, bundle_name+'.js' ) )
@@ -436,13 +436,15 @@ class ClientPkgBuild
436
436
  @logger.log( "Compound package..............: Source | Minimized | GNUZipped" )
437
437
  @logger.log( " : | |" )
438
438
  end
439
- @compound_config.each do |pkg_name, js_order|
439
+ @compounds.each do |pkg_name, js_order|
440
440
  js_size = 0
441
441
  pkg_parts = []
442
442
  js_order.each do |js_pkg|
443
443
  pkg_part = @js[ js_pkg ]
444
444
  pkg_parts.push( pkg_part )
445
- js_size += ( @package_origsizes[ js_pkg ] or @destination_origsize[ js_pkg ] )
445
+ pkg_size = ( @package_origsizes[ js_pkg ] or @destination_origsize[ js_pkg ] or 0 )
446
+ warn "nil pkg size of: #{js_pkg}" if pkg_size.nil?
447
+ js_size += pkg_size.nil? ? 0 : pkg_size
446
448
  end
447
449
  js_src = pkg_parts.join("\n")
448
450
  @js[ pkg_name ] = js_src
@@ -623,6 +625,27 @@ class ClientPkgBuild
623
625
  packages.each { |pkg_name| del_package( pkg_name ) }
624
626
  end
625
627
 
628
+ def add_compound( compound_name, pkg_names )
629
+ if @compounds.has_key?( compound_name )
630
+ warn "Compound #{compound_name} already exists, ignoring."
631
+ else
632
+ @compounds[ compound_name ] = pkg_names
633
+ end
634
+ end
635
+ def add_compounds( compounds )
636
+ compounds.each do | compound_name, pkg_names |
637
+ add_compound( compound_name, pkg_names )
638
+ end
639
+ end
640
+ def del_compound( compound_name )
641
+ if @compounds.has_key?( compound_name )
642
+ @compounds.delete( compound_name )
643
+ end
644
+ end
645
+ def del_compounds( compounds )
646
+ compounds.each { |compound_name| del_compound( compound_name ) }
647
+ end
648
+
626
649
  def add_reserved_name( reserved_name )
627
650
  @reserved_names.push( reserved_name ) unless @reserved_names.include? reserved_name
628
651
  end
@@ -719,7 +742,7 @@ class ClientPkgBuild
719
742
  @no_whitespace_removal = config[:no_whitespace_removal]
720
743
  @debug = RSence.args[:debug]
721
744
  @quiet = (not RSence.args[:verbose] and RSence.args[:suppress_build_messages])
722
- @compound_config = config[:compound_packages]
745
+ @compounds = config[:compound_packages]
723
746
  end
724
747
 
725
748
  def find_newer( src_dir, newer_than, quiet=false )
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-04-28 00:00:00.000000000 Z
13
+ date: 2012-05-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsence-deps