right-rails 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/generators/right_rails/right_rails_generator.rb +1 -1
- data/javascripts/right-autocompleter-src.js +5 -3
- data/javascripts/right-autocompleter.js +1 -1
- data/javascripts/right-behavior-src.js +21 -0
- data/javascripts/right-behavior.js +1 -1
- data/javascripts/right-calendar-src.js +3 -3
- data/javascripts/right-calendar.js +1 -1
- data/javascripts/right-dnd-src.js +3 -2
- data/javascripts/right-dnd.js +1 -1
- data/javascripts/right-effects-src.js +30 -18
- data/javascripts/right-effects.js +1 -1
- data/javascripts/right-lightbox-src.js +10 -8
- data/javascripts/right-lightbox.js +1 -1
- data/javascripts/right-olds-src.js +547 -0
- data/javascripts/right-olds.js +9 -0
- data/javascripts/right-rails-min.js +9 -0
- data/javascripts/right-rails-src.js +14 -12
- data/javascripts/right-rails.js +1 -1
- data/javascripts/right-rater-src.js +2 -2
- data/javascripts/right-rater.js +1 -1
- data/javascripts/right-selectable-src.js +3 -3
- data/javascripts/right-selectable.js +1 -1
- data/javascripts/right-slider-src.js +4 -4
- data/javascripts/right-slider.js +1 -1
- data/javascripts/right-sortable-src.js +21 -16
- data/javascripts/right-sortable.js +1 -1
- data/javascripts/right-src.js +755 -1240
- data/javascripts/right-tabs-src.js +2 -2
- data/javascripts/right-tabs.js +1 -1
- data/javascripts/right-tooltips-src.js +3 -3
- data/javascripts/right-tooltips.js +1 -1
- data/javascripts/right-ui-i18n-ru.js +2 -2
- data/javascripts/right.js +3 -2
- metadata +7 -3
@@ -30,8 +30,8 @@ var Rater = new Class(Observer, {
|
|
30
30
|
},
|
31
31
|
|
32
32
|
// searches and initializes rating units
|
33
|
-
rescan: function() {
|
34
|
-
|
33
|
+
rescan: function(scope) {
|
34
|
+
($(scope)||document).select('div.right-rater').each(function(element) {
|
35
35
|
if (!element._rater) new Rater(element);
|
36
36
|
});
|
37
37
|
}
|
data/javascripts/right-rater.js
CHANGED
@@ -6,4 +6,4 @@
|
|
6
6
|
* Copyright (C) 2009 Nikolay V. Nemshilov aka St.
|
7
7
|
*/
|
8
8
|
if (!self.RightJS) throw "Gimme RightJS";
|
9
|
-
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})("32 39=59 77(Observer,{extend:{EVENTS:$w('53 55
|
9
|
+
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})("32 39=59 77(Observer,{extend:{EVENTS:$w('53 55 28'),Options:{29:5,19:23,25:23,16:58,26:58,62:23,61:'rate',60:23},51:4(s){($(s)||22).select('21.17-14').44(4(e){if(!e._14)59 39(e)})}},71ialize:4(){32 a=$A(arguments);2.13=(a[0]&&!47(a[0]))?$(a[0]):23;2.$super(47(a.70())?a.70():2.13?eval('('+2.13.get('data-14-12')+')'):23);if(!2.13)2.13=2.63();2.13._14=2.71()},20:4(v){if(!2.16()){v=isString(v)?v.toInt():v;v=isNumber(v)?v.round():0;if(v>2.12.29)v=2.12.29;69 if(v<0)v=0;2.24(v);if(2.19!=v)2.45('53',2.19=v,2)}18 2},getValue:4(){18 2.19},38:4(e,p){2.13.38(e,p);18 2},36:4(b){32 a=4(e,v){if(e=$(e)){if(v===undefined||v===23)v='';e[e.20?'20':'25'](''+v)}}.57(b);32 c=4(e,o){32 e=$(e);if(e&&e.27)e.27(4(){2.20(e.19)}.30(o))}.57(b);if($(b)){a(2.19);c(2)}69 22.41(4(){a(2.19);c(2)}.30(2));18 2.27(a)},28:4(){if(2.12.62){59 60(2.12.62,2.12.60).28(2.12.61+\"=\"+2.19);2.45('28',2.19,2)}18 2},31:4(){2.13.35('17-14-16');18 2},enable:4(){2.13.34('17-14-16');18 2},16:4(){18 2.13.has77('17-14-16')},40:4(i){if(!2.16()){2.24(i+1);2.45('55',i+1,2)}},43:4(i){2.20(i+1);if(2.12.26)2.31();2.28()},54:4(){2.20(2.19)},24:4(n){2.37.44(4(e,a){e[n-1<a?'34':'35']('17-14-74')})},71:4(){2.37=2.13.subNodes();2.37.44(4(e,i){e.onMouseover(2.40.30(2,i)).onClick(2.43.30(2,i))},2);2.13.onMouseout(2.54.30(2));2.20(2.12.19);if(2.12.16)2.31();if(2.12.25)2.36(2.12.25);18 2},63:4(){32 e=$E('21',{'class':'17-14'});2.12.29.times(4(){e.insert($E('21',{html:'★'}))});18 e}});22.41(4(){39.51()});22.write(\"<65 type=\\\"46/css\\\">21.17-14,21.17-14 21{margin:0;padding:0;background:75;border:75;42:52-block;*42:52;*zoom:1;76-family:Arial;76-29:110%}21.17-14{67:6em;vertical-68:middle}21.17-14 21{67:64;48:64;line-48:64;46-68:center;50:pointer;56:#888}21.17-14 21.17-14-74{56:brown;46-shadow:#666 .72 .72 .15em}21.17-14-16 21{50:default}</65>\");",",,this,,function,,,,,,,,options,element,rater,,disabled,right,return,value,setValue,div,document,null,highlight,update,disableOnVote,onChange,send,size,bind,disable,var,,removeClass,addClass,assignTo,stars,insertTo,Rater,hovered,onReady,display,clicked,each,fire,text,isHash,height,_rater,cursor,rescan,inline,change,leaved,hover,color,curry,false,new,Xhr,param,url,build,1em,style,,width,align,else,last,init,05em,,glow,none,font,Class".split(",")));
|
@@ -30,8 +30,8 @@ var Selectable = new Class(Observer, {
|
|
30
30
|
refresh: true // a flag if it should automatically refresh the items list
|
31
31
|
},
|
32
32
|
|
33
|
-
rescan: function() {
|
34
|
-
|
33
|
+
rescan: function(scope) {
|
34
|
+
($(scope)||document).select('*.right-selectable').each(function(element) {
|
35
35
|
if (!element._selectable) {
|
36
36
|
new Selectable(element);
|
37
37
|
}
|
@@ -465,7 +465,7 @@ var Selectable = new Class(Observer, {
|
|
465
465
|
event.stop();
|
466
466
|
if (this.isSingle) {
|
467
467
|
var dims = this.container.dimensions();
|
468
|
-
|
468
|
+
|
469
469
|
this.element.setStyle({
|
470
470
|
top: (dims.top + dims.height) + 'px',
|
471
471
|
left: dims.left + 'px',
|
@@ -4,4 +4,4 @@
|
|
4
4
|
* Copyright (C) 2009 Nikolay V. Nemshilov aka St.
|
5
5
|
*/
|
6
6
|
if (!self.RightJS) throw "Gimme RightJS";
|
7
|
-
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})("22
|
7
|
+
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})("22 70=161 163(Observer,{extend:{EVENTS:$w('133 24 un24 72 98 80 145 107 106'),Options:{15:41,24ed:41,27:41,119:90,65:'slide',68:'short',36:41,117:139,53:90},129:11(s){($(s)||40).24('*.13-12').33(11(e){if(!e._12)161 70(e)})}},113:'13-12',64:'13-12-131',17:'13-12-24ed',27163:'13-12-27',18163:'13-12-18',147ialize:11(){22 a=$A(76);if(a[0]&&!136(a[0]))9.16=$(a[0]);9.104(136(a.148())?a.148():9.16?eval('('+9.16.get('data-12-15')+')'):41);if(!9.16)9.16=9.138();9.16._12=9.147()},destroy:11(){9.19.33(11(i){i.29('93',9.51).29('57',9.69).29('47',9.60).29('52',9.63).29('71',9.75)},9);delete(9.16._12)},61:11(v){if(89(v))v=v.split(',').109('trim').105(11(a){14!a.blank()});9.19.33('38',9.17);22 i=9.34(v).33('42',9.17);if(9.21)9.87(i[0]);14 9.48()},getValue:11(){14 9.46},59:11(e,p){9.16.59(e,p);if(9.21)9.18.59(9.16,'132');14 9},114:11(b){22 a=11(e,v){if(e=$(e)){if(v===undefined||v===41)v='';e[e.61?'61':'36'](''+v)}}.144(b);22 c=11(e,o){22 e=$(e);if(e&&e.86)e.86(11(){9.61(e.46)}.31(o))}.144(b);if($(b)){a(9.46);c(9)}54 40.122(11(){a(9.46);c(9)}.31(9));14 9.86(a)},72:11(k){9.39(k).33(11(i){9.32('72',i.42(9.27163))},9);14 9},98:11(k){9.39(k).33(11(i){9.32('98',i.38(9.27163))},9);14 9},27:11(k){14 9.39(k).143('30',9.27163)},24:11(k){22 a=9.34(k);if(9.21&&a){9.19.33('38',9.17);a=[a[0]]}a.33(11(i){9.32('24',i.42(9.17))},9);14 9},un24:11(k){9.34(k).33(11(i){9.32('un24',i.38(9.17))},9);14 9},24ed:11(k){14 9.34(k).143('30',9.17)},53:11(){9.19=9.16.24('li').33(11(i){if(!9.19||!9.19.include(i))i.on({93:9.51,71:9.75,52:9.63,47:9.60,57:9.69})},9);14 9},147:11(){9.16.42(9.113);if(9.21=!9.15.119||9.16.30(9.64))9.95().16.42(9.64);9.63=9.52.31(9);9.75=9.71.31(9);9.60=9.47.31(9);9.69=9.57.31(9);9.51=9.93.31(9);9.46=41;9.53().85('48').onUn24('48');if(9.21)9.85('87');if(9.15.27)9.72(9.15.27);if(9.15.24ed)9.24(9.15.24ed);if(9.15.36)9.114(9.15.36);if(9.21){if(9.15.24ed===41)9.24(9.19[0]);9.85('84')}if(9.15.53){22 o=9.16.36;9.16.36=11(){22 r=o.137(9.16,76);9.53();14 r}.31(9)}14 9},48:11(){if(9.21){22 a=9.19.115('30',9.17);22 v=a?9.74(a):41}54 22 v=9.19.105('30',9.17).109(11(i){14 9.74(i)},9);if(v!=9.46){9.46=v;9.32('133',v,9)}14 9},74:11(i){14 i.id?9.15.117?i.id.match(/\\d+/):i.id:9.19.73(i)},32:11(n,i){if(i&&i.tagName)9.104(n,i,9.19.73(i),9);54 9.104.137(9,76);14 9},109:11(c){if(!125(c))c=[c];14 c.109(11(k){22 i=(89(k)&&/^\\d+$/.test(k))?k.toInt():k,b=k;if(isNumber(i))b=9.19[i];54 if(89(k))b=9.19.115(11(a){14 a.id==k});14 b},9).compact()},39:11(k){14 k?9.109(k):9.19},34:11(k){14 9.39(k).105(11(i){14!i.30(9.27163)},9)},52:11(e){e.108();22 c=e.99;if(!9.27(c)){if(9.21)9.24(c);54 if(9.24ed(c)){9.un24(c);9.62=90}54{9.24(c);9.58=90}if((e.shift165||e.meta165)&&9.50){22 a=9.19.73(9.50);22 b=9.19.73(c);if(a!=b){if(a>b){22 t=a;a=b;b=a}152(22 i=a;i<b;i++)9[9.50.30(9.17)?'24':'un24'](9.19[i])}}9.50=c}},71:11(e){e.108();9.62=9.58=139},47:11(e){22 i=e.99;9.32('80',i);if(!9.21){if(9.58)9.24(i);54 if(9.62)9.un24(i)}},57:11(e){9.32('145',e.99)},93:11(e){e.108()},138:11(){22 e=$E('ul'),a=9.15.15;if(125(a))a.33(11(o){e.101($E('li',{127:o}))});54 152(22 k in a)e.101($E('li',{id:k,127:a[k]}));14 e},95:11(){9.18=$E('43',{'141':9.18163}).101([$E('43',{'127':'•','141':'13-12-130'}),$E('ul')]).59(9.16,'132').51(9.107164.31(9));40.51(9.84.31(9));14 9},107164:11(e){e.108();if(9.21){22 d=9.18.dimensions();9.16.setStyle({162:(d.162+d.67)+'px',110:d.110+'px',45:d.45+'px'}).107(9.15.65,{121:9.15.68,116:9.32.31(9,'107',9)});if(!9.15.65)9.32('107',9)}},84:11(){if(9.21&&9.16.visible()){9.16.106(9.15.65,{121:9.15.68,116:9.32.31(9,'106',9)});if(!9.15.65)9.32('106',9)}},87:11(i){9.18.115('ul').36(i?i.cloneNode(90):'<li> </li>')}});40.122(11(){70.129()});40.write(\"<94 type=\\\"151/css\\\">*.13-12,*.13-12 li,*.13-12 dt,*.13-12 dd,*.13-12 ul,43.13-12-18 ul,43.13-12-18 ul li{134:0;49:0;23:91;25:91;list-94:91}*.13-12{23:112 78 #97;23-102:91;37:81-120;*37:81;*149:1;157-45:126;-140-23-82:.55;-103-23-82:.55}*.13-12 li{49:.153 1em;83:124;23-102:112 78 #97}*.13-12 li:80{25:#155}*.13-12 li.13-12-24ed{92-135:150;25:#158}*.13-12 li.13-12-27,*.13-12 li.13-12-27:80{25:#97;96:#777;83:123}dl.13-12 dt{49:.153 .111;83:123;92-135:150;92-94:italic;96:#444;25:#155;23-102:112 78 #97}dl.13-12 dd li{49-110:1.111}*.13-12-131{-140-160-128:#156 .55 .55 .111;-103-160-128:#156 .55 .55 .111;37:91;position:absolute;25:#FFF}43.13-12-18{23:112 78 #97;-140-23-82:.55;-103-23-82:.55;37:81-120;*37:81;*149:1;*45:126;vertical-142:middle;157-45:126;83:124;67:1.159}43.13-12-18 43.13-12-130{92-family:Arial;float:13;45:0.154;25:#158;151-142:center;67:100%;146-67:0.154;92-size:200%;96:#888;23-110:112 78 #97}43.13-12-18:80 43{96:#666}43.13-12-18 ul{37:120;45:auto;134-13:55;overflow:hidden}43.13-12-18 ul li{146-67:1.159;49:0 .111}</94>\");",",,,,,,,,,this,,function,selectable,right,return,options,element,selectedClass,container,items,,isSingle,var,border,select,background,selected,disabled,disabledClass,stopObserving,hasClass,bind,fire,each,mapEnabled,unselect,update,display,removeClass,mapOrAll,document,null,addClass,div,,width,value,mouseover,calcValue,padding,_prevItem,onClick,mousedown,refresh,else,2em,_selectable,mouseout,_massSelect,insertTo,onMouseover,setValue,_massRemove,onMousedown,singleClass,fxName,,height,fxDuration,onMouseout,Selectable,mouseup,disable,indexOf,itemValue,onMouseup,arguments,,solid,containerClass,hover,inline,radius,cursor,hideList,onSelect,onChange,showItem,,isString,true,none,font,click,style,buildSingle,color,CCC,enable,target,,insert,bottom,webkit,$super,filter,hide,show,stop,map,left,5em,1px,baseClass,assignTo,first,onFinish,parseIds,showList,multiple,block,duration,onReady,default,pointer,isArray,10em,html,shadow,rescan,handle,single,before,change,margin,weight,isHash,apply,build,false,moz,class,align,every,curry,leave,line,init,last,zoom,bold,text,for,3em,8em,EEE,AAA,min,DDD,6em,box,new,top,Class,List,Key".split(",")));
|
@@ -24,8 +24,8 @@ var Slider = new Class(Observer, {
|
|
24
24
|
round: 0 // the number of symbols after the decimal pointer
|
25
25
|
},
|
26
26
|
|
27
|
-
rescan: function() {
|
28
|
-
|
27
|
+
rescan: function(scope) {
|
28
|
+
($(scope) || document).select('div.right-slider').each(function(element) {
|
29
29
|
if (!element._slider) {
|
30
30
|
new Slider(element);
|
31
31
|
}
|
@@ -284,8 +284,8 @@ var Slider = new Class(Observer, {
|
|
284
284
|
/**
|
285
285
|
* Document onReady hook for sliders
|
286
286
|
*
|
287
|
-
* Copyright (C) Nikolay V. Nemshilov aka St.
|
287
|
+
* Copyright (C) 2009 Nikolay V. Nemshilov aka St.
|
288
288
|
*/
|
289
|
-
document.onReady(Slider.rescan);
|
289
|
+
document.onReady(function() { Slider.rescan(); });
|
290
290
|
|
291
291
|
document.write("<style type=\"text/css\">div.right-slider,div.right-slider-handle{margin:0;padding:0;border:none;background:none}div.right-slider{height:0.4em;width:20em;border:1px solid #CCC;background:#EEE;-moz-border-radius:.2em;-webkit-border-radius:.2em;position:relative;margin:.6em 0;display:inline-block;*display:inline;*zoom:1;vertical-align:middle}div.right-slider-handle{position:absolute;left:0;top:0;cursor:pointer;width:4pt;height:1em;margin-top:-0.4em;margin-left:0.1em;background:#CCC;border:1px solid #AAA;-moz-border-radius:.2em;-webkit-border-radius:.2em}div.right-slider-vertical{height:10em;width:0.4em;margin:0 .3em}div.right-slider-vertical div.right-slider-handle{margin:0;margin-left:-0.4em;margin-top:0.1em;height:4pt;width:1em}</style>");
|
data/javascripts/right-slider.js
CHANGED
@@ -4,4 +4,4 @@
|
|
4
4
|
* Copyright (C) 2009 Nikolay V. Nemshilov aka St.
|
5
5
|
*/
|
6
6
|
if (!self.RightJS || !self.Draggable) throw "Gimme RightJS w/ DnD";
|
7
|
-
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})("14 50=78 83(Observer,{extend:{EVENTS:$w('69'),Options:{32:0,
|
7
|
+
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})("14 50=78 83(Observer,{extend:{EVENTS:$w('69'),Options:{32:0,47:100,38:0,21:65,25:'x',39:65,55:0},67:9(s){($(s)||33).select('30.17-12').each(9(e){if(!e._12)78 50(e)})}},75ialize:9(){14 a=$A(arguments);7.13=(a[0]&&!70(a[0]))?$(a.shift()):7.74();7.$super(70(a[0])?a[0]:eval('('+7.13.get('data-12-8')+')'));if(7.8.39)7.54(7.8.39);7.13._12=7.75()},destroy:9(){7.16.undo82();delete(7.13._12);18 7},24:9(v){14 v=isString(v)?v.64():v;14 b=Math.pow(10,7.8.55);v=(v*b).55()/b;if(7.8.38){14 s=7.8.38;14 d=v % s;v=d<s/2?v-d:v-d+s}if(v<7.8.32)v=7.8.32;if(v>7.8.47)v=7.8.47;7.40(v);if(v!==7.21)7.fire('69',7.21=v);18 7},getValue:9(){18 7.21},53:9(v){18 7.36().24([v,7.8.21,7.8.32].compact()[0])},52:9(e,p){7.13.52(e,p);18 7.53(7.21)},54:9(b){14 a=9(e,v){if(e=$(e)){if(v===undefined||v===65)v='';e[e.24?'24':'39'](''+v)}}.72(b);14 c=9(e,o){14 e=$(e);if(e&&e.43)e.43(9(){7.24(e.21)}.45(o))}.72(b);if($(b)){a(7.21);c(7)}51 33.60(9(){a(7.21);c(7)}.45(7));18 7.43(a)},75:9(){7.16=7.13.first('30.17-12-16').make82({onBefore:7.63.45(7),onDrag:7.59.45(7)});7.13.onClick(7.61.45(7));if(7.8.25=='y')7.13.add83('17-12-29');51 7.8.25=7.13.has83('17-12-29')?'y':'x';if(7.46=(RightJS.version<'1.5.0'&&!7.16.getBoundingClientRect)){14 p=7.13;14 o=7.16.11;7.16.11=9(){14 d=o.call(7);14 s=p.11();d.22+=s.22;d.19+=s.19;18 d}}18 7.53()},74:9(){18 $E('30',{'71':'17-12'}).insert($E('30',{'71':'17-12-16'}))},61:9(a){a.s22();7.36().40(7.21);14 p=a.44();14 e=7.11;14 p=(7.15?p.x-e.19:p.y-e.22)-7.42;if(p>7.28)p=7.28;51 if(p<0)p=0;7.34(p)},59:9(d,e){7.34(d.13.48[7.15?'19':'22'].64())},63:9(d){7.36().40(7.21);14 o=7.42;14 e=7.11;14 a=d.8;a.37={};if((a.axis=7.8.25)=='x'){a.37.x=[e.19+o,e.19+e.31-o];if(7.46)a.37.x[0]-=e.19}51{a.37.y=[e.22+o,e.22+e.27-o];if(7.46)a.37.y[0]-=e.22}if(7.8.38)a.38=7.28/(7.8.47-7.8.32)*7.8.38},34:9(p){if(!7.15)p=7.28-p;14 v=p/7.28*(7.8.47-7.8.32)+7.8.32;7.24(v)},40:9(v){14 p=7.28/(7.8.47-7.8.32)*(v-7.8.32);if(!7.15)p=7.28-p;7.16.48[7.15?'19':'22']=p+'px';18 7},36:9(){14 h=7.16.setStyle({19:'0',22:'0'}).11();7.11=7.13.11();7.15=7.8.25=='x';7.42=7.15?h.19-7.11.19:h.22-7.11.22;7.28=(7.15?7.11.31-h.31:7.11.27-h.27)-7.42*2;18 7}});33.60(9(){50.67()});33.write(\"<48 type=\\\"text/css\\\">30.17-12,30.17-12-16{23:0;padding:0;26:76;35:76}30.17-12{27:0.62;31:20em;26:81 73 #77;35:#EEE;-79-26-41:.56;-66-26-41:.56;44:relative;23:.6em 0;58:68-block;*58:68;*zoom:1;29-align:middle}30.17-12-16{44:absolute;19:0;22:0;cursor:pointer;31:80;27:57;23-22:-0.62;23-19:0.57;35:#77;26:81 73 #AAA;-79-26-41:.56;-66-26-41:.56}30.17-12-29{27:10em;31:0.62;23:0 .3em}30.17-12-29 30.17-12-16{23:0;23-19:-0.62;23-22:0.57;27:80;31:57}</48>\");",",,,,,,,this,options,function,,dimensions,slider,element,var,horizontal,handle,right,return,left,,value,top,margin,setValue,direction,border,height,space,vertical,div,width,min,document,setPosition,background,precalc,range,snap,update,moveTo,radius,offset,onChange,position,bind,konqFix,max,style,_slider,Slider,else,insertTo,reset,assignTo,round,2em,1em,display,dragged,onReady,clicked,4em,prepare,toFloat,null,webkit,rescan,inline,change,isHash,class,curry,solid,build,init,none,CCC,new,moz,4pt,1px,Draggable,Class".split(",")));
|
@@ -34,11 +34,11 @@ var Sortable = new Class(Observer, {
|
|
34
34
|
},
|
35
35
|
|
36
36
|
// scans through the page for auto-discoverable sortables
|
37
|
-
rescan: function() {
|
37
|
+
rescan: function(scope) {
|
38
38
|
var key = Sortable.Options.relName;
|
39
39
|
var reg = new RegExp('^'+key+'\\[(.+?)\\]');
|
40
40
|
|
41
|
-
|
41
|
+
($(scope) || document).select('ul[rel^="'+key+'"], ol[rel^="'+key+'"]').each(function(element) {
|
42
42
|
if (!element._sortable) {
|
43
43
|
var data = element.get('data-'+key+'-options');
|
44
44
|
var options = eval('('+data+')') || {};
|
@@ -89,6 +89,9 @@ var Sortable = new Class(Observer, {
|
|
89
89
|
item.current_position = index;
|
90
90
|
});
|
91
91
|
}
|
92
|
+
|
93
|
+
// resetting the left/top positions so it didn't jump next time
|
94
|
+
element.setStyle({left:'auto', top: 'auto'});
|
92
95
|
},
|
93
96
|
|
94
97
|
// tries to send an Xhr request about the element relocation
|
@@ -152,19 +155,21 @@ var Sortable = new Class(Observer, {
|
|
152
155
|
// the droppable options
|
153
156
|
var drop_options = {
|
154
157
|
overlap: direction,
|
155
|
-
|
158
|
+
containment: items,
|
156
159
|
onHover: function(draggable) {
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
160
|
+
if (items.include(draggable.element)) {
|
161
|
+
// calculating the swapping direction
|
162
|
+
var drag_dims = draggable.element.dimensions();
|
163
|
+
var this_dims = this.element.dimensions();
|
164
|
+
|
165
|
+
var before = draggable.axisY ? (
|
166
|
+
drag_dims.top > this_dims.top
|
167
|
+
) : (
|
168
|
+
drag_dims.left > this_dims.left
|
169
|
+
);
|
170
|
+
|
171
|
+
this.element.insert(draggable.clone, before ? 'before' : 'after');
|
172
|
+
}
|
168
173
|
}
|
169
174
|
};
|
170
175
|
|
@@ -188,9 +193,9 @@ var Sortable = new Class(Observer, {
|
|
188
193
|
/**
|
189
194
|
* Document level hooks for sortables
|
190
195
|
*
|
191
|
-
* Copyright (C) Nikolay V. Nemshilov aka St.
|
196
|
+
* Copyright (C) 2009 Nikolay V. Nemshilov aka St.
|
192
197
|
*/
|
193
|
-
document.onReady(Sortable.rescan);
|
198
|
+
document.onReady(function() { Sortable.rescan(); });
|
194
199
|
|
195
200
|
/**
|
196
201
|
* Element level features for the Sortable unit
|
@@ -6,4 +6,4 @@
|
|
6
6
|
* Copyright (C) Nikolay V. Nemshilov aka St.
|
7
7
|
*/
|
8
8
|
if (!Draggable) throw "Gimme Draggable";
|
9
|
-
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})("
|
9
|
+
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})("6 9=26 Class(Observer,{extend:{EVENTS:$w('32'),24:{13:'20',39:'li',23:null,16:'put',37:{},28:'id',22:'position',29:42,27:'sortable'},31:3(s){6 k=9.24.27;6 r=26 RegExp('^'+k+'\\\\[(.+?)\\\\]');($(s)||21).select('ul[35^=\"'+k+'\"], ol[35^=\"'+k+'\"]').18(3(e){if(!e.8){6 d=e.43('data-'+k+'-4');6 o=eval('('+d+')')||{};6 u=e.43('35').36(r);if(u)o.23=u[1];26 9(e,o)}})}},41ialize:3(e,o){2.5=$(e);2.$super(o);2.5.8=2.41().onUpdate('30')},25:3(){2.10.18(3(i){i.undo44().undo45()});delete(2.5.8);12 2},34:3(e){6 b=2.10();6 p=b.indexOf(e);if(p>-1&&p!=e.7){2.fire('32',e,p);b.18(3(a,i){a.7=i})}e.set47({19:'20',38:'20'})},30:3(e,a){if(2.4.23){6 u=2.4.23,p={};6 o=17.33({16:2.4.16,11:{}},2.4.37);6 i=e.id||'';if(2.4.29&&i)i=i.36(/\\d+/)||'';if(u.14('%{id}'))u=u.replace('%{id}',i);40 p[2.4.28]=i;p[2.4.22]=a;if(is46(o.11))o.11+='&'+17.toQuery46(p);40 o.11=17.33(o.11,p);37.load(u,o)}},41:3(){6 h=2.10();if(h.length){6 c=2.34.bind(2);6 e=2.4.13!='20'?2.4.13:['19','right'].14(h[0].4347('float'))?'x':'y';6 f={range:2.5,axis:e,revert:42,revertDuration:0,onS38:3(){c(2.5)}};6 g={overlap:e,containment:h,onHover:3(a){if(h.14(a.5)){6 d=a.5.15();6 t=2.5.15();6 b=a.axisY?(d.38>t.38):(d.19>t.19);2.5.insert(a.clone,b?'before':'after')}}};h.18(3(a,i){a.make44(f).make45(g).7=i})}12 2},10:3(){12 2.5.subNodes(2.4.39)}});21.onReady(3(){9.31()});Element.addMethods({make9:3(o){26 9(2,o);12 2},undo9:3(){if(2.8)2.8.25();12 2}});",",,this,function,options,element,var,current_position,_sortable,Sortable,getItems,params,return,direction,include,dimensions,method,Object,each,left,auto,document,posParam,url,Options,destroy,new,relName,idParam,parseId,tryXhr,rescan,update,merge,moved,rel,match,Xhr,top,tags,else,init,true,get,Draggable,Droppable,String,Style".split(",")));
|