Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Quick fix in the photoswipe library for ICS version 4.0.1 and 4.0.2

  • Loading branch information...
commit ca06ecef46fbda287f5901937a625474a3c81300 1 parent 8431efd
@stungeye authored
Showing with 14 additions and 5 deletions.
  1. +3 −0  index.html
  2. +1 −1  js/code.photoswipe-3.0.4.min.js
  3. +10 −4 js/main.js
View
3  index.html
@@ -25,6 +25,9 @@
<a href="#" id="launch_link">See Reading Cats</a>
</li>
<li>
+ <a href="#" id="launch_link_2">See Reading Cats 2</a>
+ </li>
+ <li>
<a href="#about_meow" class="switch_screen">About Meow Reader</a>
</li>
<li>
View
2  js/code.photoswipe-3.0.4.min.js
@@ -8,7 +8,7 @@ f.length;d<h;++d)a[f[d]]=a[f[d]]||{},a=a[f[d]]}},coalesce:function(){var c,a;c=0
"")})},toDashedCase:function(c){return c.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})},arrayIndexOf:function(c,a,b){var d,f,g,e;g=-1;d=0;for(f=a.length;d<f;d++)if(e=a[d],this.isNothing(b)){if(e===c){g=d;break}}else if(this.objectHasProperty(e,b)&&e[b]===c){g=d;break}return g},objectHasProperty:function(c,a){return c.hasOwnProperty?c.hasOwnProperty(a):"undefined"!==typeof c[a]}}})(window);
(function(e,c){c.Browser={ua:null,version:null,safari:null,webkit:null,opera:null,msie:null,chrome:null,mozilla:null,android:null,blackberry:null,iPad:null,iPhone:null,iPod:null,iOS:null,is3dSupported:null,isCSSTransformSupported:null,isTouchSupported:null,isGestureSupported:null,_detect:function(){this.ua=e.navigator.userAgent;this.version=this.ua.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[];this.safari=/Safari/gi.test(e.navigator.appVersion);this.webkit=/webkit/i.test(this.ua);this.opera=/opera/i.test(this.ua);
this.msie=/msie/i.test(this.ua)&&!this.opera;this.chrome=/Chrome/i.test(this.ua);this.firefox=/Firefox/i.test(this.ua);this.fennec=/Fennec/i.test(this.ua);this.mozilla=/mozilla/i.test(this.ua)&&!/(compatible|webkit)/.test(this.ua);this.android=/android/i.test(this.ua);this.blackberry=/blackberry/i.test(this.ua);this.iOS=/iphone|ipod|ipad/gi.test(e.navigator.platform);this.iPad=/ipad/gi.test(e.navigator.platform);this.iPhone=/iphone/gi.test(e.navigator.platform);this.iPod=/ipod/gi.test(e.navigator.platform);
-var a=document.createElement("div");this.is3dSupported=!c.isNothing(a.style.WebkitPerspective);this.isCSSTransformSupported=!c.isNothing(a.style.WebkitTransform)||!c.isNothing(a.style.MozTransform)||!c.isNothing(a.style.transformProperty);this.isTouchSupported=this.isEventSupported("touchstart");this.isGestureSupported=this.isEventSupported("gesturestart")},_eventTagNames:{select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},isEventSupported:function(a){var b=
+var a=document.createElement("div");var isAndroidICS = /4.0.[1-2]/.test(this.ua) && this.android;this.is3dSupported=!c.isNothing(a.style.WebkitPerspective)&& !isAndroidICS;this.isCSSTransformSupported=!c.isNothing(a.style.WebkitTransform)||!c.isNothing(a.style.MozTransform)||!c.isNothing(a.style.transformProperty);this.isTouchSupported=this.isEventSupported("touchstart");this.isGestureSupported=this.isEventSupported("gesturestart")},_eventTagNames:{select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"},isEventSupported:function(a){var b=
document.createElement(this._eventTagNames[a]||"div"),d,a="on"+a;d=c.objectHasProperty(b,a);d||(b.setAttribute(a,"return;"),d=typeof b[a]==="function");return d},isLandscape:function(){return c.DOM.windowWidth()>c.DOM.windowHeight()}};c.Browser._detect()})(window,window.Code.Util);
(function(e,c){c.extend(c,{Events:{add:function(a,b,d){this._checkHandlersProperty(a);b==="mousewheel"&&(b=this._normaliseMouseWheelType());typeof a.__eventHandlers[b]==="undefined"&&(a.__eventHandlers[b]=[]);a.__eventHandlers[b].push(d);this._isBrowserObject(a)&&a.addEventListener(b,d,!1)},remove:function(a,b,d){this._checkHandlersProperty(a);b==="mousewheel"&&(b=this._normaliseMouseWheelType());if(a.__eventHandlers[b]instanceof Array){var f,g,e=a.__eventHandlers[b];if(c.isNothing(d)){if(this._isBrowserObject(a)){f=
0;for(g=e.length;f<g;f++)a.removeEventListener(b,e[f],!1)}a.__eventHandlers[b]=[]}else{f=0;for(g=e.length;f<g;f++)if(e[f]===d){e.splice(f,1);break}this._isBrowserObject(a)&&a.removeEventListener(b,d,!1)}}},fire:function(a,b){var d,f,g,h,j=Array.prototype.slice.call(arguments).splice(2);b==="mousewheel"&&(b=this._normaliseMouseWheelType());if(this._isBrowserObject(a)){if(typeof b!=="string")throw"type must be a string for DOM elements";g=this._NATIVE_EVENTS[b];d=document.createEvent(g?"HTMLEvents":
View
14 js/main.js
@@ -16,7 +16,7 @@ document.addEventListener("DOMContentLoaded", function() {
});
});
-
+/*
document.addEventListener("deviceready", phonegap_init, false);
function phonegap_init() {
@@ -25,7 +25,7 @@ function phonegap_init() {
navigator.app.loadUrl(e.getAttribute('href'));
});
});
-}
+}*/
// This callback function is called by the JSONP response of the Tumblr API
// request made in the script element below this one.
@@ -39,7 +39,8 @@ function load_images(json) {
instance,
images = [],
posts = json['response']['posts'],
- launch_link = document.getElementById('launch_link');
+ launch_link = document.getElementById('launch_link'),
+ launch_link_2 = document.getElementById('launch_link_2');
// Gather all 20 images returned from the Tumblr API call into an array of hashes.
for (i = 0; i < posts.length; i++) {
@@ -52,7 +53,7 @@ function load_images(json) {
// Configure Photoswipe to load images from the array of hashes created above.
options = {
- enableDrag: false,
+ //enableDrag: false,
captionAndToolbarAutoHideDelay: 0,
getImageSource: function(obj){
return obj.url;
@@ -66,4 +67,9 @@ function load_images(json) {
// Launch the slideshow when the user clicks on the launch link on the home screen.
set_click(launch_link, function(event) { instance.show(0); });
+
+
+ options.enableDrag = false;
+ instance2 = Code.PhotoSwipe.attach(images, options);
+ set_click(launch_link_2, function(event) { instance2.show(0); });
}
Please sign in to comment.
Something went wrong with that request. Please try again.