Permalink
Browse files

Added AMD Wrapper.

  • Loading branch information...
1 parent 43c530a commit bc50ca7e28f4eec502c69d9fceae14553f28c4b1 @blueimp committed Feb 15, 2012
Showing with 24 additions and 9 deletions.
  1. +21 −5 js/jquery.image-gallery.js
  2. +1 −1 js/jquery.image-gallery.min.js
  3. +2 −3 package.json
View
@@ -1,5 +1,5 @@
/*
- * jQuery Image Gallery Plugin 2.2
+ * jQuery Image Gallery Plugin 2.3
* https://github.com/blueimp/jQuery-Image-Gallery
*
* Copyright 2011, Sebastian Tschan
@@ -10,9 +10,25 @@
*/
/*jslint nomen: true */
-/*global jQuery, window, document, setTimeout, clearTimeout */
+/*global define, window, document, setTimeout, clearTimeout */
-(function ($) {
+(function (factory) {
+ 'use strict';
+ if (typeof define === 'function' && define.amd) {
+ // Register as an anonymous AMD module:
+ define([
+ 'jquery',
+ './load-image.js',
+ 'jquery-ui'
+ ], factory);
+ } else {
+ // Browser globals:
+ factory(
+ window.jQuery,
+ window.loadImage
+ );
+ }
+}(function ($, loadImage) {
'use strict';
// The Image Gallery plugin makes use of jQuery's delegate method to attach
@@ -338,7 +354,7 @@
this._documentClickHandler
);
that._loaded = null;
- this._img = $(window.loadImage(
+ this._img = $(loadImage(
this._link.href,
function (img) {
that._loadHandler(img);
@@ -523,4 +539,4 @@
});
-}(jQuery));
+}));

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,6 +1,6 @@
{
"name": "blueimp-image-gallery",
- "version": "2.2.0",
+ "version": "2.3.0",
"title": "jQuery Image Gallery",
"description": "jQuery Image Gallery is an extension to the Dialog component of jQuery UI, to ease navigation between a set of gallery images. It features mouse and keyboard navigation, transition effects, fullscreen mode and slideshow functionality.",
"keywords": [
@@ -37,8 +37,7 @@
],
"dependencies": {
"jquery": ">=1.6",
- "jquery.ui.widget": ">=1.8",
- "jquery.ui.dialog": ">=1.8",
+ "jquery-ui": ">=1.8",
"blueimp-load-image": ">=1.1.4"
}
}

0 comments on commit bc50ca7

Please sign in to comment.