update
This commit is contained in:
751
Static/script/jQuery/bjqs-1.3.js
Normal file
751
Static/script/jQuery/bjqs-1.3.js
Normal file
@@ -0,0 +1,751 @@
|
||||
/*
|
||||
* Basic jQuery Slider plug-in v.1.3
|
||||
*
|
||||
* http://www.basic-slider.com
|
||||
*
|
||||
* Authored by John Cobb
|
||||
* http://www.johncobb.name
|
||||
* @john0514
|
||||
*
|
||||
* Copyright 2011, John Cobb
|
||||
* License: GNU General Public License, version 3 (GPL-3.0)
|
||||
* http://www.opensource.org/licenses/gpl-3.0.html
|
||||
*
|
||||
*/
|
||||
|
||||
;(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
$.fn.bjqs = function(o) {
|
||||
|
||||
// slider default settings
|
||||
var defaults = {
|
||||
|
||||
// w + h to enforce consistency
|
||||
width : 700,
|
||||
height : 300,
|
||||
|
||||
// transition valuess
|
||||
animtype : 'slide',
|
||||
animduration : 450, // length of transition
|
||||
animspeed : 4000, // delay between transitions
|
||||
automatic : true, // enable/disable automatic slide rotation
|
||||
|
||||
// control and marker configuration
|
||||
showcontrols : true, // enable/disable next + previous UI elements
|
||||
centercontrols : true, // vertically center controls
|
||||
nexttext : 'Next', // text/html inside next UI element
|
||||
prevtext : 'Prev', // text/html inside previous UI element
|
||||
showmarkers : true, // enable/disable individual slide UI markers
|
||||
centermarkers : true, // horizontally center markers
|
||||
|
||||
// interaction values
|
||||
keyboardnav : true, // enable/disable keyboard navigation
|
||||
hoverpause : true, // enable/disable pause slides on hover
|
||||
|
||||
// presentational options
|
||||
usecaptions : true, // enable/disable captions using img title attribute
|
||||
randomstart : false, // start from a random slide
|
||||
responsive : false // enable responsive behaviour
|
||||
|
||||
};
|
||||
|
||||
// create settings from defauls and user options
|
||||
var settings = $.extend({}, defaults, o);
|
||||
|
||||
// slider elements
|
||||
var $wrapper = this,
|
||||
$slider = $wrapper.find('ul.bjqs'),
|
||||
$slides = $slider.children('li'),
|
||||
$sliderBox = $('.slider'),
|
||||
|
||||
// control elements
|
||||
$c_wrapper = null,
|
||||
$c_fwd = null,
|
||||
$c_prev = null,
|
||||
|
||||
// marker elements
|
||||
$m_wrapper = null,
|
||||
$m_markers = null,
|
||||
|
||||
// elements for slide animation
|
||||
$canvas = null,
|
||||
$clone_first = null,
|
||||
$clone_last = null;
|
||||
|
||||
// state management object
|
||||
var state = {
|
||||
slidecount : $slides.length, // total number of slides
|
||||
animating : false, // bool: is transition is progress
|
||||
paused : false, // bool: is the slider paused
|
||||
currentslide : 1, // current slide being viewed (not 0 based)
|
||||
nextslide : 0, // slide to view next (not 0 based)
|
||||
currentindex : 0, // current slide being viewed (0 based)
|
||||
nextindex : 0, // slide to view next (0 based)
|
||||
interval : null // interval for automatic rotation
|
||||
};
|
||||
|
||||
var responsive = {
|
||||
width : null,
|
||||
height : null,
|
||||
ratio : null
|
||||
};
|
||||
|
||||
// helpful variables
|
||||
var vars = {
|
||||
fwd : 'forward',
|
||||
prev : 'previous'
|
||||
};
|
||||
|
||||
// run through options and initialise settings
|
||||
var init = function() {
|
||||
|
||||
// differentiate slider li from content li
|
||||
$slides.addClass('bjqs-slide');
|
||||
|
||||
// conf dimensions, responsive or static
|
||||
if( settings.responsive ){
|
||||
conf_responsive();
|
||||
}
|
||||
else{
|
||||
conf_static();
|
||||
}
|
||||
|
||||
// configurations only avaliable if more than 1 slide
|
||||
if( state.slidecount > 1 ){
|
||||
|
||||
// enable random start
|
||||
if (settings.randomstart){
|
||||
conf_random();
|
||||
}
|
||||
|
||||
// create and show controls
|
||||
if( settings.showcontrols ){
|
||||
conf_controls();
|
||||
}
|
||||
|
||||
// create and show markers
|
||||
if( settings.showmarkers ){
|
||||
conf_markers();
|
||||
}
|
||||
|
||||
// enable slidenumboard navigation
|
||||
if( settings.keyboardnav ){
|
||||
conf_keynav();
|
||||
}
|
||||
|
||||
// enable pause on hover
|
||||
if (settings.hoverpause && settings.automatic){
|
||||
conf_hoverpause();
|
||||
}
|
||||
|
||||
// conf slide animation
|
||||
if (settings.animtype === 'slide'){
|
||||
conf_slide();
|
||||
}
|
||||
|
||||
} else {
|
||||
// Stop automatic animation, because we only have one slide!
|
||||
settings.automatic = false;
|
||||
}
|
||||
|
||||
if(settings.usecaptions){
|
||||
conf_captions();
|
||||
}
|
||||
|
||||
// TODO: need to accomodate random start for slide transition setting
|
||||
if(settings.animtype === 'slide' && !settings.randomstart){
|
||||
state.currentindex = 1;
|
||||
state.currentslide = 2;
|
||||
}
|
||||
|
||||
// slide components are hidden by default, show them now
|
||||
$slider.show();
|
||||
$slides.eq(state.currentindex).show();
|
||||
|
||||
// Finally, if automatic is set to true, kick off the interval
|
||||
if(settings.automatic){
|
||||
state.interval = setInterval(function () {
|
||||
go(vars.fwd, false);
|
||||
}, settings.animspeed);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var conf_responsive = function() {
|
||||
|
||||
responsive.width = $wrapper.outerWidth();
|
||||
responsive.ratio = responsive.width/settings.width,
|
||||
responsive.height = settings.height * responsive.ratio;
|
||||
|
||||
if(settings.animtype === 'fade'){
|
||||
|
||||
// initial setup
|
||||
$slides.css({
|
||||
'height' : settings.height,
|
||||
'width' : '100%'
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : settings.height,
|
||||
'width' : '100%'
|
||||
});
|
||||
$slider.css({
|
||||
'height' : settings.height,
|
||||
'width' : '100%'
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : settings.height,
|
||||
'max-width' : settings.width,
|
||||
'position' : 'relative'
|
||||
});
|
||||
|
||||
if(responsive.width < settings.width){
|
||||
|
||||
$slides.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slider.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(window).resize(function() {
|
||||
|
||||
// calculate and update dimensions
|
||||
responsive.width = $wrapper.outerWidth();
|
||||
responsive.ratio = responsive.width/settings.width,
|
||||
responsive.height = settings.height * responsive.ratio;
|
||||
|
||||
$slides.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slider.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
if(settings.animtype === 'slide'){
|
||||
|
||||
// initial setup
|
||||
$slides.css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width
|
||||
});
|
||||
$slider.css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width * settings.slidecount
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : settings.height,
|
||||
'max-width' : settings.width,
|
||||
'position' : 'relative'
|
||||
});
|
||||
|
||||
if(responsive.width < settings.width){
|
||||
|
||||
$slides.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$slider.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
$(window).resize(function() {
|
||||
|
||||
// calculate and update dimensions
|
||||
responsive.width = $wrapper.outerWidth(),
|
||||
responsive.ratio = responsive.width/settings.width,
|
||||
responsive.height = settings.height * responsive.ratio;
|
||||
|
||||
$slides.css({
|
||||
'height' : responsive.height,
|
||||
'width' : responsive.width
|
||||
});
|
||||
$slides.children('img').css({
|
||||
'height' : responsive.height,
|
||||
'width' : responsive.width
|
||||
});
|
||||
$slider.css({
|
||||
'height' : responsive.height,
|
||||
'width' : responsive.width * settings.slidecount
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : responsive.height
|
||||
});
|
||||
$canvas.css({
|
||||
'height' : responsive.height,
|
||||
'width' : responsive.width
|
||||
});
|
||||
|
||||
resize_complete(function(){
|
||||
go(false,state.currentslide);
|
||||
}, 200, "some unique string");
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var resize_complete = (function () {
|
||||
|
||||
var timers = {};
|
||||
|
||||
return function (callback, ms, uniqueId) {
|
||||
if (!uniqueId) {
|
||||
uniqueId = "Don't call this twice without a uniqueId";
|
||||
}
|
||||
if (timers[uniqueId]) {
|
||||
clearTimeout (timers[uniqueId]);
|
||||
}
|
||||
timers[uniqueId] = setTimeout(callback, ms);
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
// enforce fixed sizing on slides, slider and wrapper
|
||||
var conf_static = function() {
|
||||
|
||||
$slides.css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width
|
||||
});
|
||||
$slider.css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width
|
||||
});
|
||||
$wrapper.css({
|
||||
'height' : settings.height,
|
||||
'width' : settings.width,
|
||||
'position' : 'relative'
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var conf_slide = function() {
|
||||
|
||||
// create two extra elements which are clones of the first and last slides
|
||||
$clone_first = $slides.eq(0).clone();
|
||||
$clone_last = $slides.eq(state.slidecount-1).clone();
|
||||
|
||||
// add them to the DOM where we need them
|
||||
$clone_first.attr({'data-clone' : 'last', 'data-slide' : 0}).appendTo($slider).show();
|
||||
|
||||
$clone_last.attr({'data-clone' : 'first', 'data-slide' : 0}).prependTo($slider).show();
|
||||
|
||||
// update the elements object
|
||||
$slides = $slider.children('li');
|
||||
state.slidecount = $slides.length;
|
||||
|
||||
// create a 'canvas' element which is neccessary for the slide animation to work
|
||||
$canvas = $('<div class="bjqs-wrapper"></div>');
|
||||
|
||||
|
||||
|
||||
// if the slider is responsive && the calculated width is less than the max width
|
||||
if(settings.responsive && (responsive.width < settings.width)){
|
||||
|
||||
$canvas.css({
|
||||
'width' : responsive.width,
|
||||
'height' : responsive.height,
|
||||
'overflow' : 'hidden',
|
||||
'position' : 'relative'
|
||||
});
|
||||
|
||||
// update the dimensions to the slider to accomodate all the slides side by side
|
||||
$slider.css({
|
||||
'width' : responsive.width * (state.slidecount + 2),
|
||||
'left' : -responsive.width * state.currentslide
|
||||
});
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
$canvas.css({
|
||||
'width' : settings.width,
|
||||
'height' : settings.height,
|
||||
'overflow' : 'hidden',
|
||||
'position' : 'relative'
|
||||
});
|
||||
|
||||
// update the dimensions to the slider to accomodate all the slides side by side
|
||||
$slider.css({
|
||||
'width' : settings.width * (state.slidecount + 2),
|
||||
'left' : -settings.width * state.currentslide
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// add some inline styles which will align our slides for left-right sliding
|
||||
$slides.css({
|
||||
'float' : 'left',
|
||||
'position' : 'relative',
|
||||
'display' : 'list-item'
|
||||
});
|
||||
|
||||
// 'everything.. in it's right place'
|
||||
$canvas.prependTo($wrapper);
|
||||
$slider.appendTo($canvas);
|
||||
|
||||
};
|
||||
|
||||
var conf_controls = function() {
|
||||
|
||||
// create the elements for the controls
|
||||
$c_wrapper = $('<ul class="bjqs-controls"></ul>');
|
||||
$c_fwd = $('<li class="bjqs-next"><a href="#" data-direction="'+ vars.fwd +'">' + settings.nexttext + '</a></li>');
|
||||
$c_prev = $('<li class="bjqs-prev"><a href="#" data-direction="'+ vars.prev +'">' + settings.prevtext + '</a></li>');
|
||||
|
||||
// bind click events
|
||||
$c_wrapper.on('click','a',function(e){
|
||||
|
||||
e.preventDefault();
|
||||
var direction = $(this).attr('data-direction');
|
||||
|
||||
if(!state.animating){
|
||||
|
||||
if(direction === vars.fwd){
|
||||
go(vars.fwd,false);
|
||||
}
|
||||
|
||||
if(direction === vars.prev){
|
||||
go(vars.prev,false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// put 'em all together
|
||||
$c_prev.appendTo($c_wrapper);
|
||||
$c_fwd.appendTo($c_wrapper);
|
||||
$c_wrapper.appendTo($wrapper);
|
||||
|
||||
// vertically center the controls
|
||||
if (settings.centercontrols) {
|
||||
|
||||
$c_wrapper.addClass('v-centered');
|
||||
|
||||
// calculate offset % for vertical positioning
|
||||
var offset_px = ($wrapper.height() - $c_fwd.children('a').outerHeight()) / 2,
|
||||
ratio = (offset_px / settings.height) * 100,
|
||||
offset = ratio + '%';
|
||||
|
||||
$c_fwd.find('a').css('top', offset);
|
||||
$c_prev.find('a').css('top', offset);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var conf_markers = function() {
|
||||
|
||||
// create a wrapper for our markers
|
||||
$m_wrapper = $('<ol class="bjqs-markers"></ol>');
|
||||
|
||||
// for every slide, create a marker
|
||||
$.each($slides, function(key, slide){
|
||||
|
||||
var slidenum = key + 1,
|
||||
gotoslide = key + 1;
|
||||
|
||||
if(settings.animtype === 'slide'){
|
||||
// + 2 to account for clones
|
||||
gotoslide = key + 2;
|
||||
}
|
||||
|
||||
var marker = $('<li><a href="#"> </a></li>');
|
||||
|
||||
// set the first marker to be active
|
||||
if(slidenum === state.currentslide){ marker.addClass('active-marker'); }
|
||||
|
||||
// bind the click event
|
||||
marker.on('click','a',function(e){
|
||||
e.preventDefault();
|
||||
if(!state.animating && state.currentslide !== gotoslide){
|
||||
go(false,gotoslide);
|
||||
}
|
||||
});
|
||||
|
||||
// add the marker to the wrapper
|
||||
marker.appendTo($m_wrapper);
|
||||
|
||||
});
|
||||
|
||||
$m_wrapper.appendTo($wrapper);
|
||||
$m_markers = $m_wrapper.find('li');
|
||||
|
||||
// center the markers
|
||||
if (settings.centermarkers) {
|
||||
$m_wrapper.addClass('h-centered');
|
||||
var offset = (settings.width - $m_wrapper.width()) / 2;
|
||||
//$m_wrapper.css('left', offset);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var conf_keynav = function() {
|
||||
|
||||
$(document).keyup(function (event) {
|
||||
|
||||
if (!state.paused) {
|
||||
clearInterval(state.interval);
|
||||
state.paused = true;
|
||||
}
|
||||
|
||||
if (!state.animating) {
|
||||
if (event.keyCode === 39) {
|
||||
event.preventDefault();
|
||||
go(vars.fwd, false);
|
||||
} else if (event.keyCode === 37) {
|
||||
event.preventDefault();
|
||||
go(vars.prev, false);
|
||||
}
|
||||
}
|
||||
|
||||
if (state.paused && settings.automatic) {
|
||||
state.interval = setInterval(function () {
|
||||
go(vars.fwd);
|
||||
}, settings.animspeed);
|
||||
state.paused = false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var conf_hoverpause = function() {
|
||||
|
||||
$wrapper.hover(function () {
|
||||
if (!state.paused) {
|
||||
clearInterval(state.interval);
|
||||
state.paused = true;
|
||||
}
|
||||
}, function () {
|
||||
if (state.paused) {
|
||||
state.interval = setInterval(function () {
|
||||
go(vars.fwd, false);
|
||||
}, settings.animspeed);
|
||||
state.paused = false;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var conf_captions = function() {
|
||||
|
||||
$.each($slides, function (key, slide) {
|
||||
|
||||
var caption = $(slide).children('img:first-child').attr('title');
|
||||
|
||||
// Account for images wrapped in links
|
||||
if(!caption){
|
||||
caption = $(slide).children('a').find('img:first-child').attr('title');
|
||||
}
|
||||
|
||||
if (caption) {
|
||||
caption = $('<p class="bjqs-caption">' + caption + '</p>');
|
||||
caption.appendTo($(slide));
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var conf_random = function() {
|
||||
|
||||
var rand = Math.floor(Math.random() * state.slidecount) + 1;
|
||||
state.currentslide = rand;
|
||||
state.currentindex = rand-1;
|
||||
|
||||
};
|
||||
|
||||
var set_next = function(direction) {
|
||||
|
||||
if(direction === vars.fwd){
|
||||
|
||||
if($slides.eq(state.currentindex).next().length){
|
||||
state.nextindex = state.currentindex + 1;
|
||||
state.nextslide = state.currentslide + 1;
|
||||
}
|
||||
else{
|
||||
state.nextindex = 0;
|
||||
state.nextslide = 1;
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
if($slides.eq(state.currentindex).prev().length){
|
||||
state.nextindex = state.currentindex - 1;
|
||||
state.nextslide = state.currentslide - 1;
|
||||
}
|
||||
else{
|
||||
state.nextindex = state.slidecount - 1;
|
||||
state.nextslide = state.slidecount;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
var go = function(direction, position) {
|
||||
|
||||
// only if we're not already doing things
|
||||
if(!state.animating){
|
||||
|
||||
// doing things
|
||||
state.animating = true;
|
||||
|
||||
if(position){
|
||||
state.nextslide = position;
|
||||
state.nextindex = position-1;
|
||||
}
|
||||
else{
|
||||
set_next(direction);
|
||||
}
|
||||
|
||||
// fade animation
|
||||
if(settings.animtype === 'fade'){
|
||||
|
||||
if(settings.showmarkers){
|
||||
$m_markers.removeClass('active-marker');
|
||||
$m_markers.eq(state.nextindex).addClass('active-marker');
|
||||
}
|
||||
|
||||
// fade out current
|
||||
$slides.eq(state.currentindex).fadeOut(settings.animduration);
|
||||
//makl zmiany tła
|
||||
$( "#slider" ).animate({
|
||||
backgroundColor: $slides.eq(state.nextindex).attr('id')
|
||||
//color: "#fff",
|
||||
//width: 1300
|
||||
}, settings.animduration-500 );
|
||||
// alert(state.nextindex);
|
||||
// alert($slides.eq(state.nextindex).attr('id'));
|
||||
// $( "#slider" ).animate({
|
||||
// backgroundColor: '#fffffff'
|
||||
// }, 1000 );
|
||||
|
||||
//makl koniec zmian
|
||||
// fade in next
|
||||
$slides.eq(state.nextindex).fadeIn(settings.animduration, function(){
|
||||
|
||||
// update state variables
|
||||
state.animating = false;
|
||||
state.currentslide = state.nextslide;
|
||||
state.currentindex = state.nextindex;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
// slide animation
|
||||
if(settings.animtype === 'slide'){
|
||||
|
||||
if(settings.showmarkers){
|
||||
|
||||
var markerindex = state.nextindex-1;
|
||||
|
||||
if(markerindex === state.slidecount-2){
|
||||
markerindex = 0;
|
||||
}
|
||||
else if(markerindex === -1){
|
||||
markerindex = state.slidecount-3;
|
||||
}
|
||||
|
||||
$m_markers.removeClass('active-marker');
|
||||
$m_markers.eq(markerindex).addClass('active-marker');
|
||||
}
|
||||
|
||||
// if the slider is responsive && the calculated width is less than the max width
|
||||
if(settings.responsive && ( responsive.width < settings.width ) ){
|
||||
state.slidewidth = responsive.width;
|
||||
}
|
||||
else{
|
||||
state.slidewidth = settings.width;
|
||||
}
|
||||
|
||||
$slider.animate({'left': -state.nextindex * state.slidewidth }, settings.animduration, function(){
|
||||
|
||||
state.currentslide = state.nextslide;
|
||||
state.currentindex = state.nextindex;
|
||||
|
||||
// is the current slide a clone?
|
||||
if($slides.eq(state.currentindex).attr('data-clone') === 'last'){
|
||||
|
||||
// affirmative, at the last slide (clone of first)
|
||||
$slider.css({'left': -state.slidewidth });
|
||||
state.currentslide = 2;
|
||||
state.currentindex = 1;
|
||||
|
||||
}
|
||||
else if($slides.eq(state.currentindex).attr('data-clone') === 'first'){
|
||||
|
||||
// affirmative, at the fist slide (clone of last)
|
||||
$slider.css({'left': -state.slidewidth *(state.slidecount - 2)});
|
||||
state.currentslide = state.slidecount - 1;
|
||||
state.currentindex = state.slidecount - 2;
|
||||
|
||||
}
|
||||
|
||||
state.animating = false;
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// lets get the party started :)
|
||||
init();
|
||||
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Color animation 1.6.0
|
||||
http://www.bitstorm.org/jquery/color-animation/
|
||||
Copyright 2011, 2013 Edwin Martin <edwin@bitstorm.org>
|
||||
Released under the MIT and GPL licenses.
|
||||
*/
|
||||
'use strict';(function(d){function h(a,b,e){var c="rgb"+(d.support.rgba?"a":"")+"("+parseInt(a[0]+e*(b[0]-a[0]),10)+","+parseInt(a[1]+e*(b[1]-a[1]),10)+","+parseInt(a[2]+e*(b[2]-a[2]),10);d.support.rgba&&(c+=","+(a&&b?parseFloat(a[3]+e*(b[3]-a[3])):1));return c+")"}function f(a){var b;return(b=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/.exec(a))?[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16),1]:(b=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/.exec(a))?[17*parseInt(b[1],16),17*parseInt(b[2],
|
||||
16),17*parseInt(b[3],16),1]:(b=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(a))?[parseInt(b[1]),parseInt(b[2]),parseInt(b[3]),1]:(b=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9\.]*)\s*\)/.exec(a))?[parseInt(b[1],10),parseInt(b[2],10),parseInt(b[3],10),parseFloat(b[4])]:l[a]}d.extend(!0,d,{support:{rgba:function(){var a=d("script:first"),b=a.css("color"),e=!1;if(/^rgba/.test(b))e=!0;else try{e=b!=a.css("color","rgba(0, 0, 0, 0.5)").css("color"),
|
||||
a.css("color",b)}catch(c){}return e}()}});var k="color backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor outlineColor".split(" ");d.each(k,function(a,b){d.Tween.propHooks[b]={get:function(a){return d(a.elem).css(b)},set:function(a){var c=a.elem.style,g=f(d(a.elem).css(b)),m=f(a.end);a.run=function(a){c[b]=h(g,m,a)}}}});d.Tween.propHooks.borderColor={set:function(a){var b=a.elem.style,e=[],c=k.slice(2,6);d.each(c,function(b,c){e[c]=f(d(a.elem).css(c))});var g=f(a.end);
|
||||
a.run=function(a){d.each(c,function(d,c){b[c]=h(e[c],g,a)})}}};var l={aqua:[0,255,255,1],azure:[240,255,255,1],beige:[245,245,220,1],black:[0,0,0,1],blue:[0,0,255,1],brown:[165,42,42,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgrey:[169,169,169,1],darkgreen:[0,100,0,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkviolet:[148,0,211,1],fuchsia:[255,
|
||||
0,255,1],gold:[255,215,0,1],green:[0,128,0,1],indigo:[75,0,130,1],khaki:[240,230,140,1],lightblue:[173,216,230,1],lightcyan:[224,255,255,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],magenta:[255,0,255,1],maroon:[128,0,0,1],navy:[0,0,128,1],olive:[128,128,0,1],orange:[255,165,0,1],pink:[255,192,203,1],purple:[128,0,128,1],violet:[128,0,128,1],red:[255,0,0,1],silver:[192,192,192,1],white:[255,255,255,1],yellow:[255,255,
|
||||
0,1],transparent:[255,255,255,0]}})(jQuery);
|
||||
|
||||
14
Static/script/jQuery/bjqs-1.3.min.js
vendored
Normal file
14
Static/script/jQuery/bjqs-1.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
Static/script/jQuery/extras.sendContact.js
Normal file
8
Static/script/jQuery/extras.sendContact.js
Normal file
@@ -0,0 +1,8 @@
|
||||
$(document).ready(function() {
|
||||
$('._sendContact').each(function() {
|
||||
$(this).click(function() {
|
||||
$('#sendContactForm').submit();
|
||||
return false;
|
||||
})
|
||||
});
|
||||
});
|
||||
14
Static/script/jQuery/init.js
Normal file
14
Static/script/jQuery/init.js
Normal file
@@ -0,0 +1,14 @@
|
||||
//Autor: Maciej.Szwed@MediaFlex.pl
|
||||
Cufon.replace('h1');
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.menu ul li a.inactive').hover(function(){
|
||||
$(this).css({backgroundPosition: '-6px -155px'});
|
||||
$(this).animate({'margin-left':'40px'});
|
||||
}, function(){
|
||||
$(this).css({backgroundPosition: '-6px -102px'});
|
||||
$(this).animate({'margin-left':'0px'});
|
||||
});
|
||||
|
||||
});
|
||||
6240
Static/script/jQuery/jquery-1.4.2.js
vendored
Normal file
6240
Static/script/jQuery/jquery-1.4.2.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
Static/script/jQuery/jquery-migrate.min.js
vendored
Normal file
2
Static/script/jQuery/jquery-migrate.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
Static/script/jQuery/jquery-swf.js
vendored
Normal file
3
Static/script/jQuery/jquery-swf.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// jQuery SWFObject v1.1.1 MIT/GPL @jon_neal
|
||||
// http://jquery.thewikies.com/swfobject
|
||||
(function(f,h,i){function k(a,c){var b=(a[0]||0)-(c[0]||0);return b>0||!b&&a.length>0&&k(a.slice(1),c.slice(1))}function l(a){if(typeof a!=g)return a;var c=[],b="";for(var d in a){b=typeof a[d]==g?l(a[d]):[d,m?encodeURI(a[d]):a[d]].join("=");c.push(b)}return c.join("&")}function n(a){var c=[];for(var b in a)a[b]&&c.push([b,'="',a[b],'"'].join(""));return c.join(" ")}function o(a){var c=[];for(var b in a)c.push(['<param name="',b,'" value="',l(a[b]),'" />'].join(""));return c.join("")}var g="object",m=true;try{var j=i.description||function(){return(new i("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}()}catch(p){j="Unavailable"}var e=j.match(/\d+/g)||[0];f[h]={available:e[0]>0,activeX:i&&!i.name,version:{original:j,array:e,string:e.join("."),major:parseInt(e[0],10)||0,minor:parseInt(e[1],10)||0,release:parseInt(e[2],10)||0},hasVersion:function(a){a=/string|number/.test(typeof a)?a.toString().split("."):/object/.test(typeof a)?[a.major,a.minor]:a||[0,0];return k(e,a)},encodeParams:true,expressInstall:"expressInstall.swf",expressInstallIsActive:false,create:function(a){if(!a.swf||this.expressInstallIsActive||!this.available&&!a.hasVersionFail)return false;if(!this.hasVersion(a.hasVersion||1)){this.expressInstallIsActive=true;if(typeof a.hasVersionFail=="function")if(!a.hasVersionFail.apply(a))return false;a={swf:a.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:a.swf,type:"application/x-shockwave-flash",id:a.id||"flash_"+Math.floor(Math.random()*999999999),width:a.width||320,height:a.height||180,style:a.style||""};m=typeof a.useEncode!=="undefined"?a.useEncode:this.encodeParams;a.movie=a.swf;a.wmode=a.wmode||"opaque";delete a.fallback;delete a.hasVersion;delete a.hasVersionFail;delete a.height;delete a.id;delete a.swf;delete a.useEncode;delete a.width;var c=document.createElement("div");c.innerHTML=["<object ",n(attrs),">",o(a),"</object>"].join("");return c.firstChild}};f.fn[h]=function(a){var c=this.find(g).andSelf().filter(g);/string|object/.test(typeof a)&&this.each(function(){var b=f(this),d;a=typeof a==g?a:{swf:a};a.fallback=this;if(d=f[h].create(a)){b.children().remove();b.html(d)}});typeof a=="function"&&c.each(function(){var b=this;b.jsInteractionTimeoutMs=b.jsInteractionTimeoutMs||0;if(b.jsInteractionTimeoutMs<660)b.clientWidth||b.clientHeight?a.call(b):setTimeout(function(){f(b)[h](a)},b.jsInteractionTimeoutMs+66)});return c}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||window.ActiveXObject)
|
||||
2223
Static/script/jQuery/jquery-ui-timepicker-addon.js
vendored
Normal file
2223
Static/script/jQuery/jquery-ui-timepicker-addon.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2383
Static/script/jQuery/jquery-ui.js
vendored
Normal file
2383
Static/script/jQuery/jquery-ui.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
122
Static/script/jQuery/jquery.busybox.js
Normal file
122
Static/script/jQuery/jquery.busybox.js
Normal file
@@ -0,0 +1,122 @@
|
||||
/**
|
||||
* 'busyBox' v1.1
|
||||
* @author Roger Padilla C. - rogerjose81@gmail.com
|
||||
* Web: http://rogerpadilla.wordpress.com/2010/05/24/jquery-busybox/
|
||||
* Licensed under Apached License v2.0
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
/**
|
||||
* Main function; used to initialize the plugin or for calling the available functionalities of the plugin (such as 'open' or 'close').
|
||||
* The 'arguments' array is used to obtain the received parameters
|
||||
*/
|
||||
$.fn.busyBox = function() {
|
||||
|
||||
$.fn.busyBox.self = this;
|
||||
|
||||
if(arguments[0] == 'open') {
|
||||
$.fn.busyBox.open();
|
||||
} else if(arguments[0] == 'close') {
|
||||
$.fn.busyBox.close();
|
||||
} else {
|
||||
$.fn.busyBox.init(arguments[0]);
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* Initialize the plugin using the passed options
|
||||
*/
|
||||
$.fn.busyBox.init = function(options) {
|
||||
|
||||
$.fn.busyBox.opts = $.extend({}, $.fn.busyBox.defaults, options);
|
||||
|
||||
// Adds the default classes if they are not present in the passed classes
|
||||
if($.fn.busyBox.opts.classes.indexOf($.fn.busyBox.defaults.classes) === -1){
|
||||
$.fn.busyBox.opts.classes += ' ' + $.fn.busyBox.defaults.classes;
|
||||
}
|
||||
|
||||
$.fn.busyBox.container = $(document.body);
|
||||
|
||||
if($.fn.busyBox.opts.autoOpen){
|
||||
$.fn.busyBox.open();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Display all the 'busyBoxes' over the matched boxes
|
||||
*/
|
||||
$.fn.busyBox.open = function(){
|
||||
|
||||
var box, inner, e, bOffset, bWidth, bHeight, iTop, iLeft;
|
||||
|
||||
$.fn.busyBox.self.each(function(index) {
|
||||
|
||||
e = $(this);
|
||||
bWidth = e.outerWidth();
|
||||
bHeight = e.outerHeight();
|
||||
bOffset = e.offset();
|
||||
|
||||
box = $('<div />');
|
||||
box.attr('id', 'busybox_' + index);
|
||||
box.addClass($.fn.busyBox.opts.classes);
|
||||
|
||||
box.css({
|
||||
width: bWidth,
|
||||
height: bHeight,
|
||||
top: bOffset.top,
|
||||
left: -9999 // Used to not display the box yet without hidden it (needed to be able to calculate its dimensions)
|
||||
});
|
||||
|
||||
inner = $($.fn.busyBox.opts.spinner);
|
||||
inner.attr('id', 'busybox_spinner_' + index);
|
||||
inner.addClass('busybox-spinner');
|
||||
|
||||
box.append(inner);
|
||||
|
||||
$.fn.busyBox.container.append(box);
|
||||
|
||||
// Set the position of the inner message inside its parent. Calculates the 'top' and/or 'left' coordinates of the inner-message (inside its parent) if those properties were configured as 'auto'
|
||||
iTop = ($.fn.busyBox.opts.top == 'auto' ? ((bHeight / 2) - (inner.outerHeight() / 2)) + 'px' : $.fn.busyBox.opts.top);
|
||||
iLeft = ($.fn.busyBox.opts.left == 'auto' ? ((bWidth / 2) - (inner.outerWidth() / 2)) + 'px' : $.fn.busyBox.opts.left);
|
||||
|
||||
inner.css({
|
||||
position: 'absolute',
|
||||
top: iTop,
|
||||
left: iLeft,
|
||||
opacity: 1.0
|
||||
});
|
||||
|
||||
// Hidde and relocate the 'busyBox' (previously displayed using a negative left-coord to be able to calculate its dimensions)
|
||||
box.css({display: 'none', left: bOffset.left});
|
||||
});
|
||||
|
||||
// Display all the 'busyBoxes'
|
||||
$.fn.busyBox.container.find('.' + $.fn.busyBox.defaults.classes).fadeIn('fast', $.fn.busyBox.opts.displayed.call(this));
|
||||
};
|
||||
|
||||
/**
|
||||
* Closes all the 'busyBoxes' being showed
|
||||
*/
|
||||
$.fn.busyBox.close = function(){
|
||||
if($.fn.busyBox.container) {
|
||||
$.fn.busyBox.container.find('.' + $.fn.busyBox.defaults.classes).fadeOut('fast', function(){
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Default configuration
|
||||
*/
|
||||
$.fn.busyBox.defaults = {
|
||||
autoOpen: true,
|
||||
spinner: '<em>Cargando…</em>',
|
||||
classes: 'busybox',
|
||||
top: 'auto',
|
||||
left: 'auto',
|
||||
displayed: function(){}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
181
Static/script/jQuery/jquery.canvas-loader.1.3.js
Normal file
181
Static/script/jQuery/jquery.canvas-loader.1.3.js
Normal file
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* jQuery Canvas Loader Plugin 1.3
|
||||
*
|
||||
* Creates an alternative to ajax loader images with the canvas element.
|
||||
*
|
||||
* Tested on Mobile Safari and Android browsers.
|
||||
*
|
||||
* By Jamund Xcot Ferguson
|
||||
*
|
||||
* Twitter: @xjamundx
|
||||
* Blog: http://www.jamund.com/
|
||||
*
|
||||
* Usage:
|
||||
*
|
||||
* Without options:
|
||||
*
|
||||
* $("img.ajaxLoader").canvasLoader();
|
||||
*
|
||||
* With options:
|
||||
*
|
||||
* $("img.ajaxLoader").canvasLoader({
|
||||
* 'radius':10,
|
||||
* 'color':'rgb(255,0,0),
|
||||
* 'dotRadius':10,
|
||||
* 'backgroundColor':'transparent'
|
||||
* 'className':'canvasLoader',
|
||||
* 'id':'canvasLoader1',
|
||||
* 'fps':10
|
||||
* });
|
||||
*
|
||||
* Options:
|
||||
*
|
||||
* radius - width/height of the loader
|
||||
* color - color of the pulsing dots
|
||||
* dotRadius - radius of the pulsing dots
|
||||
* className - class name of the canvas tag
|
||||
* backgroundColor - a background color for the canvas
|
||||
* id - id of the canvas tag
|
||||
* fps - approximate frames per second of the pulsing
|
||||
*
|
||||
**/
|
||||
|
||||
(function($){
|
||||
/**
|
||||
* Replaces loading images with a canvas alternative
|
||||
*
|
||||
* @author Jamund Xcot Ferguson
|
||||
*/
|
||||
$.fn.canvasLoader = function(options) {
|
||||
|
||||
// holds my canvas loader object
|
||||
var loaders = [];
|
||||
|
||||
// holds my defaults object
|
||||
var globalDefaults = {
|
||||
'radius':20,
|
||||
'color':'rgb(0,0,0)',
|
||||
'dotRadius':2.5,
|
||||
'backgroundColor':'transparent',
|
||||
'className':'canvasLoader',
|
||||
'id':'canvasLoader1',
|
||||
'fps':10
|
||||
};
|
||||
|
||||
// holds the generic settings objects
|
||||
var globalOpts = $.extend(globalDefaults, options);
|
||||
|
||||
// start drawing right away
|
||||
setInterval(draw, 1000/globalOpts.fps);
|
||||
|
||||
// the main drawing function
|
||||
function draw() {
|
||||
for (i in loaders) {
|
||||
loaders[i].draw();
|
||||
}
|
||||
}
|
||||
|
||||
var CanvasLoader = function(ctx, radius, color, dotRadius) {
|
||||
this.ctx = ctx;
|
||||
this.radius = radius;
|
||||
this.x = this.radius/2;
|
||||
this.y = this.radius/2;
|
||||
this.color = color;
|
||||
this.dotRadius = dotRadius;
|
||||
this.opacity = 1;
|
||||
this.numDots = 8;
|
||||
this.dots = {};
|
||||
this.degrees = Math.PI*2/this.numDots;
|
||||
for (i=1;i<=this.numDots;i++) {
|
||||
this.dots[i] = new Dot(Math.cos(this.degrees * i) * this.radius/Math.PI, Math.sin(this.degrees * i) * this.radius/Math.PI, this.dotRadius, this.color, i/this.numDots);
|
||||
this.dots[i].parent = this;
|
||||
}
|
||||
}
|
||||
|
||||
CanvasLoader.prototype.draw = function() {
|
||||
// clear old stuff
|
||||
this.ctx.clearRect(0,0,this.radius,this.radius);
|
||||
|
||||
// draw the background color
|
||||
this.ctx.globalAlpha = 1;
|
||||
this.ctx.fillStyle = globalOpts.backgroundColor;
|
||||
this.ctx.fillRect(0,0,this.radius,this.radius);
|
||||
|
||||
// fill in the dots
|
||||
for (i in this.dots) {
|
||||
this.dots[i].changeOpacity();
|
||||
this.dots[i].draw();
|
||||
}
|
||||
}
|
||||
|
||||
var Dot = function(x, y, radius, color, opacity) {
|
||||
this.radius = radius;
|
||||
this.color = color;
|
||||
this.opacity = opacity;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
Dot.prototype.draw = function() {
|
||||
this.parent.ctx.beginPath();
|
||||
this.parent.ctx.globalAlpha = this.opacity;
|
||||
this.parent.ctx.fillStyle = this.color;
|
||||
this.parent.ctx.arc(this.x+(this.parent.radius/2), this.y+(this.parent.radius/2), this.radius, 0, Math.PI*2, true);
|
||||
this.parent.ctx.fill();
|
||||
}
|
||||
|
||||
Dot.prototype.changeOpacity = function() {
|
||||
this.opacity -= 1/this.parent.numDots;
|
||||
if (this.opacity < 0) this.opacity = 1;
|
||||
}
|
||||
|
||||
// we can't replace until the image is loaded (webkit bug?)
|
||||
return $(this).each(function() {
|
||||
if (this.tagName == 'IMG') {
|
||||
$(this).load(function() {
|
||||
// set some local defaults that change
|
||||
var localDefaults = {
|
||||
'radius':($(this).width()+$(this).height())/2,
|
||||
'dotRadius':($(this).width()+$(this).height())/16,
|
||||
'id':'canvasLoader'+(parseInt($(".canvasLoader").size())+1),
|
||||
};
|
||||
|
||||
// extend the global defaults with the local defaults and then the user-supplied defaults.
|
||||
var opts = $.extend(globalOpts, localDefaults, options);
|
||||
|
||||
// create a canvas object and get the context
|
||||
var canvas = $("<canvas width='"+opts.radius+"' height='"+opts.radius+"' id='"+opts.id+"' class='"+opts.className+"'></canvas>");
|
||||
var ctx = canvas.get(0).getContext("2d");
|
||||
|
||||
// simple feature detection, needs work
|
||||
if (!!ctx) {
|
||||
loaders[loaders.length+1] = new CanvasLoader(ctx, opts.radius, opts.color, opts.dotRadius);
|
||||
$(this).replaceWith(canvas);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// set some local defaults that change
|
||||
var localDefaults = {
|
||||
'radius':($(this).width()+$(this).height())/2,
|
||||
'dotRadius':($(this).width()+$(this).height())/16,
|
||||
'id':'canvasLoader'+(parseInt($("."+globalOpts.className).size())+1),
|
||||
};
|
||||
|
||||
// extend the global defaults with the local defaults and then the user-supplied defaults.
|
||||
var opts = $.extend(globalOpts, localDefaults, options);
|
||||
|
||||
// create a canvas object and get the context
|
||||
var canvas = $("<canvas width='"+opts.radius+"' height='"+opts.radius+"' id='"+opts.id+"' class='"+opts.className+"'></canvas>");
|
||||
var ctx = canvas.get(0).getContext("2d");
|
||||
|
||||
// simple feature detection, needs work
|
||||
if (!!ctx) {
|
||||
loaders[loaders.length+1] = new CanvasLoader(ctx, opts.radius, opts.color, opts.dotRadius);
|
||||
$(this).replaceWith(canvas);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
})(jQuery);
|
||||
15
Static/script/jQuery/jquery.carouFredSel-6.0.4-packed.js
Normal file
15
Static/script/jQuery/jquery.carouFredSel-6.0.4-packed.js
Normal file
File diff suppressed because one or more lines are too long
4255
Static/script/jQuery/jquery.carouFredSel.js
Normal file
4255
Static/script/jQuery/jquery.carouFredSel.js
Normal file
File diff suppressed because it is too large
Load Diff
176
Static/script/jQuery/jquery.collapse.js
Normal file
176
Static/script/jQuery/jquery.collapse.js
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Collapse plugin for jQuery
|
||||
* --
|
||||
* source: http://github.com/danielstocks/jQuery-Collapse/
|
||||
* site: http://webcloud.se/jQuery-Collapse
|
||||
*
|
||||
* @author Daniel Stocks (http://webcloud.se)
|
||||
* Copyright 2013, Daniel Stocks
|
||||
* Released under the MIT, BSD, and GPL Licenses.
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// Constructor
|
||||
function Collapse (el, options) {
|
||||
options = options || {};
|
||||
var _this = this,
|
||||
query = options.query || "> :even";
|
||||
|
||||
$.extend(_this, {
|
||||
$el: el,
|
||||
options : options,
|
||||
sections: [],
|
||||
isAccordion : options.accordion || false,
|
||||
db : options.persist ? jQueryCollapseStorage(el.get(0).id) : false
|
||||
});
|
||||
|
||||
// Figure out what sections are open if storage is used
|
||||
_this.states = _this.db ? _this.db.read() : [];
|
||||
|
||||
// For every pair of elements in given
|
||||
// element, create a section
|
||||
_this.$el.find(query).each(function() {
|
||||
new jQueryCollapseSection($(this), _this);
|
||||
});
|
||||
|
||||
// Capute ALL the clicks!
|
||||
(function(scope) {
|
||||
_this.$el.on("click", "[data-collapse-summary] " + (scope.options.clickQuery || ""),
|
||||
$.proxy(_this.handleClick, scope));
|
||||
|
||||
_this.$el.bind("toggle close open",
|
||||
$.proxy(_this.handleEvent, scope));
|
||||
|
||||
}(_this));
|
||||
}
|
||||
|
||||
Collapse.prototype = {
|
||||
handleClick: function(e, state) {
|
||||
e.preventDefault();
|
||||
var state = state || "toggle"
|
||||
var sections = this.sections,
|
||||
l = sections.length;
|
||||
while(l--) {
|
||||
if($.contains(sections[l].$summary[0], e.target)) {
|
||||
sections[l][state]();
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleEvent: function(e) {
|
||||
if(e.target == this.$el.get(0)) return this[e.type]();
|
||||
this.handleClick(e, e.type);
|
||||
},
|
||||
open: function(eq) {
|
||||
if(isFinite(eq)) return this.sections[eq].open();
|
||||
$.each(this.sections, function(i, section) {
|
||||
section.open();
|
||||
})
|
||||
},
|
||||
close: function(eq) {
|
||||
if(isFinite(eq)) return this.sections[eq].close();
|
||||
$.each(this.sections, function(i, section) {
|
||||
section.close();
|
||||
})
|
||||
},
|
||||
toggle: function(eq) {
|
||||
if(isFinite(eq)) return this.sections[eq].toggle();
|
||||
$.each(this.sections, function(i, section) {
|
||||
section.toggle();
|
||||
})
|
||||
}
|
||||
};
|
||||
|
||||
// Section constructor
|
||||
function Section($el, parent) {
|
||||
|
||||
if(!parent.options.clickQuery) $el.wrapInner('<a href="#"/>');
|
||||
|
||||
$.extend(this, {
|
||||
isOpen : false,
|
||||
$summary : $el.attr("data-collapse-summary",""),
|
||||
$details : $el.next(),
|
||||
options: parent.options,
|
||||
parent: parent
|
||||
});
|
||||
parent.sections.push(this);
|
||||
|
||||
// Check current state of section
|
||||
var state = parent.states[this._index()];
|
||||
|
||||
if(state === 0) {
|
||||
this.close(true)
|
||||
}
|
||||
else if(this.$summary.is(".open") || state === 1) {
|
||||
this.open(true);
|
||||
} else {
|
||||
this.close(true)
|
||||
}
|
||||
}
|
||||
|
||||
Section.prototype = {
|
||||
toggle : function() {
|
||||
this.isOpen ? this.close() : this.open();
|
||||
},
|
||||
close: function(bypass) {
|
||||
this._changeState("close", bypass);
|
||||
},
|
||||
open: function(bypass) {
|
||||
var _this = this;
|
||||
if(_this.options.accordion && !bypass) {
|
||||
$.each(_this.parent.sections, function(i, section) {
|
||||
section.close()
|
||||
});
|
||||
}
|
||||
_this._changeState("open", bypass);
|
||||
},
|
||||
_index: function() {
|
||||
return $.inArray(this, this.parent.sections);
|
||||
},
|
||||
_changeState: function(state, bypass) {
|
||||
|
||||
var _this = this;
|
||||
_this.isOpen = state == "open";
|
||||
if($.isFunction(_this.options[state]) && !bypass) {
|
||||
_this.options[state].apply(_this.$details);
|
||||
} else {
|
||||
_this.$details[_this.isOpen ? "show" : "hide"]();
|
||||
}
|
||||
|
||||
_this.$summary.toggleClass("open", state != "close")
|
||||
_this.$details.attr("aria-hidden", state == "close");
|
||||
_this.$summary.attr("aria-expanded", state == "open");
|
||||
_this.$summary.trigger(state == "open" ? "opened" : "closed", _this);
|
||||
if(_this.parent.db) {
|
||||
_this.parent.db.write(_this._index(), _this.isOpen);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Expose in jQuery API
|
||||
$.fn.extend({
|
||||
collapse: function(options, scan) {
|
||||
var nodes = (scan) ? $("body").find("[data-collapse]") : $(this);
|
||||
return nodes.each(function() {
|
||||
var settings = (scan) ? {} : options,
|
||||
values = $(this).attr("data-collapse") || "";
|
||||
$.each(values.split(" "), function(i,v) {
|
||||
if(v) settings[v] = true;
|
||||
});
|
||||
new Collapse($(this), settings);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
//jQuery DOM Ready
|
||||
$(function() {
|
||||
$.fn.collapse(false, true);
|
||||
});
|
||||
|
||||
// Expose constructor to
|
||||
// global namespace
|
||||
jQueryCollapse = Collapse;
|
||||
jQueryCollapseSection = Section;
|
||||
|
||||
})(window.jQuery);
|
||||
205
Static/script/jQuery/jquery.easing.1.3.js
Normal file
205
Static/script/jQuery/jquery.easing.1.3.js
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
205
Static/script/jQuery/jquery.easing.js
Normal file
205
Static/script/jQuery/jquery.easing.js
Normal file
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
1191
Static/script/jQuery/jquery.flexslider.js
Normal file
1191
Static/script/jQuery/jquery.flexslider.js
Normal file
File diff suppressed because it is too large
Load Diff
3
Static/script/jQuery/jquery.flipster.min.js
vendored
Normal file
3
Static/script/jQuery/jquery.flipster.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
317
Static/script/jQuery/jquery.fs.picker.js
Normal file
317
Static/script/jQuery/jquery.fs.picker.js
Normal file
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* Picker v3.0.11 - 2014-02-26
|
||||
* A jQuery plugin for replacing default checkboxes and radios. Part of the formstone library.
|
||||
* http://formstone.it/picker/
|
||||
*
|
||||
* Copyright 2014 Ben Plum; MIT Licensed
|
||||
*/
|
||||
|
||||
;(function ($, window) {
|
||||
"use strict";
|
||||
|
||||
var isIE8 = (document.all && document.querySelector && !document.addEventListener);
|
||||
|
||||
/**
|
||||
* @options
|
||||
* @param customClass [string] <''> "Class applied to instance"
|
||||
* @param toggle [boolean] <false> "Render 'toggle' styles"
|
||||
* @param labels.on [string] <'ON'> "Label for 'On' position; 'toggle' only"
|
||||
* @param labels.off [string] <'OFF'> "Label for 'Off' position; 'toggle' only"
|
||||
*/
|
||||
var options = {
|
||||
customClass: "",
|
||||
toggle: false,
|
||||
labels: {
|
||||
on: "ON",
|
||||
off: "OFF"
|
||||
}
|
||||
};
|
||||
|
||||
var pub = {
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @name defaults
|
||||
* @description Sets default plugin options
|
||||
* @param opts [object] <{}> "Options object"
|
||||
* @example $.picker("defaults", opts);
|
||||
*/
|
||||
defaults: function(opts) {
|
||||
options = $.extend(options, opts || {});
|
||||
return $(this);
|
||||
},
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @name destroy
|
||||
* @description Removes instance of plugin
|
||||
* @example $(".target").picker("destroy");
|
||||
*/
|
||||
destroy: function() {
|
||||
return $(this).each(function(i, input) {
|
||||
var data = $(input).data("picker");
|
||||
|
||||
if (data) {
|
||||
data.$picker.off(".picker");
|
||||
data.$handle.remove();
|
||||
data.$labels.remove();
|
||||
data.$input.off(".picker")
|
||||
.removeClass("picker-element")
|
||||
.data("picker", null);
|
||||
data.$label.removeClass("picker-label")
|
||||
.unwrap();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @name disable
|
||||
* @description Disables target instance
|
||||
* @example $(".target").picker("disable");
|
||||
*/
|
||||
disable: function() {
|
||||
return $(this).each(function(i, input) {
|
||||
var data = $(input).data("picker");
|
||||
|
||||
if (data) {
|
||||
data.$input.prop("disabled", true);
|
||||
data.$picker.addClass("disabled");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @name enable
|
||||
* @description Enables target instance
|
||||
* @example $(".target").picker("enable");
|
||||
*/
|
||||
enable: function() {
|
||||
return $(this).each(function(i, input) {
|
||||
var data = $(input).data("picker");
|
||||
|
||||
if (data) {
|
||||
data.$input.prop("disabled", false);
|
||||
data.$picker.removeClass("disabled");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* @method
|
||||
* @name update
|
||||
* @description Updates instance of plugin
|
||||
* @example $(".target").picker("update");
|
||||
*/
|
||||
update: function() {
|
||||
return $(this).each(function(i, input) {
|
||||
var data = $(input).data("picker");
|
||||
|
||||
if (data && !data.$input.is(":disabled")) {
|
||||
if (data.$input.is(":checked")) {
|
||||
_onSelect({ data: data }, true);
|
||||
} else {
|
||||
_onDeselect({ data: data }, true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _init
|
||||
* @description Initializes plugin
|
||||
* @param opts [object] "Initialization options"
|
||||
*/
|
||||
function _init(opts) {
|
||||
// Settings
|
||||
opts = $.extend({}, options, opts);
|
||||
|
||||
// Apply to each element
|
||||
var $items = $(this);
|
||||
for (var i = 0, count = $items.length; i < count; i++) {
|
||||
_build($items.eq(i), opts);
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _build
|
||||
* @description Builds each instance
|
||||
* @param $input [jQuery object] "Target jQuery object"
|
||||
* @param opts [object] <{}> "Options object"
|
||||
*/
|
||||
function _build($input, opts) {
|
||||
if (!$input.data("picker")) {
|
||||
// EXTEND OPTIONS
|
||||
opts = $.extend({}, opts, $input.data("picker-options"));
|
||||
|
||||
var $parent = $input.closest("label"),
|
||||
$label = $parent.length ? $parent.eq(0) : $("label[for=" + $input.attr("id") + "]"),
|
||||
type = $input.attr("type"),
|
||||
typeClass = "picker-" + (type === "radio" ? "radio" : "checkbox"),
|
||||
group = $input.attr("name"),
|
||||
html = '<div class="picker-handle"><div class="picker-flag" /></div>';
|
||||
|
||||
if (opts.toggle) {
|
||||
typeClass += " picker-toggle";
|
||||
html = '<span class="picker-toggle-label on">' + opts.labels.on + '</span><span class="picker-toggle-label off">' + opts.labels.off + '</span>' + html;
|
||||
}
|
||||
|
||||
// Modify DOM
|
||||
$input.addClass("picker-element");
|
||||
$label.wrap('<div class="picker ' + typeClass + ' ' + opts.customClass + '" />')
|
||||
.before(html)
|
||||
.addClass("picker-label");
|
||||
|
||||
// Store plugin data
|
||||
var $picker = $label.parents(".picker"),
|
||||
$handle = $picker.find(".picker-handle"),
|
||||
$labels = $picker.find(".picker-toggle-label");
|
||||
|
||||
// Check checked
|
||||
if ($input.is(":checked")) {
|
||||
$picker.addClass("checked");
|
||||
}
|
||||
|
||||
// Check disabled
|
||||
if ($input.is(":disabled")) {
|
||||
$picker.addClass("disabled");
|
||||
}
|
||||
|
||||
var data = $.extend({}, opts, {
|
||||
$picker: $picker,
|
||||
$input: $input,
|
||||
$handle: $handle,
|
||||
$label: $label,
|
||||
$labels: $labels,
|
||||
group: group,
|
||||
isRadio: (type === "radio"),
|
||||
isCheckbox: (type === "checkbox")
|
||||
});
|
||||
|
||||
// Bind click events
|
||||
data.$input.on("focus.picker", data, _onFocus)
|
||||
.on("blur.picker", data, _onBlur)
|
||||
.on("change.picker", data, _onChange)
|
||||
.on("click.picker", data, _onClick)
|
||||
.on("deselect.picker", data, _onDeselect)
|
||||
.data("picker", data);
|
||||
|
||||
data.$picker.on("click.picker", data, _onClick);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onClick
|
||||
* @description Handles instance clicks
|
||||
* @param e [object] "Event data"
|
||||
*/
|
||||
function _onClick(e) {
|
||||
e.stopPropagation();
|
||||
|
||||
var data = e.data;
|
||||
|
||||
if (!$(e.target).is(data.$input)) {
|
||||
e.preventDefault();
|
||||
|
||||
data.$input.trigger("click");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onChange
|
||||
* @description Handles external changes
|
||||
* @param e [object] "Event data"
|
||||
*/
|
||||
function _onChange(e) {
|
||||
var data = e.data;
|
||||
|
||||
if (!data.$input.is(":disabled")) {
|
||||
// Checkbox change events fire after state has changed
|
||||
var checked = data.$input.is(":checked");
|
||||
if (data.isCheckbox) {
|
||||
if (checked) {
|
||||
_onSelect(e, true);
|
||||
} else {
|
||||
_onDeselect(e, true);
|
||||
}
|
||||
} else {
|
||||
// radio
|
||||
if (checked || (isIE8 && !checked)) {
|
||||
_onSelect(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onSelect
|
||||
* @description Changes input to "checked"
|
||||
* @param e [object] "Event data"
|
||||
* @param internal [boolean] "Internal update flag"
|
||||
*/
|
||||
function _onSelect(e, internal) {
|
||||
var data = e.data;
|
||||
|
||||
if (typeof data.group !== "undefined" && data.isRadio) {
|
||||
$('input[name="' + data.group + '"]').not(data.$input).trigger("deselect");
|
||||
}
|
||||
|
||||
data.$picker.addClass("checked");
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onDeselect
|
||||
* @description Changes input from "checked"
|
||||
* @param e [object] "Event data"
|
||||
* @param internal [boolean] "Internal update flag"
|
||||
*/
|
||||
function _onDeselect(e, internal) {
|
||||
var data = e.data;
|
||||
|
||||
data.$picker.removeClass("checked");
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onFocus
|
||||
* @description Handles instance focus
|
||||
* @param e [object] "Event data"
|
||||
*/
|
||||
function _onFocus(e) {
|
||||
e.data.$picker.addClass("focus");
|
||||
}
|
||||
|
||||
/**
|
||||
* @method private
|
||||
* @name _onBlur
|
||||
* @description Handles instance blur
|
||||
* @param e [object] "Event data"
|
||||
*/
|
||||
function _onBlur(e) {
|
||||
e.data.$picker.removeClass("focus");
|
||||
}
|
||||
|
||||
$.fn.picker = function(method) {
|
||||
if (pub[method]) {
|
||||
return pub[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method) {
|
||||
return _init.apply(this, arguments);
|
||||
}
|
||||
return this;
|
||||
};
|
||||
|
||||
$.picker = function(method) {
|
||||
if (method === "defaults") {
|
||||
pub.defaults.apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
66
Static/script/jQuery/jquery.imageLens.js
Normal file
66
Static/script/jQuery/jquery.imageLens.js
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
http://www.dailycoding.com/
|
||||
*/
|
||||
(function ($) {
|
||||
$.fn.imageLens = function (options) {
|
||||
|
||||
var defaults = {
|
||||
lensSize: 100,
|
||||
borderSize: 4,
|
||||
borderColor: "#888"
|
||||
};
|
||||
var options = $.extend(defaults, options);
|
||||
var lensStyle = "background-position: 0px 0px;width: " + String(options.lensSize) + "px;height: " + String(options.lensSize)
|
||||
+ "px;float: left;display: none;border-radius: " + String(options.lensSize / 2 + options.borderSize)
|
||||
+ "px;border: " + String(options.borderSize) + "px solid " + options.borderColor
|
||||
+ ";background-repeat: no-repeat;position: absolute;";
|
||||
|
||||
return this.each(function () {
|
||||
obj = $(this);
|
||||
|
||||
var offset = $(this).offset();
|
||||
|
||||
// Creating lens
|
||||
var target = $("<div style='" + lensStyle + "' class='" + options.lensCss + "'> </div>").appendTo($(this).parent());
|
||||
var targetSize = target.size();
|
||||
|
||||
// Calculating actual size of image
|
||||
var imageSrc = options.imageSrc ? options.imageSrc : $(this).attr("src");
|
||||
var imageTag = "<img style='display:none;' src='" + imageSrc + "' />";
|
||||
|
||||
var widthRatio = 0;
|
||||
var heightRatio = 0;
|
||||
|
||||
$(imageTag).load(function () {
|
||||
widthRatio = $(this).width() / obj.width();
|
||||
heightRatio = $(this).height() / obj.height();
|
||||
}).appendTo($(this).parent());
|
||||
|
||||
target.css({ backgroundImage: "url('" + imageSrc + "')" });
|
||||
|
||||
target.mousemove(setPosition);
|
||||
$(this).mousemove(setPosition);
|
||||
|
||||
function setPosition(e) {
|
||||
|
||||
var leftPos = parseInt(e.pageX - offset.left);
|
||||
var topPos = parseInt(e.pageY - offset.top);
|
||||
|
||||
if (leftPos < 0 || topPos < 0 || leftPos > obj.width() || topPos > obj.height()) {
|
||||
target.hide();
|
||||
}
|
||||
else {
|
||||
target.show();
|
||||
|
||||
leftPos = String(((e.pageX - offset.left) * widthRatio - target.width() / 2) * (-1));
|
||||
topPos = String(((e.pageY - offset.top) * heightRatio - target.height() / 2) * (-1));
|
||||
target.css({ backgroundPosition: leftPos + 'px ' + topPos + 'px' });
|
||||
|
||||
leftPos = String(e.pageX - target.width() / 2);
|
||||
topPos = String(e.pageY - target.height() / 2);
|
||||
target.css({ left: leftPos + 'px', top: topPos + 'px' });
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
1
Static/script/jQuery/jquery.imageScroll.min.js
vendored
Normal file
1
Static/script/jQuery/jquery.imageScroll.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1396
Static/script/jQuery/jquery.jcarousel.js
Normal file
1396
Static/script/jQuery/jquery.jcarousel.js
Normal file
File diff suppressed because it is too large
Load Diff
4
Static/script/jQuery/jquery.jcarousel.min.js
vendored
Normal file
4
Static/script/jQuery/jquery.jcarousel.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10220
Static/script/jQuery/jquery.js
vendored
Normal file
10220
Static/script/jQuery/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
485
Static/script/jQuery/jquery.lightbox-0.5.js
Normal file
485
Static/script/jQuery/jquery.lightbox-0.5.js
Normal file
@@ -0,0 +1,485 @@
|
||||
/**
|
||||
* jQuery lightBox plugin
|
||||
* This jQuery plugin was inspired and based on Lightbox 2 by Lokesh Dhakar (http://www.huddletogether.com/projects/lightbox2/)
|
||||
* and adapted to me for use like a plugin from jQuery.
|
||||
* @name jquery-lightbox-0.5.js
|
||||
* @author Leandro Vieira Pinho - http://leandrovieira.com
|
||||
* @version 0.5
|
||||
* @date April 11, 2008
|
||||
* @category jQuery plugin
|
||||
* @copyright (c) 2008 Leandro Vieira Pinho (leandrovieira.com)
|
||||
* @license CC Attribution-No Derivative Works 2.5 Brazil - http://creativecommons.org/licenses/by-nd/2.5/br/deed.en_US
|
||||
* @example Visit http://leandrovieira.com/projects/jquery/lightbox/ for more informations about this jQuery plugin
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// Offering a Custom Alias suport - More info: http://docs.jquery.com/Plugins/Authoring#Custom_Alias
|
||||
(function($) {
|
||||
/**
|
||||
* $ is an alias to jQuery object
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
$.fn.lightBox = function(settings) {
|
||||
// Settings to configure the jQuery lightBox plugin how you like
|
||||
settings = jQuery.extend({
|
||||
// Configuration related to overlay
|
||||
overlayBgColor: '#000', // (string) Background color to overlay; inform a hexadecimal value like: #RRGGBB. Where RR, GG, and BB are the hexadecimal values for the red, green, and blue values of the color.
|
||||
overlayOpacity: 0.8, // (integer) Opacity value to overlay; inform: 0.X. Where X are number from 0 to 9
|
||||
// Configuration related to navigation
|
||||
fixedNavigation: false, // (boolean) Boolean that informs if the navigation (next and prev button) will be fixed or not in the interface.
|
||||
// Configuration related to images
|
||||
imageLoading: '../../image/Strona/lightbox-ico-loading.gif', // (string) Path and the name of the loading icon
|
||||
imageBtnPrev: '../../image/Strona/lightbox-btn-prev.gif', // (string) Path and the name of the prev button image
|
||||
imageBtnNext: '../../image/Strona/lightbox-btn-next.gif', // (string) Path and the name of the next button image
|
||||
imageBtnClose: '../../image/Strona/lightbox-btn-close.gif', // (string) Path and the name of the close btn
|
||||
imageBlank: '../../image/Strona/lightbox-blank.gif', // (string) Path and the name of a blank image (one pixel)
|
||||
// Configuration related to container image box
|
||||
containerBorderSize: 10, // (integer) If you adjust the padding in the CSS for the container, #lightbox-container-image-box, you will need to update this value
|
||||
containerResizeSpeed: 400, // (integer) Specify the resize duration of container image. These number are miliseconds. 400 is default.
|
||||
// Configuration related to texts in caption. For example: Image 2 of 8. You can alter either "Image" and "of" texts.
|
||||
txtImage: 'Image', // (string) Specify text "Image"
|
||||
txtOf: 'z', // (string) Specify text "of"
|
||||
// Configuration related to keyboard navigation
|
||||
keyToClose: 'c', // (string) (c = close) Letter to close the jQuery lightBox interface. Beyond this letter, the letter X and the SCAPE key is used to.
|
||||
keyToPrev: 'p', // (string) (p = previous) Letter to show the previous image
|
||||
keyToNext: 'n', // (string) (n = next) Letter to show the next image.
|
||||
// Don<6F>t alter these variables in any way
|
||||
imageArray: [],
|
||||
activeImage: 0
|
||||
},settings);
|
||||
// Caching the jQuery object with all elements matched
|
||||
var jQueryMatchedObj = this; // This, in this context, refer to jQuery object
|
||||
/**
|
||||
* Initializing the plugin calling the start function
|
||||
*
|
||||
* @return boolean false
|
||||
*/
|
||||
function _initialize() {
|
||||
_start(this,jQueryMatchedObj); // This, in this context, refer to object (link) which the user have clicked
|
||||
return false; // Avoid the browser following the link
|
||||
}
|
||||
/**
|
||||
* Start the jQuery lightBox plugin
|
||||
*
|
||||
* @param object objClicked The object (link) whick the user have clicked
|
||||
* @param object jQueryMatchedObj The jQuery object with all elements matched
|
||||
*/
|
||||
function _start(objClicked,jQueryMatchedObj) {
|
||||
// Hime some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
|
||||
$('embed, object, select').css({ 'visibility' : 'hidden' });
|
||||
// Call the function to create the markup structure; style some elements; assign events in some elements.
|
||||
_set_interface();
|
||||
// Unset total images in imageArray
|
||||
settings.imageArray.length = 0;
|
||||
// Unset image active information
|
||||
settings.activeImage = 0;
|
||||
// We have an image set? Or just an image? Let<65>s see it.
|
||||
if ( jQueryMatchedObj.length == 1 ) {
|
||||
settings.imageArray.push(new Array(objClicked.getAttribute('href'),objClicked.getAttribute('title')));
|
||||
} else {
|
||||
// Add an Array (as many as we have), with href and title atributes, inside the Array that storage the images references
|
||||
for ( var i = 0; i < jQueryMatchedObj.length; i++ ) {
|
||||
settings.imageArray.push(new Array(jQueryMatchedObj[i].getAttribute('href'),jQueryMatchedObj[i].getAttribute('title')));
|
||||
}
|
||||
}
|
||||
while ( settings.imageArray[settings.activeImage][0] != objClicked.getAttribute('href') ) {
|
||||
settings.activeImage++;
|
||||
}
|
||||
// Call the function that prepares image exibition
|
||||
_set_image_to_view();
|
||||
}
|
||||
/**
|
||||
* Create the jQuery lightBox plugin interface
|
||||
*
|
||||
* The HTML markup will be like that:
|
||||
<div id="jquery-overlay"></div>
|
||||
<div id="jquery-lightbox">
|
||||
<div id="lightbox-container-image-box">
|
||||
<div id="lightbox-container-image">
|
||||
<img src="../fotos/XX.jpg" id="lightbox-image">
|
||||
<div id="lightbox-nav">
|
||||
<a href="#" id="lightbox-nav-btnPrev"></a>
|
||||
<a href="#" id="lightbox-nav-btnNext"></a>
|
||||
</div>
|
||||
<div id="lightbox-loading">
|
||||
<a href="#" id="lightbox-loading-link">
|
||||
<img src="../images/lightbox-ico-loading.gif">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="lightbox-container-image-data-box">
|
||||
<div id="lightbox-container-image-data">
|
||||
<div id="lightbox-image-details">
|
||||
<span id="lightbox-image-details-caption"></span>
|
||||
<span id="lightbox-image-details-currentNumber"></span>
|
||||
</div>
|
||||
<div id="lightbox-secNav">
|
||||
<a href="#" id="lightbox-secNav-btnClose">
|
||||
<img src="../images/lightbox-btn-close.gif">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
*
|
||||
*/
|
||||
function _set_interface() {
|
||||
|
||||
|
||||
|
||||
|
||||
// Apply the HTML markup into body tag
|
||||
$('body').append('<div id="jquery-overlay"></div><div id="jquery-lightbox"><div id="lightbox-container-image-box"><div id="lightbox-container-image"><a id="lightbox-image-full" class="zoom" ><img id="lightbox-image"></a><div style="" id="lightbox-nav"><a href="#" id="lightbox-nav-btnPrev"></a><a href="#" id="lightbox-nav-btnNext"></a></div><div id="lightbox-loading"><a href="#" id="lightbox-loading-link"><img src="' + settings.imageLoading + '"></a></div></div></div><div id="lightbox-container-image-data-box"><div id="lightbox-container-image-data"><div id="lightbox-image-details"><span id="lightbox-image-details-caption"></span><span id="lightbox-image-details-currentNumber"></span></div><div id="lightbox-secNav"><a href="#" id="lightbox-secNav-btnClose"><img src="' + settings.imageBtnClose + '"></a></div></div></div></div>');
|
||||
// Get page sizes
|
||||
var arrPageSizes = ___getPageSize();
|
||||
// Style overlay and show it
|
||||
$('#jquery-overlay').css({
|
||||
backgroundColor: settings.overlayBgColor,
|
||||
opacity: settings.overlayOpacity,
|
||||
width: arrPageSizes[0],
|
||||
height: arrPageSizes[1]
|
||||
}).fadeIn();
|
||||
// Get page scroll
|
||||
var arrPageScroll = ___getPageScroll();
|
||||
// Calculate top and left offset for the jquery-lightbox div object and show it
|
||||
$('#jquery-lightbox').css({
|
||||
top: arrPageScroll[1] + (arrPageSizes[3] / 10),
|
||||
left: arrPageScroll[0]
|
||||
}).show();
|
||||
// Assigning click events in elements to close overlay
|
||||
$('#jquery-overlay,#jquery-lightbox').click(function() {
|
||||
//_finish();
|
||||
$('#zoom').zoomy();
|
||||
alert('qwert');
|
||||
});
|
||||
// Assign the _finish function to lightbox-loading-link and lightbox-secNav-btnClose objects
|
||||
$('#lightbox-loading-link,#lightbox-secNav-btnClose').click(function() {
|
||||
_finish();
|
||||
return false;
|
||||
});
|
||||
// If window was resized, calculate the new overlay dimensions
|
||||
$(window).resize(function() {
|
||||
// Get page sizes
|
||||
var arrPageSizes = ___getPageSize();
|
||||
// Style overlay and show it
|
||||
$('#jquery-overlay').css({
|
||||
width: arrPageSizes[0],
|
||||
height: arrPageSizes[1]
|
||||
});
|
||||
// Get page scroll
|
||||
var arrPageScroll = ___getPageScroll();
|
||||
// Calculate top and left offset for the jquery-lightbox div object and show it
|
||||
$('#jquery-lightbox').css({
|
||||
top: arrPageScroll[1] + (arrPageSizes[3] / 10),
|
||||
left: arrPageScroll[0]
|
||||
});
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Prepares image exibition; doing a image<67>s preloader to calculate it<69>s size
|
||||
*
|
||||
*/
|
||||
function _set_image_to_view() { // show the loading
|
||||
// Show the loading
|
||||
$('#lightbox-loading').show();
|
||||
if ( settings.fixedNavigation ) {
|
||||
$('#lightbox-image,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
|
||||
} else {
|
||||
// Hide some elements
|
||||
$('#lightbox-image,#lightbox-nav,#lightbox-nav-btnPrev,#lightbox-nav-btnNext,#lightbox-container-image-data-box,#lightbox-image-details-currentNumber').hide();
|
||||
}
|
||||
// Image preload process
|
||||
var objImagePreloader = new Image();
|
||||
objImagePreloader.onload = function() {
|
||||
$('#lightbox-image').attr('src',settings.imageArray[settings.activeImage][0]);
|
||||
$('#lightbox-image-full').attr('href','http://localhost/formix_old_projects/megalie/dev/src/Static/upload/Article/16/full_1374affe642f33107d6d38a23bd1a72c.jpg');
|
||||
// Perfomance an effect in the image container resizing it
|
||||
_resize_container_image_box(objImagePreloader.width,objImagePreloader.height);
|
||||
// clear onLoad, IE behaves irratically with animated gifs otherwise
|
||||
objImagePreloader.onload=function(){};
|
||||
};
|
||||
objImagePreloader.src = settings.imageArray[settings.activeImage][0];
|
||||
};
|
||||
/**
|
||||
* Perfomance an effect in the image container resizing it
|
||||
*
|
||||
* @param integer intImageWidth The image<67>s width that will be showed
|
||||
* @param integer intImageHeight The image<67>s height that will be showed
|
||||
*/
|
||||
function _resize_container_image_box(intImageWidth,intImageHeight) {
|
||||
// Get current width and height
|
||||
var intCurrentWidth = $('#lightbox-container-image-box').width();
|
||||
var intCurrentHeight = $('#lightbox-container-image-box').height();
|
||||
// Get the width and height of the selected image plus the padding
|
||||
var intWidth = (intImageWidth + (settings.containerBorderSize * 2)); // Plus the image<67>s width and the left and right padding value
|
||||
var intHeight = (intImageHeight + (settings.containerBorderSize * 2)); // Plus the image<67>s height and the left and right padding value
|
||||
// Diferences
|
||||
var intDiffW = intCurrentWidth - intWidth;
|
||||
var intDiffH = intCurrentHeight - intHeight;
|
||||
// Perfomance the effect
|
||||
$('#lightbox-container-image-box').animate({ width: intWidth, height: intHeight },settings.containerResizeSpeed,function() { _show_image(); });
|
||||
if ( ( intDiffW == 0 ) && ( intDiffH == 0 ) ) {
|
||||
if ( $.browser.msie ) {
|
||||
___pause(250);
|
||||
} else {
|
||||
___pause(100);
|
||||
}
|
||||
}
|
||||
$('#lightbox-container-image-data-box').css({ width: intImageWidth });
|
||||
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ height: intImageHeight + (settings.containerBorderSize * 2) });
|
||||
};
|
||||
/**
|
||||
* Show the prepared image
|
||||
*
|
||||
*/
|
||||
function _show_image() {
|
||||
$('#lightbox-loading').hide();
|
||||
$('#lightbox-image').fadeIn(function() {
|
||||
_show_image_data();
|
||||
_set_navigation();
|
||||
});
|
||||
_preload_neighbor_images();
|
||||
};
|
||||
/**
|
||||
* Show the image information
|
||||
*
|
||||
*/
|
||||
function _show_image_data() {
|
||||
$('#lightbox-container-image-data-box').slideDown('fast');
|
||||
$('#lightbox-image-details-caption').hide();
|
||||
if ( settings.imageArray[settings.activeImage][1] ) {
|
||||
$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();
|
||||
}
|
||||
// If we have a image set, display 'Image X of X'
|
||||
if ( settings.imageArray.length > 1 ) {
|
||||
$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' (' + settings.imageArray.length+') ').show();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Display the button navigations
|
||||
*
|
||||
*/
|
||||
function _set_navigation() {
|
||||
$('#lightbox-nav').show();
|
||||
|
||||
// Instead to define this configuration in CSS file, we define here. And it<69>s need to IE. Just.
|
||||
$('#lightbox-nav-btnPrev,#lightbox-nav-btnNext').css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
|
||||
|
||||
// Show the prev button, if not the first image in set
|
||||
if ( settings.activeImage != 0 ) {
|
||||
if ( settings.fixedNavigation ) {
|
||||
$('#lightbox-nav-btnPrev').css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' })
|
||||
.unbind()
|
||||
.bind('click',function() {
|
||||
settings.activeImage = settings.activeImage - 1;
|
||||
_set_image_to_view();
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
// Show the images button for Next buttons
|
||||
$('#lightbox-nav-btnPrev').unbind().hover(function() {
|
||||
$(this).css({ 'background' : 'url(' + settings.imageBtnPrev + ') left 15% no-repeat' });
|
||||
},function() {
|
||||
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
|
||||
}).show().bind('click',function() {
|
||||
settings.activeImage = settings.activeImage - 1;
|
||||
_set_image_to_view();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Show the next button, if not the last image in set
|
||||
if ( settings.activeImage != ( settings.imageArray.length -1 ) ) {
|
||||
if ( settings.fixedNavigation ) {
|
||||
$('#lightbox-nav-btnNext').css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' })
|
||||
.unbind()
|
||||
.bind('click',function() {
|
||||
settings.activeImage = settings.activeImage + 1;
|
||||
_set_image_to_view();
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
// Show the images button for Next buttons
|
||||
$('#lightbox-nav-btnNext').unbind().hover(function() {
|
||||
$(this).css({ 'background' : 'url(' + settings.imageBtnNext + ') right 15% no-repeat' });
|
||||
},function() {
|
||||
$(this).css({ 'background' : 'transparent url(' + settings.imageBlank + ') no-repeat' });
|
||||
}).show().bind('click',function() {
|
||||
settings.activeImage = settings.activeImage + 1;
|
||||
_set_image_to_view();
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
// Enable keyboard navigation
|
||||
_enable_keyboard_navigation();
|
||||
}
|
||||
/**
|
||||
* Enable a support to keyboard navigation
|
||||
*
|
||||
*/
|
||||
function _enable_keyboard_navigation() {
|
||||
$(document).keydown(function(objEvent) {
|
||||
_keyboard_action(objEvent);
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Disable the support to keyboard navigation
|
||||
*
|
||||
*/
|
||||
function _disable_keyboard_navigation() {
|
||||
$(document).unbind();
|
||||
}
|
||||
/**
|
||||
* Perform the keyboard actions
|
||||
*
|
||||
*/
|
||||
function _keyboard_action(objEvent) {
|
||||
// To ie
|
||||
if ( objEvent == null ) {
|
||||
keycode = event.keyCode;
|
||||
escapeKey = 27;
|
||||
// To Mozilla
|
||||
} else {
|
||||
keycode = objEvent.keyCode;
|
||||
escapeKey = objEvent.DOM_VK_ESCAPE;
|
||||
}
|
||||
// Get the key in lower case form
|
||||
key = String.fromCharCode(keycode).toLowerCase();
|
||||
// Verify the keys to close the ligthBox
|
||||
if ( ( key == settings.keyToClose ) || ( key == 'x' ) || ( keycode == escapeKey ) ) {
|
||||
_finish();
|
||||
}
|
||||
// Verify the key to show the previous image
|
||||
if ( ( key == settings.keyToPrev ) || ( keycode == 37 ) ) {
|
||||
// If we<77>re not showing the first image, call the previous
|
||||
if ( settings.activeImage != 0 ) {
|
||||
settings.activeImage = settings.activeImage - 1;
|
||||
_set_image_to_view();
|
||||
_disable_keyboard_navigation();
|
||||
}
|
||||
}
|
||||
// Verify the key to show the next image
|
||||
if ( ( key == settings.keyToNext ) || ( keycode == 39 ) ) {
|
||||
// If we<77>re not showing the last image, call the next
|
||||
if ( settings.activeImage != ( settings.imageArray.length - 1 ) ) {
|
||||
settings.activeImage = settings.activeImage + 1;
|
||||
_set_image_to_view();
|
||||
_disable_keyboard_navigation();
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Preload prev and next images being showed
|
||||
*
|
||||
*/
|
||||
function _preload_neighbor_images() {
|
||||
if ( (settings.imageArray.length -1) > settings.activeImage ) {
|
||||
objNext = new Image();
|
||||
objNext.src = settings.imageArray[settings.activeImage + 1][0];
|
||||
}
|
||||
if ( settings.activeImage > 0 ) {
|
||||
objPrev = new Image();
|
||||
objPrev.src = settings.imageArray[settings.activeImage -1][0];
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Remove jQuery lightBox plugin HTML markup
|
||||
*
|
||||
*/
|
||||
function _finish() {
|
||||
$('#jquery-lightbox').remove();
|
||||
$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });
|
||||
// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.
|
||||
$('embed, object, select').css({ 'visibility' : 'visible' });
|
||||
}
|
||||
/**
|
||||
/ THIRD FUNCTION
|
||||
* getPageSize() by quirksmode.com
|
||||
*
|
||||
* @return Array Return an array with page width, height and window width, height
|
||||
*/
|
||||
function ___getPageSize() {
|
||||
var xScroll, yScroll;
|
||||
if (window.innerHeight && window.scrollMaxY) {
|
||||
xScroll = window.innerWidth + window.scrollMaxX;
|
||||
yScroll = window.innerHeight + window.scrollMaxY;
|
||||
} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
|
||||
xScroll = document.body.scrollWidth;
|
||||
yScroll = document.body.scrollHeight;
|
||||
} else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
|
||||
xScroll = document.body.offsetWidth;
|
||||
yScroll = document.body.offsetHeight;
|
||||
}
|
||||
var windowWidth, windowHeight;
|
||||
if (self.innerHeight) { // all except Explorer
|
||||
if(document.documentElement.clientWidth){
|
||||
windowWidth = document.documentElement.clientWidth;
|
||||
} else {
|
||||
windowWidth = self.innerWidth;
|
||||
}
|
||||
windowHeight = self.innerHeight;
|
||||
} else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode
|
||||
windowWidth = document.documentElement.clientWidth;
|
||||
windowHeight = document.documentElement.clientHeight;
|
||||
} else if (document.body) { // other Explorers
|
||||
windowWidth = document.body.clientWidth;
|
||||
windowHeight = document.body.clientHeight;
|
||||
}
|
||||
// for small pages with total height less then height of the viewport
|
||||
if(yScroll < windowHeight){
|
||||
pageHeight = windowHeight;
|
||||
} else {
|
||||
pageHeight = yScroll;
|
||||
}
|
||||
// for small pages with total width less then width of the viewport
|
||||
if(xScroll < windowWidth){
|
||||
pageWidth = xScroll;
|
||||
} else {
|
||||
pageWidth = windowWidth;
|
||||
}
|
||||
arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
|
||||
return arrayPageSize;
|
||||
};
|
||||
/**
|
||||
/ THIRD FUNCTION
|
||||
* getPageScroll() by quirksmode.com
|
||||
*
|
||||
* @return Array Return an array with x,y page scroll values.
|
||||
*/
|
||||
function ___getPageScroll() {
|
||||
var xScroll, yScroll;
|
||||
if (self.pageYOffset) {
|
||||
yScroll = self.pageYOffset;
|
||||
xScroll = self.pageXOffset;
|
||||
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
|
||||
yScroll = document.documentElement.scrollTop;
|
||||
xScroll = document.documentElement.scrollLeft;
|
||||
} else if (document.body) {// all other Explorers
|
||||
yScroll = document.body.scrollTop;
|
||||
xScroll = document.body.scrollLeft;
|
||||
}
|
||||
arrayPageScroll = new Array(xScroll,yScroll);
|
||||
return arrayPageScroll;
|
||||
};
|
||||
/**
|
||||
* Stop the code execution from a escified time in milisecond
|
||||
*
|
||||
*/
|
||||
function ___pause(ms) {
|
||||
var date = new Date();
|
||||
curDate = null;
|
||||
do { var curDate = new Date(); }
|
||||
while ( curDate - date < ms);
|
||||
};
|
||||
// Return the jQuery object for chaining. The unbind method is used to avoid click conflict when the plugin is called more than once
|
||||
return this.unbind('click').click(_initialize);
|
||||
};
|
||||
})(jQuery); // Call and execute the function immediately passing the jQuery object
|
||||
14933
Static/script/jQuery/jquery.mobile-1.4.1.js
Normal file
14933
Static/script/jQuery/jquery.mobile-1.4.1.js
Normal file
File diff suppressed because it is too large
Load Diff
11129
Static/script/jQuery/jquery.mobile.custom.js
Normal file
11129
Static/script/jQuery/jquery.mobile.custom.js
Normal file
File diff suppressed because it is too large
Load Diff
84
Static/script/jQuery/jquery.mousewheel.js
Normal file
84
Static/script/jQuery/jquery.mousewheel.js
Normal file
@@ -0,0 +1,84 @@
|
||||
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.6
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
var types = ['DOMMouseScroll', 'mousewheel'];
|
||||
|
||||
if ($.event.fixHooks) {
|
||||
for ( var i=types.length; i; ) {
|
||||
$.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
$.event.special.mousewheel = {
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.addEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i=types.length; i; ) {
|
||||
this.removeEventListener( types[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind("mousewheel", fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = "mousewheel";
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
|
||||
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
|
||||
|
||||
// New school multidimensional scroll (touchpads) deltas
|
||||
deltaY = delta;
|
||||
|
||||
// Gecko
|
||||
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaY = 0;
|
||||
deltaX = -1*delta;
|
||||
}
|
||||
|
||||
// Webkit
|
||||
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
|
||||
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
11
Static/script/jQuery/jquery.mousewheel.min.js
vendored
Normal file
11
Static/script/jQuery/jquery.mousewheel.min.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
*
|
||||
* Version: 3.0.2
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
|
||||
668
Static/script/jQuery/jquery.nivo.slider.js
Normal file
668
Static/script/jQuery/jquery.nivo.slider.js
Normal file
@@ -0,0 +1,668 @@
|
||||
/*
|
||||
* jQuery Nivo Slider v3.2
|
||||
* http://nivo.dev7studios.com
|
||||
*
|
||||
* Copyright 2012, Dev7studios
|
||||
* Free to use and abuse under the MIT license.
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
var NivoSlider = function(element, options){
|
||||
// Defaults are below
|
||||
var settings = $.extend({}, $.fn.nivoSlider.defaults, options);
|
||||
|
||||
// Useful variables. Play carefully.
|
||||
var vars = {
|
||||
currentSlide: 0,
|
||||
currentImage: '',
|
||||
totalSlides: 0,
|
||||
running: false,
|
||||
paused: false,
|
||||
stop: false,
|
||||
controlNavEl: false
|
||||
};
|
||||
|
||||
// Get this slider
|
||||
var slider = $(element);
|
||||
slider.data('nivo:vars', vars).addClass('nivoSlider');
|
||||
|
||||
// Find our slider children
|
||||
var kids = slider.children();
|
||||
kids.each(function() {
|
||||
var child = $(this);
|
||||
var link = '';
|
||||
if(!child.is('img')){
|
||||
if(child.is('a')){
|
||||
child.addClass('nivo-imageLink');
|
||||
link = child;
|
||||
}
|
||||
child = child.find('img:first');
|
||||
}
|
||||
// Get img width & height
|
||||
var childWidth = (childWidth === 0) ? child.attr('width') : child.width(),
|
||||
childHeight = (childHeight === 0) ? child.attr('height') : child.height();
|
||||
|
||||
if(link !== ''){
|
||||
link.css('display','none');
|
||||
}
|
||||
child.css('display','none');
|
||||
vars.totalSlides++;
|
||||
});
|
||||
|
||||
// If randomStart
|
||||
if(settings.randomStart){
|
||||
settings.startSlide = Math.floor(Math.random() * vars.totalSlides);
|
||||
}
|
||||
|
||||
// Set startSlide
|
||||
if(settings.startSlide > 0){
|
||||
if(settings.startSlide >= vars.totalSlides) { settings.startSlide = vars.totalSlides - 1; }
|
||||
vars.currentSlide = settings.startSlide;
|
||||
}
|
||||
|
||||
// Get initial image
|
||||
if($(kids[vars.currentSlide]).is('img')){
|
||||
vars.currentImage = $(kids[vars.currentSlide]);
|
||||
} else {
|
||||
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
|
||||
}
|
||||
|
||||
// Show initial link
|
||||
if($(kids[vars.currentSlide]).is('a')){
|
||||
$(kids[vars.currentSlide]).css('display','block');
|
||||
}
|
||||
|
||||
// Set first background
|
||||
var sliderImg = $('<img/>').addClass('nivo-main-image');
|
||||
sliderImg.attr('src', vars.currentImage.attr('src')).show();
|
||||
slider.append(sliderImg);
|
||||
|
||||
// Detect Window Resize
|
||||
$(window).resize(function() {
|
||||
slider.children('img').width(slider.width());
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
sliderImg.stop().height('auto');
|
||||
$('.nivo-slice').remove();
|
||||
$('.nivo-box').remove();
|
||||
});
|
||||
|
||||
//Create caption
|
||||
slider.append($('<div class="nivo-caption"></div>'));
|
||||
|
||||
// Process caption function
|
||||
var processCaption = function(settings){
|
||||
var nivoCaption = $('.nivo-caption', slider);
|
||||
if(vars.currentImage.attr('title') != '' && vars.currentImage.attr('title') != undefined){
|
||||
var title = vars.currentImage.attr('title');
|
||||
if(title.substr(0,1) == '#') title = $(title).html();
|
||||
|
||||
if(nivoCaption.css('display') == 'block'){
|
||||
setTimeout(function(){
|
||||
nivoCaption.html(title);
|
||||
}, settings.animSpeed);
|
||||
} else {
|
||||
nivoCaption.html(title);
|
||||
nivoCaption.stop().fadeIn(settings.animSpeed);
|
||||
}
|
||||
} else {
|
||||
nivoCaption.stop().fadeOut(settings.animSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
//Process initial caption
|
||||
processCaption(settings);
|
||||
|
||||
// In the words of Super Mario "let's a go!"
|
||||
var timer = 0;
|
||||
if(!settings.manualAdvance && kids.length > 1){
|
||||
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
||||
}
|
||||
|
||||
// Add Direction nav
|
||||
if(settings.directionNav){
|
||||
slider.append('<div class="nivo-directionNav"><a class="nivo-prevNav">'+ settings.prevText +'</a><a class="nivo-nextNav">'+ settings.nextText +'</a></div>');
|
||||
|
||||
$(slider).on('click', 'a.nivo-prevNav', function(){
|
||||
if(vars.running) { return false; }
|
||||
clearInterval(timer);
|
||||
timer = '';
|
||||
vars.currentSlide -= 2;
|
||||
nivoRun(slider, kids, settings, 'prev');
|
||||
});
|
||||
|
||||
$(slider).on('click', 'a.nivo-nextNav', function(){
|
||||
if(vars.running) { return false; }
|
||||
clearInterval(timer);
|
||||
timer = '';
|
||||
nivoRun(slider, kids, settings, 'next');
|
||||
});
|
||||
}
|
||||
|
||||
// Add Control nav
|
||||
if(settings.controlNav){
|
||||
vars.controlNavEl = $('<div class="nivo-controlNav"></div>');
|
||||
slider.after(vars.controlNavEl);
|
||||
for(var i = 0; i < kids.length; i++){
|
||||
if(settings.controlNavThumbs){
|
||||
vars.controlNavEl.addClass('nivo-thumbs-enabled');
|
||||
var child = kids.eq(i);
|
||||
if(!child.is('img')){
|
||||
child = child.find('img:first');
|
||||
}
|
||||
if(child.attr('data-thumb')) vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'"><img src="'+ child.attr('data-thumb') +'" alt="" /></a>');
|
||||
} else {
|
||||
vars.controlNavEl.append('<a class="nivo-control" rel="'+ i +'">'+ (i + 1) +'</a>');
|
||||
}
|
||||
}
|
||||
|
||||
//Set initial active link
|
||||
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
|
||||
|
||||
$('a', vars.controlNavEl).bind('click', function(){
|
||||
if(vars.running) return false;
|
||||
if($(this).hasClass('active')) return false;
|
||||
clearInterval(timer);
|
||||
timer = '';
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
vars.currentSlide = $(this).attr('rel') - 1;
|
||||
nivoRun(slider, kids, settings, 'control');
|
||||
});
|
||||
}
|
||||
|
||||
//For pauseOnHover setting
|
||||
if(settings.pauseOnHover){
|
||||
slider.hover(function(){
|
||||
vars.paused = true;
|
||||
clearInterval(timer);
|
||||
timer = '';
|
||||
}, function(){
|
||||
vars.paused = false;
|
||||
// Restart the timer
|
||||
if(timer === '' && !settings.manualAdvance){
|
||||
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Event when Animation finishes
|
||||
slider.bind('nivo:animFinished', function(){
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
vars.running = false;
|
||||
// Hide child links
|
||||
$(kids).each(function(){
|
||||
if($(this).is('a')){
|
||||
$(this).css('display','none');
|
||||
}
|
||||
});
|
||||
// Show current link
|
||||
if($(kids[vars.currentSlide]).is('a')){
|
||||
$(kids[vars.currentSlide]).css('display','block');
|
||||
}
|
||||
// Restart the timer
|
||||
if(timer === '' && !vars.paused && !settings.manualAdvance){
|
||||
timer = setInterval(function(){ nivoRun(slider, kids, settings, false); }, settings.pauseTime);
|
||||
}
|
||||
// Trigger the afterChange callback
|
||||
settings.afterChange.call(this);
|
||||
});
|
||||
|
||||
// Add slices for slice animations
|
||||
var createSlices = function(slider, settings, vars) {
|
||||
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
|
||||
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
|
||||
var sliceHeight = ($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().is('a')) ? $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').parent().height() : $('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height();
|
||||
|
||||
for(var i = 0; i < settings.slices; i++){
|
||||
var sliceWidth = Math.round(slider.width()/settings.slices);
|
||||
|
||||
if(i === settings.slices-1){
|
||||
slider.append(
|
||||
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
|
||||
left:(sliceWidth*i)+'px',
|
||||
width:(slider.width()-(sliceWidth*i))+'px',
|
||||
height:sliceHeight+'px',
|
||||
opacity:'0',
|
||||
overflow:'hidden'
|
||||
})
|
||||
);
|
||||
} else {
|
||||
slider.append(
|
||||
$('<div class="nivo-slice" name="'+i+'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block !important; top:0; left:-'+ ((sliceWidth + (i * sliceWidth)) - sliceWidth) +'px;" /></div>').css({
|
||||
left:(sliceWidth*i)+'px',
|
||||
width:sliceWidth+'px',
|
||||
height:sliceHeight+'px',
|
||||
opacity:'0',
|
||||
overflow:'hidden'
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$('.nivo-slice', slider).height(sliceHeight);
|
||||
sliderImg.stop().animate({
|
||||
height: $(vars.currentImage).height()
|
||||
}, settings.animSpeed);
|
||||
};
|
||||
|
||||
// Add boxes for box animations
|
||||
var createBoxes = function(slider, settings, vars){
|
||||
if($(vars.currentImage).parent().is('a')) $(vars.currentImage).parent().css('display','block');
|
||||
$('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').width(slider.width()).css('visibility', 'hidden').show();
|
||||
var boxWidth = Math.round(slider.width()/settings.boxCols),
|
||||
boxHeight = Math.round($('img[src="'+ vars.currentImage.attr('src') +'"]', slider).not('.nivo-main-image,.nivo-control img').height() / settings.boxRows);
|
||||
|
||||
|
||||
for(var rows = 0; rows < settings.boxRows; rows++){
|
||||
for(var cols = 0; cols < settings.boxCols; cols++){
|
||||
if(cols === settings.boxCols-1){
|
||||
slider.append(
|
||||
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
|
||||
opacity:0,
|
||||
left:(boxWidth*cols)+'px',
|
||||
top:(boxHeight*rows)+'px',
|
||||
width:(slider.width()-(boxWidth*cols))+'px'
|
||||
|
||||
})
|
||||
);
|
||||
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
|
||||
} else {
|
||||
slider.append(
|
||||
$('<div class="nivo-box" name="'+ cols +'" rel="'+ rows +'"><img src="'+ vars.currentImage.attr('src') +'" style="position:absolute; width:'+ slider.width() +'px; height:auto; display:block; top:-'+ (boxHeight*rows) +'px; left:-'+ (boxWidth*cols) +'px;" /></div>').css({
|
||||
opacity:0,
|
||||
left:(boxWidth*cols)+'px',
|
||||
top:(boxHeight*rows)+'px',
|
||||
width:boxWidth+'px'
|
||||
})
|
||||
);
|
||||
$('.nivo-box[name="'+ cols +'"]', slider).height($('.nivo-box[name="'+ cols +'"] img', slider).height()+'px');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sliderImg.stop().animate({
|
||||
height: $(vars.currentImage).height()
|
||||
}, settings.animSpeed);
|
||||
};
|
||||
|
||||
// Private run method
|
||||
var nivoRun = function(slider, kids, settings, nudge){
|
||||
// Get our vars
|
||||
var vars = slider.data('nivo:vars');
|
||||
|
||||
// Trigger the lastSlide callback
|
||||
if(vars && (vars.currentSlide === vars.totalSlides - 1)){
|
||||
settings.lastSlide.call(this);
|
||||
}
|
||||
|
||||
// Stop
|
||||
if((!vars || vars.stop) && !nudge) { return false; }
|
||||
|
||||
// Trigger the beforeChange callback
|
||||
settings.beforeChange.call(this);
|
||||
|
||||
// Set current background before change
|
||||
if(!nudge){
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
} else {
|
||||
if(nudge === 'prev'){
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
}
|
||||
if(nudge === 'next'){
|
||||
sliderImg.attr('src', vars.currentImage.attr('src'));
|
||||
}
|
||||
}
|
||||
|
||||
vars.currentSlide++;
|
||||
// Trigger the slideshowEnd callback
|
||||
if(vars.currentSlide === vars.totalSlides){
|
||||
vars.currentSlide = 0;
|
||||
settings.slideshowEnd.call(this);
|
||||
}
|
||||
if(vars.currentSlide < 0) { vars.currentSlide = (vars.totalSlides - 1); }
|
||||
// Set vars.currentImage
|
||||
if($(kids[vars.currentSlide]).is('img')){
|
||||
vars.currentImage = $(kids[vars.currentSlide]);
|
||||
} else {
|
||||
vars.currentImage = $(kids[vars.currentSlide]).find('img:first');
|
||||
}
|
||||
|
||||
// Set active links
|
||||
if(settings.controlNav){
|
||||
$('a', vars.controlNavEl).removeClass('active');
|
||||
$('a:eq('+ vars.currentSlide +')', vars.controlNavEl).addClass('active');
|
||||
}
|
||||
|
||||
// Process caption
|
||||
processCaption(settings);
|
||||
|
||||
// Remove any slices from last transition
|
||||
$('.nivo-slice', slider).remove();
|
||||
|
||||
// Remove any boxes from last transition
|
||||
$('.nivo-box', slider).remove();
|
||||
|
||||
var currentEffect = settings.effect,
|
||||
anims = '';
|
||||
|
||||
// Generate random effect
|
||||
if(settings.effect === 'random'){
|
||||
anims = new Array('sliceDownRight','sliceDownLeft','sliceUpRight','sliceUpLeft','sliceUpDown','sliceUpDownLeft','fold','fade',
|
||||
'boxRandom','boxRain','boxRainReverse','boxRainGrow','boxRainGrowReverse');
|
||||
currentEffect = anims[Math.floor(Math.random()*(anims.length + 1))];
|
||||
if(currentEffect === undefined) { currentEffect = 'fade'; }
|
||||
}
|
||||
|
||||
// Run random effect from specified set (eg: effect:'fold,fade')
|
||||
if(settings.effect.indexOf(',') !== -1){
|
||||
anims = settings.effect.split(',');
|
||||
currentEffect = anims[Math.floor(Math.random()*(anims.length))];
|
||||
if(currentEffect === undefined) { currentEffect = 'fade'; }
|
||||
}
|
||||
|
||||
// Custom transition as defined by "data-transition" attribute
|
||||
if(vars.currentImage.attr('data-transition')){
|
||||
currentEffect = vars.currentImage.attr('data-transition');
|
||||
}
|
||||
|
||||
// Run effects
|
||||
vars.running = true;
|
||||
var timeBuff = 0,
|
||||
i = 0,
|
||||
slices = '',
|
||||
firstSlice = '',
|
||||
totalBoxes = '',
|
||||
boxes = '';
|
||||
|
||||
if(currentEffect === 'sliceDown' || currentEffect === 'sliceDownRight' || currentEffect === 'sliceDownLeft'){
|
||||
createSlices(slider, settings, vars);
|
||||
timeBuff = 0;
|
||||
i = 0;
|
||||
slices = $('.nivo-slice', slider);
|
||||
if(currentEffect === 'sliceDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
||||
|
||||
slices.each(function(){
|
||||
var slice = $(this);
|
||||
slice.css({ 'top': '0px' });
|
||||
if(i === settings.slices-1){
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + timeBuff));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
||||
}, (100 + timeBuff));
|
||||
}
|
||||
timeBuff += 50;
|
||||
i++;
|
||||
});
|
||||
} else if(currentEffect === 'sliceUp' || currentEffect === 'sliceUpRight' || currentEffect === 'sliceUpLeft'){
|
||||
createSlices(slider, settings, vars);
|
||||
timeBuff = 0;
|
||||
i = 0;
|
||||
slices = $('.nivo-slice', slider);
|
||||
if(currentEffect === 'sliceUpLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
||||
|
||||
slices.each(function(){
|
||||
var slice = $(this);
|
||||
slice.css({ 'bottom': '0px' });
|
||||
if(i === settings.slices-1){
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + timeBuff));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
||||
}, (100 + timeBuff));
|
||||
}
|
||||
timeBuff += 50;
|
||||
i++;
|
||||
});
|
||||
} else if(currentEffect === 'sliceUpDown' || currentEffect === 'sliceUpDownRight' || currentEffect === 'sliceUpDownLeft'){
|
||||
createSlices(slider, settings, vars);
|
||||
timeBuff = 0;
|
||||
i = 0;
|
||||
var v = 0;
|
||||
slices = $('.nivo-slice', slider);
|
||||
if(currentEffect === 'sliceUpDownLeft') { slices = $('.nivo-slice', slider)._reverse(); }
|
||||
|
||||
slices.each(function(){
|
||||
var slice = $(this);
|
||||
if(i === 0){
|
||||
slice.css('top','0px');
|
||||
i++;
|
||||
} else {
|
||||
slice.css('bottom','0px');
|
||||
i = 0;
|
||||
}
|
||||
|
||||
if(v === settings.slices-1){
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + timeBuff));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
slice.animate({opacity:'1.0' }, settings.animSpeed);
|
||||
}, (100 + timeBuff));
|
||||
}
|
||||
timeBuff += 50;
|
||||
v++;
|
||||
});
|
||||
} else if(currentEffect === 'fold'){
|
||||
createSlices(slider, settings, vars);
|
||||
timeBuff = 0;
|
||||
i = 0;
|
||||
|
||||
$('.nivo-slice', slider).each(function(){
|
||||
var slice = $(this);
|
||||
var origWidth = slice.width();
|
||||
slice.css({ top:'0px', width:'0px' });
|
||||
if(i === settings.slices-1){
|
||||
setTimeout(function(){
|
||||
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + timeBuff));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
slice.animate({ width:origWidth, opacity:'1.0' }, settings.animSpeed);
|
||||
}, (100 + timeBuff));
|
||||
}
|
||||
timeBuff += 50;
|
||||
i++;
|
||||
});
|
||||
} else if(currentEffect === 'fade'){
|
||||
createSlices(slider, settings, vars);
|
||||
|
||||
firstSlice = $('.nivo-slice:first', slider);
|
||||
firstSlice.css({
|
||||
'width': slider.width() + 'px'
|
||||
});
|
||||
|
||||
firstSlice.animate({ opacity:'1.0' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
//makl zmiany tła
|
||||
$( "#sliderBox" ).animate({
|
||||
backgroundColor: $('#slider').eq(state.nextindex).attr('id')
|
||||
//color: "#fff",
|
||||
//width: 1300
|
||||
}, 3000 );
|
||||
} else if(currentEffect === 'slideInRight'){
|
||||
createSlices(slider, settings, vars);
|
||||
|
||||
firstSlice = $('.nivo-slice:first', slider);
|
||||
firstSlice.css({
|
||||
'width': '0px',
|
||||
'opacity': '1'
|
||||
});
|
||||
|
||||
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
} else if(currentEffect === 'slideInLeft'){
|
||||
createSlices(slider, settings, vars);
|
||||
|
||||
firstSlice = $('.nivo-slice:first', slider);
|
||||
firstSlice.css({
|
||||
'width': '0px',
|
||||
'opacity': '1',
|
||||
'left': '',
|
||||
'right': '0px'
|
||||
});
|
||||
|
||||
firstSlice.animate({ width: slider.width() + 'px' }, (settings.animSpeed*2), '', function(){
|
||||
// Reset positioning
|
||||
firstSlice.css({
|
||||
'left': '0px',
|
||||
'right': ''
|
||||
});
|
||||
slider.trigger('nivo:animFinished');
|
||||
});
|
||||
} else if(currentEffect === 'boxRandom'){
|
||||
createBoxes(slider, settings, vars);
|
||||
|
||||
totalBoxes = settings.boxCols * settings.boxRows;
|
||||
i = 0;
|
||||
timeBuff = 0;
|
||||
|
||||
boxes = shuffle($('.nivo-box', slider));
|
||||
boxes.each(function(){
|
||||
var box = $(this);
|
||||
if(i === totalBoxes-1){
|
||||
setTimeout(function(){
|
||||
box.animate({ opacity:'1' }, settings.animSpeed, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + timeBuff));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
box.animate({ opacity:'1' }, settings.animSpeed);
|
||||
}, (100 + timeBuff));
|
||||
}
|
||||
timeBuff += 20;
|
||||
i++;
|
||||
});
|
||||
} else if(currentEffect === 'boxRain' || currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
|
||||
createBoxes(slider, settings, vars);
|
||||
|
||||
totalBoxes = settings.boxCols * settings.boxRows;
|
||||
i = 0;
|
||||
timeBuff = 0;
|
||||
|
||||
// Split boxes into 2D array
|
||||
var rowIndex = 0;
|
||||
var colIndex = 0;
|
||||
var box2Darr = [];
|
||||
box2Darr[rowIndex] = [];
|
||||
boxes = $('.nivo-box', slider);
|
||||
if(currentEffect === 'boxRainReverse' || currentEffect === 'boxRainGrowReverse'){
|
||||
boxes = $('.nivo-box', slider)._reverse();
|
||||
}
|
||||
boxes.each(function(){
|
||||
box2Darr[rowIndex][colIndex] = $(this);
|
||||
colIndex++;
|
||||
if(colIndex === settings.boxCols){
|
||||
rowIndex++;
|
||||
colIndex = 0;
|
||||
box2Darr[rowIndex] = [];
|
||||
}
|
||||
});
|
||||
|
||||
// Run animation
|
||||
for(var cols = 0; cols < (settings.boxCols * 2); cols++){
|
||||
var prevCol = cols;
|
||||
for(var rows = 0; rows < settings.boxRows; rows++){
|
||||
if(prevCol >= 0 && prevCol < settings.boxCols){
|
||||
/* Due to some weird JS bug with loop vars
|
||||
being used in setTimeout, this is wrapped
|
||||
with an anonymous function call */
|
||||
(function(row, col, time, i, totalBoxes) {
|
||||
var box = $(box2Darr[row][col]);
|
||||
var w = box.width();
|
||||
var h = box.height();
|
||||
if(currentEffect === 'boxRainGrow' || currentEffect === 'boxRainGrowReverse'){
|
||||
box.width(0).height(0);
|
||||
}
|
||||
if(i === totalBoxes-1){
|
||||
setTimeout(function(){
|
||||
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3, '', function(){ slider.trigger('nivo:animFinished'); });
|
||||
}, (100 + time));
|
||||
} else {
|
||||
setTimeout(function(){
|
||||
box.animate({ opacity:'1', width:w, height:h }, settings.animSpeed/1.3);
|
||||
}, (100 + time));
|
||||
}
|
||||
})(rows, prevCol, timeBuff, i, totalBoxes);
|
||||
i++;
|
||||
}
|
||||
prevCol--;
|
||||
}
|
||||
timeBuff += 100;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Shuffle an array
|
||||
var shuffle = function(arr){
|
||||
for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i, 10), x = arr[--i], arr[i] = arr[j], arr[j] = x);
|
||||
return arr;
|
||||
};
|
||||
|
||||
// For debugging
|
||||
var trace = function(msg){
|
||||
if(this.console && typeof console.log !== 'undefined') { console.log(msg); }
|
||||
};
|
||||
|
||||
// Start / Stop
|
||||
this.stop = function(){
|
||||
if(!$(element).data('nivo:vars').stop){
|
||||
$(element).data('nivo:vars').stop = true;
|
||||
trace('Stop Slider');
|
||||
}
|
||||
};
|
||||
|
||||
this.start = function(){
|
||||
if($(element).data('nivo:vars').stop){
|
||||
$(element).data('nivo:vars').stop = false;
|
||||
trace('Start Slider');
|
||||
}
|
||||
};
|
||||
|
||||
// Trigger the afterLoad callback
|
||||
settings.afterLoad.call(this);
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
$.fn.nivoSlider = function(options) {
|
||||
return this.each(function(key, value){
|
||||
var element = $(this);
|
||||
// Return early if this element already has a plugin instance
|
||||
if (element.data('nivoslider')) { return element.data('nivoslider'); }
|
||||
// Pass options to plugin constructor
|
||||
var nivoslider = new NivoSlider(this, options);
|
||||
// Store plugin object in this element's data
|
||||
element.data('nivoslider', nivoslider);
|
||||
});
|
||||
};
|
||||
|
||||
//Default settings
|
||||
$.fn.nivoSlider.defaults = {
|
||||
effect: 'random',
|
||||
slices: 15,
|
||||
boxCols: 8,
|
||||
boxRows: 4,
|
||||
animSpeed: 500,
|
||||
pauseTime: 3000,
|
||||
startSlide: 0,
|
||||
directionNav: true,
|
||||
controlNav: true,
|
||||
controlNavThumbs: false,
|
||||
pauseOnHover: true,
|
||||
manualAdvance: false,
|
||||
prevText: 'Prev',
|
||||
nextText: 'Next',
|
||||
randomStart: false,
|
||||
beforeChange: function(){},
|
||||
afterChange: function(){},
|
||||
slideshowEnd: function(){},
|
||||
lastSlide: function(){},
|
||||
afterLoad: function(){}
|
||||
};
|
||||
|
||||
$.fn._reverse = [].reverse;
|
||||
|
||||
})(jQuery);
|
||||
108
Static/script/jQuery/jquery.prettyLoader.js
Normal file
108
Static/script/jQuery/jquery.prettyLoader.js
Normal file
@@ -0,0 +1,108 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
Class: prettyLoader
|
||||
Use: A unified solution for AJAX loader
|
||||
Author: Stephane Caron (http://www.no-margin-for-errors.com)
|
||||
Version: 1.0.1
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
(function($) {
|
||||
$.prettyLoader = {version: '1.0.1'};
|
||||
|
||||
$.prettyLoader = function(settings) {
|
||||
settings = jQuery.extend({
|
||||
animation_speed: 'fast', /* fast/normal/slow/integer */
|
||||
bind_to_ajax: true, /* true/false */
|
||||
delay: false, /* false OR time in milliseconds (ms) */
|
||||
loader: '/images/prettyLoader/ajax-loader.gif', /* Path to your loader gif */
|
||||
offset_top: 13, /* integer */
|
||||
offset_left: 10 /* integer */
|
||||
}, settings);
|
||||
|
||||
scrollPos = _getScroll();
|
||||
|
||||
imgLoader = new Image();
|
||||
imgLoader.onerror = function(){
|
||||
//alert('Preloader image cannot be loaded. Make sure the path is correct in the settings and that the image is reachable.');
|
||||
|
||||
};
|
||||
imgLoader.src = settings.loader;
|
||||
|
||||
if(settings.bind_to_ajax)
|
||||
jQuery(document).ajaxStart(function(){ $.prettyLoader.show() }).ajaxStop(function(){ $.prettyLoader.hide() });
|
||||
|
||||
$.prettyLoader.positionLoader = function(e){
|
||||
e = e ? e : window.event;
|
||||
|
||||
// Set the cursor pos only if the even is returned by the browser.
|
||||
cur_x = (e.clientX) ? e.clientX : cur_x;
|
||||
cur_y = (e.clientY) ? e.clientY : cur_y;
|
||||
|
||||
left_pos = cur_x + settings.offset_left + scrollPos['scrollLeft'];
|
||||
top_pos = cur_y + settings.offset_top + scrollPos['scrollTop'];
|
||||
|
||||
$('.prettyLoader').css({
|
||||
'top':top_pos,
|
||||
'left':left_pos
|
||||
});
|
||||
}
|
||||
|
||||
$.prettyLoader.show = function(delay){
|
||||
if($('.prettyLoader').size() > 0) return;
|
||||
|
||||
// Get the scroll position
|
||||
scrollPos = _getScroll();
|
||||
|
||||
// Build the loader container
|
||||
$('<div></div>')
|
||||
.addClass('prettyLoader')
|
||||
.addClass('prettyLoader_'+ settings.theme)
|
||||
.appendTo('body')
|
||||
.hide();
|
||||
|
||||
// No png for IE6...sadly :(
|
||||
if($.browser.msie && $.browser.version == 6)
|
||||
$('.prettyLoader').addClass('pl_ie6');
|
||||
|
||||
// Build the loader image
|
||||
$('<img />')
|
||||
.attr('src',settings.loader)
|
||||
.appendTo('.prettyLoader');
|
||||
|
||||
// Show it!
|
||||
$('.prettyLoader').fadeIn(settings.animation_speed);
|
||||
|
||||
$(document).bind('click',$.prettyLoader.positionLoader);
|
||||
$(document).bind('mousemove',$.prettyLoader.positionLoader);
|
||||
$(window).scroll(function(){ scrollPos = _getScroll(); $(document).triggerHandler('mousemove'); });
|
||||
|
||||
delay = (delay) ? delay : settings.delay;
|
||||
|
||||
if(delay){
|
||||
setTimeout(function(){ $.prettyLoader.hide() }, delay);
|
||||
}
|
||||
};
|
||||
|
||||
$.prettyLoader.hide = function(){
|
||||
$(document).unbind('click',$.prettyLoader.positionLoader);
|
||||
$(document).unbind('mousemove',$.prettyLoader.positionLoader);
|
||||
$(window).unbind('scroll');
|
||||
|
||||
$('.prettyLoader').fadeOut(settings.animation_speed,function(){
|
||||
$(this).remove();
|
||||
});
|
||||
};
|
||||
|
||||
function _getScroll(){
|
||||
if (self.pageYOffset) {
|
||||
return {scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};
|
||||
} else if (document.documentElement && document.documentElement.scrollTop) { // Explorer 6 Strict
|
||||
return {scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};
|
||||
} else if (document.body) {// all other Explorers
|
||||
return {scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};
|
||||
};
|
||||
};
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
69
Static/script/jQuery/jquery.prettyPhoto.js
Normal file
69
Static/script/jQuery/jquery.prettyPhoto.js
Normal file
@@ -0,0 +1,69 @@
|
||||
/* ------------------------------------------------------------------------
|
||||
Class: prettyPhoto
|
||||
Use: Lightbox clone for jQuery
|
||||
Author: Stephane Caron (http://www.no-margin-for-errors.com)
|
||||
Version: 3.0.3
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
(function($){$.prettyPhoto={version:'3.0.2'};$.fn.prettyPhoto=function(pp_settings){pp_settings=jQuery.extend({animation_speed:'fast',slideshow:false,autoplay_slideshow:false,opacity:0.80,show_title:true,allow_resize:true,default_width:500,default_height:344,counter_separator_label:'/',theme:'facebook',hideflash:false,wmode:'opaque',autoplay:true,modal:false,overlay_gallery:true,keyboard_shortcuts:true,changepicturecallback:function(){},callback:function(){},markup:'<div class="pp_pic_holder"> \
|
||||
<div class="ppt"> </div> \
|
||||
<div class="pp_top"> \
|
||||
<div class="pp_left"></div> \
|
||||
<div class="pp_middle"></div> \
|
||||
<div class="pp_right"></div> \
|
||||
</div> \
|
||||
<div class="pp_content_container"> \
|
||||
<div class="pp_left"> \
|
||||
<div class="pp_right"> \
|
||||
<div class="pp_content"> \
|
||||
<div class="pp_loaderIcon"></div> \
|
||||
<div class="pp_fade"> \
|
||||
<a href="#" class="pp_expand" title="Expand the image">Expand</a> \
|
||||
<div class="pp_hoverContainer"> \
|
||||
<a class="pp_next" href="#">next</a> \
|
||||
<a class="pp_previous" href="#">previous</a> \
|
||||
</div> \
|
||||
<div id="pp_full_res"></div> \
|
||||
<div class="pp_details clearfix"> \
|
||||
<p class="pp_description"></p> \
|
||||
<a class="pp_close" href="#">Close</a> \
|
||||
<div class="pp_nav"> \
|
||||
<a href="#" class="pp_arrow_previous">Previous</a> \
|
||||
<p class="currentTextHolder">0/0</p> \
|
||||
<a href="#" class="pp_arrow_next">Next</a> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div class="pp_bottom"> \
|
||||
<div class="pp_left"></div> \
|
||||
<div class="pp_middle"></div> \
|
||||
<div class="pp_right"></div> \
|
||||
</div> \
|
||||
</div> \
|
||||
<div class="pp_overlay"></div>',gallery_markup:'<div class="pp_gallery"> \
|
||||
<a href="#" class="pp_arrow_previous">Previous</a> \
|
||||
<ul> \
|
||||
{gallery} \
|
||||
</ul> \
|
||||
<a href="#" class="pp_arrow_next">Next</a> \
|
||||
</div>',image_markup:'<img id="fullResImage" src="{path}" />',flash_markup:'<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="{width}" height="{height}"><param name="wmode" value="{wmode}" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="{path}" /><embed src="{path}" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="{width}" height="{height}" wmode="{wmode}"></embed></object>',quicktime_markup:'<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="{height}" width="{width}"><param name="src" value="{path}"><param name="autoplay" value="{autoplay}"><param name="type" value="video/quicktime"><embed src="{path}" height="{height}" width="{width}" autoplay="{autoplay}" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>',iframe_markup:'<iframe src ="{path}" width="{width}" height="{height}" frameborder="no"></iframe>',inline_markup:'<div class="pp_inline clearfix">{content}</div>',custom_markup:''},pp_settings);var matchedObjects=this,percentBased=false,pp_dimensions,pp_open,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,windowHeight=$(window).height(),windowWidth=$(window).width(),pp_slideshow;doresize=true,scroll_pos=_get_scroll();$(window).unbind('resize.prettyphoto').bind('resize.prettyphoto',function(){_center_overlay();_resize_overlay();});if(pp_settings.keyboard_shortcuts){$(document).unbind('keydown.prettyphoto').bind('keydown.prettyphoto',function(e){if(typeof $pp_pic_holder!='undefined'){if($pp_pic_holder.is(':visible')){switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');e.preventDefault();break;case 39:$.prettyPhoto.changePage('next');e.preventDefault();break;case 27:if(!settings.modal)
|
||||
$.prettyPhoto.close();e.preventDefault();break;};};};});}
|
||||
$.prettyPhoto.initialize=function(){settings=pp_settings;if($.browser.msie&&parseInt($.browser.version)==6)settings.theme="light_square";theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;isSet=(galleryRegExp.exec(theRel))?true:false;pp_images=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return $(n).attr('href');}):$.makeArray($(this).attr('href'));pp_titles=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).find('img').attr('alt'))?$(n).find('img').attr('alt'):"";}):$.makeArray($(this).find('img').attr('alt'));pp_descriptions=(isSet)?jQuery.map(matchedObjects,function(n,i){if($(n).attr('rel').indexOf(theRel)!=-1)return($(n).attr('title'))?$(n).attr('title'):"";}):$.makeArray($(this).attr('title'));_buildOverlay(this);if(settings.allow_resize)
|
||||
$(window).bind('scroll.prettyphoto',function(){_center_overlay();});set_position=jQuery.inArray($(this).attr('href'),pp_images);$.prettyPhoto.open();return false;}
|
||||
$.prettyPhoto.open=function(event){if(typeof settings=="undefined"){settings=pp_settings;if($.browser.msie&&$.browser.version==6)settings.theme="light_square";pp_images=$.makeArray(arguments[0]);pp_titles=(arguments[1])?$.makeArray(arguments[1]):$.makeArray("");pp_descriptions=(arguments[2])?$.makeArray(arguments[2]):$.makeArray("");isSet=(pp_images.length>1)?true:false;set_position=0;_buildOverlay(event.target);}
|
||||
if($.browser.msie&&$.browser.version==6)$('select').css('visibility','hidden');if(settings.hideflash)$('object,embed').css('visibility','hidden');_checkPosition($(pp_images).size());$('.pp_loaderIcon').show();if($ppt.is(':hidden'))$ppt.css('opacity',0).show();$pp_overlay.show().fadeTo(settings.animation_speed,settings.opacity);$pp_pic_holder.find('.currentTextHolder').text((set_position+1)+settings.counter_separator_label+$(pp_images).size());$pp_pic_holder.find('.pp_description').show().html(unescape(pp_descriptions[set_position]));(settings.show_title&&pp_titles[set_position]!=""&&typeof pp_titles[set_position]!="undefined")?$ppt.html(unescape(pp_titles[set_position])):$ppt.html(' ');movie_width=(parseFloat(grab_param('width',pp_images[set_position])))?grab_param('width',pp_images[set_position]):settings.default_width.toString();movie_height=(parseFloat(grab_param('height',pp_images[set_position])))?grab_param('height',pp_images[set_position]):settings.default_height.toString();if(movie_height.indexOf('%')!=-1){movie_height=parseFloat(($(window).height()*parseFloat(movie_height)/100)-150);percentBased=true;}
|
||||
if(movie_width.indexOf('%')!=-1){movie_width=parseFloat(($(window).width()*parseFloat(movie_width)/100)-150);percentBased=true;}
|
||||
$pp_pic_holder.fadeIn(function(){imgPreloader="";switch(_getFileType(pp_images[set_position])){case'image':imgPreloader=new Image();nextImage=new Image();if(isSet&&set_position<$(pp_images).size()-1)nextImage.src=pp_images[set_position+1];prevImage=new Image();if(isSet&&pp_images[set_position-1])prevImage.src=pp_images[set_position-1];$pp_pic_holder.find('#pp_full_res')[0].innerHTML=settings.image_markup.replace(/{path}/g,pp_images[set_position]);imgPreloader.onload=function(){pp_dimensions=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.onerror=function(){alert('Image cannot be loaded. Make sure the path is correct and image exist.');$.prettyPhoto.close();};imgPreloader.src=pp_images[set_position];break;case'youtube':pp_dimensions=_fitToViewport(movie_width,movie_height);movie='http://www.youtube.com/v/'+grab_param('v',pp_images[set_position]);if(settings.autoplay)movie+="&autoplay=1";toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,movie);break;case'vimeo':pp_dimensions=_fitToViewport(movie_width,movie_height);movie_id=pp_images[set_position];var regExp=/http:\/\/(www\.)?vimeo.com\/(\d+)/;var match=movie_id.match(regExp);movie='http://player.vimeo.com/video/'+match[2]+'?title=0&byline=0&portrait=0';if(settings.autoplay)movie+="&autoplay=1;";vimeo_width=pp_dimensions['width']+'/embed/?moog_width='+pp_dimensions['width'];toInject=settings.iframe_markup.replace(/{width}/g,vimeo_width).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,movie);break;case'quicktime':pp_dimensions=_fitToViewport(movie_width,movie_height);pp_dimensions['height']+=15;pp_dimensions['contentHeight']+=15;pp_dimensions['containerHeight']+=15;toInject=settings.quicktime_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,pp_images[set_position]).replace(/{autoplay}/g,settings.autoplay);break;case'flash':pp_dimensions=_fitToViewport(movie_width,movie_height);flash_vars=pp_images[set_position];flash_vars=flash_vars.substring(pp_images[set_position].indexOf('flashvars')+10,pp_images[set_position].length);filename=pp_images[set_position];filename=filename.substring(0,filename.indexOf('?'));toInject=settings.flash_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{wmode}/g,settings.wmode).replace(/{path}/g,filename+'?'+flash_vars);break;case'iframe':pp_dimensions=_fitToViewport(movie_width,movie_height);frame_url=pp_images[set_position];frame_url=frame_url.substr(0,frame_url.indexOf('iframe')-1);toInject=settings.iframe_markup.replace(/{width}/g,pp_dimensions['width']).replace(/{height}/g,pp_dimensions['height']).replace(/{path}/g,frame_url);break;case'custom':pp_dimensions=_fitToViewport(movie_width,movie_height);toInject=settings.custom_markup;break;case'inline':myClone=$(pp_images[set_position]).clone().css({'width':settings.default_width}).wrapInner('<div id="pp_full_res"><div class="pp_inline clearfix"></div></div>').appendTo($('body')).show();doresize=false;pp_dimensions=_fitToViewport($(myClone).width(),$(myClone).height());doresize=true;$(myClone).remove();toInject=settings.inline_markup.replace(/{content}/g,$(pp_images[set_position]).html());break;};if(!imgPreloader){$pp_pic_holder.find('#pp_full_res')[0].innerHTML=toInject;_showContent();};});return false;};$.prettyPhoto.changePage=function(direction){currentGalleryPage=0;if(direction=='previous'){set_position--;if(set_position<0){set_position=0;return;};}else if(direction=='next'){set_position++;if(set_position>$(pp_images).size()-1){set_position=0;}}else{set_position=direction;};if(!doresize)doresize=true;$('.pp_contract').removeClass('pp_contract').addClass('pp_expand');_hideContent(function(){$.prettyPhoto.open();});};$.prettyPhoto.changeGalleryPage=function(direction){if(direction=='next'){currentGalleryPage++;if(currentGalleryPage>totalPage){currentGalleryPage=0;};}else if(direction=='previous'){currentGalleryPage--;if(currentGalleryPage<0){currentGalleryPage=totalPage;};}else{currentGalleryPage=direction;};itemsToSlide=(currentGalleryPage==totalPage)?pp_images.length-((totalPage)*itemsPerPage):itemsPerPage;$pp_pic_holder.find('.pp_gallery li').each(function(i){$(this).animate({'left':(i*itemWidth)-((itemsToSlide*itemWidth)*currentGalleryPage)});});};$.prettyPhoto.startSlideshow=function(){if(typeof pp_slideshow=='undefined'){$pp_pic_holder.find('.pp_play').unbind('click').removeClass('pp_play').addClass('pp_pause').click(function(){$.prettyPhoto.stopSlideshow();return false;});pp_slideshow=setInterval($.prettyPhoto.startSlideshow,settings.slideshow);}else{$.prettyPhoto.changePage('next');};}
|
||||
$.prettyPhoto.stopSlideshow=function(){$pp_pic_holder.find('.pp_pause').unbind('click').removeClass('pp_pause').addClass('pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});clearInterval(pp_slideshow);pp_slideshow=undefined;}
|
||||
$.prettyPhoto.close=function(){if($pp_overlay.is(":animated"))return;$.prettyPhoto.stopSlideshow();$pp_pic_holder.stop().find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt,.pp_fade').fadeOut(settings.animation_speed,function(){$(this).remove();});$pp_overlay.fadeOut(settings.animation_speed,function(){if($.browser.msie&&$.browser.version==6)$('select').css('visibility','visible');if(settings.hideflash)$('object,embed').css('visibility','visible');$(this).remove();$(window).unbind('scroll');settings.callback();doresize=true;pp_open=false;delete settings;});};function _showContent(){$('.pp_loaderIcon').hide();$ppt.fadeTo(settings.animation_speed,1);projectedTop=scroll_pos['scrollTop']+((windowHeight/2)-(pp_dimensions['containerHeight']/2));if(projectedTop<0)projectedTop=0;$pp_pic_holder.find('.pp_content').animate({height:pp_dimensions['contentHeight'],width:pp_dimensions['contentWidth']},settings.animation_speed);$pp_pic_holder.animate({'top':projectedTop,'left':(windowWidth/2)-(pp_dimensions['containerWidth']/2),width:pp_dimensions['containerWidth']},settings.animation_speed,function(){$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(pp_dimensions['height']).width(pp_dimensions['width']);$pp_pic_holder.find('.pp_fade').fadeIn(settings.animation_speed);if(isSet&&_getFileType(pp_images[set_position])=="image"){$pp_pic_holder.find('.pp_hoverContainer').show();}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
|
||||
if(pp_dimensions['resized']){$('a.pp_expand,a.pp_contract').show();}else{$('a.pp_expand,a.pp_contract').hide();}
|
||||
if(settings.autoplay_slideshow&&!pp_slideshow&&!pp_open)$.prettyPhoto.startSlideshow();settings.changepicturecallback();pp_open=true;});_insert_gallery();};function _hideContent(callback){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_fade').fadeOut(settings.animation_speed,function(){$('.pp_loaderIcon').show();callback();});};function _checkPosition(setCount){(setCount>1)?$('.pp_nav').show():$('.pp_nav').hide();};function _fitToViewport(width,height){resized=false;_getDimensions(width,height);imageWidth=width,imageHeight=height;if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allow_resize&&!percentBased){resized=true,fitting=false;while(!fitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{fitting=true;};pp_containerHeight=imageHeight,pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:Math.floor(imageWidth),height:Math.floor(imageHeight),containerHeight:Math.floor(pp_containerHeight),containerWidth:Math.floor(pp_containerWidth)+40,contentHeight:Math.floor(pp_contentHeight),contentWidth:Math.floor(pp_contentWidth),resized:resized};};function _getDimensions(width,height){width=parseFloat(width);height=parseFloat(height);$pp_details=$pp_pic_holder.find('.pp_details');$pp_details.width(width);detailsHeight=parseFloat($pp_details.css('marginTop'))+parseFloat($pp_details.css('marginBottom'));$pp_details=$pp_details.clone().appendTo($('body')).css({'position':'absolute','top':-10000});detailsHeight+=$pp_details.height();detailsHeight=(detailsHeight<=34)?36:detailsHeight;if($.browser.msie&&$.browser.version==7)detailsHeight+=8;$pp_details.remove();$pp_title=$pp_pic_holder.find('.ppt');$pp_title.width(width);titleHeight=parseFloat($pp_title.css('marginTop'))+parseFloat($pp_title.css('marginBottom'));$pp_title=$pp_title.clone().appendTo($('body')).css({'position':'absolute','top':-10000});titleHeight+=$pp_title.height();$pp_title.remove();pp_contentHeight=height+detailsHeight;pp_contentWidth=width;pp_containerHeight=pp_contentHeight+titleHeight+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width;}
|
||||
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){return'youtube';}else if(itemSrc.match(/vimeo\.com/i)){return'vimeo';}else if(itemSrc.match(/\b.mov\b/i)){return'quicktime';}else if(itemSrc.match(/\b.swf\b/i)){return'flash';}else if(itemSrc.match(/\biframe=true\b/i)){return'iframe';}else if(itemSrc.match(/\bcustom=true\b/i)){return'custom';}else if(itemSrc.substr(0,1)=='#'){return'inline';}else{return'image';};};function _center_overlay(){if(doresize&&typeof $pp_pic_holder!='undefined'){scroll_pos=_get_scroll();contentHeight=$pp_pic_holder.height(),contentwidth=$pp_pic_holder.width();projectedTop=(windowHeight/2)+scroll_pos['scrollTop']-(contentHeight/2);if(projectedTop<0)projectedTop=0;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+scroll_pos['scrollLeft']-(contentwidth/2)});};};function _get_scroll(){if(self.pageYOffset){return{scrollTop:self.pageYOffset,scrollLeft:self.pageXOffset};}else if(document.documentElement&&document.documentElement.scrollTop){return{scrollTop:document.documentElement.scrollTop,scrollLeft:document.documentElement.scrollLeft};}else if(document.body){return{scrollTop:document.body.scrollTop,scrollLeft:document.body.scrollLeft};};};function _resize_overlay(){windowHeight=$(window).height(),windowWidth=$(window).width();if(typeof $pp_overlay!="undefined")$pp_overlay.height($(document).height()).width(windowWidth);};function _insert_gallery(){if(isSet&&settings.overlay_gallery&&_getFileType(pp_images[set_position])=="image"){itemWidth=52+5;navWidth=(settings.theme=="facebook")?58:38;itemsPerPage=Math.floor((pp_dimensions['containerWidth']-100-navWidth)/itemWidth);itemsPerPage=(itemsPerPage<pp_images.length)?itemsPerPage:pp_images.length;totalPage=Math.ceil(pp_images.length/itemsPerPage)-1;if(totalPage==0){navWidth=0;$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').hide();}else{$pp_pic_holder.find('.pp_gallery .pp_arrow_next,.pp_gallery .pp_arrow_previous').show();};galleryWidth=itemsPerPage*itemWidth+navWidth;$pp_pic_holder.find('.pp_gallery').width(galleryWidth).css('margin-left',-(galleryWidth/2));$pp_pic_holder.find('.pp_gallery ul').width(itemsPerPage*itemWidth).find('li.selected').removeClass('selected');goToPage=(Math.ceil((set_position+1)/itemsPerPage)<totalPage)?Math.ceil((set_position+1)/itemsPerPage):totalPage;$.prettyPhoto.changeGalleryPage(goToPage);$pp_pic_holder.find('.pp_gallery ul li:eq('+set_position+')').addClass('selected');}else{$pp_pic_holder.find('.pp_content').unbind('mouseenter mouseleave');$pp_pic_holder.find('.pp_gallery').hide();}}
|
||||
function _buildOverlay(caller){$('body').append(settings.markup);$pp_pic_holder=$('.pp_pic_holder'),$ppt=$('.ppt'),$pp_overlay=$('div.pp_overlay');if(isSet&&settings.overlay_gallery){currentGalleryPage=0;toInject="";for(var i=0;i<pp_images.length;i++){if(!pp_images[i].match(/\b(jpg|jpeg|png|gif)\b/gi)){classname='default';}else{classname='';}
|
||||
toInject+="<li class='"+classname+"'><a href='#'><img src='"+pp_images[i]+"' width='50' alt='' /></a></li>";};toInject=settings.gallery_markup.replace(/{gallery}/g,toInject);$pp_pic_holder.find('#pp_full_res').after(toInject);$pp_pic_holder.find('.pp_gallery .pp_arrow_next').click(function(){$.prettyPhoto.changeGalleryPage('next');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_gallery .pp_arrow_previous').click(function(){$.prettyPhoto.changeGalleryPage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_content').hover(function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeIn();},function(){$pp_pic_holder.find('.pp_gallery:not(.disabled)').fadeOut();});itemWidth=52+5;$pp_pic_holder.find('.pp_gallery ul li').each(function(i){$(this).css({'position':'absolute','left':i*itemWidth});$(this).find('a').unbind('click').click(function(){$.prettyPhoto.changePage(i);$.prettyPhoto.stopSlideshow();return false;});});};if(settings.slideshow){$pp_pic_holder.find('.pp_nav').prepend('<a href="#" class="pp_play">Play</a>')
|
||||
$pp_pic_holder.find('.pp_nav .pp_play').click(function(){$.prettyPhoto.startSlideshow();return false;});}
|
||||
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);$pp_overlay.css({'opacity':0,'height':$(document).height(),'width':$(window).width()}).bind('click',function(){if(!settings.modal)$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(e){if($(this).hasClass('pp_expand')){$(this).removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$(this).removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent(function(){$.prettyPhoto.open();});return false;});$pp_pic_holder.find('.pp_previous, .pp_nav .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');$.prettyPhoto.stopSlideshow();return false;});$pp_pic_holder.find('.pp_next, .pp_nav .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');$.prettyPhoto.stopSlideshow();return false;});_center_overlay();};return this.unbind('click.prettyphoto').bind('click.prettyphoto',$.prettyPhoto.initialize);};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);return(results==null)?"":results[1];}})(jQuery);
|
||||
11
Static/script/jQuery/jquery.scrollTo-min.js
vendored
Normal file
11
Static/script/jQuery/jquery.scrollTo-min.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* jQuery.ScrollTo - Easy element scrolling using jQuery.
|
||||
* Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
|
||||
* Dual licensed under MIT and GPL.
|
||||
* Date: 5/25/2009
|
||||
* @author Ariel Flesler
|
||||
* @version 1.4.2
|
||||
*
|
||||
* http://flesler.blogspot.com/2007/10/jqueryscrollto.html
|
||||
*/
|
||||
;(function(d){var k=d.scrollTo=function(a,i,e){d(window).scrollTo(a,i,e)};k.defaults={axis:'xy',duration:parseFloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodeName||d.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentWindow||a).document||a.ownerDocument||a;return d.browser.safari||e.compatMode=='BackCompat'?e.body:e.documentElement})};d.fn.scrollTo=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onAfter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'Left':'Top',h=e.toLowerCase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseInt(f.css('margin'+e))||0;g[c]-=parseInt(f.css('border'+e+'Width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parseFloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:Math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onAfterFirst);delete g[c]}});t(b.onAfter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'Width':'Height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.toLowerCase()]();var c='client'+e,l=a.ownerDocument.documentElement,m=a.ownerDocument.body;return Math.max(l[h],m[h])-Math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery);
|
||||
2
Static/script/jQuery/jquery.scrollex.min.js
vendored
Normal file
2
Static/script/jQuery/jquery.scrollex.min.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/* jquery.scrollex v0.2.1 | (c) @ajlkn | github.com/ajlkn/jquery.scrollex | MIT licensed */
|
||||
!function(t){function e(t,e,n){return"string"==typeof t&&("%"==t.slice(-1)?t=parseInt(t.substring(0,t.length-1))/100*e:"vh"==t.slice(-2)?t=parseInt(t.substring(0,t.length-2))/100*n:"px"==t.slice(-2)&&(t=parseInt(t.substring(0,t.length-2)))),t}var n=t(window),i=1,o={};n.on("scroll",function(){var e=n.scrollTop();t.map(o,function(t){window.clearTimeout(t.timeoutId),t.timeoutId=window.setTimeout(function(){t.handler(e)},t.options.delay)})}).on("load",function(){n.trigger("scroll")}),jQuery.fn.scrollex=function(l){var s=t(this);if(0==this.length)return s;if(this.length>1){for(var r=0;r<this.length;r++)t(this[r]).scrollex(l);return s}if(s.data("_scrollexId"))return s;var a,u,h,c,p;switch(a=i++,u=jQuery.extend({top:0,bottom:0,delay:0,mode:"default",enter:null,leave:null,initialize:null,terminate:null,scroll:null},l),u.mode){case"top":h=function(t,e,n,i,o){return t>=i&&o>=t};break;case"bottom":h=function(t,e,n,i,o){return n>=i&&o>=n};break;case"middle":h=function(t,e,n,i,o){return e>=i&&o>=e};break;case"top-only":h=function(t,e,n,i,o){return i>=t&&n>=i};break;case"bottom-only":h=function(t,e,n,i,o){return n>=o&&o>=t};break;default:case"default":h=function(t,e,n,i,o){return n>=i&&o>=t}}return c=function(t){var i,o,l,s,r,a,u=this.state,h=!1,c=this.$element.offset();i=n.height(),o=t+i/2,l=t+i,s=this.$element.outerHeight(),r=c.top+e(this.options.top,s,i),a=c.top+s-e(this.options.bottom,s,i),h=this.test(t,o,l,r,a),h!=u&&(this.state=h,h?this.options.enter&&this.options.enter.apply(this.element):this.options.leave&&this.options.leave.apply(this.element)),this.options.scroll&&this.options.scroll.apply(this.element,[(o-r)/(a-r)])},p={id:a,options:u,test:h,handler:c,state:null,element:this,$element:s,timeoutId:null},o[a]=p,s.data("_scrollexId",p.id),p.options.initialize&&p.options.initialize.apply(this),s},jQuery.fn.unscrollex=function(){var e=t(this);if(0==this.length)return e;if(this.length>1){for(var n=0;n<this.length;n++)t(this[n]).unscrollex();return e}var i,l;return(i=e.data("_scrollexId"))?(l=o[i],window.clearTimeout(l.timeoutId),delete o[i],e.removeData("_scrollexId"),l.options.terminate&&l.options.terminate.apply(this),e):e}}(jQuery);
|
||||
455
Static/script/jQuery/jquery.scrollme.js
Normal file
455
Static/script/jQuery/jquery.scrollme.js
Normal file
@@ -0,0 +1,455 @@
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// ScrollMe
|
||||
// A jQuery plugin for adding simple scrolling effects to web pages
|
||||
// http://scrollme.nckprsn.com
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
|
||||
var scrollme = ( function( $ )
|
||||
{
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// ScrollMe object
|
||||
|
||||
var _this = {};
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Properties
|
||||
|
||||
var $document = $( document );
|
||||
var $window = $( window );
|
||||
|
||||
_this.body_height = 0;
|
||||
|
||||
_this.viewport_height = 0;
|
||||
|
||||
_this.viewport_top = 0;
|
||||
_this.viewport_bottom = 0;
|
||||
|
||||
_this.viewport_top_previous = -1;
|
||||
|
||||
_this.elements = [];
|
||||
_this.elements_in_view = [];
|
||||
|
||||
_this.property_defaults =
|
||||
{
|
||||
'opacity' : 1,
|
||||
'translatex' : 0,
|
||||
'translatey' : 0,
|
||||
'translatez' : 0,
|
||||
'rotatex' : 0,
|
||||
'rotatey' : 0,
|
||||
'rotatez' : 0,
|
||||
'scale' : 1,
|
||||
'scalex' : 1,
|
||||
'scaley' : 1,
|
||||
'scalez' : 1
|
||||
};
|
||||
|
||||
_this.scrollme_selector = '.scrollme';
|
||||
_this.animateme_selector = '.animateme';
|
||||
|
||||
_this.update_interval = 10;
|
||||
|
||||
// Easing functions
|
||||
|
||||
_this.easing_functions =
|
||||
{
|
||||
'linear' : function( x )
|
||||
{
|
||||
return x;
|
||||
},
|
||||
|
||||
'easeout' : function( x )
|
||||
{
|
||||
return x * x * x;
|
||||
},
|
||||
|
||||
'easein' : function( x )
|
||||
{
|
||||
x = 1 - x;
|
||||
return 1 - ( x * x * x );
|
||||
},
|
||||
|
||||
'easeinout' : function( x )
|
||||
{
|
||||
if( x < 0.5 )
|
||||
{
|
||||
return ( 4 * x * x * x );
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 1 - x;
|
||||
return 1 - ( 4 * x * x * x ) ;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Document events to bind initialisation to
|
||||
|
||||
_this.init_events =
|
||||
[
|
||||
'ready',
|
||||
'page:load', // Turbolinks
|
||||
'page:change' // Turbolinks
|
||||
];
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Initialisation conditions
|
||||
|
||||
_this.init_if = function() { return true; }
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Initialisation
|
||||
|
||||
_this.init = function()
|
||||
{
|
||||
// Cancel if initialisation conditions not met
|
||||
|
||||
if( !_this.init_if() ) return false;
|
||||
|
||||
// Load all elements to animate
|
||||
|
||||
_this.init_elements();
|
||||
|
||||
// Get element & viewport sizes
|
||||
|
||||
_this.on_resize();
|
||||
|
||||
// Recalculate heights & positions on resize and rotate
|
||||
|
||||
$window.on( 'resize orientationchange' , function(){ _this.on_resize(); } );
|
||||
|
||||
// Recalculate heights & positions when page is fully loaded + a bit just in case
|
||||
|
||||
$window.load( function(){ setTimeout( function(){ _this.on_resize(); } , 100 ) });
|
||||
|
||||
// Start animating
|
||||
|
||||
setInterval( _this.update , _this.update_interval );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Get list and pre-load animated elements
|
||||
|
||||
_this.init_elements = function()
|
||||
{
|
||||
// For each reference element
|
||||
|
||||
$( _this.scrollme_selector ).each( function()
|
||||
{
|
||||
var element = {};
|
||||
|
||||
element.element = $( this );
|
||||
|
||||
var effects = [];
|
||||
|
||||
// For each animated element
|
||||
|
||||
$( this ).find( _this.animateme_selector ).addBack( _this.animateme_selector ).each( function()
|
||||
{
|
||||
// Get effect details
|
||||
|
||||
var effect = {};
|
||||
|
||||
effect.element = $( this );
|
||||
|
||||
effect.when = effect.element.data( 'when' );
|
||||
effect.from = effect.element.data( 'from' );
|
||||
effect.to = effect.element.data( 'to' );
|
||||
|
||||
if( effect.element.is( '[data-crop]' ) )
|
||||
{
|
||||
effect.crop = effect.element.data( 'crop' );
|
||||
}
|
||||
else
|
||||
{
|
||||
effect.crop = true;
|
||||
}
|
||||
|
||||
if( effect.element.is( '[data-easing]' ) )
|
||||
{
|
||||
effect.easing = _this.easing_functions[ effect.element.data( 'easing' ) ]
|
||||
}
|
||||
else
|
||||
{
|
||||
effect.easing = _this.easing_functions[ 'easeout' ];
|
||||
}
|
||||
|
||||
// Get animated properties
|
||||
|
||||
var properties = {};
|
||||
|
||||
if( effect.element.is( '[data-opacity]' ) ) properties.opacity = effect.element.data( 'opacity' );
|
||||
if( effect.element.is( '[data-translatex]' ) ) properties.translatex = effect.element.data( 'translatex' );
|
||||
if( effect.element.is( '[data-translatey]' ) ) properties.translatey = effect.element.data( 'translatey' );
|
||||
if( effect.element.is( '[data-translatez]' ) ) properties.translatez = effect.element.data( 'translatez' );
|
||||
if( effect.element.is( '[data-rotatex]' ) ) properties.rotatex = effect.element.data( 'rotatex' );
|
||||
if( effect.element.is( '[data-rotatey]' ) ) properties.rotatey = effect.element.data( 'rotatey' );
|
||||
if( effect.element.is( '[data-rotatez]' ) ) properties.rotatez = effect.element.data( 'rotatez' );
|
||||
if( effect.element.is( '[data-scale]' ) ) properties.scale = effect.element.data( 'scale' );
|
||||
if( effect.element.is( '[data-scalex]' ) ) properties.scalex = effect.element.data( 'scalex' );
|
||||
if( effect.element.is( '[data-scaley]' ) ) properties.scaley = effect.element.data( 'scaley' );
|
||||
if( effect.element.is( '[data-scalez]' ) ) properties.scalez = effect.element.data( 'scalez' );
|
||||
|
||||
effect.properties = properties;
|
||||
|
||||
effects.push( effect );
|
||||
});
|
||||
|
||||
element.effects = effects;
|
||||
|
||||
_this.elements.push( element );
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Update elements
|
||||
|
||||
_this.update = function()
|
||||
{
|
||||
window.requestAnimationFrame( function()
|
||||
{
|
||||
_this.update_viewport_position();
|
||||
|
||||
if( _this.viewport_top_previous != _this.viewport_top )
|
||||
{
|
||||
_this.update_elements_in_view();
|
||||
_this.animate();
|
||||
}
|
||||
|
||||
_this.viewport_top_previous = _this.viewport_top;
|
||||
});
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Animate stuff
|
||||
|
||||
_this.animate = function()
|
||||
{
|
||||
// For each element in viewport
|
||||
|
||||
var elements_in_view_length = _this.elements_in_view.length;
|
||||
|
||||
for( var i=0 ; i<elements_in_view_length ; i++ )
|
||||
{
|
||||
var element = _this.elements_in_view[i];
|
||||
|
||||
// For each effect
|
||||
|
||||
var effects_length = element.effects.length;
|
||||
|
||||
for( var e=0 ; e<effects_length ; e++ )
|
||||
{
|
||||
var effect = element.effects[e];
|
||||
|
||||
// Get effect animation boundaries
|
||||
|
||||
switch( effect.when )
|
||||
{
|
||||
case 'view' : // Maintained for backwards compatibility
|
||||
case 'span' :
|
||||
var start = element.top - _this.viewport_height;
|
||||
var end = element.bottom;
|
||||
break;
|
||||
|
||||
case 'exit' :
|
||||
var start = element.bottom - _this.viewport_height;
|
||||
var end = element.bottom;
|
||||
break;
|
||||
|
||||
default :
|
||||
var start = element.top - _this.viewport_height;
|
||||
var end = element.top;
|
||||
break;
|
||||
}
|
||||
|
||||
// Crop boundaries
|
||||
|
||||
if( effect.crop )
|
||||
{
|
||||
if( start < 0 ) start = 0;
|
||||
if( end > ( _this.body_height - _this.viewport_height ) ) end = _this.body_height - _this.viewport_height;
|
||||
}
|
||||
|
||||
// Get scroll position of reference selector
|
||||
|
||||
var scroll = ( _this.viewport_top - start ) / ( end - start );
|
||||
|
||||
// Get relative scroll position for effect
|
||||
|
||||
var from = effect[ 'from' ];
|
||||
var to = effect[ 'to' ];
|
||||
|
||||
var length = to - from;
|
||||
|
||||
var scroll_relative = ( scroll - from ) / length;
|
||||
|
||||
// Apply easing
|
||||
|
||||
var scroll_eased = effect.easing( scroll_relative );
|
||||
|
||||
// Get new value for each property
|
||||
|
||||
var opacity = _this.animate_value( scroll , scroll_eased , from , to , effect , 'opacity' );
|
||||
var translatey = _this.animate_value( scroll , scroll_eased , from , to , effect , 'translatey' );
|
||||
var translatex = _this.animate_value( scroll , scroll_eased , from , to , effect , 'translatex' );
|
||||
var translatez = _this.animate_value( scroll , scroll_eased , from , to , effect , 'translatez' );
|
||||
var rotatex = _this.animate_value( scroll , scroll_eased , from , to , effect , 'rotatex' );
|
||||
var rotatey = _this.animate_value( scroll , scroll_eased , from , to , effect , 'rotatey' );
|
||||
var rotatez = _this.animate_value( scroll , scroll_eased , from , to , effect , 'rotatez' );
|
||||
var scale = _this.animate_value( scroll , scroll_eased , from , to , effect , 'scale' );
|
||||
var scalex = _this.animate_value( scroll , scroll_eased , from , to , effect , 'scalex' );
|
||||
var scaley = _this.animate_value( scroll , scroll_eased , from , to , effect , 'scaley' );
|
||||
var scalez = _this.animate_value( scroll , scroll_eased , from , to , effect , 'scalez' );
|
||||
|
||||
// Override scale values
|
||||
|
||||
if( 'scale' in effect.properties )
|
||||
{
|
||||
scalex = scale;
|
||||
scaley = scale;
|
||||
scalez = scale;
|
||||
}
|
||||
|
||||
// Update properties
|
||||
|
||||
effect.element.css(
|
||||
{
|
||||
'opacity' : opacity,
|
||||
'transform' : 'translate3d( '+translatex+'px , '+translatey+'px , '+translatez+'px ) rotateX( '+rotatex+'deg ) rotateY( '+rotatey+'deg ) rotateZ( '+rotatez+'deg ) scale3d( '+scalex+' , '+scaley+' , '+scalez+' )'
|
||||
} );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Calculate property values
|
||||
|
||||
_this.animate_value = function( scroll , scroll_eased , from , to , effect , property )
|
||||
{
|
||||
var value_default = _this.property_defaults[ property ];
|
||||
|
||||
// Return default value if property is not animated
|
||||
|
||||
if( !( property in effect.properties ) ) return value_default;
|
||||
|
||||
var value_target = effect.properties[ property ];
|
||||
|
||||
var forwards = ( to > from ) ? true : false;
|
||||
|
||||
// Return boundary value if outside effect boundaries
|
||||
|
||||
if( scroll < from && forwards ) { return value_default; }
|
||||
if( scroll > to && forwards ) { return value_target; }
|
||||
|
||||
if( scroll > from && !forwards ) { return value_default; }
|
||||
if( scroll < to && !forwards ) { return value_target; }
|
||||
|
||||
// Calculate new property value
|
||||
|
||||
var new_value = value_default + ( scroll_eased * ( value_target - value_default ) );
|
||||
|
||||
// Round as required
|
||||
|
||||
switch( property )
|
||||
{
|
||||
case 'opacity' : new_value = new_value.toFixed(2); break;
|
||||
case 'translatex' : new_value = new_value.toFixed(0); break;
|
||||
case 'translatey' : new_value = new_value.toFixed(0); break;
|
||||
case 'translatez' : new_value = new_value.toFixed(0); break;
|
||||
case 'rotatex' : new_value = new_value.toFixed(1); break;
|
||||
case 'rotatey' : new_value = new_value.toFixed(1); break;
|
||||
case 'rotatez' : new_value = new_value.toFixed(1); break;
|
||||
case 'scale' : new_value = new_value.toFixed(3); break;
|
||||
default : break;
|
||||
}
|
||||
|
||||
// Done
|
||||
|
||||
return new_value;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Update viewport position
|
||||
|
||||
_this.update_viewport_position = function()
|
||||
{
|
||||
_this.viewport_top = $window.scrollTop();
|
||||
_this.viewport_bottom = _this.viewport_top + _this.viewport_height;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Update list of elements in view
|
||||
|
||||
_this.update_elements_in_view = function()
|
||||
{
|
||||
_this.elements_in_view = [];
|
||||
|
||||
var elements_length = _this.elements.length;
|
||||
|
||||
for( var i=0 ; i<elements_length ; i++ )
|
||||
{
|
||||
if ( ( _this.elements[i].top < _this.viewport_bottom ) && ( _this.elements[i].bottom > _this.viewport_top ) )
|
||||
{
|
||||
_this.elements_in_view.push( _this.elements[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Stuff to do on resize
|
||||
|
||||
_this.on_resize = function()
|
||||
{
|
||||
// Update viewport/element data
|
||||
|
||||
_this.update_viewport();
|
||||
_this.update_element_heights();
|
||||
|
||||
// Update display
|
||||
|
||||
_this.update_viewport_position();
|
||||
_this.update_elements_in_view();
|
||||
_this.animate();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Update viewport parameters
|
||||
|
||||
_this.update_viewport = function()
|
||||
{
|
||||
_this.body_height = $document.height();
|
||||
_this.viewport_height = $window.height();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Update height of animated elements
|
||||
|
||||
_this.update_element_heights = function()
|
||||
{
|
||||
var elements_length = _this.elements.length;
|
||||
|
||||
for( var i=0 ; i<elements_length ; i++ )
|
||||
{
|
||||
var element_height = _this.elements[i].element.outerHeight();
|
||||
var position = _this.elements[i].element.offset();
|
||||
|
||||
_this.elements[i].height = element_height;
|
||||
_this.elements[i].top = position.top;
|
||||
_this.elements[i].bottom = position.top + element_height;
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
// Bind initialisation
|
||||
|
||||
$document.on( _this.init_events.join( ' ' ) , function(){ _this.init(); } );
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
|
||||
return _this;
|
||||
|
||||
// ----------------------------------------------------------------------------------------------------
|
||||
|
||||
})( jQuery );
|
||||
226
Static/script/jQuery/jquery.sticky.js
Normal file
226
Static/script/jQuery/jquery.sticky.js
Normal file
@@ -0,0 +1,226 @@
|
||||
// Sticky Plugin v1.0.3 for jQuery
|
||||
// =============
|
||||
// Author: Anthony Garand
|
||||
// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk)
|
||||
// Improvements by Leonardo C. Daronco (daronco)
|
||||
// Created: 02/14/2011
|
||||
// Date: 07/20/2015
|
||||
// Website: http://stickyjs.com/
|
||||
// Description: Makes an element on the page stick on the screen as you scroll
|
||||
// It will only set the 'top' and 'position' of your element, you
|
||||
// might need to adjust the width in some cases.
|
||||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
// Node/CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
var slice = Array.prototype.slice; // save ref to original slice()
|
||||
var splice = Array.prototype.splice; // save ref to original slice()
|
||||
|
||||
var defaults = {
|
||||
topSpacing: 0,
|
||||
bottomSpacing: 0,
|
||||
className: 'is-sticky',
|
||||
wrapperClassName: 'sticky-wrapper',
|
||||
center: false,
|
||||
getWidthFrom: '',
|
||||
widthFromWrapper: true, // works only when .getWidthFrom is empty
|
||||
responsiveWidth: false
|
||||
},
|
||||
$window = $(window),
|
||||
$document = $(document),
|
||||
sticked = [],
|
||||
windowHeight = $window.height(),
|
||||
scroller = function() {
|
||||
var scrollTop = $window.scrollTop(),
|
||||
documentHeight = $document.height(),
|
||||
dwh = documentHeight - windowHeight,
|
||||
extra = (scrollTop > dwh) ? dwh - scrollTop : 0;
|
||||
|
||||
for (var i = 0, l = sticked.length; i < l; i++) {
|
||||
var s = sticked[i],
|
||||
elementTop = s.stickyWrapper.offset().top,
|
||||
etse = elementTop - s.topSpacing - extra;
|
||||
|
||||
//update height in case of dynamic content
|
||||
s.stickyWrapper.css('height', s.stickyElement.outerHeight());
|
||||
|
||||
if (scrollTop <= etse) {
|
||||
if (s.currentTop !== null) {
|
||||
s.stickyElement
|
||||
.css({
|
||||
'width': '',
|
||||
'position': '',
|
||||
'top': ''
|
||||
});
|
||||
s.stickyElement.parent().removeClass(s.className);
|
||||
s.stickyElement.trigger('sticky-end', [s]);
|
||||
s.currentTop = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
var newTop = documentHeight - s.stickyElement.outerHeight()
|
||||
- s.topSpacing - s.bottomSpacing - scrollTop - extra;
|
||||
if (newTop < 0) {
|
||||
newTop = newTop + s.topSpacing;
|
||||
} else {
|
||||
newTop = s.topSpacing;
|
||||
}
|
||||
if (s.currentTop !== newTop) {
|
||||
var newWidth;
|
||||
if (s.getWidthFrom) {
|
||||
newWidth = $(s.getWidthFrom).width() || null;
|
||||
} else if (s.widthFromWrapper) {
|
||||
newWidth = s.stickyWrapper.width();
|
||||
}
|
||||
if (newWidth == null) {
|
||||
newWidth = s.stickyElement.width();
|
||||
}
|
||||
s.stickyElement
|
||||
.css('width', newWidth)
|
||||
.css('position', 'fixed')
|
||||
.css('top', newTop);
|
||||
|
||||
s.stickyElement.parent().addClass(s.className);
|
||||
|
||||
if (s.currentTop === null) {
|
||||
s.stickyElement.trigger('sticky-start', [s]);
|
||||
} else {
|
||||
// sticky is started but it have to be repositioned
|
||||
s.stickyElement.trigger('sticky-update', [s]);
|
||||
}
|
||||
|
||||
if (s.currentTop === s.topSpacing && s.currentTop > newTop || s.currentTop === null && newTop < s.topSpacing) {
|
||||
// just reached bottom || just started to stick but bottom is already reached
|
||||
s.stickyElement.trigger('sticky-bottom-reached', [s]);
|
||||
} else if(s.currentTop !== null && newTop === s.topSpacing && s.currentTop < newTop) {
|
||||
// sticky is started && sticked at topSpacing && overflowing from top just finished
|
||||
s.stickyElement.trigger('sticky-bottom-unreached', [s]);
|
||||
}
|
||||
|
||||
s.currentTop = newTop;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
resizer = function() {
|
||||
windowHeight = $window.height();
|
||||
|
||||
for (var i = 0, l = sticked.length; i < l; i++) {
|
||||
var s = sticked[i];
|
||||
var newWidth = null;
|
||||
if (s.getWidthFrom) {
|
||||
if (s.responsiveWidth) {
|
||||
newWidth = $(s.getWidthFrom).width();
|
||||
}
|
||||
} else if(s.widthFromWrapper) {
|
||||
newWidth = s.stickyWrapper.width();
|
||||
}
|
||||
if (newWidth != null) {
|
||||
s.stickyElement.css('width', newWidth);
|
||||
}
|
||||
}
|
||||
},
|
||||
methods = {
|
||||
init: function(options) {
|
||||
var o = $.extend({}, defaults, options);
|
||||
return this.each(function() {
|
||||
var stickyElement = $(this);
|
||||
|
||||
var stickyId = stickyElement.attr('id');
|
||||
var stickyHeight = stickyElement.outerHeight();
|
||||
var wrapperId = stickyId ? stickyId + '-' + defaults.wrapperClassName : defaults.wrapperClassName;
|
||||
var wrapper = $('<div></div>')
|
||||
.attr('id', wrapperId)
|
||||
.addClass(o.wrapperClassName);
|
||||
|
||||
stickyElement.wrapAll(wrapper);
|
||||
|
||||
var stickyWrapper = stickyElement.parent();
|
||||
|
||||
if (o.center) {
|
||||
stickyWrapper.css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"});
|
||||
}
|
||||
|
||||
if (stickyElement.css("float") === "right") {
|
||||
stickyElement.css({"float":"none"}).parent().css({"float":"right"});
|
||||
}
|
||||
|
||||
stickyWrapper.css('height', stickyHeight);
|
||||
|
||||
o.stickyElement = stickyElement;
|
||||
o.stickyWrapper = stickyWrapper;
|
||||
o.currentTop = null;
|
||||
|
||||
sticked.push(o);
|
||||
});
|
||||
},
|
||||
update: scroller,
|
||||
unstick: function(options) {
|
||||
return this.each(function() {
|
||||
var that = this;
|
||||
var unstickyElement = $(that);
|
||||
|
||||
var removeIdx = -1;
|
||||
var i = sticked.length;
|
||||
while (i-- > 0) {
|
||||
if (sticked[i].stickyElement.get(0) === that) {
|
||||
splice.call(sticked,i,1);
|
||||
removeIdx = i;
|
||||
}
|
||||
}
|
||||
if(removeIdx !== -1) {
|
||||
unstickyElement.unwrap();
|
||||
unstickyElement
|
||||
.css({
|
||||
'width': '',
|
||||
'position': '',
|
||||
'top': '',
|
||||
'float': ''
|
||||
})
|
||||
;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
// should be more efficient than using $window.scroll(scroller) and $window.resize(resizer):
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('scroll', scroller, false);
|
||||
window.addEventListener('resize', resizer, false);
|
||||
} else if (window.attachEvent) {
|
||||
window.attachEvent('onscroll', scroller);
|
||||
window.attachEvent('onresize', resizer);
|
||||
}
|
||||
|
||||
$.fn.sticky = function(method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method ) {
|
||||
return methods.init.apply( this, arguments );
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.sticky');
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.unstick = function(method) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, slice.call(arguments, 1));
|
||||
} else if (typeof method === 'object' || !method ) {
|
||||
return methods.unstick.apply( this, arguments );
|
||||
} else {
|
||||
$.error('Method ' + method + ' does not exist on jQuery.sticky');
|
||||
}
|
||||
};
|
||||
$(function() {
|
||||
setTimeout(scroller, 0);
|
||||
});
|
||||
}));
|
||||
3
Static/script/jQuery/jquery.swfobject.1-1-1.min.js
vendored
Normal file
3
Static/script/jQuery/jquery.swfobject.1-1-1.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// jQuery SWFObject v1.1.1 MIT/GPL @jon_neal
|
||||
// http://jquery.thewikies.com/swfobject
|
||||
(function(f,h,i){function k(a,c){var b=(a[0]||0)-(c[0]||0);return b>0||!b&&a.length>0&&k(a.slice(1),c.slice(1))}function l(a){if(typeof a!=g)return a;var c=[],b="";for(var d in a){b=typeof a[d]==g?l(a[d]):[d,m?encodeURI(a[d]):a[d]].join("=");c.push(b)}return c.join("&")}function n(a){var c=[];for(var b in a)a[b]&&c.push([b,'="',a[b],'"'].join(""));return c.join(" ")}function o(a){var c=[];for(var b in a)c.push(['<param name="',b,'" value="',l(a[b]),'" />'].join(""));return c.join("")}var g="object",m=true;try{var j=i.description||function(){return(new i("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")}()}catch(p){j="Unavailable"}var e=j.match(/\d+/g)||[0];f[h]={available:e[0]>0,activeX:i&&!i.name,version:{original:j,array:e,string:e.join("."),major:parseInt(e[0],10)||0,minor:parseInt(e[1],10)||0,release:parseInt(e[2],10)||0},hasVersion:function(a){a=/string|number/.test(typeof a)?a.toString().split("."):/object/.test(typeof a)?[a.major,a.minor]:a||[0,0];return k(e,a)},encodeParams:true,expressInstall:"expressInstall.swf",expressInstallIsActive:false,create:function(a){if(!a.swf||this.expressInstallIsActive||!this.available&&!a.hasVersionFail)return false;if(!this.hasVersion(a.hasVersion||1)){this.expressInstallIsActive=true;if(typeof a.hasVersionFail=="function")if(!a.hasVersionFail.apply(a))return false;a={swf:a.expressInstall||this.expressInstall,height:137,width:214,flashvars:{MMredirectURL:location.href,MMplayerType:this.activeX?"ActiveX":"PlugIn",MMdoctitle:document.title.slice(0,47)+" - Flash Player Installation"}}}attrs={data:a.swf,type:"application/x-shockwave-flash",id:a.id||"flash_"+Math.floor(Math.random()*999999999),width:a.width||320,height:a.height||180,style:a.style||""};m=typeof a.useEncode!=="undefined"?a.useEncode:this.encodeParams;a.movie=a.swf;a.wmode=a.wmode||"opaque";delete a.fallback;delete a.hasVersion;delete a.hasVersionFail;delete a.height;delete a.id;delete a.swf;delete a.useEncode;delete a.width;var c=document.createElement("div");c.innerHTML=["<object ",n(attrs),">",o(a),"</object>"].join("");return c.firstChild}};f.fn[h]=function(a){var c=this.find(g).andSelf().filter(g);/string|object/.test(typeof a)&&this.each(function(){var b=f(this),d;a=typeof a==g?a:{swf:a};a.fallback=this;if(d=f[h].create(a)){b.children().remove();b.html(d)}});typeof a=="function"&&c.each(function(){var b=this;b.jsInteractionTimeoutMs=b.jsInteractionTimeoutMs||0;if(b.jsInteractionTimeoutMs<660)b.clientWidth||b.clientHeight?a.call(b):setTimeout(function(){f(b)[h](a)},b.jsInteractionTimeoutMs+66)});return c}})(jQuery,"flash",navigator.plugins["Shockwave Flash"]||window.ActiveXObject);
|
||||
950
Static/script/jQuery/jquery.swipebox.js
Normal file
950
Static/script/jQuery/jquery.swipebox.js
Normal file
@@ -0,0 +1,950 @@
|
||||
/*! Swipebox v1.4.1 | Constantin Saguin csag.co | MIT License | github.com/brutaldesign/swipebox */
|
||||
|
||||
;( function ( window, document, $, undefined ) {
|
||||
|
||||
$.swipebox = function( elem, options ) {
|
||||
|
||||
// Default options
|
||||
var ui,
|
||||
defaults = {
|
||||
useCSS : true,
|
||||
useSVG : true,
|
||||
initialIndexOnArray : 0,
|
||||
removeBarsOnMobile : true,
|
||||
hideCloseButtonOnMobile : false,
|
||||
hideBarsDelay : 3000,
|
||||
videoMaxWidth : 1140,
|
||||
vimeoColor : 'cccccc',
|
||||
beforeOpen: null,
|
||||
afterOpen: null,
|
||||
afterClose: null,
|
||||
nextSlide: null,
|
||||
prevSlide: null,
|
||||
loopAtEnd: false,
|
||||
autoplayVideos: false,
|
||||
queryStringData: {},
|
||||
toggleClassOnLoad: ''
|
||||
},
|
||||
|
||||
plugin = this,
|
||||
elements = [], // slides array [ { href:'...', title:'...' }, ...],
|
||||
$elem,
|
||||
selector = elem.selector,
|
||||
$selector = $( selector ),
|
||||
isMobile = navigator.userAgent.match( /(iPad)|(iPhone)|(iPod)|(Android)|(PlayBook)|(BB10)|(BlackBerry)|(Opera Mini)|(IEMobile)|(webOS)|(MeeGo)/i ),
|
||||
isTouch = isMobile !== null || document.createTouch !== undefined || ( 'ontouchstart' in window ) || ( 'onmsgesturechange' in window ) || navigator.msMaxTouchPoints,
|
||||
supportSVG = !! document.createElementNS && !! document.createElementNS( 'http://www.w3.org/2000/svg', 'svg').createSVGRect,
|
||||
winWidth = window.innerWidth ? window.innerWidth : $( window ).width(),
|
||||
winHeight = window.innerHeight ? window.innerHeight : $( window ).height(),
|
||||
currentX = 0,
|
||||
/* jshint multistr: true */
|
||||
html = '<div id="swipebox-overlay">\
|
||||
<div id="swipebox-container">\
|
||||
<div id="swipebox-slider"></div>\
|
||||
<div id="swipebox-top-bar">\
|
||||
<div id="swipebox-title"></div>\
|
||||
</div>\
|
||||
<div id="swipebox-bottom-bar">\
|
||||
<div id="swipebox-arrows">\
|
||||
<a id="swipebox-prev"></a>\
|
||||
<a id="swipebox-next"></a>\
|
||||
</div>\
|
||||
</div>\
|
||||
<a id="swipebox-close"></a>\
|
||||
</div>\
|
||||
</div>';
|
||||
|
||||
plugin.settings = {};
|
||||
|
||||
$.swipebox.close = function () {
|
||||
ui.closeSlide();
|
||||
};
|
||||
|
||||
$.swipebox.extend = function () {
|
||||
return ui;
|
||||
};
|
||||
|
||||
plugin.init = function() {
|
||||
|
||||
plugin.settings = $.extend( {}, defaults, options );
|
||||
|
||||
if ( $.isArray( elem ) ) {
|
||||
|
||||
elements = elem;
|
||||
ui.target = $( window );
|
||||
ui.init( plugin.settings.initialIndexOnArray );
|
||||
|
||||
} else {
|
||||
|
||||
$( document ).on( 'click', selector, function( event ) {
|
||||
|
||||
// console.log( isTouch );
|
||||
|
||||
if ( event.target.parentNode.className === 'slide current' ) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $.isArray( elem ) ) {
|
||||
ui.destroy();
|
||||
$elem = $( selector );
|
||||
ui.actions();
|
||||
}
|
||||
|
||||
elements = [];
|
||||
var index , relType, relVal;
|
||||
|
||||
// Allow for HTML5 compliant attribute before legacy use of rel
|
||||
if ( ! relVal ) {
|
||||
relType = 'data-rel';
|
||||
relVal = $( this ).attr( relType );
|
||||
}
|
||||
|
||||
if ( ! relVal ) {
|
||||
relType = 'rel';
|
||||
relVal = $( this ).attr( relType );
|
||||
}
|
||||
|
||||
if ( relVal && relVal !== '' && relVal !== 'nofollow' ) {
|
||||
$elem = $selector.filter( '[' + relType + '="' + relVal + '"]' );
|
||||
} else {
|
||||
$elem = $( selector );
|
||||
}
|
||||
|
||||
$elem.each( function() {
|
||||
|
||||
var title = null,
|
||||
href = null;
|
||||
|
||||
if ( $( this ).attr( 'title' ) ) {
|
||||
title = $( this ).attr( 'title' );
|
||||
}
|
||||
|
||||
|
||||
if ( $( this ).attr( 'href' ) ) {
|
||||
href = $( this ).attr( 'href' );
|
||||
}
|
||||
|
||||
elements.push( {
|
||||
href: href,
|
||||
title: title
|
||||
} );
|
||||
} );
|
||||
|
||||
index = $elem.index( $( this ) );
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
ui.target = $( event.target );
|
||||
ui.init( index );
|
||||
} );
|
||||
}
|
||||
};
|
||||
|
||||
ui = {
|
||||
|
||||
/**
|
||||
* Initiate Swipebox
|
||||
*/
|
||||
init : function( index ) {
|
||||
if ( plugin.settings.beforeOpen ) {
|
||||
plugin.settings.beforeOpen();
|
||||
}
|
||||
this.target.trigger( 'swipebox-start' );
|
||||
$.swipebox.isOpen = true;
|
||||
this.build();
|
||||
this.openSlide( index );
|
||||
this.openMedia( index );
|
||||
this.preloadMedia( index+1 );
|
||||
this.preloadMedia( index-1 );
|
||||
if ( plugin.settings.afterOpen ) {
|
||||
plugin.settings.afterOpen();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Built HTML containers and fire main functions
|
||||
*/
|
||||
build : function () {
|
||||
var $this = this, bg;
|
||||
|
||||
$( 'body' ).append( html );
|
||||
|
||||
if ( supportSVG && plugin.settings.useSVG === true ) {
|
||||
bg = $( '#swipebox-close' ).css( 'background-image' );
|
||||
bg = bg.replace( 'png', 'svg' );
|
||||
$( '#swipebox-prev, #swipebox-next, #swipebox-close' ).css( {
|
||||
'background-image' : bg
|
||||
} );
|
||||
}
|
||||
|
||||
if ( isMobile && plugin.settings.removeBarsOnMobile ) {
|
||||
$( '#swipebox-bottom-bar, #swipebox-top-bar' ).remove();
|
||||
}
|
||||
|
||||
$.each( elements, function() {
|
||||
$( '#swipebox-slider' ).append( '<div class="slide"></div>' );
|
||||
} );
|
||||
|
||||
$this.setDim();
|
||||
$this.actions();
|
||||
|
||||
if ( isTouch ) {
|
||||
$this.gesture();
|
||||
}
|
||||
|
||||
// Devices can have both touch and keyboard input so always allow key events
|
||||
$this.keyboard();
|
||||
|
||||
$this.animBars();
|
||||
$this.resize();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Set dimensions depending on windows width and height
|
||||
*/
|
||||
setDim : function () {
|
||||
|
||||
var width, height, sliderCss = {};
|
||||
|
||||
// Reset dimensions on mobile orientation change
|
||||
if ( 'onorientationchange' in window ) {
|
||||
|
||||
window.addEventListener( 'orientationchange', function() {
|
||||
if ( window.orientation === 0 ) {
|
||||
width = winWidth;
|
||||
height = winHeight;
|
||||
} else if ( window.orientation === 90 || window.orientation === -90 ) {
|
||||
width = winHeight;
|
||||
height = winWidth;
|
||||
}
|
||||
}, false );
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
width = window.innerWidth ? window.innerWidth : $( window ).width();
|
||||
height = window.innerHeight ? window.innerHeight : $( window ).height();
|
||||
}
|
||||
|
||||
sliderCss = {
|
||||
width : width,
|
||||
height : height
|
||||
};
|
||||
|
||||
$( '#swipebox-overlay' ).css( sliderCss );
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Reset dimensions on window resize envent
|
||||
*/
|
||||
resize : function () {
|
||||
var $this = this;
|
||||
|
||||
$( window ).resize( function() {
|
||||
$this.setDim();
|
||||
} ).resize();
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if device supports CSS transitions
|
||||
*/
|
||||
supportTransition : function () {
|
||||
|
||||
var prefixes = 'transition WebkitTransition MozTransition OTransition msTransition KhtmlTransition'.split( ' ' ),
|
||||
i;
|
||||
|
||||
for ( i = 0; i < prefixes.length; i++ ) {
|
||||
if ( document.createElement( 'div' ).style[ prefixes[i] ] !== undefined ) {
|
||||
return prefixes[i];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if CSS transitions are allowed (options + devicesupport)
|
||||
*/
|
||||
doCssTrans : function () {
|
||||
if ( plugin.settings.useCSS && this.supportTransition() ) {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Touch navigation
|
||||
*/
|
||||
gesture : function () {
|
||||
|
||||
var $this = this,
|
||||
index,
|
||||
hDistance,
|
||||
vDistance,
|
||||
hDistanceLast,
|
||||
vDistanceLast,
|
||||
hDistancePercent,
|
||||
vSwipe = false,
|
||||
hSwipe = false,
|
||||
hSwipMinDistance = 10,
|
||||
vSwipMinDistance = 50,
|
||||
startCoords = {},
|
||||
endCoords = {},
|
||||
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' ),
|
||||
slider = $( '#swipebox-slider' );
|
||||
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
|
||||
$( 'body' ).bind( 'touchstart', function( event ) {
|
||||
|
||||
$( this ).addClass( 'touching' );
|
||||
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
|
||||
endCoords = event.originalEvent.targetTouches[0];
|
||||
startCoords.pageX = event.originalEvent.targetTouches[0].pageX;
|
||||
startCoords.pageY = event.originalEvent.targetTouches[0].pageY;
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + currentX +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
|
||||
} );
|
||||
|
||||
$( '.touching' ).bind( 'touchmove',function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
endCoords = event.originalEvent.targetTouches[0];
|
||||
|
||||
if ( ! hSwipe ) {
|
||||
vDistanceLast = vDistance;
|
||||
vDistance = endCoords.pageY - startCoords.pageY;
|
||||
if ( Math.abs( vDistance ) >= vSwipMinDistance || vSwipe ) {
|
||||
var opacity = 0.75 - Math.abs(vDistance) / slider.height();
|
||||
|
||||
slider.css( { 'top': vDistance + 'px' } );
|
||||
slider.css( { 'opacity': opacity } );
|
||||
|
||||
vSwipe = true;
|
||||
}
|
||||
}
|
||||
|
||||
hDistanceLast = hDistance;
|
||||
hDistance = endCoords.pageX - startCoords.pageX;
|
||||
hDistancePercent = hDistance * 100 / winWidth;
|
||||
|
||||
if ( ! hSwipe && ! vSwipe && Math.abs( hDistance ) >= hSwipMinDistance ) {
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transition' : '',
|
||||
'transition' : ''
|
||||
} );
|
||||
hSwipe = true;
|
||||
}
|
||||
|
||||
if ( hSwipe ) {
|
||||
|
||||
// swipe left
|
||||
if ( 0 < hDistance ) {
|
||||
|
||||
// first slide
|
||||
if ( 0 === index ) {
|
||||
// console.log( 'first' );
|
||||
$( '#swipebox-overlay' ).addClass( 'leftSpringTouch' );
|
||||
} else {
|
||||
// Follow gesture
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
|
||||
} );
|
||||
}
|
||||
|
||||
// swipe rught
|
||||
} else if ( 0 > hDistance ) {
|
||||
|
||||
// last Slide
|
||||
if ( elements.length === index +1 ) {
|
||||
// console.log( 'last' );
|
||||
$( '#swipebox-overlay' ).addClass( 'rightSpringTouch' );
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + ( currentX + hDistancePercent ) +'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + ( currentX + hDistancePercent ) + '%, 0, 0)'
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
return false;
|
||||
|
||||
} ).bind( 'touchend',function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transition' : '-webkit-transform 0.4s ease',
|
||||
'transition' : 'transform 0.4s ease'
|
||||
} );
|
||||
|
||||
vDistance = endCoords.pageY - startCoords.pageY;
|
||||
hDistance = endCoords.pageX - startCoords.pageX;
|
||||
hDistancePercent = hDistance*100/winWidth;
|
||||
|
||||
// Swipe to bottom to close
|
||||
if ( vSwipe ) {
|
||||
vSwipe = false;
|
||||
if ( Math.abs( vDistance ) >= 2 * vSwipMinDistance && Math.abs( vDistance ) > Math.abs( vDistanceLast ) ) {
|
||||
var vOffset = vDistance > 0 ? slider.height() : - slider.height();
|
||||
slider.animate( { top: vOffset + 'px', 'opacity': 0 },
|
||||
300,
|
||||
function () {
|
||||
$this.closeSlide();
|
||||
} );
|
||||
} else {
|
||||
slider.animate( { top: 0, 'opacity': 1 }, 300 );
|
||||
}
|
||||
|
||||
} else if ( hSwipe ) {
|
||||
|
||||
hSwipe = false;
|
||||
|
||||
// swipeLeft
|
||||
if( hDistance >= hSwipMinDistance && hDistance >= hDistanceLast) {
|
||||
|
||||
$this.getPrev();
|
||||
|
||||
// swipeRight
|
||||
} else if ( hDistance <= -hSwipMinDistance && hDistance <= hDistanceLast) {
|
||||
|
||||
$this.getNext();
|
||||
}
|
||||
|
||||
} else { // Top and bottom bars have been removed on touchable devices
|
||||
// tap
|
||||
if ( ! bars.hasClass( 'visible-bars' ) ) {
|
||||
$this.showBars();
|
||||
$this.setTimeout();
|
||||
} else {
|
||||
$this.clearTimeout();
|
||||
$this.hideBars();
|
||||
}
|
||||
}
|
||||
|
||||
$( '#swipebox-slider' ).css( {
|
||||
'-webkit-transform' : 'translate3d(' + currentX + '%, 0, 0)',
|
||||
'transform' : 'translate3d(' + currentX + '%, 0, 0)'
|
||||
} );
|
||||
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpringTouch' ).removeClass( 'rightSpringTouch' );
|
||||
$( '.touching' ).off( 'touchmove' ).removeClass( 'touching' );
|
||||
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set timer to hide the action bars
|
||||
*/
|
||||
setTimeout: function () {
|
||||
if ( plugin.settings.hideBarsDelay > 0 ) {
|
||||
var $this = this;
|
||||
$this.clearTimeout();
|
||||
$this.timeout = window.setTimeout( function() {
|
||||
$this.hideBars();
|
||||
},
|
||||
|
||||
plugin.settings.hideBarsDelay
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear timer
|
||||
*/
|
||||
clearTimeout: function () {
|
||||
window.clearTimeout( this.timeout );
|
||||
this.timeout = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Show navigation and title bars
|
||||
*/
|
||||
showBars : function () {
|
||||
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
if ( this.doCssTrans() ) {
|
||||
bars.addClass( 'visible-bars' );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).animate( { top : 0 }, 500 );
|
||||
$( '#swipebox-bottom-bar' ).animate( { bottom : 0 }, 500 );
|
||||
setTimeout( function() {
|
||||
bars.addClass( 'visible-bars' );
|
||||
}, 1000 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Hide navigation and title bars
|
||||
*/
|
||||
hideBars : function () {
|
||||
var bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
if ( this.doCssTrans() ) {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).animate( { top : '-50px' }, 500 );
|
||||
$( '#swipebox-bottom-bar' ).animate( { bottom : '-50px' }, 500 );
|
||||
setTimeout( function() {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
}, 1000 );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Animate navigation and top bars
|
||||
*/
|
||||
animBars : function () {
|
||||
var $this = this,
|
||||
bars = $( '#swipebox-top-bar, #swipebox-bottom-bar' );
|
||||
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
|
||||
$( '#swipebox-slider' ).click( function() {
|
||||
if ( ! bars.hasClass( 'visible-bars' ) ) {
|
||||
$this.showBars();
|
||||
$this.setTimeout();
|
||||
}
|
||||
} );
|
||||
|
||||
$( '#swipebox-bottom-bar' ).hover( function() {
|
||||
$this.showBars();
|
||||
bars.addClass( 'visible-bars' );
|
||||
$this.clearTimeout();
|
||||
|
||||
}, function() {
|
||||
if ( plugin.settings.hideBarsDelay > 0 ) {
|
||||
bars.removeClass( 'visible-bars' );
|
||||
$this.setTimeout();
|
||||
}
|
||||
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Keyboard navigation
|
||||
*/
|
||||
keyboard : function () {
|
||||
var $this = this;
|
||||
$( window ).bind( 'keyup', function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
if ( event.keyCode === 37 ) {
|
||||
|
||||
$this.getPrev();
|
||||
|
||||
} else if ( event.keyCode === 39 ) {
|
||||
|
||||
$this.getNext();
|
||||
|
||||
} else if ( event.keyCode === 27 ) {
|
||||
|
||||
$this.closeSlide();
|
||||
}
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Navigation events : go to next slide, go to prevous slide and close
|
||||
*/
|
||||
actions : function () {
|
||||
var $this = this,
|
||||
action = 'touchend click'; // Just detect for both event types to allow for multi-input
|
||||
|
||||
if ( elements.length < 2 ) {
|
||||
|
||||
$( '#swipebox-bottom-bar' ).hide();
|
||||
|
||||
if ( undefined === elements[ 1 ] ) {
|
||||
$( '#swipebox-top-bar' ).hide();
|
||||
}
|
||||
|
||||
} else {
|
||||
$( '#swipebox-prev' ).bind( action, function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$this.getPrev();
|
||||
$this.setTimeout();
|
||||
} );
|
||||
|
||||
$( '#swipebox-next' ).bind( action, function( event ) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
$this.getNext();
|
||||
$this.setTimeout();
|
||||
} );
|
||||
}
|
||||
|
||||
$( '#swipebox-close' ).bind( action, function() {
|
||||
$this.closeSlide();
|
||||
} );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set current slide
|
||||
*/
|
||||
setSlide : function ( index, isFirst ) {
|
||||
|
||||
isFirst = isFirst || false;
|
||||
|
||||
var slider = $( '#swipebox-slider' );
|
||||
|
||||
currentX = -index*100;
|
||||
|
||||
if ( this.doCssTrans() ) {
|
||||
slider.css( {
|
||||
'-webkit-transform' : 'translate3d(' + (-index*100)+'%, 0, 0)',
|
||||
'transform' : 'translate3d(' + (-index*100)+'%, 0, 0)'
|
||||
} );
|
||||
} else {
|
||||
slider.animate( { left : ( -index*100 )+'%' } );
|
||||
}
|
||||
|
||||
$( '#swipebox-slider .slide' ).removeClass( 'current' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).addClass( 'current' );
|
||||
this.setTitle( index );
|
||||
|
||||
if ( isFirst ) {
|
||||
slider.fadeIn();
|
||||
}
|
||||
|
||||
$( '#swipebox-prev, #swipebox-next' ).removeClass( 'disabled' );
|
||||
|
||||
if ( index === 0 ) {
|
||||
$( '#swipebox-prev' ).addClass( 'disabled' );
|
||||
} else if ( index === elements.length - 1 && plugin.settings.loopAtEnd !== true ) {
|
||||
$( '#swipebox-next' ).addClass( 'disabled' );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Open slide
|
||||
*/
|
||||
openSlide : function ( index ) {
|
||||
$( 'html' ).addClass( 'swipebox-html' );
|
||||
if ( isTouch ) {
|
||||
$( 'html' ).addClass( 'swipebox-touch' );
|
||||
|
||||
if ( plugin.settings.hideCloseButtonOnMobile ) {
|
||||
$( 'html' ).addClass( 'swipebox-no-close-button' );
|
||||
}
|
||||
} else {
|
||||
$( 'html' ).addClass( 'swipebox-no-touch' );
|
||||
}
|
||||
$( window ).trigger( 'resize' ); // fix scroll bar visibility on desktop
|
||||
this.setSlide( index, true );
|
||||
},
|
||||
|
||||
/**
|
||||
* Set a time out if the media is a video
|
||||
*/
|
||||
preloadMedia : function ( index ) {
|
||||
var $this = this,
|
||||
src = null;
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
src = elements[ index ].href;
|
||||
}
|
||||
|
||||
if ( ! $this.isVideo( src ) ) {
|
||||
setTimeout( function() {
|
||||
$this.openMedia( index );
|
||||
}, 1000);
|
||||
} else {
|
||||
$this.openMedia( index );
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Open
|
||||
*/
|
||||
openMedia : function ( index ) {
|
||||
var $this = this,
|
||||
src,
|
||||
slide;
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
src = elements[ index ].href;
|
||||
}
|
||||
|
||||
if ( index < 0 || index >= elements.length ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
slide = $( '#swipebox-slider .slide' ).eq( index );
|
||||
|
||||
if ( ! $this.isVideo( src ) ) {
|
||||
slide.addClass( 'slide-loading' );
|
||||
$this.loadMedia( src, function() {
|
||||
slide.removeClass( 'slide-loading' );
|
||||
slide.html( this );
|
||||
} );
|
||||
} else {
|
||||
slide.html( $this.getVideo( src ) );
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Set link title attribute as caption
|
||||
*/
|
||||
setTitle : function ( index ) {
|
||||
var title = null;
|
||||
|
||||
$( '#swipebox-title' ).empty();
|
||||
|
||||
if ( elements[ index ] !== undefined ) {
|
||||
title = elements[ index ].title;
|
||||
}
|
||||
|
||||
if ( title ) {
|
||||
$( '#swipebox-top-bar' ).show();
|
||||
$( '#swipebox-title' ).append( title );
|
||||
} else {
|
||||
$( '#swipebox-top-bar' ).hide();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Check if the URL is a video
|
||||
*/
|
||||
isVideo : function ( src ) {
|
||||
|
||||
if ( src ) {
|
||||
if ( src.match( /(youtube\.com|youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/) || src.match( /vimeo\.com\/([0-9]*)/ ) || src.match( /youtu\.be\/([a-zA-Z0-9\-_]+)/ ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ( src.toLowerCase().indexOf( 'swipeboxvideo=1' ) >= 0 ) {
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse URI querystring and:
|
||||
* - overrides value provided via dictionary
|
||||
* - rebuild it again returning a string
|
||||
*/
|
||||
parseUri : function (uri, customData) {
|
||||
var a = document.createElement('a'),
|
||||
qs = {};
|
||||
|
||||
// Decode the URI
|
||||
a.href = decodeURIComponent( uri );
|
||||
|
||||
// QueryString to Object
|
||||
if ( a.search ) {
|
||||
qs = JSON.parse( '{"' + a.search.toLowerCase().replace('?','').replace(/&/g,'","').replace(/=/g,'":"') + '"}' );
|
||||
}
|
||||
|
||||
// Extend with custom data
|
||||
if ( $.isPlainObject( customData ) ) {
|
||||
qs = $.extend( qs, customData, plugin.settings.queryStringData ); // The dev has always the final word
|
||||
}
|
||||
|
||||
// Return querystring as a string
|
||||
return $
|
||||
.map( qs, function (val, key) {
|
||||
if ( val && val > '' ) {
|
||||
return encodeURIComponent( key ) + '=' + encodeURIComponent( val );
|
||||
}
|
||||
})
|
||||
.join('&');
|
||||
},
|
||||
|
||||
/**
|
||||
* Get video iframe code from URL
|
||||
*/
|
||||
getVideo : function( url ) {
|
||||
var iframe = '',
|
||||
youtubeUrl = url.match( /((?:www\.)?youtube\.com|(?:www\.)?youtube-nocookie\.com)\/watch\?v=([a-zA-Z0-9\-_]+)/ ),
|
||||
youtubeShortUrl = url.match(/(?:www\.)?youtu\.be\/([a-zA-Z0-9\-_]+)/),
|
||||
vimeoUrl = url.match( /(?:www\.)?vimeo\.com\/([0-9]*)/ ),
|
||||
qs = '';
|
||||
if ( youtubeUrl || youtubeShortUrl) {
|
||||
if ( youtubeShortUrl ) {
|
||||
youtubeUrl = youtubeShortUrl;
|
||||
}
|
||||
qs = ui.parseUri( url, {
|
||||
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
|
||||
'v' : ''
|
||||
});
|
||||
iframe = '<iframe width="560" height="315" src="//' + youtubeUrl[1] + '/embed/' + youtubeUrl[2] + '?' + qs + '" frameborder="0" allowfullscreen></iframe>';
|
||||
|
||||
} else if ( vimeoUrl ) {
|
||||
qs = ui.parseUri( url, {
|
||||
'autoplay' : ( plugin.settings.autoplayVideos ? '1' : '0' ),
|
||||
'byline' : '0',
|
||||
'portrait' : '0',
|
||||
'color': plugin.settings.vimeoColor
|
||||
});
|
||||
iframe = '<iframe width="560" height="315" src="//player.vimeo.com/video/' + vimeoUrl[1] + '?' + qs + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
|
||||
|
||||
} else {
|
||||
iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>';
|
||||
}
|
||||
|
||||
return '<div class="swipebox-video-container" style="max-width:' + plugin.settings.videoMaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>';
|
||||
},
|
||||
|
||||
/**
|
||||
* Load image
|
||||
*/
|
||||
loadMedia : function ( src, callback ) {
|
||||
// Inline content
|
||||
if ( src.trim().indexOf('#') === 0 ) {
|
||||
callback.call(
|
||||
$('<div>', {
|
||||
'class' : 'swipebox-inline-container'
|
||||
})
|
||||
.append(
|
||||
$(src)
|
||||
.clone()
|
||||
.toggleClass( plugin.settings.toggleClassOnLoad )
|
||||
)
|
||||
);
|
||||
}
|
||||
// Everything else
|
||||
else {
|
||||
if ( ! this.isVideo( src ) ) {
|
||||
var img = $( '<img>' ).on( 'load', function() {
|
||||
callback.call( img );
|
||||
} );
|
||||
|
||||
img.attr( 'src', src );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get next slide
|
||||
*/
|
||||
getNext : function () {
|
||||
var $this = this,
|
||||
src,
|
||||
index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) );
|
||||
if ( index + 1 < elements.length ) {
|
||||
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index++;
|
||||
$this.setSlide( index );
|
||||
$this.preloadMedia( index+1 );
|
||||
if ( plugin.settings.nextSlide ) {
|
||||
plugin.settings.nextSlide();
|
||||
}
|
||||
} else {
|
||||
|
||||
if ( plugin.settings.loopAtEnd === true ) {
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index = 0;
|
||||
$this.preloadMedia( index );
|
||||
$this.setSlide( index );
|
||||
$this.preloadMedia( index + 1 );
|
||||
if ( plugin.settings.nextSlide ) {
|
||||
plugin.settings.nextSlide();
|
||||
}
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).addClass( 'rightSpring' );
|
||||
setTimeout( function() {
|
||||
$( '#swipebox-overlay' ).removeClass( 'rightSpring' );
|
||||
}, 500 );
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get previous slide
|
||||
*/
|
||||
getPrev : function () {
|
||||
var index = $( '#swipebox-slider .slide' ).index( $( '#swipebox-slider .slide.current' ) ),
|
||||
src;
|
||||
if ( index > 0 ) {
|
||||
src = $( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe').attr( 'src' );
|
||||
$( '#swipebox-slider .slide' ).eq( index ).contents().find( 'iframe' ).attr( 'src', src );
|
||||
index--;
|
||||
this.setSlide( index );
|
||||
this.preloadMedia( index-1 );
|
||||
if ( plugin.settings.prevSlide ) {
|
||||
plugin.settings.prevSlide();
|
||||
}
|
||||
} else {
|
||||
$( '#swipebox-overlay' ).addClass( 'leftSpring' );
|
||||
setTimeout( function() {
|
||||
$( '#swipebox-overlay' ).removeClass( 'leftSpring' );
|
||||
}, 500 );
|
||||
}
|
||||
},
|
||||
|
||||
nextSlide : function () {
|
||||
// Callback for next slide
|
||||
},
|
||||
|
||||
prevSlide : function () {
|
||||
// Callback for prev slide
|
||||
},
|
||||
|
||||
/**
|
||||
* Close
|
||||
*/
|
||||
closeSlide : function () {
|
||||
$( 'html' ).removeClass( 'swipebox-html' );
|
||||
$( 'html' ).removeClass( 'swipebox-touch' );
|
||||
$( window ).trigger( 'resize' );
|
||||
this.destroy();
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the whole thing
|
||||
*/
|
||||
destroy : function () {
|
||||
$( window ).unbind( 'keyup' );
|
||||
$( 'body' ).unbind( 'touchstart' );
|
||||
$( 'body' ).unbind( 'touchmove' );
|
||||
$( 'body' ).unbind( 'touchend' );
|
||||
$( '#swipebox-slider' ).unbind();
|
||||
$( '#swipebox-overlay' ).remove();
|
||||
|
||||
if ( ! $.isArray( elem ) ) {
|
||||
elem.removeData( '_swipebox' );
|
||||
}
|
||||
|
||||
if ( this.target ) {
|
||||
this.target.trigger( 'swipebox-destroy' );
|
||||
}
|
||||
|
||||
$.swipebox.isOpen = false;
|
||||
|
||||
if ( plugin.settings.afterClose ) {
|
||||
plugin.settings.afterClose();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
plugin.init();
|
||||
};
|
||||
|
||||
$.fn.swipebox = function( options ) {
|
||||
|
||||
if ( ! $.data( this, '_swipebox' ) ) {
|
||||
var swipebox = new $.swipebox( this, options );
|
||||
this.data( '_swipebox', swipebox );
|
||||
}
|
||||
return this.data( '_swipebox' );
|
||||
|
||||
};
|
||||
|
||||
}( window, document, jQuery ) );
|
||||
75
Static/script/jQuery/jquery.timer.js
Normal file
75
Static/script/jQuery/jquery.timer.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
*
|
||||
* jQuery Timer plugin v0.1
|
||||
* Matt Schmidt [http://www.mattptr.net]
|
||||
*
|
||||
* Licensed under the BSD License:
|
||||
* http://mattptr.net/license/license.txt
|
||||
*
|
||||
*/
|
||||
|
||||
jQuery.timer = function (interval, callback)
|
||||
{
|
||||
/**
|
||||
*
|
||||
* timer() provides a cleaner way to handle intervals
|
||||
*
|
||||
* @usage
|
||||
* $.timer(interval, callback);
|
||||
*
|
||||
*
|
||||
* @example
|
||||
* $.timer(1000, function (timer) {
|
||||
* alert("hello");
|
||||
* timer.stop();
|
||||
* });
|
||||
* @desc Show an alert box after 1 second and stop
|
||||
*
|
||||
* @example
|
||||
* var second = false;
|
||||
* $.timer(1000, function (timer) {
|
||||
* if (!second) {
|
||||
* alert('First time!');
|
||||
* second = true;
|
||||
* timer.reset(3000);
|
||||
* }
|
||||
* else {
|
||||
* alert('Second time');
|
||||
* timer.stop();
|
||||
* }
|
||||
* });
|
||||
* @desc Show an alert box after 1 second and show another after 3 seconds
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
var interval = interval || 100;
|
||||
|
||||
if (!callback)
|
||||
return false;
|
||||
|
||||
_timer = function (interval, callback) {
|
||||
this.stop = function () {
|
||||
clearInterval(self.id);
|
||||
};
|
||||
|
||||
this.internalCallback = function () {
|
||||
callback(self);
|
||||
};
|
||||
|
||||
this.reset = function (val) {
|
||||
if (self.id)
|
||||
clearInterval(self.id);
|
||||
|
||||
var val = val || 100;
|
||||
this.id = setInterval(this.internalCallback, val);
|
||||
};
|
||||
|
||||
this.interval = interval;
|
||||
this.id = setInterval(this.internalCallback, this.interval);
|
||||
|
||||
var self = this;
|
||||
};
|
||||
|
||||
return new _timer(interval, callback);
|
||||
};
|
||||
46
Static/script/jQuery/jquery.tooltip.js
Normal file
46
Static/script/jQuery/jquery.tooltip.js
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Image preview script
|
||||
* powered by jQuery (http://www.jquery.com)
|
||||
*
|
||||
* written by Alen Grakalic (http://cssglobe.com)
|
||||
*
|
||||
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
|
||||
*
|
||||
*/
|
||||
|
||||
this.imagePreview = function(){
|
||||
/* CONFIG */
|
||||
|
||||
xOffset = 10;
|
||||
yOffset = 30;
|
||||
|
||||
// these 2 variable determine popup's distance from the cursor
|
||||
// you might want to adjust to get the right result
|
||||
|
||||
/* END CONFIG */
|
||||
$("a.preview").hover(function(e){
|
||||
this.t = this.title;
|
||||
this.title = "";
|
||||
var c = (this.t != "") ? "<br/>" + this.t : "";
|
||||
$("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - xOffset) + "px")
|
||||
.css("left",(e.pageX + yOffset) + "px")
|
||||
.fadeIn("fast");
|
||||
},
|
||||
function(){
|
||||
this.title = this.t;
|
||||
$("#preview").remove();
|
||||
});
|
||||
$("a.preview").mousemove(function(e){
|
||||
$("#preview")
|
||||
.css("top",(e.pageY - xOffset) + "px")
|
||||
.css("left",(e.pageX + yOffset) + "px");
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
// starting the script on page load
|
||||
$(document).ready(function(){
|
||||
imagePreview();
|
||||
});
|
||||
1
Static/script/jQuery/jquery.transit.min.js
vendored
Normal file
1
Static/script/jQuery/jquery.transit.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
216
Static/script/jQuery/jquery.ui.core.js
vendored
Normal file
216
Static/script/jQuery/jquery.ui.core.js
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
/*!
|
||||
* jQuery UI 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
// prevent duplicate loading
|
||||
// this is only a problem because we proxy existing functions
|
||||
// and we don't want to double proxy them
|
||||
$.ui = $.ui || {};
|
||||
if ($.ui.version) {
|
||||
return;
|
||||
}
|
||||
|
||||
//Helper functions and ui object
|
||||
$.extend($.ui, {
|
||||
version: "1.8.2",
|
||||
|
||||
// $.ui.plugin is deprecated. Use the proxy pattern instead.
|
||||
plugin: {
|
||||
add: function(module, option, set) {
|
||||
var proto = $.ui[module].prototype;
|
||||
for(var i in set) {
|
||||
proto.plugins[i] = proto.plugins[i] || [];
|
||||
proto.plugins[i].push([option, set[i]]);
|
||||
}
|
||||
},
|
||||
call: function(instance, name, args) {
|
||||
var set = instance.plugins[name];
|
||||
if(!set || !instance.element[0].parentNode) { return; }
|
||||
|
||||
for (var i = 0; i < set.length; i++) {
|
||||
if (instance.options[set[i][0]]) {
|
||||
set[i][1].apply(instance.element, args);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
contains: function(a, b) {
|
||||
return document.compareDocumentPosition
|
||||
? a.compareDocumentPosition(b) & 16
|
||||
: a !== b && a.contains(b);
|
||||
},
|
||||
|
||||
hasScroll: function(el, a) {
|
||||
|
||||
//If overflow is hidden, the element might have extra content, but the user wants to hide it
|
||||
if ($(el).css('overflow') == 'hidden') { return false; }
|
||||
|
||||
var scroll = (a && a == 'left') ? 'scrollLeft' : 'scrollTop',
|
||||
has = false;
|
||||
|
||||
if (el[scroll] > 0) { return true; }
|
||||
|
||||
// TODO: determine which cases actually cause this to happen
|
||||
// if the element doesn't have the scroll set, see if it's possible to
|
||||
// set the scroll
|
||||
el[scroll] = 1;
|
||||
has = (el[scroll] > 0);
|
||||
el[scroll] = 0;
|
||||
return has;
|
||||
},
|
||||
|
||||
isOverAxis: function(x, reference, size) {
|
||||
//Determines when x coordinate is over "b" element axis
|
||||
return (x > reference) && (x < (reference + size));
|
||||
},
|
||||
|
||||
isOver: function(y, x, top, left, height, width) {
|
||||
//Determines when x, y coordinates is over "b" element
|
||||
return $.ui.isOverAxis(y, top, height) && $.ui.isOverAxis(x, left, width);
|
||||
},
|
||||
|
||||
keyCode: {
|
||||
ALT: 18,
|
||||
BACKSPACE: 8,
|
||||
CAPS_LOCK: 20,
|
||||
COMMA: 188,
|
||||
COMMAND: 91,
|
||||
COMMAND_LEFT: 91, // COMMAND
|
||||
COMMAND_RIGHT: 93,
|
||||
CONTROL: 17,
|
||||
DELETE: 46,
|
||||
DOWN: 40,
|
||||
END: 35,
|
||||
ENTER: 13,
|
||||
ESCAPE: 27,
|
||||
HOME: 36,
|
||||
INSERT: 45,
|
||||
LEFT: 37,
|
||||
MENU: 93, // COMMAND_RIGHT
|
||||
NUMPAD_ADD: 107,
|
||||
NUMPAD_DECIMAL: 110,
|
||||
NUMPAD_DIVIDE: 111,
|
||||
NUMPAD_ENTER: 108,
|
||||
NUMPAD_MULTIPLY: 106,
|
||||
NUMPAD_SUBTRACT: 109,
|
||||
PAGE_DOWN: 34,
|
||||
PAGE_UP: 33,
|
||||
PERIOD: 190,
|
||||
RIGHT: 39,
|
||||
SHIFT: 16,
|
||||
SPACE: 32,
|
||||
TAB: 9,
|
||||
UP: 38,
|
||||
WINDOWS: 91 // COMMAND
|
||||
}
|
||||
});
|
||||
|
||||
//jQuery plugins
|
||||
$.fn.extend({
|
||||
_focus: $.fn.focus,
|
||||
focus: function(delay, fn) {
|
||||
return typeof delay === 'number'
|
||||
? this.each(function() {
|
||||
var elem = this;
|
||||
setTimeout(function() {
|
||||
$(elem).focus();
|
||||
(fn && fn.call(elem));
|
||||
}, delay);
|
||||
})
|
||||
: this._focus.apply(this, arguments);
|
||||
},
|
||||
|
||||
enableSelection: function() {
|
||||
return this
|
||||
.attr('unselectable', 'off')
|
||||
.css('MozUserSelect', '');
|
||||
},
|
||||
|
||||
disableSelection: function() {
|
||||
return this
|
||||
.attr('unselectable', 'on')
|
||||
.css('MozUserSelect', 'none');
|
||||
},
|
||||
|
||||
scrollParent: function() {
|
||||
var scrollParent;
|
||||
if(($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(relative|absolute|fixed)/).test($.curCSS(this,'position',1)) && (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
} else {
|
||||
scrollParent = this.parents().filter(function() {
|
||||
return (/(auto|scroll)/).test($.curCSS(this,'overflow',1)+$.curCSS(this,'overflow-y',1)+$.curCSS(this,'overflow-x',1));
|
||||
}).eq(0);
|
||||
}
|
||||
|
||||
return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
|
||||
},
|
||||
|
||||
zIndex: function(zIndex) {
|
||||
if (zIndex !== undefined) {
|
||||
return this.css('zIndex', zIndex);
|
||||
}
|
||||
|
||||
if (this.length) {
|
||||
var elem = $(this[0]), position, value;
|
||||
while (elem.length && elem[0] !== document) {
|
||||
// Ignore z-index if position is set to a value where z-index is ignored by the browser
|
||||
// This makes behavior of this function consistent across browsers
|
||||
// WebKit always returns auto if the element is positioned
|
||||
position = elem.css('position');
|
||||
if (position == 'absolute' || position == 'relative' || position == 'fixed')
|
||||
{
|
||||
// IE returns 0 when zIndex is not specified
|
||||
// other browsers return a string
|
||||
// we ignore the case of nested elements with an explicit value of 0
|
||||
// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
|
||||
value = parseInt(elem.css('zIndex'));
|
||||
if (!isNaN(value) && value != 0) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
elem = elem.parent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Additional selectors
|
||||
$.extend($.expr[':'], {
|
||||
data: function(elem, i, match) {
|
||||
return !!$.data(elem, match[3]);
|
||||
},
|
||||
|
||||
focusable: function(element) {
|
||||
var nodeName = element.nodeName.toLowerCase(),
|
||||
tabIndex = $.attr(element, 'tabindex');
|
||||
return (/input|select|textarea|button|object/.test(nodeName)
|
||||
? !element.disabled
|
||||
: 'a' == nodeName || 'area' == nodeName
|
||||
? element.href || !isNaN(tabIndex)
|
||||
: !isNaN(tabIndex))
|
||||
// the element and all of its ancestors must be visible
|
||||
// the browser may report that the area is hidden
|
||||
&& !$(element)['area' == nodeName ? 'parents' : 'closest'](':hidden').length;
|
||||
},
|
||||
|
||||
tabbable: function(element) {
|
||||
var tabIndex = $.attr(element, 'tabindex');
|
||||
return (isNaN(tabIndex) || tabIndex >= 0) && $(element).is(':focusable');
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
23
Static/script/jQuery/jquery.ui.datepicker-pl.js
vendored
Normal file
23
Static/script/jQuery/jquery.ui.datepicker-pl.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/* Polish initialisation for the jQuery UI date picker plugin. */
|
||||
/* Written by Jacek Wysocki (jacek.wysocki@gmail.com). */
|
||||
jQuery(function($){
|
||||
$.datepicker.regional['pl'] = {
|
||||
closeText: 'Zamknij',
|
||||
prevText: '<Poprzedni',
|
||||
nextText: 'Następny>',
|
||||
currentText: 'Dziś',
|
||||
monthNames: ['Styczeń','Luty','Marzec','Kwiecień','Maj','Czerwiec',
|
||||
'Lipiec','Sierpień','Wrzesień','Październik','Listopad','Grudzień'],
|
||||
monthNamesShort: ['Sty','Lu','Mar','Kw','Maj','Cze',
|
||||
'Lip','Sie','Wrz','Pa','Lis','Gru'],
|
||||
dayNames: ['Niedziela','Poniedziałek','Wtorek','Środa','Czwartek','Piątek','Sobota'],
|
||||
dayNamesShort: ['Nie','Pn','Wt','Śr','Czw','Pt','So'],
|
||||
dayNamesMin: ['N','Pn','Wt','Śr','Cz','Pt','So'],
|
||||
weekHeader: 'Tydz',
|
||||
dateFormat: 'dd.mm.yy',
|
||||
firstDay: 1,
|
||||
isRTL: false,
|
||||
showMonthAfterYear: false,
|
||||
yearSuffix: ''};
|
||||
$.datepicker.setDefaults($.datepicker.regional['pl']);
|
||||
});
|
||||
1730
Static/script/jQuery/jquery.ui.datepicker.js
vendored
Normal file
1730
Static/script/jQuery/jquery.ui.datepicker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
233
Static/script/jQuery/jquery.ui.position.js
vendored
Normal file
233
Static/script/jQuery/jquery.ui.position.js
vendored
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* jQuery UI Position 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Position
|
||||
*/
|
||||
(function( $ ) {
|
||||
|
||||
$.ui = $.ui || {};
|
||||
|
||||
var horizontalPositions = /left|center|right/,
|
||||
horizontalDefault = "center",
|
||||
verticalPositions = /top|center|bottom/,
|
||||
verticalDefault = "center",
|
||||
_position = $.fn.position,
|
||||
_offset = $.fn.offset;
|
||||
|
||||
$.fn.position = function( options ) {
|
||||
if ( !options || !options.of ) {
|
||||
return _position.apply( this, arguments );
|
||||
}
|
||||
|
||||
// make a copy, we don't want to modify arguments
|
||||
options = $.extend( {}, options );
|
||||
|
||||
var target = $( options.of ),
|
||||
collision = ( options.collision || "flip" ).split( " " ),
|
||||
offset = options.offset ? options.offset.split( " " ) : [ 0, 0 ],
|
||||
targetWidth,
|
||||
targetHeight,
|
||||
basePosition;
|
||||
|
||||
if ( options.of.nodeType === 9 ) {
|
||||
targetWidth = target.width();
|
||||
targetHeight = target.height();
|
||||
basePosition = { top: 0, left: 0 };
|
||||
} else if ( options.of.scrollTo && options.of.document ) {
|
||||
targetWidth = target.width();
|
||||
targetHeight = target.height();
|
||||
basePosition = { top: target.scrollTop(), left: target.scrollLeft() };
|
||||
} else if ( options.of.preventDefault ) {
|
||||
// force left top to allow flipping
|
||||
options.at = "left top";
|
||||
targetWidth = targetHeight = 0;
|
||||
basePosition = { top: options.of.pageY, left: options.of.pageX };
|
||||
} else {
|
||||
targetWidth = target.outerWidth();
|
||||
targetHeight = target.outerHeight();
|
||||
basePosition = target.offset();
|
||||
}
|
||||
|
||||
// force my and at to have valid horizontal and veritcal positions
|
||||
// if a value is missing or invalid, it will be converted to center
|
||||
$.each( [ "my", "at" ], function() {
|
||||
var pos = ( options[this] || "" ).split( " " );
|
||||
if ( pos.length === 1) {
|
||||
pos = horizontalPositions.test( pos[0] ) ?
|
||||
pos.concat( [verticalDefault] ) :
|
||||
verticalPositions.test( pos[0] ) ?
|
||||
[ horizontalDefault ].concat( pos ) :
|
||||
[ horizontalDefault, verticalDefault ];
|
||||
}
|
||||
pos[ 0 ] = horizontalPositions.test( pos[0] ) ? pos[ 0 ] : horizontalDefault;
|
||||
pos[ 1 ] = verticalPositions.test( pos[1] ) ? pos[ 1 ] : verticalDefault;
|
||||
options[ this ] = pos;
|
||||
});
|
||||
|
||||
// normalize collision option
|
||||
if ( collision.length === 1 ) {
|
||||
collision[ 1 ] = collision[ 0 ];
|
||||
}
|
||||
|
||||
// normalize offset option
|
||||
offset[ 0 ] = parseInt( offset[0], 10 ) || 0;
|
||||
if ( offset.length === 1 ) {
|
||||
offset[ 1 ] = offset[ 0 ];
|
||||
}
|
||||
offset[ 1 ] = parseInt( offset[1], 10 ) || 0;
|
||||
|
||||
if ( options.at[0] === "right" ) {
|
||||
basePosition.left += targetWidth;
|
||||
} else if (options.at[0] === horizontalDefault ) {
|
||||
basePosition.left += targetWidth / 2;
|
||||
}
|
||||
|
||||
if ( options.at[1] === "bottom" ) {
|
||||
basePosition.top += targetHeight;
|
||||
} else if ( options.at[1] === verticalDefault ) {
|
||||
basePosition.top += targetHeight / 2;
|
||||
}
|
||||
|
||||
basePosition.left += offset[ 0 ];
|
||||
basePosition.top += offset[ 1 ];
|
||||
|
||||
return this.each(function() {
|
||||
var elem = $( this ),
|
||||
elemWidth = elem.outerWidth(),
|
||||
elemHeight = elem.outerHeight(),
|
||||
position = $.extend( {}, basePosition );
|
||||
|
||||
if ( options.my[0] === "right" ) {
|
||||
position.left -= elemWidth;
|
||||
} else if ( options.my[0] === horizontalDefault ) {
|
||||
position.left -= elemWidth / 2;
|
||||
}
|
||||
|
||||
if ( options.my[1] === "bottom" ) {
|
||||
position.top -= elemHeight;
|
||||
} else if ( options.my[1] === verticalDefault ) {
|
||||
position.top -= elemHeight / 2;
|
||||
}
|
||||
|
||||
// prevent fractions (see #5280)
|
||||
position.left = parseInt( position.left );
|
||||
position.top = parseInt( position.top );
|
||||
|
||||
$.each( [ "left", "top" ], function( i, dir ) {
|
||||
if ( $.ui.position[ collision[i] ] ) {
|
||||
$.ui.position[ collision[i] ][ dir ]( position, {
|
||||
targetWidth: targetWidth,
|
||||
targetHeight: targetHeight,
|
||||
elemWidth: elemWidth,
|
||||
elemHeight: elemHeight,
|
||||
offset: offset,
|
||||
my: options.my,
|
||||
at: options.at
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if ( $.fn.bgiframe ) {
|
||||
elem.bgiframe();
|
||||
}
|
||||
elem.offset( $.extend( position, { using: options.using } ) );
|
||||
});
|
||||
};
|
||||
|
||||
$.ui.position = {
|
||||
fit: {
|
||||
left: function( position, data ) {
|
||||
var win = $( window ),
|
||||
over = position.left + data.elemWidth - win.width() - win.scrollLeft();
|
||||
position.left = over > 0 ? position.left - over : Math.max( 0, position.left );
|
||||
},
|
||||
top: function( position, data ) {
|
||||
var win = $( window ),
|
||||
over = position.top + data.elemHeight - win.height() - win.scrollTop();
|
||||
position.top = over > 0 ? position.top - over : Math.max( 0, position.top );
|
||||
}
|
||||
},
|
||||
|
||||
flip: {
|
||||
left: function( position, data ) {
|
||||
if ( data.at[0] === "center" ) {
|
||||
return;
|
||||
}
|
||||
var win = $( window ),
|
||||
over = position.left + data.elemWidth - win.width() - win.scrollLeft(),
|
||||
myOffset = data.my[ 0 ] === "left" ?
|
||||
-data.elemWidth :
|
||||
data.my[ 0 ] === "right" ?
|
||||
data.elemWidth :
|
||||
0,
|
||||
offset = -2 * data.offset[ 0 ];
|
||||
position.left += position.left < 0 ?
|
||||
myOffset + data.targetWidth + offset :
|
||||
over > 0 ?
|
||||
myOffset - data.targetWidth + offset :
|
||||
0;
|
||||
},
|
||||
top: function( position, data ) {
|
||||
if ( data.at[1] === "center" ) {
|
||||
return;
|
||||
}
|
||||
var win = $( window ),
|
||||
over = position.top + data.elemHeight - win.height() - win.scrollTop(),
|
||||
myOffset = data.my[ 1 ] === "top" ?
|
||||
-data.elemHeight :
|
||||
data.my[ 1 ] === "bottom" ?
|
||||
data.elemHeight :
|
||||
0,
|
||||
atOffset = data.at[ 1 ] === "top" ?
|
||||
data.targetHeight :
|
||||
-data.targetHeight,
|
||||
offset = -2 * data.offset[ 1 ];
|
||||
position.top += position.top < 0 ?
|
||||
myOffset + data.targetHeight + offset :
|
||||
over > 0 ?
|
||||
myOffset + atOffset + offset :
|
||||
0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// offset setter from jQuery 1.4
|
||||
if ( !$.offset.setOffset ) {
|
||||
$.offset.setOffset = function( elem, options ) {
|
||||
// set position first, in-case top/left are set even on static elem
|
||||
if ( /static/.test( $.curCSS( elem, "position" ) ) ) {
|
||||
elem.style.position = "relative";
|
||||
}
|
||||
var curElem = $( elem ),
|
||||
curOffset = curElem.offset(),
|
||||
curTop = parseInt( $.curCSS( elem, "top", true ), 10 ) || 0,
|
||||
curLeft = parseInt( $.curCSS( elem, "left", true ), 10) || 0,
|
||||
props = {
|
||||
top: (options.top - curOffset.top) + curTop,
|
||||
left: (options.left - curOffset.left) + curLeft
|
||||
};
|
||||
|
||||
if ( 'using' in options ) {
|
||||
options.using.call( elem, props );
|
||||
} else {
|
||||
curElem.css( props );
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.offset = function( options ) {
|
||||
var elem = this[ 0 ];
|
||||
if ( !elem || !elem.ownerDocument ) { return null; }
|
||||
if ( options ) {
|
||||
return this.each(function() {
|
||||
$.offset.setOffset( this, options );
|
||||
});
|
||||
}
|
||||
return _offset.call( this );
|
||||
};
|
||||
}
|
||||
|
||||
}( jQuery ));
|
||||
729
Static/script/jQuery/jquery.ui.tabs.js
vendored
Normal file
729
Static/script/jQuery/jquery.ui.tabs.js
vendored
Normal file
@@ -0,0 +1,729 @@
|
||||
/*
|
||||
* jQuery UI Tabs 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tabs
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
var tabId = 0,
|
||||
listId = 0;
|
||||
|
||||
function getNextTabId() {
|
||||
return ++tabId;
|
||||
}
|
||||
|
||||
function getNextListId() {
|
||||
return ++listId;
|
||||
}
|
||||
|
||||
$.widget("ui.tabs", {
|
||||
options: {
|
||||
add: null,
|
||||
ajaxOptions: null,
|
||||
cache: false,
|
||||
cookie: null, // e.g. { expires: 7, path: '/', domain: 'jquery.com', secure: true }
|
||||
collapsible: false,
|
||||
disable: null,
|
||||
disabled: [],
|
||||
enable: null,
|
||||
event: 'click',
|
||||
fx: null, // e.g. { height: 'toggle', opacity: 'toggle', duration: 200 }
|
||||
idPrefix: 'ui-tabs-',
|
||||
load: null,
|
||||
panelTemplate: '<div></div>',
|
||||
remove: null,
|
||||
select: null,
|
||||
show: null,
|
||||
spinner: '<em>Loading…</em>',
|
||||
tabTemplate: '<li><a href="#{href}"><span>#{label}</span></a></li>'
|
||||
},
|
||||
_create: function() {
|
||||
this._tabify(true);
|
||||
},
|
||||
|
||||
_setOption: function(key, value) {
|
||||
if (key == 'selected') {
|
||||
if (this.options.collapsible && value == this.options.selected) {
|
||||
return;
|
||||
}
|
||||
this.select(value);
|
||||
}
|
||||
else {
|
||||
this.options[key] = value;
|
||||
this._tabify();
|
||||
}
|
||||
},
|
||||
|
||||
_tabId: function(a) {
|
||||
return a.title && a.title.replace(/\s/g, '_').replace(/[^A-Za-z0-9\-_:\.]/g, '') ||
|
||||
this.options.idPrefix + getNextTabId();
|
||||
},
|
||||
|
||||
_sanitizeSelector: function(hash) {
|
||||
return hash.replace(/:/g, '\\:'); // we need this because an id may contain a ":"
|
||||
},
|
||||
|
||||
_cookie: function() {
|
||||
var cookie = this.cookie || (this.cookie = this.options.cookie.name || 'ui-tabs-' + getNextListId());
|
||||
return $.cookie.apply(null, [cookie].concat($.makeArray(arguments)));
|
||||
},
|
||||
|
||||
_ui: function(tab, panel) {
|
||||
return {
|
||||
tab: tab,
|
||||
panel: panel,
|
||||
index: this.anchors.index(tab)
|
||||
};
|
||||
},
|
||||
|
||||
_cleanup: function() {
|
||||
// restore all former loading tabs labels
|
||||
this.lis.filter('.ui-state-processing').removeClass('ui-state-processing')
|
||||
.find('span:data(label.tabs)')
|
||||
.each(function() {
|
||||
var el = $(this);
|
||||
el.html(el.data('label.tabs')).removeData('label.tabs');
|
||||
});
|
||||
},
|
||||
|
||||
_tabify: function(init) {
|
||||
|
||||
this.list = this.element.find('ol,ul').eq(0);
|
||||
this.lis = $('li:has(a[href])', this.list);
|
||||
this.anchors = this.lis.map(function() { return $('a', this)[0]; });
|
||||
this.panels = $([]);
|
||||
|
||||
var self = this, o = this.options;
|
||||
|
||||
var fragmentId = /^#.+/; // Safari 2 reports '#' for an empty hash
|
||||
this.anchors.each(function(i, a) {
|
||||
var href = $(a).attr('href');
|
||||
|
||||
// For dynamically created HTML that contains a hash as href IE < 8 expands
|
||||
// such href to the full page url with hash and then misinterprets tab as ajax.
|
||||
// Same consideration applies for an added tab with a fragment identifier
|
||||
// since a[href=#fragment-identifier] does unexpectedly not match.
|
||||
// Thus normalize href attribute...
|
||||
var hrefBase = href.split('#')[0], baseEl;
|
||||
if (hrefBase && (hrefBase === location.toString().split('#')[0] ||
|
||||
(baseEl = $('base')[0]) && hrefBase === baseEl.href)) {
|
||||
href = a.hash;
|
||||
a.href = href;
|
||||
}
|
||||
|
||||
// inline tab
|
||||
if (fragmentId.test(href)) {
|
||||
self.panels = self.panels.add(self._sanitizeSelector(href));
|
||||
}
|
||||
|
||||
// remote tab
|
||||
else if (href != '#') { // prevent loading the page itself if href is just "#"
|
||||
$.data(a, 'href.tabs', href); // required for restore on destroy
|
||||
|
||||
// TODO until #3808 is fixed strip fragment identifier from url
|
||||
// (IE fails to load from such url)
|
||||
$.data(a, 'load.tabs', href.replace(/#.*$/, '')); // mutable data
|
||||
|
||||
var id = self._tabId(a);
|
||||
a.href = '#' + id;
|
||||
var $panel = $('#' + id);
|
||||
if (!$panel.length) {
|
||||
$panel = $(o.panelTemplate).attr('id', id).addClass('ui-tabs-panel ui-widget-content ui-corner-bottom')
|
||||
.insertAfter(self.panels[i - 1] || self.list);
|
||||
$panel.data('destroy.tabs', true);
|
||||
}
|
||||
self.panels = self.panels.add($panel);
|
||||
}
|
||||
|
||||
// invalid tab href
|
||||
else {
|
||||
o.disabled.push(i);
|
||||
}
|
||||
});
|
||||
|
||||
// initialization from scratch
|
||||
if (init) {
|
||||
|
||||
// attach necessary classes for styling
|
||||
this.element.addClass('ui-tabs ui-widget ui-widget-content ui-corner-all');
|
||||
this.list.addClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
|
||||
this.lis.addClass('ui-state-default ui-corner-top');
|
||||
this.panels.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom');
|
||||
|
||||
// Selected tab
|
||||
// use "selected" option or try to retrieve:
|
||||
// 1. from fragment identifier in url
|
||||
// 2. from cookie
|
||||
// 3. from selected class attribute on <li>
|
||||
if (o.selected === undefined) {
|
||||
if (location.hash) {
|
||||
this.anchors.each(function(i, a) {
|
||||
if (a.hash == location.hash) {
|
||||
o.selected = i;
|
||||
return false; // break
|
||||
}
|
||||
});
|
||||
}
|
||||
if (typeof o.selected != 'number' && o.cookie) {
|
||||
o.selected = parseInt(self._cookie(), 10);
|
||||
}
|
||||
if (typeof o.selected != 'number' && this.lis.filter('.ui-tabs-selected').length) {
|
||||
o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
|
||||
}
|
||||
o.selected = o.selected || (this.lis.length ? 0 : -1);
|
||||
}
|
||||
else if (o.selected === null) { // usage of null is deprecated, TODO remove in next release
|
||||
o.selected = -1;
|
||||
}
|
||||
|
||||
// sanity check - default to first tab...
|
||||
o.selected = ((o.selected >= 0 && this.anchors[o.selected]) || o.selected < 0) ? o.selected : 0;
|
||||
|
||||
// Take disabling tabs via class attribute from HTML
|
||||
// into account and update option properly.
|
||||
// A selected tab cannot become disabled.
|
||||
o.disabled = $.unique(o.disabled.concat(
|
||||
$.map(this.lis.filter('.ui-state-disabled'),
|
||||
function(n, i) { return self.lis.index(n); } )
|
||||
)).sort();
|
||||
|
||||
if ($.inArray(o.selected, o.disabled) != -1) {
|
||||
o.disabled.splice($.inArray(o.selected, o.disabled), 1);
|
||||
}
|
||||
|
||||
// highlight selected tab
|
||||
this.panels.addClass('ui-tabs-hide');
|
||||
this.lis.removeClass('ui-tabs-selected ui-state-active');
|
||||
if (o.selected >= 0 && this.anchors.length) { // check for length avoids error when initializing empty list
|
||||
this.panels.eq(o.selected).removeClass('ui-tabs-hide');
|
||||
this.lis.eq(o.selected).addClass('ui-tabs-selected ui-state-active');
|
||||
|
||||
// seems to be expected behavior that the show callback is fired
|
||||
self.element.queue("tabs", function() {
|
||||
self._trigger('show', null, self._ui(self.anchors[o.selected], self.panels[o.selected]));
|
||||
});
|
||||
|
||||
this.load(o.selected);
|
||||
}
|
||||
|
||||
// clean up to avoid memory leaks in certain versions of IE 6
|
||||
$(window).bind('unload', function() {
|
||||
self.lis.add(self.anchors).unbind('.tabs');
|
||||
self.lis = self.anchors = self.panels = null;
|
||||
});
|
||||
|
||||
}
|
||||
// update selected after add/remove
|
||||
else {
|
||||
o.selected = this.lis.index(this.lis.filter('.ui-tabs-selected'));
|
||||
}
|
||||
|
||||
// update collapsible
|
||||
this.element[o.collapsible ? 'addClass' : 'removeClass']('ui-tabs-collapsible');
|
||||
|
||||
// set or update cookie after init and add/remove respectively
|
||||
if (o.cookie) {
|
||||
this._cookie(o.selected, o.cookie);
|
||||
}
|
||||
|
||||
// disable tabs
|
||||
for (var i = 0, li; (li = this.lis[i]); i++) {
|
||||
$(li)[$.inArray(i, o.disabled) != -1 &&
|
||||
!$(li).hasClass('ui-tabs-selected') ? 'addClass' : 'removeClass']('ui-state-disabled');
|
||||
}
|
||||
|
||||
// reset cache if switching from cached to not cached
|
||||
if (o.cache === false) {
|
||||
this.anchors.removeData('cache.tabs');
|
||||
}
|
||||
|
||||
// remove all handlers before, tabify may run on existing tabs after add or option change
|
||||
this.lis.add(this.anchors).unbind('.tabs');
|
||||
|
||||
if (o.event != 'mouseover') {
|
||||
var addState = function(state, el) {
|
||||
if (el.is(':not(.ui-state-disabled)')) {
|
||||
el.addClass('ui-state-' + state);
|
||||
}
|
||||
};
|
||||
var removeState = function(state, el) {
|
||||
el.removeClass('ui-state-' + state);
|
||||
};
|
||||
this.lis.bind('mouseover.tabs', function() {
|
||||
addState('hover', $(this));
|
||||
});
|
||||
this.lis.bind('mouseout.tabs', function() {
|
||||
removeState('hover', $(this));
|
||||
});
|
||||
this.anchors.bind('focus.tabs', function() {
|
||||
addState('focus', $(this).closest('li'));
|
||||
});
|
||||
this.anchors.bind('blur.tabs', function() {
|
||||
removeState('focus', $(this).closest('li'));
|
||||
});
|
||||
}
|
||||
|
||||
// set up animations
|
||||
var hideFx, showFx;
|
||||
if (o.fx) {
|
||||
if ($.isArray(o.fx)) {
|
||||
hideFx = o.fx[0];
|
||||
showFx = o.fx[1];
|
||||
}
|
||||
else {
|
||||
hideFx = showFx = o.fx;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset certain styles left over from animation
|
||||
// and prevent IE's ClearType bug...
|
||||
function resetStyle($el, fx) {
|
||||
$el.css({ display: '' });
|
||||
if (!$.support.opacity && fx.opacity) {
|
||||
$el[0].style.removeAttribute('filter');
|
||||
}
|
||||
}
|
||||
|
||||
// Show a tab...
|
||||
var showTab = showFx ?
|
||||
function(clicked, $show) {
|
||||
$(clicked).closest('li').addClass('ui-tabs-selected ui-state-active');
|
||||
$show.hide().removeClass('ui-tabs-hide') // avoid flicker that way
|
||||
.animate(showFx, showFx.duration || 'normal', function() {
|
||||
resetStyle($show, showFx);
|
||||
self._trigger('show', null, self._ui(clicked, $show[0]));
|
||||
});
|
||||
} :
|
||||
function(clicked, $show) {
|
||||
$(clicked).closest('li').addClass('ui-tabs-selected ui-state-active');
|
||||
$show.removeClass('ui-tabs-hide');
|
||||
self._trigger('show', null, self._ui(clicked, $show[0]));
|
||||
};
|
||||
|
||||
// Hide a tab, $show is optional...
|
||||
var hideTab = hideFx ?
|
||||
function(clicked, $hide) {
|
||||
$hide.animate(hideFx, hideFx.duration || 'normal', function() {
|
||||
self.lis.removeClass('ui-tabs-selected ui-state-active');
|
||||
$hide.addClass('ui-tabs-hide');
|
||||
resetStyle($hide, hideFx);
|
||||
self.element.dequeue("tabs");
|
||||
});
|
||||
} :
|
||||
function(clicked, $hide, $show) {
|
||||
self.lis.removeClass('ui-tabs-selected ui-state-active');
|
||||
$hide.addClass('ui-tabs-hide');
|
||||
self.element.dequeue("tabs");
|
||||
};
|
||||
|
||||
// attach tab event handler, unbind to avoid duplicates from former tabifying...
|
||||
this.anchors.bind(o.event + '.tabs', function() {
|
||||
var el = this, $li = $(this).closest('li'), $hide = self.panels.filter(':not(.ui-tabs-hide)'),
|
||||
$show = $(self._sanitizeSelector(this.hash));
|
||||
|
||||
// If tab is already selected and not collapsible or tab disabled or
|
||||
// or is already loading or click callback returns false stop here.
|
||||
// Check if click handler returns false last so that it is not executed
|
||||
// for a disabled or loading tab!
|
||||
if (($li.hasClass('ui-tabs-selected') && !o.collapsible) ||
|
||||
$li.hasClass('ui-state-disabled') ||
|
||||
$li.hasClass('ui-state-processing') ||
|
||||
self._trigger('select', null, self._ui(this, $show[0])) === false) {
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
|
||||
o.selected = self.anchors.index(this);
|
||||
|
||||
self.abort();
|
||||
|
||||
// if tab may be closed
|
||||
if (o.collapsible) {
|
||||
if ($li.hasClass('ui-tabs-selected')) {
|
||||
o.selected = -1;
|
||||
|
||||
if (o.cookie) {
|
||||
self._cookie(o.selected, o.cookie);
|
||||
}
|
||||
|
||||
self.element.queue("tabs", function() {
|
||||
hideTab(el, $hide);
|
||||
}).dequeue("tabs");
|
||||
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
else if (!$hide.length) {
|
||||
if (o.cookie) {
|
||||
self._cookie(o.selected, o.cookie);
|
||||
}
|
||||
|
||||
self.element.queue("tabs", function() {
|
||||
showTab(el, $show);
|
||||
});
|
||||
|
||||
self.load(self.anchors.index(this)); // TODO make passing in node possible, see also http://dev.jqueryui.com/ticket/3171
|
||||
|
||||
this.blur();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (o.cookie) {
|
||||
self._cookie(o.selected, o.cookie);
|
||||
}
|
||||
|
||||
// show new tab
|
||||
if ($show.length) {
|
||||
if ($hide.length) {
|
||||
self.element.queue("tabs", function() {
|
||||
hideTab(el, $hide);
|
||||
});
|
||||
}
|
||||
self.element.queue("tabs", function() {
|
||||
showTab(el, $show);
|
||||
});
|
||||
|
||||
self.load(self.anchors.index(this));
|
||||
}
|
||||
else {
|
||||
throw 'jQuery UI Tabs: Mismatching fragment identifier.';
|
||||
}
|
||||
|
||||
// Prevent IE from keeping other link focussed when using the back button
|
||||
// and remove dotted border from clicked link. This is controlled via CSS
|
||||
// in modern browsers; blur() removes focus from address bar in Firefox
|
||||
// which can become a usability and annoying problem with tabs('rotate').
|
||||
if ($.browser.msie) {
|
||||
this.blur();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// disable click in any case
|
||||
this.anchors.bind('click.tabs', function(){return false;});
|
||||
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
var o = this.options;
|
||||
|
||||
this.abort();
|
||||
|
||||
this.element.unbind('.tabs')
|
||||
.removeClass('ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible')
|
||||
.removeData('tabs');
|
||||
|
||||
this.list.removeClass('ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all');
|
||||
|
||||
this.anchors.each(function() {
|
||||
var href = $.data(this, 'href.tabs');
|
||||
if (href) {
|
||||
this.href = href;
|
||||
}
|
||||
var $this = $(this).unbind('.tabs');
|
||||
$.each(['href', 'load', 'cache'], function(i, prefix) {
|
||||
$this.removeData(prefix + '.tabs');
|
||||
});
|
||||
});
|
||||
|
||||
this.lis.unbind('.tabs').add(this.panels).each(function() {
|
||||
if ($.data(this, 'destroy.tabs')) {
|
||||
$(this).remove();
|
||||
}
|
||||
else {
|
||||
$(this).removeClass([
|
||||
'ui-state-default',
|
||||
'ui-corner-top',
|
||||
'ui-tabs-selected',
|
||||
'ui-state-active',
|
||||
'ui-state-hover',
|
||||
'ui-state-focus',
|
||||
'ui-state-disabled',
|
||||
'ui-tabs-panel',
|
||||
'ui-widget-content',
|
||||
'ui-corner-bottom',
|
||||
'ui-tabs-hide'
|
||||
].join(' '));
|
||||
}
|
||||
});
|
||||
|
||||
if (o.cookie) {
|
||||
this._cookie(null, o.cookie);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
add: function(url, label, index) {
|
||||
if (index === undefined) {
|
||||
index = this.anchors.length; // append by default
|
||||
}
|
||||
|
||||
var self = this, o = this.options,
|
||||
$li = $(o.tabTemplate.replace(/#\{href\}/g, url).replace(/#\{label\}/g, label)),
|
||||
id = !url.indexOf('#') ? url.replace('#', '') : this._tabId($('a', $li)[0]);
|
||||
|
||||
$li.addClass('ui-state-default ui-corner-top').data('destroy.tabs', true);
|
||||
|
||||
// try to find an existing element before creating a new one
|
||||
var $panel = $('#' + id);
|
||||
if (!$panel.length) {
|
||||
$panel = $(o.panelTemplate).attr('id', id).data('destroy.tabs', true);
|
||||
}
|
||||
$panel.addClass('ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide');
|
||||
|
||||
if (index >= this.lis.length) {
|
||||
$li.appendTo(this.list);
|
||||
$panel.appendTo(this.list[0].parentNode);
|
||||
}
|
||||
else {
|
||||
$li.insertBefore(this.lis[index]);
|
||||
$panel.insertBefore(this.panels[index]);
|
||||
}
|
||||
|
||||
o.disabled = $.map(o.disabled,
|
||||
function(n, i) { return n >= index ? ++n : n; });
|
||||
|
||||
this._tabify();
|
||||
|
||||
if (this.anchors.length == 1) { // after tabify
|
||||
o.selected = 0;
|
||||
$li.addClass('ui-tabs-selected ui-state-active');
|
||||
$panel.removeClass('ui-tabs-hide');
|
||||
this.element.queue("tabs", function() {
|
||||
self._trigger('show', null, self._ui(self.anchors[0], self.panels[0]));
|
||||
});
|
||||
|
||||
this.load(0);
|
||||
}
|
||||
|
||||
// callback
|
||||
this._trigger('add', null, this._ui(this.anchors[index], this.panels[index]));
|
||||
return this;
|
||||
},
|
||||
|
||||
remove: function(index) {
|
||||
var o = this.options, $li = this.lis.eq(index).remove(),
|
||||
$panel = this.panels.eq(index).remove();
|
||||
|
||||
// If selected tab was removed focus tab to the right or
|
||||
// in case the last tab was removed the tab to the left.
|
||||
if ($li.hasClass('ui-tabs-selected') && this.anchors.length > 1) {
|
||||
this.select(index + (index + 1 < this.anchors.length ? 1 : -1));
|
||||
}
|
||||
|
||||
o.disabled = $.map($.grep(o.disabled, function(n, i) { return n != index; }),
|
||||
function(n, i) { return n >= index ? --n : n; });
|
||||
|
||||
this._tabify();
|
||||
|
||||
// callback
|
||||
this._trigger('remove', null, this._ui($li.find('a')[0], $panel[0]));
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function(index) {
|
||||
var o = this.options;
|
||||
if ($.inArray(index, o.disabled) == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.lis.eq(index).removeClass('ui-state-disabled');
|
||||
o.disabled = $.grep(o.disabled, function(n, i) { return n != index; });
|
||||
|
||||
// callback
|
||||
this._trigger('enable', null, this._ui(this.anchors[index], this.panels[index]));
|
||||
return this;
|
||||
},
|
||||
|
||||
disable: function(index) {
|
||||
var self = this, o = this.options;
|
||||
if (index != o.selected) { // cannot disable already selected tab
|
||||
this.lis.eq(index).addClass('ui-state-disabled');
|
||||
|
||||
o.disabled.push(index);
|
||||
o.disabled.sort();
|
||||
|
||||
// callback
|
||||
this._trigger('disable', null, this._ui(this.anchors[index], this.panels[index]));
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
select: function(index) {
|
||||
if (typeof index == 'string') {
|
||||
index = this.anchors.index(this.anchors.filter('[href$=' + index + ']'));
|
||||
}
|
||||
else if (index === null) { // usage of null is deprecated, TODO remove in next release
|
||||
index = -1;
|
||||
}
|
||||
if (index == -1 && this.options.collapsible) {
|
||||
index = this.options.selected;
|
||||
}
|
||||
|
||||
this.anchors.eq(index).trigger(this.options.event + '.tabs');
|
||||
return this;
|
||||
},
|
||||
|
||||
load: function(index) {
|
||||
var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs');
|
||||
|
||||
this.abort();
|
||||
|
||||
// not remote or from cache
|
||||
if (!url || this.element.queue("tabs").length !== 0 && $.data(a, 'cache.tabs')) {
|
||||
this.element.dequeue("tabs");
|
||||
return;
|
||||
}
|
||||
|
||||
// load remote from here on
|
||||
this.lis.eq(index).addClass('ui-state-processing');
|
||||
|
||||
if (o.spinner) {
|
||||
var span = $('span', a);
|
||||
span.data('label.tabs', span.html()).html(o.spinner);
|
||||
}
|
||||
|
||||
this.xhr = $.ajax($.extend({}, o.ajaxOptions, {
|
||||
url: url,
|
||||
success: function(r, s) {
|
||||
$(self._sanitizeSelector(a.hash)).html(r);
|
||||
|
||||
// take care of tab labels
|
||||
self._cleanup();
|
||||
|
||||
if (o.cache) {
|
||||
$.data(a, 'cache.tabs', true); // if loaded once do not load them again
|
||||
}
|
||||
|
||||
// callbacks
|
||||
self._trigger('load', null, self._ui(self.anchors[index], self.panels[index]));
|
||||
try {
|
||||
o.ajaxOptions.success(r, s);
|
||||
}
|
||||
catch (e) {}
|
||||
},
|
||||
error: function(xhr, s, e) {
|
||||
// take care of tab labels
|
||||
self._cleanup();
|
||||
|
||||
// callbacks
|
||||
self._trigger('load', null, self._ui(self.anchors[index], self.panels[index]));
|
||||
try {
|
||||
// Passing index avoid a race condition when this method is
|
||||
// called after the user has selected another tab.
|
||||
// Pass the anchor that initiated this request allows
|
||||
// loadError to manipulate the tab content panel via $(a.hash)
|
||||
o.ajaxOptions.error(xhr, s, index, a);
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
}));
|
||||
|
||||
// last, so that load event is fired before show...
|
||||
self.element.dequeue("tabs");
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
abort: function() {
|
||||
// stop possibly running animations
|
||||
this.element.queue([]);
|
||||
this.panels.stop(false, true);
|
||||
|
||||
// "tabs" queue must not contain more than two elements,
|
||||
// which are the callbacks for the latest clicked tab...
|
||||
this.element.queue("tabs", this.element.queue("tabs").splice(-2, 2));
|
||||
|
||||
// terminate pending requests from other tabs
|
||||
if (this.xhr) {
|
||||
this.xhr.abort();
|
||||
delete this.xhr;
|
||||
}
|
||||
|
||||
// take care of tab labels
|
||||
this._cleanup();
|
||||
return this;
|
||||
},
|
||||
|
||||
url: function(index, url) {
|
||||
this.anchors.eq(index).removeData('cache.tabs').data('load.tabs', url);
|
||||
return this;
|
||||
},
|
||||
|
||||
length: function() {
|
||||
return this.anchors.length;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$.extend($.ui.tabs, {
|
||||
version: '1.8.2'
|
||||
});
|
||||
|
||||
/*
|
||||
* Tabs Extensions
|
||||
*/
|
||||
|
||||
/*
|
||||
* Rotate
|
||||
*/
|
||||
$.extend($.ui.tabs.prototype, {
|
||||
rotation: null,
|
||||
rotate: function(ms, continuing) {
|
||||
|
||||
var self = this, o = this.options;
|
||||
|
||||
var rotate = self._rotate || (self._rotate = function(e) {
|
||||
clearTimeout(self.rotation);
|
||||
self.rotation = setTimeout(function() {
|
||||
var t = o.selected;
|
||||
self.select( ++t < self.anchors.length ? t : 0 );
|
||||
}, ms);
|
||||
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
});
|
||||
|
||||
var stop = self._unrotate || (self._unrotate = !continuing ?
|
||||
function(e) {
|
||||
if (e.clientX) { // in case of a true click
|
||||
self.rotate(null);
|
||||
}
|
||||
} :
|
||||
function(e) {
|
||||
t = o.selected;
|
||||
rotate();
|
||||
});
|
||||
|
||||
// start rotation
|
||||
if (ms) {
|
||||
this.element.bind('tabsshow', rotate);
|
||||
this.anchors.bind(o.event + '.tabs', stop);
|
||||
rotate();
|
||||
}
|
||||
// stop rotation
|
||||
else {
|
||||
clearTimeout(self.rotation);
|
||||
this.element.unbind('tabsshow', rotate);
|
||||
this.anchors.unbind(o.event + '.tabs', stop);
|
||||
delete this._rotate;
|
||||
delete this._unrotate;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
147
Static/script/jQuery/jquery.ui.tooltip.js
vendored
Normal file
147
Static/script/jQuery/jquery.ui.tooltip.js
vendored
Normal file
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* jQuery UI Tooltip @VERSION
|
||||
*
|
||||
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Tooltip
|
||||
*
|
||||
* Depends:
|
||||
* jquery.ui.core.js
|
||||
* jquery.ui.widget.js
|
||||
* jquery.ui.position.js
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
// role=application on body required for screenreaders to correctly interpret aria attributes
|
||||
if( !$(document.body).is('[role]') ){
|
||||
$(document.body).attr('role','application');
|
||||
}
|
||||
|
||||
var increments = 0;
|
||||
|
||||
$.widget("ui.tooltip", {
|
||||
options: {
|
||||
tooltipClass: "ui-widget-content",
|
||||
content: function() {
|
||||
return $(this).attr("title");
|
||||
},
|
||||
position: {
|
||||
my: "left center",
|
||||
at: "right center",
|
||||
offset: "15 0"
|
||||
}
|
||||
},
|
||||
_init: function() {
|
||||
var self = this;
|
||||
this.tooltip = $("<div></div>")
|
||||
.attr("id", "ui-tooltip-" + increments++)
|
||||
.attr("role", "tooltip")
|
||||
.attr("aria-hidden", "true")
|
||||
.addClass("ui-tooltip ui-widget ui-corner-all")
|
||||
.addClass(this.options.tooltipClass)
|
||||
.appendTo(document.body)
|
||||
.hide();
|
||||
this.tooltipContent = $("<div></div>")
|
||||
.addClass("ui-tooltip-content")
|
||||
.appendTo(this.tooltip);
|
||||
this.opacity = this.tooltip.css("opacity");
|
||||
this.element
|
||||
.bind("focus.tooltip mouseenter.tooltip", function(event) {
|
||||
self.open( event );
|
||||
})
|
||||
.bind("blur.tooltip mouseleave.tooltip", function(event) {
|
||||
self.close( event );
|
||||
});
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
this.options.disabled = false;
|
||||
},
|
||||
|
||||
disable: function() {
|
||||
this.options.disabled = true;
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
this.tooltip.remove();
|
||||
$.Widget.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
widget: function() {
|
||||
return this.tooltip;
|
||||
},
|
||||
|
||||
open: function(event) {
|
||||
var target = this.element;
|
||||
// already visible? possible when both focus and mouseover events occur
|
||||
if (this.current && this.current[0] == target[0])
|
||||
return;
|
||||
var self = this;
|
||||
this.current = target;
|
||||
this.currentTitle = target.attr("title");
|
||||
var content = this.options.content.call(target[0], function(response) {
|
||||
// ignore async responses that come in after the tooltip is already hidden
|
||||
if (self.current == target)
|
||||
self._show(event, target, response);
|
||||
});
|
||||
if (content) {
|
||||
self._show(event, target, content);
|
||||
}
|
||||
},
|
||||
|
||||
_show: function(event, target, content) {
|
||||
if (!content)
|
||||
return;
|
||||
|
||||
target.attr("title", "");
|
||||
|
||||
if (this.options.disabled)
|
||||
return;
|
||||
|
||||
this.tooltipContent.html(content);
|
||||
this.tooltip.css({
|
||||
top: 0,
|
||||
left: 0
|
||||
}).show().position($.extend(this.options.position, {
|
||||
of: target
|
||||
})).hide();
|
||||
|
||||
this.tooltip.attr("aria-hidden", "false");
|
||||
target.attr("aria-describedby", this.tooltip.attr("id"));
|
||||
|
||||
if (this.tooltip.is(":animated"))
|
||||
this.tooltip.stop().show().fadeTo("normal", this.opacity);
|
||||
else
|
||||
this.tooltip.is(':visible') ? this.tooltip.fadeTo("normal", this.opacity) : this.tooltip.fadeIn();
|
||||
|
||||
this._trigger( "open", event );
|
||||
},
|
||||
|
||||
close: function(event) {
|
||||
if (!this.current)
|
||||
return;
|
||||
|
||||
var current = this.current.attr("title", this.currentTitle);
|
||||
this.current = null;
|
||||
|
||||
if (this.options.disabled)
|
||||
return;
|
||||
|
||||
current.removeAttr("aria-describedby");
|
||||
this.tooltip.attr("aria-hidden", "true");
|
||||
|
||||
if (this.tooltip.is(':animated'))
|
||||
this.tooltip.stop().fadeTo("normal", 0, function() {
|
||||
$(this).hide().css("opacity", "");
|
||||
});
|
||||
else
|
||||
this.tooltip.stop().fadeOut();
|
||||
|
||||
this._trigger( "close", event );
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
236
Static/script/jQuery/jquery.ui.widget.js
vendored
Normal file
236
Static/script/jQuery/jquery.ui.widget.js
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
/*!
|
||||
* jQuery UI Widget 1.8.2
|
||||
*
|
||||
* Copyright (c) 2010 AUTHORS.txt (http://jqueryui.com/about)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* http://docs.jquery.com/UI/Widget
|
||||
*/
|
||||
(function( $ ) {
|
||||
|
||||
var _remove = $.fn.remove;
|
||||
|
||||
$.fn.remove = function( selector, keepData ) {
|
||||
return this.each(function() {
|
||||
if ( !keepData ) {
|
||||
if ( !selector || $.filter( selector, [ this ] ).length ) {
|
||||
$( "*", this ).add( this ).each(function() {
|
||||
$( this ).triggerHandler( "remove" );
|
||||
});
|
||||
}
|
||||
}
|
||||
return _remove.call( $(this), selector, keepData );
|
||||
});
|
||||
};
|
||||
|
||||
$.widget = function( name, base, prototype ) {
|
||||
var namespace = name.split( "." )[ 0 ],
|
||||
fullName;
|
||||
name = name.split( "." )[ 1 ];
|
||||
fullName = namespace + "-" + name;
|
||||
|
||||
if ( !prototype ) {
|
||||
prototype = base;
|
||||
base = $.Widget;
|
||||
}
|
||||
|
||||
// create selector for plugin
|
||||
$.expr[ ":" ][ fullName ] = function( elem ) {
|
||||
return !!$.data( elem, name );
|
||||
};
|
||||
|
||||
$[ namespace ] = $[ namespace ] || {};
|
||||
$[ namespace ][ name ] = function( options, element ) {
|
||||
// allow instantiation without initializing for simple inheritance
|
||||
if ( arguments.length ) {
|
||||
this._createWidget( options, element );
|
||||
}
|
||||
};
|
||||
|
||||
var basePrototype = new base();
|
||||
// we need to make the options hash a property directly on the new instance
|
||||
// otherwise we'll modify the options hash on the prototype that we're
|
||||
// inheriting from
|
||||
// $.each( basePrototype, function( key, val ) {
|
||||
// if ( $.isPlainObject(val) ) {
|
||||
// basePrototype[ key ] = $.extend( {}, val );
|
||||
// }
|
||||
// });
|
||||
basePrototype.options = $.extend( {}, basePrototype.options );
|
||||
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
||||
namespace: namespace,
|
||||
widgetName: name,
|
||||
widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
|
||||
widgetBaseClass: fullName
|
||||
}, prototype );
|
||||
|
||||
$.widget.bridge( name, $[ namespace ][ name ] );
|
||||
};
|
||||
|
||||
$.widget.bridge = function( name, object ) {
|
||||
$.fn[ name ] = function( options ) {
|
||||
var isMethodCall = typeof options === "string",
|
||||
args = Array.prototype.slice.call( arguments, 1 ),
|
||||
returnValue = this;
|
||||
|
||||
// allow multiple hashes to be passed on init
|
||||
options = !isMethodCall && args.length ?
|
||||
$.extend.apply( null, [ true, options ].concat(args) ) :
|
||||
options;
|
||||
|
||||
// prevent calls to internal methods
|
||||
if ( isMethodCall && options.substring( 0, 1 ) === "_" ) {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
if ( isMethodCall ) {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, name ),
|
||||
methodValue = instance && $.isFunction( instance[options] ) ?
|
||||
instance[ options ].apply( instance, args ) :
|
||||
instance;
|
||||
if ( methodValue !== instance && methodValue !== undefined ) {
|
||||
returnValue = methodValue;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.each(function() {
|
||||
var instance = $.data( this, name );
|
||||
if ( instance ) {
|
||||
if ( options ) {
|
||||
instance.option( options );
|
||||
}
|
||||
instance._init();
|
||||
} else {
|
||||
$.data( this, name, new object( options, this ) );
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return returnValue;
|
||||
};
|
||||
};
|
||||
|
||||
$.Widget = function( options, element ) {
|
||||
// allow instantiation without initializing for simple inheritance
|
||||
if ( arguments.length ) {
|
||||
this._createWidget( options, element );
|
||||
}
|
||||
};
|
||||
|
||||
$.Widget.prototype = {
|
||||
widgetName: "widget",
|
||||
widgetEventPrefix: "",
|
||||
options: {
|
||||
disabled: false
|
||||
},
|
||||
_createWidget: function( options, element ) {
|
||||
// $.widget.bridge stores the plugin instance, but we do it anyway
|
||||
// so that it's stored even before the _create function runs
|
||||
this.element = $( element ).data( this.widgetName, this );
|
||||
this.options = $.extend( true, {},
|
||||
this.options,
|
||||
$.metadata && $.metadata.get( element )[ this.widgetName ],
|
||||
options );
|
||||
|
||||
var self = this;
|
||||
this.element.bind( "remove." + this.widgetName, function() {
|
||||
self.destroy();
|
||||
});
|
||||
|
||||
this._create();
|
||||
this._init();
|
||||
},
|
||||
_create: function() {},
|
||||
_init: function() {},
|
||||
|
||||
destroy: function() {
|
||||
this.element
|
||||
.unbind( "." + this.widgetName )
|
||||
.removeData( this.widgetName );
|
||||
this.widget()
|
||||
.unbind( "." + this.widgetName )
|
||||
.removeAttr( "aria-disabled" )
|
||||
.removeClass(
|
||||
this.widgetBaseClass + "-disabled " +
|
||||
"ui-state-disabled" );
|
||||
},
|
||||
|
||||
widget: function() {
|
||||
return this.element;
|
||||
},
|
||||
|
||||
option: function( key, value ) {
|
||||
var options = key,
|
||||
self = this;
|
||||
|
||||
if ( arguments.length === 0 ) {
|
||||
// don't return a reference to the internal hash
|
||||
return $.extend( {}, self.options );
|
||||
}
|
||||
|
||||
if (typeof key === "string" ) {
|
||||
if ( value === undefined ) {
|
||||
return this.options[ key ];
|
||||
}
|
||||
options = {};
|
||||
options[ key ] = value;
|
||||
}
|
||||
|
||||
$.each( options, function( key, value ) {
|
||||
self._setOption( key, value );
|
||||
});
|
||||
|
||||
return self;
|
||||
},
|
||||
_setOption: function( key, value ) {
|
||||
this.options[ key ] = value;
|
||||
|
||||
if ( key === "disabled" ) {
|
||||
this.widget()
|
||||
[ value ? "addClass" : "removeClass"](
|
||||
this.widgetBaseClass + "-disabled" + " " +
|
||||
"ui-state-disabled" )
|
||||
.attr( "aria-disabled", value );
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
enable: function() {
|
||||
return this._setOption( "disabled", false );
|
||||
},
|
||||
disable: function() {
|
||||
return this._setOption( "disabled", true );
|
||||
},
|
||||
|
||||
_trigger: function( type, event, data ) {
|
||||
var callback = this.options[ type ];
|
||||
|
||||
event = $.Event( event );
|
||||
event.type = ( type === this.widgetEventPrefix ?
|
||||
type :
|
||||
this.widgetEventPrefix + type ).toLowerCase();
|
||||
data = data || {};
|
||||
|
||||
// copy original event properties over to the new event
|
||||
// this would happen if we could call $.event.fix instead of $.Event
|
||||
// but we don't have a way to force an event to be fixed multiple times
|
||||
if ( event.originalEvent ) {
|
||||
for ( var i = $.event.props.length, prop; i; ) {
|
||||
prop = $.event.props[ --i ];
|
||||
event[ prop ] = event.originalEvent[ prop ];
|
||||
}
|
||||
}
|
||||
|
||||
this.element.trigger( event, data );
|
||||
|
||||
return !( $.isFunction(callback) &&
|
||||
callback.call( this.element[0], event, data ) === false ||
|
||||
event.isDefaultPrevented() );
|
||||
}
|
||||
};
|
||||
|
||||
})( jQuery );
|
||||
26
Static/script/jQuery/jquery.uploadify.v2.1.4.min.js
vendored
Normal file
26
Static/script/jQuery/jquery.uploadify.v2.1.4.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1231
Static/script/jQuery/jquery.validate.js
vendored
Normal file
1231
Static/script/jQuery/jquery.validate.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1146
Static/script/jQuery/jquery.validate.js.old
Normal file
1146
Static/script/jQuery/jquery.validate.js.old
Normal file
File diff suppressed because it is too large
Load Diff
83
Static/script/jQuery/jquery.visible.js
Normal file
83
Static/script/jQuery/jquery.visible.js
Normal file
@@ -0,0 +1,83 @@
|
||||
(function($){
|
||||
|
||||
/**
|
||||
* Copyright 2012, Digital Fusion
|
||||
* Licensed under the MIT license.
|
||||
* http://teamdf.com/jquery-plugins/license/
|
||||
*
|
||||
* @author Sam Sehnert
|
||||
* @desc A small plugin that checks whether elements are within
|
||||
* the user visible viewport of a web browser.
|
||||
* can accounts for vertical position, horizontal, or both
|
||||
*/
|
||||
var $w=$(window);
|
||||
$.fn.visible = function(partial,hidden,direction,container){
|
||||
|
||||
if (this.length < 1)
|
||||
return;
|
||||
|
||||
// Set direction default to 'both'.
|
||||
direction = direction || 'both';
|
||||
|
||||
var $t = this.length > 1 ? this.eq(0) : this,
|
||||
isContained = typeof container !== 'undefined' && container !== null,
|
||||
$c = isContained ? $(container) : $w,
|
||||
wPosition = isContained ? $c.position() : 0,
|
||||
t = $t.get(0),
|
||||
vpWidth = $c.outerWidth(),
|
||||
vpHeight = $c.outerHeight(),
|
||||
clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true;
|
||||
|
||||
if (typeof t.getBoundingClientRect === 'function'){
|
||||
|
||||
// Use this native browser method, if available.
|
||||
var rec = t.getBoundingClientRect(),
|
||||
tViz = isContained ?
|
||||
rec.top - wPosition.top >= 0 && rec.top < vpHeight + wPosition.top :
|
||||
rec.top >= 0 && rec.top < vpHeight,
|
||||
bViz = isContained ?
|
||||
rec.bottom - wPosition.top > 0 && rec.bottom <= vpHeight + wPosition.top :
|
||||
rec.bottom > 0 && rec.bottom <= vpHeight,
|
||||
lViz = isContained ?
|
||||
rec.left - wPosition.left >= 0 && rec.left < vpWidth + wPosition.left :
|
||||
rec.left >= 0 && rec.left < vpWidth,
|
||||
rViz = isContained ?
|
||||
rec.right - wPosition.left > 0 && rec.right < vpWidth + wPosition.left :
|
||||
rec.right > 0 && rec.right <= vpWidth,
|
||||
vVisible = partial ? tViz || bViz : tViz && bViz,
|
||||
hVisible = partial ? lViz || rViz : lViz && rViz,
|
||||
vVisible = (rec.top < 0 && rec.bottom > vpHeight) ? true : vVisible,
|
||||
hVisible = (rec.left < 0 && rec.right > vpWidth) ? true : hVisible;
|
||||
|
||||
if(direction === 'both')
|
||||
return clientSize && vVisible && hVisible;
|
||||
else if(direction === 'vertical')
|
||||
return clientSize && vVisible;
|
||||
else if(direction === 'horizontal')
|
||||
return clientSize && hVisible;
|
||||
} else {
|
||||
|
||||
var viewTop = isContained ? 0 : wPosition,
|
||||
viewBottom = viewTop + vpHeight,
|
||||
viewLeft = $c.scrollLeft(),
|
||||
viewRight = viewLeft + vpWidth,
|
||||
position = $t.position(),
|
||||
_top = position.top,
|
||||
_bottom = _top + $t.height(),
|
||||
_left = position.left,
|
||||
_right = _left + $t.width(),
|
||||
compareTop = partial === true ? _bottom : _top,
|
||||
compareBottom = partial === true ? _top : _bottom,
|
||||
compareLeft = partial === true ? _right : _left,
|
||||
compareRight = partial === true ? _left : _right;
|
||||
|
||||
if(direction === 'both')
|
||||
return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop)) && ((compareRight <= viewRight) && (compareLeft >= viewLeft));
|
||||
else if(direction === 'vertical')
|
||||
return !!clientSize && ((compareBottom <= viewBottom) && (compareTop >= viewTop));
|
||||
else if(direction === 'horizontal')
|
||||
return !!clientSize && ((compareRight <= viewRight) && (compareLeft >= viewLeft));
|
||||
}
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
24
Static/script/jQuery/messages_pl.js
Normal file
24
Static/script/jQuery/messages_pl.js
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Translated default messages for the jQuery validation plugin.
|
||||
* Locale: PL (Polish; język polski, polszczyzna)
|
||||
*/
|
||||
$.extend( $.validator.messages, {
|
||||
required: "To pole jest wymagane.",
|
||||
remote: "Proszę o wypełnienie tego pola.",
|
||||
email: "Proszę o podanie prawidłowego adresu email.",
|
||||
url: "Proszę o podanie prawidłowego URL.",
|
||||
date: "Proszę o podanie prawidłowej daty.",
|
||||
dateISO: "Proszę o podanie prawidłowej daty (ISO).",
|
||||
number: "Proszę o podanie prawidłowej liczby.",
|
||||
digits: "Proszę o podanie samych cyfr.",
|
||||
creditcard: "Proszę o podanie prawidłowej karty kredytowej.",
|
||||
equalTo: "Proszę o podanie tej samej wartości ponownie.",
|
||||
extension: "Proszę o podanie wartości z prawidłowym rozszerzeniem.",
|
||||
maxlength: $.validator.format( "Proszę o podanie nie więcej niż {0} znaków." ),
|
||||
minlength: $.validator.format( "Proszę o podanie przynajmniej {0} znaków." ),
|
||||
rangelength: $.validator.format( "Proszę o podanie wartości o długości od {0} do {1} znaków." ),
|
||||
range: $.validator.format( "Proszę o podanie wartości z przedziału od {0} do {1}." ),
|
||||
max: $.validator.format( "Proszę o podanie wartości mniejszej bądź równej {0}." ),
|
||||
min: $.validator.format( "Proszę o podanie wartości większej bądź równej {0}." ),
|
||||
pattern: $.validator.format( "Pole zawiera niedozwolone znaki." )
|
||||
} );
|
||||
412
Static/script/jQuery/parallax.js
Normal file
412
Static/script/jQuery/parallax.js
Normal file
@@ -0,0 +1,412 @@
|
||||
/*!
|
||||
* parallax.js v1.5.0 (http://pixelcog.github.io/parallax.js/)
|
||||
* @copyright 2016 PixelCog, Inc.
|
||||
* @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
;(function ( $, window, document, undefined ) {
|
||||
|
||||
// Polyfill for requestAnimationFrame
|
||||
// via: https://gist.github.com/paulirish/1579671
|
||||
|
||||
(function() {
|
||||
var lastTime = 0;
|
||||
var vendors = ['ms', 'moz', 'webkit', 'o'];
|
||||
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
|
||||
window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame'];
|
||||
window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame'];
|
||||
}
|
||||
|
||||
if (!window.requestAnimationFrame)
|
||||
window.requestAnimationFrame = function(callback) {
|
||||
var currTime = new Date().getTime();
|
||||
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
|
||||
var id = window.setTimeout(function() { callback(currTime + timeToCall); },
|
||||
timeToCall);
|
||||
lastTime = currTime + timeToCall;
|
||||
return id;
|
||||
};
|
||||
|
||||
if (!window.cancelAnimationFrame)
|
||||
window.cancelAnimationFrame = function(id) {
|
||||
clearTimeout(id);
|
||||
};
|
||||
}());
|
||||
|
||||
|
||||
// Parallax Constructor
|
||||
|
||||
function Parallax(element, options) {
|
||||
var self = this;
|
||||
|
||||
if (typeof options == 'object') {
|
||||
delete options.refresh;
|
||||
delete options.render;
|
||||
$.extend(this, options);
|
||||
}
|
||||
|
||||
this.$element = $(element);
|
||||
|
||||
if (!this.imageSrc && this.$element.is('img')) {
|
||||
this.imageSrc = this.$element.attr('src');
|
||||
}
|
||||
|
||||
var positions = (this.position + '').toLowerCase().match(/\S+/g) || [];
|
||||
|
||||
if (positions.length < 1) {
|
||||
positions.push('center');
|
||||
}
|
||||
if (positions.length == 1) {
|
||||
positions.push(positions[0]);
|
||||
}
|
||||
|
||||
if (positions[0] == 'top' || positions[0] == 'bottom' || positions[1] == 'left' || positions[1] == 'right') {
|
||||
positions = [positions[1], positions[0]];
|
||||
}
|
||||
|
||||
if (this.positionX !== undefined) positions[0] = this.positionX.toLowerCase();
|
||||
if (this.positionY !== undefined) positions[1] = this.positionY.toLowerCase();
|
||||
|
||||
self.positionX = positions[0];
|
||||
self.positionY = positions[1];
|
||||
|
||||
if (this.positionX != 'left' && this.positionX != 'right') {
|
||||
if (isNaN(parseInt(this.positionX))) {
|
||||
this.positionX = 'center';
|
||||
} else {
|
||||
this.positionX = parseInt(this.positionX);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.positionY != 'top' && this.positionY != 'bottom') {
|
||||
if (isNaN(parseInt(this.positionY))) {
|
||||
this.positionY = 'center';
|
||||
} else {
|
||||
this.positionY = parseInt(this.positionY);
|
||||
}
|
||||
}
|
||||
|
||||
this.position =
|
||||
this.positionX + (isNaN(this.positionX)? '' : 'px') + ' ' +
|
||||
this.positionY + (isNaN(this.positionY)? '' : 'px');
|
||||
|
||||
if (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
|
||||
if (this.imageSrc && this.iosFix && !this.$element.is('img')) {
|
||||
this.$element.css({
|
||||
backgroundImage: 'url(' + this.imageSrc + ')',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: this.position
|
||||
});
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
if (navigator.userAgent.match(/(Android)/)) {
|
||||
if (this.imageSrc && this.androidFix && !this.$element.is('img')) {
|
||||
this.$element.css({
|
||||
backgroundImage: 'url(' + this.imageSrc + ')',
|
||||
backgroundSize: 'cover',
|
||||
backgroundPosition: this.position
|
||||
});
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
this.$mirror = $('<div />').prependTo(this.mirrorContainer);
|
||||
|
||||
var slider = this.$element.find('>.parallax-slider');
|
||||
var sliderExisted = false;
|
||||
|
||||
if (slider.length == 0)
|
||||
this.$slider = $('<img />').prependTo(this.$mirror);
|
||||
else {
|
||||
this.$slider = slider.prependTo(this.$mirror)
|
||||
sliderExisted = true;
|
||||
}
|
||||
|
||||
this.$mirror.addClass('parallax-mirror').css({
|
||||
visibility: 'hidden',
|
||||
zIndex: this.zIndex,
|
||||
position: 'fixed',
|
||||
top: 0,
|
||||
left: 0,
|
||||
overflow: 'hidden'
|
||||
});
|
||||
|
||||
this.$slider.addClass('parallax-slider').one('load', function() {
|
||||
if (!self.naturalHeight || !self.naturalWidth) {
|
||||
self.naturalHeight = this.naturalHeight || this.height || 1;
|
||||
self.naturalWidth = this.naturalWidth || this.width || 1;
|
||||
}
|
||||
self.aspectRatio = self.naturalWidth / self.naturalHeight;
|
||||
|
||||
Parallax.isSetup || Parallax.setup();
|
||||
Parallax.sliders.push(self);
|
||||
Parallax.isFresh = false;
|
||||
Parallax.requestRender();
|
||||
});
|
||||
|
||||
if (!sliderExisted)
|
||||
this.$slider[0].src = this.imageSrc;
|
||||
|
||||
if (this.naturalHeight && this.naturalWidth || this.$slider[0].complete || slider.length > 0) {
|
||||
this.$slider.trigger('load');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Parallax Instance Methods
|
||||
|
||||
$.extend(Parallax.prototype, {
|
||||
speed: 0.2,
|
||||
bleed: 0,
|
||||
zIndex: -100,
|
||||
iosFix: true,
|
||||
androidFix: true,
|
||||
position: 'center',
|
||||
overScrollFix: false,
|
||||
mirrorContainer: 'body',
|
||||
|
||||
refresh: function() {
|
||||
this.boxWidth = this.$element.outerWidth();
|
||||
this.boxHeight = this.$element.outerHeight() + this.bleed * 2;
|
||||
this.boxOffsetTop = this.$element.offset().top - this.bleed;
|
||||
this.boxOffsetLeft = this.$element.offset().left;
|
||||
this.boxOffsetBottom = this.boxOffsetTop + this.boxHeight;
|
||||
|
||||
var winHeight = Parallax.winHeight;
|
||||
var docHeight = Parallax.docHeight;
|
||||
var maxOffset = Math.min(this.boxOffsetTop, docHeight - winHeight);
|
||||
var minOffset = Math.max(this.boxOffsetTop + this.boxHeight - winHeight, 0);
|
||||
var imageHeightMin = this.boxHeight + (maxOffset - minOffset) * (1 - this.speed) | 0;
|
||||
var imageOffsetMin = (this.boxOffsetTop - maxOffset) * (1 - this.speed) | 0;
|
||||
var margin;
|
||||
|
||||
if (imageHeightMin * this.aspectRatio >= this.boxWidth) {
|
||||
this.imageWidth = imageHeightMin * this.aspectRatio | 0;
|
||||
this.imageHeight = imageHeightMin;
|
||||
this.offsetBaseTop = imageOffsetMin;
|
||||
|
||||
margin = this.imageWidth - this.boxWidth;
|
||||
|
||||
if (this.positionX == 'left') {
|
||||
this.offsetLeft = 0;
|
||||
} else if (this.positionX == 'right') {
|
||||
this.offsetLeft = - margin;
|
||||
} else if (!isNaN(this.positionX)) {
|
||||
this.offsetLeft = Math.max(this.positionX, - margin);
|
||||
} else {
|
||||
this.offsetLeft = - margin / 2 | 0;
|
||||
}
|
||||
} else {
|
||||
this.imageWidth = this.boxWidth;
|
||||
this.imageHeight = this.boxWidth / this.aspectRatio | 0;
|
||||
this.offsetLeft = 0;
|
||||
|
||||
margin = this.imageHeight - imageHeightMin;
|
||||
|
||||
if (this.positionY == 'top') {
|
||||
this.offsetBaseTop = imageOffsetMin;
|
||||
} else if (this.positionY == 'bottom') {
|
||||
this.offsetBaseTop = imageOffsetMin - margin;
|
||||
} else if (!isNaN(this.positionY)) {
|
||||
this.offsetBaseTop = imageOffsetMin + Math.max(this.positionY, - margin);
|
||||
} else {
|
||||
this.offsetBaseTop = imageOffsetMin - margin / 2 | 0;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
render: function() {
|
||||
var scrollTop = Parallax.scrollTop;
|
||||
var scrollLeft = Parallax.scrollLeft;
|
||||
var overScroll = this.overScrollFix ? Parallax.overScroll : 0;
|
||||
var scrollBottom = scrollTop + Parallax.winHeight;
|
||||
|
||||
if (this.boxOffsetBottom > scrollTop && this.boxOffsetTop <= scrollBottom) {
|
||||
this.visibility = 'visible';
|
||||
this.mirrorTop = this.boxOffsetTop - scrollTop;
|
||||
this.mirrorLeft = this.boxOffsetLeft - scrollLeft;
|
||||
this.offsetTop = this.offsetBaseTop - this.mirrorTop * (1 - this.speed);
|
||||
} else {
|
||||
this.visibility = 'hidden';
|
||||
}
|
||||
|
||||
this.$mirror.css({
|
||||
transform: 'translate3d('+this.mirrorLeft+'px, '+(this.mirrorTop - overScroll)+'px, 0px)',
|
||||
visibility: this.visibility,
|
||||
height: this.boxHeight,
|
||||
width: this.boxWidth
|
||||
});
|
||||
|
||||
this.$slider.css({
|
||||
transform: 'translate3d('+this.offsetLeft+'px, '+this.offsetTop+'px, 0px)',
|
||||
position: 'absolute',
|
||||
height: this.imageHeight,
|
||||
width: this.imageWidth,
|
||||
maxWidth: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Parallax Static Methods
|
||||
|
||||
$.extend(Parallax, {
|
||||
scrollTop: 0,
|
||||
scrollLeft: 0,
|
||||
winHeight: 0,
|
||||
winWidth: 0,
|
||||
docHeight: 1 << 30,
|
||||
docWidth: 1 << 30,
|
||||
sliders: [],
|
||||
isReady: false,
|
||||
isFresh: false,
|
||||
isBusy: false,
|
||||
|
||||
setup: function() {
|
||||
if (this.isReady) return;
|
||||
|
||||
var self = this;
|
||||
|
||||
var $doc = $(document), $win = $(window);
|
||||
|
||||
var loadDimensions = function() {
|
||||
Parallax.winHeight = $win.height();
|
||||
Parallax.winWidth = $win.width();
|
||||
Parallax.docHeight = $doc.height();
|
||||
Parallax.docWidth = $doc.width();
|
||||
};
|
||||
|
||||
var loadScrollPosition = function() {
|
||||
var winScrollTop = $win.scrollTop();
|
||||
var scrollTopMax = Parallax.docHeight - Parallax.winHeight;
|
||||
var scrollLeftMax = Parallax.docWidth - Parallax.winWidth;
|
||||
Parallax.scrollTop = Math.max(0, Math.min(scrollTopMax, winScrollTop));
|
||||
Parallax.scrollLeft = Math.max(0, Math.min(scrollLeftMax, $win.scrollLeft()));
|
||||
Parallax.overScroll = Math.max(winScrollTop - scrollTopMax, Math.min(winScrollTop, 0));
|
||||
};
|
||||
|
||||
$win.on('resize.px.parallax load.px.parallax', function() {
|
||||
loadDimensions();
|
||||
self.refresh();
|
||||
Parallax.isFresh = false;
|
||||
Parallax.requestRender();
|
||||
})
|
||||
.on('scroll.px.parallax load.px.parallax', function() {
|
||||
loadScrollPosition();
|
||||
Parallax.requestRender();
|
||||
});
|
||||
|
||||
loadDimensions();
|
||||
loadScrollPosition();
|
||||
|
||||
this.isReady = true;
|
||||
|
||||
var lastPosition = -1;
|
||||
|
||||
function frameLoop() {
|
||||
if (lastPosition == window.pageYOffset) { // Avoid overcalculations
|
||||
window.requestAnimationFrame(frameLoop);
|
||||
return false;
|
||||
} else lastPosition = window.pageYOffset;
|
||||
|
||||
self.render();
|
||||
window.requestAnimationFrame(frameLoop);
|
||||
}
|
||||
|
||||
frameLoop();
|
||||
},
|
||||
|
||||
configure: function(options) {
|
||||
if (typeof options == 'object') {
|
||||
delete options.refresh;
|
||||
delete options.render;
|
||||
$.extend(this.prototype, options);
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function() {
|
||||
$.each(this.sliders, function(){ this.refresh(); });
|
||||
this.isFresh = true;
|
||||
},
|
||||
|
||||
render: function() {
|
||||
this.isFresh || this.refresh();
|
||||
$.each(this.sliders, function(){ this.render(); });
|
||||
},
|
||||
|
||||
requestRender: function() {
|
||||
var self = this;
|
||||
self.render();
|
||||
self.isBusy = false;
|
||||
},
|
||||
destroy: function(el){
|
||||
var i,
|
||||
parallaxElement = $(el).data('px.parallax');
|
||||
parallaxElement.$mirror.remove();
|
||||
for(i=0; i < this.sliders.length; i+=1){
|
||||
if(this.sliders[i] == parallaxElement){
|
||||
this.sliders.splice(i, 1);
|
||||
}
|
||||
}
|
||||
$(el).data('px.parallax', false);
|
||||
if(this.sliders.length === 0){
|
||||
$(window).off('scroll.px.parallax resize.px.parallax load.px.parallax');
|
||||
this.isReady = false;
|
||||
Parallax.isSetup = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Parallax Plugin Definition
|
||||
|
||||
function Plugin(option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var options = typeof option == 'object' && option;
|
||||
|
||||
if (this == window || this == document || $this.is('body')) {
|
||||
Parallax.configure(options);
|
||||
}
|
||||
else if (!$this.data('px.parallax')) {
|
||||
options = $.extend({}, $this.data(), options);
|
||||
$this.data('px.parallax', new Parallax(this, options));
|
||||
}
|
||||
else if (typeof option == 'object')
|
||||
{
|
||||
$.extend($this.data('px.parallax'), options);
|
||||
}
|
||||
if (typeof option == 'string') {
|
||||
if(option == 'destroy'){
|
||||
Parallax.destroy(this);
|
||||
}else{
|
||||
Parallax[option]();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var old = $.fn.parallax;
|
||||
|
||||
$.fn.parallax = Plugin;
|
||||
$.fn.parallax.Constructor = Parallax;
|
||||
|
||||
|
||||
// Parallax No Conflict
|
||||
|
||||
$.fn.parallax.noConflict = function () {
|
||||
$.fn.parallax = old;
|
||||
return this;
|
||||
};
|
||||
|
||||
|
||||
// Parallax Data-API
|
||||
|
||||
$( function () {
|
||||
$('[data-parallax="scroll"]').parallax();
|
||||
});
|
||||
|
||||
}(jQuery, window, document));
|
||||
208
Static/script/jQuery/scrollintoview.js
Normal file
208
Static/script/jQuery/scrollintoview.js
Normal file
@@ -0,0 +1,208 @@
|
||||
/*!
|
||||
* jQuery scrollintoview() plugin and :scrollable selector filter
|
||||
*
|
||||
* Version 1.8 (14 Jul 2011)
|
||||
* Requires jQuery 1.4 or newer
|
||||
*
|
||||
* Copyright (c) 2011 Robert Koritnik
|
||||
* Licensed under the terms of the MIT license
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*/
|
||||
|
||||
(function ($) {
|
||||
var converter = {
|
||||
vertical: { x: false, y: true },
|
||||
horizontal: { x: true, y: false },
|
||||
both: { x: true, y: true },
|
||||
x: { x: true, y: false },
|
||||
y: { x: false, y: true }
|
||||
};
|
||||
|
||||
var settings = {
|
||||
duration: "fast",
|
||||
direction: "both"
|
||||
};
|
||||
|
||||
var rootrx = /^(?:html)$/i;
|
||||
|
||||
// gets border dimensions
|
||||
var borders = function (domElement, styles) {
|
||||
styles = styles || (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(domElement, null) : domElement.currentStyle);
|
||||
var px = document.defaultView && document.defaultView.getComputedStyle ? true : false;
|
||||
var b = {
|
||||
top: (parseFloat(px ? styles.borderTopWidth : $.css(domElement, "borderTopWidth")) || 0),
|
||||
left: (parseFloat(px ? styles.borderLeftWidth : $.css(domElement, "borderLeftWidth")) || 0),
|
||||
bottom: (parseFloat(px ? styles.borderBottomWidth : $.css(domElement, "borderBottomWidth")) || 0),
|
||||
right: (parseFloat(px ? styles.borderRightWidth : $.css(domElement, "borderRightWidth")) || 0)
|
||||
};
|
||||
return {
|
||||
top: b.top,
|
||||
left: b.left,
|
||||
bottom: b.bottom,
|
||||
right: b.right,
|
||||
vertical: b.top + b.bottom,
|
||||
horizontal: b.left + b.right
|
||||
};
|
||||
};
|
||||
|
||||
var dimensions = function ($element) {
|
||||
var win = $(window);
|
||||
var isRoot = rootrx.test($element[0].nodeName);
|
||||
return {
|
||||
border: isRoot ? { top: 0, left: 0, bottom: 0, right: 0} : borders($element[0]),
|
||||
scroll: {
|
||||
top: (isRoot ? win : $element).scrollTop(),
|
||||
left: (isRoot ? win : $element).scrollLeft()
|
||||
},
|
||||
scrollbar: {
|
||||
right: isRoot ? 0 : $element.innerWidth() - $element[0].clientWidth,
|
||||
bottom: isRoot ? 0 : $element.innerHeight() - $element[0].clientHeight
|
||||
},
|
||||
rect: (function () {
|
||||
var r = $element[0].getBoundingClientRect();
|
||||
return {
|
||||
top: isRoot ? 0 : r.top,
|
||||
left: isRoot ? 0 : r.left,
|
||||
bottom: isRoot ? $element[0].clientHeight : r.bottom,
|
||||
right: isRoot ? $element[0].clientWidth : r.right
|
||||
};
|
||||
})()
|
||||
};
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
scrollintoview: function (options) {
|
||||
/// <summary>Scrolls the first element in the set into view by scrolling its closest scrollable parent.</summary>
|
||||
/// <param name="options" type="Object">Additional options that can configure scrolling:
|
||||
/// duration (default: "fast") - jQuery animation speed (can be a duration string or number of milliseconds)
|
||||
/// direction (default: "both") - select possible scrollings ("vertical" or "y", "horizontal" or "x", "both")
|
||||
/// complete (default: none) - a function to call when scrolling completes (called in context of the DOM element being scrolled)
|
||||
/// </param>
|
||||
/// <return type="jQuery">Returns the same jQuery set that this function was run on.</return>
|
||||
|
||||
options = $.extend({}, settings, options);
|
||||
options.direction = converter[typeof (options.direction) === "string" && options.direction.toLowerCase()] || converter.both;
|
||||
|
||||
var dirStr = "";
|
||||
if (options.direction.x === true) dirStr = "horizontal";
|
||||
if (options.direction.y === true) dirStr = dirStr ? "both" : "vertical";
|
||||
|
||||
var el = this.eq(0);
|
||||
var scroller = el.closest(":scrollable(" + dirStr + ")");
|
||||
|
||||
// check if there's anything to scroll in the first place
|
||||
if (scroller.length > 0)
|
||||
{
|
||||
scroller = scroller.eq(0);
|
||||
|
||||
var dim = {
|
||||
e: dimensions(el),
|
||||
s: dimensions(scroller)
|
||||
};
|
||||
|
||||
var rel = {
|
||||
top: dim.e.rect.top - (dim.s.rect.top + dim.s.border.top),
|
||||
bottom: dim.s.rect.bottom - dim.s.border.bottom - dim.s.scrollbar.bottom - dim.e.rect.bottom,
|
||||
left: dim.e.rect.left - (dim.s.rect.left + dim.s.border.left),
|
||||
right: dim.s.rect.right - dim.s.border.right - dim.s.scrollbar.right - dim.e.rect.right
|
||||
};
|
||||
|
||||
var animOptions = {};
|
||||
|
||||
// vertical scroll
|
||||
if (options.direction.y === true)
|
||||
{
|
||||
if (rel.top < 0)
|
||||
{
|
||||
animOptions.scrollTop = dim.s.scroll.top + rel.top;
|
||||
}
|
||||
else if (rel.top > 0 && rel.bottom < 0)
|
||||
{
|
||||
animOptions.scrollTop = dim.s.scroll.top + Math.min(rel.top, -rel.bottom);
|
||||
}
|
||||
}
|
||||
|
||||
// horizontal scroll
|
||||
if (options.direction.x === true)
|
||||
{
|
||||
if (rel.left < 0)
|
||||
{
|
||||
animOptions.scrollLeft = dim.s.scroll.left + rel.left;
|
||||
}
|
||||
else if (rel.left > 0 && rel.right < 0)
|
||||
{
|
||||
animOptions.scrollLeft = dim.s.scroll.left + Math.min(rel.left, -rel.right);
|
||||
}
|
||||
}
|
||||
|
||||
// scroll if needed
|
||||
if (!$.isEmptyObject(animOptions))
|
||||
{
|
||||
if (rootrx.test(scroller[0].nodeName))
|
||||
{
|
||||
scroller = $("html,body");
|
||||
}
|
||||
scroller
|
||||
.animate(animOptions, options.duration)
|
||||
.eq(0) // we want function to be called just once (ref. "html,body")
|
||||
.queue(function (next) {
|
||||
$.isFunction(options.complete) && options.complete.call(scroller[0]);
|
||||
next();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// when there's nothing to scroll, just call the "complete" function
|
||||
$.isFunction(options.complete) && options.complete.call(scroller[0]);
|
||||
}
|
||||
}
|
||||
|
||||
// return set back
|
||||
return this;
|
||||
}
|
||||
});
|
||||
|
||||
var scrollValue = {
|
||||
auto: true,
|
||||
scroll: true,
|
||||
visible: false,
|
||||
hidden: false
|
||||
};
|
||||
|
||||
$.extend($.expr[":"], {
|
||||
scrollable: function (element, index, meta, stack) {
|
||||
var direction = converter[typeof (meta[3]) === "string" && meta[3].toLowerCase()] || converter.both;
|
||||
var styles = (document.defaultView && document.defaultView.getComputedStyle ? document.defaultView.getComputedStyle(element, null) : element.currentStyle);
|
||||
var overflow = {
|
||||
x: scrollValue[styles.overflowX.toLowerCase()] || false,
|
||||
y: scrollValue[styles.overflowY.toLowerCase()] || false,
|
||||
isRoot: rootrx.test(element.nodeName)
|
||||
};
|
||||
|
||||
// check if completely unscrollable (exclude HTML element because it's special)
|
||||
if (!overflow.x && !overflow.y && !overflow.isRoot)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var size = {
|
||||
height: {
|
||||
scroll: element.scrollHeight,
|
||||
client: element.clientHeight
|
||||
},
|
||||
width: {
|
||||
scroll: element.scrollWidth,
|
||||
client: element.clientWidth
|
||||
},
|
||||
// check overflow.x/y because iPad (and possibly other tablets) don't dislay scrollbars
|
||||
scrollableX: function () {
|
||||
return (overflow.x || overflow.isRoot) && this.width.scroll > this.width.client;
|
||||
},
|
||||
scrollableY: function () {
|
||||
return (overflow.y || overflow.isRoot) && this.height.scroll > this.height.client;
|
||||
}
|
||||
};
|
||||
return direction.y && size.scrollableY() || direction.x && size.scrollableX();
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
||||
60
Static/script/jQuery/validate.sendCareer.js
Normal file
60
Static/script/jQuery/validate.sendCareer.js
Normal file
@@ -0,0 +1,60 @@
|
||||
$(document).ready(function(){
|
||||
$('#sendCareer').submit(function() {
|
||||
$('._phone').each(function() {
|
||||
this.value = this.value.toString().split(" ").join("").split("-").join("");
|
||||
});
|
||||
});
|
||||
|
||||
$.validator.addMethod(
|
||||
"regex",
|
||||
function(value, element, regexp) {
|
||||
var check = false;
|
||||
var re = new RegExp(regexp);
|
||||
return this.optional(element) || re.test(value);
|
||||
},
|
||||
"pole musi zawierać tylko litery"
|
||||
);
|
||||
|
||||
$('#sendCareer').validate({
|
||||
rules: {
|
||||
name : {
|
||||
required: true
|
||||
},
|
||||
email : {
|
||||
required: true,
|
||||
email: true
|
||||
},
|
||||
message : {
|
||||
required: true
|
||||
},
|
||||
agreement : {
|
||||
required: true
|
||||
},
|
||||
file : {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
name: {
|
||||
required: translate('required_field')
|
||||
},
|
||||
email: {
|
||||
required: translate('required_field'),
|
||||
email: translate('invalid_email')
|
||||
},
|
||||
agreement: {
|
||||
required: translate('required_field')
|
||||
},
|
||||
file: {
|
||||
required: translate('required_field')
|
||||
},
|
||||
message: {
|
||||
required: translate('required_field')
|
||||
}
|
||||
},
|
||||
errorElement: "p",
|
||||
errorClass: "warning"
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
58
Static/script/jQuery/validate.sendContact.js
Normal file
58
Static/script/jQuery/validate.sendContact.js
Normal file
@@ -0,0 +1,58 @@
|
||||
$(document).ready(function () {
|
||||
$('#sendContactForm').submit(function () {
|
||||
$('._phone').each(function () {
|
||||
this.value = this.value.toString().split(" ").join("").split("-").join("");
|
||||
});
|
||||
});
|
||||
|
||||
$.validator.addMethod(
|
||||
"regex",
|
||||
function (value, element, regexp) {
|
||||
var check = false;
|
||||
var re = new RegExp(regexp);
|
||||
return this.optional(element) || re.test(value);
|
||||
},
|
||||
"pole musi zawierać tylko litery"
|
||||
);
|
||||
|
||||
$('#sendContactForm').validate({
|
||||
rules: {
|
||||
|
||||
name: {
|
||||
required: true
|
||||
},
|
||||
surname: {
|
||||
required: true
|
||||
},
|
||||
email: {
|
||||
required: true,
|
||||
email: true
|
||||
},
|
||||
phone: {
|
||||
required: true
|
||||
},
|
||||
message: {
|
||||
required: true
|
||||
},
|
||||
hiddenRecaptcha: {
|
||||
required: function () {
|
||||
if (grecaptcha.getResponse() == '') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
errorElement: "p",
|
||||
errorClass: "warning"
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
function recaptchaCallback() {
|
||||
$('#hiddenRecaptcha').valid();
|
||||
}
|
||||
;
|
||||
51
Static/script/jQuery/validate.sendFormDownload.js
Normal file
51
Static/script/jQuery/validate.sendFormDownload.js
Normal file
@@ -0,0 +1,51 @@
|
||||
$(document).ready(function(){
|
||||
$('#sendFormDownload').submit(function() {
|
||||
$('._phone').each(function() {
|
||||
this.value = this.value.toString().split(" ").join("").split("-").join("");
|
||||
});
|
||||
});
|
||||
|
||||
$.validator.addMethod(
|
||||
"regex",
|
||||
function(value, element, regexp) {
|
||||
var check = false;
|
||||
var re = new RegExp(regexp);
|
||||
return this.optional(element) || re.test(value);
|
||||
},
|
||||
"pole musi zawierać tylko litery"
|
||||
);
|
||||
|
||||
$('#sendFormDownload').validate({
|
||||
rules: {
|
||||
name : {
|
||||
required: true
|
||||
},
|
||||
email : {
|
||||
required: true,
|
||||
email: true
|
||||
},
|
||||
message : {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
name: {
|
||||
required: translate('required_field')
|
||||
},
|
||||
email: {
|
||||
required: translate('required_field'),
|
||||
email: translate('invalid_email')
|
||||
},
|
||||
agreement: {
|
||||
required: translate('required_field')
|
||||
},
|
||||
message: {
|
||||
required: translate('required_field')
|
||||
}
|
||||
},
|
||||
errorElement: "p",
|
||||
errorClass: "warning"
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
610
Static/script/jQuery/zoomy.js
Normal file
610
Static/script/jQuery/zoomy.js
Normal file
@@ -0,0 +1,610 @@
|
||||
/*
|
||||
* Zoomy 1.3.3 - jQuery plugin
|
||||
* http://redeyeops.com/plugins/zoomy
|
||||
*
|
||||
* Copyright (c) 2010 Jacob Lowe (http://redeyeoperations.com)
|
||||
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||||
* and GPL (GPL-LICENSE.txt) licenses.
|
||||
*
|
||||
* Built for jQuery library
|
||||
* http://jquery.com
|
||||
*
|
||||
* Addition fixes and modifications done by Larry Battle ( blarry@bateru.com )
|
||||
* Code has been refactored and the logic has been corrected.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function ($) {
|
||||
|
||||
// global zoomys state, Indexed, 0 = no zoom, 1 = zoom;
|
||||
|
||||
'use strict';
|
||||
var ZoomyS = {
|
||||
count : [],
|
||||
pos: null
|
||||
};
|
||||
|
||||
|
||||
$.fn.zoomy = function (event, options) {
|
||||
|
||||
//defaults && option list
|
||||
var defaults = {
|
||||
zoomSize: 200,
|
||||
round: true,
|
||||
glare: true,
|
||||
clickable: false,
|
||||
attr: 'href',
|
||||
border: '5px solid #999',
|
||||
zoomInit: null, //callback for when zoom initializes
|
||||
zoomStart: null, // callback for when zoom starts
|
||||
zoomStop: null // callback for when the zoom ends
|
||||
},
|
||||
defaultEvent = 'click',
|
||||
|
||||
|
||||
change = {
|
||||
|
||||
// Move Zoom Cursor
|
||||
|
||||
move : function (ele, zoom, e) {
|
||||
var ratio = function (x, y) {
|
||||
var z = x / y;
|
||||
return z;
|
||||
},
|
||||
id = zoom.attr('rel'),
|
||||
l = ele.offset(),
|
||||
theOffset = ZoomyS[id].zoom.border,
|
||||
zoomImgX = ZoomyS[id].zoom.x,
|
||||
zoomImgY = ZoomyS[id].zoom.y,
|
||||
tnImgX = ZoomyS[id].css.width,
|
||||
tnImgY = ZoomyS[id].css.height,
|
||||
zoomSize = options.zoomSize + (theOffset * 2),
|
||||
halfSize = zoomSize / 2,
|
||||
ratioX = ratio(tnImgX, zoomImgX),
|
||||
ratioY = ratio(tnImgY, zoomImgY),
|
||||
stop = halfSize - (halfSize * ratioX) - (theOffset * ratioX) + theOffset,
|
||||
stopPos = function (x) {
|
||||
var p = (x - zoomSize - theOffset) + stop;
|
||||
return p;
|
||||
},
|
||||
rightStop = stopPos(tnImgX),
|
||||
bottomStop = stopPos(tnImgY),
|
||||
zoomY = zoomImgY - zoomSize,
|
||||
zoomX = zoomImgX - zoomSize,
|
||||
mousePos = function (x, y) {
|
||||
var p = x - y - halfSize;
|
||||
return p;
|
||||
},
|
||||
zoomPos = function (x, y, z) {
|
||||
var p = ((x - y) / z) - halfSize + theOffset;
|
||||
return p;
|
||||
},
|
||||
cdCreate = function (a, b, c, d) {
|
||||
var bgPos = '-' + a + 'px ' + '-' + b + 'px',
|
||||
o = {
|
||||
backgroundPosition: bgPos,
|
||||
left: c,
|
||||
top: d
|
||||
};
|
||||
return o;
|
||||
},
|
||||
posX = mousePos(e.pageX, l.left),
|
||||
posY = mousePos(e.pageY, l.top),
|
||||
leftX = zoomPos(e.pageX, l.left, ratioX),
|
||||
topY = zoomPos(e.pageY, l.top, ratioY),
|
||||
|
||||
// Collision Detection Possiblities
|
||||
|
||||
arrPosb = {
|
||||
|
||||
// In the Center
|
||||
|
||||
0 : [leftX, topY, posX, posY],
|
||||
|
||||
// On Left Side
|
||||
|
||||
1 : [0, topY, -stop, posY],
|
||||
|
||||
// On the Top Left Corner
|
||||
|
||||
2 : [0, 0, -stop, -stop],
|
||||
|
||||
//On the Bottom Left Corner
|
||||
|
||||
3 : [0, zoomY, -stop, bottomStop],
|
||||
|
||||
// On the Top
|
||||
|
||||
4 : [leftX, 0, posX, -stop],
|
||||
|
||||
//On the Top Right Corner
|
||||
|
||||
5 : [zoomX, 0, rightStop, -stop],
|
||||
|
||||
//On the Right Side
|
||||
|
||||
6 : [zoomX, topY, rightStop, posY],
|
||||
|
||||
|
||||
//On the Bottom Right Corner
|
||||
|
||||
7 : [zoomX, zoomY, rightStop, bottomStop],
|
||||
|
||||
//On the Bottom
|
||||
|
||||
8 : [leftX, zoomY, posX, bottomStop]
|
||||
},
|
||||
|
||||
// Test for collisions
|
||||
|
||||
a = -stop <= posX,
|
||||
e2 = -stop > posX,
|
||||
b = -stop <= posY,
|
||||
f = -stop > posY,
|
||||
d = bottomStop > posY,
|
||||
g = bottomStop <= posY,
|
||||
c = rightStop > posX,
|
||||
j = rightStop <= posX,
|
||||
|
||||
|
||||
// Results
|
||||
|
||||
cssArrIndex = (a && b && c && d) ? 0 : (e2) ? (b && d) ? 1 : (f) ? 2 : (g) ? 3 : null : (f) ? (c) ? 4 : 5 : (j) ? (d) ? 6 : 7 : (g) ? 8 : null,
|
||||
|
||||
//Create CSS object to move Zoomy
|
||||
|
||||
move = cdCreate(arrPosb[cssArrIndex][0], arrPosb[cssArrIndex][1], arrPosb[cssArrIndex][2], arrPosb[cssArrIndex][3], arrPosb[cssArrIndex][4], arrPosb[cssArrIndex][5]);
|
||||
|
||||
|
||||
//Uncomment to see Index number for collision type
|
||||
//console.log(cssArrIndex)
|
||||
|
||||
// And Actual Call
|
||||
|
||||
zoom.css(move || {});
|
||||
|
||||
},
|
||||
|
||||
// Change classes for original image effect
|
||||
|
||||
classes : function (ele) {
|
||||
var i = ele.find('.zoomy').attr('rel');
|
||||
if (ZoomyS[i].state === 0 || ZoomyS[i].state === null) {
|
||||
ele.removeClass('inactive');
|
||||
} else {
|
||||
ele.addClass('inactive');
|
||||
}
|
||||
},
|
||||
|
||||
// Enter zoom area start up Zoom again
|
||||
|
||||
enter : function (ele, zoom) {
|
||||
var i = zoom.attr('rel');
|
||||
ZoomyS[i].state = 1;
|
||||
zoom.css('visibility', 'visible');
|
||||
change.classes(ele);
|
||||
},
|
||||
|
||||
// Leave zoom area
|
||||
|
||||
leave : function (ele, zoom, x) {
|
||||
var i = zoom.attr('rel');
|
||||
if (x !== null) {
|
||||
ZoomyS[i].state = null;
|
||||
} else {
|
||||
ZoomyS[i].state = 0;
|
||||
}
|
||||
zoom.css('visibility', 'hidden');
|
||||
change.classes(ele);
|
||||
},
|
||||
|
||||
// Callback handler (startZoom && stopZoom)
|
||||
|
||||
callback : function (type, zoom) {
|
||||
var callbackFunc = type,
|
||||
zoomId = zoom.attr('rel');
|
||||
|
||||
if (callbackFunc !== null && typeof callbackFunc === 'function') {
|
||||
|
||||
callbackFunc($.extend({}, ZoomyS[zoomId], ZoomyS.pos));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
// Styling Object, holds pretty much all styling except for some minor tweeks
|
||||
|
||||
style = {
|
||||
|
||||
round : function (x, y) {
|
||||
var cssObj = (!options.round) ? 0 : ( x === undefined) ? options.zoomSize + y / 2 + 'px' : options.zoomSize / 2 + 'px ' + options.zoomSize / 2 + 'px 0px 0px';
|
||||
return cssObj;
|
||||
},
|
||||
|
||||
glare : function (zoom) {
|
||||
zoom.children('span').css({
|
||||
height: options.zoomSize / 2,
|
||||
width: options.zoomSize - 10,
|
||||
margin: ($.browser.msie && parseInt($.browser.version, 10) === 9) ? 0 : '5px auto',
|
||||
'border-radius': style.round(0)
|
||||
});
|
||||
},
|
||||
|
||||
border: function (zoom) {
|
||||
|
||||
var borderRaw = options.border.replace(/^\s*|\s*$/g,''),
|
||||
borderArr = borderRaw.split(' '),
|
||||
interger = parseFloat(borderArr[0]),
|
||||
size = (borderArr.length > 2 && interger * 1 === interger ) ? interger : 0;
|
||||
|
||||
|
||||
|
||||
return [borderRaw, size];
|
||||
},
|
||||
|
||||
params : function (ele, zoom) {
|
||||
var img = ele.children('img'),
|
||||
|
||||
// TODO: Create function to filter out percents
|
||||
border = style.border(zoom),
|
||||
|
||||
margin = {
|
||||
'marginTop': img.css('margin-top'),
|
||||
'marginRight': img.css('margin-right'),
|
||||
'marginBottom': img.css('margin-bottom'),
|
||||
'marginLeft': img.css('margin-left')
|
||||
},
|
||||
|
||||
floats = {
|
||||
'float': img.css('float')
|
||||
},
|
||||
|
||||
//Zoomy needs these to work
|
||||
|
||||
zoomMin = {
|
||||
'display': 'block',
|
||||
height: img.height(),
|
||||
width: img.width(),
|
||||
'position': 'relative'
|
||||
|
||||
},
|
||||
|
||||
//A lil bit of geneology o.0
|
||||
|
||||
parentCenter = function () {
|
||||
|
||||
//Checking for parent text-align center
|
||||
|
||||
var textAlign = ele.parent('*:first').css('text-align');
|
||||
if (textAlign === 'center') {
|
||||
margin.marginRight = 'auto';
|
||||
margin.marginLeft = 'auto';
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
id = zoom.attr('rel'),
|
||||
css = {};
|
||||
|
||||
|
||||
|
||||
if (floats['float'] === 'none') {
|
||||
parentCenter();
|
||||
}
|
||||
|
||||
$.extend(css, margin, floats, zoomMin);
|
||||
|
||||
ZoomyS[id].css = css;
|
||||
|
||||
if (!options.glare) {
|
||||
zoom.children('span').css({
|
||||
height: options.zoomSize - 10,
|
||||
width: options.zoomSize - 10
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
zoom.css({
|
||||
height: options.zoomSize,
|
||||
width: options.zoomSize,
|
||||
'border-radius': style.round(undefined, border[1]),
|
||||
border: border[0]
|
||||
});
|
||||
|
||||
|
||||
|
||||
img.css('margin', '0px');
|
||||
|
||||
|
||||
img.one("load", function () {
|
||||
ele.css(ZoomyS[id].css);
|
||||
}).each(function () {
|
||||
if (this.complete || ($.browser.msie && parseInt($.browser.version, 10) === 6)) {
|
||||
$(this).trigger("load");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
// Build Object, Elements are added to the DOM here
|
||||
|
||||
build = {
|
||||
|
||||
// Load Zoom Image
|
||||
|
||||
image : function (image, zoom) {
|
||||
var id = zoom.attr('rel');
|
||||
//Move the Zoomy out of the screen view while loading img
|
||||
zoom.show().css({top: '-999999px', left: '-999999px'});
|
||||
|
||||
if (zoom.find('img').attr('src') !== image) {
|
||||
zoom.find('img').attr('src', image).load(function () {
|
||||
|
||||
var assets = (options.glare) ? '<span/>' : '',
|
||||
border = style.border(zoom);
|
||||
|
||||
image = image.replace(/ /g, '%20');
|
||||
|
||||
ZoomyS[id].zoom = {
|
||||
'x': zoom.find('img').width(),
|
||||
'y': zoom.find('img').height(),
|
||||
'border': border[1]
|
||||
};
|
||||
|
||||
zoom.append(assets)
|
||||
.css({
|
||||
'background-image': 'url(' + image + ')'
|
||||
})
|
||||
.find('img')
|
||||
.remove();
|
||||
|
||||
style.glare(zoom);
|
||||
|
||||
}).each(function () {
|
||||
|
||||
if (this.complete || ($.browser.msie && parseInt($.browser.version, 10) === 6)) {
|
||||
|
||||
$(this).trigger("load");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
// Add zoom element to page
|
||||
|
||||
zoom : function (ele, i) {
|
||||
|
||||
//Adding Initial State
|
||||
|
||||
ZoomyS[i] = {
|
||||
state: null,
|
||||
index : i
|
||||
};
|
||||
|
||||
ZoomyS.count.push(0);
|
||||
|
||||
// Picking from the right attibute
|
||||
|
||||
var image = (typeof (ele.attr(options.attr)) === 'string' && options.attr !== 'href') ? ele.attr(options.attr) : ele.attr('href'),
|
||||
zoom = null,
|
||||
initCallback = options.zoomInit,
|
||||
eventHandler = function () {
|
||||
var eventlist = [], //List of Actual Events
|
||||
zoomMove = function (e) {
|
||||
|
||||
change.move(ele, zoom, e);
|
||||
|
||||
//ZoomyS.pos = e;
|
||||
|
||||
},
|
||||
zoomStart = function () {
|
||||
change.enter(ele, zoom);
|
||||
|
||||
ele.bind('mousemove', zoomMove);
|
||||
|
||||
/* Start Zoom Callback */
|
||||
|
||||
change.callback(options.zoomStart, zoom);
|
||||
},
|
||||
zoomStop = function (x) {
|
||||
change.leave(ele, zoom, x);
|
||||
|
||||
ele.unbind('mousemove', zoomMove);
|
||||
|
||||
/* Start Zoom Callback */
|
||||
|
||||
change.callback(options.zoomStop, zoom);
|
||||
},
|
||||
events = { //List of Possible Events
|
||||
event: function (e) {
|
||||
|
||||
ZoomyS.pos = e;
|
||||
|
||||
if (!options.clickable) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (ZoomyS[i].state === 0 || ZoomyS[i].state === null) {
|
||||
|
||||
zoomStart();
|
||||
|
||||
//Fix on click show and positioning issues
|
||||
|
||||
change.move(ele, zoom, e);
|
||||
|
||||
} else if (ZoomyS[i].state === 1 && event !== 'mouseover' && event !== 'mouseenter') {
|
||||
|
||||
zoomStop(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
'mouseover': function (e) {
|
||||
|
||||
ZoomyS.pos = e;
|
||||
|
||||
if (ZoomyS[i].state === 0) {
|
||||
zoomStart();
|
||||
}
|
||||
|
||||
|
||||
|
||||
},
|
||||
'mouseleave': function (e) {
|
||||
|
||||
ZoomyS.pos = e;
|
||||
|
||||
if (ZoomyS[i].state === 1) {
|
||||
|
||||
zoomStop(null);
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
'click': function () {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Making sure there is only one mouse over event & Click returns false when it suppose to
|
||||
|
||||
|
||||
if (event === 'mouseover') {
|
||||
eventlist[event] = events.event;
|
||||
} else {
|
||||
eventlist[event] = events.event;
|
||||
eventlist.mouseover = events.mouseover;
|
||||
}
|
||||
|
||||
if (!options.clickable && event !== 'click') {
|
||||
eventlist.click = events.click;
|
||||
}
|
||||
eventlist.mouseleave = events.mouseleave;
|
||||
|
||||
|
||||
|
||||
// Binding Events to element
|
||||
|
||||
ele.bind(eventlist);
|
||||
|
||||
};
|
||||
|
||||
eventHandler();
|
||||
|
||||
//Creating Zoomy Element
|
||||
ele.addClass('parent-zoom').append('<div class="zoomy zoom-obj-' + i + '" rel="' + i + '"><img id="tmp"/></div>');
|
||||
|
||||
|
||||
//Setting the Zoom Variable towards the right zoom object
|
||||
|
||||
zoom = $('.zoom-obj-' + i);
|
||||
|
||||
|
||||
if (initCallback !== null && typeof initCallback === 'function') {
|
||||
initCallback(ele);
|
||||
}
|
||||
|
||||
// Set basic parameters
|
||||
|
||||
style.params(ele, zoom);
|
||||
|
||||
// Load zoom image
|
||||
|
||||
build.image(image, zoom);
|
||||
|
||||
//Event Handler added 1.2
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
// Initialize element to add to page, check for initial image to be loaded
|
||||
|
||||
init : function (ele, img) {
|
||||
|
||||
|
||||
img.one("load", function () {
|
||||
|
||||
// Ready to build zoom
|
||||
|
||||
build.zoom(ele, ZoomyS.count.length);
|
||||
|
||||
}).each(function () {
|
||||
|
||||
if (this.complete || ($.browser.msie && parseInt($.browser.version, 10) === 6)) {
|
||||
|
||||
$(this).trigger("load");
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Fallback if there is no event but there are options
|
||||
|
||||
if (typeof (event) === 'object' && options === undefined) {
|
||||
|
||||
options = event;
|
||||
|
||||
event = defaultEvent;
|
||||
|
||||
} else if (event === undefined) {
|
||||
|
||||
event = defaultEvent;
|
||||
|
||||
}
|
||||
|
||||
//overriding defaults with options
|
||||
|
||||
options = $.extend(defaults, options);
|
||||
|
||||
|
||||
$(this).each(function () {
|
||||
|
||||
var ele = $(this),
|
||||
img = ele.find('img');
|
||||
|
||||
|
||||
// Start Building Zoom
|
||||
|
||||
build.init(ele, img);
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
}(jQuery));
|
||||
Reference in New Issue
Block a user