assets-rails 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +13 -9
- data/assets-rails.gemspec +2 -0
- data/lib/assets-rails/engine.rb +3 -1
- data/lib/assets-rails/version.rb +1 -1
- data/vendor/assets/fonts/lightgallery/Slide-icons.dev.svg +33 -0
- data/vendor/assets/fonts/lightgallery/Slide-icons.eot +0 -0
- data/vendor/assets/fonts/lightgallery/Slide-icons.svg +33 -0
- data/vendor/assets/fonts/lightgallery/Slide-icons.ttf +0 -0
- data/vendor/assets/fonts/lightgallery/Slide-icons.woff +0 -0
- data/vendor/assets/fonts/photoswipe/v4.0.0/default-skin/default-skin.svg +38 -0
- data/vendor/assets/fonts/photoswipe/v4.0.2/default-skin/default-skin.svg +1 -0
- data/vendor/assets/images/jquery.share/social-icons-sprite.png +0 -0
- data/vendor/assets/images/jquery.share/social-icons.png +0 -0
- data/vendor/assets/images/lightgallery/loading.gif +0 -0
- data/vendor/assets/images/photoswipe/v4.0.0/default-skin/default-skin.png +0 -0
- data/vendor/assets/images/photoswipe/v4.0.0/default-skin/preloader.gif +0 -0
- data/vendor/assets/images/photoswipe/v4.0.2/default-skin/default-skin.png +0 -0
- data/vendor/assets/images/photoswipe/v4.0.2/default-skin/preloader.gif +0 -0
- data/vendor/assets/javascripts/imagesloaded/v3.1.8.js +1 -1
- data/vendor/assets/javascripts/imagesloaded/v3.1.8/imagesloaded.js +561 -3
- data/vendor/assets/javascripts/jquery.cookie/v1.4.1.js +2 -0
- data/vendor/assets/javascripts/jquery.cookie/v1.4.1/jquery.cookie.js +117 -0
- data/vendor/assets/javascripts/jquery.share.js +1 -0
- data/vendor/assets/javascripts/jquery.share/jquery.share.js +137 -0
- data/vendor/assets/javascripts/jquery.zoom/v1.7.13.js +1 -0
- data/vendor/assets/javascripts/jquery.zoom/v1.7.13/jquery.zoom.js +233 -0
- data/vendor/assets/javascripts/lightgallery/v1.1.4.js +1 -0
- data/vendor/assets/javascripts/lightgallery/v1.1.4/lightgallery.min.js +11 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.0.js +2 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.0/photoswipe-ui-default.js +824 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.0/photoswipe.js +3647 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.2.js +2 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.2/photoswipe-ui-default.js +792 -0
- data/vendor/assets/javascripts/photoswipe/v4.0.2/photoswipe.js +3589 -0
- data/vendor/assets/stylesheets/font-awesome/v4.2.0/_variables.scss +1 -1
- data/vendor/assets/stylesheets/jquery.collageplus/v0.3.3/transitions.css +202 -0
- data/vendor/assets/stylesheets/jquery.share.css +3 -0
- data/vendor/assets/stylesheets/jquery.share/jquery.share.scss +215 -0
- data/vendor/assets/stylesheets/lightgallery/v1.1.4/lightgallery.scss +629 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.0.css +3 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.0/default-skin.scss +418 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.0/photoswipe.css +125 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.2.css +3 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.2/default-skin.scss +390 -0
- data/vendor/assets/stylesheets/photoswipe/v4.0.2/photoswipe.css +148 -0
- metadata +43 -5
@@ -0,0 +1,117 @@
|
|
1
|
+
/*!
|
2
|
+
* jQuery Cookie Plugin v1.4.1
|
3
|
+
* https://github.com/carhartl/jquery-cookie
|
4
|
+
*
|
5
|
+
* Copyright 2006, 2014 Klaus Hartl
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
8
|
+
(function (factory) {
|
9
|
+
if (typeof define === 'function' && define.amd) {
|
10
|
+
// AMD
|
11
|
+
define(['jquery'], factory);
|
12
|
+
} else if (typeof exports === 'object') {
|
13
|
+
// CommonJS
|
14
|
+
factory(require('jquery'));
|
15
|
+
} else {
|
16
|
+
// Browser globals
|
17
|
+
factory(jQuery);
|
18
|
+
}
|
19
|
+
}(function ($) {
|
20
|
+
|
21
|
+
var pluses = /\+/g;
|
22
|
+
|
23
|
+
function encode(s) {
|
24
|
+
return config.raw ? s : encodeURIComponent(s);
|
25
|
+
}
|
26
|
+
|
27
|
+
function decode(s) {
|
28
|
+
return config.raw ? s : decodeURIComponent(s);
|
29
|
+
}
|
30
|
+
|
31
|
+
function stringifyCookieValue(value) {
|
32
|
+
return encode(config.json ? JSON.stringify(value) : String(value));
|
33
|
+
}
|
34
|
+
|
35
|
+
function parseCookieValue(s) {
|
36
|
+
if (s.indexOf('"') === 0) {
|
37
|
+
// This is a quoted cookie as according to RFC2068, unescape...
|
38
|
+
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
39
|
+
}
|
40
|
+
|
41
|
+
try {
|
42
|
+
// Replace server-side written pluses with spaces.
|
43
|
+
// If we can't decode the cookie, ignore it, it's unusable.
|
44
|
+
// If we can't parse the cookie, ignore it, it's unusable.
|
45
|
+
s = decodeURIComponent(s.replace(pluses, ' '));
|
46
|
+
return config.json ? JSON.parse(s) : s;
|
47
|
+
} catch(e) {}
|
48
|
+
}
|
49
|
+
|
50
|
+
function read(s, converter) {
|
51
|
+
var value = config.raw ? s : parseCookieValue(s);
|
52
|
+
return $.isFunction(converter) ? converter(value) : value;
|
53
|
+
}
|
54
|
+
|
55
|
+
var config = $.cookie = function (key, value, options) {
|
56
|
+
|
57
|
+
// Write
|
58
|
+
|
59
|
+
if (arguments.length > 1 && !$.isFunction(value)) {
|
60
|
+
options = $.extend({}, config.defaults, options);
|
61
|
+
|
62
|
+
if (typeof options.expires === 'number') {
|
63
|
+
var days = options.expires, t = options.expires = new Date();
|
64
|
+
t.setTime(+t + days * 864e+5);
|
65
|
+
}
|
66
|
+
|
67
|
+
return (document.cookie = [
|
68
|
+
encode(key), '=', stringifyCookieValue(value),
|
69
|
+
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
70
|
+
options.path ? '; path=' + options.path : '',
|
71
|
+
options.domain ? '; domain=' + options.domain : '',
|
72
|
+
options.secure ? '; secure' : ''
|
73
|
+
].join(''));
|
74
|
+
}
|
75
|
+
|
76
|
+
// Read
|
77
|
+
|
78
|
+
var result = key ? undefined : {};
|
79
|
+
|
80
|
+
// To prevent the for loop in the first place assign an empty array
|
81
|
+
// in case there are no cookies at all. Also prevents odd result when
|
82
|
+
// calling $.cookie().
|
83
|
+
var cookies = document.cookie ? document.cookie.split('; ') : [];
|
84
|
+
|
85
|
+
for (var i = 0, l = cookies.length; i < l; i++) {
|
86
|
+
var parts = cookies[i].split('=');
|
87
|
+
var name = decode(parts.shift());
|
88
|
+
var cookie = parts.join('=');
|
89
|
+
|
90
|
+
if (key && key === name) {
|
91
|
+
// If second argument (value) is a function it's a converter...
|
92
|
+
result = read(cookie, value);
|
93
|
+
break;
|
94
|
+
}
|
95
|
+
|
96
|
+
// Prevent storing a cookie that we couldn't decode.
|
97
|
+
if (!key && (cookie = read(cookie)) !== undefined) {
|
98
|
+
result[name] = cookie;
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
return result;
|
103
|
+
};
|
104
|
+
|
105
|
+
config.defaults = {};
|
106
|
+
|
107
|
+
$.removeCookie = function (key, options) {
|
108
|
+
if ($.cookie(key) === undefined) {
|
109
|
+
return false;
|
110
|
+
}
|
111
|
+
|
112
|
+
// Must not alter options, thus extending a fresh object...
|
113
|
+
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
114
|
+
return !$.cookie(key);
|
115
|
+
};
|
116
|
+
|
117
|
+
}));
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require jquery.share/jquery.share.js
|
@@ -0,0 +1,137 @@
|
|
1
|
+
/**
|
2
|
+
* jQuery.share - social media sharing plugin
|
3
|
+
* ---
|
4
|
+
* @author Carol Skelly (http://in1.com)
|
5
|
+
* @version 1.0
|
6
|
+
* @license MIT license (http://opensource.org/licenses/mit-license.php)
|
7
|
+
* ---
|
8
|
+
*/
|
9
|
+
|
10
|
+
;(function ( $, window, undefined ) {
|
11
|
+
|
12
|
+
var document = window.document;
|
13
|
+
|
14
|
+
$.fn.share = function(method) {
|
15
|
+
|
16
|
+
var methods = {
|
17
|
+
|
18
|
+
init : function(options) {
|
19
|
+
this.share.settings = $.extend({}, this.share.defaults, options);
|
20
|
+
var settings = this.share.settings,
|
21
|
+
networks = this.share.settings.networks,
|
22
|
+
theme = this.share.settings.theme,
|
23
|
+
orientation = this.share.settings.orientation,
|
24
|
+
affix = this.share.settings.affix,
|
25
|
+
margin = this.share.settings.margin,
|
26
|
+
pageTitle = this.share.settings.title||$(document).attr('title'),
|
27
|
+
pageUrl = this.share.settings.urlToShare||$(location).attr('href'),
|
28
|
+
pageDesc = "";
|
29
|
+
|
30
|
+
$.each($(document).find('meta[name="description"]'),function(idx,item){
|
31
|
+
pageDesc = $(item).attr("content");
|
32
|
+
});
|
33
|
+
|
34
|
+
// each instance of this plugin
|
35
|
+
return this.each(function() {
|
36
|
+
var $element = $(this),
|
37
|
+
id=$element.attr("id"),
|
38
|
+
u=encodeURIComponent(pageUrl),
|
39
|
+
t=encodeURIComponent(pageTitle),
|
40
|
+
d=pageDesc.substring(0,250),
|
41
|
+
href;
|
42
|
+
|
43
|
+
// append HTML for each network button
|
44
|
+
for (var item in networks) {
|
45
|
+
item = networks[item];
|
46
|
+
href = helpers.networkDefs[item].url;
|
47
|
+
href = href.replace('|u|',u).replace('|t|',t).replace('|d|',d)
|
48
|
+
.replace('|140|',t.substring(0,130));
|
49
|
+
$("<a href='"+href+"' title='Share this page on "+item+
|
50
|
+
"' class='pop share-"+theme+" share-"+theme+"-"+item+"'></a>")
|
51
|
+
.appendTo($element);
|
52
|
+
}
|
53
|
+
|
54
|
+
// customize css
|
55
|
+
$("#"+id+".share-"+theme).css('margin',margin);
|
56
|
+
|
57
|
+
if (orientation != "horizontal"){
|
58
|
+
$("#"+id+" a.share-"+theme).css('display','block');
|
59
|
+
}
|
60
|
+
else {
|
61
|
+
$("#"+id+" a.share-"+theme).css('display','inline-block');
|
62
|
+
}
|
63
|
+
|
64
|
+
if (typeof affix != "undefined"){
|
65
|
+
$element.addClass('share-affix');
|
66
|
+
if (affix.indexOf('right')!=-1){
|
67
|
+
$element.css('left','auto');
|
68
|
+
$element.css('right','0px');
|
69
|
+
if (affix.indexOf('center')!=-1){
|
70
|
+
$element.css('top','40%');
|
71
|
+
}
|
72
|
+
}
|
73
|
+
else if (affix.indexOf('left center')!=-1){
|
74
|
+
$element.css('top','40%');
|
75
|
+
}
|
76
|
+
|
77
|
+
if (affix.indexOf('bottom')!=-1){
|
78
|
+
$element.css('bottom','0px');
|
79
|
+
$element.css('top','auto');
|
80
|
+
if (affix.indexOf('center')!=-1){
|
81
|
+
$element.css('left','40%');
|
82
|
+
}
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
// bind click
|
87
|
+
$('.pop').click(function(){
|
88
|
+
window.open($(this).attr('href'),'t','toolbar=0,resizable=1,status=0,width=640,height=528');
|
89
|
+
return false;
|
90
|
+
});
|
91
|
+
|
92
|
+
|
93
|
+
});// end plugin instance
|
94
|
+
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
var helpers = {
|
99
|
+
networkDefs: {
|
100
|
+
facebook:{url:'http://www.facebook.com/share.php?u=|u|'},
|
101
|
+
//http://twitter.com/home?status=jQuery%20Share%20Social%20Media%20Plugin%20-%20Share%20to%20multiple%20social%20networks%20from%20a%20single%20form%20http://plugins.in1.com/share/demo
|
102
|
+
twitter:{url:'https://twitter.com/share?url=|u|&text=|140|'},
|
103
|
+
linkedin:{url:'http://www.linkedin.com/shareArticle?mini=true&url=|u|&title=|t|&summary=|d|&source=in1.com'},
|
104
|
+
in1:{url:'http://www.in1.com/cast?u=|u|',w:'490',h:'529'},
|
105
|
+
tumblr:{url:'http://www.tumblr.com/share?v=3&u=|u|'},
|
106
|
+
digg:{url:'http://digg.com/submit?url=|u|&title=|t|'},
|
107
|
+
googleplus:{url:'https://plusone.google.com/_/+1/confirm?hl=en&url=|u|'},
|
108
|
+
reddit:{url:'http://reddit.com/submit?url=|u|'},
|
109
|
+
pinterest:{url:'http://pinterest.com/pin/create/button/?url=|u|&media=&description=|d|'},
|
110
|
+
posterous:{url:'http://posterous.com/share?linkto=|u|&title=|t|'},
|
111
|
+
stumbleupon:{url:'http://www.stumbleupon.com/submit?url=|u|&title=|t|'},
|
112
|
+
email:{url:'mailto:?subject=|t|'}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
|
116
|
+
if (methods[method]) {
|
117
|
+
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
118
|
+
} else if (typeof method === 'object' || !method) {
|
119
|
+
return methods.init.apply(this, arguments);
|
120
|
+
} else {
|
121
|
+
$.error( 'Method "' + method + '" does not exist in social plugin');
|
122
|
+
}
|
123
|
+
|
124
|
+
}
|
125
|
+
|
126
|
+
$.fn.share.defaults = {
|
127
|
+
networks: ['facebook','twitter','linkedin'],
|
128
|
+
theme: 'icon', // use round icons sprite
|
129
|
+
autoShow: true,
|
130
|
+
margin: '3px',
|
131
|
+
orientation: 'horizontal',
|
132
|
+
useIn1: false
|
133
|
+
}
|
134
|
+
|
135
|
+
$.fn.share.settings = {}
|
136
|
+
|
137
|
+
})(jQuery, window);
|
@@ -0,0 +1 @@
|
|
1
|
+
//= require jquery.zoom/v1.7.13/jquery.zoom.js
|
@@ -0,0 +1,233 @@
|
|
1
|
+
/*!
|
2
|
+
Zoom 1.7.13
|
3
|
+
license: MIT
|
4
|
+
http://www.jacklmoore.com/zoom
|
5
|
+
*/
|
6
|
+
(function ($) {
|
7
|
+
var defaults = {
|
8
|
+
url: false,
|
9
|
+
callback: false,
|
10
|
+
target: false,
|
11
|
+
duration: 120,
|
12
|
+
on: 'mouseover', // other options: grab, click, toggle
|
13
|
+
touch: true, // enables a touch fallback
|
14
|
+
onZoomIn: false,
|
15
|
+
onZoomOut: false,
|
16
|
+
magnify: 1
|
17
|
+
};
|
18
|
+
|
19
|
+
// Core Zoom Logic, independent of event listeners.
|
20
|
+
$.zoom = function(target, source, img, magnify) {
|
21
|
+
var targetHeight,
|
22
|
+
targetWidth,
|
23
|
+
sourceHeight,
|
24
|
+
sourceWidth,
|
25
|
+
xRatio,
|
26
|
+
yRatio,
|
27
|
+
offset,
|
28
|
+
position = $(target).css('position'),
|
29
|
+
$source = $(source);
|
30
|
+
|
31
|
+
// The parent element needs positioning so that the zoomed element can be correctly positioned within.
|
32
|
+
target.style.position = /(absolute|fixed)/.test(position) ? position : 'relative';
|
33
|
+
target.style.overflow = 'hidden';
|
34
|
+
|
35
|
+
img.style.width = img.style.height = '';
|
36
|
+
|
37
|
+
$(img)
|
38
|
+
.addClass('zoomImg')
|
39
|
+
.css({
|
40
|
+
position: 'absolute',
|
41
|
+
top: 0,
|
42
|
+
left: 0,
|
43
|
+
opacity: 0,
|
44
|
+
width: img.width * magnify,
|
45
|
+
height: img.height * magnify,
|
46
|
+
border: 'none',
|
47
|
+
maxWidth: 'none',
|
48
|
+
maxHeight: 'none'
|
49
|
+
})
|
50
|
+
.appendTo(target);
|
51
|
+
|
52
|
+
return {
|
53
|
+
init: function() {
|
54
|
+
targetWidth = $(target).outerWidth();
|
55
|
+
targetHeight = $(target).outerHeight();
|
56
|
+
|
57
|
+
if (source === target) {
|
58
|
+
sourceWidth = targetWidth;
|
59
|
+
sourceHeight = targetHeight;
|
60
|
+
} else {
|
61
|
+
sourceWidth = $source.outerWidth();
|
62
|
+
sourceHeight = $source.outerHeight();
|
63
|
+
}
|
64
|
+
|
65
|
+
xRatio = (img.width - targetWidth) / sourceWidth;
|
66
|
+
yRatio = (img.height - targetHeight) / sourceHeight;
|
67
|
+
|
68
|
+
offset = $source.offset();
|
69
|
+
},
|
70
|
+
move: function (e) {
|
71
|
+
var left = (e.pageX - offset.left),
|
72
|
+
top = (e.pageY - offset.top);
|
73
|
+
|
74
|
+
top = Math.max(Math.min(top, sourceHeight), 0);
|
75
|
+
left = Math.max(Math.min(left, sourceWidth), 0);
|
76
|
+
|
77
|
+
img.style.left = (left * -xRatio) + 'px';
|
78
|
+
img.style.top = (top * -yRatio) + 'px';
|
79
|
+
}
|
80
|
+
};
|
81
|
+
};
|
82
|
+
|
83
|
+
$.fn.zoom = function (options) {
|
84
|
+
return this.each(function () {
|
85
|
+
var
|
86
|
+
settings = $.extend({}, defaults, options || {}),
|
87
|
+
//target will display the zoomed image
|
88
|
+
target = settings.target || this,
|
89
|
+
//source will provide zoom location info (thumbnail)
|
90
|
+
source = this,
|
91
|
+
$source = $(source),
|
92
|
+
img = document.createElement('img'),
|
93
|
+
$img = $(img),
|
94
|
+
mousemove = 'mousemove.zoom',
|
95
|
+
clicked = false,
|
96
|
+
touched = false,
|
97
|
+
$urlElement;
|
98
|
+
|
99
|
+
// If a url wasn't specified, look for an image element.
|
100
|
+
if (!settings.url) {
|
101
|
+
$urlElement = $source.find('img');
|
102
|
+
if ($urlElement[0]) {
|
103
|
+
settings.url = $urlElement.data('src') || $urlElement.attr('src');
|
104
|
+
}
|
105
|
+
if (!settings.url) {
|
106
|
+
return;
|
107
|
+
}
|
108
|
+
}
|
109
|
+
|
110
|
+
(function(){
|
111
|
+
var position = target.style.position;
|
112
|
+
var overflow = target.style.overflow;
|
113
|
+
|
114
|
+
$source.one('zoom.destroy', function(){
|
115
|
+
$source.off(".zoom");
|
116
|
+
target.style.position = position;
|
117
|
+
target.style.overflow = overflow;
|
118
|
+
$img.remove();
|
119
|
+
});
|
120
|
+
|
121
|
+
}());
|
122
|
+
|
123
|
+
img.onload = function () {
|
124
|
+
var zoom = $.zoom(target, source, img, settings.magnify);
|
125
|
+
|
126
|
+
function start(e) {
|
127
|
+
zoom.init();
|
128
|
+
zoom.move(e);
|
129
|
+
|
130
|
+
// Skip the fade-in for IE8 and lower since it chokes on fading-in
|
131
|
+
// and changing position based on mousemovement at the same time.
|
132
|
+
$img.stop()
|
133
|
+
.fadeTo($.support.opacity ? settings.duration : 0, 1, $.isFunction(settings.onZoomIn) ? settings.onZoomIn.call(img) : false);
|
134
|
+
}
|
135
|
+
|
136
|
+
function stop() {
|
137
|
+
$img.stop()
|
138
|
+
.fadeTo(settings.duration, 0, $.isFunction(settings.onZoomOut) ? settings.onZoomOut.call(img) : false);
|
139
|
+
}
|
140
|
+
|
141
|
+
// Mouse events
|
142
|
+
if (settings.on === 'grab') {
|
143
|
+
$source
|
144
|
+
.on('mousedown.zoom',
|
145
|
+
function (e) {
|
146
|
+
if (e.which === 1) {
|
147
|
+
$(document).one('mouseup.zoom',
|
148
|
+
function () {
|
149
|
+
stop();
|
150
|
+
|
151
|
+
$(document).off(mousemove, zoom.move);
|
152
|
+
}
|
153
|
+
);
|
154
|
+
|
155
|
+
start(e);
|
156
|
+
|
157
|
+
$(document).on(mousemove, zoom.move);
|
158
|
+
|
159
|
+
e.preventDefault();
|
160
|
+
}
|
161
|
+
}
|
162
|
+
);
|
163
|
+
} else if (settings.on === 'click') {
|
164
|
+
$source.on('click.zoom',
|
165
|
+
function (e) {
|
166
|
+
if (clicked) {
|
167
|
+
// bubble the event up to the document to trigger the unbind.
|
168
|
+
return;
|
169
|
+
} else {
|
170
|
+
clicked = true;
|
171
|
+
start(e);
|
172
|
+
$(document).on(mousemove, zoom.move);
|
173
|
+
$(document).one('click.zoom',
|
174
|
+
function () {
|
175
|
+
stop();
|
176
|
+
clicked = false;
|
177
|
+
$(document).off(mousemove, zoom.move);
|
178
|
+
}
|
179
|
+
);
|
180
|
+
return false;
|
181
|
+
}
|
182
|
+
}
|
183
|
+
);
|
184
|
+
} else if (settings.on === 'toggle') {
|
185
|
+
$source.on('click.zoom',
|
186
|
+
function (e) {
|
187
|
+
if (clicked) {
|
188
|
+
stop();
|
189
|
+
} else {
|
190
|
+
start(e);
|
191
|
+
}
|
192
|
+
clicked = !clicked;
|
193
|
+
}
|
194
|
+
);
|
195
|
+
} else if (settings.on === 'mouseover') {
|
196
|
+
zoom.init(); // Preemptively call init because IE7 will fire the mousemove handler before the hover handler.
|
197
|
+
|
198
|
+
$source
|
199
|
+
.on('mouseenter.zoom', start)
|
200
|
+
.on('mouseleave.zoom', stop)
|
201
|
+
.on(mousemove, zoom.move);
|
202
|
+
}
|
203
|
+
|
204
|
+
// Touch fallback
|
205
|
+
if (settings.touch) {
|
206
|
+
$source
|
207
|
+
.on('touchstart.zoom', function (e) {
|
208
|
+
e.preventDefault();
|
209
|
+
if (touched) {
|
210
|
+
touched = false;
|
211
|
+
stop();
|
212
|
+
} else {
|
213
|
+
touched = true;
|
214
|
+
start( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );
|
215
|
+
}
|
216
|
+
})
|
217
|
+
.on('touchmove.zoom', function (e) {
|
218
|
+
e.preventDefault();
|
219
|
+
zoom.move( e.originalEvent.touches[0] || e.originalEvent.changedTouches[0] );
|
220
|
+
});
|
221
|
+
}
|
222
|
+
|
223
|
+
if ($.isFunction(settings.callback)) {
|
224
|
+
settings.callback.call(img);
|
225
|
+
}
|
226
|
+
};
|
227
|
+
|
228
|
+
img.src = settings.url;
|
229
|
+
});
|
230
|
+
};
|
231
|
+
|
232
|
+
$.fn.zoom.defaults = defaults;
|
233
|
+
}(window.jQuery));
|