Initial import: eendoe website and apache vhosts
This commit is contained in:
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,49 @@
|
||||
|
||||
var google;
|
||||
|
||||
function init() {
|
||||
// Basic options for a simple Google Map
|
||||
// For more options see: https://developers.google.com/maps/documentation/javascript/reference#MapOptions
|
||||
// var myLatlng = new google.maps.LatLng(40.71751, -73.990922);
|
||||
var myLatlng = new google.maps.LatLng(40.69847032728747, -73.9514422416687);
|
||||
// 39.399872
|
||||
// -8.224454
|
||||
|
||||
var mapOptions = {
|
||||
// How zoomed in you want the map to start at (always required)
|
||||
zoom: 7,
|
||||
|
||||
// The latitude and longitude to center the map (always required)
|
||||
center: myLatlng,
|
||||
|
||||
// How you would like to style the map.
|
||||
scrollwheel: false,
|
||||
styles: [{"featureType":"administrative.land_parcel","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"landscape.man_made","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"poi","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road","elementType":"labels","stylers":[{"visibility":"simplified"},{"lightness":20}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"hue":"#f49935"}]},{"featureType":"road.highway","elementType":"labels","stylers":[{"visibility":"simplified"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"hue":"#fad959"}]},{"featureType":"road.arterial","elementType":"labels","stylers":[{"visibility":"off"}]},{"featureType":"road.local","elementType":"geometry","stylers":[{"visibility":"simplified"}]},{"featureType":"road.local","elementType":"labels","stylers":[{"visibility":"simplified"}]},{"featureType":"transit","elementType":"all","stylers":[{"visibility":"off"}]},{"featureType":"water","elementType":"all","stylers":[{"hue":"#a1cdfc"},{"saturation":30},{"lightness":49}]}]
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Get the HTML DOM element that will contain your map
|
||||
// We are using a div with id="map" seen below in the <body>
|
||||
var mapElement = document.getElementById('map');
|
||||
|
||||
// Create the Google Map using out element and options defined above
|
||||
var map = new google.maps.Map(mapElement, mapOptions);
|
||||
|
||||
var addresses = ['Brooklyn'];
|
||||
|
||||
for (var x = 0; x < addresses.length; x++) {
|
||||
$.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&sensor=false', null, function (data) {
|
||||
var p = data.results[0].geometry.location
|
||||
var latlng = new google.maps.LatLng(p.lat, p.lng);
|
||||
new google.maps.Marker({
|
||||
position: latlng,
|
||||
map: map,
|
||||
icon: 'images/loc.png'
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
google.maps.event.addDomListener(window, 'load', init);
|
||||
@@ -0,0 +1,130 @@
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
// AMD
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// CommonJS
|
||||
factory(require('jquery'));
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
var CountTo = function (element, options) {
|
||||
this.$element = $(element);
|
||||
this.options = $.extend({}, CountTo.DEFAULTS, this.dataOptions(), options);
|
||||
this.init();
|
||||
};
|
||||
|
||||
CountTo.DEFAULTS = {
|
||||
from: 0, // the number the element should start at
|
||||
to: 0, // the number the element should end at
|
||||
speed: 1000, // how long it should take to count between the target numbers
|
||||
refreshInterval: 100, // how often the element should be updated
|
||||
decimals: 0, // the number of decimal places to show
|
||||
formatter: formatter, // handler for formatting the value before rendering
|
||||
onUpdate: null, // callback method for every time the element is updated
|
||||
onComplete: null // callback method for when the element finishes updating
|
||||
};
|
||||
|
||||
CountTo.prototype.init = function () {
|
||||
this.value = this.options.from;
|
||||
this.loops = Math.ceil(this.options.speed / this.options.refreshInterval);
|
||||
this.loopCount = 0;
|
||||
this.increment = (this.options.to - this.options.from) / this.loops;
|
||||
};
|
||||
|
||||
CountTo.prototype.dataOptions = function () {
|
||||
var options = {
|
||||
from: this.$element.data('from'),
|
||||
to: this.$element.data('to'),
|
||||
speed: this.$element.data('speed'),
|
||||
refreshInterval: this.$element.data('refresh-interval'),
|
||||
decimals: this.$element.data('decimals')
|
||||
};
|
||||
|
||||
var keys = Object.keys(options);
|
||||
|
||||
for (var i in keys) {
|
||||
var key = keys[i];
|
||||
|
||||
if (typeof(options[key]) === 'undefined') {
|
||||
delete options[key];
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
};
|
||||
|
||||
CountTo.prototype.update = function () {
|
||||
this.value += this.increment;
|
||||
this.loopCount++;
|
||||
|
||||
this.render();
|
||||
|
||||
if (typeof(this.options.onUpdate) == 'function') {
|
||||
this.options.onUpdate.call(this.$element, this.value);
|
||||
}
|
||||
|
||||
if (this.loopCount >= this.loops) {
|
||||
clearInterval(this.interval);
|
||||
this.value = this.options.to;
|
||||
|
||||
if (typeof(this.options.onComplete) == 'function') {
|
||||
this.options.onComplete.call(this.$element, this.value);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CountTo.prototype.render = function () {
|
||||
var formattedValue = this.options.formatter.call(this.$element, this.value, this.options);
|
||||
this.$element.text(formattedValue);
|
||||
};
|
||||
|
||||
CountTo.prototype.restart = function () {
|
||||
this.stop();
|
||||
this.init();
|
||||
this.start();
|
||||
};
|
||||
|
||||
CountTo.prototype.start = function () {
|
||||
this.stop();
|
||||
this.render();
|
||||
this.interval = setInterval(this.update.bind(this), this.options.refreshInterval);
|
||||
};
|
||||
|
||||
CountTo.prototype.stop = function () {
|
||||
if (this.interval) {
|
||||
clearInterval(this.interval);
|
||||
}
|
||||
};
|
||||
|
||||
CountTo.prototype.toggle = function () {
|
||||
if (this.interval) {
|
||||
this.stop();
|
||||
} else {
|
||||
this.start();
|
||||
}
|
||||
};
|
||||
|
||||
function formatter(value, options) {
|
||||
return value.toFixed(options.decimals);
|
||||
}
|
||||
|
||||
$.fn.countTo = function (option) {
|
||||
return this.each(function () {
|
||||
var $this = $(this);
|
||||
var data = $this.data('countTo');
|
||||
var init = !data || typeof(option) === 'object';
|
||||
var options = typeof(option) === 'object' ? option : {};
|
||||
var method = typeof(option) === 'string' ? option : 'start';
|
||||
|
||||
if (init) {
|
||||
if (data) data.stop();
|
||||
$this.data('countTo', data = new CountTo(this, options));
|
||||
}
|
||||
|
||||
data[method].call(data);
|
||||
});
|
||||
};
|
||||
}));
|
||||
@@ -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.
|
||||
*
|
||||
*/
|
||||
+4
File diff suppressed because one or more lines are too long
Vendored
+5
File diff suppressed because one or more lines are too long
Vendored
+2
File diff suppressed because one or more lines are too long
@@ -0,0 +1,235 @@
|
||||
// https://github.com/camsjams/jquery-style-switcher
|
||||
/**
|
||||
@author Cameron Manavian
|
||||
jQuery Style Switcher
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Cameron Manavian
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
**/
|
||||
|
||||
(function ($) {
|
||||
var jStyleSwitcher,
|
||||
_defaultOptions = {
|
||||
hasPreview: true,
|
||||
defaultThemeId: 'jssDefault',
|
||||
fullPath: 'css/',
|
||||
cookie: {
|
||||
expires: 30,
|
||||
isManagingLoad: true
|
||||
}
|
||||
},
|
||||
// private
|
||||
_cookieKey = 'jss_selected',
|
||||
_docCookies = {};
|
||||
|
||||
/*\
|
||||
|*|
|
||||
|*| :: cookies.js ::
|
||||
|*|
|
||||
|*| A complete cookies reader/writer framework with full unicode support.
|
||||
|*|
|
||||
|*| revision #1
|
||||
|*|
|
||||
|*| https://developer.mozilla.org/en-US/docs/Web/API/document.cookie
|
||||
|*|
|
||||
|*| This framework is released under the GNU Public License, version 3 or later.
|
||||
|*| http://www.gnu.org/licenses/gpl-3.0-standalone.html
|
||||
|*|
|
||||
|*| Syntaxes:
|
||||
|*|
|
||||
|*| * docCookies.setItem(name, value[, end[, path[, domain[, secure]]]])
|
||||
|*| * docCookies.getItem(name)
|
||||
|*| * docCookies.removeItem(name[, path[, domain]])
|
||||
|*| * docCookies.hasItem(name)
|
||||
|*| * docCookies.keys()
|
||||
|*|
|
||||
\*/
|
||||
_docCookies = {
|
||||
getItem: function (sKey) {
|
||||
if (!sKey) {
|
||||
return null;
|
||||
}
|
||||
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null;
|
||||
},
|
||||
setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) {
|
||||
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) {
|
||||
return false;
|
||||
}
|
||||
var sExpires = "";
|
||||
if (vEnd) {
|
||||
switch (vEnd.constructor) {
|
||||
case Number:
|
||||
sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd;
|
||||
break;
|
||||
case String:
|
||||
sExpires = "; expires=" + vEnd;
|
||||
break;
|
||||
case Date:
|
||||
sExpires = "; expires=" + vEnd.toUTCString();
|
||||
break;
|
||||
}
|
||||
}
|
||||
document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : "");
|
||||
return true;
|
||||
},
|
||||
removeItem: function (sKey, sPath, sDomain) {
|
||||
if (!this.hasItem(sKey)) {
|
||||
return false;
|
||||
}
|
||||
document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "");
|
||||
return true;
|
||||
},
|
||||
hasItem: function (sKey) {
|
||||
if (!sKey) {
|
||||
return false;
|
||||
}
|
||||
return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie);
|
||||
},
|
||||
keys: function () {
|
||||
var aKeys = document.cookie.replace(/((?:^|\s*;)[^\=]+)(?=;|$)|^\s*|\s*(?:\=[^;]*)?(?:\1|$)/g, "").split(/\s*(?:\=[^;]*)?;\s*/);
|
||||
for (var nLen = aKeys.length, nIdx = 0; nIdx < nLen; nIdx++) {
|
||||
aKeys[nIdx] = decodeURIComponent(aKeys[nIdx]);
|
||||
}
|
||||
return aKeys;
|
||||
}
|
||||
};
|
||||
|
||||
jStyleSwitcher = function ($root, config) {
|
||||
return this.init($root, config);
|
||||
};
|
||||
|
||||
jStyleSwitcher.prototype = {
|
||||
|
||||
/**
|
||||
* {Object} DOM reference to style option list
|
||||
*/
|
||||
$root: null,
|
||||
|
||||
/**
|
||||
* {Object} configs for the style switcher
|
||||
*/
|
||||
config: {},
|
||||
|
||||
/**
|
||||
* {Object} jQuery reference to <link> tag for swapping CSS
|
||||
*/
|
||||
$themeCss: null,
|
||||
|
||||
/**
|
||||
* {String} default theme page was loaded with
|
||||
*/
|
||||
defaultTheme: null,
|
||||
|
||||
init: function ($root, config) {
|
||||
this.$root = $root;
|
||||
this.config = config ? config : {};
|
||||
this.setDefaultTheme();
|
||||
if(this.defaultTheme) {
|
||||
// try cookies
|
||||
if (this.config.cookie) {
|
||||
this.checkCookie();
|
||||
}
|
||||
// try hover
|
||||
if (this.config.hasPreview) {
|
||||
this.addHoverEvents();
|
||||
}
|
||||
// finally, add click events
|
||||
this.addClickEvents();
|
||||
} else {
|
||||
this.$root.addClass('jssError error level0');
|
||||
}
|
||||
},
|
||||
|
||||
setDefaultTheme: function () {
|
||||
this.$themeCss = $('link[id=' + this.config.defaultThemeId + ']');
|
||||
if(this.$themeCss.length) {
|
||||
this.defaultTheme = this.$themeCss.attr('href');
|
||||
}
|
||||
},
|
||||
|
||||
resetStyle: function() {
|
||||
this.updateStyle(this.defaultTheme);
|
||||
},
|
||||
|
||||
updateStyle: function(newStyle) {
|
||||
this.$themeCss.attr('href', newStyle);
|
||||
},
|
||||
|
||||
getFullAssetPath: function(asset) {
|
||||
return this.config.fullPath + asset + '.css';
|
||||
},
|
||||
|
||||
checkCookie: function () {
|
||||
var styleCookie;
|
||||
// if using cookies and using JavaScript to load css
|
||||
if (this.config.cookie && this.config.cookie.isManagingLoad) {
|
||||
// check if css is set in cookie
|
||||
styleCookie = _docCookies.getItem(_cookieKey);
|
||||
if (styleCookie) {
|
||||
newStyle = this.getFullAssetPath(styleCookie);
|
||||
// update link tag
|
||||
this.updateStyle(newStyle);
|
||||
// update default ref
|
||||
this.defaultTheme = newStyle;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addHoverEvents: function () {
|
||||
var self = this;
|
||||
this.$root.find('a').hover(
|
||||
function () {
|
||||
var asset = $(this).data('theme'),
|
||||
newStyle = self.getFullAssetPath(asset);
|
||||
// update link tag
|
||||
self.updateStyle(newStyle);
|
||||
},
|
||||
function () {
|
||||
// reset link tag
|
||||
self.resetStyle();
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
addClickEvents: function () {
|
||||
var self = this;
|
||||
this.$root.find('a').click(
|
||||
function () {
|
||||
var asset = $(this).data('theme'),
|
||||
newStyle = self.getFullAssetPath(asset);
|
||||
// update link tag
|
||||
self.updateStyle(newStyle);
|
||||
// update default ref
|
||||
self.defaultTheme = newStyle;
|
||||
// try to store cookie
|
||||
if (self.config.cookie) {
|
||||
_docCookies.setItem(_cookieKey, asset, self.config.cookie.expires, '/');
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.styleSwitcher = function (options) {
|
||||
return new jStyleSwitcher(this, $.extend(true, _defaultOptions, options));
|
||||
};
|
||||
})(jQuery);
|
||||
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -0,0 +1,48 @@
|
||||
$(document).ready(function() {
|
||||
// MagnificPopup
|
||||
var magnifPopup = function() {
|
||||
$('.image-popup').magnificPopup({
|
||||
type: 'image',
|
||||
removalDelay: 300,
|
||||
mainClass: 'mfp-with-zoom',
|
||||
gallery:{
|
||||
enabled:true
|
||||
},
|
||||
zoom: {
|
||||
enabled: true, // By default it's false, so don't forget to enable it
|
||||
|
||||
duration: 300, // duration of the effect, in milliseconds
|
||||
easing: 'ease-in-out', // CSS transition easing function
|
||||
|
||||
// The "opener" function should return the element from which popup will be zoomed in
|
||||
// and to which popup will be scaled down
|
||||
// By defailt it looks for an image tag:
|
||||
opener: function(openerElement) {
|
||||
// openerElement is the element on which popup was initialized, in this case its <a> tag
|
||||
// you don't need to add "opener" option if this code matches your needs, it's defailt one.
|
||||
return openerElement.is('img') ? openerElement : openerElement.find('img');
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var magnifVideo = function() {
|
||||
$('.popup-youtube, .popup-vimeo, .popup-gmaps').magnificPopup({
|
||||
disableOn: 700,
|
||||
type: 'iframe',
|
||||
mainClass: 'mfp-fade',
|
||||
removalDelay: 160,
|
||||
preloader: false,
|
||||
|
||||
fixedContentPos: false
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
// Call the functions
|
||||
magnifPopup();
|
||||
magnifVideo();
|
||||
|
||||
});
|
||||
@@ -0,0 +1,474 @@
|
||||
;(function () {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
||||
|
||||
// iPad and iPod detection
|
||||
var isiPad = function(){
|
||||
return (navigator.platform.indexOf("iPad") != -1);
|
||||
};
|
||||
|
||||
var isiPhone = function(){
|
||||
return (
|
||||
(navigator.platform.indexOf("iPhone") != -1) ||
|
||||
(navigator.platform.indexOf("iPod") != -1)
|
||||
);
|
||||
};
|
||||
|
||||
// Parallax
|
||||
var parallax = function() {
|
||||
$(window).stellar();
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Burger Menu
|
||||
var burgerMenu = function() {
|
||||
|
||||
$('body').on('click', '.js-fh5co-nav-toggle', function(event){
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
if ( $('#navbar').is(':visible') ) {
|
||||
$(this).removeClass('active');
|
||||
} else {
|
||||
$(this).addClass('active');
|
||||
}
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
var goToTop = function() {
|
||||
|
||||
$('.js-gotop').on('click', function(event){
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $('html').offset().top
|
||||
}, 500);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
// Page Nav
|
||||
var clickMenu = function() {
|
||||
|
||||
$('#navbar a:not([class="external"])').click(function(event){
|
||||
var section = $(this).data('nav-section'),
|
||||
navbar = $('#navbar');
|
||||
|
||||
if ( $('[data-section="' + section + '"]').length ) {
|
||||
$('html, body').animate({
|
||||
scrollTop: $('[data-section="' + section + '"]').offset().top
|
||||
}, 500);
|
||||
}
|
||||
|
||||
if ( navbar.is(':visible')) {
|
||||
navbar.removeClass('in');
|
||||
navbar.attr('aria-expanded', 'false');
|
||||
$('.js-fh5co-nav-toggle').removeClass('active');
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
// Reflect scrolling in navigation
|
||||
var navActive = function(section) {
|
||||
|
||||
var $el = $('#navbar > ul');
|
||||
$el.find('li').removeClass('active');
|
||||
$el.each(function(){
|
||||
$(this).find('a[data-nav-section="'+section+'"]').closest('li').addClass('active');
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
var navigationSection = function() {
|
||||
|
||||
var $section = $('section[data-section]');
|
||||
|
||||
$section.waypoint(function(direction) {
|
||||
|
||||
if (direction === 'down') {
|
||||
navActive($(this.element).data('section'));
|
||||
}
|
||||
}, {
|
||||
offset: '150px'
|
||||
});
|
||||
|
||||
$section.waypoint(function(direction) {
|
||||
if (direction === 'up') {
|
||||
navActive($(this.element).data('section'));
|
||||
}
|
||||
}, {
|
||||
offset: function() { return -$(this.element).height() + 155; }
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Window Scroll
|
||||
var windowScroll = function() {
|
||||
var lastScrollTop = 0;
|
||||
|
||||
$(window).scroll(function(event){
|
||||
|
||||
var header = $('#fh5co-header'),
|
||||
scrlTop = $(this).scrollTop();
|
||||
|
||||
if ( scrlTop > 500 && scrlTop <= 2000 ) {
|
||||
header.addClass('navbar-fixed-top fh5co-animated slideInDown');
|
||||
} else if ( scrlTop <= 500) {
|
||||
if ( header.hasClass('navbar-fixed-top') ) {
|
||||
header.addClass('navbar-fixed-top fh5co-animated slideOutUp');
|
||||
setTimeout(function(){
|
||||
header.removeClass('navbar-fixed-top fh5co-animated slideInDown slideOutUp');
|
||||
}, 100 );
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Animations
|
||||
// Home
|
||||
|
||||
var homeAnimate = function() {
|
||||
if ( $('#fh5co-home').length > 0 ) {
|
||||
|
||||
$('#fh5co-home').waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
$('#fh5co-home .to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var introAnimate = function() {
|
||||
if ( $('#fh5co-intro').length > 0 ) {
|
||||
|
||||
$('#fh5co-intro').waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
$('#fh5co-intro .to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInRight animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 1000);
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var workAnimate = function() {
|
||||
if ( $('#fh5co-work').length > 0 ) {
|
||||
|
||||
$('#fh5co-work').waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
$('#fh5co-work .to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var testimonialAnimate = function() {
|
||||
var testimonial = $('#fh5co-testimonials');
|
||||
if ( testimonial.length > 0 ) {
|
||||
|
||||
testimonial.waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
var sec = testimonial.find('.to-animate').length,
|
||||
sec = parseInt((sec * 200) - 400);
|
||||
|
||||
setTimeout(function() {
|
||||
testimonial.find('.to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
setTimeout(function() {
|
||||
testimonial.find('.to-animate-2').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInDown animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, sec);
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var servicesAnimate = function() {
|
||||
var services = $('#fh5co-services');
|
||||
if ( services.length > 0 ) {
|
||||
|
||||
services.waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
var sec = services.find('.to-animate').length,
|
||||
sec = parseInt((sec * 200) + 400);
|
||||
|
||||
setTimeout(function() {
|
||||
services.find('.to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
setTimeout(function() {
|
||||
services.find('.to-animate-2').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('bounceIn animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, sec);
|
||||
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var aboutAnimate = function() {
|
||||
var about = $('#fh5co-about');
|
||||
if ( about.length > 0 ) {
|
||||
|
||||
about.waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
|
||||
setTimeout(function() {
|
||||
about.find('.to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
var countersAnimate = function() {
|
||||
var counters = $('#fh5co-counters');
|
||||
if ( counters.length > 0 ) {
|
||||
|
||||
counters.waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
var sec = counters.find('.to-animate').length,
|
||||
sec = parseInt((sec * 200) + 400);
|
||||
|
||||
setTimeout(function() {
|
||||
counters.find('.to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
setTimeout(function() {
|
||||
counters.find('.js-counter').countTo({
|
||||
formatter: function (value, options) {
|
||||
return value.toFixed(options.decimals);
|
||||
},
|
||||
});
|
||||
}, 400);
|
||||
|
||||
setTimeout(function() {
|
||||
counters.find('.to-animate-2').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('bounceIn animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, sec);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var contactAnimate = function() {
|
||||
var contact = $('#fh5co-contact');
|
||||
if ( contact.length > 0 ) {
|
||||
|
||||
contact.waypoint( function( direction ) {
|
||||
|
||||
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
|
||||
|
||||
setTimeout(function() {
|
||||
contact.find('.to-animate').each(function( k ) {
|
||||
var el = $(this);
|
||||
|
||||
setTimeout ( function () {
|
||||
el.addClass('fadeInUp animated');
|
||||
}, k * 200, 'easeInOutExpo' );
|
||||
|
||||
});
|
||||
}, 200);
|
||||
|
||||
$(this.element).addClass('animated');
|
||||
|
||||
}
|
||||
} , { offset: '80%' } );
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Document on load.
|
||||
$(function(){
|
||||
|
||||
parallax();
|
||||
|
||||
burgerMenu();
|
||||
|
||||
clickMenu();
|
||||
|
||||
windowScroll();
|
||||
|
||||
navigationSection();
|
||||
|
||||
goToTop();
|
||||
|
||||
|
||||
// Animations
|
||||
homeAnimate();
|
||||
introAnimate();
|
||||
workAnimate();
|
||||
testimonialAnimate();
|
||||
servicesAnimate();
|
||||
aboutAnimate();
|
||||
countersAnimate();
|
||||
contactAnimate();
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}());
|
||||
Vendored
+4
File diff suppressed because one or more lines are too long
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
|
||||
/*! Respond.js v1.4.2: min/max-width media query polyfill * Copyright 2013 Scott Jehl
|
||||
* Licensed under https://github.com/scottjehl/Respond/blob/master/LICENSE-MIT
|
||||
* */
|
||||
|
||||
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){u(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))};if(c.ajax=f,c.queue=d,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var g,h,i,j=a.document,k=j.documentElement,l=[],m=[],n=[],o={},p=30,q=j.getElementsByTagName("head")[0]||k,r=j.getElementsByTagName("base")[0],s=q.getElementsByTagName("link"),t=function(){var a,b=j.createElement("div"),c=j.body,d=k.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=j.createElement("body"),c.style.background="none"),k.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&k.insertBefore(c,k.firstChild),a=b.offsetWidth,f?k.removeChild(c):c.removeChild(b),k.style.fontSize=d,e&&(c.style.fontSize=e),a=i=parseFloat(a)},u=function(b){var c="clientWidth",d=k[c],e="CSS1Compat"===j.compatMode&&d||j.body[c]||d,f={},o=s[s.length-1],r=(new Date).getTime();if(b&&g&&p>r-g)return a.clearTimeout(h),h=a.setTimeout(u,p),void 0;g=r;for(var v in l)if(l.hasOwnProperty(v)){var w=l[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?i||t():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?i||t():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(m[w.rules]))}for(var C in n)n.hasOwnProperty(C)&&n[C]&&n[C].parentNode===q&&q.removeChild(n[C]);n.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=j.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,q.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(j.createTextNode(F)),n.push(E)}},v=function(a,b,d){var e=a.replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var g=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},h=!f&&d;b.length&&(b+="/"),h&&(f=1);for(var i=0;f>i;i++){var j,k,n,o;h?(j=d,m.push(g(a))):(j=e[i].match(c.regex.findStyles)&&RegExp.$1,m.push(RegExp.$2&&g(RegExp.$2))),n=j.split(","),o=n.length;for(var p=0;o>p;p++)k=n[p],l.push({media:k.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:m.length-1,hasquery:k.indexOf("(")>-1,minw:k.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:k.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},w=function(){if(d.length){var b=d.shift();f(b.href,function(c){v(c,b.href,b.media),o[b.href]=!0,a.setTimeout(function(){w()},0)})}},x=function(){for(var b=0;b<s.length;b++){var c=s[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!o[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(v(c.styleSheet.rawCssText,e,f),o[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!r||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}w()};x(),c.update=x,c.getEmValue=t,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
||||
Reference in New Issue
Block a user