added more preview pages and more templates
This commit is contained in:
File diff suppressed because one or more lines are too long
+66
@@ -0,0 +1,66 @@
|
||||
/*! device.js 0.1.61 */
|
||||
(function () {
|
||||
var a, b, c, d, e, f, g, h, i, j;
|
||||
a = window.device, window.device = {}, c = window.document.documentElement, j = window.navigator.userAgent.toLowerCase(), device.ios = function () {
|
||||
return device.iphone() || device.ipod() || device.ipad()
|
||||
}, device.iphone = function () {
|
||||
return d("iphone")
|
||||
}, device.ipod = function () {
|
||||
return d("ipod")
|
||||
}, device.ipad = function () {
|
||||
return d("ipad")
|
||||
}, device.android = function () {
|
||||
return d("android")
|
||||
}, device.androidPhone = function () {
|
||||
return device.android() && d("mobile")
|
||||
}, device.androidTablet = function () {
|
||||
return device.android() && !d("mobile")
|
||||
}, device.blackberry = function () {
|
||||
return d("blackberry") || d("bb10") || d("rim")
|
||||
}, device.blackberryPhone = function () {
|
||||
return device.blackberry() && !d("tablet")
|
||||
}, device.blackberryTablet = function () {
|
||||
return device.blackberry() && d("tablet")
|
||||
}, device.windows = function () {
|
||||
return d("windows")
|
||||
}, device.windowsPhone = function () {
|
||||
return device.windows() && d("phone")
|
||||
}, device.windowsTablet = function () {
|
||||
return device.windows() && d("touch") && !device.windowsPhone()
|
||||
}, device.fxos = function () {
|
||||
return(d("(mobile;") || d("(tablet;")) && d("; rv:")
|
||||
}, device.fxosPhone = function () {
|
||||
return device.fxos() && d("mobile")
|
||||
}, device.fxosTablet = function () {
|
||||
return device.fxos() && d("tablet")
|
||||
}, device.meego = function () {
|
||||
return d("meego")
|
||||
}, device.cordova = function () {
|
||||
return window.cordova && "file:" === location.protocol
|
||||
}, device.nodeWebkit = function () {
|
||||
return"object" == typeof window.process
|
||||
}, device.mobile = function () {
|
||||
return device.androidPhone() || device.iphone() || device.ipod() || device.windowsPhone() || device.blackberryPhone() || device.fxosPhone() || device.meego()
|
||||
}, device.tablet = function () {
|
||||
return device.ipad() || device.androidTablet() || device.blackberryTablet() || device.windowsTablet() || device.fxosTablet()
|
||||
}, device.desktop = function () {
|
||||
return!device.tablet() && !device.mobile()
|
||||
}, device.portrait = function () {
|
||||
return window.innerHeight / window.innerWidth > 1
|
||||
}, device.landscape = function () {
|
||||
return window.innerHeight / window.innerWidth < 1
|
||||
}, device.noConflict = function () {
|
||||
return window.device = a, this
|
||||
}, d = function (a) {
|
||||
return-1 !== j.indexOf(a)
|
||||
}, f = function (a) {
|
||||
var b;
|
||||
return b = new RegExp(a, "i"), c.className.match(b)
|
||||
}, b = function (a) {
|
||||
return f(a) ? void 0 : c.className += " " + a
|
||||
}, h = function (a) {
|
||||
return f(a) ? c.className = c.className.replace(a, "") : void 0
|
||||
}, device.ios() ? device.ipad() ? b("ios ipad tablet") : device.iphone() ? b("ios iphone mobile") : device.ipod() && b("ios ipod mobile") : b(device.android() ? device.androidTablet() ? "android tablet" : "android mobile" : device.blackberry() ? device.blackberryTablet() ? "blackberry tablet" : "blackberry mobile" : device.windows() ? device.windowsTablet() ? "windows tablet" : device.windowsPhone() ? "windows mobile" : "desktop" : device.fxos() ? device.fxosTablet() ? "fxos tablet" : "fxos mobile" : device.meego() ? "meego mobile" : device.nodeWebkit() ? "node-webkit" : "desktop"), device.cordova() && b("cordova"), e = function () {
|
||||
return device.landscape() ? (h("portrait"), b("landscape")) : (h("landscape"), b("portrait"))
|
||||
}, i = "onorientationchange"in window, g = i ? "orientationchange" : "resize", window.addEventListener ? window.addEventListener(g, e, !1) : window.attachEvent ? window.attachEvent(g, e) : window[g] = e, e()
|
||||
}).call(this);
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.2 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
;(function(window, document) {
|
||||
/*jshint evil:true */
|
||||
/** version */
|
||||
var version = '3.7.2';
|
||||
|
||||
/** Preset options */
|
||||
var options = window.html5 || {};
|
||||
|
||||
/** Used to skip problem elements */
|
||||
var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;
|
||||
|
||||
/** Not all elements can be cloned in IE **/
|
||||
var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;
|
||||
|
||||
/** Detect whether the browser supports default html5 styles */
|
||||
var supportsHtml5Styles;
|
||||
|
||||
/** Name of the expando, to work with multiple documents or to re-shiv one document */
|
||||
var expando = '_html5shiv';
|
||||
|
||||
/** The id for the the documents expando */
|
||||
var expanID = 0;
|
||||
|
||||
/** Cached data for each document */
|
||||
var expandoData = {};
|
||||
|
||||
/** Detect whether the browser supports unknown elements */
|
||||
var supportsUnknownElements;
|
||||
|
||||
(function() {
|
||||
try {
|
||||
var a = document.createElement('a');
|
||||
a.innerHTML = '<xyz></xyz>';
|
||||
//if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles
|
||||
supportsHtml5Styles = ('hidden' in a);
|
||||
|
||||
supportsUnknownElements = a.childNodes.length == 1 || (function() {
|
||||
// assign a false positive if unable to shiv
|
||||
(document.createElement)('a');
|
||||
var frag = document.createDocumentFragment();
|
||||
return (
|
||||
typeof frag.cloneNode == 'undefined' ||
|
||||
typeof frag.createDocumentFragment == 'undefined' ||
|
||||
typeof frag.createElement == 'undefined'
|
||||
);
|
||||
}());
|
||||
} catch(e) {
|
||||
// assign a false positive if detection fails => unable to shiv
|
||||
supportsHtml5Styles = true;
|
||||
supportsUnknownElements = true;
|
||||
}
|
||||
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Creates a style sheet with the given CSS text and adds it to the document.
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @param {String} cssText The CSS text.
|
||||
* @returns {StyleSheet} The style element.
|
||||
*/
|
||||
function addStyleSheet(ownerDocument, cssText) {
|
||||
var p = ownerDocument.createElement('p'),
|
||||
parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement;
|
||||
|
||||
p.innerHTML = 'x<style>' + cssText + '</style>';
|
||||
return parent.insertBefore(p.lastChild, parent.firstChild);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of `html5.elements` as an array.
|
||||
* @private
|
||||
* @returns {Array} An array of shived element node names.
|
||||
*/
|
||||
function getElements() {
|
||||
var elements = html5.elements;
|
||||
return typeof elements == 'string' ? elements.split(' ') : elements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extends the built-in list of html5 elements
|
||||
* @memberOf html5
|
||||
* @param {String|Array} newElements whitespace separated list or array of new element names to shiv
|
||||
* @param {Document} ownerDocument The context document.
|
||||
*/
|
||||
function addElements(newElements, ownerDocument) {
|
||||
var elements = html5.elements;
|
||||
if(typeof elements != 'string'){
|
||||
elements = elements.join(' ');
|
||||
}
|
||||
if(typeof newElements != 'string'){
|
||||
newElements = newElements.join(' ');
|
||||
}
|
||||
html5.elements = elements +' '+ newElements;
|
||||
shivDocument(ownerDocument);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the data associated to the given document
|
||||
* @private
|
||||
* @param {Document} ownerDocument The document.
|
||||
* @returns {Object} An object of data.
|
||||
*/
|
||||
function getExpandoData(ownerDocument) {
|
||||
var data = expandoData[ownerDocument[expando]];
|
||||
if (!data) {
|
||||
data = {};
|
||||
expanID++;
|
||||
ownerDocument[expando] = expanID;
|
||||
expandoData[expanID] = data;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived element for the given nodeName and document
|
||||
* @memberOf html5
|
||||
* @param {String} nodeName name of the element
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived element.
|
||||
*/
|
||||
function createElement(nodeName, ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createElement(nodeName);
|
||||
}
|
||||
if (!data) {
|
||||
data = getExpandoData(ownerDocument);
|
||||
}
|
||||
var node;
|
||||
|
||||
if (data.cache[nodeName]) {
|
||||
node = data.cache[nodeName].cloneNode();
|
||||
} else if (saveClones.test(nodeName)) {
|
||||
node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode();
|
||||
} else {
|
||||
node = data.createElem(nodeName);
|
||||
}
|
||||
|
||||
// Avoid adding some elements to fragments in IE < 9 because
|
||||
// * Attributes like `name` or `type` cannot be set/changed once an element
|
||||
// is inserted into a document/fragment
|
||||
// * Link elements with `src` attributes that are inaccessible, as with
|
||||
// a 403 response, will cause the tab/window to crash
|
||||
// * Script elements appended to fragments will execute when their `src`
|
||||
// or `text` property is set
|
||||
return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node;
|
||||
}
|
||||
|
||||
/**
|
||||
* returns a shived DocumentFragment for the given document
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The context document.
|
||||
* @returns {Object} The shived DocumentFragment.
|
||||
*/
|
||||
function createDocumentFragment(ownerDocument, data){
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
if(supportsUnknownElements){
|
||||
return ownerDocument.createDocumentFragment();
|
||||
}
|
||||
data = data || getExpandoData(ownerDocument);
|
||||
var clone = data.frag.cloneNode(),
|
||||
i = 0,
|
||||
elems = getElements(),
|
||||
l = elems.length;
|
||||
for(;i<l;i++){
|
||||
clone.createElement(elems[i]);
|
||||
}
|
||||
return clone;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shivs the `createElement` and `createDocumentFragment` methods of the document.
|
||||
* @private
|
||||
* @param {Document|DocumentFragment} ownerDocument The document.
|
||||
* @param {Object} data of the document.
|
||||
*/
|
||||
function shivMethods(ownerDocument, data) {
|
||||
if (!data.cache) {
|
||||
data.cache = {};
|
||||
data.createElem = ownerDocument.createElement;
|
||||
data.createFrag = ownerDocument.createDocumentFragment;
|
||||
data.frag = data.createFrag();
|
||||
}
|
||||
|
||||
|
||||
ownerDocument.createElement = function(nodeName) {
|
||||
//abort shiv
|
||||
if (!html5.shivMethods) {
|
||||
return data.createElem(nodeName);
|
||||
}
|
||||
return createElement(nodeName, ownerDocument, data);
|
||||
};
|
||||
|
||||
ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' +
|
||||
'var n=f.cloneNode(),c=n.createElement;' +
|
||||
'h.shivMethods&&(' +
|
||||
// unroll the `createElement` calls
|
||||
getElements().join().replace(/[\w\-:]+/g, function(nodeName) {
|
||||
data.createElem(nodeName);
|
||||
data.frag.createElement(nodeName);
|
||||
return 'c("' + nodeName + '")';
|
||||
}) +
|
||||
');return n}'
|
||||
)(html5, data.frag);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* Shivs the given document.
|
||||
* @memberOf html5
|
||||
* @param {Document} ownerDocument The document to shiv.
|
||||
* @returns {Document} The shived document.
|
||||
*/
|
||||
function shivDocument(ownerDocument) {
|
||||
if (!ownerDocument) {
|
||||
ownerDocument = document;
|
||||
}
|
||||
var data = getExpandoData(ownerDocument);
|
||||
|
||||
if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) {
|
||||
data.hasCSS = !!addStyleSheet(ownerDocument,
|
||||
// corrects block display not defined in IE6/7/8/9
|
||||
'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}' +
|
||||
// adds styling not present in IE6/7/8/9
|
||||
'mark{background:#FF0;color:#000}' +
|
||||
// hides non-rendered elements
|
||||
'template{display:none}'
|
||||
);
|
||||
}
|
||||
if (!supportsUnknownElements) {
|
||||
shivMethods(ownerDocument, data);
|
||||
}
|
||||
return ownerDocument;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* The `html5` object is exposed so that more elements can be shived and
|
||||
* existing shiving can be detected on iframes.
|
||||
* @type Object
|
||||
* @example
|
||||
*
|
||||
* // options can be changed before the script is included
|
||||
* html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false };
|
||||
*/
|
||||
var html5 = {
|
||||
|
||||
/**
|
||||
* An array or space separated string of node names of the elements to shiv.
|
||||
* @memberOf html5
|
||||
* @type Array|String
|
||||
*/
|
||||
'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video',
|
||||
|
||||
/**
|
||||
* current version of html5shiv
|
||||
*/
|
||||
'version': version,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the HTML5 style sheet should be inserted.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivCSS': (options.shivCSS !== false),
|
||||
|
||||
/**
|
||||
* Is equal to true if a browser supports creating unknown/HTML5 elements
|
||||
* @memberOf html5
|
||||
* @type boolean
|
||||
*/
|
||||
'supportsUnknownElements': supportsUnknownElements,
|
||||
|
||||
/**
|
||||
* A flag to indicate that the document's `createElement` and `createDocumentFragment`
|
||||
* methods should be overwritten.
|
||||
* @memberOf html5
|
||||
* @type Boolean
|
||||
*/
|
||||
'shivMethods': (options.shivMethods !== false),
|
||||
|
||||
/**
|
||||
* A string to describe the type of `html5` object ("default" or "default print").
|
||||
* @memberOf html5
|
||||
* @type String
|
||||
*/
|
||||
'type': 'default',
|
||||
|
||||
// shivs the document according to the specified `html5` object options
|
||||
'shivDocument': shivDocument,
|
||||
|
||||
//creates a shived element
|
||||
createElement: createElement,
|
||||
|
||||
//creates a shived documentFragment
|
||||
createDocumentFragment: createDocumentFragment,
|
||||
|
||||
//extends list of elements
|
||||
addElements: addElements
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
// expose html5
|
||||
window.html5 = html5;
|
||||
|
||||
// shiv the document
|
||||
shivDocument(document);
|
||||
|
||||
}(this, document));
|
||||
@@ -0,0 +1,521 @@
|
||||
/*!
|
||||
* jQuery Migrate - v1.2.1 - 2013-05-08
|
||||
* https://github.com/jquery/jquery-migrate
|
||||
* Copyright 2005, 2013 jQuery Foundation, Inc. and other contributors; Licensed MIT
|
||||
*/
|
||||
(function( jQuery, window, undefined ) {
|
||||
// See http://bugs.jquery.com/ticket/13335
|
||||
// "use strict";
|
||||
|
||||
|
||||
var warnedAbout = {};
|
||||
|
||||
// List of warnings already given; public read only
|
||||
jQuery.migrateWarnings = [];
|
||||
|
||||
// Set to true to prevent console output; migrateWarnings still maintained
|
||||
// jQuery.migrateMute = false;
|
||||
|
||||
// Show a message on the console so devs know we're active
|
||||
if ( !jQuery.migrateMute && window.console && window.console.log ) {
|
||||
window.console.log("JQMIGRATE: Logging is active");
|
||||
}
|
||||
|
||||
// Set to false to disable traces that appear with warnings
|
||||
if ( jQuery.migrateTrace === undefined ) {
|
||||
jQuery.migrateTrace = true;
|
||||
}
|
||||
|
||||
// Forget any warnings we've already given; public
|
||||
jQuery.migrateReset = function() {
|
||||
warnedAbout = {};
|
||||
jQuery.migrateWarnings.length = 0;
|
||||
};
|
||||
|
||||
function migrateWarn( msg) {
|
||||
var console = window.console;
|
||||
if ( !warnedAbout[ msg ] ) {
|
||||
warnedAbout[ msg ] = true;
|
||||
jQuery.migrateWarnings.push( msg );
|
||||
if ( console && console.warn && !jQuery.migrateMute ) {
|
||||
console.warn( "JQMIGRATE: " + msg );
|
||||
if ( jQuery.migrateTrace && console.trace ) {
|
||||
console.trace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function migrateWarnProp( obj, prop, value, msg ) {
|
||||
if ( Object.defineProperty ) {
|
||||
// On ES5 browsers (non-oldIE), warn if the code tries to get prop;
|
||||
// allow property to be overwritten in case some other plugin wants it
|
||||
try {
|
||||
Object.defineProperty( obj, prop, {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
migrateWarn( msg );
|
||||
return value;
|
||||
},
|
||||
set: function( newValue ) {
|
||||
migrateWarn( msg );
|
||||
value = newValue;
|
||||
}
|
||||
});
|
||||
return;
|
||||
} catch( err ) {
|
||||
// IE8 is a dope about Object.defineProperty, can't warn there
|
||||
}
|
||||
}
|
||||
|
||||
// Non-ES5 (or broken) browser; just set the property
|
||||
jQuery._definePropertyBroken = true;
|
||||
obj[ prop ] = value;
|
||||
}
|
||||
|
||||
if ( document.compatMode === "BackCompat" ) {
|
||||
// jQuery has never supported or tested Quirks Mode
|
||||
migrateWarn( "jQuery is not compatible with Quirks Mode" );
|
||||
}
|
||||
|
||||
|
||||
var attrFn = jQuery( "<input/>", { size: 1 } ).attr("size") && jQuery.attrFn,
|
||||
oldAttr = jQuery.attr,
|
||||
valueAttrGet = jQuery.attrHooks.value && jQuery.attrHooks.value.get ||
|
||||
function() { return null; },
|
||||
valueAttrSet = jQuery.attrHooks.value && jQuery.attrHooks.value.set ||
|
||||
function() { return undefined; },
|
||||
rnoType = /^(?:input|button)$/i,
|
||||
rnoAttrNodeType = /^[238]$/,
|
||||
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
||||
ruseDefault = /^(?:checked|selected)$/i;
|
||||
|
||||
// jQuery.attrFn
|
||||
migrateWarnProp( jQuery, "attrFn", attrFn || {}, "jQuery.attrFn is deprecated" );
|
||||
|
||||
jQuery.attr = function( elem, name, value, pass ) {
|
||||
var lowerName = name.toLowerCase(),
|
||||
nType = elem && elem.nodeType;
|
||||
|
||||
if ( pass ) {
|
||||
// Since pass is used internally, we only warn for new jQuery
|
||||
// versions where there isn't a pass arg in the formal params
|
||||
if ( oldAttr.length < 4 ) {
|
||||
migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
|
||||
}
|
||||
if ( elem && !rnoAttrNodeType.test( nType ) &&
|
||||
(attrFn ? name in attrFn : jQuery.isFunction(jQuery.fn[name])) ) {
|
||||
return jQuery( elem )[ name ]( value );
|
||||
}
|
||||
}
|
||||
|
||||
// Warn if user tries to set `type`, since it breaks on IE 6/7/8; by checking
|
||||
// for disconnected elements we don't warn on $( "<button>", { type: "button" } ).
|
||||
if ( name === "type" && value !== undefined && rnoType.test( elem.nodeName ) && elem.parentNode ) {
|
||||
migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
|
||||
}
|
||||
|
||||
// Restore boolHook for boolean property/attribute synchronization
|
||||
if ( !jQuery.attrHooks[ lowerName ] && rboolean.test( lowerName ) ) {
|
||||
jQuery.attrHooks[ lowerName ] = {
|
||||
get: function( elem, name ) {
|
||||
// Align boolean attributes with corresponding properties
|
||||
// Fall back to attribute presence where some booleans are not supported
|
||||
var attrNode,
|
||||
property = jQuery.prop( elem, name );
|
||||
return property === true || typeof property !== "boolean" &&
|
||||
( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
||||
|
||||
name.toLowerCase() :
|
||||
undefined;
|
||||
},
|
||||
set: function( elem, value, name ) {
|
||||
var propName;
|
||||
if ( value === false ) {
|
||||
// Remove boolean attributes when set to false
|
||||
jQuery.removeAttr( elem, name );
|
||||
} else {
|
||||
// value is true since we know at this point it's type boolean and not false
|
||||
// Set boolean attributes to the same name and set the DOM property
|
||||
propName = jQuery.propFix[ name ] || name;
|
||||
if ( propName in elem ) {
|
||||
// Only set the IDL specifically if it already exists on the element
|
||||
elem[ propName ] = true;
|
||||
}
|
||||
|
||||
elem.setAttribute( name, name.toLowerCase() );
|
||||
}
|
||||
return name;
|
||||
}
|
||||
};
|
||||
|
||||
// Warn only for attributes that can remain distinct from their properties post-1.9
|
||||
if ( ruseDefault.test( lowerName ) ) {
|
||||
migrateWarn( "jQuery.fn.attr('" + lowerName + "') may use property instead of attribute" );
|
||||
}
|
||||
}
|
||||
|
||||
return oldAttr.call( jQuery, elem, name, value );
|
||||
};
|
||||
|
||||
// attrHooks: value
|
||||
jQuery.attrHooks.value = {
|
||||
get: function( elem, name ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrGet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value') no longer gets properties");
|
||||
}
|
||||
return name in elem ?
|
||||
elem.value :
|
||||
null;
|
||||
},
|
||||
set: function( elem, value ) {
|
||||
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
||||
if ( nodeName === "button" ) {
|
||||
return valueAttrSet.apply( this, arguments );
|
||||
}
|
||||
if ( nodeName !== "input" && nodeName !== "option" ) {
|
||||
migrateWarn("jQuery.fn.attr('value', val) no longer sets properties");
|
||||
}
|
||||
// Does not return so that setAttribute is also used
|
||||
elem.value = value;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var matched, browser,
|
||||
oldInit = jQuery.fn.init,
|
||||
oldParseJSON = jQuery.parseJSON,
|
||||
// Note: XSS check is done below after string is trimmed
|
||||
rquickExpr = /^([^<]*)(<[\w\W]+>)([^>]*)$/;
|
||||
|
||||
// $(html) "looks like html" rule change
|
||||
jQuery.fn.init = function( selector, context, rootjQuery ) {
|
||||
var match;
|
||||
|
||||
if ( selector && typeof selector === "string" && !jQuery.isPlainObject( context ) &&
|
||||
(match = rquickExpr.exec( jQuery.trim( selector ) )) && match[ 0 ] ) {
|
||||
// This is an HTML string according to the "old" rules; is it still?
|
||||
if ( selector.charAt( 0 ) !== "<" ) {
|
||||
migrateWarn("$(html) HTML strings must start with '<' character");
|
||||
}
|
||||
if ( match[ 3 ] ) {
|
||||
migrateWarn("$(html) HTML text after last tag is ignored");
|
||||
}
|
||||
// Consistently reject any HTML-like string starting with a hash (#9521)
|
||||
// Note that this may break jQuery 1.6.x code that otherwise would work.
|
||||
if ( match[ 0 ].charAt( 0 ) === "#" ) {
|
||||
migrateWarn("HTML string cannot start with a '#' character");
|
||||
jQuery.error("JQMIGRATE: Invalid selector string (XSS)");
|
||||
}
|
||||
// Now process using loose rules; let pre-1.8 play too
|
||||
if ( context && context.context ) {
|
||||
// jQuery object as context; parseHTML expects a DOM object
|
||||
context = context.context;
|
||||
}
|
||||
if ( jQuery.parseHTML ) {
|
||||
return oldInit.call( this, jQuery.parseHTML( match[ 2 ], context, true ),
|
||||
context, rootjQuery );
|
||||
}
|
||||
}
|
||||
return oldInit.apply( this, arguments );
|
||||
};
|
||||
jQuery.fn.init.prototype = jQuery.fn;
|
||||
|
||||
// Let $.parseJSON(falsy_value) return null
|
||||
jQuery.parseJSON = function( json ) {
|
||||
if ( !json && json !== null ) {
|
||||
migrateWarn("jQuery.parseJSON requires a valid JSON string");
|
||||
return null;
|
||||
}
|
||||
return oldParseJSON.apply( this, arguments );
|
||||
};
|
||||
|
||||
jQuery.uaMatch = function( ua ) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
||||
/(msie) ([\w.]+)/.exec( ua ) ||
|
||||
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
||||
[];
|
||||
|
||||
return {
|
||||
browser: match[ 1 ] || "",
|
||||
version: match[ 2 ] || "0"
|
||||
};
|
||||
};
|
||||
|
||||
// Don't clobber any existing jQuery.browser in case it's different
|
||||
if ( !jQuery.browser ) {
|
||||
matched = jQuery.uaMatch( navigator.userAgent );
|
||||
browser = {};
|
||||
|
||||
if ( matched.browser ) {
|
||||
browser[ matched.browser ] = true;
|
||||
browser.version = matched.version;
|
||||
}
|
||||
|
||||
// Chrome is Webkit, but Webkit is also Safari.
|
||||
if ( browser.chrome ) {
|
||||
browser.webkit = true;
|
||||
} else if ( browser.webkit ) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
jQuery.browser = browser;
|
||||
}
|
||||
|
||||
// Warn if the code tries to get jQuery.browser
|
||||
migrateWarnProp( jQuery, "browser", jQuery.browser, "jQuery.browser is deprecated" );
|
||||
|
||||
jQuery.sub = function() {
|
||||
function jQuerySub( selector, context ) {
|
||||
return new jQuerySub.fn.init( selector, context );
|
||||
}
|
||||
jQuery.extend( true, jQuerySub, this );
|
||||
jQuerySub.superclass = this;
|
||||
jQuerySub.fn = jQuerySub.prototype = this();
|
||||
jQuerySub.fn.constructor = jQuerySub;
|
||||
jQuerySub.sub = this.sub;
|
||||
jQuerySub.fn.init = function init( selector, context ) {
|
||||
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
||||
context = jQuerySub( context );
|
||||
}
|
||||
|
||||
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
||||
};
|
||||
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
||||
var rootjQuerySub = jQuerySub(document);
|
||||
migrateWarn( "jQuery.sub() is deprecated" );
|
||||
return jQuerySub;
|
||||
};
|
||||
|
||||
|
||||
// Ensure that $.ajax gets the new parseJSON defined in core.js
|
||||
jQuery.ajaxSetup({
|
||||
converters: {
|
||||
"text json": jQuery.parseJSON
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var oldFnData = jQuery.fn.data;
|
||||
|
||||
jQuery.fn.data = function( name ) {
|
||||
var ret, evt,
|
||||
elem = this[0];
|
||||
|
||||
// Handles 1.7 which has this behavior and 1.8 which doesn't
|
||||
if ( elem && name === "events" && arguments.length === 1 ) {
|
||||
ret = jQuery.data( elem, name );
|
||||
evt = jQuery._data( elem, name );
|
||||
if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
|
||||
migrateWarn("Use of jQuery.fn.data('events') is deprecated");
|
||||
return evt;
|
||||
}
|
||||
}
|
||||
return oldFnData.apply( this, arguments );
|
||||
};
|
||||
|
||||
|
||||
var rscriptType = /\/(java|ecma)script/i,
|
||||
oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
|
||||
|
||||
jQuery.fn.andSelf = function() {
|
||||
migrateWarn("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()");
|
||||
return oldSelf.apply( this, arguments );
|
||||
};
|
||||
|
||||
// Since jQuery.clean is used internally on older versions, we only shim if it's missing
|
||||
if ( !jQuery.clean ) {
|
||||
jQuery.clean = function( elems, context, fragment, scripts ) {
|
||||
// Set context per 1.8 logic
|
||||
context = context || document;
|
||||
context = !context.nodeType && context[0] || context;
|
||||
context = context.ownerDocument || context;
|
||||
|
||||
migrateWarn("jQuery.clean() is deprecated");
|
||||
|
||||
var i, elem, handleScript, jsTags,
|
||||
ret = [];
|
||||
|
||||
jQuery.merge( ret, jQuery.buildFragment( elems, context ).childNodes );
|
||||
|
||||
// Complex logic lifted directly from jQuery 1.8
|
||||
if ( fragment ) {
|
||||
// Special handling of each script element
|
||||
handleScript = function( elem ) {
|
||||
// Check if we consider it executable
|
||||
if ( !elem.type || rscriptType.test( elem.type ) ) {
|
||||
// Detach the script and store it in the scripts array (if provided) or the fragment
|
||||
// Return truthy to indicate that it has been handled
|
||||
return scripts ?
|
||||
scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
|
||||
fragment.appendChild( elem );
|
||||
}
|
||||
};
|
||||
|
||||
for ( i = 0; (elem = ret[i]) != null; i++ ) {
|
||||
// Check if we're done after handling an executable script
|
||||
if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
|
||||
// Append to fragment and handle embedded scripts
|
||||
fragment.appendChild( elem );
|
||||
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
||||
// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
|
||||
jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
|
||||
|
||||
// Splice the scripts into ret after their former ancestor and advance our index beyond them
|
||||
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
||||
i += jsTags.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
var eventAdd = jQuery.event.add,
|
||||
eventRemove = jQuery.event.remove,
|
||||
eventTrigger = jQuery.event.trigger,
|
||||
oldToggle = jQuery.fn.toggle,
|
||||
oldLive = jQuery.fn.live,
|
||||
oldDie = jQuery.fn.die,
|
||||
ajaxEvents = "ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",
|
||||
rajaxEvent = new RegExp( "\\b(?:" + ajaxEvents + ")\\b" ),
|
||||
rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
|
||||
hoverHack = function( events ) {
|
||||
if ( typeof( events ) !== "string" || jQuery.event.special.hover ) {
|
||||
return events;
|
||||
}
|
||||
if ( rhoverHack.test( events ) ) {
|
||||
migrateWarn("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'");
|
||||
}
|
||||
return events && events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
||||
};
|
||||
|
||||
// Event props removed in 1.9, put them back if needed; no practical way to warn them
|
||||
if ( jQuery.event.props && jQuery.event.props[ 0 ] !== "attrChange" ) {
|
||||
jQuery.event.props.unshift( "attrChange", "attrName", "relatedNode", "srcElement" );
|
||||
}
|
||||
|
||||
// Undocumented jQuery.event.handle was "deprecated" in jQuery 1.7
|
||||
if ( jQuery.event.dispatch ) {
|
||||
migrateWarnProp( jQuery.event, "handle", jQuery.event.dispatch, "jQuery.event.handle is undocumented and deprecated" );
|
||||
}
|
||||
|
||||
// Support for 'hover' pseudo-event and ajax event warnings
|
||||
jQuery.event.add = function( elem, types, handler, data, selector ){
|
||||
if ( elem !== document && rajaxEvent.test( types ) ) {
|
||||
migrateWarn( "AJAX events should be attached to document: " + types );
|
||||
}
|
||||
eventAdd.call( this, elem, hoverHack( types || "" ), handler, data, selector );
|
||||
};
|
||||
jQuery.event.remove = function( elem, types, handler, selector, mappedTypes ){
|
||||
eventRemove.call( this, elem, hoverHack( types ) || "", handler, selector, mappedTypes );
|
||||
};
|
||||
|
||||
jQuery.fn.error = function() {
|
||||
var args = Array.prototype.slice.call( arguments, 0);
|
||||
migrateWarn("jQuery.fn.error() is deprecated");
|
||||
args.splice( 0, 0, "error" );
|
||||
if ( arguments.length ) {
|
||||
return this.bind.apply( this, args );
|
||||
}
|
||||
// error event should not bubble to window, although it does pre-1.7
|
||||
this.triggerHandler.apply( this, args );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.toggle = function( fn, fn2 ) {
|
||||
|
||||
// Don't mess with animation or css toggles
|
||||
if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
|
||||
return oldToggle.apply( this, arguments );
|
||||
}
|
||||
migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
|
||||
|
||||
// Save reference to arguments for access in closure
|
||||
var args = arguments,
|
||||
guid = fn.guid || jQuery.guid++,
|
||||
i = 0,
|
||||
toggler = function( event ) {
|
||||
// Figure out which function to execute
|
||||
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
||||
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
||||
|
||||
// Make sure that clicks stop
|
||||
event.preventDefault();
|
||||
|
||||
// and execute the function
|
||||
return args[ lastToggle ].apply( this, arguments ) || false;
|
||||
};
|
||||
|
||||
// link all the functions, so any of them can unbind this click handler
|
||||
toggler.guid = guid;
|
||||
while ( i < args.length ) {
|
||||
args[ i++ ].guid = guid;
|
||||
}
|
||||
|
||||
return this.click( toggler );
|
||||
};
|
||||
|
||||
jQuery.fn.live = function( types, data, fn ) {
|
||||
migrateWarn("jQuery.fn.live() is deprecated");
|
||||
if ( oldLive ) {
|
||||
return oldLive.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).on( types, this.selector, data, fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
jQuery.fn.die = function( types, fn ) {
|
||||
migrateWarn("jQuery.fn.die() is deprecated");
|
||||
if ( oldDie ) {
|
||||
return oldDie.apply( this, arguments );
|
||||
}
|
||||
jQuery( this.context ).off( types, this.selector || "**", fn );
|
||||
return this;
|
||||
};
|
||||
|
||||
// Turn global events into document-triggered events
|
||||
jQuery.event.trigger = function( event, data, elem, onlyHandlers ){
|
||||
if ( !elem && !rajaxEvent.test( event ) ) {
|
||||
migrateWarn( "Global events are undocumented and deprecated" );
|
||||
}
|
||||
return eventTrigger.call( this, event, data, elem || document, onlyHandlers );
|
||||
};
|
||||
jQuery.each( ajaxEvents.split("|"),
|
||||
function( _, name ) {
|
||||
jQuery.event.special[ name ] = {
|
||||
setup: function() {
|
||||
var elem = this;
|
||||
|
||||
// The document needs no shimming; must be !== for oldIE
|
||||
if ( elem !== document ) {
|
||||
jQuery.event.add( document, name + "." + jQuery.guid, function() {
|
||||
jQuery.event.trigger( name, null, elem, true );
|
||||
});
|
||||
jQuery._data( this, name, jQuery.guid++ );
|
||||
}
|
||||
return false;
|
||||
},
|
||||
teardown: function() {
|
||||
if ( this !== document ) {
|
||||
jQuery.event.remove( document, name + "." + jQuery._data( this, name ) );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
})( jQuery, window );
|
||||
@@ -0,0 +1,113 @@
|
||||
/*!
|
||||
* jQuery Cookie Plugin v1.4.1
|
||||
* https://github.com/carhartl/jquery-cookie
|
||||
*
|
||||
* Copyright 2006, 2014 Klaus Hartl
|
||||
* Released under the MIT license
|
||||
*/
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD (Register as an anonymous module)
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS
|
||||
module.exports = factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var pluses = /\+/g;
|
||||
|
||||
function encode(s) {
|
||||
return config.raw ? s : encodeURIComponent(s);
|
||||
}
|
||||
|
||||
function decode(s) {
|
||||
return config.raw ? s : decodeURIComponent(s);
|
||||
}
|
||||
|
||||
function stringifyCookieValue(value) {
|
||||
return encode(config.json ? JSON.stringify(value) : String(value));
|
||||
}
|
||||
|
||||
function parseCookieValue(s) {
|
||||
if (s.indexOf('"') === 0) {
|
||||
// This is a quoted cookie as according to RFC2068, unescape...
|
||||
s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\');
|
||||
}
|
||||
|
||||
try {
|
||||
// Replace server-side written pluses with spaces.
|
||||
// If we can't decode the cookie, ignore it, it's unusable.
|
||||
// If we can't parse the cookie, ignore it, it's unusable.
|
||||
s = decodeURIComponent(s.replace(pluses, ' '));
|
||||
return config.json ? JSON.parse(s) : s;
|
||||
} catch(e) {}
|
||||
}
|
||||
|
||||
function read(s, converter) {
|
||||
var value = config.raw ? s : parseCookieValue(s);
|
||||
return $.isFunction(converter) ? converter(value) : value;
|
||||
}
|
||||
|
||||
var config = $.cookie = function (key, value, options) {
|
||||
|
||||
// Write
|
||||
|
||||
if (arguments.length > 1 && !$.isFunction(value)) {
|
||||
options = $.extend({}, config.defaults, options);
|
||||
|
||||
if (typeof options.expires === 'number') {
|
||||
var days = options.expires, t = options.expires = new Date();
|
||||
t.setMilliseconds(t.getMilliseconds() + days * 864e+5);
|
||||
}
|
||||
|
||||
return (document.cookie = [
|
||||
encode(key), '=', stringifyCookieValue(value),
|
||||
options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE
|
||||
options.path ? '; path=' + options.path : '',
|
||||
options.domain ? '; domain=' + options.domain : '',
|
||||
options.secure ? '; secure' : ''
|
||||
].join(''));
|
||||
}
|
||||
|
||||
// Read
|
||||
|
||||
var result = key ? undefined : {},
|
||||
// To prevent the for loop in the first place assign an empty array
|
||||
// in case there are no cookies at all. Also prevents odd result when
|
||||
// calling $.cookie().
|
||||
cookies = document.cookie ? document.cookie.split('; ') : [],
|
||||
i = 0,
|
||||
l = cookies.length;
|
||||
|
||||
for (; i < l; i++) {
|
||||
var parts = cookies[i].split('='),
|
||||
name = decode(parts.shift()),
|
||||
cookie = parts.join('=');
|
||||
|
||||
if (key === name) {
|
||||
// If second argument (value) is a function it's a converter...
|
||||
result = read(cookie, value);
|
||||
break;
|
||||
}
|
||||
|
||||
// Prevent storing a cookie that we couldn't decode.
|
||||
if (!key && (cookie = read(cookie)) !== undefined) {
|
||||
result[name] = cookie;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
config.defaults = {};
|
||||
|
||||
$.removeCookie = function (key, options) {
|
||||
// Must not alter options, thus extending a fresh object...
|
||||
$.cookie(key, '', $.extend({}, options, { expires: -1 }));
|
||||
return !$.cookie(key);
|
||||
};
|
||||
}));
|
||||
@@ -0,0 +1,205 @@
|
||||
/*
|
||||
* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/
|
||||
*
|
||||
* Uses the built in easing capabilities added In jQuery 1.1
|
||||
* to offer multiple easing options
|
||||
*
|
||||
* TERMS OF USE - jQuery Easing
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2008 George McGinley Smith
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
// t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
jQuery.easing['jswing'] = jQuery.easing['swing'];
|
||||
|
||||
jQuery.extend( jQuery.easing,
|
||||
{
|
||||
def: 'easeOutQuad',
|
||||
swing: function (x, t, b, c, d) {
|
||||
//alert(jQuery.easing.default);
|
||||
return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
|
||||
},
|
||||
easeInQuad: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t + b;
|
||||
},
|
||||
easeOutQuad: function (x, t, b, c, d) {
|
||||
return -c *(t/=d)*(t-2) + b;
|
||||
},
|
||||
easeInOutQuad: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t + b;
|
||||
return -c/2 * ((--t)*(t-2) - 1) + b;
|
||||
},
|
||||
easeInCubic: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t + b;
|
||||
},
|
||||
easeOutCubic: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t + 1) + b;
|
||||
},
|
||||
easeInOutCubic: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t + 2) + b;
|
||||
},
|
||||
easeInQuart: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t + b;
|
||||
},
|
||||
easeOutQuart: function (x, t, b, c, d) {
|
||||
return -c * ((t=t/d-1)*t*t*t - 1) + b;
|
||||
},
|
||||
easeInOutQuart: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
|
||||
return -c/2 * ((t-=2)*t*t*t - 2) + b;
|
||||
},
|
||||
easeInQuint: function (x, t, b, c, d) {
|
||||
return c*(t/=d)*t*t*t*t + b;
|
||||
},
|
||||
easeOutQuint: function (x, t, b, c, d) {
|
||||
return c*((t=t/d-1)*t*t*t*t + 1) + b;
|
||||
},
|
||||
easeInOutQuint: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
|
||||
return c/2*((t-=2)*t*t*t*t + 2) + b;
|
||||
},
|
||||
easeInSine: function (x, t, b, c, d) {
|
||||
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
|
||||
},
|
||||
easeOutSine: function (x, t, b, c, d) {
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
},
|
||||
easeInOutSine: function (x, t, b, c, d) {
|
||||
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
|
||||
},
|
||||
easeInExpo: function (x, t, b, c, d) {
|
||||
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
|
||||
},
|
||||
easeOutExpo: function (x, t, b, c, d) {
|
||||
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
|
||||
},
|
||||
easeInOutExpo: function (x, t, b, c, d) {
|
||||
if (t==0) return b;
|
||||
if (t==d) return b+c;
|
||||
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
|
||||
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
|
||||
},
|
||||
easeInCirc: function (x, t, b, c, d) {
|
||||
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
|
||||
},
|
||||
easeOutCirc: function (x, t, b, c, d) {
|
||||
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
|
||||
},
|
||||
easeInOutCirc: function (x, t, b, c, d) {
|
||||
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
|
||||
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
|
||||
},
|
||||
easeInElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
},
|
||||
easeOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
|
||||
},
|
||||
easeInOutElastic: function (x, t, b, c, d) {
|
||||
var s=1.70158;var p=0;var a=c;
|
||||
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
|
||||
if (a < Math.abs(c)) { a=c; var s=p/4; }
|
||||
else var s = p/(2*Math.PI) * Math.asin (c/a);
|
||||
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
|
||||
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
|
||||
},
|
||||
easeInBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*(t/=d)*t*((s+1)*t - s) + b;
|
||||
},
|
||||
easeOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
|
||||
},
|
||||
easeInOutBack: function (x, t, b, c, d, s) {
|
||||
if (s == undefined) s = 1.70158;
|
||||
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
|
||||
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
|
||||
},
|
||||
easeInBounce: function (x, t, b, c, d) {
|
||||
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
|
||||
},
|
||||
easeOutBounce: function (x, t, b, c, d) {
|
||||
if ((t/=d) < (1/2.75)) {
|
||||
return c*(7.5625*t*t) + b;
|
||||
} else if (t < (2/2.75)) {
|
||||
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
|
||||
} else if (t < (2.5/2.75)) {
|
||||
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
|
||||
} else {
|
||||
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
|
||||
}
|
||||
},
|
||||
easeInOutBounce: function (x, t, b, c, d) {
|
||||
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
|
||||
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
*
|
||||
* TERMS OF USE - EASING EQUATIONS
|
||||
*
|
||||
* Open source under the BSD License.
|
||||
*
|
||||
* Copyright © 2001 Robert Penner
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
*
|
||||
* Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* Neither the name of the author nor the names of contributors may be used to endorse
|
||||
* or promote products derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
@@ -0,0 +1,46 @@
|
||||
/*parsed HTML*/
|
||||
$(function () {
|
||||
$("[data-equal-group]").each(function () {
|
||||
$(this).contents().wrapAll("<div class='box_inner'></div>");
|
||||
})
|
||||
})
|
||||
/*add event*/
|
||||
$(window).bind("resize", height_handler).bind("load", height_handler)
|
||||
function height_handler() {
|
||||
|
||||
var groups = [];
|
||||
$("[data-equal-group]").each(function () {
|
||||
var g = $(this).data('equal-group');
|
||||
if (!groups[g]) {
|
||||
groups[g] = [];
|
||||
}
|
||||
groups[g].push(this);
|
||||
});
|
||||
|
||||
var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
|
||||
|
||||
if(width > 767){
|
||||
$.each(groups, function () {
|
||||
$(this).equalHeights();
|
||||
})
|
||||
}else{
|
||||
$.each(groups, function () {
|
||||
$(this).css('height', 'auto');
|
||||
})
|
||||
}
|
||||
}
|
||||
/*glob function*/
|
||||
(function ($) {
|
||||
$.fn.equalHeights = function (minHeight, maxHeight) {
|
||||
tallest = (minHeight) ? minHeight : 0;
|
||||
this.each(function () {
|
||||
if ($(">.box_inner", this).outerHeight() > tallest) {
|
||||
tallest = $(">.box_inner", this).outerHeight()
|
||||
}
|
||||
});
|
||||
if ((maxHeight) && tallest > maxHeight) tallest = maxHeight;
|
||||
return this.each(function () {
|
||||
$(this).height(tallest)
|
||||
})
|
||||
}
|
||||
})(jQuery)
|
||||
@@ -0,0 +1,122 @@
|
||||
/*!
|
||||
* Buttons helper for fancyBox
|
||||
* version: 1.0.5 (Mon, 15 Oct 2012)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* buttons: {
|
||||
* position : 'top'
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*/
|
||||
(function ($) {
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox;
|
||||
|
||||
//Add helper object
|
||||
F.helpers.buttons = {
|
||||
defaults : {
|
||||
skipSingle : false, // disables if gallery contains single image
|
||||
position : 'top', // 'top' or 'bottom'
|
||||
tpl : '<div id="fancybox-buttons"><ul><li><a class="btnPrev" title="Previous" href="javascript:;"></a></li><li><a class="btnPlay" title="Start slideshow" href="javascript:;"></a></li><li><a class="btnNext" title="Next" href="javascript:;"></a></li><li><a class="btnToggle" title="Toggle size" href="javascript:;"></a></li><li><a class="btnClose" title="Close" href="javascript:;"></a></li></ul></div>'
|
||||
},
|
||||
|
||||
list : null,
|
||||
buttons: null,
|
||||
|
||||
beforeLoad: function (opts, obj) {
|
||||
//Remove self if gallery do not have at least two items
|
||||
|
||||
if (opts.skipSingle && obj.group.length < 2) {
|
||||
obj.helpers.buttons = false;
|
||||
obj.closeBtn = true;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//Increase top margin to give space for buttons
|
||||
obj.margin[ opts.position === 'bottom' ? 2 : 0 ] += 30;
|
||||
},
|
||||
|
||||
onPlayStart: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Pause slideshow').addClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
onPlayEnd: function () {
|
||||
if (this.buttons) {
|
||||
this.buttons.play.attr('title', 'Start slideshow').removeClass('btnPlayOn');
|
||||
}
|
||||
},
|
||||
|
||||
afterShow: function (opts, obj) {
|
||||
var buttons = this.buttons;
|
||||
|
||||
if (!buttons) {
|
||||
this.list = $(opts.tpl).addClass(opts.position).appendTo('body');
|
||||
|
||||
buttons = {
|
||||
prev : this.list.find('.btnPrev').click( F.prev ),
|
||||
next : this.list.find('.btnNext').click( F.next ),
|
||||
play : this.list.find('.btnPlay').click( F.play ),
|
||||
toggle : this.list.find('.btnToggle').click( F.toggle ),
|
||||
close : this.list.find('.btnClose').click( F.close )
|
||||
}
|
||||
}
|
||||
|
||||
//Prev
|
||||
if (obj.index > 0 || obj.loop) {
|
||||
buttons.prev.removeClass('btnDisabled');
|
||||
} else {
|
||||
buttons.prev.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
//Next / Play
|
||||
if (obj.loop || obj.index < obj.group.length - 1) {
|
||||
buttons.next.removeClass('btnDisabled');
|
||||
buttons.play.removeClass('btnDisabled');
|
||||
|
||||
} else {
|
||||
buttons.next.addClass('btnDisabled');
|
||||
buttons.play.addClass('btnDisabled');
|
||||
}
|
||||
|
||||
this.buttons = buttons;
|
||||
|
||||
this.onUpdate(opts, obj);
|
||||
},
|
||||
|
||||
onUpdate: function (opts, obj) {
|
||||
var toggle;
|
||||
|
||||
if (!this.buttons) {
|
||||
return;
|
||||
}
|
||||
|
||||
toggle = this.buttons.toggle.removeClass('btnDisabled btnToggleOn');
|
||||
|
||||
//Size toggle button
|
||||
if (obj.canShrink) {
|
||||
toggle.addClass('btnToggleOn');
|
||||
|
||||
} else if (!obj.canExpand) {
|
||||
toggle.addClass('btnDisabled');
|
||||
}
|
||||
},
|
||||
|
||||
beforeClose: function () {
|
||||
if (this.list) {
|
||||
this.list.remove();
|
||||
}
|
||||
|
||||
this.list = null;
|
||||
this.buttons = null;
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
@@ -0,0 +1,199 @@
|
||||
/*!
|
||||
* Media helper for fancyBox
|
||||
* version: 1.0.6 (Fri, 14 Jun 2013)
|
||||
* @requires fancyBox v2.0 or later
|
||||
*
|
||||
* Usage:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: true
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Set custom URL parameters:
|
||||
* $(".fancybox").fancybox({
|
||||
* helpers : {
|
||||
* media: {
|
||||
* youtube : {
|
||||
* params : {
|
||||
* autoplay : 0
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Or:
|
||||
* $(".fancybox").fancybox({,
|
||||
* helpers : {
|
||||
* media: true
|
||||
* },
|
||||
* youtube : {
|
||||
* autoplay: 0
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Supports:
|
||||
*
|
||||
* Youtube
|
||||
* http://www.youtube.com/watch?v=opj24KnzrWo
|
||||
* http://www.youtube.com/embed/opj24KnzrWo
|
||||
* http://youtu.be/opj24KnzrWo
|
||||
* http://www.youtube-nocookie.com/embed/opj24KnzrWo
|
||||
* Vimeo
|
||||
* http://vimeo.com/40648169
|
||||
* http://vimeo.com/channels/staffpicks/38843628
|
||||
* http://vimeo.com/groups/surrealism/videos/36516384
|
||||
* http://player.vimeo.com/video/45074303
|
||||
* Metacafe
|
||||
* http://www.metacafe.com/watch/7635964/dr_seuss_the_lorax_movie_trailer/
|
||||
* http://www.metacafe.com/watch/7635964/
|
||||
* Dailymotion
|
||||
* http://www.dailymotion.com/video/xoytqh_dr-seuss-the-lorax-premiere_people
|
||||
* Twitvid
|
||||
* http://twitvid.com/QY7MD
|
||||
* Twitpic
|
||||
* http://twitpic.com/7p93st
|
||||
* Instagram
|
||||
* http://instagr.am/p/IejkuUGxQn/
|
||||
* http://instagram.com/p/IejkuUGxQn/
|
||||
* Google maps
|
||||
* http://maps.google.com/maps?q=Eiffel+Tower,+Avenue+Gustave+Eiffel,+Paris,+France&t=h&z=17
|
||||
* http://maps.google.com/?ll=48.857995,2.294297&spn=0.007666,0.021136&t=m&z=16
|
||||
* http://maps.google.com/?ll=48.859463,2.292626&spn=0.000965,0.002642&t=m&z=19&layer=c&cbll=48.859524,2.292532&panoid=YJ0lq28OOy3VT2IqIuVY0g&cbp=12,151.58,,0,-15.56
|
||||
*/
|
||||
(function ($) {
|
||||
"use strict";
|
||||
|
||||
//Shortcut for fancyBox object
|
||||
var F = $.fancybox,
|
||||
format = function( url, rez, params ) {
|
||||
params = params || '';
|
||||
|
||||
if ( $.type( params ) === "object" ) {
|
||||
params = $.param(params, true);
|
||||
}
|
||||
|
||||
$.each(rez, function(key, value) {
|
||||
url = url.replace( '$' + key, value || '' );
|
||||
});
|
||||
|
||||
if (params.length) {
|
||||
url += ( url.indexOf('?') > 0 ? '&' : '?' ) + params;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
//Add helper object
|
||||
F.helpers.media = {
|
||||
defaults : {
|
||||
youtube : {
|
||||
matcher : /(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(watch\?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*)).*/i,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
autohide : 1,
|
||||
fs : 1,
|
||||
rel : 0,
|
||||
hd : 1,
|
||||
wmode : 'opaque',
|
||||
enablejsapi : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.youtube.com/embed/$3'
|
||||
},
|
||||
vimeo : {
|
||||
matcher : /(?:vimeo(?:pro)?.com)\/(?:[^\d]+)?(\d+)(?:.*)/,
|
||||
params : {
|
||||
autoplay : 1,
|
||||
hd : 1,
|
||||
show_title : 1,
|
||||
show_byline : 1,
|
||||
show_portrait : 0,
|
||||
fullscreen : 1
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//player.vimeo.com/video/$1'
|
||||
},
|
||||
metacafe : {
|
||||
matcher : /metacafe.com\/(?:watch|fplayer)\/([\w\-]{1,10})/,
|
||||
params : {
|
||||
autoPlay : 'yes'
|
||||
},
|
||||
type : 'swf',
|
||||
url : function( rez, params, obj ) {
|
||||
obj.swf.flashVars = 'playerVars=' + $.param( params, true );
|
||||
|
||||
return '//www.metacafe.com/fplayer/' + rez[1] + '/.swf';
|
||||
}
|
||||
},
|
||||
dailymotion : {
|
||||
matcher : /dailymotion.com\/video\/(.*)\/?(.*)/,
|
||||
params : {
|
||||
additionalInfos : 0,
|
||||
autoStart : 1
|
||||
},
|
||||
type : 'swf',
|
||||
url : '//www.dailymotion.com/swf/video/$1'
|
||||
},
|
||||
twitvid : {
|
||||
matcher : /twitvid\.com\/([a-zA-Z0-9_\-\?\=]+)/i,
|
||||
params : {
|
||||
autoplay : 0
|
||||
},
|
||||
type : 'iframe',
|
||||
url : '//www.twitvid.com/embed.php?guid=$1'
|
||||
},
|
||||
twitpic : {
|
||||
matcher : /twitpic\.com\/(?!(?:place|photos|events)\/)([a-zA-Z0-9\?\=\-]+)/i,
|
||||
type : 'image',
|
||||
url : '//twitpic.com/show/full/$1/'
|
||||
},
|
||||
instagram : {
|
||||
matcher : /(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,
|
||||
type : 'image',
|
||||
url : '//$1/p/$2/media/?size=l'
|
||||
},
|
||||
google_maps : {
|
||||
matcher : /maps\.google\.([a-z]{2,3}(\.[a-z]{2})?)\/(\?ll=|maps\?)(.*)/i,
|
||||
type : 'iframe',
|
||||
url : function( rez ) {
|
||||
return '//maps.google.' + rez[1] + '/' + rez[3] + '' + rez[4] + '&output=' + (rez[4].indexOf('layer=c') > 0 ? 'svembed' : 'embed');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
beforeLoad : function(opts, obj) {
|
||||
var url = obj.href || '',
|
||||
type = false,
|
||||
what,
|
||||
item,
|
||||
rez,
|
||||
params;
|
||||
|
||||
for (what in opts) {
|
||||
if (opts.hasOwnProperty(what)) {
|
||||
item = opts[ what ];
|
||||
rez = url.match( item.matcher );
|
||||
|
||||
if (rez) {
|
||||
type = item.type;
|
||||
params = $.extend(true, {}, item.params, obj[ what ] || ($.isPlainObject(opts[ what ]) ? opts[ what ].params : null));
|
||||
|
||||
url = $.type( item.url ) === "function" ? item.url.call( this, rez, params, obj ) : format( item.url, rez, params );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (type) {
|
||||
obj.href = url;
|
||||
obj.type = type;
|
||||
|
||||
obj.autoHeight = false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}(jQuery));
|
||||
+2032
File diff suppressed because it is too large
Load Diff
+4
File diff suppressed because one or more lines are too long
@@ -0,0 +1,12 @@
|
||||
/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
|
||||
* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
|
||||
* Thanks to: Seamus Leahy for adding deltaX and deltaY
|
||||
*
|
||||
* Version: 3.0.6
|
||||
*
|
||||
* Requires: 1.2.2+
|
||||
*/
|
||||
(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* RD-Google Map - v0.1
|
||||
* Easy as hell Google Map Api Jquery plugin.
|
||||
*
|
||||
* Made by Evgeniy Gusarov (Stmechanus || Diversant)
|
||||
*
|
||||
* Under MIT License
|
||||
*/
|
||||
|
||||
|
||||
;
|
||||
(function ($) {
|
||||
'use strict'
|
||||
|
||||
var def_settings = {
|
||||
cntClass: 'map',
|
||||
mapClass: 'map_model',
|
||||
locationsClass: 'map_locations',
|
||||
marker: {
|
||||
basic: 'images/gmap_marker.png',
|
||||
active: 'images/gmap_marker_active.png'
|
||||
},
|
||||
styles: []
|
||||
},
|
||||
|
||||
defaults = {
|
||||
map: {
|
||||
x: -73.9924068,
|
||||
y: 40.646197,
|
||||
zoom: 14
|
||||
},
|
||||
locations: []
|
||||
};
|
||||
|
||||
|
||||
var getLocations = function ($map, settings) {
|
||||
var $locations = $map.parent().find('.' + settings.locationsClass).find('li');
|
||||
|
||||
var locations = [];
|
||||
|
||||
|
||||
if ($locations.length > 0) {
|
||||
$locations.each(function (i) {
|
||||
var $loc = $(this);
|
||||
|
||||
if ($loc.data('x') && $loc.data('y')) {
|
||||
locations[i] = {
|
||||
x: $loc.data('x'),
|
||||
y: $loc.data('y'),
|
||||
basic: $loc.data('basic') ? $loc.data('basic') : settings.marker.basic,
|
||||
active: $loc.data('active') ? $loc.data('active') : settings.marker.active
|
||||
}
|
||||
|
||||
if (!$.trim($loc.html())) {
|
||||
locations[i].content = false;
|
||||
} else {
|
||||
locations[i].content = '<div class="iw-content">' + $loc.html() + '</div>';
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
return locations;
|
||||
}
|
||||
|
||||
$.fn.googleMap = function (settings) {
|
||||
|
||||
settings = $.extend(true, {}, def_settings, settings);
|
||||
|
||||
$(this).each(function () {
|
||||
var $this = $(this);
|
||||
|
||||
var options = $.extend(
|
||||
true, {}, defaults,
|
||||
{
|
||||
map: {
|
||||
x: $this.data('x'),
|
||||
y: $this.data('y'),
|
||||
zoom: $this.data('zoom')
|
||||
},
|
||||
locations: getLocations($this, settings)
|
||||
}
|
||||
);
|
||||
|
||||
var map = new google.maps.Map(this, {
|
||||
center: new google.maps.LatLng(
|
||||
parseFloat(options.map.y),
|
||||
parseFloat(options.map.x)
|
||||
),
|
||||
scrollwheel: false,
|
||||
styles: settings.styles,
|
||||
zoom: options.map.zoom
|
||||
}),
|
||||
infowindow = new google.maps.InfoWindow(),
|
||||
markers = [];
|
||||
|
||||
for (var i in options.locations) {
|
||||
markers[i] = new google.maps.Marker(
|
||||
{
|
||||
position: new google.maps.LatLng(
|
||||
parseFloat(options.locations[i].y),
|
||||
parseFloat(options.locations[i].x)),
|
||||
map: map,
|
||||
icon: options.locations[i].basic,
|
||||
index: i
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
if (options.locations[i].content) {
|
||||
google.maps.event.addListener(markers[i], 'click', function () {
|
||||
for (var j in markers) {
|
||||
markers[j].setIcon(options.locations[j].basic);
|
||||
}
|
||||
|
||||
infowindow.setContent(options.locations[this.index].content);
|
||||
infowindow.open(map, this);
|
||||
$('.gm-style-iw').parent().parent().addClass("gm-wrapper");
|
||||
this.setIcon(options.locations[this.index].active);
|
||||
});
|
||||
google.maps.event.addListener(infowindow, 'closeclick', function () {
|
||||
for (var j in markers) {
|
||||
markers[j].setIcon(options.locations[j].basic);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
google.maps.event.addDomListener(window, 'resize', function() {
|
||||
map.setCenter(new google.maps.LatLng(
|
||||
parseFloat(options.map.y),
|
||||
parseFloat(options.map.x)
|
||||
));
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* Author: Evgeniy Gusarov StMechanus (Diversant)
|
||||
* Under the MIT License
|
||||
*
|
||||
* Version: 1.0.1
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
;
|
||||
(function ($) {
|
||||
|
||||
var settings = {
|
||||
cntClass: 'rd-mobilemenu',
|
||||
menuClass: 'rd-mobilemenu_ul',
|
||||
submenuClass: 'rd-mobilemenu_submenu',
|
||||
panelClass: 'rd-mobilepanel',
|
||||
toggleClass: 'rd-mobilepanel_toggle',
|
||||
titleClass: 'rd-mobilepanel_title'
|
||||
},
|
||||
lastY, dir;
|
||||
|
||||
|
||||
var RDMobileMenu = function (element, options) {
|
||||
this.options = options;
|
||||
|
||||
this.$source = $(element);
|
||||
};
|
||||
|
||||
RDMobileMenu.prototype = {
|
||||
init: function () {
|
||||
var nav = this;
|
||||
nav.createDOM();
|
||||
nav.createListeners();
|
||||
},
|
||||
|
||||
createDOM: function () {
|
||||
var nav = this;
|
||||
|
||||
$('body')
|
||||
.append($('<div/>', {
|
||||
'class': settings.cntClass
|
||||
}).append(nav.createNavDOM()))
|
||||
.append($('<div/>', {
|
||||
'class': settings.panelClass
|
||||
})
|
||||
.append($('<button/>', {
|
||||
'class': settings.toggleClass
|
||||
}).append($('<span/>')))
|
||||
.append($('<h2/>', {
|
||||
'class': settings.titleClass,
|
||||
'text': document.title
|
||||
})));
|
||||
},
|
||||
|
||||
createNavDOM: function () {
|
||||
var nav = this;
|
||||
|
||||
var menu = $('<ul>', {'class': settings.menuClass});
|
||||
|
||||
var li = nav.$source.children();
|
||||
for (var i = 0; i < li.length; i++) {
|
||||
var o = li[i].children,
|
||||
item = null;
|
||||
for (var j = 0; j < o.length; j++) {
|
||||
if (o[j].tagName) {
|
||||
if (!item) {
|
||||
item = document.createElement('li');
|
||||
if (li[i].className.indexOf('active') > -1) {
|
||||
item.className = 'active';
|
||||
}
|
||||
}
|
||||
|
||||
switch (o[j].tagName.toLowerCase()) {
|
||||
case 'a':
|
||||
var link = o[j].cloneNode(true);
|
||||
item.appendChild(link);
|
||||
break;
|
||||
case 'ul':
|
||||
var submenu = o[j].cloneNode(true);
|
||||
submenu.className = settings.submenuClass;
|
||||
$(submenu).css({"display": "none"});
|
||||
item.appendChild(submenu);
|
||||
$(item).find('> a')
|
||||
.each(function () {
|
||||
$this = $(this);
|
||||
$this.addClass('rd-with-ul')
|
||||
.append($('<span/>', {class: 'rd-submenu-toggle'}))
|
||||
.find('.rd-submenu-toggle')
|
||||
.on('click', function (e) {
|
||||
e.preventDefault();
|
||||
$this = $(this).parent();
|
||||
|
||||
if ($this.hasClass('rd-with-ul') && !$this.hasClass('active')) {
|
||||
$('.rd-with-ul').removeClass('active');
|
||||
var submenu = $this.addClass('active').parent().find('.' + settings.submenuClass);
|
||||
submenu.stop().slideDown();
|
||||
$('.' + settings.submenuClass).not(submenu).stop().slideUp();
|
||||
} else {
|
||||
var submenu = $this.removeClass('active').parent().find('.' + settings.submenuClass);
|
||||
submenu.stop().slideUp();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item) {
|
||||
menu.append(item);
|
||||
}
|
||||
}
|
||||
|
||||
return menu;
|
||||
},
|
||||
|
||||
createListeners: function () {
|
||||
var nav = this;
|
||||
|
||||
nav.createToggleListener();
|
||||
nav.createResizeListener();
|
||||
},
|
||||
|
||||
createToggleListener: function () {
|
||||
var nav = this,
|
||||
type;
|
||||
|
||||
if (nav.isMobile()){
|
||||
type = 'touchstart';
|
||||
}else{
|
||||
type = 'click';
|
||||
}
|
||||
|
||||
$('body').delegate('.' + settings.toggleClass, type, function () {
|
||||
var o = $('.' + settings.cntClass);
|
||||
$(this).toggleClass('active');
|
||||
|
||||
if (o.hasClass('active')) {
|
||||
$(this).removeClass('active');
|
||||
o.removeClass('active');
|
||||
$('body').undelegate('*', 'mousewheel', nav.scroll);
|
||||
$('body').undelegate('*', 'touchmove', nav.scroll);
|
||||
$('body').undelegate('*', 'touchend', nav.touchend);
|
||||
$('body').undelegate('*', 'touchstart', nav.close);
|
||||
$('body').undelegate('*:not(.' + settings.toggleClass + ' span)', 'click', nav.close);
|
||||
} else {
|
||||
$(this).addClass('active');
|
||||
o.addClass('active');
|
||||
$('body').delegate('*', 'mousewheel', nav.scroll);
|
||||
$('body').delegate('*', 'touchmove', nav.scroll);
|
||||
$('body').delegate('*', 'touchend', nav.touchend);
|
||||
$('body').delegate('*', 'touchstart', {type: type}, nav.close);
|
||||
$('body').delegate('*:not(.' + settings.toggleClass + ' span)', 'click', {type: type}, nav.close);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
createResizeListener: function () {
|
||||
var nav = this;
|
||||
|
||||
$(window).on('resize', function () {
|
||||
var o = $('.' + settings.cntClass);
|
||||
|
||||
if (o.css('display') == 'none') {
|
||||
o.removeClass('active');
|
||||
$('.' + settings.toggleClass).removeClass('active');
|
||||
$('body').undelegate('*', 'mousewheel', nav.scroll);
|
||||
$('body').undelegate('*', 'touchmove', nav.scroll);
|
||||
$('body').undelegate('*', 'touchend', nav.touchend);
|
||||
$('body').undelegate('*', 'touchstart', nav.close);
|
||||
$('body').undelegate('*:not(.' + settings.toggleClass + ' span)', 'click', nav.close);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
scroll: function (e) {
|
||||
e.preventDefault();
|
||||
var menu = $('.' + settings.menuClass);
|
||||
|
||||
var x = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0].pageX : e.pageX,
|
||||
y = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0].pageY : e.pageY;
|
||||
|
||||
if (
|
||||
y > menu.offset().top &&
|
||||
y < (menu.offset().top + menu.outerHeight()) &&
|
||||
x > menu.offset().left &&
|
||||
x < (menu.offset().left + menu.outerWidth())
|
||||
) {
|
||||
var delta = 0;
|
||||
if (e.originalEvent.targetTouches) {
|
||||
if (!lastY) lastY = y;
|
||||
delta = (lastY - y);
|
||||
|
||||
lastY = y;
|
||||
dir = delta > 0;
|
||||
|
||||
} else {
|
||||
delta = (e.originalEvent.wheelDelta || -e.originalEvent.detail) * (-50)
|
||||
}
|
||||
|
||||
menu.stop().scrollTop(menu.scrollTop() + delta);
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
touchend: function (e) {
|
||||
var menu = $('.' + settings.menuClass);
|
||||
|
||||
menu.stop().animate({
|
||||
scrollTop: menu.scrollTop() + (dir ? 100 : -100)
|
||||
}, 3000, 'easeOutQuint');
|
||||
lastY = undefined;
|
||||
},
|
||||
|
||||
close: function (e) {
|
||||
if (!e.originalEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
var menu = $('.' + settings.menuClass);
|
||||
var x = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0].pageX : e.pageX,
|
||||
y = e.originalEvent.targetTouches ? e.originalEvent.targetTouches[0].pageY : e.pageY;
|
||||
|
||||
if (!(
|
||||
y > menu.offset().top &&
|
||||
y < (menu.offset().top + menu.outerHeight()) &&
|
||||
x > menu.offset().left &&
|
||||
x < (menu.offset().left + menu.outerWidth())
|
||||
)
|
||||
) {
|
||||
$('.' + settings.toggleClass).trigger(e.data.type);
|
||||
}
|
||||
},
|
||||
|
||||
isMobile: function () {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.rdparallax = function (option) {
|
||||
var o = this;
|
||||
if (o.length) {
|
||||
new RDMobileMenu(o[0]).init();
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
window.RDMobilemenu_autoinit = function (selector) {
|
||||
var o = $(selector);
|
||||
if (o.length) {
|
||||
new RDMobileMenu(o[0]).init();
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
RDMobilemenu_autoinit('[data-type="navbar"]');
|
||||
});
|
||||
@@ -0,0 +1,299 @@
|
||||
/*
|
||||
* Author: Evgeniy Gusarov StMechanus (Diversant)
|
||||
* Under the MIT License
|
||||
*
|
||||
* Version: 2.0.1
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
;
|
||||
(function ($) {
|
||||
|
||||
var RDParallax = function (element, options) {
|
||||
this.options = options;
|
||||
|
||||
this.settings = {
|
||||
'imageClass': 'parallax_image',
|
||||
'patternClass': 'parallax_pattern',
|
||||
'contentClass': 'parallax_cnt',
|
||||
'wrapClass': 'parallax'
|
||||
}
|
||||
|
||||
this.$wrap = $(element);
|
||||
|
||||
this.$image = $.noop();
|
||||
};
|
||||
|
||||
RDParallax.prototype = {
|
||||
init: function () {
|
||||
var parallax = this;
|
||||
parallax.isInit = true;
|
||||
parallax.createDOM();
|
||||
parallax.blur();
|
||||
parallax.createListeners();
|
||||
},
|
||||
|
||||
createDOM: function () {
|
||||
var parallax = this;
|
||||
|
||||
parallax
|
||||
.$wrap
|
||||
.addClass(parallax.settings.wrapClass)
|
||||
.wrapInner($('<div/>', {
|
||||
'class': parallax.settings.contentClass
|
||||
}))
|
||||
.prepend($('<div/>', {
|
||||
'class': (parallax.options.pattern ? parallax.settings.patternClass : parallax.settings.imageClass)
|
||||
}).css({
|
||||
'background-image': 'url(' + parallax.options.url + ')',
|
||||
'background-color': parallax.options.color
|
||||
}));
|
||||
|
||||
parallax.$image = parallax.options.pattern ? parallax.$wrap.find('.' + parallax.settings.patternClass) : parallax.$wrap.find('.' + parallax.settings.imageClass);
|
||||
},
|
||||
|
||||
createListeners: function () {
|
||||
this.createResizeListener();
|
||||
this.createScrollListener();
|
||||
},
|
||||
|
||||
createScrollListener: function () {
|
||||
var parallax = this;
|
||||
|
||||
if (parallax.isMobile()) {
|
||||
if (!parallax.options.mobile) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$(window).bind('touchstart', function () {
|
||||
parallax.isTouched = true;
|
||||
});
|
||||
|
||||
$(window).bind('touchend', function () {
|
||||
if(parallax.timer){
|
||||
clearTimeout(parallax.timer);
|
||||
}
|
||||
|
||||
parallax.timer = setTimeout(function () {
|
||||
parallax.isTouched = false;
|
||||
}, 1200);
|
||||
});
|
||||
|
||||
$(window).bind('scroll', function () {
|
||||
parallax.move();
|
||||
});
|
||||
parallax.move();
|
||||
},
|
||||
|
||||
createResizeListener: function () {
|
||||
var parallax = this;
|
||||
|
||||
if (parallax.isMobile()) {
|
||||
if (!parallax.options.mobile) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!parallax.isMobile()) {
|
||||
$(window).bind('resize', function () {
|
||||
parallax.resize();
|
||||
});
|
||||
}
|
||||
|
||||
$(window).bind('orientationchange', function () {
|
||||
setTimeout(function () {
|
||||
parallax.resize();
|
||||
}, 300);
|
||||
});
|
||||
|
||||
parallax.resize();
|
||||
},
|
||||
|
||||
move: function () {
|
||||
var parallax = this;
|
||||
|
||||
if (!parallax.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (parallax.isMobile()) {
|
||||
if (!parallax.options.mobile) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var st = $(window).scrollTop(),
|
||||
off = parallax.$wrap.offset().top,
|
||||
wh = $(window).height(),
|
||||
h = parallax.$wrap.outerHeight(),
|
||||
ph = parallax.$image.height();
|
||||
|
||||
var speed = parallax.options.speed;
|
||||
if (speed < 0) {
|
||||
speed = 0;
|
||||
}
|
||||
if (speed > 1) {
|
||||
speed = 1;
|
||||
}
|
||||
|
||||
var step = (st - (off - wh)) / ((off + h) - (off - wh)) * speed;
|
||||
|
||||
|
||||
if (parallax.options.direction == 'normal') {
|
||||
var pos = step * (h - ph);
|
||||
} else {
|
||||
var pos = (1 - step) * (h - ph);
|
||||
}
|
||||
|
||||
if (parallax.isIE() && parallax.ieVersion() <= 10) {
|
||||
parallax.$image.css('top', '' + pos + 'px');
|
||||
}
|
||||
else if (parallax.isMobile() && parallax.options.mobile) {
|
||||
if (parallax.isTouched || parallax.isInit) {
|
||||
parallax.$image.stop().animate({pos: pos}, {
|
||||
step: function (pos) {
|
||||
$(this).css('transform', 'translate3d(0, ' + pos + 'px, 0)');
|
||||
},
|
||||
duration: parallax.options.duration
|
||||
}, parallax.options.easing);
|
||||
|
||||
parallax.isInit = false;
|
||||
}
|
||||
} else {
|
||||
parallax.$image.css('transform', 'translate3d(0, ' + pos + 'px, 0)');
|
||||
}
|
||||
|
||||
if (parallax.isFirefox() && window.devicePixelRatio < 1){
|
||||
parallax.$image.css('background-color', '#010101');
|
||||
|
||||
setTimeout(function () {
|
||||
parallax.$image.css('background-color', parallax.options.color);
|
||||
}, 10);
|
||||
}
|
||||
},
|
||||
|
||||
resize: function () {
|
||||
var parallax = this,
|
||||
h = Math.max($(window).height(), 500);
|
||||
|
||||
if(h < parallax.$wrap.outerHeight()){
|
||||
h = parallax.$wrap.outerHeight() + $(window).height() * parallax.options.speed;
|
||||
}
|
||||
|
||||
parallax.$image.height(h);
|
||||
|
||||
setTimeout(function () {
|
||||
parallax.move();
|
||||
parallax.blur();
|
||||
}, 300);
|
||||
},
|
||||
|
||||
blur: function () {
|
||||
var parallax = this;
|
||||
|
||||
if (parallax.options.blur && !parallax.isIE() && !parallax.options.pattern) {
|
||||
|
||||
$('<img/>', {src: parallax.options.url}).load(function () {
|
||||
var dh = parallax.$image.height() / this.height,
|
||||
dw = parallax.$image.width() / this.width,
|
||||
blur = Math.floor(Math.max(dh, dw));
|
||||
|
||||
|
||||
if (blur > 2) {
|
||||
parallax.$image.css({
|
||||
'filter': 'blur(' + blur + 'px)',
|
||||
'-webkit-filter': 'blur(' + blur + 'px)'
|
||||
});
|
||||
} else {
|
||||
parallax.$image.css({
|
||||
'filter': 'blur(' + 0 + 'px)',
|
||||
'-webkit-filter': 'blur(' + 0 + 'px)'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
isVisible: function () {
|
||||
var parallax = this,
|
||||
|
||||
windowScroll = $(window).scrollTop(),
|
||||
windowHeight = $(window).height(),
|
||||
parallaxOffset = parallax.$wrap.offset().top,
|
||||
parallaxHeight = parallax.$wrap.outerHeight();
|
||||
|
||||
return (parallaxOffset + parallaxHeight >= windowScroll) && (parallaxOffset <= windowScroll + windowHeight)
|
||||
},
|
||||
|
||||
isIE: function () {
|
||||
if (navigator.appVersion.indexOf("MSIE") != -1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
isMobile: function () {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
|
||||
},
|
||||
|
||||
ieVersion: function () {
|
||||
return parseFloat(navigator.appVersion.split("MSIE")[1]);
|
||||
},
|
||||
|
||||
isFirefox: function () {
|
||||
return typeof InstallTrigger !== 'undefined'; // Firefox 1.0+
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.rdparallax = function (option) {
|
||||
var element = this.each(function () {
|
||||
var options = $.extend({}, $.fn.rdparallax.defaults, option);
|
||||
|
||||
if (options.url) {
|
||||
new RDParallax(this, options).init();
|
||||
} else {
|
||||
console.error('RD Parallax: data-url is not defined');
|
||||
}
|
||||
});
|
||||
return element;
|
||||
};
|
||||
|
||||
$.fn.rdparallax.defaults = {
|
||||
speed: 0.4,
|
||||
direction: 'normal',
|
||||
blur: false,
|
||||
mobile: false,
|
||||
url: false,
|
||||
pattern: false,
|
||||
duration: 200,
|
||||
easing: 'linear',
|
||||
color: 'inherit'
|
||||
};
|
||||
|
||||
window.RDParallax_autoinit = function (selector) {
|
||||
$(selector).each(function () {
|
||||
var options = $.extend({}, $.fn.rdparallax.defaults, {
|
||||
url: $(this).data('url'),
|
||||
speed: $(this).data('speed'),
|
||||
direction: $(this).data('direction'),
|
||||
blur: $(this).data('blur'),
|
||||
mobile: $(this).data('mobile'),
|
||||
pattern: $(this).data('pattern'),
|
||||
color: $(this).data('color')
|
||||
});
|
||||
|
||||
if (options.url) {
|
||||
new RDParallax(this, options).init();
|
||||
} else {
|
||||
console.error('RD Parallax: data-url is not defined');
|
||||
}
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
|
||||
$(document).ready(function () {
|
||||
RDParallax_autoinit('.parallax');
|
||||
});
|
||||
@@ -0,0 +1,54 @@
|
||||
/* jquery.simplr.smoothscroll version 1.0 copyright (c) 2012 https://github.com/simov/simplr-smoothscroll licensed under MIT */ ;
|
||||
(function (e) {
|
||||
"use strict";
|
||||
e.srSmoothscroll = function (t) {
|
||||
var platform = window.navigator.platform;
|
||||
if ((platform === 'MacIntel' || platform === 'MacPPC')) {
|
||||
return false
|
||||
};
|
||||
var n = e.extend({
|
||||
step: 170,
|
||||
speed: 1000,
|
||||
ease: "swing"
|
||||
}, t || {});
|
||||
var r = e(window),
|
||||
i = e(document),
|
||||
s = 0,
|
||||
o = n.step,
|
||||
u = n.speed,
|
||||
a = r.height(),
|
||||
f = navigator.userAgent.indexOf("AppleWebKit") !== -1 ? e("body") : e("html"),
|
||||
l = false,
|
||||
rdy = 0;
|
||||
e("body").mousewheel(function (e, t) {
|
||||
//Sidenav FIX
|
||||
var nav;
|
||||
if ((nav = $('.rd-mobilemenu')).length > 0) {
|
||||
if (nav.hasClass('active')) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//===========
|
||||
l = true;
|
||||
if (rdy == 0) {
|
||||
rdy = 1;
|
||||
if (t < 0) s = r.scrollTop() + o;
|
||||
else s = r.scrollTop() - o;
|
||||
} else {
|
||||
if (t < 0) s = s + a >= i.height() ? s : s += o;
|
||||
else s = s <= 0 ? 0 : s -= o;
|
||||
}
|
||||
f.stop().animate({
|
||||
scrollTop: s
|
||||
}, u, n.ease, function () {
|
||||
l = false
|
||||
});
|
||||
return false
|
||||
});
|
||||
r.on("resize", function (e) {
|
||||
a = r.height()
|
||||
}).on("scroll", function (e) {
|
||||
if (!l) s = r.scrollTop()
|
||||
})
|
||||
}
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,41 @@
|
||||
(function($){
|
||||
$.fn.UItoTop = function(options) {
|
||||
|
||||
var defaults = {
|
||||
text: '',
|
||||
min: 500,
|
||||
scrollSpeed: 800,
|
||||
containerID: 'toTop',
|
||||
containerClass: 'toTop fa fa-angle-up',
|
||||
easingType: 'linear'
|
||||
|
||||
};
|
||||
|
||||
var settings = $.extend(defaults, options);
|
||||
var containerIDhash = '#' + settings.containerID;
|
||||
var containerHoverIDHash = '#'+settings.containerHoverID;
|
||||
|
||||
$('body').append('<a href="#" id="'+settings.containerID+'" class="'+settings.containerClass+'" >'+settings.text+'</a>');
|
||||
|
||||
$(containerIDhash).hide().click(function(){
|
||||
$('html, body').stop().animate({scrollTop:0}, settings.scrollSpeed, settings.easingType);
|
||||
$('#'+settings.containerHoverID, this).stop().animate({'opacity': 0 }, settings.inDelay, settings.easingType);
|
||||
return false;
|
||||
})
|
||||
|
||||
|
||||
$(window).scroll(function() {
|
||||
var sd = $(window).scrollTop();
|
||||
if(typeof document.body.style.maxHeight === "undefined") {
|
||||
$(containerIDhash).css({
|
||||
'position': 'absolute',
|
||||
'top': $(window).scrollTop() + $(window).height() - 50
|
||||
});
|
||||
}
|
||||
if ( sd > settings.min )
|
||||
$(containerIDhash).stop(true,true).fadeIn(600);
|
||||
else
|
||||
$(containerIDhash).fadeOut(800);
|
||||
});
|
||||
};
|
||||
})(jQuery);
|
||||
@@ -0,0 +1,271 @@
|
||||
/* ========================================================================
|
||||
* Bootstrap: modal.js v3.1.1
|
||||
* http://getbootstrap.com/javascript/#modals
|
||||
* ========================================================================
|
||||
* Copyright 2011-2014 Twitter, Inc.
|
||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
||||
* ======================================================================== */
|
||||
|
||||
|
||||
+function ($) {
|
||||
'use strict';
|
||||
|
||||
// MODAL CLASS DEFINITION
|
||||
// ======================
|
||||
|
||||
var Modal = function (element, options) {
|
||||
this.options = options
|
||||
this.$body = $(document.body)
|
||||
this.$element = $(element)
|
||||
this.$backdrop =
|
||||
this.isShown = null
|
||||
this.scrollbarWidth = 0
|
||||
|
||||
if (this.options.remote) {
|
||||
this.$element
|
||||
.find('.modal-content')
|
||||
.load(this.options.remote, $.proxy(function () {
|
||||
this.$element.trigger('loaded.bs.modal')
|
||||
}, this))
|
||||
}
|
||||
}
|
||||
|
||||
Modal.DEFAULTS = {
|
||||
backdrop: true,
|
||||
keyboard: true,
|
||||
show: true
|
||||
}
|
||||
|
||||
Modal.prototype.toggle = function (_relatedTarget) {
|
||||
return this.isShown ? this.hide() : this.show(_relatedTarget)
|
||||
}
|
||||
|
||||
Modal.prototype.show = function (_relatedTarget) {
|
||||
var that = this
|
||||
var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = true
|
||||
|
||||
this.checkScrollbar()
|
||||
this.$body.addClass('modal-open')
|
||||
|
||||
this.setScrollbar()
|
||||
this.escape()
|
||||
|
||||
this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this))
|
||||
|
||||
this.backdrop(function () {
|
||||
var transition = $.support.transition && that.$element.hasClass('fade')
|
||||
|
||||
if (!that.$element.parent().length) {
|
||||
that.$element.appendTo(that.$body) // don't move modals dom position
|
||||
}
|
||||
|
||||
that.$element
|
||||
.show()
|
||||
.scrollTop(0)
|
||||
|
||||
if (transition) {
|
||||
that.$element[0].offsetWidth // force reflow
|
||||
}
|
||||
|
||||
that.$element
|
||||
.addClass('in')
|
||||
.attr('aria-hidden', false)
|
||||
|
||||
that.enforceFocus()
|
||||
|
||||
var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget })
|
||||
|
||||
transition ?
|
||||
that.$element.find('.modal-dialog') // wait for modal to slide in
|
||||
.one($.support.transition.end, function () {
|
||||
that.$element.trigger('focus').trigger(e)
|
||||
})
|
||||
.emulateTransitionEnd(300) :
|
||||
that.$element.trigger('focus').trigger(e)
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.hide = function (e) {
|
||||
if (e) e.preventDefault()
|
||||
|
||||
e = $.Event('hide.bs.modal')
|
||||
|
||||
this.$element.trigger(e)
|
||||
|
||||
if (!this.isShown || e.isDefaultPrevented()) return
|
||||
|
||||
this.isShown = false
|
||||
|
||||
this.$body.removeClass('modal-open')
|
||||
|
||||
this.resetScrollbar()
|
||||
this.escape()
|
||||
|
||||
$(document).off('focusin.bs.modal')
|
||||
|
||||
this.$element
|
||||
.removeClass('in')
|
||||
.attr('aria-hidden', true)
|
||||
.off('click.dismiss.bs.modal')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.$element
|
||||
.one($.support.transition.end, $.proxy(this.hideModal, this))
|
||||
.emulateTransitionEnd(300) :
|
||||
this.hideModal()
|
||||
}
|
||||
|
||||
Modal.prototype.enforceFocus = function () {
|
||||
$(document)
|
||||
.off('focusin.bs.modal') // guard against infinite focus loop
|
||||
.on('focusin.bs.modal', $.proxy(function (e) {
|
||||
if (this.$element[0] !== e.target && !this.$element.has(e.target).length) {
|
||||
this.$element.trigger('focus')
|
||||
}
|
||||
}, this))
|
||||
}
|
||||
|
||||
Modal.prototype.escape = function () {
|
||||
if (this.isShown && this.options.keyboard) {
|
||||
this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) {
|
||||
e.which == 27 && this.hide()
|
||||
}, this))
|
||||
} else if (!this.isShown) {
|
||||
this.$element.off('keyup.dismiss.bs.modal')
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.hideModal = function () {
|
||||
var that = this
|
||||
this.$element.hide()
|
||||
this.backdrop(function () {
|
||||
that.removeBackdrop()
|
||||
that.$element.trigger('hidden.bs.modal')
|
||||
})
|
||||
}
|
||||
|
||||
Modal.prototype.removeBackdrop = function () {
|
||||
this.$backdrop && this.$backdrop.remove()
|
||||
this.$backdrop = null
|
||||
}
|
||||
|
||||
Modal.prototype.backdrop = function (callback) {
|
||||
var animate = this.$element.hasClass('fade') ? 'fade' : ''
|
||||
|
||||
if (this.isShown && this.options.backdrop) {
|
||||
var doAnimate = $.support.transition && animate
|
||||
|
||||
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
|
||||
.appendTo(this.$body)
|
||||
|
||||
this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) {
|
||||
if (e.target !== e.currentTarget) return
|
||||
this.options.backdrop == 'static'
|
||||
? this.$element[0].focus.call(this.$element[0])
|
||||
: this.hide.call(this)
|
||||
}, this))
|
||||
|
||||
if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
|
||||
|
||||
this.$backdrop.addClass('in')
|
||||
|
||||
if (!callback) return
|
||||
|
||||
doAnimate ?
|
||||
this.$backdrop
|
||||
.one($.support.transition.end, callback)
|
||||
.emulateTransitionEnd(150) :
|
||||
callback()
|
||||
|
||||
} else if (!this.isShown && this.$backdrop) {
|
||||
this.$backdrop.removeClass('in')
|
||||
|
||||
$.support.transition && this.$element.hasClass('fade') ?
|
||||
this.$backdrop
|
||||
.one($.support.transition.end, callback)
|
||||
.emulateTransitionEnd(150) :
|
||||
callback()
|
||||
|
||||
} else if (callback) {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
Modal.prototype.checkScrollbar = function () {
|
||||
if (document.body.clientWidth >= window.innerWidth) return
|
||||
this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar()
|
||||
}
|
||||
|
||||
Modal.prototype.setScrollbar = function () {
|
||||
var bodyPad = parseInt(this.$body.css('padding-right') || 0)
|
||||
if (this.scrollbarWidth) this.$body.css('padding-right', bodyPad + this.scrollbarWidth)
|
||||
}
|
||||
|
||||
Modal.prototype.resetScrollbar = function () {
|
||||
this.$body.css('padding-right', '')
|
||||
}
|
||||
|
||||
Modal.prototype.measureScrollbar = function () { // thx walsh
|
||||
var scrollDiv = document.createElement('div')
|
||||
scrollDiv.className = 'modal-scrollbar-measure'
|
||||
this.$body.append(scrollDiv)
|
||||
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth
|
||||
this.$body[0].removeChild(scrollDiv)
|
||||
return scrollbarWidth
|
||||
}
|
||||
|
||||
|
||||
// MODAL PLUGIN DEFINITION
|
||||
// =======================
|
||||
|
||||
var old = $.fn.modal
|
||||
|
||||
$.fn.modal = function (option, _relatedTarget) {
|
||||
return this.each(function () {
|
||||
var $this = $(this)
|
||||
var data = $this.data('bs.modal')
|
||||
var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option)
|
||||
|
||||
if (!data) $this.data('bs.modal', (data = new Modal(this, options)))
|
||||
if (typeof option == 'string') data[option](_relatedTarget)
|
||||
else if (options.show) data.show(_relatedTarget)
|
||||
})
|
||||
}
|
||||
|
||||
$.fn.modal.Constructor = Modal
|
||||
|
||||
|
||||
// MODAL NO CONFLICT
|
||||
// =================
|
||||
|
||||
$.fn.modal.noConflict = function () {
|
||||
$.fn.modal = old
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
// MODAL DATA-API
|
||||
// ==============
|
||||
|
||||
$(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) {
|
||||
var $this = $(this)
|
||||
var href = $this.attr('href')
|
||||
var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
|
||||
var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data())
|
||||
|
||||
if ($this.is('a')) e.preventDefault()
|
||||
|
||||
$target
|
||||
.modal(option, this)
|
||||
.one('hide', function () {
|
||||
$this.is(':visible') && $this.trigger('focus')
|
||||
})
|
||||
})
|
||||
|
||||
}(jQuery);
|
||||
@@ -0,0 +1,72 @@
|
||||
/*
|
||||
* Pointer Events Polyfill: Adds support for the style attribute "pointer-events: none" to browsers without this feature (namely, IE).
|
||||
* (c) 2013, Kent Mewhort, licensed under BSD. See LICENSE.txt for details.
|
||||
*/
|
||||
|
||||
// constructor
|
||||
function PointerEventsPolyfill(options){
|
||||
// set defaults
|
||||
this.options = {
|
||||
selector: '*',
|
||||
mouseEvents: ['click','dblclick','mousedown','mouseup'],
|
||||
usePolyfillIf: function(){
|
||||
if(navigator.appName == 'Microsoft Internet Explorer')
|
||||
{
|
||||
var agent = navigator.userAgent;
|
||||
if (agent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/) != null){
|
||||
var version = parseFloat( RegExp.$1 );
|
||||
if(version < 11)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if(options){
|
||||
var obj = this;
|
||||
$.each(options, function(k,v){
|
||||
obj.options[k] = v;
|
||||
});
|
||||
}
|
||||
|
||||
if(this.options.usePolyfillIf())
|
||||
this.register_mouse_events();
|
||||
}
|
||||
|
||||
// singleton initializer
|
||||
PointerEventsPolyfill.initialize = function(options){
|
||||
if(PointerEventsPolyfill.singleton == null)
|
||||
PointerEventsPolyfill.singleton = new PointerEventsPolyfill(options);
|
||||
return PointerEventsPolyfill.singleton;
|
||||
};
|
||||
|
||||
// handle mouse events w/ support for pointer-events: none
|
||||
PointerEventsPolyfill.prototype.register_mouse_events = function(){
|
||||
// register on all elements (and all future elements) matching the selector
|
||||
$(document).on(this.options.mouseEvents.join(" "), this.options.selector, function(e){
|
||||
if($(this).css('pointer-events') == 'none'){
|
||||
// peak at the element below
|
||||
var origDisplayAttribute = $(this).css('display');
|
||||
$(this).css('display','none');
|
||||
|
||||
var underneathElem = document.elementFromPoint(e.clientX, e.clientY);
|
||||
|
||||
if(origDisplayAttribute)
|
||||
$(this)
|
||||
.css('display', origDisplayAttribute);
|
||||
else
|
||||
$(this).css('display','');
|
||||
|
||||
// fire the mouse event on the element below
|
||||
e.target = underneathElem;
|
||||
$(underneathElem).trigger(e);
|
||||
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
};
|
||||
|
||||
jQuery(document).ready(function(){
|
||||
PointerEventsPolyfill.initialize({});
|
||||
});
|
||||
@@ -0,0 +1,362 @@
|
||||
// Smooth scroll blocking
|
||||
document.addEventListener( 'DOMContentLoaded', function() {
|
||||
if ( 'onwheel' in document ) {
|
||||
window.onwheel = function( event ) {
|
||||
if( typeof( this.RDSmoothScroll ) !== undefined ) {
|
||||
try { window.removeEventListener( 'DOMMouseScroll', this.RDSmoothScroll.prototype.onWheel ); } catch( error ) {}
|
||||
event.stopPropagation();
|
||||
}
|
||||
};
|
||||
} else if ( 'onmousewheel' in document ) {
|
||||
window.onmousewheel= function( event ) {
|
||||
if( typeof( this.RDSmoothScroll ) !== undefined ) {
|
||||
try { window.removeEventListener( 'onmousewheel', this.RDSmoothScroll.prototype.onWheel ); } catch( error ) {}
|
||||
event.stopPropagation();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
try { $('body').unmousewheel(); } catch( error ) {}
|
||||
});
|
||||
|
||||
function include(scriptUrl) {
|
||||
document.write('<script src="' + scriptUrl + '"></script>');
|
||||
}
|
||||
|
||||
function isIE() {
|
||||
var myNav = navigator.userAgent.toLowerCase();
|
||||
return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
|
||||
};
|
||||
|
||||
/* cookie.JS
|
||||
========================================================*/
|
||||
include('js/jquery.cookie.js');
|
||||
|
||||
/* Easing library
|
||||
========================================================*/
|
||||
include('js/jquery.easing.1.3.js');
|
||||
|
||||
/* PointerEvents
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
if(isIE() && isIE() < 11){
|
||||
include('js/pointer-events.js');
|
||||
$('html').addClass('lt-ie11');
|
||||
$(document).ready(function(){
|
||||
PointerEventsPolyfill.initialize({});
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* Stick up menus
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('html');
|
||||
if (o.hasClass('desktop')) {
|
||||
include('js/tmstickup.js');
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#stuck_container').TMStickUp({})
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* ToTop
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('html');
|
||||
if (o.hasClass('desktop')) {
|
||||
include('js/jquery.ui.totop.js');
|
||||
|
||||
$(document).ready(function () {
|
||||
$().UItoTop({
|
||||
easingType: 'easeOutQuart',
|
||||
containerClass: 'toTop fa fa-angle-up'
|
||||
});
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* EqualHeights
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('[data-equal-group]');
|
||||
if (o.length > 0) {
|
||||
include('js/jquery.equalheights.js');
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* SMOOTH SCROLLIG
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('html');
|
||||
if (o.hasClass('desktop')) {
|
||||
include('js/jquery.mousewheel.min.js');
|
||||
include('js/jquery.simplr.smoothscroll.min.js');
|
||||
|
||||
$(document).ready(function () {
|
||||
$.srSmoothscroll({
|
||||
step: 150,
|
||||
speed: 800
|
||||
});
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* Copyright Year
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var currentYear = (new Date).getFullYear();
|
||||
$(document).ready(function () {
|
||||
$("#copyright-year").text((new Date).getFullYear());
|
||||
});
|
||||
})(jQuery);
|
||||
|
||||
|
||||
/* Superfish menus
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
include('js/superfish.js');
|
||||
})(jQuery);
|
||||
|
||||
/* Navbar
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
include('js/jquery.rd-navbar.js');
|
||||
})(jQuery);
|
||||
|
||||
/* Parallax
|
||||
=============================================*/
|
||||
;(function ($) {
|
||||
include('js/jquery.rd-parallax.js');
|
||||
})(jQuery);
|
||||
|
||||
/* FancyBox
|
||||
========================================================*/
|
||||
;(function ($) {
|
||||
var o = $('.thumb');
|
||||
if (o.length > 0) {
|
||||
include('js/jquery.fancybox.js');
|
||||
include('js/jquery.fancybox-media.js');
|
||||
include('js/jquery.fancybox-buttons.js');
|
||||
$(document).ready(function () {
|
||||
o.fancybox();
|
||||
});
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
|
||||
/* Google Map
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = document.getElementById("google-map");
|
||||
if (o) {
|
||||
include('//maps.google.com/maps/api/js?sensor=false');
|
||||
include('js/jquery.rd-google-map.js');
|
||||
|
||||
$(document).ready(function () {
|
||||
var o = $('#google-map');
|
||||
if (o.length > 0) {
|
||||
var styleArray = [
|
||||
{
|
||||
"featureType": "administrative",
|
||||
"elementType": "labels.text.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#444444"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "administrative.country",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
},
|
||||
{
|
||||
"color": "#fc6e6e"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "administrative.province",
|
||||
"elementType": "geometry.fill",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
},
|
||||
{
|
||||
"hue": "#008aff"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "landscape",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#f2f2f2"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "poi",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"saturation": -100
|
||||
},
|
||||
{
|
||||
"lightness": 45
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.highway",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "simplified"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "road.arterial",
|
||||
"elementType": "labels.icon",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "transit",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"visibility": "off"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"featureType": "water",
|
||||
"elementType": "all",
|
||||
"stylers": [
|
||||
{
|
||||
"color": "#bee0ee"
|
||||
},
|
||||
{
|
||||
"visibility": "on"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
o.googleMap({
|
||||
styles: styleArray,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
(jQuery);
|
||||
|
||||
/* WOW
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('html');
|
||||
|
||||
if ((navigator.userAgent.toLowerCase().indexOf('msie') == -1 ) || (isIE() && isIE() > 9)) {
|
||||
if (o.hasClass('desktop')) {
|
||||
include('js/wow.js');
|
||||
|
||||
$(document).ready(function () {
|
||||
new WOW().init();
|
||||
});
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* Contact Form
|
||||
========================================================*/
|
||||
;
|
||||
(function ($) {
|
||||
var o = $('#contact-form');
|
||||
if (o.length > 0) {
|
||||
include('js/modal.js');
|
||||
include('js/TMForm.js');
|
||||
|
||||
if($('#contact-form .recaptcha').length > 0){
|
||||
include('//www.google.com/recaptcha/api/js/recaptcha_ajax.js');
|
||||
}
|
||||
}
|
||||
})(jQuery);
|
||||
|
||||
/* Orientation tablet fix
|
||||
========================================================*/
|
||||
$(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();
|
||||
// Menu Android
|
||||
if (window.orientation != undefined) {
|
||||
var regM = /ipod|ipad|iphone/gi,
|
||||
result = ua.match(regM);
|
||||
if (!result) {
|
||||
$('.sf-menus li').each(function () {
|
||||
if ($(">ul", this)[0]) {
|
||||
$(">a", this).toggle(
|
||||
function () {
|
||||
return false;
|
||||
},
|
||||
function () {
|
||||
window.location.href = $(this).attr("href");
|
||||
}
|
||||
);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
var ua = navigator.userAgent.toLocaleLowerCase(),
|
||||
regV = /ipod|ipad|iphone/gi,
|
||||
result = ua.match(regV),
|
||||
userScale = "";
|
||||
if (!result) {
|
||||
userScale = ",user-scalable=0"
|
||||
}
|
||||
document.write('<meta name="viewport" content="width=device-width,initial-scale=1.0' + userScale + '">');
|
||||
|
||||
@@ -0,0 +1,314 @@
|
||||
/*
|
||||
* jQuery Superfish Menu Plugin - v1.7.4
|
||||
* Copyright (c) 2013 Joel Birch
|
||||
*
|
||||
* Dual licensed under the MIT and GPL licenses:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
* http://www.gnu.org/licenses/gpl.html
|
||||
*/
|
||||
|
||||
(function ($, window) {
|
||||
"use strict";
|
||||
|
||||
var methods = (function () {
|
||||
// private properties and methods go here
|
||||
var c = {
|
||||
bcClass: 'sf-breadcrumb',
|
||||
menuClass: 'sf-js-enabled',
|
||||
anchorClass: 'sf-with-ul',
|
||||
menuArrowClass: 'sf-arrows'
|
||||
},
|
||||
ios = (function () {
|
||||
var ios = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||
if (ios) {
|
||||
// iOS clicks only bubble as far as body children
|
||||
$(window).load(function () {
|
||||
$('body').children().on('click', $.noop);
|
||||
});
|
||||
}
|
||||
return ios;
|
||||
})(),
|
||||
wp7 = (function () {
|
||||
var style = document.documentElement.style;
|
||||
return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent));
|
||||
})(),
|
||||
toggleMenuClasses = function ($menu, o) {
|
||||
var classes = c.menuClass;
|
||||
if (o.cssArrows) {
|
||||
classes += ' ' + c.menuArrowClass;
|
||||
}
|
||||
$menu.toggleClass(classes);
|
||||
},
|
||||
setPathToCurrent = function ($menu, o) {
|
||||
return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels)
|
||||
.addClass(o.hoverClass + ' ' + c.bcClass)
|
||||
.filter(function () {
|
||||
return ($(this).children(o.popUpSelector).hide().show().length);
|
||||
}).removeClass(o.pathClass);
|
||||
},
|
||||
toggleAnchorClass = function ($li) {
|
||||
$li.children('a').toggleClass(c.anchorClass);
|
||||
},
|
||||
toggleTouchAction = function ($menu) {
|
||||
var touchAction = $menu.css('ms-touch-action');
|
||||
touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y';
|
||||
$menu.css('ms-touch-action', touchAction);
|
||||
},
|
||||
applyHandlers = function ($menu, o) {
|
||||
var targets = 'li:has(' + o.popUpSelector + ')';
|
||||
if ($.fn.hoverIntent && !o.disableHI) {
|
||||
$menu.hoverIntent(over, out, targets);
|
||||
}
|
||||
else {
|
||||
$menu
|
||||
.on('mouseenter.superfish', targets, over)
|
||||
.on('mouseleave.superfish', targets, out);
|
||||
}
|
||||
var touchevent = 'MSPointerDown.superfish';
|
||||
if (!ios) {
|
||||
touchevent += ' touchend.superfish';
|
||||
}
|
||||
if (wp7) {
|
||||
touchevent += ' mousedown.superfish';
|
||||
}
|
||||
$menu
|
||||
.on('focusin.superfish', 'li', over)
|
||||
.on('focusout.superfish', 'li', out)
|
||||
.on(touchevent, 'a', o, touchHandler);
|
||||
},
|
||||
touchHandler = function (e) {
|
||||
var $this = $(this),
|
||||
$ul = $this.siblings(e.data.popUpSelector);
|
||||
|
||||
if ($ul.length > 0 && $ul.is(':hidden')) {
|
||||
$this.one('click.superfish', false);
|
||||
if (e.type === 'MSPointerDown') {
|
||||
$this.trigger('focus');
|
||||
} else {
|
||||
$.proxy(over, $this.parent('li'))();
|
||||
}
|
||||
}
|
||||
},
|
||||
over = function () {
|
||||
var $this = $(this),
|
||||
o = getOptions($this);
|
||||
clearTimeout(o.sfTimer);
|
||||
|
||||
$this.siblings().superfish('hide').end().superfish('show');
|
||||
},
|
||||
out = function () {
|
||||
var $this = $(this),
|
||||
o = getOptions($this);
|
||||
if (ios) {
|
||||
$.proxy(close, $this, o)();
|
||||
}
|
||||
else {
|
||||
clearTimeout(o.sfTimer);
|
||||
o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay);
|
||||
}
|
||||
|
||||
},
|
||||
close = function (o) {
|
||||
o.retainPath = ($.inArray(this[0], o.$path) > -1);
|
||||
|
||||
this.superfish('hide');
|
||||
|
||||
if (!this.parents('.' + o.hoverClass).length) {
|
||||
o.onIdle.call(getMenu(this));
|
||||
if (o.$path.length) {
|
||||
$.proxy(over, o.$path)();
|
||||
}
|
||||
}
|
||||
},
|
||||
getMenu = function ($el) {
|
||||
return $el.closest('.' + c.menuClass);
|
||||
},
|
||||
getOptions = function ($el) {
|
||||
return getMenu($el).data('sf-options');
|
||||
},
|
||||
resizeBg = function () {
|
||||
if ($(window).width() > 767 && $.fn.superfish.defaults.fakeBg ) {
|
||||
var page = $($.fn.superfish.defaults.fakeBgLimiter);
|
||||
var obj = $('.sub-menu');
|
||||
|
||||
var offset = $(page).offset();
|
||||
|
||||
var x = offset.left;
|
||||
var x1 = $(obj).offset().left;
|
||||
var width = $(page).width();
|
||||
|
||||
$('.fake-bg').css(
|
||||
{
|
||||
left: (x - x1),
|
||||
width: width
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
// public methods
|
||||
hide: function (instant) {
|
||||
if (this.length) {
|
||||
var $this = this,
|
||||
o = getOptions($this);
|
||||
if (!o) {
|
||||
return this;
|
||||
}
|
||||
var not = (o.retainPath === true) ? o.$path : '',
|
||||
$ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector),
|
||||
speed = o.speedOut;
|
||||
|
||||
if (instant) {
|
||||
$ul.show();
|
||||
speed = 0;
|
||||
}
|
||||
o.retainPath = false;
|
||||
o.onBeforeHide.call($ul);
|
||||
|
||||
$ul.children('li').css({opacity: 0});
|
||||
|
||||
$ul.stop(true, true).animate(o.animationOut, {
|
||||
duration: speed,
|
||||
complete: function () {
|
||||
var $this = $(this);
|
||||
o.onHide.call($this);
|
||||
}
|
||||
});
|
||||
}
|
||||
return this;
|
||||
},
|
||||
show: function () {
|
||||
var o = getOptions(this);
|
||||
if (!o) {
|
||||
return this;
|
||||
}
|
||||
var $this = this.addClass(o.hoverClass),
|
||||
$ul = $this.children(o.popUpSelector);
|
||||
|
||||
o.onBeforeShow.call($ul);
|
||||
|
||||
$ul.stop(true, true).animate(o.animation, {
|
||||
duration: o.speed,
|
||||
step: function () {
|
||||
if ($(this).css('display') != 'none') {
|
||||
resizeBg();
|
||||
}
|
||||
},
|
||||
complete: function () {
|
||||
o.onShow.call($ul);
|
||||
$ul.children('li').animate({opacity: 1}, 'normal');
|
||||
}
|
||||
});
|
||||
return this;
|
||||
},
|
||||
destroy: function () {
|
||||
return this.each(function () {
|
||||
var $this = $(this),
|
||||
o = $this.data('sf-options'),
|
||||
$hasPopUp;
|
||||
if (!o) {
|
||||
return false;
|
||||
}
|
||||
$hasPopUp = $this.find(o.popUpSelector).parent('li');
|
||||
clearTimeout(o.sfTimer);
|
||||
toggleMenuClasses($this, o);
|
||||
toggleAnchorClass($hasPopUp);
|
||||
toggleTouchAction($this);
|
||||
// remove event handlers
|
||||
$this.off('.superfish').off('.hoverIntent');
|
||||
// clear animation's inline display style
|
||||
$hasPopUp.children(o.popUpSelector).attr('style', function (i, style) {
|
||||
return style.replace(/display[^;]+;?/g, '');
|
||||
});
|
||||
// reset 'current' path classes
|
||||
o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass);
|
||||
$this.find('.' + o.hoverClass).removeClass(o.hoverClass);
|
||||
o.onDestroy.call($this);
|
||||
$this.removeData('sf-options');
|
||||
});
|
||||
},
|
||||
init: function (op) {
|
||||
if ($.fn.superfish.defaults.fakeBg) {
|
||||
$(window).on('resize', resizeBg);
|
||||
$(window).on('orientationchange', resizeBg);
|
||||
|
||||
$('.sub-menu').prepend('<div class="fake-bg"></div>');
|
||||
|
||||
resizeBg();
|
||||
}
|
||||
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
if ($this.data('sf-options')) {
|
||||
return false;
|
||||
}
|
||||
var o = $.extend({}, $.fn.superfish.defaults, op),
|
||||
$hasPopUp = $this.find(o.popUpSelector).parent('li');
|
||||
o.$path = setPathToCurrent($this, o);
|
||||
|
||||
$this.data('sf-options', o);
|
||||
|
||||
toggleMenuClasses($this, o);
|
||||
toggleAnchorClass($hasPopUp);
|
||||
toggleTouchAction($this);
|
||||
applyHandlers($this, o);
|
||||
|
||||
$hasPopUp.not('.' + c.bcClass).superfish('hide', true);
|
||||
|
||||
o.onInit.call(this);
|
||||
});
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
$.fn.superfish = function (method, args) {
|
||||
if (methods[method]) {
|
||||
return methods[method].apply(this, Array.prototype.slice.call(arguments, 1));
|
||||
}
|
||||
else if (typeof method === 'object' || !method) {
|
||||
|
||||
return methods.init.apply(this, arguments);
|
||||
}
|
||||
else {
|
||||
return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish');
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.superfish.defaults = {
|
||||
popUpSelector: 'ul,.sf-mega', // within menus context
|
||||
hoverClass: 'sfHover',
|
||||
pathClass: 'overrideThisToUse',
|
||||
fakeBg: false,
|
||||
fakeBgLimiter: '.page',
|
||||
pathLevels: 1,
|
||||
delay: 800,
|
||||
animation: {height: 'show'},
|
||||
animationOut: {height: 'hide'},
|
||||
speed: 'normal',
|
||||
speedOut: 'fast',
|
||||
cssArrows: true,
|
||||
disableHI: false,
|
||||
onInit: $.noop,
|
||||
onBeforeShow: $.noop,
|
||||
onShow: $.noop,
|
||||
onBeforeHide: $.noop,
|
||||
onHide: $.noop,
|
||||
onIdle: $.noop,
|
||||
onDestroy: $.noop
|
||||
};
|
||||
|
||||
// soon to be deprecated
|
||||
$.fn.extend({
|
||||
hideSuperfishUl: methods.hide,
|
||||
showSuperfishUl: methods.show
|
||||
});
|
||||
|
||||
})(jQuery, window);
|
||||
|
||||
|
||||
$(window).load(function () {
|
||||
$('.sf-menu').superfish();
|
||||
});
|
||||
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
(function($,undefined){
|
||||
var
|
||||
def={
|
||||
stuckClass:'isStuck'
|
||||
}
|
||||
,doc=$(document),anim = false;
|
||||
|
||||
$.fn.TMStickUp=function(opt){
|
||||
opt=$.extend(true,{},def,opt)
|
||||
|
||||
$(this).each(function(){
|
||||
var $this=$(this)
|
||||
,posY//=$this.offset().top+$this.outerHeight()
|
||||
,isStuck=false
|
||||
,clone=$this.clone().appendTo($this.parent()).addClass(opt.stuckClass)
|
||||
,height//=$this.outerHeight()
|
||||
,stuckedHeight=clone.outerHeight()
|
||||
,opened//=$.cookie&&$.cookie('panel1')==='opened'
|
||||
,tmr
|
||||
|
||||
$(window).resize(function(){
|
||||
clearTimeout(tmr)
|
||||
clone.css({top:isStuck?0:-stuckedHeight,visibility:isStuck?'visible':'hidden'})
|
||||
tmr=setTimeout(function(){
|
||||
posY=$this.offset().top//+$this.outerHeight()
|
||||
height=$this.outerHeight()
|
||||
stuckedHeight=clone.outerHeight()
|
||||
opened=$.cookie&&$.cookie('panel1')==='opened'
|
||||
|
||||
clone.css({top:isStuck?0:-stuckedHeight})
|
||||
},40)
|
||||
}).resize()
|
||||
|
||||
clone.css({
|
||||
position:'fixed'
|
||||
,width:'100%'
|
||||
})
|
||||
|
||||
$this
|
||||
.on('rePosition',function(e,d){
|
||||
if(isStuck)
|
||||
clone.animate({marginTop:d},{easing:'linear'})
|
||||
if(d===0)
|
||||
opened=false
|
||||
else
|
||||
opened=true
|
||||
})
|
||||
|
||||
doc
|
||||
.on('scroll',function(){
|
||||
var scrollTop=doc.scrollTop()
|
||||
|
||||
if(scrollTop>=posY&&!isStuck){
|
||||
clone
|
||||
.stop()
|
||||
.css({visibility:'visible'})
|
||||
.animate({
|
||||
top:0
|
||||
,marginTop:opened?50:0
|
||||
},{
|
||||
|
||||
})
|
||||
|
||||
isStuck=true
|
||||
}
|
||||
|
||||
if(scrollTop<posY+height&&isStuck){
|
||||
$('.sf-menu ul').css('display', 'none');
|
||||
|
||||
var sf = $('.search-form');
|
||||
if(sf.length > 0){
|
||||
sf.find('input').blur();
|
||||
}
|
||||
|
||||
clone
|
||||
.stop()
|
||||
.animate({
|
||||
top:-stuckedHeight
|
||||
,marginTop:0
|
||||
},{
|
||||
duration:200
|
||||
,complete:function(){
|
||||
clone.css({visibility:'hidden'})
|
||||
}
|
||||
});
|
||||
|
||||
isStuck=false;
|
||||
|
||||
}
|
||||
})
|
||||
.trigger('scroll')
|
||||
})
|
||||
}
|
||||
})(jQuery)
|
||||
@@ -0,0 +1,388 @@
|
||||
(function() {
|
||||
var MutationObserver, Util, WeakMap,
|
||||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
||||
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
|
||||
|
||||
Util = (function() {
|
||||
function Util() {}
|
||||
|
||||
Util.prototype.extend = function(custom, defaults) {
|
||||
var key, value;
|
||||
for (key in custom) {
|
||||
value = custom[key];
|
||||
if (value != null) {
|
||||
defaults[key] = value;
|
||||
}
|
||||
}
|
||||
return defaults;
|
||||
};
|
||||
|
||||
Util.prototype.isMobile = function(agent) {
|
||||
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(agent);
|
||||
};
|
||||
|
||||
return Util;
|
||||
|
||||
})();
|
||||
|
||||
WeakMap = this.WeakMap || this.MozWeakMap || (WeakMap = (function() {
|
||||
function WeakMap() {
|
||||
this.keys = [];
|
||||
this.values = [];
|
||||
}
|
||||
|
||||
WeakMap.prototype.get = function(key) {
|
||||
var i, item, _i, _len, _ref;
|
||||
_ref = this.keys;
|
||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||
item = _ref[i];
|
||||
if (item === key) {
|
||||
return this.values[i];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WeakMap.prototype.set = function(key, value) {
|
||||
var i, item, _i, _len, _ref;
|
||||
_ref = this.keys;
|
||||
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
|
||||
item = _ref[i];
|
||||
if (item === key) {
|
||||
this.values[i] = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
this.keys.push(key);
|
||||
return this.values.push(value);
|
||||
};
|
||||
|
||||
return WeakMap;
|
||||
|
||||
})());
|
||||
|
||||
MutationObserver = this.MutationObserver || this.WebkitMutationObserver || this.MozMutationObserver || (MutationObserver = (function() {
|
||||
function MutationObserver() {
|
||||
console.warn('MutationObserver is not supported by your browser.');
|
||||
console.warn('WOW.js cannot detect dom mutations, please call .sync() after loading new content.');
|
||||
}
|
||||
|
||||
MutationObserver.notSupported = true;
|
||||
|
||||
MutationObserver.prototype.observe = function() {};
|
||||
|
||||
return MutationObserver;
|
||||
|
||||
})());
|
||||
|
||||
this.WOW = (function() {
|
||||
WOW.prototype.defaults = {
|
||||
boxClass: 'wow',
|
||||
animateClass: 'animated',
|
||||
offset: 0,
|
||||
mobile: true,
|
||||
live: true
|
||||
};
|
||||
|
||||
function WOW(options) {
|
||||
if (options == null) {
|
||||
options = {};
|
||||
}
|
||||
this.scrollCallback = __bind(this.scrollCallback, this);
|
||||
this.scrollHandler = __bind(this.scrollHandler, this);
|
||||
this.start = __bind(this.start, this);
|
||||
this.scrolled = true;
|
||||
this.config = this.util().extend(options, this.defaults);
|
||||
this.animationNameCache = new WeakMap();
|
||||
}
|
||||
|
||||
WOW.prototype.init = function() {
|
||||
var _ref;
|
||||
this.element = window.document.documentElement;
|
||||
if ((_ref = document.readyState) === "interactive" || _ref === "complete") {
|
||||
this.start();
|
||||
} else {
|
||||
document.addEventListener('DOMContentLoaded', this.start);
|
||||
}
|
||||
return this.finished = [];
|
||||
};
|
||||
|
||||
WOW.prototype.start = function() {
|
||||
var box, _i, _len, _ref;
|
||||
this.stopped = false;
|
||||
this.boxes = this.element.getElementsByClassName(this.config.boxClass);
|
||||
this.all = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (this.boxes.length) {
|
||||
if (this.disabled()) {
|
||||
this.resetStyle();
|
||||
} else {
|
||||
_ref = this.boxes;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
this.applyStyle(box, true);
|
||||
}
|
||||
window.addEventListener('scroll', this.scrollHandler, false);
|
||||
window.addEventListener('resize', this.scrollHandler, false);
|
||||
this.interval = setInterval(this.scrollCallback, 50);
|
||||
}
|
||||
}
|
||||
if (this.config.live) {
|
||||
return new MutationObserver((function(_this) {
|
||||
return function(records) {
|
||||
var node, record, _j, _len1, _results;
|
||||
_results = [];
|
||||
for (_j = 0, _len1 = records.length; _j < _len1; _j++) {
|
||||
record = records[_j];
|
||||
_results.push((function() {
|
||||
var _k, _len2, _ref1, _results1;
|
||||
_ref1 = record.addedNodes || [];
|
||||
_results1 = [];
|
||||
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) {
|
||||
node = _ref1[_k];
|
||||
_results1.push(this.doSync(node));
|
||||
}
|
||||
return _results1;
|
||||
}).call(_this));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
})(this)).observe(document.body, {
|
||||
childList: true,
|
||||
subtree: true
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.stop = function() {
|
||||
this.stopped = true;
|
||||
window.removeEventListener('scroll', this.scrollHandler, false);
|
||||
window.removeEventListener('resize', this.scrollHandler, false);
|
||||
if (this.interval != null) {
|
||||
return clearInterval(this.interval);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.sync = function(element) {
|
||||
if (MutationObserver.notSupported) {
|
||||
return this.doSync(this.element);
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.doSync = function(element) {
|
||||
var box, _i, _len, _ref, _results;
|
||||
if (!this.stopped) {
|
||||
element || (element = this.element);
|
||||
element = element.parentNode || element;
|
||||
_ref = element.getElementsByClassName(this.config.boxClass);
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
if (__indexOf.call(this.all, box) < 0) {
|
||||
this.applyStyle(box, true);
|
||||
this.boxes.push(box);
|
||||
this.all.push(box);
|
||||
_results.push(this.scrolled = true);
|
||||
} else {
|
||||
_results.push(void 0);
|
||||
}
|
||||
}
|
||||
return _results;
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.show = function(box) {
|
||||
this.applyStyle(box);
|
||||
return box.className = "" + box.className + " " + this.config.animateClass;
|
||||
};
|
||||
|
||||
WOW.prototype.applyStyle = function(box, hidden) {
|
||||
var delay, duration, iteration;
|
||||
duration = box.getAttribute('data-wow-duration');
|
||||
delay = box.getAttribute('data-wow-delay');
|
||||
iteration = box.getAttribute('data-wow-iteration');
|
||||
return this.animate((function(_this) {
|
||||
return function() {
|
||||
return _this.customStyle(box, hidden, duration, delay, iteration);
|
||||
};
|
||||
})(this));
|
||||
};
|
||||
|
||||
WOW.prototype.animate = (function() {
|
||||
if ('requestAnimationFrame' in window) {
|
||||
return function(callback) {
|
||||
return window.requestAnimationFrame(callback);
|
||||
};
|
||||
} else {
|
||||
return function(callback) {
|
||||
return callback();
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
||||
WOW.prototype.resetStyle = function() {
|
||||
var box, _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
_results.push(box.setAttribute('style', 'visibility: visible;'));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
WOW.prototype.customStyle = function(box, hidden, duration, delay, iteration) {
|
||||
if (hidden) {
|
||||
this.cacheAnimationName(box);
|
||||
}
|
||||
box.style.visibility = hidden ? 'hidden' : 'visible';
|
||||
if (duration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDuration: duration
|
||||
});
|
||||
}
|
||||
if (delay) {
|
||||
this.vendorSet(box.style, {
|
||||
animationDelay: delay
|
||||
});
|
||||
}
|
||||
if (iteration) {
|
||||
this.vendorSet(box.style, {
|
||||
animationIterationCount: iteration
|
||||
});
|
||||
}
|
||||
this.vendorSet(box.style, {
|
||||
animationName: hidden ? 'none' : this.cachedAnimationName(box)
|
||||
});
|
||||
return box;
|
||||
};
|
||||
|
||||
WOW.prototype.vendors = ["moz", "webkit"];
|
||||
|
||||
WOW.prototype.vendorSet = function(elem, properties) {
|
||||
var name, value, vendor, _results;
|
||||
_results = [];
|
||||
for (name in properties) {
|
||||
value = properties[name];
|
||||
elem["" + name] = value;
|
||||
_results.push((function() {
|
||||
var _i, _len, _ref, _results1;
|
||||
_ref = this.vendors;
|
||||
_results1 = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
vendor = _ref[_i];
|
||||
_results1.push(elem["" + vendor + (name.charAt(0).toUpperCase()) + (name.substr(1))] = value);
|
||||
}
|
||||
return _results1;
|
||||
}).call(this));
|
||||
}
|
||||
return _results;
|
||||
};
|
||||
|
||||
WOW.prototype.vendorCSS = function(elem, property) {
|
||||
var result, style, vendor, _i, _len, _ref;
|
||||
style = window.getComputedStyle(elem);
|
||||
result = style.getPropertyCSSValue(property);
|
||||
_ref = this.vendors;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
vendor = _ref[_i];
|
||||
result = result || style.getPropertyCSSValue("-" + vendor + "-" + property);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
|
||||
WOW.prototype.animationName = function(box) {
|
||||
var animationName;
|
||||
try {
|
||||
animationName = this.vendorCSS(box, 'animation-name').cssText;
|
||||
} catch (_error) {
|
||||
animationName = window.getComputedStyle(box).getPropertyValue('animation-name');
|
||||
}
|
||||
if (animationName === 'none') {
|
||||
return '';
|
||||
} else {
|
||||
return animationName;
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.cacheAnimationName = function(box) {
|
||||
return this.animationNameCache.set(box, this.animationName(box));
|
||||
};
|
||||
|
||||
WOW.prototype.cachedAnimationName = function(box) {
|
||||
return this.animationNameCache.get(box);
|
||||
};
|
||||
|
||||
WOW.prototype.scrollHandler = function() {
|
||||
return this.scrolled = true;
|
||||
};
|
||||
|
||||
WOW.prototype.scrollCallback = function() {
|
||||
var box;
|
||||
if (this.scrolled) {
|
||||
this.scrolled = false;
|
||||
this.boxes = (function() {
|
||||
var _i, _len, _ref, _results;
|
||||
_ref = this.boxes;
|
||||
_results = [];
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
box = _ref[_i];
|
||||
if (!(box)) {
|
||||
continue;
|
||||
}
|
||||
if (this.isVisible(box)) {
|
||||
this.show(box);
|
||||
continue;
|
||||
}
|
||||
_results.push(box);
|
||||
}
|
||||
return _results;
|
||||
}).call(this);
|
||||
if (!(this.boxes.length || this.config.live)) {
|
||||
return this.stop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WOW.prototype.offsetTop = function(element) {
|
||||
var top;
|
||||
while (element.offsetTop === void 0) {
|
||||
element = element.parentNode;
|
||||
}
|
||||
top = element.offsetTop;
|
||||
while (element = element.offsetParent) {
|
||||
top += element.offsetTop;
|
||||
}
|
||||
return top;
|
||||
};
|
||||
|
||||
WOW.prototype.isVisible = function(box) {
|
||||
var bottom, offset, top, viewBottom, viewTop;
|
||||
offset = box.getAttribute('data-wow-offset') || this.config.offset;
|
||||
viewTop = window.pageYOffset;
|
||||
viewBottom = viewTop + this.element.clientHeight - offset;
|
||||
top = this.offsetTop(box);
|
||||
bottom = top + box.clientHeight;
|
||||
return top <= viewBottom && bottom >= viewTop;
|
||||
};
|
||||
|
||||
WOW.prototype.util = function() {
|
||||
return this._util || (this._util = new Util());
|
||||
};
|
||||
|
||||
WOW.prototype.disabled = function() {
|
||||
return !this.config.mobile && this.util().isMobile(navigator.userAgent);
|
||||
};
|
||||
|
||||
return WOW;
|
||||
|
||||
})();
|
||||
|
||||
}).call(this);
|
||||
Reference in New Issue
Block a user