right-rails 0.4.4 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. data/init.rb +37 -8
  2. data/javascripts/right-autocompleter-src.js +55 -41
  3. data/javascripts/right-autocompleter.js +2 -2
  4. data/javascripts/right-behavior-src.js +5 -5
  5. data/javascripts/right-behavior.js +2 -2
  6. data/javascripts/right-calendar-src.js +139 -67
  7. data/javascripts/right-calendar.js +2 -2
  8. data/javascripts/right-dnd-src.js +7 -7
  9. data/javascripts/right-dnd.js +2 -2
  10. data/javascripts/right-effects-src.js +9 -9
  11. data/javascripts/right-effects.js +2 -2
  12. data/javascripts/right-events-src.js +8 -8
  13. data/javascripts/right-events.js +2 -2
  14. data/javascripts/right-in-edit-src.js +10 -8
  15. data/javascripts/right-in-edit.js +2 -2
  16. data/javascripts/right-json-src.js +14 -15
  17. data/javascripts/right-json.js +2 -2
  18. data/javascripts/right-lightbox-src.js +141 -86
  19. data/javascripts/right-lightbox.js +3 -3
  20. data/javascripts/right-olds-src.js +26 -48
  21. data/javascripts/right-olds.js +2 -2
  22. data/javascripts/right-rails-src.js +109 -31
  23. data/javascripts/right-rails.js +2 -2
  24. data/javascripts/right-rater-src.js +20 -12
  25. data/javascripts/right-rater.js +2 -2
  26. data/javascripts/right-selectable-src.js +3 -3
  27. data/javascripts/right-selectable.js +1 -1
  28. data/javascripts/right-slider-src.js +3 -3
  29. data/javascripts/right-slider.js +1 -1
  30. data/javascripts/right-sortable-src.js +28 -28
  31. data/javascripts/right-sortable.js +2 -2
  32. data/javascripts/right-src.js +612 -405
  33. data/javascripts/right-tabs-src.js +115 -44
  34. data/javascripts/right-tabs.js +2 -2
  35. data/javascripts/right-tooltips-src.js +131 -74
  36. data/javascripts/right-tooltips.js +2 -2
  37. data/javascripts/right-ui-i18n-fr.js +4 -4
  38. data/javascripts/right-uploader-src.js +170 -0
  39. data/javascripts/right-uploader.js +9 -0
  40. data/javascripts/right.js +2 -4
  41. data/lib/right_rails.rb +1 -1
  42. data/lib/right_rails/helpers/basic.rb +10 -2
  43. data/lib/right_rails/helpers/misc.rb +16 -17
  44. data/lib/right_rails/helpers/rails.rb +0 -7
  45. data/spec/lib/right_rails/helpers/basic_spec.rb +0 -1
  46. data/spec/lib/right_rails/helpers/rails_spec.rb +24 -0
  47. data/spec/spec_helper.rb +9 -1
  48. metadata +14 -5
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * Unified tabs engine for RightJS (http://rightjs.org/ui/tabs)
3
3
  *
4
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
4
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
5
5
  */
6
6
  if (!RightJS) throw "Gimme RightJS";
7
7
  /**
8
8
  * The basic tabs handling engine
9
9
  *
10
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
10
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
11
11
  */
12
12
  var Tabs = new Class(Observer, {
13
13
  extend: {
@@ -151,7 +151,7 @@ var Tabs = new Class(Observer, {
151
151
  /**
152
152
  * A single tab handling object
153
153
  *
154
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
154
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
155
155
  */
156
156
  Tabs.Tab = new Class({
157
157
  extend: {
@@ -261,7 +261,7 @@ Tabs.Tab = new Class({
261
261
  /**
262
262
  * The tab panels behavior logic
263
263
  *
264
- * Copyright (C) Nikolay V. Nemshilov aka St.
264
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
265
265
  */
266
266
  Tabs.Panel = new Class(Observer, {
267
267
 
@@ -274,15 +274,26 @@ Tabs.Panel = new Class(Observer, {
274
274
  // shows the panel
275
275
  show: function() {
276
276
  return this.resizing(function() {
277
- this.element.radioClass('right-tabs-panel-current');
277
+ this.tab.controller.tabs.each(function(tab) {
278
+ var element = tab.panel.element;
279
+ element[element == this.element ?
280
+ 'addClass' : 'removeClass']('right-tabs-panel-current');
281
+ }, this);
278
282
  });
279
283
  },
280
284
 
281
285
  // updates the panel content
282
286
  update: function(content) {
283
- return this.resizing(function() {
287
+ // don't use resize if it's some other hidden tab was loaded asynch
288
+ if (this.tab.current()) {
289
+ this.resizing(function() {
290
+ this.element.update(content||'');
291
+ });
292
+ } else {
284
293
  this.element.update(content||'');
285
- });
294
+ }
295
+
296
+ return this;
286
297
  },
287
298
 
288
299
  // removes the pannel
@@ -293,34 +304,28 @@ Tabs.Panel = new Class(Observer, {
293
304
 
294
305
  // locks the panel with a spinner locker
295
306
  lock: function() {
296
- var locker = $E('div', {'class': 'right-tabs-panel-locker'});
297
- var spinner = $E('div', {'class': 'right-tabs-panel-locker-spinner'}).insertTo(locker);
298
- var dots = '1234'.split('').map(function(i) {
299
- return $E('div', {'class': i == 1 ? 'glow':null}).insertTo(spinner);
300
- });
301
-
302
- (function() {
303
- spinner.insert(dots.last(), 'top');
304
- dots.unshift(dots.pop());
305
- }).periodical(400);
306
-
307
- this.element.insert(locker, 'top');
307
+ this.element.insert(this.locker(), 'top');
308
308
  },
309
309
 
310
310
  // protected
311
311
 
312
312
  resizing: function(callback) {
313
- if (Tabs.__working) return this.resizing.bind(this, callback).delay(20);
314
-
315
313
  var controller = this.tab.controller;
314
+
315
+ if (controller.__working) return this.resizing.bind(this, callback).delay(100);
316
+
316
317
  var options = controller.options;
317
318
  var prev_panel = controller.element.first('.right-tabs-panel-current');
318
319
  var this_panel = this.element;
319
320
  var swapping = prev_panel != this_panel;
320
321
  var loading = this.element.first('div.right-tabs-panel-locker');
321
322
 
323
+ // sometimes it looses the parent on remote tabs
324
+ if (this_panel.parentNode.hasClass('right-tabs-resizer')) this_panel.insertTo(prev_panel.parentNode);
325
+
322
326
  if (options.resizeFx && self.Fx && prev_panel && (swapping || loading)) {
323
- Tabs.__working = true;
327
+ controller.__working = true;
328
+ var unlock = function() { controller.__working = false; };
324
329
 
325
330
  // calculating the visual effects durations
326
331
  var fx_name = (options.resizeFx == 'both' && loading) ? 'slide' : options.resizeFx;
@@ -339,15 +344,17 @@ Tabs.Panel = new Class(Observer, {
339
344
 
340
345
  // getting the new size
341
346
  var new_panel_height = this_panel.offsetHeight;
347
+ var fx_wrapper = null;
342
348
 
343
349
  if (fx_name != 'fade' && prev_panel_height != new_panel_height) {
344
350
  // preserving the whole element size so it didn't jump when we are tossing the tabs around
345
351
  controller.element.style.height = controller.element.offsetHeight + 'px';
346
352
 
347
353
  // wrapping the element with an overflowed element to visualize the resize
348
- var fx_wrapper = $E('div', {'class': 'right-tabs-resizer'});
349
- var set_back = fx_wrapper.replace.bind(fx_wrapper, this_panel);
350
- fx_wrapper.style.height = prev_panel_height + 'px';
354
+ fx_wrapper = $E('div', {
355
+ 'class': 'right-tabs-resizer',
356
+ 'style': 'height: '+ prev_panel_height + 'px'
357
+ });
351
358
 
352
359
  // in case of harmonica nicely hidding the previous panel
353
360
  if (controller.isHarmonica && swapping) {
@@ -367,24 +374,64 @@ Tabs.Panel = new Class(Observer, {
367
374
  // getting back the auto-size so we could resize it
368
375
  controller.element.style.height = 'auto';
369
376
 
370
- if (hide_wrapper) hide_wrapper.morph({height: '0px'}, {duration: resize_duration, onFinish: prev_back});
371
- fx_wrapper.morph({height: new_panel_height + 'px'}, {duration: resize_duration, onFinish: set_back });
372
377
  } else {
373
378
  // removing the resize duration out of the equasion
374
379
  rezise_duration = 0;
375
380
  duration = fade_duration;
376
381
  }
377
382
 
378
- if (fx_name != 'slide')
379
- this_panel.morph.bind(this_panel, {opacity: 1}, {duration: fade_duration}).delay(resize_duration);
383
+ var counter = 0;
384
+ var set_back = function() {
385
+ if (fx_wrapper) {
386
+ if (fx_name == 'both' && !counter)
387
+ return counter ++;
388
+
389
+ fx_wrapper.replace(this_panel);
390
+ }
391
+
392
+ unlock();
393
+ };
394
+
395
+ if (hide_wrapper)
396
+ hide_wrapper.morph({height: '0px'},
397
+ {duration: resize_duration, onFinish: prev_back});
398
+
399
+ if (fx_wrapper)
400
+ fx_wrapper.morph({height: new_panel_height + 'px'},
401
+ {duration: resize_duration, onFinish: set_back});
380
402
 
381
- // removing the working marker
382
- (function() { Tabs.__working = false; }).bind(this).delay(duration);
403
+ if (fx_name != 'slide')
404
+ this_panel.morph.bind(this_panel, {opacity: 1},
405
+ {duration: fade_duration, onFinish: set_back}
406
+ ).delay(resize_duration);
407
+
408
+ if (!fx_wrapper && fx_name == 'slide')
409
+ set_back();
410
+
383
411
  } else {
384
412
  callback.call(this);
385
413
  }
386
414
 
387
415
  return this;
416
+ },
417
+
418
+ // builds the locker element
419
+ locker: function() {
420
+ if (!this._locker) {
421
+ var locker = $E('div', {'class': 'right-tabs-panel-locker'});
422
+ var spinner = $E('div', {'class': 'right-tabs-panel-locker-spinner'}).insertTo(locker);
423
+ var dots = '1234'.split('').map(function(i) {
424
+ return $E('div', {'class': i == 1 ? 'glow':null}).insertTo(spinner);
425
+ });
426
+
427
+ (function() {
428
+ spinner.insert(dots.last(), 'top');
429
+ dots.unshift(dots.pop());
430
+ }).periodical(400);
431
+
432
+ this._locker = locker;
433
+ }
434
+ return this._locker;
388
435
  }
389
436
 
390
437
  });
@@ -397,7 +444,7 @@ Tabs.Panel = new Class(Observer, {
397
444
  * any tab. But the carousel tabs scrolls to the next/previous
398
445
  * tabs on the list.
399
446
  *
400
- * Copyright (C) Nikolay V. Nemshilov aka St.
447
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
401
448
  */
402
449
  Tabs.include((function() {
403
450
  var old_init = Tabs.prototype.init;
@@ -565,7 +612,7 @@ return {
565
612
  /**
566
613
  * This module handles the current tab state saving/restoring processes
567
614
  *
568
- * Copyright (C) Nikolay V. Nemshilov aka St.
615
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
569
616
  */
570
617
  Tabs.include((function() {
571
618
  var old_initialize = Tabs.prototype.initialize;
@@ -649,7 +696,7 @@ return {
649
696
  /**
650
697
  * This module handles the tabs cration and removing processes
651
698
  *
652
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
699
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
653
700
  */
654
701
  Tabs.include({
655
702
  /**
@@ -730,7 +777,7 @@ Tabs.include({
730
777
  /**
731
778
  * This module contains the remote tabs loading logic
732
779
  *
733
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
780
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
734
781
  */
735
782
  Tabs.Tab.include((function() {
736
783
  var old_show = Tabs.Tab.prototype.show;
@@ -739,6 +786,8 @@ return {
739
786
 
740
787
  // wrapping the show mehtod, to catch the remote requests
741
788
  show: function() {
789
+ if (this.dogPiling(arguments)) return this;
790
+
742
791
  var result = old_show.apply(this, arguments);
743
792
  var url = this.link.href;
744
793
  var options = this.controller.options;
@@ -752,20 +801,42 @@ return {
752
801
  this.panel.lock();
753
802
 
754
803
  try { // basically that's for the development tests, so the IE browsers didn't get screwed on the test page
755
-
756
- this.request = Xhr.load(url, options.Xhr).onComplete(function(response) {
757
- this.panel.update(response.text);
804
+
805
+ this.request = new Xhr(url, Object.merge({method: 'get'}, options.Xhr))
806
+ .onComplete(function(response) {
807
+ if (this.controller.__working)
808
+ return arguments.callee.bind(this, response).delay(100);
809
+
810
+ this.panel.update(response.text);
758
811
 
759
- this.request = null; // removing the request marker so it could be rerun
760
- if (options.cache) this.cache = true;
812
+ this.request = null; // removing the request marker so it could be rerun
813
+ if (options.cache) this.cache = true;
761
814
 
762
- this.fire('load');
763
- }.bind(this));
815
+ this.fire('load');
816
+ }.bind(this)
817
+ ).send();
764
818
 
765
819
  } catch(e) { if (!Browser.OLD) throw(e) }
766
820
  }
767
821
 
768
822
  return result;
823
+ },
824
+
825
+ // protected
826
+
827
+ dogPiling: function(args) {
828
+ if (this.controller.__working) {
829
+ if (this.controller.__timeout)
830
+ this.controller.__timeout.cancel();
831
+
832
+ this.controller.__timeout = (function(args) {
833
+ this.show.apply(this, args);
834
+ }).bind(this, args).delay(100);
835
+
836
+ return true;
837
+ }
838
+
839
+ return this.controller.__timeout = null;
769
840
  }
770
841
 
771
842
  }})());
@@ -773,7 +844,7 @@ return {
773
844
  /**
774
845
  * This module handles the slide-show loop feature for the Tabs
775
846
  *
776
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
847
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
777
848
  */
778
849
  Tabs.include((function() {
779
850
  var old_initialize = Tabs.prototype.initialize;
@@ -852,7 +923,7 @@ return {
852
923
  /**
853
924
  * The document level hooks for the tabs-egnine
854
925
  *
855
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
926
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
856
927
  */
857
928
  document.onReady(function() {
858
929
  Tabs.rescan();
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Unified tabs engine for RightJS (http://rightjs.org/ui/tabs)
3
3
  *
4
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
4
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
5
5
  */
6
- if (!RightJS) throw "Gimme RightJS";eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("19 37=135 176(Observer,{extend:{EVENTS:$w('54 hide 160 load 87 116 add 61 move'),Options:{145:'',14Element:74,107:'both',128:400,2537:91,25178:400,142:74,28:[],closable:91,loop:91,loopPause:true,url:91,131:91,Xhr:74,68:74},rescan:16(s){($(s)||102).select('*.13-14').each(16(e){if(!e._14)135 37(e)})}},49:16(e,o){11.17=$(e);11.$super(o||eval('('+11.17.get('data-14-24')+')'));11.17._14=11.init()},destroy:16(){delete(11.17._14)},54:16(t){18 11.94(t,'54')},87:16(t){18 11.94(t,'87')},116:16(t){18 11.94(t,'116')},94:16(t,m){if(isArray(t))t.each(11[m],11);95 if(t=isNumber(t)?11.14[t]:t)t[m]();18 11},init:16(){11.35=11.17.152=='DL';11.42=11.17.144('13-14-62');11.isSimple=!11.35&&!11.42;11.find37();11.17.45('13-14');if(11.isSimple)11.17.45('13-14-52');18 11.87(11.24.28)},find37:16(){11.14175=11.35?11.17:$(11.24.14Element)||11.17.55('UL').45('13-14-75');11.14=11.14175.subNodes(11.35?'dt':74).map(16(n){18 135 37.156(n,11)},11)},173:16(t){19 a=11.24.145+t.id,p;if(11.35){19 n=t.17.next();p=(n&&n.152=='DD')?n:$E('DD').59To(t.17,'after')}95 p=$(a)||$E(11.17.152=='UL'?'LI':'DIV').59To(11.17);18 p.set('id',a)}});37.156=135 176({extend:{autoId:0},49:16(e,c){11.17=e.45('13-14-43');11.33=c;11.17.153(11.160.64(11)).124('s80Event');11.findLink();11.27=135 37.Panel(c.173(11),11);if(c.24.closable)11.174.59($E('72',{'63':'13-14-43-close-icon','html':'&times;'}).153(11.61.64(11)).124('s80Event'))},160:16(e){e.s80();18 11.76('160').54()},54:16(){if(11.51()){19 p=11.33.14.55('26');if(p)p.76('hide');11.17.167('13-14-26');11.33.25To156(11);11.27.54();11.76('54')}18 11},87:16(){11.17.45('13-14-28');18 11.76('87')},116:16(){11.17.61176('13-14-28');18 11.76('116')},28:16(){18!11.51()},51:16(){18!11.17.144('13-14-28')},26:16(){18 11.17.144('13-14-26')},61:16(a){if(a)a.s80();if(11.26()){19 e=11.33.14.47('51');19 s=e[e.65(11)+1]||e[e.65(11)-1];if(s)s.54()}11.33.14.172(11.33.14.65(11),1);11.17.61();11.27.61();18 11},46:16(){18 11.17.84+11.17.113('41Right').165()},76:16(e){11.33.76(e,11);18 11},findLink:16(){11.174=11.17.55('a');11.id=11.174.href.127('#')[1]||(11.33.24.145+(37.156.autoId++))}});37.Panel=135 176(Observer,{49:16(e,t){11.43=t;11.id=e.id;11.17=e.45('13-14-27')},54:16(){18 11.104(16(){11.17.167('13-14-27-26')})},140:16(c){18 11.104(16(){11.17.140(c||'')})},61:16(){11.17.61();18 11},lock:16(){19 l=$E('72',{'63':'13-14-27-67'});19 s=$E('72',{'63':'13-14-27-67-126'}).59To(l);19 d='1234'.127('').map(16(a){18 $E('72',{'63':a==1?'glow':74}).59To(s)});(16(){s.59(d.last(),'80');d.unshift(d.pop())}).169(400);11.17.59(l,'80')},104:16(c){if(37.129)18 11.104.64(11,c).delay(20);19 a=11.43.33;19 o=a.24;19 g=a.17.55('.13-14-27-26');19 t=11.17;19 j=g!=t;19 l=11.17.55('72.13-14-27-67');if(o.107&&self.Fx&&g&&(j||l)){37.129=true;19 b=(o.107=='both'&&l)?'150':o.107;19 d=o.128;d=Fx.178s[d]||d;19 r=b=='fade'?0:b=='150'?d:d/2;19 f=d-r;if(b!='150')t.setStyle({32:0});19 i=(a.35&&j)?0:g.73;c.call(11);19 n=t.73;if(b!='fade'&&i!=n){a.17.86.29=a.17.73+'px';19 e=$E('72',{'63':'13-14-125'});19 s=e.163.64(e,t);e.86.29=i+'px';if(a.35&&j){g.45('13-14-27-26');19 h=$E('72',{'63':'13-14-125'});h.86.29=g.73+'px';19 p=16(){h.163(g.61176('13-14-27-26'))};g.wrap(h);e.86.29='138'}t.wrap(e);a.17.86.29='auto';if(h)h.151({29:'138'},{103:r,onFinish:p});e.151({29:n+'px'},{103:r,onFinish:s})}95{rezise_103=0;d=f}if(b!='150')t.151.64(t,{32:1},{103:f}).delay(r);(16(){37.129=91}).64(11).delay(d)}95 c.call(11);18 11}});37.82((16(){19 d=37.97.init;18{next:16(){18 11.pick156(+1)},prev:16(){18 11.pick156(-1)},25Left:16(){18 11[11.42?'prev':'121'](+0.6)},25Right:16(){18 11[11.42?'next':'121'](-0.6)},init:16(){d.call(11);if(11.25able=(11.24.2537||11.42))11.136();18 11},136:16(){if(!11.17.55('13-14-22')){11.120=$E('72',{'63':'13-14-25-38','html':'&laquo;'}).124(11.25Left.64(11));11.119=$E('72',{'63':'13-14-25-13','html':'&raquo;'}).124(11.25Right.64(11));11.17.59($E('72',{'63':'13-14-22'}).59([11.120,11.119,$E('72',{'63':'13-14-25-147'}).59(11.14175)]),'80')}},pick156:16(p){19 c=11.14.55('26');if(c&&c.51()){19 e=11.14.47('51');19 t=e[e.65(c)+p];if(t)t.54()}},25To156:16(t){if(11.25able){19 b=0;for(19 i=0;i<11.14.92;i++){b+=11.14[i].46();if(11.14[i]==t)break}19 a=11.14175.117.84;19 s=(11.42?(a/2+t.46()/2):a)-b;if(!11.42){19 c=11.14175.113('38').165()||0;if(s>=c&&s<(c+a-t.46()))s=c;95 if(c>-b&&c<=(t.46()-b))s=t.46()-b}11.25To(s)}},121:16(s){19 c=11.14175.113('38').165()||0;19 a=11.14175.117.84;11.25To(c+a*s)},25To:16(s){19 c=11.14175.113('38').165()||0;19 a=11.14175.117.84;19 o=0;for(19 i=0;i<11.14.92;i++)o+=11.14[i].46();if(s<(a-o))s=a-o;if(s>0)s=0;19 b={38:s+'px'};if(11.24.25178&&self.Fx&&c!=s)11.14175.151(b,{103:11.24.25178});95 11.14175.setStyle(b);11.101(o,a,s)},101:16(o,a,s){19 h=110=91;if(11.42){19 e=11.14.47('51');19 c=e.55('26');if(c){19 i=e.65(c);h=i>0;110=i<e.92-1}}95{h=s!=0;110=s>(a-o)}11.120[h?'61176':'45']('13-14-25-28');11.119[110?'61176':'45']('13-14-25-28')}}})());37.82((16(){19 d=37.97.49;19 g=16(){18 self.68?(68.get('13-14-indexes')||'').127(','):[]};19 s=16(o,a,t){if(self.68){19 i=g();i=i.without.157(i,a.map('id'));i.push(t.id);68.set('13-14-indexes',i.uniq().join(','),o)}};18{49:16(){d.157(11,130);11.161();if(11.24.68)11.onShow(s.curry(11.24.68,11.14))},161:16(){19 c;if(11.24.142!==74)c=11.24.142;95{19 e=11.14.47('51');c=e[11.urlIndex()]||e[11.162()]||e.55('26')||e[0]}if(c)c.54()},urlIndex:16(){19 b=-1,a=102.location.href.127('#')[1];if(a)for(19 i=0;i<11.14.92;i++)if(11.14[i].id==a){b=i;break}18 b},162:16(){19 a=-1;if(11.24.68){19 b=g();for(19 i=0;i<11.14.92;i++)if(b.82(11.14[i].id)){a=i;break}}18 a}}})());37.82({add:16(a,c,o){19 o=o||{};19 e=$E(11.35?'dt':'li').59($E('a',{html:a,href:o.url||'#'+(o.id||'')})).59To(11.14175);19 t=135 37.156(e,11);t.27.17.140(c||'');11.14.push(t);if(defined(o.39))11.move(t,o.39);18 11.76('add',t)},move:16(t,p){19 t=11.14[t]||t;if(11.14[p]&&11.14[p]!==t){11.14[p].17.59(t.17,(p==11.14.92-1)?'after':'before');if(11.35)t.17.59(t.27.17,'after');11.14.172(11.14.65(t),1);11.14.172(p,0,t);11.76('move',t,p)}18 11},61:16(t){18 11.94(t,'61')}});37.156.82((16(){19 b=37.156.97.54;18{54:16(){19 a=b.157(11,130);19 u=11.174.href;19 o=11.33.24;if(u.82s('#'))u=o.url?o.url.163('%{id}',u.127('#')[1]):74;if(u&&!11.164&&!(o.131||11.131)){11.27.lock();try{11.164=Xhr.load(u,o.Xhr).onComplete(16(r){11.27.140(r.133);11.164=74;if(o.131)11.131=true;11.76('load')}.64(11))}catch(e){if(!Browser.OLD)throw(e)}}18 a}}})());37.82((16(){19 o=37.97.49;18{49:16(){o.157(11,130);if(11.24.loop)11.134()},134:16(d){if(!d&&!11.24.loop)18 11;if(11.24.loopPause){11._s80177=11._s80177||11.s80177.64(11,true);11.70=11.70||11.134.64(11,d);11.98().on({mouseover:11._s80177,mouseout:11.70})}if(11.108)11.108.s80();11.108=16(){19 e=11.14.47('51');19 c=11.14.55('26');19 n=e[e.65(c)+1];11.54(n||e.55())}.64(11).169(11.24.loop||d);18 11},s80177:16(e,p){if(11.108){11.108.s80();11.108=74}if(!p&&11.70)11.98()},98:16(){18 11.17.s80Observing('mouseover',11._s80177).s80Observing('mouseout',11.70)}}})());102.onReady(16(){37.rescan()});102.write(\"<86 type=\\\"133/css\\\">.13-14,.13-14 .13-14-75,.13-14 .13-14-43,.13-14 .13-14-27,.13-14-25-38,.13-14-25-13,.13-14-25-147,.13-14-27-67,.13-14-125{41:0;57:0;30:78;21:78;75-86:78;69:132;46:auto;29:auto}.13-14{21-48:93 114 #122}.13-14-125{141:hidden}.13-14-43,.13-14-43 a{69:132;float:38}.13-14-43 a{39:71;115:154;133-decoration:78;21:93 114 #122;30:#DDD;56:#444;-111-21-31:.3em;-58-21-31:.3em}.13-14-43 a:79{21-56:#122;30:#EEE}.13-14 .13-14-75 .13-14-26 a,dl.13-14 dt.13-14-26 a{font-weight:bold;56:#000;30:#FFF}.13-14-43 a 158{21:78;32:.6;47:105(32=60)}.13-14-43 a:79 158,.13-14 .13-14-75 .13-14-26 a 158{32:1;47:105(32=137)}.13-14-28,.13-14-28 a,.13-14-28 a:79{30:#EEE;21-56:#DDD;56:#AAA;115:default}.13-14-28 a 158,.13-14-28 a:79 158{32:.5;47:105(32=50)}.13-14-43-close-icon{69:in148-132;*69:in148;*zoom:1;41-13:-0.5em;41-38:0.5em;115:154;32:0.5;47:105(32=50)}.13-14-43-close-icon:79{32:1;47:105(32=137);56:#B00;133-shadow:#888 .15em .15em .109}.13-14 .13-14-27{69:78;39:71;min-29:4em;57:.5em 0}.13-14 .13-14-27-26{69:132}.13-14-27-67{39:143;80:138;38:138;32:0.5;47:105(32=50);30:#122;46:137%;29:137%;133-align:center;148-29:137%}.13-14-27-67-126{39:143;38:44%;80:44%}.13-14-27-67-126 72{float:38;30:#777;46:.5em;29:112;41-13:.112;-111-21-31:.112;-58-21-31:.112}.13-14-27-67-126 72.glow{30:#444;29:1.109;41-80:-0.112}.13-14 .13-14-22{57:0 1.4em;39:71;41-48:.5em}.13-14 .13-14-22 .13-14-25-38,.13-14 .13-14-22 .13-14-25-13{46:1.112;133-align:center;30:#EEE;56:#666;115:154;21:93 114 #122;-111-21-31:.109;-58-21-31:.109;39:143;80:138;38:138;z-index:137}.13-14 .13-14-22 .13-14-25-38:79,.13-14 .13-14-22 .13-14-25-13:79{56:#000;30:#DDD;21-56:#AAA}.13-14 .13-14-22 .13-14-25-13{38:auto;13:138}.13-14 .13-14-22 .13-14-25-28,.13-14 .13-14-22 .13-14-25-28:79{115:default;30:#DDD;21-56:#DDD;56:#AAA}.13-14 .13-14-22 .13-14-25-147{46:137%;141:hidden;39:71;z-index:50}.13-14 .13-14-22 .13-14-75{39:71;46:999em;41:0}.13-14-52 .13-14-75{29:109;57:0 112;21-48:93 114 #122}.13-14-52 .13-14-43{41-80:-93;41-13:93}.13-14-52 .13-14-43 a{148-29:1.8em;41-80:.109;57:0 112;21-48:78;-111-21-31-4838:0;-111-21-31-4813:0;-58-21-48-38-31:0;-58-21-48-13-31:0}.13-14-52 .13-14-75 .13-14-26 a{148-29:109;41-80:93}.13-14-52 .13-14-22{21-48:93 114 #122}.13-14-52 .13-14-22 .13-14-25-38,.13-14-52 .13-14-22 .13-14-25-13{148-29:1.8em;80:.109;-111-21-31-4838:0;-111-21-31-4813:0;-58-21-48-38-31:0;-58-21-48-13-31:0}.13-14-52 .13-14-22 .13-14-25-147{39:71;80:93}.13-14-52 .13-14-22 .13-14-25-147 .13-14-75{57:0}.13-14-62 .13-14-75,.13-14-62 .13-14-43 a,.13-14-62 .13-14-22 .13-14-25-38,.13-14-62 .13-14-22 .13-14-25-13{29:6em;148-29:6em}.13-14-62 .13-14-43{41-13:2px}.13-14-62 .13-14-43 a 158{21:93 114 #122;41:.4em;57:0}dl.13-14{141:78;21:78}dt.13-14-43,dt.13-14-43 a{69:132;float:78}dt.13-14-43 a{57:.109 112}dl.13-14 dt.13-14-26 a{30:#EEE;-111-21-31-4838:0;-111-21-31-4813:0;-58-21-48-38-31:0;-58-21-48-13-31:0}</86>\");",",,,,,,,,,,,this,,right,tabs,,function,element,return,var,,border,scroller,,options,scroll,current,panel,disabled,height,background,radius,opacity,controller,,isHarmonica,tabsList,Tabs,left,position,,margin,isCarousel,tab,,addClass,width,filter,bottom,initialize,,enabled,simple,,show,first,color,padding,webkit,insert,,remove,carousel,class,bind,indexOf,,locker,Cookie,display,_startLoop,relative,div,offsetHeight,null,list,fire,,none,hover,top,,include,,offsetWidth,removeClass,style,disable,,insertTo,scrollDuration,false,length,1px,callTab,else,_stopLoop,prototype,forgetHovers,,,checkScrollButtons,document,duration,resizing,alpha,bottomright,resizeFx,timer,2em,has_next,moz,1em,getStyle,solid,cursor,enable,parentNode,bottomleft,nextButton,prevButton,justScroll,CCC,,onClick,resizer,spinner,split,resizeDuration,__working,arguments,cache,block,text,startLoop,new,buildScroller,100,0px,stopObserving,update,overflow,selected,absolute,hasClass,idPrefix,scrollTo,body,line,scrollToTab,slide,morph,tagName,onMousedown,pointer,tabsElement,Tab,apply,img,pickTab,click,findCurrent,cookieIndex,replace,request,toInt,scrollRight,radioClass,scrollTabs,periodical,scrollable,scrollLeft,splice,findPanel,link,List,Class,Loop,Duration".split(",")));
6
+ if (!RightJS) throw "Gimme RightJS";eval((function(s,d){for(var i=d.length-1;i>-1;i--)if(d[i])s=s.replace(new RegExp(i,'g'),d[i]);return s})("19 42=129 174(Observer,{extend:{EVENTS:$w('49 hide 156 load 87 124 add 57 move'),Options:{147:'',14Element:68,117:'both',134:400,2642:94,26176:400,145:68,28:[],closable:94,loop:94,loopPause:151,url:94,138:94,Xhr:68,72:68},rescan:16(s){($(s)||107).select('*.13-14').each(16(e){if(!e._14)129 42(e)})}},47:16(e,o){11.17=$(e);11.$super(o||eval('('+11.17.get('data-14-25')+')'));11.17._14=11.init()},destroy:16(){delete(11.17._14)},49:16(t){18 11.96(t,'49')},87:16(t){18 11.96(t,'87')},124:16(t){18 11.96(t,'124')},96:16(t,m){if(isArray(t))t.each(11[m],11);93 if(t=isNumber(t)?11.14[t]:t)t[m]();18 11},init:16(){11.35=11.17.162=='DL';11.43=11.17.118('13-14-59');11.isSimple=!11.35&&!11.43;11.find42();11.17.41('13-14');if(11.isSimple)11.17.41('13-14-53');18 11.87(11.25.28)},find42:16(){11.14173=11.35?11.17:$(11.25.14Element)||11.17.54('UL').41('13-14-83');11.14=11.14173.subNodes(11.35?'dt':68).map(16(n){18 129 42.164(n,11)},11)},find177:16(t){19 a=11.25.147+t.id,p;if(11.35){19 n=t.17.next();p=(n&&n.162=='DD')?n:$E('DD').62To(t.17,'after')}93 p=$(a)||$E(11.17.162=='UL'?'LI':'DIV').62To(11.17);18 p.set('id',a)}});42.164=129 174({extend:{autoId:0},47:16(e,c){11.17=e.41('13-14-38');11.21=c;11.17.160(11.156.69(11)).130('s89Event');11.findLink();11.27=129 42.177(c.find177(11),11);if(c.25.closable)11.link.62($E('78',{'65':'13-14-38-close-icon','html':'&times;'}).160(11.57.69(11)).130('s89Event'))},156:16(e){e.s89();18 11.84('156').49()},49:16(){if(11.51()){19 p=11.21.14.54('24');if(p)p.84('hide');11.17.radio174('13-14-24');11.21.26To164(11);11.27.49();11.84('49')}18 11},87:16(){11.17.41('13-14-28');18 11.84('87')},124:16(){11.17.57174('13-14-28');18 11.84('124')},28:16(){18!11.51()},51:16(){18!11.17.118('13-14-28')},24:16(){18 11.17.118('13-14-24')},57:16(a){if(a)a.s89();if(11.24()){19 e=11.21.14.48('51');19 s=e[e.71(11)+1]||e[e.71(11)-1];if(s)s.49()}11.21.14.splice(11.21.14.71(11),1);11.17.57();11.27.57();18 11},45:16(){18 11.17.86+11.17.114('39Right').155()},84:16(e){11.21.84(e,11);18 11},findLink:16(){11.link=11.17.54('a');11.id=11.link.href.133('#')[1]||(11.21.25.147+(42.164.autoId++))}});42.177=129 174(Observer,{47:16(e,t){11.38=t;11.id=e.id;11.17=e.41('13-14-27')},49:16(){18 11.116(16(){11.38.21.14.each(16(t){19 e=t.27.17;e[e==11.17?'41':'57174']('13-14-27-24')},11)})},122:16(c){if(11.38.24())11.116(16(){11.17.122(c||'')});93 11.17.122(c||'');18 11},57:16(){11.17.57();18 11},lock:16(){11.17.62(11.52(),'89')},116:16(c){19 a=11.38.21;if(a.82)18 11.116.69(11,c).157(103);19 o=a.25;19 i=a.17.54('.13-14-27-24');19 t=11.17;19 k=i!=t;19 l=11.17.54('78.13-14-27-52');if(t.73.118('13-14-98'))t.62To(i.73);if(o.117&&self.Fx&&i&&(k||l)){a.82=151;19 u=16(){a.82=94};19 e=(o.117=='both'&&l)?'135':o.117;19 d=o.134;d=Fx.176s[d]||d;19 r=e=='fade'?0:e=='135'?d:d/2;19 f=d-r;if(e!='135')t.setStyle({32:0});19 j=(a.35&&k)?0:i.79;c.call(11);19 n=t.79;19 g=68;if(e!='fade'&&j!=n){a.17.91.29=a.17.79+'px';g=$E('78',{'65':'13-14-98','91':'29: '+j+'px'});if(a.35&&k){i.41('13-14-27-24');19 h=$E('78',{'65':'13-14-98'});h.91.29=i.79+'px';19 p=16(){h.159(i.57174('13-14-27-24'))};i.wrap(h);g.91.29='141'}t.wrap(g);a.17.91.29='auto'}93{rezise_111=0;d=f}19 b=0;19 s=16(){if(g){if(e=='both'&&!b)18 b++;g.159(t)}u()};if(h)h.169({29:'141'},{111:r,144:p});if(g)g.169({29:n+'px'},{111:r,144:s});if(e!='135')t.169.69(t,{32:1},{111:f,144:s}).157(r);if(!g&&e=='135')s()}93 c.call(11);18 11},52:16(){if(!11._52){19 l=$E('78',{'65':'13-14-27-52'});19 s=$E('78',{'65':'13-14-27-52-131'}).62To(l);19 d='1234'.133('').map(16(a){18 $E('78',{'65':a==1?'glow':68}).62To(s)});(16(){s.62(d.last(),'89');d.unshift(d.pop())}).periodical(400);11._52=l}18 11._52}});42.90((16(){19 d=42.97.init;18{next:16(){18 11.153(+1)},prev:16(){18 11.153(-1)},26Left:16(){18 11[11.43?'prev':'127'](+0.6)},26Right:16(){18 11[11.43?'next':'127'](-0.6)},init:16(){d.call(11);if(11.26able=(11.25.2642||11.43))11.143();18 11},143:16(){if(!11.17.54('13-14-22')){11.125=$E('78',{'65':'13-14-26-36','html':'&laquo;'}).130(11.26Left.69(11));11.128=$E('78',{'65':'13-14-26-13','html':'&raquo;'}).130(11.26Right.69(11));11.17.62($E('78',{'65':'13-14-22'}).62([11.125,11.128,$E('78',{'65':'13-14-26-152'}).62(11.14173)]),'89')}},153:16(p){19 c=11.14.54('24');if(c&&c.51()){19 e=11.14.48('51');19 t=e[e.71(c)+p];if(t)t.49()}},26To164:16(t){if(11.26able){19 b=0;for(19 i=0;i<11.14.95;i++){b+=11.14[i].45();if(11.14[i]==t)break}19 a=11.14173.73.86;19 s=(11.43?(a/2+t.45()/2):a)-b;if(!11.43){19 c=11.14173.114('36').155()||0;if(s>=c&&s<(c+a-t.45()))s=c;93 if(c>-b&&c<=(t.45()-b))s=t.45()-b}11.26To(s)}},127:16(s){19 c=11.14173.114('36').155()||0;19 a=11.14173.73.86;11.26To(c+a*s)},26To:16(s){19 c=11.14173.114('36').155()||0;19 a=11.14173.73.86;19 o=0;for(19 i=0;i<11.14.95;i++)o+=11.14[i].45();if(s<(a-o))s=a-o;if(s>0)s=0;19 b={36:s+'px'};if(11.25.26176&&self.Fx&&c!=s)11.14173.169(b,{111:11.25.26176});93 11.14173.setStyle(b);11.106(o,a,s)},106:16(o,a,s){19 h=120=94;if(11.43){19 e=11.14.48('51');19 c=e.54('24');if(c){19 i=e.71(c);h=i>0;120=i<e.95-1}}93{h=s!=0;120=s>(a-o)}11.125[h?'57174':'41']('13-14-26-28');11.128[120?'57174':'41']('13-14-26-28')}}})());42.90((16(){19 d=42.97.47;19 g=16(){18 self.72?(72.get('13-14-indexes')||'').133(','):[]};19 s=16(o,a,t){if(self.72){19 i=g();i=i.without.140(i,a.map('id'));i.push(t.id);72.set('13-14-indexes',i.uniq().join(','),o)}};18{47:16(){d.140(11,80);11.161();if(11.25.72)11.onShow(s.curry(11.25.72,11.14))},161:16(){19 c;if(11.25.145!==68)c=11.25.145;93{19 e=11.14.48('51');c=e[11.urlIndex()]||e[11.168()]||e.54('24')||e[0]}if(c)c.49()},urlIndex:16(){19 b=-1,a=107.location.href.133('#')[1];if(a)for(19 i=0;i<11.14.95;i++)if(11.14[i].id==a){b=i;break}18 b},168:16(){19 a=-1;if(11.25.72){19 b=g();for(19 i=0;i<11.14.95;i++)if(b.90(11.14[i].id)){a=i;break}}18 a}}})());42.90({add:16(a,c,o){19 o=o||{};19 e=$E(11.35?'dt':'li').62($E('a',{html:a,href:o.url||'#'+(o.id||'')})).62To(11.14173);19 t=129 42.164(e,11);t.27.17.122(c||'');11.14.push(t);if(defined(o.37))11.move(t,o.37);18 11.84('add',t)},move:16(t,p){19 t=11.14[t]||t;if(11.14[p]&&11.14[p]!==t){11.14[p].17.62(t.17,(p==11.14.95-1)?'after':'before');if(11.35)t.17.62(t.27.17,'after');11.14.splice(11.14.71(t),1);11.14.splice(p,0,t);11.84('move',t,p)}18 11},57:16(t){18 11.96(t,'57')}});42.164.90((16(){19 c=42.164.97.49;18{49:16(){if(11.dogPiling(80))18 11;19 a=c.140(11,80);19 u=11.link.href;19 o=11.21.25;if(u.90s('#'))u=o.url?o.url.159('%{id}',u.133('#')[1]):68;if(u&&!11.170&&!(o.138||11.138)){11.27.lock();try{11.170=129 Xhr(u,Object.merge({method:'get'},o.Xhr)).onComplete(16(r){if(11.21.82)18 80.callee.69(11,r).157(103);11.27.122(r.136);11.170=68;if(o.138)11.138=151;11.84('load')}.69(11)).send()}catch(e){if(!Browser.OLD)throw(e)}}18 a},dogPiling:16(b){if(11.21.82){if(11.21.104)11.21.104.cancel();11.21.104=(16(a){11.49.140(11,a)}).69(11,b).157(103);18 151}18 11.21.104=68}}})());42.90((16(){19 o=42.97.47;18{47:16(){o.140(11,80);if(11.25.loop)11.139()},139:16(d){if(!d&&!11.25.loop)18 11;if(11.25.loopPause){11._s89175=11._s89175||11.s89175.69(11,151);11.74=11.74||11.139.69(11,d);11.105().on({mouseover:11._s89175,mouseout:11.74})}if(11.108)11.108.s89();11.108=16(){19 e=11.14.48('51');19 c=11.14.54('24');19 n=e[e.71(c)+1];11.49(n||e.54())}.69(11).periodical(11.25.loop||d);18 11},s89175:16(e,p){if(11.108){11.108.s89();11.108=68}if(!p&&11.74)11.105()},105:16(){18 11.17.s89Observing('mouseover',11._s89175).s89Observing('mouseout',11.74)}}})());107.onReady(16(){42.rescan()});107.write(\"<91 type=\\\"136/css\\\">.13-14,.13-14 .13-14-83,.13-14 .13-14-38,.13-14 .13-14-27,.13-14-26-36,.13-14-26-13,.13-14-26-152,.13-14-27-52,.13-14-98{39:0;56:0;30:81;20:81;83-91:81;70:137;45:auto;29:auto}.13-14{20-46:102 110 #132}.13-14-98{149:hidden}.13-14-38,.13-14-38 a{70:137;float:36}.13-14-38 a{37:76;121:158;136-decoration:81;20:102 110 #132;30:#DDD;55:#444;-112-20-31:.3em;-58-20-31:.3em}.13-14-38 a:85{20-55:#132;30:#EEE}.13-14 .13-14-83 .13-14-24 a,dl.13-14 dt.13-14-24 a{font-weight:bold;55:#000;30:#FFF}.13-14-38 a 166{20:81;32:.6;48:109(32=60)}.13-14-38 a:85 166,.13-14 .13-14-83 .13-14-24 a 166{32:1;48:109(32=103)}.13-14-28,.13-14-28 a,.13-14-28 a:85{30:#EEE;20-55:#DDD;55:#AAA;121:default}.13-14-28 a 166,.13-14-28 a:85 166{32:.5;48:109(32=50)}.13-14-38-close-icon{70:in150-137;*70:in150;*zoom:1;39-13:-0.5em;39-36:0.5em;121:158;32:0.5;48:109(32=50)}.13-14-38-close-icon:85{32:1;48:109(32=103);55:#B00;136-shadow:#888 .15em .15em .113}.13-14 .13-14-27{70:81;37:76;min-29:4em;56:.5em 0}.13-14 .13-14-27-24{70:137}.13-14-27-52{37:146;89:141;36:141;32:0.5;48:109(32=50);30:#132;45:103%;29:103%;136-align:center;150-29:103%}.13-14-27-52-131{37:146;36:44%;89:44%}.13-14-27-52-131 78{float:36;30:#777;45:.5em;29:115;39-13:.115;-112-20-31:.115;-58-20-31:.115}.13-14-27-52-131 78.glow{30:#444;29:1.113;39-89:-0.115}.13-14 .13-14-22{56:0 1.4em;37:76;39-46:.5em}.13-14 .13-14-22 .13-14-26-36,.13-14 .13-14-22 .13-14-26-13{45:1.115;136-align:center;30:#EEE;55:#666;121:158;20:102 110 #132;-112-20-31:.113;-58-20-31:.113;37:146;89:141;36:141;z-index:103}.13-14 .13-14-22 .13-14-26-36:85,.13-14 .13-14-22 .13-14-26-13:85{55:#000;30:#DDD;20-55:#AAA}.13-14 .13-14-22 .13-14-26-13{36:auto;13:141}.13-14 .13-14-22 .13-14-26-28,.13-14 .13-14-22 .13-14-26-28:85{121:default;30:#DDD;20-55:#DDD;55:#AAA}.13-14 .13-14-22 .13-14-26-152{45:103%;149:hidden;37:76;z-index:50}.13-14 .13-14-22 .13-14-83{37:76;45:999em;39:0}.13-14-53 .13-14-83{29:113;56:0 115;20-46:102 110 #132}.13-14-53 .13-14-38{39-89:-102;39-13:102}.13-14-53 .13-14-38 a{150-29:1.8em;39-89:.113;56:0 115;20-46:81;-112-20-31-4636:0;-112-20-31-4613:0;-58-20-46-36-31:0;-58-20-46-13-31:0}.13-14-53 .13-14-83 .13-14-24 a{150-29:113;39-89:102}.13-14-53 .13-14-22{20-46:102 110 #132}.13-14-53 .13-14-22 .13-14-26-36,.13-14-53 .13-14-22 .13-14-26-13{150-29:1.8em;89:.113;-112-20-31-4636:0;-112-20-31-4613:0;-58-20-46-36-31:0;-58-20-46-13-31:0}.13-14-53 .13-14-22 .13-14-26-152{37:76;89:102}.13-14-53 .13-14-22 .13-14-26-152 .13-14-83{56:0}.13-14-59 .13-14-83,.13-14-59 .13-14-38 a,.13-14-59 .13-14-22 .13-14-26-36,.13-14-59 .13-14-22 .13-14-26-13{29:6em;150-29:6em}.13-14-59 .13-14-38{39-13:2px}.13-14-59 .13-14-38 a 166{20:102 110 #132;39:.4em;56:0}dl.13-14{149:81;20:81}dt.13-14-38,dt.13-14-38 a{70:137;float:81}dt.13-14-38 a{56:.113 115}dl.13-14 dt.13-14-24 a{30:#EEE;-112-20-31-4636:0;-112-20-31-4613:0;-58-20-46-36-31:0;-58-20-46-13-31:0}</91>\");",",,,,,,,,,,,this,,right,tabs,,function,element,return,var,border,controller,scroller,,current,options,scroll,panel,disabled,height,background,radius,opacity,tabsList,,isHarmonica,left,position,tab,margin,,addClass,Tabs,isCarousel,,width,bottom,initialize,filter,show,,enabled,locker,simple,first,color,padding,remove,webkit,carousel,,,insert,,,class,,removeClass,null,bind,display,indexOf,Cookie,parentNode,_startLoop,insertTo,relative,,div,offsetHeight,arguments,none,__working,list,fire,hover,offsetWidth,disable,,top,include,style,scrollDuration,else,false,length,callTab,prototype,resizer,,,_stopLoop,1px,100,__timeout,forgetHovers,checkScrollButtons,document,timer,alpha,solid,duration,moz,2em,getStyle,1em,resizing,resizeFx,hasClass,bottomright,has_next,cursor,update,,enable,prevButton,bottomleft,justScroll,nextButton,new,onClick,spinner,CCC,split,resizeDuration,slide,text,block,cache,startLoop,apply,0px,stopObserving,buildScroller,onFinish,selected,absolute,idPrefix,scrollTo,overflow,line,true,body,pickTab,scrollToTab,toInt,click,delay,pointer,replace,onMousedown,findCurrent,tagName,tabsElement,Tab,scrollRight,img,_locker,cookieIndex,morph,request,scrollLeft,scrollTabs,List,Class,Loop,Duration,Panel".split(",")));
@@ -3,88 +3,121 @@
3
3
  *
4
4
  * See http://rightjs.org/ui/tooltips for more details
5
5
  *
6
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
6
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
7
7
  */
8
8
  if (!RightJS) throw "Gimme RightJS!";
9
9
 
10
10
  /**
11
11
  * The native tooltips feature for RithJS
12
12
  *
13
- *
14
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
13
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
15
14
  */
16
-
17
15
  var Tooltip = new Class({
18
16
  include: Options,
19
17
 
20
18
  extend: {
21
19
  Options: {
22
- checkTags: '*', // tags that should be checked on-load
23
- relName: 'tooltip',
24
- idSuffix: '-tooltip',
25
- fxName: 'fade',
26
- fxDuration: 400,
27
- delay: 400 // the appearance delay
20
+ cssRule: '[rel=tooltip]', // a css-marker of an element with a tooltip
21
+
22
+ fxName: 'fade', // the appearance effect name
23
+ fxDuration: 400, // the appearance effect duration
24
+ delay: 400, // the appearance delay
25
+
26
+ move: true, // if it should be moved with the mouse
27
+
28
+ idSuffix: '-tooltip' // ID prefix for tooltips with ID
28
29
  },
29
30
 
30
31
  current: null, // currently active tooltip reference
32
+ instances: [], // keeps the list of instances
31
33
 
32
- // scans the page for auto-discoverable tooltiped elements
33
- rescan: function(scope) {
34
- var key = Tooltip.Options.relName;
35
- ($(scope) || document).select(Tooltip.Options.checkTags+'[rel='+key+']').each(function(element) {
36
- var text = element.get('title') || element.get('alt');
37
- if (text) {
38
- var data = element.get('data-'+key+'-options');
39
- new Tooltip(element, eval('('+data+')'));
40
- }
41
- });
42
- }
34
+ // tries to find a tip closest to the event
35
+ find: function(event) {
36
+ var target = event.target, targets = [target].concat(target.parents()),
37
+ targets = targets.slice(0, targets.length - 2),
38
+ element = targets.first(function(node) {
39
+ return node._tooltip || node.match(Tooltip.Options.cssRule);
40
+ });
41
+
42
+ if (element) {
43
+ var uid = $uid(element);
44
+ return Tooltip.instances[uid] = Tooltip.instances[uid] || new Tooltip(element);
45
+ }
46
+ },
47
+
48
+ // DEPRECATED a dummy method for the old API backward compatibility
49
+ rescan: function(scope) { }
43
50
  },
44
51
 
52
+ /**
53
+ * Constructor
54
+ *
55
+ * @param Element associated element
56
+ * @param Object options
57
+ */
45
58
  initialize: function(element, options) {
46
- this.element = $E('div', {'class': 'right-tooltip'}).insertTo(document.body).hide();
47
- this.container = $E('div', {'class': 'right-tooltip-container'}).insertTo(this.element);
59
+ this.associate = element = $(element);
60
+ this.element = $E('div', {
61
+ 'class': 'right-tooltip',
62
+ 'html': '<div class="right-tooltip-arrow"></div>'+
63
+ '<div class="right-tooltip-container">'+
64
+ (element.get('title') || element.get('alt'))+
65
+ '</div>'
66
+ }).insertTo(document.body);
48
67
 
49
- this.setOptions(options).assignTo(element);
50
- },
51
-
52
- setText: function(text) {
53
- this.container.update(text);
54
- return this;
55
- },
56
-
57
- getText: function() {
58
- return this.container.innerHTML;
68
+ this.setOptions(options || eval('('+element.get('data-tooltips-options')+')'));
69
+
70
+ element.set({ title: '', alt: ''});
71
+
72
+ if (element.id)
73
+ this.element.id = element.id + this.options.idSuffix;
59
74
  },
60
75
 
76
+ /**
77
+ * Hides the tooltip
78
+ *
79
+ * @return Tooltip this
80
+ */
61
81
  hide: function() {
62
- Tooltip.current = null;
63
82
  this.cancelTimer();
64
- this.element.hide(this.options.fxName, {duration: this.options.fxDuration});
83
+ this.element.hide(this.options.fxName, {
84
+ duration: this.options.fxDuration,
85
+ onFinish: function() {
86
+ if (Tooltip.current === this)
87
+ Tooltip.current = null;
88
+ }.bind(this)
89
+ });
65
90
 
66
91
  return this;
67
92
  },
68
93
 
69
- show: function() {
70
- Tooltip.current = this;
71
- this.element.show(this.options.fxName, {duration: this.options.fxDuration});
72
-
73
- return this;
74
- },
75
-
76
- showDelayed: function() {
77
- Tooltip.current = this;
78
- this.timer = this.show.bind(this).delay(this.options.delay);
79
- },
80
-
81
- cancelTimer: function() {
82
- if (this.timer) {
83
- this.timer.cancel();
84
- this.timer = null;
85
- }
94
+ /**
95
+ * Shows the tooltip with a dealy
96
+ *
97
+ * @param Boolean if true will show tooltip immediately
98
+ * @return Tooltip this
99
+ */
100
+ show: function(immediately) {
101
+ // hidding all the others
102
+ Tooltip.instances.each(function(tip) {
103
+ if (tip && tip !== this) tip.hide();
104
+ }, this);
105
+
106
+ // show the tooltip with a delay
107
+ this.timer = (function() {
108
+ this.element.stop().show(this.options.fxName, {duration: this.options.fxDuration});
109
+
110
+ Tooltip.current = this;
111
+ }).bind(this).delay(this.options.delay);
112
+
113
+ return Tooltip.current = this;
86
114
  },
87
115
 
116
+ /**
117
+ * Moves the tooltip where the event happened
118
+ *
119
+ * @return Tooltip this
120
+ */
88
121
  moveTo: function(event) {
89
122
  this.element.style.left = event.pageX + 'px';
90
123
  this.element.style.top = event.pageY + 'px';
@@ -92,39 +125,63 @@ var Tooltip = new Class({
92
125
  return this;
93
126
  },
94
127
 
95
- assignTo: function(element) {
96
- this.setText(element.get('title') || element.get('alt'));
97
-
98
- // removing the element native title and alt
99
- element.setAttribute('title', '');
100
- element.setAttribute('alt', '');
101
-
102
- element.on({
103
- mouseover: this.showDelayed.bind(this),
104
- mouseout: this.hide.bind(this)
105
- });
106
-
107
- if (element.id) this.element.id = element.id + this.options.idSuffix;
108
-
109
- this.associate = element;
110
-
111
- return this;
128
+ // protected
129
+
130
+ // cancels a show timeout
131
+ cancelTimer: function() {
132
+ if (this.timer) {
133
+ this.timer.cancel();
134
+ this.timer = null;
135
+ }
112
136
  }
113
137
  });
114
138
 
115
139
  /**
116
140
  * The post load tooltips initialization script
117
141
  *
118
- * Copyright (C) 2009 Nikolay V. Nemshilov aka St.
142
+ * Copyright (C) 2009-2010 Nikolay V. Nemshilov
119
143
  */
120
144
  document.on({
121
- ready: function() { Tooltip.rescan(); },
145
+ /**
146
+ * Watches all the mouse-over events and reacts if one of the targets
147
+ * matches a tooltip
148
+ *
149
+ * @param Event event
150
+ */
151
+ mouseover: function(event) {
152
+ var prev_tip = Tooltip.current, this_tip = Tooltip.find(event);
153
+
154
+ if (this_tip) {
155
+ if (prev_tip && prev_tip !== this_tip) prev_tip.hide();
156
+ if (this_tip.element.hidden()) this_tip.show();
157
+
158
+ this_tip.moveTo(event);
159
+ }
160
+ },
161
+
162
+ /**
163
+ * Catches the mouseout events and hides tooltips when needed
164
+ *
165
+ * @param Event event
166
+ */
167
+ mouseout: function(event) {
168
+ var curr_tip = Tooltip.current, this_tip = Tooltip.find(event);
169
+
170
+ if (curr_tip && (!this_tip || this_tip === curr_tip))
171
+ curr_tip.hide();
172
+ },
122
173
 
174
+ /**
175
+ * Moves tooltips when active
176
+ *
177
+ * @param Event event
178
+ */
123
179
  mousemove: function(event) {
124
- if (Tooltip.current) {
125
- Tooltip.current.moveTo(event);
180
+ var tip = Tooltip.current;
181
+ if (tip && tip.options.move) {
182
+ tip.moveTo(event);
126
183
  }
127
184
  }
128
185
  });
129
186
 
130
- document.write("<style type=\"text/css\">div.right-tooltip{position:absolute;margin-top:16pt;margin-left:2pt;border:1px solid #DDD;background-color:#FFF8EE;color:#666;font-size:80%;cursor:default;border-radius:.4em;-moz-border-radius:.4em;-webkit-border-radius:.4em;box-shadow:.4em .4em .4em #AAA;-moz-box-shadow:.4em .4em .4em #AAA;-webkit-box-shadow:.4em .4em .4em #AAA}div.right-tooltip-container{margin:.6em;border-left:2px solid brown;padding-left:.5em}</style>");
187
+ document.write("<style type=\"text/css\">div.right-tooltip{display:none;position:absolute;z-index:999999;font-size:90%;margin-top:16pt;margin-left:5pt;color:#FFF;text-shadow:0 0 .2em #000;border:.3em solid rgba(255,255,255,0.2);background-color:rgba(25,25,25,0.92);background-image:-webkit-gradient(linear,0% 0%,0% 100%,from(transparent),to(#000));*background-color:#000;*border:.3em solid #444;border-radius:.4em;-moz-border-radius:.4em;-webkit-border-radius:.4em;box-shadow:0 0 .4em #555;-moz-box-shadow:0 0 .4em #555;-webkit-box-shadow:0 0 .4em #555}div.right-tooltip-container{margin:.4em .6em}</style>");