muck-activities 0.1.25 → 0.1.26
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/views/activities/_activity_feed.html.erb +1 -1
- data/muck-activities.gemspec +141 -7
- data/test/rails_root/config/database.yml +13 -13
- data/test/rails_root/config/environment.rb +4 -2
- data/test/rails_root/config/global_config.yml +6 -1
- data/test/rails_root/config/initializers/geokit_config.rb +63 -0
- data/test/rails_root/db/migrate/{20090602041838_create_users.rb → 20090327231918_create_users.rb} +11 -10
- data/test/rails_root/db/migrate/20090402234137_create_languages.rb +1 -1
- data/test/rails_root/db/migrate/20090730154102_allow_null_user.rb +9 -0
- data/test/rails_root/db/migrate/20090804184247_add_comment_count_to_shares.rb +9 -0
- data/test/rails_root/db/migrate/20090804231857_add_shares_uri_index.rb +9 -0
- data/test/rails_root/db/migrate/20091124203137_add_location_to_profiles.rb +15 -0
- data/test/rails_root/db/migrate/20091124205819_add_fields_to_profiles.rb +21 -0
- data/test/rails_root/lib/tasks/muck.rake +7 -0
- data/test/rails_root/public/images/arrow_down.gif +0 -0
- data/test/rails_root/public/images/arrow_up.gif +0 -0
- data/test/rails_root/public/images/fancybox/fancy_closebox.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_progress.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_right.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_left.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_main.png +0 -0
- data/test/rails_root/public/images/fancybox/fancy_title_right.png +0 -0
- data/test/rails_root/public/images/icons/blue_guy.png +0 -0
- data/test/rails_root/public/images/icons/button_background.png +0 -0
- data/test/rails_root/public/images/icons/cancel.png +0 -0
- data/test/rails_root/public/images/icons/close.png +0 -0
- data/test/rails_root/public/images/icons/comment.png +0 -0
- data/test/rails_root/public/images/icons/exclaim.png +0 -0
- data/test/rails_root/public/images/icons/external.png +0 -0
- data/test/rails_root/public/images/icons/feed.png +0 -0
- data/test/rails_root/public/images/icons/grey_guy.png +0 -0
- data/test/rails_root/public/images/icons/hide.png +0 -0
- data/test/rails_root/public/images/icons/information.png +0 -0
- data/test/rails_root/public/images/icons/minus.png +0 -0
- data/test/rails_root/public/images/icons/pending.png +0 -0
- data/test/rails_root/public/images/icons/question.png +0 -0
- data/test/rails_root/public/images/icons/search_box.png +0 -0
- data/test/rails_root/public/images/icons/star.png +0 -0
- data/test/rails_root/public/images/icons/stop.png +0 -0
- data/test/rails_root/public/images/icons/thumb_down.png +0 -0
- data/test/rails_root/public/images/icons/thumb_up.png +0 -0
- data/test/rails_root/public/images/nothing.png +0 -0
- data/test/rails_root/public/javascripts/jquery/colorpicker.js +450 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.js.readme +6 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.min.js +15 -0
- data/test/rails_root/public/javascripts/jquery/jquery.autocomplete.pack.js +767 -0
- data/test/rails_root/public/javascripts/jquery/jquery.easing.js +1 -0
- data/test/rails_root/public/javascripts/jquery/jquery.fancybox.js +16 -0
- data/test/rails_root/public/javascripts/jquery/jquery.metadata.min.js +13 -0
- data/test/rails_root/public/javascripts/jquery/jquery.queryString.js +33 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.js +66 -0
- data/test/rails_root/public/javascripts/jquery/jquery.swapimage.min.js +11 -0
- data/test/rails_root/public/javascripts/jquery/jquery.tips.js +7 -6
- data/test/rails_root/public/javascripts/jquery/jrails.js +1 -0
- data/test/rails_root/public/javascripts/muck.js +57 -6
- data/test/rails_root/public/javascripts/muck_activities.js +17 -10
- data/test/rails_root/public/javascripts/muck_time/en.js +53 -0
- data/test/rails_root/public/javascripts/tree.js +107 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.autocomplete.css +15 -0
- data/test/rails_root/public/stylesheets/jquery/jquery.fancybox.css +38 -0
- data/test/rails_root/public/stylesheets/muck-activities.css +39 -0
- data/test/rails_root/public/stylesheets/styles.css +13 -3
- data/test/rails_root/test/unit/activity_feed_test.rb +8 -2
- data/test/rails_root/test/unit/activity_test.rb +17 -29
- data/test/rails_root/test/unit/share_test.rb +1 -0
- data/test/rails_root/test/unit/user_test.rb +1 -0
- data/test/rails_root/vendor/plugins/geokit-rails/CHANGELOG.rdoc +46 -0
- data/test/rails_root/vendor/plugins/geokit-rails/MIT-LICENSE +20 -0
- data/test/rails_root/vendor/plugins/geokit-rails/README.markdown +561 -0
- data/test/rails_root/vendor/plugins/geokit-rails/Rakefile +18 -0
- data/test/rails_root/vendor/plugins/geokit-rails/about.yml +9 -0
- data/test/rails_root/vendor/plugins/geokit-rails/assets/api_keys_template +61 -0
- data/test/rails_root/vendor/plugins/geokit-rails/init.rb +1 -0
- data/test/rails_root/vendor/plugins/geokit-rails/install.rb +14 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails.rb +26 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/acts_as_mappable.rb +456 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/adapters/abstract.rb +31 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/adapters/mysql.rb +22 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/adapters/postgresql.rb +22 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/adapters/sqlserver.rb +43 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/defaults.rb +22 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/geocoder_control.rb +16 -0
- data/test/rails_root/vendor/plugins/geokit-rails/lib/geokit-rails/ip_geocode_lookup.rb +46 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/acts_as_mappable_test.rb +474 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/boot.rb +25 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/database.yml +20 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/companies.yml +7 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/custom_locations.yml +54 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/locations.yml +54 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/mock_addresses.yml +17 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/mock_families.yml +2 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/mock_houses.yml +9 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/mock_organizations.yml +5 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/mock_people.yml +5 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/fixtures/stores.yml +0 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/ip_geocode_lookup_test.rb +77 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/company.rb +3 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/custom_location.rb +12 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/location.rb +4 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/mock_address.rb +4 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/mock_family.rb +3 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/mock_house.rb +3 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/mock_organization.rb +4 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/mock_person.rb +4 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/models/store.rb +3 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/schema.rb +60 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/tasks.rake +31 -0
- data/test/rails_root/vendor/plugins/geokit-rails/test/test_helper.rb +23 -0
- metadata +137 -4
@@ -0,0 +1 @@
|
|
1
|
+
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d)},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4}else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b}});
|
@@ -0,0 +1,16 @@
|
|
1
|
+
/*
|
2
|
+
* FancyBox - jQuery Plugin
|
3
|
+
* simple and fancy lightbox alternative
|
4
|
+
*
|
5
|
+
* Copyright (c) 2009 Janis Skarnelis
|
6
|
+
* Examples and documentation at: http://fancybox.net
|
7
|
+
*
|
8
|
+
* Version: 1.2.6 (16/11/2009)
|
9
|
+
* Requires: jQuery v1.3+
|
10
|
+
*
|
11
|
+
* Dual licensed under the MIT and GPL licenses:
|
12
|
+
* http://www.opensource.org/licenses/mit-license.php
|
13
|
+
* http://www.gnu.org/licenses/gpl.html
|
14
|
+
*/
|
15
|
+
|
16
|
+
;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}(';(p($){$.q.1Q=p(){J O.2n(p(){n b=$(O).u(\'2o\');8(b.1d(/^3i\\(["\']?(.*\\.2p)["\']?\\)$/i)){b=3j.$1;$(O).u({\'2o\':\'3k\',\'1e\':"3l:3m.3n.3o(3p=D, 3q="+($(O).u(\'3r\')==\'2q-3s\'?\'3t\':\'3u\')+", 13=\'"+b+"\')"}).2n(p(){n a=$(O).u(\'1u\');8(a!=\'2r\'&&a!=\'2s\')$(O).u(\'1u\',\'2s\')})}})};n l,4,1f=F,X=1v 1w,1x,1y=1,1z=/\\.(3v|3w|2p|3x|3y)(.*)?$/i;n m=1A,18=$.14.1g&&$.14.2t.1R(0,1)==6&&!19.3z,1S=18||($.14.1g&&$.14.2t.1R(0,1)==7);$.q.r=p(o){n j=$.2u({},$.q.r.2v,o);n k=O;p 2w(){l=O;4=$.2u({},j);2x();J F};p 2x(){8(1f)J;8($.1T(4.1U)){4.1U()}4.v=[];4.t=0;8(j.v.Y>0){4.v=j.v}C{n a={};8(!l.1B||l.1B==\'\'){n a={K:l.K,G:l.G};8($(l).1C("1l:1D").Y){a.S=$(l).1C("1l:1D")}C{a.S=$(l)}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}C{n b=$(k).1e("a[1B="+l.1B+"]");n a={};3A(n i=0;i<b.Y;i++){a={K:b[i].K,G:b[i].G};8($(b[i]).1C("1l:1D").Y){a.S=$(b[i]).1C("1l:1D")}C{a.S=$(b[i])}8(a.G==\'\'||1V a.G==\'1m\'){a.G=a.S.2y(\'1W\')}4.v.2z(a)}}}3B(4.v[4.t].K!=l.K){4.t++}8(4.1E){8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'3C\');$("#T").u(\'A\',$(U).A())}$("#T").u({\'3D-3E\':4.2A,\'22\':4.2B}).Z()}$(19).11("23.L 24.L",$.q.r.2C);1h()};p 1h(){$("#1n, #1o, #1i, #H").1a();n b=4.v[4.t].K;8(b.1d("1j")||l.3F.2D("1j")>=0){$.q.r.1F();1p(\'<1j s="2E" 3G="2F.q.r.2G()" 3H="3I\'+P.1b(P.3J()*3K)+\'" 2H="0" 3L="0" 13="\'+b+\'"></1j>\',4.1G,4.1H)}C 8(b.1d(/#/)){n c=19.3M.K.3N(\'#\')[0];c=b.3O(c,\'\');c=c.1R(c.2D(\'#\'));1p(\'<9 s="3P">\'+$(c).2I()+\'</9>\',4.1G,4.1H)}C 8(b.1d(1z)){X=1v 1w;X.13=b;8(X.3Q){25()}C{$.q.r.1F();$(X).Q().11(\'3R\',p(){$("#M").1a();25()})}}C{$.q.r.1F();$.3S(b,p(a){$("#M").1a();1p(\'<9 s="3T">\'+a+\'</9>\',4.1G,4.1H)})}};p 25(){n a=X.E;n b=X.A;n c=(4.N*2)+40;n d=(4.N*2)+26;n w=$.q.r.1q();8(4.2J&&(a>(w[0]-c)||b>(w[1]-d))){n e=P.28(P.28(w[0]-c,a)/a,P.28(w[1]-d,b)/b);a=P.1b(e*a);b=P.1b(e*b)}1p(\'<1l 1W="" s="3U" 13="\'+X.13+\'" />\',a,b)};p 2K(){8((4.v.Y-1)>4.t){n a=4.v[4.t+1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}8(4.t>0){n a=4.v[4.t-1].K||F;8(a&&a.1d(1z)){1I=1v 1w();1I.13=a}}};p 1p(a,b,c){1f=D;n d=4.N;8(1S||m){$("#y")[0].15.2L("A");$("#y")[0].15.2L("E")}8(d>0){b+=d*2;c+=d*2;$("#y").u({\'z\':d+\'R\',\'2M\':d+\'R\',\'2N\':d+\'R\',\'B\':d+\'R\',\'E\':\'2O\',\'A\':\'2O\'});8(1S||m){$("#y")[0].15.2P(\'A\',\'(O.2Q.3V - \'+d*2+\')\');$("#y")[0].15.2P(\'E\',\'(O.2Q.3W - \'+d*2+\')\')}}C{$("#y").u({\'z\':0,\'2M\':0,\'2N\':0,\'B\':0,\'E\':\'2R%\',\'A\':\'2R%\'})}8($("#x").16(":V")&&b==$("#x").E()&&c==$("#x").A()){$("#y").1J(\'29\',p(){$("#y").1r().1K($(a)).2a("1L",p(){1s()})});J}n w=$.q.r.1q();n e=(c+26)>w[1]?w[3]:(w[3]+P.1b((w[1]-c-26)*0.5));n f=(b+40)>w[0]?w[2]:(w[2]+P.1b((w[0]-b-40)*0.5));n g={\'B\':f,\'z\':e,\'E\':b+\'R\',\'A\':c+\'R\'};8($("#x").16(":V")){$("#y").1J("1L",p(){$("#y").1r();$("#x").2b(g,4.2S,4.2T,p(){$("#y").1K($(a)).2a("1L",p(){1s()})})})}C{8(4.2c>0&&4.v[4.t].S!==1m){$("#y").1r().1K($(a));n h=4.v[4.t].S;n i=$.q.r.2d(h);$("#x").u({\'B\':(i.B-20-4.N)+\'R\',\'z\':(i.z-20-4.N)+\'R\',\'E\':$(h).E()+(4.N*2),\'A\':$(h).A()+(4.N*2)});8(4.2e){g.22=\'Z\'}$("#x").2b(g,4.2c,4.2U,p(){1s()})}C{$("#y").1a().1r().1K($(a)).Z();$("#x").u(g).2a("1L",p(){1s()})}}};p 2V(){8(4.t!==0){$("#1o, #2W").Q().11("17",p(e){e.2X();4.t--;1h();J F});$("#1o").Z()}8(4.t!=(4.v.Y-1)){$("#1n, #2Y").Q().11("17",p(e){e.2X();4.t++;1h();J F});$("#1n").Z()}};p 1s(){8($.14.1g){$("#y")[0].15.1M(\'1e\');$("#x")[0].15.1M(\'1e\')}2V();2K();$(U).11("1N.L",p(e){8(e.2f==27&&4.2Z){$.q.r.1c()}C 8(e.2f==37&&4.t!==0){$(U).Q("1N.L");4.t--;1h()}C 8(e.2f==39&&4.t!=(4.v.Y-1)){$(U).Q("1N.L");4.t++;1h()}});8(4.30){$("#y").17($.q.r.1c)}8(4.1E&&4.31){$("#T").11("17",$.q.r.1c)}8(4.33){$("#1i").11("17",$.q.r.1c).Z()}8(1V 4.v[4.t].G!==\'1m\'&&4.v[4.t].G.Y>0){n a=$("#x").1u();$(\'#H 9\').3X(4.v[4.t].G).2I();$(\'#H\').u({\'z\':a.z+$("#x").34()-32,\'B\':a.B+(($("#x").35()*0.5)-($(\'#H\').E()*0.5))}).Z()}8(4.1E&&18){$(\'1X, 1Y, 1Z\',$(\'#y\')).u(\'21\',\'V\')}8($.1T(4.2g)){4.2g(4.v[4.t])}8($.14.1g){$("#x")[0].15.1M(\'1e\');$("#y")[0].15.1M(\'1e\')}1f=F};J O.Q(\'17.L\').11(\'17.L\',2w)};$.q.r.2C=p(){n w=$.q.r.1q();8(4.2h&&$("#x").16(\':V\')){n a=$("#x").35();n b=$("#x").34();n c={\'z\':(b>w[1]?w[3]:w[3]+P.1b((w[1]-b)*0.5)),\'B\':(a>w[0]?w[2]:w[2]+P.1b((w[0]-a)*0.5))};$("#x").u(c);$(\'#H\').u({\'z\':c.z+b-32,\'B\':c.B+((a*0.5)-($(\'#H\').E()*0.5))})}8(18&&$("#T").16(\':V\')){$("#T").u({\'A\':$(U).A()})}8($("#M").16(\':V\')){$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])})}};$.q.r.1t=p(a,b){J 3Y($.3Z(a.41?a[0]:a,b,D))||0};$.q.r.2d=p(a){n b=a.42();b.z+=$.q.r.1t(a,\'43\');b.z+=$.q.r.1t(a,\'44\');b.B+=$.q.r.1t(a,\'45\');b.B+=$.q.r.1t(a,\'46\');J b};$.q.r.2G=p(){$("#M").1a();$("#2E").Z()};$.q.r.1q=p(){J[$(19).E(),$(19).A(),$(U).47(),$(U).48()]};$.q.r.36=p(){8(!$("#M").16(\':V\')){38(1x);J}$("#M > 9").u(\'z\',(1y*-40)+\'R\');1y=(1y+1)%12};$.q.r.1F=p(){38(1x);n w=$.q.r.1q();$("#M").u({\'B\':((w[0]-40)*0.5+w[2]),\'z\':((w[1]-40)*0.5+w[3])}).Z();$("#M").11(\'17\',$.q.r.1c);1x=49($.q.r.36,4a)};$.q.r.1c=p(){1f=D;$(X).Q();$(U).Q("1N.L");$(19).Q("23.L 24.L");$("#T, #y, #1i").Q();$("#1i, #M, #1o, #1n, #H").1a();1O=p(){8($("#T").16(\':V\')){$("#T").1J("29")}$("#y").1r();8(4.2h){$(19).Q("23.L 24.L")}8(18){$(\'1X, 1Y, 1Z\').u(\'21\',\'V\')}8($.1T(4.2i)){4.2i()}1f=F};8($("#x").16(":V")!==F){8(4.2j>0&&4.v[4.t].S!==1m){n a=4.v[4.t].S;n b=$.q.r.2d(a);n c={\'B\':(b.B-20-4.N)+\'R\',\'z\':(b.z-20-4.N)+\'R\',\'E\':$(a).E()+(4.N*2),\'A\':$(a).A()+(4.N*2)};8(4.2e){c.22=\'1a\'}$("#x").3a(F,D).2b(c,4.2j,4.3b,1O)}C{$("#x").3a(F,D).1J(\'29\',1O)}}C{1O()}J F};$.q.r.3c=p(){n a=\'\';a+=\'<9 s="T"></9>\';a+=\'<9 s="M"><9></9></9>\';a+=\'<9 s="x">\';a+=\'<9 s="3d">\';a+=\'<9 s="1i"></9>\';a+=\'<9 s="W"><9 I="W" s="4b"></9><9 I="W" s="4c"></9><9 I="W" s="4d"></9><9 I="W" s="4e"></9><9 I="W" s="4f"></9><9 I="W" s="4g"></9><9 I="W" s="4h"></9><9 I="W" s="4i"></9></9>\';a+=\'<a K="2k:;" s="1o"><1P I="2l" s="2W"></1P></a><a K="2k:;" s="1n"><1P I="2l" s="2Y"></1P></a>\';a+=\'<9 s="y"></9>\';a+=\'</9>\';a+=\'</9>\';a+=\'<9 s="H"></9>\';$(a).3e("4j");$(\'<3f 4k="0" 4l="0" 4m="0"><3g><1k I="H" s="4n"></1k><1k I="H" s="4o"><9></9></1k><1k I="H" s="4p"></1k></3g></3f>\').3e(\'#H\');8($.14.1g){$(".W").1Q()}8(18){$("9#T").u("1u","2r");$("#M 9, #1i, .H, .2l").1Q();$("#3d").4q(\'<1j s="3h" 13="2k:F;" 4r="2q" 2H="0"></1j>\');n b=$(\'#3h\')[0].4s.U;b.4t();b.1c()}};$.q.r.2v={N:10,2J:D,2e:D,2c:0,2j:0,2S:4u,2U:\'2m\',3b:\'2m\',2T:\'2m\',1G:4v,1H:4w,1E:D,2B:0.3,2A:\'#4x\',2Z:D,33:D,31:D,30:D,2h:D,v:[],1U:1A,2g:1A,2i:1A};$(U).4y(p(){m=$.14.1g&&!$.4z;8($("#x").Y<1){$.q.r.3c()}})})(2F);',62,284,'||||opts||||if|div||||||||||||||var||function|fn|fancybox|id|itemCurrent|css|itemArray||fancy_outer|fancy_content|top|height|left|else|true|width|false|title|fancy_title|class|return|href|fb|fancy_loading|padding|this|Math|unbind|px|orig|fancy_overlay|document|visible|fancy_bg|imagePreloader|length|show||bind||src|browser|style|is|click|IE6|window|hide|round|close|match|filter|busy|msie|_change_item|fancy_close|iframe|td|img|undefined|fancy_right|fancy_left|_set_content|getViewport|empty|_finish|getNumeric|position|new|Image|loadingTimer|loadingFrame|imageRegExp|null|rel|children|first|overlayShow|showLoading|frameWidth|frameHeight|objNext|fadeOut|append|normal|removeAttribute|keydown|__cleanup|span|fixPNG|substr|oldIE|isFunction|callbackOnStart|typeof|alt|embed|object|select||visibility|opacity|resize|scroll|_proceed_image|60||min|fast|fadeIn|animate|zoomSpeedIn|getPosition|zoomOpacity|keyCode|callbackOnShow|centerOnScroll|callbackOnClose|zoomSpeedOut|javascript|fancy_ico|swing|each|backgroundImage|png|no|absolute|relative|version|extend|defaults|_initialize|_start|attr|push|overlayColor|overlayOpacity|scrollBox|indexOf|fancy_frame|jQuery|showIframe|frameborder|html|imageScale|_preload_neighbor_images|removeExpression|right|bottom|auto|setExpression|parentNode|100|zoomSpeedChange|easingChange|easingIn|_set_navigation|fancy_left_ico|stopPropagation|fancy_right_ico|enableEscapeButton|hideOnContentClick|hideOnOverlayClick||showCloseButton|outerHeight|outerWidth|animateLoading||clearInterval||stop|easingOut|build|fancy_inner|appendTo|table|tr|fancy_bigIframe|url|RegExp|none|progid|DXImageTransform|Microsoft|AlphaImageLoader|enabled|sizingMethod|backgroundRepeat|repeat|crop|scale|jpg|gif|bmp|jpeg|XMLHttpRequest|for|while|hidden|background|color|className|onload|name|fancy_iframe|random|1000|hspace|location|split|replace|fancy_div|complete|load|get|fancy_ajax|fancy_img|clientHeight|clientWidth|text|parseInt|curCSS||jquery|offset|paddingTop|borderTopWidth|paddingLeft|borderLeftWidth|scrollLeft|scrollTop|setInterval|66|fancy_bg_n|fancy_bg_ne|fancy_bg_e|fancy_bg_se|fancy_bg_s|fancy_bg_sw|fancy_bg_w|fancy_bg_nw|body|cellspacing|cellpadding|border|fancy_title_left|fancy_title_main|fancy_title_right|prepend|scrolling|contentWindow|open|300|560|340|666|ready|boxModel'.split('|'),0,{}));
|
@@ -0,0 +1,13 @@
|
|
1
|
+
/*
|
2
|
+
* Metadata - jQuery plugin for parsing metadata from elements
|
3
|
+
*
|
4
|
+
* Copyright (c) 2006 John Resig, Yehuda Katz, J�örn Zaefferer, Paul McLanahan
|
5
|
+
*
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* http://www.gnu.org/licenses/gpl.html
|
9
|
+
*
|
10
|
+
* Revision: $Id: jquery.metadata.js 3620 2007-10-10 20:55:38Z pmclanahan $
|
11
|
+
*
|
12
|
+
*/
|
13
|
+
(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)return;var e=elem.getElementsByTagName(settings.name);if(e.length)data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)data=attr;}if(data.indexOf('{')<0)data="{"+data+"}";data=eval("("+data+")");$.data(elem,settings.single,data);return data;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// QueryString Engine v1.0.1
|
2
|
+
//By James Campbell
|
3
|
+
(function($) {
|
4
|
+
$.querystringvalues = $.queryStringValues = $.QueryStringValues = $.QueryStringvalues = $.queryStringValues = $.queryStringvalues = $.querystringValues = $.getqueryString = $.queryString = $.querystring = $.QueryString = $.Querystring = $.getQueryString = $.getquerystring = $.getQuerystring = function(options)
|
5
|
+
{
|
6
|
+
defaults = {defaultvalue:"null"} ;
|
7
|
+
options = $.extend(defaults , options);
|
8
|
+
qs = location.search.substring(1, location.search.length);
|
9
|
+
if (qs.length == 0) return options.defaultvalue;
|
10
|
+
qs = qs.replace(/\+/g, ' ');
|
11
|
+
var args = qs.split('&');
|
12
|
+
for (var i = 0; i < args.length; i ++ )
|
13
|
+
{
|
14
|
+
var value;
|
15
|
+
var pair = args[i].split('=');
|
16
|
+
var name = unescape(pair[0]);
|
17
|
+
|
18
|
+
if (pair.length == 2)
|
19
|
+
{
|
20
|
+
value = unescape(pair[1]);
|
21
|
+
}
|
22
|
+
else
|
23
|
+
{
|
24
|
+
value = name;
|
25
|
+
}
|
26
|
+
if (name == options.id || i == options.id-1)
|
27
|
+
{
|
28
|
+
return value;
|
29
|
+
}
|
30
|
+
}
|
31
|
+
return options.defaultvalue
|
32
|
+
};
|
33
|
+
})(jQuery);
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/**
|
2
|
+
* swapImage - jQuery plugin for swapping image
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008 tszming (tszming@gmail.com)
|
5
|
+
*
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* http://www.gnu.org/licenses/gpl.html
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Enable image swapping, requires metadata plugin.
|
14
|
+
*
|
15
|
+
* @example $.swapImage(".swapImage");
|
16
|
+
* @desc Enable image swapping for all images with CSS class name equal to "swapImage", e.g.
|
17
|
+
* <img class="swapImage {src: 'images/new.gif'}" src="images/old.gif" />
|
18
|
+
*
|
19
|
+
* @param i Images to be selected.
|
20
|
+
* @param preload Preload the image, default = true.
|
21
|
+
* @param repeat Repeat the effect, default = true.
|
22
|
+
* @param swapInEvent Event for swap In.
|
23
|
+
* @param swapOutEvent Event for swap Out.
|
24
|
+
*
|
25
|
+
* @name $.swapImage
|
26
|
+
* @cat Plugins/SwapImage
|
27
|
+
* @author tszming (tszming@gmail.com)
|
28
|
+
* @version 1.0.1
|
29
|
+
*/
|
30
|
+
jQuery.swapImage = function(i, preload, repeat, swapInEvent, swapOutEvent) {
|
31
|
+
|
32
|
+
jQuery.swapImage.preload = function() {
|
33
|
+
var img = new Image();
|
34
|
+
img.src = jQuery(this).metadata().src;
|
35
|
+
};
|
36
|
+
|
37
|
+
jQuery.swapImage.swap = function() {
|
38
|
+
var data = jQuery(this).metadata();
|
39
|
+
var tmp = data.src;
|
40
|
+
data.src = this.src;
|
41
|
+
this.src = tmp;
|
42
|
+
};
|
43
|
+
|
44
|
+
jQuery(document).ready(function() {
|
45
|
+
|
46
|
+
if (typeof preload == "undefined") preload = true;
|
47
|
+
if (typeof repeat == "undefined") repeat = true;
|
48
|
+
if (typeof swapInEvent == "undefined" && typeof swapInEvent == "undefined") {
|
49
|
+
swapInEvent = "mouseenter"; swapOutEvent = "mouseleave";
|
50
|
+
}
|
51
|
+
|
52
|
+
if (repeat) {
|
53
|
+
if (typeof swapOutEvent != "undefined") {
|
54
|
+
jQuery(i).bind(swapInEvent, jQuery.swapImage.swap).bind(swapOutEvent, jQuery.swapImage.swap);
|
55
|
+
} else {
|
56
|
+
jQuery(i).bind(swapInEvent, jQuery.swapImage.swap);
|
57
|
+
}
|
58
|
+
} else {
|
59
|
+
jQuery(i).one(swapInEvent, jQuery.swapImage.swap);
|
60
|
+
}
|
61
|
+
|
62
|
+
if (preload) {
|
63
|
+
jQuery(i).each(jQuery.swapImage.preload)
|
64
|
+
};
|
65
|
+
});
|
66
|
+
};
|
@@ -0,0 +1,11 @@
|
|
1
|
+
/**
|
2
|
+
* swapImage - jQuery plugin for swapping image
|
3
|
+
*
|
4
|
+
* Copyright (c) 2008 tszming (tszming@gmail.com)
|
5
|
+
*
|
6
|
+
* Dual licensed under the MIT and GPL licenses:
|
7
|
+
* http://www.opensource.org/licenses/mit-license.php
|
8
|
+
* http://www.gnu.org/licenses/gpl.html
|
9
|
+
*
|
10
|
+
*/
|
11
|
+
jQuery.swapImage=function(i,preload,repeat,swapInEvent,swapOutEvent){jQuery.swapImage.preload=function(){var img=new Image();img.src=jQuery(this).metadata().src};jQuery.swapImage.swap=function(){var data=jQuery(this).metadata();var tmp=data.src;data.src=this.src;this.src=tmp};jQuery(document).ready(function(){if(typeof preload=="undefined")preload=true;if(typeof repeat=="undefined")repeat=true;if(typeof swapInEvent=="undefined"&&typeof swapInEvent=="undefined"){swapInEvent="mouseenter";swapOutEvent="mouseleave"}if(repeat){if(typeof swapOutEvent!="undefined"){jQuery(i).bind(swapInEvent,jQuery.swapImage.swap).bind(swapOutEvent,jQuery.swapImage.swap)}else{jQuery(i).bind(swapInEvent,jQuery.swapImage.swap)}}else{jQuery(i).one(swapInEvent,jQuery.swapImage.swap)}if(preload){jQuery(i).each(jQuery.swapImage.preload)}})};
|
@@ -1,16 +1,17 @@
|
|
1
1
|
jQuery(document).ready(function() {
|
2
2
|
jQuery(".tip-field").focus(function() {
|
3
3
|
jQuery(".active").removeClass("active");
|
4
|
-
var tip_key = jQuery('#' + this.id).siblings('
|
4
|
+
var tip_key = jQuery('#' + this.id).siblings('.tip-key');
|
5
5
|
var control_id = this.id;
|
6
6
|
var help_id = this.id;
|
7
|
+
var field = jQuery('#' + this.id);
|
7
8
|
if (tip_key.length > 0){
|
8
9
|
control_id = tip_key.html();
|
9
|
-
help_id =
|
10
|
-
}
|
11
|
-
var tip_text =
|
12
|
-
var tip_title =
|
13
|
-
var tip_position =
|
10
|
+
help_id = field.siblings('.tip-id').html();
|
11
|
+
}
|
12
|
+
var tip_text = field.siblings('.tip-text').html();
|
13
|
+
var tip_title = field.siblings('.tip-title').html();
|
14
|
+
var tip_position = field.siblings('.tip-position').html();
|
14
15
|
if (!tip_position) { tip_position = 'right'; }
|
15
16
|
show_tip(control_id, tip_title, tip_text, tip_position);
|
16
17
|
jQuery("#" + help_id + "-container").addClass("active");
|
@@ -0,0 +1 @@
|
|
1
|
+
(function($){$().ajaxSend(function(a,xhr,s){xhr.setRequestHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*")})})(jQuery);(function($){$.fn.reset=function(){return this.each(function(){if(typeof this.reset=="function"||(typeof this.reset=="object"&&!this.reset.nodeType)){this.reset()}})};$.fn.enable=function(){return this.each(function(){this.disabled=false})};$.fn.disable=function(){return this.each(function(){this.disabled=true})}})(jQuery);(function($){$.extend({fieldEvent:function(el,obs){var field=el[0]||el,e="change";if(field.type=="radio"||field.type=="checkbox"){e="click"}else{if(obs&&field.type=="text"||field.type=="textarea"){e="keyup"}}return e}});$.fn.extend({delayedObserver:function(delay,callback){var el=$(this);if(typeof window.delayedObserverStack=="undefined"){window.delayedObserverStack=[]}if(typeof window.delayedObserverCallback=="undefined"){window.delayedObserverCallback=function(stackPos){observed=window.delayedObserverStack[stackPos];if(observed.timer){clearTimeout(observed.timer)}observed.timer=setTimeout(function(){observed.timer=null;observed.callback(observed.obj,observed.obj.formVal())},observed.delay*1000);observed.oldVal=observed.obj.formVal()}}window.delayedObserverStack.push({obj:el,timer:null,delay:delay,oldVal:el.formVal(),callback:callback});var stackPos=window.delayedObserverStack.length-1;if(el[0].tagName=="FORM"){$(":input",el).each(function(){var field=$(this);field.bind($.fieldEvent(field,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})})}else{el.bind($.fieldEvent(el,delay),function(){observed=window.delayedObserverStack[stackPos];if(observed.obj.formVal()==observed.obj.oldVal){return}else{window.delayedObserverCallback(stackPos)}})}},formVal:function(){var el=this[0];if(el.tagName=="FORM"){return this.serialize()}if(el.type=="checkbox"||self.type=="radio"){return this.filter("input:checked").val()||""}else{return this.val()}}})})(jQuery);(function($){$.fn.extend({visualEffect:function(o){e=o.replace(/\_(.)/g,function(m,l){return l.toUpperCase()});return eval("$(this)."+e+"()")},appear:function(speed,callback){return this.fadeIn(speed,callback)},blindDown:function(speed,callback){return this.show("blind",{direction:"vertical"},speed,callback)},blindUp:function(speed,callback){return this.hide("blind",{direction:"vertical"},speed,callback)},blindRight:function(speed,callback){return this.show("blind",{direction:"horizontal"},speed,callback)},blindLeft:function(speed,callback){this.hide("blind",{direction:"horizontal"},speed,callback);return this},dropOut:function(speed,callback){return this.hide("drop",{direction:"down"},speed,callback)},dropIn:function(speed,callback){return this.show("drop",{direction:"up"},speed,callback)},fade:function(speed,callback){return this.fadeOut(speed,callback)},fadeToggle:function(speed,callback){return this.animate({opacity:"toggle"},speed,callback)},fold:function(speed,callback){return this.hide("fold",{},speed,callback)},foldOut:function(speed,callback){return this.show("fold",{},speed,callback)},grow:function(speed,callback){return this.show("scale",{},speed,callback)},highlight:function(speed,callback){return this.show("highlight",{},speed,callback)},puff:function(speed,callback){return this.hide("puff",{},speed,callback)},pulsate:function(speed,callback){return this.show("pulsate",{},speed,callback)},shake:function(speed,callback){return this.show("shake",{},speed,callback)},shrink:function(speed,callback){return this.hide("scale",{},speed,callback)},squish:function(speed,callback){return this.hide("scale",{origin:["top","left"]},speed,callback)},slideUp:function(speed,callback){return this.hide("slide",{direction:"up"},speed,callback)},slideDown:function(speed,callback){return this.show("slide",{direction:"up"},speed,callback)},switchOff:function(speed,callback){return this.hide("clip",{},speed,callback)},switchOn:function(speed,callback){return this.show("clip",{},speed,callback)}})})(jQuery);
|
@@ -1,9 +1,13 @@
|
|
1
1
|
//jQuery.noConflict();
|
2
|
-
|
3
2
|
jQuery(document).ajaxSend(function(event, request, settings) {
|
4
|
-
|
3
|
+
request.setRequestHeader("Accept", "text/javascript");
|
4
|
+
request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
|
5
|
+
|
6
|
+
if (settings.type.toUpperCase() == 'GET' || typeof(AUTH_TOKEN) == "undefined") return; // for details see: http://www.justinball.com/2009/07/08/jquery-ajax-get-in-firefox-post-in-internet-explorer/
|
7
|
+
// settings.data is a serialized string like "foo=bar&baz=boink" (or null)
|
5
8
|
settings.data = settings.data || "";
|
6
|
-
|
9
|
+
if (typeof(AUTH_TOKEN) != "undefined")
|
10
|
+
settings.data += (settings.data ? "&" : "") + "authenticity_token=" + encodeURIComponent(AUTH_TOKEN);
|
7
11
|
});
|
8
12
|
|
9
13
|
function setup_submit_delete(){
|
@@ -47,6 +51,47 @@ function show_hide_obj (ary_objs_to_show, ary_objs_to_hide)
|
|
47
51
|
}
|
48
52
|
}
|
49
53
|
|
54
|
+
function setup_country(force_load){
|
55
|
+
|
56
|
+
var country_id = jQuery("#countries").val();
|
57
|
+
var state_id = jQuery("#states").val();
|
58
|
+
|
59
|
+
if (country_id == undefined){
|
60
|
+
return;
|
61
|
+
}
|
62
|
+
|
63
|
+
if (country_id == '-1'){
|
64
|
+
jQuery("#states").val('-1');
|
65
|
+
jQuery("#counties").val('-1');
|
66
|
+
}
|
67
|
+
|
68
|
+
if (country_id == '-1' || country_id == ''){
|
69
|
+
jQuery("#states-container").hide();
|
70
|
+
jQuery("#counties-container").hide();
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
if(force_load || state_id == '' || state_id == null || state_id == -1) {
|
75
|
+
jQuery.getJSON("/helper/load_states_for_country/" + country_id + ".js", function(data){
|
76
|
+
var options = '';
|
77
|
+
jQuery("#counties-container").hide();
|
78
|
+
jQuery('#states-container label').html(data.label);
|
79
|
+
states = data.states;
|
80
|
+
if(states.length > 0){
|
81
|
+
for (var i = 0; i < states.length; i++) {
|
82
|
+
var state_id = states[i].state.id;
|
83
|
+
if(state_id == undefined) { state_id = ''; }
|
84
|
+
options += '<option value="' + state_id + '">' + states[i].state.name + '</option>';
|
85
|
+
}
|
86
|
+
jQuery("#states-container").show();
|
87
|
+
jQuery("select#states").html(options);
|
88
|
+
} else {
|
89
|
+
jQuery("#states-container").hide();
|
90
|
+
}
|
91
|
+
});
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
50
95
|
jQuery.jGrowl.defaults.position = 'center';
|
51
96
|
|
52
97
|
jQuery.jGrowl.info = function(msg){
|
@@ -65,12 +110,18 @@ jQuery(document).ready(function() {
|
|
65
110
|
jQuery("#global-login").focus(function() {
|
66
111
|
jQuery("#global-login").val("");
|
67
112
|
});
|
68
|
-
|
69
113
|
jQuery("#global-password").focus(function() {
|
70
114
|
jQuery("#global-password").val("");
|
71
115
|
});
|
72
|
-
|
73
116
|
jQuery("#quick-login-submit").click(function() {
|
74
117
|
jQuery("#quick-login").submit();
|
75
|
-
});
|
118
|
+
});
|
119
|
+
|
120
|
+
jQuery("#countries-container select").change(function() {
|
121
|
+
setup_country(true);
|
122
|
+
});
|
123
|
+
if(jQuery("#states").val() == '' || jQuery("#states").val() == null) {
|
124
|
+
jQuery("#states-container").hide();
|
125
|
+
}
|
126
|
+
setup_country(false);
|
76
127
|
});
|
@@ -7,8 +7,7 @@ function apply_activity_ajax_methods(){
|
|
7
7
|
hide_comment_boxes();
|
8
8
|
apply_comment_hover();
|
9
9
|
apply_activity_hover();
|
10
|
-
jQuery('.activity-no-comments').hide();
|
11
|
-
|
10
|
+
jQuery('.activity-no-comments').hide();
|
12
11
|
jQuery('.activity-has-comments').find('textarea').click(function(){
|
13
12
|
show_comment_box(this);
|
14
13
|
});
|
@@ -19,6 +18,7 @@ function apply_activity_ajax_methods(){
|
|
19
18
|
}
|
20
19
|
});
|
21
20
|
|
21
|
+
jQuery(".make-comment").unbind();
|
22
22
|
jQuery('.make-comment').click(function(){
|
23
23
|
var id = this.id.replace('make_comment_activity_', '');
|
24
24
|
var comment_box = jQuery('#comment_activity_' + id);
|
@@ -36,8 +36,11 @@ function apply_activity_ajax_methods(){
|
|
36
36
|
}
|
37
37
|
|
38
38
|
function setup_comment_submit(){
|
39
|
+
jQuery(".comment-submit").unbind();
|
39
40
|
jQuery(".comment-submit").click(function() {
|
40
|
-
jQuery(this).
|
41
|
+
jQuery(this).hide();
|
42
|
+
jQuery(this).parents('.comment-form-wrapper').siblings('.actor-icon').hide();
|
43
|
+
jQuery(this).siblings('textarea').hide();
|
41
44
|
jQuery(this).parent().append('<p class="comment-loading"><img src="/images/spinner.gif" alt="loading..." /> ' + ADD_COMMENT_MESSAGE + '</p>');
|
42
45
|
var form = jQuery(this).parents('form');
|
43
46
|
jQuery.post(form.attr('action'), form.serialize() + '&format=json',
|
@@ -46,9 +49,13 @@ function setup_comment_submit(){
|
|
46
49
|
if(!json.success){
|
47
50
|
jQuery.jGrowl.info(json.message);
|
48
51
|
} else {
|
49
|
-
jQuery('.activity-comment').get(0).clone(true);
|
50
52
|
jQuery('.comment-loading').remove();
|
51
53
|
jQuery('.activity-has-comments').find('textarea').show();
|
54
|
+
var comment_box = jQuery('#comment_activity_' + json.parent_id);
|
55
|
+
comment_box.before(json.html);
|
56
|
+
comment_box.removeClass('activity-no-comments');
|
57
|
+
comment_box.addClass('activity-has-comments');
|
58
|
+
comment_box.find('textarea').show();
|
52
59
|
apply_activity_ajax_methods();
|
53
60
|
}
|
54
61
|
});
|
@@ -83,12 +90,6 @@ function get_latest_activity_id(){
|
|
83
90
|
}
|
84
91
|
}
|
85
92
|
|
86
|
-
function apply_comment_hover(){
|
87
|
-
jQuery('.activity-comment').hover(
|
88
|
-
function () { jQuery(this).addClass('comment-hover'); },
|
89
|
-
function () { jQuery(this).removeClass('comment-hover'); } );
|
90
|
-
}
|
91
|
-
|
92
93
|
function update_feed(request){
|
93
94
|
jQuery('#activity-feed-content').prepend(request);
|
94
95
|
}
|
@@ -97,4 +98,10 @@ function apply_activity_hover(){
|
|
97
98
|
jQuery('.activity-content').hover(
|
98
99
|
function () { jQuery(this).addClass('activity-hover'); },
|
99
100
|
function () { jQuery(this).removeClass('activity-hover'); } );
|
101
|
+
}
|
102
|
+
|
103
|
+
function apply_comment_hover(){
|
104
|
+
jQuery('.activity-comment').hover(
|
105
|
+
function () { jQuery(this).addClass('comment-hover'); },
|
106
|
+
function () { jQuery(this).removeClass('comment-hover'); } );
|
100
107
|
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// from http://blog.peelmeagrape.net/2008/7/26/time-ago-in-words-javascript-part-1
|
2
|
+
function distanceOfTimeInWords(fromTime, toTime, includeSeconds) {
|
3
|
+
var fromSeconds = fromTime.getTime();
|
4
|
+
var toSeconds = toTime.getTime();
|
5
|
+
var distanceInSeconds = Math.round(Math.abs(fromSeconds - toSeconds) / 1000)
|
6
|
+
var distanceInMinutes = Math.round(distanceInSeconds / 60)
|
7
|
+
if (distanceInMinutes <= 1) {
|
8
|
+
if (!includeSeconds)
|
9
|
+
return (distanceInMinutes == 0) ? 'less than a minute' : '1 minute'
|
10
|
+
if (distanceInSeconds < 5)
|
11
|
+
return 'less than 5 seconds'
|
12
|
+
if (distanceInSeconds < 10)
|
13
|
+
return 'less than 10 seconds'
|
14
|
+
if (distanceInSeconds < 20)
|
15
|
+
return 'less than 20 seconds'
|
16
|
+
if (distanceInSeconds < 40)
|
17
|
+
return 'half a minute'
|
18
|
+
if (distanceInSeconds < 60)
|
19
|
+
return 'less than a minute'
|
20
|
+
return '1 minute'
|
21
|
+
}
|
22
|
+
if (distanceInMinutes < 45)
|
23
|
+
return distanceInMinutes + ' minutes'
|
24
|
+
if (distanceInMinutes < 90)
|
25
|
+
return "about 1 hour"
|
26
|
+
if (distanceInMinutes < 1440)
|
27
|
+
return "about " + (Math.round(distanceInMinutes / 60)) + ' hours'
|
28
|
+
if (distanceInMinutes < 2880)
|
29
|
+
return "1 day"
|
30
|
+
if (distanceInMinutes < 43200)
|
31
|
+
return (Math.round(distanceInMinutes / 1440)) + ' days'
|
32
|
+
if (distanceInMinutes < 86400)
|
33
|
+
return "about 1 month"
|
34
|
+
if (distanceInMinutes < 525600)
|
35
|
+
return (Math.round(distanceInMinutes / 43200)) + ' months'
|
36
|
+
if (distanceInMinutes < 1051200)
|
37
|
+
return "about 1 year"
|
38
|
+
return "over " + (Math.round(distanceInMinutes / 525600)) + ' years'
|
39
|
+
}
|
40
|
+
|
41
|
+
if ( typeof jQuery != "undefined" )
|
42
|
+
jQuery.fn.readableDate = function(){
|
43
|
+
return this.each(function(){
|
44
|
+
var span = jQuery(this);
|
45
|
+
var date = distanceOfTimeInWords(new Date(span.text()), new Date(), true);
|
46
|
+
if (date)
|
47
|
+
jQuery(this).text(date + ' ago');
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
jQuery(document).ready(function() {
|
52
|
+
jQuery(".readable-time").readableDate();
|
53
|
+
});
|
@@ -0,0 +1,107 @@
|
|
1
|
+
jQuery(document).ready(function() {
|
2
|
+
|
3
|
+
jQuery(".pageContainer").draggable({
|
4
|
+
zIndex : 1000000,
|
5
|
+
revert : 'invalid',
|
6
|
+
opacity : 0.5,
|
7
|
+
scroll : true,
|
8
|
+
helper : 'clone'
|
9
|
+
});
|
10
|
+
|
11
|
+
jQuery("#pageList").droppable({
|
12
|
+
accept: ".pageContainer",
|
13
|
+
drop: function(ev, ui) {
|
14
|
+
var source_li = jQuery(ui.draggable);
|
15
|
+
var child_ul = jQuery(this).children('ul');
|
16
|
+
var page_id = source_li.children('input').val();
|
17
|
+
var parent_id = 0;
|
18
|
+
if(same_parent(source_li, child_ul)){
|
19
|
+
return;
|
20
|
+
}
|
21
|
+
insert_alphabetic(child_ul, source_li);
|
22
|
+
update_parent(page_id, parent_id);
|
23
|
+
}
|
24
|
+
});
|
25
|
+
|
26
|
+
jQuery(".pageContainer").droppable({
|
27
|
+
accept: ".pageContainer",
|
28
|
+
hoverClass: 'pageContainer-hover',
|
29
|
+
tolerance : 'pointer',
|
30
|
+
greedy : true,
|
31
|
+
drop: function(ev, ui) {
|
32
|
+
var source_li = jQuery(ui.draggable);
|
33
|
+
var target_li = jQuery(this);
|
34
|
+
var page_id = source_li.children('input').val();
|
35
|
+
var parent_id = target_li.children('input').val();
|
36
|
+
if(target_li.children('ul').length <= 0){
|
37
|
+
target_li.append('<ul></ul>');
|
38
|
+
}
|
39
|
+
var child_ul = target_li.children('ul');
|
40
|
+
if(same_parent(source_li, child_ul)){
|
41
|
+
return;
|
42
|
+
}
|
43
|
+
jQuery(this).children('ul:hidden').slideDown();
|
44
|
+
insert_alphabetic(child_ul, source_li);
|
45
|
+
update_parent(page_id, parent_id);
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
jQuery(".submit-delete").click(function() {
|
50
|
+
if(jQuery(this).parents('li:first').siblings('li').length <= 0){
|
51
|
+
jQuery(this).parents('li:first').parents('li:first').children('.expander').remove();
|
52
|
+
}
|
53
|
+
return false;
|
54
|
+
});
|
55
|
+
|
56
|
+
function insert_alphabetic(child_ul, source_li){
|
57
|
+
var kids = child_ul.children('li');
|
58
|
+
var source_text = source_li.children('span.link').children('a').html().toLowerCase();
|
59
|
+
for(i=0; i<kids.length; i++){
|
60
|
+
var current_text = jQuery(kids[i]).children('span.link').children('a').html().toLowerCase();
|
61
|
+
if(source_text < current_text){
|
62
|
+
source_li.insertBefore(kids[i]);
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
source_li.appendTo(child_ul);
|
67
|
+
}
|
68
|
+
|
69
|
+
function same_parent(source_li, child_ul){
|
70
|
+
return source_li.parent() == child_ul;
|
71
|
+
}
|
72
|
+
|
73
|
+
function update_parent(page_id, parent_id){
|
74
|
+
var path = jQuery('#updatePath').val();
|
75
|
+
jQuery.post(path + '/' + page_id + '.js', {parent_id: parent_id, action: 'update', _method: 'put', only_parent: 'true' },
|
76
|
+
function(data){
|
77
|
+
apply_expander();
|
78
|
+
if(data.length > 0){
|
79
|
+
var result = eval('(' + data + ')');
|
80
|
+
if(!result.success){
|
81
|
+
jQuery.jGrowl.error(result.message);
|
82
|
+
}
|
83
|
+
}
|
84
|
+
});
|
85
|
+
return false;
|
86
|
+
}
|
87
|
+
|
88
|
+
apply_expander();
|
89
|
+
function apply_expander(){
|
90
|
+
jQuery(".expander").remove();
|
91
|
+
jQuery(".pageContainer ul:hidden li:first-child").parent().parent().prepend('<a class="expander" href="#"><img src="/images/expand.png" /></a>');
|
92
|
+
jQuery(".pageContainer ul:visible li:first-child").parent().parent().prepend('<a class="expander" href="#"><img src="/images/collapse.png" /></a>');
|
93
|
+
jQuery(".expander").click(function(){
|
94
|
+
var img = jQuery(this).children('img');
|
95
|
+
var target_ul = jQuery(this).siblings('ul');
|
96
|
+
if(img.attr('src') == '/images/expand.png'){
|
97
|
+
img.attr('src', '/images/collapse.png');
|
98
|
+
target_ul.slideDown();
|
99
|
+
} else {
|
100
|
+
img.attr('src', '/images/expand.png');
|
101
|
+
target_ul.slideUp();
|
102
|
+
}
|
103
|
+
return false;
|
104
|
+
});
|
105
|
+
}
|
106
|
+
|
107
|
+
});
|