compass-jquery-plugin 0.3.0.beta.2 → 0.3.0.beta.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +2 -2
- data/VERSION.yml +1 -1
- data/compass-jquery-plugin.gemspec +309 -6
- data/gem_tasks/jqtouch.rake +73 -7
- data/gem_tasks/jrails13.rake +6 -6
- data/gem_tasks/jrails14.rake +6 -6
- data/lib/handle_js_files.rb +3 -2
- data/lib/jquery.ui.rb +1 -1
- data/templates/dynatree/jquery.ui/dynatree.aero.scss +4 -4
- data/templates/dynatree/jquery.ui/dynatree.aqua.scss +4 -4
- data/templates/dynatree/jquery.ui/dynatree.crystal.scss +4 -4
- data/templates/dynatree/jquery.ui/dynatree.xp.scss +4 -5
- data/templates/jqgrid/i18n/jqgrid/locale-cn.js +7 -3
- data/templates/jqgrid/i18n/jqgrid/locale-cn.min.js +8 -8
- data/templates/jqgrid/jquery.jqGrid.js +213 -137
- data/templates/jqgrid/jquery.jqGrid.min.js +262 -261
- data/templates/jqgrid/jquery.ui/jqGrid.scss +37 -37
- data/templates/jqtouch/jqtouch/glyphish/Read me first - license.txt +14 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/01-refresh.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/02-redo.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/03-loopback.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/04-squiggle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/05-shuffle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/06-magnifying-glass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/07-map-marker.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/08-chat.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/09-chat2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/10-medical.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/100-coffee.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/101-gameplan.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/102-walk.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/103-map.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/104-index-cards.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/105-piano.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/106-sliders.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/107-widescreen.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/108-badge.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/109-chicken.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/11-clock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/110-bug.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/111-user.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/112-group.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/113-navigation.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/114-balloon.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/115-bow-and-arrow.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/116-controller.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/117-todo.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/118-coathanger.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/119-piggybank.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/12-eye.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/120-headphones.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/121-lanscape.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/122-stats.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/123-id-card.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/124-bullhorn.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/125-food.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/126-moon.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/127-sock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/128-bone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/129-golf.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/13-target.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/130-dice.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/14-tag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/15-tags.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/16-line-chart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/17-bar-chart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/18-envelope.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/19-gear.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/20-gear2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/21-skull.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/22-skull-n-crossbones.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/23-bird.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/24-gift.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/25-weather.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/26-bandaid.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/27-planet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/28-star.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/29-heart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/30-key.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/31-ipod.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/32-iphone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/33-cabinet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/34-coffee.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/35-shopping-bag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/36-toolbox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/37-suitcase.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/38-airplane.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/39-spraycan.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/40-inbox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/41-picture-frame.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/42-photos.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/43-film-roll.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/44-shoebox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/45-movie1.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/46-movie2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/47-fuel.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/48-fork-and-knife.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/49-battery.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/50-beaker.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/51-outlet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/52-pinetree.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/53-house.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/54-lock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/55-network.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/56-cloud.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/57-download.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/58-bookmark.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/59-flag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/60-signpost.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/61-brightness.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/62-contrast.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/63-runner.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/64-zap.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/65-note.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/66-microphone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/67-tshirt.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/68-paperclip.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/69-display.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/70-tv.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/71-compass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/72-pin.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/73-radar.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/74-location.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/75-phone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/76-baby.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/77-ekg.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/78-stopwatch.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/79-medical-bag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/80-shopping-cart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/81-dashboard.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/82-dogpaw.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/83-calendar.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/84-lightbulb.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/85-trophy.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/86-camera.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/87-wineglass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/88-beermug.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/89-dumbbell.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/90-lifebuoy.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/91-beaker2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/92-testtube.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/93-thermometer.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/94-pill.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/95-equalizer.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/96-book.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/97-puzzle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/98-palette.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/icons/99-umbrella.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/01-refresh.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/02-redo.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/03-loopback.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/04-squiggle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/05-shuffle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/06-magnifying-glass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/07-map-marker.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/08-chat.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/09-chat2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/10-medical.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/100-coffee.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/101-gameplan.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/102-walk.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/103-map.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/104-index-cards.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/105-piano.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/106-sliders.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/107-widescreen.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/108-badge.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/109-chicken.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/11-clock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/110-bug.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/111-user.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/112-group.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/113-navigation.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/114-balloon.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/115-bow-and-arrow.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/116-controller.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/117-todo.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/118-coathanger.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/119-piggybank.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/12-eye.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/120-headphones.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/121-lanscape.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/122-stats.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/123-id-card.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/124-bullhorn.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/125-food.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/126-moon.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/127-sock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/128-bone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/129-golf.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/13-target.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/130-dice.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/14-tag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/15-tags.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/16-line-chart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/17-bar-chart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/18-envelope.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/19-gear.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/20-gear2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/21-skull.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/22-skull-n-crossbones.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/23-bird.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/24-gift.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/25-weather.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/26-bandaid.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/27-planet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/28-star.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/29-heart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/30-key.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/31-ipod.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/32-iphone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/33-cabinet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/34-coffee.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/35-shopping-bag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/36-toolbox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/37-suitcase.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/38-airplane.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/39-spraycan.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/40-inbox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/41-picture-frame.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/42-photos.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/43-film-roll.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/44-shoebox.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/45-movie1.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/46-movie2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/47-fuel.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/48-fork-and-knife.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/49-battery.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/50-beaker.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/51-outlet.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/52-pinetree.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/53-house.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/54-lock.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/55-network.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/56-cloud.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/57-download.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/58-bookmark.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/59-flag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/60-signpost.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/61-brightness.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/62-contrast.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/63-runner.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/64-zap.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/65-note.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/66-microphone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/67-tshirt.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/68-paperclip.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/69-display.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/70-tv.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/71-compass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/72-pin.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/73-radar.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/74-location.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/75-phone.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/76-baby.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/77-ekg.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/78-stopwatch.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/79-medical-bag.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/80-shopping-cart.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/81-dashboard.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/82-dogpaw.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/83-calendar.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/84-lightbulb.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/85-trophy.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/86-camera.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/87-wineglass.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/88-beermug.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/89-dumbbell.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/90-lifebuoy.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/91-beaker2.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/92-testtube.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/93-thermometer.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/94-pill.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/95-equalizer.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/96-book.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/97-puzzle.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/98-palette.png +0 -0
- data/templates/jqtouch/jqtouch/glyphish/mini-icons/99-umbrella.png +0 -0
- data/templates/jqtouch/jqtouch/ical/bottom_bar.png +0 -0
- data/templates/jqtouch/jqtouch/ical/calpad.jpg +0 -0
- data/templates/jqtouch/jqtouch/ical/cells.png +0 -0
- data/templates/jqtouch/jqtouch/ical/footer.png +0 -0
- data/templates/jqtouch/jqtouch/ical/header.png +0 -0
- data/templates/jqtouch/jqtouch/ical/header_left.png +0 -0
- data/templates/jqtouch/jqtouch/ical/header_right.png +0 -0
- data/templates/jqtouch/jqtouch/ical/jqt_startup.png +0 -0
- data/templates/jqtouch/jqtouch/ical/jqtouch-ical.png +0 -0
- data/templates/jqtouch/jqtouch/iphone-emulator.scss +1 -1
- data/templates/jqtouch/jqtouch/jqt.apple.scss +30 -30
- data/templates/jqtouch/jqtouch/jqt.jqt.scss +40 -40
- data/templates/jqtouch/jqtouch/jqtouch.scss +533 -168
- data/templates/jqtouch/jqtouch/sw/alpha.png +0 -0
- data/templates/jqtouch/jqtouch/sw/button-cancel.png +0 -0
- data/templates/jqtouch/jqtouch/sw/button-done.png +0 -0
- data/templates/jqtouch/jqtouch/sw/header.png +0 -0
- data/templates/jqtouch/jqtouch/sw/slot-border.png +0 -0
- data/templates/jqtouch/jquery.jqtouch.js +2049 -25
- data/templates/jqtouch/jquery.jqtouch.min.js +1 -26
- data/templates/jqtouch/manifest.rb +276 -1
- data/templates/jrails-1.3/config/initializers/jrails.rb +2 -2
- data/templates/jrails-1.3/{jquery-ui-1.7.2.js → jquery-ui-1.7.3.js} +4730 -4716
- data/templates/jrails-1.3/jquery-ui-1.7.3.min.js +690 -0
- data/templates/jrails-1.3/jquery.ui/_theme.scss +36 -36
- data/templates/jrails-1.3/jquery.ui/contextMenu.scss +7 -7
- data/templates/jrails-1.3/manifest.rb +2 -2
- data/templates/jrails-1.4/config/initializers/jrails.rb +2 -2
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.js +6 -6
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-fr-CH.min.js +1 -1
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.js +1 -1
- data/templates/jrails-1.4/i18n/jquery.ui/datepicker-pl.min.js +1 -1
- data/templates/jrails-1.4/{jquery-ui-1.8.js → jquery-ui-1.8.1.js} +6729 -6597
- data/templates/jrails-1.4/{jquery-ui-1.8.min.js → jquery-ui-1.8.1.min.js} +304 -305
- data/templates/jrails-1.4/jquery.ui/_theme.scss +45 -45
- data/templates/jrails-1.4/jquery.ui/contextMenu.scss +7 -7
- data/templates/jrails-1.4/manifest.rb +2 -2
- data/templates/ribbon/jquery.ui/ribbon.office/arrow.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/arrow_down.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/bg.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/item_background.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/item_small_background.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_background.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_bottom.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_dropdownitembg.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_dropdownitembghover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_item_hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_middle.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_top.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_top_backstage.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menu_top_backstage2.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/menuitem_background.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/orb.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/orb_hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/orb_office.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/orb_office_hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/orb_submenu_item_hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-firstLevel-hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-rightColumn-wide.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-subMenu-item-hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-subMenu-item.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-subMenu-itemSquare-hover.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/ribbon-backstage-subMenu-itemSquare.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office/top_background.png +0 -0
- data/templates/ribbon/jquery.ui/ribbon.office.scss +444 -0
- data/templates/ribbon/jquery.ui/ribbon.simple.scss +17 -9
- data/templates/ribbon/jquery.ui/ribbon.windows7.scss +27 -37
- data/templates/ribbon/manifest.rb +28 -0
- metadata +310 -7
- data/templates/jrails-1.3/jquery-ui-1.7.2.min.js +0 -688
@@ -17,8 +17,8 @@
|
|
17
17
|
(c) 2009 by jQTouch project members.
|
18
18
|
See LICENSE.txt for license.
|
19
19
|
|
20
|
-
$Revision:
|
21
|
-
$Date: 2010-04-
|
20
|
+
$Revision: 148 $
|
21
|
+
$Date: 2010-04-24 23:00:00 +0200 (Sa, 24. Apr 2010) $
|
22
22
|
$LastChangedBy: davidcolbykaneda $
|
23
23
|
|
24
24
|
*/
|
@@ -45,6 +45,7 @@
|
|
45
45
|
lastAnimationTime=0,
|
46
46
|
touchSelectors=[],
|
47
47
|
publicObj={},
|
48
|
+
tapBuffer=351,
|
48
49
|
extensions=$.jQTouch.prototype.extensions,
|
49
50
|
defaultAnimations=['slide','flip','slideup','swap','cube','pop','dissolve','fade','back'],
|
50
51
|
animations=[],
|
@@ -154,23 +155,27 @@
|
|
154
155
|
|
155
156
|
if (jQTSettings.useFastTouch && $.support.touch) {
|
156
157
|
$body.click(function(e) {
|
157
|
-
var
|
158
|
+
var timeDiff = (new Date()).getTime() - lastAnimationTime;
|
159
|
+
if (timeDiff > tapBuffer) {
|
160
|
+
var $el = $(e.target);
|
158
161
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
+
if ($el.attr('nodeName')!=='A' && $el.attr('nodeName')!=='AREA' && $el.attr('nodeName')!=='INPUT') {
|
163
|
+
$el = $el.closest('a, area');
|
164
|
+
}
|
162
165
|
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
return false;
|
166
|
+
if ($el.isExternalLink()) {
|
167
|
+
return true;
|
168
|
+
}
|
167
169
|
}
|
170
|
+
|
171
|
+
return false;
|
172
|
+
|
168
173
|
});
|
169
174
|
|
170
175
|
// This additionally gets rid of form focusses
|
171
176
|
$body.mousedown(function(e) {
|
172
177
|
var timeDiff = (new Date()).getTime() - lastAnimationTime;
|
173
|
-
if (timeDiff <
|
178
|
+
if (timeDiff < tapBuffer) {
|
174
179
|
return false;
|
175
180
|
}
|
176
181
|
});
|
@@ -357,27 +362,29 @@
|
|
357
362
|
// Collapse the keyboard
|
358
363
|
$(':focus').blur();
|
359
364
|
|
360
|
-
fromPage.css('top', -window.pageYOffset);
|
361
|
-
toPage.css('top', 0);
|
362
|
-
|
363
365
|
// Make sure we are scrolled up to hide location bar
|
364
|
-
|
366
|
+
toPage.css('top', window.pageYOffset);
|
365
367
|
|
366
368
|
// Define callback to run after animation completes
|
367
369
|
var callback = function animationEnd(event) {
|
370
|
+
|
371
|
+
fromPage[0].removeEventListener('webkitTransitionEnd', callback);
|
372
|
+
fromPage[0].removeEventListener('webkitAnimationEnd', callback);
|
373
|
+
|
368
374
|
if (animation) {
|
369
|
-
|
370
|
-
|
375
|
+
toPage.removeClass('start in ' + animation.name);
|
376
|
+
fromPage.removeClass('start out current ' + animation.name);
|
371
377
|
if (backwards) {
|
372
378
|
toPage.toggleClass('reverse');
|
373
379
|
fromPage.toggleClass('reverse');
|
374
380
|
}
|
381
|
+
toPage.css('top', 0);
|
375
382
|
} else {
|
376
383
|
fromPage.removeClass('current');
|
377
384
|
}
|
378
385
|
|
379
|
-
toPage.trigger('pageAnimationEnd', { direction: 'in' });
|
380
|
-
fromPage.trigger('pageAnimationEnd', { direction: 'out' });
|
386
|
+
toPage.trigger('pageAnimationEnd', { direction: 'in', reverse: backwards });
|
387
|
+
fromPage.trigger('pageAnimationEnd', { direction: 'out', reverse: backwards });
|
381
388
|
|
382
389
|
clearInterval(hashCheckInterval);
|
383
390
|
currentPage = toPage;
|
@@ -390,20 +397,31 @@
|
|
390
397
|
}
|
391
398
|
lastAnimationTime = (new Date()).getTime();
|
392
399
|
tapReady = true;
|
400
|
+
|
393
401
|
}
|
394
402
|
|
395
403
|
fromPage.trigger('pageAnimationStart', { direction: 'out' });
|
396
404
|
toPage.trigger('pageAnimationStart', { direction: 'in' });
|
397
405
|
|
398
406
|
if ($.support.WebKitAnimationEvent && animation && jQTSettings.useAnimations) {
|
399
|
-
toPage.one('webkitAnimationEnd', callback);
|
400
407
|
tapReady = false;
|
401
408
|
if (backwards) {
|
402
409
|
toPage.toggleClass('reverse');
|
403
410
|
fromPage.toggleClass('reverse');
|
404
411
|
}
|
412
|
+
|
413
|
+
// Support both transitions and animations
|
414
|
+
fromPage[0].addEventListener('webkitTransitionEnd', callback);
|
415
|
+
fromPage[0].addEventListener('webkitAnimationEnd', callback);
|
416
|
+
|
405
417
|
toPage.addClass(animation.name + ' in current');
|
406
418
|
fromPage.addClass(animation.name + ' out');
|
419
|
+
|
420
|
+
setTimeout(function(){
|
421
|
+
toPage.addClass('start');
|
422
|
+
fromPage.addClass('start');
|
423
|
+
}, 0);
|
424
|
+
|
407
425
|
|
408
426
|
} else {
|
409
427
|
toPage.addClass('current');
|
@@ -519,9 +537,8 @@
|
|
519
537
|
}
|
520
538
|
}
|
521
539
|
function updateOrientation() {
|
522
|
-
orientation = Math.abs(window.orientation) == 90 ? 'landscape' : '
|
523
|
-
$body.removeClass('
|
524
|
-
// scrollTo(0, 0);
|
540
|
+
orientation = Math.abs(window.orientation) == 90 ? 'landscape' : 'portrait';
|
541
|
+
$body.removeClass('portrait landscape').addClass(orientation).trigger('turn', {orientation: orientation});
|
525
542
|
}
|
526
543
|
function handleTouch(e) {
|
527
544
|
var $el = $(e.target);
|
@@ -607,7 +624,7 @@
|
|
607
624
|
}
|
608
625
|
$.fn.swipe = function(fn) {
|
609
626
|
if ($.isFunction(fn)) {
|
610
|
-
return $(this).
|
627
|
+
return $(this).live('swipe', fn);
|
611
628
|
} else {
|
612
629
|
return $(this).trigger('swipe');
|
613
630
|
}
|
@@ -622,7 +639,7 @@
|
|
622
639
|
}
|
623
640
|
$.fn.isExternalLink = function() {
|
624
641
|
var $el = $(this);
|
625
|
-
return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com
|
642
|
+
return ($el.attr('target') == '_blank' || $el.attr('rel') == 'external' || $el.is('input[type="checkbox"], input[type="radio"], a[href^="http://maps.google.com"], a[href^="mailto:"], a[href^="tel:"], a[href^="javascript:"], a[href*="youtube.com/v"], a[href*="youtube.com/watch"]'));
|
626
643
|
}
|
627
644
|
|
628
645
|
publicObj = {
|
@@ -705,6 +722,894 @@
|
|
705
722
|
}
|
706
723
|
})(jQuery);
|
707
724
|
|
725
|
+
/**
|
726
|
+
*
|
727
|
+
* Find more about the Spinning Wheel function at
|
728
|
+
* http://cubiq.org/spinning-wheel-on-webkit-for-iphone-ipod-touch/11
|
729
|
+
*
|
730
|
+
* Copyright (c) 2009 Matteo Spinelli, http://cubiq.org/
|
731
|
+
* Released under MIT license
|
732
|
+
* http://cubiq.org/dropbox/mit-license.txt
|
733
|
+
*
|
734
|
+
* Version 1.4 - Last updated: 2009.07.09
|
735
|
+
*
|
736
|
+
*/
|
737
|
+
|
738
|
+
var SpinningWheel = {
|
739
|
+
cellHeight: 44,
|
740
|
+
friction: 0.003,
|
741
|
+
slotData: [],
|
742
|
+
|
743
|
+
|
744
|
+
/**
|
745
|
+
*
|
746
|
+
* Event handler
|
747
|
+
*
|
748
|
+
*/
|
749
|
+
|
750
|
+
handleEvent: function (e) {
|
751
|
+
if (e.type == 'touchstart') {
|
752
|
+
this.lockScreen(e);
|
753
|
+
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
754
|
+
this.tapDown(e);
|
755
|
+
} else if (e.currentTarget.id == 'sw-frame') {
|
756
|
+
this.scrollStart(e);
|
757
|
+
}
|
758
|
+
} else if (e.type == 'touchmove') {
|
759
|
+
this.lockScreen(e);
|
760
|
+
|
761
|
+
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
762
|
+
this.tapCancel(e);
|
763
|
+
} else if (e.currentTarget.id == 'sw-frame') {
|
764
|
+
this.scrollMove(e);
|
765
|
+
}
|
766
|
+
} else if (e.type == 'touchend') {
|
767
|
+
if (e.currentTarget.id == 'sw-cancel' || e.currentTarget.id == 'sw-done') {
|
768
|
+
this.tapUp(e);
|
769
|
+
} else if (e.currentTarget.id == 'sw-frame') {
|
770
|
+
this.scrollEnd(e);
|
771
|
+
}
|
772
|
+
} else if (e.type == 'webkitTransitionEnd') {
|
773
|
+
if (e.target.id == 'sw-wrapper') {
|
774
|
+
// this.destroy();
|
775
|
+
} else {
|
776
|
+
this.backWithinBoundaries(e);
|
777
|
+
}
|
778
|
+
} else if (e.type == 'orientationchange') {
|
779
|
+
this.onOrientationChange(e);
|
780
|
+
} else if (e.type == 'scroll') {
|
781
|
+
this.onScroll(e);
|
782
|
+
}
|
783
|
+
},
|
784
|
+
|
785
|
+
|
786
|
+
/**
|
787
|
+
*
|
788
|
+
* Global events
|
789
|
+
*
|
790
|
+
*/
|
791
|
+
|
792
|
+
onOrientationChange: function (e) {
|
793
|
+
window.scrollTo(0, 0);
|
794
|
+
this.swWrapper.style.top = window.innerHeight + window.pageYOffset + 'px';
|
795
|
+
this.calculateSlotsWidth();
|
796
|
+
},
|
797
|
+
|
798
|
+
onScroll: function (e) {
|
799
|
+
this.swWrapper.style.top = window.innerHeight + window.pageYOffset + 'px';
|
800
|
+
},
|
801
|
+
|
802
|
+
lockScreen: function (e) {
|
803
|
+
e.preventDefault();
|
804
|
+
e.stopPropagation();
|
805
|
+
},
|
806
|
+
|
807
|
+
|
808
|
+
/**
|
809
|
+
*
|
810
|
+
* Initialization
|
811
|
+
*
|
812
|
+
*/
|
813
|
+
|
814
|
+
reset: function () {
|
815
|
+
this.slotEl = [];
|
816
|
+
|
817
|
+
this.activeSlot = null;
|
818
|
+
|
819
|
+
this.swWrapper = undefined;
|
820
|
+
this.swSlotWrapper = undefined;
|
821
|
+
this.swSlots = undefined;
|
822
|
+
this.swFrame = undefined;
|
823
|
+
},
|
824
|
+
|
825
|
+
calculateSlotsWidth: function () {
|
826
|
+
var div = this.swSlots.getElementsByTagName('div');
|
827
|
+
for (var i = 0; i < div.length; i += 1) {
|
828
|
+
this.slotEl[i].slotWidth = div[i].offsetWidth;
|
829
|
+
}
|
830
|
+
},
|
831
|
+
|
832
|
+
create: function () {
|
833
|
+
var i, l, out, ul, div;
|
834
|
+
|
835
|
+
this.reset(); // Initialize object variables
|
836
|
+
|
837
|
+
// Create the Spinning Wheel main wrapper
|
838
|
+
div = document.createElement('div');
|
839
|
+
div.id = 'sw-wrapper';
|
840
|
+
div.style.top = window.innerHeight + window.pageYOffset + 'px'; // Place the SW down the actual viewing screen
|
841
|
+
div.style.webkitTransitionProperty = '-webkit-transform';
|
842
|
+
// div.innerHTML = '<div id="sw-header"><div id="sw-cancel">Cancel</' + 'div><div id="sw-done">Done</' + 'div></' + 'div><div id="sw-slots-wrapper"><div id="sw-slots"></' + 'div></' + 'div><div id="sw-frame"></' + 'div>';
|
843
|
+
div.innerHTML = '<div id="sw-slots-wrapper"><div id="sw-slots"></' + 'div></' + 'div><div id="sw-frame"></' + 'div>';
|
844
|
+
|
845
|
+
document.body.appendChild(div);
|
846
|
+
|
847
|
+
this.swWrapper = div; // The SW wrapper
|
848
|
+
this.swSlotWrapper = document.getElementById('sw-slots-wrapper'); // Slots visible area
|
849
|
+
this.swSlots = document.getElementById('sw-slots'); // Pseudo table element (inner wrapper)
|
850
|
+
this.swFrame = document.getElementById('sw-frame'); // The scrolling controller
|
851
|
+
|
852
|
+
// Create HTML slot elements
|
853
|
+
for (l = 0; l < this.slotData.length; l += 1) {
|
854
|
+
// Create the slot
|
855
|
+
ul = document.createElement('ul');
|
856
|
+
out = '';
|
857
|
+
for (i in this.slotData[l].values) {
|
858
|
+
out += '<li>' + this.slotData[l].values[i] + '<' + '/li>';
|
859
|
+
}
|
860
|
+
ul.innerHTML = out;
|
861
|
+
|
862
|
+
div = document.createElement('div'); // Create slot container
|
863
|
+
div.className = this.slotData[l].style; // Add styles to the container
|
864
|
+
div.appendChild(ul);
|
865
|
+
|
866
|
+
// Append the slot to the wrapper
|
867
|
+
this.swSlots.appendChild(div);
|
868
|
+
|
869
|
+
ul.slotPosition = l; // Save the slot position inside the wrapper
|
870
|
+
ul.slotYPosition = 0;
|
871
|
+
ul.slotWidth = 0;
|
872
|
+
ul.slotMaxScroll = this.swSlotWrapper.clientHeight - ul.clientHeight - 86;
|
873
|
+
ul.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)'; // Add default transition
|
874
|
+
|
875
|
+
this.slotEl.push(ul); // Save the slot for later use
|
876
|
+
|
877
|
+
// Place the slot to its default position (if other than 0)
|
878
|
+
if (this.slotData[l].defaultValue) {
|
879
|
+
this.scrollToValue(l, this.slotData[l].defaultValue);
|
880
|
+
}
|
881
|
+
}
|
882
|
+
|
883
|
+
this.calculateSlotsWidth();
|
884
|
+
|
885
|
+
// Global events
|
886
|
+
// document.addEventListener('touchstart', this, false); // Prevent page scrolling
|
887
|
+
document.addEventListener('touchmove', this, false); // Prevent page scrolling
|
888
|
+
window.addEventListener('orientationchange', this, true); // Optimize SW on orientation change
|
889
|
+
window.addEventListener('scroll', this, true); // Reposition SW on page scroll
|
890
|
+
|
891
|
+
// Cancel/Done buttons events
|
892
|
+
// document.getElementById('sw-cancel').addEventListener('touchstart', this, false);
|
893
|
+
document.getElementById('sw-done').addEventListener('touchstart', this, false);
|
894
|
+
|
895
|
+
// Add scrolling to the slots
|
896
|
+
this.swFrame.addEventListener('touchstart', this, false);
|
897
|
+
},
|
898
|
+
|
899
|
+
open: function () {
|
900
|
+
this.create();
|
901
|
+
|
902
|
+
this.swWrapper.style.webkitTransitionTimingFunction = 'ease-out';
|
903
|
+
this.swWrapper.style.webkitTransitionDuration = '400ms';
|
904
|
+
this.swWrapper.style.webkitTransform = 'translate3d(0, -210px, 0)';
|
905
|
+
},
|
906
|
+
|
907
|
+
|
908
|
+
/**
|
909
|
+
*
|
910
|
+
* Unload
|
911
|
+
*
|
912
|
+
*/
|
913
|
+
|
914
|
+
destroy: function () {
|
915
|
+
this.swWrapper.removeEventListener('webkitTransitionEnd', this, false);
|
916
|
+
|
917
|
+
this.swFrame.removeEventListener('touchstart', this, false);
|
918
|
+
|
919
|
+
// document.getElementById('sw-cancel').removeEventListener('touchstart', this, false);
|
920
|
+
document.getElementById('sw-done').removeEventListener('touchstart', this, false);
|
921
|
+
|
922
|
+
// document.removeEventListener('touchstart', this, false);
|
923
|
+
document.removeEventListener('touchmove', this, false);
|
924
|
+
window.removeEventListener('orientationchange', this, true);
|
925
|
+
window.removeEventListener('scroll', this, true);
|
926
|
+
|
927
|
+
this.slotData = [];
|
928
|
+
this.cancelAction = function () {
|
929
|
+
return false;
|
930
|
+
};
|
931
|
+
|
932
|
+
this.cancelDone = function () {
|
933
|
+
return true;
|
934
|
+
};
|
935
|
+
|
936
|
+
this.reset();
|
937
|
+
|
938
|
+
document.body.removeChild(document.getElementById('sw-wrapper'));
|
939
|
+
},
|
940
|
+
|
941
|
+
close: function () {
|
942
|
+
this.swWrapper.style.webkitTransitionTimingFunction = 'ease-in';
|
943
|
+
this.swWrapper.style.webkitTransitionDuration = '400ms';
|
944
|
+
this.swWrapper.style.webkitTransform = 'translate3d(0, 0, 0)';
|
945
|
+
|
946
|
+
this.swWrapper.addEventListener('webkitTransitionEnd', this, false);
|
947
|
+
},
|
948
|
+
|
949
|
+
|
950
|
+
/**
|
951
|
+
*
|
952
|
+
* Generic methods
|
953
|
+
*
|
954
|
+
*/
|
955
|
+
|
956
|
+
addSlot: function (values, style, defaultValue) {
|
957
|
+
if (!style) {
|
958
|
+
style = '';
|
959
|
+
}
|
960
|
+
|
961
|
+
style = style.split(' ');
|
962
|
+
|
963
|
+
for (var i = 0; i < style.length; i += 1) {
|
964
|
+
style[i] = 'sw-' + style[i];
|
965
|
+
}
|
966
|
+
|
967
|
+
style = style.join(' ');
|
968
|
+
|
969
|
+
var obj = { 'values': values, 'style': style, 'defaultValue': defaultValue };
|
970
|
+
this.slotData.push(obj);
|
971
|
+
},
|
972
|
+
|
973
|
+
getSelectedValues: function () {
|
974
|
+
var index, count,
|
975
|
+
i, l,
|
976
|
+
keys = [], values = [];
|
977
|
+
|
978
|
+
for (i in this.slotEl) {
|
979
|
+
// Remove any residual animation
|
980
|
+
this.slotEl[i].removeEventListener('webkitTransitionEnd', this, false);
|
981
|
+
this.slotEl[i].style.webkitTransitionDuration = '0';
|
982
|
+
|
983
|
+
if (this.slotEl[i].slotYPosition > 0) {
|
984
|
+
this.setPosition(i, 0);
|
985
|
+
} else if (this.slotEl[i].slotYPosition < this.slotEl[i].slotMaxScroll) {
|
986
|
+
this.setPosition(i, this.slotEl[i].slotMaxScroll);
|
987
|
+
}
|
988
|
+
|
989
|
+
index = -Math.round(this.slotEl[i].slotYPosition / this.cellHeight);
|
990
|
+
|
991
|
+
count = 0;
|
992
|
+
for (l in this.slotData[i].values) {
|
993
|
+
if (count == index) {
|
994
|
+
keys.push(l);
|
995
|
+
values.push(this.slotData[i].values[l]);
|
996
|
+
break;
|
997
|
+
}
|
998
|
+
|
999
|
+
count += 1;
|
1000
|
+
}
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
return { 'keys': keys, 'values': values };
|
1004
|
+
},
|
1005
|
+
|
1006
|
+
|
1007
|
+
/**
|
1008
|
+
*
|
1009
|
+
* Rolling slots
|
1010
|
+
*
|
1011
|
+
*/
|
1012
|
+
|
1013
|
+
setPosition: function (slot, pos) {
|
1014
|
+
this.slotEl[slot].slotYPosition = pos;
|
1015
|
+
this.slotEl[slot].style.webkitTransform = 'translate3d(0, ' + pos + 'px, 0)';
|
1016
|
+
},
|
1017
|
+
|
1018
|
+
scrollStart: function (e) {
|
1019
|
+
// Find the clicked slot
|
1020
|
+
var xPos = e.targetTouches[0].clientX - this.swSlots.offsetLeft; // Clicked position minus left offset (should be 11px)
|
1021
|
+
|
1022
|
+
// Find tapped slot
|
1023
|
+
var slot = 0;
|
1024
|
+
for (var i = 0; i < this.slotEl.length; i += 1) {
|
1025
|
+
slot += this.slotEl[i].slotWidth;
|
1026
|
+
|
1027
|
+
if (xPos < slot) {
|
1028
|
+
this.activeSlot = i;
|
1029
|
+
break;
|
1030
|
+
}
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
// If slot is readonly do nothing
|
1034
|
+
if (this.slotData[this.activeSlot].style.match('readonly')) {
|
1035
|
+
this.swFrame.removeEventListener('touchmove', this, false);
|
1036
|
+
this.swFrame.removeEventListener('touchend', this, false);
|
1037
|
+
return false;
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
this.slotEl[this.activeSlot].removeEventListener('webkitTransitionEnd', this, false); // Remove transition event (if any)
|
1041
|
+
this.slotEl[this.activeSlot].style.webkitTransitionDuration = '0'; // Remove any residual transition
|
1042
|
+
|
1043
|
+
// Stop and hold slot position
|
1044
|
+
var theTransform = window.getComputedStyle(this.slotEl[this.activeSlot]).webkitTransform;
|
1045
|
+
theTransform = new WebKitCSSMatrix(theTransform).m42;
|
1046
|
+
if (theTransform != this.slotEl[this.activeSlot].slotYPosition) {
|
1047
|
+
this.setPosition(this.activeSlot, theTransform);
|
1048
|
+
}
|
1049
|
+
|
1050
|
+
this.startY = e.targetTouches[0].clientY;
|
1051
|
+
this.scrollStartY = this.slotEl[this.activeSlot].slotYPosition;
|
1052
|
+
this.scrollStartTime = e.timeStamp;
|
1053
|
+
|
1054
|
+
this.swFrame.addEventListener('touchmove', this, false);
|
1055
|
+
this.swFrame.addEventListener('touchend', this, false);
|
1056
|
+
|
1057
|
+
return true;
|
1058
|
+
},
|
1059
|
+
|
1060
|
+
scrollMove: function (e) {
|
1061
|
+
var topDelta = e.targetTouches[0].clientY - this.startY;
|
1062
|
+
|
1063
|
+
if (this.slotEl[this.activeSlot].slotYPosition > 0 || this.slotEl[this.activeSlot].slotYPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
1064
|
+
topDelta /= 2;
|
1065
|
+
}
|
1066
|
+
|
1067
|
+
this.setPosition(this.activeSlot, this.slotEl[this.activeSlot].slotYPosition + topDelta);
|
1068
|
+
this.startY = e.targetTouches[0].clientY;
|
1069
|
+
|
1070
|
+
// Prevent slingshot effect
|
1071
|
+
if (e.timeStamp - this.scrollStartTime > 80) {
|
1072
|
+
this.scrollStartY = this.slotEl[this.activeSlot].slotYPosition;
|
1073
|
+
this.scrollStartTime = e.timeStamp;
|
1074
|
+
}
|
1075
|
+
},
|
1076
|
+
|
1077
|
+
scrollEnd: function (e) {
|
1078
|
+
this.swFrame.removeEventListener('touchmove', this, false);
|
1079
|
+
this.swFrame.removeEventListener('touchend', this, false);
|
1080
|
+
|
1081
|
+
// If we are outside of the boundaries, let's go back to the sheepfold
|
1082
|
+
if (this.slotEl[this.activeSlot].slotYPosition > 0 || this.slotEl[this.activeSlot].slotYPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
1083
|
+
this.scrollTo(this.activeSlot, this.slotEl[this.activeSlot].slotYPosition > 0 ? 0 : this.slotEl[this.activeSlot].slotMaxScroll);
|
1084
|
+
return false;
|
1085
|
+
}
|
1086
|
+
|
1087
|
+
// Lame formula to calculate a fake deceleration
|
1088
|
+
var scrollDistance = this.slotEl[this.activeSlot].slotYPosition - this.scrollStartY;
|
1089
|
+
|
1090
|
+
// The drag session was too short
|
1091
|
+
if (scrollDistance < this.cellHeight / 1.5 && scrollDistance > -this.cellHeight / 1.5) {
|
1092
|
+
if (this.slotEl[this.activeSlot].slotYPosition % this.cellHeight) {
|
1093
|
+
this.scrollTo(this.activeSlot, Math.round(this.slotEl[this.activeSlot].slotYPosition / this.cellHeight) * this.cellHeight, '100ms');
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
return false;
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
var scrollDuration = e.timeStamp - this.scrollStartTime;
|
1100
|
+
|
1101
|
+
var newDuration = (2 * scrollDistance / scrollDuration) / this.friction;
|
1102
|
+
var newScrollDistance = (this.friction / 2) * (newDuration * newDuration);
|
1103
|
+
|
1104
|
+
if (newDuration < 0) {
|
1105
|
+
newDuration = -newDuration;
|
1106
|
+
newScrollDistance = -newScrollDistance;
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
var newPosition = this.slotEl[this.activeSlot].slotYPosition + newScrollDistance;
|
1110
|
+
|
1111
|
+
if (newPosition > 0) {
|
1112
|
+
// Prevent the slot to be dragged outside the visible area (top margin)
|
1113
|
+
newPosition /= 2;
|
1114
|
+
newDuration /= 3;
|
1115
|
+
|
1116
|
+
if (newPosition > this.swSlotWrapper.clientHeight / 4) {
|
1117
|
+
newPosition = this.swSlotWrapper.clientHeight / 4;
|
1118
|
+
}
|
1119
|
+
} else if (newPosition < this.slotEl[this.activeSlot].slotMaxScroll) {
|
1120
|
+
// Prevent the slot to be dragged outside the visible area (bottom margin)
|
1121
|
+
newPosition = (newPosition - this.slotEl[this.activeSlot].slotMaxScroll) / 2 + this.slotEl[this.activeSlot].slotMaxScroll;
|
1122
|
+
newDuration /= 3;
|
1123
|
+
|
1124
|
+
if (newPosition < this.slotEl[this.activeSlot].slotMaxScroll - this.swSlotWrapper.clientHeight / 4) {
|
1125
|
+
newPosition = this.slotEl[this.activeSlot].slotMaxScroll - this.swSlotWrapper.clientHeight / 4;
|
1126
|
+
}
|
1127
|
+
} else {
|
1128
|
+
newPosition = Math.round(newPosition / this.cellHeight) * this.cellHeight;
|
1129
|
+
}
|
1130
|
+
|
1131
|
+
this.scrollTo(this.activeSlot, Math.round(newPosition), Math.round(newDuration) + 'ms');
|
1132
|
+
|
1133
|
+
return true;
|
1134
|
+
},
|
1135
|
+
|
1136
|
+
scrollTo: function (slotNum, dest, runtime) {
|
1137
|
+
this.slotEl[slotNum].style.webkitTransitionDuration = runtime ? runtime : '100ms';
|
1138
|
+
this.setPosition(slotNum, dest ? dest : 0);
|
1139
|
+
|
1140
|
+
// If we are outside of the boundaries go back to the sheepfold
|
1141
|
+
if (this.slotEl[slotNum].slotYPosition > 0 || this.slotEl[slotNum].slotYPosition < this.slotEl[slotNum].slotMaxScroll) {
|
1142
|
+
this.slotEl[slotNum].addEventListener('webkitTransitionEnd', this, false);
|
1143
|
+
}
|
1144
|
+
},
|
1145
|
+
|
1146
|
+
scrollToValue: function (slot, value) {
|
1147
|
+
var yPos, count, i;
|
1148
|
+
|
1149
|
+
this.slotEl[slot].removeEventListener('webkitTransitionEnd', this, false);
|
1150
|
+
this.slotEl[slot].style.webkitTransitionDuration = '0';
|
1151
|
+
|
1152
|
+
count = 0;
|
1153
|
+
for (i in this.slotData[slot].values) {
|
1154
|
+
if (i == value) {
|
1155
|
+
yPos = count * this.cellHeight;
|
1156
|
+
this.setPosition(slot, yPos);
|
1157
|
+
break;
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
count -= 1;
|
1161
|
+
}
|
1162
|
+
},
|
1163
|
+
|
1164
|
+
backWithinBoundaries: function (e) {
|
1165
|
+
e.target.removeEventListener('webkitTransitionEnd', this, false);
|
1166
|
+
|
1167
|
+
this.scrollTo(e.target.slotPosition, e.target.slotYPosition > 0 ? 0 : e.target.slotMaxScroll, '150ms');
|
1168
|
+
return false;
|
1169
|
+
},
|
1170
|
+
|
1171
|
+
|
1172
|
+
/**
|
1173
|
+
*
|
1174
|
+
* Buttons
|
1175
|
+
*
|
1176
|
+
*/
|
1177
|
+
|
1178
|
+
tapDown: function (e) {
|
1179
|
+
e.currentTarget.addEventListener('touchmove', this, false);
|
1180
|
+
e.currentTarget.addEventListener('touchend', this, false);
|
1181
|
+
e.currentTarget.className = 'sw-pressed';
|
1182
|
+
},
|
1183
|
+
|
1184
|
+
tapCancel: function (e) {
|
1185
|
+
e.currentTarget.removeEventListener('touchmove', this, false);
|
1186
|
+
e.currentTarget.removeEventListener('touchend', this, false);
|
1187
|
+
e.currentTarget.className = '';
|
1188
|
+
},
|
1189
|
+
|
1190
|
+
tapUp: function (e) {
|
1191
|
+
this.tapCancel(e);
|
1192
|
+
|
1193
|
+
if (e.currentTarget.id == 'sw-cancel') {
|
1194
|
+
this.cancelAction();
|
1195
|
+
} else {
|
1196
|
+
this.doneAction();
|
1197
|
+
}
|
1198
|
+
|
1199
|
+
// this.close(); //not needed because we control this via the feedback from the query
|
1200
|
+
},
|
1201
|
+
|
1202
|
+
setCancelAction: function (action) {
|
1203
|
+
this.cancelAction = action;
|
1204
|
+
},
|
1205
|
+
|
1206
|
+
setDoneAction: function (action) {
|
1207
|
+
this.doneAction = action;
|
1208
|
+
},
|
1209
|
+
|
1210
|
+
cancelAction: function () {
|
1211
|
+
return false;
|
1212
|
+
},
|
1213
|
+
|
1214
|
+
cancelDone: function () {
|
1215
|
+
return true;
|
1216
|
+
}
|
1217
|
+
};
|
1218
|
+
|
1219
|
+
/*
|
1220
|
+
Copyright (C) 2008 Charles Ying. All Rights Reserved.
|
1221
|
+
|
1222
|
+
This distribution is released under the BSD license.
|
1223
|
+
|
1224
|
+
http://css-vfx.googlecode.com/
|
1225
|
+
|
1226
|
+
See the README for documentation and license.
|
1227
|
+
*/
|
1228
|
+
|
1229
|
+
(function () { // Module pattern
|
1230
|
+
|
1231
|
+
var global = this;
|
1232
|
+
|
1233
|
+
// CREATE ARRAYS FOR LINKS AND CAPTIONS
|
1234
|
+
var imagesArray = Array();
|
1235
|
+
|
1236
|
+
var captionsArray = Array();
|
1237
|
+
// ["This is a caption lorem ipsum"],
|
1238
|
+
// ["Here's one that we'll<br>make into two lines"],
|
1239
|
+
// [""Quotes" and ©s and ™s, oh my!"],
|
1240
|
+
// ["Blah Blah Blooey"]);
|
1241
|
+
|
1242
|
+
/*
|
1243
|
+
Utilities (avoid jQuery dependencies)
|
1244
|
+
*/
|
1245
|
+
|
1246
|
+
function utils_extend(obj, dict)
|
1247
|
+
{
|
1248
|
+
for (var key in dict)
|
1249
|
+
{
|
1250
|
+
obj[key] = dict[key];
|
1251
|
+
}
|
1252
|
+
}
|
1253
|
+
|
1254
|
+
function utils_setsize(elem, w, h)
|
1255
|
+
{
|
1256
|
+
elem.style.width = w.toString() + "px";
|
1257
|
+
elem.style.height = h.toString() + "px";
|
1258
|
+
}
|
1259
|
+
|
1260
|
+
function utils_setxy(elem, x, y)
|
1261
|
+
{
|
1262
|
+
elem.style.left = Math.round(x).toString() + "px";
|
1263
|
+
elem.style.top = Math.round(y).toString() + "px";
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
/*
|
1267
|
+
TrayController is a horizontal touch event controller that tracks cumulative offsets and passes events to a delegate.
|
1268
|
+
*/
|
1269
|
+
|
1270
|
+
TrayController = function ()
|
1271
|
+
{
|
1272
|
+
return this;
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
TrayController.prototype.init = function (elem)
|
1276
|
+
{
|
1277
|
+
this.currentX = 0;
|
1278
|
+
this.elem = elem;
|
1279
|
+
}
|
1280
|
+
|
1281
|
+
TrayController.prototype.touchstart = function (event)
|
1282
|
+
{
|
1283
|
+
this.startX = event.touches[0].pageX - this.currentX;
|
1284
|
+
this.touchMoved = false;
|
1285
|
+
|
1286
|
+
window.addEventListener("touchmove", this, true);
|
1287
|
+
window.addEventListener("touchend", this, true);
|
1288
|
+
|
1289
|
+
this.elem.style.webkitTransitionDuration = "0s";
|
1290
|
+
}
|
1291
|
+
|
1292
|
+
TrayController.prototype.touchmove = function (e)
|
1293
|
+
{
|
1294
|
+
this.touchMoved = true;
|
1295
|
+
this.lastX = this.currentX;
|
1296
|
+
this.lastMoveTime = new Date();
|
1297
|
+
this.currentX = event.touches[0].pageX - this.startX;
|
1298
|
+
this.delegate.update(this.currentX);
|
1299
|
+
}
|
1300
|
+
|
1301
|
+
TrayController.prototype.touchend = function (e)
|
1302
|
+
{
|
1303
|
+
window.removeEventListener("touchmove", this, true);
|
1304
|
+
window.removeEventListener("touchend", this, true);
|
1305
|
+
|
1306
|
+
this.elem.style.webkitTransitionDuration = "0.4s";
|
1307
|
+
|
1308
|
+
if (this.touchMoved)
|
1309
|
+
{
|
1310
|
+
/* Approximate some inertia -- the transition function takes care of the decay over 0.4s for us, but we need to amplify the last movement */
|
1311
|
+
var delta = this.currentX - this.lastX;
|
1312
|
+
var dt = (new Date()) - this.lastMoveTime + 1;
|
1313
|
+
/* dx * 400 / dt */
|
1314
|
+
|
1315
|
+
this.currentX = this.currentX + delta * 200 / dt;
|
1316
|
+
this.delegate.updateTouchEnd(this);
|
1317
|
+
}
|
1318
|
+
else
|
1319
|
+
{
|
1320
|
+
this.delegate.clicked(this.currentX);
|
1321
|
+
}
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
TrayController.prototype.handleEvent = function (event)
|
1325
|
+
{
|
1326
|
+
this[event.type](event);
|
1327
|
+
event.preventDefault();
|
1328
|
+
}
|
1329
|
+
|
1330
|
+
/*
|
1331
|
+
These variables define how the zflow presentation is made.
|
1332
|
+
*/
|
1333
|
+
|
1334
|
+
const CSIZE = 150;
|
1335
|
+
const CGAP = CSIZE / 2;
|
1336
|
+
|
1337
|
+
const FLOW_ANGLE = 70;
|
1338
|
+
const FLOW_THRESHOLD = CGAP / 2;
|
1339
|
+
const FLOW_ZFOCUS = CSIZE;
|
1340
|
+
const FLOW_XGAP = CSIZE / 3;
|
1341
|
+
|
1342
|
+
const T_NEG_ANGLE = "rotateY(" + (- FLOW_ANGLE) + "deg)";
|
1343
|
+
const T_ANGLE = "rotateY(" + FLOW_ANGLE + "deg)";
|
1344
|
+
const T_ZFOCUS = "translateZ(" + FLOW_ZFOCUS + "px)";
|
1345
|
+
|
1346
|
+
FlowDelegate = function ()
|
1347
|
+
{
|
1348
|
+
this.cells = new Array();
|
1349
|
+
this.transforms = new Array();
|
1350
|
+
}
|
1351
|
+
|
1352
|
+
FlowDelegate.prototype.init = function (elem)
|
1353
|
+
{
|
1354
|
+
this.elem = elem;
|
1355
|
+
}
|
1356
|
+
|
1357
|
+
FlowDelegate.prototype.updateTouchEnd = function (controller)
|
1358
|
+
{
|
1359
|
+
this.lastFocus = undefined;
|
1360
|
+
|
1361
|
+
// Snap to nearest position
|
1362
|
+
var i = this.getFocusedCell(controller.currentX);
|
1363
|
+
|
1364
|
+
controller.currentX = - i * CGAP;
|
1365
|
+
this.update(controller.currentX);
|
1366
|
+
}
|
1367
|
+
|
1368
|
+
FlowDelegate.prototype.clicked = function (currentX)
|
1369
|
+
{
|
1370
|
+
var i = - Math.round(currentX / CGAP);
|
1371
|
+
var cell = this.cells[i];
|
1372
|
+
galleryCell = i; //save the key for use in show_image div
|
1373
|
+
// ADDED window.open() - "_self" CAN BE CHANGED TO "_blank" 0R AN EXPLICITLY NAMED WINDOW
|
1374
|
+
//window.open(imagesArray[i],"_blank");
|
1375
|
+
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
FlowDelegate.prototype.getFocusedCell = function (currentX)
|
1379
|
+
{
|
1380
|
+
// Snap to nearest position
|
1381
|
+
var i = - Math.round(currentX / CGAP);
|
1382
|
+
|
1383
|
+
// Clamp to cells array boundary
|
1384
|
+
return Math.min(Math.max(i, 0), this.cells.length - 1);
|
1385
|
+
}
|
1386
|
+
|
1387
|
+
FlowDelegate.prototype.transformForCell = function (cell, i, offset)
|
1388
|
+
{
|
1389
|
+
/*
|
1390
|
+
This function needs to be fast, so we avoid function calls, divides, Math.round,
|
1391
|
+
and precalculate any invariants we can.
|
1392
|
+
*/
|
1393
|
+
var x = (i * CGAP);
|
1394
|
+
var ix = x + offset;
|
1395
|
+
|
1396
|
+
if ((ix < FLOW_THRESHOLD) && (ix >= -FLOW_THRESHOLD))
|
1397
|
+
{
|
1398
|
+
// yangle = 0, zpos = FLOW_ZFOCUS
|
1399
|
+
return T_ZFOCUS + " translateX(" + x + "px)";
|
1400
|
+
}
|
1401
|
+
else if (ix > 0)
|
1402
|
+
{
|
1403
|
+
// yangle = -FLOW_ANGLE, x + FLOW_XGAP
|
1404
|
+
return "translateX(" + (x + FLOW_XGAP) + "px) " + T_NEG_ANGLE;
|
1405
|
+
}
|
1406
|
+
else
|
1407
|
+
{
|
1408
|
+
// yangle = FLOW_ANGLE, x - FLOW_XGAP
|
1409
|
+
return "translateX(" + (x - FLOW_XGAP) + "px) " + T_ANGLE;
|
1410
|
+
}
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
FlowDelegate.prototype.setTransformForCell = function (cell, i, transform)
|
1414
|
+
{
|
1415
|
+
if (this.transforms[i] != transform)
|
1416
|
+
{
|
1417
|
+
cell.style.webkitTransform = transform;
|
1418
|
+
this.transforms[i] = transform;
|
1419
|
+
}
|
1420
|
+
}
|
1421
|
+
|
1422
|
+
|
1423
|
+
FlowDelegate.prototype.update = function (currentX)
|
1424
|
+
{
|
1425
|
+
this.elem.style.webkitTransform = "translateX(" + (currentX) + "px)";
|
1426
|
+
|
1427
|
+
/*
|
1428
|
+
It would be nice if we only updated dirty cells... for now, we use a cache
|
1429
|
+
*/
|
1430
|
+
for (var i in this.cells)
|
1431
|
+
{
|
1432
|
+
var cell = this.cells[i];
|
1433
|
+
this.setTransformForCell(cell, i, this.transformForCell(cell, i, currentX));
|
1434
|
+
i += 1;
|
1435
|
+
}
|
1436
|
+
}
|
1437
|
+
var controller = new TrayController();
|
1438
|
+
var delegate = new FlowDelegate();
|
1439
|
+
|
1440
|
+
global.zflow = function (images, selector)
|
1441
|
+
{
|
1442
|
+
var tray = document.querySelector(selector);
|
1443
|
+
controller.init(tray);
|
1444
|
+
delegate.init(tray);
|
1445
|
+
controller.delegate = delegate;
|
1446
|
+
|
1447
|
+
// WE NO LONGER NEED THIS VARIABLE
|
1448
|
+
// var imagesLeft = images.length;
|
1449
|
+
|
1450
|
+
var cellCSS = {
|
1451
|
+
top: Math.round(-CSIZE * 0.65) + "px",
|
1452
|
+
left: Math.round(-CSIZE / 2) + "px",
|
1453
|
+
width: CSIZE + "px",
|
1454
|
+
height: Math.round(CSIZE * 1.5) + "px",
|
1455
|
+
opacity: 0,
|
1456
|
+
}
|
1457
|
+
|
1458
|
+
var i = 0;
|
1459
|
+
|
1460
|
+
function makeCell()
|
1461
|
+
{
|
1462
|
+
|
1463
|
+
var cell = document.createElement("div");
|
1464
|
+
var image = document.createElement("img");
|
1465
|
+
var canvas = document.createElement("canvas");
|
1466
|
+
var link = document.createElement("a");
|
1467
|
+
// CREATE caption element
|
1468
|
+
var caption = document.createElement("caption");
|
1469
|
+
|
1470
|
+
cell.className = "cell";
|
1471
|
+
cell.appendChild(link);
|
1472
|
+
link.appendChild(image);
|
1473
|
+
cell.appendChild(canvas);
|
1474
|
+
|
1475
|
+
// ADD caption to cell
|
1476
|
+
cell.appendChild(caption);
|
1477
|
+
|
1478
|
+
// ASSIGN SRC DIRECTLY FROM THE IMAGES ARRAY SINCE IT'S NO LONGER PASSED AS A PARAMETER OF THE FUNCTION
|
1479
|
+
image.src = images[i];
|
1480
|
+
imagesArray[i] = images[i];
|
1481
|
+
link.href = "show_image?fName="+images[i];
|
1482
|
+
link.className = "slide-right";
|
1483
|
+
global.afnc = function () {
|
1484
|
+
var iwidth = image.width;
|
1485
|
+
var iheight = image.height;
|
1486
|
+
|
1487
|
+
var ratio = Math.min(CSIZE / iheight, CSIZE / iwidth);
|
1488
|
+
|
1489
|
+
iwidth *= ratio;
|
1490
|
+
iheight *= ratio;
|
1491
|
+
|
1492
|
+
utils_setsize(image, iwidth, iheight);
|
1493
|
+
|
1494
|
+
utils_extend(cell.style, cellCSS);
|
1495
|
+
|
1496
|
+
utils_setxy(image, (CSIZE - iwidth) / 2, CSIZE - iheight);
|
1497
|
+
utils_setxy(canvas, (CSIZE - iwidth) / 2, CSIZE);
|
1498
|
+
|
1499
|
+
// POSITION caption - this can be tweaked to place it where you like
|
1500
|
+
utils_setxy(caption, (CSIZE - iwidth) / 2, CSIZE + 10);
|
1501
|
+
|
1502
|
+
reflect(image, iwidth, iheight, canvas);
|
1503
|
+
|
1504
|
+
// CALL FUNCTION writeCaption()
|
1505
|
+
var $tCaption = images[i].match(/(.*)[\/\\]([^\/\\]+)\.\w+$/)[2]; //strip the path
|
1506
|
+
$tCaption = $tCaption.replace(/_/g, ' '); //replace the _ with blank
|
1507
|
+
$tCaption = $tCaption.replace( /(^|\s)([a-z])/g , function(m,p1,p2){ return p1+p2.toUpperCase(); } ); //cap first word
|
1508
|
+
captionsArray[i] = $tCaption; //store the capation in the array
|
1509
|
+
writeCaption(caption, iwidth, i);
|
1510
|
+
|
1511
|
+
delegate.setTransformForCell(cell, delegate.cells.length, delegate.transformForCell(cell, delegate.cells.length, controller.currentX));
|
1512
|
+
delegate.cells.push(cell);
|
1513
|
+
|
1514
|
+
// Start at 0 opacity
|
1515
|
+
tray.appendChild(cell);
|
1516
|
+
// Set to 1 to fade element in.
|
1517
|
+
cell.style.opacity = 1.0;
|
1518
|
+
|
1519
|
+
// THIS MAKES THE NEXT CELL IF NECESSARY
|
1520
|
+
if (i < (images.length - 1))
|
1521
|
+
{
|
1522
|
+
i++;
|
1523
|
+
makeCell();
|
1524
|
+
}
|
1525
|
+
else
|
1526
|
+
{
|
1527
|
+
window.setTimeout( function() { window.scrollTo(0, 0); }, 100 );
|
1528
|
+
galleryInit = 1;
|
1529
|
+
}
|
1530
|
+
} // end afnc
|
1531
|
+
|
1532
|
+
image.addEventListener("load", afnc, true );
|
1533
|
+
|
1534
|
+
};
|
1535
|
+
|
1536
|
+
|
1537
|
+
// INITIATE CELL CREATION
|
1538
|
+
makeCell();
|
1539
|
+
tray.addEventListener('touchstart', controller, false);
|
1540
|
+
}
|
1541
|
+
|
1542
|
+
global.zflowCleanup = function (selector)
|
1543
|
+
{
|
1544
|
+
var tray = document.querySelector(selector);
|
1545
|
+
if (tray) {
|
1546
|
+
if (tray.childNodes.length > 0) {
|
1547
|
+
delegate.transforms.length = 0;
|
1548
|
+
delegate.cells.length = 0;
|
1549
|
+
while (tray.hasChildNodes()) {
|
1550
|
+
var image = tray.childNodes[0].childNodes[0].childNodes[0];
|
1551
|
+
image.removeEventListener("load", afnc, true); //remove the listener first
|
1552
|
+
tray.removeChild(tray.childNodes[0]);
|
1553
|
+
}
|
1554
|
+
var div = document.getElementById('gallery');
|
1555
|
+
if (div) {
|
1556
|
+
div.parentNode.removeChild(div); //take the gallery out so it will reload
|
1557
|
+
galleryInit = 0; //reset the init flag
|
1558
|
+
galleryCell = 0; //reset the image flag
|
1559
|
+
}
|
1560
|
+
}
|
1561
|
+
}
|
1562
|
+
}
|
1563
|
+
|
1564
|
+
global.zflowGetImageSource = function (selector, index)
|
1565
|
+
{
|
1566
|
+
var tray = document.querySelector(selector);
|
1567
|
+
var imageSrc= "";
|
1568
|
+
if (tray) {
|
1569
|
+
if (tray.childNodes.length > 0) {
|
1570
|
+
while (tray.hasChildNodes()) {
|
1571
|
+
imageSrc = tray.childNodes[0].childNodes[0].childNodes[index].src;
|
1572
|
+
}
|
1573
|
+
}
|
1574
|
+
}
|
1575
|
+
return imageSrc;
|
1576
|
+
}
|
1577
|
+
|
1578
|
+
// FUNCTION TO SET WIDTH AND WRITE CAPTION
|
1579
|
+
function writeCaption(caption, iwidth, i) {
|
1580
|
+
caption.width = iwidth;
|
1581
|
+
caption.innerHTML = captionsArray[i];
|
1582
|
+
}
|
1583
|
+
|
1584
|
+
function reflect(image, iwidth, iheight, canvas)
|
1585
|
+
{
|
1586
|
+
canvas.width = iwidth;
|
1587
|
+
canvas.height = iheight / 2;
|
1588
|
+
|
1589
|
+
var ctx = canvas.getContext("2d");
|
1590
|
+
|
1591
|
+
ctx.save();
|
1592
|
+
|
1593
|
+
ctx.translate(0, iheight - 1);
|
1594
|
+
ctx.scale(1, -1);
|
1595
|
+
ctx.drawImage(image, 0, 0, iwidth, iheight);
|
1596
|
+
|
1597
|
+
ctx.restore();
|
1598
|
+
|
1599
|
+
ctx.globalCompositeOperation = "destination-out";
|
1600
|
+
|
1601
|
+
var gradient = ctx.createLinearGradient(0, 0, 0, iheight / 2);
|
1602
|
+
gradient.addColorStop(1, "rgba(255, 255, 255, 1.0)");
|
1603
|
+
gradient.addColorStop(0, "rgba(255, 255, 255, 0.5)");
|
1604
|
+
|
1605
|
+
ctx.fillStyle = gradient;
|
1606
|
+
ctx.fillRect(0, 0, iwidth, iheight / 2);
|
1607
|
+
}
|
1608
|
+
|
1609
|
+
})();
|
1610
|
+
|
1611
|
+
|
1612
|
+
|
708
1613
|
/*
|
709
1614
|
|
710
1615
|
_/ _/_/ _/_/_/_/_/ _/
|
@@ -1024,4 +1929,1123 @@
|
|
1024
1929
|
}
|
1025
1930
|
});
|
1026
1931
|
}
|
1932
|
+
})(jQuery);
|
1933
|
+
|
1934
|
+
/**
|
1935
|
+
*
|
1936
|
+
* Add support for scaling using jQTouch
|
1937
|
+
*
|
1938
|
+
* Copyright (c) 2009 Sam Shull <http://www.google.com/profiles/brickysam26>
|
1939
|
+
* Released under MIT license
|
1940
|
+
*
|
1941
|
+
* <code>
|
1942
|
+
*
|
1943
|
+
* <div>
|
1944
|
+
* <img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome" class="scalable"/>
|
1945
|
+
* </div>
|
1946
|
+
*
|
1947
|
+
* </code>
|
1948
|
+
*
|
1949
|
+
* Known issues:
|
1950
|
+
* - using a link that is a slideSelector (ie: body > * > ul li a) on the same psuedo-page causes problems during scaling
|
1951
|
+
*
|
1952
|
+
*
|
1953
|
+
* $Revision$
|
1954
|
+
* $Date$
|
1955
|
+
* $LastChangedBy$
|
1956
|
+
*
|
1957
|
+
*/
|
1958
|
+
|
1959
|
+
(function($)
|
1960
|
+
{
|
1961
|
+
|
1962
|
+
$.fn.scalable = function (options)
|
1963
|
+
{
|
1964
|
+
return this.each(function ()
|
1965
|
+
{
|
1966
|
+
new iScale( this, options );
|
1967
|
+
});
|
1968
|
+
};
|
1969
|
+
|
1970
|
+
if ($.jQTouch)
|
1971
|
+
{
|
1972
|
+
$.jQTouch.addExtension(function (jQT){
|
1973
|
+
|
1974
|
+
function binder (e, info)
|
1975
|
+
{
|
1976
|
+
info.page.find('.scalable').scalable();
|
1977
|
+
}
|
1978
|
+
|
1979
|
+
$(document.body)
|
1980
|
+
.bind('pageInserted', binder);
|
1981
|
+
|
1982
|
+
$(function()
|
1983
|
+
{
|
1984
|
+
$('body > *')
|
1985
|
+
.each(function()
|
1986
|
+
{
|
1987
|
+
binder({}, {page: $(this)});
|
1988
|
+
});
|
1989
|
+
});
|
1990
|
+
|
1991
|
+
return {};
|
1992
|
+
});
|
1993
|
+
|
1994
|
+
|
1995
|
+
function iScale (el, options)
|
1996
|
+
{
|
1997
|
+
var that = this;
|
1998
|
+
|
1999
|
+
this.numberOfTouches = 2;
|
2000
|
+
|
2001
|
+
this.element = el;
|
2002
|
+
this.scale(1);
|
2003
|
+
this.refresh();
|
2004
|
+
|
2005
|
+
this.scaleLessThanOne = false;
|
2006
|
+
|
2007
|
+
el.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)';
|
2008
|
+
|
2009
|
+
el.addEventListener('touchstart', this, false);
|
2010
|
+
//moved up here because I didnt see any reason to add and remove them
|
2011
|
+
el.addEventListener('touchmove', this, false);
|
2012
|
+
el.addEventListener('touchend', this, false);
|
2013
|
+
|
2014
|
+
window.addEventListener('unload', function ()
|
2015
|
+
{
|
2016
|
+
el.removeEventListener('touchstart', that, false);
|
2017
|
+
el.removeEventListener('touchmove', that, false);
|
2018
|
+
el.removeEventListener('touchend', that, false);
|
2019
|
+
|
2020
|
+
this.removeEventListener('unload', arguments.callee, false);
|
2021
|
+
}, false);
|
2022
|
+
|
2023
|
+
if (options)
|
2024
|
+
{
|
2025
|
+
$.extend(this, options);
|
2026
|
+
}
|
2027
|
+
}
|
2028
|
+
|
2029
|
+
iScale.prototype = {
|
2030
|
+
handleEvent: function(e) {
|
2031
|
+
switch(e.type) {
|
2032
|
+
case 'touchstart': return this.onTouchStart(e); break;
|
2033
|
+
case 'touchmove': return this.onTouchMove(e); break;
|
2034
|
+
case 'touchend': return this.onTouchEnd(e); break;
|
2035
|
+
}
|
2036
|
+
},
|
2037
|
+
|
2038
|
+
scale: function (scale) {
|
2039
|
+
if (scale !== undefined)
|
2040
|
+
{
|
2041
|
+
this._scale = scale;
|
2042
|
+
this.element.style.webkitTransform = 'scale('+scale+')';
|
2043
|
+
return;
|
2044
|
+
}
|
2045
|
+
|
2046
|
+
return this._scale;
|
2047
|
+
},
|
2048
|
+
|
2049
|
+
refresh: function() {
|
2050
|
+
this.element.style.webkitTransitionDuration = '0';
|
2051
|
+
},
|
2052
|
+
|
2053
|
+
onTouchStart: function(e) {
|
2054
|
+
if ( e.targetTouches.length != this.numberOfTouches )
|
2055
|
+
{
|
2056
|
+
return;
|
2057
|
+
}
|
2058
|
+
|
2059
|
+
this.refresh();
|
2060
|
+
|
2061
|
+
this.moved = false;
|
2062
|
+
|
2063
|
+
this.startDistance = Math.sqrt(
|
2064
|
+
Math.pow((e.targetTouches[1].clientX - e.targetTouches[0].clientX), 2)
|
2065
|
+
+ Math.pow((e.targetTouches[1].clientX - e.targetTouches[0].clientX), 2)
|
2066
|
+
);
|
2067
|
+
|
2068
|
+
return false;
|
2069
|
+
},
|
2070
|
+
|
2071
|
+
onTouchMove: function(e) {
|
2072
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2073
|
+
return;
|
2074
|
+
|
2075
|
+
e.preventDefault();
|
2076
|
+
|
2077
|
+
this.moved = true;
|
2078
|
+
|
2079
|
+
this.refresh();
|
2080
|
+
|
2081
|
+
var newDistance = Math.sqrt(
|
2082
|
+
Math.pow((e.targetTouches[1].clientX - e.targetTouches[0].clientX), 2)
|
2083
|
+
+ Math.pow((e.targetTouches[1].clientY - e.targetTouches[0].clientY), 2)
|
2084
|
+
),
|
2085
|
+
difference = newDistance - this.startDistance,
|
2086
|
+
percentChange = (difference / this.startDistance) / 2;
|
2087
|
+
|
2088
|
+
this.scale(this.scale() + (this.scale() * percentChange));
|
2089
|
+
|
2090
|
+
this.startDistance = newDistance;
|
2091
|
+
|
2092
|
+
return false;
|
2093
|
+
},
|
2094
|
+
|
2095
|
+
onTouchEnd: function(e) {
|
2096
|
+
var theTarget,theEvent;
|
2097
|
+
|
2098
|
+
if( !this.moved ) {
|
2099
|
+
theTarget = e.target;
|
2100
|
+
if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
|
2101
|
+
theEvent = document.createEvent("MouseEvents");
|
2102
|
+
theEvent.initEvent('click', true, true);
|
2103
|
+
theTarget.dispatchEvent(theEvent);
|
2104
|
+
return;
|
2105
|
+
}
|
2106
|
+
|
2107
|
+
e.preventDefault();
|
2108
|
+
e.stopPropagation();
|
2109
|
+
|
2110
|
+
if (!this.scaleLessThanOne && this.scale() < 1)
|
2111
|
+
{
|
2112
|
+
this.element.style.webkitTransitionDuration = '200ms';
|
2113
|
+
this.scale(1);
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
return false;
|
2117
|
+
},
|
2118
|
+
|
2119
|
+
scaleTo: function(dest, runtime) {
|
2120
|
+
this.element.style.webkitTransitionDuration = runtime ? runtime : '300ms';
|
2121
|
+
this.scale(dest ? dest : 0);
|
2122
|
+
}
|
2123
|
+
};
|
2124
|
+
}
|
2125
|
+
})(jQuery);
|
2126
|
+
|
2127
|
+
/**
|
2128
|
+
*
|
2129
|
+
* Add support for scrolling horizontally and vertically using jQTouch in Safari Mobile
|
2130
|
+
*
|
2131
|
+
* Copyright (c) 2009 Sam Shull <http://www.google.com/profiles/brickysam26>
|
2132
|
+
* Released under MIT license
|
2133
|
+
*
|
2134
|
+
* <code>
|
2135
|
+
* <div id="vertical-scrolling-example">
|
2136
|
+
* <div class="toolbar">
|
2137
|
+
* <h1>Vertical Scroll Example</h1>
|
2138
|
+
* </div>
|
2139
|
+
* <div class="vertical-scroll">
|
2140
|
+
* <div>
|
2141
|
+
* This is where you insert scollable text
|
2142
|
+
* </div>
|
2143
|
+
* </div>
|
2144
|
+
* </div>
|
2145
|
+
*
|
2146
|
+
* <div id="horizontal-scrolling-example">
|
2147
|
+
* <div class="toolbar">
|
2148
|
+
* <h1>Horizontal Scroll Example</h1>
|
2149
|
+
* </div>
|
2150
|
+
* <a href="#home" class="grayButton swap">Gotta have something here or you get a flicker</a>
|
2151
|
+
* <div class="horizontal-scroll">
|
2152
|
+
* <table>
|
2153
|
+
* <tr>
|
2154
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2155
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2156
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2157
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2158
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2159
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2160
|
+
* <td><div class="scroll-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2161
|
+
* </tr>
|
2162
|
+
* </table>
|
2163
|
+
* </div>
|
2164
|
+
* </div>
|
2165
|
+
* </code>
|
2166
|
+
*
|
2167
|
+
*
|
2168
|
+
* Known issues:
|
2169
|
+
* - slideSelector must be explicitly set to a class like .slideRight in order for the slide selector to work
|
2170
|
+
* - horizontal scroll flickers without a button above it
|
2171
|
+
* - must define a class selector for slideSelector to operate properly within the scroll box
|
2172
|
+
*
|
2173
|
+
* $Revision$
|
2174
|
+
* $Date$
|
2175
|
+
* $LastChangedBy$
|
2176
|
+
*
|
2177
|
+
*/
|
2178
|
+
|
2179
|
+
(function($)
|
2180
|
+
{
|
2181
|
+
|
2182
|
+
$.fn.scrollVertically = function (options)
|
2183
|
+
{
|
2184
|
+
return this.each(function ()
|
2185
|
+
{
|
2186
|
+
new iScroll( this, options );
|
2187
|
+
});
|
2188
|
+
};
|
2189
|
+
|
2190
|
+
$.fn.scrollHorizontally = function (options)
|
2191
|
+
{
|
2192
|
+
return this.each(function ()
|
2193
|
+
{
|
2194
|
+
new iScrollHorizontal( this, options );
|
2195
|
+
});
|
2196
|
+
};
|
2197
|
+
|
2198
|
+
|
2199
|
+
if ($.jQTouch)
|
2200
|
+
{
|
2201
|
+
$.jQTouch.addExtension(function (jQT){
|
2202
|
+
|
2203
|
+
function binder (e, info)
|
2204
|
+
{
|
2205
|
+
var horizontal = info.page.find('.horizontal-scroll > table'),
|
2206
|
+
vertical = info.page.find('.vertical-scroll > div');
|
2207
|
+
|
2208
|
+
horizontal.scrollHorizontally({acceleration: Number(horizontal.attr("scrollspeed")|| 0.009)});
|
2209
|
+
vertical.scrollVertically({acceleration: Number(vertical.attr("scrollspeed") || 0.009)});
|
2210
|
+
}
|
2211
|
+
|
2212
|
+
$(document.body)
|
2213
|
+
.bind('pageInserted', binder);
|
2214
|
+
|
2215
|
+
$(function()
|
2216
|
+
{
|
2217
|
+
$('body > *')
|
2218
|
+
.each(function()
|
2219
|
+
{
|
2220
|
+
binder({}, {page: $(this)});
|
2221
|
+
});
|
2222
|
+
});
|
2223
|
+
|
2224
|
+
return {};
|
2225
|
+
});
|
2226
|
+
|
2227
|
+
/**
|
2228
|
+
*
|
2229
|
+
* Find more about the scrolling function at
|
2230
|
+
* http://cubiq.org/scrolling-div-on-iphone-ipod-touch/5
|
2231
|
+
*
|
2232
|
+
* Copyright (c) 2009 Matteo Spinelli, http://cubiq.org/
|
2233
|
+
* Released under MIT license
|
2234
|
+
* http://cubiq.org/dropbox/mit-license.txt
|
2235
|
+
*
|
2236
|
+
* Version 2.3 - Last updated: 2009.07.09
|
2237
|
+
* Changes - 10/22/09 - cleaned up a little by Sam Shull
|
2238
|
+
*
|
2239
|
+
*/
|
2240
|
+
|
2241
|
+
function iScroll(el, options)
|
2242
|
+
{
|
2243
|
+
var that = this;
|
2244
|
+
|
2245
|
+
this.numberOfTouches = 1;
|
2246
|
+
|
2247
|
+
this.element = el;
|
2248
|
+
this.position(0);
|
2249
|
+
this.refresh();
|
2250
|
+
el.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)';
|
2251
|
+
this.acceleration = 0.009;
|
2252
|
+
|
2253
|
+
el.addEventListener('touchstart', this, false);
|
2254
|
+
//moved up here because I didnt see any reason to add and remove them
|
2255
|
+
|
2256
|
+
window.addEventListener('unload', function ()
|
2257
|
+
{
|
2258
|
+
el.removeEventListener('touchstart', that, false);
|
2259
|
+
window.removeEventListener('unload', arguments.callee, false);
|
2260
|
+
}, false);
|
2261
|
+
|
2262
|
+
if (options)
|
2263
|
+
{
|
2264
|
+
$.extend(this, options);
|
2265
|
+
}
|
2266
|
+
}
|
2267
|
+
|
2268
|
+
iScroll.prototype = {
|
2269
|
+
handleEvent: function(e) {
|
2270
|
+
switch(e.type) {
|
2271
|
+
case 'touchstart': this.onTouchStart(e); break;
|
2272
|
+
case 'touchmove': this.onTouchMove(e); break;
|
2273
|
+
case 'touchend': this.onTouchEnd(e); break;
|
2274
|
+
case 'webkitTransitionEnd': this.onTransitionEnd(e); break;
|
2275
|
+
}
|
2276
|
+
},
|
2277
|
+
|
2278
|
+
//i combined the getter and setter in order to make this
|
2279
|
+
//more forward compatible since that is a deprecated api
|
2280
|
+
position: function (pos) {
|
2281
|
+
if (pos !== undefined)
|
2282
|
+
{
|
2283
|
+
this._position = pos;
|
2284
|
+
this.element.style.webkitTransform = 'translate3d(0, ' + pos + 'px, 0)';
|
2285
|
+
return;
|
2286
|
+
}
|
2287
|
+
|
2288
|
+
return this._position;
|
2289
|
+
},
|
2290
|
+
|
2291
|
+
refresh: function() {
|
2292
|
+
this.element.style.webkitTransitionDuration = '0';
|
2293
|
+
|
2294
|
+
if( this.element.offsetHeight<this.element.parentNode.clientHeight )
|
2295
|
+
this.maxScroll = 0;
|
2296
|
+
else
|
2297
|
+
this.maxScroll = this.element.parentNode.clientHeight - this.element.offsetHeight;
|
2298
|
+
},
|
2299
|
+
|
2300
|
+
onTouchStart: function(e) {
|
2301
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2302
|
+
return;
|
2303
|
+
|
2304
|
+
e.preventDefault();
|
2305
|
+
|
2306
|
+
this.refresh();
|
2307
|
+
|
2308
|
+
var theTransform = window.getComputedStyle(this.element).webkitTransform;
|
2309
|
+
theTransform = new WebKitCSSMatrix(theTransform).m42;
|
2310
|
+
if( theTransform!=this.position() )
|
2311
|
+
this.position(theTransform);
|
2312
|
+
|
2313
|
+
this.startY = e.targetTouches[0].clientY;
|
2314
|
+
this.scrollStartY = this.position();
|
2315
|
+
this.scrollStartTime = e.timeStamp;
|
2316
|
+
this.moved = false;
|
2317
|
+
|
2318
|
+
//moved
|
2319
|
+
this.element.addEventListener('touchmove', this, false);
|
2320
|
+
this.element.addEventListener('touchend', this, false);
|
2321
|
+
//return false;
|
2322
|
+
},
|
2323
|
+
|
2324
|
+
onTouchMove: function(e) {
|
2325
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2326
|
+
return;
|
2327
|
+
|
2328
|
+
e.preventDefault();
|
2329
|
+
var topDelta = e.targetTouches[0].clientY - this.startY;
|
2330
|
+
if( this.position() > 0 || this.position() < this.maxScroll ) topDelta/=2;
|
2331
|
+
this.position(this.position() + topDelta);
|
2332
|
+
this.startY = e.targetTouches[0].clientY;
|
2333
|
+
this.moved = true;
|
2334
|
+
|
2335
|
+
// Prevent slingshot effect
|
2336
|
+
if( e.timeStamp-this.scrollStartTime>100 ) {
|
2337
|
+
this.scrollStartY = this.position();
|
2338
|
+
this.scrollStartTime = e.timeStamp;
|
2339
|
+
}
|
2340
|
+
|
2341
|
+
//return false;
|
2342
|
+
},
|
2343
|
+
|
2344
|
+
onTouchEnd: function(e) {
|
2345
|
+
//moved
|
2346
|
+
this.element.removeEventListener('touchmove', this, false);
|
2347
|
+
this.element.removeEventListener('touchend', this, false);
|
2348
|
+
e.preventDefault();
|
2349
|
+
var newPosition,theTarget,theEvent,scrollDistance,scrollDuration,newDuration,newScrollDistance;
|
2350
|
+
|
2351
|
+
// If we are outside of the boundaries, let's go back to the sheepfold
|
2352
|
+
if( this.position() > 0 || this.position() < this.maxScroll ) {
|
2353
|
+
this.scrollTo(this.position() > 0 ? 0 : this.maxScroll);
|
2354
|
+
return;
|
2355
|
+
}
|
2356
|
+
|
2357
|
+
if( !this.moved ) {
|
2358
|
+
theTarget = e.target;
|
2359
|
+
if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
|
2360
|
+
theEvent = document.createEvent("MouseEvents");
|
2361
|
+
theEvent.initEvent('click', true, true);
|
2362
|
+
theTarget.dispatchEvent(theEvent);
|
2363
|
+
return false
|
2364
|
+
}
|
2365
|
+
|
2366
|
+
// Lame formula to calculate a fake deceleration
|
2367
|
+
scrollDistance = this.position() - this.scrollStartY;
|
2368
|
+
scrollDuration = e.timeStamp - this.scrollStartTime;
|
2369
|
+
|
2370
|
+
newDuration = (2 * scrollDistance / scrollDuration) / this.acceleration;
|
2371
|
+
newScrollDistance = (this.acceleration / 2) * (newDuration * newDuration);
|
2372
|
+
|
2373
|
+
if( newDuration<0 ) {
|
2374
|
+
newDuration = -newDuration;
|
2375
|
+
newScrollDistance = -newScrollDistance;
|
2376
|
+
}
|
2377
|
+
|
2378
|
+
newPosition = this.position() + newScrollDistance;
|
2379
|
+
|
2380
|
+
if( newPosition>this.element.parentNode.clientHeight/2 )
|
2381
|
+
newPosition = this.element.parentNode.clientHeight/2;
|
2382
|
+
else if( newPosition>0 )
|
2383
|
+
newPosition/= 1.5;
|
2384
|
+
else if( newPosition<this.maxScroll-this.element.parentNode.clientHeight/2 )
|
2385
|
+
newPosition = this.maxScroll-this.element.parentNode.clientHeight/2;
|
2386
|
+
else if( newPosition<this.maxScroll )
|
2387
|
+
newPosition = (newPosition - this.maxScroll) / 1.5 + this.maxScroll;
|
2388
|
+
else
|
2389
|
+
newDuration*= 6;
|
2390
|
+
|
2391
|
+
this.scrollTo(newPosition, Math.round(newDuration) + 'ms');
|
2392
|
+
|
2393
|
+
//return false;
|
2394
|
+
},
|
2395
|
+
|
2396
|
+
onTransitionEnd: function() {
|
2397
|
+
this.element.removeEventListener('webkitTransitionEnd', this, false);
|
2398
|
+
this.scrollTo( this.position() > 0 ? 0 : this.maxScroll );
|
2399
|
+
},
|
2400
|
+
|
2401
|
+
scrollTo: function(dest, runtime) {
|
2402
|
+
this.element.style.webkitTransitionDuration = runtime ? runtime : '300ms';
|
2403
|
+
this.position(dest ? dest : 0);
|
2404
|
+
|
2405
|
+
// If we are outside of the boundaries at the end of the transition go back to the sheepfold
|
2406
|
+
if( this.position() > 0 || this.position() < this.maxScroll )
|
2407
|
+
this.element.addEventListener('webkitTransitionEnd', this, false);
|
2408
|
+
}
|
2409
|
+
};
|
2410
|
+
|
2411
|
+
/**
|
2412
|
+
*
|
2413
|
+
* A horizontal revision of iScroll by Matteo Spinelli, http://cubiq.org/
|
2414
|
+
*
|
2415
|
+
* Copyright (c) 2009 Sam Shull <http://www.google.com/profiles/brickysam26>
|
2416
|
+
* Released under MIT license
|
2417
|
+
*
|
2418
|
+
* Version 0.1
|
2419
|
+
*
|
2420
|
+
*/
|
2421
|
+
function iScrollHorizontal(el, options)
|
2422
|
+
{
|
2423
|
+
var that = this;
|
2424
|
+
|
2425
|
+
this.numberOfTouches = 1;
|
2426
|
+
|
2427
|
+
this.element = el;
|
2428
|
+
this.position(0);
|
2429
|
+
this.refresh();
|
2430
|
+
el.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)';
|
2431
|
+
this.acceleration = 0.009;
|
2432
|
+
|
2433
|
+
el.addEventListener('touchstart', this, false);
|
2434
|
+
//moved up here because I didnt see any reason to add and remove them
|
2435
|
+
|
2436
|
+
window.addEventListener('unload', function ()
|
2437
|
+
{
|
2438
|
+
el.removeEventListener('touchstart', that, false);
|
2439
|
+
window.removeEventListener('unload', arguments.callee, false);
|
2440
|
+
}, false);
|
2441
|
+
|
2442
|
+
if (options)
|
2443
|
+
{
|
2444
|
+
$.extend(this, options);
|
2445
|
+
}
|
2446
|
+
}
|
2447
|
+
|
2448
|
+
iScrollHorizontal.prototype = {
|
2449
|
+
handleEvent: function(e) {
|
2450
|
+
switch(e.type) {
|
2451
|
+
case 'touchstart': this.onTouchStart(e); break;
|
2452
|
+
case 'touchmove': this.onTouchMove(e); break;
|
2453
|
+
case 'touchend': this.onTouchEnd(e); break;
|
2454
|
+
case 'webkitTransitionEnd': this.onTransitionEnd(e); break;
|
2455
|
+
}
|
2456
|
+
},
|
2457
|
+
|
2458
|
+
position: function (pos) {
|
2459
|
+
if (pos !== undefined)
|
2460
|
+
{
|
2461
|
+
this._position = pos;
|
2462
|
+
this.element.style.webkitTransform = 'translateX(' + pos + 'px)';
|
2463
|
+
return;
|
2464
|
+
}
|
2465
|
+
|
2466
|
+
return this._position;
|
2467
|
+
},
|
2468
|
+
|
2469
|
+
refresh: function() {
|
2470
|
+
this.element.style.webkitTransitionDuration = '0';
|
2471
|
+
|
2472
|
+
if( this.element.offsetWidth<this.element.parentNode.clientWidth )
|
2473
|
+
this.maxScroll = 0;
|
2474
|
+
else
|
2475
|
+
this.maxScroll = this.element.parentNode.clientWidth - this.element.offsetWidth;
|
2476
|
+
},
|
2477
|
+
|
2478
|
+
onTouchStart: function(e) {
|
2479
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2480
|
+
return;
|
2481
|
+
|
2482
|
+
e.preventDefault();
|
2483
|
+
|
2484
|
+
this.refresh();
|
2485
|
+
|
2486
|
+
this.startX = e.targetTouches[0].clientX;
|
2487
|
+
this.scrollStartX = this.position();
|
2488
|
+
this.scrollStartTime = e.timeStamp;
|
2489
|
+
this.moved = false;
|
2490
|
+
|
2491
|
+
this.element.addEventListener('touchmove', this, false);
|
2492
|
+
this.element.addEventListener('touchend', this, false);
|
2493
|
+
},
|
2494
|
+
|
2495
|
+
onTouchMove: function(e) {
|
2496
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2497
|
+
return;
|
2498
|
+
|
2499
|
+
e.preventDefault();
|
2500
|
+
var topDelta = e.targetTouches[0].clientX - this.startX;
|
2501
|
+
if( this.position()>0 || this.position()<this.maxScroll ) topDelta/=2;
|
2502
|
+
this.position(this.position() + topDelta);
|
2503
|
+
this.startX = e.targetTouches[0].clientX;
|
2504
|
+
this.moved = true;
|
2505
|
+
|
2506
|
+
// Prevent slingshot effect
|
2507
|
+
if( e.timeStamp-this.scrollStartTime>100 ) {
|
2508
|
+
this.scrollStartX = this.position();
|
2509
|
+
this.scrollStartTime = e.timeStamp;
|
2510
|
+
}
|
2511
|
+
},
|
2512
|
+
|
2513
|
+
onTouchEnd: function(e) {
|
2514
|
+
this.element.removeEventListener('touchmove', this, false);
|
2515
|
+
this.element.removeEventListener('touchend', this, false);
|
2516
|
+
e.preventDefault();
|
2517
|
+
var newPosition,theTarget,theEvent,scrollDistance,scrollDuration,newDuration,newScrollDistance;
|
2518
|
+
|
2519
|
+
if( !this.moved ) {
|
2520
|
+
theTarget = e.target;
|
2521
|
+
if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
|
2522
|
+
theEvent = document.createEvent("MouseEvents");
|
2523
|
+
theEvent.initEvent('click', true, true);
|
2524
|
+
theTarget.dispatchEvent(theEvent);
|
2525
|
+
return false
|
2526
|
+
}
|
2527
|
+
|
2528
|
+
// Lame formula to calculate a fake deceleration
|
2529
|
+
scrollDistance = this.position() - this.scrollStartX;
|
2530
|
+
scrollDuration = e.timeStamp - this.scrollStartTime;
|
2531
|
+
|
2532
|
+
newDuration = (2 * scrollDistance / scrollDuration) / this.acceleration;
|
2533
|
+
newScrollDistance = (this.acceleration / 2) * (newDuration * newDuration);
|
2534
|
+
|
2535
|
+
if( newDuration<0 ) {
|
2536
|
+
newDuration = -newDuration;
|
2537
|
+
newScrollDistance = -newScrollDistance;
|
2538
|
+
}
|
2539
|
+
|
2540
|
+
newPosition = this.position() + newScrollDistance;
|
2541
|
+
|
2542
|
+
if( newPosition>this.element.parentNode.clientWidth/2 )
|
2543
|
+
{
|
2544
|
+
newPosition = this.element.parentNode.clientWidth/2;
|
2545
|
+
}
|
2546
|
+
else if( newPosition<this.maxScroll-this.element.parentNode.clientWidth/2 )
|
2547
|
+
{
|
2548
|
+
newPosition = this.maxScroll-this.element.parentNode.clientWidth/2;
|
2549
|
+
}
|
2550
|
+
else if( newPosition<this.maxScroll )
|
2551
|
+
{
|
2552
|
+
newPosition = (newPosition - this.maxScroll) / 1.5 + this.maxScroll;
|
2553
|
+
}
|
2554
|
+
else
|
2555
|
+
{
|
2556
|
+
newDuration*= 6;
|
2557
|
+
}
|
2558
|
+
|
2559
|
+
this.scrollTo(newPosition, Math.round(newDuration) + 'ms');
|
2560
|
+
|
2561
|
+
//return false;
|
2562
|
+
},
|
2563
|
+
|
2564
|
+
onTransitionEnd: function() {
|
2565
|
+
this.element.removeEventListener('webkitTransitionEnd', this, false);
|
2566
|
+
this.scrollTo( this.position()>0 ? 0 : this.maxScroll );
|
2567
|
+
},
|
2568
|
+
|
2569
|
+
scrollTo: function(dest, runtime) {
|
2570
|
+
this.element.style.webkitTransitionDuration = runtime ? runtime : '300ms';
|
2571
|
+
this.position(dest ? dest : 0);
|
2572
|
+
|
2573
|
+
// If we are outside of the boundaries at the end of the transition go back to the sheepfold
|
2574
|
+
if( this.position()>0 || this.position()<this.maxScroll )
|
2575
|
+
this.element.addEventListener('webkitTransitionEnd', this, false);
|
2576
|
+
}
|
2577
|
+
};
|
2578
|
+
}
|
2579
|
+
})(jQuery);
|
2580
|
+
|
2581
|
+
/**
|
2582
|
+
*
|
2583
|
+
* Add support for sliding horizontally and vertically using jQTouch in Safari Mobile
|
2584
|
+
*
|
2585
|
+
* Copyright (c) 2009 Sam Shull <http://www.google.com/profiles/brickysam26>
|
2586
|
+
* Released under MIT license
|
2587
|
+
*
|
2588
|
+
* <code>
|
2589
|
+
*
|
2590
|
+
* <div id="vertical-sliding-example">
|
2591
|
+
* <div class="toolbar">
|
2592
|
+
* <h1>Vertical Slide Example</h1>
|
2593
|
+
* </div>
|
2594
|
+
* <div class="vertical-slide">
|
2595
|
+
* <div>
|
2596
|
+
* This is where you insert scollable text
|
2597
|
+
* </div>
|
2598
|
+
* </div>
|
2599
|
+
* </div>
|
2600
|
+
*
|
2601
|
+
* <div id="horizontal-sliding-example">
|
2602
|
+
* <div class="toolbar">
|
2603
|
+
* <h1>Horizontal Slide Example</h1>
|
2604
|
+
* </div>
|
2605
|
+
* <a href="#home" class="grayButton swap">Gotta have something here or you get a flicker</a>
|
2606
|
+
* <div class="horizontal-slide">
|
2607
|
+
* <table>
|
2608
|
+
* <tr>
|
2609
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2610
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2611
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2612
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2613
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2614
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2615
|
+
* <td><div class="slide-container"><img src="http://rlv.zcache.com/css_is_awesome_mug-p1687164350719819282objs_210.jpg" alt="CSS Is Awesome"/></div></td>
|
2616
|
+
* </tr>
|
2617
|
+
* </table>
|
2618
|
+
* </div>
|
2619
|
+
* </div>
|
2620
|
+
* </code>
|
2621
|
+
*
|
2622
|
+
* Known issues:
|
2623
|
+
* - horizontal scroll flickers without a button above it
|
2624
|
+
* - must define a class selector for slideSelector to operate properly within the slide box
|
2625
|
+
*
|
2626
|
+
* $Revision$
|
2627
|
+
* $Date$
|
2628
|
+
* $LastChangedBy$
|
2629
|
+
*
|
2630
|
+
*/
|
2631
|
+
|
2632
|
+
(function($)
|
2633
|
+
{
|
2634
|
+
|
2635
|
+
$.fn.slideVertically = function (options)
|
2636
|
+
{
|
2637
|
+
return this.each(function ()
|
2638
|
+
{
|
2639
|
+
new iSlide( this, options );
|
2640
|
+
});
|
2641
|
+
};
|
2642
|
+
|
2643
|
+
$.fn.slideHorizontally = function (options)
|
2644
|
+
{
|
2645
|
+
return this.each(function ()
|
2646
|
+
{
|
2647
|
+
new iSlideHorizontal( this, options );
|
2648
|
+
});
|
2649
|
+
};
|
2650
|
+
|
2651
|
+
if ($.jQTouch)
|
2652
|
+
{
|
2653
|
+
$.jQTouch.addExtension(function (jQT){
|
2654
|
+
|
2655
|
+
function binder (e, info)
|
2656
|
+
{
|
2657
|
+
var horizontal = info.page.find('.horizontal-slide > table'),
|
2658
|
+
vertical = info.page.find('.vertical-slide > div');
|
2659
|
+
|
2660
|
+
horizontal.slideHorizontally({acceleration: Number(horizontal.attr("slidespeed")|| 500) || null});
|
2661
|
+
vertical.slideVertically({acceleration: Number(vertical.attr("slidespeed") || 500)});
|
2662
|
+
}
|
2663
|
+
|
2664
|
+
$(document.body)
|
2665
|
+
.bind('pageInserted', binder);
|
2666
|
+
|
2667
|
+
$(function()
|
2668
|
+
{
|
2669
|
+
$('body > *')
|
2670
|
+
.each(function()
|
2671
|
+
{
|
2672
|
+
binder({}, {page: $(this)});
|
2673
|
+
});
|
2674
|
+
});
|
2675
|
+
|
2676
|
+
return {};
|
2677
|
+
});
|
2678
|
+
|
2679
|
+
/**
|
2680
|
+
*
|
2681
|
+
* Modified version of
|
2682
|
+
* http://cubiq.org/slideing-div-on-iphone-ipod-touch/5
|
2683
|
+
*
|
2684
|
+
* Copyright (c) 2009 Matteo Spinelli, http://cubiq.org/
|
2685
|
+
* Released under MIT license
|
2686
|
+
* http://cubiq.org/dropbox/mit-license.txt
|
2687
|
+
*
|
2688
|
+
*
|
2689
|
+
* Modifications by Sam Shull <http://www.google.com/profiles/brickysam26>
|
2690
|
+
* Released under MIT license
|
2691
|
+
*/
|
2692
|
+
|
2693
|
+
function iSlide(el, options)
|
2694
|
+
{
|
2695
|
+
var that = this;
|
2696
|
+
|
2697
|
+
this.numberOfTouches = 1;
|
2698
|
+
|
2699
|
+
this.acceleration = 500;
|
2700
|
+
|
2701
|
+
this.element = el;
|
2702
|
+
this.position(0);
|
2703
|
+
this.refresh();
|
2704
|
+
el.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)';
|
2705
|
+
|
2706
|
+
el.addEventListener('touchstart', this, false);
|
2707
|
+
//moved up here because I didnt see any reason to add and remove them
|
2708
|
+
|
2709
|
+
window.addEventListener('unload', function ()
|
2710
|
+
{
|
2711
|
+
el.removeEventListener('touchstart', that, false);
|
2712
|
+
window.removeEventListener('unload', arguments.callee, false);
|
2713
|
+
|
2714
|
+
}, false);
|
2715
|
+
|
2716
|
+
if (options)
|
2717
|
+
{
|
2718
|
+
$.extend(this, options);
|
2719
|
+
}
|
2720
|
+
}
|
2721
|
+
|
2722
|
+
iSlide.prototype = {
|
2723
|
+
handleEvent: function(e) {
|
2724
|
+
switch(e.type) {
|
2725
|
+
case 'touchstart': this.onTouchStart(e); break;
|
2726
|
+
case 'touchmove': this.onTouchMove(e); break;
|
2727
|
+
case 'touchend': this.onTouchEnd(e); break;
|
2728
|
+
case 'webkitTransitionEnd': this.onTransitionEnd(e); break;
|
2729
|
+
}
|
2730
|
+
},
|
2731
|
+
|
2732
|
+
//i combined the getter and setter in order to make this
|
2733
|
+
//more forward compatible since that is a deprecated api
|
2734
|
+
position: function (pos) {
|
2735
|
+
if (pos !== undefined)
|
2736
|
+
{
|
2737
|
+
this._position = pos;
|
2738
|
+
this.element.style.webkitTransform = 'translate3d(0, ' + pos + 'px, 0)';
|
2739
|
+
return;
|
2740
|
+
}
|
2741
|
+
|
2742
|
+
return this._position;
|
2743
|
+
},
|
2744
|
+
|
2745
|
+
refresh: function() {
|
2746
|
+
this.element.style.webkitTransitionDuration = '0';
|
2747
|
+
|
2748
|
+
if( this.element.offsetHeight<this.element.parentNode.clientHeight )
|
2749
|
+
this.maxSlide = 0;
|
2750
|
+
else
|
2751
|
+
this.maxSlide = this.element.parentNode.clientHeight - this.element.offsetHeight;
|
2752
|
+
},
|
2753
|
+
|
2754
|
+
onTouchStart: function(e) {
|
2755
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2756
|
+
return;
|
2757
|
+
|
2758
|
+
e.preventDefault();
|
2759
|
+
this.refresh();
|
2760
|
+
|
2761
|
+
var theTransform = window.getComputedStyle(this.element).webkitTransform;
|
2762
|
+
theTransform = new WebKitCSSMatrix(theTransform).m42;
|
2763
|
+
if( theTransform!=this.position() )
|
2764
|
+
this.position(theTransform);
|
2765
|
+
|
2766
|
+
this.startY = e.targetTouches[0].clientY;
|
2767
|
+
this.slideStartY = this.position();
|
2768
|
+
this.slideStartTime = e.timeStamp;
|
2769
|
+
this.moved = false;
|
2770
|
+
|
2771
|
+
this.element.addEventListener('touchmove', this, false);
|
2772
|
+
this.element.addEventListener('touchend', this, false);
|
2773
|
+
|
2774
|
+
return false;
|
2775
|
+
},
|
2776
|
+
|
2777
|
+
onTouchMove: function(e) {
|
2778
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2779
|
+
return;
|
2780
|
+
|
2781
|
+
e.preventDefault();
|
2782
|
+
var topDelta = e.targetTouches[0].clientY - this.startY;
|
2783
|
+
if( this.position()>0 || this.position()<this.maxSlide ) topDelta/=2;
|
2784
|
+
this.position(this.position() + topDelta);
|
2785
|
+
this.startY = e.targetTouches[0].clientY;
|
2786
|
+
this.moved = true;
|
2787
|
+
|
2788
|
+
return false;
|
2789
|
+
},
|
2790
|
+
|
2791
|
+
onTouchEnd: function(e) {
|
2792
|
+
e.preventDefault();
|
2793
|
+
this.element.removeEventListener('touchmove', this, false);
|
2794
|
+
this.element.removeEventListener('touchend', this, false);
|
2795
|
+
|
2796
|
+
var newPosition = this.position(),theTarget,theEvent,slideDistance;
|
2797
|
+
|
2798
|
+
// If we are outside of the boundaries, let's go back to the sheepfold
|
2799
|
+
if( newPosition > 0 || newPosition < this.maxSlide ) {
|
2800
|
+
this.slideTo(newPosition > 0 ? 0 : this.maxSlide);
|
2801
|
+
return;
|
2802
|
+
}
|
2803
|
+
|
2804
|
+
if( !this.moved ) {
|
2805
|
+
theTarget = e.target;
|
2806
|
+
if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
|
2807
|
+
theEvent = document.createEvent("MouseEvents");
|
2808
|
+
theEvent.initEvent('click', true, true);
|
2809
|
+
theTarget.dispatchEvent(theEvent);
|
2810
|
+
return false
|
2811
|
+
}
|
2812
|
+
|
2813
|
+
if (newPosition > 0)
|
2814
|
+
{
|
2815
|
+
slideDistance = 0;
|
2816
|
+
}
|
2817
|
+
else if ( newPosition < this.maxSlide )
|
2818
|
+
{
|
2819
|
+
slideDistance = this.maxSlide;
|
2820
|
+
}
|
2821
|
+
else
|
2822
|
+
{
|
2823
|
+
slideDistance = this.snapTo( this.position(), this.slideStartY < this.position());
|
2824
|
+
}
|
2825
|
+
|
2826
|
+
this.slideTo( slideDistance, this.acceleration + 'ms');
|
2827
|
+
|
2828
|
+
return;
|
2829
|
+
},
|
2830
|
+
|
2831
|
+
onTransitionEnd: function() {
|
2832
|
+
this.element.removeEventListener('webkitTransitionEnd', this, false);
|
2833
|
+
this.slideTo( this.position() > 0 ? 0 : this.maxSlide );
|
2834
|
+
},
|
2835
|
+
|
2836
|
+
slideTo: function(dest, runtime) {
|
2837
|
+
this.element.style.webkitTransitionDuration = runtime ? runtime : this.acceleration + 'ms';
|
2838
|
+
this.position(dest ? dest : 0);
|
2839
|
+
|
2840
|
+
// If we are outside of the boundaries at the end of the transition go back to the sheepfold
|
2841
|
+
if( this.position() > 0 || this.position() < this.maxSlide )
|
2842
|
+
this.element.addEventListener('webkitTransitionEnd', this, false);
|
2843
|
+
},
|
2844
|
+
|
2845
|
+
snapTo: function (dest, dir)
|
2846
|
+
{
|
2847
|
+
if (dest != 0)
|
2848
|
+
{
|
2849
|
+
var opposite = -dest,
|
2850
|
+
elements = this.element.querySelectorAll('.vertical-slide-snapto'),
|
2851
|
+
i = 0,
|
2852
|
+
l = elements.length;
|
2853
|
+
|
2854
|
+
for (l = elements.length; i < l; ++i)
|
2855
|
+
{
|
2856
|
+
//console.log('element['+i+']: '+ elements[i].offsetTop);
|
2857
|
+
if (elements[i].offsetTop >= opposite)
|
2858
|
+
{
|
2859
|
+
return !dir
|
2860
|
+
? -elements[i].offsetTop
|
2861
|
+
: -(elements[i-1]||elements[0]||{offsetTop:dest}).offsetTop;
|
2862
|
+
}
|
2863
|
+
}
|
2864
|
+
}
|
2865
|
+
|
2866
|
+
return dest;
|
2867
|
+
}
|
2868
|
+
};
|
2869
|
+
|
2870
|
+
/**
|
2871
|
+
*
|
2872
|
+
* Modified version of
|
2873
|
+
* http://cubiq.org/slideing-div-on-iphone-ipod-touch/5
|
2874
|
+
*
|
2875
|
+
* Copyright (c) 2009 Matteo Spinelli, http://cubiq.org/
|
2876
|
+
* Released under MIT license
|
2877
|
+
* http://cubiq.org/dropbox/mit-license.txt
|
2878
|
+
*
|
2879
|
+
*
|
2880
|
+
* Modifications by Sam Shull <http://www.google.com/profiles/brickysam26>
|
2881
|
+
* Released under MIT license
|
2882
|
+
*/
|
2883
|
+
function iSlideHorizontal(el, options)
|
2884
|
+
{
|
2885
|
+
var that = this;
|
2886
|
+
|
2887
|
+
this.numberOfTouches = 1;
|
2888
|
+
|
2889
|
+
this.acceleration = 500;
|
2890
|
+
|
2891
|
+
this.element = el;
|
2892
|
+
this.position(0);
|
2893
|
+
this.refresh();
|
2894
|
+
el.style.webkitTransitionTimingFunction = 'cubic-bezier(0, 0, 0.2, 1)';
|
2895
|
+
this.acceleration = null;
|
2896
|
+
|
2897
|
+
el.addEventListener('touchstart', this, false);
|
2898
|
+
|
2899
|
+
window.addEventListener('unload', function ()
|
2900
|
+
{
|
2901
|
+
el.removeEventListener('touchstart', that, false);
|
2902
|
+
window.removeEventListener('unload', arguments.callee, false);
|
2903
|
+
|
2904
|
+
}, false);
|
2905
|
+
|
2906
|
+
if (options)
|
2907
|
+
{
|
2908
|
+
$.extend(this, options);
|
2909
|
+
}
|
2910
|
+
}
|
2911
|
+
|
2912
|
+
iSlideHorizontal.prototype = {
|
2913
|
+
handleEvent: function(e) {
|
2914
|
+
switch(e.type) {
|
2915
|
+
case 'touchstart': this.onTouchStart(e); break;
|
2916
|
+
case 'touchmove': this.onTouchMove(e); break;
|
2917
|
+
case 'touchend': this.onTouchEnd(e); break;
|
2918
|
+
case 'webkitTransitionEnd': this.onTransitionEnd(e); break;
|
2919
|
+
}
|
2920
|
+
},
|
2921
|
+
|
2922
|
+
position: function (pos) {
|
2923
|
+
if (pos !== undefined)
|
2924
|
+
{
|
2925
|
+
this._position = pos;
|
2926
|
+
this.element.style.webkitTransform = 'translateX(' + pos + 'px)';
|
2927
|
+
return;
|
2928
|
+
}
|
2929
|
+
|
2930
|
+
return this._position;
|
2931
|
+
},
|
2932
|
+
|
2933
|
+
refresh: function() {
|
2934
|
+
this.element.style.webkitTransitionDuration = '0';
|
2935
|
+
|
2936
|
+
if( this.element.offsetWidth<this.element.parentNode.clientWidth )
|
2937
|
+
this.maxSlide = 0;
|
2938
|
+
else
|
2939
|
+
this.maxSlide = this.element.parentNode.clientWidth - this.element.offsetWidth;
|
2940
|
+
},
|
2941
|
+
|
2942
|
+
onTouchStart: function(e) {
|
2943
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2944
|
+
return false;
|
2945
|
+
|
2946
|
+
e.preventDefault();
|
2947
|
+
this.refresh();
|
2948
|
+
|
2949
|
+
this.slideStartX = this.startX = e.targetTouches[0].clientX;
|
2950
|
+
this.slideStartTime = e.timeStamp;
|
2951
|
+
this.moved = false;
|
2952
|
+
|
2953
|
+
this.element.addEventListener('touchmove', this, false);
|
2954
|
+
this.element.addEventListener('touchend', this, false);
|
2955
|
+
|
2956
|
+
return false;
|
2957
|
+
},
|
2958
|
+
|
2959
|
+
onTouchMove: function(e) {
|
2960
|
+
if( e.targetTouches.length != this.numberOfTouches )
|
2961
|
+
return false;
|
2962
|
+
|
2963
|
+
e.preventDefault();
|
2964
|
+
var topDelta = e.targetTouches[0].clientX - this.startX;
|
2965
|
+
this.position(this.position() + topDelta);
|
2966
|
+
this.startX = e.targetTouches[0].clientX;
|
2967
|
+
this.moved = true;
|
2968
|
+
|
2969
|
+
return false;
|
2970
|
+
},
|
2971
|
+
|
2972
|
+
onTouchEnd: function(e) {
|
2973
|
+
e.preventDefault();
|
2974
|
+
var newPosition,theTarget,theEvent,slideDistance,slideDuration,newDuration,newSlideDistance;
|
2975
|
+
|
2976
|
+
this.element.removeEventListener('touchmove', this, false);
|
2977
|
+
this.element.removeEventListener('touchend', this, false);
|
2978
|
+
|
2979
|
+
// If we are outside of the boundaries, let's go back to the sheepfold
|
2980
|
+
if( this.position() > 0 || this.position() < this.maxSlide ) {
|
2981
|
+
this.slideTo(this.position() > 0 ? 0 : this.maxSlide);
|
2982
|
+
return;
|
2983
|
+
}
|
2984
|
+
|
2985
|
+
if( !this.moved ) {
|
2986
|
+
theTarget = e.target;
|
2987
|
+
if(theTarget.nodeType == 3) theTarget = theTarget.parentNode;
|
2988
|
+
theEvent = document.createEvent("MouseEvents");
|
2989
|
+
theEvent.initEvent('click', true, true);
|
2990
|
+
theTarget.dispatchEvent(theEvent);
|
2991
|
+
return false
|
2992
|
+
}
|
2993
|
+
|
2994
|
+
newPosition = this.position() + ((this.startX - this.slideStartX) / 2);
|
2995
|
+
|
2996
|
+
if (newPosition > 0)
|
2997
|
+
{
|
2998
|
+
newPosition = 0;
|
2999
|
+
}
|
3000
|
+
else if ( newPosition < this.maxSlide )
|
3001
|
+
{
|
3002
|
+
newPosition = this.maxSlide;
|
3003
|
+
}
|
3004
|
+
else
|
3005
|
+
{
|
3006
|
+
newPosition = this.snapTo( this.position(), newPosition > this.position());
|
3007
|
+
}
|
3008
|
+
|
3009
|
+
this.slideTo( newPosition, this.acceleration + 'ms');
|
3010
|
+
|
3011
|
+
return false;
|
3012
|
+
},
|
3013
|
+
|
3014
|
+
onTransitionEnd: function() {
|
3015
|
+
this.element.removeEventListener('webkitTransitionEnd', this, false);
|
3016
|
+
this.slideTo( this.position()>0 ? 0 : this.maxScroll );
|
3017
|
+
},
|
3018
|
+
|
3019
|
+
slideTo: function(dest, runtime) {
|
3020
|
+
this.element.style.webkitTransitionDuration = runtime ? runtime : this.acceleration + 'ms';
|
3021
|
+
this.position(dest ? dest : 0);
|
3022
|
+
|
3023
|
+
if( this.position()>0 || this.position() < this.maxSlide )
|
3024
|
+
this.element.addEventListener('webkitTransitionEnd', this, false);
|
3025
|
+
},
|
3026
|
+
|
3027
|
+
snapTo: function (dest, dir)
|
3028
|
+
{
|
3029
|
+
if (dest != 0)
|
3030
|
+
{
|
3031
|
+
//the children of the first row of the table - in case of nested tables
|
3032
|
+
var opposite = -dest, i = 0,
|
3033
|
+
elements = this.element.querySelectorAll('.horizontal-slide-snapto'),
|
3034
|
+
l = elements.length;
|
3035
|
+
|
3036
|
+
for (; i < l; ++i)
|
3037
|
+
{
|
3038
|
+
if (elements[i].offsetLeft >= opposite)
|
3039
|
+
{
|
3040
|
+
return !dir
|
3041
|
+
? -elements[i].offsetLeft
|
3042
|
+
: -(elements[i-1]||elements[0]||{offsetLeft:dest}).offsetLeft;
|
3043
|
+
}
|
3044
|
+
}
|
3045
|
+
}
|
3046
|
+
|
3047
|
+
return dest;
|
3048
|
+
}
|
3049
|
+
};
|
3050
|
+
}
|
1027
3051
|
})(jQuery);
|