Permalink
Browse files

v1.0.4

  • Loading branch information...
1 parent 620348f commit f7555db4ec83e4c1b1ea23f85c27057b5370f4c4 Code Computerlove committed Apr 20, 2011
Showing with 67 additions and 44 deletions.
  1. +11 −3 README.md
  2. +1 −1 build.properties
  3. +1 −0 build.xml
  4. +14 −0 src/change.log
  5. +31 −4 src/photoswipe.js
  6. +3 −30 src/util-dom-jQuery.js
  7. +3 −3 src/util-dom.js
  8. +1 −1 src/viewport-class.js
  9. +2 −2 src/zoom-pan-rotate-class.js
View
@@ -24,6 +24,8 @@ Features
- Automatically scales images to maximise screen size and orientation.
+- Zoom / pan and rotate images (as of v1.0.4 - experimental iOS devices only)
+
- Works with your markup and semantic structure. Does not enforce any specific markup.
- Supports image captions.
@@ -106,16 +108,16 @@ This example assumes you want to use jQuery for the gallery's engine as well as
Options
-------
-- **zIndex**: The intial zIndex for PhotoSwipe. Default "1000"
-
- **fadeInSpeed**: The speed of any fading-in elements in milliseconds. Default "250"
- **fadeOutSpeed**: The speed of any fading-out elements in milliseconds. Default "500"
- **slideSpeed**: How fast images slide into view in milliseconds. Default "250"
- **swipeThreshold**: How many pixels your finger has to move across the screen to register a swipe gesture. Default "50"
-
+
+- **swipeTimeThreshold**: A swipe must take no longer than this value in milli-seconds to be registered as a swipe gesture. Default "250"
+
- **loop**: Whether the gallery auto-loops back to the beginning when you reach the end. Default "true"
- **slideshowDelay**: The delay between showing the next image when in slideshow mode. Default "3000"
@@ -124,6 +126,12 @@ Options
- **preventHide**: Once PhotoSwipe is active, prevents the user closing it. Useful for "exclusive mode" (see examples/exclusive-mode.html). Default: "false"
+- **zIndex**: The intial zIndex for PhotoSwipe. Default "1000"
+
+- **allowUserZoom**: EXPERIMENTAL iOS only - Allow the user to zoom / pan around images. Default "true"
+
+- **allowRotationOnUserZoom**: EXPERIMENTAL iOS only - Allow the user to rotate images whilst zooming / panning. Default "true"
+
- **captionAndToolbarHide**: Hide the caption and toolbar. Default "false"
- **captionAndToolbarHideOnSwipe**: Hide the caption and toolbar when you swipe to the next image. Default "true"
View
@@ -5,7 +5,7 @@
project.description = PhotoSwipe
project.src.dir = src
-project.build.version = 1.0.4b1
+project.build.version = 1.0.4
project.build.year = 2011
project.build.workdir = work
View
@@ -58,6 +58,7 @@
<fileset dir="." includes="${project.src.dir}/caption-class.js" />
<fileset dir="." includes="${project.src.dir}/toolbar-class.js" />
<fileset dir="." includes="${project.src.dir}/caption-toolbar-class.js" />
+ <fileset dir="." includes="${project.src.dir}/zoom-pan-rotate-class.js" />
<fileset dir="." includes="${project.src.dir}/photoswipe.js" />
</concat>
View
@@ -51,3 +51,17 @@ Major update:
- Now compliled with Google Closure. Overall smaller file size
+
+
+1.0.4 20.04.11 - Ste Brennan
+----------------------------
+
+- Experimental "zoom/pan/rotate" for iOS devices
+
+- Fixed issue2. Can now click on "clickable" elements added to a caption on touch screen devices
+
+- Speed improvements for Android and Blackberry devices.
+
+- "Flicker" when using toolbar buttons to show next and previous on Android devices fixed.
+
+
View
@@ -60,7 +60,7 @@
preventHide: false,
zIndex: 1000,
- /* Experimental! */
+ /* Experimental - iOS only at the moment */
allowUserZoom: true,
allowRotationOnUserZoom: true,
@@ -455,7 +455,23 @@
*/
canUserZoom: function(){
- return (this.settings.allowUserZoom && !this.isBusy);
+ if (!this.settings.allowUserZoom){
+ return false;
+ }
+
+ if (this.isBusy){
+ return false;
+ }
+
+ if (Util.isNothing(this.slider.currentItem.fullSizeImage)){
+ return false;
+ }
+
+ if (!this.slider.currentItem.fullSizeImage.hasLoaded){
+ return false;
+ }
+
+ return true;
},
@@ -477,12 +493,12 @@
*/
onViewportTouch: function(e){
- this.stopSlideshow();
-
switch(e.action){
case ViewportClass.Actions.gestureStart:
+
if (this.canUserZoom()){
+ this.stopSlideshow();
if (!this.isZoomActive()){
this.zoomPanRotate = new ZoomPanRotateClass({}, this.viewport.el, this.slider.currentItem.imageEl);
}
@@ -491,30 +507,37 @@
break;
case ViewportClass.Actions.gestureChange:
+
if (this.isZoomActive()){
this.zoomPanRotate.zoomRotate(e.scale, (this.settings.allowRotationOnUserZoom) ? e.rotation : 0);
}
break;
case ViewportClass.Actions.gestureEnd:
+
if (this.isZoomActive()){
this.zoomPanRotate.setStartingScaleAndRotation(e.scale, (this.settings.allowRotationOnUserZoom) ? e.rotation : 0);
}
break;
case ViewportClass.Actions.touchStart:
+
+ this.stopSlideshow();
if (this.isZoomActive()){
this.zoomPanRotate.panStart(e.point);
}
break;
case ViewportClass.Actions.touchMove:
+
if (this.isZoomActive()){
this.zoomPanRotate.pan(e.point);
}
break;
case ViewportClass.Actions.click:
+
+ this.stopSlideshow();
if (!this.settings.hideToolbar){
this.toggleCaptionAndToolbar();
}
@@ -524,11 +547,15 @@
break;
case ViewportClass.Actions.swipeLeft:
+
+ this.stopSlideshow();
this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.swipe;
this.showNext();
break;
case ViewportClass.Actions.swipeRight:
+
+ this.stopSlideshow();
this.lastShowPrevTrigger = Code.PhotoSwipe.ShowPrevTriggers.swipe;
this.showPrevious();
break;
View
@@ -8,42 +8,15 @@
Util.extend(Util, {
DOM: {
-
- _eventTagNames: {
- 'select':'input',
- 'change':'input',
- 'submit':'form',
- 'reset':'form',
- 'error':'img',
- 'load':'img',
- 'abort':'img'
- },
-
-
- /*
- * Function: isEventSupported
- * http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
- */
- isEventSupported: function(eventName) {
- var el = document.createElement(this._eventTagNames[eventName] || 'div');
- eventName = 'on' + eventName;
- var isSupported = (eventName in el);
- if (!isSupported) {
- el.setAttribute(eventName, 'return;');
- isSupported = typeof el[eventName] == 'function';
- }
- el = null;
- return isSupported;
- },
-
+
/*
* Function: resetTranslate
* Required for smoother transition on iOS
*/
resetTranslate: function(el){
- if (Util.browser.mobileSafari){
+ if (Util.browser.mobileSafari3dSupported){
$(el).css('-webkit-transform', 'translate3d(0px,0px,0px)');
}
@@ -389,7 +362,7 @@
var retval = {
x: event.pageX,
y: event.pageY
- }
+ };
return retval;
},
View
@@ -160,7 +160,7 @@
var re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)');
if ( ! re.test(currentClassValue) ){
- if (currentClassValue != ''){
+ if (currentClassValue !== ''){
currentClassValue = currentClassValue + ' ';
}
currentClassValue = currentClassValue + className;
@@ -332,7 +332,7 @@
var styleBackup = {
display: el.style.display,
left: el.style.left
- }
+ };
el.style.display = 'block';
el.style.left = '-1000000px';
@@ -472,7 +472,7 @@
var retval = {
x: 0,
y: 0
- }
+ };
if (event.pageX) {
retval.x = event.pageX;
View
@@ -145,7 +145,7 @@
return {
x: touches[0].pageX,
y: touches[0].pageY
- }
+ };
},
@@ -130,7 +130,7 @@
this.panStartingPoint = {
x: point.x,
y: point.y
- }
+ };
},
@@ -149,7 +149,7 @@
this.transformSettings.startingTranslateX + dx;
this.transformSettings.translateY =
- this.transformSettings.startingTranslateY + dy;;
+ this.transformSettings.startingTranslateY + dy;
this.applyTransform();

0 comments on commit f7555db

Please sign in to comment.