Permalink
Browse files

v1.0.14

  • Loading branch information...
1 parent 7d16d14 commit 95264b17b3fd982fed42bb9624fe4c074ace2d3c codecomputerlove committed Jun 24, 2011
View
@@ -9,13 +9,13 @@ The current version supports mobile handsets running WebKit based browsers, i.e.
PhotoSwipe also runs on the desktop and has been tested on Chrome, Firefox, Safari and Internet Explorer 8 and above.
-Latest Release v1.0.13
----------------------
-[Download](http://github.com/downloads/codecomputerlove/PhotoSwipe/code-photoswipe.v1.0.13.zip)
+Latest Release v1.0.14
+----------------------
+[Download](http://github.com/downloads/codecomputerlove/PhotoSwipe/code-photoswipe.v1.0.14.zip)
-- Upgraded to jQuery Mobile 1.0 beta.
+- "Double tap" to zoom and pan around an image now working in IE9
-- Added new "double tap" feature. Double tapping an image will zoom the image in and allow the user to pan around. This is still experimental and works on iOS (pinch and zoom still works), Android, BlackBerry, Chrome and Firefox 4 and above.
+- Major rewrite of how events are handled internally. If you experience any event related issues / things not firing please revert back to v1.0.13 and report the issue. Thanks!
View
@@ -5,7 +5,7 @@
project.description = PhotoSwipe
project.src.dir = src
-project.build.version = 1.0.13
+project.build.version = 1.0.14
project.build.year = 2011
project.build.workdir = work
View
@@ -47,8 +47,8 @@
<fileset dir="." includes="${project.src.dir}/util.js" />
<fileset dir="." includes="${project.src.dir}/util-dom${engine}.js" />
+ <fileset dir="." includes="${project.src.dir}/util-events${engine}.js" />
<fileset dir="." includes="${project.src.dir}/util-animation${engine}.js" />
- <fileset dir="." includes="${project.src.dir}/event-class.js" />
<fileset dir="." includes="${project.src.dir}/element-class.js" />
<fileset dir="." includes="${project.src.dir}/full-size-image-class.js" />
<fileset dir="." includes="${project.src.dir}/document-overlay-class.js" />
View
@@ -60,25 +60,25 @@
/*
- * Function: addEventListeners
+ * Function: addEventHandlers
*/
- addEventListeners: function(){
+ addEventHandlers: function(){
if (Util.browser.touchSupported){
- Util.DOM.addEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.Events.add(this.el, 'touchmove', this.touchMoveHandler);
}
},
/*
- * Function: removeEventListeners
+ * Function: removeEventHandlers
*/
- removeEventListeners: function(){
+ removeEventHandlers: function(){
if (Util.browser.touchSupported){
- Util.DOM.removeEventListener(this.el, 'touchmove', this.touchMoveHandler);
+ Util.Events.remove(this.el, 'touchmove', this.touchMoveHandler);
}
},
@@ -8,14 +8,14 @@
/*
* Class: Code.PhotoSwipe.CaptionToolbarClass
*/
- Code.PhotoSwipe.CaptionToolbarClass = Code.PhotoSwipe.EventClass.extend({
+ Code.PhotoSwipe.CaptionToolbarClass = SimpleClass.extend({
toolbar: null,
caption: null,
isHidden: null,
- hasAddedEventListeners: null,
+ hasAddedEventHandlers: null,
toolbarClickEventHandler: null,
@@ -25,8 +25,6 @@
*/
init: function(options){
- this._super();
-
this.settings = {
opacity: 0.8,
fadeInSpeed: 250,
@@ -41,7 +39,7 @@
Util.extend(this.settings, options);
this.isHidden = true;
- this.hasAddedEventListeners = false;
+ this.hasAddedEventHandlers = false;
this.toolbarClickEventHandler = this.onToolbarClick.bind(this);
@@ -80,29 +78,29 @@
/*
- * Function: addEventListeners
+ * Function: addEventHandlers
*/
- addEventListeners: function(){
+ addEventHandlers: function(){
- if (this.hasAddedEventListeners){
+ if (this.hasAddedEventHandlers){
return;
}
- this.toolbar.addEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+ Util.Events.add(this.toolbar, ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
- this.hasAddedEventListeners = true;
+ this.hasAddedEventHandlers = true;
},
/*
- * Function: removeEventListeners
+ * Function: removeEventHandlers
*/
- removeEventListeners: function(){
+ removeEventHandlers: function(){
- this.toolbar.removeEventListener(ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
- this.hasAddedEventListeners = false;
+ Util.Events.remove(this.toolbar, ToolbarClass.EventTypes.onClick, this.toolbarClickEventHandler);
+ this.hasAddedEventHandlers = false;
},
@@ -189,10 +187,10 @@
*/
onFadeIn: function(){
- this.addEventListeners();
+ this.addEventHandlers();
this.resetAutoHideTimeout();
- this.dispatchEvent({
+ Util.Events.fire(this, {
type: Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onShow,
target: this
});
@@ -227,7 +225,7 @@
*/
onFadeOut: function(){
- this.dispatchEvent({
+ Util.Events.fire(this, {
type: Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onHide,
target: this
});
@@ -256,12 +254,12 @@
this.stopFade();
this.isHidden = true;
- this.removeEventListeners();
+ this.removeEventHandlers();
this.caption.hide();
this.toolbar.hide();
- this.dispatchEvent({
+ Util.Events.fire(this, {
type: Code.PhotoSwipe.CaptionToolbarClass.EventTypes.onHide,
target: this
});
@@ -329,7 +327,7 @@
*/
onToolbarClick: function(e){
- this.dispatchEvent({
+ Util.Events.fire(this, {
type: Code.PhotoSwipe.ToolbarClass.EventTypes.onClick,
target: this,
action: e.action
@@ -363,8 +361,8 @@
});
Code.PhotoSwipe.CaptionToolbarClass.EventTypes = {
- onShow: 'onShow',
- onHide: 'onHide'
+ onShow: 'PhotoSwipeCaptionToolbarClassOnShow',
+ onHide: 'PhotoSwipeCaptionToolbarClassOnHide'
};
})
View
@@ -164,3 +164,11 @@ Major update:
- Added new "double tap" feature. Double tapping an image will zoom the image in and allow the user to pan around. This is still experimental and works on iOS (pinch and zoom still works), Android, BlackBerry, Chrome and Firefox 4 and above
+
+1.0.14 24.06.22 - Ste Brennan
+-----------------------------
+
+- "Double tap" to zoom and pan around an image now working in IE9
+
+- Major rewrite of how events are handled internally.
+
View
@@ -10,7 +10,7 @@
* Most PhotoSwipe classes inherit from this class
* Provides hooks for fading in and out
*/
- Code.PhotoSwipe.ElementClass = Code.PhotoSwipe.EventClass.extend({
+ Code.PhotoSwipe.ElementClass = SimpleClass.extend({
el: null,
settings: null,
@@ -25,8 +25,6 @@
*/
init: function(options){
- this._super();
-
this.settings = {
opacity: 1,
fadeInSpeed: 250,
@@ -75,8 +73,8 @@
postShow: function(){
this.isHidden = false;
- this.addEventListeners();
- this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onShow);
+ this.addEventHandlers();
+ Util.Events.fire(this, Code.PhotoSwipe.ElementClass.EventTypes.onShow);
},
@@ -126,8 +124,8 @@
return;
}
- this.addEventListeners();
- this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn);
+ this.addEventHandlers();
+ Util.Events.fire(this, Code.PhotoSwipe.ElementClass.EventTypes.onFadeIn);
},
@@ -154,8 +152,8 @@
postHide: function(){
this.isHidden = true;
- this.removeEventListeners();
- this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onHide);
+ this.removeEventHandlers();
+ Util.Events.fire(this, Code.PhotoSwipe.ElementClass.EventTypes.onHide);
},
@@ -186,9 +184,9 @@
}
Util.DOM.hide(this.el);
- this.removeEventListeners();
+ this.removeEventHandlers();
- this.dispatchEvent(Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut);
+ Util.Events.fire(this, Code.PhotoSwipe.ElementClass.EventTypes.onFadeOut);
},
@@ -205,17 +203,17 @@
/*
- * Function: addEventListeners
+ * Function: addEventHandlers
*/
- addEventListeners: function(){
+ addEventHandlers: function(){
},
/*
- * Function: removeEventListeners
+ * Function: removeEventHandlers
*/
- removeEventListeners: function(){
+ removeEventHandlers: function(){
}
@@ -225,11 +223,11 @@
Code.PhotoSwipe.ElementClass.EventTypes = {
- onShow: 'onShow',
- onHide: 'onHide',
- onClick: 'onClick',
- onFadeIn: 'onFadeIn',
- onFadeOut: 'onFadeOut'
+ onShow: 'PhotoSwipeElementClassOnShow',
+ onHide: 'PhotoSwipeElementClassOnHide',
+ onClick: 'PhotoSwipeElementClassOnClick',
+ onFadeIn: 'PhotoSwipeElementClassOnFadeIn',
+ onFadeOut: 'PhotoSwipeElementClassOnFadeOut'
};
View
@@ -1,66 +0,0 @@
-// PhotoSwipe - http://www.photoswipe.com/
-// Copyright (c) %%year%% by Code Computerlove (http://www.codecomputerlove.com)
-// Licensed under the MIT license
-// version: %%version%%
-
-(function () {
-
- // Based on http://www.javascriptbank.com/how-build-custom-events-javascript.html
- Code.PhotoSwipe.EventClass = SimpleClass.extend({
-
- _listeners: null,
-
- init: function(){
-
- this._listeners = {};
-
- },
-
-
- addEventListener: function(type, listener){
-
- if (typeof this._listeners[type] === 'undefined'){
- this._listeners[type] = [];
- }
- this._listeners[type].push(listener);
-
- },
-
-
- dispatchEvent: function(event){
- if (typeof event == "string"){
- event = { type: event };
- }
- if (!event.target){
- event.target = this;
- }
-
- if (!event.type){
- throw new Error("Event object missing 'type' property.");
- }
-
- if (this._listeners[event.type] instanceof Array){
- var listeners = this._listeners[event.type];
- for (var i=0, len=listeners.length; i < len; i++){
- listeners[i].call(this, event);
- }
- }
- },
-
-
- removeEventListener: function(type, listener){
- if (this._listeners[type] instanceof Array){
- var listeners = this._listeners[type];
- for (var i=0, len=listeners.length; i < len; i++){
- if (listeners[i] === listener){
- listeners.splice(i, 1);
- break;
- }
- }
- }
- }
-
- });
-
-
-})();
Oops, something went wrong.

0 comments on commit 95264b1

Please sign in to comment.