muck-contents 0.1.12 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +122 -15
- data/VERSION +1 -1
- data/app/controllers/muck/tiny_mce_controller.rb +47 -0
- data/app/helpers/tinymce_helper.rb +23 -8
- data/app/views/contents/_form.html.erb +1 -2
- data/app/views/contents/new.html.erb +1 -0
- data/app/views/layouts/tiny_mce.html.erb +25 -0
- data/app/views/tiny_mce/files.html.erb +136 -0
- data/app/views/tiny_mce/images.html.erb +312 -0
- data/{public/javascripts/tiny_mce/plugins/advlinktoo/link.htm → app/views/tiny_mce/links.html.erb} +328 -344
- data/config/muck_contents_routes.rb +6 -0
- data/lib/action_controller/acts/muck_content_handler.rb +1 -1
- data/locales/en.yml +2 -0
- data/muck-contents.gemspec +153 -25
- data/public/{javascripts/tiny_mce/plugins/advimagetoo/img → images/tinymce}/sample.gif +0 -0
- data/public/{javascripts/tiny_mce/plugins/advfiletoo/img → images/tinymce}/upload.gif +0 -0
- data/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin.js +9 -22
- data/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin_src.js +41 -54
- data/public/javascripts/tiny_mce/plugins/advfiletoo/js/functions.js +0 -139
- data/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin.js +9 -17
- data/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin_src.js +40 -50
- data/public/javascripts/tiny_mce/plugins/advimagetoo/js/functions.js +0 -152
- data/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin.js +3 -14
- data/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin_src.js +3 -14
- data/public/{javascripts/tiny_mce/plugins/advfiletoo/css/advfile.css → stylesheets/tinymce.css} +33 -12
- data/test/rails_root/Rakefile +2 -1
- data/test/rails_root/app/controllers/uploads_controller.rb +57 -0
- data/test/rails_root/app/models/upload.rb +94 -0
- data/test/rails_root/app/models/user.rb +5 -0
- data/test/rails_root/config/environment.rb +2 -0
- data/test/rails_root/config/initializers/mce_options.rb +12 -8
- data/test/rails_root/config/initializers/s3_credentials.rb +9 -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 +18 -0
- data/test/rails_root/db/migrate/20090426041056_create_countries.rb +15 -0
- data/test/rails_root/db/migrate/20090426041103_create_states.rb +18 -0
- data/test/rails_root/db/migrate/{20090704220120_acts_as_taggable_on_migration.rb → 20090506000404_acts_as_taggable_on_migration.rb} +31 -29
- data/test/rails_root/db/migrate/20090517040220_create_uploads.rb +38 -0
- data/test/rails_root/db/migrate/20090730044139_add_comment_cache.rb +9 -0
- data/test/rails_root/db/migrate/20090818204527_add_activity_indexes.rb +9 -0
- data/test/rails_root/db/migrate/20090819030523_add_attachable_to_activities.rb +13 -0
- data/test/rails_root/lib/daemons/amazonaws.rb +36 -0
- data/test/rails_root/lib/tasks/muck.rake +7 -0
- data/test/rails_root/public/images/SWFUploadButton.png +0 -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/cancelbutton.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/file_icons/excel.gif +0 -0
- data/test/rails_root/public/images/file_icons/file.gif +0 -0
- data/test/rails_root/public/images/file_icons/file.png +0 -0
- data/test/rails_root/public/images/file_icons/file_aac.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ai.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_avi.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_bin.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_bmp.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_cue.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_divx.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_doc.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_eps.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_flac.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_flv.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_gif.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_html.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ical.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_indd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_inx.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_iso.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_jpg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mov.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mp3.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_mpg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_pdf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_php.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_png.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_pps.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_ppt.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_psd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_qxd.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_qxp.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_raw.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_rtf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_svg.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_tif.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_txt.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_vcf.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_wav.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_wma.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_xls.gif +0 -0
- data/test/rails_root/public/images/file_icons/file_xml.gif +0 -0
- data/test/rails_root/public/images/file_icons/mp3.gif +0 -0
- data/test/rails_root/public/images/file_icons/pdf.gif +0 -0
- data/test/rails_root/public/images/file_icons/pdf.png +0 -0
- data/test/rails_root/public/images/file_icons/text.gif +0 -0
- data/test/rails_root/public/images/file_icons/text.png +0 -0
- data/test/rails_root/public/images/file_icons/word.gif +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/tiny_mce/plugins/advimagetoo/img → images/tinymce}/sample.gif +0 -0
- data/test/rails_root/public/{javascripts/tiny_mce/plugins/advfiletoo/img → images/tinymce}/upload.gif +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 +9 -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/jrails.js +1 -0
- data/test/rails_root/public/javascripts/muck.js +11 -6
- data/test/rails_root/public/javascripts/muck_activities.js +5 -6
- data/test/rails_root/public/javascripts/muck_time/en.js +53 -0
- data/test/rails_root/public/javascripts/swfupload/fileprogress.js +151 -0
- data/test/rails_root/public/javascripts/swfupload/handlers.js +201 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.cookies.js +53 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.js +980 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.queue.js +98 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.speed.js +342 -0
- data/test/rails_root/public/javascripts/swfupload/swfupload.swfobject.js +111 -0
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin.js +9 -22
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/editor_plugin_src.js +41 -54
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/js/functions.js +0 -139
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin.js +9 -17
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/editor_plugin_src.js +40 -50
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/image.htm +10 -9
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/js/functions.js +0 -152
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin.js +3 -14
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advlinktoo/editor_plugin_src.js +3 -14
- data/test/rails_root/public/javascripts/tiny_mce/templates/example.htm +14 -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 +44 -0
- data/test/rails_root/public/stylesheets/muck-activities.css +39 -0
- data/test/rails_root/public/stylesheets/styles.css +10 -3
- data/test/rails_root/public/stylesheets/swfupload.css +26 -0
- data/test/rails_root/public/{javascripts/tiny_mce/plugins/advfiletoo/css/advfile.css → stylesheets/tinymce.css} +33 -12
- data/test/rails_root/public/system/locals/000/000/026/original/deploy-1.rb +75 -0
- metadata +153 -25
- data/public/javascripts/tiny_mce/plugins/advfiletoo/file.htm +0 -139
- data/public/javascripts/tiny_mce/plugins/advimagetoo/css/advimage.css +0 -32
- data/public/javascripts/tiny_mce/plugins/advimagetoo/image.htm +0 -303
- data/public/javascripts/tiny_mce/plugins/advlinktoo/css/advlink.css +0 -8
- data/test/rails_root/db/migrate/20090608073052_create_friends.rb +0 -16
- data/test/rails_root/db/migrate/20090808005918_add_scope_index_to_slugs.rb +0 -9
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advfiletoo/file.htm +0 -139
- data/test/rails_root/public/javascripts/tiny_mce/plugins/advimagetoo/css/advimage.css +0 -32
- data/test/rails_root/public/javascripts/tiny_mce/templates/bio.htm +0 -31
- data/test/rails_root/public/javascripts/tiny_mce/templates/country.htm +0 -59
@@ -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,9 @@
|
|
1
|
+
/*
|
2
|
+
* FancyBox - simple and fancy jQuery plugin
|
3
|
+
* Examples and documentation at: http://fancy.klade.lv/
|
4
|
+
* Version: 1.2.1 (13/03/2009)
|
5
|
+
* Copyright (c) 2009 Janis Skarnelis
|
6
|
+
* Licensed under the MIT License: http://en.wikipedia.org/wiki/MIT_License
|
7
|
+
* Requires: jQuery v1.3+
|
8
|
+
*/
|
9
|
+
eval(function(p,a,c,k,e,d){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--){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}(';(7($){$.b.2Q=7(){u B.2t(7(){9 1J=$(B).n(\'2Z\');5(1J.1c(/^3w\\(["\']?(.*\\.2p)["\']?\\)$/i)){1J=3t.$1;$(B).n({\'2Z\':\'45\',\'2o\':"3W:3R.4m.4d(3h=F, 3T="+($(B).n(\'41\')==\'2J-3Z\'?\'4c\':\'3N\')+", Q=\'"+1J+"\')"}).2t(7(){9 1b=$(B).n(\'1b\');5(1b!=\'2e\'&&1b!=\'2n\')$(B).n(\'1b\',\'2n\')})}})};9 A,4,16=D,s=1t 1o,1w,1v=1,1y=/\\.(3A|3Y|2p|3c|3d)(.*)?$/i;9 P=($.2q.3K&&2f($.2q.3z.2k(0,1))<8);$.b.c=7(Y){Y=$.3x({},$.b.c.2R,Y);9 2s=B;7 2h(){A=B;4=Y;2r();u D};7 2r(){5(16)u;5($.1O(4.2c)){4.2c()}4.j=[];4.h=0;5(Y.j.N>0){4.j=Y.j}t{9 O={};5(!A.1H||A.1H==\'\'){9 O={d:A.d,X:A.X};5($(A).1G("1m:1D").N){O.1a=$(A).1G("1m:1D")}4.j.2j(O)}t{9 Z=$(2s).2o("a[1H="+A.1H+"]");9 O={};3C(9 i=0;i<Z.N;i++){O={d:Z[i].d,X:Z[i].X};5($(Z[i]).1G("1m:1D").N){O.1a=$(Z[i]).1G("1m:1D")}4.j.2j(O)}3F(4.j[4.h].d!=A.d){4.h++}}}5(4.23){5(P){$(\'1U, 1Q, 1P\').n(\'1S\',\'3s\')}$("#1i").n(\'25\',4.2U).J()}1d()};7 1d(){$("#1f, #1e, #V, #G").S();9 d=4.j[4.h].d;5(d.1c(/#/)){9 U=11.3r.d.3f(\'#\')[0];U=d.3g(U,\'\');U=U.2k(U.2l(\'#\'));1k(\'<6 l="3e">\'+$(U).o()+\'</6>\',4.1I,4.1x)}t 5(d.1c(1y)){s=1t 1o;s.Q=d;5(s.3a){1K()}t{$.b.c.34();$(s).x().14(\'3b\',7(){$(".I").S();1K()})}}t 5(d.1c("17")||A.3j.2l("17")>=0){1k(\'<17 l="35" 3q="$.b.c.38()" 3o="3n\'+C.T(C.3l()*3m)+\'" 2K="0" 3E="0" Q="\'+d+\'"></17>\',4.1I,4.1x)}t{$.4p(d,7(2m){1k(\'<6 l="3L">\'+2m+\'</6>\',4.1I,4.1x)})}};7 1K(){5(4.30){9 w=$.b.c.1n();9 r=C.1M(C.1M(w[0]-36,s.g)/s.g,C.1M(w[1]-4b,s.f)/s.f);9 g=C.T(r*s.g);9 f=C.T(r*s.f)}t{9 g=s.g;9 f=s.f}1k(\'<1m 48="" l="49" Q="\'+s.Q+\'" />\',g,f)};7 2F(){5((4.j.N-1)>4.h){9 d=4.j[4.h+1].d;5(d.1c(1y)){1A=1t 1o();1A.Q=d}}5(4.h>0){9 d=4.j[4.h-1].d;5(d.1c(1y)){1A=1t 1o();1A.Q=d}}};7 1k(1j,g,f){16=F;9 L=4.2Y;5(P){$("#q")[0].1E.2u("f");$("#q")[0].1E.2u("g")}5(L>0){g+=L*2;f+=L*2;$("#q").n({\'v\':L+\'z\',\'2E\':L+\'z\',\'2i\':L+\'z\',\'y\':L+\'z\',\'g\':\'2B\',\'f\':\'2B\'});5(P){$("#q")[0].1E.2C(\'f\',\'(B.2D.4j - 20)\');$("#q")[0].1E.2C(\'g\',\'(B.2D.3S - 20)\')}}t{$("#q").n({\'v\':0,\'2E\':0,\'2i\':0,\'y\':0,\'g\':\'2z%\',\'f\':\'2z%\'})}5($("#k").1u(":19")&&g==$("#k").g()&&f==$("#k").f()){$("#q").1Z("2N",7(){$("#q").1C().1F($(1j)).21("1s",7(){1g()})});u}9 w=$.b.c.1n();9 2v=(g+36)>w[0]?w[2]:(w[2]+C.T((w[0]-g-36)/2));9 2w=(f+1z)>w[1]?w[3]:(w[3]+C.T((w[1]-f-1z)/2));9 K={\'y\':2v,\'v\':2w,\'g\':g+\'z\',\'f\':f+\'z\'};5($("#k").1u(":19")){$("#q").1Z("1s",7(){$("#q").1C();$("#k").24(K,4.2X,4.2T,7(){$("#q").1F($(1j)).21("1s",7(){1g()})})})}t{5(4.1W>0&&4.j[4.h].1a!==1L){$("#q").1C().1F($(1j));9 M=4.j[4.h].1a;9 15=$.b.c.1R(M);$("#k").n({\'y\':(15.y-18)+\'z\',\'v\':(15.v-18)+\'z\',\'g\':$(M).g(),\'f\':$(M).f()});5(4.1X){K.25=\'J\'}$("#k").24(K,4.1W,4.2W,7(){1g()})}t{$("#q").S().1C().1F($(1j)).J();$("#k").n(K).21("1s",7(){1g()})}}};7 2y(){5(4.h!=0){$("#1e, #2O").x().14("R",7(e){e.2x();4.h--;1d();u D});$("#1e").J()}5(4.h!=(4.j.N-1)){$("#1f, #2M").x().14("R",7(e){e.2x();4.h++;1d();u D});$("#1f").J()}};7 1g(){2y();2F();$(W).1B(7(e){5(e.29==27){$.b.c.1l();$(W).x("1B")}t 5(e.29==37&&4.h!=0){4.h--;1d();$(W).x("1B")}t 5(e.29==39&&4.h!=(4.j.N-1)){4.h++;1d();$(W).x("1B")}});5(4.1r){$(11).14("1N 1T",$.b.c.2g)}t{$("6#k").n("1b","2e")}5(4.2b){$("#22").R($.b.c.1l)}$("#1i, #V").14("R",$.b.c.1l);$("#V").J();5(4.j[4.h].X!==1L&&4.j[4.h].X.N>0){$(\'#G 6\').o(4.j[4.h].X);$(\'#G\').J()}5(4.23&&P){$(\'1U, 1Q, 1P\',$(\'#q\')).n(\'1S\',\'19\')}5($.1O(4.2a)){4.2a()}16=D};u B.x(\'R\').R(2h)};$.b.c.2g=7(){9 m=$.b.c.1n();$("#k").n(\'y\',(($("#k").g()+36)>m[0]?m[2]:m[2]+C.T((m[0]-$("#k").g()-36)/2)));$("#k").n(\'v\',(($("#k").f()+1z)>m[1]?m[3]:m[3]+C.T((m[1]-$("#k").f()-1z)/2)))};$.b.c.1h=7(H,2A){u 2f($.3I(H.3u?H[0]:H,2A,F))||0};$.b.c.1R=7(H){9 m=H.4g();m.v+=$.b.c.1h(H,\'3k\');m.v+=$.b.c.1h(H,\'3J\');m.y+=$.b.c.1h(H,\'3H\');m.y+=$.b.c.1h(H,\'3D\');u m};$.b.c.38=7(){$(".I").S();$("#35").J()};$.b.c.1n=7(){u[$(11).g(),$(11).f(),$(W).3i(),$(W).3p()]};$.b.c.2G=7(){5(!$("#I").1u(\':19\')){33(1w);u}$("#I > 6").n(\'v\',(1v*-40)+\'z\');1v=(1v+1)%12};$.b.c.34=7(){33(1w);9 m=$.b.c.1n();$("#I").n({\'y\':((m[0]-40)/2+m[2]),\'v\':((m[1]-40)/2+m[3])}).J();$("#I").14(\'R\',$.b.c.1l);1w=3Q($.b.c.2G,3X)};$.b.c.1l=7(){16=F;$(s).x();$("#1i, #V").x();5(4.2b){$("#22").x()}$("#V, .I, #1e, #1f, #G").S();5(4.1r){$(11).x("1N 1T")}1q=7(){$("#1i, #k").S();5(4.1r){$(11).x("1N 1T")}5(P){$(\'1U, 1Q, 1P\').n(\'1S\',\'19\')}5($.1O(4.1V)){4.1V()}16=D};5($("#k").1u(":19")!==D){5(4.26>0&&4.j[4.h].1a!==1L){9 M=4.j[4.h].1a;9 15=$.b.c.1R(M);9 K={\'y\':(15.y-18)+\'z\',\'v\':(15.v-18)+\'z\',\'g\':$(M).g(),\'f\':$(M).f()};5(4.1X){K.25=\'S\'}$("#k").31(D,F).24(K,4.26,4.2S,1q)}t{$("#k").31(D,F).1Z("2N",1q)}}t{1q()}u D};$.b.c.2V=7(){9 o=\'\';o+=\'<6 l="1i"></6>\';o+=\'<6 l="22">\';o+=\'<6 p="I" l="I"><6></6></6>\';o+=\'<6 l="k">\';o+=\'<6 l="2I">\';o+=\'<6 l="V"></6>\';o+=\'<6 l="E"><6 p="E 44"></6><6 p="E 43"></6><6 p="E 42"></6><6 p="E 3V"></6><6 p="E 3U"></6><6 p="E 3O"></6><6 p="E 3M"></6><6 p="E 3P"></6></6>\';o+=\'<a d="2P:;" l="1e"><1p p="1Y" l="2O"></1p></a><a d="2P:;" l="1f"><1p p="1Y" l="2M"></1p></a>\';o+=\'<6 l="q"></6>\';o+=\'<6 l="G"></6>\';o+=\'</6>\';o+=\'</6>\';o+=\'</6>\';$(o).2H("46");$(\'<32 4i="0" 4h="0" 4k="0"><2L><13 p="G" l="4l"></13><13 p="G" l="4o"><6></6></13><13 p="G" l="4n"></13></2L></32>\').2H(\'#G\');5(P){$("#2I").47(\'<17 p="4a" 4e="2J" 2K="0"></17>\');$("#V, .E, .G, .1Y").2Q()}};$.b.c.2R={2Y:10,30:F,1X:D,1W:0,26:0,2X:3G,2W:\'28\',2S:\'28\',2T:\'28\',1I:3B,1x:3v,23:F,2U:0.3,2b:F,1r:F,j:[],2c:2d,2a:2d,1V:2d};$(W).3y(7(){$.b.c.2V()})})(4f);',62,274,'||||opts|if|div|function||var||fn|fancybox|href||height|width|itemCurrent||itemArray|fancy_outer|id|pos|css|html|class|fancy_content||imagePreloader|else|return|top||unbind|left|px|elem|this|Math|false|fancy_bg|true|fancy_title|el|fancy_loading|show|itemOpts|pad|orig_item|length|item|isIE|src|click|hide|round|target|fancy_close|document|title|settings|subGroup||window||td|bind|orig_pos|busy|iframe||visible|orig|position|match|_change_item|fancy_left|fancy_right|_finish|getNumeric|fancy_overlay|value|_set_content|close|img|getViewport|Image|span|__cleanup|centerOnScroll|normal|new|is|loadingFrame|loadingTimer|frameHeight|imageRegExp|50|objNext|keydown|empty|first|style|append|children|rel|frameWidth|image|_proceed_image|undefined|min|resize|isFunction|select|object|getPosition|visibility|scroll|embed|callbackOnClose|zoomSpeedIn|zoomOpacity|fancy_ico|fadeOut||fadeIn|fancy_wrap|overlayShow|animate|opacity|zoomSpeedOut||swing|keyCode|callbackOnShow|hideOnContentClick|callbackOnStart|null|absolute|parseInt|scrollBox|_initialize|bottom|push|substr|indexOf|data|relative|filter|png|browser|_start|matchedGroup|each|removeExpression|itemLeft|itemTop|stopPropagation|_set_navigation|100|prop|auto|setExpression|parentNode|right|_preload_neighbor_images|animateLoading|appendTo|fancy_inner|no|frameborder|tr|fancy_right_ico|fast|fancy_left_ico|javascript|fixPNG|defaults|easingOut|easingChange|overlayOpacity|build|easingIn|zoomSpeedChange|padding|backgroundImage|imageScale|stop|table|clearInterval|showLoading|fancy_frame|||showIframe||complete|load|bmp|jpeg|fancy_div|split|replace|enabled|scrollLeft|className|paddingTop|random|1000|fancy_iframe|name|scrollTop|onload|location|hidden|RegExp|jquery|355|url|extend|ready|version|jpg|425|for|borderLeftWidth|hspace|while|300|paddingLeft|curCSS|borderTopWidth|msie|fancy_ajax|fancy_bg_w|scale|fancy_bg_sw|fancy_bg_nw|setInterval|DXImageTransform|clientWidth|sizingMethod|fancy_bg_s|fancy_bg_se|progid|66|gif|repeat||backgroundRepeat|fancy_bg_e|fancy_bg_ne|fancy_bg_n|none|body|prepend|alt|fancy_img|fancy_bigIframe|60|crop|AlphaImageLoader|scrolling|jQuery|offset|cellpadding|cellspacing|clientHeight|border|fancy_title_left|Microsoft|fancy_title_right|fancy_title_main|get'.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)}})};
|
@@ -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(){
|
@@ -65,12 +69,13 @@ jQuery(document).ready(function() {
|
|
65
69
|
jQuery("#global-login").focus(function() {
|
66
70
|
jQuery("#global-login").val("");
|
67
71
|
});
|
68
|
-
|
72
|
+
|
69
73
|
jQuery("#global-password").focus(function() {
|
70
74
|
jQuery("#global-password").val("");
|
71
75
|
});
|
72
|
-
|
76
|
+
|
73
77
|
jQuery("#quick-login-submit").click(function() {
|
74
78
|
jQuery("#quick-login").submit();
|
75
|
-
});
|
79
|
+
});
|
80
|
+
|
76
81
|
});
|
@@ -1,14 +1,13 @@
|
|
1
1
|
jQuery(document).ready(function() {
|
2
|
-
|
2
|
+
apply_activity_ajax_methods();
|
3
3
|
});
|
4
4
|
|
5
|
-
function
|
5
|
+
function apply_activity_ajax_methods(){
|
6
6
|
setup_comment_submit();
|
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
|
});
|
@@ -57,7 +56,7 @@ function setup_comment_submit(){
|
|
57
56
|
comment_box.removeClass('activity-no-comments');
|
58
57
|
comment_box.addClass('activity-has-comments');
|
59
58
|
comment_box.find('textarea').show();
|
60
|
-
|
59
|
+
apply_activity_ajax_methods();
|
61
60
|
}
|
62
61
|
});
|
63
62
|
return false;
|
@@ -83,7 +82,7 @@ function show_comment_box(obj){
|
|
83
82
|
}
|
84
83
|
|
85
84
|
function get_latest_activity_id(){
|
86
|
-
var activities = jQuery('#activity-feed-content').children('.activity
|
85
|
+
var activities = jQuery('#activity-feed-content').children('.activity');
|
87
86
|
if(activities.length > 0){
|
88
87
|
return activities[0].id.replace('activity_', '');
|
89
88
|
} else {
|
@@ -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,151 @@
|
|
1
|
+
/*
|
2
|
+
A simple class for displaying file information and progress
|
3
|
+
Note: This is a demonstration only and not part of SWFUpload.
|
4
|
+
Note: Some have had problems adapting this class in IE7. It may not be suitable for your application.
|
5
|
+
*/
|
6
|
+
|
7
|
+
// Constructor
|
8
|
+
// file is a SWFUpload file object
|
9
|
+
// targetID is the HTML element id attribute that the FileProgress HTML structure will be added to.
|
10
|
+
// Instantiating a new FileProgress object with an existing file will reuse/update the existing DOM elements
|
11
|
+
function FileProgress(file, targetID) {
|
12
|
+
this.fileProgressID = file.id;
|
13
|
+
|
14
|
+
this.opacity = 100;
|
15
|
+
this.height = 0;
|
16
|
+
|
17
|
+
this.fileProgressWrapper = document.getElementById(this.fileProgressID);
|
18
|
+
if (!this.fileProgressWrapper) {
|
19
|
+
this.fileProgressWrapper = document.createElement("div");
|
20
|
+
this.fileProgressWrapper.className = "progressWrapper";
|
21
|
+
this.fileProgressWrapper.id = this.fileProgressID;
|
22
|
+
|
23
|
+
this.fileProgressElement = document.createElement("div");
|
24
|
+
this.fileProgressElement.className = "progressContainer";
|
25
|
+
|
26
|
+
var progressCancel = document.createElement("a");
|
27
|
+
progressCancel.className = "progressCancel";
|
28
|
+
progressCancel.href = "#";
|
29
|
+
progressCancel.style.visibility = "hidden";
|
30
|
+
progressCancel.appendChild(document.createTextNode(" "));
|
31
|
+
|
32
|
+
var progressText = document.createElement("div");
|
33
|
+
progressText.className = "progressName";
|
34
|
+
progressText.appendChild(document.createTextNode(file.name));
|
35
|
+
|
36
|
+
var progressBar = document.createElement("div");
|
37
|
+
progressBar.className = "progressBarInProgress";
|
38
|
+
|
39
|
+
var progressStatus = document.createElement("div");
|
40
|
+
progressStatus.className = "progressBarStatus";
|
41
|
+
progressStatus.innerHTML = " ";
|
42
|
+
|
43
|
+
this.fileProgressElement.appendChild(progressCancel);
|
44
|
+
this.fileProgressElement.appendChild(progressText);
|
45
|
+
this.fileProgressElement.appendChild(progressStatus);
|
46
|
+
this.fileProgressElement.appendChild(progressBar);
|
47
|
+
|
48
|
+
this.fileProgressWrapper.appendChild(this.fileProgressElement);
|
49
|
+
|
50
|
+
document.getElementById(targetID).appendChild(this.fileProgressWrapper);
|
51
|
+
} else {
|
52
|
+
this.fileProgressElement = this.fileProgressWrapper.firstChild;
|
53
|
+
}
|
54
|
+
|
55
|
+
this.height = this.fileProgressWrapper.offsetHeight;
|
56
|
+
|
57
|
+
}
|
58
|
+
FileProgress.prototype.setProgress = function (percentage) {
|
59
|
+
this.fileProgressElement.className = "progressContainer green";
|
60
|
+
this.fileProgressElement.childNodes[3].className = "progressBarInProgress";
|
61
|
+
this.fileProgressElement.childNodes[3].style.width = percentage + "%";
|
62
|
+
};
|
63
|
+
FileProgress.prototype.setComplete = function () {
|
64
|
+
this.fileProgressElement.className = "progressContainer blue";
|
65
|
+
this.fileProgressElement.childNodes[3].className = "progressBarComplete";
|
66
|
+
this.fileProgressElement.childNodes[3].style.width = "";
|
67
|
+
|
68
|
+
var oSelf = this;
|
69
|
+
setTimeout(function () {
|
70
|
+
oSelf.disappear();
|
71
|
+
}, 5000);
|
72
|
+
};
|
73
|
+
FileProgress.prototype.setError = function () {
|
74
|
+
this.fileProgressElement.className = "progressContainer red";
|
75
|
+
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
76
|
+
this.fileProgressElement.childNodes[3].style.width = "";
|
77
|
+
|
78
|
+
var oSelf = this;
|
79
|
+
setTimeout(function () {
|
80
|
+
oSelf.disappear();
|
81
|
+
}, 5000);
|
82
|
+
};
|
83
|
+
FileProgress.prototype.setCancelled = function () {
|
84
|
+
this.fileProgressElement.className = "progressContainer";
|
85
|
+
this.fileProgressElement.childNodes[3].className = "progressBarError";
|
86
|
+
this.fileProgressElement.childNodes[3].style.width = "";
|
87
|
+
|
88
|
+
var oSelf = this;
|
89
|
+
setTimeout(function () {
|
90
|
+
oSelf.disappear();
|
91
|
+
}, 2000);
|
92
|
+
};
|
93
|
+
FileProgress.prototype.setStatus = function (status) {
|
94
|
+
this.fileProgressElement.childNodes[2].innerHTML = status;
|
95
|
+
};
|
96
|
+
|
97
|
+
// Show/Hide the cancel button
|
98
|
+
FileProgress.prototype.toggleCancel = function (show, swfUploadInstance) {
|
99
|
+
this.fileProgressElement.childNodes[0].style.visibility = show ? "visible" : "hidden";
|
100
|
+
if (swfUploadInstance) {
|
101
|
+
var fileID = this.fileProgressID;
|
102
|
+
this.fileProgressElement.childNodes[0].onclick = function () {
|
103
|
+
swfUploadInstance.cancelUpload(fileID);
|
104
|
+
return false;
|
105
|
+
};
|
106
|
+
}
|
107
|
+
};
|
108
|
+
|
109
|
+
// Fades out and clips away the FileProgress box.
|
110
|
+
FileProgress.prototype.disappear = function () {
|
111
|
+
|
112
|
+
var reduceOpacityBy = 15;
|
113
|
+
var reduceHeightBy = 4;
|
114
|
+
var rate = 30; // 15 fps
|
115
|
+
|
116
|
+
if (this.opacity > 0) {
|
117
|
+
this.opacity -= reduceOpacityBy;
|
118
|
+
if (this.opacity < 0) {
|
119
|
+
this.opacity = 0;
|
120
|
+
}
|
121
|
+
|
122
|
+
if (this.fileProgressWrapper.filters) {
|
123
|
+
try {
|
124
|
+
this.fileProgressWrapper.filters.item("DXImageTransform.Microsoft.Alpha").opacity = this.opacity;
|
125
|
+
} catch (e) {
|
126
|
+
// If it is not set initially, the browser will throw an error. This will set it if it is not set yet.
|
127
|
+
this.fileProgressWrapper.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + this.opacity + ")";
|
128
|
+
}
|
129
|
+
} else {
|
130
|
+
this.fileProgressWrapper.style.opacity = this.opacity / 100;
|
131
|
+
}
|
132
|
+
}
|
133
|
+
|
134
|
+
if (this.height > 0) {
|
135
|
+
this.height -= reduceHeightBy;
|
136
|
+
if (this.height < 0) {
|
137
|
+
this.height = 0;
|
138
|
+
}
|
139
|
+
|
140
|
+
this.fileProgressWrapper.style.height = this.height + "px";
|
141
|
+
}
|
142
|
+
|
143
|
+
if (this.height > 0 || this.opacity > 0) {
|
144
|
+
var oSelf = this;
|
145
|
+
setTimeout(function () {
|
146
|
+
oSelf.disappear();
|
147
|
+
}, rate);
|
148
|
+
} else {
|
149
|
+
this.fileProgressWrapper.style.display = "none";
|
150
|
+
}
|
151
|
+
};
|
@@ -0,0 +1,201 @@
|
|
1
|
+
function swfUploadPreLoad() {
|
2
|
+
var self = this;
|
3
|
+
var loading = function () {
|
4
|
+
jQuery('.swf_loading_content').show();
|
5
|
+
var longLoad = function () {
|
6
|
+
jQuery('.swf_loading_content').hide();
|
7
|
+
jQuery('.swf_long_loading').show();
|
8
|
+
};
|
9
|
+
this.customSettings.loadingTimeout = setTimeout(function() {
|
10
|
+
longLoad.call(self)
|
11
|
+
},
|
12
|
+
15 * 1000
|
13
|
+
);
|
14
|
+
};
|
15
|
+
|
16
|
+
this.customSettings.loadingTimeout = setTimeout(function() {
|
17
|
+
loading.call(self);
|
18
|
+
},
|
19
|
+
1*1000
|
20
|
+
);
|
21
|
+
}
|
22
|
+
|
23
|
+
function swfUploadLoaded() {
|
24
|
+
var self = this;
|
25
|
+
clearTimeout(this.customSettings.loadingTimeout);
|
26
|
+
jQuery('.swf_loading_content').hide();
|
27
|
+
jQuery('.swf_long_loading').hide();
|
28
|
+
jQuery('.swf_alternate_content').hide();
|
29
|
+
jQuery(".swf_cancel_button").click(function(){ self.cancelQueue(); });
|
30
|
+
}
|
31
|
+
|
32
|
+
function swfUploadLoadFailed() {
|
33
|
+
clearTimeout(this.customSettings.loadingTimeout);
|
34
|
+
jQuery('.degraded_container').show();
|
35
|
+
jQuery('.swfupload_container').hide();
|
36
|
+
}
|
37
|
+
|
38
|
+
function fileQueued(file) {
|
39
|
+
try {
|
40
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
41
|
+
progress.setStatus("Pending...");
|
42
|
+
progress.toggleCancel(true, this);
|
43
|
+
} catch (ex) {
|
44
|
+
this.debug(ex);
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
function fileQueueError(file, errorCode, message) {
|
49
|
+
try {
|
50
|
+
if (errorCode === SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED) {
|
51
|
+
alert("You have attempted to queue too many files.\n" + (message === 0 ? "You have reached the upload limit." : "You may select " + (message > 1 ? "up to " + message + " files." : "one file.")));
|
52
|
+
return;
|
53
|
+
}
|
54
|
+
|
55
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
56
|
+
progress.setError();
|
57
|
+
progress.toggleCancel(false);
|
58
|
+
|
59
|
+
switch (errorCode) {
|
60
|
+
case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:
|
61
|
+
progress.setStatus("File is too big.");
|
62
|
+
this.debug("Error Code: File too big, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
63
|
+
break;
|
64
|
+
case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:
|
65
|
+
progress.setStatus("Cannot upload Zero Byte files.");
|
66
|
+
this.debug("Error Code: Zero byte file, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
67
|
+
break;
|
68
|
+
case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:
|
69
|
+
progress.setStatus("Invalid File Type.");
|
70
|
+
this.debug("Error Code: Invalid File Type, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
71
|
+
break;
|
72
|
+
default:
|
73
|
+
if (file !== null) {
|
74
|
+
progress.setStatus("Unhandled Error");
|
75
|
+
}
|
76
|
+
this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
77
|
+
break;
|
78
|
+
}
|
79
|
+
} catch (ex) {
|
80
|
+
this.debug(ex);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
function fileDialogComplete(numFilesSelected, numFilesQueued) {
|
85
|
+
try {
|
86
|
+
if (numFilesSelected > 0) {
|
87
|
+
jQuery('#' + this.customSettings.cancelButtonId).show();
|
88
|
+
}
|
89
|
+
/* I want auto start the upload and I can do that here */
|
90
|
+
this.startUpload();
|
91
|
+
} catch (ex) {
|
92
|
+
this.debug(ex);
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
function uploadStart(file) {
|
97
|
+
try {
|
98
|
+
/* I don't want to do any file validation or anything, I'll just update the UI and
|
99
|
+
return true to indicate that the upload should start.
|
100
|
+
It's important to update the UI here because in Linux no uploadProgress events are called. The best
|
101
|
+
we can do is say we are uploading.
|
102
|
+
*/
|
103
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
104
|
+
progress.setStatus("Uploading...");
|
105
|
+
progress.toggleCancel(true, this);
|
106
|
+
}
|
107
|
+
catch (ex) {}
|
108
|
+
|
109
|
+
return true;
|
110
|
+
}
|
111
|
+
|
112
|
+
function uploadProgress(file, bytesLoaded, bytesTotal) {
|
113
|
+
try {
|
114
|
+
var percent = Math.ceil((bytesLoaded / bytesTotal) * 100);
|
115
|
+
|
116
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
117
|
+
progress.setProgress(percent);
|
118
|
+
progress.setStatus("Uploading...");
|
119
|
+
} catch (ex) {
|
120
|
+
this.debug(ex);
|
121
|
+
}
|
122
|
+
}
|
123
|
+
|
124
|
+
function uploadSuccess(file, serverData) {
|
125
|
+
try {
|
126
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
127
|
+
progress.setComplete();
|
128
|
+
progress.setStatus("Complete.");
|
129
|
+
progress.toggleCancel(false);
|
130
|
+
AddUpload(serverData);
|
131
|
+
} catch (ex) {
|
132
|
+
this.debug(ex);
|
133
|
+
}
|
134
|
+
}
|
135
|
+
|
136
|
+
function uploadError(file, errorCode, message) {
|
137
|
+
try {
|
138
|
+
var progress = new FileProgress(file, this.customSettings.progressTarget);
|
139
|
+
progress.setError();
|
140
|
+
progress.toggleCancel(false);
|
141
|
+
|
142
|
+
switch (errorCode) {
|
143
|
+
case SWFUpload.UPLOAD_ERROR.HTTP_ERROR:
|
144
|
+
progress.setStatus("Upload Error: " + message);
|
145
|
+
this.debug("Error Code: HTTP Error, File name: " + file.name + ", Message: " + message);
|
146
|
+
break;
|
147
|
+
case SWFUpload.UPLOAD_ERROR.UPLOAD_FAILED:
|
148
|
+
progress.setStatus("Upload Failed.");
|
149
|
+
this.debug("Error Code: Upload Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
150
|
+
break;
|
151
|
+
case SWFUpload.UPLOAD_ERROR.IO_ERROR:
|
152
|
+
progress.setStatus("Server (IO) Error");
|
153
|
+
this.debug("Error Code: IO Error, File name: " + file.name + ", Message: " + message);
|
154
|
+
break;
|
155
|
+
case SWFUpload.UPLOAD_ERROR.SECURITY_ERROR:
|
156
|
+
progress.setStatus("Security Error");
|
157
|
+
this.debug("Error Code: Security Error, File name: " + file.name + ", Message: " + message);
|
158
|
+
break;
|
159
|
+
case SWFUpload.UPLOAD_ERROR.UPLOAD_LIMIT_EXCEEDED:
|
160
|
+
progress.setStatus("Upload limit exceeded.");
|
161
|
+
this.debug("Error Code: Upload Limit Exceeded, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
162
|
+
break;
|
163
|
+
case SWFUpload.UPLOAD_ERROR.FILE_VALIDATION_FAILED:
|
164
|
+
progress.setStatus("Failed Validation. Upload skipped.");
|
165
|
+
this.debug("Error Code: File Validation Failed, File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
166
|
+
break;
|
167
|
+
case SWFUpload.UPLOAD_ERROR.FILE_CANCELLED:
|
168
|
+
// If there aren't any files left (they were all cancelled) disable the cancel button
|
169
|
+
if (this.getStats().files_queued === 0) {
|
170
|
+
document.getElementById(this.customSettings.cancelButtonId).disabled = true;
|
171
|
+
}
|
172
|
+
progress.setStatus("Cancelled");
|
173
|
+
progress.setCancelled();
|
174
|
+
break;
|
175
|
+
case SWFUpload.UPLOAD_ERROR.UPLOAD_STOPPED:
|
176
|
+
progress.setStatus("Stopped");
|
177
|
+
break;
|
178
|
+
default:
|
179
|
+
progress.setStatus("Unhandled Error: " + errorCode);
|
180
|
+
this.debug("Error Code: " + errorCode + ", File name: " + file.name + ", File size: " + file.size + ", Message: " + message);
|
181
|
+
break;
|
182
|
+
}
|
183
|
+
} catch (ex) {
|
184
|
+
this.debug(ex);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
|
188
|
+
function uploadComplete(file) {
|
189
|
+
if (this.getStats().files_queued === 0) {
|
190
|
+
jQuery('#' + this.customSettings.cancelButtonId).hide();
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
// This event comes from the Queue Plugin
|
195
|
+
function queueComplete(numFilesUploaded) {
|
196
|
+
//this.customSettings.progressTarget
|
197
|
+
}
|
198
|
+
|
199
|
+
function AddUpload(data) {
|
200
|
+
upload_completed_callback(data);
|
201
|
+
}
|