rsence-pre 2.2.0.25 → 2.2.0.26

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.0.25.pre
1
+ 2.2.0.26.pre
@@ -40,13 +40,14 @@ HTimeSheet = HControl.extend({
40
40
  autoLabel: false, // automatically set the label to the date
41
41
  autoLabelFn: 'formatDate',
42
42
  autoLabelFnOptions: { longWeekDay: true },
43
- notchesPerHour: 4, // by default 1/4 of an hour precision (15 minutes)
43
+ notchesPerHour: 4, // by default 1/4 of an hour precision (15 minutes)
44
44
  itemOffsetLeft: 64, // Theme settings; don't enter in options
45
45
  itemOffsetRight: 0, // Theme settings; don't enter in options
46
46
  itemOffsetTop: 20, // Theme settings; don't enter in options
47
47
  itemOffsetBottom: 0, // Theme settings; don't enter in options
48
48
  itemDisplayTime: true,
49
49
  allowClickCreate: false,
50
+ allowDoubleClickCreate: true,
50
51
  minDragSize: 5, // minimum amount of pixels dragged required for accepting a drag
51
52
  hourOffsetTop: -4, // Theme settings; don't enter in options
52
53
  constructor: function( _ctrl ){
@@ -231,7 +232,7 @@ HTimeSheet = HControl.extend({
231
232
  start: 0,
232
233
  duration: _minDuration,
233
234
  // locked: false,
234
- color: '#c00'
235
+ color: '#cc0000'
235
236
  };
236
237
  this.dragPreviewRect = this.rectFromValue({start:_options.timeStart,duration:_minDuration});
237
238
  this.minDuration = _minDuration;
@@ -246,13 +247,46 @@ HTimeSheet = HControl.extend({
246
247
  this.dragPreview.setStyleOfPart('state','color','#fff');
247
248
  },
248
249
 
249
- // event listener for clicks, cancels event if a drag event mistakenly triggered it
250
+ // event listener for clicks, simulates double clicks in case of not double click aware browser
250
251
  click: function( x, y, b ){
251
- if( !this.startDragTime ){
252
+ var
253
+ prevClickTime = false,
254
+ notCreated = !this.clickCreated && !this.doubleClickCreated && !this.dragCreated;
255
+ // this.doubleClickSimCreated = false;
256
+ if( !this.startDragTime && this.prevClickTime ){
257
+ prevClickTime = this.prevClickTime;
258
+ }
259
+ else if (this.startDragTime){
260
+ prevClickTime = this.startDragTime;
261
+ }
262
+ if( notCreated && this.options.allowClickCreate ){
263
+ // console.log('click create');
252
264
  this.clickCreate( x,y );
253
265
  this.clickCreated = true;
266
+ this.doubleClickCreated = false;
267
+ this.prevClickTime = false;
268
+ }
269
+ else if( notCreated && this.options.allowDoubleClickCreate ){
270
+ var
271
+ currTime = new Date().getTime(),
272
+ timeDiff = prevClickTime?(currTime - prevClickTime):-1;
273
+ if( timeDiff > 150 && timeDiff < 500 && !this.doubleClickCreated ){
274
+ // console.log('click double create');
275
+ this.clickCreate( x, y );
276
+ this.clickCreated = false;
277
+ this.doubleClickCreated = true;
278
+ this.doubleClickSimCreated = true;
279
+ }
280
+ else {
281
+ this.doubleClickCreated = false;
282
+ }
283
+ this.prevClickTime = currTime;
284
+ }
285
+ else {
286
+ this.clickCreated = false;
287
+ this.doubleClickCreated = false;
288
+ this.prevClickTime = false;
254
289
  }
255
- this.clickCreated = false;
256
290
  },
257
291
 
258
292
  // creates an item on click
@@ -271,12 +305,25 @@ HTimeSheet = HControl.extend({
271
305
  }
272
306
  },
273
307
 
274
- // event listener for double clicks, simulates two sequential clicks
308
+ // event listener for double clicks
275
309
  doubleClick: function(x,y){
276
- if( !this.clickCreated ){
310
+ this.prevClickTime = false;
311
+ this.doubleClickCreated = false;
312
+ var notCreated = !this.clickCreated && !this.doubleClickCreated && !this.doubleClickSimCreated && !this.dragCreated;
313
+ if( !this.options.allowDoubleClickCreate && this.options.allowClickCreate && notCreated ){
277
314
  this.click(x,y);
278
315
  }
279
- this.clickCreated = false;
316
+ else if ( this.options.allowDoubleClickCreate && !this.options.allowClickCreate && notCreated ){
317
+ // console.log('double click create');
318
+ this.clickCreate( x, y );
319
+ this.clickCreated = false;
320
+ this.doubleClickCreated = true;
321
+ }
322
+ else {
323
+ // console.log('no double click create');
324
+ this.clickCreated = false;
325
+ }
326
+ this.doubleClickSimCreated = false;
280
327
  },
281
328
 
282
329
  // update the preview area
@@ -294,6 +341,7 @@ HTimeSheet = HControl.extend({
294
341
 
295
342
  // drag & drop event listeners, used for dragging new timesheet items
296
343
  startDrag: function( x, y, b ){
344
+ // console.log('st');
297
345
  this._startDragY = y;
298
346
  this.startDragTime = this.pxToTime( y-this.pageY() );
299
347
  this.refreshDragPreview( this.startDragTime, this.startDragTime + this.minDuration );
@@ -303,6 +351,7 @@ HTimeSheet = HControl.extend({
303
351
  },
304
352
 
305
353
  drag: function( x, y, b ){
354
+ // console.log('dr');
306
355
  var
307
356
  _dragTime = this.pxToTime( y-this.pageY() ),
308
357
  _startTime,
@@ -320,21 +369,31 @@ HTimeSheet = HControl.extend({
320
369
  },
321
370
 
322
371
  endDrag: function( x, y, b ){
372
+ // console.log('ed');
323
373
  var
324
374
  _dragTime = this.pxToTime( y-this.pageY() ),
325
375
  _minDistanceSatisfied = Math.abs( this._startDragY - y ) >= this.options.minDragSize;
326
- if( this.options.allowClickCreate ){
327
- _minDistanceSatisfied = true;
328
- }
376
+ // if( this.options.allowClickCreate ){
377
+ // _minDistanceSatisfied = true;
378
+ // }
329
379
  this.dragPreview.hide();
330
- if( _dragTime !== this.startDragTime && _minDistanceSatisfied ){
331
- if( this.activateEditor( this.dragPreview ) ){
332
- this.editor.createItem( HVM.clone( this.dragPreview.value ) );
333
- return true;
380
+ if( _dragTime !== this.startDragTime ){
381
+ if( _minDistanceSatisfied ){
382
+ if( this.activateEditor( this.dragPreview ) ){
383
+ // console.log('drag create');
384
+ this.dragCreated = true;
385
+ this.editor.createItem( HVM.clone( this.dragPreview.value ) );
386
+ return true;
387
+ }
334
388
  }
389
+ this.dragCreated = false;
390
+ }
391
+ else {
392
+ this.dragCreated = false;
335
393
  this.clickCreated = false;
336
394
  this.startDragTime = false;
337
395
  this.click( x, y, b );
396
+ return true;
338
397
  }
339
398
  return false;
340
399
  },
@@ -18,10 +18,15 @@ HMiniMenu = HRadioButtonList.extend({
18
18
 
19
19
  defaultEvents: {
20
20
  draggable: true,
21
- click: true
21
+ click: true,
22
+ resize: true
22
23
  },
23
24
 
24
25
  subComponentHeight: 15,
26
+
27
+ resize: function(){
28
+ this.repositionMenuItems();
29
+ },
25
30
 
26
31
  repositionMenuItems: function(){
27
32
  var
@@ -171,7 +171,11 @@ module RSence
171
171
  puts
172
172
  puts "plugin: #{eval_repl}"
173
173
  puts
174
- err_msg = err_msg.gsub(/^\t\(eval\)\:/s,"\t#{eval_repl}:")
174
+ begin
175
+ err_msg = err_msg.gsub(/^\t\(eval\)\:/s,"\t#{eval_repl}:")
176
+ rescue Encoding::CompatibilityError => e
177
+ $stderr.write( "Encoding::CompatibilityError in plugin error eval!" )
178
+ end
175
179
  end
176
180
  $stderr.write( err_msg )
177
181
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsence-pre
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0.25
4
+ version: 2.2.0.26
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-21 00:00:00.000000000 Z
13
+ date: 2011-11-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rsence-deps
17
- requirement: &70129073305800 !ruby/object:Gem::Requirement
17
+ requirement: &70150946678940 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - =
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: '964'
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70129073305800
25
+ version_requirements: *70150946678940
26
26
  description: ! 'RSence is a different and unique development model and software frameworks
27
27
  designed first-hand for real-time web applications. RSence consists of separate,
28
28
  but tigtly integrated data- and user interface frameworks.