/*! simpleWeather v3.1.0 - http://simpleweatherjs.com */ (function($) { 'use strict'; function getAltTemp(unit, temp) { if(unit === 'f') { return Math.round((5.0/9.0)*(temp-32.0)); } else { return Math.round((9.0/5.0)*temp+32.0); } } $.extend({ simpleWeather: function(options){ options = $.extend({ location: '', woeid: '', unit: 'f', success: function(weather){}, error: function(message){} }, options); var now = new Date(); var weatherUrl = 'https://query.yahooapis.com/v1/public/yql?format=json&rnd=' + now.getFullYear() + now.getMonth() + now.getDay() + now.getHours() + '&diagnostics=true&callback=?&q='; if(options.location !== '') { /* If latitude/longitude coordinates, need to format a little different. */ var location = ''; if(/^(\-?\d+(\.\d+)?),\s*(\-?\d+(\.\d+)?)$/.test(options.location)) { location = '(' + options.location + ')'; } else { location = options.location; } weatherUrl += 'select * from weather.forecast where woeid in (select woeid from geo.places(1) where text="' + location + '") and u="' + options.unit + '"'; } else if(options.woeid !== '') { weatherUrl += 'select * from weather.forecast where woeid=' + options.woeid + ' and u="' + options.unit + '"'; } else { options.error('Could not retrieve weather due to an invalid location.'); return false; } $.getJSON( encodeURI(weatherUrl), function(data) { if(data !== null && data.query !== null && data.query.results !== null && data.query.results.channel.description !== 'Yahoo! Weather Error') { var result = data.query.results.channel, weather = {}, forecast, compass = ['N', 'NNE', 'NE', 'ENE', 'E', 'ESE', 'SE', 'SSE', 'S', 'SSW', 'SW', 'WSW', 'W', 'WNW', 'NW', 'NNW', 'N'], image404 = 'https://s.yimg.com/os/mit/media/m/weather/images/icons/l/44d-100567.png'; weather.title = result.item.title; weather.temp = result.item.condition.temp; weather.code = result.item.condition.code; weather.todayCode = result.item.forecast[0].code; weather.currently = result.item.condition.text; weather.high = result.item.forecast[0].high; weather.low = result.item.forecast[0].low; weather.text = result.item.forecast[0].text; weather.humidity = result.atmosphere.humidity; weather.pressure = result.atmosphere.pressure; weather.rising = result.atmosphere.rising; weather.visibility = result.atmosphere.visibility; weather.sunrise = result.astronomy.sunrise; weather.sunset = result.astronomy.sunset; weather.description = result.item.description; weather.city = result.location.city; weather.country = result.location.country; weather.region = result.location.region; weather.updated = result.item.pubDate; weather.link = result.item.link; weather.units = {temp: result.units.temperature, distance: result.units.distance, pressure: result.units.pressure, speed: result.units.speed}; weather.wind = {chill: result.wind.chill, direction: compass[Math.round(result.wind.direction / 22.5)], speed: result.wind.speed}; if(result.item.condition.temp < 80 && result.atmosphere.humidity < 40) { weather.heatindex = -42.379+2.04901523*result.item.condition.temp+10.14333127*result.atmosphere.humidity-0.22475541*result.item.condition.temp*result.atmosphere.humidity-6.83783*(Math.pow(10, -3))*(Math.pow(result.item.condition.temp, 2))-5.481717*(Math.pow(10, -2))*(Math.pow(result.atmosphere.humidity, 2))+1.22874*(Math.pow(10, -3))*(Math.pow(result.item.condition.temp, 2))*result.atmosphere.humidity+8.5282*(Math.pow(10, -4))*result.item.condition.temp*(Math.pow(result.atmosphere.humidity, 2))-1.99*(Math.pow(10, -6))*(Math.pow(result.item.condition.temp, 2))*(Math.pow(result.atmosphere.humidity,2)); } else { weather.heatindex = result.item.condition.temp; } if(result.item.condition.code == '3200') { weather.thumbnail = image404; weather.image = image404; } else { weather.thumbnail = 'https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/' + result.item.condition.code + 'ds.png'; weather.image = 'https://s.yimg.com/zz/combo?a/i/us/nws/weather/gr/' + result.item.condition.code + 'd.png'; } weather.alt = {temp: getAltTemp(options.unit, result.item.condition.temp), high: getAltTemp(options.unit, result.item.forecast[0].high), low: getAltTemp(options.unit, result.item.forecast[0].low)}; if(options.unit === 'f') { weather.alt.unit = 'c'; } else { weather.alt.unit = 'f'; } weather.forecast = []; for(var i=0;i */ !function(a){var b=function(b,c){function d(){clearInterval(f),f=setInterval(function(){e.nextSlide()},i.interval)}var e=this,f=null,g=null,h=Math.floor(100*Math.random())+Date.now();e.currentSlide=0,e.totalSlides=0,c=void 0===c?{}:c;var i=a.extend({slidesContainer:b,slides:".slide",slideTracker:!0,slideTrackerID:"slideposition",slideOnInterval:!0,interval:5e3,swipe:!0,magneticSwipe:!0,transition:"slide",animateDuration:1e3,animationEasing:"ease",pauseOnHover:!1,updateTransit:!0,useDefaultCSS:!0,neverEnding:!0},c);e.init=function(){"fade"==i.transition&&(i.neverEnding=!1,i.magneticSwipe=!1),i.updateTransit&&a.support.transition&&jQuery().transition&&!a.transit.useTransitionEnd&&(a.transit.useTransitionEnd=!0);var c="jss-slideswrap-"+h;if(a(i.slidesContainer).wrapInner("
"),g="."+c,i.neverEnding&&a(g).stop().css(a.support.transition&&jQuery().transition?{x:"-100%"}:{left:"-100%"}),e.totalSlides=a(i.slidesContainer).find(i.slides).length,i.neverEnding){var f=a(i.slidesContainer).find(i.slides).first().clone(!0,!0),j=a(i.slidesContainer).find(i.slides).last().clone(!0,!0);a(g).prepend(j),a(g).append(f)}var k=0;if(i.useDefaultCSS&&a(i.slidesContainer).css({position:"relative",overflow:"hidden"}),a(i.slidesContainer).find(i.slides).each(function(b){if(i.neverEnding?0===b?a(this).attr("data-index",e.totalSlides-1):b==e.totalSlides+1?a(this).attr("data-index",0):a(this).attr("data-index",b-1):a(this).attr("data-index",b),k=a(this).outerWidth()>k?a(this).outerWidth():k,"slide"==i.transition&&a(this).css(void 0!==a.support.transition?{x:100*b+"%","z-index":2*e.totalSlides-b,width:k}:{left:100*b+"%","z-index":2*e.totalSlides-b,width:k}),"fade"==i.transition){var c=0===b?1:0;a(this).css({left:0,top:0,"z-index":e.totalSlides-b,width:k,opacity:c})}i.useDefaultCSS&&a(this).css({position:"absolute","float":"left",height:"100%",top:0})}),i.slideTracker){a(i.slidesContainer).after("
");for(var l=0;l')}a('div[data-slider="'+h+'"] ul li[data-index="'+e.currentSlide+'"]').addClass("active"),a("div[data-slider='"+h+"'] ul li").click(function(){a(this).hasClass("active")||e.nextSlide(a(this).data("index"))})}if(i.slideOnInterval&&d(),i.swipe||i.magneticSwipe){a(i.slidesContainer).css("cursor","-webkit-grab"),a(i.slidesContainer).css("cursor","-moz-grab"),a(i.slidesContainer).css("cursor","grab");var n=!1,o={x:0,y:0},p=0,q=a(i.slidesContainer).width(),r=window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",s=window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",t=window.navigator.msPointerEnabled?"MSPointerUp":"touchend";a(i.slidesContainer).on(r+" mousedown",function(b){n=!0,o={x:void 0!==b.pageX?b.pageX:b.originalEvent.touches[0].pageX,y:void 0!==b.pageY?b.pageY:b.originalEvent.touches[0].pageY},i.magneticSwipe&&a(i.slidesContainer).find(i.slides).css("transition","none"),p=0,a(i.slidesContainer).css("cursor","-webkit-grabbing"),a(i.slidesContainer).css("cursor","-moz-grabbing"),a(i.slidesContainer).css("cursor","grabbing")}),a(i.slidesContainer).on(s+" mousemove",function(a){if(a.type==s&&a.preventDefault(),n){var b=void 0!==a.pageX?a.pageX:a.originalEvent.touches[0].pageX;p=(o.x-b)/q*100,i.magneticSwipe&&e.manualSlide(p)}}),a(i.slidesContainer).on(t+" mouseup",function(){n=!1,p>25&&(e.currentSlidep&&(e.currentSlide>0||i.neverEnding)?e.prevSlide():e.resetSlides(),a(i.slidesContainer).css("cursor","-webkit-grab"),a(i.slidesContainer).css("cursor","-moz-grab"),a(i.slidesContainer).css("cursor","grab")})}a(b).trigger({type:"init",totalSlides:e.totalSlides})}(),a(window).resize(function(){var b=0;a(i.slidesContainer).find(i.slides).each(function(){a(this).css("width",""),b=a(this).outerWidth()>b?a(this).outerWidth():b,a(this).css("fade"==i.transition?{width:b}:{x:100*(a(this).data("index")-e.currentSlideindex)+"%",width:b})})}),e.manualSlide=function(b){if("slide"==i.transition){a(g).css("-webkit-transition","none"),a(g).css("-moz-transition","none"),a(g).css("-ms-transition","none"),a(g).css("transition","none");var c=-(100*e.currentSlide+b);i.neverEnding&&(c=-(100*(e.currentSlide+1)+b)),a(g).css(a.support.transition&&jQuery().transition?{x:c+"%"}:{left:c+"%"})}},e.resetSlides=function(){if("slide"==i.transition){var b=i.neverEnding?-(100*(e.currentSlide+1)):-(100*e.currentSlide);a.support.transition&&jQuery().transition?a(g).stop().transition({x:b+"%"},i.animateDuration,i.animationEasing):a(g).stop().animate({left:b+"%"},i.animateDuration)}},e.prevSlide=function(){var a=e.currentSlide>0?e.currentSlide-=1:e.totalSlides-1;e.nextSlide(a)},e.nextSlide=function(c){function f(){if(!k){"fade"==i.transition&&a(i.slidesContainer).find(i.slides).each(function(){a(this).data("index")==e.currentSlide?a(this).show():a(this).hide()}),"slide"==i.transition&&i.neverEnding&&(e.currentSlide==e.totalSlides-1&&0===j&&(a.support.transition&&jQuery().transition?a(g).stop().transition({x:100*-e.totalSlides+"%"},1,"linear"):a(g).css({left:100*-e.totalSlides+"%"})),0===e.currentSlide&&j==e.totalSlides-1&&(a.support.transition&&jQuery().transition?a(g).stop().transition({x:"-100%"},1,"linear"):a(g).css({left:"-100%"})));var c=jQuery.Event("afterSliding",{prevSlide:j,newSlide:e.currentSlide});a(b).trigger(c),k=!0}}var j=e.currentSlide,k=!1;e.currentSlide=void 0===c?e.currentSlide0&&(h+=" "+k(e));var i=[];return a.each(g,function(a,b){i.push(b+" "+h)}),i.join(", ")}function h(b,c){c||(a.cssNumber[b]=!0),a.transit.propertyMap[b]=m.transform,a.cssHooks[b]={get:function(c){var d=a(c).css("transit:transform");return d.get(b)},set:function(c,d){var e=a(c).css("transit:transform");e.setFromString(b,d),a(c).css({"transit:transform":e})}}}function i(a){return a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()})}function j(a,b){return"string"!=typeof a||a.match(/^[\-0-9\.]+$/)?""+a+b:a}function k(b){var c=b;return a.fx.speeds[c]&&(c=a.fx.speeds[c]),j(c,"ms")}a.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:!0,useTransitionEnd:!0};var l=document.createElement("div"),m={},n=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;m.transition=b("transition"),m.transitionDelay=b("transitionDelay"),m.transform=b("transform"),m.transformOrigin=b("transformOrigin"),m.transform3d=c();var o={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"},p=m.transitionEnd=o[m.transition]||null;for(var q in m)m.hasOwnProperty(q)&&"undefined"==typeof a.support[q]&&(a.support[q]=m[q]);l=null,a.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"},a.cssHooks["transit:transform"]={get:function(b){return a(b).data("transform")||new d},set:function(b,c){var e=c;e instanceof d||(e=new d(e)),b.style[m.transform]="WebkitTransform"!==m.transform||n?e.toString():e.toString(!0),a(b).data("transform",e)}},a.cssHooks.transform={set:a.cssHooks["transit:transform"].set},a.fn.jquery<"1.8"&&(a.cssHooks.transformOrigin={get:function(a){return a.style[m.transformOrigin]},set:function(a,b){a.style[m.transformOrigin]=b}},a.cssHooks.transition={get:function(a){return a.style[m.transition]},set:function(a,b){a.style[m.transition]=b}}),h("scale"),h("translate"),h("rotate"),h("rotateX"),h("rotateY"),h("rotate3d"),h("perspective"),h("skewX"),h("skewY"),h("x",!0),h("y",!0),d.prototype={setFromString:function(a,b){var c="string"==typeof b?b.split(","):b.constructor===Array?b:[b];c.unshift(a),d.prototype.set.apply(this,c)},set:function(a){var b=Array.prototype.slice.apply(arguments,[1]);this.setter[a]?this.setter[a].apply(this,b):this[a]=b.join(",")},get:function(a){return this.getter[a]?this.getter[a].apply(this):this[a]||0},setter:{rotate:function(a){this.rotate=j(a,"deg")},rotateX:function(a){this.rotateX=j(a,"deg")},rotateY:function(a){this.rotateY=j(a,"deg")},scale:function(a,b){void 0===b&&(b=a),this.scale=a+","+b},skewX:function(a){this.skewX=j(a,"deg")},skewY:function(a){this.skewY=j(a,"deg")},perspective:function(a){this.perspective=j(a,"px")},x:function(a){this.set("translate",a,null)},y:function(a){this.set("translate",null,a)},translate:function(a,b){void 0===this._translateX&&(this._translateX=0),void 0===this._translateY&&(this._translateY=0),null!==a&&void 0!==a&&(this._translateX=j(a,"px")),null!==b&&void 0!==b&&(this._translateY=j(b,"px")),this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var a=(this.scale||"1,1").split(",");return a[0]&&(a[0]=parseFloat(a[0])),a[1]&&(a[1]=parseFloat(a[1])),a[0]===a[1]?a[0]:a},rotate3d:function(){for(var a=(this.rotate3d||"0,0,0,0deg").split(","),b=0;3>=b;++b)a[b]&&(a[b]=parseFloat(a[b]));return a[3]&&(a[3]=j(a[3],"deg")),a}},parse:function(a){var b=this;a.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(a,c,d){b.setFromString(c,d)})},toString:function(a){var b=[];for(var c in this)if(this.hasOwnProperty(c)){if(!m.transform3d&&("rotateX"===c||"rotateY"===c||"perspective"===c||"transformOrigin"===c))continue;"_"!==c[0]&&b.push(a&&"scale"===c?c+"3d("+this[c]+",1)":a&&"translate"===c?c+"3d("+this[c]+",0)":c+"("+this[c]+")")}return b.join(" ")}},a.fn.transition=a.fn.transit=function(b,c,d,f){var h=this,i=0,j=!0;"function"==typeof c&&(f=c,c=void 0),"function"==typeof d&&(f=d,d=void 0),"undefined"!=typeof b.easing&&(d=b.easing,delete b.easing),"undefined"!=typeof b.duration&&(c=b.duration,delete b.duration),"undefined"!=typeof b.complete&&(f=b.complete,delete b.complete),"undefined"!=typeof b.queue&&(j=b.queue,delete b.queue),"undefined"!=typeof b.delay&&(i=b.delay,delete b.delay),"undefined"==typeof c&&(c=a.fx.speeds._default),"undefined"==typeof d&&(d=a.cssEase._default),c=k(c);var l=g(b,c,d,i),n=a.transit.enabled&&m.transition,o=n?parseInt(c,10)+parseInt(i,10):0;if(0===o){var q=function(a){h.css(b),f&&f.apply(h),a&&a()};return e(h,j,q),h}var r={},s=function(c){var d=!1,e=function(){d&&h.unbind(p,e),o>0&&h.each(function(){this.style[m.transition]=r[this]||null}),"function"==typeof f&&f.apply(h),"function"==typeof c&&c()};o>0&&p&&a.transit.useTransitionEnd?(d=!0,h.bind(p,e)):window.setTimeout(e,o),h.each(function(){o>0&&(this.style[m.transition]=l),a(this).css(b)})},t=function(a){this.offsetWidth,s(a)};return e(h,j,t),this},a.transit.getTransitionValue=g}(jQuery); //# sourceMappingURL=jquery.simpleslider.package.min.js.map; /*! jssocials - v1.4.0 - 2016-10-10 * http://js-socials.com * Copyright (c) 2016 Artem Tabalin; Licensed MIT */ (function(window, $, undefined) { var JSSOCIALS = "JSSocials", JSSOCIALS_DATA_KEY = JSSOCIALS; var getOrApply = function(value, context) { if($.isFunction(value)) { return value.apply(context, $.makeArray(arguments).slice(2)); } return value; }; var IMG_SRC_REGEX = /(\.(jpeg|png|gif|bmp|svg)$|^data:image\/(jpeg|png|gif|bmp|svg\+xml);base64)/i; var URL_PARAMS_REGEX = /(&?[a-zA-Z0-9]+=)?\{([a-zA-Z0-9]+)\}/g; var MEASURES = { "G": 1000000000, "M": 1000000, "K": 1000 }; var shares = {}; function Socials(element, config) { var $element = $(element); $element.data(JSSOCIALS_DATA_KEY, this); this._$element = $element; this.shares = []; this._init(config); this._render(); } Socials.prototype = { url: "", text: "", shareIn: "blank", showLabel: function(screenWidth) { return (this.showCount === false) ? (screenWidth > this.smallScreenWidth) : (screenWidth >= this.largeScreenWidth); }, showCount: function(screenWidth) { return (screenWidth <= this.smallScreenWidth) ? "inside" : true; }, smallScreenWidth: 640, largeScreenWidth: 1024, resizeTimeout: 200, elementClass: "jssocials", sharesClass: "jssocials-shares", shareClass: "jssocials-share", shareButtonClass: "jssocials-share-button", shareLinkClass: "jssocials-share-link", shareLogoClass: "jssocials-share-logo", shareLabelClass: "jssocials-share-label", shareLinkCountClass: "jssocials-share-link-count", shareCountBoxClass: "jssocials-share-count-box", shareCountClass: "jssocials-share-count", shareZeroCountClass: "jssocials-share-no-count", _init: function(config) { this._initDefaults(); $.extend(this, config); this._initShares(); this._attachWindowResizeCallback(); }, _initDefaults: function() { this.url = window.location.href; this.text = $.trim($("meta[name=description]").attr("content") || $("title").text()); }, _initShares: function() { this.shares = $.map(this.shares, $.proxy(function(shareConfig) { if(typeof shareConfig === "string") { shareConfig = { share: shareConfig }; } var share = (shareConfig.share && shares[shareConfig.share]); if(!share && !shareConfig.renderer) { throw Error("Share '" + shareConfig.share + "' is not found"); } return $.extend({ url: this.url, text: this.text }, share, shareConfig); }, this)); }, _attachWindowResizeCallback: function() { $(window).on("resize", $.proxy(this._windowResizeHandler, this)); }, _detachWindowResizeCallback: function() { $(window).off("resize", this._windowResizeHandler); }, _windowResizeHandler: function() { if($.isFunction(this.showLabel) || $.isFunction(this.showCount)) { window.clearTimeout(this._resizeTimer); this._resizeTimer = setTimeout($.proxy(this.refresh, this), this.resizeTimeout); } }, _render: function() { this._clear(); this._defineOptionsByScreen(); this._$element.addClass(this.elementClass); this._$shares = $("
").addClass(this.sharesClass) .appendTo(this._$element); this._renderShares(); }, _defineOptionsByScreen: function() { this._screenWidth = $(window).width(); this._showLabel = getOrApply(this.showLabel, this, this._screenWidth); this._showCount = getOrApply(this.showCount, this, this._screenWidth); }, _renderShares: function() { $.each(this.shares, $.proxy(function(_, share) { this._renderShare(share); }, this)); }, _renderShare: function(share) { var $share; if($.isFunction(share.renderer)) { $share = $(share.renderer()); } else { $share = this._createShare(share); } $share.addClass(this.shareClass) .addClass(share.share ? "jssocials-share-" + share.share : "") .addClass(share.css) .appendTo(this._$shares); }, _createShare: function(share) { var $result = $("
"); var $shareLink = this._createShareLink(share).appendTo($result); if(this._showCount) { var isInsideCount = (this._showCount === "inside"); var $countContainer = isInsideCount ? $shareLink : $("
").addClass(this.shareCountBoxClass).appendTo($result); $countContainer.addClass(isInsideCount ? this.shareLinkCountClass : this.shareCountBoxClass); this._renderShareCount(share, $countContainer); } return $result; }, _createShareLink: function(share) { var shareStrategy = this._getShareStrategy(share); var $result = shareStrategy.call(share, { shareUrl: this._getShareUrl(share) }); $result.addClass(this.shareLinkClass) .append(this._createShareLogo(share)); if(this._showLabel) { $result.append(this._createShareLabel(share)); } $.each(this.on || {}, function(event, handler) { if($.isFunction(handler)) { $result.on(event, $.proxy(handler, share)); } }); return $result; }, _getShareStrategy: function(share) { var result = shareStrategies[share.shareIn || this.shareIn]; if(!result) throw Error("Share strategy '" + this.shareIn + "' not found"); return result; }, _getShareUrl: function(share) { var shareUrl = getOrApply(share.shareUrl, share); return this._formatShareUrl(shareUrl, share); }, _createShareLogo: function(share) { var logo = share.logo; var $result = IMG_SRC_REGEX.test(logo) ? $("").attr("src", share.logo) : $("").addClass(logo); $result.addClass(this.shareLogoClass); return $result; }, _createShareLabel: function(share) { return $("").addClass(this.shareLabelClass) .text(share.label); }, _renderShareCount: function(share, $container) { var $count = $("").addClass(this.shareCountClass); $container.addClass(this.shareZeroCountClass) .append($count); this._loadCount(share).done($.proxy(function(count) { if(count) { $container.removeClass(this.shareZeroCountClass); $count.text(count); } }, this)); }, _loadCount: function(share) { var deferred = $.Deferred(); var countUrl = this._getCountUrl(share); if(!countUrl) { return deferred.resolve(0).promise(); } var handleSuccess = $.proxy(function(response) { deferred.resolve(this._getCountValue(response, share)); }, this); $.getJSON(countUrl).done(handleSuccess) .fail(function() { $.get(countUrl).done(handleSuccess) .fail(function() { deferred.resolve(0); }); }); return deferred.promise(); }, _getCountUrl: function(share) { var countUrl = getOrApply(share.countUrl, share); return this._formatShareUrl(countUrl, share); }, _getCountValue: function(response, share) { var count = ($.isFunction(share.getCount) ? share.getCount(response) : response) || 0; return (typeof count === "string") ? count : this._formatNumber(count); }, _formatNumber: function(number) { $.each(MEASURES, function(letter, value) { if(number >= value) { number = parseFloat((number / value).toFixed(2)) + letter; return false; } }); return number; }, _formatShareUrl: function(url, share) { return url.replace(URL_PARAMS_REGEX, function(match, key, field) { var value = share[field] || ""; return value ? (key || "") + window.encodeURIComponent(value) : ""; }); }, _clear: function() { window.clearTimeout(this._resizeTimer); this._$element.empty(); }, _passOptionToShares: function(key, value) { var shares = this.shares; $.each(["url", "text"], function(_, optionName) { if(optionName !== key) return; $.each(shares, function(_, share) { share[key] = value; }); }); }, _normalizeShare: function(share) { if($.isNumeric(share)) { return this.shares[share]; } if(typeof share === "string") { return $.grep(this.shares, function(s) { return s.share === share; })[0]; } return share; }, refresh: function() { this._render(); }, destroy: function() { this._clear(); this._detachWindowResizeCallback(); this._$element .removeClass(this.elementClass) .removeData(JSSOCIALS_DATA_KEY); }, option: function(key, value) { if(arguments.length === 1) { return this[key]; } this[key] = value; this._passOptionToShares(key, value); this.refresh(); }, shareOption: function(share, key, value) { share = this._normalizeShare(share); if(arguments.length === 2) { return share[key]; } share[key] = value; this.refresh(); } }; $.fn.jsSocials = function(config) { var args = $.makeArray(arguments), methodArgs = args.slice(1), result = this; this.each(function() { var $element = $(this), instance = $element.data(JSSOCIALS_DATA_KEY), methodResult; if(instance) { if(typeof config === "string") { methodResult = instance[config].apply(instance, methodArgs); if(methodResult !== undefined && methodResult !== instance) { result = methodResult; return false; } } else { instance._detachWindowResizeCallback(); instance._init(config); instance._render(); } } else { new Socials($element, config); } }); return result; }; var setDefaults = function(config) { var component; if($.isPlainObject(config)) { component = Socials.prototype; } else { component = shares[config]; config = arguments[1] || {}; } $.extend(component, config); }; var shareStrategies = { popup: function(args) { return $("").attr("href", "#") .on("click", function() { window.open(args.shareUrl, null, "width=600, height=400, location=0, menubar=0, resizeable=0, scrollbars=0, status=0, titlebar=0, toolbar=0"); return false; }); }, blank: function(args) { return $("").attr({ target: "_blank", href: args.shareUrl }); }, self: function(args) { return $("").attr({ target: "_self", href: args.shareUrl }); } }; window.jsSocials = { Socials: Socials, shares: shares, shareStrategies: shareStrategies, setDefaults: setDefaults }; }(window, jQuery)); (function(window, $, jsSocials, undefined) { $.extend(jsSocials.shares, { email: { label: "E-mail", logo: "fa fa-fw fa-envelope", shareUrl: "mailto:{to}?subject={text}&body={url}", countUrl: "", shareIn: "self" }, twitter: { label: "Tweet", logo: "fa fa-fw fa-twitter", shareUrl: "https://twitter.com/share?url={url}&text={text}&via={via}&hashtags={hashtags}", countUrl: "" }, facebook: { label: "Like", logo: "fa fa-fw fa-facebook", shareUrl: "https://facebook.com/sharer/sharer.php?u={url}", countUrl: "https://graph.facebook.com/?id={url}", getCount: function(data) { return data.share && data.share.share_count || 0; } }, vkontakte: { label: "Like", logo: "fa fa-vk", shareUrl: "https://vk.com/share.php?url={url}&title={title}&description={text}", countUrl: "https://vk.com/share.php?act=count&index=1&url={url}", getCount: function(data) { return parseInt(data.slice(15, -2).split(', ')[1]); } }, googleplus: { label: "+1", logo: "fa fa-fw fa-google-plus", shareUrl: "https://plus.google.com/share?url={url}", countUrl: "" }, linkedin: { label: "Share", logo: "fa fa-fw fa-linkedin", shareUrl: "https://www.linkedin.com/shareArticle?mini=true&url={url}", countUrl: "https://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?", getCount: function(data) { return data.count; } }, pinterest: { label: "Pin it", logo: "fa fa-fw fa-pinterest-p", shareUrl: "https://pinterest.com/pin/create/bookmarklet/?media={media}&url={url}&description={text}", countUrl: "https://api.pinterest.com/v1/urls/count.json?&url={url}&callback=?", getCount: function(data) { return data.count; } }, stumbleupon: { label: "Share", logo: "fa fa-stumbleupon", shareUrl: "http://www.stumbleupon.com/submit?url={url}&title={title}", countUrl: "https://cors-anywhere.herokuapp.com/https://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}", getCount: function(data) { return data.result.views; } }, telegram: { label: "Telegram", logo: "fa fa-paper-plane", shareUrl: "tg://msg?text={url} {text}", countUrl: "", shareIn: "self" }, whatsapp: { label: "WhatsApp", logo: "fa fa-whatsapp", shareUrl: "whatsapp://send?text={url} {text}", countUrl: "", shareIn: "self" }, line: { label: "LINE", logo: "fa fa-comment", shareUrl: "http://line.me/R/msg/text/?{text} {url}", countUrl: "" }, viber: { label: "Viber", logo: "fa fa-volume-control-phone", shareUrl: "viber://forward?text={url} {text}", countUrl: "", shareIn: "self" }, pocket: { label: "Pocket", logo: "fa fa-get-pocket", shareUrl: "https://getpocket.com/save?url={url}&title={title}", countUrl: "" }, messenger: { label: "Share", logo: "fa fa-commenting", shareUrl: "fb-messenger://share?link={url}", countUrl: "", shareIn: "self" }, tumblr: { label: "Tumblr", logo: "fa fa-fw fa-tumblr", shareUrl: "https://www.tumblr.com/share/tool?canonicalUrl={url}", countUrl: "" }, reddit: { label: "Reddit", logo: "fa fa-fw fa-reddit-alien", shareUrl: "//www.reddit.com/submit?url={url}", countUrl: "" } }); }(window, jQuery, window.jsSocials));; /* * Bones Scripts File * Author: Eddie Machado * * This file should contain any js scripts you want to add to the site. * Instead of calling it in the header or throwing it inside wp_head() * this file will be called automatically in the footer so as not to * slow the page load. * * There are a lot of example functions and tools in here. If you don't * need any of it, just remove it. They are meant to be helpers and are * not required. It's your world baby, you can do whatever you want. */ /* * Get Viewport Dimensions * returns object with viewport dimensions to match css in width and height properties * ( source: http://andylangton.co.uk/blog/development/get-viewport-size-width-and-height-javascript ) */ function updateViewportDimensions() { var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight; return { width:x,height:y }; } // setting the viewport width var viewport = updateViewportDimensions(); /* * Throttle Resize-triggered Events * Wrap your actions in this function to throttle the frequency of firing them off, for better performance, esp. on mobile. * ( source: http://stackoverflow.com/questions/2854407/javascript-jquery-window-resize-how-to-fire-after-the-resize-is-completed ) */ var waitForFinalEvent = (function () { var timers = {}; return function (callback, ms, uniqueId) { if (!uniqueId) { uniqueId = "Don't call this twice without a uniqueId"; } if (timers[uniqueId]) { clearTimeout (timers[uniqueId]); } timers[uniqueId] = setTimeout(callback, ms); }; })(); // how long to wait before deciding the resize has stopped, in ms. Around 50-100 should work ok. var timeToWaitForLast = 100; /* * Here's an example so you can see how we're using the above function * * This is commented out so it won't work, but you can copy it and * remove the comments. * * * * If we want to only do it on a certain page, we can setup checks so we do it * as efficient as possible. * * if( typeof is_home === "undefined" ) var is_home = $('body').hasClass('home'); * * This once checks to see if you're on the home page based on the body class * We can then use that check to perform actions on the home page only * * When the window is resized, we perform this function * $(window).resize(function () { * * // if we're on the home page, we wait the set amount (in function above) then fire the function * if( is_home ) { waitForFinalEvent( function() { * * // update the viewport, in case the window size has changed * viewport = updateViewportDimensions(); * * // if we're above or equal to 768 fire this off * if( viewport.width >= 768 ) { * console.log('On home page and window sized to 768 width or more.'); * } else { * // otherwise, let's do this instead * console.log('Not on home page, or window sized to less than 768.'); * } * * }, timeToWaitForLast, "your-function-identifier-string"); } * }); * * Pretty cool huh? You can create functions like this to conditionally load * content and other stuff dependent on the viewport. * Remember that mobile devices and javascript aren't the best of friends. * Keep it light and always make sure the larger viewports are doing the heavy lifting. * */ /* * We're going to swap out the gravatars. * In the functions.php file, you can see we're not loading the gravatar * images on mobile to save bandwidth. Once we hit an acceptable viewport * then we can swap out those images since they are located in a data attribute. */ function loadGravatars() { // set the viewport using the function above viewport = updateViewportDimensions(); // if the viewport is tablet or larger, we load in the gravatars if (viewport.width >= 768) { jQuery('.comment img[data-gravatar]').each(function(){ jQuery(this).attr('src',jQuery(this).attr('data-gravatar')); }); } } // end function window.addEventListener('load', function () { checkSize(); }, false); /* * Put all your regular jQuery in here. */ jQuery(document).ready(function($) { /* * Let's fire off the gravatar function * You can remove this if you don't need it */ //loadGravatars(); $('.size-bigger').parent().addClass('size-bigger'); $(window).scroll(function(){ if($(window).scrollTop() > 500){ // $(window).off("scroll"); $('.fly-out.active').css('left','0%'); } }); $('.fly-out-close').click(function() { $('.fly-out').css('left','-120%').removeClass('active'); }); $('.go-search').click(function() { $('.searchform').toggleClass('show'); }); $('.toggle').click(function() { $('nav .other-pubs').toggleClass('show'); }); $('.toggle-other-pubs').click(function() { $('.other-pubs').toggleClass('show'); }); // $( ".other-hoods-insert" ).insertBefore( $( ".other-hoods li:nth-last-child(2)" ) ); jQuery('section.commentlist').hide('fast'); var width = $(window).width(); $(window).on('resize', function(){ if($(this).width() != width){ width = $(this).width(); checkSize(); } }); // remove empty ads (have to have class "blank-ad") $('.blank-ad').parent().remove(); $('.more-news.brooklyn').appendTo('.brooklyn-sites'); $("#share-icons").jsSocials({ shareIn: "popup", showLabel: false, showCount: false, shares: ["facebook", "twitter"] }); $("#sidebar1").hcSticky({followScroll: true, bottom: 20, offResolutions: -768}); // $(".more-news-sidebar").hcSticky({followScroll: true, bottom: 20, offResolutions: -1240}); // $('.more-news-sidebar .more-news').infiniteScroll({ // // options // path: 'http://localhost/queenspost/astoriapost/tropical-themed-bar-to-open-on-corner-of-broadway-and-35th-st/page/{{#}}/', // append: '.article-wrapper', // history: false, // }); if( window.location.hash.match(/^#comment\-[0-9]+$/) ) { // Display a message to comment author $('

Thank you! Your comment will appear shortly.

').insertBefore( $('header.article-header') ); } // Default notification level for comment subscribers // Changed from "yes" for each and every comment $('input#subscribe-reloaded').val('replies'); $(".middle-ar-area").insertAfter($(".events-in-news .article-wrapper:nth-of-type(1)")); // add line break between day of the week and day of the month on weekly calendar view $('.tribe-grid-header .column span').each(function() { var word = $(this).html(); var index = word.indexOf(' '); if(index == -1) { index = word.length; } $(this).html(word.substring(0, index) + '
' + word.substring(index, word.length)); }); // limits summary description to 18 words $(".Xtribe-events-list-event-description p, .Xtribe-event-description p").each(function() { // Some Vars var elText, openSpan = '(...)', closeSpan = ''; // Make the text into array elText = $(this).text().split(" "); // Adding the open span to the beginning of the array elText.splice(18, 0, openSpan); // Adding span closing after the first word in each sentence elText.splice(0, -1, closeSpan); // Make the array into string elText = elText.join(" "); // Change the html of each element to style it $(this).html(elText); }); }); /* end of as page load scripts */ //Function to the css rule (instead of checking from breakpoint it checks to see if an element that only shows on mobile is displayed) function checkSize(){ //768 and above if (jQuery(".toggle").css("display") == "none" ){ setTimeout(function () { //this sets delay so that disqus loads and the size of that iframe height is added to #inner-content height var adsSidebarHeight = jQuery('#sidebar1').outerHeight(true); var moreNewsSidebarHeight = jQuery('.more-news-sidebar').outerHeight(true); var contentHeight = jQuery('#inner-content').outerHeight(true); //console.log(adsSidebarHeight); //console.log(moreNewsSidebarHeight); //console.log(contentHeight); if (moreNewsSidebarHeight > contentHeight) { //jQuery('#main').height(moreNewsSidebarHeight); jQuery('#main').css('min-height', moreNewsSidebarHeight); } var newContentHeight = jQuery('#inner-content').outerHeight(true); if (adsSidebarHeight > newContentHeight) { //jQuery('#main').height(adsSidebarHeight); jQuery('#main').css('min-height', adsSidebarHeight); } jQuery('.footer').css('display', 'block'); }, 3000); } else { //mobile jQuery(".middle-ar-area, .above-footer-ar-area, .entry-content .g").css({ width: '+=40px', left: '-20px', position: 'relative' }); jQuery( ".top-news .article-wrapper:first-of-type .insert-ad" ).remove(); // jQuery('.ad-mobile').each(function (i) { // var n = jQuery('#sidebar1 img').length; // if (i < n) { // jQuery(this).append( jQuery('#sidebar1 img:eq(' + (i) + ')').clone() ); // } // if (i > n-1) { // jQuery(this).append( jQuery('#sidebar1 img:eq(' + (i-n) + ')').clone() ); // } // }); // Get all ads var ads = []; jQuery(".ars .g").each(function(idx) { if( jQuery(this).find("img").length ) { // Skip empty ads ads.push( jQuery(this) ); jQuery(this).detach(); } }); if( ads.length == 0 ) return; // Display ads //firstAd = nextAd(ads); // firstAd.clone().appendTo( jQuery(".query-homepage-main-item-wrapper") ); // firstAd.clone().insertBefore( jQuery("#related-news") ); jQuery(".ad-mobile").each(function(idx) { nextAd(ads).clone().appendTo(jQuery(this)); //dynAds(); }); jQuery(document).ajaxComplete(function() { jQuery(".ad-mobile").each(function(idx) { if ( jQuery(this).is(':empty')) { nextAd(ads).clone().delay(100).appendTo(jQuery(this)); }; }); //dynAds(); }); function nextAd(array) { if(typeof nextAd.idx == 'undefined') { nextAd.idx = 0; } if(typeof nextAd.len == 'undefined') { nextAd.len = array.length; /* console.log("ads count: " + nextAd.len); */ } if( nextAd.idx == nextAd.len) { nextAd.idx = 0; } // rewind array //console.log("ads current idx: " + nextAd.idx); current = array[nextAd.idx]; ++nextAd.idx; return current; } function dynAds() { jQuery(".ad-mobile").each(function() { if( jQuery(this).find(".g-dyn").length ) { // Skip blocks with no dynamic group var blockHeight = jQuery(this).find(jQuery('.g-dyn')).height(); jQuery(this).find(jQuery('.g')).css({'position':'relative','height':blockHeight, 'margin':'0 auto'}) jQuery(this).find(".g").addClass("slider"); jQuery(this).find(".g-dyn").addClass("slide").css('display','block'); }; //console.log('working'); }); jQuery(document).ready(function(){ //console.log('also working'); var options = { transition: "fade", // Accepts "slide" and "fade" for a slide or fade transition slideOnInterval: true, // Slide on interval interval: 6000, // Interval to slide on if slideOnInterval is enabled animateDuration: 10, // Duration of an animation neverEnding: true // Create a 'neverending/repeating' slider effect. }; jQuery(".slider").simpleSlider(options); }); } jQuery("#sidebar1").insertBefore(jQuery(".above-footer-ar-area")); } } ;