Skip to content

Commit

Permalink
Fix jQuery3 deprecated functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Ludwig committed Dec 8, 2016
1 parent fb0bf17 commit 7281886
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
14 changes: 7 additions & 7 deletions src/galleria.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Galleria v1.4.7 2016-09-17
* Galleria v1.5.0 2016-12-07
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
Expand All @@ -21,7 +21,7 @@ var doc = window.document,
protoArray = Array.prototype,

// internal constants
VERSION = 1.47,
VERSION = 1.50,
DEBUG = true,
TIMEOUT = 30000,
DUMMY = false,
Expand Down Expand Up @@ -5780,7 +5780,7 @@ Galleria.loadTheme = function( src, options ) {
err;

// start listening for the timeout onload
$( window ).load( function() {
$( window ).on('load', function() {
if ( !loaded ) {
// give it another 20 seconds
err = window.setTimeout(function() {
Expand Down Expand Up @@ -6157,7 +6157,7 @@ Galleria.Picture.prototype = {
*/

preload: function( src ) {
$( new Image() ).load((function(src, cache) {
$( new Image() ).on( 'load', (function(src, cache) {
return function() {
cache[ src ] = src;
};
Expand Down Expand Up @@ -6201,7 +6201,7 @@ Galleria.Picture.prototype = {

this.container.appendChild( this.image );

$('#'+id).load( (function( self, callback ) {
$('#'+id).on( 'load', (function( self, callback ) {
return function() {
window.setTimeout(function() {
$( self.image ).css( 'visibility', 'visible' );
Expand Down Expand Up @@ -6298,7 +6298,7 @@ Galleria.Picture.prototype = {
},
error: function() {
if ( !resort ) {
$(new Image()).load( onload ).attr( 'src', img.src );
$(new Image()).on( 'load', onload ).attr( 'src', img.src );
resort = true;
} else {
Galleria.raise('Could not extract width/height from image: ' + img.src +
Expand Down Expand Up @@ -6329,7 +6329,7 @@ Galleria.Picture.prototype = {
});

// begin load and insert in cache when done
$image.load( onload ).on( 'error', onerror ).attr( 'src', src );
$image.on( 'load', onload ).on( 'error', onerror ).attr( 'src', src );

// return the container
return this.container;
Expand Down
9 changes: 5 additions & 4 deletions src/themes/classic/classic-demo-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h1>Galleria Classic Theme</h1>
<a href="https://vimeo.com/25750735">
<span class="video">Works for vimeo too.</span>
</a>
<a href="https://www.youtube.com/watch?v=gAeYCJZ_meY">
<a href="https://www.youtube.com/watch?v=GOD-RyVB-3Q">
<span class="video">Works for youtube too.</span>
</a>

Expand All @@ -111,10 +111,11 @@ <h1>Galleria Classic Theme</h1>
</div>

<!-- load jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.js"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js"></script>
<!-- load Galleria -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.7/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.4.7/themes/classic/galleria.classic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.0/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.0/themes/classic/galleria.classic.min.js"></script>
<script>
$(function() {
Galleria.run('#galleria');
Expand Down
5 changes: 3 additions & 2 deletions src/themes/classic/classic-demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
</style>

<!-- load jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.js"></script> -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.js"></script>

<!-- load Galleria -->
<script src="../../galleria.js"></script>
Expand Down Expand Up @@ -109,7 +110,7 @@ <h1>Galleria Classic Theme</h1>
<a href="https://vimeo.com/25750735">
<span class="video">Works for vimeo too.</span>
</a>
<a href="https://www.youtube.com/watch?v=gAeYCJZ_meY">
<a href="https://www.youtube.com/watch?v=GOD-RyVB-3Q">
<span class="video">Works for youtube too.</span>
</a>

Expand Down

0 comments on commit 7281886

Please sign in to comment.