preview site for fix and fresh

This commit is contained in:
westfarn committed 2026-07-22 05:07:13 -05:00
1 parent b19fdee30d
commit f70adf2a5e
1228 files changed
+38196 -149050

No files matched your search

@@ -0,0 +1,8 @@
/*!
* Isotope PACKAGED v2.0.0
* Filter & sort magical layouts
* http://isotope.metafizzy.co
*/
(function(t){function e(){}function i(t){function i(e){e.prototype.option||(e.prototype.option=function(e){t.isPlainObject(e)&&(this.options=t.extend(!0,this.options,e))})}function n(e,i){t.fn[e]=function(n){if("string"==typeof n){for(var s=o.call(arguments,1),a=0,u=this.length;u>a;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():r.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==n.readyState;if(!e.isReady&&!i){e.isReady=!0;for(var o=0,s=r.length;s>o;o++){var a=r[o];a()}}}function o(o){return o.bind(n,"DOMContentLoaded",i),o.bind(n,"readystatechange",i),o.bind(t,"load",i),e}var n=t.document,r=[];e.isReady=!1,"function"==typeof define&&define.amd?(e.isReady="function"==typeof requirejs,define("doc-ready/doc-ready",["eventie/eventie"],o)):t.docReady=o(t.eventie)}(this),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?moduleLine truncated
},c.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=d(i)}},c.prototype._updateItemsSortData=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];o.updateSortData()}};var d=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=c.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();c.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},c.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},c.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},c.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},c.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},c.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},c.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},c.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},c.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},c.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},c.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},c.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var l=c.prototype.remove;return c.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(l.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},c.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},c}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window);
@@ -0,0 +1,6 @@
/*! jQuery UI - v1.10.3 - 2013-11-05
* http://jqueryui.com
* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.position.js, jquery.ui.draggable.js, jquery.ui.tooltip.js
* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
(function(e,t){function i(t,i){var s,n,r,o=t.nodeName.toLowerCase();return"area"===o?(s=t.parentNode,n=s.name,t.href&&n&&"map"===s.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&a(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&a(t)}function a(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var s=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,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,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,a){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),a&&a.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var a,s,n=e(this[0]);n.length&&n[0]!==document;){if(a=n.css("position"),("absolute"===a||"relative"===a||"fixed"===a)&&(s=parseInt(n.css("zIndex"),10),!isNaN(s)&&0!==s))return s;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++s)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,a){return!!e.data(t,a[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var a=e.attr(t,"tabindex"),s=isNaN(a);return(s||a>=0)&&i(t,!s)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,a){function s(t,i,a,s){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,a&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),s&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===a?["Left","Right"]:["Top","Bottom"],r=a.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+a]=function(i){return i===t?o["inner"+a].call(this):this.each(function(){e(this).css(r,s(this,i)+"px")})},e.fn["outer"+a]=function(t,i){return"number"!=typeof t?o["outer"+a].call(this,t):this.each(function(){e(this).css(r,s(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,a){var s,n=e.ui[t].prototype;for(s in a)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([i,a[s]])},call:function(e,t,i){var a,s=e.plugins[t];if(s&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(a=0;s.length>a;a++)e.options[s[a][0]]&&s[a][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var a=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return t[a]>0?!0:(t[a]=1,s=t[a]>0,t[a]=0,s)}})})(jQuery);(function(e,t){var i=0,s=Array.prototype.slice,a=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(n){}a(t)},e.widget=function(i,s,a){var n,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],n=u+"-"+i,a||(a=s,s=e.Widget),e.expr[":"][n.toLowerCase()]=function(t){return!!e.data(t,n)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:a.version,_proto:e.extend({},a),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(a,function(i,a){return e.isFunction(a)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,n=this._superApply;return this._suLine truncated
@@ -0,0 +1,13 @@
/*
* touchSwipe - jQuery Plugin
* https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
* http://labs.skinkers.com/touchSwipe/
* http://plugins.jquery.com/project/touchSwipe
*
* Copyright (c) 2010 Matt Bryson (www.skinkers.com)
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* $version: 1.3.3
*/
(function(g){function P(c){if(c&&void 0===c.allowPageScroll&&(void 0!==c.swipe||void 0!==c.swipeStatus))c.allowPageScroll=G;c||(c={});c=g.extend({},g.fn.swipe.defaults,c);return this.each(function(){var b=g(this),f=b.data(w);f||(f=new W(this,c),b.data(w,f))})}function W(c,b){var f,p,r,s;function H(a){var a=a.originalEvent,c,Q=n?a.touches[0]:a;d=R;n?h=a.touches.length:a.preventDefault();i=0;j=null;k=0;!n||h===b.fingers||b.fingers===x?(r=f=Q.pageX,s=p=Q.pageY,y=(new Date).getTime(),b.swipeStatus&&(c=l(a,d))):t(a);if(!1===c)return d=m,l(a,d),c;e.bind(I,J);e.bind(K,L)}function J(a){a=a.originalEvent;if(!(d===q||d===m)){var c,e=n?a.touches[0]:a;f=e.pageX;p=e.pageY;u=(new Date).getTime();j=S();n&&(h=a.touches.length);d=z;var e=a,g=j;if(b.allowPageScroll===G)e.preventDefault();else{var o=b.allowPageScroll===T;switch(g){case v:(b.swipeLeft&&o||!o&&b.allowPageScroll!=M)&&e.preventDefault();break;case A:(b.swipeRight&&o||!o&&b.allowPageScroll!=M)&&e.preventDefault();break;case B:(b.swipeUp&&o||!o&&b.allowPageScroll!=N)&&e.preventDefault();break;case C:(b.swipeDown&&o||!o&&b.allowPageScroll!=N)&&e.preventDefault()}}h===b.fingers||b.fingers===x||!n?(i=U(),k=u-y,b.swipeStatus&&(c=l(a,d,j,i,k)),b.triggerOnTouchEnd||(e=!(b.maxTimeThreshold?!(k>=b.maxTimeThreshold):1),!0===D()?(d=q,c=l(a,d)):e&&(d=m,l(a,d)))):(d=m,l(a,d));!1===c&&(d=m,l(a,d))}}function L(a){a=a.originalEvent;u=(new Date).getTime();i=U();j=S();k=u-y;if(b.triggerOnTouchEnd||!1===b.triggerOnTouchEnd&&d===z)if(d=q,(h===b.fingers||b.fingers===x||!n)&&0!==f){var c=!(b.maxTimeThreshold?!(k>=b.maxTimeThreshold):1);if((!0===D()||null===D())&&!c)l(a,d);else if(c||!1===D())d=m,l(a,d)}else d=m,l(a,d);else d===z&&(d=m,l(a,d));e.unbind(I,J,!1);e.unbind(K,L,!1)}function t(){y=u=p=f=s=r=h=0}function l(a,c){var d=void 0;b.swipeStatus&&(d=b.swipeStatus.call(e,a,c,j||null,i||0,k||0,h));if(c===m&&b.click&&(1===h||!n)&&(isNaN(i)||0===i))d=b.click.call(e,a,a.target);if(c==q)switch(b.swipe&&(d=b.swipe.call(e,a,j,i,k,h)),j){case v:b.swipeLeft&&(d=b.swipeLeft.call(e,a,j,i,k,h));break;case A:b.swipeRight&&(d=b.swipeRight.call(e,a,j,i,k,h));break;case B:b.swipeUp&&(d=b.swipeUp.call(e,a,j,i,k,h));break;case C:b.swipeDown&&(d=b.swipeDown.call(e,a,j,i,k,h))}(c===m||c===q)&&t(a);return d}function D(){return null!==b.threshold?i>=b.threshold:null}function U(){return Math.round(Math.sqrt(Math.pow(f-r,2)+Math.pow(p-s,2)))}function S(){var a;a=Math.atan2(p-s,r-f);a=Math.round(180*a/Math.PI);0>a&&(a=360-Math.abs(a));return 45>=a&&0<=a?v:360>=a&&315<=a?v:135<=a&&225>=a?A:45<a&&135>a?C:B}function V(){e.unbind(E,H);e.unbind(F,t);e.unbind(I,J);e.unbind(K,L)}var O=n||!b.fallbackToMouseEvents,E=O?"touchstart":"mousedown",I=O?"touchmove":"mousemove",K=O?"touchend":"mouseup",F="touchcancel",i=0,j=null,k=0,e=g(c),d="start",h=0,y=p=f=s=r=0,u=0;try{e.bind(E,H),e.bind(F,t)}catch(P){g.error("events not supported "+E+","+F+" on jQuery.swipe")}this.enable=function(){e.bind(E,H);e.bind(F,t);return e};this.disable=function(){V();return e};this.destroy=function(){V();e.data(w,null);return e}}var v="left",A="right",B="up",C="down",G="none",T="auto",M="horizontal",N="vertical",x="all",R="start",z="move",q="end",m="cancel",n="ontouchstart"in window,w="TouchSwipe";g.fn.swipe=function(c){var b=g(this),f=b.data(w);if(f&&"string"===typeof c){if(f[c])return f[c].apply(this,Array.prototype.slice.call(arguments,1));g.error("Method "+c+" does not exist on jQuery.swipe")}else if(!f&&("object"===typeof c||!c))return P.apply(this,arguments);return b};g.fn.swipe.defaults={fingers:1,threshold:75,maxTimeThreshold:null,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,click:null,triggerOnTouchEnd:!0,allowPageScroll:"auto",fallbackToMouseEvents:!0};g.fn.swipe.phases={PHASE_START:R,PHASE_MOVE:z,PHASE_END:q,PHASE_CANCEL:m};g.fn.swipe.directions={LEFT:v,RIGHT:A,UP:B,DOWN:C};g.fn.swipe.pageScroll={NONE:G,HORIZONTAL:M,VERTICAL:N,AUTO:T};g.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:x}})(jQuery);
@@ -0,0 +1,160 @@
/*!
* jQuery UI Touch Punch 0.2.2
*
* Copyright 2011, Dave Furfero
* Dual licensed under the MIT or GPL Version 2 licenses.
*
* Depends:
* jquery.ui.widget.js
* jquery.ui.mouse.js
*/
(function ($) {
// Detect touch support
$.support.touch = 'ontouchend' in document;
// Ignore browsers without touch support
if (!$.support.touch) {
return;
}
var mouseProto = $.ui.mouse.prototype,
_mouseInit = mouseProto._mouseInit,
touchHandled;
/**
* Simulate a mouse event based on a corresponding touch event
* @param {Object} event A touch event
* @param {String} simulatedType The corresponding mouse event
*/
function simulateMouseEvent (event, simulatedType) {
// Ignore multi-touch events
if (event.originalEvent.touches.length > 1) {
return;
}
event.preventDefault();
var touch = event.originalEvent.changedTouches[0],
simulatedEvent = document.createEvent('MouseEvents');
// Initialize the simulated mouse event using the touch event's coordinates
simulatedEvent.initMouseEvent(
simulatedType, // type
true, // bubbles
true, // cancelable
window, // view
1, // detail
touch.screenX, // screenX
touch.screenY, // screenY
touch.clientX, // clientX
touch.clientY, // clientY
false, // ctrlKey
false, // altKey
false, // shiftKey
false, // metaKey
0, // button
null // relatedTarget
);
// Dispatch the simulated event to the target element
event.target.dispatchEvent(simulatedEvent);
}
/**
* Handle the jQuery UI widget's touchstart events
* @param {Object} event The widget element's touchstart event
*/
mouseProto._touchStart = function (event) {
var self = this;
// Ignore the event if another widget is already being handled
if (touchHandled || !self._mouseCapture(event.originalEvent.changedTouches[0])) {
return;
}
// Set the flag to prevent other widgets from inheriting the touch event
touchHandled = true;
// Track movement to determine if interaction was a click
self._touchMoved = false;
// Simulate the mouseover event
simulateMouseEvent(event, 'mouseover');
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
// Simulate the mousedown event
simulateMouseEvent(event, 'mousedown');
};
/**
* Handle the jQuery UI widget's touchmove events
* @param {Object} event The document's touchmove event
*/
mouseProto._touchMove = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Interaction was not a click
this._touchMoved = true;
// Simulate the mousemove event
simulateMouseEvent(event, 'mousemove');
};
/**
* Handle the jQuery UI widget's touchend events
* @param {Object} event The document's touchend event
*/
mouseProto._touchEnd = function (event) {
// Ignore event if not handled
if (!touchHandled) {
return;
}
// Simulate the mouseup event
simulateMouseEvent(event, 'mouseup');
// Simulate the mouseout event
simulateMouseEvent(event, 'mouseout');
// If the touch interaction did not move, it should trigger a click
if (!this._touchMoved) {
// Simulate the click event
simulateMouseEvent(event, 'click');
}
// Unset the flag to allow other widgets to inherit the touch event
touchHandled = false;
};
/**
* A duck punch of the $.ui.mouse _mouseInit method to support touch events.
* This method extends the widget with bound touch event handlers that
* translate touch events to mouse events and pass them to the widget's
* original mouse event handling methods.
*/
mouseProto._mouseInit = function () {
var self = this;
// Delegate the touch handlers to the widget's element
self.element
.bind('touchstart', $.proxy(self, '_touchStart'))
.bind('touchmove', $.proxy(self, '_touchMove'))
.bind('touchend', $.proxy(self, '_touchEnd'));
// Call the original $.ui.mouse init method
_mouseInit.call(self);
};
})(jQuery);
@@ -0,0 +1,122 @@
/*
* Plugin for draggable pagination for tmMultimediaGallery
*Version: 1.0;
*Author: Smart;
*/
(function($){
$.fn.tmDraggablePagination = function(o){
return this.each(function(){
var $this = $(this),
data = $this.data('tmDraggablePagination'),
options = {
itemClass: '.item',
prevButtonClass: '.prev',
nextButtonClass: '.next',
controlHiddenClass: '.hide-button',
step: null,
constructor: function () {
var $paginHolder = $this.find(">div"),
$win = $(window),
$next = $(options.nextButtonClass),
$prev = $(options.prevButtonClass),
totalWidth = 0,
step = (options.step) ? options.step : $paginHolder.find(options.itemClass).outerWidth(true);
init();
function checkFunction(rule, position){
if ($paginHolder.length) {
if (rule){
$paginHolder.stop().animate({'left': position});
return false;
}
}
return true;
}
function checkLeftBorder(){
return checkFunction(($paginHolder.position().left > 0), 0);
}
function checkWidth(){
return checkFunction(($paginHolder.width() < $this.width()), 0);
}
function checkRightBorder(){
var leftPos = Math.abs($paginHolder.position().left) + $this.width();
return checkFunction((leftPos > $paginHolder.width()), (-1*($paginHolder.width() - $this.width())));
}
function init(){
var controlHiddenClassName = options.controlHiddenClass.substr(1);
$paginHolder
.find(options.itemClass).each(function(){
totalWidth += $(this).outerWidth(true);
})
.end()
.width(totalWidth)
.draggable({
axis: "x",
start: onDragStart,
stop: onDragStop
});
onDragStart();
// set listeners
$next && $next.on('click', onClickNext);
$prev && $prev.on('click', onClickPrev);
$win.on('resize', onResize);
function onClickPrev(e){
var leftPosNew = $paginHolder.position().left + step;
(leftPosNew > 0) && (leftPosNew = 0);
checkFunction(true, leftPosNew);
}
function onClickNext(e){
var leftPosNew = $paginHolder.position().left - step,
leftPos = -($paginHolder.width() - $this.width());
(leftPosNew < leftPos) && (leftPosNew = leftPos);
checkFunction(true, leftPosNew);
}
function onDragStart(event, ui){
if ($this.width() > totalWidth) {
$next && $next.addClass(controlHiddenClassName);
$prev && $prev.addClass(controlHiddenClassName);
return false;
} else {
$next && $next.removeClass(controlHiddenClassName);
$prev && $prev.removeClass(controlHiddenClassName);
}
}
function onDragStop(event, ui){
checkWidth();
checkRightBorder();
checkLeftBorder();
}
function onResize(e){
onDragStart();
if($paginHolder.width() > $this.width()){
checkRightBorder();
}else{
$paginHolder.css('left', 0);
checkLeftBorder();
}
}
}
}
}
data?$this=data:$this.data({tmDraggablePagination: options});
typeof o=='object' && $.extend(options, o);
options.me || options.constructor(options.me=$this);
});
}
})(jQuery);
@@ -0,0 +1,71 @@
/*
* Plugin for getting list of files from directory
*Version: 1.0;
*Author: Smart;
*/
(function($){
$.fn.tmFileList = function(o){
return this.each(function(){
var $this = $(this),
data = $this.data('tmFileList'),
options = {
relativePath: '../../', // relative path of script, this value will be added to pathThumb, pathFull for getting file list
pathThumb: '', // path to thumbnails relatively index.html
pathFull: '', // path to full images relatively index.html
url: './gallery/php/file_list.php', // url to php file
urlThumb: [], // array for thumbnails
urlFull: [], // array for full images
// constructor of plugin
constructor: function () {
options.getData(options.pathThumb, options.setUrlThumb, output1);
// get data from ajax request #1
function output1(){
options.getData(options.pathFull, options.setUrlFull, output2);
}
// get data from ajax request #2
function output2(){
options.output(options.urlThumb, options.urlFull);
}
},
// setters
setUrlThumb: function(inData){
options.urlThumb = inData;
},
setUrlFull: function(inData){
options.urlFull = inData;
},
// get file list from php via ajax
getData: function(inData, callback, output){
$.ajax({
type: "POST",
url: options.url,
data: {path: options.relativePath + inData},
success: function(results){
results = results.split(';');
results.length && results.pop();
$.each(results, function(i){
results[i] = inData + results[i];
});
callback(results.sort());
output && output();
}
});
},
// return file lists
output: function (urlThumbList, urlFullList){
}
}
data?$this=data:$this.data({tmFileList: options});
typeof o=='object' && $.extend(options, o);
options.me || options.constructor(options.me=$this);
});
}
})(jQuery);
@@ -0,0 +1,751 @@
/*
* Plugin for stretching images and video on fullscreen
*Version: 2.0;
*Author: Smart;
*/
(function($){
$.fn.tmMultimediaGallery = function(o){
return this.each(function(){
var object = $(this),
data = object.data('tmMultimediaGallery'),
getObject = {
startIndex: 0, // initial postion for gallery
showOnInit: true, // show gallery after init
autoPlayState: false, // on/off autoplay
autoPlayTime: 4, // autoplay timeout
alignIMG:"center", // align of image
alignMode: 'fill', // mode of align 'fill' or 'fit'
mouseMove: false, // use mouse move actions for images
controlDisplay: false, // on/off controls display
hideControlsOnClick: true, // hide controls on click or on tap event
paginationDisplay: true, // on/off pagination display
animationSpeed:'0.7', // speed of animation
mobile: false, // if mobile
resizableContainer: false, // change the size of the container on the size of the window
galleryOpenClass: 'galleryOpen', // class, that adds to body when gallery is open
container: '.galleryContainer', // container of gallery (window or other DOM element)
imageHolder: '.imageHolder', // imageHolder selector
pagination: '.inner', // pagination selector
paginationItem: '.item', // pagination item
outerPagination: false, // outer pagination
description: '.galleryDescription', // description selector
descriptionActiveClass: '.active', // active class for current description item
descriptionShowClass: '.show', // show class for description holder
outerNavigation: false, // outer navigation
next: '.nextButton', // next button selector
prev: '.prevButton', // prev button selector
play: '.playButton', // play button selector
pause: '.pauseButton', // pause button selector
spinner: '.imgSpinner', // prev button selector
backClass: '.backImg', // back class
frontClass: '.frontImg', // front class
animationClass: 'flip', // class for main animation
animationClassSub: 'scale', // class for secondary animation
noAnimationClass: '.animationDisable', // class for quick image changing
onShowActions: function(){}, // actions when gallery is active
onHideActions: function(){}, // actions when gallery is not active,
onBeforeChange: function(){}, // actions before change image
onAfterChange: function(){}, // actions after change image
onShowControls: function(){}, // actions shows controls of gallery
onHideControls: function(){}, // actions hide controls of gallery
// constructor of plugin
constructor: function (params) {
if (object.length) {
getObject.container = object.parents(getObject.container);
getObject.imageHolder = $(getObject.imageHolder, getObject.container);
if (!getObject.outerPagination) {
getObject.pagination = $(getObject.pagination, getObject.container);
} else {
getObject.pagination = $(getObject.pagination);
}
getObject.description = $(getObject.description, getObject.container);
getObject.descriptionActiveClass = getObject.descriptionActiveClass.substr(1);
getObject.descriptionShowClass = getObject.descriptionShowClass.substr(1);
if (!getObject.outerNavigation) {
getObject.next = $(getObject.next, getObject.container);
getObject.prev = $(getObject.prev, getObject.container);
} else {
getObject.next = $(getObject.next);
getObject.prev = $(getObject.prev);
}
getObject.play = $(getObject.play, getObject.container);
getObject.pause = $(getObject.pause, getObject.container);
getObject.spinner = $(getObject.spinner);
getObject.noAnimationClass = getObject.noAnimationClass.substr(1);
var image = $("img", getObject.imageHolder),
video = $("video", getObject.imageHolder),
imageSRCLink = $(getObject.paginationItem + " a", getObject.pagination.eq(0)),
description = $("li", getObject.description),
imageDeltaX,
imageDeltaY,
prevImg = -1,
currImg = -1,
allImg = imageSRCLink.length,
loadComplete = true,
autoPlayTimer,
dragDirection = 1,
doc = $(document),
win = $(window),
body = $('body'),
galleryActive = false,
showControls = false,
mouseDrag = false,
mouseDown = false,
msie9 = Boolean(navigator.userAgent.match(/MSIE ([9]+)\./));
getObject.startIndex = (getObject.startIndex < allImg) ? getObject.startIndex : 0;
init();
}
function init(){
msie9&&getObject.imageHolder.addClass('ie9');
getObject.autoPlayTime*=1000;
getObject.animationSpeed = getObject.animationSpeed.replace(",", ".");
getObject.spinner.removeClass('spinnerShow');
object.css({"position":"absolute", width:"100%", height:"100%", "z-index":"0"});
getObject.imageHolder.css({"position":"absolute", width:"100%", height:"100%", "z-index":0, "top":0});
if (!$(getObject.frontClass, getObject.imageHolder).length)
image.wrap('<div class="'+getObject.frontClass.substr(1)+'"></div>');
if (!$(getObject.backClass, getObject.imageHolder).length)
getObject.imageHolder.append('<div class="'+getObject.backClass.substr(1)+'" style="display:none"></div>');
setTimeout(function() {
getObject.imageHolder.removeClass('flip90');
object.css('zIndex','0');
}, 1000);
if (getObject.autoPlayState){
autoPlayHandler();
}
getObject.mouseMove && init_mouse_move();
window.orientation==undefined?usedDevice = "desktop":usedDevice = "fixedOptions";
if(usedDevice != "desktop"){
window.addEventListener("orientationchange", function(){
resizeImageHandler();
}, true);
}
win.resize(resizeImageHandler);
object.on('resize', resizeImageHandler);
resizeImageHandler();
if ((!getObject.controlDisplay) || (allImg <= 1)){
getObject.next.css({display:"none"});
getObject.prev.css({display:"none"});
}else{
getObject.next.css({display:"block"});
getObject.prev.css({display:"block"});
}
getObject.next.on("click", clickNext);
getObject.prev.on("click", clickPrev);
var id = 0;
if(getObject.paginationDisplay){
$(getObject.pagination)
.find(getObject.paginationItem + " a")
.on('mousedown', function(){
mouseDown = true;
})
.on('mouseup',function(){
clearTimeout(id);
id = setTimeout(function(){ mouseDown = false; }, 10);
})
.on('mousemove', function(){
mouseDrag = mouseDown;
})
.on('click', clickPagination);
}else{
getObject.pagination.css({display:"none"});
}
// object listeners
object
.on('showGallery', function(e, d){
reset();
body.addClass(getObject.galleryOpenClass);
if (!galleryActive){
!getObject.mobile&&videoInit();
}
getObject.onShowActions();
galleryActive = true;
descriptionChange();
descriptionToggle(true);
resizeImageHandler();
doc.on('keydown', keyboardEvent);
object.on('goTo', goTo);
if (!d) { d = getObject.startIndex.toString(); }
object.trigger('goTo', d);
})
.on('hideGallery',function(e){
getObject.onHideActions();
body.removeClass(getObject.galleryOpenClass);
videoStop();
getObject.imageHolder
.removeClass('videoInside')
.off('click')
.children('div').removeClass('videoShow')
getObject.autoPlayState = false;
descriptionToggle(false);
galleryActive = false;
doc.off('keydown', keyboardEvent);
object.off('goTo', goTo);
resetCounters();
})
.on('setGalleryActivity', function(e, d){
if (d) {
if (d === 'true') {
galleryActive = true;
} else if (d === 'false') {
galleryActive = false;
}
}
})
.on('showControls', function(e){
showControls = true;
getObject.onShowControls();
})
.on('hideControls', function(e){
showControls = false;
getObject.onHideControls();
})
.on('toggleControls', function(e, d){
if (d) {
if (d === 'true') {
object.trigger('showControls');
} else if (d === 'false') {
object.trigger('hideControls');
}
}
})
.on('click', function(){
if (getObject.hideControlsOnClick)
object.trigger('toggleControls', (showControls=!showControls).toString());
})
if ($.fn.swipe) {
object
.swipe({
swipeLeft:function(event, direction, distance, duration, fingerCount) {
galleryActive && clickNext();
},
swipeRight:function(event, direction, distance, duration, fingerCount) {
galleryActive && clickPrev();
}
});
}
if (getObject.showOnInit) {
object.trigger('showGallery');
} else {
reset();
}
}
// keyboard listeners
function keyboardEvent(e){
if (galleryActive) {
if (e.keyCode == 37) { clickPrev(); }
else if (e.keyCode == 39) { clickNext(); }
}
}
// reset couters and remove active class from pagination
function resetCounters(){
currImg = prevImg = -1;
$(getObject.paginationItem, getObject.pagination).removeClass('active');
}
// reset actions
function reset () {
var img = $(getObject.imageHolder).find(getObject.frontClass + ' img, '+getObject.backClass + ' img');
img.length && img.attr('src', '').css('visibility', 'hidden');
resetCounters();
}
// mouse move actions
function init_mouse_move(){
/* mouse move actions */
var currTop = 0;
if (!getObject.mobile) {
getObject.imageHolder
.on('mousemove', function(e){
if (!galleryActive) { return false; }
currTop = e.pageY * ($('.frontImg>img, .backImg>img').height()-win.height()) / win.height();
$('.frontImg, .backImg', getObject.imageHolder).stop().animate({'scrollTop': currTop}, 1500);
});
/* end mouse move */
} else {
if ($.fn.swipe) {
getObject.imageHolder
.find('.frontImg, .backImg')
.swipe({
swipe:function(event, direction, distance, duration, fingerCount) {
if (direction == 'down') {
currTop -= distance;
} else if (direction == 'up'){
currTop += distance;
}
var h = $('.frontImg>img, .backImg>img').height();
currTop = (currTop > h) ? h : currTop;
currTop = (currTop < 0) ? 0 : currTop;
$('.frontImg, .backImg', getObject.imageHolder).stop().animate({'scrollTop': currTop}, 1500);
}
});
}
}
}
// function for go to element (number - parameter d)
function goTo(e, d, q){
if (d){
d = parseInt(d);
if (getObject.pagination &&
getObject.pagination.find('a') &&
getObject.pagination.find('a').eq(d)) {
getObject.pagination.find('a').eq(d).trigger('click', q);
}
}
}
// show / hide description holder
function descriptionToggle(value){
if (value){
getObject.description.addClass(getObject.descriptionShowClass);
} else {
getObject.description.removeClass(getObject.descriptionShowClass);
}
}
// change description
function descriptionChange(){
description
.stop(true)
.removeClass(getObject.descriptionActiveClass)
.eq(currImg)
.addClass(getObject.descriptionActiveClass).end();
descriptionResize();
// .delay(500).queue(descriptionResize);
}
function descriptionResize(){
getObject.description.css('height', description.eq(currImg).outerHeight(true));
}
// next listener
function clickNext(e){
if(loadComplete){
getObject.autoPlayState = false;
prevImg = currImg;
currImg++;
if(currImg>allImg-1){
currImg = 0;
}
dragDirection=1;
changeImageHandler();
}
return false;
}
// prev listener
function clickPrev(e){
if(loadComplete){
getObject.autoPlayState = false;
prevImg = currImg;
currImg--;
if(currImg<0){
currImg = allImg-1;
}
dragDirection=-1;
changeImageHandler();
}
return false;
}
// pagination listener
function clickPagination(e, d){
if (!mouseDrag) {
var index = $(this).parents(getObject.paginationItem).index();
if((index !== currImg) && loadComplete){
if (!galleryActive) {
object.trigger('showGallery');
}
prevImg = currImg;
currImg = index;
clearTimeout(autoPlayTimer);
getObject.autoPlayState = false;
dragDirection = prevImg<currImg ? 1 : -1;
changeImageHandler(d);
}
}
return false;
}
// autoplay
function autoPlayHandler(){
autoPlayTimer = setTimeout(function(){
if(getObject.autoPlayState){
prevImg = currImg;
currImg++;
if(currImg>=allImg){
currImg = 0;
}
changeImageHandler();
}
}, getObject.autoPlayTime);
}
// video initialize
function videoInit(){
function imageHolderClick(e){
video&&video[0].paused ? videoPlay() : videoPause();
}
image.stop(true).fadeIn(1200);
getObject.imageHolder
.removeClass('videoInside')
.off('click')
.find('video').remove().end()
.children('div').removeClass('videoShow');
video = null;
getObject.pause.removeClass('showButton').off('click');
getObject.play.removeClass('showButton').off('click');
// if video tag exist
if ($(getObject.paginationItem, getObject.pagination).eq(currImg).hasClass('video')){
var videoArray = $(getObject.paginationItem, getObject.pagination).eq(currImg).find('a').attr('data-video-href');
if (videoArray.length) videoArray = videoArray.split(',');
getObject.imageHolder
.addClass('videoInside')
image
.after('<video preload poster="'+image.attr('src')+'" style="display: none;"><source src="'+videoArray[0]+'" type="video/mp4" /><source src="'+videoArray[1]+'" type="video/webm" /><source src="'+videoArray[2]+'" type="video/ogg" />Video tag not supported. Download the video <a href="'+videoArray[0]+'.webm">here</a>.</video>');
getObject.play.addClass('showButton').on('click',videoPlay);
getObject.pause.on('click', videoPause);
getObject.imageHolder.on('click', imageHolderClick);
video = getObject.imageHolder.find('video');
}
}
// video play
function videoPlay(e){
getObject.autoPlayState = false;
resizeElement(video);
getObject.play.removeClass('showButton');
getObject.pause.addClass('showButton');
descriptionToggle(false);
image.stop(true).fadeOut(600, function(){
video.stop(true).fadeIn(1200);
getObject.imageHolder.children(getObject.frontClass).addClass('videoShow');
video[0].play();
});
return false;
}
// video pause
function videoPause(e){
getObject.play.addClass('showButton');
getObject.pause.removeClass('showButton');
descriptionToggle(true);
if (video&&video.length) {
video[0].pause();
video.stop(true).fadeOut(600,function () {
getObject.imageHolder.children('div').removeClass('videoShow');
image.stop(true).fadeIn(1200);
});
}
return false;
}
// video stop
function videoStop(e){
videoPause(e);
getObject.play.removeClass('showButton');
getObject.pause.removeClass('showButton');
return false;
}
// function for getting container height
function windowH() {
var result;
if (getObject.container == window) {
result = ((getObject.container.height()>=parseInt($('body').css('minHeight')))?getObject.container.height():parseInt($('body').css('minHeight')));
} else {
result = getObject.container.height();
}
return result;
}
// function for getting container width
function windowW() {
var result;
if (getObject.container == window) {
return ((getObject.container.width()>=parseInt($('body').css('minWidth')))?getObject.container.width():parseInt($('body').css('minWidth')));
} else {
result = getObject.container.width();
}
return result;
}
// function for controlling resize element
function resizeElement(obj) {
if (obj.length) {
var imageWidth = obj.width(),
imageHeight = obj.height(),
screenWidth = windowW(),
screenHeight = windowH(),
imageCoef = imageHeight/imageWidth,
holderCoef = screenHeight/screenWidth,
imageDeltaX = 0,
imageDeltaY = 0;
if (getObject.alignMode === 'fill') {
obj.css({'width': windowW(), 'height':"auto", 'position':"absolute", "max-width":"none"});
imageWidth = obj.width();
imageHeight = obj.height();
var alignIMG = obj.attr('data-image-align') ? obj.attr('data-image-align') : getObject.alignIMG,
imageScroll = obj.attr('data-image-scroll');
if (imageScroll === "enable") {
imageScroll = true;
alignIMG = 'top';
obj.parent().css('overflow-y','visible');
} else {
imageScroll = false;
obj.parent().css('overflow-y','hidden');
}
// imageCoef = imageHeight/imageWidth;
// holderCoef = screenHeight/screenWidth;
obj.css({height: screenHeight, width:"auto"});
if ((imageCoef > holderCoef) || ((imageScroll || getObject.mouseMove) && (screenHeight < imageHeight))){
obj.css({height:"auto", width: screenWidth});
}
imageWidth = obj.width();
imageHeight = obj.height();
switch(alignIMG){
case "top":
imageDeltaX=-(imageWidth-screenWidth)*.5;
imageDeltaY=0;
break;
case "bottom":
imageDeltaX=-(imageWidth-screenWidth)*.5;
imageDeltaY=-(imageHeight-screenHeight);
break;
case "right":
imageDeltaX=-(imageWidth-screenWidth);
imageDeltaY=-(imageHeight-screenHeight)*.5;
break;
case "left":
imageDeltaX=0;
imageDeltaY=-(imageHeight-screenHeight)*.5;
break;
case "top_left":
imageDeltaX=0;
imageDeltaY=0;
break;
case "top_right":
imageDeltaX=-(imageWidth-screenWidth);
imageDeltaY=0;
break;
case "bottom_right":
imageDeltaX=-(imageWidth-screenWidth);
imageDeltaY=-(imageWidth-screenHeight);
break;
case "bottom_left":
imageDeltaX=0;
imageDeltaY=-(imageHeight-screenHeight);
break;
default:
imageDeltaX=-(imageWidth-screenWidth)*.5;
imageDeltaY= -(imageHeight-screenHeight)*.5;
}
if (!getObject.mouseMove) {
obj.css({'left':imageDeltaX, 'top':imageDeltaY});
} else {
obj.css({'left':imageDeltaX});
}
} else if (getObject.alignMode === 'fit') {
if (imageCoef > holderCoef){
obj.css({ width: 'auto', height: screenHeight });
} else {
obj.css({ height: 'auto', width: screenWidth });
}
imageWidth = obj.width();
imageHeight = obj.height();
imageDeltaX = -(imageWidth-screenWidth)*.5;
imageDeltaY = -(imageHeight-screenHeight)*.5;
obj.css({'position':"absolute", "max-width":"none", 'left':imageDeltaX, 'top':imageDeltaY});
}
}
}
// main function for controlling resize element
function resizeImageHandler(){
descriptionResize();
if (getObject.resizableContainer) {
getObject.container.css({
'width': win.width(),
'height': win.height()
});
}
image = $("img", getObject.imageHolder);
image.length&&image.each(function(ind, img){
resizeElement($(img));
})
video = $('video', getObject.imageHolder);
resizeElement(video);
}
// function for controlling change image
function changeImageHandler(d){
if (allImg > 1) {
// galleryActive = false;
getObject.spinner.addClass('spinnerShow');
$(getObject.pagination).each(function(){
$(this).find(getObject.paginationItem)
.eq(currImg)
.addClass("active").end()
.eq(prevImg).removeClass("active");
});
loadComplete = false;
image = $("img", getObject.imageHolder);
var imgSRC = imageSRCLink.eq(currImg).attr("href"),
alignIMG = imageSRCLink.eq(currImg).attr("data-image-align"),
imageScroll = imageSRCLink.eq(currImg).attr("data-image-scroll");
alignIMG = alignIMG?'data-image-align="'+alignIMG+'"':"";
imageScroll = imageScroll?'data-image-scroll="'+imageScroll+'"':"";
$(getObject.backClass, getObject.imageHolder)
.css({'display':'block'})
.empty()
.append('<img src="'+imgSRC+'" alt="" '+alignIMG+' '+imageScroll+'>')
.find('img')
.on("load", loadHandler);
descriptionChange();
descriptionToggle(true);
}
function loadHandler(){
loadImageHandler(d);
}
}
// function for controlling load image
function loadImageHandler(quickChange){
getObject.onBeforeChange();
getObject.imageHolder.addClass(getObject.animationClassSub);
resizeElement(getObject.imageHolder.find(getObject.backClass+'>img'));
resizeElement(getObject.imageHolder.find(getObject.frontClass+'>img'));
var time = 1000;
if (quickChange === 'quick') {
time = 10;
getObject.container.addClass(getObject.noAnimationClass);
$(getObject.frontClass, getObject.imageHolder).empty().css({'zIndex':1, 'display':'none'});
}
setTimeout(function(){
getObject.spinner.removeClass('spinnerShow');
// add or remove animation class
!getObject.imageHolder.hasClass(getObject.animationClass)?getObject.imageHolder.addClass(getObject.animationClass):getObject.imageHolder.removeClass(getObject.animationClass);
if (msie9) {
getObject.imageHolder
.find(getObject.frontClass).stop(true).animate({'opacity':0}, time).end()
.find(getObject.backClass).css('opacity',0).stop(true, true).animate({'opacity':1}, time).end()
}
getObject.imageHolder.find(getObject.backClass+">img")
.off("load", loadImageHandler);
getObject.imageHolder
.stop(true,true)
.delay(getObject.animationSpeed*time)
.queue(onAnimateComplete);
function onAnimateComplete(e){
if (quickChange) {
getObject.container.removeClass(getObject.noAnimationClass);
}
var $this = $(this);
$(getObject.frontClass, $this).empty().css({'zIndex':1, 'display':'none'});
$(getObject.backClass, $this).css('zIndex',2);
image = $(getObject.backClass + ' img', $this);
$this.removeClass(getObject.animationClassSub);
// swap classes
var tmp = getObject.backClass;
getObject.backClass = getObject.frontClass;
getObject.frontClass = tmp;
// initialize video if exist
!getObject.mobile&&videoInit();
loadComplete = true;
// galleryActive = true;
autoPlayHandler();
getObject.onAfterChange();
}
}, time)
}
}
}
data?object=data:object.data({tmMultimediaGallery: getObject});
typeof o=='object' && $.extend(getObject, o);
getObject.me || getObject.constructor(getObject.me=object);
});
}
})(jQuery);
@@ -0,0 +1,173 @@
// initialize tmMultimediaGallery
var pathThumb = pathFull = '';
$(window).load(function(){
var $spinner = $('.content-load-spinner');
// get file list
$('#content .inner').tmFileList({
pathThumb: pathThumb,
pathFull: pathFull,
output: function(urlThumbList, urlFullList){
buildPagination({urlThumb: urlThumbList, urlFull: urlFullList});
}
});
// build pagination function
function buildPagination(urlList){
// automatic build pagination for isotope
var $inner_1 = $('#content .inner');
$inner_1
.addClass('loading')
.tmPaginationGenerator({
urlList: urlList,
// divWrapper: true,
anchorInnerHtml: '<span class="magnifier-overlay"></span><span class="fa fa-expand"></span>',
generateComplete: function($ul){
},
loadComplete: function($ul){
// apply isotope for items
$ul.isotope({
itemSelector : '#content .inner>div>div',
resizable: true,
layoutMode: 'masonry',
itemPositionDataEnabled: true
});
// remove spinner
setTimeout(function(){
$spinner.fadeOut(600);
$inner_1.removeClass('loading');
}, 400);
// automatic build pagination for carousel
$('.galleryContainer .inner').tmPaginationGenerator({
urlList: urlList,
anchorInnerHtml: '<span class="magnifier-overlay"></span><span class="fa fa-expand"></span>',
generateComplete: function($ul){
// apply carousel items
initFullGallery();
$('.carousel.inner').tmDraggablePagination({
step: 50
});
}
});
}
});
}
function initFullGallery(){
var id = 0,
$gallery = $('.galleryHolder'),
$description = $('.galleryDescription li');
$gallery.tmMultimediaGallery({
startIndex: 0, // initial postion for gallery
showOnInit: false, // show gallery after init
autoPlayState: false, // on/off autoplay
autoPlayTime: 12, // autoplay timeout
alignIMG:"center", // align of image (center, top, bottom, right, left, top_left, top_right, bottom_roght, bottom_left)
alignMode: 'fit', // mode of align 'fill' or 'fit'
controlDisplay: true, // on/off controls display
paginationDisplay: true, // on/off pagination display
animationSpeed:'0.7', // speed of animation
mobile: false, // if mobile
resizableContainer: true, // change the size of the container on the size of the window
container: '.galleryContainer', // container of gallery (window or other DOM element)
imageHolder: '.imageHolder', // imageHolder selector
pagination: '.inner', // pagination selector
paginationItem: '.item', // pagination item selector
outerPagination: true, // outer pagination
description: '.galleryDescription', // description selector
descriptionActiveClass: '.active', // active class for current description item
descriptionShowClass: '.showDescription', // show class for description holder
outerNavigation: false, // outer navigation
mouseMove: false, // mouse move reaction of image
next: '.nextButton', // next button selector
prev: '.prevButton', // prev button selector
play: '.playButton', // play button selector
pause: '.pauseButton', // pause button selector
spinner: '.imgSpinner', // prev button selector
backClass: '.backImg', // back class
frontClass: '.frontImg', // front class
animationClass: 'flip', // class for main animation
animationClassSub: 'scale', // class for secondary animation
noAnimationClass: '.animationDisable', // class for quick image changing
onShowActions: function(){
id = setTimeout(function(){
// $('#inner').removeClass('hideFromScreen');
$gallery.trigger('showControls');
$(window).trigger('resize');
}, 2000);
},
onHideActions: function(){
clearTimeout(id);
// $('#inner').addClass('hideFromScreen');
$gallery.trigger('hideControls');
},
onBeforeChange: function(){
},
onAfterChange: function(){
},
onHideControls: function(){
$('.prevButton, .nextButton, .close-icon, .info-icon, .gallery_nav, .prev, .next').removeClass('showButton');
$('.galleryDescription').removeClass('show');
$('.carousel-holder').removeClass('show');
},
onShowControls: function(){
$('.prevButton, .nextButton, .close-icon, .gallery_nav, .prev, .next').addClass('showButton');
if ($description.length) {
$('.info-icon').addClass('showButton');
}
$('.carousel-holder').addClass('show');
}
});
// click function for close button
$('.close-icon').click(function(){
$gallery.trigger('hideGallery');
return false;
});
$(document).keyup(function(e){
if(e.keyCode === 27)
$gallery.trigger('hideGallery');
return false;
});
// click function for info button
if ($description.length) {
$('.info-icon').on('click', function(){
$(this).removeClass('showButton');
$('.galleryDescription').addClass('show');
return false;
});
// click function for close-details button
$('.close-info-icon').on('click', function(){
$('.info-icon').addClass('showButton');
$('.galleryDescription').removeClass('show');
return false;
});
}
}
});
$(function(){
// IPad/IPhone
var viewportmeta = document.querySelector && document.querySelector('meta[name="viewport"]'),
ua = navigator.userAgent,
gestureStart = function () {
viewportmeta.content = "width=device-width, minimum-scale=0.25, maximum-scale=1.6, initial-scale=1.0";
},
scaleFix = function () {
if (viewportmeta && /iPhone|iPad/.test(ua) && !/Opera Mini/.test(ua)) {
viewportmeta.content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0";
document.addEventListener("gesturestart", gestureStart, false);
}
};
scaleFix();
});
@@ -0,0 +1,59 @@
/*
* Plugin for pagination generation for tmMultimediaGallery
*Version: 1.0;
*Author: Smart;
*/
(function($){
$.fn.tmPaginationGenerator = function(o){
return this.each(function(){
var $this = $(this),
data = $this.data('tmPaginationGenerator'),
options = {
urlList: {urlThumb: [], urlFull: []}, // url of images
divWrapper: false, // wrap all li in div
itemClass: 'item', // class for item
anchorInnerHtml: '', // class for hover hmtl in <a> element
// constructor of plugin
constructor: function () {
if (!options.urlList.urlThumb.length || !options.urlList.urlFull.length) {
return false;
}
$this
.empty()
.append('<div></div>');
var length = Math.min(options.urlList.urlThumb.length, options.urlList.urlFull.length),
$ul = $this.find('>div');
for (var i = 0; i < length; i++){
var appendString = '<div class="' + options.itemClass + '"><a href="' + options.urlList.urlFull[i] + '">' + options.anchorInnerHtml + '<img src="' + options.urlList.urlThumb[i] + '" alt/></a></div>';
options.divWrapper && (appendString = '<div>' + appendString + '</div>');
$ul.append(appendString);
}
options.generateComplete($ul);
var images = $ul.find('img'),
counter = images.length;
images.on('load abort error', function(){
--counter;
if(counter === 0) {
options.loadComplete($ul);
}
})
},
// function called when building html tree complete
generateComplete: function(ul){
},
// function called when loading images complete
loadComplete: function(ul){
}
}
data?$this=data:$this.data({tmPaginationGenerator: options});
typeof o=='object' && $.extend(options, o);
options.me || options.constructor(options.me=$this);
});
}
})(jQuery);