New module bootstrapTheme
pulled out bootstrap theme from blechreiz main module - to reuse
This commit is contained in:
56
bootstrapTheme/static/js/bindWithDelay.js
Normal file
56
bootstrapTheme/static/js/bindWithDelay.js
Normal file
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
bindWithDelay jQuery plugin
|
||||
Author: Brian Grinstead
|
||||
MIT license: http://www.opensource.org/licenses/mit-license.php
|
||||
|
||||
http://github.com/bgrins/bindWithDelay
|
||||
http://briangrinstead.com/files/bindWithDelay
|
||||
|
||||
Usage:
|
||||
See http://api.jquery.com/bind/
|
||||
.bindWithDelay( eventType, [ eventData ], handler(eventObject), timeout, throttle )
|
||||
|
||||
Examples:
|
||||
$("#foo").bindWithDelay("click", function(e) { }, 100);
|
||||
$(window).bindWithDelay("resize", { optional: "eventData" }, callback, 1000);
|
||||
$(window).bindWithDelay("resize", callback, 1000, true);
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.bindWithDelay = function( type, data, fn, timeout, throttle ) {
|
||||
|
||||
if ( $.isFunction( data ) ) {
|
||||
throttle = timeout;
|
||||
timeout = fn;
|
||||
fn = data;
|
||||
data = undefined;
|
||||
}
|
||||
|
||||
// Allow delayed function to be removed with fn in unbind function
|
||||
fn.guid = fn.guid || ($.guid && $.guid++);
|
||||
|
||||
// Bind each separately so that each element has its own delay
|
||||
return this.each(function() {
|
||||
|
||||
var wait = null;
|
||||
|
||||
function cb() {
|
||||
var e = $.extend(true, { }, arguments[0]);
|
||||
var ctx = this;
|
||||
var throttler = function() {
|
||||
wait = null;
|
||||
fn.apply(ctx, [e]);
|
||||
};
|
||||
|
||||
if (!throttle) { clearTimeout(wait); wait = null; }
|
||||
if (!wait) { wait = setTimeout(throttler, timeout); }
|
||||
}
|
||||
|
||||
cb.guid = fn.guid;
|
||||
|
||||
$(this).bind(type, data, cb);
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
167
bootstrapTheme/static/js/bootstrap-collapse.js
vendored
Normal file
167
bootstrapTheme/static/js/bootstrap-collapse.js
vendored
Normal file
@@ -0,0 +1,167 @@
|
||||
/* =============================================================
|
||||
* bootstrap-collapse.js v2.3.2
|
||||
* http://twbs.github.com/bootstrap/javascript.html#collapse
|
||||
* =============================================================
|
||||
* Copyright 2013 Twitter, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
* ============================================================ */
|
||||
|
||||
|
||||
!function ($) {
|
||||
|
||||
"use strict"; // jshint ;_;
|
||||
|
||||
|
||||
/* COLLAPSE PUBLIC CLASS DEFINITION
|
||||
* ================================ */
|
||||
|
||||
var Collapse = function (element, options) {
|
||||
this.$element = $(element)
|
||||
this.options = $.extend({}, $.fn.collapse.defaults, options)
|
||||
|
||||
if (this.options.parent) {
|
||||
this.$parent = $(this.options.parent)
|
||||
}
|
||||
|
||||
this.options.toggle && this.toggle()
|
||||
}
|
||||
|
||||
Collapse.prototype = {
|
||||
|
||||
constructor: Collapse
|
||||
|
||||
, dimension: function () {
|
||||
var hasWidth = this.$element.hasClass('width')
|
||||
return hasWidth ? 'width' : 'height'
|
||||
}
|
||||
|
||||
, show: function () {
|
||||
var dimension
|
||||
, scroll
|
||||
, actives
|
||||
, hasData
|
||||
|
||||
if (this.transitioning || this.$element.hasClass('in')) return
|
||||
|
||||
dimension = this.dimension()
|
||||
scroll = $.camelCase(['scroll', dimension].join('-'))
|
||||
actives = this.$parent && this.$parent.find('> .accordion-group > .in')
|
||||
|
||||
if (actives && actives.length) {
|
||||
hasData = actives.data('collapse')
|
||||
if (hasData && hasData.transitioning) return
|
||||
actives.collapse('hide')
|
||||
hasData || actives.data('collapse', null)
|
||||
}
|
||||
|
||||
this.$element[dimension](0)
|
||||
this.transition('addClass', $.Event('show'), 'shown')
|
||||
$.support.transition && this.$element[dimension](this.$element[0][scroll])
|
||||
}
|
||||
|
||||
, hide: function () {
|
||||
var dimension
|
||||
if (this.transitioning || !this.$element.hasClass('in')) return
|
||||
dimension = this.dimension()
|
||||
this.reset(this.$element[dimension]())
|
||||
this.transition('removeClass', $.Event('hide'), 'hidden')
|
||||
this.$element[dimension](0)
|
||||
}
|
||||
|
||||
, reset: function (size) {
|
||||
var dimension = this.dimension()
|
||||
|
||||
this.$element
|
||||
.removeClass('collapse')
|
||||
[dimension](size || 'auto')
|
||||
[0].offsetWidth
|
||||
|
||||
this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
, transition: function (method, startEvent, completeEvent) {
|
||||
var that = this
|
||||
, complete = function () {
|
||||
if (startEvent.type == 'show') that.reset()
|
||||
that.transitioning = 0
|
||||
that.$element.trigger(completeEvent)
|
||||
}
|
||||
|
||||
this.$element.trigger(startEvent)
|
||||
|
||||
if (startEvent.isDefaultPrevented()) return
|
||||
|
||||
this.transitioning = 1
|
||||
|
||||
this.$element[method]('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('collapse') ?
|
||||
this.$element.one($.support.transition.end, complete) :
|
||||
complete()
|
||||
}
|
||||
|
||||
, toggle: function () {
|
||||
this[this.$element.hasClass('in') ? 'hide' : 'show']()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var old = $.fn.collapse
|
||||
|
||||
$.fn.collapse = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
, data = $this.data('collapse')
|
||||
, options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option)
|
||||
if (!data) $this.data('collapse', (data = new Collapse(this, options)))
|
||||
if (typeof option == 'string') data[option]()
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.collapse.defaults = {
|
||||
toggle: true
|
||||
}
|
||||
|
||||
$.fn.collapse.Constructor = Collapse
|
||||
|
||||
|
||||
/* COLLAPSE NO CONFLICT
|
||||
* ==================== */
|
||||
|
||||
$.fn.collapse.noConflict = function () {
|
||||
$.fn.collapse = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
/* COLLAPSE DATA-API
|
||||
* ================= */
|
||||
|
||||
$(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
|
||||
var $this = $(this), href
|
||||
, target = $this.attr('data-target')
|
||||
|| e.preventDefault()
|
||||
|| (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
|
||||
, option = $(target).data('collapse') ? 'toggle' : $this.data()
|
||||
$this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
|
||||
$(target).collapse(option)
|
||||
})
|
||||
|
||||
}(window.jQuery);
|
||||
17
bootstrapTheme/static/js/bootstrap-datepicker.de.js
vendored
Normal file
17
bootstrapTheme/static/js/bootstrap-datepicker.de.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* German translation for bootstrap-datepicker
|
||||
* Sam Zurcher <sam@orelias.ch>
|
||||
*/
|
||||
;(function($){
|
||||
$.fn.datepicker.dates['de'] = {
|
||||
days: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"],
|
||||
daysShort: ["Son", "Mon", "Die", "Mit", "Don", "Fre", "Sam", "Son"],
|
||||
daysMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"],
|
||||
months: ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"],
|
||||
monthsShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"],
|
||||
today: "Heute",
|
||||
clear: "Löschen",
|
||||
weekStart: 1,
|
||||
format: "dd.mm.yyyy"
|
||||
};
|
||||
}(jQuery));
|
||||
1395
bootstrapTheme/static/js/bootstrap-datepicker.js
vendored
Normal file
1395
bootstrapTheme/static/js/bootstrap-datepicker.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
bootstrapTheme/static/js/bootstrap-timepicker.js
vendored
Normal file
5
bootstrapTheme/static/js/bootstrap-timepicker.js
vendored
Normal file
File diff suppressed because one or more lines are too long
2280
bootstrapTheme/static/js/bootstrap.js
vendored
Normal file
2280
bootstrapTheme/static/js/bootstrap.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
bootstrapTheme/static/js/bootstrap.min.js
vendored
Normal file
6
bootstrapTheme/static/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
903
bootstrapTheme/static/js/flexslider.js
Executable file
903
bootstrapTheme/static/js/flexslider.js
Executable file
@@ -0,0 +1,903 @@
|
||||
/*
|
||||
* jQuery FlexSlider v2.1
|
||||
* http://www.woothemes.com/flexslider/
|
||||
*
|
||||
* Copyright 2012 WooThemes
|
||||
* Free to use under the GPLv2 license.
|
||||
* http://www.gnu.org/licenses/gpl-2.0.html
|
||||
*
|
||||
* Contributing author: Tyler Smith (@mbmufffin)
|
||||
*/
|
||||
|
||||
;(function ($) {
|
||||
|
||||
//FlexSlider: Object Instance
|
||||
$.flexslider = function(el, options) {
|
||||
var slider = $(el),
|
||||
vars = $.extend({}, $.flexslider.defaults, options),
|
||||
namespace = vars.namespace,
|
||||
touch = ("ontouchstart" in window) || window.DocumentTouch && document instanceof DocumentTouch,
|
||||
eventType = (touch) ? "touchend" : "click",
|
||||
vertical = vars.direction === "vertical",
|
||||
reverse = vars.reverse,
|
||||
carousel = (vars.itemWidth > 0),
|
||||
fade = vars.animation === "fade",
|
||||
asNav = vars.asNavFor !== "",
|
||||
methods = {};
|
||||
|
||||
// Store a reference to the slider object
|
||||
$.data(el, "flexslider", slider);
|
||||
|
||||
// Privat slider methods
|
||||
methods = {
|
||||
init: function() {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = vars.startAt;
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
slider.atEnd = (slider.currentSlide === 0 || slider.currentSlide === slider.last);
|
||||
slider.containerSelector = vars.selector.substr(0,vars.selector.search(' '));
|
||||
slider.slides = $(vars.selector, slider);
|
||||
slider.container = $(slider.containerSelector, slider);
|
||||
slider.count = slider.slides.length;
|
||||
// SYNC:
|
||||
slider.syncExists = $(vars.sync).length > 0;
|
||||
// SLIDE:
|
||||
if (vars.animation === "slide") vars.animation = "swing";
|
||||
slider.prop = (vertical) ? "top" : "marginLeft";
|
||||
slider.args = {};
|
||||
// SLIDESHOW:
|
||||
slider.manualPause = false;
|
||||
// TOUCH/USECSS:
|
||||
slider.transitions = !vars.video && !fade && vars.useCSS && (function() {
|
||||
var obj = document.createElement('div'),
|
||||
props = ['perspectiveProperty', 'WebkitPerspective', 'MozPerspective', 'OPerspective', 'msPerspective'];
|
||||
for (var i in props) {
|
||||
if ( obj.style[ props[i] ] !== undefined ) {
|
||||
slider.pfx = props[i].replace('Perspective','').toLowerCase();
|
||||
slider.prop = "-" + slider.pfx + "-transform";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}());
|
||||
// CONTROLSCONTAINER:
|
||||
if (vars.controlsContainer !== "") slider.controlsContainer = $(vars.controlsContainer).length > 0 && $(vars.controlsContainer);
|
||||
// MANUAL:
|
||||
if (vars.manualControls !== "") slider.manualControls = $(vars.manualControls).length > 0 && $(vars.manualControls);
|
||||
|
||||
// RANDOMIZE:
|
||||
if (vars.randomize) {
|
||||
slider.slides.sort(function() { return (Math.round(Math.random())-0.5); });
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
|
||||
slider.doMath();
|
||||
|
||||
// ASNAV:
|
||||
if (asNav) methods.asNav.setup();
|
||||
|
||||
// INIT
|
||||
slider.setup("init");
|
||||
|
||||
// CONTROLNAV:
|
||||
if (vars.controlNav) methods.controlNav.setup();
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.setup();
|
||||
|
||||
// KEYBOARD:
|
||||
if (vars.keyboard && ($(slider.containerSelector).length === 1 || vars.multipleKeyboard)) {
|
||||
$(document).bind('keyup', function(event) {
|
||||
var keycode = event.keyCode;
|
||||
if (!slider.animating && (keycode === 39 || keycode === 37)) {
|
||||
var target = (keycode === 39) ? slider.getTarget('next') :
|
||||
(keycode === 37) ? slider.getTarget('prev') : false;
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
}
|
||||
// MOUSEWHEEL:
|
||||
if (vars.mousewheel) {
|
||||
slider.bind('mousewheel', function(event, delta, deltaX, deltaY) {
|
||||
event.preventDefault();
|
||||
var target = (delta < 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
}
|
||||
|
||||
// PAUSEPLAY
|
||||
if (vars.pausePlay) methods.pausePlay.setup();
|
||||
|
||||
// SLIDSESHOW
|
||||
if (vars.slideshow) {
|
||||
if (vars.pauseOnHover) {
|
||||
slider.hover(function() {
|
||||
if (!slider.manualPlay && !slider.manualPause) slider.pause();
|
||||
}, function() {
|
||||
if (!slider.manualPause && !slider.manualPlay) slider.play();
|
||||
});
|
||||
}
|
||||
// initialize animation
|
||||
(vars.initDelay > 0) ? setTimeout(slider.play, vars.initDelay) : slider.play();
|
||||
}
|
||||
|
||||
// TOUCH
|
||||
if (touch && vars.touch) methods.touch();
|
||||
|
||||
// FADE&&SMOOTHHEIGHT || SLIDE:
|
||||
if (!fade || (fade && vars.smoothHeight)) $(window).bind("resize focus", methods.resize);
|
||||
|
||||
|
||||
// API: start() Callback
|
||||
setTimeout(function(){
|
||||
vars.start(slider);
|
||||
}, 200);
|
||||
},
|
||||
asNav: {
|
||||
setup: function() {
|
||||
slider.asNav = true;
|
||||
slider.animatingTo = Math.floor(slider.currentSlide/slider.move);
|
||||
slider.currentItem = slider.currentSlide;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(slider.currentItem).addClass(namespace + "active-slide");
|
||||
slider.slides.click(function(e){
|
||||
e.preventDefault();
|
||||
var $slide = $(this),
|
||||
target = $slide.index();
|
||||
if (!$(vars.asNavFor).data('flexslider').animating && !$slide.hasClass('active')) {
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction, false, true, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
controlNav: {
|
||||
setup: function() {
|
||||
if (!slider.manualControls) {
|
||||
methods.controlNav.setupPaging();
|
||||
} else { // MANUALCONTROLS:
|
||||
methods.controlNav.setupManual();
|
||||
}
|
||||
},
|
||||
setupPaging: function() {
|
||||
var type = (vars.controlNav === "thumbnails") ? 'control-thumbs' : 'control-paging',
|
||||
j = 1,
|
||||
item;
|
||||
|
||||
slider.controlNavScaffold = $('<ol class="'+ namespace + 'control-nav ' + namespace + type + '"></ol>');
|
||||
|
||||
if (slider.pagingCount > 1) {
|
||||
for (var i = 0; i < slider.pagingCount; i++) {
|
||||
item = (vars.controlNav === "thumbnails") ? '<img src="' + slider.slides.eq(i).attr("data-thumb") + '"/>' : '<a>' + j + '</a>';
|
||||
slider.controlNavScaffold.append('<li>' + item + '</li>');
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
(slider.controlsContainer) ? $(slider.controlsContainer).append(slider.controlNavScaffold) : slider.append(slider.controlNavScaffold);
|
||||
methods.controlNav.set();
|
||||
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNavScaffold.delegate('a, img', eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
slider.direction = (target > slider.currentSlide) ? "next" : "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNavScaffold.delegate('a', "click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
setupManual: function() {
|
||||
slider.controlNav = slider.manualControls;
|
||||
methods.controlNav.active();
|
||||
|
||||
slider.controlNav.live(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this),
|
||||
target = slider.controlNav.index($this);
|
||||
|
||||
if (!$this.hasClass(namespace + 'active')) {
|
||||
(target > slider.currentSlide) ? slider.direction = "next" : slider.direction = "prev";
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.controlNav.live("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
set: function() {
|
||||
var selector = (vars.controlNav === "thumbnails") ? 'img' : 'a';
|
||||
slider.controlNav = $('.' + namespace + 'control-nav li ' + selector, (slider.controlsContainer) ? slider.controlsContainer : slider);
|
||||
},
|
||||
active: function() {
|
||||
slider.controlNav.removeClass(namespace + "active").eq(slider.animatingTo).addClass(namespace + "active");
|
||||
},
|
||||
update: function(action, pos) {
|
||||
if (slider.pagingCount > 1 && action === "add") {
|
||||
slider.controlNavScaffold.append($('<li><a>' + slider.count + '</a></li>'));
|
||||
} else if (slider.pagingCount === 1) {
|
||||
slider.controlNavScaffold.find('li').remove();
|
||||
} else {
|
||||
slider.controlNav.eq(pos).closest('li').remove();
|
||||
}
|
||||
methods.controlNav.set();
|
||||
(slider.pagingCount > 1 && slider.pagingCount !== slider.controlNav.length) ? slider.update(pos, action) : methods.controlNav.active();
|
||||
}
|
||||
},
|
||||
directionNav: {
|
||||
setup: function() {
|
||||
var directionNavScaffold = $('<ul class="' + namespace + 'direction-nav"><li><a class="' + namespace + 'prev" href="#">' + vars.prevText + '</a></li><li><a class="' + namespace + 'next" href="#">' + vars.nextText + '</a></li></ul>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
$(slider.controlsContainer).append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(directionNavScaffold);
|
||||
slider.directionNav = $('.' + namespace + 'direction-nav li a', slider);
|
||||
}
|
||||
|
||||
methods.directionNav.update();
|
||||
|
||||
slider.directionNav.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
var target = ($(this).hasClass(namespace + 'next')) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.directionNav.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function() {
|
||||
var disabledClass = namespace + 'disabled';
|
||||
if (slider.pagingCount === 1) {
|
||||
slider.directionNav.addClass(disabledClass);
|
||||
} else if (!vars.animationLoop) {
|
||||
if (slider.animatingTo === 0) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "prev").addClass(disabledClass);
|
||||
} else if (slider.animatingTo === slider.last) {
|
||||
slider.directionNav.removeClass(disabledClass).filter('.' + namespace + "next").addClass(disabledClass);
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
} else {
|
||||
slider.directionNav.removeClass(disabledClass);
|
||||
}
|
||||
}
|
||||
},
|
||||
pausePlay: {
|
||||
setup: function() {
|
||||
var pausePlayScaffold = $('<div class="' + namespace + 'pauseplay"><a></a></div>');
|
||||
|
||||
// CONTROLSCONTAINER:
|
||||
if (slider.controlsContainer) {
|
||||
slider.controlsContainer.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider.controlsContainer);
|
||||
} else {
|
||||
slider.append(pausePlayScaffold);
|
||||
slider.pausePlay = $('.' + namespace + 'pauseplay a', slider);
|
||||
}
|
||||
|
||||
methods.pausePlay.update((vars.slideshow) ? namespace + 'pause' : namespace + 'play');
|
||||
|
||||
slider.pausePlay.bind(eventType, function(event) {
|
||||
event.preventDefault();
|
||||
if ($(this).hasClass(namespace + 'pause')) {
|
||||
slider.manualPause = true;
|
||||
slider.manualPlay = false;
|
||||
slider.pause();
|
||||
} else {
|
||||
slider.manualPause = false;
|
||||
slider.manualPlay = true;
|
||||
slider.play();
|
||||
}
|
||||
});
|
||||
// Prevent iOS click event bug
|
||||
if (touch) {
|
||||
slider.pausePlay.bind("click touchstart", function(event) {
|
||||
event.preventDefault();
|
||||
});
|
||||
}
|
||||
},
|
||||
update: function(state) {
|
||||
(state === "play") ? slider.pausePlay.removeClass(namespace + 'pause').addClass(namespace + 'play').text(vars.playText) : slider.pausePlay.removeClass(namespace + 'play').addClass(namespace + 'pause').text(vars.pauseText);
|
||||
}
|
||||
},
|
||||
touch: function() {
|
||||
var startX,
|
||||
startY,
|
||||
offset,
|
||||
cwidth,
|
||||
dx,
|
||||
startT,
|
||||
scrolling = false;
|
||||
|
||||
el.addEventListener('touchstart', onTouchStart, false);
|
||||
function onTouchStart(e) {
|
||||
if (slider.animating) {
|
||||
e.preventDefault();
|
||||
} else if (e.touches.length === 1) {
|
||||
slider.pause();
|
||||
// CAROUSEL:
|
||||
cwidth = (vertical) ? slider.h : slider. w;
|
||||
startT = Number(new Date());
|
||||
// CAROUSEL:
|
||||
offset = (carousel && reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(carousel && reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(carousel && slider.currentSlide === slider.last) ? slider.limit :
|
||||
(carousel) ? ((slider.itemW + vars.itemMargin) * slider.move) * slider.currentSlide :
|
||||
(reverse) ? (slider.last - slider.currentSlide + slider.cloneOffset) * cwidth : (slider.currentSlide + slider.cloneOffset) * cwidth;
|
||||
startX = (vertical) ? e.touches[0].pageY : e.touches[0].pageX;
|
||||
startY = (vertical) ? e.touches[0].pageX : e.touches[0].pageY;
|
||||
|
||||
el.addEventListener('touchmove', onTouchMove, false);
|
||||
el.addEventListener('touchend', onTouchEnd, false);
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchMove(e) {
|
||||
dx = (vertical) ? startX - e.touches[0].pageY : startX - e.touches[0].pageX;
|
||||
scrolling = (vertical) ? (Math.abs(dx) < Math.abs(e.touches[0].pageX - startY)) : (Math.abs(dx) < Math.abs(e.touches[0].pageY - startY));
|
||||
|
||||
if (!scrolling || Number(new Date()) - startT > 500) {
|
||||
e.preventDefault();
|
||||
if (!fade && slider.transitions) {
|
||||
if (!vars.animationLoop) {
|
||||
dx = dx/((slider.currentSlide === 0 && dx < 0 || slider.currentSlide === slider.last && dx > 0) ? (Math.abs(dx)/cwidth+2) : 1);
|
||||
}
|
||||
slider.setProps(offset + dx, "setTouch");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function onTouchEnd(e) {
|
||||
// finish the touch by undoing the touch session
|
||||
el.removeEventListener('touchmove', onTouchMove, false);
|
||||
|
||||
if (slider.animatingTo === slider.currentSlide && !scrolling && !(dx === null)) {
|
||||
var updateDx = (reverse) ? -dx : dx,
|
||||
target = (updateDx > 0) ? slider.getTarget('next') : slider.getTarget('prev');
|
||||
|
||||
if (slider.canAdvance(target) && (Number(new Date()) - startT < 550 && Math.abs(updateDx) > 50 || Math.abs(updateDx) > cwidth/2)) {
|
||||
slider.flexAnimate(target, vars.pauseOnAction);
|
||||
} else {
|
||||
if (!fade) slider.flexAnimate(slider.currentSlide, vars.pauseOnAction, true);
|
||||
}
|
||||
}
|
||||
el.removeEventListener('touchend', onTouchEnd, false);
|
||||
startX = null;
|
||||
startY = null;
|
||||
dx = null;
|
||||
offset = null;
|
||||
}
|
||||
},
|
||||
resize: function() {
|
||||
if (!slider.animating && slider.is(':visible')) {
|
||||
if (!carousel) slider.doMath();
|
||||
|
||||
if (fade) {
|
||||
// SMOOTH HEIGHT:
|
||||
methods.smoothHeight();
|
||||
} else if (carousel) { //CAROUSEL:
|
||||
slider.slides.width(slider.computedW);
|
||||
slider.update(slider.pagingCount);
|
||||
slider.setProps();
|
||||
}
|
||||
else if (vertical) { //VERTICAL:
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(slider.h, "setTotal");
|
||||
} else {
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
slider.newSlides.width(slider.computedW);
|
||||
slider.setProps(slider.computedW, "setTotal");
|
||||
}
|
||||
}
|
||||
},
|
||||
smoothHeight: function(dur) {
|
||||
if (!vertical || fade) {
|
||||
var $obj = (fade) ? slider : slider.viewport;
|
||||
(dur) ? $obj.animate({"height": slider.slides.eq(slider.animatingTo).height()}, dur) : $obj.height(slider.slides.eq(slider.animatingTo).height());
|
||||
}
|
||||
},
|
||||
sync: function(action) {
|
||||
var $obj = $(vars.sync).data("flexslider"),
|
||||
target = slider.animatingTo;
|
||||
|
||||
switch (action) {
|
||||
case "animate": $obj.flexAnimate(target, vars.pauseOnAction, false, true); break;
|
||||
case "play": if (!$obj.playing && !$obj.asNav) { $obj.play(); } break;
|
||||
case "pause": $obj.pause(); break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// public methods
|
||||
slider.flexAnimate = function(target, pause, override, withSync, fromNav) {
|
||||
if (asNav && slider.pagingCount === 1) slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
|
||||
if (!slider.animating && (slider.canAdvance(target, fromNav) || override) && slider.is(":visible")) {
|
||||
if (asNav && withSync) {
|
||||
var master = $(vars.asNavFor).data('flexslider');
|
||||
slider.atEnd = target === 0 || target === slider.count - 1;
|
||||
master.flexAnimate(target, true, false, true, fromNav);
|
||||
slider.direction = (slider.currentItem < target) ? "next" : "prev";
|
||||
master.direction = slider.direction;
|
||||
|
||||
if (Math.ceil((target + 1)/slider.visible) - 1 !== slider.currentSlide && target !== 0) {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
target = Math.floor(target/slider.visible);
|
||||
} else {
|
||||
slider.currentItem = target;
|
||||
slider.slides.removeClass(namespace + "active-slide").eq(target).addClass(namespace + "active-slide");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
slider.animating = true;
|
||||
slider.animatingTo = target;
|
||||
// API: before() animation Callback
|
||||
vars.before(slider);
|
||||
|
||||
// SLIDESHOW:
|
||||
if (pause) slider.pause();
|
||||
|
||||
// SYNC:
|
||||
if (slider.syncExists && !fromNav) methods.sync("animate");
|
||||
|
||||
// CONTROLNAV
|
||||
if (vars.controlNav) methods.controlNav.active();
|
||||
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: slide active class (for add/remove slide)
|
||||
if (!carousel) slider.slides.removeClass(namespace + 'active-slide').eq(target).addClass(namespace + 'active-slide');
|
||||
|
||||
// INFINITE LOOP:
|
||||
// CANDIDATE: atEnd
|
||||
slider.atEnd = target === 0 || target === slider.last;
|
||||
|
||||
// DIRECTIONNAV:
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
if (target === slider.last) {
|
||||
// API: end() of cycle Callback
|
||||
vars.end(slider);
|
||||
// SLIDESHOW && !INFINITE LOOP:
|
||||
if (!vars.animationLoop) slider.pause();
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var dimension = (vertical) ? slider.slides.filter(':first').height() : slider.computedW,
|
||||
margin, slideString, calcNext;
|
||||
|
||||
// INFINITE LOOP / REVERSE:
|
||||
if (carousel) {
|
||||
margin = (vars.itemWidth > slider.w) ? vars.itemMargin * 2 : vars.itemMargin;
|
||||
calcNext = ((slider.itemW + margin) * slider.move) * slider.animatingTo;
|
||||
slideString = (calcNext > slider.limit && slider.visible !== 1) ? slider.limit : calcNext;
|
||||
} else if (slider.currentSlide === 0 && target === slider.count - 1 && vars.animationLoop && slider.direction !== "next") {
|
||||
slideString = (reverse) ? (slider.count + slider.cloneOffset) * dimension : 0;
|
||||
} else if (slider.currentSlide === slider.last && target === 0 && vars.animationLoop && slider.direction !== "prev") {
|
||||
slideString = (reverse) ? 0 : (slider.count + 1) * dimension;
|
||||
} else {
|
||||
slideString = (reverse) ? ((slider.count - 1) - target + slider.cloneOffset) * dimension : (target + slider.cloneOffset) * dimension;
|
||||
}
|
||||
slider.setProps(slideString, "", vars.animationSpeed);
|
||||
if (slider.transitions) {
|
||||
if (!vars.animationLoop || !slider.atEnd) {
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
slider.container.unbind("webkitTransitionEnd transitionend");
|
||||
slider.container.bind("webkitTransitionEnd transitionend", function() {
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
} else {
|
||||
slider.container.animate(slider.args, vars.animationSpeed, vars.easing, function(){
|
||||
slider.wrapup(dimension);
|
||||
});
|
||||
}
|
||||
} else { // FADE:
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeOut(vars.animationSpeed, vars.easing);
|
||||
slider.slides.eq(target).fadeIn(vars.animationSpeed, vars.easing, slider.wrapup);
|
||||
} else {
|
||||
slider.slides.eq(slider.currentSlide).css({ "opacity": 0, "zIndex": 1 });
|
||||
slider.slides.eq(target).css({ "opacity": 1, "zIndex": 2 });
|
||||
|
||||
slider.slides.unbind("webkitTransitionEnd transitionend");
|
||||
slider.slides.eq(slider.currentSlide).bind("webkitTransitionEnd transitionend", function() {
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
});
|
||||
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight(vars.animationSpeed);
|
||||
}
|
||||
}
|
||||
slider.wrapup = function(dimension) {
|
||||
// SLIDE:
|
||||
if (!fade && !carousel) {
|
||||
if (slider.currentSlide === 0 && slider.animatingTo === slider.last && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpEnd");
|
||||
} else if (slider.currentSlide === slider.last && slider.animatingTo === 0 && vars.animationLoop) {
|
||||
slider.setProps(dimension, "jumpStart");
|
||||
}
|
||||
}
|
||||
slider.animating = false;
|
||||
slider.currentSlide = slider.animatingTo;
|
||||
// API: after() animation Callback
|
||||
vars.after(slider);
|
||||
}
|
||||
|
||||
// SLIDESHOW:
|
||||
slider.animateSlides = function() {
|
||||
if (!slider.animating) slider.flexAnimate(slider.getTarget("next"));
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.pause = function() {
|
||||
clearInterval(slider.animatedSlides);
|
||||
slider.playing = false;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("play");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("pause");
|
||||
}
|
||||
// SLIDESHOW:
|
||||
slider.play = function() {
|
||||
slider.animatedSlides = setInterval(slider.animateSlides, vars.slideshowSpeed);
|
||||
slider.playing = true;
|
||||
// PAUSEPLAY:
|
||||
if (vars.pausePlay) methods.pausePlay.update("pause");
|
||||
// SYNC:
|
||||
if (slider.syncExists) methods.sync("play");
|
||||
}
|
||||
slider.canAdvance = function(target, fromNav) {
|
||||
// ASNAV:
|
||||
var last = (asNav) ? slider.pagingCount - 1 : slider.last;
|
||||
return (fromNav) ? true :
|
||||
(asNav && slider.currentItem === slider.count - 1 && target === 0 && slider.direction === "prev") ? true :
|
||||
(asNav && slider.currentItem === 0 && target === slider.pagingCount - 1 && slider.direction !== "next") ? false :
|
||||
(target === slider.currentSlide && !asNav) ? false :
|
||||
(vars.animationLoop) ? true :
|
||||
(slider.atEnd && slider.currentSlide === 0 && target === last && slider.direction !== "next") ? false :
|
||||
(slider.atEnd && slider.currentSlide === last && target === 0 && slider.direction === "next") ? false :
|
||||
true;
|
||||
}
|
||||
slider.getTarget = function(dir) {
|
||||
slider.direction = dir;
|
||||
if (dir === "next") {
|
||||
return (slider.currentSlide === slider.last) ? 0 : slider.currentSlide + 1;
|
||||
} else {
|
||||
return (slider.currentSlide === 0) ? slider.last : slider.currentSlide - 1;
|
||||
}
|
||||
}
|
||||
|
||||
// SLIDE:
|
||||
slider.setProps = function(pos, special, dur) {
|
||||
var target = (function() {
|
||||
var posCheck = (pos) ? pos : ((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo,
|
||||
posCalc = (function() {
|
||||
if (carousel) {
|
||||
return (special === "setTouch") ? pos :
|
||||
(reverse && slider.animatingTo === slider.last) ? 0 :
|
||||
(reverse) ? slider.limit - (((slider.itemW + vars.itemMargin) * slider.move) * slider.animatingTo) :
|
||||
(slider.animatingTo === slider.last) ? slider.limit : posCheck;
|
||||
} else {
|
||||
switch (special) {
|
||||
case "setTotal": return (reverse) ? ((slider.count - 1) - slider.currentSlide + slider.cloneOffset) * pos : (slider.currentSlide + slider.cloneOffset) * pos;
|
||||
case "setTouch": return (reverse) ? pos : pos;
|
||||
case "jumpEnd": return (reverse) ? pos : slider.count * pos;
|
||||
case "jumpStart": return (reverse) ? slider.count * pos : pos;
|
||||
default: return pos;
|
||||
}
|
||||
}
|
||||
}());
|
||||
return (posCalc * -1) + "px";
|
||||
}());
|
||||
|
||||
if (slider.transitions) {
|
||||
target = (vertical) ? "translate3d(0," + target + ",0)" : "translate3d(" + target + ",0,0)";
|
||||
dur = (dur !== undefined) ? (dur/1000) + "s" : "0s";
|
||||
slider.container.css("-" + slider.pfx + "-transition-duration", dur);
|
||||
}
|
||||
|
||||
slider.args[slider.prop] = target;
|
||||
if (slider.transitions || dur === undefined) slider.container.css(slider.args);
|
||||
}
|
||||
|
||||
slider.setup = function(type) {
|
||||
// SLIDE:
|
||||
if (!fade) {
|
||||
var sliderOffset, arr;
|
||||
|
||||
if (type === "init") {
|
||||
slider.viewport = $('<div class="' + namespace + 'viewport"></div>').css({"overflow": "hidden", "position": "relative"}).appendTo(slider).append(slider.container);
|
||||
// INFINITE LOOP:
|
||||
slider.cloneCount = 0;
|
||||
slider.cloneOffset = 0;
|
||||
// REVERSE:
|
||||
if (reverse) {
|
||||
arr = $.makeArray(slider.slides).reverse();
|
||||
slider.slides = $(arr);
|
||||
slider.container.empty().append(slider.slides);
|
||||
}
|
||||
}
|
||||
// INFINITE LOOP && !CAROUSEL:
|
||||
if (vars.animationLoop && !carousel) {
|
||||
slider.cloneCount = 2;
|
||||
slider.cloneOffset = 1;
|
||||
// clear out old clones
|
||||
if (type !== "init") slider.container.find('.clone').remove();
|
||||
slider.container.append(slider.slides.first().clone().addClass('clone')).prepend(slider.slides.last().clone().addClass('clone'));
|
||||
}
|
||||
slider.newSlides = $(vars.selector, slider);
|
||||
|
||||
sliderOffset = (reverse) ? slider.count - 1 - slider.currentSlide + slider.cloneOffset : slider.currentSlide + slider.cloneOffset;
|
||||
// VERTICAL:
|
||||
if (vertical && !carousel) {
|
||||
slider.container.height((slider.count + slider.cloneCount) * 200 + "%").css("position", "absolute").width("100%");
|
||||
setTimeout(function(){
|
||||
slider.newSlides.css({"display": "block"});
|
||||
slider.doMath();
|
||||
slider.viewport.height(slider.h);
|
||||
slider.setProps(sliderOffset * slider.h, "init");
|
||||
}, (type === "init") ? 100 : 0);
|
||||
} else {
|
||||
slider.container.width((slider.count + slider.cloneCount) * 200 + "%");
|
||||
slider.setProps(sliderOffset * slider.computedW, "init");
|
||||
setTimeout(function(){
|
||||
slider.doMath();
|
||||
slider.newSlides.css({"width": slider.computedW, "float": "left", "display": "block"});
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}, (type === "init") ? 100 : 0);
|
||||
}
|
||||
} else { // FADE:
|
||||
slider.slides.css({"width": "100%", "float": "left", "marginRight": "-100%", "position": "relative"});
|
||||
if (type === "init") {
|
||||
if (!touch) {
|
||||
slider.slides.eq(slider.currentSlide).fadeIn(vars.animationSpeed, vars.easing);
|
||||
} else {
|
||||
slider.slides.css({ "opacity": 0, "display": "block", "webkitTransition": "opacity " + vars.animationSpeed / 1000 + "s ease", "zIndex": 1 }).eq(slider.currentSlide).css({ "opacity": 1, "zIndex": 2});
|
||||
}
|
||||
}
|
||||
// SMOOTH HEIGHT:
|
||||
if (vars.smoothHeight) methods.smoothHeight();
|
||||
}
|
||||
// !CAROUSEL:
|
||||
// CANDIDATE: active slide
|
||||
if (!carousel) slider.slides.removeClass(namespace + "active-slide").eq(slider.currentSlide).addClass(namespace + "active-slide");
|
||||
}
|
||||
|
||||
slider.doMath = function() {
|
||||
var slide = slider.slides.first(),
|
||||
slideMargin = vars.itemMargin,
|
||||
minItems = vars.minItems,
|
||||
maxItems = vars.maxItems;
|
||||
|
||||
slider.w = slider.width();
|
||||
slider.h = slide.height();
|
||||
slider.boxPadding = slide.outerWidth() - slide.width();
|
||||
|
||||
// CAROUSEL:
|
||||
if (carousel) {
|
||||
slider.itemT = vars.itemWidth + slideMargin;
|
||||
slider.minW = (minItems) ? minItems * slider.itemT : slider.w;
|
||||
slider.maxW = (maxItems) ? maxItems * slider.itemT : slider.w;
|
||||
slider.itemW = (slider.minW > slider.w) ? (slider.w - (slideMargin * minItems))/minItems :
|
||||
(slider.maxW < slider.w) ? (slider.w - (slideMargin * maxItems))/maxItems :
|
||||
(vars.itemWidth > slider.w) ? slider.w : vars.itemWidth;
|
||||
slider.visible = Math.floor(slider.w/(slider.itemW + slideMargin));
|
||||
slider.move = (vars.move > 0 && vars.move < slider.visible ) ? vars.move : slider.visible;
|
||||
slider.pagingCount = Math.ceil(((slider.count - slider.visible)/slider.move) + 1);
|
||||
slider.last = slider.pagingCount - 1;
|
||||
slider.limit = (slider.pagingCount === 1) ? 0 :
|
||||
(vars.itemWidth > slider.w) ? ((slider.itemW + (slideMargin * 2)) * slider.count) - slider.w - slideMargin : ((slider.itemW + slideMargin) * slider.count) - slider.w - slideMargin;
|
||||
} else {
|
||||
slider.itemW = slider.w;
|
||||
slider.pagingCount = slider.count;
|
||||
slider.last = slider.count - 1;
|
||||
}
|
||||
slider.computedW = slider.itemW - slider.boxPadding;
|
||||
}
|
||||
|
||||
slider.update = function(pos, action) {
|
||||
slider.doMath();
|
||||
|
||||
// update currentSlide and slider.animatingTo if necessary
|
||||
if (!carousel) {
|
||||
if (pos < slider.currentSlide) {
|
||||
slider.currentSlide += 1;
|
||||
} else if (pos <= slider.currentSlide && pos !== 0) {
|
||||
slider.currentSlide -= 1;
|
||||
}
|
||||
slider.animatingTo = slider.currentSlide;
|
||||
}
|
||||
|
||||
// update controlNav
|
||||
if (vars.controlNav && !slider.manualControls) {
|
||||
if ((action === "add" && !carousel) || slider.pagingCount > slider.controlNav.length) {
|
||||
methods.controlNav.update("add");
|
||||
} else if ((action === "remove" && !carousel) || slider.pagingCount < slider.controlNav.length) {
|
||||
if (carousel && slider.currentSlide > slider.last) {
|
||||
slider.currentSlide -= 1;
|
||||
slider.animatingTo -= 1;
|
||||
}
|
||||
methods.controlNav.update("remove", slider.last);
|
||||
}
|
||||
}
|
||||
// update directionNav
|
||||
if (vars.directionNav) methods.directionNav.update();
|
||||
|
||||
}
|
||||
|
||||
slider.addSlide = function(obj, pos) {
|
||||
var $obj = $(obj);
|
||||
|
||||
slider.count += 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// append new slide
|
||||
if (vertical && reverse) {
|
||||
(pos !== undefined) ? slider.slides.eq(slider.count - pos).after($obj) : slider.container.prepend($obj);
|
||||
} else {
|
||||
(pos !== undefined) ? slider.slides.eq(pos).before($obj) : slider.container.append($obj);
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.update(pos, "add");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
//FlexSlider: added() Callback
|
||||
vars.added(slider);
|
||||
}
|
||||
slider.removeSlide = function(obj) {
|
||||
var pos = (isNaN(obj)) ? slider.slides.index($(obj)) : obj;
|
||||
|
||||
// update count
|
||||
slider.count -= 1;
|
||||
slider.last = slider.count - 1;
|
||||
|
||||
// remove slide
|
||||
if (isNaN(obj)) {
|
||||
$(obj, slider.slides).remove();
|
||||
} else {
|
||||
(vertical && reverse) ? slider.slides.eq(slider.last).remove() : slider.slides.eq(obj).remove();
|
||||
}
|
||||
|
||||
// update currentSlide, animatingTo, controlNav, and directionNav
|
||||
slider.doMath();
|
||||
slider.update(pos, "remove");
|
||||
|
||||
// update slider.slides
|
||||
slider.slides = $(vars.selector + ':not(.clone)', slider);
|
||||
// re-setup the slider to accomdate new slide
|
||||
slider.setup();
|
||||
|
||||
// FlexSlider: removed() Callback
|
||||
vars.removed(slider);
|
||||
}
|
||||
|
||||
//FlexSlider: Initialize
|
||||
methods.init();
|
||||
}
|
||||
|
||||
//FlexSlider: Default Settings
|
||||
$.flexslider.defaults = {
|
||||
namespace: "flex-", //{NEW} String: Prefix string attached to the class of every element generated by the plugin
|
||||
selector: ".slides > li", //{NEW} Selector: Must match a simple pattern. '{container} > {slide}' -- Ignore pattern at your own peril
|
||||
animation: "fade", //String: Select your animation type, "fade" or "slide"
|
||||
easing: "swing", //{NEW} String: Determines the easing method used in jQuery transitions. jQuery easing plugin is supported!
|
||||
direction: "horizontal", //String: Select the sliding direction, "horizontal" or "vertical"
|
||||
reverse: false, //{NEW} Boolean: Reverse the animation direction
|
||||
animationLoop: true, //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end
|
||||
smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode
|
||||
startAt: 0, //Integer: The slide that the slider should start on. Array notation (0 = first slide)
|
||||
slideshow: true, //Boolean: Animate slider automatically
|
||||
slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds
|
||||
animationSpeed: 600, //Integer: Set the speed of animations, in milliseconds
|
||||
initDelay: 0, //{NEW} Integer: Set an initialization delay, in milliseconds
|
||||
randomize: false, //Boolean: Randomize slide order
|
||||
|
||||
// Usability features
|
||||
pauseOnAction: true, //Boolean: Pause the slideshow when interacting with control elements, highly recommended.
|
||||
pauseOnHover: false, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering
|
||||
useCSS: true, //{NEW} Boolean: Slider will use CSS3 transitions if available
|
||||
touch: true, //{NEW} Boolean: Allow touch swipe navigation of the slider on touch-enabled devices
|
||||
video: false, //{NEW} Boolean: If using video in the slider, will prevent CSS3 3D Transforms to avoid graphical glitches
|
||||
|
||||
// Primary Controls
|
||||
controlNav: true, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage
|
||||
directionNav: true, //Boolean: Create navigation for previous/next navigation? (true/false)
|
||||
prevText: "Previous", //String: Set the text for the "previous" directionNav item
|
||||
nextText: "Next", //String: Set the text for the "next" directionNav item
|
||||
|
||||
// Secondary Navigation
|
||||
keyboard: true, //Boolean: Allow slider navigating via keyboard left/right keys
|
||||
multipleKeyboard: false, //{NEW} Boolean: Allow keyboard navigation to affect multiple sliders. Default behavior cuts out keyboard navigation with more than one slider present.
|
||||
mousewheel: false, //{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel
|
||||
pausePlay: false, //Boolean: Create pause/play dynamic element
|
||||
pauseText: "Pause", //String: Set the text for the "pause" pausePlay item
|
||||
playText: "Play", //String: Set the text for the "play" pausePlay item
|
||||
|
||||
// Special properties
|
||||
controlsContainer: "", //{UPDATED} jQuery Object/Selector: Declare which container the navigation elements should be appended too. Default container is the FlexSlider element. Example use would be $(".flexslider-container"). Property is ignored if given element is not found.
|
||||
manualControls: "", //{UPDATED} jQuery Object/Selector: Declare custom control navigation. Examples would be $(".flex-control-nav li") or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.
|
||||
sync: "", //{NEW} Selector: Mirror the actions performed on this slider with another slider. Use with care.
|
||||
asNavFor: "", //{NEW} Selector: Internal property exposed for turning the slider into a thumbnail navigation for another slider
|
||||
|
||||
// Carousel Options
|
||||
itemWidth: 0, //{NEW} Integer: Box-model width of individual carousel items, including horizontal borders and padding.
|
||||
itemMargin: 0, //{NEW} Integer: Margin between carousel items.
|
||||
minItems: 0, //{NEW} Integer: Minimum number of carousel items that should be visible. Items will resize fluidly when below this.
|
||||
maxItems: 0, //{NEW} Integer: Maxmimum number of carousel items that should be visible. Items will resize fluidly when above this limit.
|
||||
move: 0, //{NEW} Integer: Number of carousel items that should move on animation. If 0, slider will move all visible items.
|
||||
|
||||
// Callback API
|
||||
start: function(){}, //Callback: function(slider) - Fires when the slider loads the first slide
|
||||
before: function(){}, //Callback: function(slider) - Fires asynchronously with each slider animation
|
||||
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
|
||||
end: function(){}, //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)
|
||||
added: function(){}, //{NEW} Callback: function(slider) - Fires after a slide is added
|
||||
removed: function(){} //{NEW} Callback: function(slider) - Fires after a slide is removed
|
||||
}
|
||||
|
||||
|
||||
//FlexSlider: Plugin Function
|
||||
$.fn.flexslider = function(options) {
|
||||
if (options === undefined) options = {};
|
||||
|
||||
if (typeof options === "object") {
|
||||
return this.each(function() {
|
||||
var $this = $(this),
|
||||
selector = (options.selector) ? options.selector : ".slides > li",
|
||||
$slides = $this.find(selector);
|
||||
|
||||
if ($slides.length === 1) {
|
||||
$slides.fadeIn(400);
|
||||
if (options.start) options.start($this);
|
||||
} else if ($this.data('flexslider') == undefined) {
|
||||
new $.flexslider(this, options);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Helper strings to quickly perform functions on the slider
|
||||
var $slider = $(this).data('flexslider');
|
||||
switch (options) {
|
||||
case "play": $slider.play(); break;
|
||||
case "pause": $slider.pause(); break;
|
||||
case "next": $slider.flexAnimate($slider.getTarget("next"), true); break;
|
||||
case "prev":
|
||||
case "previous": $slider.flexAnimate($slider.getTarget("prev"), true); break;
|
||||
default: if (typeof options === "number") $slider.flexAnimate(options, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
375
bootstrapTheme/static/js/index-slider.js
Normal file
375
bootstrapTheme/static/js/index-slider.js
Normal file
@@ -0,0 +1,375 @@
|
||||
jQuery.easing.jswing = jQuery.easing.swing;
|
||||
jQuery.extend(jQuery.easing, {
|
||||
def: "easeOutQuad",
|
||||
swing: function (e, f, a, h, g) {
|
||||
return jQuery.easing[jQuery.easing.def](e, f, a, h, g)
|
||||
},
|
||||
easeInQuad: function (e, f, a, h, g) {
|
||||
return h * (f /= g) * f + a
|
||||
},
|
||||
easeOutQuad: function (e, f, a, h, g) {
|
||||
return -h * (f /= g) * (f - 2) + a
|
||||
},
|
||||
easeInOutQuad: function (e, f, a, h, g) {
|
||||
if ((f /= g / 2) < 1) {
|
||||
return h / 2 * f * f + a
|
||||
}
|
||||
return -h / 2 * ((--f) * (f - 2) - 1) + a
|
||||
},
|
||||
easeInCubic: function (e, f, a, h, g) {
|
||||
return h * (f /= g) * f * f + a
|
||||
},
|
||||
easeOutCubic: function (e, f, a, h, g) {
|
||||
return h * ((f = f / g - 1) * f * f + 1) + a
|
||||
},
|
||||
easeInOutCubic: function (e, f, a, h, g) {
|
||||
if ((f /= g / 2) < 1) {
|
||||
return h / 2 * f * f * f + a
|
||||
}
|
||||
return h / 2 * ((f -= 2) * f * f + 2) + a
|
||||
},
|
||||
easeInQuart: function (e, f, a, h, g) {
|
||||
return h * (f /= g) * f * f * f + a
|
||||
},
|
||||
easeOutQuart: function (e, f, a, h, g) {
|
||||
return -h * ((f = f / g - 1) * f * f * f - 1) + a
|
||||
},
|
||||
easeInOutQuart: function (e, f, a, h, g) {
|
||||
if ((f /= g / 2) < 1) {
|
||||
return h / 2 * f * f * f * f + a
|
||||
}
|
||||
return -h / 2 * ((f -= 2) * f * f * f - 2) + a
|
||||
},
|
||||
easeInQuint: function (e, f, a, h, g) {
|
||||
return h * (f /= g) * f * f * f * f + a
|
||||
},
|
||||
easeOutQuint: function (e, f, a, h, g) {
|
||||
return h * ((f = f / g - 1) * f * f * f * f + 1) + a
|
||||
},
|
||||
easeInOutQuint: function (e, f, a, h, g) {
|
||||
if ((f /= g / 2) < 1) {
|
||||
return h / 2 * f * f * f * f * f + a
|
||||
}
|
||||
return h / 2 * ((f -= 2) * f * f * f * f + 2) + a
|
||||
},
|
||||
easeInSine: function (e, f, a, h, g) {
|
||||
return -h * Math.cos(f / g * (Math.PI / 2)) + h + a
|
||||
},
|
||||
easeOutSine: function (e, f, a, h, g) {
|
||||
return h * Math.sin(f / g * (Math.PI / 2)) + a
|
||||
},
|
||||
easeInOutSine: function (e, f, a, h, g) {
|
||||
return -h / 2 * (Math.cos(Math.PI * f / g) - 1) + a
|
||||
},
|
||||
easeInExpo: function (e, f, a, h, g) {
|
||||
return (f == 0) ? a : h * Math.pow(2, 10 * (f / g - 1)) + a
|
||||
},
|
||||
easeOutExpo: function (e, f, a, h, g) {
|
||||
return (f == g) ? a + h : h * (-Math.pow(2, -10 * f / g) + 1) + a
|
||||
},
|
||||
easeInOutExpo: function (e, f, a, h, g) {
|
||||
if (f == 0) {
|
||||
return a
|
||||
}
|
||||
if (f == g) {
|
||||
return a + h
|
||||
}
|
||||
if ((f /= g / 2) < 1) {
|
||||
return h / 2 * Math.pow(2, 10 * (f - 1)) + a
|
||||
}
|
||||
return h / 2 * (-Math.pow(2, -10 * --f) + 2) + a
|
||||
},
|
||||
easeInCirc: function (e, f, a, h, g) {
|
||||
return -h * (Math.sqrt(1 - (f /= g) * f) - 1) + a
|
||||
},
|
||||
easeOutCirc: function (e, f, a, h, g) {
|
||||
return h * Math.sqrt(1 - (f = f / g - 1) * f) + a
|
||||
},
|
||||
easeInOutCirc: function (e, f, a, h, g) {
|
||||
if ((f /= g / 2) < 1) {
|
||||
return -h / 2 * (Math.sqrt(1 - f * f) - 1) + a
|
||||
}
|
||||
return h / 2 * (Math.sqrt(1 - (f -= 2) * f) + 1) + a
|
||||
},
|
||||
easeInElastic: function (f, h, e, l, k) {
|
||||
var i = 1.70158;
|
||||
var j = 0;
|
||||
var g = l;
|
||||
if (h == 0) {
|
||||
return e
|
||||
}
|
||||
if ((h /= k) == 1) {
|
||||
return e + l
|
||||
}
|
||||
if (!j) {
|
||||
j = k * 0.3
|
||||
}
|
||||
if (g < Math.abs(l)) {
|
||||
g = l;
|
||||
var i = j / 4
|
||||
} else {
|
||||
var i = j / (2 * Math.PI) * Math.asin(l / g)
|
||||
}
|
||||
return -(g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
|
||||
},
|
||||
easeOutElastic: function (f, h, e, l, k) {
|
||||
var i = 1.70158;
|
||||
var j = 0;
|
||||
var g = l;
|
||||
if (h == 0) {
|
||||
return e
|
||||
}
|
||||
if ((h /= k) == 1) {
|
||||
return e + l
|
||||
}
|
||||
if (!j) {
|
||||
j = k * 0.3
|
||||
}
|
||||
if (g < Math.abs(l)) {
|
||||
g = l;
|
||||
var i = j / 4
|
||||
} else {
|
||||
var i = j / (2 * Math.PI) * Math.asin(l / g)
|
||||
}
|
||||
return g * Math.pow(2, -10 * h) * Math.sin((h * k - i) * (2 * Math.PI) / j) + l + e
|
||||
},
|
||||
easeInOutElastic: function (f, h, e, l, k) {
|
||||
var i = 1.70158;
|
||||
var j = 0;
|
||||
var g = l;
|
||||
if (h == 0) {
|
||||
return e
|
||||
}
|
||||
if ((h /= k / 2) == 2) {
|
||||
return e + l
|
||||
}
|
||||
if (!j) {
|
||||
j = k * (0.3 * 1.5)
|
||||
}
|
||||
if (g < Math.abs(l)) {
|
||||
g = l;
|
||||
var i = j / 4
|
||||
} else {
|
||||
var i = j / (2 * Math.PI) * Math.asin(l / g)
|
||||
}
|
||||
if (h < 1) {
|
||||
return -0.5 * (g * Math.pow(2, 10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j)) + e
|
||||
}
|
||||
return g * Math.pow(2, -10 * (h -= 1)) * Math.sin((h * k - i) * (2 * Math.PI) / j) * 0.5 + l + e
|
||||
},
|
||||
easeInBack: function (e, f, a, i, h, g) {
|
||||
if (g == undefined) {
|
||||
g = 1.70158
|
||||
}
|
||||
return i * (f /= h) * f * ((g + 1) * f - g) + a
|
||||
},
|
||||
easeOutBack: function (e, f, a, i, h, g) {
|
||||
if (g == undefined) {
|
||||
g = 0.70158
|
||||
}
|
||||
return i * ((f = f / h - 1) * f * ((g + 1) * f + g) + 1) + a
|
||||
},
|
||||
easeInOutBack: function (e, f, a, i, h, g) {
|
||||
if (g == undefined) {
|
||||
g = 1.70158
|
||||
}
|
||||
if ((f /= h / 2) < 1) {
|
||||
return i / 2 * (f * f * (((g *= (1.525)) + 1) * f - g)) + a
|
||||
}
|
||||
return i / 2 * ((f -= 2) * f * (((g *= (1.525)) + 1) * f + g) + 2) + a
|
||||
},
|
||||
easeInBounce: function (e, f, a, h, g) {
|
||||
return h - jQuery.easing.easeOutBounce(e, g - f, 0, h, g) + a
|
||||
},
|
||||
easeOutBounce: function (e, f, a, h, g) {
|
||||
if ((f /= g) < (1 / 2.75)) {
|
||||
return h * (7.5625 * f * f) + a
|
||||
} else {
|
||||
if (f < (2 / 2.75)) {
|
||||
return h * (7.5625 * (f -= (1.5 / 2.75)) * f + 0.75) + a
|
||||
} else {
|
||||
if (f < (2.5 / 2.75)) {
|
||||
return h * (7.5625 * (f -= (2.25 / 2.75)) * f + 0.9375) + a
|
||||
} else {
|
||||
return h * (7.5625 * (f -= (2.625 / 2.75)) * f + 0.984375) + a
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (e, f, a, h, g) {
|
||||
if (f < g / 2) {
|
||||
return jQuery.easing.easeInBounce(e, f * 2, 0, h, g) * 0.5 + a
|
||||
}
|
||||
return jQuery.easing.easeOutBounce(e, f * 2 - g, 0, h, g) * 0.5 + h * 0.5 + a
|
||||
}
|
||||
});
|
||||
|
||||
var center = $(window).width() / 2;
|
||||
$(document).ready(function () {
|
||||
function d() {
|
||||
$(".slide.active img").each(function () {
|
||||
var g = parseInt($(this).attr("class").split(" ")[1].replace("left", ""));
|
||||
var i = g + center;
|
||||
var h = parseInt($(this).attr("class").split(" ")[3].replace("t", ""));
|
||||
var f = parseInt($(this).attr("class").split(" ")[4].replace("z", ""));
|
||||
if ($(this).hasClass("fade")) {
|
||||
$(this).css({
|
||||
left: i,
|
||||
top: h,
|
||||
"z-index": f
|
||||
})
|
||||
} else {
|
||||
$(this).css({
|
||||
left: i,
|
||||
top: h,
|
||||
"z-index": f
|
||||
}).show()
|
||||
}
|
||||
});
|
||||
setTimeout(function () {
|
||||
$(".slide.active img.fade,.slide.active .info").fadeIn(600, "easeInOutQuad", function () {
|
||||
$("#feature_slider").removeClass()
|
||||
})
|
||||
}, 800)
|
||||
}
|
||||
function c() {
|
||||
$("#feature_slider").addClass("disabled").append('<ul id="pagination" /><a href="" id="slide-left" /><a href="" id="slide-right" />');
|
||||
$("#feature_slider article").each(function () {
|
||||
$("#pagination").append('<li><a href="#' + $(this).attr("id") + '">' + $(this).index() + "</a></li>")
|
||||
});
|
||||
$("#pagination li:first").addClass("active");
|
||||
$("#pagination").css({
|
||||
left: ($(window).width() - $("#pagination li").length * 14) / 2
|
||||
});
|
||||
var h = 0;
|
||||
|
||||
function j() {
|
||||
$(".slide.active img").each(function () {
|
||||
var l = parseInt($(this).attr("class").split(" ")[1].replace("left", ""));
|
||||
var q = l + center;
|
||||
// var p = parseInt($(this).attr("class").split(" ")[2].replace("st", ""));
|
||||
var p = 400;
|
||||
var n = parseInt($(this).attr("class").split(" ")[2].replace("sp", ""));
|
||||
var o = parseInt($(this).attr("class").split(" ")[3].replace("t", ""));
|
||||
var k = parseInt($(this).attr("class").split(" ")[4].replace("z", ""));
|
||||
if ($(this).hasClass("fade")) {
|
||||
$(this).css({
|
||||
left: q,
|
||||
top: o,
|
||||
"z-index": k
|
||||
})
|
||||
} else {
|
||||
if ($("#feature_slider").hasClass("scrollLeft")) {
|
||||
var m = -$(this).width() - p
|
||||
} else {
|
||||
var m = $(window).width() + p
|
||||
}
|
||||
$(this).css({
|
||||
left: m,
|
||||
top: o,
|
||||
"z-index": k
|
||||
}).show();
|
||||
$(this).animate({
|
||||
left: q
|
||||
}, n, "easeOutQuad")
|
||||
}
|
||||
});
|
||||
setTimeout(function () {
|
||||
$(".slide.active img.fade,.slide.active .info").fadeIn(600, "easeInOutQuad", function () {
|
||||
$("#feature_slider").removeClass()
|
||||
})
|
||||
}, 600)
|
||||
}
|
||||
function g() {
|
||||
$(".slide.active").removeClass("active").addClass("previous");
|
||||
$(".slide.previous img").not(".fade").each(function () {
|
||||
// var l = parseInt($(this).attr("class").split(" ")[2].replace("st", ""));
|
||||
var l = 400;
|
||||
var k = parseInt($(this).attr("class").split(" ")[2].replace("sp", ""));
|
||||
if ($("#feature_slider").hasClass("scrollLeft")) {
|
||||
$(this).animate({
|
||||
left: $(window).width() + l
|
||||
}, k, "easeInQuad")
|
||||
} else {
|
||||
$(this).animate({
|
||||
left: -$(this).width() - l
|
||||
}, k, "easeInQuad")
|
||||
}
|
||||
});
|
||||
// speed of transitions
|
||||
$(".slide.previous img.fade,.slide.previous .info").fadeOut(600, "easeInQuad", function () {
|
||||
$(".slide.next").removeClass("next").addClass("active").fadeIn(500, "easeInOutQuad", function () {
|
||||
$(".slide.previous").removeClass("previous").fadeOut(500, "easeInOutQuad");
|
||||
j()
|
||||
})
|
||||
})
|
||||
}
|
||||
$(".slide:first").addClass("active").fadeIn(500, "easeInOutQuad", function () {
|
||||
$("#slide-left, #slide-right, #pagination").fadeIn(200, "easeInOutQuad", function () {
|
||||
j()
|
||||
})
|
||||
});
|
||||
$("#pagination li").not("active").click(function () {
|
||||
clearInterval(f);
|
||||
if ($(this).index() < $("#pagination li.active").index()) {
|
||||
$("#feature_slider").addClass("scrollLeft")
|
||||
}
|
||||
if (!$("#feature_slider").hasClass("disabled")) {
|
||||
$("#feature_slider").addClass("disabled");
|
||||
$("#pagination li.active").removeClass();
|
||||
$(this).addClass("active");
|
||||
$($(this).find("a").attr("href")).addClass("next");
|
||||
g()
|
||||
}
|
||||
return false
|
||||
});
|
||||
$("#slide-left").click(function () {
|
||||
clearInterval(f);
|
||||
if (!$("#feature_slider").hasClass("disabled")) {
|
||||
$("#feature_slider").addClass("disabled");
|
||||
if ($("#pagination li:first").hasClass("active")) {
|
||||
$("#pagination li.active").removeClass();
|
||||
$("#pagination li:last").addClass("active");
|
||||
$("#feature_slider article:last").addClass("next")
|
||||
} else {
|
||||
$("#pagination li.active").removeClass().prev().addClass("active");
|
||||
$("#feature_slider article.active").prev().addClass("next")
|
||||
}
|
||||
$("#feature_slider").addClass("scrollLeft");
|
||||
g()
|
||||
}
|
||||
return false
|
||||
});
|
||||
|
||||
function i() {
|
||||
if (!$("#feature_slider").hasClass("disabled")) {
|
||||
$("#feature_slider").addClass("disabled");
|
||||
if ($("#pagination li:last").hasClass("active")) {
|
||||
$("#pagination li.active").removeClass();
|
||||
$("#pagination li:first").addClass("active");
|
||||
$("#feature_slider article:first").addClass("next")
|
||||
} else {
|
||||
$("#pagination li.active").removeClass().next().addClass("active");
|
||||
$("#feature_slider article.active").next().addClass("next")
|
||||
}
|
||||
g()
|
||||
}
|
||||
}
|
||||
$("#slide-right").click(function () {
|
||||
clearInterval(f);
|
||||
i();
|
||||
return false
|
||||
});
|
||||
var f = setInterval(function () {
|
||||
i()
|
||||
}, 15000)
|
||||
}
|
||||
c();
|
||||
$(window).resize(function () {
|
||||
$("#pagination").css({
|
||||
left: ($(window).width() - $("#pagination li").length * 14) / 2
|
||||
});
|
||||
center = $(window).width() / 2;
|
||||
d()
|
||||
});
|
||||
});
|
||||
6
bootstrapTheme/static/js/jquery-2.0.3.min.js
vendored
Normal file
6
bootstrapTheme/static/js/jquery-2.0.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
6
bootstrapTheme/static/js/jquery-ui-1.10.0.custom.min.js
vendored
Normal file
6
bootstrapTheme/static/js/jquery-ui-1.10.0.custom.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
26
bootstrapTheme/static/js/jquery.countdown.min.js
vendored
Executable file
26
bootstrapTheme/static/js/jquery.countdown.min.js
vendored
Executable file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* jQuery The Final Countdown plugin v1.0.0 beta
|
||||
* http://github.com/hilios/jquery.countdown
|
||||
*
|
||||
* Copyright (c) 2011 Edson Hilios
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
(function(h){h.fn.countdown=function(a,l){function m(a,d){return function(){return d.call(a)}}var k="seconds minutes hours days weeks daysLeft".split(" ");return this.each(function(){function j(){if(0===e.closest("html").length)clearInterval(f),d("removed");else{c--;0>c&&(c=0);g={seconds:c%60,minutes:Math.floor(c/60)%60,hours:Math.floor(c/60/60)%24,days:Math.floor(c/60/60/24),weeks:Math.floor(c/60/60/24/7),daysLeft:Math.floor(c/60/60/24)%7};for(var a=0;a<k.length;a++){var b=k[a];i[b]!=g[b]&&(i[b]=g[b],d(b))}0==c&&(clearInterval(f),d("finished"))}}function d(d){var b=h.Event(d);b.date=new Date((new Date).valueOf()+c);b.value=i[d]||"0";b.toDate=a;b.lasting=g;switch(d){case "seconds":case "minutes":case "hours":b.value=10>b.value?"0"+b.value.toString():b.value.toString();break;default:b.value&&(b.value=b.value.toString())}l.call(e,b)}if(!(a instanceof Date))if(String(a).match(/^[0-9]*$/))a=new Date(a);else if(a.match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})\s([0-9]{1,2})\:([0-9]{2})\:([0-9]{2})/)||a.match(/([0-9]{2,4})\/([0-9]{1,2})\/([0-9]{1,2})\s([0-9]{1,2})\:([0-9]{2})\:([0-9]{2})/))a=new Date(a);else if(a.match(/([0-9]{1,2})\/([0-9]{1,2})\/([0-9]{2,4})/)||a.match(/([0-9]{2,4})\/([0-9]{1,2})\/([0-9]{1,2})/))a=new Date(a);else throw Error("Doesn't seen to be a valid date object or string");var e=h(this),i={},g={},f=e.data("countdownInterval"),c=Math.floor((a.valueOf()-(new Date).valueOf())/1E3);j();f&&clearInterval(f);e.data("countdownInterval",setInterval(m(e,j),1E3));f=e.data("countdownInterval")})}})(jQuery);
|
||||
11
bootstrapTheme/static/js/jquery.isotope.min.js
vendored
Normal file
11
bootstrapTheme/static/js/jquery.isotope.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
265
bootstrapTheme/static/js/jquery.noty.js
Normal file
265
bootstrapTheme/static/js/jquery.noty.js
Normal file
@@ -0,0 +1,265 @@
|
||||
/**
|
||||
* noty - jQuery Notification Plugin v1.2.1
|
||||
* Contributors: https://github.com/needim/noty/graphs/contributors
|
||||
*
|
||||
* Examples and Documentation - http://needim.github.com/noty/
|
||||
*
|
||||
* Licensed under the MIT licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
**/
|
||||
(function($) {
|
||||
$.noty = function(options, customContainer) {
|
||||
|
||||
var base = {};
|
||||
var $noty = null;
|
||||
var isCustom = false;
|
||||
|
||||
base.init = function(options) {
|
||||
base.options = $.extend({}, $.noty.defaultOptions, options);
|
||||
base.options.type = base.options.cssPrefix+base.options.type;
|
||||
base.options.id = base.options.type+'_'+new Date().getTime();
|
||||
base.options.layout = base.options.cssPrefix+'layout_'+base.options.layout;
|
||||
|
||||
if (base.options.custom.container) customContainer = base.options.custom.container;
|
||||
isCustom = ($.type(customContainer) === 'object') ? true : false;
|
||||
|
||||
return base.addQueue();
|
||||
};
|
||||
|
||||
// Push notification to queue
|
||||
base.addQueue = function() {
|
||||
var isGrowl = ($.inArray(base.options.layout, $.noty.growls) == -1) ? false : true;
|
||||
if (!isGrowl) (base.options.force) ? $.noty.queue.unshift({options: base.options}) : $.noty.queue.push({options: base.options});
|
||||
return base.render(isGrowl);
|
||||
};
|
||||
|
||||
// Render the noty
|
||||
base.render = function(isGrowl) {
|
||||
|
||||
// Layout spesific container settings
|
||||
var container = (isCustom) ? customContainer.addClass(base.options.theme+' '+base.options.layout+' noty_custom_container') : $('body');
|
||||
if (isGrowl) {
|
||||
if ($('ul.noty_cont.' + base.options.layout).length == 0)
|
||||
container.prepend($('<ul/>').addClass('noty_cont ' + base.options.layout));
|
||||
container = $('ul.noty_cont.' + base.options.layout);
|
||||
} else {
|
||||
if ($.noty.available) {
|
||||
var fromQueue = $.noty.queue.shift(); // Get noty from queue
|
||||
if ($.type(fromQueue) === 'object') {
|
||||
$.noty.available = false;
|
||||
base.options = fromQueue.options;
|
||||
} else {
|
||||
$.noty.available = true; // Queue is over
|
||||
return base.options.id;
|
||||
}
|
||||
} else {
|
||||
return base.options.id;
|
||||
}
|
||||
}
|
||||
base.container = container;
|
||||
|
||||
// Generating noty bar
|
||||
base.bar = $('<div class="noty_bar"/>').attr('id', base.options.id).addClass(base.options.theme+' '+base.options.layout+' '+base.options.type);
|
||||
$noty = base.bar;
|
||||
$noty.append(base.options.template).find('.noty_text').html(base.options.text);
|
||||
$noty.data('noty_options', base.options);
|
||||
|
||||
// Close button display
|
||||
(base.options.closeButton) ? $noty.addClass('noty_closable').find('.noty_close').show() : $noty.find('.noty_close').remove();
|
||||
|
||||
// Bind close event to button
|
||||
$noty.find('.noty_close').bind('click', function() { $noty.trigger('noty.close'); });
|
||||
|
||||
// If we have a button we must disable closeOnSelfClick and closeOnSelfOver option
|
||||
if (base.options.buttons) base.options.closeOnSelfClick = base.options.closeOnSelfOver = false;
|
||||
// Close on self click
|
||||
if (base.options.closeOnSelfClick) $noty.bind('click', function() { $noty.trigger('noty.close'); }).css('cursor', 'pointer');
|
||||
// Close on self mouseover
|
||||
if (base.options.closeOnSelfOver) $noty.bind('mouseover', function() { $noty.trigger('noty.close'); }).css('cursor', 'pointer');
|
||||
|
||||
// Set buttons if available
|
||||
if (base.options.buttons) {
|
||||
$buttons = $('<div/>').addClass('noty_buttons');
|
||||
$noty.find('.noty_message').append($buttons);
|
||||
$.each(base.options.buttons, function(i, button) {
|
||||
bclass = (button.type) ? button.type : 'gray';
|
||||
$button = $('<button/>').addClass(bclass).html(button.text).appendTo($noty.find('.noty_buttons'))
|
||||
.bind('click', function() {
|
||||
if ($.isFunction(button.click)) {
|
||||
button.click.call($button, $noty);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
return base.show(isGrowl);
|
||||
};
|
||||
|
||||
base.show = function(isGrowl) {
|
||||
|
||||
// is Modal?
|
||||
if (base.options.modal) $('<div/>').addClass('noty_modal').addClass(base.options.theme).prependTo($('body')).fadeIn('fast');
|
||||
|
||||
$noty.close = function() { return this.trigger('noty.close'); };
|
||||
|
||||
// Prepend noty to container
|
||||
(isGrowl) ? base.container.prepend($('<li/>').append($noty)) : base.container.prepend($noty);
|
||||
|
||||
// topCenter and center specific options
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
|
||||
$noty.bind('noty.setText', function(event, text) {
|
||||
$noty.find('.noty_text').html(text);
|
||||
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
});
|
||||
|
||||
$noty.bind('noty.setType', function(event, type) {
|
||||
$noty.removeClass($noty.data('noty_options').type);
|
||||
|
||||
type = $noty.data('noty_options').cssPrefix+type;
|
||||
|
||||
$noty.data('noty_options').type = type;
|
||||
|
||||
$noty.addClass(type);
|
||||
|
||||
if (base.options.layout == 'noty_layout_topCenter' || base.options.layout == 'noty_layout_center') {
|
||||
$.noty.reCenter($noty);
|
||||
}
|
||||
});
|
||||
|
||||
$noty.bind('noty.getId', function(event) {
|
||||
return $noty.data('noty_options').id;
|
||||
});
|
||||
|
||||
// Bind close event
|
||||
$noty.one('noty.close', function(event) {
|
||||
var options = $noty.data('noty_options');
|
||||
if(options.onClose){options.onClose();}
|
||||
|
||||
// Modal Cleaning
|
||||
if (options.modal) $('.noty_modal').fadeOut('fast', function() { $(this).remove(); });
|
||||
|
||||
$noty.clearQueue().stop().animate(
|
||||
$noty.data('noty_options').animateClose,
|
||||
$noty.data('noty_options').speed,
|
||||
$noty.data('noty_options').easing,
|
||||
$noty.data('noty_options').onClosed)
|
||||
.promise().done(function() {
|
||||
|
||||
// Layout spesific cleaning
|
||||
if ($.inArray($noty.data('noty_options').layout, $.noty.growls) > -1) {
|
||||
$noty.parent().remove();
|
||||
} else {
|
||||
$noty.remove();
|
||||
|
||||
// queue render
|
||||
$.noty.available = true;
|
||||
base.render(false);
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
// Start the show
|
||||
if(base.options.onShow){base.options.onShow();}
|
||||
$noty.animate(base.options.animateOpen, base.options.speed, base.options.easing, base.options.onShown);
|
||||
|
||||
// If noty is have a timeout option
|
||||
if (base.options.timeout) $noty.delay(base.options.timeout).promise().done(function() { $noty.trigger('noty.close'); });
|
||||
return base.options.id;
|
||||
};
|
||||
|
||||
// Run initializer
|
||||
return base.init(options);
|
||||
};
|
||||
|
||||
// API
|
||||
$.noty.get = function(id) { return $('#'+id); };
|
||||
$.noty.close = function(id) {
|
||||
//remove from queue if not already visible
|
||||
for(var i=0;i<$.noty.queue.length;) {
|
||||
if($.noty.queue[i].options.id==id)
|
||||
$.noty.queue.splice(id,1);
|
||||
else
|
||||
i++;
|
||||
}
|
||||
//close if already visible
|
||||
$.noty.get(id).trigger('noty.close');
|
||||
};
|
||||
$.noty.setText = function(id, text) {
|
||||
$.noty.get(id).trigger('noty.setText', text);
|
||||
};
|
||||
$.noty.setType = function(id, type) {
|
||||
$.noty.get(id).trigger('noty.setType', type);
|
||||
};
|
||||
$.noty.closeAll = function() {
|
||||
$.noty.clearQueue();
|
||||
$('.noty_bar').trigger('noty.close');
|
||||
};
|
||||
$.noty.reCenter = function(noty) {
|
||||
noty.css({'left': ($(window).width() - noty.outerWidth()) / 2 + 'px'});
|
||||
};
|
||||
$.noty.clearQueue = function() {
|
||||
$.noty.queue = [];
|
||||
};
|
||||
|
||||
var windowAlert = window.alert;
|
||||
$.noty.consumeAlert = function(options){
|
||||
window.alert = function(text){
|
||||
if(options){options.text = text;}
|
||||
else{options = {text:text};}
|
||||
$.noty(options);
|
||||
};
|
||||
}
|
||||
$.noty.stopConsumeAlert = function(){
|
||||
window.alert = windowAlert;
|
||||
}
|
||||
|
||||
$.noty.queue = [];
|
||||
$.noty.growls = ['noty_layout_topLeft', 'noty_layout_topRight', 'noty_layout_bottomLeft', 'noty_layout_bottomRight'];
|
||||
$.noty.available = true;
|
||||
$.noty.defaultOptions = {
|
||||
layout: 'top',
|
||||
theme: 'noty_theme_default',
|
||||
animateOpen: {height: 'toggle'},
|
||||
animateClose: {height: 'toggle'},
|
||||
easing: 'swing',
|
||||
text: '',
|
||||
type: 'alert',
|
||||
speed: 500,
|
||||
timeout: 5000,
|
||||
closeButton: false,
|
||||
closeOnSelfClick: true,
|
||||
closeOnSelfOver: false,
|
||||
force: false,
|
||||
onShow: false,
|
||||
onShown: false,
|
||||
onClose: false,
|
||||
onClosed: false,
|
||||
buttons: false,
|
||||
modal: false,
|
||||
template: '<div class="noty_message"><span class="noty_text"></span><div class="noty_close"></div></div>',
|
||||
cssPrefix: 'noty_',
|
||||
custom: {
|
||||
container: null
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.noty = function(options) {
|
||||
return this.each(function() {
|
||||
(new $.noty(options, $(this)));
|
||||
});
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
|
||||
//Helper
|
||||
function noty(options) {
|
||||
return jQuery.noty(options); // returns an id
|
||||
}
|
||||
63
bootstrapTheme/static/js/theme.js
Normal file
63
bootstrapTheme/static/js/theme.js
Normal file
@@ -0,0 +1,63 @@
|
||||
$(function () {
|
||||
$(window).scroll(function() {
|
||||
if ($(".navbar").offset().top>30) {
|
||||
$(".navbar-inner").addClass("sticky");
|
||||
}
|
||||
else {
|
||||
$(".navbar-inner").removeClass("sticky");
|
||||
}
|
||||
});
|
||||
|
||||
// Flex
|
||||
if ($(".flexslider").length) {
|
||||
$('.flexslider').flexslider();
|
||||
}
|
||||
|
||||
servicesCircle.initialize();
|
||||
|
||||
staticHeader.initialize();
|
||||
|
||||
portfolioItem.initialize();
|
||||
});
|
||||
|
||||
var portfolioItem = {
|
||||
initialize: function () {
|
||||
var $container = $("#portfolio_tem .left_box");
|
||||
var $bigPics = $container.find(".big img");
|
||||
var $thumbs = $container.find(".thumbs .thumb");
|
||||
|
||||
$bigPics.hide().eq(0).show();
|
||||
|
||||
$thumbs.click(function (e) {
|
||||
e.preventDefault();
|
||||
var index = $thumbs.index(this);
|
||||
$bigPics.fadeOut();
|
||||
$bigPics.eq(index).fadeIn();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var staticHeader = {
|
||||
initialize: function () {
|
||||
if ($(".navbar-static-top").length) {
|
||||
$("body").css("padding-top", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var servicesCircle = {
|
||||
initialize: function () {
|
||||
var $container = $(".services_circles");
|
||||
var $texts = $container.find(".description .text");
|
||||
var $circles = $container.find(".areas .circle");
|
||||
|
||||
$circles.click(function () {
|
||||
var index = $circles.index(this);
|
||||
$texts.fadeOut();
|
||||
$texts.eq(index).fadeIn();
|
||||
$circles.removeClass("active");
|
||||
$(this).addClass("active");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user