mix-rails-core 0.23.1 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/app/assets/images/blank.gif +0 -0
- data/app/assets/images/jqzoom/advertise.jpg +0 -0
- data/app/assets/images/jqzoom/zoomloader.gif +0 -0
- data/app/assets/images/loadinfo.net.gif +0 -0
- data/app/assets/javascripts/angular-google-maps.js +531 -0
- data/app/assets/javascripts/angular-ui.min.js +7 -0
- data/app/assets/javascripts/angular.min.js +161 -0
- data/app/assets/javascripts/gmaps.js +1909 -0
- data/app/assets/javascripts/jquery-gmaps-latlon-picker.js +231 -0
- data/app/assets/javascripts/jquery.jqzoom.js +1 -0
- data/app/assets/javascripts/jquery.krioImageLoader.js +47 -0
- data/app/assets/javascripts/jquery.lazyload.js +227 -0
- data/app/assets/javascripts/jquery.maskedinput.js +290 -0
- data/app/assets/javascripts/jquery.meio.mask.min.js +1 -0
- data/app/assets/javascripts/jquery.ui.addresspicker.js +194 -0
- data/app/assets/javascripts/jquery/jquery.jqzoom-core.js +733 -0
- data/app/assets/javascripts/multizoom.js +388 -0
- data/app/assets/stylesheets/angular-ui.min.css +1 -0
- data/app/assets/stylesheets/jquery-gmaps-latlon-picker.css +2 -0
- data/app/assets/stylesheets/jquery.jqzoom.css +3 -0
- data/app/assets/stylesheets/jquery/jquery.jqzoom.css.erb +120 -0
- data/app/assets/stylesheets/multizoom.css +48 -0
- data/app/helpers/core_helper.rb +4 -0
- data/app/inputs/cell_input.rb +5 -0
- data/app/inputs/cep_input.rb +5 -0
- data/app/inputs/phone_input.rb +5 -0
- data/app/inputs/state_input.rb +5 -0
- data/app/models/attachment.rb +4 -1
- data/app/models/category.rb +4 -1
- data/app/models/ckeditor/asset.rb +7 -0
- data/app/models/ckeditor/attachment_file.rb +7 -0
- data/app/models/ckeditor/picture.rb +7 -0
- data/app/uploaders/ckeditor_attachment_file_uploader.rb +36 -0
- data/app/uploaders/ckeditor_picture_uploader.rb +47 -0
- data/app/views/admix/categories/_form_config.haml +3 -0
- data/config/initializers/ckeditor.rb +21 -0
- data/config/initializers/defaults_rails.rb +10 -1
- data/config/locales/core.pt-BR.yml +25 -2
- data/config/routes.rb +2 -0
- data/db/migrate/20130226152256_create_ckeditor_assets.rb +26 -0
- data/lib/mix-rails-core.rb +3 -0
- data/lib/mix-rails-core/version.rb +2 -2
- metadata +73 -120
- data/app/assets/javascripts/jquery/jquery.maskedinput-1.3.min.js +0 -7
- data/app/models/admix/categories_datagrid.rb +0 -14
- data/app/views/admix/categories/_form_fields.haml +0 -1
@@ -0,0 +1,388 @@
|
|
1
|
+
|
2
|
+
// Multi-Zoom Script (c)2012 John Davenport Scheuer
|
3
|
+
// as first seen in http://www.dynamicdrive.com/forums/
|
4
|
+
// username: jscheuer1 - This Notice Must Remain for Legal Use
|
5
|
+
// requires: a modified version of Dynamic Drive's Featured Image Zoomer (w/ adjustable power) (included)
|
6
|
+
|
7
|
+
/*Featured Image Zoomer (May 8th, 2010)
|
8
|
+
* This notice must stay intact for usage
|
9
|
+
* Author: Dynamic Drive at http://www.dynamicdrive.com/
|
10
|
+
* Visit http://www.dynamicdrive.com/ for full source code
|
11
|
+
*/
|
12
|
+
|
13
|
+
// Feb 21st, 2011: Script updated to v1.5, which now includes new feature by jscheuer1 (http://www.dynamicdrive.com/forums/member.php?u=2033) to show optional "magnifying lens" while over thumbnail image.
|
14
|
+
// March 1st, 2011: Script updated to v1.51. Minor improvements to inner workings of script.
|
15
|
+
// July 9th, 12': Script updated to v1.5.1, which fixes mouse wheel issue with script when used with a more recent version of jQuery.
|
16
|
+
// Nov 5th, 2012: Unofficial update to v1.5.1m for integration with multi-zoom (adds multiple images to be zoomed via thumbnail activated image swapping)
|
17
|
+
// Nov 28th, 2012: Version 2.1 w/Multi Zoom, updates - new features and bug fixes
|
18
|
+
|
19
|
+
var featuredimagezoomer = { // the two options for Featured Image Zoomer:
|
20
|
+
loadinggif: 'spinningred.gif', // full path or URL to "loading" gif
|
21
|
+
magnifycursor: 'crosshair' // value for CSS's 'cursor' property when over the zoomable image
|
22
|
+
};
|
23
|
+
|
24
|
+
//////////////// No Need To Edit Beyond Here ////////////////
|
25
|
+
|
26
|
+
(function($){
|
27
|
+
|
28
|
+
$('head').append('<style type="text/css">.featuredimagezoomerhidden {visibility: hidden!important;}</style>');
|
29
|
+
|
30
|
+
$.fn.multizoomhide = function(){
|
31
|
+
return $('<style type="text/css">' + this.selector + ' {visibility: hidden;}<\/style>').appendTo('head');
|
32
|
+
};
|
33
|
+
|
34
|
+
$.fn.addmultizoom = function(options){
|
35
|
+
|
36
|
+
var indoptions = {largeimage: options.largeimage}, $imgObj = $(options.imgObj + ':not(".thumbs")'),
|
37
|
+
$descArea = $(options.descArea), first = true, splitre = /, ?/;
|
38
|
+
|
39
|
+
options = $.extend({
|
40
|
+
speed: 'slow',
|
41
|
+
initzoomablefade: true,
|
42
|
+
zoomablefade: true
|
43
|
+
}, options);
|
44
|
+
|
45
|
+
function loadfunction(){
|
46
|
+
var lnk = this, styleobj1 = {}, styleobj2 = {}, $nim, lnkd, lnkt, lnko, w, h;
|
47
|
+
if((lnkd = lnk.getAttribute('data-dims'))){
|
48
|
+
lnkd = lnkd.split(splitre);
|
49
|
+
w = lnkd[0]; h = lnkd[1];
|
50
|
+
}
|
51
|
+
$(new Image()).error(function(){
|
52
|
+
if(lnk.tagName && !options.notmulti){
|
53
|
+
alert("Error: I couldn't find the image:\n\n" + lnk.href + ((lnkt = lnk.getAttribute('data-title'))? '\n\n"' + lnkt + '"' : ''));
|
54
|
+
if((lnko = $imgObj.data('last-trigger'))){
|
55
|
+
first = true;
|
56
|
+
$(lnko).trigger('click');
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}).load(function(){
|
60
|
+
var opacity = $imgObj.css('opacity'), combinedoptions = {}, $parent;
|
61
|
+
if(isNaN(opacity)){opacity = 1;}
|
62
|
+
if(options.notmulti || !indoptions.largeimage){
|
63
|
+
w = options.width || $imgObj.width(); h = options.height || $imgObj.height();
|
64
|
+
}
|
65
|
+
$imgObj.attr('src', this.src).css({width: w || options.width || this.width, height: (h = +(h || options.height || this.height))});
|
66
|
+
if($imgObj.data('added')) {$imgObj.data('added').remove()};
|
67
|
+
$imgObj.data('last-trigger', lnk);
|
68
|
+
if(options.imagevertcenter){styleobj1 = {top: ($imgObj.parent().innerHeight() - h) / 2};}
|
69
|
+
$imgObj.css(styleobj1).addimagezoom($.extend(combinedoptions, options, indoptions))
|
70
|
+
.data('added', $('.magnifyarea:last' + (combinedoptions.cursorshade? ', .cursorshade:last' : '') + ', .zoomstatus:last, .zoomtracker:last'));
|
71
|
+
if(options.magvertcenter){
|
72
|
+
$('.magnifyarea:last').css({marginTop: (h - $('.magnifyarea:last').height()) / 2});
|
73
|
+
}
|
74
|
+
if(options.descpos){
|
75
|
+
$parent = $imgObj.parent();
|
76
|
+
styleobj2 = {left: $parent.offset().left + ($parent.outerWidth() - $parent.width()) / 2, top: h + $imgObj.offset().top};
|
77
|
+
}
|
78
|
+
if(options.notmulti){
|
79
|
+
$descArea.css(styleobj2);
|
80
|
+
} else {
|
81
|
+
$descArea.css(styleobj2).empty().append(lnk.getAttribute('data-title') || '');
|
82
|
+
}
|
83
|
+
if(+opacity < 1){$imgObj.add($descArea).animate({opacity: 1}, options.speed);}
|
84
|
+
}).attr('src', $imgObj.data('src'));
|
85
|
+
}
|
86
|
+
|
87
|
+
this.click(function(e){
|
88
|
+
e.preventDefault();
|
89
|
+
var src = $imgObj.attr('src'), ms, zr, cs, opacityObj = {opacity: 0};
|
90
|
+
if(!first && (src === this.href || src === this.getAttribute('href'))){return;}
|
91
|
+
if(first && !options.initzoomablefade || !options.zoomablefade){opacityObj = {};}
|
92
|
+
first = false;
|
93
|
+
indoptions.largeimage = this.getAttribute('data-large') || options.largeimage || '';
|
94
|
+
if(indoptions.largeimage === 'none'){indoptions.largeimage = '';}
|
95
|
+
if((ms = this.getAttribute('data-magsize')) || options.magnifiersize){
|
96
|
+
indoptions.magnifiersize = (ms? ms.split(splitre) : '') || options.magnifiersize;
|
97
|
+
} else {delete indoptions.magnifiersize;}
|
98
|
+
indoptions.zoomrange = ((zr = this.getAttribute('data-zoomrange'))? (zr = zr.split(splitre)) : '') || options.zoomrange || '';
|
99
|
+
if(zr){zr[0] = +zr[0]; zr[1] = +zr[1];}
|
100
|
+
indoptions.cursorshade = ((cs = this.getAttribute('data-lens'))? cs : '') || options.cursorshade || '';
|
101
|
+
if(cs){indoptions.cursorshade = eval(cs);}
|
102
|
+
$imgObj.data('added') &&
|
103
|
+
$imgObj.stop(true, true).data('added').not('.zoomtracker').remove().end()
|
104
|
+
.css({background: 'url(' + featuredimagezoomer.loadinggif + ') center no-repeat'});
|
105
|
+
$imgObj.css($.extend({visibility: 'visible'}, ($imgObj.data('added')? options.zoomablefade? {opacity: 0.25} : opacityObj : opacityObj))).data('src', this.href);
|
106
|
+
$descArea.css($.extend({visibility: 'visible'}, opacityObj));
|
107
|
+
loadfunction.call(this);
|
108
|
+
}).eq(0).trigger('click');
|
109
|
+
|
110
|
+
return this;
|
111
|
+
};
|
112
|
+
|
113
|
+
// Featured Image Zoomer main code:
|
114
|
+
|
115
|
+
$.extend(featuredimagezoomer, {
|
116
|
+
|
117
|
+
dsetting: { //default settings
|
118
|
+
magnifierpos: 'right',
|
119
|
+
magnifiersize:[200, 200],
|
120
|
+
cursorshadecolor: '#fff',
|
121
|
+
cursorshadeopacity: 0.3,
|
122
|
+
cursorshadeborder: '1px solid black',
|
123
|
+
cursorshade: false,
|
124
|
+
leftoffset: 15, //offsets here are used (added to) the width of the magnifyarea when
|
125
|
+
rightoffset: 10 //calculating space requirements and to position it visa vis any drop shadow
|
126
|
+
},
|
127
|
+
|
128
|
+
isie: (function(){/*@cc_on @*//*@if(@_jscript_version >= 5)return true;@end @*/return false;})(), //is this IE?
|
129
|
+
|
130
|
+
showimage: function($tracker, $mag, showstatus){
|
131
|
+
var specs=$tracker.data('specs'), d=specs.magpos, fiz=this;
|
132
|
+
var coords=$tracker.data('specs').coords //get coords of tracker (from upper corner of document)
|
133
|
+
specs.windimensions={w:$(window).width(), h:$(window).height()}; //remember window dimensions
|
134
|
+
var magcoords={} //object to store coords magnifier DIV should move to
|
135
|
+
magcoords.left = coords.left + (d === 'left'? -specs.magsize.w - specs.lo : $tracker.width() + specs.ro);
|
136
|
+
//switch sides for magnifiers that don't have enough room to display on the right if there's room on the left:
|
137
|
+
if(d!=='left' && magcoords.left + specs.magsize.w + specs.lo >= specs.windimensions.w && coords.left - specs.magsize.w >= specs.lo){
|
138
|
+
magcoords.left = coords.left - specs.magsize.w - specs.lo;
|
139
|
+
} else if(d==='left' && magcoords.left < specs.ro) { //if there's no room on the left, move to the right
|
140
|
+
magcoords.left = coords.left + $tracker.width() + specs.ro;
|
141
|
+
}
|
142
|
+
$mag.css({left: magcoords.left, top:coords.top}).show(); //position magnifier DIV on page
|
143
|
+
specs.$statusdiv.html('Current Zoom: '+specs.curpower+'<div style="font-size:80%">Use Mouse Wheel to Zoom In/Out</div>');
|
144
|
+
if (showstatus) //show status DIV? (only when a range of zoom is defined)
|
145
|
+
fiz.showstatusdiv(specs, 400, 2000);
|
146
|
+
},
|
147
|
+
|
148
|
+
hideimage: function($tracker, $mag, showstatus){
|
149
|
+
var specs=$tracker.data('specs');
|
150
|
+
$mag.hide();
|
151
|
+
if (showstatus)
|
152
|
+
this.hidestatusdiv(specs);
|
153
|
+
},
|
154
|
+
|
155
|
+
showstatusdiv: function(specs, fadedur, showdur){
|
156
|
+
clearTimeout(specs.statustimer)
|
157
|
+
specs.$statusdiv.css({visibility: 'visible'}).fadeIn(fadedur) //show status div
|
158
|
+
specs.statustimer=setTimeout(function(){featuredimagezoomer.hidestatusdiv(specs)}, showdur) //hide status div after delay
|
159
|
+
},
|
160
|
+
|
161
|
+
hidestatusdiv: function(specs){
|
162
|
+
specs.$statusdiv.stop(true, true).hide()
|
163
|
+
},
|
164
|
+
|
165
|
+
getboundary: function(b, val, specs){ //function to set x and y boundaries magnified image can move to (moved outside moveimage for efficiency)
|
166
|
+
if (b=="left"){
|
167
|
+
var rb=-specs.imagesize.w*specs.curpower+specs.magsize.w
|
168
|
+
return (val>0)? 0 : (val<rb)? rb : val
|
169
|
+
}
|
170
|
+
else{
|
171
|
+
var tb=-specs.imagesize.h*specs.curpower+specs.magsize.h
|
172
|
+
return (val>0)? 0 : (val<tb)? tb : val
|
173
|
+
}
|
174
|
+
},
|
175
|
+
|
176
|
+
moveimage: function($tracker, $maginner, $cursorshade, e){
|
177
|
+
var specs=$tracker.data('specs'), csw = Math.round(specs.magsize.w/specs.curpower), csh = Math.round(specs.magsize.h/specs.curpower),
|
178
|
+
csb = specs.csborder, fiz = this, imgcoords=specs.coords, pagex=(e.pageX || specs.lastpagex), pagey=(e.pageY || specs.lastpagey),
|
179
|
+
x=pagex-imgcoords.left, y=pagey-imgcoords.top;
|
180
|
+
$cursorshade.css({ // keep shaded area sized and positioned proportionately to area being magnified
|
181
|
+
visibility: '',
|
182
|
+
width: csw,
|
183
|
+
height: csh,
|
184
|
+
top: Math.min(specs.imagesize.h-csh-csb, Math.max(0, y-(csb+csh)/2)) + imgcoords.top,
|
185
|
+
left: Math.min(specs.imagesize.w-csw-csb, Math.max(0, x-(csb+csw)/2)) + imgcoords.left
|
186
|
+
});
|
187
|
+
var newx=-x*specs.curpower+specs.magsize.w/2 //calculate x coord to move enlarged image
|
188
|
+
var newy=-y*specs.curpower+specs.magsize.h/2
|
189
|
+
$maginner.css({left:fiz.getboundary('left', newx, specs), top:fiz.getboundary('top', newy, specs)})
|
190
|
+
specs.$statusdiv.css({left:pagex-10, top:pagey+20})
|
191
|
+
specs.lastpagex=pagex //cache last pagex value (either e.pageX or lastpagex), as FF1.5 returns undefined for e.pageX for "DOMMouseScroll" event
|
192
|
+
specs.lastpagey=pagey
|
193
|
+
},
|
194
|
+
|
195
|
+
magnifyimage: function($tracker, e, zoomrange){
|
196
|
+
if (!e.detail && !e.wheelDelta){e = e.originalEvent;}
|
197
|
+
var delta=e.detail? e.detail*(-120) : e.wheelDelta //delta returns +120 when wheel is scrolled up, -120 when scrolled down
|
198
|
+
var zoomdir=(delta<=-120)? "out" : "in"
|
199
|
+
var specs=$tracker.data('specs')
|
200
|
+
var magnifier=specs.magnifier, od=specs.imagesize, power=specs.curpower
|
201
|
+
var newpower=(zoomdir=="in")? Math.min(power+1, zoomrange[1]) : Math.max(power-1, zoomrange[0]) //get new power
|
202
|
+
var nd=[od.w*newpower, od.h*newpower] //calculate dimensions of new enlarged image within magnifier
|
203
|
+
magnifier.$image.css({width:nd[0], height:nd[1]})
|
204
|
+
specs.curpower=newpower //set current power to new power after magnification
|
205
|
+
specs.$statusdiv.html('Current Zoom: '+specs.curpower)
|
206
|
+
this.showstatusdiv(specs, 0, 500)
|
207
|
+
$tracker.trigger('mousemove')
|
208
|
+
},
|
209
|
+
|
210
|
+
highestzindex: function($img){
|
211
|
+
var z = 0, $els = $img.parents().add($img), elz;
|
212
|
+
$els.each(function(){
|
213
|
+
elz = $(this).css('zIndex');
|
214
|
+
elz = isNaN(elz)? 0 : +elz;
|
215
|
+
z = Math.max(z, elz);
|
216
|
+
});
|
217
|
+
return z;
|
218
|
+
},
|
219
|
+
|
220
|
+
init: function($img, options){
|
221
|
+
var setting=$.extend({}, this.dsetting, options), w = $img.width(), h = $img.height(), o = $img.offset(),
|
222
|
+
fiz = this, $tracker, $cursorshade, $statusdiv, $magnifier, lastpage = {pageX: 0, pageY: 0},
|
223
|
+
basezindex = setting.zIndex || this.highestzindex($img);
|
224
|
+
if(h === 0 || w === 0){
|
225
|
+
$(new Image()).load(function(){
|
226
|
+
featuredimagezoomer.init($img, options);
|
227
|
+
}).attr('src', $img.attr('src'));
|
228
|
+
return;
|
229
|
+
}
|
230
|
+
$img.css({visibility: 'visible'});
|
231
|
+
setting.largeimage = setting.largeimage || $img.get(0).src;
|
232
|
+
$magnifier=$('<div class="magnifyarea" style="position:absolute;z-index:'+basezindex+';width:'+setting.magnifiersize[0]+'px;height:'+setting.magnifiersize[1]+'px;left:-10000px;top:-10000px;visibility:hidden;overflow:hidden;border:1px solid black;" />')
|
233
|
+
.append('<div style="position:relative;left:0;top:0;z-index:'+basezindex+';" />')
|
234
|
+
.appendTo(document.body) //create magnifier container
|
235
|
+
//following lines - create featured image zoomer divs, and absolutely positioned them for placement over the thumbnail and each other:
|
236
|
+
if(setting.cursorshade){
|
237
|
+
$cursorshade = $('<div class="cursorshade" style="visibility:hidden;position:absolute;left:0;top:0;z-index:'+basezindex+';" />')
|
238
|
+
.css({border: setting.cursorshadeborder, opacity: setting.cursorshadeopacity, backgroundColor: setting.cursorshadecolor})
|
239
|
+
.appendTo(document.body);
|
240
|
+
} else {
|
241
|
+
$cursorshade = $('<div />'); //dummy shade div to satisfy $tracker.data('specs')
|
242
|
+
}
|
243
|
+
$statusdiv = $('<div class="zoomstatus preloadevt" style="position:absolute;visibility:hidden;left:0;top:0;z-index:'+basezindex+';" />')
|
244
|
+
.html('<img src="'+this.loadinggif+'" />')
|
245
|
+
.appendTo(document.body); //create DIV to show "loading" gif/ "Current Zoom" info
|
246
|
+
$tracker = $('<div class="zoomtracker" style="cursor:progress;position:absolute;z-index:'+basezindex+';left:'+o.left+'px;top:'+o.top+'px;height:'+h+'px;width:'+w+'px;" />')
|
247
|
+
.css({backgroundImage: (this.isie? 'url(cannotbe)' : 'none')})
|
248
|
+
.appendTo(document.body);
|
249
|
+
$(window).bind('load resize', function(){ //in case resizing the window repostions the image or description
|
250
|
+
var o = $img.offset(), $parent;
|
251
|
+
$tracker.css({left: o.left, top: o.top});
|
252
|
+
if(options.descpos && options.descArea){
|
253
|
+
$parent = $img.parent();
|
254
|
+
$(options.descArea).css({left: $parent.offset().left + ($parent.outerWidth() - $parent.width()) / 2, top: $img.height() + o.top});
|
255
|
+
}
|
256
|
+
});
|
257
|
+
|
258
|
+
function getspecs($maginner, $bigimage){ //get specs function
|
259
|
+
var magsize={w:$magnifier.width(), h:$magnifier.height()}
|
260
|
+
var imagesize={w:w, h:h}
|
261
|
+
var power=(setting.zoomrange)? setting.zoomrange[0] : ($bigimage.width()/w).toFixed(5)
|
262
|
+
$tracker.data('specs', {
|
263
|
+
$statusdiv: $statusdiv,
|
264
|
+
statustimer: null,
|
265
|
+
magnifier: {$outer:$magnifier, $inner:$maginner, $image:$bigimage},
|
266
|
+
magsize: magsize,
|
267
|
+
magpos: setting.magnifierpos,
|
268
|
+
imagesize: imagesize,
|
269
|
+
curpower: power,
|
270
|
+
coords: getcoords(),
|
271
|
+
csborder: $cursorshade.outerWidth(),
|
272
|
+
lo: setting.leftoffset,
|
273
|
+
ro: setting.rightoffset
|
274
|
+
})
|
275
|
+
}
|
276
|
+
|
277
|
+
function getcoords(){ //get coords of thumb image function
|
278
|
+
var offset=$tracker.offset() //get image's tracker div's offset from document
|
279
|
+
return {left:offset.left, top:offset.top}
|
280
|
+
}
|
281
|
+
|
282
|
+
$tracker.mouseover(function(e){
|
283
|
+
$cursorshade.add($magnifier).add($statusdiv).removeClass('featuredimagezoomerhidden');
|
284
|
+
$tracker.data('premouseout', false);
|
285
|
+
}).mouseout(function(e){
|
286
|
+
$cursorshade.add($magnifier).add($statusdiv.not('.preloadevt')).addClass('featuredimagezoomerhidden');
|
287
|
+
$tracker.data('premouseout', true);
|
288
|
+
}).mousemove(function(e){ //save tracker mouse position for initial magnifier appearance, if needed
|
289
|
+
lastpage.pageX = e.pageX;
|
290
|
+
lastpage.pageY = e.pageY;
|
291
|
+
});
|
292
|
+
|
293
|
+
$tracker.one('mouseover', function(e){
|
294
|
+
var $maginner=$magnifier.find('div:eq(0)')
|
295
|
+
var $bigimage=$('<img src="'+setting.largeimage+'"/>').appendTo($maginner)
|
296
|
+
var largeloaded = featuredimagezoomer.loaded[$('<a href="'+setting.largeimage+'"></a>').get(0).href];
|
297
|
+
var showstatus=setting.zoomrange && setting.zoomrange[1]>setting.zoomrange[0]
|
298
|
+
var imgcoords=getcoords()
|
299
|
+
if(!largeloaded){
|
300
|
+
$img.stop(true, true).css({opacity:0.1}) //"dim" image while large image is loading
|
301
|
+
$statusdiv.css({left:imgcoords.left+w/2-$statusdiv.width()/2, top:imgcoords.top+h/2-$statusdiv.height()/2, visibility:'visible'})
|
302
|
+
}
|
303
|
+
$bigimage.bind('loadevt', function(event, e){ //magnified image ONLOAD event function (to be triggered later)
|
304
|
+
if(e.type === 'error'){
|
305
|
+
$img.css({opacity: 1}).data('added').remove();
|
306
|
+
var src = $('<a href="' + $bigimage.attr('src') + '"></a>').get(0).href;
|
307
|
+
if(window.console && console.error){
|
308
|
+
console.error('Cannot find Featured Image Zoomer larger image: ' + src);
|
309
|
+
} else {
|
310
|
+
alert('Cannot find Featured Image Zoomer larger image:\n\n' + src);
|
311
|
+
}
|
312
|
+
return;
|
313
|
+
}
|
314
|
+
featuredimagezoomer.loaded[this.src] = true;
|
315
|
+
$img.css({opacity:1}) //restore thumb image opacity
|
316
|
+
$statusdiv.empty().css({border:'1px solid black', background:'#C0C0C0', padding:'4px', font:'bold 13px Arial', opacity:0.8}).hide().removeClass('preloadevt');
|
317
|
+
if($tracker.data('premouseout')){
|
318
|
+
$statusdiv.addClass('featuredimagezoomerhidden');
|
319
|
+
}
|
320
|
+
if (setting.zoomrange){ //if set large image to a specific power
|
321
|
+
var nd=[w*setting.zoomrange[0], h*setting.zoomrange[0]] //calculate dimensions of new enlarged image
|
322
|
+
$bigimage.css({width:nd[0], height:nd[1]})
|
323
|
+
}
|
324
|
+
getspecs($maginner, $bigimage) //remember various info about thumbnail and magnifier
|
325
|
+
$magnifier.css({display:'none', visibility:'visible'})
|
326
|
+
$tracker.mouseover(function(e){ //image onmouseover
|
327
|
+
$tracker.data('specs').coords=getcoords() //refresh image coords (from upper left edge of document)
|
328
|
+
fiz.showimage($tracker, $magnifier, showstatus)
|
329
|
+
})
|
330
|
+
$tracker.mousemove(function(e){ //image onmousemove
|
331
|
+
fiz.moveimage($tracker, $maginner, $cursorshade, e)
|
332
|
+
})
|
333
|
+
if (!$tracker.data('premouseout')){
|
334
|
+
fiz.showimage($tracker, $magnifier, showstatus);
|
335
|
+
fiz.moveimage($tracker, $maginner, $cursorshade, lastpage);
|
336
|
+
}
|
337
|
+
$tracker.mouseout(function(e){ //image onmouseout
|
338
|
+
fiz.hideimage($tracker, $magnifier, showstatus)
|
339
|
+
}).css({cursor: fiz.magnifycursor});
|
340
|
+
if (setting.zoomrange && setting.zoomrange[1]>setting.zoomrange[0]){ //if zoom range enabled
|
341
|
+
$tracker.bind('DOMMouseScroll mousewheel', function(e){
|
342
|
+
fiz.magnifyimage($tracker, e, setting.zoomrange);
|
343
|
+
e.preventDefault();
|
344
|
+
});
|
345
|
+
} else if(setting.disablewheel){
|
346
|
+
$tracker.bind('DOMMouseScroll mousewheel', function(e){e.preventDefault();});
|
347
|
+
}
|
348
|
+
}) //end $bigimage onload
|
349
|
+
if ($bigimage.get(0).complete){ //if image has already loaded (account for IE, Opera not firing onload event if so)
|
350
|
+
$bigimage.trigger('loadevt', {type: 'load'})
|
351
|
+
}
|
352
|
+
else{
|
353
|
+
$bigimage.bind('load error', function(e){$bigimage.trigger('loadevt', e)})
|
354
|
+
}
|
355
|
+
})
|
356
|
+
},
|
357
|
+
|
358
|
+
iname: (function(){var itag = $('<img />'), iname = itag.get(0).tagName; itag.remove(); return iname;})(),
|
359
|
+
|
360
|
+
loaded: {},
|
361
|
+
|
362
|
+
hashre: /^#/
|
363
|
+
});
|
364
|
+
|
365
|
+
$.fn.addimagezoom = function(options){
|
366
|
+
var sel = this.selector, $thumbs = $(sel.replace(featuredimagezoomer.hashre, '.') + '.thumbs a');
|
367
|
+
options = options || {};
|
368
|
+
if(options.multizoom !== null && ($thumbs).size()){
|
369
|
+
$thumbs.addmultizoom($.extend(options, {imgObj: sel, multizoom: null}));
|
370
|
+
return this;
|
371
|
+
} else if(options.multizoom){
|
372
|
+
$(options.multizoom).addmultizoom($.extend(options, {imgObj: sel, multizoom: null}));
|
373
|
+
return this;
|
374
|
+
} else if (options.multizoom !== null){
|
375
|
+
return this.each(function(){
|
376
|
+
if (this.tagName !== featuredimagezoomer.iname)
|
377
|
+
return true; //skip to next matched element
|
378
|
+
$('<a href="' + this.src + '"></a>').addmultizoom($.extend(options, {imgObj: sel, multizoom: null, notmulti: true}));
|
379
|
+
});
|
380
|
+
}
|
381
|
+
return this.each(function(){ //return jQuery obj
|
382
|
+
if (this.tagName !== featuredimagezoomer.iname)
|
383
|
+
return true; //skip to next matched element
|
384
|
+
featuredimagezoomer.init($(this), options);
|
385
|
+
});
|
386
|
+
};
|
387
|
+
|
388
|
+
})(jQuery);
|
@@ -0,0 +1 @@
|
|
1
|
+
.ui-resetwrap{position:relative;display:inline-block}.ui-reset{position:absolute;top:0;right:0;z-index:2;display:none;height:100%;cursor:pointer}.ui-resetwrap:hover .ui-reset{display:block}.ui-currency-pos{color:green}.ui-currency-neg{color:red}.ui-currency-zero{color:blue}.ui-currency-pos.ui-bignum,.ui-currency-neg.ui-smallnum{font-size:110%}.ui-match{background:yellow}
|
@@ -0,0 +1,120 @@
|
|
1
|
+
.zoomPad{
|
2
|
+
position:relative;
|
3
|
+
float:left;
|
4
|
+
z-index:99;
|
5
|
+
cursor:crosshair;
|
6
|
+
}
|
7
|
+
|
8
|
+
|
9
|
+
.zoomPreload{
|
10
|
+
-moz-opacity:0.8;
|
11
|
+
opacity: 0.8;
|
12
|
+
filter: alpha(opacity = 80);
|
13
|
+
color: #333;
|
14
|
+
font-size: 12px;
|
15
|
+
font-family: Tahoma;
|
16
|
+
text-decoration: none;
|
17
|
+
border: 1px solid #CCC;
|
18
|
+
background-color: white;
|
19
|
+
padding: 8px;
|
20
|
+
text-align:center;
|
21
|
+
background-image: url(<%= asset_path('images/jqzoom/zoomloader.gif') %>);
|
22
|
+
background-repeat: no-repeat;
|
23
|
+
background-position: 43px 30px;
|
24
|
+
z-index:110;
|
25
|
+
width:90px;
|
26
|
+
height:43px;
|
27
|
+
position:absolute;
|
28
|
+
top:0px;
|
29
|
+
left:0px;
|
30
|
+
* width:100px;
|
31
|
+
* height:49px;
|
32
|
+
}
|
33
|
+
|
34
|
+
|
35
|
+
.zoomPup{
|
36
|
+
overflow:hidden;
|
37
|
+
background-color: #FFF;
|
38
|
+
-moz-opacity:0.6;
|
39
|
+
opacity: 0.6;
|
40
|
+
filter: alpha(opacity = 60);
|
41
|
+
z-index:120;
|
42
|
+
position:absolute;
|
43
|
+
border:1px solid #CCC;
|
44
|
+
z-index:101;
|
45
|
+
cursor:crosshair;
|
46
|
+
}
|
47
|
+
|
48
|
+
.zoomOverlay{
|
49
|
+
position:absolute;
|
50
|
+
left:0px;
|
51
|
+
top:0px;
|
52
|
+
background:#FFF;
|
53
|
+
/*opacity:0.5;*/
|
54
|
+
z-index:5000;
|
55
|
+
width:100%;
|
56
|
+
height:100%;
|
57
|
+
display:none;
|
58
|
+
z-index:101;
|
59
|
+
}
|
60
|
+
|
61
|
+
.zoomWindow{
|
62
|
+
position:absolute;
|
63
|
+
left:110%;
|
64
|
+
top:40px;
|
65
|
+
background:#FFF;
|
66
|
+
z-index:6000;
|
67
|
+
height:auto;
|
68
|
+
z-index:10000;
|
69
|
+
z-index:110;
|
70
|
+
}
|
71
|
+
.zoomWrapper{
|
72
|
+
position:relative;
|
73
|
+
border:1px solid #999;
|
74
|
+
z-index:110;
|
75
|
+
}
|
76
|
+
.zoomWrapperTitle{
|
77
|
+
display:block;
|
78
|
+
background:#999;
|
79
|
+
color:#FFF;
|
80
|
+
height:18px;
|
81
|
+
line-height:18px;
|
82
|
+
width:100%;
|
83
|
+
overflow:hidden;
|
84
|
+
text-align:center;
|
85
|
+
font-size:10px;
|
86
|
+
position:absolute;
|
87
|
+
top:0px;
|
88
|
+
left:0px;
|
89
|
+
z-index:120;
|
90
|
+
-moz-opacity:0.6;
|
91
|
+
opacity: 0.6;
|
92
|
+
filter: alpha(opacity = 60);
|
93
|
+
}
|
94
|
+
.zoomWrapperImage{
|
95
|
+
display:block;
|
96
|
+
position:relative;
|
97
|
+
overflow:hidden;
|
98
|
+
z-index:110;
|
99
|
+
|
100
|
+
}
|
101
|
+
.zoomWrapperImage img{
|
102
|
+
border:0px;
|
103
|
+
display:block;
|
104
|
+
position:absolute;
|
105
|
+
z-index:101;
|
106
|
+
}
|
107
|
+
|
108
|
+
.zoomIframe{
|
109
|
+
z-index: -1;
|
110
|
+
filter:alpha(opacity=0);
|
111
|
+
-moz-opacity: 0.80;
|
112
|
+
opacity: 0.80;
|
113
|
+
position:absolute;
|
114
|
+
display:block;
|
115
|
+
}
|
116
|
+
|
117
|
+
/*********************************************************
|
118
|
+
/ When clicking on thumbs jqzoom will add the class
|
119
|
+
/ "zoomThumbActive" on the anchor selected
|
120
|
+
/*********************************************************/
|