Permalink
Browse files

Commit for 1.0.2

  • Loading branch information...
1 parent 85bce94 commit 9304a7a9acd19022bd03c0952d6a99df236e488d Code Computerlove committed Apr 14, 2011
View
@@ -73,6 +73,13 @@ See "examples/index.html".
This example assumes no jQuery at all and is heavily optimised for WebKit and Mozilla browsers.
+ // Set up PhotoSwipe with all anchor tags in the Gallery container
+ document.addEventListener('DOMContentLoaded', function(){
+
+ Code.photoSwipe('a', '#Gallery');
+
+ }, false);
+
Getting Started - Default Distribution (with jQuery plugin)
-----------------------------------------------------------
@@ -81,6 +88,12 @@ See "examples/jquery-plugin.html".
This example assumes you want to use the convience of jQuery for initiating the gallery, but still the optimised engine for WebKit and Mozilla browsers.
+ $(document).ready(function(){
+
+ $("#Gallery a").photoSwipe();
+
+ });
+
Getting Started - Default Distribution (with jQuery engine)
-----------------------------------------------------------
@@ -103,10 +116,12 @@ Options
- **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"
+- **slideshowDelay**: The delay between showing the next image when in slideshow mode. Default "3000"
- **imageScaleMethod**: How images will fit onto the screen. Either "fit" or "zoom". "fit" ensures the image always fits the screen. "zoom" the image will always fill the full screen, this may cause the image to be "zoomed" in and cropped. Default "fit"
+- **preventHide**: Once PhotoSwipe is active, prevents the user closing it. Useful for "exclusive mode" (see examples/exclusive-mode.html). Default: "false"
+
- **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,8 @@
project.description = PhotoSwipe
project.src.dir = src
-project.build.version = 1.0.1
+project.build.version = 1.0.2
+project.build.year = 2011
project.build.workdir = work
project.build.artifactdir = release
View
@@ -55,7 +55,11 @@
<fileset dir="." includes="${project.src.dir}/photoswipe.js" />
</concat>
-
+
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.js"/>
+ </antcall>
+
<!-- Minimise -->
<jsmin srcfile="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.js" suffix="true" />
@@ -65,7 +69,9 @@
<fileset dir="." includes="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.min.js" />
</concat>
- <replace file="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.min2.js" token="%%version%%" value="${project.build.version}.${build.number}"/>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.min2.js"/>
+ </antcall>
<delete file="${project.build.workdir}/code-photoswipe${engine}-${project.build.version}.min.js"/>
@@ -76,11 +82,25 @@
<fileset dir="${project.src.dir}/examples"/>
</copy>
- <replace file="${project.build.workdir}/examples/index.html" token="%%version%%" value="${project.build.version}"/>
- <replace file="${project.build.workdir}/examples/jquery-plugin.html" token="%%version%%" value="${project.build.version}"/>
- <replace file="${project.build.workdir}/examples/jquery-engine.html" token="%%version%%" value="${project.build.version}"/>
- <replace file="${project.build.workdir}/examples/advanced-setup.html" token="%%version%%" value="${project.build.version}"/>
-
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/index.html"/>
+ </antcall>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/jquery-plugin.html"/>
+ </antcall>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/jquery-engine.html"/>
+ </antcall>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/advanced-setup.html"/>
+ </antcall>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/events.html"/>
+ </antcall>
+ <antcall target="versionStamp">
+ <param name="filePath" value="${project.build.workdir}/examples/exclusive-mode.html"/>
+ </antcall>
+
</target>
@@ -108,6 +128,13 @@
</target>
+ <target name="versionStamp">
+
+ <replace file="${filePath}" token="%%version%%" value="${project.build.version}"/>
+ <replace file="${filePath}" token="%%year%%" value="${project.build.year}"/>
+
+ </target>
+
<target name="moveToArtifact">
View
@@ -1,6 +1,7 @@
// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
+// version: %%version%%
(function(Util){
@@ -27,7 +28,7 @@
Util.extend(this.settings, options);
- this._super(options);
+ this._super(this.settings);
this.captionValue = '';
@@ -156,4 +157,4 @@
content: 'ps-caption-content'
};
-})(Code.PhotoSwipe.Util);
+})(Code.PhotoSwipe.Util);
@@ -1,6 +1,7 @@
// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
+// version: %%version%%
(function(Util, CaptionClass, ToolbarClass){
@@ -33,7 +34,8 @@
fadeOutSpeed: 500,
autoHideDelay: 5000,
flipPosition: false,
- showEmptyCaptions: true
+ showEmptyCaptions: true,
+ hideClose: false
};
Util.extend(this.settings, options);
@@ -56,7 +58,8 @@
fadeInSpeed: this.settings.fadeInSpeed,
fadeOutSpeed: this.settings.fadeOutSpeed,
opacity: this.settings.opacity,
- position: (this.settings.flipPosition) ? 'top' : 'bottom'
+ position: (this.settings.flipPosition) ? 'top' : 'bottom',
+ hideClose: this.settings.hideClose
});
},
@@ -328,4 +331,4 @@
});
-})(Code.PhotoSwipe.Util, Code.PhotoSwipe.CaptionClass, Code.PhotoSwipe.ToolbarClass);
+})(Code.PhotoSwipe.Util, Code.PhotoSwipe.CaptionClass, Code.PhotoSwipe.ToolbarClass);
View
@@ -1,10 +1,10 @@
-1.0.0 07.04.11
---------------
-Initial release by Ste Brennan
+1.0.0 07.04.11 - Ste Brennan
+----------------------------
+Initial release
-1.0.1 11.04.11
---------------
+1.0.1 11.04.11 - Ste Brennan
+----------------------------
Major update:
- Fading of caption and toolbar more like iOS photo view by default.
@@ -18,3 +18,20 @@ Major update:
- Fixed issue with placement of caption if at the bottom
+
+1.0.2 14.04.11 - Ste Brennan
+----------------------------
+
+- PhotoSwipe now dispatches the following events which you can listen out for in your code (see examples/events.html)
+ * onShow: When the gallery is displayed
+ * onHide: When the gallery is hidden
+ * onShowNext: When the gallery has been issued the command to show the next image
+ * onShowPrevious: When the gallery has been issued the command to show the previous image
+ * onDisplayImage: When the gallery displays an image. Typically fired after onShowNext and onShowPrevious
+ * onResetPosition: When the gallery resets the size and position of itself. Typically fired after device orientation change or window resize
+ * onSlideshowStart: When the gallery has started the slideshow
+ * onSlideshowStop: When the gallery has stopped the slideshow
+
+- Added "exclusive mode". This means the user will only be able to interact with PhotoSwipe, and not the underlying document. They will be unable to close PhotoSwipe once it is active. (see examples/exclusive-mode.html)
+
+- Fixed Issue #1 - Line break in thumbnail anchor can cause a JS error
@@ -1,6 +1,7 @@
// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
+// version: %%version%%
(function(Util){
@@ -47,4 +48,4 @@
documentOverlay: 'ps-document-overlay'
};
-})(Code.PhotoSwipe.Util);
+})(Code.PhotoSwipe.Util);
View
@@ -1,6 +1,7 @@
// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
+// version: %%version%%
(function (Util) {
@@ -294,4 +295,4 @@
};
-})(Code.PhotoSwipe.Util);
+})(Code.PhotoSwipe.Util);
View
@@ -1,6 +1,7 @@
// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) 2011 by Code Computerlove (http://www.codecomputerlove.com)
+// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
// Licensed under the MIT license
+// version: %%version%%
(function () {
@@ -62,4 +63,4 @@
});
-})();
+})();
View
@@ -29,7 +29,65 @@
// Set up PhotoSwipe with all anchor tags in the Gallery container
document.addEventListener('DOMContentLoaded', function(){
- Code.photoSwipe('a', '#Gallery', {
+ // Add event listeners
+
+ // onShow
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onShow, function(e){
+
+ console.log('onShow');
+
+ });
+
+ // onHide
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onHide, function(e){
+
+ console.log('onHide');
+
+ });
+
+ // onShowNext
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onShowNext, function(e){
+
+ console.log('onShowNext');
+
+ });
+
+ // onShowPrevious
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onShowPrevious, function(e){
+
+ console.log('onShowPrevious');
+
+ });
+
+ // onDisplayImage
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onDisplayImage, function(e){
+
+ console.log('onDisplayImage');
+
+ });
+
+ // onResetPosition
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onResetPosition, function(e){
+
+ console.log('onResetPosition');
+
+ });
+
+ // onSlideshowStart
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onSlideshowStart, function(e){
+
+ console.log('onSlideshowStart');
+
+ });
+
+ // onSlideshowStop
+ Code.PhotoSwipe.Current.addEventListener(Code.PhotoSwipe.EventTypes.onSlideshowStop, function(e){
+
+ console.log('onSlideshowStop');
+
+ });
+
+ var thumbEls = Code.photoSwipe('a', '#Gallery', {
getImageSource: Code.PhotoSwipe.GetImageSource,
getImageCaption: Code.PhotoSwipe.GetImageCaption,
@@ -40,6 +98,7 @@
loop: true,
slideshowDelay: 3000,
imageScaleMethod: 'fit', // Either "fit" or "zoom"
+ preventHide: false,
captionAndToolbarHide: false,
captionAndToolbarHideOnSwipe: true,
@@ -50,7 +109,8 @@
});
-
+ console.log(thumbEls);
+
}, false);
@@ -102,11 +162,23 @@
<div class="gallery-row">
- <div class="gallery-item"><a href="images/full/001.jpg"><img src="images/thumb/001.jpg" alt="Image 001" /></a></div>
-
- <div class="gallery-item"><a href="images/full/002.jpg"><img src="images/thumb/002.jpg" alt="Image 002" /></a></div>
-
- <div class="gallery-item"><a href="images/full/003.jpg"><img src="images/thumb/003.jpg" alt="" /></a></div>
+ <div class="gallery-item">
+ <a href="images/full/001.jpg">
+ <img src="images/thumb/001.jpg" alt="Image 001" />
+ </a>
+ </div>
+
+ <div class="gallery-item">
+ <a href="images/full/002.jpg">
+ <img src="images/thumb/002.jpg" alt="Image 002" />
+ </a>
+ </div>
+
+ <div class="gallery-item">
+ <a href="images/full/003.jpg">
+ <img src="images/thumb/003.jpg" alt="" />
+ </a>
+ </div>
</div>
Oops, something went wrong.

0 comments on commit 9304a7a

Please sign in to comment.