From 563a9e64beb7f1183b2c31943b7533481ae5da97 Mon Sep 17 00:00:00 2001 From: Sarven Capadisli Date: Wed, 17 Dec 2008 19:33:02 -0500 Subject: identica badge by Kent Brewster. For more information see: http://kentbrewster.com/identica-badge/ Copy and paste the following wherever you want the badge to show up: + + Substitute your own ID in the user parameter. + +] +[TAG 0.6.4.1 +Evan Prodromou **20081220204906] +Patch bundle hash: +afe7b4b695e91033a56499c2eee94a02fa1f0105 diff --git a/_darcs/pristine/actions/profilesettings.php b/_darcs/pristine/actions/profilesettings.php index 6c22a7933..caec2f93d 100644 --- a/_darcs/pristine/actions/profilesettings.php +++ b/_darcs/pristine/actions/profilesettings.php @@ -54,13 +54,13 @@ class ProfilesettingsAction extends SettingsAction return; } - if ($this->arg('save')) { - $this->save_profile(); - } else if ($this->arg('upload')) { - $this->upload_avatar(); - } else if ($this->arg('changepass')) { - $this->change_password(); - } + if ($this->arg('save')) { + $this->save_profile(); + } else if ($this->arg('upload')) { + $this->upload_avatar(); + } else if ($this->arg('changepass')) { + $this->change_password(); + } } @@ -70,31 +70,31 @@ class ProfilesettingsAction extends SettingsAction $user = common_current_user(); $profile = $user->getProfile(); - common_element_start('form', array('method' => 'POST', - 'id' => 'profilesettings', - 'action' => - common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); - - # too much common patterns here... abstractable? - - common_input('nickname', _('Nickname'), - ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, - _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_input('fullname', _('Full name'), - ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - common_input('homepage', _('Homepage'), - ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, - _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), - ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, - _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), - ($this->arg('location')) ? $this->arg('location') : $profile->location, - _('Where you are, like "City, State (or Region), Country"')); - common_input('tags', _('Tags'), - ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), - _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); + common_element_start('form', array('method' => 'POST', + 'id' => 'profilesettings', + 'action' => + common_local_url('profilesettings'))); + common_hidden('token', common_session_token()); + + # too much common patterns here... abstractable? + + common_input('nickname', _('Nickname'), + ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, + _('1-64 lowercase letters or numbers, no punctuation or spaces')); + common_input('fullname', _('Full name'), + ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); + common_input('homepage', _('Homepage'), + ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, + _('URL of your homepage, blog, or profile on another site')); + common_textarea('bio', _('Bio'), + ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, + _('Describe yourself and your interests in 140 chars')); + common_input('location', _('Location'), + ($this->arg('location')) ? $this->arg('location') : $profile->location, + _('Where you are, like "City, State (or Region), Country"')); + common_input('tags', _('Tags'), + ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), + _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); $language = common_language(); common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); @@ -137,23 +137,23 @@ class ProfilesettingsAction extends SettingsAction common_local_url('profilesettings'))); common_hidden('token', common_session_token()); - if ($original) { - common_element('img', array('src' => $original->url, - 'class' => 'avatar original', - 'width' => $original->width, - 'height' => $original->height, - 'alt' => $user->nickname)); - } + if ($original) { + common_element('img', array('src' => $original->url, + 'class' => 'avatar original', + 'width' => $original->width, + 'height' => $original->height, + 'alt' => $user->nickname)); + } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - if ($avatar) { - common_element('img', array('src' => $avatar->url, - 'class' => 'avatar profile', - 'width' => AVATAR_PROFILE_SIZE, - 'height' => AVATAR_PROFILE_SIZE, - 'alt' => $user->nickname)); - } + if ($avatar) { + common_element('img', array('src' => $avatar->url, + 'class' => 'avatar profile', + 'width' => AVATAR_PROFILE_SIZE, + 'height' => AVATAR_PROFILE_SIZE, + 'alt' => $user->nickname)); + } common_element('input', array('name' => 'MAX_FILE_SIZE', @@ -390,8 +390,8 @@ class ProfilesettingsAction extends SettingsAction $this->show_form(_('Failed updating avatar.')); } - @unlink($_FILES['avatarfile']['tmp_name']); - } + @unlink($_FILES['avatarfile']['tmp_name']); + } function nickname_exists($nickname) { diff --git a/_darcs/pristine/js/jcrop/Jcrop.gif b/_darcs/pristine/js/jcrop/Jcrop.gif new file mode 100644 index 000000000..72ea7ccb5 Binary files /dev/null and b/_darcs/pristine/js/jcrop/Jcrop.gif differ diff --git a/_darcs/pristine/js/jcrop/jquery.Jcrop.css b/_darcs/pristine/js/jcrop/jquery.Jcrop.css new file mode 100644 index 000000000..b95178a72 --- /dev/null +++ b/_darcs/pristine/js/jcrop/jquery.Jcrop.css @@ -0,0 +1,45 @@ +/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */ +.jcrop-holder +{ + text-align: left; +} + +.jcrop-vline, .jcrop-hline +{ + font-size: 0; + position: absolute; + background: white url('Jcrop.gif') top left repeat; + /* + opacity: .5; + *filter:alpha(opacity=50); + */ +} +.jcrop-vline { height: 100%; width: 1px !important; } +.jcrop-hline { width: 100%; height: 1px !important; } +.jcrop-handle { + font-size: 1px; + width: 7px !important; + height: 7px !important; + border: 1px #eee solid; + background-color: #333; + *width: 9px; + *height: 9px; +} + +.jcrop-tracker { + *background-color: gray; + width: 100%; height: 100%; +} + +.custom .jcrop-vline, +.custom .jcrop-hline +{ + background: yellow; +} +.custom .jcrop-handle +{ + border-color: black; + background-color: #C7BB00; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} diff --git a/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js b/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js new file mode 100644 index 000000000..57639814f --- /dev/null +++ b/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js @@ -0,0 +1,41 @@ + $(function(){ + jQuery("#avatar_original img.avatar").Jcrop({ onChange: showPreview, + setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], + onSelect: updateCoords, + aspectRatio: 1, + boxWidth: 640, + boxHeight: 640, + bgColor: '#000', + bgOpacity: .4 + }); + }); + + function showPreview(coords) { + var rx = 96 / coords.w; + var ry = 96 / coords.h; + + var img_width = $("#avatar_original img.avatar").attr("width"); + var img_height = $("#avatar_original img.avatar").attr("height"); + + + $('#avatar_preview img.avatar').css({ + width: Math.round(rx *img_width) + 'px', + height: Math.round(ry * img_height) + 'px', + marginLeft: '-' + Math.round(rx * coords.x) + 'px', + marginTop: '-' + Math.round(ry * coords.y) + 'px' + }); + }; + + function updateCoords(c) { + $('#avatar_crop_x').val(c.x); + $('#avatar_crop_y').val(c.y); + $('#avatar_crop_w').val(c.w); + $('#avatar_crop_h').val(c.h); + }; + + function checkCoords() { + if (parseInt($('#avatar_crop_w').val())) return true; + alert('Please select a crop region then press submit.'); + return false; + }; + diff --git a/_darcs/pristine/js/jcrop/jquery.Jcrop.pack.js b/_darcs/pristine/js/jcrop/jquery.Jcrop.pack.js new file mode 100644 index 000000000..aa82e8abe --- /dev/null +++ b/_darcs/pristine/js/jcrop/jquery.Jcrop.pack.js @@ -0,0 +1,8 @@ +/** + * Jcrop v.0.9.5 (packed) + * (c) 2008 Kelly Hallman and DeepLiquid.com + * More information: http://deepliquid.com/content/Jcrop.html + * Released under MIT License - this header must remain with code + */ + +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$.1n=7(G,F){d G=G,F=F;g(1p(G)!==\'2d\')G=$(G)[0];g(1p(F)!==\'2d\')F={};g(!(\'2x\'1a F))F.2x=$.3d.3e?K:M;g(!(\'2c\'1a F))F.2c=$.3d.3e?K:M;d 4f={2x:K,3W:\'4C\',1f:4D,3T:\'4Y\',3x:.6,3O:.4,3P:.5,53:5,3N:9,3D:5,51:14,25:0,2c:M,3I:M,3B:M,30:M,3A:M,49:0,4p:0,4k:8,3V:20,3X:3,2f:K,3n:[0,0],2z:[0,0],2O:[0,0],2D:7(){},2G:7(){}};d j=4f;21(F);d $I=$(G).B({16:\'1b\'});47($I,j.49,j.4p);d S=$I.W(),L=$I.U(),$12=$(\'<12 />\').W(S).U(L).1f(1L(\'4F\')).B({16:\'4H\',4B:j.3T});g(j.1f)$12.1f(j.1f);$I.54($12);d $34=$(\'\').3Y(\'2N\',$I.3Y(\'2N\')).B(\'16\',\'1b\').W(S).U(L);d $2C=$(\'<12 />\').W(1t(V)).U(1t(V)).B({1l:59,16:\'1b\',4o:\'4g\'}).1P($34);d $2g=$(\'<12 />\').W(1t(V)).U(1t(V)).B({1l:5b});d $28=$(\'<12 />\').B({16:\'1b\',1l:55}).3U($I).1P($2C,$2g);d 23=j.4k;d $1S=$(\'<12 />\').1f(1L(\'3v\')).W(S+(23*2)).U(L+(23*2)).B({16:\'1b\',R:D(-23),P:D(-23),1l:3R,1z:0}).3q(48);d 1I,1Q;d 2u=2Q(G),1q,1B,3i,58,3h,1O;g(\'36\'1a j){1I=j.36[0]/S;1Q=j.36[1]/L}d E=7(){d A=0,u=0,q=0,m=0,Z,Y;7 1A(z){d z=2T(z);q=A=z[0];m=u=z[1]};7 1y(z){d z=2T(z);Z=z[0]-q;Y=z[1]-m;q=z[0];m=z[1]};7 3f(){k[Z,Y]};7 2b(2y){d Z=2y[0],Y=2y[1];g(0>A+Z)Z-=Z+A;g(0>u+Y)Y-=Y+u;g(LS){15=S;h=N.17((15-A)/1k);13=1Z<0?u-h:h+u}}1g{15=q;h=3c/1k;13=1Z<0?u-h:u+h;g(13<0){13=0;w=N.17((13-u)*1k);15=1V<0?A-w:w+A}1g g(13>L){13=L;w=N.17(13-u)*1k;15=1V<0?A-w:w+A}}k 4E=3g(1F(A,u,15,13))};7 2T(p){g(p[0]<0)p[0]=0;g(p[1]<0)p[1]=0;g(p[0]>S)p[0]=S;g(p[1]>L)p[1]=L;k[p[0],p[1]]};7 1F(A,u,q,m){d 2R=A,3r=q,3o=u,3l=m;g(q2q))q=(1U>0)?(A+2q):(A-2q);g(2n&&(N.17(22)>2n))m=(22>0)?(u+2n):(u-2n);g(2i&&(N.17(22)<2i))m=(22>0)?(u+2i):(u-2i);g(2m&&(N.17(1U)<2m))q=(1U>0)?(A+2m):(A-2m);g(A<0){q-=A;A-=A}g(u<0){m-=u;u-=u}g(q<0){A-=q;q-=q}g(m<0){u-=m;m-=m}g(q>S){d X=q-S;A-=X;q-=X}g(m>L){d X=m-L;u-=X;m-=X}g(A>S){d X=A-L;m-=X;u-=X}g(u>L){d X=u-L;m-=X;u-=X}k 3g(1F(A,u,q,m))};7 3g(a){k{x:a[0],y:a[1],q:a[2],m:a[3],w:a[2]-a[0],h:a[3]-a[1]}};k{1F:1F,1A:1A,1y:1y,3f:3f,2b:2b,2K:2K,Q:Q}}();d J=7(){d 4v,4z,4y,1R,2U=4x;d 2F={};d H={};d 2E=K;d 1i=j.3D;g(j.30){2F={R:1Y(\'3C\').B(\'R\',$.3d.3e?D(-1):D(0)),3Q:1Y(\'3C\'),P:1Y(\'3z\'),3L:1Y(\'3z\')}}g(j.3A){H.t=1W(\'n\');H.b=1W(\'s\');H.r=1W(\'e\');H.l=1W(\'w\')}j.3B&&2Y([\'n\',\'s\',\'e\',\'w\']);j.3I&&2Y([\'1M\',\'11\',\'1s\',\'2e\']);7 1Y(1u){d 1J=$(\'<12 />\').B({16:\'1b\',1z:j.3O}).1f(1L(1u));$2C.1P(1J);k 1J};7 2W(T,3y){d 1J=$(\'<12 />\').3q(3b(T)).B({3p:T+\'-2A\',16:\'1b\',1l:3y});$2g.1P(1J);k 1J};7 3J(T){k 2W(T,2U++).B({R:D(-1i+1),P:D(-1i+1),1z:j.3P}).1f(1L(\'H\'))};7 1W(T){d s=j.3N,o=1i,h=s,w=s,t=o,l=o;1E(T){C\'n\':C\'s\':w=1t(V);O;C\'e\':C\'w\':h=1t(V);O}k 2W(T,2U++).W(w).U(h).B({R:D(-t+1),P:D(-l+1)})};7 2Y(2J){4U(i 1a 2J)H[2J[i]]=3J(2J[i])};7 31(c){d 3a=N.1K((c.h/2)-1i),35=N.1K((c.w/2)-1i),4V=4W=-1i+1,2a=c.w-1i,1X=c.h-1i,x,y;\'e\'1a H&&H.e.B({R:D(3a),P:D(2a)})&&H.w.B({R:D(3a)})&&H.s.B({R:D(1X),P:D(35)})&&H.n.B({P:D(35)});\'1s\'1a H&&H.1s.B({P:D(2a)})&&H.2e.B({R:D(1X),P:D(2a)})&&H.1M.B({R:D(1X)});\'b\'1a H&&H.b.B({R:D(1X)})&&H.r.B({P:D(2a)})};7 3K(x,y){$34.B({R:D(-y),P:D(-x)});$28.B({R:D(y),P:D(x)})};7 2A(w,h){$28.W(w).U(h)};7 3s(){d p=E.Q();E.1A([p.x,p.y]);E.1y([p.q,p.m])};7 2I(){g(1R)k 1e()};7 1e(){d c=E.Q();2A(c.w,c.h);3K(c.x,c.y);j.30&&2F[\'3L\'].B({P:D(c.w-1)})&&2F[\'3Q\'].B({R:D(c.h-1)});2E&&31(c);1R||1w();j.2D(2H(c))};7 1w(){$28.1w();$I.B(\'1z\',j.3x);1R=M};7 1r(){1o();$28.1v();$I.B(\'1z\',1);1R=K};7 1v(){1r();$I.B(\'1z\',1);1R=K};7 2t(){2E=M;31(E.Q());$2g.1w()};7 1o(){2E=K;$2g.1v()};7 2o(v){(3h=v)?1o():2t()};7 1h(){d c=E.Q();2o(K);3s()};1o();$2C.1P($(\'<12 />\').1f(1L(\'3v\')).3q(3b(\'1N\')).B({3p:\'1N\',16:\'1b\',1l:4M,1z:0}));k{2I:2I,1e:1e,1r:1r,1w:1w,1v:1v,2t:2t,1o:1o,2o:2o,1h:1h}}();d 1j=7(){d 2w=7(){},2v=7(){},2L=j.2x;g(!2L){$1S.3k(2B).2S(26).4N(26)}7 4j(){g(2L){$(3t).3k(2B).2S(26)}$1S.B({1l:4G})}7 4i(){g(2L){$(3t).3H(\'3k\',2B).3H(\'2S\',26)}$1S.B({1l:3R})}7 2B(e){2w(2r(e))};7 26(e){e.2j();e.2k();g(1q){1q=K;2v(2r(e));j.2G(2H(E.Q()));4i();2w=7(){};2v=7(){}}k K};7 1G(1N,1h){1q=M;2w=1N;2v=1h;4j();k K};7 1x(t){$1S.B(\'3p\',t)};$I.4s($1S);k{1G:1G,1x:1x}}();d 33=7(){d $24=$(\'<4w 1u="4L" />\').B({16:\'1b\',P:\'-4O\'}).57(43).56(2f).5a(41),$3S=$(\'<12 />\').B({16:\'1b\',4o:\'4g\'}).1P($24);7 2l(){g(j.2c){$24.1w();$24.4Z()}};7 41(e){$24.1v()};7 2f(e){g(!j.2f)k;d 42=1O,1C;1O=e.4Q?M:K;g(42!=1O){g(1O&&1q){1C=E.Q();1B=1C.w/1C.h}1g 1B=0;J.1e()}e.2k();e.2j();k K};7 29(e,x,y){E.2b([x,y]);J.2I();e.2j();e.2k()};7 43(e){g(e.4T)k M;2f(e);d 2h=1O?10:1;1E(e.5d){C 37:29(e,-2h,0);O;C 39:29(e,2h,0);O;C 38:29(e,0,-2h);O;C 40:29(e,0,2h);O;C 27:J.1r();O;C 9:k M}k K};g(j.2c)$3S.3U($I);k{2l:2l}}();7 D(n){k\'\'+1m(n)+\'D\'};7 1t(n){k\'\'+1m(n)+\'%\'};7 1L(44){k j.3W+\'-\'+44};7 2Q(G){d z=$(G).2y();k[z.P,z.R]};7 2r(e){k[(e.4q-2u[0]),(e.4r-2u[1])]};7 46(1u){g(1u!=3i){1j.1x(1u);3i=1u}};7 4a(19,z){2u=2Q(G);1j.1x(19==\'1N\'?19:19+\'-2A\');g(19==\'1N\')k 1j.1G(4e(z),2P);d 1C=E.Q();E.1A(E.2K(4b(19)));1j.1G(45(19,1C),2P)};7 45(19,f){k 7(z){g(!j.25&&!1B)1E(19){C\'e\':z[1]=f.m;O;C\'w\':z[1]=f.m;O;C\'n\':z[0]=f.q;O;C\'s\':z[0]=f.q;O}1g 1E(19){C\'e\':z[1]=f.y+1;O;C\'w\':z[1]=f.y+1;O;C\'n\':z[0]=f.x+1;O;C\'s\':z[0]=f.x+1;O}E.1y(z);J.1e()}};7 4e(z){d 2M=z;33.2l();k 7(z){E.2b([z[0]-2M[0],z[1]-2M[1]]);2M=z;J.1e()}};7 4b(T){1E(T){C\'n\':k\'1M\';C\'s\':k\'11\';C\'e\':k\'11\';C\'w\':k\'1s\';C\'1s\':k\'1M\';C\'11\':k\'2e\';C\'2e\':k\'11\';C\'1M\':k\'1s\'}};7 3b(T){k 7(e){1q=M;4a(T,2r(e));e.2k();e.2j();k K}};7 47($G,w,h){d 11=$G.W(),1H=$G.U();g((11>w)&&w>0){11=w;1H=(w/$G.W())*$G.U()}g((1H>h)&&h>0){1H=h;11=(h/$G.U())*$G.W()}1I=$G.W()/11;1Q=$G.U()/1H;$G.W(11).U(1H)};7 2H(c){k{x:1m(c.x*1I),y:1m(c.y*1Q),q:1m(c.q*1I),m:1m(c.m*1Q),w:1m(c.w*1I),h:1m(c.h*1Q)}};7 2P(z){d c=E.Q();g(c.w>j.3n[0]&&c.h>j.3n[1]){J.2t();J.1h()}1g{J.1r()}1j.1x(\'2X\')};7 48(e){1q=M;2u=2Q(G);J.1r();J.1o();46(\'2X\');E.1A(2r(e));1j.1G(4c,2P);33.2l();e.2k();e.2j();k K};7 4c(z){E.1y(z);J.1e()};7 2Z(a){d A=a[0],u=a[1],q=a[2],m=a[3];g(3h)k;d 2s=E.1F(A,u,q,m);d c=E.Q();d 18=2p=[c.x,c.y,c.q,c.m];d 3w=j.3V;d x=18[0];d y=18[1];d q=18[2];d m=18[3];d 3Z=2s[0]-2p[0];d 4m=2s[1]-2p[1];d 4n=2s[2]-2p[2];d 4l=2s[3]-2p[3];d 1c=0;d 4h=j.3X;J.2o(M);d 3u=7(){k 7(){1c+=(V-1c)/4h;18[0]=x+((1c/V)*3Z);18[1]=y+((1c/V)*4m);18[2]=q+((1c/V)*4n);18[3]=m+((1c/V)*4l);g(1c=4K.8)1c=V;1d(18)}}();7 32(){4I.4t(3u,3w)};32()};7 1d(l){E.1A([l[0],l[1]]);E.1y([l[2],l[3]]);J.1e()};7 21(F){g(1p(F)!=\'2d\')F={};j=$.4X(j,F);g(1p(j.2D)!==\'7\')j.2D=7(){};g(1p(j.2G)!==\'7\')j.2G=7(){}};7 3m(){k 2H(E.Q())};7 2V(){k E.Q()};7 3E(F){21(F);g(\'1d\'1a F){1d(F.1d);J.1h()}};g(1p(F)!=\'2d\')F={};g(\'1d\'1a F){1d(F.1d);J.1h()}d 2q=j.2z[0]||0;d 2n=j.2z[1]||0;d 2m=j.2O[0]||0;d 2i=j.2O[1]||0;1j.1x(\'2X\');k{2Z:2Z,1d:1d,21:3E,3m:3m,2V:2V}};$.5e.1n=7(j){7 3G(1D){d 4d=j.4R||1D.2N;d I=4P 4S();d 1D=1D;I.50=7(){$(1D).1v().4A(I);1D.1n=$.1n(I,j)};I.2N=4d};g(1p(j)!==\'2d\')j={};1T.4J(7(){g(\'1n\'1a 1T){g(j==\'52\')k 1T.1n;1g 1T.1n.21(j)}1g 3G(1T)});k 1T};',62,325,'|||||||function||||||var|||if|||options|return||y2||||x2||||y1|||||pos|x1|css|case|px|Coords|opt|obj|handle|img|Selection|false|boundy|true|Math|break|left|getFixed|top|boundx|ord|height|100|width|delta|oy|ox||nw|div|yy||xx|position|abs|animat|mode|in|absolute|pcent|setSelect|update|addClass|else|done|hhs|Tracker|aspect|zIndex|parseInt|Jcrop|disableHandles|typeof|btndown|release|ne|pct|type|hide|show|setCursor|setCurrent|opacity|setPressed|aspectLock|fc|from|switch|flipCoords|activateHandlers|nh|xscale|jq|round|cssClass|sw|move|shift_down|append|yscale|awake|trk|this|xsize|rw|insertDragbar|south|insertBorder|rh||setOptions|ysize|bound|keymgr|aspectRatio|trackUp||sel|doNudge|east|moveOffset|keySupport|object|se|watchShift|hdl_holder|nudge|ymin|preventDefault|stopPropagation|watchKeys|xmin|ylimit|animMode|initcr|xlimit|mouseAbs|animto|enableHandles|docOffset|onDone|onMove|trackDocument|offset|maxSize|resize|trackMove|img_holder|onChange|seehandles|borders|onSelect|unscale|updateVisible|li|getCorner|trackDoc|lloc|src|minSize|doneSelect|getPos|xa|mouseup|rebound|hdep|tellScaled|dragDiv|crosshair|createHandles|animateTo|drawBorders|moveHandles|animateStart|KeyManager|img2|midhoriz|trueSize||||midvert|createDragger|rwa|browser|msie|getOffset|makeObj|animating|lastcurs|rha|mousemove|yb|tellSelect|minSelect|ya|cursor|mousedown|xb|refresh|document|animator|tracker|interv|bgOpacity|zi|vline|dragEdges|sideHandles|hline|handleOffset|setOptionsNew|getRect|attachWhenDone|unbind|cornerHandles|insertHandle|moveto|right|real_ratio|handleSize|borderOpacity|handleOpacity|bottom|290|keywrap|bgColor|insertBefore|animationDelay|baseClass|swingSpeed|attr|ix1||onBlur|init_shift|parseKey|cl|dragmodeHandler|myCursor|presize|newSelection|boxWidth|startDragMode|oppLockCorner|selectDrag|loadsrc|createMover|defaults|hidden|velocity|toBack|toFront|boundary|iy2|iy1|ix2|overflow|boxHeight|pageX|pageY|before|setTimeout|max|start|input|370|dragmode|end|after|backgroundColor|jcrop|null|last|holder|450|relative|window|each|99|radio|360|mouseout|30px|new|shiftKey|useImg|Image|ctrlKey|for|north|west|extend|black|focus|onload|edgeMargin|api|handlePad|wrap|300|keyup|keydown|dimmed|310|blur|320|min|keyCode|fn'.split('|'),0,{})) diff --git a/_darcs/pristine/lib/settingsaction.php b/_darcs/pristine/lib/settingsaction.php index 46f713fa8..62de39d45 100644 --- a/_darcs/pristine/lib/settingsaction.php +++ b/_darcs/pristine/lib/settingsaction.php @@ -60,13 +60,12 @@ class SettingsAction extends Action } } - function form_header($title, $msg=null, $success=false) - { - common_show_header($title, - null, - array($msg, $success), - array($this, 'show_top')); - } + function form_header($title, $msg=NULL, $success=false) { + common_show_header($title, + NULL, + array($msg, $success), + array($this, 'show_top')); + } function show_top($arr) { diff --git a/_darcs/pristine/theme/default/display.css b/_darcs/pristine/theme/default/display.css index 0b894550c..977321616 100644 --- a/_darcs/pristine/theme/default/display.css +++ b/_darcs/pristine/theme/default/display.css @@ -440,6 +440,17 @@ p.time a { float: left; margin: 0 10px 18px 0; } +#avatar_original { + margin-bottom:1em; +} + +#avatar_preview { + overflow:hidden; + width:96px; + height:96px; +} + + a.nickname { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; diff --git a/_darcs/tentative_inventory b/_darcs/tentative_inventory new file mode 100644 index 000000000..4926f6f3b --- /dev/null +++ b/_darcs/tentative_inventory @@ -0,0 +1,123 @@ +Starting with tag: +[TAG 0.6.4.1 +Evan Prodromou **20081220204906] +[identica badge by Kent Brewster. For more information see: +Sarven Capadisli **20081218003302 + http://kentbrewster.com/identica-badge/ + + Copy and paste the following wherever you want the badge to show up: + + + + Substitute your own ID in the user parameter. + +] +[more information in subscription notices +Evan Prodromou **20081212171135] +[first step of phpcs-cleanup of index.php +Evan Prodromou **20081221002332] +[reformatting for phpcs in lib/util.php +Evan Prodromou **20081221003016] +[some modifications to assuage phpcs +Evan Prodromou **20081221003955] +[reformat lib/daemon.php for phpcs +Evan Prodromou **20081221004607] +[reformat for phpcs +Evan Prodromou **20081221005837] +[reformat lib/jabber.php for phpcs, including doc comments +Evan Prodromou **20081222173249] +[reformat lib/language.php for PEAR Coding Standards +Evan Prodromou **20081222193029] +[bring mailbox.php into line with PEAR Coding Standards (mostly) +Evan Prodromou **20081222195041] +[bring messaging section (inbox, outbox, mailbox) into PEAR Code Standards compliance +Evan Prodromou **20081222201304 + + Actually refactored the method names on these classes to come into + complete compliance with the code standards. Untested; maybe there are + some bad method names now. + +] +[reformat and document lib/mail.php for phpcs conformance +Evan Prodromou **20081223173330] +[bring lib/noticelist.php into line with PEAR code standards +Evan Prodromou **20081223190851] +[incorrect label on notice list file comment +Evan Prodromou **20081223191430] +[replace all tabs with four spaces +Evan Prodromou **20081223191907 + + The PEAR coding standards decree: no tabs, but indent by four spaces. + I've done a global search-and-replace on all tabs, replacing them by + four spaces. This is a huge change, but it will go a long way to + getting us towards phpcs-compliance. And that means better code + readability, and that means more participation. + +] +[replace NULL with null +Evan Prodromou **20081223192129 + + Another global search-and-replace update. Here, I've replaced the PHP + keyword 'NULL' with its lowercase version. This is another PEAR code + standards change. + +] +[change function headers to K&R style +Evan Prodromou **20081223193323 + + Another huge change, for PEAR code standards compliance. Function + headers have to be in K&R style (opening brace on its own line), + instead of having the opening brace on the same line as the function + and parameters. So, a little perl magic found all the function + definitions and move the opening brace to the next line (properly + indented... usually). + +] +[TRUE => true, FALSE => false +Evan Prodromou **20081223194428 + + More PEAR coding standards global changes. Here, I've changed all + instances of TRUE to true and FALSE to false. + +] +[move opening brace of class declaration to next line +Evan Prodromou **20081223194923 + + Another gigantor PEAR coding standards patch. Here, I've moved the + opening curly bracket on a class statement to the following line. + +] +[Twitter-bridge: fix for Twitter's new strict policy of rejecting HTTP POSTs with invalid "expect" headers +Zach Copley **20081225152207] +[whitespace changes in actions/register.php after global search-and-replace +Evan Prodromou **20081223195722] +[Laconica-specific extensions for Twitter API +Evan Prodromou **20081230202019] +[add laconica-specific methods to htaccess.sample +Evan Prodromou **20081230202513] +[add laconica methods to unauthed ones +Evan Prodromou **20081230203747] +[implement api/laconica/version method +Evan Prodromou **20081230205939] +[add some breaks so that switch statement works +Evan Prodromou **20081230210114] +[implement the api/laconica/config method +Evan Prodromou **20081230211444] +[better serialization of arrays and booleans in config output +Evan Prodromou **20081230211957] +[wrapper element for config.xml +Evan Prodromou **20081230212202] +[trac750 Automatically update linked Facebook users' statuses +Zach Copley **20090105010407] +[trac750 configurable sync flags for Facebook app (noticesync, replysync) +Zach Copley **20090105040212] +[trac750 added some output to the facebook_update.php script +Zach Copley **20090105045603] +[Jcrop v2 (POST cropping to be completed) +csarven@controlyourself.ca**20081210021607] \ No newline at end of file diff --git a/_darcs/tentative_pristine b/_darcs/tentative_pristine index 212e028d8..e69de29bb 100644 --- a/_darcs/tentative_pristine +++ b/_darcs/tentative_pristine @@ -1,10 +0,0 @@ -hunk ./scripts/update_facebook.php 51 -+print date('r', $current_time) . " Looking for notices to send to Facebook...\n"; -+ -+$cnt = 0; -+ -hunk ./scripts/update_facebook.php 67 -+ $cnt++; -hunk ./scripts/update_facebook.php 74 -+print "Sent $cnt notices to Facebook.\n"; -+ diff --git a/actions/profilesettings.php b/actions/profilesettings.php index 6c22a7933..caec2f93d 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -54,13 +54,13 @@ class ProfilesettingsAction extends SettingsAction return; } - if ($this->arg('save')) { - $this->save_profile(); - } else if ($this->arg('upload')) { - $this->upload_avatar(); - } else if ($this->arg('changepass')) { - $this->change_password(); - } + if ($this->arg('save')) { + $this->save_profile(); + } else if ($this->arg('upload')) { + $this->upload_avatar(); + } else if ($this->arg('changepass')) { + $this->change_password(); + } } @@ -70,31 +70,31 @@ class ProfilesettingsAction extends SettingsAction $user = common_current_user(); $profile = $user->getProfile(); - common_element_start('form', array('method' => 'POST', - 'id' => 'profilesettings', - 'action' => - common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); - - # too much common patterns here... abstractable? - - common_input('nickname', _('Nickname'), - ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, - _('1-64 lowercase letters or numbers, no punctuation or spaces')); - common_input('fullname', _('Full name'), - ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); - common_input('homepage', _('Homepage'), - ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, - _('URL of your homepage, blog, or profile on another site')); - common_textarea('bio', _('Bio'), - ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, - _('Describe yourself and your interests in 140 chars')); - common_input('location', _('Location'), - ($this->arg('location')) ? $this->arg('location') : $profile->location, - _('Where you are, like "City, State (or Region), Country"')); - common_input('tags', _('Tags'), - ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), - _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); + common_element_start('form', array('method' => 'POST', + 'id' => 'profilesettings', + 'action' => + common_local_url('profilesettings'))); + common_hidden('token', common_session_token()); + + # too much common patterns here... abstractable? + + common_input('nickname', _('Nickname'), + ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, + _('1-64 lowercase letters or numbers, no punctuation or spaces')); + common_input('fullname', _('Full name'), + ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); + common_input('homepage', _('Homepage'), + ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, + _('URL of your homepage, blog, or profile on another site')); + common_textarea('bio', _('Bio'), + ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, + _('Describe yourself and your interests in 140 chars')); + common_input('location', _('Location'), + ($this->arg('location')) ? $this->arg('location') : $profile->location, + _('Where you are, like "City, State (or Region), Country"')); + common_input('tags', _('Tags'), + ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), + _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); $language = common_language(); common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); @@ -137,23 +137,23 @@ class ProfilesettingsAction extends SettingsAction common_local_url('profilesettings'))); common_hidden('token', common_session_token()); - if ($original) { - common_element('img', array('src' => $original->url, - 'class' => 'avatar original', - 'width' => $original->width, - 'height' => $original->height, - 'alt' => $user->nickname)); - } + if ($original) { + common_element('img', array('src' => $original->url, + 'class' => 'avatar original', + 'width' => $original->width, + 'height' => $original->height, + 'alt' => $user->nickname)); + } $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); - if ($avatar) { - common_element('img', array('src' => $avatar->url, - 'class' => 'avatar profile', - 'width' => AVATAR_PROFILE_SIZE, - 'height' => AVATAR_PROFILE_SIZE, - 'alt' => $user->nickname)); - } + if ($avatar) { + common_element('img', array('src' => $avatar->url, + 'class' => 'avatar profile', + 'width' => AVATAR_PROFILE_SIZE, + 'height' => AVATAR_PROFILE_SIZE, + 'alt' => $user->nickname)); + } common_element('input', array('name' => 'MAX_FILE_SIZE', @@ -390,8 +390,8 @@ class ProfilesettingsAction extends SettingsAction $this->show_form(_('Failed updating avatar.')); } - @unlink($_FILES['avatarfile']['tmp_name']); - } + @unlink($_FILES['avatarfile']['tmp_name']); + } function nickname_exists($nickname) { diff --git a/js/jcrop/Jcrop.gif b/js/jcrop/Jcrop.gif new file mode 100644 index 000000000..72ea7ccb5 Binary files /dev/null and b/js/jcrop/Jcrop.gif differ diff --git a/js/jcrop/jquery.Jcrop.css b/js/jcrop/jquery.Jcrop.css new file mode 100644 index 000000000..b95178a72 --- /dev/null +++ b/js/jcrop/jquery.Jcrop.css @@ -0,0 +1,45 @@ +/* Fixes issue here http://code.google.com/p/jcrop/issues/detail?id=1 */ +.jcrop-holder +{ + text-align: left; +} + +.jcrop-vline, .jcrop-hline +{ + font-size: 0; + position: absolute; + background: white url('Jcrop.gif') top left repeat; + /* + opacity: .5; + *filter:alpha(opacity=50); + */ +} +.jcrop-vline { height: 100%; width: 1px !important; } +.jcrop-hline { width: 100%; height: 1px !important; } +.jcrop-handle { + font-size: 1px; + width: 7px !important; + height: 7px !important; + border: 1px #eee solid; + background-color: #333; + *width: 9px; + *height: 9px; +} + +.jcrop-tracker { + *background-color: gray; + width: 100%; height: 100%; +} + +.custom .jcrop-vline, +.custom .jcrop-hline +{ + background: yellow; +} +.custom .jcrop-handle +{ + border-color: black; + background-color: #C7BB00; + -moz-border-radius: 3px; + -webkit-border-radius: 3px; +} diff --git a/js/jcrop/jquery.Jcrop.go.js b/js/jcrop/jquery.Jcrop.go.js new file mode 100644 index 000000000..57639814f --- /dev/null +++ b/js/jcrop/jquery.Jcrop.go.js @@ -0,0 +1,41 @@ + $(function(){ + jQuery("#avatar_original img.avatar").Jcrop({ onChange: showPreview, + setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], + onSelect: updateCoords, + aspectRatio: 1, + boxWidth: 640, + boxHeight: 640, + bgColor: '#000', + bgOpacity: .4 + }); + }); + + function showPreview(coords) { + var rx = 96 / coords.w; + var ry = 96 / coords.h; + + var img_width = $("#avatar_original img.avatar").attr("width"); + var img_height = $("#avatar_original img.avatar").attr("height"); + + + $('#avatar_preview img.avatar').css({ + width: Math.round(rx *img_width) + 'px', + height: Math.round(ry * img_height) + 'px', + marginLeft: '-' + Math.round(rx * coords.x) + 'px', + marginTop: '-' + Math.round(ry * coords.y) + 'px' + }); + }; + + function updateCoords(c) { + $('#avatar_crop_x').val(c.x); + $('#avatar_crop_y').val(c.y); + $('#avatar_crop_w').val(c.w); + $('#avatar_crop_h').val(c.h); + }; + + function checkCoords() { + if (parseInt($('#avatar_crop_w').val())) return true; + alert('Please select a crop region then press submit.'); + return false; + }; + diff --git a/js/jcrop/jquery.Jcrop.pack.js b/js/jcrop/jquery.Jcrop.pack.js new file mode 100644 index 000000000..aa82e8abe --- /dev/null +++ b/js/jcrop/jquery.Jcrop.pack.js @@ -0,0 +1,8 @@ +/** + * Jcrop v.0.9.5 (packed) + * (c) 2008 Kelly Hallman and DeepLiquid.com + * More information: http://deepliquid.com/content/Jcrop.html + * Released under MIT License - this header must remain with code + */ + +eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('$.1n=7(G,F){d G=G,F=F;g(1p(G)!==\'2d\')G=$(G)[0];g(1p(F)!==\'2d\')F={};g(!(\'2x\'1a F))F.2x=$.3d.3e?K:M;g(!(\'2c\'1a F))F.2c=$.3d.3e?K:M;d 4f={2x:K,3W:\'4C\',1f:4D,3T:\'4Y\',3x:.6,3O:.4,3P:.5,53:5,3N:9,3D:5,51:14,25:0,2c:M,3I:M,3B:M,30:M,3A:M,49:0,4p:0,4k:8,3V:20,3X:3,2f:K,3n:[0,0],2z:[0,0],2O:[0,0],2D:7(){},2G:7(){}};d j=4f;21(F);d $I=$(G).B({16:\'1b\'});47($I,j.49,j.4p);d S=$I.W(),L=$I.U(),$12=$(\'<12 />\').W(S).U(L).1f(1L(\'4F\')).B({16:\'4H\',4B:j.3T});g(j.1f)$12.1f(j.1f);$I.54($12);d $34=$(\'\').3Y(\'2N\',$I.3Y(\'2N\')).B(\'16\',\'1b\').W(S).U(L);d $2C=$(\'<12 />\').W(1t(V)).U(1t(V)).B({1l:59,16:\'1b\',4o:\'4g\'}).1P($34);d $2g=$(\'<12 />\').W(1t(V)).U(1t(V)).B({1l:5b});d $28=$(\'<12 />\').B({16:\'1b\',1l:55}).3U($I).1P($2C,$2g);d 23=j.4k;d $1S=$(\'<12 />\').1f(1L(\'3v\')).W(S+(23*2)).U(L+(23*2)).B({16:\'1b\',R:D(-23),P:D(-23),1l:3R,1z:0}).3q(48);d 1I,1Q;d 2u=2Q(G),1q,1B,3i,58,3h,1O;g(\'36\'1a j){1I=j.36[0]/S;1Q=j.36[1]/L}d E=7(){d A=0,u=0,q=0,m=0,Z,Y;7 1A(z){d z=2T(z);q=A=z[0];m=u=z[1]};7 1y(z){d z=2T(z);Z=z[0]-q;Y=z[1]-m;q=z[0];m=z[1]};7 3f(){k[Z,Y]};7 2b(2y){d Z=2y[0],Y=2y[1];g(0>A+Z)Z-=Z+A;g(0>u+Y)Y-=Y+u;g(LS){15=S;h=N.17((15-A)/1k);13=1Z<0?u-h:h+u}}1g{15=q;h=3c/1k;13=1Z<0?u-h:u+h;g(13<0){13=0;w=N.17((13-u)*1k);15=1V<0?A-w:w+A}1g g(13>L){13=L;w=N.17(13-u)*1k;15=1V<0?A-w:w+A}}k 4E=3g(1F(A,u,15,13))};7 2T(p){g(p[0]<0)p[0]=0;g(p[1]<0)p[1]=0;g(p[0]>S)p[0]=S;g(p[1]>L)p[1]=L;k[p[0],p[1]]};7 1F(A,u,q,m){d 2R=A,3r=q,3o=u,3l=m;g(q2q))q=(1U>0)?(A+2q):(A-2q);g(2n&&(N.17(22)>2n))m=(22>0)?(u+2n):(u-2n);g(2i&&(N.17(22)<2i))m=(22>0)?(u+2i):(u-2i);g(2m&&(N.17(1U)<2m))q=(1U>0)?(A+2m):(A-2m);g(A<0){q-=A;A-=A}g(u<0){m-=u;u-=u}g(q<0){A-=q;q-=q}g(m<0){u-=m;m-=m}g(q>S){d X=q-S;A-=X;q-=X}g(m>L){d X=m-L;u-=X;m-=X}g(A>S){d X=A-L;m-=X;u-=X}g(u>L){d X=u-L;m-=X;u-=X}k 3g(1F(A,u,q,m))};7 3g(a){k{x:a[0],y:a[1],q:a[2],m:a[3],w:a[2]-a[0],h:a[3]-a[1]}};k{1F:1F,1A:1A,1y:1y,3f:3f,2b:2b,2K:2K,Q:Q}}();d J=7(){d 4v,4z,4y,1R,2U=4x;d 2F={};d H={};d 2E=K;d 1i=j.3D;g(j.30){2F={R:1Y(\'3C\').B(\'R\',$.3d.3e?D(-1):D(0)),3Q:1Y(\'3C\'),P:1Y(\'3z\'),3L:1Y(\'3z\')}}g(j.3A){H.t=1W(\'n\');H.b=1W(\'s\');H.r=1W(\'e\');H.l=1W(\'w\')}j.3B&&2Y([\'n\',\'s\',\'e\',\'w\']);j.3I&&2Y([\'1M\',\'11\',\'1s\',\'2e\']);7 1Y(1u){d 1J=$(\'<12 />\').B({16:\'1b\',1z:j.3O}).1f(1L(1u));$2C.1P(1J);k 1J};7 2W(T,3y){d 1J=$(\'<12 />\').3q(3b(T)).B({3p:T+\'-2A\',16:\'1b\',1l:3y});$2g.1P(1J);k 1J};7 3J(T){k 2W(T,2U++).B({R:D(-1i+1),P:D(-1i+1),1z:j.3P}).1f(1L(\'H\'))};7 1W(T){d s=j.3N,o=1i,h=s,w=s,t=o,l=o;1E(T){C\'n\':C\'s\':w=1t(V);O;C\'e\':C\'w\':h=1t(V);O}k 2W(T,2U++).W(w).U(h).B({R:D(-t+1),P:D(-l+1)})};7 2Y(2J){4U(i 1a 2J)H[2J[i]]=3J(2J[i])};7 31(c){d 3a=N.1K((c.h/2)-1i),35=N.1K((c.w/2)-1i),4V=4W=-1i+1,2a=c.w-1i,1X=c.h-1i,x,y;\'e\'1a H&&H.e.B({R:D(3a),P:D(2a)})&&H.w.B({R:D(3a)})&&H.s.B({R:D(1X),P:D(35)})&&H.n.B({P:D(35)});\'1s\'1a H&&H.1s.B({P:D(2a)})&&H.2e.B({R:D(1X),P:D(2a)})&&H.1M.B({R:D(1X)});\'b\'1a H&&H.b.B({R:D(1X)})&&H.r.B({P:D(2a)})};7 3K(x,y){$34.B({R:D(-y),P:D(-x)});$28.B({R:D(y),P:D(x)})};7 2A(w,h){$28.W(w).U(h)};7 3s(){d p=E.Q();E.1A([p.x,p.y]);E.1y([p.q,p.m])};7 2I(){g(1R)k 1e()};7 1e(){d c=E.Q();2A(c.w,c.h);3K(c.x,c.y);j.30&&2F[\'3L\'].B({P:D(c.w-1)})&&2F[\'3Q\'].B({R:D(c.h-1)});2E&&31(c);1R||1w();j.2D(2H(c))};7 1w(){$28.1w();$I.B(\'1z\',j.3x);1R=M};7 1r(){1o();$28.1v();$I.B(\'1z\',1);1R=K};7 1v(){1r();$I.B(\'1z\',1);1R=K};7 2t(){2E=M;31(E.Q());$2g.1w()};7 1o(){2E=K;$2g.1v()};7 2o(v){(3h=v)?1o():2t()};7 1h(){d c=E.Q();2o(K);3s()};1o();$2C.1P($(\'<12 />\').1f(1L(\'3v\')).3q(3b(\'1N\')).B({3p:\'1N\',16:\'1b\',1l:4M,1z:0}));k{2I:2I,1e:1e,1r:1r,1w:1w,1v:1v,2t:2t,1o:1o,2o:2o,1h:1h}}();d 1j=7(){d 2w=7(){},2v=7(){},2L=j.2x;g(!2L){$1S.3k(2B).2S(26).4N(26)}7 4j(){g(2L){$(3t).3k(2B).2S(26)}$1S.B({1l:4G})}7 4i(){g(2L){$(3t).3H(\'3k\',2B).3H(\'2S\',26)}$1S.B({1l:3R})}7 2B(e){2w(2r(e))};7 26(e){e.2j();e.2k();g(1q){1q=K;2v(2r(e));j.2G(2H(E.Q()));4i();2w=7(){};2v=7(){}}k K};7 1G(1N,1h){1q=M;2w=1N;2v=1h;4j();k K};7 1x(t){$1S.B(\'3p\',t)};$I.4s($1S);k{1G:1G,1x:1x}}();d 33=7(){d $24=$(\'<4w 1u="4L" />\').B({16:\'1b\',P:\'-4O\'}).57(43).56(2f).5a(41),$3S=$(\'<12 />\').B({16:\'1b\',4o:\'4g\'}).1P($24);7 2l(){g(j.2c){$24.1w();$24.4Z()}};7 41(e){$24.1v()};7 2f(e){g(!j.2f)k;d 42=1O,1C;1O=e.4Q?M:K;g(42!=1O){g(1O&&1q){1C=E.Q();1B=1C.w/1C.h}1g 1B=0;J.1e()}e.2k();e.2j();k K};7 29(e,x,y){E.2b([x,y]);J.2I();e.2j();e.2k()};7 43(e){g(e.4T)k M;2f(e);d 2h=1O?10:1;1E(e.5d){C 37:29(e,-2h,0);O;C 39:29(e,2h,0);O;C 38:29(e,0,-2h);O;C 40:29(e,0,2h);O;C 27:J.1r();O;C 9:k M}k K};g(j.2c)$3S.3U($I);k{2l:2l}}();7 D(n){k\'\'+1m(n)+\'D\'};7 1t(n){k\'\'+1m(n)+\'%\'};7 1L(44){k j.3W+\'-\'+44};7 2Q(G){d z=$(G).2y();k[z.P,z.R]};7 2r(e){k[(e.4q-2u[0]),(e.4r-2u[1])]};7 46(1u){g(1u!=3i){1j.1x(1u);3i=1u}};7 4a(19,z){2u=2Q(G);1j.1x(19==\'1N\'?19:19+\'-2A\');g(19==\'1N\')k 1j.1G(4e(z),2P);d 1C=E.Q();E.1A(E.2K(4b(19)));1j.1G(45(19,1C),2P)};7 45(19,f){k 7(z){g(!j.25&&!1B)1E(19){C\'e\':z[1]=f.m;O;C\'w\':z[1]=f.m;O;C\'n\':z[0]=f.q;O;C\'s\':z[0]=f.q;O}1g 1E(19){C\'e\':z[1]=f.y+1;O;C\'w\':z[1]=f.y+1;O;C\'n\':z[0]=f.x+1;O;C\'s\':z[0]=f.x+1;O}E.1y(z);J.1e()}};7 4e(z){d 2M=z;33.2l();k 7(z){E.2b([z[0]-2M[0],z[1]-2M[1]]);2M=z;J.1e()}};7 4b(T){1E(T){C\'n\':k\'1M\';C\'s\':k\'11\';C\'e\':k\'11\';C\'w\':k\'1s\';C\'1s\':k\'1M\';C\'11\':k\'2e\';C\'2e\':k\'11\';C\'1M\':k\'1s\'}};7 3b(T){k 7(e){1q=M;4a(T,2r(e));e.2k();e.2j();k K}};7 47($G,w,h){d 11=$G.W(),1H=$G.U();g((11>w)&&w>0){11=w;1H=(w/$G.W())*$G.U()}g((1H>h)&&h>0){1H=h;11=(h/$G.U())*$G.W()}1I=$G.W()/11;1Q=$G.U()/1H;$G.W(11).U(1H)};7 2H(c){k{x:1m(c.x*1I),y:1m(c.y*1Q),q:1m(c.q*1I),m:1m(c.m*1Q),w:1m(c.w*1I),h:1m(c.h*1Q)}};7 2P(z){d c=E.Q();g(c.w>j.3n[0]&&c.h>j.3n[1]){J.2t();J.1h()}1g{J.1r()}1j.1x(\'2X\')};7 48(e){1q=M;2u=2Q(G);J.1r();J.1o();46(\'2X\');E.1A(2r(e));1j.1G(4c,2P);33.2l();e.2k();e.2j();k K};7 4c(z){E.1y(z);J.1e()};7 2Z(a){d A=a[0],u=a[1],q=a[2],m=a[3];g(3h)k;d 2s=E.1F(A,u,q,m);d c=E.Q();d 18=2p=[c.x,c.y,c.q,c.m];d 3w=j.3V;d x=18[0];d y=18[1];d q=18[2];d m=18[3];d 3Z=2s[0]-2p[0];d 4m=2s[1]-2p[1];d 4n=2s[2]-2p[2];d 4l=2s[3]-2p[3];d 1c=0;d 4h=j.3X;J.2o(M);d 3u=7(){k 7(){1c+=(V-1c)/4h;18[0]=x+((1c/V)*3Z);18[1]=y+((1c/V)*4m);18[2]=q+((1c/V)*4n);18[3]=m+((1c/V)*4l);g(1c=4K.8)1c=V;1d(18)}}();7 32(){4I.4t(3u,3w)};32()};7 1d(l){E.1A([l[0],l[1]]);E.1y([l[2],l[3]]);J.1e()};7 21(F){g(1p(F)!=\'2d\')F={};j=$.4X(j,F);g(1p(j.2D)!==\'7\')j.2D=7(){};g(1p(j.2G)!==\'7\')j.2G=7(){}};7 3m(){k 2H(E.Q())};7 2V(){k E.Q()};7 3E(F){21(F);g(\'1d\'1a F){1d(F.1d);J.1h()}};g(1p(F)!=\'2d\')F={};g(\'1d\'1a F){1d(F.1d);J.1h()}d 2q=j.2z[0]||0;d 2n=j.2z[1]||0;d 2m=j.2O[0]||0;d 2i=j.2O[1]||0;1j.1x(\'2X\');k{2Z:2Z,1d:1d,21:3E,3m:3m,2V:2V}};$.5e.1n=7(j){7 3G(1D){d 4d=j.4R||1D.2N;d I=4P 4S();d 1D=1D;I.50=7(){$(1D).1v().4A(I);1D.1n=$.1n(I,j)};I.2N=4d};g(1p(j)!==\'2d\')j={};1T.4J(7(){g(\'1n\'1a 1T){g(j==\'52\')k 1T.1n;1g 1T.1n.21(j)}1g 3G(1T)});k 1T};',62,325,'|||||||function||||||var|||if|||options|return||y2||||x2||||y1|||||pos|x1|css|case|px|Coords|opt|obj|handle|img|Selection|false|boundy|true|Math|break|left|getFixed|top|boundx|ord|height|100|width|delta|oy|ox||nw|div|yy||xx|position|abs|animat|mode|in|absolute|pcent|setSelect|update|addClass|else|done|hhs|Tracker|aspect|zIndex|parseInt|Jcrop|disableHandles|typeof|btndown|release|ne|pct|type|hide|show|setCursor|setCurrent|opacity|setPressed|aspectLock|fc|from|switch|flipCoords|activateHandlers|nh|xscale|jq|round|cssClass|sw|move|shift_down|append|yscale|awake|trk|this|xsize|rw|insertDragbar|south|insertBorder|rh||setOptions|ysize|bound|keymgr|aspectRatio|trackUp||sel|doNudge|east|moveOffset|keySupport|object|se|watchShift|hdl_holder|nudge|ymin|preventDefault|stopPropagation|watchKeys|xmin|ylimit|animMode|initcr|xlimit|mouseAbs|animto|enableHandles|docOffset|onDone|onMove|trackDocument|offset|maxSize|resize|trackMove|img_holder|onChange|seehandles|borders|onSelect|unscale|updateVisible|li|getCorner|trackDoc|lloc|src|minSize|doneSelect|getPos|xa|mouseup|rebound|hdep|tellScaled|dragDiv|crosshair|createHandles|animateTo|drawBorders|moveHandles|animateStart|KeyManager|img2|midhoriz|trueSize||||midvert|createDragger|rwa|browser|msie|getOffset|makeObj|animating|lastcurs|rha|mousemove|yb|tellSelect|minSelect|ya|cursor|mousedown|xb|refresh|document|animator|tracker|interv|bgOpacity|zi|vline|dragEdges|sideHandles|hline|handleOffset|setOptionsNew|getRect|attachWhenDone|unbind|cornerHandles|insertHandle|moveto|right|real_ratio|handleSize|borderOpacity|handleOpacity|bottom|290|keywrap|bgColor|insertBefore|animationDelay|baseClass|swingSpeed|attr|ix1||onBlur|init_shift|parseKey|cl|dragmodeHandler|myCursor|presize|newSelection|boxWidth|startDragMode|oppLockCorner|selectDrag|loadsrc|createMover|defaults|hidden|velocity|toBack|toFront|boundary|iy2|iy1|ix2|overflow|boxHeight|pageX|pageY|before|setTimeout|max|start|input|370|dragmode|end|after|backgroundColor|jcrop|null|last|holder|450|relative|window|each|99|radio|360|mouseout|30px|new|shiftKey|useImg|Image|ctrlKey|for|north|west|extend|black|focus|onload|edgeMargin|api|handlePad|wrap|300|keyup|keydown|dimmed|310|blur|320|min|keyCode|fn'.split('|'),0,{})) diff --git a/lib/settingsaction.php b/lib/settingsaction.php index 46f713fa8..62de39d45 100644 --- a/lib/settingsaction.php +++ b/lib/settingsaction.php @@ -60,13 +60,12 @@ class SettingsAction extends Action } } - function form_header($title, $msg=null, $success=false) - { - common_show_header($title, - null, - array($msg, $success), - array($this, 'show_top')); - } + function form_header($title, $msg=NULL, $success=false) { + common_show_header($title, + NULL, + array($msg, $success), + array($this, 'show_top')); + } function show_top($arr) { diff --git a/theme/default/display.css b/theme/default/display.css index 0b894550c..977321616 100644 --- a/theme/default/display.css +++ b/theme/default/display.css @@ -440,6 +440,17 @@ p.time a { float: left; margin: 0 10px 18px 0; } +#avatar_original { + margin-bottom:1em; +} + +#avatar_preview { + overflow:hidden; + width:96px; + height:96px; +} + + a.nickname { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; -- cgit v1.2.3-54-g00ecf From ba24378fdff1de0aee31878dca0e92cc87a56ae8 Mon Sep 17 00:00:00 2001 From: csarven Date: Tue, 9 Dec 2008 21:59:22 -0500 Subject: Jcrop CSS updates to original/preview views darcs-hash:20081210025922-eefa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz --- _darcs/inventory | 4 +- ...fa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz | Bin 0 -> 950 bytes _darcs/patches/unrevert | 179 +++------------------ _darcs/pristine/js/jcrop/jquery.Jcrop.go.js | 4 +- _darcs/pristine/theme/default/display.css | 19 ++- _darcs/tentative_inventory | 4 +- js/jcrop/jquery.Jcrop.go.js | 4 +- theme/default/display.css | 19 ++- 8 files changed, 69 insertions(+), 164 deletions(-) create mode 100644 _darcs/patches/20081210025922-eefa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz (limited to 'js') diff --git a/_darcs/inventory b/_darcs/inventory index 4926f6f3b..0b89ad962 100644 --- a/_darcs/inventory +++ b/_darcs/inventory @@ -120,4 +120,6 @@ Zach Copley **20090105040212] [trac750 added some output to the facebook_update.php script Zach Copley **20090105045603] [Jcrop v2 (POST cropping to be completed) -csarven@controlyourself.ca**20081210021607] \ No newline at end of file +csarven@controlyourself.ca**20081210021607] +[Jcrop CSS updates to original/preview views +csarven@controlyourself.ca**20081210025922] \ No newline at end of file diff --git a/_darcs/patches/20081210025922-eefa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz b/_darcs/patches/20081210025922-eefa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz new file mode 100644 index 000000000..d56e89497 Binary files /dev/null and b/_darcs/patches/20081210025922-eefa4-20d87784a350ccc94ee8cb2d69ad44b1b0c92539.gz differ diff --git a/_darcs/patches/unrevert b/_darcs/patches/unrevert index fbfd7b2fc..374813245 100644 --- a/_darcs/patches/unrevert +++ b/_darcs/patches/unrevert @@ -2,108 +2,27 @@ New patches: [unrevert -anonymous**20090106212611] { -hunk ./actions/profilesettings.php 57 - return; - } - -+v v v v v v v - if ($this->arg('save')) { - $this->save_profile(); - } else if ($this->arg('upload')) { -hunk ./actions/profilesettings.php 62 - $this->upload_avatar(); -+ } else if ($this->arg('crop')) { -+ $this->crop_avatar(); - } else if ($this->arg('changepass')) { - $this->change_password(); - } -hunk ./actions/profilesettings.php 67 -+************* -+ if ($this->arg('save')) { -+ $this->save_profile(); -+ } else if ($this->arg('upload')) { -+ $this->upload_avatar(); -+ } else if ($this->arg('changepass')) { -+ $this->change_password(); -+ } -+^ ^ ^ ^ ^ ^ ^ - - } - -hunk ./actions/profilesettings.php 85 - $user = common_current_user(); - $profile = $user->getProfile(); - -+v v v v v v v - common_element_start('form', array('method' => 'POST', - 'id' => 'profilesettings', -hunk ./actions/profilesettings.php 88 -- 'action' => -- common_local_url('profilesettings'))); -+ 'action' => common_local_url('profilesettings'))); - common_hidden('token', common_session_token()); - - # too much common patterns here... abstractable? -hunk ./actions/profilesettings.php 110 - common_input('tags', _('Tags'), - ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), - _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); -+************* -+ common_element_start('form', array('method' => 'POST', -+ 'id' => 'profilesettings', -+ 'action' => -+ common_local_url('profilesettings'))); -+ common_hidden('token', common_session_token()); -+ -+ # too much common patterns here... abstractable? -+ -+ common_input('nickname', _('Nickname'), -+ ($this->arg('nickname')) ? $this->arg('nickname') : $profile->nickname, -+ _('1-64 lowercase letters or numbers, no punctuation or spaces')); -+ common_input('fullname', _('Full name'), -+ ($this->arg('fullname')) ? $this->arg('fullname') : $profile->fullname); -+ common_input('homepage', _('Homepage'), -+ ($this->arg('homepage')) ? $this->arg('homepage') : $profile->homepage, -+ _('URL of your homepage, blog, or profile on another site')); -+ common_textarea('bio', _('Bio'), -+ ($this->arg('bio')) ? $this->arg('bio') : $profile->bio, -+ _('Describe yourself and your interests in 140 chars')); -+ common_input('location', _('Location'), -+ ($this->arg('location')) ? $this->arg('location') : $profile->location, -+ _('Where you are, like "City, State (or Region), Country"')); -+ common_input('tags', _('Tags'), -+ ($this->arg('tags')) ? $this->arg('tags') : implode(' ', $user->getSelfTags()), -+ _('Tags for yourself (letters, numbers, -, ., and _), comma- or space- separated')); -+^ ^ ^ ^ ^ ^ ^ - - $language = common_language(); - common_dropdown('language', _('Language'), get_nice_language_list(), _('Preferred language'), true, $language); -hunk ./actions/profilesettings.php 179 +anonymous**20090106212612] { +hunk ./actions/profilesettings.php 140 common_local_url('profilesettings'))); common_hidden('token', common_session_token()); +v v v v v v v if ($original) { -hunk ./actions/profilesettings.php 181 +hunk ./actions/profilesettings.php 142 ++ common_element_start('div', array('id'=>'avatar_original', 'class'=>'avatar_view')); + common_element('h3', null, _("Original:")); -+ common_element_start('div', array('id'=>'avatar_original')); ++ common_element_start('div', array('id'=>'avatar_original_view')); common_element('img', array('src' => $original->url, 'class' => 'avatar original', 'width' => $original->width, -hunk ./actions/profilesettings.php 188 +hunk ./actions/profilesettings.php 150 'height' => $original->height, 'alt' => $user->nickname)); + common_element_end('div'); -+ -+ foreach(array('avatar_crop_x', 'avatar_crop_y', 'avatar_crop_w', 'avatar_crop_h') as $crop_info) { -+ common_element('input', array('name' => $crop_info, -+ 'type' => 'hidden', -+ 'id' => $crop_info)); -+ } -+ common_submit('avatar_crop', _('Crop')); ++ common_element_end('div'); } -hunk ./actions/profilesettings.php 197 +hunk ./actions/profilesettings.php 153 +************* + if ($original) { + common_element('img', array('src' => $original->url, @@ -116,22 +35,31 @@ hunk ./actions/profilesettings.php 197 $avatar = $profile->getAvatar(AVATAR_PROFILE_SIZE); -hunk ./actions/profilesettings.php 209 +hunk ./actions/profilesettings.php 165 +v v v v v v v if ($avatar) { -hunk ./actions/profilesettings.php 211 +hunk ./actions/profilesettings.php 167 - common_element('img', array('src' => $avatar->url, ++ common_element_start('div', array('id'=>'avatar_preview', 'class'=>'avatar_view')); + common_element('h3', null, _("Preview:")); -+ common_element_start('div', array('id'=>'avatar_preview')); ++ common_element_start('div', array('id'=>'avatar_preview_view')); + common_element('img', array('src' => $original->url,//$avatar->url, 'class' => 'avatar profile', 'width' => AVATAR_PROFILE_SIZE, 'height' => AVATAR_PROFILE_SIZE, -hunk ./actions/profilesettings.php 218 +hunk ./actions/profilesettings.php 175 'alt' => $user->nickname)); + common_element_end('div'); ++ common_element_end('div'); ++ ++ foreach(array('avatar_crop_x', 'avatar_crop_y', 'avatar_crop_w', 'avatar_crop_h') as $crop_info) { ++ common_element('input', array('name' => $crop_info, ++ 'type' => 'hidden', ++ 'id' => $crop_info)); ++ } ++ common_submit('avatar_crop', _('Crop')); } -hunk ./actions/profilesettings.php 220 +hunk ./actions/profilesettings.php 185 +************* + if ($avatar) { + common_element('img', array('src' => $avatar->url, @@ -144,69 +72,12 @@ hunk ./actions/profilesettings.php 220 common_element('input', array('name' => 'MAX_FILE_SIZE', -hunk ./actions/profilesettings.php 465 - $this->show_form(_('Failed updating avatar.')); - } - -+v v v v v v v - @unlink($_FILES['avatarfile']['tmp_name']); - } - -hunk ./actions/profilesettings.php 469 -+ function crop_avatar() { -+// http://deepliquid.com/content/Jcrop_Implementation_Theory.html -+// Grab POSTs x, y, w, h and crop out a rectangle topleft: (x,y), bottomright: (x+w, x+h) using the original image. -+ } -+************* -+ @unlink($_FILES['avatarfile']['tmp_name']); -+ } -+^ ^ ^ ^ ^ ^ ^ -+ - function nickname_exists($nickname) - { - $user = common_current_user(); -hunk ./lib/settingsaction.php 63 - } - } - -+v v v v v v v - function form_header($title, $msg=NULL, $success=false) { - common_show_header($title, -hunk ./lib/settingsaction.php 66 -- NULL, -+ array($this, 'show_header'), - array($msg, $success), - array($this, 'show_top')); - } -hunk ./lib/settingsaction.php 71 - -+ function show_header() { -+ common_element('link', array('rel' => 'stylesheet', -+ 'type' => 'text/css', -+ 'href' => common_path('js/jcrop/jquery.Jcrop.css?version='.LACONICA_VERSION), -+ 'media' => 'screen, projection, tv')); -+ common_element('script', array('type' => 'text/javascript', -+ 'src' => common_path('js/jcrop/jquery.Jcrop.pack.js'))); -+ common_element('script', array('type' => 'text/javascript', -+ 'src' => common_path('js/jcrop/jquery.Jcrop.go.js'))); -+ } -+************* -+ function form_header($title, $msg=null, $success=false) -+ { -+ common_show_header($title, -+ null, -+ array($msg, $success), -+ array($this, 'show_top')); -+ } -+^ ^ ^ ^ ^ ^ ^ -+ - function show_top($arr) - { - $msg = $arr[0]; } Context: +[Jcrop CSS updates to original/preview views +csarven@controlyourself.ca**20081210025922] [Jcrop v2 (POST cropping to be completed) csarven@controlyourself.ca**20081210021607] [trac750 added some output to the facebook_update.php script @@ -330,4 +201,4 @@ Sarven Capadisli **20081218003302 [TAG 0.6.4.1 Evan Prodromou **20081220204906] Patch bundle hash: -afe7b4b695e91033a56499c2eee94a02fa1f0105 +b75aa06ac49c2ff8a9fa803da998c6ea5f5c1d17 diff --git a/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js b/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js index 57639814f..7c5b5e4e6 100644 --- a/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js +++ b/_darcs/pristine/js/jcrop/jquery.Jcrop.go.js @@ -3,8 +3,8 @@ setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], onSelect: updateCoords, aspectRatio: 1, - boxWidth: 640, - boxHeight: 640, + boxWidth: 480, + boxHeight: 480, bgColor: '#000', bgOpacity: .4 }); diff --git a/_darcs/pristine/theme/default/display.css b/_darcs/pristine/theme/default/display.css index 977321616..f22f9aa69 100644 --- a/_darcs/pristine/theme/default/display.css +++ b/_darcs/pristine/theme/default/display.css @@ -440,16 +440,31 @@ p.time a { float: left; margin: 0 10px 18px 0; } -#avatar_original { + +#profilesettings { + margin-bottom:2em; +} + + +.avatar_view { + float:left; margin-bottom:1em; + margin-right:1em; } -#avatar_preview { +#avatar_preview_view { overflow:hidden; width:96px; height:96px; } +#avatar_crop { + margin-bottom:2em; +} +#avatar_crop, +#avatarfile { + clear:both; +} a.nickname { font-family: Verdana, Arial, Helvetica, sans-serif; diff --git a/_darcs/tentative_inventory b/_darcs/tentative_inventory index 4926f6f3b..0b89ad962 100644 --- a/_darcs/tentative_inventory +++ b/_darcs/tentative_inventory @@ -120,4 +120,6 @@ Zach Copley **20090105040212] [trac750 added some output to the facebook_update.php script Zach Copley **20090105045603] [Jcrop v2 (POST cropping to be completed) -csarven@controlyourself.ca**20081210021607] \ No newline at end of file +csarven@controlyourself.ca**20081210021607] +[Jcrop CSS updates to original/preview views +csarven@controlyourself.ca**20081210025922] \ No newline at end of file diff --git a/js/jcrop/jquery.Jcrop.go.js b/js/jcrop/jquery.Jcrop.go.js index 57639814f..7c5b5e4e6 100644 --- a/js/jcrop/jquery.Jcrop.go.js +++ b/js/jcrop/jquery.Jcrop.go.js @@ -3,8 +3,8 @@ setSelect: [ 0, 0, $("#avatar_original img.avatar").attr("width"), $("#avatar_original img.avatar").attr("height") ], onSelect: updateCoords, aspectRatio: 1, - boxWidth: 640, - boxHeight: 640, + boxWidth: 480, + boxHeight: 480, bgColor: '#000', bgOpacity: .4 }); diff --git a/theme/default/display.css b/theme/default/display.css index 977321616..f22f9aa69 100644 --- a/theme/default/display.css +++ b/theme/default/display.css @@ -440,16 +440,31 @@ p.time a { float: left; margin: 0 10px 18px 0; } -#avatar_original { + +#profilesettings { + margin-bottom:2em; +} + + +.avatar_view { + float:left; margin-bottom:1em; + margin-right:1em; } -#avatar_preview { +#avatar_preview_view { overflow:hidden; width:96px; height:96px; } +#avatar_crop { + margin-bottom:2em; +} +#avatar_crop, +#avatarfile { + clear:both; +} a.nickname { font-family: Verdana, Arial, Helvetica, sans-serif; -- cgit v1.2.3-54-g00ecf From a6c9e3cea0e376034ff1f27342a90dde4affb0c7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 14 Jan 2009 11:45:07 -0500 Subject: Update jQuery libraries to 1.3 --- js/jquery.js | 3126 +++++++++++++++++++++++++++++++++--------------------- js/jquery.min.js | 43 +- 2 files changed, 1924 insertions(+), 1245 deletions(-) (limited to 'js') diff --git a/js/jquery.js b/js/jquery.js index 88e661eec..fc06ace27 100644 --- a/js/jquery.js +++ b/js/jquery.js @@ -1,34 +1,36 @@ -(function(){ -/* - * jQuery 1.2.6 - New Wave Javascript +/*! + * jQuery JavaScript Library v1.3 + * http://jquery.com/ * - * Copyright (c) 2008 John Resig (jquery.com) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License * - * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $ - * $Rev: 5685 $ + * Date: 2009-01-13 12:50:31 -0500 (Tue, 13 Jan 2009) + * Revision: 6104 */ +(function(){ -// Map over jQuery in case of overwrite -var _jQuery = window.jQuery, -// Map over the $ in case of overwrite - _$ = window.$; - -var jQuery = window.jQuery = window.$ = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); -}; - -// A simple way to check for HTML strings or ID strings -// (both of which we optimize for) -var quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/, - -// Is it a simple selector - isSimple = /^.[^:#\[\.]*$/, +var + // Will speed up references to window, and allows munging its name. + window = this, + // Will speed up references to undefined, and allows munging its name. + undefined, + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + // Map over the $ in case of overwrite + _$ = window.$, + + jQuery = window.jQuery = window.$ = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, -// Will speed up references to undefined, and allows munging its name. - undefined; + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/, + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/; jQuery.fn = jQuery.prototype = { init: function( selector, context ) { @@ -39,10 +41,11 @@ jQuery.fn = jQuery.prototype = { if ( selector.nodeType ) { this[0] = selector; this.length = 1; + this.context = selector; return this; } // Handle HTML strings - if ( typeof selector == "string" ) { + if ( typeof selector === "string" ) { // Are we dealing with HTML string or an ID? var match = quickExpr.exec( selector ); @@ -65,7 +68,10 @@ jQuery.fn = jQuery.prototype = { return jQuery().find( selector ); // Otherwise, we inject the element directly into the jQuery object - return jQuery( elem ); + var ret = jQuery( elem ); + ret.context = document; + ret.selector = selector; + return ret; } selector = []; } @@ -78,26 +84,32 @@ jQuery.fn = jQuery.prototype = { // HANDLE: $(function) // Shortcut for document ready } else if ( jQuery.isFunction( selector ) ) - return jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); + return jQuery( document ).ready( selector ); + + // Make sure that old selector state is passed along + if ( selector.selector && selector.context ) { + this.selector = selector.selector; + this.context = selector.context; + } return this.setArray(jQuery.makeArray(selector)); }, + // Start with an empty selector + selector: "", + // The current version of jQuery being used - jquery: "1.2.6", + jquery: "1.3", // The number of elements contained in the matched element set size: function() { return this.length; }, - // The number of elements contained in the matched element set - length: 0, - // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { - return num == undefined ? + return num === undefined ? // Return a 'clean' array jQuery.makeArray( this ) : @@ -108,13 +120,20 @@ jQuery.fn = jQuery.prototype = { // Take an array of elements and push it onto the stack // (returning the new matched element set) - pushStack: function( elems ) { + pushStack: function( elems, name, selector ) { // Build a new jQuery matched element set var ret = jQuery( elems ); // Add the old object onto the stack (as a reference) ret.prevObject = this; + ret.context = this.context; + + if ( name === "find" ) + ret.selector = this.selector + (this.selector ? " " : "") + selector; + else if ( name ) + ret.selector = this.selector + "." + name + "(" + selector + ")"; + // Return the newly-formed element set return ret; }, @@ -141,8 +160,6 @@ jQuery.fn = jQuery.prototype = { // Determine the position of an element within // the matched set of elements index: function( elem ) { - var ret = -1; - // Locate the position of the desired element return jQuery.inArray( // If it receives a jQuery object, the first element is used @@ -154,7 +171,7 @@ jQuery.fn = jQuery.prototype = { var options = name; // Look for the case where we're accessing a style value - if ( name.constructor == String ) + if ( typeof name === "string" ) if ( value === undefined ) return this[0] && jQuery[ type || "attr" ]( this[0], name ); @@ -184,7 +201,7 @@ jQuery.fn = jQuery.prototype = { }, text: function( text ) { - if ( typeof text != "object" && text != null ) + if ( typeof text !== "object" && text != null ) return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) ); var ret = ""; @@ -202,20 +219,22 @@ jQuery.fn = jQuery.prototype = { }, wrapAll: function( html ) { - if ( this[0] ) + if ( this[0] ) { // The elements to wrap the target around - jQuery( html, this[0].ownerDocument ) - .clone() - .insertBefore( this[0] ) - .map(function(){ - var elem = this; + var wrap = jQuery( html, this[0].ownerDocument ).clone(); + + if ( this[0].parentNode ) + wrap.insertBefore( this[0] ); - while ( elem.firstChild ) - elem = elem.firstChild; + wrap.map(function(){ + var elem = this; - return elem; - }) - .append(this); + while ( elem.firstChild ) + elem = elem.firstChild; + + return elem; + }).append(this); + } return this; }, @@ -233,27 +252,27 @@ jQuery.fn = jQuery.prototype = { }, append: function() { - return this.domManip(arguments, true, false, function(elem){ + return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.appendChild( elem ); }); }, prepend: function() { - return this.domManip(arguments, true, true, function(elem){ + return this.domManip(arguments, true, function(elem){ if (this.nodeType == 1) this.insertBefore( elem, this.firstChild ); }); }, before: function() { - return this.domManip(arguments, false, false, function(elem){ + return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this ); }); }, after: function() { - return this.domManip(arguments, false, true, function(elem){ + return this.domManip(arguments, false, function(elem){ this.parentNode.insertBefore( elem, this.nextSibling ); }); }, @@ -262,20 +281,31 @@ jQuery.fn = jQuery.prototype = { return this.prevObject || jQuery( [] ); }, + // For internal use only. + // Behaves like an Array's .push method, not like a jQuery method. + push: [].push, + find: function( selector ) { - var elems = jQuery.map(this, function(elem){ - return jQuery.find( selector, elem ); - }); + if ( this.length === 1 && !/,/.test(selector) ) { + var ret = this.pushStack( [], "find", selector ); + ret.length = 0; + jQuery.find( selector, this[0], ret ); + return ret; + } else { + var elems = jQuery.map(this, function(elem){ + return jQuery.find( selector, elem ); + }); - return this.pushStack( /[^+>] [^+>]/.test( selector ) || selector.indexOf("..") > -1 ? - jQuery.unique( elems ) : - elems ); + return this.pushStack( /[^+>] [^+>]/.test( selector ) ? + jQuery.unique( elems ) : + elems, "find", selector ); + } }, clone: function( events ) { // Do the clone var ret = this.map(function(){ - if ( jQuery.browser.msie && !jQuery.isXMLDoc(this) ) { + if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) { // IE copies events bound via attachEvent when // using cloneNode. Calling detachEvent on the // clone will also remove the events from the orignal @@ -296,7 +326,7 @@ jQuery.fn = jQuery.prototype = { // removeData doesn't work here, IE removes it from the original as well // this is primarily for IE but the data expando shouldn't be copied over in any browser var clone = ret.find("*").andSelf().each(function(){ - if ( this[ expando ] != undefined ) + if ( this[ expando ] !== undefined ) this[ expando ] = null; }); @@ -323,14 +353,29 @@ jQuery.fn = jQuery.prototype = { return selector.call( elem, i ); }) || - jQuery.multiFilter( selector, this ) ); + jQuery.multiFilter( selector, jQuery.grep(this, function(elem){ + return elem.nodeType === 1; + }) ), "filter", selector ); + }, + + closest: function( selector ) { + var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null; + + return this.map(function(){ + var cur = this; + while ( cur && cur.ownerDocument ) { + if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selector) ) + return cur; + cur = cur.parentNode; + } + }); }, not: function( selector ) { - if ( selector.constructor == String ) + if ( typeof selector === "string" ) // test special case where just one selector is passed in if ( isSimple.test( selector ) ) - return this.pushStack( jQuery.multiFilter( selector, this, true ) ); + return this.pushStack( jQuery.multiFilter( selector, this, true ), "not", selector ); else selector = jQuery.multiFilter( selector, this ); @@ -343,7 +388,7 @@ jQuery.fn = jQuery.prototype = { add: function( selector ) { return this.pushStack( jQuery.unique( jQuery.merge( this.get(), - typeof selector == 'string' ? + typeof selector === "string" ? jQuery( selector ) : jQuery.makeArray( selector ) ))); @@ -354,15 +399,17 @@ jQuery.fn = jQuery.prototype = { }, hasClass: function( selector ) { - return this.is( "." + selector ); + return !!selector && this.is( "." + selector ); }, val: function( value ) { - if ( value == undefined ) { - - if ( this.length ) { - var elem = this[0]; + if ( value === undefined ) { + var elem = this[0]; + if ( elem ) { + if( jQuery.nodeName( elem, 'option' ) ) + return (elem.attributes.value || {}).specified ? elem.value : elem.text; + // We need to handle select boxes special if ( jQuery.nodeName( elem, "select" ) ) { var index = elem.selectedIndex, @@ -380,7 +427,7 @@ jQuery.fn = jQuery.prototype = { if ( option.selected ) { // Get the specifc value for the option - value = jQuery.browser.msie && !option.attributes.value.specified ? option.text : option.value; + value = jQuery(option).val(); // We don't need an array for one selects if ( one ) @@ -391,25 +438,25 @@ jQuery.fn = jQuery.prototype = { } } - return values; + return values; + } // Everything else, we just grab the value - } else - return (this[0].value || "").replace(/\r/g, ""); + return (elem.value || "").replace(/\r/g, ""); } return undefined; } - if( value.constructor == Number ) + if ( typeof value === "number" ) value += ''; return this.each(function(){ if ( this.nodeType != 1 ) return; - if ( value.constructor == Array && /radio|checkbox/.test( this.type ) ) + if ( jQuery.isArray(value) && /radio|checkbox/.test( this.type ) ) this.checked = (jQuery.inArray(this.value, value) >= 0 || jQuery.inArray(this.name, value) >= 0); @@ -430,7 +477,7 @@ jQuery.fn = jQuery.prototype = { }, html: function( value ) { - return value == undefined ? + return value === undefined ? (this[0] ? this[0].innerHTML : null) : @@ -442,11 +489,12 @@ jQuery.fn = jQuery.prototype = { }, eq: function( i ) { - return this.slice( i, i + 1 ); + return this.slice( i, +i + 1 ); }, slice: function() { - return this.pushStack( Array.prototype.slice.apply( this, arguments ) ); + return this.pushStack( Array.prototype.slice.apply( this, arguments ), + "slice", Array.prototype.slice.call(arguments).join(",") ); }, map: function( callback ) { @@ -459,69 +507,29 @@ jQuery.fn = jQuery.prototype = { return this.add( this.prevObject ); }, - data: function( key, value ){ - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) - data = jQuery.data( this[0], key ); - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function(){ - jQuery.data( this, key, value ); - }); - }, - - removeData: function( key ){ - return this.each(function(){ - jQuery.removeData( this, key ); - }); - }, - - domManip: function( args, table, reverse, callback ) { - var clone = this.length > 1, elems; - - return this.each(function(){ - if ( !elems ) { - elems = jQuery.clean( args, this.ownerDocument ); - - if ( reverse ) - elems.reverse(); - } - - var obj = this; - - if ( table && jQuery.nodeName( this, "table" ) && jQuery.nodeName( elems[0], "tr" ) ) - obj = this.getElementsByTagName("tbody")[0] || this.appendChild( this.ownerDocument.createElement("tbody") ); - - var scripts = jQuery( [] ); - - jQuery.each(elems, function(){ - var elem = clone ? - jQuery( this ).clone( true )[0] : - this; - - // execute all scripts after the elements have been injected - if ( jQuery.nodeName( elem, "script" ) ) - scripts = scripts.add( elem ); - else { - // Remove any inner scripts for later evaluation - if ( elem.nodeType == 1 ) - scripts = scripts.add( jQuery( "script", elem ).remove() ); - - // Inject the elements into the document - callback.call( obj, elem ); - } - }); + domManip: function( args, table, callback ) { + if ( this[0] ) { + var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(), + scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ), + first = fragment.firstChild, + extra = this.length > 1 ? fragment.cloneNode(true) : fragment; + + if ( first ) + for ( var i = 0, l = this.length; i < l; i++ ) + callback.call( root(this[i], first), i > 0 ? extra.cloneNode(true) : fragment ); + + if ( scripts ) + jQuery.each( scripts, evalScript ); + } - scripts.each( evalScript ); - }); + return this; + + function root( elem, cur ) { + return table && jQuery.nodeName(elem, "table") && jQuery.nodeName(cur, "tr") ? + (elem.getElementsByTagName("tbody")[0] || + elem.appendChild(elem.ownerDocument.createElement("tbody"))) : + elem; + } } }; @@ -552,7 +560,7 @@ jQuery.extend = jQuery.fn.extend = function() { var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; // Handle a deep copy situation - if ( target.constructor == Boolean ) { + if ( typeof target === "boolean" ) { deep = target; target = arguments[1] || {}; // skip the boolean and the target @@ -560,7 +568,7 @@ jQuery.extend = jQuery.fn.extend = function() { } // Handle case when target is a string or something (possible in deep copy) - if ( typeof target != "object" && typeof target != "function" ) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) target = {}; // extend jQuery itself if only one argument is passed @@ -581,7 +589,7 @@ jQuery.extend = jQuery.fn.extend = function() { continue; // Recurse if we're merging object values - if ( deep && copy && typeof copy == "object" && !copy.nodeType ) + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) target[ name ] = jQuery.extend( deep, // Never move original objects, clone them src || ( copy.length != null ? [ ] : { } ) @@ -597,11 +605,11 @@ jQuery.extend = jQuery.fn.extend = function() { return target; }; -var expando = "jQuery" + now(), uuid = 0, windowData = {}, - // exclude the following css properties to add px - exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, +// exclude the following css properties to add px +var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i, // cache defaultView - defaultView = document.defaultView || {}; + defaultView = document.defaultView || {}, + toString = Object.prototype.toString; jQuery.extend({ noConflict: function( deep ) { @@ -613,10 +621,15 @@ jQuery.extend({ return jQuery; }, - // See test/unit/core.js for details concerning this function. - isFunction: function( fn ) { - return !!fn && typeof fn != "string" && !fn.nodeName && - fn.constructor != Array && /^[\s[]?function/.test( fn + "" ); + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return toString.call(obj) === "[object Function]"; + }, + + isArray: function( obj ) { + return toString.call(obj) === "[object Array]"; }, // check if an element is in a (or is an) XML document @@ -636,10 +649,10 @@ jQuery.extend({ script = document.createElement("script"); script.type = "text/javascript"; - if ( jQuery.browser.msie ) - script.text = data; - else + if ( jQuery.support.scriptEval ) script.appendChild( document.createTextNode( data ) ); + else + script.text = data; // Use insertBefore instead of appendChild to circumvent an IE6 bug. // This arises when a base node is used (#2709). @@ -652,80 +665,12 @@ jQuery.extend({ return elem.nodeName && elem.nodeName.toUpperCase() == name.toUpperCase(); }, - cache: {}, - - data: function( elem, name, data ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // Compute a unique ID for the element - if ( !id ) - id = elem[ expando ] = ++uuid; - - // Only generate the data cache if we're - // trying to access or manipulate it - if ( name && !jQuery.cache[ id ] ) - jQuery.cache[ id ] = {}; - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) - jQuery.cache[ id ][ name ] = data; - - // Return the named cache data, or the ID for the element - return name ? - jQuery.cache[ id ][ name ] : - id; - }, - - removeData: function( elem, name ) { - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( jQuery.cache[ id ] ) { - // Remove the section of cache data - delete jQuery.cache[ id ][ name ]; - - // If we've removed all the data, remove the element's cache - name = ""; - - for ( name in jQuery.cache[ id ] ) - break; - - if ( !name ) - jQuery.removeData( elem ); - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch(e){ - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) - elem.removeAttribute( expando ); - } - - // Completely remove the data cache - delete jQuery.cache[ id ]; - } - }, - // args is for internal usage only each: function( object, callback, args ) { var name, i = 0, length = object.length; if ( args ) { - if ( length == undefined ) { + if ( length === undefined ) { for ( name in object ) if ( callback.apply( object[ name ], args ) === false ) break; @@ -736,7 +681,7 @@ jQuery.extend({ // A special, fast, case for the most common use of each } else { - if ( length == undefined ) { + if ( length === undefined ) { for ( name in object ) if ( callback.call( object[ name ], name, object[ name ] ) === false ) break; @@ -754,7 +699,7 @@ jQuery.extend({ value = value.call( elem, i ); // Handle passing in a number to a CSS property - return value && value.constructor == Number && type == "curCSS" && !exclude.test( name ) ? + return typeof value === "number" && type == "curCSS" && !exclude.test( name ) ? value + "px" : value; }, @@ -771,7 +716,7 @@ jQuery.extend({ // internal only, use removeClass("class") remove: function( elem, classNames ) { if (elem.nodeType == 1) - elem.className = classNames != undefined ? + elem.className = classNames !== undefined ? jQuery.grep(elem.className.split(/\s+/), function(className){ return !jQuery.className.has( classNames, className ); }).join(" ") : @@ -828,30 +773,14 @@ jQuery.extend({ curCSS: function( elem, name, force ) { var ret, style = elem.style; - // A helper method for determining if an element's values are broken - function color( elem ) { - if ( !jQuery.browser.safari ) - return false; - - // defaultView is cached - var ret = defaultView.getComputedStyle( elem, null ); - return !ret || ret.getPropertyValue("color") == ""; - } - // We need to handle opacity special in IE - if ( name == "opacity" && jQuery.browser.msie ) { + if ( name == "opacity" && !jQuery.support.opacity ) { ret = jQuery.attr( style, "opacity" ); return ret == "" ? "1" : ret; } - // Opera sometimes will give the wrong display answer, this fixes it, see #2037 - if ( jQuery.browser.opera && name == "display" ) { - var save = style.outline; - style.outline = "0 solid black"; - style.outline = save; - } // Make sure we're using the right name for getting the float value if ( name.match( /float/i ) ) @@ -870,38 +799,9 @@ jQuery.extend({ var computedStyle = defaultView.getComputedStyle( elem, null ); - if ( computedStyle && !color( elem ) ) + if ( computedStyle ) ret = computedStyle.getPropertyValue( name ); - // If the element isn't reporting its values properly in Safari - // then some display: none elements are involved - else { - var swap = [], stack = [], a = elem, i = 0; - - // Locate all of the parent display: none elements - for ( ; a && color(a); a = a.parentNode ) - stack.unshift(a); - - // Go through and make them visible, but in reverse - // (It would be better if we knew the exact display type that they had) - for ( ; i < stack.length; i++ ) - if ( color( stack[ i ] ) ) { - swap[ i ] = stack[ i ].style.display; - stack[ i ].style.display = "block"; - } - - // Since we flip the display style, we have to handle that - // one special, otherwise get the value - ret = name == "display" && swap[ stack.length - 1 ] != null ? - "none" : - ( computedStyle && computedStyle.getPropertyValue( name ) ) || ""; - - // Finally, revert the display styles back - for ( i = 0; i < swap.length; i++ ) - if ( swap[ i ] != null ) - stack[ i ].style.display = swap[ i ]; - } - // We should always get a number back from opacity if ( name == "opacity" && ret == "" ) ret = "1"; @@ -936,22 +836,32 @@ jQuery.extend({ return ret; }, - clean: function( elems, context ) { - var ret = []; + clean: function( elems, context, fragment ) { context = context || document; + // !context.createElement fails in IE with an error but returns typeof 'object' - if (typeof context.createElement == 'undefined') + if ( typeof context.createElement === "undefined" ) context = context.ownerDocument || context[0] && context[0].ownerDocument || document; + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + if ( !fragment && elems.length === 1 && typeof elems[0] === "string" ) { + var match = /^<(\w+)\s*\/?>$/.exec(elems[0]); + if ( match ) + return [ context.createElement( match[1] ) ]; + } + + var ret = [], scripts = [], div = context.createElement("div"); + jQuery.each(elems, function(i, elem){ + if ( typeof elem === "number" ) + elem += ''; + if ( !elem ) return; - if ( elem.constructor == Number ) - elem += ''; - // Convert html string into DOM nodes - if ( typeof elem == "string" ) { + if ( typeof elem === "string" ) { // Fix "XHTML"-style tags in all browsers elem = elem.replace(/(<(\w+)[^>]*?)\/>/g, function(all, front, tag){ return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? @@ -960,7 +870,7 @@ jQuery.extend({ }); // Trim whitespace, otherwise indexOf won't work as expected - var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement("div"); + var tags = jQuery.trim( elem ).toLowerCase(); var wrap = // option or optgroup @@ -984,7 +894,7 @@ jQuery.extend({ [ 2, "", "
" ] || // IE can't serialize and