right-rails 0.6.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +8 -0
- data/README.rdoc +71 -0
- data/Rakefile +144 -14
- data/generators/right_rails/right_rails_generator.rb +18 -21
- data/init.rb +11 -32
- data/lib/generators/right_rails/right_rails_generator.rb +27 -0
- data/lib/generators/right_rails/templates/iframed.html.erb +10 -0
- data/lib/right-rails.rb +1 -1
- data/lib/right_rails/config.rb +278 -0
- data/lib/right_rails/controller_extensions.rb +10 -5
- data/lib/right_rails/helpers/basic.rb +10 -66
- data/lib/right_rails/helpers/forms.rb +141 -139
- data/lib/right_rails/helpers/misc.rb +45 -67
- data/lib/right_rails/helpers/rails.rb +40 -105
- data/lib/right_rails/helpers.rb +364 -1
- data/lib/right_rails/java_script_generator.rb +34 -24
- data/lib/right_rails.rb +6 -1
- data/{images → public/images}/colorpicker.png +0 -0
- data/{images → public/images}/resizable.png +0 -0
- data/public/javascripts/right/autocompleter-src.js +612 -0
- data/public/javascripts/right/autocompleter.js +18 -0
- data/public/javascripts/right/calendar-src.js +1448 -0
- data/public/javascripts/right/calendar.js +36 -0
- data/public/javascripts/right/colorpicker-src.js +967 -0
- data/public/javascripts/right/colorpicker.js +26 -0
- data/{javascripts/right-dnd-src.js → public/javascripts/right/dnd-src.js} +86 -52
- data/public/javascripts/right/dnd.js +20 -0
- data/{javascripts/right-effects-src.js → public/javascripts/right/effects-src.js} +90 -45
- data/public/javascripts/right/effects.js +17 -0
- data/{javascripts/right-ui-i18n-de.js → public/javascripts/right/i18n/de.js} +7 -7
- data/{javascripts/right-ui-i18n-en-us.js → public/javascripts/right/i18n/en-us.js} +1 -1
- data/{javascripts/right-ui-i18n-es.js → public/javascripts/right/i18n/es.js} +7 -7
- data/{javascripts/right-ui-i18n-fr.js → public/javascripts/right/i18n/fr.js} +7 -7
- data/{javascripts/right-ui-i18n-hu.js → public/javascripts/right/i18n/hu.js} +7 -7
- data/{javascripts/right-ui-i18n-jp.js → public/javascripts/right/i18n/jp.js} +7 -7
- data/{javascripts/right-ui-i18n-nl.js → public/javascripts/right/i18n/nl.js} +7 -7
- data/{javascripts/right-ui-i18n-pt-br.js → public/javascripts/right/i18n/pt-br.js} +7 -7
- data/{javascripts/right-ui-i18n-ru.js → public/javascripts/right/i18n/ru.js} +7 -7
- data/{javascripts/right-ui-i18n-ua.js → public/javascripts/right/i18n/ua.js} +17 -12
- data/public/javascripts/right/in-edit-src.js +352 -0
- data/public/javascripts/right/in-edit.js +13 -0
- data/public/javascripts/right/json-src.js +160 -0
- data/public/javascripts/right/json.js +10 -0
- data/public/javascripts/right/lightbox-src.js +881 -0
- data/public/javascripts/right/lightbox.js +24 -0
- data/{javascripts/right-rails-src.js → public/javascripts/right/rails-src.js} +195 -171
- data/public/javascripts/right/rails.js +14 -0
- data/public/javascripts/right/rater-src.js +366 -0
- data/public/javascripts/right/rater.js +13 -0
- data/public/javascripts/right/resizable-src.js +420 -0
- data/public/javascripts/right/resizable.js +15 -0
- data/public/javascripts/right/selectable-src.js +687 -0
- data/public/javascripts/right/selectable.js +22 -0
- data/public/javascripts/right/slider-src.js +377 -0
- data/public/javascripts/right/slider.js +14 -0
- data/public/javascripts/right/sortable-src.js +392 -0
- data/public/javascripts/right/sortable.js +16 -0
- data/public/javascripts/right/tabs-src.js +1123 -0
- data/public/javascripts/right/tabs.js +29 -0
- data/public/javascripts/right/tooltip-src.js +307 -0
- data/public/javascripts/right/tooltip.js +12 -0
- data/public/javascripts/right/uploader-src.js +283 -0
- data/public/javascripts/right/uploader.js +13 -0
- data/{javascripts → public/javascripts}/right-olds-src.js +134 -186
- data/public/javascripts/right-olds.js +18 -0
- data/public/javascripts/right-safe-src.js +161 -0
- data/public/javascripts/right-safe.js +8 -0
- data/{javascripts → public/javascripts}/right-src.js +2558 -1750
- data/public/javascripts/right.js +92 -0
- data/spec/lib/right_rails/config_spec.rb +133 -0
- data/spec/lib/right_rails/controller_extensions_spec.rb +1 -1
- data/spec/lib/right_rails/helpers/basic_spec.rb +77 -66
- data/spec/lib/right_rails/helpers/forms_spec.rb +231 -33
- data/spec/lib/right_rails/helpers/misc_spec.rb +94 -26
- data/spec/lib/right_rails/helpers/rails_spec.rb +42 -7
- data/spec/lib/right_rails/helpers_spec.rb +125 -0
- data/spec/lib/right_rails/java_script_generator_spec.rb +30 -0
- data/spec/rcov.opts +3 -0
- data/spec/spec_helper.rb +12 -7
- metadata +70 -61
- data/README.textile +0 -69
- data/javascripts/right-autocompleter-src.js +0 -318
- data/javascripts/right-autocompleter.js +0 -9
- data/javascripts/right-behavior-src.js +0 -261
- data/javascripts/right-behavior.js +0 -8
- data/javascripts/right-calendar-src.js +0 -946
- data/javascripts/right-calendar.js +0 -9
- data/javascripts/right-colorpicker-src.js +0 -635
- data/javascripts/right-colorpicker.js +0 -9
- data/javascripts/right-dnd.js +0 -9
- data/javascripts/right-effects.js +0 -6
- data/javascripts/right-events-src.js +0 -321
- data/javascripts/right-events.js +0 -6
- data/javascripts/right-in-edit-src.js +0 -194
- data/javascripts/right-in-edit.js +0 -6
- data/javascripts/right-json-src.js +0 -141
- data/javascripts/right-json.js +0 -6
- data/javascripts/right-lightbox-src.js +0 -651
- data/javascripts/right-lightbox.js +0 -9
- data/javascripts/right-olds.js +0 -9
- data/javascripts/right-rails.js +0 -9
- data/javascripts/right-rater-src.js +0 -253
- data/javascripts/right-rater.js +0 -9
- data/javascripts/right-resizable-src.js +0 -336
- data/javascripts/right-resizable.js +0 -9
- data/javascripts/right-selectable-src.js +0 -565
- data/javascripts/right-selectable.js +0 -7
- data/javascripts/right-slider-src.js +0 -288
- data/javascripts/right-slider.js +0 -7
- data/javascripts/right-sortable-src.js +0 -225
- data/javascripts/right-sortable.js +0 -9
- data/javascripts/right-tabs-src.js +0 -937
- data/javascripts/right-tabs.js +0 -6
- data/javascripts/right-tooltips-src.js +0 -195
- data/javascripts/right-tooltips.js +0 -9
- data/javascripts/right-uploader-src.js +0 -167
- data/javascripts/right-uploader.js +0 -9
- data/javascripts/right.js +0 -7
data/javascripts/right-olds.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* This is old browsers support patch for RightJS
|
3
|
-
*
|
4
|
-
* The library released under terms of the MIT license
|
5
|
-
* Visit http://rightjs.org for more details
|
6
|
-
*
|
7
|
-
* Copyright (C) 2008-2010 Nikolay V. Nemshilov
|
8
|
-
*/
|
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})("if(56.66){$=(7(o){8 7(i){9 e=o(i);if(e!==58&&50(i)&&e.id!==i)e=$$('#'+i)[0];8 e?14.23(e):e}})($);46(21,{create14:(7(o){8 7(t){8 14.23(o(t))}})(21.create14)});46(14,{23:7(e){if(e&&e.11&&!e.set){46(e,14.53,29);if(60.45)switch(e.11){39 'FORM':45.64(e);35;39 'INPUT':39 'SELECT':39 'BUTTON':39 'TEXTAREA':45.14.64(e);35}}8 e}});14.34((7(){9 o=14.53.49;8{49:7(a,c){8 o.22(12,a,c).each(14.23)}}})())}if(!$E('p').getBoundingClientRect){14.34({27:7(){9 l=12.offsetLeft,t=12.offsetTop,a=12.51('27'),p=12.31,b=12.ownerDocument.body;15(p&&p.11){if(p===b||p.51('27')!='static'){if(p!==b||a!='absolute'){9 s=p.27();l+=s.x;t+=s.y}35}p=p.31}8{x:l,y:t}}});45.34({get14s:7(){8 12.37('input,37,t64area,button')}})}if(!21.querySelector)14.34((7(){9 H={' ':7(e,t){8 $A(e.get14sByTagName(t))},'>':7(e,t){9 r=[],n=e.26Child;15(n){if(t=='*'||n.11==t)r.30(n);n=n.19}8 r},'+':7(e,t){15(e=e.19)if(e.11)8(t=='*'||e.11==t)?[e]:[];8[]},'~':7(e,t){9 r=[];15(e=e.19)if(t=='*'||e.11==t)r.30(e);8 r}};9 G={57:7(){8 12.57},47:7(){8 12.47},empty:7(){8!(12.innerT64||12.innerHTML||12.t64Content||'').13},'26-16':7(t){9 n=12;15(n=n.20)if(n.11&&(!t||n.11==t))8 24;8 29},'26-of-44':7(){8 17[1]['26-16'].22(12,12.11)},'42-16':7(t){9 n=12;15(n=n.19)if(n.11&&(!t||n.11==t))8 24;8 29},'42-of-44':7(){8 17[1]['42-16'].22(12,12.11)},'59-16':7(t,m){8 m['26-16'].22(12,t)&&m['42-16'].22(12,t)},'59-of-44':7(){8 17[1]['59-16'].22(12,12.11,17[1])},'63-16':7(d,c,t){if(!12.31)8 24;d=d.toLower68();if(d=='n')8 29;if(d.25('n')){9 a=b=0;if(m=d.28(/^([+-]?\\d*)?n([+-]?\\d*)?$/)){a=m[1]=='-'?-1:48(m[1],10)||1;b=48(m[2],10)||0}9 i=1,n=12;15((n=n.20))if(n.11&&(!t||n.11==t))i++;8(i-b)% a==0&&(i-b)/a>=0}38 8 c['61'].22(12,d.62()-1,c,t)},'63-of-44':7(n){8 17[1]['63-16'].22(12,n,17[1],12.11)},61:7(a,m,t){a=50(a)?a.62():a;9 n=12,c=0;15((n=n.20))if(n.11&&(!t||n.11==t)&&++c>a)8 24;8 c==a}};9 A=/((?:\\((?:\\([^()]+\\)|[^()]+)+\\)|\\[(?:\\[[^[\\]]*\\]|['\"][^'\"]*['\"]|[^[\\]'\"]+)+\\]|\\\\.|[^ >+~,(\\[\\\\]+)+|[>+~])(\\s*,\\s*)?/g;9 E=/#([\\w\\-_]+)/;9 L=/^[\\w\\*]+/;9 C=/\\.([\\w\\-\\._]+)/;9 F=/:([\\w\\-]+)(\\((.+?)\\))*$/;9 w=/\\[((?:[\\w-]*:)?[\\w-]+)\\s*(?:([!^$*~|]?=)\\s*((['\"])([^\\4]*?)\\4|([^'\"][^\\]]*?)))?\\]/;9 q={};7 x(b){if(!q[b]){9 i,t,c,a,p,v,m,d={};15(m=b.28(w)){a=a||{};a[m[1]]={o:m[2],v:m[5]||m[6]};b=b.33(m[0],'')}if(m=b.28(F)){p=m[1];v=m[3]==''?58:m[3];b=b.33(m[0],'')}i=(b.28(E)||[1,58])[1];t=(b.28(L)||'*').toString().toUpper68();c=(b.28(C)||[1,''])[1].40('.').without('');d.65=t;if(i||c.13||a||p){9 f='7(y){9 e,r=[];32(9 z=0,x=y.13;z<x;z++){e=y[z];55}8 r}';9 e=7(c){f=f.33('55',c+'55')};if(i)e('if(e.id!=i)18;');if(c.13)e('if(e.43){9 n=e.43.40(\" \");if(n.13==1&&c.54(n[0])==-1)18;38{32(9 i=0,l=c.13,b=24;i<l;i++)if(n.54(c[i])==-1){b=29;35;}if(b)18;}}38 18;');if(a)e('9 p,o,v,b=24;32 (9 k in a){p=e.getAttribute(k)||\"\";o=a[k].o;v=a[k].v;if((o==\"=\"&&p!=v)||(o==\"*=\"&&!p.25(v))||(o==\"^=\"&&!p.starts67(v))||(o==\"$=\"&&!p.ends67(v))||(o==\"~=\"&&!p.40(\" \").25(v))||(o==\"|=\"&&!p.40(\"-\").25(v))){b=29;35;}}if(b){18;}');if(p&&G[p]){9 s=G;e('if(!s[p].22(e,v,s))18;')}d.41=eval('['+f.33('55','r.30(e)')+']')[0]}q[b]=d}8 q[b]};9 M={};7 y(g){9 h=g.join('');if(!M[h]){32(9 i=0;i<g.13;i++)g[i][1]=x(g[i][1]);9 c=$uid;9 k=7(e){9 b=[],a=[],u;32(9 i=0,l=e.13;i<l;i++){u=c(e[i]);if(!a[u]){b.30(e[i]);a[u]=29}}8 b};9 d=7(e,a){9 r=H[a[0]](e,a[1].65);8 a[1].41?a[1].41(r):r};M[h]=7(e){9 f,s;32(9 i=0,a=g.13;i<a;i++){if(i==0)f=d(e,g[i]);38{if(i>1)f=k(f);32(9 j=0;j<f.13;j++){s=d(f[j],g[i]);s.52(1);s.52(j);f.splice.apply(f,s);j+=s.13-3}}}8 g.13>1?k(f):f}}8 M[h]};9 J={},B={};7 K(c){if(!J[c]){A.42Index=0;9 b=[],a=[],r=' ',m,t;15(m=A.exec(c)){t=m[1];if(t=='+'||t=='>'||t=='~')r=t;38{a.30([r,t]);r=' '}if(m[2]){b.30(y(a));a=[]}}b.30(y(a));J[c]=b}8 J[c]};7 I(e,c){9 s=K(c),r=[];32(9 i=0,l=s.13;i<l;i++)r=r.concat(s[i](e));if(56.66)r.32Each(14.23);8 r};9 D={26:7(c){8 12.37(c).26()},37:7(c){8 I(12,c||'*')}};46(21,D);60.$$=7(c){8 I(21,c||'*')};8 D})());",",,,,,,,function,return,var,,tagName,this,length,Element,while,child,arguments,continue,nextSibling,previousSibling,document,call,prepare,false,includes,first,position,match,true,push,parentNode,for,replace,include,break,createElement,select,else,case,split,filter,last,className,type,Form,$ext,disabled,parseInt,rCollect,isString,getStyle,unshift,Methods,indexOf,_f_,Browser,checked,null,only,window,index,toInt,nth,ext,tag,OLD,With,Case".split(",")));
|
data/javascripts/right-rails.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Ruby On Rails common Ajax operations conventional wrapper
|
3
|
-
* and underscored aliases for core methods
|
4
|
-
*
|
5
|
-
* http://github.com/MadRabbit/right-rails
|
6
|
-
*
|
7
|
-
* Copyright (C) 2009-2010 Nikolay V. Nemshilov
|
8
|
-
*/
|
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})("7 RR={6:{17at:'js',37:'flashes',42:'slide',14:3200,1096:65,31:'86',19Fx:'86',1995:'73',27:'.52_edit',23:'.52_delete',1510097:65},update_flash:4(c){7 e=$(5.6.37);if(e)5.11(e,c).24();8 5},24:4(){if(5.6.14>-1){7 e=$(5.6.37);if(e&&e.visible())e.67.64(e,5.6.42).delay(5.6.14)}8 5},10:4(i){if($(i)&&5.6.1096)$(i).10();8 5},19:4(a,w,i){7 p=i||5.6.1995,n,c=$(a).19(w,p);switch(p){51 '73':n=c.subNodes().last();40;51 'top':n=c.39();40;51 'be93e':n=c.prev();40;51 'after':n=c.next();40}if(n&&5.6.19Fx)n.67().show(5.6.19Fx,{55:5.10.64(5,n)});34 5.10(n);8 5.15(a)},11:4(i,s){$(i).11(s);8 5.10(i).15(i)},43:4(i){7 e=$(i);if(e){7 r=e.43.64(e);if(5.6.31)e.67(5.6.31,{55:r});34 r()}},16:4(i){7 f=$(i);if(f)f.remotize().enable().71+='.'+5.6.17at;8 5},11_17:4(i,s){7 f=$(i);if(f){f.11(s);5.16(i)}8 5.15(i)},show_17_93:4(i,s){$(i).select('17').49('43');$(i).19(s);8 5.16($(i).39('17')).15(i)},30:4(e){7 t=e.tar29,l=[t].75(t.56()).39('38','a');if(l){if(l.38(5.6.27)){e.36();92.83(l.66+'.'+5.6.17at)}34 if(l.38(5.6.23)&&l.94('59')){e.36();eval('({f:'+l.59.to68().11('.45','.85')+'})').f.call(l)}}},15:4(s){$w('Draggable Droppable Tabs Slider Selectable').49(4(n){if(n in 89)89[n].15(5.6.1510097?s:90)},5);8 5}};(4(){7 u=4(a,e){7 m=e.29('35-58');if(m&&!58(m)){a.36();8 65}};7 c=4(e,o){8 70.merge({onCreate:4(){e.50('52:83ing',5)},onComplete:4(){e.50('52:complete',5)},onSuccess:4(){e.50('52:success',5)},onFailure:4(){e.50('52:failure',5)}},o)};7 g=4(e,l){7 m=l.29('35-44'),r=l.29('35-76');if(u(e,l))8;if(m||r)e.36();if(r)92.83(l.66,c(l,{44:m||'29',57:l.29('35-57')}));34 if(m){7 p=$$('84[48=88-param]')[0],t=$$('84[48=88-token]')[0],f=$E('17',{71:l.66,44:'post'});if(p&&t)f.19('<79 63=\"74\" 48=\"'+p.29('62')+'\" 81=\"'+t.29('62')+'\" />');f.19('<79 63=\"74\" 48=\"_44\" 81=\"'+m+'\"/>').19To(18.body).45()}};7 d=4(e,b){if(!u(e,b)&&$(b.17).94('35-76')){e.36();b.17.85(c(b.17))}};18.on({80:4(e){7 t=e.tar29,f=t.17,l=[t].75(t.56()).39('38','a');if(f&&['45','image'].60(t.63))d(e,t);34 if(l)g(e,l)},keydown:4(e){7 t=e.tar29,f=t.17;if(f&&t.tagName==='INPUT'&&e.keyCode==13)d(e,t)}})})();18.on({ready:4(){RR.24()},80:4(e){RR.30(e)}});[68.9,78.9,Function.9,70,6,53,53.9,window,18].49(4(o){93(7 k in o)try{if(/[A-Z]/.87(k)&&63of(o[k])==='4'){7 u=k.41();if(o[u]===90||o[u]===undefined)o[u]=o[k]}}catch(e){}});[61,Event,91,91.61].49(4(o){7 a={},m=o.Methods;93(7 k in m)if(/[A-Z]/.87(k)&&63of(m[k])==='4')a[k.41()]=m[k];o.60(a)});69(68.9,{54:'25',28:'12',to_f:'toFloat',to_i:'toInt',gsub:'11',down51:'toLower98',up51:'toUpper98',82:'25',77:'12',strip:'trim'});69(78.9,{collect:'map',detect:'filter',54:'25',28:'12',82:'25',77:'12'});",",,,,function,this,Options,var,return,prototype,highlight,replace,lastIndexOf,,flashHideDelay,rescan,remotize_form,form,document,insert,,highlightUpdates,rescanWithScopes,linkToAjaxDelete,hide_flash,indexOf,insertPosition,linkToAjaxEdit,last_index_of,get,process_click,removeFx,,insertFx,else,data,stop,flashId,match,first,break,underscored,flashHideFx,remove,method,submit,target,format,name,each,fire,case,ajax,Observer,index_of,onFinish,parents,spinner,confirm,onclick,include,Element,content,type,bind,true,href,hide,String,$alias,Object,action,typeof,bottom,hidden,concat,remote,rindex,Array,input,click,value,index,load,meta,send,fade,test,csrf,self,null,Form,Xhr,for,has,Position,Updates,Scopes,Case,,With".split(",")));
|
@@ -1,253 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Simple rating script
|
3
|
-
*
|
4
|
-
* Visit http://rightjs.org/ui/rater for details
|
5
|
-
*
|
6
|
-
* Copyright (C) 2009-2010 Nikolay V. Nemshilov
|
7
|
-
*/
|
8
|
-
if (!self.RightJS) throw "Gimme RightJS";
|
9
|
-
/**
|
10
|
-
* The Rating widget
|
11
|
-
*
|
12
|
-
* Copyright (C) 2009-2010 Nikolay V. Nemshilov
|
13
|
-
*/
|
14
|
-
var Rater = new Class(Observer, {
|
15
|
-
extend: {
|
16
|
-
EVENTS: $w('change hover send'),
|
17
|
-
|
18
|
-
Options: {
|
19
|
-
size: 5, // number of stars in the line
|
20
|
-
value: null, // default value
|
21
|
-
update: null, // an element to update
|
22
|
-
|
23
|
-
disabled: false, // if it should be disabled
|
24
|
-
disableOnVote: false, // if it should be disabled when user clicks a value
|
25
|
-
|
26
|
-
url: null, // an url to send results with AJAX
|
27
|
-
param: 'rate', // the value param name
|
28
|
-
Xhr: null // additional Xhr options
|
29
|
-
},
|
30
|
-
|
31
|
-
// DEPRECATED: searches and initializes rating units
|
32
|
-
rescan: function(scope) {}
|
33
|
-
},
|
34
|
-
|
35
|
-
/**
|
36
|
-
* basic constructor
|
37
|
-
*
|
38
|
-
* @param mixed element reference or an options hash
|
39
|
-
* @param Object options hash
|
40
|
-
*/
|
41
|
-
initialize: function() {
|
42
|
-
var args = $A(arguments);
|
43
|
-
|
44
|
-
this.element = (args[0] && !isHash(args[0])) ? $(args[0]) : null;
|
45
|
-
this.$super(isHash(args.last()) ? args.last() : this.element ? eval('('+this.element.get('data-rater-options')+')') : null);
|
46
|
-
|
47
|
-
if (!this.element) this.element = this.build();
|
48
|
-
|
49
|
-
if (!this.options.value)
|
50
|
-
this.options.value = this.element.select('.right-rater-glow').length;
|
51
|
-
|
52
|
-
this.element._rater = this.init();
|
53
|
-
},
|
54
|
-
|
55
|
-
/**
|
56
|
-
* Sets the element value
|
57
|
-
*
|
58
|
-
* @param Number or String value
|
59
|
-
* @return Rater this
|
60
|
-
*/
|
61
|
-
setValue: function(value) {
|
62
|
-
if (!this.disabled()) {
|
63
|
-
// converting the type and rounding the value
|
64
|
-
value = isString(value) ? value.toInt() : value;
|
65
|
-
value = isNumber(value) ? value.round() : 0;
|
66
|
-
|
67
|
-
// checking constraints
|
68
|
-
if (value > this.options.size) value = this.options.size;
|
69
|
-
else if (value < 0) value = 0;
|
70
|
-
|
71
|
-
this.highlight(value);
|
72
|
-
|
73
|
-
if (this.value != value) {
|
74
|
-
this.fire('change', this.value = value, this);
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
return this;
|
79
|
-
},
|
80
|
-
|
81
|
-
/**
|
82
|
-
* Returns the current value of the rater
|
83
|
-
*
|
84
|
-
* @return Number value
|
85
|
-
*/
|
86
|
-
getValue: function() {
|
87
|
-
return this.value;
|
88
|
-
},
|
89
|
-
|
90
|
-
/**
|
91
|
-
* Inserts the rater into the given element
|
92
|
-
*
|
93
|
-
* @param mixed element reference
|
94
|
-
* @param String optional position
|
95
|
-
* @return Rater this
|
96
|
-
*/
|
97
|
-
insertTo: function(element, position) {
|
98
|
-
this.element.insertTo(element, position);
|
99
|
-
return this;
|
100
|
-
},
|
101
|
-
|
102
|
-
/**
|
103
|
-
* Assigns the unit to work with an input element
|
104
|
-
*
|
105
|
-
* @param mixed element reference
|
106
|
-
* @return Rater this
|
107
|
-
*/
|
108
|
-
assignTo: function(element) {
|
109
|
-
var assign = function(element, value) {
|
110
|
-
if (element = $(element)) {
|
111
|
-
if (value === undefined || value === null) value = '';
|
112
|
-
element[element.setValue ? 'setValue' : 'update'](''+value);
|
113
|
-
}
|
114
|
-
}.curry(element);
|
115
|
-
|
116
|
-
var connect = function(element, object) {
|
117
|
-
var element = $(element);
|
118
|
-
if (element && element.onChange) {
|
119
|
-
element.onChange(function() {
|
120
|
-
this.setValue(element.value);
|
121
|
-
}.bind(object));
|
122
|
-
}
|
123
|
-
}.curry(element);
|
124
|
-
|
125
|
-
if ($(element)) {
|
126
|
-
assign(this.value);
|
127
|
-
connect(this);
|
128
|
-
} else {
|
129
|
-
document.onReady(function() {
|
130
|
-
assign(this.value);
|
131
|
-
connect(this);
|
132
|
-
}.bind(this));
|
133
|
-
}
|
134
|
-
|
135
|
-
return this.onChange(assign);
|
136
|
-
},
|
137
|
-
|
138
|
-
/**
|
139
|
-
* Sends an Xhr request with the current value to the options.url address
|
140
|
-
*
|
141
|
-
* @return Rater this
|
142
|
-
*/
|
143
|
-
send: function() {
|
144
|
-
if (this.options.url) {
|
145
|
-
new Xhr(this.options.url, this.options.Xhr).send(this.options.param+"="+this.value);
|
146
|
-
this.fire('send', this.value, this);
|
147
|
-
}
|
148
|
-
return this;
|
149
|
-
},
|
150
|
-
|
151
|
-
/**
|
152
|
-
* Disables the instance
|
153
|
-
*
|
154
|
-
* @return Rater this
|
155
|
-
*/
|
156
|
-
disable: function() {
|
157
|
-
this.element.addClass('right-rater-disabled');
|
158
|
-
return this;
|
159
|
-
},
|
160
|
-
|
161
|
-
/**
|
162
|
-
* Enables this instance
|
163
|
-
*
|
164
|
-
* @return Rater this
|
165
|
-
*/
|
166
|
-
enable: function() {
|
167
|
-
this.element.removeClass('right-rater-disabled');
|
168
|
-
return this;
|
169
|
-
},
|
170
|
-
|
171
|
-
/**
|
172
|
-
* Checks if the instance is disabled
|
173
|
-
*
|
174
|
-
* @return boolean
|
175
|
-
*/
|
176
|
-
disabled: function() {
|
177
|
-
return this.element.hasClass('right-rater-disabled');
|
178
|
-
},
|
179
|
-
|
180
|
-
// protected
|
181
|
-
|
182
|
-
// callback for 'hover' event
|
183
|
-
hovered: function(index) {
|
184
|
-
if (!this.disabled()) {
|
185
|
-
this.highlight(index + 1);
|
186
|
-
this.fire('hover', index + 1, this);
|
187
|
-
}
|
188
|
-
},
|
189
|
-
|
190
|
-
// callback for user-click
|
191
|
-
clicked: function(index) {
|
192
|
-
this.setValue(index + 1);
|
193
|
-
if (this.options.disableOnVote) this.disable();
|
194
|
-
this.send();
|
195
|
-
},
|
196
|
-
|
197
|
-
// callback when user moves the mouse out
|
198
|
-
leaved: function() {
|
199
|
-
this.setValue(this.value);
|
200
|
-
},
|
201
|
-
|
202
|
-
// highlights the stars
|
203
|
-
highlight: function(number) {
|
204
|
-
this.stars.each(function(element, i) {
|
205
|
-
element[number - 1 < i ? 'removeClass' : 'addClass']('right-rater-glow');
|
206
|
-
});
|
207
|
-
},
|
208
|
-
|
209
|
-
// initializes the script
|
210
|
-
init: function() {
|
211
|
-
this.stars = this.element.subNodes();
|
212
|
-
|
213
|
-
this.stars.each(function(element, index) {
|
214
|
-
element.onMouseover(this.hovered.bind(this, index))
|
215
|
-
.onClick(this.clicked.bind(this, index));
|
216
|
-
}, this);
|
217
|
-
|
218
|
-
this.element.onMouseout(this.leaved.bind(this));
|
219
|
-
this.setValue(this.options.value);
|
220
|
-
|
221
|
-
if (this.options.disabled) this.disable();
|
222
|
-
if (this.options.update) this.assignTo(this.options.update);
|
223
|
-
|
224
|
-
return this;
|
225
|
-
},
|
226
|
-
|
227
|
-
// builds the elements structure
|
228
|
-
build: function() {
|
229
|
-
var element = $E('div', {'class': 'right-rater'});
|
230
|
-
|
231
|
-
this.options.size.times(function() {
|
232
|
-
element.insert($E('div', {html: '★'}));
|
233
|
-
});
|
234
|
-
|
235
|
-
return element;
|
236
|
-
}
|
237
|
-
});
|
238
|
-
|
239
|
-
/**
|
240
|
-
* Document on-load trigger for units auto-discovery
|
241
|
-
*
|
242
|
-
* Copyright (C) 2009-2010 Nikolay V. Nemshilov
|
243
|
-
*/
|
244
|
-
document.onMouseover(function(event) {
|
245
|
-
var target = event.target, element = [target].concat(target.parents()).first('hasClass', 'right-rater');
|
246
|
-
|
247
|
-
if (element) {
|
248
|
-
var rater = element._rater || new Rater(element);
|
249
|
-
if (target.parentNode === element)
|
250
|
-
target.fire('mouseover');
|
251
|
-
}
|
252
|
-
|
253
|
-
});document.write("<style type=\"text/css\">div.right-rater,div.right-rater div{margin:0;padding:0;background:none;border:none;display:inline-block;*display:inline;*zoom:1;font-family:Arial;font-size:110%}div.right-rater{width:6em;height:1em;vertical-align:middle}div.right-rater div{float:left;width:1em;height:1em;line-height:1em;text-align:center;cursor:pointer;color:#888}div.right-rater div.right-rater-glow{color:brown;text-shadow:#666 .05em .05em .15em}div.right-rater-disabled div{cursor:default}</style>");
|
data/javascripts/right-rater.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Simple rating script
|
3
|
-
*
|
4
|
-
* Visit http://rightjs.org/ui/rater for details
|
5
|
-
*
|
6
|
-
* Copyright (C) 2009-2010 Nikolay V. Nemshilov
|
7
|
-
*/
|
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})("23 57=61 Class(Observer,{extend:{EVENTS:$w('54 67 30'),Options:{31:5,18:22,26:22,17:68,25:68,63:22,55:'rate',56:22},rescan:4(s){}},69ialize:4(){23 a=$A(arguments);2.13=(a[0]&&!51(a[0]))?$(a[0]):22;2.$super(51(a.70())?a.70():2.13?eval('('+2.13.get('data-14-12')+')'):22);if(!2.13)2.13=2.64();if(!2.12.18)2.12.18=2.13.select('.16-14-48').length;2.13._14=2.69()},20:4(v){if(!2.17()){v=isString(v)?v.toInt():v;v=isNumber(v)?v.round():0;if(v>2.12.31)v=2.12.31;71 if(v<0)v=0;2.24(v);if(2.18!=v)2.37('54',2.18=v,2)}19 2},getValue:4(){19 2.18},40:4(e,p){2.13.40(e,p);19 2},41:4(b){23 a=4(e,v){if(e=$(e)){if(v===undefined||v===22)v='';e[e.20?'20':'26'](''+v)}}.58(b);23 c=4(e,o){23 e=$(e);if(e&&e.28)e.28(4(){2.20(e.18)}.29(o))}.58(b);if($(b)){a(2.18);c(2)}71 27.onReady(4(){a(2.18);c(2)}.29(2));19 2.28(a)},30:4(){if(2.12.63){61 56(2.12.63,2.12.56).30(2.12.55+\"=\"+2.18);2.37('30',2.18,2)}19 2},35:4(){2.13.42('16-14-17');19 2},enable:4(){2.13.34('16-14-17');19 2},17:4(){19 2.13.38('16-14-17')},46:4(i){if(!2.17()){2.24(i+1);2.37('67',i+1,2)}},44:4(i){2.20(i+1);if(2.12.25)2.35();2.30()},50:4(){2.20(2.18)},24:4(n){2.39.76(4(e,a){e[n-1<a?'34':'42']('16-14-48')})},69:4(){2.39=2.13.subNodes();2.39.76(4(e,i){e.32(2.46.29(2,i)).onClick(2.44.29(2,i))},2);2.13.onMouseout(2.50.29(2));2.20(2.12.18);if(2.12.17)2.35();if(2.12.26)2.41(2.12.26);19 2},64:4(){23 e=$E('21',{'class':'16-14'});2.12.31.times(4(){e.insert($E('21',{html:'★'}))});19 e}});27.32(4(a){23 t=a.target,e=[t].concat(t.parents()).first('38','16-14');if(e){23 r=e._14||61 57(e);if(t.parentNode===e)t.37('mouseover')}});27.write(\"<59 type=\\\"47/css\\\">21.16-14,21.16-14 21{margin:0;padding:0;background:75;border:75;45:49-block;*45:49;*zoom:1;74-family:Arial;74-31:110%}21.16-14{62:6em;36:43;vertical-65:middle}21.16-14 21{float:left;62:43;36:43;line-36:43;47-65:center;52:pointer;60:#888}21.16-14 21.16-14-48{60:brown;47-shadow:#666 .72 .72 .15em}21.16-14-17 21{52:default}</59>\");",",,this,,function,,,,,,,,options,element,rater,,right,disabled,value,return,setValue,div,null,var,highlight,disableOnVote,update,document,onChange,bind,send,size,onMouseover,,removeClass,disable,height,fire,hasClass,stars,insertTo,assignTo,addClass,1em,clicked,display,hovered,text,glow,inline,leaved,isHash,cursor,_rater,change,param,Xhr,Rater,curry,style,color,new,width,url,build,align,,hover,false,init,last,else,05em,,font,none,each".split(",")));
|
@@ -1,336 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Resizable unit for RightJS
|
3
|
-
*
|
4
|
-
* See: http://rightjs.org/ui/resizable
|
5
|
-
*
|
6
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
7
|
-
*/
|
8
|
-
if (!RightJS) throw "Gimme RightJS";
|
9
|
-
/**
|
10
|
-
* The resizable unit main file
|
11
|
-
*
|
12
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
13
|
-
*/
|
14
|
-
var Resizable = new Class(Observer, {
|
15
|
-
extend: {
|
16
|
-
EVENTS: $('resize initialize destroy start release'),
|
17
|
-
|
18
|
-
Options: {
|
19
|
-
direction: null, // 'top', 'left', 'right', 'bottom', null for bidrectional
|
20
|
-
|
21
|
-
minWidth: null,
|
22
|
-
maxWidth: null,
|
23
|
-
minHeight: null,
|
24
|
-
maxHeight: null
|
25
|
-
},
|
26
|
-
|
27
|
-
instances: [],
|
28
|
-
|
29
|
-
/**
|
30
|
-
* Tries to find or instanciate the resizable unit
|
31
|
-
* by the mouse event
|
32
|
-
*
|
33
|
-
* @param Event mouse event
|
34
|
-
* @return Resizable instance or null
|
35
|
-
*/
|
36
|
-
findBy: function(event) {
|
37
|
-
var target = event.target, element;
|
38
|
-
if (target.hasClass('right-resizable-handle')) {
|
39
|
-
element = target.parent();
|
40
|
-
return Resizable.instances[$uid(element)] || new Resizable(element);
|
41
|
-
}
|
42
|
-
}
|
43
|
-
},
|
44
|
-
|
45
|
-
/**
|
46
|
-
* Basic constructor
|
47
|
-
*
|
48
|
-
* @param Element reference
|
49
|
-
* @param Object options
|
50
|
-
*/
|
51
|
-
initialize: function(element, options) {
|
52
|
-
this.element = $(element);
|
53
|
-
this.$super(Object.merge(options,
|
54
|
-
eval('('+ this.element.get('data-resizable-options') +')')
|
55
|
-
));
|
56
|
-
|
57
|
-
Resizable.instances[$uid(this.element)] = this.init();
|
58
|
-
this.fire('initialize');
|
59
|
-
},
|
60
|
-
|
61
|
-
/**
|
62
|
-
* destructor
|
63
|
-
*
|
64
|
-
* @return Resizable this
|
65
|
-
*/
|
66
|
-
destroy: function() {
|
67
|
-
this.element
|
68
|
-
.removeClass('right-resizable')
|
69
|
-
.removeClass('right-resizable-top')
|
70
|
-
.removeClass('right-resizable-left')
|
71
|
-
.removeClass('right-resizable-right')
|
72
|
-
.removeClass('right-resizable-bottom')
|
73
|
-
.insert(this.content.childNodes);
|
74
|
-
|
75
|
-
this.content.remove();
|
76
|
-
this.handle.remove();
|
77
|
-
|
78
|
-
Resizable.instances = Resizable.instances.without($uid(this.element));
|
79
|
-
|
80
|
-
this.fire('destroy');
|
81
|
-
},
|
82
|
-
|
83
|
-
/**
|
84
|
-
* Overriding the method to recognize the direction
|
85
|
-
* option from the element class-name
|
86
|
-
*
|
87
|
-
* @param Object options
|
88
|
-
* @return Resizable this
|
89
|
-
*/
|
90
|
-
setOptions: function(options) {
|
91
|
-
// trying to recognize the direction
|
92
|
-
$w('top left right bottom').each(function(direction) {
|
93
|
-
if (this.element.hasClass('right-resizable-'+direction))
|
94
|
-
options.direction = direction;
|
95
|
-
}, this);
|
96
|
-
|
97
|
-
return this.$super(options);
|
98
|
-
},
|
99
|
-
|
100
|
-
/**
|
101
|
-
* Starts the resizing process
|
102
|
-
*
|
103
|
-
* @param Event mouse event
|
104
|
-
*/
|
105
|
-
start: function(event) {
|
106
|
-
this.prevSizes = this.element.sizes();
|
107
|
-
this.prevEvPos = event.position();
|
108
|
-
|
109
|
-
// trying to recognize the boundaries
|
110
|
-
$w('minWidth maxWidth minHeight maxHeight').each(function(dimension) {
|
111
|
-
this[dimension] = this.findDim(dimension);
|
112
|
-
}, this);
|
113
|
-
|
114
|
-
return Resizable.current = this.fire('start', event);
|
115
|
-
},
|
116
|
-
|
117
|
-
/**
|
118
|
-
* Tracks the event during the resize process
|
119
|
-
*
|
120
|
-
* @param Event mouse event
|
121
|
-
*/
|
122
|
-
track: function(event) {
|
123
|
-
var event_pos = event.position(), prev_pos = this.prevEvPos,
|
124
|
-
handle = this.handle.dimensions(),
|
125
|
-
prev_size = this.prevSizes, width = prev_size.x, height = prev_size.y,
|
126
|
-
x_diff = prev_pos.x - event_pos.x,
|
127
|
-
y_diff = prev_pos.y - event_pos.y,
|
128
|
-
min_x = this.minWidth,
|
129
|
-
max_x = this.maxWidth,
|
130
|
-
min_y = this.minHeight,
|
131
|
-
max_y = this.maxHeight,
|
132
|
-
options = this.options,
|
133
|
-
direction = options.direction;
|
134
|
-
|
135
|
-
// calculating the new size
|
136
|
-
width += (direction == 'left' ? 1 : -1) * x_diff;
|
137
|
-
height += (direction == 'top' ? 1 : -1) * y_diff;
|
138
|
-
|
139
|
-
// applying the boundaries
|
140
|
-
if (width < min_x) width = min_x;
|
141
|
-
if (width > max_x) width = max_x;
|
142
|
-
if (height < min_y) height = min_y;
|
143
|
-
if (height > max_y) height = max_y;
|
144
|
-
|
145
|
-
// applying the sizes
|
146
|
-
if (prev_size.x != width && direction != 'top' && direction != 'bottom') {
|
147
|
-
this.setWidth(width);
|
148
|
-
}
|
149
|
-
if (prev_size.y != height && direction != 'left' && direction != 'right') {
|
150
|
-
this.setHeight(height);
|
151
|
-
}
|
152
|
-
|
153
|
-
// adjusting the previous cursor position so that it didn't had a shift
|
154
|
-
if (width == min_x || width == max_x)
|
155
|
-
event_pos.x = handle.left + handle.width / 2;
|
156
|
-
if (height == min_y || height == max_y)
|
157
|
-
event_pos.y = handle.top + handle.height / 2;
|
158
|
-
|
159
|
-
this.prevEvPos = event_pos;
|
160
|
-
this.prevSizes = this.element.sizes();
|
161
|
-
|
162
|
-
this.fire('resize', event);
|
163
|
-
},
|
164
|
-
|
165
|
-
/**
|
166
|
-
* Sets the widget size
|
167
|
-
*
|
168
|
-
* @param Number width or Object {x:NN, y:NN}
|
169
|
-
* @param Number height
|
170
|
-
* @return Resizable this
|
171
|
-
*/
|
172
|
-
setSize: function(in_width, in_height) {
|
173
|
-
var width = in_width, height = in_height;
|
174
|
-
if (isHash(in_width)) {
|
175
|
-
width = in_width.x;
|
176
|
-
height = in_width.y;
|
177
|
-
}
|
178
|
-
return this.setWidth(width).setHeight(height);
|
179
|
-
},
|
180
|
-
|
181
|
-
/**
|
182
|
-
* Sets the width of the widget
|
183
|
-
*
|
184
|
-
* @param Number width
|
185
|
-
* @return Resizable this
|
186
|
-
*/
|
187
|
-
setWidth: function(width) {
|
188
|
-
this.element.setWidth(width);
|
189
|
-
this.content.setWidth(width - this.contXDiff);
|
190
|
-
},
|
191
|
-
|
192
|
-
/**
|
193
|
-
* Sets the height of the widget
|
194
|
-
*
|
195
|
-
* @param Number height
|
196
|
-
* @return Resizable this
|
197
|
-
*/
|
198
|
-
setHeight: function(height) {
|
199
|
-
this.element.setHeight(height);
|
200
|
-
this.content.setHeight(height - this.contYDiff);
|
201
|
-
},
|
202
|
-
|
203
|
-
/**
|
204
|
-
* Marks it the end of the action
|
205
|
-
*
|
206
|
-
* @return Resizable this
|
207
|
-
*/
|
208
|
-
release: function(event) {
|
209
|
-
Resizable.current = null;
|
210
|
-
return this.fire('release', event);
|
211
|
-
},
|
212
|
-
|
213
|
-
/**
|
214
|
-
* Overloading the standard method so that it was sending
|
215
|
-
* current instance as an argument
|
216
|
-
*
|
217
|
-
* @param String event name
|
218
|
-
* @return Resizable this
|
219
|
-
*/
|
220
|
-
fire: function(event, dom_event) {
|
221
|
-
return this.$super(event, this, dom_event);
|
222
|
-
},
|
223
|
-
|
224
|
-
// protected
|
225
|
-
|
226
|
-
init: function() {
|
227
|
-
var class_name = 'right-resizable',
|
228
|
-
handle_class_name = 'right-resizable-handle',
|
229
|
-
content_class_name = 'right-resizable-content';
|
230
|
-
|
231
|
-
// assigning the main element class
|
232
|
-
if (this.options.direction) class_name += '-'+ this.options.direction;
|
233
|
-
this.element.addClass(class_name);
|
234
|
-
|
235
|
-
// checking for the content block
|
236
|
-
this.content = this.element.first('*.'+ content_class_name) || $E('div', {
|
237
|
-
'class': content_class_name
|
238
|
-
}).insert(this.element.childNodes).insertTo(this.element);
|
239
|
-
|
240
|
-
// checking for the handle element
|
241
|
-
this.handle = (this.element.first('*.'+ handle_class_name) || $E('div', {
|
242
|
-
'class': handle_class_name
|
243
|
-
})).insertTo(this.element);
|
244
|
-
|
245
|
-
// used later during the resize process
|
246
|
-
this.contXDiff = this.element.offsetWidth - this.content.offsetWidth;
|
247
|
-
this.contYDiff = this.element.offsetHeight - this.content.offsetHeight;
|
248
|
-
|
249
|
-
return this;
|
250
|
-
},
|
251
|
-
|
252
|
-
// finds dimensions of the element
|
253
|
-
findDim: function(dimension) {
|
254
|
-
var style = this.options[dimension] || this.element.getStyle(dimension);
|
255
|
-
|
256
|
-
if (style && /\d+/.test(style) && style.toFloat() > 0) {
|
257
|
-
var what = dimension.include('Width') ? 'width' : 'height',
|
258
|
-
dummy = (this.dummy || (this.dummy = $E('div', {
|
259
|
-
style: 'visibility:hidden;z-index:-1'
|
260
|
-
})))
|
261
|
-
.setStyle(what, style)
|
262
|
-
.insertTo(this.element, 'before');
|
263
|
-
|
264
|
-
var size = dummy['offset' + what.capitalize()];
|
265
|
-
dummy.remove();
|
266
|
-
|
267
|
-
return size;
|
268
|
-
}
|
269
|
-
}
|
270
|
-
});
|
271
|
-
|
272
|
-
/**
|
273
|
-
* Document level hooks for resizables
|
274
|
-
*
|
275
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
276
|
-
*/
|
277
|
-
document.on({
|
278
|
-
mousedown: function(event) {
|
279
|
-
var resizable = Resizable.findBy(event);
|
280
|
-
if (resizable) {
|
281
|
-
event.stop();
|
282
|
-
Resizable.current = resizable.start(event);
|
283
|
-
}
|
284
|
-
},
|
285
|
-
|
286
|
-
mousemove: function(event) {
|
287
|
-
var resizable = Resizable.current;
|
288
|
-
if (resizable) {
|
289
|
-
event.stop();
|
290
|
-
resizable.track(event);
|
291
|
-
}
|
292
|
-
},
|
293
|
-
|
294
|
-
mouseup: function(event) {
|
295
|
-
var resizable = Resizable.current;
|
296
|
-
if (resizable) {
|
297
|
-
resizable.release(event);
|
298
|
-
}
|
299
|
-
}
|
300
|
-
});
|
301
|
-
|
302
|
-
window.on('blur', function(event) {
|
303
|
-
var resizable = Resizable.current;
|
304
|
-
if (resizable) {
|
305
|
-
resizable.release(event);
|
306
|
-
}
|
307
|
-
});
|
308
|
-
|
309
|
-
/**
|
310
|
-
* Element level hook to make things resizable
|
311
|
-
*
|
312
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
313
|
-
*/
|
314
|
-
Element.include({
|
315
|
-
/**
|
316
|
-
* Makes a resizeable out of the element
|
317
|
-
*
|
318
|
-
* @param Object options
|
319
|
-
* @return Element this
|
320
|
-
*/
|
321
|
-
makeResizable: function(options) {
|
322
|
-
new Resizable(this, options);
|
323
|
-
return this;
|
324
|
-
},
|
325
|
-
|
326
|
-
/**
|
327
|
-
* Destroys a resizable functionality
|
328
|
-
*
|
329
|
-
* @return Element this
|
330
|
-
*/
|
331
|
-
undoResizable: function() {
|
332
|
-
var resizable = Resizable.instances[$uid(this)];
|
333
|
-
if (resizable) resizable.destroy();
|
334
|
-
return this;
|
335
|
-
}
|
336
|
-
});document.write("<style type=\"text/css\">.right-resizable,.right-resizable-top,.right-resizable-left,.right-resizable-right,.right-resizable-bottom,.right-resizable-content .right-resizable-handle{margin:0;padding:0;overflow:none;border:none;background:none;width:auto;height:auto;min-width:none;max-width:none;min-height:none;max-height:none}.right-resizable,.right-resizable-top,.right-resizable-left,.right-resizable-right,.right-resizable-bottom{position:relative;min-width:8em;min-height:8em;border:1px solid #DDD}.right-resizable-content{overflow:auto;padding:.5em;position:relative}.right-resizable-handle{position:absolute;background-image:url(/images/rightjs-ui/resizable.png);background-repeat: no-repeat;background-color:#DDD;cursor:move}.right-resizable .right-resizable-handle{right:0;bottom:0;background-position:-2px -2px;background-color:transparent;width:16px;height:16px}.right-resizable-top .right-resizable-handle,.right-resizable-bottom .right-resizable-handle{height:8px;width:100%;background-position:center -26px;cursor:row-resize}.right-resizable-left .right-resizable-handle,.right-resizable-right .right-resizable-handle{top:0px;width:8px;height:100%;background-position:-26px center;cursor:col-resize}.right-resizable-top .right-resizable-content{padding-top:1em}.right-resizable-top .right-resizable-handle{top:0}.right-resizable-bottom .right-resizable-content{padding-bottom:1em}.right-resizable-bottom .right-resizable-handle{bottom:0}.right-resizable-left .right-resizable-content{padding-left:1em}.right-resizable-left .right-resizable-handle{left:0}.right-resizable-right .right-resizable-content{padding-right:1em}.right-resizable-right .right-resizable-handle{right:0}</style>");
|
@@ -1,9 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Resizable unit for RightJS
|
3
|
-
*
|
4
|
-
* See: http://rightjs.org/ui/resizable
|
5
|
-
*
|
6
|
-
* Copyright (C) 2010 Nikolay Nemshilov
|
7
|
-
*/
|
8
|
-
if (!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})("27 12=75 93(Observer,{extend:{EVENTS:$('44 36 37 49 34'),92:{29:41,45:41,46:41,43:41,42:41},21:[],70:9(a){27 t=a.target,e;if(t.62('4-3-13')){e=t.parent();19 12.21[57(e)]||75 12(e)}}},36:9(e,o){7.11=$(e);7.52(Object.merge(o,eval('('+7.11.get('data-3-33')+')')));12.21[57(7.11)]=7.85();7.39('36')},37:9(){7.11.22('4-3').22('4-3-25').22('4-3-23').22('4-3-4').22('4-3-17').69(7.14.51);7.14.54();7.13.54();12.21=12.21.without(57(7.11));7.39('37')},set92:9(o){$w('25 23 4 17').81(9(d){if(7.11.62('4-3-'+d))o.29=d},7);19 7.52(o)},49:9(e){7.40=7.11.76();7.38=e.18();$w('45 46 43 42').81(9(d){7[d]=7.66(d)},7);19 12.31=7.39('49',e)},74:9(e){27 a=e.18(),p=7.38,h=7.13.dimensions(),i=7.40,w=i.x,b=i.y,x=p.x-a.x,y=p.y-a.y,f=7.45,m=7.46,g=7.43,c=7.42,o=7.33,d=o.29;w+=(d=='23'?1:-1)*x;b+=(d=='25'?1:-1)*y;if(w<f)w=f;if(w>m)w=m;if(b<g)b=g;if(b>c)b=c;if(i.x!=w&&d!='25'&&d!='17')7.32(w);if(i.y!=b&&d!='23'&&d!='4')7.28(b);if(w==f||w==m)a.x=h.23+h.24/2;if(b==g||b==c)a.y=h.25+h.20/2;7.38=a;7.40=7.11.76();7.39('44',e)},setSize:9(a,i){27 w=a,h=i;if(isHash(a)){w=a.x;h=a.y}19 7.32(w).28(h)},32:9(w){7.11.32(w);7.14.32(w-7.55)},28:9(h){7.11.28(h);7.14.28(h-7.56)},34:9(e){12.31=41;19 7.39('34',e)},39:9(e,d){19 7.52(e,7,d)},85:9(){27 c='4-3',h='4-3-13',a='4-3-14';if(7.33.29)c+='-'+7.33.29;7.11.add93(c);7.14=7.11.77('*.'+a)||$E('78',{'73':a}).69(7.11.51).47(7.11);7.13=(7.11.77('*.'+h)||$E('78',{'73':h})).47(7.11);7.55=7.11.off32-7.14.off32;7.56=7.11.off28-7.14.off28;19 7},66:9(a){27 c=7.33[a]||7.11.get94(a);if(c&&/\\d+/.test(c)&&c.toFloat()>0){27 w=a.64('Width')?'24':'20',b=(7.80||(7.80=$E('78',{61:'visibility:hidden;z-index:-1'}))).set94(w,c).47(7.11,'before');27 s=b['offset'+w.capitalize()];b.54();19 s}}});60.on({mousedown:9(e){27 r=12.70(e);if(r){e.s25();12.31=r.49(e)}},mousemove:9(e){27 r=12.31;if(r){e.s25();r.74(e)}},mouseup:9(e){27 r=12.31;if(r)r.34(e)}});window.on('blur',9(e){27 r=12.31;if(r)r.34(e)});Element.64({make12:9(o){75 12(7,o);19 7},undo12:9(){27 r=12.21[57(7)];if(r)r.37();19 7}});60.write(\"<61 type=\\\"text/css\\\">.4-3,.4-3-25,.4-3-23,.4-3-4,.4-3-17,.4-3-14 .4-3-13{margin:0;30:0;59:35;72:35;15:35;24:67;20:67;65-24:35;88-24:35;65-20:35;88-20:35}.4-3,.4-3-25,.4-3-23,.4-3-4,.4-3-17{18:58;65-24:87;65-20:87;72:1px solid #89}.4-3-14{59:67;30:.5em;18:58}.4-3-13{18:absolute;15-image:url(/images/rightjs-ui/3.png);15-68:no-68;15-79:#89;53:move}.4-3 .4-3-13{4:0;17:0;15-18:-91 -91;15-79:transparent;24:82;20:82}.4-3-25 .4-3-13,.4-3-17 .4-3-13{20:86;24:90%;15-18:71 -84;53:row-44}.4-3-23 .4-3-13,.4-3-4 .4-3-13{25:0px;24:86;20:90%;15-18:-84 71;53:col-44}.4-3-25 .4-3-14{30-25:63}.4-3-25 .4-3-13{25:0}.4-3-17 .4-3-14{30-17:63}.4-3-17 .4-3-13{17:0}.4-3-23 .4-3-14{30-23:63}.4-3-23 .4-3-13{23:0}.4-3-4 .4-3-14{30-4:63}.4-3-4 .4-3-13{4:0}</61>\");",",,,resizable,right,,,this,,function,,element,Resizable,handle,content,background,,bottom,position,return,height,instances,removeClass,left,width,top,,var,setHeight,direction,padding,current,setWidth,options,release,none,initialize,destroy,prevEvPos,fire,prevSizes,null,maxHeight,minHeight,resize,minWidth,maxWidth,insertTo,offsetHeight,start,offsetWidth,childNodes,$super,cursor,remove,contXDiff,contYDiff,$uid,relative,overflow,document,style,hasClass,1em,include,min,findDim,auto,repeat,insert,findBy,center,border,class,track,new,sizes,first,div,color,dummy,each,16px,stop,26px,init,8px,8em,max,DDD,100,2px,Options,Class,Style".split(",")));
|