right-rails 1.0.10 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +4 -4
- data/Rakefile +4 -4
- data/lib/right_rails.rb +1 -1
- data/public/javascripts/right/autocompleter-src.js +115 -106
- data/public/javascripts/right/autocompleter.js +3 -14
- data/public/javascripts/right/billboard-src.js +58 -38
- data/public/javascripts/right/billboard.js +3 -13
- data/public/javascripts/right/calendar-src.js +136 -133
- data/public/javascripts/right/calendar.js +4 -33
- data/public/javascripts/right/colorpicker-src.js +128 -125
- data/public/javascripts/right/colorpicker.js +4 -23
- data/public/javascripts/right/dialog-src.js +67 -37
- data/public/javascripts/right/dialog.js +3 -17
- data/public/javascripts/right/dnd-src.js +44 -43
- data/public/javascripts/right/dnd.js +3 -16
- data/public/javascripts/right/effects-src.js +125 -98
- data/public/javascripts/right/effects.js +3 -13
- data/public/javascripts/right/in-edit-src.js +54 -38
- data/public/javascripts/right/in-edit.js +4 -10
- data/public/javascripts/right/jquerysh-src.js +344 -20
- data/public/javascripts/right/jquerysh.js +3 -3
- data/public/javascripts/right/json-src.js +22 -35
- data/public/javascripts/right/json.js +4 -7
- data/public/javascripts/right/keys-src.js +87 -0
- data/public/javascripts/right/keys.js +7 -0
- data/public/javascripts/right/lightbox-src.js +76 -58
- data/public/javascripts/right/lightbox.js +3 -20
- data/public/javascripts/right/rails-src.js +108 -107
- data/public/javascripts/right/rails.js +4 -11
- data/public/javascripts/right/rater-src.js +47 -31
- data/public/javascripts/right/rater.js +3 -9
- data/public/javascripts/right/resizable-src.js +60 -33
- data/public/javascripts/right/resizable.js +3 -11
- data/public/javascripts/right/selectable-src.js +87 -51
- data/public/javascripts/right/selectable.js +3 -18
- data/public/javascripts/right/sizzle-src.js +15 -10
- data/public/javascripts/right/sizzle.js +4 -27
- data/public/javascripts/right/slider-src.js +49 -33
- data/public/javascripts/right/slider.js +3 -10
- data/public/javascripts/right/sortable-src.js +46 -32
- data/public/javascripts/right/sortable.js +4 -13
- data/public/javascripts/right/table-src.js +19 -10
- data/public/javascripts/right/table.js +4 -6
- data/public/javascripts/right/tabs-src.js +69 -47
- data/public/javascripts/right/tabs.js +4 -26
- data/public/javascripts/right/tooltips-src.js +78 -56
- data/public/javascripts/right/tooltips.js +4 -9
- data/public/javascripts/right/uploader-src.js +50 -34
- data/public/javascripts/right/uploader.js +3 -9
- data/public/javascripts/right-olds-src.js +528 -355
- data/public/javascripts/right-olds.js +4 -13
- data/public/javascripts/right-safe-src.js +4 -99
- data/public/javascripts/right-safe.js +3 -4
- data/public/javascripts/right-src.js +1618 -1245
- data/public/javascripts/right.js +4 -91
- metadata +8 -6
@@ -1,8 +1,8 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* RightJS-UI Billboard v2.2.0
|
3
3
|
* http://rightjs.org/ui/billboard
|
4
4
|
*
|
5
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
5
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
7
|
var Billboard = RightJS.Billboard = (function(RightJS) {
|
8
8
|
/**
|
@@ -10,25 +10,8 @@ var Billboard = RightJS.Billboard = (function(RightJS) {
|
|
10
10
|
* it creates an abstract proxy with the common functionality
|
11
11
|
* which then we reuse and override in the actual widgets
|
12
12
|
*
|
13
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
14
|
-
*/
|
15
|
-
|
16
|
-
/**
|
17
|
-
* Billboard initialization script
|
18
|
-
*
|
19
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
13
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
20
14
|
*/
|
21
|
-
var R = RightJS,
|
22
|
-
$ = RightJS.$,
|
23
|
-
$$ = RightJS.$$,
|
24
|
-
$w = RightJS.$w,
|
25
|
-
$E = RightJS.$E,
|
26
|
-
Fx = RightJS.Fx,
|
27
|
-
Class = RightJS.Class,
|
28
|
-
Object = RightJS.Object;
|
29
|
-
|
30
|
-
|
31
|
-
|
32
15
|
|
33
16
|
/**
|
34
17
|
* The widget units constructor
|
@@ -48,7 +31,7 @@ function Widget(tag_name, methods) {
|
|
48
31
|
*
|
49
32
|
* Copyright (C) 2010 Nikolay Nemshilov
|
50
33
|
*/
|
51
|
-
var AbstractWidget = new RightJS.
|
34
|
+
var AbstractWidget = new RightJS.Class(RightJS.Element.Wrappers[tag_name] || RightJS.Element, {
|
52
35
|
/**
|
53
36
|
* The common constructor
|
54
37
|
*
|
@@ -80,7 +63,8 @@ function Widget(tag_name, methods) {
|
|
80
63
|
options = {};
|
81
64
|
}
|
82
65
|
this.setOptions(options, this);
|
83
|
-
|
66
|
+
|
67
|
+
return (RightJS.Wrapper.Cache[RightJS.$uid(this._)] = this);
|
84
68
|
},
|
85
69
|
|
86
70
|
// protected
|
@@ -93,12 +77,16 @@ function Widget(tag_name, methods) {
|
|
93
77
|
* @return void
|
94
78
|
*/
|
95
79
|
setOptions: function(options, element) {
|
96
|
-
|
97
|
-
|
98
|
-
RightJS.Object.merge(options, eval("("+(
|
80
|
+
if (element) {
|
81
|
+
options = RightJS.Object.merge(options, new Function("return "+(
|
99
82
|
element.get('data-'+ this.key) || '{}'
|
100
|
-
)
|
101
|
-
|
83
|
+
))());
|
84
|
+
}
|
85
|
+
|
86
|
+
if (options) {
|
87
|
+
RightJS.Options.setOptions.call(this, RightJS.Object.merge(this.options, options));
|
88
|
+
}
|
89
|
+
|
102
90
|
return this;
|
103
91
|
}
|
104
92
|
});
|
@@ -107,7 +95,7 @@ function Widget(tag_name, methods) {
|
|
107
95
|
* Creating the actual widget class
|
108
96
|
*
|
109
97
|
*/
|
110
|
-
var Klass = new RightJS.
|
98
|
+
var Klass = new RightJS.Class(AbstractWidget, methods);
|
111
99
|
|
112
100
|
// creating the widget related shortcuts
|
113
101
|
RightJS.Observer.createShortcuts(Klass.prototype, Klass.EVENTS || []);
|
@@ -117,13 +105,30 @@ function Widget(tag_name, methods) {
|
|
117
105
|
|
118
106
|
|
119
107
|
/**
|
120
|
-
*
|
108
|
+
* Billboard initialization script
|
121
109
|
*
|
122
110
|
* Copyright (C) 2010 Nikolay Nemshilov
|
123
111
|
*/
|
112
|
+
var R = RightJS,
|
113
|
+
$ = RightJS.$,
|
114
|
+
$$ = RightJS.$$,
|
115
|
+
$w = RightJS.$w,
|
116
|
+
$E = RightJS.$E,
|
117
|
+
Fx = RightJS.Fx,
|
118
|
+
Class = RightJS.Class,
|
119
|
+
Object = RightJS.Object;
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
/**
|
125
|
+
* Billboards basic class
|
126
|
+
*
|
127
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
128
|
+
*/
|
124
129
|
var Billboard = new Widget('UL', {
|
125
130
|
extend: {
|
126
|
-
version: '2.0
|
131
|
+
version: '2.2.0',
|
127
132
|
|
128
133
|
EVENTS: $w('change first last'),
|
129
134
|
|
@@ -435,7 +440,7 @@ Billboard.Fx.Slide = new Class(Billboard.Fx, {
|
|
435
440
|
/**
|
436
441
|
* Stripe visual effects class
|
437
442
|
*
|
438
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
443
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
439
444
|
*/
|
440
445
|
Billboard.Fx.Stripe = new Class(Billboard.Fx, {
|
441
446
|
|
@@ -477,12 +482,13 @@ Billboard.Fx.Stripe = new Class(Billboard.Fx, {
|
|
477
482
|
};
|
478
483
|
|
479
484
|
if (direction !== 'right' && i === (length - 1) || (direction === 'right' && i === 0)) {
|
480
|
-
options.onFinish = R(this.finish).bind(this);
|
485
|
+
options.onFinish = R(this.finish).bind(this, true);
|
481
486
|
}
|
482
487
|
|
483
488
|
switch (direction) {
|
484
489
|
case 'up':
|
485
490
|
R(function(stripe, options) {
|
491
|
+
stripe.setHeight(stripe.size().y);
|
486
492
|
stripe.morph({height: '0px'}, options);
|
487
493
|
}).bind(this, stripe, options).delay(i * delay);
|
488
494
|
break;
|
@@ -490,6 +496,7 @@ Billboard.Fx.Stripe = new Class(Billboard.Fx, {
|
|
490
496
|
case 'down':
|
491
497
|
stripe.setStyle('top: auto; bottom: 0px');
|
492
498
|
R(function(stripe, options) {
|
499
|
+
stripe.setHeight(stripe.size().y);
|
493
500
|
stripe.morph({height: '0px'}, options);
|
494
501
|
}).bind(this, stripe, options).delay(i * delay);
|
495
502
|
break;
|
@@ -507,20 +514,22 @@ Billboard.Fx.Stripe = new Class(Billboard.Fx, {
|
|
507
514
|
break;
|
508
515
|
|
509
516
|
default:
|
510
|
-
this.finish();
|
517
|
+
this.finish(true);
|
511
518
|
}
|
512
519
|
}
|
513
520
|
},
|
514
521
|
|
515
522
|
|
516
523
|
/**
|
517
|
-
* Stubbing the
|
524
|
+
* Stubbing the finish method so it didn't finish prematurely
|
518
525
|
*
|
519
526
|
* @return Fx this
|
520
527
|
*/
|
521
|
-
|
522
|
-
|
523
|
-
|
528
|
+
finish: function(for_sure) {
|
529
|
+
if (for_sure) {
|
530
|
+
this.$super();
|
531
|
+
}
|
532
|
+
return this;
|
524
533
|
}
|
525
534
|
|
526
535
|
});
|
@@ -538,7 +547,18 @@ $(document).onReady(function() {
|
|
538
547
|
});
|
539
548
|
});
|
540
549
|
|
541
|
-
|
550
|
+
var embed_style = document.createElement('style'),
|
551
|
+
embed_rules = document.createTextNode("*.rui-billboard, *.rui-billboard> *{margin:0;padding:0;list-style:none} *.rui-billboard{display:inline-block; *display:inline; *zoom:1;position:relative} *.rui-billboard> *{display:none;width:100%;height:100%} *.rui-billboard> *:first-child, *.rui-billboard> *.rui-billboard-current:first-child{display:block;position:relative} *.rui-billboard> *>img{margin:0;padding:0} *.rui-billboard-current{position:absolute;left:0;top:0;display:block;z-index:999} *.rui-billboard-button-prev, *.rui-billboard-button-next{position:absolute;z-index:99999;left:.25em;top:auto;bottom:.25em;display:block;width:.5em;height:auto;text-align:center;font-size:200%;font-family:Arial;font-weight:bold;padding:0em .5em .2em .5em;background:white;opacity:0;filter:alpha(opacity:0);cursor:pointer;border:.12em solid #888;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none;transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out} *.rui-billboard-button-next{left:auto;right:.25em;text-align:right} *.rui-billboard-button-prev:active{text-indent:-.1em} *.rui-billboard-button-next:active{text-indent:.2em} *.rui-billboard:hover *.rui-billboard-button-prev, *.rui-billboard:hover *.rui-billboard-button-next{opacity:0.4;filter:alpha(opacity:40)} *.rui-billboard:hover *.rui-billboard-button-prev:hover, *.rui-billboard:hover *.rui-billboard-button-next:hover{opacity:0.7;filter:alpha(opacity:70)}.rui-billboard-fx-container{position:absolute;left:0;top:0;display:block;z-index:9999;overflow:hidden}.rui-billboard-fx-container> *{position:absolute;left:0;top:0}.rui-billboard-stripe{overflow:hidden}.rui-billboard-stripe> *{position:relative}");
|
552
|
+
|
553
|
+
embed_style.type = 'text/css';
|
554
|
+
document.getElementsByTagName('head')[0].appendChild(embed_style);
|
555
|
+
|
556
|
+
if(embed_style.styleSheet) {
|
557
|
+
embed_style.styleSheet.cssText = embed_rules.nodeValue;
|
558
|
+
} else {
|
559
|
+
embed_style.appendChild(embed_rules);
|
560
|
+
}
|
561
|
+
|
542
562
|
|
543
563
|
return Billboard;
|
544
564
|
})(RightJS);
|
@@ -1,17 +1,7 @@
|
|
1
1
|
/**
|
2
|
-
*
|
2
|
+
* RightJS-UI Billboard v2.2.0
|
3
3
|
* http://rightjs.org/ui/billboard
|
4
4
|
*
|
5
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
5
|
+
* Copyright (C) 2010-2011 Nikolay Nemshilov
|
6
6
|
*/
|
7
|
-
var Billboard=RightJS.Billboard=function(c){var
|
8
|
-
d){d=d||this;c.Options.setOptions.call(this,c.Object.merge(h,eval("("+(d.get("data-"+this.key)||"{}")+")")));return this}});g=new c.Wrapper(g,b);c.Observer.createShortcuts(g.prototype,g.EVENTS||[]);return g})("UL",{extend:{version:"2.0.1",EVENTS:q("change first last"),Options:{fxName:"stripe",fxDuration:"long",autostart:true,delay:4E3,loop:true,showButtons:true,prevButton:"native",nextButton:"native",stripes:10,cssRule:"*.rui-billboard"}},initialize:function(a){this.$super("billboard",a);if(this.options.showButtons){this.prevButton=
|
9
|
-
this.options.prevButton!=="native"?o(this.options.prevButton):m("div",{"class":"rui-billboard-button-prev",html:"‹"}).insertTo(this);this.nextButton=this.options.nextButton!=="native"?o(this.options.nextButton):m("div",{"class":"rui-billboard-button-next",html:"›"}).insertTo(this);this.prevButton.onClick(c(function(b){b.stop();this.showPrev()}).bind(this));this.nextButton.onClick(c(function(b){b.stop();this.showNext()}).bind(this))}this.onChange(function(b){if(b.item===this.items().first())this.fire("first");
|
10
|
-
else b.item===this.items().last()&&this.fire("last")});this.on({mouseover:function(){this.stop()},mouseout:function(b){this.options.autostart&&!b.find(".rui-billboard")&&this.start()}});this.options.autostart&&this.start()},items:function(){return this.children().without(this.prevButton,this.nextButton)},showNext:function(){var a=this.items(),b=a.indexOf(this.current())+1;if(b==a.length&&this.options.loop)b=0;return this.current(b)},showPrev:function(){var a=this.items(),b=a.indexOf(this.current())-
|
11
|
-
1;if(b<0&&this.options.loop)b=a.length-1;return this.current(b)},current:function(a){var b=this.items();if(arguments.length){if(a instanceof Element)a=b.indexOf(a);this.runFx(b[a])}else return b.length?b.first("hasClass","rui-billboard-current")||b.first().addClass("rui-billboard-current"):null;return this},start:function(){this.timer=c(this.showNext).bind(this).periodical(this.options.delay)},stop:function(){this.timer&&this.timer.stop()},fire:function(a,b){return this.$super(a,s.merge({index:this.items().indexOf(this.current()),
|
12
|
-
item:this.current()},b))},runFx:function(a){if(a&&!this._running){var b=f.Fx[c(this.options.fxName||"").capitalize()];if(b)(new b(this)).start(this.current(),a);else{this.current().removeClass("rui-billboard-current");a.addClass("rui-billboard-current")}}}});f.Fx=new n(r,{initialize:function(a){this.container=m("div",{"class":"rui-billboard-fx-container"});this.$super(a,{duration:a.options.fxDuration,onStart:function(){a._running=true;a.insert(this.container)},onFinish:function(){this.container.remove();
|
13
|
-
a._running=false;a.fire("change")}})},prepare:function(a,b){a.removeClass("rui-billboard-current");b.addClass("rui-billboard-current");this.clone=a.clone();this.container.update(this.clone)}});f.Fx.Fade=new n(f.Fx,{prepare:function(a,b){this.$super(a,b)},render:function(a){this.container.setStyle({opacity:1-a})}});f.Fx.Slide=new n(f.Fx,{prepare:function(a,b){this._width=this.element.current().size().x;this._direction=a.nextSiblings().include(b)?-1:1;this.$super(a,b);this.clone.setStyle({width:this._width+
|
14
|
-
"px"})},render:function(a){this.clone._.style.left=this._direction*this._width*a+"px"}});f.Fx.Stripe=new n(f.Fx,{directions:["down","up","left","right"],prepare:function(a,b){this.$super(a,b);var g=this.element.options.stripes,h=this.element.items()[0].size().x/g,d=this.directions.shift();this.directions.push(d);this.container.clean();for(var e=0;e<g;e++){var k=m("div",{"class":"rui-billboard-stripe",style:{width:h+1+"px",left:e*h+"px"}}).insert(a.clone().setStyle({width:h*g+"px",left:-e*h+"px"}));
|
15
|
-
this.container.append(k);var l={duration:this.options.duration};if(d!=="right"&&e===g-1||d==="right"&&e===0)l.onFinish=c(this.finish).bind(this);switch(d){case "up":c(function(i,j){i.morph({height:"0px"},j)}).bind(this,k,l).delay(e*100);break;case "down":k.setStyle("top: auto; bottom: 0px");c(function(i,j){i.morph({height:"0px"},j)}).bind(this,k,l).delay(e*100);break;case "left":c(function(i,j){i.morph({width:"0px"},j)}).bind(this,k,l).delay(e*100);break;case "right":c(function(i,j){i.morph({width:"0px"},
|
16
|
-
j)}).bind(this,k,l).delay((g-e-1)*100);break;default:this.finish()}}},start:function(){this.$super.apply(this,arguments);return this.pause()}});o(document).onReady(function(){p(f.Options.cssRule).each(function(a){a instanceof f||new f(a)})});document.write('<style type="text/css"> *.rui-billboard, *.rui-billboard> *{margin:0;padding:0;list-style:none} *.rui-billboard{display:inline-block; *display:inline; *zoom:1;position:relative} *.rui-billboard> *{display:none;width:100%;height:100%} *.rui-billboard> *:first-child, *.rui-billboard> *.rui-billboard-current:first-child{display:block;position:relative} *.rui-billboard> *>img{margin:0;padding:0} *.rui-billboard-current{position:absolute;left:0;top:0;display:block;z-index:999} *.rui-billboard-button-prev, *.rui-billboard-button-next{position:absolute;z-index:99999;left:.25em;top:auto;bottom:.25em;display:block;width:.5em;height:auto;text-align:center;font-size:200%;font-family:Arial;font-weight:bold;padding:0em .5em .2em .5em;background:white;opacity:0;filter:alpha(opacity:0);cursor:pointer;border:.12em solid #888;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none;transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out} *.rui-billboard-button-next{left:auto;right:.25em;text-align:right} *.rui-billboard-button-prev:active{text-indent:-.1em} *.rui-billboard-button-next:active{text-indent:.2em} *.rui-billboard:hover *.rui-billboard-button-prev, *.rui-billboard:hover *.rui-billboard-button-next{opacity:0.4;filter:alpha(opacity:40)} *.rui-billboard:hover *.rui-billboard-button-prev:hover, *.rui-billboard:hover *.rui-billboard-button-next:hover{opacity:0.7;filter:alpha(opacity:70)}.rui-billboard-fx-container{position:absolute;left:0;top:0;display:block;z-index:9999;overflow:hidden}.rui-billboard-fx-container> *{position:absolute;left:0;top:0}.rui-billboard-stripe{overflow:hidden}.rui-billboard-stripe> *{position:relative}</style>');
|
17
|
-
return f}(RightJS);
|
7
|
+
var Billboard=RightJS.Billboard=function(a){function b(b,c){c||(c=b,b="DIV");var d=new a.Class(a.Element.Wrappers[b]||a.Element,{initialize:function(c,d){this.key=c;var e=[{"class":"rui-"+c}];this instanceof a.Input||this instanceof a.Form||e.unshift(b),this.$super.apply(this,e),a.isString(d)&&(d=a.$(d)),d instanceof a.Element&&(this._=d._,"$listeners"in d&&(d.$listeners=d.$listeners),d={}),this.setOptions(d,this);return a.Wrapper.Cache[a.$uid(this._)]=this},setOptions:function(b,c){c&&(b=a.Object.merge(b,(new Function("return "+(c.get("data-"+this.key)||"{}")))())),b&&a.Options.setOptions.call(this,a.Object.merge(this.options,b));return this}}),e=new a.Class(d,c);a.Observer.createShortcuts(e.prototype,e.EVENTS||[]);return e}var c=a,d=a.$,e=a.$$,f=a.$w,g=a.$E,h=a.Fx,i=a.Class,j=a.Object,k=new b("UL",{extend:{version:"2.2.0",EVENTS:f("change first last"),Options:{fxName:"stripe",fxDuration:"long",autostart:!0,delay:4e3,loop:!0,showButtons:!0,prevButton:"native",nextButton:"native",stripes:10,cssRule:"*.rui-billboard"}},initialize:function(a){this.$super("billboard",a),this.options.showButtons&&(this.prevButton=this.options.prevButton!=="native"?d(this.options.prevButton):g("div",{"class":"rui-billboard-button-prev",html:"‹"}).insertTo(this),this.nextButton=this.options.nextButton!=="native"?d(this.options.nextButton):g("div",{"class":"rui-billboard-button-next",html:"›"}).insertTo(this),this.prevButton.onClick(c(function(a){a.stop(),this.showPrev()}).bind(this)),this.nextButton.onClick(c(function(a){a.stop(),this.showNext()}).bind(this))),this.onChange(function(a){a.item===this.items().first()?this.fire("first"):a.item===this.items().last()&&this.fire("last")}),this.on({mouseover:function(){this.stop()},mouseout:function(a){this.options.autostart&&!a.find(".rui-billboard")&&this.start()}}),this.options.autostart&&this.start()},items:function(){return this.children().without(this.prevButton,this.nextButton)},showNext:function(){var a=this.items(),b=a.indexOf(this.current())+1;b==a.length&&this.options.loop&&(b=0);return this.current(b)},showPrev:function(){var a=this.items(),b=a.indexOf(this.current())-1;b<0&&this.options.loop&&(b=a.length-1);return this.current(b)},current:function(a){var b=this.items();if(arguments.length)a instanceof Element&&(a=b.indexOf(a)),this.runFx(b[a]);else return b.length?b.first("hasClass","rui-billboard-current")||b.first().addClass("rui-billboard-current"):null;return this},start:function(){this.timer=c(this.showNext).bind(this).periodical(this.options.delay)},stop:function(){this.timer&&this.timer.stop()},fire:function(a,b){return this.$super(a,j.merge({index:this.items().indexOf(this.current()),item:this.current()},b))},runFx:function(a){if(a&&!this._running){var b=k.Fx[c(this.options.fxName||"").capitalize()];b?(new b(this)).start(this.current(),a):(this.current().removeClass("rui-billboard-current"),a.addClass("rui-billboard-current"))}}});k.Fx=new i(h,{initialize:function(a){this.container=g("div",{"class":"rui-billboard-fx-container"}),this.$super(a,{duration:a.options.fxDuration,onStart:function(){a._running=!0,a.insert(this.container)},onFinish:function(){this.container.remove(),a._running=!1,a.fire("change")}})},prepare:function(a,b){a.removeClass("rui-billboard-current"),b.addClass("rui-billboard-current"),this.clone=a.clone(),this.container.update(this.clone)}}),k.Fx.Fade=new i(k.Fx,{prepare:function(a,b){this.$super(a,b)},render:function(a){this.container.setStyle({opacity:1-a})}}),k.Fx.Slide=new i(k.Fx,{prepare:function(a,b){this._width=this.element.current().size().x,this._direction=a.nextSiblings().include(b)?-1:1,this.$super(a,b),this.clone.setStyle({width:this._width+"px"})},render:function(a){this.clone._.style.left=this._direction*this._width*a+"px"}}),k.Fx.Stripe=new i(k.Fx,{directions:["down","up","left","right"],prepare:function(a,b){this.$super(a,b);var d=this.element.options.stripes,e=this.element.items()[0].size().x/d,f=100,h=this.directions.shift();this.directions.push(h),this.container.clean();for(var i=0;i<d;i++){var j=g("div",{"class":"rui-billboard-stripe",style:{width:e+1+"px",left:i*e+"px"}}).insert(a.clone().setStyle({width:e*d+"px",left:-i*e+"px"}));this.container.append(j);var k={duration:this.options.duration};if(h!=="right"&&i===d-1||h==="right"&&i===0)k.onFinish=c(this.finish).bind(this,!0);switch(h){case"up":c(function(a,b){a.setHeight(a.size().y),a.morph({height:"0px"},b)}).bind(this,j,k).delay(i*f);break;case"down":j.setStyle("top: auto; bottom: 0px"),c(function(a,b){a.setHeight(a.size().y),a.morph({height:"0px"},b)}).bind(this,j,k).delay(i*f);break;case"left":c(function(a,b){a.morph({width:"0px"},b)}).bind(this,j,k).delay(i*f);break;case"right":c(function(a,b){a.morph({width:"0px"},b)}).bind(this,j,k).delay((d-i-1)*f);break;default:this.finish(!0)}}},finish:function(a){a&&this.$super();return this}}),d(document).onReady(function(){e(k.Options.cssRule).each(function(a){a instanceof k||(a=new k(a))})});var l=document.createElement("style"),m=document.createTextNode("*.rui-billboard, *.rui-billboard> *{margin:0;padding:0;list-style:none} *.rui-billboard{display:inline-block; *display:inline; *zoom:1;position:relative} *.rui-billboard> *{display:none;width:100%;height:100%} *.rui-billboard> *:first-child, *.rui-billboard> *.rui-billboard-current:first-child{display:block;position:relative} *.rui-billboard> *>img{margin:0;padding:0} *.rui-billboard-current{position:absolute;left:0;top:0;display:block;z-index:999} *.rui-billboard-button-prev, *.rui-billboard-button-next{position:absolute;z-index:99999;left:.25em;top:auto;bottom:.25em;display:block;width:.5em;height:auto;text-align:center;font-size:200%;font-family:Arial;font-weight:bold;padding:0em .5em .2em .5em;background:white;opacity:0;filter:alpha(opacity:0);cursor:pointer;border:.12em solid #888;border-radius:.2em;-moz-border-radius:.2em;-webkit-border-radius:.2em;user-select:none;-moz-user-select:none;-webkit-user-select:none;transition:opacity .3s ease-in-out;-o-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;-webkit-transition:opacity .3s ease-in-out} *.rui-billboard-button-next{left:auto;right:.25em;text-align:right} *.rui-billboard-button-prev:active{text-indent:-.1em} *.rui-billboard-button-next:active{text-indent:.2em} *.rui-billboard:hover *.rui-billboard-button-prev, *.rui-billboard:hover *.rui-billboard-button-next{opacity:0.4;filter:alpha(opacity:40)} *.rui-billboard:hover *.rui-billboard-button-prev:hover, *.rui-billboard:hover *.rui-billboard-button-next:hover{opacity:0.7;filter:alpha(opacity:70)}.rui-billboard-fx-container{position:absolute;left:0;top:0;display:block;z-index:9999;overflow:hidden}.rui-billboard-fx-container> *{position:absolute;left:0;top:0}.rui-billboard-stripe{overflow:hidden}.rui-billboard-stripe> *{position:relative}");l.type="text/css",document.getElementsByTagName("head")[0].appendChild(l),l.styleSheet?l.styleSheet.cssText=m.nodeValue:l.appendChild(m);return k}(RightJS)
|