Skip to content

Commit

Permalink
Versioning and compatibility checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Ludwig committed Feb 12, 2017
1 parent 68882ad commit f163ee6
Show file tree
Hide file tree
Showing 21 changed files with 45 additions and 33 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ CDN
---
::

<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.2/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.3/galleria.min.js"></script>

https://cdnjs.com/libraries/galleria
9 changes: 7 additions & 2 deletions dist/galleria.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Galleria v1.5.2 2017-01-13
* Galleria v1.5.3 2017-02-13
* 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.52,
VERSION = 1.53,
DEBUG = true,
TIMEOUT = 30000,
DUMMY = false,
Expand Down Expand Up @@ -5683,6 +5683,11 @@ Galleria.addTheme = function( theme ) {
Galleria.raise('No theme name specified');
}

// make sure it's compatible
if ( !theme.version || parseInt(Galleria.version*10) > parseInt(theme.version*10) ) {
Galleria.raise('This version of Galleria requires '+theme.name+' theme version '+Galleria.version.toFixed(1)+' or later', true);
}

if ( typeof theme.defaults !== 'object' ) {
theme.defaults = {};
} else {
Expand Down
8 changes: 4 additions & 4 deletions dist/galleria.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/plugins/flickr/galleria.flickr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria Flickr Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/flickr/galleria.flickr.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/plugins/history/galleria.history.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria History Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/history/galleria.history.min.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Galleria - v1.5.2 2017-01-13
* Galleria - v1.5.3 2017-02-13
* https://galleria.io
*
* Copyright (c) 2010 - 2017 worse is better UG
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/picasa/galleria.picasa.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria Picasa Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
2 changes: 1 addition & 1 deletion dist/plugins/picasa/galleria.picasa.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/themes/classic/classic-demo-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ <h1>Galleria Classic Theme</h1>
<!-- <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.5.2/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.2/themes/classic/galleria.classic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.3/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.3/themes/classic/galleria.classic.min.js"></script>
<script>
$(function() {
Galleria.run('#galleria');
Expand Down
4 changes: 2 additions & 2 deletions dist/themes/classic/galleria.classic.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Galleria Classic Theme 2016-09-03
* Galleria Classic Theme 2017-02-13
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
5 changes: 3 additions & 2 deletions dist/themes/classic/galleria.classic.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Galleria Classic Theme 2016-09-03
* Galleria Classic Theme 2017-02-13
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand All @@ -14,6 +14,7 @@

Galleria.addTheme({
name: 'classic',
version: 1.5,
author: 'Galleria',
css: 'galleria.classic.css',
defaults: {
Expand Down
4 changes: 2 additions & 2 deletions dist/themes/classic/galleria.classic.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "galleria",
"version": "1.5.2",
"version": "1.5.3",
"title": "Responsive JavaScript Image Gallery",
"description": "A free JavaScript image gallery framework that simplifies the process of creating beautiful image galleries for the web and mobile devices.",
"homepage": "https://galleria.io",
Expand Down
9 changes: 7 additions & 2 deletions src/galleria.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Galleria v1.5.2 2017-01-13
* Galleria v1.5.3 2017-02-13
* 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.52,
VERSION = 1.53,
DEBUG = true,
TIMEOUT = 30000,
DUMMY = false,
Expand Down Expand Up @@ -5683,6 +5683,11 @@ Galleria.addTheme = function( theme ) {
Galleria.raise('No theme name specified');
}

// make sure it's compatible
if ( !theme.version || parseInt(Galleria.version*10) > parseInt(theme.version*10) ) {
Galleria.raise('This version of Galleria requires '+theme.name+' theme version '+Galleria.version.toFixed(1)+' or later', true);
}

if ( typeof theme.defaults !== 'object' ) {
theme.defaults = {};
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/flickr/galleria.flickr.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria Flickr Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/history/galleria.history.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria History Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/picasa/galleria.picasa.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Galleria Picasa Plugin 2016-09-03
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
4 changes: 2 additions & 2 deletions src/themes/classic/classic-demo-cdn.html
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ <h1>Galleria Classic Theme</h1>
<!-- <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.5.2/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.2/themes/classic/galleria.classic.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.3/galleria.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/galleria/1.5.3/themes/classic/galleria.classic.min.js"></script>
<script>
$(function() {
Galleria.run('#galleria');
Expand Down
4 changes: 2 additions & 2 deletions src/themes/classic/galleria.classic.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Galleria Classic Theme 2016-09-03
* Galleria Classic Theme 2017-02-13
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand Down
5 changes: 3 additions & 2 deletions src/themes/classic/galleria.classic.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* Galleria Classic Theme 2016-09-03
* Galleria Classic Theme 2017-02-13
* http://galleria.io
*
* Copyright (c) 2010 - 2016 worse is better UG
* Copyright (c) 2010 - 2017 worse is better UG
* Licensed under the MIT license
* https://raw.github.com/worseisbetter/galleria/master/LICENSE
*
Expand All @@ -14,6 +14,7 @@

Galleria.addTheme({
name: 'classic',
version: 1.5,
author: 'Galleria',
css: 'galleria.classic.css',
defaults: {
Expand Down

0 comments on commit f163ee6

Please sign in to comment.