File:
[LON-CAPA] /
loncom /
html /
adm /
countdown /
jquery.countdown.pack.js
Revision
1.1:
download - view:
text,
annotated -
select for diffs
Sun Mar 18 13:51:11 2012 UTC (12 years, 9 months ago) by
foxr
Branches:
MAIN
CVS tags:
version_2_12_X,
version_2_11_X,
version_2_11_5_msu,
version_2_11_5,
version_2_11_4_uiuc,
version_2_11_4_msu,
version_2_11_4,
version_2_11_3_uiuc,
version_2_11_3_msu,
version_2_11_3,
version_2_11_2_uiuc,
version_2_11_2_msu,
version_2_11_2_educog,
version_2_11_2,
version_2_11_1,
version_2_11_0_RC3,
version_2_11_0_RC2,
version_2_11_0_RC1,
version_2_11_0,
HEAD
Add jquery countdown widget to the repository (BZ 5891 resolution will use
this for the timer).
/* http://keith-wood.name/countdown.html
Countdown for jQuery v1.5.11.
Written by Keith Wood (kbwood{at}iinet.com.au) January 2008.
Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
Please attribute the author if you use it. */
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[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}('(B($){B 1j(){x.1E=[];x.1E[\'\']={1k:[\'2E\',\'2F\',\'2G\',\'2H\',\'2I\',\'2J\',\'2K\'],2L:[\'2M\',\'2N\',\'2O\',\'2P\',\'2Q\',\'2R\',\'2S\'],1l:[\'y\',\'m\',\'w\',\'d\'],1v:C,1F:\':\',1Y:Q};x.1h={1Z:C,20:C,21:C,22:C,23:\'2T\',1m:\'\',25:Q,1w:0,1G:\'\',26:\'\',27:\'\',28:Q,29:C,2a:C,2b:1};$.1n(x.1h,x.1E[\'\']);x.1o=[];B 1H(a){8 b=(a||I N().J());A(b-d>=U){$.G.1I();d=b}c(1H)}8 c=1a.2U||1a.2V||1a.2W||1a.2X||1a.2Y||C;8 d=0;A(!c){2Z(B(){$.G.1I()},31)}17{d=1a.33||I N().J();c(1H)}}8 w=\'G\';8 Y=0;8 O=1;8 W=2;8 D=3;8 H=4;8 M=5;8 S=6;$.1n(1j.2c,{1p:\'34\',1b:[],35:B(a){x.1J(x.1h,a);1K(x.1h,a||{})},1L:B(a,b,c,e,f,g,h,i){A(1q b==\'36\'&&b.37==N){i=b.1M();h=b.1N();g=b.1O();f=b.1P();e=b.T();c=b.18();b=b.19()}8 d=I N();d.38(b);d.2d(1);d.39(c||0);d.2d(e||1);d.3a(f||0);d.3b((g||0)-(V.3c(a)<30?a*1c:a));d.3d(h||0);d.3e(i||0);F d},2e:B(a){F a[0]*3f+a[1]*3g+a[2]*2f+a[3]*2g+a[4]*2h+a[5]*1c+a[6]},3h:B(a,b){A(!b){F $.G.1h}8 c=$.Z(a,w);F(b==\'3i\'?c.11:c.11[b])},2i:B(a,b){8 c=$(a);A(c.2j(x.1p)){F}c.3j(x.1p);8 d={11:$.1n({},b),z:[0,0,0,0,0,0,0]};$.Z(a,w,d);x.2k(a)},1Q:B(a){A(!x.1R(a)){x.1b.2l(a)}},1R:B(a){F($.3k(a,x.1b)>-1)},1x:B(b){x.1b=$.3l(x.1b,B(a){F(a==b?C:a)})},1I:B(){X(8 i=x.1b.1y-1;i>=0;i--){x.1r(x.1b[i])}},1r:B(a,b){8 c=$(a);b=b||$.Z(a,w);A(!b){F}c.3m(x.2m(b));c[(x.E(b,\'1Y\')?\'3n\':\'3o\')+\'3p\'](\'3q\');8 d=x.E(b,\'2a\');A(d){8 e=b.R!=\'2n\'?b.z:x.1z(b,b.13,x.E(b,\'1w\'),I N());8 f=x.E(b,\'2b\');A(f==1||x.2e(e)%f==0){d.1s(a,[e])}}8 g=b.R!=\'1t\'&&(b.K?b.1d.J()<b.K.J():b.1d.J()>=b.14.J());A(g&&!b.1S){b.1S=1T;A(x.1R(a)||x.E(b,\'28\')){x.1x(a);8 h=x.E(b,\'29\');A(h){h.1s(a,[])}8 i=x.E(b,\'27\');A(i){8 j=x.E(b,\'1m\');b.11.1m=i;x.1r(a,b);b.11.1m=j}8 k=x.E(b,\'26\');A(k){1a.3r=k}}b.1S=Q}17 A(b.R==\'1t\'){x.1x(a)}$.Z(a,w,b)},2k:B(a,b,c){b=b||{};A(1q b==\'1U\'){8 d=b;b={};b[d]=c}8 e=$.Z(a,w);A(e){x.1J(e.11,b);1K(e.11,b);x.2o(a,e);$.Z(a,w,e);8 f=I N();A((e.K&&e.K<f)||(e.14&&e.14>f)){x.1Q(a)}x.1r(a,e)}},1J:B(a,b){8 c=Q;X(8 n 1V b){A(n!=\'1v\'&&n.P(/[2p]2q/)){c=1T;15}}A(c){X(8 n 1V a){A(n.P(/[2p]2q[0-9]/)){a[n]=C}}}},2o:B(a,b){8 c;8 d=x.E(b,\'22\');8 e=0;8 f=C;X(8 i=0;i<x.1o.1y;i++){A(x.1o[i][0]==d){f=x.1o[i][1];15}}A(f!=C){e=(d?f:0);c=I N()}17{8 g=(d?d.1s(a,[]):C);c=I N();e=(g?c.J()-g.J():0);x.1o.2l([d,e])}8 h=x.E(b,\'21\');h=(h==C?-c.3s():h);b.K=x.E(b,\'20\');A(b.K!=C){b.K=x.1L(h,x.1A(b.K,C));A(b.K&&e){b.K.1B(b.K.1M()+e)}}b.14=x.1L(h,x.1A(x.E(b,\'1Z\'),c));A(e){b.14.1B(b.14.1M()+e)}b.13=x.2r(b)},3t:B(a){8 b=$(a);A(!b.2j(x.1p)){F}x.1x(a);b.3u(x.1p).3v();$.3w(a,w)},3x:B(a){x.R(a,\'1t\')},3y:B(a){x.R(a,\'2n\')},3z:B(a){x.R(a,C)},R:B(a,b){8 c=$.Z(a,w);A(c){A(c.R==\'1t\'&&!b){c.z=c.2s;8 d=(c.K?\'-\':\'+\');c[c.K?\'K\':\'14\']=x.1A(d+c.z[0]+\'y\'+d+c.z[1]+\'o\'+d+c.z[2]+\'w\'+d+c.z[3]+\'d\'+d+c.z[4]+\'h\'+d+c.z[5]+\'m\'+d+c.z[6]+\'s\');x.1Q(a)}c.R=b;c.2s=(b==\'1t\'?c.z:C);$.Z(a,w,c);x.1r(a,c)}},3A:B(a){8 b=$.Z(a,w);F(!b?C:(!b.R?b.z:x.1z(b,b.13,x.E(b,\'1w\'),I N())))},E:B(a,b){F(a.11[b]!=C?a.11[b]:$.G.1h[b])},1A:B(k,l){8 m=B(a){8 b=I N();b.2t(b.J()+a*U);F b};8 n=B(a){a=a.3B();8 b=I N();8 c=b.19();8 d=b.18();8 e=b.T();8 f=b.1P();8 g=b.1O();8 h=b.1N();8 i=/([+-]?[0-9]+)\\s*(s|m|h|d|w|o|y)?/g;8 j=i.2u(a);3C(j){3D(j[2]||\'s\'){1e\'s\':h+=1f(j[1],10);15;1e\'m\':g+=1f(j[1],10);15;1e\'h\':f+=1f(j[1],10);15;1e\'d\':e+=1f(j[1],10);15;1e\'w\':e+=1f(j[1],10)*7;15;1e\'o\':d+=1f(j[1],10);e=V.1C(e,$.G.1i(c,d));15;1e\'y\':c+=1f(j[1],10);e=V.1C(e,$.G.1i(c,d));15}j=i.2u(a)}F I N(c,d,e,f,g,h,0)};8 o=(k==C?l:(1q k==\'1U\'?n(k):(1q k==\'3E\'?m(k):k)));A(o)o.1B(0);F o},1i:B(a,b){F 32-I N(a,b,32).T()},1W:B(a){F a},2m:B(c){8 d=x.E(c,\'1w\');c.z=(c.R?c.z:x.1z(c,c.13,d,I N()));8 e=Q;8 f=0;8 g=d;8 h=$.1n({},c.13);X(8 i=Y;i<=S;i++){e|=(c.13[i]==\'?\'&&c.z[i]>0);h[i]=(c.13[i]==\'?\'&&!e?C:c.13[i]);f+=(h[i]?1:0);g-=(c.z[i]>0?1:0)}8 j=[Q,Q,Q,Q,Q,Q,Q];X(8 i=S;i>=Y;i--){A(c.13[i]){A(c.z[i]){j[i]=1T}17{j[i]=g>0;g--}}}8 k=x.E(c,\'25\');8 l=x.E(c,\'1m\');8 m=(k?x.E(c,\'1l\'):x.E(c,\'1k\'));8 n=x.E(c,\'1v\')||x.1W;8 o=x.E(c,\'1F\');8 p=x.E(c,\'1G\')||\'\';8 q=B(a){8 b=$.G.E(c,\'1l\'+n(c.z[a]));F(h[a]?c.z[a]+(b?b[a]:m[a])+\' \':\'\')};8 r=B(a){8 b=$.G.E(c,\'1k\'+n(c.z[a]));F((!d&&h[a])||(d&&j[a])?\'<16 1u="3F"><16 1u="2v">\'+c.z[a]+\'</16><3G/>\'+(b?b[a]:m[a])+\'</16>\':\'\')};F(l?x.2w(c,h,l,k,d,j):((k?\'<16 1u="1X 2v\'+(c.R?\' 2x\':\'\')+\'">\'+q(Y)+q(O)+q(W)+q(D)+(h[H]?x.L(c.z[H],2):\'\')+(h[M]?(h[H]?o:\'\')+x.L(c.z[M],2):\'\')+(h[S]?(h[H]||h[M]?o:\'\')+x.L(c.z[S],2):\'\'):\'<16 1u="1X 3H\'+(d||f)+(c.R?\' 2x\':\'\')+\'">\'+r(Y)+r(O)+r(W)+r(D)+r(H)+r(M)+r(S))+\'</16>\'+(p?\'<16 1u="1X 3I">\'+p+\'</16>\':\'\')))},2w:B(c,d,e,f,g,h){8 j=x.E(c,(f?\'1l\':\'1k\'));8 k=x.E(c,\'1v\')||x.1W;8 l=B(a){F($.G.E(c,(f?\'1l\':\'1k\')+k(c.z[a]))||j)[a]};8 m=B(a,b){F V.1D(a/b)%10};8 o={3J:x.E(c,\'1G\'),3K:x.E(c,\'1F\'),3L:l(Y),3M:c.z[Y],3N:x.L(c.z[Y],2),3O:x.L(c.z[Y],3),3P:m(c.z[Y],1),3Q:m(c.z[Y],10),3R:m(c.z[Y],1g),3S:m(c.z[Y],U),3T:l(O),3U:c.z[O],3V:x.L(c.z[O],2),3W:x.L(c.z[O],3),3X:m(c.z[O],1),3Y:m(c.z[O],10),3Z:m(c.z[O],1g),40:m(c.z[O],U),41:l(W),42:c.z[W],43:x.L(c.z[W],2),44:x.L(c.z[W],3),45:m(c.z[W],1),46:m(c.z[W],10),47:m(c.z[W],1g),48:m(c.z[W],U),49:l(D),4a:c.z[D],4b:x.L(c.z[D],2),4c:x.L(c.z[D],3),4d:m(c.z[D],1),4e:m(c.z[D],10),4f:m(c.z[D],1g),4g:m(c.z[D],U),4h:l(H),4i:c.z[H],4j:x.L(c.z[H],2),4k:x.L(c.z[H],3),4l:m(c.z[H],1),4m:m(c.z[H],10),4n:m(c.z[H],1g),4o:m(c.z[H],U),4p:l(M),4q:c.z[M],4r:x.L(c.z[M],2),4s:x.L(c.z[M],3),4t:m(c.z[M],1),4u:m(c.z[M],10),4v:m(c.z[M],1g),4w:m(c.z[M],U),4x:l(S),4y:c.z[S],4z:x.L(c.z[S],2),4A:x.L(c.z[S],3),4B:m(c.z[S],1),4C:m(c.z[S],10),4D:m(c.z[S],1g),4E:m(c.z[S],U)};8 p=e;X(8 i=Y;i<=S;i++){8 q=\'4F\'.4G(i);8 r=I 2y(\'\\\\{\'+q+\'<\\\\}(.*)\\\\{\'+q+\'>\\\\}\',\'g\');p=p.2z(r,((!g&&d[i])||(g&&h[i])?\'$1\':\'\'))}$.2A(o,B(n,v){8 a=I 2y(\'\\\\{\'+n+\'\\\\}\',\'g\');p=p.2z(a,v)});F p},L:B(a,b){a=\'\'+a;A(a.1y>=b){F a}a=\'4H\'+a;F a.4I(a.1y-b)},2r:B(a){8 b=x.E(a,\'23\');8 c=[];c[Y]=(b.P(\'y\')?\'?\':(b.P(\'Y\')?\'!\':C));c[O]=(b.P(\'o\')?\'?\':(b.P(\'O\')?\'!\':C));c[W]=(b.P(\'w\')?\'?\':(b.P(\'W\')?\'!\':C));c[D]=(b.P(\'d\')?\'?\':(b.P(\'D\')?\'!\':C));c[H]=(b.P(\'h\')?\'?\':(b.P(\'H\')?\'!\':C));c[M]=(b.P(\'m\')?\'?\':(b.P(\'M\')?\'!\':C));c[S]=(b.P(\'s\')?\'?\':(b.P(\'S\')?\'!\':C));F c},1z:B(c,d,e,f){c.1d=f;c.1d.1B(0);8 g=I N(c.1d.J());A(c.K){A(f.J()<c.K.J()){c.1d=f=g}17{f=c.K}}17{g.2t(c.14.J());A(f.J()>c.14.J()){c.1d=f=g}}8 h=[0,0,0,0,0,0,0];A(d[Y]||d[O]){8 i=$.G.1i(f.19(),f.18());8 j=$.G.1i(g.19(),g.18());8 k=(g.T()==f.T()||(g.T()>=V.1C(i,j)&&f.T()>=V.1C(i,j)));8 l=B(a){F(a.1P()*1c+a.1O())*1c+a.1N()};8 m=V.4J(0,(g.19()-f.19())*12+g.18()-f.18()+((g.T()<f.T()&&!k)||(k&&l(g)<l(f))?-1:0));h[Y]=(d[Y]?V.1D(m/12):0);h[O]=(d[O]?m-h[Y]*12:0);f=I N(f.J());8 n=(f.T()==i);8 o=$.G.1i(f.19()+h[Y],f.18()+h[O]);A(f.T()>o){f.2B(o)}f.4K(f.19()+h[Y]);f.4L(f.18()+h[O]);A(n){f.2B(o)}}8 p=V.1D((g.J()-f.J())/U);8 q=B(a,b){h[a]=(d[a]?V.1D(p/b):0);p-=h[a]*b};q(W,2f);q(D,2g);q(H,2h);q(M,1c);q(S,1);A(p>0&&!c.K){8 r=[1,12,4.4M,7,24,1c,1c];8 s=S;8 t=1;X(8 u=S;u>=Y;u--){A(d[u]){A(h[s]>=t){h[s]=0;p=1}A(p>0){h[u]++;p=0;s=u;t=1}}t*=r[u]}}A(e){X(8 u=Y;u<=S;u++){A(e&&h[u]){e--}17 A(!e){h[u]=0}}}F h}});B 1K(a,b){$.1n(a,b);X(8 c 1V b){A(b[c]==C){a[c]=C}}F a}$.4N.G=B(a){8 b=4O.2c.4P.4Q(4R,1);A(a==\'4S\'||a==\'4T\'){F $.G[\'2C\'+a+\'1j\'].1s($.G,[x[0]].2D(b))}F x.2A(B(){A(1q a==\'1U\'){$.G[\'2C\'+a+\'1j\'].1s($.G,[x].2D(b))}17{$.G.2i(x,a)}})};$.G=I 1j()})(4U);',62,305,'||||||||var|||||||||||||||||||||||||this||_periods|if|function|null||_get|return|countdown||new|getTime|_since|_minDigits||Date||match|false|_hold||getDate|1000|Math||for||data||options||_show|_until|break|span|else|getMonth|getFullYear|window|_timerTargets|60|_now|case|parseInt|100|_defaults|_getDaysInMonth|Countdown|labels|compactLabels|layout|extend|_serverSyncs|markerClassName|typeof|_updateCountdown|apply|pause|class|whichLabels|significant|_removeTarget|length|_calculatePeriods|_determineTime|setMilliseconds|min|floor|regional|timeSeparator|description|timerCallBack|_updateTargets|_resetExtraLabels|extendRemove|UTCDate|getMilliseconds|getSeconds|getMinutes|getHours|_addTarget|_hasTarget|_expiring|true|string|in|_normalLabels|countdown_row|isRTL|until|since|timezone|serverSync|format||compact|expiryUrl|expiryText|alwaysExpire|onExpiry|onTick|tickInterval|prototype|setUTCDate|periodsToSeconds|604800|86400|3600|_attachCountdown|hasClass|_changeCountdown|push|_generateHTML|lap|_adjustSettings|Ll|abels|_determineShow|_savePeriods|setTime|exec|countdown_amount|_buildLayout|countdown_holding|RegExp|replace|each|setDate|_|concat|Years|Months|Weeks|Days|Hours|Minutes|Seconds|labels1|Year|Month|Week|Day|Hour|Minute|Second|dHMS|requestAnimationFrame|webkitRequestAnimationFrame|mozRequestAnimationFrame|oRequestAnimationFrame|msRequestAnimationFrame|setInterval||980||mozAnimationStartTime|hasCountdown|setDefaults|object|constructor|setUTCFullYear|setUTCMonth|setUTCHours|setUTCMinutes|abs|setUTCSeconds|setUTCMilliseconds|31557600|2629800|_settingsCountdown|all|addClass|inArray|map|html|add|remove|Class|countdown_rtl|location|getTimezoneOffset|_destroyCountdown|removeClass|empty|removeData|_pauseCountdown|_lapCountdown|_resumeCountdown|_getTimesCountdown|toLowerCase|while|switch|number|countdown_section|br|countdown_show|countdown_descr|desc|sep|yl|yn|ynn|ynnn|y1|y10|y100|y1000|ol|on|onn|onnn|o1|o10|o100|o1000|wl|wn|wnn|wnnn|w1|w10|w100|w1000|dl|dn|dnn|dnnn|d1|d10|d100|d1000|hl|hn|hnn|hnnn|h1|h10|h100|h1000|ml|mn|mnn|mnnn|m1|m10|m100|m1000|sl|sn|snn|snnn|s1|s10|s100|s1000|yowdhms|charAt|0000000000|substr|max|setFullYear|setMonth|3482|fn|Array|slice|call|arguments|getTimes|settings|jQuery'.split('|'),0,{}))
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>