muck-users 3.2.12 → 3.2.13
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +6 -0
- data/Rakefile +1 -5
- data/VERSION +1 -1
- data/app/controllers/muck/users_controller.rb +84 -11
- data/lib/muck-users/config.rb +2 -0
- data/muck-users.gemspec +9 -666
- metadata +18 -677
- data/test/app/controllers/application_controller.rb +0 -15
- data/test/app/controllers/default_controller.rb +0 -7
- data/test/app/helpers/application_helper.rb +0 -3
- data/test/app/mailers/user_mailer.rb +0 -3
- data/test/app/models/access_code.rb +0 -3
- data/test/app/models/access_code_request.rb +0 -3
- data/test/app/models/country.rb +0 -13
- data/test/app/models/language.rb +0 -15
- data/test/app/models/state.rb +0 -13
- data/test/app/models/user.rb +0 -52
- data/test/app/models/user_session.rb +0 -2
- data/test/app/views/default/index.html.erb +0 -0
- data/test/app/views/layouts/application.html.erb +0 -14
- data/test/config/application.rb +0 -42
- data/test/config/assets.yml +0 -34
- data/test/config/boot.rb +0 -13
- data/test/config/database.yml +0 -15
- data/test/config/environment.rb +0 -5
- data/test/config/environments/development.rb +0 -26
- data/test/config/environments/production.rb +0 -49
- data/test/config/environments/test.rb +0 -35
- data/test/config/initializers/backtrace_silencers.rb +0 -7
- data/test/config/initializers/inflections.rb +0 -10
- data/test/config/initializers/mime_types.rb +0 -5
- data/test/config/initializers/muck.rb +0 -60
- data/test/config/initializers/secret_token.rb +0 -7
- data/test/config/initializers/session_store.rb +0 -8
- data/test/config/locales/en.yml +0 -5
- data/test/config/routes.rb +0 -4
- data/test/db/migrate/20090320174818_create_muck_permissions_and_roles.rb +0 -16
- data/test/db/migrate/20090327231918_create_users.rb +0 -40
- data/test/db/migrate/20090402234137_create_languages.rb +0 -18
- data/test/db/migrate/20090426041056_create_countries.rb +0 -15
- data/test/db/migrate/20090426041103_create_states.rb +0 -18
- data/test/db/migrate/20100123035450_create_access_codes.rb +0 -19
- data/test/db/migrate/20100123233654_create_access_code_requests.rb +0 -14
- data/test/db/migrate/20101117172951_add_name_to_access_code_requests.rb +0 -9
- data/test/db/migrate/20110303183433_add_sent_to_to_access_codes.rb +0 -9
- data/test/db/migrate/20110420153714_add_provided_by_to_access_codes.rb +0 -9
- data/test/db/schema.rb +0 -115
- data/test/db/seeds.rb +0 -7
- data/test/features/step_definitions/web_steps.rb +0 -219
- data/test/features/support/custom_env.rb +0 -19
- data/test/features/support/env.rb +0 -58
- data/test/features/support/paths.rb +0 -33
- data/test/lib/tasks/cucumber.rake +0 -53
- data/test/log/production.log +0 -0
- data/test/log/server.log +0 -0
- data/test/public/404.html +0 -30
- data/test/public/422.html +0 -30
- data/test/public/500.html +0 -30
- data/test/public/dispatch.rb +0 -10
- data/test/public/favicon.ico +0 -0
- data/test/public/images/admin/Home.gif +0 -0
- data/test/public/images/admin/roles.gif +0 -0
- data/test/public/images/admin/source/Home.png +0 -0
- data/test/public/images/admin/source/User.png +0 -0
- data/test/public/images/admin/source/roles.png +0 -0
- data/test/public/images/admin/user.gif +0 -0
- data/test/public/images/arrow_down.gif +0 -0
- data/test/public/images/arrow_left.gif +0 -0
- data/test/public/images/arrow_right.gif +0 -0
- data/test/public/images/arrow_up.gif +0 -0
- data/test/public/images/blue/preview.gif +0 -0
- data/test/public/images/fancybox/blank.gif +0 -0
- data/test/public/images/fancybox/fancy_close.png +0 -0
- data/test/public/images/fancybox/fancy_closebox.png +0 -0
- data/test/public/images/fancybox/fancy_left.png +0 -0
- data/test/public/images/fancybox/fancy_loading.png +0 -0
- data/test/public/images/fancybox/fancy_nav_left.png +0 -0
- data/test/public/images/fancybox/fancy_nav_right.png +0 -0
- data/test/public/images/fancybox/fancy_progress.png +0 -0
- data/test/public/images/fancybox/fancy_right.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_e.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_n.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_ne.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_nw.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_s.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_se.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_sw.png +0 -0
- data/test/public/images/fancybox/fancy_shadow_w.png +0 -0
- data/test/public/images/fancybox/fancy_title_left.png +0 -0
- data/test/public/images/fancybox/fancy_title_main.png +0 -0
- data/test/public/images/fancybox/fancy_title_over.png +0 -0
- data/test/public/images/fancybox/fancy_title_right.png +0 -0
- data/test/public/images/fancybox/fancybox-x.png +0 -0
- data/test/public/images/fancybox/fancybox-y.png +0 -0
- data/test/public/images/fancybox/fancybox.png +0 -0
- data/test/public/images/icon_no.gif +0 -0
- data/test/public/images/icon_success.gif +0 -0
- data/test/public/images/icons/accept.png +0 -0
- data/test/public/images/icons/add.png +0 -0
- data/test/public/images/icons/blue_guy.png +0 -0
- data/test/public/images/icons/button_background.png +0 -0
- data/test/public/images/icons/cancel.png +0 -0
- data/test/public/images/icons/close.png +0 -0
- data/test/public/images/icons/comment.png +0 -0
- data/test/public/images/icons/delete.png +0 -0
- data/test/public/images/icons/exclaim.png +0 -0
- data/test/public/images/icons/external.png +0 -0
- data/test/public/images/icons/feed.png +0 -0
- data/test/public/images/icons/grey_guy.png +0 -0
- data/test/public/images/icons/hide.png +0 -0
- data/test/public/images/icons/information.png +0 -0
- data/test/public/images/icons/minus.png +0 -0
- data/test/public/images/icons/pending.png +0 -0
- data/test/public/images/icons/question.png +0 -0
- data/test/public/images/icons/search_box.png +0 -0
- data/test/public/images/icons/star.png +0 -0
- data/test/public/images/icons/stop.png +0 -0
- data/test/public/images/icons/thumb_down.png +0 -0
- data/test/public/images/icons/thumb_up.png +0 -0
- data/test/public/images/icons/vote.png +0 -0
- data/test/public/images/loading-spinner.gif +0 -0
- data/test/public/images/loading.gif +0 -0
- data/test/public/images/nothing.png +0 -0
- data/test/public/images/profile_default.jpg +0 -0
- data/test/public/images/rails.png +0 -0
- data/test/public/images/red/preview.gif +0 -0
- data/test/public/images/service_icons/16/amazon.png +0 -0
- data/test/public/images/service_icons/16/ask.png +0 -0
- data/test/public/images/service_icons/16/bibsonomy.png +0 -0
- data/test/public/images/service_icons/16/bing.png +0 -0
- data/test/public/images/service_icons/16/blogger.png +0 -0
- data/test/public/images/service_icons/16/bloglines.png +0 -0
- data/test/public/images/service_icons/16/citeulike.png +0 -0
- data/test/public/images/service_icons/16/clipmarks.png +0 -0
- data/test/public/images/service_icons/16/connotea.png +0 -0
- data/test/public/images/service_icons/16/dailymotion.png +0 -0
- data/test/public/images/service_icons/16/delicious.png +0 -0
- data/test/public/images/service_icons/16/digg.png +0 -0
- data/test/public/images/service_icons/16/diigo.png +0 -0
- data/test/public/images/service_icons/16/facebook.png +0 -0
- data/test/public/images/service_icons/16/feed.png +0 -0
- data/test/public/images/service_icons/16/fireeagle.png +0 -0
- data/test/public/images/service_icons/16/flickr.png +0 -0
- data/test/public/images/service_icons/16/fotolog.png +0 -0
- data/test/public/images/service_icons/16/friendfeed.png +0 -0
- data/test/public/images/service_icons/16/friendster.png +0 -0
- data/test/public/images/service_icons/16/furl.png +0 -0
- data/test/public/images/service_icons/16/goodreads.png +0 -0
- data/test/public/images/service_icons/16/google.png +0 -0
- data/test/public/images/service_icons/16/googleblog.png +0 -0
- data/test/public/images/service_icons/16/googlenews.png +0 -0
- data/test/public/images/service_icons/16/icerocket.png +0 -0
- data/test/public/images/service_icons/16/identica.png +0 -0
- data/test/public/images/service_icons/16/joost.png +0 -0
- data/test/public/images/service_icons/16/lastfm.png +0 -0
- data/test/public/images/service_icons/16/librarything.png +0 -0
- data/test/public/images/service_icons/16/linkedin.png +0 -0
- data/test/public/images/service_icons/16/livejournal.png +0 -0
- data/test/public/images/service_icons/16/magnolia.png +0 -0
- data/test/public/images/service_icons/16/mendeley.png +0 -0
- data/test/public/images/service_icons/16/metacafe.png +0 -0
- data/test/public/images/service_icons/16/mixx.png +0 -0
- data/test/public/images/service_icons/16/myspace.png +0 -0
- data/test/public/images/service_icons/16/netflix.png +0 -0
- data/test/public/images/service_icons/16/netvibes.png +0 -0
- data/test/public/images/service_icons/16/newsvine.png +0 -0
- data/test/public/images/service_icons/16/oai.png +0 -0
- data/test/public/images/service_icons/16/odeo.png +0 -0
- data/test/public/images/service_icons/16/opml.png +0 -0
- data/test/public/images/service_icons/16/pandora.png +0 -0
- data/test/public/images/service_icons/16/photobucket.png +0 -0
- data/test/public/images/service_icons/16/picasa.png +0 -0
- data/test/public/images/service_icons/16/polyvore.png +0 -0
- data/test/public/images/service_icons/16/pownce.png +0 -0
- data/test/public/images/service_icons/16/reddit.png +0 -0
- data/test/public/images/service_icons/16/simpy.png +0 -0
- data/test/public/images/service_icons/16/smugmug.png +0 -0
- data/test/public/images/service_icons/16/stumbleupon.png +0 -0
- data/test/public/images/service_icons/16/tag.png +0 -0
- data/test/public/images/service_icons/16/technorati.png +0 -0
- data/test/public/images/service_icons/16/tumblr.png +0 -0
- data/test/public/images/service_icons/16/twine.png +0 -0
- data/test/public/images/service_icons/16/twitter.png +0 -0
- data/test/public/images/service_icons/16/vimeo.png +0 -0
- data/test/public/images/service_icons/16/webshots.png +0 -0
- data/test/public/images/service_icons/16/wordpress.png +0 -0
- data/test/public/images/service_icons/16/xanga.png +0 -0
- data/test/public/images/service_icons/16/yahoo.png +0 -0
- data/test/public/images/service_icons/16/yelp.png +0 -0
- data/test/public/images/service_icons/16/youtube.png +0 -0
- data/test/public/images/service_icons/16/zooomr.png +0 -0
- data/test/public/images/service_icons/16/zotero.png +0 -0
- data/test/public/images/service_icons/24/amazon.png +0 -0
- data/test/public/images/service_icons/24/ask.png +0 -0
- data/test/public/images/service_icons/24/bibsonomy.png +0 -0
- data/test/public/images/service_icons/24/bing.png +0 -0
- data/test/public/images/service_icons/24/blogger.png +0 -0
- data/test/public/images/service_icons/24/bloglines.png +0 -0
- data/test/public/images/service_icons/24/citeulike.png +0 -0
- data/test/public/images/service_icons/24/clipmarks.png +0 -0
- data/test/public/images/service_icons/24/connotea.png +0 -0
- data/test/public/images/service_icons/24/dailymotion.png +0 -0
- data/test/public/images/service_icons/24/delicious.png +0 -0
- data/test/public/images/service_icons/24/digg.png +0 -0
- data/test/public/images/service_icons/24/diigo.png +0 -0
- data/test/public/images/service_icons/24/facebook.png +0 -0
- data/test/public/images/service_icons/24/feed.png +0 -0
- data/test/public/images/service_icons/24/fireeagle.png +0 -0
- data/test/public/images/service_icons/24/flickr.png +0 -0
- data/test/public/images/service_icons/24/fotolog.png +0 -0
- data/test/public/images/service_icons/24/friendfeed.png +0 -0
- data/test/public/images/service_icons/24/friendster.png +0 -0
- data/test/public/images/service_icons/24/furl.png +0 -0
- data/test/public/images/service_icons/24/goodreads.png +0 -0
- data/test/public/images/service_icons/24/google.png +0 -0
- data/test/public/images/service_icons/24/googleblog.png +0 -0
- data/test/public/images/service_icons/24/googlenews.png +0 -0
- data/test/public/images/service_icons/24/icerocket.png +0 -0
- data/test/public/images/service_icons/24/identica.png +0 -0
- data/test/public/images/service_icons/24/joost.png +0 -0
- data/test/public/images/service_icons/24/lastfm.png +0 -0
- data/test/public/images/service_icons/24/librarything.png +0 -0
- data/test/public/images/service_icons/24/linkedin.png +0 -0
- data/test/public/images/service_icons/24/livejournal.png +0 -0
- data/test/public/images/service_icons/24/magnolia.png +0 -0
- data/test/public/images/service_icons/24/mendeley.png +0 -0
- data/test/public/images/service_icons/24/metacafe.png +0 -0
- data/test/public/images/service_icons/24/mixx.png +0 -0
- data/test/public/images/service_icons/24/myspace.png +0 -0
- data/test/public/images/service_icons/24/netflix.png +0 -0
- data/test/public/images/service_icons/24/netvibes.png +0 -0
- data/test/public/images/service_icons/24/newsvine.png +0 -0
- data/test/public/images/service_icons/24/oai.png +0 -0
- data/test/public/images/service_icons/24/odeo.png +0 -0
- data/test/public/images/service_icons/24/opml.png +0 -0
- data/test/public/images/service_icons/24/pandora.png +0 -0
- data/test/public/images/service_icons/24/photobucket.png +0 -0
- data/test/public/images/service_icons/24/picasa.png +0 -0
- data/test/public/images/service_icons/24/polyvore.png +0 -0
- data/test/public/images/service_icons/24/pownce.png +0 -0
- data/test/public/images/service_icons/24/reddit.png +0 -0
- data/test/public/images/service_icons/24/simpy.png +0 -0
- data/test/public/images/service_icons/24/smugmug.png +0 -0
- data/test/public/images/service_icons/24/stumbleupon.png +0 -0
- data/test/public/images/service_icons/24/tag.png +0 -0
- data/test/public/images/service_icons/24/technorati.png +0 -0
- data/test/public/images/service_icons/24/tumblr.png +0 -0
- data/test/public/images/service_icons/24/twine.png +0 -0
- data/test/public/images/service_icons/24/twitter.png +0 -0
- data/test/public/images/service_icons/24/vimeo.png +0 -0
- data/test/public/images/service_icons/24/webshots.png +0 -0
- data/test/public/images/service_icons/24/wordpress.png +0 -0
- data/test/public/images/service_icons/24/xanga.png +0 -0
- data/test/public/images/service_icons/24/yahoo.png +0 -0
- data/test/public/images/service_icons/24/yelp.png +0 -0
- data/test/public/images/service_icons/24/youtube.png +0 -0
- data/test/public/images/service_icons/24/zooomr.png +0 -0
- data/test/public/images/service_icons/24/zotero.png +0 -0
- data/test/public/images/service_icons/48/amazon.png +0 -0
- data/test/public/images/service_icons/48/ask.png +0 -0
- data/test/public/images/service_icons/48/bibsonomy.png +0 -0
- data/test/public/images/service_icons/48/bing.png +0 -0
- data/test/public/images/service_icons/48/blogger.png +0 -0
- data/test/public/images/service_icons/48/bloglines.png +0 -0
- data/test/public/images/service_icons/48/citeulike.png +0 -0
- data/test/public/images/service_icons/48/clipmarks.png +0 -0
- data/test/public/images/service_icons/48/connotea.png +0 -0
- data/test/public/images/service_icons/48/dailymotion.png +0 -0
- data/test/public/images/service_icons/48/delicious.png +0 -0
- data/test/public/images/service_icons/48/digg.png +0 -0
- data/test/public/images/service_icons/48/diigo.png +0 -0
- data/test/public/images/service_icons/48/facebook.png +0 -0
- data/test/public/images/service_icons/48/feed.png +0 -0
- data/test/public/images/service_icons/48/fireeagle.png +0 -0
- data/test/public/images/service_icons/48/flickr.png +0 -0
- data/test/public/images/service_icons/48/fotolog.png +0 -0
- data/test/public/images/service_icons/48/friendfeed.png +0 -0
- data/test/public/images/service_icons/48/friendster.png +0 -0
- data/test/public/images/service_icons/48/furl.png +0 -0
- data/test/public/images/service_icons/48/goodreads.png +0 -0
- data/test/public/images/service_icons/48/google.png +0 -0
- data/test/public/images/service_icons/48/googleblog.png +0 -0
- data/test/public/images/service_icons/48/googlenews.png +0 -0
- data/test/public/images/service_icons/48/icerocket.png +0 -0
- data/test/public/images/service_icons/48/identica.png +0 -0
- data/test/public/images/service_icons/48/joost.png +0 -0
- data/test/public/images/service_icons/48/lastfm.png +0 -0
- data/test/public/images/service_icons/48/librarything.png +0 -0
- data/test/public/images/service_icons/48/linkedin.png +0 -0
- data/test/public/images/service_icons/48/livejournal.png +0 -0
- data/test/public/images/service_icons/48/magnolia.png +0 -0
- data/test/public/images/service_icons/48/mendeley.png +0 -0
- data/test/public/images/service_icons/48/metacafe.png +0 -0
- data/test/public/images/service_icons/48/mixx.png +0 -0
- data/test/public/images/service_icons/48/myspace.png +0 -0
- data/test/public/images/service_icons/48/netflix.png +0 -0
- data/test/public/images/service_icons/48/netvibes.png +0 -0
- data/test/public/images/service_icons/48/newsvine.png +0 -0
- data/test/public/images/service_icons/48/oai.png +0 -0
- data/test/public/images/service_icons/48/odeo.png +0 -0
- data/test/public/images/service_icons/48/opml.png +0 -0
- data/test/public/images/service_icons/48/pandora.png +0 -0
- data/test/public/images/service_icons/48/photobucket.png +0 -0
- data/test/public/images/service_icons/48/picasa.png +0 -0
- data/test/public/images/service_icons/48/polyvore.png +0 -0
- data/test/public/images/service_icons/48/pownce.png +0 -0
- data/test/public/images/service_icons/48/reddit.png +0 -0
- data/test/public/images/service_icons/48/simpy.png +0 -0
- data/test/public/images/service_icons/48/smugmug.png +0 -0
- data/test/public/images/service_icons/48/stumbleupon.png +0 -0
- data/test/public/images/service_icons/48/tag.png +0 -0
- data/test/public/images/service_icons/48/technorati.png +0 -0
- data/test/public/images/service_icons/48/tumblr.png +0 -0
- data/test/public/images/service_icons/48/twine.png +0 -0
- data/test/public/images/service_icons/48/twitter.png +0 -0
- data/test/public/images/service_icons/48/vimeo.png +0 -0
- data/test/public/images/service_icons/48/webshots.png +0 -0
- data/test/public/images/service_icons/48/wordpress.png +0 -0
- data/test/public/images/service_icons/48/xanga.png +0 -0
- data/test/public/images/service_icons/48/yahoo.png +0 -0
- data/test/public/images/service_icons/48/yelp.png +0 -0
- data/test/public/images/service_icons/48/youtube.png +0 -0
- data/test/public/images/service_icons/48/zooomr.png +0 -0
- data/test/public/images/service_icons/48/zotero.png +0 -0
- data/test/public/images/service_icons/60/amazon.png +0 -0
- data/test/public/images/service_icons/60/ask.png +0 -0
- data/test/public/images/service_icons/60/bibsonomy.png +0 -0
- data/test/public/images/service_icons/60/bing.png +0 -0
- data/test/public/images/service_icons/60/blogger.png +0 -0
- data/test/public/images/service_icons/60/bloglines.png +0 -0
- data/test/public/images/service_icons/60/citeulike.png +0 -0
- data/test/public/images/service_icons/60/clipmarks.png +0 -0
- data/test/public/images/service_icons/60/connotea.png +0 -0
- data/test/public/images/service_icons/60/dailymotion.png +0 -0
- data/test/public/images/service_icons/60/delicious.png +0 -0
- data/test/public/images/service_icons/60/digg.png +0 -0
- data/test/public/images/service_icons/60/diigo.png +0 -0
- data/test/public/images/service_icons/60/facebook.png +0 -0
- data/test/public/images/service_icons/60/feed.png +0 -0
- data/test/public/images/service_icons/60/fireeagle.png +0 -0
- data/test/public/images/service_icons/60/flickr.png +0 -0
- data/test/public/images/service_icons/60/fotolog.png +0 -0
- data/test/public/images/service_icons/60/friendfeed.png +0 -0
- data/test/public/images/service_icons/60/friendster.png +0 -0
- data/test/public/images/service_icons/60/furl.png +0 -0
- data/test/public/images/service_icons/60/goodreads.png +0 -0
- data/test/public/images/service_icons/60/google.png +0 -0
- data/test/public/images/service_icons/60/googleblog.png +0 -0
- data/test/public/images/service_icons/60/googlenews.png +0 -0
- data/test/public/images/service_icons/60/icerocket.png +0 -0
- data/test/public/images/service_icons/60/identica.png +0 -0
- data/test/public/images/service_icons/60/joost.png +0 -0
- data/test/public/images/service_icons/60/lastfm.png +0 -0
- data/test/public/images/service_icons/60/librarything.png +0 -0
- data/test/public/images/service_icons/60/linkedin.png +0 -0
- data/test/public/images/service_icons/60/livejournal.png +0 -0
- data/test/public/images/service_icons/60/magnolia.png +0 -0
- data/test/public/images/service_icons/60/mendeley.png +0 -0
- data/test/public/images/service_icons/60/metacafe.png +0 -0
- data/test/public/images/service_icons/60/mixx.png +0 -0
- data/test/public/images/service_icons/60/myspace.png +0 -0
- data/test/public/images/service_icons/60/netflix.png +0 -0
- data/test/public/images/service_icons/60/netvibes.png +0 -0
- data/test/public/images/service_icons/60/newsvine.png +0 -0
- data/test/public/images/service_icons/60/oai.png +0 -0
- data/test/public/images/service_icons/60/odeo.png +0 -0
- data/test/public/images/service_icons/60/opml.png +0 -0
- data/test/public/images/service_icons/60/pandora.png +0 -0
- data/test/public/images/service_icons/60/photobucket.png +0 -0
- data/test/public/images/service_icons/60/picasa.png +0 -0
- data/test/public/images/service_icons/60/polyvore.png +0 -0
- data/test/public/images/service_icons/60/pownce.png +0 -0
- data/test/public/images/service_icons/60/reddit.png +0 -0
- data/test/public/images/service_icons/60/simpy.png +0 -0
- data/test/public/images/service_icons/60/smugmug.png +0 -0
- data/test/public/images/service_icons/60/stumbleupon.png +0 -0
- data/test/public/images/service_icons/60/tag.png +0 -0
- data/test/public/images/service_icons/60/technorati.png +0 -0
- data/test/public/images/service_icons/60/tumblr.png +0 -0
- data/test/public/images/service_icons/60/twine.png +0 -0
- data/test/public/images/service_icons/60/twitter.png +0 -0
- data/test/public/images/service_icons/60/vimeo.png +0 -0
- data/test/public/images/service_icons/60/webshots.png +0 -0
- data/test/public/images/service_icons/60/wordpress.png +0 -0
- data/test/public/images/service_icons/60/xanga.png +0 -0
- data/test/public/images/service_icons/60/yahoo.png +0 -0
- data/test/public/images/service_icons/60/yelp.png +0 -0
- data/test/public/images/service_icons/60/youtube.png +0 -0
- data/test/public/images/service_icons/60/zooomr.png +0 -0
- data/test/public/images/service_icons/60/zotero.png +0 -0
- data/test/public/images/service_icons/facebook_friend_links.jpg +0 -0
- data/test/public/images/service_icons/facebook_my_links.jpg +0 -0
- data/test/public/images/service_icons/source/Aquaticus_Social_Icon_template_by_jwloh.psd +0 -0
- data/test/public/images/service_icons/source/Google.psd +0 -0
- data/test/public/images/service_icons/source/Quake 9 Design.webloc b/data/test/public/images/service_icons/source/Quake 9 → Design.webloc +0 -0
- data/test/public/images/service_icons/source/ReadMe.rtf +0 -52
- data/test/public/images/service_icons/source/amazon.png +0 -0
- data/test/public/images/service_icons/source/aquaticus.social.png +0 -0
- data/test/public/images/service_icons/source/ask.png +0 -0
- data/test/public/images/service_icons/source/ask.psd +0 -0
- data/test/public/images/service_icons/source/bibsonomy.png +0 -0
- data/test/public/images/service_icons/source/bibsonomy.psd +0 -0
- data/test/public/images/service_icons/source/bing.png +0 -0
- data/test/public/images/service_icons/source/bing.psd +0 -0
- data/test/public/images/service_icons/source/blogger.png +0 -0
- data/test/public/images/service_icons/source/bloglines.png +0 -0
- data/test/public/images/service_icons/source/bloglines.psd +0 -0
- data/test/public/images/service_icons/source/citeulike.png +0 -0
- data/test/public/images/service_icons/source/clipmarks.png +0 -0
- data/test/public/images/service_icons/source/connotea.png +0 -0
- data/test/public/images/service_icons/source/connotea.psd +0 -0
- data/test/public/images/service_icons/source/dailymotion.png +0 -0
- data/test/public/images/service_icons/source/delicious.png +0 -0
- data/test/public/images/service_icons/source/digg.png +0 -0
- data/test/public/images/service_icons/source/diigo.png +0 -0
- data/test/public/images/service_icons/source/facebook.png +0 -0
- data/test/public/images/service_icons/source/feed.png +0 -0
- data/test/public/images/service_icons/source/fireeagle.psd +0 -0
- data/test/public/images/service_icons/source/flickr.png +0 -0
- data/test/public/images/service_icons/source/fotolog.png +0 -0
- data/test/public/images/service_icons/source/friendfeed.png +0 -0
- data/test/public/images/service_icons/source/friendster.png +0 -0
- data/test/public/images/service_icons/source/furl.png +0 -0
- data/test/public/images/service_icons/source/goodreads.png +0 -0
- data/test/public/images/service_icons/source/google.png +0 -0
- data/test/public/images/service_icons/source/googleblog.png +0 -0
- data/test/public/images/service_icons/source/googlenews.png +0 -0
- data/test/public/images/service_icons/source/icerocket.png +0 -0
- data/test/public/images/service_icons/source/icerocket.psd +0 -0
- data/test/public/images/service_icons/source/identica.png +0 -0
- data/test/public/images/service_icons/source/joost.png +0 -0
- data/test/public/images/service_icons/source/lastfm.png +0 -0
- data/test/public/images/service_icons/source/librarything.png +0 -0
- data/test/public/images/service_icons/source/linkedin.png +0 -0
- data/test/public/images/service_icons/source/livejournal.png +0 -0
- data/test/public/images/service_icons/source/magnolia.png +0 -0
- data/test/public/images/service_icons/source/mendeley.png +0 -0
- data/test/public/images/service_icons/source/metacafe.png +0 -0
- data/test/public/images/service_icons/source/metacafe.psd +0 -0
- data/test/public/images/service_icons/source/mixx.png +0 -0
- data/test/public/images/service_icons/source/myspace.png +0 -0
- data/test/public/images/service_icons/source/netflix.png +0 -0
- data/test/public/images/service_icons/source/netvibes.png +0 -0
- data/test/public/images/service_icons/source/newsvine.png +0 -0
- data/test/public/images/service_icons/source/oai.png +0 -0
- data/test/public/images/service_icons/source/odeo.png +0 -0
- data/test/public/images/service_icons/source/opml.png +0 -0
- data/test/public/images/service_icons/source/pandora.png +0 -0
- data/test/public/images/service_icons/source/photobucket.png +0 -0
- data/test/public/images/service_icons/source/picasa.png +0 -0
- data/test/public/images/service_icons/source/polyvore.png +0 -0
- data/test/public/images/service_icons/source/posterous.psd +0 -0
- data/test/public/images/service_icons/source/pownce.png +0 -0
- data/test/public/images/service_icons/source/reddit.png +0 -0
- data/test/public/images/service_icons/source/simpy.png +0 -0
- data/test/public/images/service_icons/source/smugmug.png +0 -0
- data/test/public/images/service_icons/source/stumbleupon.png +0 -0
- data/test/public/images/service_icons/source/tag.png +0 -0
- data/test/public/images/service_icons/source/technorati.png +0 -0
- data/test/public/images/service_icons/source/template.png +0 -0
- data/test/public/images/service_icons/source/tumblr.png +0 -0
- data/test/public/images/service_icons/source/twine.png +0 -0
- data/test/public/images/service_icons/source/twine.psd +0 -0
- data/test/public/images/service_icons/source/twitter.png +0 -0
- data/test/public/images/service_icons/source/vimeo.png +0 -0
- data/test/public/images/service_icons/source/webshots.png +0 -0
- data/test/public/images/service_icons/source/wordpress.png +0 -0
- data/test/public/images/service_icons/source/xanga.png +0 -0
- data/test/public/images/service_icons/source/yahoo.png +0 -0
- data/test/public/images/service_icons/source/yelp.png +0 -0
- data/test/public/images/service_icons/source/youtube.png +0 -0
- data/test/public/images/service_icons/source/zooomr.png +0 -0
- data/test/public/images/service_icons/source/zotero.png +0 -0
- data/test/public/images/spinner.gif +0 -0
- data/test/public/images/sprites.png +0 -0
- data/test/public/javascripts/application.js +0 -2
- data/test/public/javascripts/builder.js +0 -136
- data/test/public/javascripts/controls.js +0 -963
- data/test/public/javascripts/dragdrop.js +0 -972
- data/test/public/javascripts/effects.js +0 -1120
- data/test/public/javascripts/fancyzoom.min.js +0 -1
- data/test/public/javascripts/jquery/colorpicker.js +0 -450
- data/test/public/javascripts/jquery/jquery-1.5.1.js +0 -8316
- data/test/public/javascripts/jquery/jquery-ui-1.8.11.custom.js +0 -11577
- data/test/public/javascripts/jquery/jquery-ui-1.8.4.custom.min.js +0 -763
- data/test/public/javascripts/jquery/jquery-ui.js +0 -781
- data/test/public/javascripts/jquery/jquery.autocomplete.js.readme +0 -6
- data/test/public/javascripts/jquery/jquery.autocomplete.min.js +0 -15
- data/test/public/javascripts/jquery/jquery.autocomplete.pack.js +0 -767
- data/test/public/javascripts/jquery/jquery.cookie.js +0 -96
- data/test/public/javascripts/jquery/jquery.easing.js +0 -46
- data/test/public/javascripts/jquery/jquery.fancybox.js +0 -46
- data/test/public/javascripts/jquery/jquery.form.js +0 -675
- data/test/public/javascripts/jquery/jquery.jgrowl.js +0 -9
- data/test/public/javascripts/jquery/jquery.js +0 -154
- data/test/public/javascripts/jquery/jquery.metadata.min.js +0 -13
- data/test/public/javascripts/jquery/jquery.mousewheel.js +0 -13
- data/test/public/javascripts/jquery/jquery.queryString.js +0 -33
- data/test/public/javascripts/jquery/jquery.swapimage.js +0 -66
- data/test/public/javascripts/jquery/jquery.swapimage.min.js +0 -11
- data/test/public/javascripts/jquery/jquery.timers.js +0 -138
- data/test/public/javascripts/jquery/jquery.tips.js +0 -75
- data/test/public/javascripts/jquery/jrails.js +0 -1
- data/test/public/javascripts/muck-countries.js +0 -50
- data/test/public/javascripts/muck-src.js +0 -147
- data/test/public/javascripts/muck-users.js +0 -20
- data/test/public/javascripts/muck.js +0 -149
- data/test/public/javascripts/muck_activities.js +0 -100
- data/test/public/javascripts/muck_admin.js +0 -0
- data/test/public/javascripts/muck_countries.js +0 -50
- data/test/public/javascripts/muck_time/en.js +0 -53
- data/test/public/javascripts/prototype.js +0 -4225
- data/test/public/javascripts/rails.js +0 -175
- data/test/public/javascripts/scriptaculous.js +0 -58
- data/test/public/javascripts/slider.js +0 -277
- data/test/public/javascripts/sound.js +0 -60
- data/test/public/javascripts/tree.js +0 -107
- data/test/public/robots.txt +0 -1
- data/test/public/stylesheets/admin.css +0 -75
- data/test/public/stylesheets/application.css +0 -0
- data/test/public/stylesheets/blueprint/ie.css +0 -26
- data/test/public/stylesheets/blueprint/liquid_screen.css +0 -203
- data/test/public/stylesheets/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/buttons/icons/key.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/buttons/readme.txt +0 -32
- data/test/public/stylesheets/blueprint/plugins/buttons/screen.css +0 -97
- data/test/public/stylesheets/blueprint/plugins/fancy-type/readme.txt +0 -14
- data/test/public/stylesheets/blueprint/plugins/fancy-type/screen.css +0 -71
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/test/public/stylesheets/blueprint/plugins/link-icons/readme.txt +0 -18
- data/test/public/stylesheets/blueprint/plugins/link-icons/screen.css +0 -40
- data/test/public/stylesheets/blueprint/plugins/liquid/liquid.css +0 -134
- data/test/public/stylesheets/blueprint/plugins/liquid/src/liquid.css +0 -197
- data/test/public/stylesheets/blueprint/plugins/rtl/readme.txt +0 -10
- data/test/public/stylesheets/blueprint/plugins/rtl/screen.css +0 -109
- data/test/public/stylesheets/blueprint/print.css +0 -30
- data/test/public/stylesheets/blueprint/screen.css +0 -251
- data/test/public/stylesheets/blueprint/sprite.css +0 -1
- data/test/public/stylesheets/blueprint/src/forms.css +0 -49
- data/test/public/stylesheets/blueprint/src/grid.css +0 -213
- data/test/public/stylesheets/blueprint/src/grid.png +0 -0
- data/test/public/stylesheets/blueprint/src/ie.css +0 -59
- data/test/public/stylesheets/blueprint/src/print.css +0 -85
- data/test/public/stylesheets/blueprint/src/reset.css +0 -38
- data/test/public/stylesheets/blueprint/src/typography.css +0 -105
- data/test/public/stylesheets/default.css +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/test/public/stylesheets/flick/images/ui-icons_0073ea_256x240.png +0 -0
- data/test/public/stylesheets/flick/images/ui-icons_454545_256x240.png +0 -0
- data/test/public/stylesheets/flick/images/ui-icons_666666_256x240.png +0 -0
- data/test/public/stylesheets/flick/images/ui-icons_ff0084_256x240.png +0 -0
- data/test/public/stylesheets/flick/images/ui-icons_ffffff_256x240.png +0 -0
- data/test/public/stylesheets/flick/jquery-ui-1.8.1.custom.css +0 -486
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-small_0_aaaaaa_40x40.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_diagonals-thick_15_444444_40x40.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_glass_100_f0f0f0_1x400.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_glass_50_99c2ff_1x400.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_glass_55_fbf5d0_1x400.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_glass_80_e6e6e6_1x400.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-hard_100_f9f9f9_1x100.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-bg_highlight-soft_100_e7eef3_1x100.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_222222_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_2694e8_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_72a7cf_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_888888_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/images/ui-icons_ffffff_256x240.png +0 -0
- data/test/public/stylesheets/jquery/cupertino/jquery-ui-1.7.1.custom.css +0 -404
- data/test/public/stylesheets/jquery/cupertino/jquery-ui-1.7.2.custom.css +0 -160
- data/test/public/stylesheets/jquery/jquery.autocomplete.css +0 -15
- data/test/public/stylesheets/jquery/jquery.fancybox.css +0 -77
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_217bc0_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_469bdd_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_6da8d5_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_d8e7f3_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/images/ui-icons_f9bd01_256x240.png +0 -0
- data/test/public/stylesheets/jquery/redmond/jquery-ui-1.7.1.custom.css +0 -404
- data/test/public/stylesheets/jquery/redmond/jquery-ui-1.7.2.custom.css +0 -160
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/test/public/stylesheets/jquery/smoothness/jquery-ui-1.7.1.custom.css +0 -404
- data/test/public/stylesheets/jquery/smoothness/jquery-ui-1.7.2.custom.css +0 -160
- data/test/public/stylesheets/jquery/smoothness/jquery-ui-1.8.11.custom.css +0 -573
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
- data/test/public/stylesheets/jquery/ui-lightness/jquery-ui-1.7.1.custom.css +0 -404
- data/test/public/stylesheets/jquery/ui-lightness/jquery-ui-1.7.2.custom.css +0 -160
- data/test/public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.11.custom.css +0 -573
- data/test/public/stylesheets/jquery/ui-lightness/jquery-ui-1.8.4.custom.css +0 -572
- data/test/public/stylesheets/muck-users.css +0 -10
- data/test/public/stylesheets/reset.css +0 -0
- data/test/public/stylesheets/styles.css +0 -98
- data/test/public/stylesheets/themes/blue/styles.css +0 -1
- data/test/public/stylesheets/themes/red/styles.css +0 -1
- data/test/script/rails +0 -6
- data/test/spec/controllers/access_code_requests_controller_spec.rb +0 -62
- data/test/spec/controllers/activations_controller_spec.rb +0 -69
- data/test/spec/controllers/admin/access_code_requests_controller_spec.rb +0 -128
- data/test/spec/controllers/admin/access_codes_controller_spec.rb +0 -189
- data/test/spec/controllers/admin/roles_controller_spec.rb +0 -84
- data/test/spec/controllers/admin/users_controller_spec.rb +0 -245
- data/test/spec/controllers/password_resets_controller_spec.rb +0 -65
- data/test/spec/controllers/user_sessions_controller_spec.rb +0 -122
- data/test/spec/controllers/username_request_controller_spec.rb +0 -35
- data/test/spec/controllers/users_controller_spec.rb +0 -427
- data/test/spec/helpers/muck_users_helper_spec.rb +0 -70
- data/test/spec/mailers/user_mailer_spec.rb +0 -108
- data/test/spec/models/access_code_request_spec.rb +0 -105
- data/test/spec/models/access_code_spec.rb +0 -117
- data/test/spec/models/permission_spec.rb +0 -19
- data/test/spec/models/role_spec.rb +0 -18
- data/test/spec/models/secure_methods_spec.rb +0 -56
- data/test/spec/models/user_spec.rb +0 -433
- data/test/spec/spec_helper.rb +0 -5
- data/test/test/fixtures/rails.png +0 -0
@@ -1,6 +0,0 @@
|
|
1
|
-
NOTE: the jquery.autocomplete.pack.js file has been modified. Specifically line
|
2
|
-
314 was changed from
|
3
|
-
if ( data && data.length && hasFocus ) {
|
4
|
-
to
|
5
|
-
if ( data && data.length ) {
|
6
|
-
For some reason the hasFocus value was always 0 which prevented the autocomplete from ever showing up.
|
@@ -1,15 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Autocomplete - jQuery plugin 1.0.2
|
3
|
-
*
|
4
|
-
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
|
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.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
|
11
|
-
*
|
12
|
-
*/;(function($){$.fn.extend({autocomplete:function(urlOrData,options){var isUrl=typeof urlOrData=="string";options=$.extend({},$.Autocompleter.defaults,{url:isUrl?urlOrData:null,data:isUrl?null:urlOrData,delay:isUrl?$.Autocompleter.defaults.delay:10,max:options&&!options.scroll?10:150},options);options.highlight=options.highlight||function(value){return value;};options.formatMatch=options.formatMatch||options.formatItem;return this.each(function(){new $.Autocompleter(this,options);});},result:function(handler){return this.bind("result",handler);},search:function(handler){return this.trigger("search",[handler]);},flushCache:function(){return this.trigger("flushCache");},setOptions:function(options){return this.trigger("setOptions",[options]);},unautocomplete:function(){return this.trigger("unautocomplete");}});$.Autocompleter=function(input,options){var KEY={UP:38,DOWN:40,DEL:46,TAB:9,RETURN:13,ESC:27,COMMA:188,PAGEUP:33,PAGEDOWN:34,BACKSPACE:8};var $input=$(input).attr("autocomplete","off").addClass(options.inputClass);var timeout;var previousValue="";var cache=$.Autocompleter.Cache(options);var hasFocus=0;var lastKeyPressCode;var config={mouseDownOnSelect:false};var select=$.Autocompleter.Select(options,input,selectCurrent,config);var blockSubmit;$.browser.opera&&$(input.form).bind("submit.autocomplete",function(){if(blockSubmit){blockSubmit=false;return false;}});$input.bind(($.browser.opera?"keypress":"keydown")+".autocomplete",function(event){lastKeyPressCode=event.keyCode;switch(event.keyCode){case KEY.UP:event.preventDefault();if(select.visible()){select.prev();}else{onChange(0,true);}break;case KEY.DOWN:event.preventDefault();if(select.visible()){select.next();}else{onChange(0,true);}break;case KEY.PAGEUP:event.preventDefault();if(select.visible()){select.pageUp();}else{onChange(0,true);}break;case KEY.PAGEDOWN:event.preventDefault();if(select.visible()){select.pageDown();}else{onChange(0,true);}break;case options.multiple&&$.trim(options.multipleSeparator)==","&&KEY.COMMA:case KEY.TAB:case KEY.RETURN:if(selectCurrent()){event.preventDefault();blockSubmit=true;return false;}break;case KEY.ESC:select.hide();break;default:clearTimeout(timeout);timeout=setTimeout(onChange,options.delay);break;}}).focus(function(){hasFocus++;}).blur(function(){hasFocus=0;if(!config.mouseDownOnSelect){hideResults();}}).click(function(){if(hasFocus++>1&&!select.visible()){onChange(0,true);}}).bind("search",function(){var fn=(arguments.length>1)?arguments[1]:null;function findValueCallback(q,data){var result;if(data&&data.length){for(var i=0;i<data.length;i++){if(data[i].result.toLowerCase()==q.toLowerCase()){result=data[i];break;}}}if(typeof fn=="function")fn(result);else $input.trigger("result",result&&[result.data,result.value]);}$.each(trimWords($input.val()),function(i,value){request(value,findValueCallback,findValueCallback);});}).bind("flushCache",function(){cache.flush();}).bind("setOptions",function(){$.extend(options,arguments[1]);if("data"in arguments[1])cache.populate();}).bind("unautocomplete",function(){select.unbind();$input.unbind();$(input.form).unbind(".autocomplete");});function selectCurrent(){var selected=select.selected();if(!selected)return false;var v=selected.result;previousValue=v;if(options.multiple){var words=trimWords($input.val());if(words.length>1){v=words.slice(0,words.length-1).join(options.multipleSeparator)+options.multipleSeparator+v;}v+=options.multipleSeparator;}$input.val(v);hideResultsNow();$input.trigger("result",[selected.data,selected.value]);return true;}function onChange(crap,skipPrevCheck){if(lastKeyPressCode==KEY.DEL){select.hide();return;}var currentValue=$input.val();if(!skipPrevCheck&¤tValue==previousValue)return;previousValue=currentValue;currentValue=lastWord(currentValue);if(currentValue.length>=options.minChars){$input.addClass(options.loadingClass);if(!options.matchCase)currentValue=currentValue.toLowerCase();request(currentValue,receiveData,hideResultsNow);}else{stopLoading();select.hide();}};function trimWords(value){if(!value){return[""];}var words=value.split(options.multipleSeparator);var result=[];$.each(words,function(i,value){if($.trim(value))result[i]=$.trim(value);});return result;}function lastWord(value){if(!options.multiple)return value;var words=trimWords(value);return words[words.length-1];}function autoFill(q,sValue){if(options.autoFill&&(lastWord($input.val()).toLowerCase()==q.toLowerCase())&&lastKeyPressCode!=KEY.BACKSPACE){$input.val($input.val()+sValue.substring(lastWord(previousValue).length));$.Autocompleter.Selection(input,previousValue.length,previousValue.length+sValue.length);}};function hideResults(){clearTimeout(timeout);timeout=setTimeout(hideResultsNow,200);};function hideResultsNow(){var wasVisible=select.visible();select.hide();clearTimeout(timeout);stopLoading();if(options.mustMatch){$input.search(function(result){if(!result){if(options.multiple){var words=trimWords($input.val()).slice(0,-1);$input.val(words.join(options.multipleSeparator)+(words.length?options.multipleSeparator:""));}else
|
13
|
-
$input.val("");}});}if(wasVisible)$.Autocompleter.Selection(input,input.value.length,input.value.length);};function receiveData(q,data){if(data&&data.length&&hasFocus){stopLoading();select.display(data,q);autoFill(q,data[0].value);select.show();}else{hideResultsNow();}};function request(term,success,failure){if(!options.matchCase)term=term.toLowerCase();var data=cache.load(term);if(data&&data.length){success(term,data);}else if((typeof options.url=="string")&&(options.url.length>0)){var extraParams={timestamp:+new Date()};$.each(options.extraParams,function(key,param){extraParams[key]=typeof param=="function"?param():param;});$.ajax({mode:"abort",port:"autocomplete"+input.name,dataType:options.dataType,url:options.url,data:$.extend({q:lastWord(term),limit:options.max},extraParams),success:function(data){var parsed=options.parse&&options.parse(data)||parse(data);cache.add(term,parsed);success(term,parsed);}});}else{select.emptyList();failure(term);}};function parse(data){var parsed=[];var rows=data.split("\n");for(var i=0;i<rows.length;i++){var row=$.trim(rows[i]);if(row){row=row.split("|");parsed[parsed.length]={data:row,value:row[0],result:options.formatResult&&options.formatResult(row,row[0])||row[0]};}}return parsed;};function stopLoading(){$input.removeClass(options.loadingClass);};};$.Autocompleter.defaults={inputClass:"ac_input",resultsClass:"ac_results",loadingClass:"ac_loading",minChars:1,delay:400,matchCase:false,matchSubset:true,matchContains:false,cacheLength:10,max:100,mustMatch:false,extraParams:{},selectFirst:true,formatItem:function(row){return row[0];},formatMatch:null,autoFill:false,width:0,multiple:false,multipleSeparator:", ",highlight:function(value,term){return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"),"<strong>$1</strong>");},scroll:true,scrollHeight:180};$.Autocompleter.Cache=function(options){var data={};var length=0;function matchSubset(s,sub){if(!options.matchCase)s=s.toLowerCase();var i=s.indexOf(sub);if(i==-1)return false;return i==0||options.matchContains;};function add(q,value){if(length>options.cacheLength){flush();}if(!data[q]){length++;}data[q]=value;}function populate(){if(!options.data)return false;var stMatchSets={},nullData=0;if(!options.url)options.cacheLength=1;stMatchSets[""]=[];for(var i=0,ol=options.data.length;i<ol;i++){var rawValue=options.data[i];rawValue=(typeof rawValue=="string")?[rawValue]:rawValue;var value=options.formatMatch(rawValue,i+1,options.data.length);if(value===false)continue;var firstChar=value.charAt(0).toLowerCase();if(!stMatchSets[firstChar])stMatchSets[firstChar]=[];var row={value:value,data:rawValue,result:options.formatResult&&options.formatResult(rawValue)||value};stMatchSets[firstChar].push(row);if(nullData++<options.max){stMatchSets[""].push(row);}};$.each(stMatchSets,function(i,value){options.cacheLength++;add(i,value);});}setTimeout(populate,25);function flush(){data={};length=0;}return{flush:flush,add:add,populate:populate,load:function(q){if(!options.cacheLength||!length)return null;if(!options.url&&options.matchContains){var csub=[];for(var k in data){if(k.length>0){var c=data[k];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub.push(x);}});}}return csub;}else
|
14
|
-
if(data[q]){return data[q];}else
|
15
|
-
if(options.matchSubset){for(var i=q.length-1;i>=options.minChars;i--){var c=data[q.substr(0,i)];if(c){var csub=[];$.each(c,function(i,x){if(matchSubset(x.value,q)){csub[csub.length]=x;}});return csub;}}}return null;}};};$.Autocompleter.Select=function(options,input,select,config){var CLASSES={ACTIVE:"ac_over"};var listItems,active=-1,data,term="",needsInit=true,element,list;function init(){if(!needsInit)return;element=$("<div/>").hide().addClass(options.resultsClass).css("position","absolute").appendTo(document.body);list=$("<ul/>").appendTo(element).mouseover(function(event){if(target(event).nodeName&&target(event).nodeName.toUpperCase()=='LI'){active=$("li",list).removeClass(CLASSES.ACTIVE).index(target(event));$(target(event)).addClass(CLASSES.ACTIVE);}}).click(function(event){$(target(event)).addClass(CLASSES.ACTIVE);select();input.focus();return false;}).mousedown(function(){config.mouseDownOnSelect=true;}).mouseup(function(){config.mouseDownOnSelect=false;});if(options.width>0)element.css("width",options.width);needsInit=false;}function target(event){var element=event.target;while(element&&element.tagName!="LI")element=element.parentNode;if(!element)return[];return element;}function moveSelect(step){listItems.slice(active,active+1).removeClass(CLASSES.ACTIVE);movePosition(step);var activeItem=listItems.slice(active,active+1).addClass(CLASSES.ACTIVE);if(options.scroll){var offset=0;listItems.slice(0,active).each(function(){offset+=this.offsetHeight;});if((offset+activeItem[0].offsetHeight-list.scrollTop())>list[0].clientHeight){list.scrollTop(offset+activeItem[0].offsetHeight-list.innerHeight());}else if(offset<list.scrollTop()){list.scrollTop(offset);}}};function movePosition(step){active+=step;if(active<0){active=listItems.size()-1;}else if(active>=listItems.size()){active=0;}}function limitNumberOfItems(available){return options.max&&options.max<available?options.max:available;}function fillList(){list.empty();var max=limitNumberOfItems(data.length);for(var i=0;i<max;i++){if(!data[i])continue;var formatted=options.formatItem(data[i].data,i+1,max,data[i].value,term);if(formatted===false)continue;var li=$("<li/>").html(options.highlight(formatted,term)).addClass(i%2==0?"ac_even":"ac_odd").appendTo(list)[0];$.data(li,"ac_data",data[i]);}listItems=list.find("li");if(options.selectFirst){listItems.slice(0,1).addClass(CLASSES.ACTIVE);active=0;}if($.fn.bgiframe)list.bgiframe();}return{display:function(d,q){init();data=d;term=q;fillList();},next:function(){moveSelect(1);},prev:function(){moveSelect(-1);},pageUp:function(){if(active!=0&&active-8<0){moveSelect(-active);}else{moveSelect(-8);}},pageDown:function(){if(active!=listItems.size()-1&&active+8>listItems.size()){moveSelect(listItems.size()-1-active);}else{moveSelect(8);}},hide:function(){element&&element.hide();listItems&&listItems.removeClass(CLASSES.ACTIVE);active=-1;},visible:function(){return element&&element.is(":visible");},current:function(){return this.visible()&&(listItems.filter("."+CLASSES.ACTIVE)[0]||options.selectFirst&&listItems[0]);},show:function(){var offset=$(input).offset();element.css({width:typeof options.width=="string"||options.width>0?options.width:$(input).width(),top:offset.top+input.offsetHeight,left:offset.left}).show();if(options.scroll){list.scrollTop(0);list.css({maxHeight:options.scrollHeight,overflow:'auto'});if($.browser.msie&&typeof document.body.style.maxHeight==="undefined"){var listHeight=0;listItems.each(function(){listHeight+=this.offsetHeight;});var scrollbarsVisible=listHeight>options.scrollHeight;list.css('height',scrollbarsVisible?options.scrollHeight:listHeight);if(!scrollbarsVisible){listItems.width(list.width()-parseInt(listItems.css("padding-left"))-parseInt(listItems.css("padding-right")));}}}},selected:function(){var selected=listItems&&listItems.filter("."+CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);return selected&&selected.length&&$.data(selected[0],"ac_data");},emptyList:function(){list&&list.empty();},unbind:function(){element&&element.remove();}};};$.Autocompleter.Selection=function(field,start,end){if(field.createTextRange){var selRange=field.createTextRange();selRange.collapse(true);selRange.moveStart("character",start);selRange.moveEnd("character",end);selRange.select();}else if(field.setSelectionRange){field.setSelectionRange(start,end);}else{if(field.selectionStart){field.selectionStart=start;field.selectionEnd=end;}}field.focus();};})(jQuery);
|
@@ -1,767 +0,0 @@
|
|
1
|
-
/**********************************************************************************************
|
2
|
-
* NOTE: this version is modified from the original to work with luvfoo. Specifically line
|
3
|
-
* 314 was changed from
|
4
|
-
* if ( data && data.length && hasFocus ) {
|
5
|
-
* to
|
6
|
-
* if ( data && data.length ) {
|
7
|
-
* For some reason the hasFocus value was always 0 which prevented the autocomplete from ever showing up.
|
8
|
-
**********************************************************************************************
|
9
|
-
*
|
10
|
-
* Autocomplete - jQuery plugin 1.0.2
|
11
|
-
*
|
12
|
-
* Copyright (c) 2007 Dylan Verheul, Dan G. Switzer, Anjesh Tuladhar, Jörn Zaefferer
|
13
|
-
*
|
14
|
-
* Dual licensed under the MIT and GPL licenses:
|
15
|
-
* http://www.opensource.org/licenses/mit-license.php
|
16
|
-
* http://www.gnu.org/licenses/gpl.html
|
17
|
-
*
|
18
|
-
* Revision: $Id: jquery.autocomplete.js 5747 2008-06-25 18:30:55Z joern.zaefferer $
|
19
|
-
*
|
20
|
-
*/
|
21
|
-
|
22
|
-
;(function($) {
|
23
|
-
|
24
|
-
$.fn.extend({
|
25
|
-
autocomplete: function(urlOrData, options) {
|
26
|
-
var isUrl = typeof urlOrData == "string";
|
27
|
-
options = $.extend({}, $.Autocompleter.defaults, {
|
28
|
-
url: isUrl ? urlOrData : null,
|
29
|
-
data: isUrl ? null : urlOrData,
|
30
|
-
delay: isUrl ? $.Autocompleter.defaults.delay : 10,
|
31
|
-
max: options && !options.scroll ? 10 : 150
|
32
|
-
}, options);
|
33
|
-
|
34
|
-
// if highlight is set to false, replace it with a do-nothing function
|
35
|
-
options.highlight = options.highlight || function(value) { return value; };
|
36
|
-
|
37
|
-
// if the formatMatch option is not specified, then use formatItem for backwards compatibility
|
38
|
-
options.formatMatch = options.formatMatch || options.formatItem;
|
39
|
-
|
40
|
-
return this.each(function() {
|
41
|
-
new $.Autocompleter(this, options);
|
42
|
-
});
|
43
|
-
},
|
44
|
-
result: function(handler) {
|
45
|
-
return this.bind("result", handler);
|
46
|
-
},
|
47
|
-
search: function(handler) {
|
48
|
-
return this.trigger("search", [handler]);
|
49
|
-
},
|
50
|
-
flushCache: function() {
|
51
|
-
return this.trigger("flushCache");
|
52
|
-
},
|
53
|
-
setOptions: function(options){
|
54
|
-
return this.trigger("setOptions", [options]);
|
55
|
-
},
|
56
|
-
unautocomplete: function() {
|
57
|
-
return this.trigger("unautocomplete");
|
58
|
-
}
|
59
|
-
});
|
60
|
-
|
61
|
-
$.Autocompleter = function(input, options) {
|
62
|
-
|
63
|
-
var KEY = {
|
64
|
-
UP: 38,
|
65
|
-
DOWN: 40,
|
66
|
-
DEL: 46,
|
67
|
-
TAB: 9,
|
68
|
-
RETURN: 13,
|
69
|
-
ESC: 27,
|
70
|
-
COMMA: 188,
|
71
|
-
PAGEUP: 33,
|
72
|
-
PAGEDOWN: 34,
|
73
|
-
BACKSPACE: 8
|
74
|
-
};
|
75
|
-
|
76
|
-
// Create $ object for input element
|
77
|
-
var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
|
78
|
-
|
79
|
-
var timeout;
|
80
|
-
var previousValue = "";
|
81
|
-
var cache = $.Autocompleter.Cache(options);
|
82
|
-
var hasFocus = 0;
|
83
|
-
var lastKeyPressCode;
|
84
|
-
var config = {
|
85
|
-
mouseDownOnSelect: false
|
86
|
-
};
|
87
|
-
var select = $.Autocompleter.Select(options, input, selectCurrent, config);
|
88
|
-
|
89
|
-
var blockSubmit;
|
90
|
-
|
91
|
-
// prevent form submit in opera when selecting with return key
|
92
|
-
$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
|
93
|
-
if (blockSubmit) {
|
94
|
-
blockSubmit = false;
|
95
|
-
return false;
|
96
|
-
}
|
97
|
-
});
|
98
|
-
|
99
|
-
// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
|
100
|
-
$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
|
101
|
-
// track last key pressed
|
102
|
-
lastKeyPressCode = event.keyCode;
|
103
|
-
switch(event.keyCode) {
|
104
|
-
|
105
|
-
case KEY.UP:
|
106
|
-
event.preventDefault();
|
107
|
-
if ( select.visible() ) {
|
108
|
-
select.prev();
|
109
|
-
} else {
|
110
|
-
onChange(0, true);
|
111
|
-
}
|
112
|
-
break;
|
113
|
-
|
114
|
-
case KEY.DOWN:
|
115
|
-
event.preventDefault();
|
116
|
-
if ( select.visible() ) {
|
117
|
-
select.next();
|
118
|
-
} else {
|
119
|
-
onChange(0, true);
|
120
|
-
}
|
121
|
-
break;
|
122
|
-
|
123
|
-
case KEY.PAGEUP:
|
124
|
-
event.preventDefault();
|
125
|
-
if ( select.visible() ) {
|
126
|
-
select.pageUp();
|
127
|
-
} else {
|
128
|
-
onChange(0, true);
|
129
|
-
}
|
130
|
-
break;
|
131
|
-
|
132
|
-
case KEY.PAGEDOWN:
|
133
|
-
event.preventDefault();
|
134
|
-
if ( select.visible() ) {
|
135
|
-
select.pageDown();
|
136
|
-
} else {
|
137
|
-
onChange(0, true);
|
138
|
-
}
|
139
|
-
break;
|
140
|
-
|
141
|
-
// matches also semicolon
|
142
|
-
case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
|
143
|
-
case KEY.TAB:
|
144
|
-
case KEY.RETURN:
|
145
|
-
if( selectCurrent() ) {
|
146
|
-
// stop default to prevent a form submit, Opera needs special handling
|
147
|
-
event.preventDefault();
|
148
|
-
blockSubmit = true;
|
149
|
-
return false;
|
150
|
-
}
|
151
|
-
break;
|
152
|
-
|
153
|
-
case KEY.ESC:
|
154
|
-
select.hide();
|
155
|
-
break;
|
156
|
-
|
157
|
-
default:
|
158
|
-
clearTimeout(timeout);
|
159
|
-
timeout = setTimeout(onChange, options.delay);
|
160
|
-
break;
|
161
|
-
}
|
162
|
-
}).focus(function(){
|
163
|
-
// track whether the field has focus, we shouldn't process any
|
164
|
-
// results if the field no longer has focus
|
165
|
-
hasFocus++;
|
166
|
-
}).blur(function() {
|
167
|
-
hasFocus = 0;
|
168
|
-
if (!config.mouseDownOnSelect) {
|
169
|
-
hideResults();
|
170
|
-
}
|
171
|
-
}).click(function() {
|
172
|
-
// show select when clicking in a focused field
|
173
|
-
if ( hasFocus++ > 1 && !select.visible() ) {
|
174
|
-
onChange(0, true);
|
175
|
-
}
|
176
|
-
}).bind("search", function() {
|
177
|
-
// TODO why not just specifying both arguments?
|
178
|
-
var fn = (arguments.length > 1) ? arguments[1] : null;
|
179
|
-
function findValueCallback(q, data) {
|
180
|
-
var result;
|
181
|
-
if( data && data.length ) {
|
182
|
-
for (var i=0; i < data.length; i++) {
|
183
|
-
if( data[i].result.toLowerCase() == q.toLowerCase() ) {
|
184
|
-
result = data[i];
|
185
|
-
break;
|
186
|
-
}
|
187
|
-
}
|
188
|
-
}
|
189
|
-
if( typeof fn == "function" ) fn(result);
|
190
|
-
else $input.trigger("result", result && [result.data, result.value]);
|
191
|
-
}
|
192
|
-
$.each(trimWords($input.val()), function(i, value) {
|
193
|
-
request(value, findValueCallback, findValueCallback);
|
194
|
-
});
|
195
|
-
}).bind("flushCache", function() {
|
196
|
-
cache.flush();
|
197
|
-
}).bind("setOptions", function() {
|
198
|
-
$.extend(options, arguments[1]);
|
199
|
-
// if we've updated the data, repopulate
|
200
|
-
if ( "data" in arguments[1] )
|
201
|
-
cache.populate();
|
202
|
-
}).bind("unautocomplete", function() {
|
203
|
-
select.unbind();
|
204
|
-
$input.unbind();
|
205
|
-
$(input.form).unbind(".autocomplete");
|
206
|
-
});
|
207
|
-
|
208
|
-
|
209
|
-
function selectCurrent() {
|
210
|
-
var selected = select.selected();
|
211
|
-
if( !selected )
|
212
|
-
return false;
|
213
|
-
|
214
|
-
var v = selected.result;
|
215
|
-
previousValue = v;
|
216
|
-
|
217
|
-
if ( options.multiple ) {
|
218
|
-
var words = trimWords($input.val());
|
219
|
-
if ( words.length > 1 ) {
|
220
|
-
v = words.slice(0, words.length - 1).join( options.multipleSeparator ) + options.multipleSeparator + v;
|
221
|
-
}
|
222
|
-
v += options.multipleSeparator;
|
223
|
-
}
|
224
|
-
|
225
|
-
$input.val(v);
|
226
|
-
hideResultsNow();
|
227
|
-
$input.trigger("result", [selected.data, selected.value]);
|
228
|
-
return true;
|
229
|
-
}
|
230
|
-
|
231
|
-
function onChange(crap, skipPrevCheck) {
|
232
|
-
if( lastKeyPressCode == KEY.DEL ) {
|
233
|
-
select.hide();
|
234
|
-
return;
|
235
|
-
}
|
236
|
-
|
237
|
-
var currentValue = $input.val();
|
238
|
-
|
239
|
-
if ( !skipPrevCheck && currentValue == previousValue )
|
240
|
-
return;
|
241
|
-
|
242
|
-
previousValue = currentValue;
|
243
|
-
|
244
|
-
currentValue = lastWord(currentValue);
|
245
|
-
if ( currentValue.length >= options.minChars) {
|
246
|
-
$input.addClass(options.loadingClass);
|
247
|
-
if (!options.matchCase)
|
248
|
-
currentValue = currentValue.toLowerCase();
|
249
|
-
request(currentValue, receiveData, hideResultsNow);
|
250
|
-
} else {
|
251
|
-
stopLoading();
|
252
|
-
select.hide();
|
253
|
-
}
|
254
|
-
};
|
255
|
-
|
256
|
-
function trimWords(value) {
|
257
|
-
if ( !value ) {
|
258
|
-
return [""];
|
259
|
-
}
|
260
|
-
var words = value.split( options.multipleSeparator );
|
261
|
-
var result = [];
|
262
|
-
$.each(words, function(i, value) {
|
263
|
-
if ( $.trim(value) )
|
264
|
-
result[i] = $.trim(value);
|
265
|
-
});
|
266
|
-
return result;
|
267
|
-
}
|
268
|
-
|
269
|
-
function lastWord(value) {
|
270
|
-
if ( !options.multiple )
|
271
|
-
return value;
|
272
|
-
var words = trimWords(value);
|
273
|
-
return words[words.length - 1];
|
274
|
-
}
|
275
|
-
|
276
|
-
// fills in the input box w/the first match (assumed to be the best match)
|
277
|
-
// q: the term entered
|
278
|
-
// sValue: the first matching result
|
279
|
-
function autoFill(q, sValue){
|
280
|
-
// autofill in the complete box w/the first match as long as the user hasn't entered in more data
|
281
|
-
// if the last user key pressed was backspace, don't autofill
|
282
|
-
if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
|
283
|
-
// fill in the value (keep the case the user has typed)
|
284
|
-
$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
|
285
|
-
// select the portion of the value not typed by the user (so the next character will erase)
|
286
|
-
$.Autocompleter.Selection(input, previousValue.length, previousValue.length + sValue.length);
|
287
|
-
}
|
288
|
-
};
|
289
|
-
|
290
|
-
function hideResults() {
|
291
|
-
clearTimeout(timeout);
|
292
|
-
timeout = setTimeout(hideResultsNow, 200);
|
293
|
-
};
|
294
|
-
|
295
|
-
function hideResultsNow() {
|
296
|
-
var wasVisible = select.visible();
|
297
|
-
select.hide();
|
298
|
-
clearTimeout(timeout);
|
299
|
-
stopLoading();
|
300
|
-
if (options.mustMatch) {
|
301
|
-
// call search and run callback
|
302
|
-
$input.search(
|
303
|
-
function (result){
|
304
|
-
// if no value found, clear the input box
|
305
|
-
if( !result ) {
|
306
|
-
if (options.multiple) {
|
307
|
-
var words = trimWords($input.val()).slice(0, -1);
|
308
|
-
$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
|
309
|
-
}
|
310
|
-
else
|
311
|
-
$input.val( "" );
|
312
|
-
}
|
313
|
-
}
|
314
|
-
);
|
315
|
-
}
|
316
|
-
if (wasVisible)
|
317
|
-
// position cursor at end of input field
|
318
|
-
$.Autocompleter.Selection(input, input.value.length, input.value.length);
|
319
|
-
};
|
320
|
-
|
321
|
-
function receiveData(q, data) {
|
322
|
-
if ( data && data.length ) {
|
323
|
-
stopLoading();
|
324
|
-
select.display(data, q);
|
325
|
-
autoFill(q, data[0].value);
|
326
|
-
select.show();
|
327
|
-
} else {
|
328
|
-
hideResultsNow();
|
329
|
-
}
|
330
|
-
};
|
331
|
-
|
332
|
-
function request(term, success, failure) {
|
333
|
-
if (!options.matchCase)
|
334
|
-
term = term.toLowerCase();
|
335
|
-
var data = cache.load(term);
|
336
|
-
// recieve the cached data
|
337
|
-
if (data && data.length) {
|
338
|
-
success(term, data);
|
339
|
-
// if an AJAX url has been supplied, try loading the data now
|
340
|
-
} else if( (typeof options.url == "string") && (options.url.length > 0) ){
|
341
|
-
|
342
|
-
var extraParams = {
|
343
|
-
timestamp: +new Date()
|
344
|
-
};
|
345
|
-
$.each(options.extraParams, function(key, param) {
|
346
|
-
extraParams[key] = typeof param == "function" ? param() : param;
|
347
|
-
});
|
348
|
-
|
349
|
-
$.ajax({
|
350
|
-
// try to leverage ajaxQueue plugin to abort previous requests
|
351
|
-
mode: "abort",
|
352
|
-
// limit abortion to this input
|
353
|
-
port: "autocomplete" + input.name,
|
354
|
-
dataType: options.dataType,
|
355
|
-
url: options.url,
|
356
|
-
data: $.extend({
|
357
|
-
q: lastWord(term),
|
358
|
-
limit: options.max
|
359
|
-
}, extraParams),
|
360
|
-
success: function(data) {
|
361
|
-
var parsed = options.parse && options.parse(data) || parse(data);
|
362
|
-
cache.add(term, parsed);
|
363
|
-
success(term, parsed);
|
364
|
-
}
|
365
|
-
});
|
366
|
-
} else {
|
367
|
-
// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
|
368
|
-
select.emptyList();
|
369
|
-
failure(term);
|
370
|
-
}
|
371
|
-
};
|
372
|
-
|
373
|
-
function parse(data) {
|
374
|
-
var parsed = [];
|
375
|
-
var rows = data.split("\n");
|
376
|
-
for (var i=0; i < rows.length; i++) {
|
377
|
-
var row = $.trim(rows[i]);
|
378
|
-
if (row) {
|
379
|
-
row = row.split("|");
|
380
|
-
parsed[parsed.length] = {
|
381
|
-
data: row,
|
382
|
-
value: row[0],
|
383
|
-
result: options.formatResult && options.formatResult(row, row[0]) || row[0]
|
384
|
-
};
|
385
|
-
}
|
386
|
-
}
|
387
|
-
return parsed;
|
388
|
-
};
|
389
|
-
|
390
|
-
function stopLoading() {
|
391
|
-
$input.removeClass(options.loadingClass);
|
392
|
-
};
|
393
|
-
|
394
|
-
};
|
395
|
-
|
396
|
-
$.Autocompleter.defaults = {
|
397
|
-
inputClass: "ac_input",
|
398
|
-
resultsClass: "ac_results",
|
399
|
-
loadingClass: "ac_loading",
|
400
|
-
minChars: 1,
|
401
|
-
delay: 400,
|
402
|
-
matchCase: false,
|
403
|
-
matchSubset: true,
|
404
|
-
matchContains: false,
|
405
|
-
cacheLength: 10,
|
406
|
-
max: 100,
|
407
|
-
mustMatch: false,
|
408
|
-
extraParams: {},
|
409
|
-
selectFirst: true,
|
410
|
-
formatItem: function(row) { return row[0]; },
|
411
|
-
formatMatch: null,
|
412
|
-
autoFill: false,
|
413
|
-
width: 0,
|
414
|
-
multiple: false,
|
415
|
-
multipleSeparator: ", ",
|
416
|
-
highlight: function(value, term) {
|
417
|
-
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
|
418
|
-
},
|
419
|
-
scroll: true,
|
420
|
-
scrollHeight: 180
|
421
|
-
};
|
422
|
-
|
423
|
-
$.Autocompleter.Cache = function(options) {
|
424
|
-
|
425
|
-
var data = {};
|
426
|
-
var length = 0;
|
427
|
-
|
428
|
-
function matchSubset(s, sub) {
|
429
|
-
if (!options.matchCase)
|
430
|
-
s = s.toLowerCase();
|
431
|
-
var i = s.indexOf(sub);
|
432
|
-
if (i == -1) return false;
|
433
|
-
return i == 0 || options.matchContains;
|
434
|
-
};
|
435
|
-
|
436
|
-
function add(q, value) {
|
437
|
-
if (length > options.cacheLength){
|
438
|
-
flush();
|
439
|
-
}
|
440
|
-
if (!data[q]){
|
441
|
-
length++;
|
442
|
-
}
|
443
|
-
data[q] = value;
|
444
|
-
}
|
445
|
-
|
446
|
-
function populate(){
|
447
|
-
if( !options.data ) return false;
|
448
|
-
// track the matches
|
449
|
-
var stMatchSets = {},
|
450
|
-
nullData = 0;
|
451
|
-
|
452
|
-
// no url was specified, we need to adjust the cache length to make sure it fits the local data store
|
453
|
-
if( !options.url ) options.cacheLength = 1;
|
454
|
-
|
455
|
-
// track all options for minChars = 0
|
456
|
-
stMatchSets[""] = [];
|
457
|
-
|
458
|
-
// loop through the array and create a lookup structure
|
459
|
-
for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
|
460
|
-
var rawValue = options.data[i];
|
461
|
-
// if rawValue is a string, make an array otherwise just reference the array
|
462
|
-
rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
|
463
|
-
|
464
|
-
var value = options.formatMatch(rawValue, i+1, options.data.length);
|
465
|
-
if ( value === false )
|
466
|
-
continue;
|
467
|
-
|
468
|
-
var firstChar = value.charAt(0).toLowerCase();
|
469
|
-
// if no lookup array for this character exists, look it up now
|
470
|
-
if( !stMatchSets[firstChar] )
|
471
|
-
stMatchSets[firstChar] = [];
|
472
|
-
|
473
|
-
// if the match is a string
|
474
|
-
var row = {
|
475
|
-
value: value,
|
476
|
-
data: rawValue,
|
477
|
-
result: options.formatResult && options.formatResult(rawValue) || value
|
478
|
-
};
|
479
|
-
|
480
|
-
// push the current match into the set list
|
481
|
-
stMatchSets[firstChar].push(row);
|
482
|
-
|
483
|
-
// keep track of minChars zero items
|
484
|
-
if ( nullData++ < options.max ) {
|
485
|
-
stMatchSets[""].push(row);
|
486
|
-
}
|
487
|
-
};
|
488
|
-
|
489
|
-
// add the data items to the cache
|
490
|
-
$.each(stMatchSets, function(i, value) {
|
491
|
-
// increase the cache size
|
492
|
-
options.cacheLength++;
|
493
|
-
// add to the cache
|
494
|
-
add(i, value);
|
495
|
-
});
|
496
|
-
}
|
497
|
-
|
498
|
-
// populate any existing data
|
499
|
-
setTimeout(populate, 25);
|
500
|
-
|
501
|
-
function flush(){
|
502
|
-
data = {};
|
503
|
-
length = 0;
|
504
|
-
}
|
505
|
-
|
506
|
-
return {
|
507
|
-
flush: flush,
|
508
|
-
add: add,
|
509
|
-
populate: populate,
|
510
|
-
load: function(q) {
|
511
|
-
if (!options.cacheLength || !length)
|
512
|
-
return null;
|
513
|
-
/*
|
514
|
-
* if dealing w/local data and matchContains than we must make sure
|
515
|
-
* to loop through all the data collections looking for matches
|
516
|
-
*/
|
517
|
-
if( !options.url && options.matchContains ){
|
518
|
-
// track all matches
|
519
|
-
var csub = [];
|
520
|
-
// loop through all the data grids for matches
|
521
|
-
for( var k in data ){
|
522
|
-
// don't search through the stMatchSets[""] (minChars: 0) cache
|
523
|
-
// this prevents duplicates
|
524
|
-
if( k.length > 0 ){
|
525
|
-
var c = data[k];
|
526
|
-
$.each(c, function(i, x) {
|
527
|
-
// if we've got a match, add it to the array
|
528
|
-
if (matchSubset(x.value, q)) {
|
529
|
-
csub.push(x);
|
530
|
-
}
|
531
|
-
});
|
532
|
-
}
|
533
|
-
}
|
534
|
-
return csub;
|
535
|
-
} else
|
536
|
-
// if the exact item exists, use it
|
537
|
-
if (data[q]){
|
538
|
-
return data[q];
|
539
|
-
} else
|
540
|
-
if (options.matchSubset) {
|
541
|
-
for (var i = q.length - 1; i >= options.minChars; i--) {
|
542
|
-
var c = data[q.substr(0, i)];
|
543
|
-
if (c) {
|
544
|
-
var csub = [];
|
545
|
-
$.each(c, function(i, x) {
|
546
|
-
if (matchSubset(x.value, q)) {
|
547
|
-
csub[csub.length] = x;
|
548
|
-
}
|
549
|
-
});
|
550
|
-
return csub;
|
551
|
-
}
|
552
|
-
}
|
553
|
-
}
|
554
|
-
return null;
|
555
|
-
}
|
556
|
-
};
|
557
|
-
};
|
558
|
-
|
559
|
-
$.Autocompleter.Select = function (options, input, select, config) {
|
560
|
-
var CLASSES = {
|
561
|
-
ACTIVE: "ac_over"
|
562
|
-
};
|
563
|
-
|
564
|
-
var listItems,
|
565
|
-
active = -1,
|
566
|
-
data,
|
567
|
-
term = "",
|
568
|
-
needsInit = true,
|
569
|
-
element,
|
570
|
-
list;
|
571
|
-
|
572
|
-
// Create results
|
573
|
-
function init() {
|
574
|
-
if (!needsInit)
|
575
|
-
return;
|
576
|
-
element = $("<div/>")
|
577
|
-
.hide()
|
578
|
-
.addClass(options.resultsClass)
|
579
|
-
.css("position", "absolute")
|
580
|
-
.appendTo(document.body);
|
581
|
-
|
582
|
-
list = $("<ul/>").appendTo(element).mouseover( function(event) {
|
583
|
-
if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
|
584
|
-
active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
|
585
|
-
$(target(event)).addClass(CLASSES.ACTIVE);
|
586
|
-
}
|
587
|
-
}).click(function(event) {
|
588
|
-
$(target(event)).addClass(CLASSES.ACTIVE);
|
589
|
-
select();
|
590
|
-
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
|
591
|
-
input.focus();
|
592
|
-
return false;
|
593
|
-
}).mousedown(function() {
|
594
|
-
config.mouseDownOnSelect = true;
|
595
|
-
}).mouseup(function() {
|
596
|
-
config.mouseDownOnSelect = false;
|
597
|
-
});
|
598
|
-
|
599
|
-
if( options.width > 0 )
|
600
|
-
element.css("width", options.width);
|
601
|
-
|
602
|
-
needsInit = false;
|
603
|
-
}
|
604
|
-
|
605
|
-
function target(event) {
|
606
|
-
var element = event.target;
|
607
|
-
while(element && element.tagName != "LI")
|
608
|
-
element = element.parentNode;
|
609
|
-
// more fun with IE, sometimes event.target is empty, just ignore it then
|
610
|
-
if(!element)
|
611
|
-
return [];
|
612
|
-
return element;
|
613
|
-
}
|
614
|
-
|
615
|
-
function moveSelect(step) {
|
616
|
-
listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
|
617
|
-
movePosition(step);
|
618
|
-
var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
|
619
|
-
if(options.scroll) {
|
620
|
-
var offset = 0;
|
621
|
-
listItems.slice(0, active).each(function() {
|
622
|
-
offset += this.offsetHeight;
|
623
|
-
});
|
624
|
-
if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
|
625
|
-
list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
|
626
|
-
} else if(offset < list.scrollTop()) {
|
627
|
-
list.scrollTop(offset);
|
628
|
-
}
|
629
|
-
}
|
630
|
-
};
|
631
|
-
|
632
|
-
function movePosition(step) {
|
633
|
-
active += step;
|
634
|
-
if (active < 0) {
|
635
|
-
active = listItems.size() - 1;
|
636
|
-
} else if (active >= listItems.size()) {
|
637
|
-
active = 0;
|
638
|
-
}
|
639
|
-
}
|
640
|
-
|
641
|
-
function limitNumberOfItems(available) {
|
642
|
-
return options.max && options.max < available
|
643
|
-
? options.max
|
644
|
-
: available;
|
645
|
-
}
|
646
|
-
|
647
|
-
function fillList() {
|
648
|
-
list.empty();
|
649
|
-
var max = limitNumberOfItems(data.length);
|
650
|
-
for (var i=0; i < max; i++) {
|
651
|
-
if (!data[i])
|
652
|
-
continue;
|
653
|
-
var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
|
654
|
-
if ( formatted === false )
|
655
|
-
continue;
|
656
|
-
var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
|
657
|
-
$.data(li, "ac_data", data[i]);
|
658
|
-
}
|
659
|
-
listItems = list.find("li");
|
660
|
-
if ( options.selectFirst ) {
|
661
|
-
listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
|
662
|
-
active = 0;
|
663
|
-
}
|
664
|
-
// apply bgiframe if available
|
665
|
-
if ( $.fn.bgiframe )
|
666
|
-
list.bgiframe();
|
667
|
-
}
|
668
|
-
|
669
|
-
return {
|
670
|
-
display: function(d, q) {
|
671
|
-
init();
|
672
|
-
data = d;
|
673
|
-
term = q;
|
674
|
-
fillList();
|
675
|
-
},
|
676
|
-
next: function() {
|
677
|
-
moveSelect(1);
|
678
|
-
},
|
679
|
-
prev: function() {
|
680
|
-
moveSelect(-1);
|
681
|
-
},
|
682
|
-
pageUp: function() {
|
683
|
-
if (active != 0 && active - 8 < 0) {
|
684
|
-
moveSelect( -active );
|
685
|
-
} else {
|
686
|
-
moveSelect(-8);
|
687
|
-
}
|
688
|
-
},
|
689
|
-
pageDown: function() {
|
690
|
-
if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
|
691
|
-
moveSelect( listItems.size() - 1 - active );
|
692
|
-
} else {
|
693
|
-
moveSelect(8);
|
694
|
-
}
|
695
|
-
},
|
696
|
-
hide: function() {
|
697
|
-
element && element.hide();
|
698
|
-
listItems && listItems.removeClass(CLASSES.ACTIVE);
|
699
|
-
active = -1;
|
700
|
-
},
|
701
|
-
visible : function() {
|
702
|
-
return element && element.is(":visible");
|
703
|
-
},
|
704
|
-
current: function() {
|
705
|
-
return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
|
706
|
-
},
|
707
|
-
show: function() {
|
708
|
-
var offset = $(input).offset();
|
709
|
-
element.css({
|
710
|
-
width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
|
711
|
-
top: offset.top + input.offsetHeight,
|
712
|
-
left: offset.left
|
713
|
-
}).show();
|
714
|
-
if(options.scroll) {
|
715
|
-
list.scrollTop(0);
|
716
|
-
list.css({
|
717
|
-
maxHeight: options.scrollHeight,
|
718
|
-
overflow: 'auto'
|
719
|
-
});
|
720
|
-
|
721
|
-
if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
|
722
|
-
var listHeight = 0;
|
723
|
-
listItems.each(function() {
|
724
|
-
listHeight += this.offsetHeight;
|
725
|
-
});
|
726
|
-
var scrollbarsVisible = listHeight > options.scrollHeight;
|
727
|
-
list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
|
728
|
-
if (!scrollbarsVisible) {
|
729
|
-
// IE doesn't recalculate width when scrollbar disappears
|
730
|
-
listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
|
731
|
-
}
|
732
|
-
}
|
733
|
-
|
734
|
-
}
|
735
|
-
},
|
736
|
-
selected: function() {
|
737
|
-
var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
|
738
|
-
return selected && selected.length && $.data(selected[0], "ac_data");
|
739
|
-
},
|
740
|
-
emptyList: function (){
|
741
|
-
list && list.empty();
|
742
|
-
},
|
743
|
-
unbind: function() {
|
744
|
-
element && element.remove();
|
745
|
-
}
|
746
|
-
};
|
747
|
-
};
|
748
|
-
|
749
|
-
$.Autocompleter.Selection = function(field, start, end) {
|
750
|
-
if( field.createTextRange ){
|
751
|
-
var selRange = field.createTextRange();
|
752
|
-
selRange.collapse(true);
|
753
|
-
selRange.moveStart("character", start);
|
754
|
-
selRange.moveEnd("character", end);
|
755
|
-
selRange.select();
|
756
|
-
} else if( field.setSelectionRange ){
|
757
|
-
field.setSelectionRange(start, end);
|
758
|
-
} else {
|
759
|
-
if( field.selectionStart ){
|
760
|
-
field.selectionStart = start;
|
761
|
-
field.selectionEnd = end;
|
762
|
-
}
|
763
|
-
}
|
764
|
-
field.focus();
|
765
|
-
};
|
766
|
-
|
767
|
-
})(jQuery);
|