1/* ====== JS PLUGINS & EXTENSIONS ====== */ 2 3/* --- $OVERTHROW --- */ 4/* Overthrow. An overflow:auto polyfill for responsive design. 5 * (c) 2012: Scott Jehl, Filament Group, Inc. 6 */ 7/* Detect */ 8 (function(w,undefined){var doc=w.document,docElem=doc.documentElement,enabledClassName="overthrow-enabled",canBeFilledWithPoly="ontouchmove"in doc,nativeOverflow="WebkitOverflowScrolling"in docElem.style||("msOverflowStyle"in docElem.style||(!canBeFilledWithPoly&&w.screen.width>800||function(){var ua=w.navigator.userAgent,webkit=ua.match(/AppleWebKit\/([0-9]+)/),wkversion=webkit&&webkit[1],wkLte534=webkit&&wkversion>=534;return ua.match(/Android ([0-9]+)/)&&(RegExp.$1>=3&&wkLte534)||(ua.match(/ Version\/([0-9]+)/)&& 9(RegExp.$1>=0&&(w.blackberry&&wkLte534))||(ua.indexOf("PlayBook")>-1&&(wkLte534&&!ua.indexOf("Android 2")===-1)||(ua.match(/Firefox\/([0-9]+)/)&&RegExp.$1>=4||(ua.match(/wOSBrowser\/([0-9]+)/)&&(RegExp.$1>=233&&wkLte534)||ua.match(/NokiaBrowser\/([0-9\.]+)/)&&(parseFloat(RegExp.$1)===7.3&&(webkit&&wkversion>=533))))))}()));w.overthrow={};w.overthrow.enabledClassName=enabledClassName;w.overthrow.addClass=function(){if(docElem.className.indexOf(w.overthrow.enabledClassName)===-1)docElem.className+= 10" "+w.overthrow.enabledClassName};w.overthrow.removeClass=function(){docElem.className=docElem.className.replace(w.overthrow.enabledClassName,"")};w.overthrow.set=function(){if(nativeOverflow)w.overthrow.addClass()};w.overthrow.canBeFilledWithPoly=canBeFilledWithPoly;w.overthrow.forget=function(){w.overthrow.removeClass()};w.overthrow.support=nativeOverflow?"native":"none"})(this); 11 12/* Polifyll */
13 (function(w,o,undefined){if(o===undefined)return;o.scrollIndicatorClassName="overthrow";var doc=w.document,docElem=doc.documentElement,nativeOverflow=o.support==="native",canBeFilledWithPoly=o.canBeFilledWithPoly,configure=o.configure,set=o.set,forget=o.forget,scrollIndicatorClassName=o.scrollIndicatorClassName;o.closest=function(target,ascend){return!ascend&&(target.className&&(target.className.indexOf(scrollIndicatorClassName)>-1&&target))||o.closest(target.parentNode)};var enabled=false;o.set= 14function(){set();if(enabled||(nativeOverflow||!canBeFilledWithPoly))return;w.overthrow.addClass();enabled=true;o.support="polyfilled";o.forget=function(){forget();enabled=false;if(doc.removeEventListener)doc.removeEventListener("touchstart",start,false)};var elem,lastTops=[],lastLefts=[],lastDown,lastRight,resetVertTracking=function(){lastTops=[];lastDown=null},resetHorTracking=function(){lastLefts=[];lastRight=null},inputs,setPointers=function(val){inputs=elem.querySelectorAll("textarea, input"); 15for(var i=0,il=inputs.length;i<il;i++)inputs[i].style.pointerEvents=val},changeScrollTarget=function(startEvent,ascend){if(doc.createEvent){var newTarget=(!ascend||ascend===undefined)&&elem.parentNode||(elem.touchchild||elem),tEnd;if(newTarget!==elem){tEnd=doc.createEvent("HTMLEvents");tEnd.initEvent("touchend",true,true);elem.dispatchEvent(tEnd);newTarget.touchchild=elem;elem=newTarget;newTarget.dispatchEvent(startEvent)}}},start=function(e){if(o.intercept)o.intercept();resetVertTracking();resetHorTracking(); 16elem=o.closest(e.target);if(!elem||(elem===docElem||e.touches.length>1))return;setPointers("none");var touchStartE=e,scrollT=elem.scrollTop,scrollL=elem.scrollLeft,height=elem.offsetHeight,width=elem.offsetWidth,startY=e.touches[0].pageY,startX=e.touches[0].pageX,scrollHeight=elem.scrollHeight,scrollWidth=elem.scrollWidth,move=function(e){var ty=scrollT+startY-e.touches[0].pageY,tx=scrollL+startX-e.touches[0].pageX,down=ty>=(lastTops.length?lastTops[0]:0),right=tx>=(lastLefts.length?lastLefts[0]: 170);if(ty>0&&ty<scrollHeight-height||tx>0&&tx<scrollWidth-width)e.preventDefault();else changeScrollTarget(touchStartE);if(lastDown&&down!==lastDown)resetVertTracking();if(lastRight&&right!==lastRight)resetHorTracking();lastDown=down;lastRight=right;elem.scrollTop=ty;elem.scrollLeft=tx;lastTops.unshift(ty);lastLefts.unshift(tx);if(lastTops.length>3)lastTops.pop();if(lastLefts.length>3)lastLefts.pop()},end=function(e){setPointers("auto");setTimeout(function(){setPointers("none")},450);elem.removeEventListener("touchmove", 18move,false);elem.removeEventListener("touchend",end,false)};elem.addEventListener("touchmove",move,false);elem.addEventListener("touchend",end,false)};doc.addEventListener("touchstart",start,false)}})(this,this.overthrow); 19 20 21 22 23/* ====== SHARED VARS ====== */ 24 var phone, touch, ltie9, lteie9, wh, ww, dh, ar, fonts; 25 26 var ua = navigator.userAgent; 27 var winLoc = window.location.toString(); 28 29 var is_webkit = ua.match(/webkit/i); 30 var is_firefox = ua.match(/gecko/i); 31 var is_newer_ie = ua.match(/msie (9|([1-9][0-9]))/i); 32 var is_older_ie = ua.match(/msie/i) && !is_newer_ie; 33 var is_ancient_ie = ua.match(/msie 6/i); 34 var is_mobile = ua.match(/mobile/i);
35 var is_OSX = (ua.match(/(iPad|iPhone|iPod|Macintosh)/g) ? true : false); 36 37 var nua = navigator.userAgent; 38 var is_android = ((nua.indexOf('Mozilla/5.0') > -1 && nua.indexOf('Android ') > -1 && nua.indexOf('AppleWebKit') > -1) && !(nua.indexOf('Chrome') > -1)); 39 40 var useTransform = true; 41 var use2DTransform = (ua.match(/msie 9/i) || winLoc.match(/transform\=2d/i)); 42 var transform; 43 44 // setting up transform prefixes 45 var prefixes = { 46 webkit: 'webkitTransform', 47 firefox: 'MozTransform', 48 ie: 'msTransform', 49 w3c: 'transform' 50 }; 51 52 if (useTransform) { 53 if (is_webkit) { 54 transform = prefixes.webkit; 55 } else if (is_firefox) { 56 transform = prefixes.firefox; 57 } else if (is_newer_ie) { 58 transform = prefixes.ie; 59 } 60 } 61 62var popup_open = 0; 63var isMobile = function () { 64 try{ document.createEvent("TouchEvent"); return true; } 65 catch(e){ return false; } 66}; 67 68// start:scale image 69 70(function(window, undefined){ 71var document = window.document, 72support = { 73transform3d: ("WebKitCSSMatrix" in window && "m11" in new WebKitCSSMatrix()), 74touch: ("ontouchstart" in window) 75}; 76 77function getTranslate(x, y){ 78var distX = x, distY = y; 79return support.transform3d ? "translate3d("+ distX +"px, "+ distY +"px, 0)" : "translate("+ distX +"px, "+ distY +"px)"; 80} 81 82 83function getPage(event, page) { 84return support.touch ? event.changedTouches[0][page] : event[page]; 85} 86 87 88var ImagesZoom = function(){}; 89 90 91ImagesZoom.prototype = { 92// ç»åå§åæ°æ® 93init: function(param){ 94 // console.log("param",param); 95var self = this, 96params = param || {}; 97 98var zoomMask = document.querySelector(".mfp-container"), 99zoomImg = document.querySelector( param.elem+" img"), 100zoomClose = document.querySelector(".mfp-container .mfp-close"); 101// imgSrc = "" 102 103self.maxZoomInSize = params.max_zoom_in_size || 4; // æå¤§æ¾å¤§åæ° 104self.buffMove = 3; //ç¼å²ç³»æ° 105self.buffScale = 2; //æ¾å¤§ç³»æ° 106self.finger = false; //è§¦æ¸ææçç¶æ falseï¼åææ trueï¼å¤ææ 107 108self._destroy(); 109 110 111zoomClose.addEventListener("click", function(){ 112// zoomMask.style.cssText = "display:none"; 113// zoomImg.src = ""; 114// zoomImg.style.cssText = ""; 115// document.querySelector(".ad-slot.top-sticky-mfp-ad").remove(); 116jQuery(".ad-slot.top-sticky-mfp-ad").addClass('hide'); 117self._destroy(); 118 119 120document.removeEventListener("touchmove", self.eventStop, false); 121}, false); 122 123 124// for(var len=imgList.length,i=0; i<len; i++){ 125// imgList[i].addEventListener("click", function(){ 126// imgSrc = this.getAttribute("src"); 127// console.log(zoomImg); 128// zoomMask.style.cssText = "display:block"; 129// zoomImg.src = imgSrc; 130 131 132// zoomImg.onload = function(e){ 133 134// console.log("zoomImgonload",zoomImg); 135 // zoomImg.style.cssText = "margin-top:-"+(zoomImg.offsetHeight/2)+"px;visibility:visible;"; 136var imgBuff= ()=>{ 137 zoomImg.style.cssText = "margin-top:-"+(zoomImg.offsetHeight/2)+"px;visibility:visible;"; 138 // ç¦æ¢é¡µé¢æ»å¨ 139document.addEventListener("touchmove", self.eventStop, false); 140 141self.imgBaseWidth = zoomImg.offsetWidth; 142self.imgBaseHeight = zoomImg.offsetHeight; 143 144 145self.addEventStart({ 146wrapX: zoomMask.offsetWidth, 147wrapY: zoomMask.offsetHeight, 148mapX: zoomImg.width, 149mapY: zoomImg.height 150}); 151} 152 153if(zoomImg.complete){ 154 // console.log("zoomImg.complete",zoomImg.offsetHeight); 155 imgBuff(); 156}else{ 157 // console.log(zoomImg.complete); 158zoomImg.onload = function(){ 159 // console.log('onload',zoomImg.offsetHeight); 160 imgBuff(); 161} 162} 163 164 165// } 166// }, false); 167// } 168}, 169addEventStart: function(param){ 170var self = this, 171params = param || {}; 172 173 174self.element = document.querySelector(".mfp-figure img"); 175 176 177//config set 178self.wrapX = params.wrapX || 0; //å¯è§åºå宽度 179self.wrapY = params.wrapY || 0; //å¯è§åºåé«åº¦ 180self.mapX = params.mapX || 0; //å°å¾å®½åº¦ 181self.mapY = params.mapY || 0; //å°å¾é«åº¦ 182 183 184self.outDistY = (self.mapY - self.wrapY)/2; //å¾çè¶ è¿ä¸å±çæ¶åæç¨ 185 186self.width = self.mapX - self.wrapX; //å°å¾ç宽度åå»å¯è§åºåç宽度 187self.height = self.mapY - self.wrapY; //å°å¾çé«åº¦åå»å¯è§åºåçé«åº¦ 188 189 190self.element.addEventListener("touchstart",function(e){ 191self._touchstart(e); 192},false); 193self.element.addEventListener("touchmove",function(e){ 194self._touchmove(e); 195},false); 196self.element.addEventListener("touchend",function(e){ 197self._touchend(e); 198},false); 199}, 200// éç½®åæ æ°æ® 201_destroy: function(){ 202this.distX = 0; 203this.distY = 0; 204this.newX = 0; 205this.newY = 0; 206}, 207// æ´æ°å°å¾ä¿¡æ¯ 208_changeData: function(){ 209this.mapX = this.element.offsetWidth; //å°å¾å®½åº¦ 210this.mapY = this.element.offsetHeight; //å°å¾é«åº¦
211// this.outDistY = (this.mapY - this.wrapY)/2; //å½å¾çé«åº¦è¶ è¿å±å¹çé«åº¦æ¶åãå¾çæ¯åç´å± ä¸çï¼è¿æ¶ç§»å¨æä¸ªé«åº¦å为ç¼å²å¸¦ 212this.width = this.mapX - this.wrapX; //å°å¾ç宽度åå»å¯è§åºåç宽度 213this.height = this.mapY - this.wrapY; //å°å¾çé«åº¦åå»å¯è§åºåçé«åº¦ 214}, 215_touchstart: function(e){ 216var self = this; 217 218 219e.preventDefault(); 220 221 222var touchTarget = e.targetTouches.length; //è·å¾è§¦æ§ç¹æ° 223 224 225self._changeData(); //éæ°åå§åå¾çãå¯è§åºåæ°æ®ï¼ç±äºæ¾å¤§ä¼äº§çæ°çè®¡ç® 226 227 228if(touchTarget == 1){ 229// è·åå¼å§åæ 230self.basePageX = getPage(e, "pageX"); 231self.basePageY = getPage(e, "pageY"); 232 233 234self.finger = false; 235}else{ 236self.finger = true; 237 238// const touchDistRes = self.getTouchDist(e); 239// self.startFingerDist = touchDistRes.dist; 240// self.startFingerX = touchDistRes.x; 241// const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop; 242// let startFingerY = touchDistRes.y - scrollHeight - 120; 243// self.startFingerY = startFingerY; 244 245self.startFingerDist = self.getTouchDist(e).dist; 246self.startFingerX = self.getTouchDist(e).x; 247self.startFingerY = self.getTouchDist(e).y; 248} 249 250 251// console.log("pageX: "+getPage(e, "pageX")); 252// console.log("pageY: "+getPage(e, "pageY")); 253}, 254_touchmove: function(e){ 255var self = this; 256 257 258e.preventDefault(); 259e.stopPropagation(); 260 261 262// console.log("event.changedTouches[0].pageY: "+event.changedTouches[0].pageY); 263 264var touchTarget = e.targetTouches.length; //è·å¾è§¦æ§ç¹æ° 265 266 267if(touchTarget == 1 && !self.finger){ 268self._move(e); 269} 270 271 272if(touchTarget>=2){ 273self._zoom(e); 274} 275}, 276_touchend: function(e){ 277var self = this; 278 279 280self._changeData(); //éæ°è®¡ç®æ°æ® 281if(self.finger){ 282self.distX = -self.imgNewX; 283self.distY = -self.imgNewY; 284} 285 286 287if( self.distX>0 ){ 288self.newX = 0; 289}else if( self.distX<=0 && self.distX>=-self.width ){ 290self.newX = self.distX; 291self.newY = self.distY; 292}else if( self.distX<-self.width ){ 293self.newX = -self.width; 294} 295self.reset(); 296}, 297_move: function(e){ 298var self = this, 299pageX = getPage(e, "pageX"), //è·åç§»å¨åæ 300pageY = getPage(e, "pageY"); 301// console.log("move",self); 302 303// ç¦æ¢é»è®¤äºä»¶ 304// e.preventDefault(); 305// e.stopPropagation(); 306 307 308// è·å¾ç§»å¨è·ç¦» 309self.distX = (pageX - self.basePageX) + self.newX; 310self.distY = (pageY - self.basePageY) + self.newY; 311 312 313if(self.distX > 0){ 314self.moveX = Math.round(self.distX/self.buffMove); 315}else if( self.distX<=0 && self.distX>=-self.width ){ 316self.moveX = self.distX; 317}else if(self.distX < -self.width ){ 318self.moveX = -self.width+Math.round((self.distX+self.width)/self.buffMove); 319} 320self.movePos(); 321self.finger = false; 322}, 323// å¾çç¼©æ¾ 324_zoom: function(e){ 325var self = this; 326// e.preventDefault(); 327// e.stopPropagation(); 328 329 330var nowFingerDist = self.getTouchDist(e).dist, //è·å¾å½åé¿åº¦ 331ratio = nowFingerDist / self.startFingerDist; //计ç®ç¼©æ¾æ¯ 332 333var imgWidth = Math.round(self.mapX * ratio), //计ç®å¾ç宽度 334imgHeight = Math.round(self.mapY * ratio); //计ç®å¾çé«åº¦ 335// éå¶æ 鿾大 336const maxImgWidth = self.imgBaseWidth * self.maxZoomInSize; 337const maxImgHeight = self.imgBaseHeight * self.maxZoomInSize; 338 if (imgWidth > maxImgWidth) { 339 imgWidth = maxImgWidth; 340 } 341 if (imgHeight > maxImgHeight) { 342 imgHeight = maxImgHeight; 343 } 344 ratio = imgWidth / self.mapX; 345 346// 计ç®å¾çæ°çåæ 347self.imgNewX = Math.round(self.startFingerX * ratio - self.startFingerX - self.newX * ratio); 348self.imgNewY = Math.round((self.startFingerY * ratio - self.startFingerY)/2 - self.newY * ratio); 349 350 351if(imgWidth >= self.imgBaseWidth){ 352 353self.element.style.width = imgWidth + "px"; 354self.refresh(-self.imgNewX, -self.imgNewY, "0s", "ease"); 355self.finger = true; 356}else{ 357if(imgWidth < self.imgBaseWidth){ 358self.element.style.width = self.imgBaseWidth + "px"; 359} 360} 361 362 363self.finger = true; 364}, 365// ç§»å¨åæ 366movePos: function(){ 367var self = this; 368 369 370if(self.height<0){ 371if(self.element.offsetWidth == self.imgBaseWidth){ 372self.moveY = Math.round(self.distY/self.buffMove); 373}else{ 374var moveTop = Math.round((self.element.offsetHeight-self.imgBaseHeight)/2); 375self.moveY = -moveTop + Math.round((self.distY + moveTop)/self.buffMove); 376} 377}else{ 378var a = Math.round((self.wrapY - self.imgBaseHeight)/2), 379b = self.element.offsetHeight - self.wrapY + Math.round(self.wrapY - self.imgBaseHeight)/2; 380 381 382if(self.distY >= -a){ 383self.moveY = Math.round((self.distY + a)/self.buffMove) - a; 384}else if(self.distY <= -b){ 385self.moveY = Math.round((self.distY + b)/self.buffMove) - b; 386}else{ 387self.moveY = self.distY; 388} 389} 390self.refresh(self.moveX, self.moveY, "0s", "ease"); 391}, 392// éç½®æ°æ® 393reset: function(){ 394var self = this, 395hideTime = ".2s"; 396if(self.height<0){ 397self.newY = -Math.round(self.element.offsetHeight - self.imgBaseHeight)/2; 398}else{ 399var a = Math.round((self.wrapY - self.imgBaseHeight)/2) , 400b = self.element.offsetHeight - self.wrapY + Math.round(self.wrapY - self.imgBaseHeight)/2; 401 402 403if(self.distY >= -a){ 404self.newY = -a; 405}else if(self.distY <= -b){ 406self.newY = -b; 407}else{ 408self.newY = self.distY; 409} 410} 411self.refresh(self.newX, self.newY, hideTime, "ease-in-out"); 412}, 413// æ§è¡å¾çç§»å¨ 414refresh: function(x, y, timer, type){ 415this.element.style.webkitTransitionProperty = "-webkit-transform"; 416this.element.style.webkitTransitionDuration = timer; 417this.element.style.webkitTransitionTimingFunction = type; 418this.element.style.webkitTransform = getTranslate(x, y); 419}, 420// è·åå¤ç¹è§¦æ§ 421getTouchDist: function(e){ 422var x1 = 0, 423y1 = 0, 424x2 = 0, 425y2 = 0, 426x3 = 0, 427y3 = 0, 428buffY = 0, 429result = {}; 430 431if(/iPad|iPhone|iPod/.test(navigator.userAgent || navigator.vendor || window.opera) && !window.MSStream ){ 432 // buffY = 108; 433// buffY = this.imgBaseHeight / 2; 434buffY = jQuery('.mfp-img')[0].offsetTop - 32; 435// console.log("iPhone",buffY); 436} 437if(/android/i.test(navigator.userAgent || navigator.vendor || window.opera)){ 438// buffY = this.imgBaseHeight / 2; 439buffY = jQuery('.mfp-img')[0].offsetTop - 14; 440// console.log("android",buffY); 441} 442x1 = e.touches[0].pageX; 443x2 = e.touches[1].pageX; 444y1 = e.touches[0].pageY - window.scrollY - buffY; 445y2 = e.touches[1].pageY - window.scrollY - buffY; 446 447 448if(!x1 || !x2) return; 449 450 451if(x1<=x2){ 452x3 = (x2-x1)/2+x1; 453}else{ 454x3 = (x1-x2)/2+x2; 455} 456if(y1<=y2){ 457y3 = (y2-y1)/2+y1; 458}else{ 459y3 = (y1-y2)/2+y2; 460} 461 462 463result = { 464dist: Math.round(Math.sqrt(Math.pow(x1-x2,2)+Math.pow(y1-y2,2))), 465x: Math.round(x3), 466y: Math.round(y3) 467}; 468return result; 469}, 470eventStop: function(e){ 471e.preventDefault(); 472e.stopPropagation(); 473} 474}; 475 476 477window.ImagesZoom = new ImagesZoom(); 478})(this); 479 480// end:scale image 481 482var globalInit = { 483 magnificPopupOptions : function() { 484 return { 485 delegate: 'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]', 486 type: 'image', 487 removalDelay: 200, 488 image: { 489 titleSrc: function (item){ 490 var $figcaption = jQuery(item.el).parents('figure').find('figcaption:first'); 491 if ($figcaption.length > 0 && $figcaption.text() !== '') { 492 return $figcaption.text(); 493 } 494 var output = ''; 495 if ( typeof item.el.attr('data-title') !== "undefined" && item.el.attr('data-title') !== "") { 496 output = item.el.attr('data-title'); 497 } 498 if ( typeof item.el.attr('data-alt') !== "undefined" && item.el.attr('data-alt') !== "") { 499 output += '<small>'+item.el.attr('data-alt')+'</small>'; 500 } 501 return output; 502 } 503 }, 504 gallery:{ 505 enabled:true, 506 navigateByImgClick: true 507 }, 508 callbacks: { 509 beforeOpen: function () { 510 jQuery(window).trigger('mfp.beforeOpen'); 511 }, 512 open: function (item) { 513 popup_open = 1; 514 515 setTimeout(function(){ 516 jQuery(window).trigger('mfp.open'); 517 518 ImagesZoom.init({ 519 "elem":".mfp-figure", 520 "max_zoom_in_size": 3 521 }); 522 jQuery(".ad-slot.top-sticky-mfp-ad").removeClass('hide'); 523 524 intext=jQuery(".mfp-title")[0].innerText; 525 if(intext!="" && intext!="Sponsored"){ 526 if(document.querySelector('.mfp-title').scrollHeight <= 36){ 527 // console.log('mfp-title:height=36:',document.querySelector('.mfp-title').scrollHeight); 528 jQuery(".mfp-title-arrow").addClass("no-arrow"); 529 }else{ 530 // console.log('mfp-title:height>36:',document.querySelector('.mfp-title').scrollHeight); 531 // document.querySelector('.mfp-title').addEventListener('click',popup_txt_open); 532 document.querySelector('.mfp-title-arrow').addEventListener('click',popup_txt_open); 533 // document.querySelector('.mfp-title-arrow.down').addEventListener('click',popup_txt_close); 534 } 535 }else{ 536 jQuery(".mfp-title-arrow").addClass("no-arrow"); 537 } 538 // if(isMobile()){ 539 // jQuery(".mfp-container").swipe({ 540 // swipeLeft:function(event,direction,distance,duration,fingerCount){ 541 // this.magnificPopup("next"); 542 // }, 543 // swipeRight:function(event,direction,distance,duration,fingerCount){ 544 // this.magnificPopup("prev"); 545 // } 546 // });} 547 },300); 548 }, 549 change: function (item) { 550 jQuery(window).trigger('mfp.change', item); 551 if(popup_open == 1) { 552 setTimeout(function(){ 553 554 ImagesZoom.init({ 555 "elem":".mfp-figure", 556 "max_zoom_in_size": 3 557 }); 558 559 popup_txt_close(); 560 intext=jQuery(".mfp-title")[0].innerText; 561 if(intext!="" && intext!="Sponsored"){ 562 jQuery(".mfp-title-arrow").removeClass("no-arrow"); 563 if(document.querySelector('.mfp-title').scrollHeight <= 36){ 564 // console.log('mfp-title:height=36:',document.querySelector('.mfp-title').scrollHeight); 565 jQuery(".mfp-title-arrow").addClass("no-arrow"); 566 }else{ 567 // console.log('mfp-title:height>36:',document.querySelector('.mfp-title').scrollHeight); 568 // document.querySelector('.mfp-title').addEventListener('click',popup_txt_open); 569 document.querySelector('.mfp-title-arrow').addEventListener('click',popup_txt_open); 570 // document.querySelector('.mfp-title-arrow.down').addEventListener('click',popup_txt_close); 571 } 572 }else{ 573 jQuery(".mfp-title-arrow").addClass("no-arrow"); 574 } 575 },300); 576 } 577 }, 578 beforeClose: function () { 579 jQuery(window).trigger('mfp.beforeClose'); 580 }, 581 close: function () { 582 history.pushState(0,0,"#gallery_close"); 583 jQuery(window).trigger('mfp.close'); 584 popup_open = 0; 585 } 586 } 587 }; 588 }, 589 magnificPopupInit : function() { 590 if(isMobile()){ 591 console.log('mobile'); 592 jQuery('.js-post-gallery').each(function() { 593 jQuery(this).magnificPopup(globalInit.magnificPopupOptions()); 594 //jQuery(this).magnificPopup(globalInit.magnificPopupOptions()).swipe({slidesPerview:"auto",centredSlides:true}); 595 }); 596 }else{ 597 console.log('desktop'); 598 jQuery('.js-post-gallery').each(function() { 599 jQuery(this).magnificPopup(globalInit.magnificPopupOptions()); 600 // jQuery(this).magnificPopup(globalInit.magnificPopupOptions()).swipe({slidesPerview:"auto",centredSlides:true}); 601 }); 602 }; 603
604 }, 605 facebookPopup : function(title,id){ 606 if(title){ 607 window.gaPostTitle = title; 608 }else{ 609 window.gaPostTitle = jQuery('.article__title--single').text(); 610 } 611 if(id){ 612 window.gaPostId = id; 613 }else{ 614 var PostId = jQuery('.post-container').attr('id'); 615 if(PostId){ 616 var res = PostId.split("-"); 617 window.gaPostId = res[1]; 618 } 619 620 } 621 //console.log(window.gaPostId); 622 if(jQuery('.spu-box').find('.fb-like').length > 0) 623 jQuery('.spu-box').find('.fb-like').attr("data-label",window.gaPostId + '_' + window.gaPostTitle); 624 } 625 626}; 627 628(function($, window, undefined) { 629 630 /* --- DETECT PLATFORM --- */ 631 632 function platformDetect(){ 633 $.support.touch = 'ontouchend' in document; 634 var navUA = navigator.userAgent.toLowerCase(), 635 navPlat = navigator.platform.toLowerCase(); 636 637 var isiPhone = navPlat.indexOf("iphone"), 638 isiPod = navPlat.indexOf("ipod"), 639 isAndroidPhone = navPlat.indexOf("android"), 640 safari = (navUA.indexOf('safari') != -1 && navUA.indexOf('chrome') == -1) ? true : false, 641 svgSupport = (window.SVGAngle) ? true : false, 642 svgSupportAlt = (document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")) ? true : false, 643 ff3x = (/gecko/i.test(navUA) && /rv:1.9/i.test(navUA)) ? true : false; 644 645 phone = (isiPhone > -1 || isiPod > -1 || isAndroidPhone > -1) ? true : false; 646 touch = $.support.touch ? true : false; 647 ltie9 = $.support.leadingWhitespace ? false : true; 648 lteie9 = typeof window.atob === 'undefined' ? true : false; 649 650 var $bod = $('body'); 651 652 if (touch) {$bod.addClass('touch');} 653 if (safari) $bod.addClass('safari'); 654 if (phone) $bod.addClass('phone'); 655 }; 656 657 658 659 660 /* ====== PLUGINS & EXTENSIONS ====== */ 661 662 /* --- $MODERNIZR --- */ 663 664 /* Modernizr 2.7.0 (Custom Build) | MIT & BSD 665 * Build: http://modernizr.com/download/#-flexbox-flexboxlegacy-cssanimations-csstransforms-csstransforms3d-csstransitions-touch-shiv-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes-load 666 */ 667 ;window.Modernizr=function(a,b,c){function z(a){j.cssText=a}function A(a,b){return z(m.join(a+";")+(b||""))}function B(a,b){return typeof a===b}function C(a,b){return!!~(""+a).indexOf(b)}function D(a,b){for(var d in a){var e=a[d];if(!C(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function E(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:B(f,"function")?f.bind(d||b):f}return!1}function F(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return B(b,"string")||B(b,"undefined")?D(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),E(e,b,c))}var d="2.7.0",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["­",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x={}.hasOwnProperty,y;!B(x,"undefined")&&!B(x.call,"undefined")?y=function(a,b){return x.call(a,b)}:y=function(a,b){return b in a&&B(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.flexbox=function(){return F("flexWrap")},q.flexboxlegacy=function(){return F("boxDirection")},q.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:w(["@media (",m.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},q.cssanimations=function(){return F("animationName")},q.csstransforms=function(){return!!F("transform")},q.csstransforms3d=function(){var a=!!F("perspective");return a&&"webkitPerspective"in g.style&&w("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},q.csstransitions=function(){return F("transition")};for(var G in q)y(q,G)&&(v=G.toLowerCase(),e[v]=q[G](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)y(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},z(""),i=k=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;
667return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?: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,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.testProp=function(a){return D([a])},e.testAllProps=F,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f<d;f++)g=a[f].split("="),(e=z[g.shift()])&&(c=e(c,g));for(f=0;f<b;f++)c=x[f](c);return c}function g(a,e,f,g,h){var i=b(a),j=i.autoCallback;i.url.split(".").pop().split("?").shift(),i.bypass||(e&&(e=d(e)?e:e[a]||e[g]||e[a.split("/").pop().split("?")[0]]),i.instead?i.instead(a,e,f,g,h):(y[i.url]?i.noexec=!0:y[i.url]=1,f.load(i.url,i.forceCSS||!i.forceJS&&"css"==i.url.split(".").pop().split("?").shift()?"c":c,i.noexec,i.attrs,i.timeout),(d(e)||d(j))&&f.load(function(){k(),e&&e(i.origUrl,h,g),j&&j(i.origUrl,h,g),y[i.url]=2})))}function h(a,b){function c(a,c){if(a){if(e(a))c||(j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}),g(a,j,b,0,h);else if(Object(a)===a)for(n in m=function(){var b=0,c;for(c in a)a.hasOwnProperty(c)&&b++;return b}(),a)a.hasOwnProperty(n)&&(!c&&!--m&&(d(j)?j=function(){var a=[].slice.call(arguments);k.apply(this,a),l()}:j[n]=function(a){return function(){var b=[].slice.call(arguments);a&&a.apply(this,b),l()}}(k[n])),g(a[n],j,b,n,h))}else!c&&l()}var h=!!a.test,i=a.load||a.both,j=a.callback||f,k=j,l=a.complete||f,m,n;c(h?a.yep:a.nope,!!i),i&&c(i)}var i,j,l=this.yepnope.loader;if(e(a))g(a,0,l,0);else if(w(a))for(i=0;i<a.length;i++)j=a[i],e(j)?g(j,0,l,0):w(j)?B(j):Object(j)===j&&h(j,l);else Object(a)===a&&h(a,l)},B.addPrefix=function(a,b){z[a]=b},B.addFilter=function(a){x.push(a)},B.errorTimeout=1e4,null==b.readyState&&b.addEventListener&&(b.readyState="loading",b.addEventListener("DOMContentLoaded",A=function(){b.removeEventListener("DOMContentLoaded",A,0),b.readyState="complete"},0)),a.yepnope=k(),a.yepnope.executeStack=h,a.yepnope.injectJs=function(a,c,d,e,i,j){var k=b.createElement("script"),l,o,e=e||B.errorTimeout;k.src=a;for(o in d)k.setAttribute(o,d[o]);c=j?h:c||f,k.onreadystatechange=k.onload=function(){!l&&g(k.readyState)&&(l=1,c(),k.onload=k.onreadystatechange=null)},m(function(){l||(l=1,c(1))},e),i?k.onload():n.parentNode.insertBefore(k,n)},a.yepnope.injectCss=function(a,c,d,e,g,i){var e=b.createElement("link"),j,c=i?h:c||f;e.href=a,e.rel="stylesheet",e.type="text/css";for(j in d)e.setAttribute(j,d[j]);g||(n.parentNode.insertBefore(e,n),m(c,0))}}(this,document),Modernizr.load=function(){yepnope.apply(window,[].slice.call(arguments,0))}; 668 669 670 /* --- $HOVERINTENT --- */ 671 672 /* hoverIntent r7 // 2013.03.11 // jQuery 1.9.1+ 673 * http://cherne.net/brian/resources/jquery.hoverIntent.html 674 * 675 * You may use hoverIntent under the terms of the MIT license. 676 * Copyright 2007, 2013 Brian Cherne 677 */ 678 (function(e){e.fn.hoverIntent=function(t,n,r){var i={interval:100,sensitivity:7,timeout:0};if(typeof t==="object"){i=e.extend(i,t)}else if(e.isFunction(n)){i=e.extend(i,{over:t,out:n,selector:r})}else{i=e.extend(i,{over:t,out:t,selector:n})}var s,o,u,a;var f=function(e){s=e.pageX;o=e.pageY};var l=function(t,n){n.hoverIntent_t=clearTimeout(n.hoverIntent_t);if(Math.abs(u-s)+Math.abs(a-o)<i.sensitivity){e(n).off("mousemove.hoverIntent",f);n.hoverIntent_s=1;return i.over.apply(n,[t])}else{u=s;a=o;n.hoverIntent_t=setTimeout(function(){l(t,n)},i.interval)}};var c=function(e,t){t.hoverIntent_t=clearTimeout(t.hoverIntent_t);t.hoverIntent_s=0;return i.out.apply(t,[e])};var h=function(t){var n=jQuery.extend({},t);var r=this;if(r.hoverIntent_t){r.hoverIntent_t=clearTimeout(r.hoverIntent_t)}if(t.type=="mouseenter"){u=n.pageX;a=n.pageY;e(r).on("mousemove.hoverIntent",f);if(r.hoverIntent_s!=1){r.hoverIntent_t=setTimeout(function(){l(n,r)},i.interval)}}else{e(r).off("mousemove.hoverIntent",f);if(r.hoverIntent_s==1){r.hoverIntent_t=setTimeout(function(){c(n,r)},i.timeout)}}};return this.on({"mouseenter.hoverIntent":h,"mouseleave.hoverIntent":h},i.selector)}})(jQuery) 679 680 681 682 /* --- $SALVATTORE --- */ 683 684 /* 685 * Salvattore 1.0.5 by @rnmp and @ppold 686 * https://github.com/rnmp/salvattore 687 */ 688 function salvattore(){(function(root, factory) { 689 if(typeof exports === 'object') { 690 module.exports = factory(); 691 } 692 else if(typeof define === 'function' && define.amd) { 693 define('salvattore', [], factory); 694 } 695 else { 696 root.salvattore = factory(); 697 } 698 }(this, function() { 699 /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */ 700 701 window.matchMedia || (window.matchMedia = function() { 702 "use strict"; 703 704 // For browsers that support matchMedium api such as IE 9 and webkit 705 var styleMedia = (window.styleMedia || window.media); 706 707 // For those that don't support matchMedium 708 if (!styleMedia) { 709 var style = document.createElement('style'), 710 script = document.getElementsByTagName('script')[0], 711 info = null; 712 713 style.type = 'text/css'; 714 style.id = 'matchmediajs-test'; 715 716 script.parentNode.insertBefore(style, script); 717 718 // 'style.currentStyle' is used by IE <= 8 and 'window.getComputedStyle' for all other browsers 719 info = ('getComputedStyle' in window) && window.getComputedStyle(style, null) || style.currentStyle; 720 721 styleMedia = { 722 matchMedium: function(media) { 723 var text = '@media ' + media + '{ #matchmediajs-test { width: 1px; } }'; 724 725 // 'style.styleSheet' is used by IE <= 8 and 'style.textContent' for all other browsers 726 if (style.styleSheet) { 727 style.styleSheet.cssText = text; 728 } else { 729 style.textContent = text; 730 } 731 732 // Test if media query is true or false 733 return info.width === '1px'; 734 } 735 }; 736 } 737 738 return function(media) { 739 return { 740 matches: styleMedia.matchMedium(media || 'all'), 741 media: media || 'all' 742 }; 743 }; 744 }()); 745 ;/*! matchMedia() polyfill addListener/removeListener extension. Author & copyright (c) 2012: Scott Jehl. Dual MIT/BSD license */ 746 (function(){ 747 // Bail out for browsers that have addListener support 748 if (window.matchMedia && window.matchMedia('all').addListener) { 749 return false;
750 } 751 752 var localMatchMedia = window.matchMedia, 753 hasMediaQueries = localMatchMedia('only all').matches, 754 isListening = false, 755 timeoutID = 0, // setTimeout for debouncing 'handleChange' 756 queries = [], // Contains each 'mql' and associated 'listeners' if 'addListener' is used 757 handleChange = function(evt) { 758 // Debounce 759 clearTimeout(timeoutID); 760 761 timeoutID = setTimeout(function() { 762 for (var i = 0, il = queries.length; i < il; i++) { 763 var mql = queries[i].mql, 764 listeners = queries[i].listeners || [], 765 matches = localMatchMedia(mql.media).matches; 766 767 // Update mql.matches value and call listeners 768 // Fire listeners only if transitioning to or from matched state 769 if (matches !== mql.matches) { 770 mql.matches = matches; 771 772 for (var j = 0, jl = listeners.length; j < jl; j++) { 773 listeners[j].call(window, mql); 774 } 775 } 776 } 777 }, 30); 778 }; 779 780 window.matchMedia = function(media) { 781 var mql = localMatchMedia(media), 782 listeners = [], 783 index = 0; 784 785 mql.addListener = function(listener) { 786 // Changes would not occur to css media type so return now (Affects IE <= 8) 787 if (!hasMediaQueries) { 788 return; 789 } 790 791 // Set up 'resize' listener for browsers that support CSS3 media queries (Not for IE <= 8) 792 // There should only ever be 1 resize listener running for performance 793 if (!isListening) { 794 isListening = true; 795 window.addEventListener('resize', handleChange, true); 796 } 797 798 // Push object only if it has not been pushed already 799 if (index === 0) { 800 index = queries.push({ 801 mql : mql, 802 listeners : listeners 803 }); 804 } 805 806 listeners.push(listener); 807 }; 808 809 mql.removeListener = function(listener) { 810 for (var i = 0, il = listeners.length; i < il; i++){ 811 if (listeners[i] === listener){ 812 listeners.splice(i, 1); 813 } 814 } 815 }; 816 817 return mql; 818 }; 819 }()); 820 ;// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ 821// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating 822 823// requestAnimationFrame polyfill by Erik Mรà¸ller. fixes from Paul Irish and Tino Zijdel 824 825// MIT license 826 827 (function() { 828 var lastTime = 0; 829 var vendors = ['ms', 'moz', 'webkit', 'o']; 830 for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { 831 window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; 832 window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] 833 || window[vendors[x]+'CancelRequestAnimationFrame']; 834 } 835 836 if (!window.requestAnimationFrame) 837 window.requestAnimationFrame = function(callback, element) { 838 var currTime = new Date().getTime(); 839 var timeToCall = Math.max(0, 16 - (currTime - lastTime)); 840 var id = window.setTimeout(function() { callback(currTime + timeToCall); }, 841 timeToCall); 842 lastTime = currTime + timeToCall; 843 return id; 844 }; 845 846 if (!window.cancelAnimationFrame) 847 window.cancelAnimationFrame = function(id) { 848 clearTimeout(id); 849 }; 850 }()); 851 ;var salvattore = (function (global, document, undefined) { 852 "use strict"; 853 854 var self = {}, 855 grids = [], 856 add_to_dataset = function(element, key, value) { 857 // uses dataset function or a fallback for <ie10 858 if (element.dataset) { 859 element.dataset[key] = value; 860 } else { 861 element.setAttribute("data-" + key, value); 862 } 863 return; 864 }; 865 866 self.obtain_grid_settings = function obtain_grid_settings(element) { 867 // returns the number of columns and the classes a column should have, 868 // from computing the style of the ::before pseudo-element of the grid. 869 870 var computedStyle = global.getComputedStyle(element, ":before") 871 , content = computedStyle.getPropertyValue("content").slice(1, -1) 872 , matchResult = content.match(/^\s*(\d+)(?:\s?\.(.+))?\s*$/) 873 , numberOfColumns 874 , columnClasses 875 ; 876 877 if (matchResult) { 878 numberOfColumns = matchResult[1]; 879 columnClasses = matchResult[2]; 880 columnClasses = columnClasses? columnClasses.split(".") : ["column"]; 881 } else { 882 matchResult = content.match(/^\s*\.(.+)\s+(\d+)\s*$/); 883 columnClasses = matchResult[1]; 884 numberOfColumns = matchResult[2]; 885 if (numberOfColumns) { 886 numberOfColumns = numberOfColumns.split("."); 887 } 888 } 889 890 return { 891 numberOfColumns: numberOfColumns, 892 columnClasses: columnClasses 893 }; 894 }; 895 896 897 self.add_columns = function add_columns(grid, items) { 898 // from the settings obtained, it creates columns with 899 // the configured classes and adds to them a list of items. 900 901 var settings = self.obtain_grid_settings(grid) 902 , numberOfColumns = settings.numberOfColumns 903 , columnClasses = settings.columnClasses 904 , columnsItems = new Array(+numberOfColumns) 905 , columnsFragment = document.createDocumentFragment() 906 , i = numberOfColumns 907 , selector 908 ; 909 910 while (i-- !== 0) { 911 selector = "[data-columns] > *:nth-child(" + numberOfColumns + "n-" + i + ")"; 912 columnsItems.push(items.querySelectorAll(selector)); 913 } 914
915 columnsItems.forEach(function append_to_grid_fragment(rows) { 916 var column = document.createElement("div") 917 , rowsFragment = document.createDocumentFragment() 918 ; 919 920 column.className = columnClasses.join(" "); 921 922 Array.prototype.forEach.call(rows, function append_to_column(row) { 923 rowsFragment.appendChild(row); 924 }); 925 column.appendChild(rowsFragment); 926 columnsFragment.appendChild(column); 927 }); 928 929 grid.appendChild(columnsFragment); 930 add_to_dataset(grid, 'columns', numberOfColumns); 931 }; 932 933 934 self.remove_columns = function remove_columns(grid) { 935 // removes all the columns from a grid, and returns a list 936 // of items sorted by the ordering of columns. 937 938 var range = document.createRange(); 939 range.selectNodeContents(grid); 940 941 var columns = Array.prototype.filter.call(range.extractContents().childNodes, function filter_elements(node) { 942 return node instanceof global.HTMLElement; 943 }); 944 945 var numberOfColumns = columns.length 946 , numberOfRowsInFirstColumn = columns[0].childNodes.length 947 , sortedRows = new Array(numberOfRowsInFirstColumn * numberOfColumns) 948 ; 949 950 Array.prototype.forEach.call(columns, function iterate_columns(column, columnIndex) { 951 Array.prototype.forEach.call(column.children, function iterate_rows(row, rowIndex) { 952 sortedRows[rowIndex * numberOfColumns + columnIndex] = row; 953 }); 954 }); 955 956 var container = document.createElement("div"); 957 add_to_dataset(container, 'columns', 0); 958 959 sortedRows.filter(function filter_non_null(child) { 960 return !!child; 961 }
961).forEach(function append_row(child) { 962 container.appendChild(child); 963 }); 964 965 return container; 966 }; 967 968 969 self.recreate_columns = function recreate_columns(grid) { 970 // removes all the columns from the grid, and adds them again, 971 // it is used when the number of columns change. 972 973 global.requestAnimationFrame(function render_after_css_media_query_change() { 974 self.add_columns(grid, self.remove_columns(grid)); 975 }); 976 }; 977 978 979 self.media_query_change = function media_query_change(mql) { 980 // recreates the columns when a media query matches the current state 981 // of the browser. 982 983 if (mql.matches) { 984 Array.prototype.forEach.call(grids, self.recreate_columns); 985 } 986 }; 987 988 989 self.get_css_rules = function get_css_rules(stylesheet) { 990 // returns a list of css rules from a stylesheet 991 992 var cssRules; 993 try { 994 cssRules = stylesheet.sheet.cssRules || stylesheet.sheet.rules; 995 } catch (e) { 996 return []; 997 } 998 999 return cssRules || []; 1000 }; 1001 1002 1003 self.get_stylesheets = function get_stylesheets() { 1004 // returns a list of all the styles in the document (that are accessible). 1005 1006 return Array.prototype.concat.call( 1007 Array.prototype.slice.call(document.querySelectorAll("style[type='text/css']")), 1008 Array.prototype.slice.call(document.querySelectorAll("link[rel='stylesheet']")) 1009 ); 1010 }; 1011 1012 1013 self.media_rule_has_columns_selector = function media_rule_has_columns_selector(rules) { 1014 // checks if a media query css rule has in its contents a selector that 1015 // styles the grid. 1016 if (typeof rules == 'undefined' || !(rules instanceof Array)) { 1017 return false; 1018 } 1019 var i = rules.length 1020 , rule 1021 ; 1022 1023 while (i--) { 1024 rule = rules[i]; 1025 if (rule.selectorText && rule.selectorText.match(/\[data-columns\](.*)::?before$/)) { 1026 return true; 1027 } 1028 } 1029 1030 return false; 1031 }; 1032 1033 1034 self.scan_media_queries = function scan_media_queries() { 1035 // scans all the stylesheets for selectors that style grids, 1036 // if the matchMedia API is supported. 1037 1038 var mediaQueries = []; 1039 1040 if (!global.matchMedia) { 1041 return; 1042 } 1043 1044 self.get_stylesheets().forEach(function extract_rules(stylesheet) { 1045 Array.prototype.forEach.call(self.get_css_rules(stylesheet), function filter_by_column_selector(rule) { 1046 if (rule.media && self.media_rule_has_columns_selector(rule.cssRules)) { 1047 mediaQueries.push(global.matchMedia(rule.media.mediaText)); 1048 } 1049 }); 1050 }); 1051 1052 mediaQueries.forEach(function listen_to_changes(mql) { 1053 mql.addListener(self.media_query_change); 1054 }); 1055 }; 1056 1057
1058 self.next_element_column_index = function next_element_column_index(grid) { 1059 // returns the index of the column where the given element must be added. 1060 1061 var children = grid.children 1062 , m = children.length 1063 , lowestRowCount = 0 1064 , child 1065 , currentRowCount 1066 , i 1067 , index = 0 1068 ; 1069 1070 for (i = 0; i < m; i++) { 1071 child = children[i]; 1072 currentRowCount = child.children.length; 1073 if(lowestRowCount == 0) { 1074 lowestRowCount = currentRowCount; 1075 } 1076 if(currentRowCount < lowestRowCount) { 1077 index = i; 1078 lowestRowCount = currentRowCount; 1079 } 1080 } 1081 1082 return index; 1083 }; 1084 1085 1086 self.create_list_of_fragments = function create_list_of_fragments(quantity) { 1087 // returns a list of fragments 1088 1089 var fragments = new Array(quantity) 1090 , i = 0 1091 ; 1092 1093 while (i !== quantity) { 1094 fragments[i] = document.createDocumentFragment(); 1095 i++; 1096 } 1097 1098 return fragments; 1099 }; 1100 1101 1102 self.append_elements = function append_elements(grid, elements) { 1103 // adds a list of elements to the end of a grid 1104 1105 var columns = grid.children 1106 , numberOfColumns = columns.length 1107 , fragments = self.create_list_of_fragments(numberOfColumns) 1108 ; 1109 1110 elements.forEach(function append_to_next_fragment(element) {
1111 var columnIndex = self.next_element_column_index(grid); 1112 fragments[columnIndex].appendChild(element); 1113 }); 1114 1115 Array.prototype.forEach.call(columns, function insert_column(column, index) { 1116 column.appendChild(fragments[index]); 1117 }); 1118 }; 1119 1120 1121 self.prepend_elements = function prepend_elements(grid, elements) { 1122 // adds a list of elements to the start of a grid 1123 1124 var columns = grid.children 1125 , numberOfColumns = columns.length 1126 , fragments = self.create_list_of_fragments(numberOfColumns) 1127 , columnIndex = numberOfColumns - 1 1128 ; 1129 1130 elements.forEach(function append_to_next_fragment(element) { 1131 var fragment = fragments[columnIndex]; 1132 fragment.insertBefore(element, fragment.firstChild); 1133 if (columnIndex === 0) { 1134 columnIndex = numberOfColumns - 1; 1135 } else { 1136 columnIndex--; 1137 } 1138 }); 1139 1140 Array.prototype.forEach.call(columns, function insert_column(column, index) { 1141 column.insertBefore(fragments[index], column.firstChild); 1142 }); 1143 1144 // populates a fragment with n columns till the right 1145 var fragment = document.createDocumentFragment() 1146 , numberOfColumnsToExtract = elements.length % numberOfColumns 1147 ; 1148 1149 while (numberOfColumnsToExtract-- !== 0) { 1150 fragment.appendChild(grid.lastChild); 1151 } 1152 1153 // adds the fragment to the left 1154 grid.insertBefore(fragment, grid.firstChild); 1155 }; 1156 1157 1158 self.register_grid = function register_grid (grid) { 1159 if (global.getComputedStyle(grid).display === "none") { 1160 return; 1161 } 1162 1163 // retrieve the list of items from the grid itself 1164 var range = document.createRange(); 1165 range.selectNodeContents(grid); 1166 1167 var items = document.createElement("div"); 1168 items.appendChild(range.extractContents()); 1169 1170 1171 add_to_dataset(items, 'columns', 0); 1172 self.add_columns(grid, items); 1173 grids.push(grid); 1174 }; 1175 1176 1177 self.init = function init() { 1178 // adds required CSS rule to hide 'content' based 1179 // configuration. 1180 1181 var css = document.createElement("style"); 1182 css.innerHTML = "[data-columns]::before{visibility:hidden;position:absolute;font-size:1px;}"; 1183 document.head.appendChild(css); 1184 1185 // scans all the grids in the document and generates 1186 // columns from their configuration. 1187 1188 var gridElements = document.querySelectorAll("[data-columns]"); 1189 //Array.prototype.forEach.call(gridElements, self.register_grid); 1190 if($('#main').hasClass('cus_list')){ 1191 Array.prototype.forEach.call(gridElements, function(){}) 1192 }else{ 1193 Array.prototype.forEach.call(gridElements, self.register_grid); 1194 } 1195 self.scan_media_queries(); 1196 }; 1197 1198 1199 self.init(); 1200 1201 return { 1202 append_elements: self.append_elements, 1203 prepend_elements: self.prepend_elements, 1204 register_grid: self.register_grid 1205 }; 1206 1207 })(window, window.document); 1208 1209 return salvattore; 1210 }));} 1211 1212 1213 /* --- $RESPOND JS --- */ 1214 1215 /*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */ 1216 /*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */ 1217 window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.documentElement,e=d.firstElementChild||d.firstChild,f=a.createElement("body"),g=a.createElement("div");return g.id="mq-test-1",g.style.cssText="position:absolute;top:-100em",f.style.background="none",f.appendChild(g),function(a){return g.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',d.insertBefore(f,e),c=42===g.offsetWidth,d.removeChild(f),{matches:c,media:a}}}(document); 1218 1219 /*! Respond.js v1.3.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ 1220 (function(a){"use strict";function x(){u(!0)}var b={};if(a.respond=b,b.update=function(){},b.mediaQueriesSupported=a.matchMedia&&a.matchMedia("only all").matches,!b.mediaQueriesSupported){var q,r,t,c=a.document,d=c.documentElement,e=[],f=[],g=[],h={},i=30,j=c.getElementsByTagName("head")[0]||d,k=c.getElementsByTagName("base")[0],l=j.getElementsByTagName("link"),m=[],n=function(){for(var b=0;l.length>b;b++){var c=l[b],d=c.href,e=c.media,f=c.rel&&"stylesheet"===c.rel.toLowerCase();d&&f&&!h[d]&&(c.styleSheet&&c.styleSheet.rawCssText?(p(c.styleSheet.rawCssText,d,e),h[d]=!0):(!/^([a-zA-Z:]*\/\/)/.test(d)&&!k||d.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&m.push({href:d,media:e}))}o()},o=function(){if(m.length){var b=m.shift();v(b.href,function(c){p(c,b.href,b.media),h[b.href]=!0,a.setTimeout(function(){o()},0)})}},p=function(a,b,c){var d=a.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),g=d&&d.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+b+"$2$3")},i=!g&&c;b.length&&(b+="/"),i&&(g=1);for(var j=0;g>j;j++){var k,l,m,n;i?(k=c,f.push(h(a))):(k=d[j].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,f.push(RegExp.$2&&h(RegExp.$2))),m=k.split(","),n=m.length;for(var o=0;n>o;o++)l=m[o],e.push({media:l.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:f.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}u()},s=function(){var a,b=c.createElement("div"),e=c.body,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",e||(e=f=c.createElement("body"),e.style.background="none"),e.appendChild(b),d.insertBefore(e,d.firstChild),a=b.offsetWidth,f?d.removeChild(e):e.removeChild(b),a=t=parseFloat(a)},u=function(b){var h="clientWidth",k=d[h],m="CSS1Compat"===c.compatMode&&k||c.body[h]||k,n={},o=l[l.length-1],p=(new Date).getTime();if(b&&q&&i>p-q)return a.clearTimeout(r),r=a.setTimeout(u,i),void 0;q=p;for(var v in e)if(e.hasOwnProperty(v)){var w=e[v],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?t||s():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?t||s():1)),w.hasquery&&(z&&A||!(z||m>=x)||!(A||y>=m))||(n[w.media]||(n[w.media]=[]),n[w.media].push(f[w.rules]))}for(var C in g)g.hasOwnProperty(C)&&g[C]&&g[C].parentNode===j&&j.removeChild(g[C]);for(var D in n)if(n.hasOwnProperty(D)){var E=c.createElement("style"),F=n[D].join("\n");E.type="text/css",E.media=D,j.insertBefore(E,o.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(c.createTextNode(F)),g.push(E)}},v=function(a,b){var c=w();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))},w=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}();n(),b.update=n,a.addEventListener?a.addEventListener("resize",x,!1):a.attachEvent&&a.attachEvent("onresize",x)}})(this); 1221 1222 1223 1224 /* --- $EASING --- */ 1225 1226 /* 1227 * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ 1228 */ 1229 // t: current time, b: begInnIng value, c: change In value, d: duration 1230 jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(x,t,b,c,d){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*0.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*0.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*(0.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 -0.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)*0.5+c+b;}
1230,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+0.75)+b;}else{if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+0.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+0.984375)+b;}}}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2){return jQuery.easing.easeInBounce(x,t*2,0,c,d)*0.5+b;}return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*0.5+c*0.5+b;}}); 1231 1232 1233 /* --- $outerHTML Plugin --- */ 1234 1235 $.fn.outerHTML = function(){ 1236 1237 // IE, Chrome & Safari will comply with the non-standard outerHTML, all others (FF) will have a fall-back for cloning 1238 return (!this.length) ? this : (this[0].outerHTML || ( 1239 function(el){ 1240 var div = document.createElement('div'); 1241 div.appendChild(el.cloneNode(true)); 1242 var contents = div.innerHTML; 1243 div = null; 1244 return contents; 1245 })(this[0])); 1246 }; 1247 1248 1249 1250 /* --- ORGANIC TABS --- */ 1251 1252 // --- MODIFIED 1253 // https://github.com/CSS-Tricks/jQuery-Organic-Tabs 1254 $.organicTabs = function (el, options) { 1255 var base = this; 1256 base.$el = $(el); 1257 base.$nav = base.$el.find(".tabs__nav"); 1258 base.init = function () { 1259 base.options = $.extend({}, $.organicTabs.defaultOptions, options); 1260 var $allListWrap = base.$el.find(".tabs__content"), 1261 curList = base.$el.find("a.current").attr("href").substring(1); 1262 $allListWrap.height(base.$el.find("#" + curList).height()); 1263 1264 base.$nav.find("li > a").click(function(event) { 1265 var curList = base.$el.find("a.current").attr("href").substring(1), 1266 $newList = $(this), 1267 listID = $newList.attr("href").substring(1); 1268 1269 1270 if ((listID != curList) && (base.$el.find(":animated").length == 0)) { 1271 base.$el.find("#" + curList).css({ 1272 opacity: 0, 1273 "z-index": 10, 1274 display: "none" 1275 }); 1276 1277 var newHeight = base.$el.find("#" + listID).height(); 1278 $allListWrap.css({ 1279 height: newHeight 1280 }); 1281 1282 setTimeout(function () { 1283 base.$el.find("#" + curList); 1284 base.$el.find("#" + listID).css({ 1285 opacity: 1, 1286 "z-index": 20, 1287 display: "block" 1288 }); 1289 base.$el.find(".tabs__nav li a").removeClass("current"); 1290 $newList.addClass("current"); 1291 }, 250); 1292 } 1293 event.preventDefault(); 1294 }); 1295 }; 1296 base.init(); 1297}; 1298$.organicTabs.defaultOptions = { 1299 speed: 300 1300}; 1301$.fn.organicTabs = function (options) { 1302 return this.each(function () { 1303 (new $.organicTabs(this, options)); 1304 }); 1305}; 1306 1307 /* --- FASTCLICK --- */ 1308 1309 /* Polyfill to remove click delays on browsers with touch UIs. 1310 @version 0.6.7 1311 @codingstandard ftlabs-jsv2 1312 @copyright The Financial Times Limited [All Rights Reserved] 1313 @license MIT License (see LICENSE.txt) 1314 */ 1315 // function FastClick(a){var b,c=this;this.trackingClick=!1;this.trackingClickStart=0;this.targetElement=null;this.lastTouchIdentifier=this.touchStartY=this.touchStartX=0;this.layer=a;if(!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)};this.onTouchEnd= 1316 // function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)};FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel", 1317 // this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(d,b,c){var e=Node.prototype.removeEventListener;"click"===d?e.call(a,d,b.hijacked||b,c):e.call(a,d,b,c)},a.addEventListener=function(b,c,f){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.prop
1317agationStopped||c(a)}),f):e.call(a,b,c,f)}),"function"===typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))} 1318 // FastClick.prototype.deviceIsAndroid=0<navigator.userAgent.indexOf("Android");FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent); 1319 // FastClick.prototype.needsClick=function(a){switch(a.nodeName.toLowerCase()){case "button":case "select":case "textarea":if(a.disabled)return!0;break;case "input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case "label":case "video":return!0}return/\bneedsclick\b/.test(a.className)}; 1320 // FastClick.prototype.needsFocus=function(a){switch(a.nodeName.toLowerCase()){case "textarea":case "select":return!0;case "input":switch(a.type){case "button":case "checkbox":case "file":case "image":case "radio":case "submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}}; 1321 // FastClick.prototype.sendClick=function(a,b){var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur();d=b.changedTouches[0];c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null);c.forwardedTouchEvent=!0;a.dispatchEvent(c)};FastClick.prototype.focus=function(a){var b;this.deviceIsIOS&&a.setSelectionRange?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()}; 1322 // FastClick.prototype.updateScrollParent=function(a){var b,c;b=a.fastClickScrollParent;if(!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c;a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)};FastClick.prototype.getTargetElementFromEventTarget=function(a){return a.nodeType===Node.TEXT_NODE?a.parentNode:a}; 1323 // FastClick.prototype.onTouchStart=function(a){var b,c,d;if(1<a.targetTouches.length)return!0;b=this.getTargetElementFromEventTarget(a.target);c=a.targetTouches[0];if(this.deviceIsIOS){d=window.getSelection();if(d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier;this.updateScrollParent(b)}}this.trackingClick=!0;this.trackingClickStart=a.timeStamp;this.targetElement=b;this.touchStartX= 1324 // c.pageX;this.touchStartY=c.pageY;200>a.timeStamp-this.lastClickTime&&a.preventDefault();return!0};FastClick.prototype.touchHasMoved=function(a){a=a.changedTouches[0];return 10<Math.abs(a.pageX-this.touchStartX)||10<Math.abs(a.pageY-this.touchStartY)?!0:!1};FastClick.prototype.findControl=function(a){return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")}; 1325 // FastClick.prototype.onTouchEnd=function(a){var b,c,d;d=this.targetElement;this.touchHasMoved(a)&&(this.trackingClick=!1,this.targetElement=null);if(!this.trackingClick)return!0;if(200>a.timeStamp-this.lastClickTime)return this.cancelNextClick=!0;this.lastClickTime=a.timeStamp;b=this.trackingClickStart;this.trackingClick=!1;this.trackingClickStart=0;this.deviceIsIOSWithBadTarget&&(d=a.changedTouches[0],d=document.elementFromPoint(d.pageX-window.pageXOffset,d.pageY-window.pageYOffset));c=d.tagName.toLowerCase(); 1326 // if("label"===c){if(b=this.findControl(d)){this.focus(d);if(this.deviceIsAndroid)return!1;d=b}}else if(this.needsFocus(d)){if(100<a.timeStamp-b||this.deviceIsIOS&&window.top!==window&&"input"===c)return this.targetElement=null,!1;this.focus(d);if(!this.deviceIsIOS4||"select"!==c)this.targetElement=null,a.preventDefault();return!1}if(this.deviceIsIOS&&!this.deviceIsIOS4&&(b=d.fastClickScrollParent)&&b.fastClickLastScrollTop!==b.scrollTop)return!0;this.needsClick(d)||(a.preventDefault(),this.sendClick(d, 1327 // a));return!1};FastClick.prototype.onTouchCancel=function(){this.trackingClick=!1;this.targetElement=null};FastClick.prototype.onMouse=function(a){return!this.targetElement||a.forwardedTouchEvent||!a.cancelable?!0:!this.needsClick(this.targetElement)||this.cancelNextClick?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0};
1328 // FastClick.prototype.onClick=function(a){if(this.trackingClick)return this.targetElement=null,this.trackingClick=!1,!0;if("submit"===a.target.type&&0===a.detail)return!0;a=this.onMouse(a);a||(this.targetElement=null);return a}; 1329 // FastClick.prototype.destroy=function(){var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0));a.removeEventListener("click",this.onClick,!0);a.removeEventListener("touchstart",this.onTouchStart,!1);a.removeEventListener("touchend",this.onTouchEnd,!1);a.removeEventListener("touchcancel",this.onTouchCancel,!1)}; 1330 // FastClick.notNeeded=function(a){var b;if("undefined"===typeof window.ontouchstart)return!0;if(/Chrome\/[0-9]+/.test(navigator.userAgent))if(FastClick.prototype.deviceIsAndroid){if((b=document.querySelector("meta[name=viewport]"))&&-1!==b.content.indexOf("user-scalable=no"))return!0}else return!0;return"none"===a.style.msTouchAction?!0:!1};FastClick.attach=function(a){return new FastClick(a)}; 1331 // "undefined"!==typeof define&&define.amd?define(function(){return FastClick}):"undefined"!==typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick; 1332 1333 1334 /* --- ROYALSLIDER --- */ 1335 1336 // jQuery RoyalSlider plugin. Custom build. Copyright 2011-2013 Dmitry Semenov http://dim
1336semenov.com 1337// http://dimsemenov.com/private/home.php?build=bullets_thumbnails_tabs_fullscreen_autoplay_video_animated-blocks_auto-height_global-caption_active-class_deeplinking_visible-nearby 1338// jquery.royalslider v9.5.1 1339(function(n){function u(b,f){var c,a=this,e=window.navigator,g=e.userAgent.toLowerCase();a.uid=n.rsModules.uid++;a.ns=".rs"+a.uid;var d=document.createElement("div").style,h=["webkit","Moz","ms","O"],k="",l=0,r;for(c=0;c<h.length;c++)r=h[c],!k&&r+"Transform"in d&&(k=r),r=r.toLowerCase(),window.requestAnimationFrame||(window.requestAnimationFrame=window[r+"RequestAnimationFrame"],window.cancelAnimationFrame=window[r+"CancelAnimationFrame"]||window[r+"CancelRequestAnimationFrame"]);window.requestAnimationFrame|| 1340(window.requestAnimationFrame=function(a,b){var c=(new Date).getTime(),d=Math.max(0,16-(c-l)),e=window.setTimeout(function(){a(c+d)},d);l=c+d;return e});window.cancelAnimationFrame||(window.cancelAnimationFrame=function(a){clearTimeout(a)});a.isIPAD=g.match(/(ipad)/);a.isIOS=a.isIPAD||g.match(/(iphone|ipod)/);c=function(a){a=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||0>a.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)|| 1341[];return{browser:a[1]||"",version:a[2]||"0"}}(g);h={};c.browser&&(h[c.browser]=!0,h.version=c.version);h.chrome&&(h.webkit=!0);a._a=h;a.isAndroid=-1<g.indexOf("android");a.slider=n(b);a.ev=n(a);a._b=n(document);a.st=n.extend({},n.fn.royalSlider.defaults,f);a._c=a.st.transitionSpeed;a._d=0;!a.st.allowCSS3||h.webkit&&!a.st.allowCSS3OnWebkit||(c=k+(k?"T":"t"),a._e=c+"ransform"in d&&c+"ransition"in d,a._e&&(a._f=k+(k?"P":"p")+"erspective"in d));k=k.toLowerCase();a._g="-"+k+"-";a._h="vertical"===a.st.slidesOrientation? 1342!1:!0;a._i=a._h?"left":"top";a._j=a._h?"width":"height";a._k=-1;a._l="fade"===a.st.transitionType?!1:!0;a._l||(a.st.sliderDrag=!1,a._m=10);a._n="z-index:0; display:none; opacity:0;";a._o=0;a._p=0;a._q=0;n.each(n.rsModules,function(b,c){"uid"!==b&&c.call(a)});a.slides=[];a._r=0;(a.st.slides?n(a.st.slides):a.slider.children().detach()).each(function(){a._s(this,!0)});a.st.randomizeSlides&&a.slides.sort(function(){return 0.5-Math.random()});a.numSlides=a.slides.length;a._t();a.st.startSlideId?a.st.startSlideId> 1343a.numSlides-1&&(a.st.startSlideId=a.numSlides-1):a.st.startSlideId=0;a._o=a.staticSlideId=a.currSlideId=a._u=a.st.startSlideId;a.currSlide=a.slides[a.currSlideId];a._v=0;a.pointerMultitouch=!1;a.slider.addClass((a._h?"rsHor":"rsVer")+(a._l?"":" rsFade"));d='<div class="rsOverflow"><div class="rsContainer">';a.slidesSpacing=a.st.slidesSpacing;a._w=(a._h?a.slider.width():a.slider.height())+a.st.slidesSpacing;a._x=Boolean(0<a._y);1>=a.numSlides&&(a._z=!1);a._a1=a._z&&a._l?2===a.numSlides?1:2:0;a._b1= 13446>a.numSlides?a.numSlides:6;a._c1=0;a._d1=0;a.slidesJQ=[];for(c=0;c<a.numSlides;c++)a.slidesJQ.push(n('<div style="'+(a._l?"":c!==a.currSlideId?a._n:"z-index:0;")+'" class="rsSlide "></div>'));a._e1=d=n(d+"</div></div>");var m=a.ns,k=function(b,c,d,e,f){a._j1=b+c+m;a._k1=b+d+m;a._l1=b+e+m;f&&(a._m1=b+f+m)};c=e.pointerEnabled;a.pointerEnabled=c||e.msPointerEnabled;a.pointerEnabled?(a.hasTouch=!1,a._n1=0.2,a.pointerMultitouch=Boolean(1<e[(c?"m":"msM")+"axTouchPoints"]),c?k("pointer","down","move","up", 1345"cancel"):k("MSPointer","Down","Move","Up","Cancel")):(a.isIOS?a._j1=a._k1=a._l1=a._m1="":k("mouse","down","move","up"),"ontouchstart"in window||"createTouch"in document?(a.hasTouch=!0,a._j1+=" touchstart"+m,a._k1+=" touchmove"+m,a._l1+=" touchend"+m,a._m1+=" touchcancel"+m,a._n1=0.5,a.st.sliderTouch&&(a._f1=!0)):(a.hasTouch=!1,a._n1=0.2));a.st.sliderDrag&&(a._f1=!0,h.msie||h.opera?a._g1=a._h1="move":h.mozilla?(a._g1="-moz-grab",a._h1="-moz-grabbing"):h.webkit&&-1!=e.platform.indexOf("Mac")&&(a._g1= 1346"-webkit-grab",a._h1="-webkit-grabbing"),a._i1());a.slider.html(d);a._o1=a.st.controlsInside?a._e1:a.slider;a._p1=a._e1.children(".rsContainer");a.pointerEnabled&&a._p1.css((c?"":"-ms-")+"touch-action",a._h?"pan-y":"pan-x");a._q1=n('<div class="rsPreloader"></div>');e=a._p1.children(".rsSlide");a._r1=a.slidesJQ[a.currSlideId];a._s1=0;a._e?(a._t1="transition-property",a._u1="transition-duration",a._v1="transition-timing-function",a._w1=a._x1=a._g+"transform",a._f?(h.webkit&&!h.chrome&&a.slider.addClass("rsWebkit3d"), 1347a._y1="translate3d(",a._z1="px, ",a._a2="px, 0px)"):(a._y1="translate(",a._z1="px, ",a._a2="px)"),a._l?a._p1[a._g+a._t1]=a._g+"transform":(h={},h[a._g+a._t1]="opacity",h[a._g+a._u1]=a.st.transitionSpeed+"ms",h[a._g+a._v1]=a.st.css3easeInOut,e.css(h))):(a._x1="left",a._w1="top");var p;n(window).on("resize"+a.ns,function(){p&&clearTimeout(p);p=setTimeout(function(){a.updateSliderSize()},50)});a.ev.trigger("rsAfterPropsSetup");a.updateSliderSize();a.st.keyboardNavEnabled&&a._b2();a.st.arrowsNavHideOnTouch&& 1348(a.hasTouch||a.pointerMultitouch)&&(a.st.arrowsNav=!1);a.st.arrowsNav&&(e=a._o1,n('<div class="rsArrow rsArrowLeft"><div class="rsArrowIcn"></div></div><div class="rsArrow rsArrowRight"><div class="rsArrowIcn"></div></div>').appendTo(e),a._c2=e.children(".rsArrowLeft").click(function(b){b.preventDefault();a.prev()}),a._d2=e.children(".rsArrowRight").click(function(b){b.preventDefault();a.next()}),a.st.arrowsNavAutoHide&&!a.hasTouch&&(a._c2.addClass("rsHidden"),a._d2.addClass("rsHidden"),e.one("mousemove.arrowshover", 1349function(){a._c2.removeClass("rsHidden");a._d2.removeClass("rsHidden")}),e.hover(function(){a._e2||(a._c2.removeClass("rsHidden"),a._d2.removeClass("rsHidden"))},function(){a._e2||(a._c2.addClass("rsHidden"),a._d2.addClass("rsHidden"))})),a.ev.on("rsOnUpdateNav",function(){a._f2()}
1349),a._f2());if(a._f1)a._p1.on(a._j1,function(b){a._g2(b)});else a.dragSuccess=!1;var q=["rsPlayBtnIcon","rsPlayBtn","rsCloseVideoBtn","rsCloseVideoIcn"];a._p1.click(function(b){if(!a.dragSuccess){var c=n(b.target).attr("class"); 1350if(-1!==n.inArray(c,q)&&a.toggleVideo())return!1;if(a.st.navigateByClick&&!a._h2){if(n(b.target).closest(".rsNoDrag",a._r1).length)return!0;a._i2(b)}a.ev.trigger("rsSlideClick",b)}}).on("click.rs","a",function(b){if(a.dragSuccess)return!1;a._h2=!0;setTimeout(function(){a._h2=!1},3)});a.ev.trigger("rsAfterInit")}n.rsModules||(n.rsModules={uid:0});u.prototype={constructor:u,_i2:function(b){b=b[this._h?"pageX":"pageY"]-this._j2;b>=this._q?this.next():0>b&&this.prev()},_t:function(){var b;b=this.st.numImagesToPreload; 1351if(this._z=this.st.loop)2===this.numSlides?(this._z=!1,this.st.loopRewind=!0):2>this.numSlides&&(this.st.loopRewind=this._z=!1);this._z&&0<b&&(4>=this.numSlides?b=1:this.st.numImagesToPreload>(this.numSlides-1)/2&&(b=Math.floor((this.numSlides-1)/2)));this._y=b},_s:function(b,f){function c(b,c){c?g.images.push(b.attr(c)):g.images.push(b.text());if(h){h=!1;g.caption="src"===c?b.attr("alt"):b.contents();g.image=g.images[0];g.videoURL=b.attr("data-rsVideo");var d=b.attr("data-rsw"),e=b.attr("data-rsh"); 1352"undefined"!==typeof d&&!1!==d&&"undefined"!==typeof e&&!1!==e?(g.iW=parseInt(d,10),g.iH=parseInt(e,10)):a.st.imgWidth&&a.st.imgHeight&&(g.iW=a.st.imgWidth,g.iH=a.st.imgHeight)}}var a=this,e,g={},d,h=!0;b=n(b);a._k2=b;a.ev.trigger("rsBeforeParseNode",[b,g]);if(!g.stopParsing)return b=a._k2,g.id=a._r,g.contentAdded=!1,a._r++,g.images=[],g.isBig=!1,g.hasCover||(b.hasClass("rsImg")?(d=b,e=!0):(d=b.find(".rsImg"),d.length&&(e=!0)),e?(g.bigImage=d.eq(0).attr("data-rsBigImg"),d.each(function(){var a=n(this); 1353a.is("a")?c(a,"href"):a.is("img")?c(a,"src"):c(a)})):b.is("img")&&(b.addClass("rsImg rsMainSlideImage"),c(b,"src"))),d=b.find(".rsCaption"),d.length&&(g.caption=d.remove()),g.content=b,a.ev.trigger("rsAfterParseNode",[b,g]),f&&a.slides.push(g),0===g.images.length&&(g.isLoaded=!0,g.isRendered=!1,g.isLoading=!1,g.images=null),g},_b2:function(){var b=this,f,c,a=function(a){37===a?b.prev():39===a&&b.next()};b._b.on("keydown"+b.ns,function(e){b._l2||(c=e.keyCode,37!==c&&39!==c||f||(a(c),f=setInterval(function(){a(c)}, 1354700)))}).on("keyup"+b.ns,function(a){f&&(clearInterval(f),f=null)})},goTo:function(b,f){b!==this.currSlideId&&this._m2(b,this.st.transitionSpeed,!0,!f)},destroy:function(b){this.ev.trigger("rsBeforeDestroy");this._b.off("keydown"+this.ns+" keyup"+this.ns+" "+this._k1+" "+this._l1);this._p1.off(this._j1+" click");this.slider.data("royalSlider",null);n.removeData(this.slider,"royalSlider");n(window).off("resize"+this.ns);this.loadingTimeout&&clearTimeout(this.loadingTimeout);b&&this.slider.remove(); 1355this.ev=this.slider=this.slides=null},_n2:function(b,f){function c(c,f,g){c.isAdded?(a(f,c),e(f,c)):(g||(g=d.slidesJQ[f]),c.holder?g=c.holder:(g=d.slidesJQ[f]=n(g),c.holder=g),c.appendOnLoaded=!1,e(f,c,g),a(f,c),d._p2(c,g,b),c.isAdded=!0)}function a(a,c){c.contentAdded||(d.setItemHtml(c,b),b||(c.contentAdded=!0))}function e(a,b,c){d._l&&(c||(c=d.slidesJQ[a]),c.css(d._i,(a+d._d1+p)*d._w))}function g(a){if(l){if(a>r-1)return g(a-r);if(0>a)return g(r+a)}return a}var d=this,h,k,l=d._z,r=d.numSlides;if(!isNaN(f))return g(f); 1356var m=d.currSlideId,p,q=b?Math.abs(d._o2-d.currSlideId)>=d.numSlides-1?0:1:d._y,s=Math.min(2,q),v=!1,u=!1,t;for(k=m;k<m+1+s;k++)if(t=g(k),(h=d.slides[t])&&(!h.isAdded||!h.positionSet)){v=!0;break}for(k=m-1;k>m-1-s;k--)if(t=g(k),(h=d.slides[t])&&(!h.isAdded||!h.positionSet)){u=!0;break}if(v)for(k=m;k<m+q+1;k++)t=g(k),p=Math.floor((d._u-(m-k))/d.numSlides)*d.numSlides,(h=d.slides[t])&&c(h,t);if(u)for(k=m-1;k>m-1-q;k--)t=g(k),p=Math.floor((d._u-(m-k))/r)*r,(h=d.slides[t])&&c(h,t);if(!b)for(s=g(m-q), 1357m=g(m+q),q=s>m?0:s,k=0;k<r;k++)s>m&&k>s-1||!(k<q||k>m)||(h=d.slides[k])&&h.holder&&(h.holder.detach(),h.isAdded=!1)},setItemHtml:function(b,f){var c=this,a=function(){if(!b.images)b.isRendered=!0,b.isLoaded=!0,b.isLoading=!1,d(!0);else if(!b.isLoading){var a,f;b.content.hasClass("rsImg")?(a=b.content,f=!0):a=b.content.find(".rsImg:not(img)");a&&!a.is("img")&&a.each(function(){var a=n(this),c='<img class="rsImg" src="'+(a.is("a")?a.attr("href"):a.text())+'" />';f?b.content=n(c):a.replaceWith(c)}); 1358a=f?b.content:b.content.find("img.rsImg");k();a.eq(0).addClass("rsMainSlideImage");b.iW&&b.iH&&(b.isLoaded||c._q2(b),d());b.isLoading=!0;if(b.isBig)n("<img />").on("load.rs error.rs",function(a){n(this).off("load.rs error.rs");e([this],!0)}).attr("src",b.image);else{b.loaded=[];b.numStartedLoad=0;a=function(a){n(this).off("load.rs error.rs");b.loaded.push(this);b.loaded.length===b.numStartedLoad&&e(b.loaded,!1)};for(var g=0;g<b.images.length;g++){var h=n("<img />");b.numStartedLoad++;h.on("load.rs error.rs", 1359a).attr("src",b.images[g])}}}},e=function(a,c){if(a.length){var d=a[0];if(c!==b.isBig)(d=b.holder.children())&&1<d.length&&l();else if(b.iW&&b.iH)g();else if(b.iW=d.width,b.iH=d.height,b.iW&&b.iH)g();else{var e=new Image;
1359e.onload=function(){e.width?(b.iW=e.width,b.iH=e.height,g()):setTimeout(function(){e.width&&(b.iW=e.width,b.iH=e.height);g()},1E3)};e.src=d.src}}else g()},g=function(){b.isLoaded=!0;b.isLoading=!1;d();l();h()},d=function(){if(!b.isAppended&&c.ev){var a=c.st.visibleNearby,d=b.id-c._o; 1360f||b.appendOnLoaded||!c.st.fadeinLoadedSlide||0!==d&&(!(a||c._r2||c._l2)||-1!==d&&1!==d)||(a={visibility:"visible",opacity:0},a[c._g+"transition"]="opacity 400ms ease-in-out",b.content.css(a),setTimeout(function(){b.content.css("opacity",1)},16));b.holder.find(".rsPreloader").length?b.holder.append(b.content):b.holder.html(b.content);b.isAppended=!0;b.isLoaded&&(c._q2(b),h());b.sizeReady||(b.sizeReady=!0,setTimeout(function(){c.ev.trigger("rsMaybeSizeReady",b)},100))}},h=function(){!b.loadedTriggered&& 1361c.ev&&(b.isLoaded=b.loadedTriggered=!0,b.holder.trigger("rsAfterContentSet"),c.ev.trigger("rsAfterContentSet",b))},k=function(){c.st.usePreloader&&b.holder.html(c._q1.clone())},l=function(a){c.st.usePreloader&&(a=b.holder.find(".rsPreloader"),a.length&&a.remove())};b.isLoaded?d():f?!c._l&&b.images&&b.iW&&b.iH?a():(b.holder.isWaiting=!0,k(),b.holder.slideId=-99):a()},_p2:function(b,f,c){this._p1.append(b.holder);b.appendOnLoaded=!1},_g2:function(b,f){var c=this,a,e="touchstart"===b.type;c._s2=e;c.ev.trigger("rsDragStart"); 1362if(n(b.target).closest(".rsNoDrag",c._r1).length)return c.dragSuccess=!1,!0;!f&&c._r2&&(c._t2=!0,c._u2());c.dragSuccess=!1;if(c._l2)e&&(c._v2=!0);else{e&&(c._v2=!1);c._w2();if(e){var g=b.originalEvent.touches;if(g&&0<g.length)a=g[0],1<g.length&&(c._v2=!0);else return}else b.preventDefault(),a=b,c.pointerEnabled&&(a=a.originalEvent);c._l2=!0;c._b.on(c._k1,function(a){c._x2(a,f)}).on(c._l1,function(a){c._y2(a,f)});c._z2="";c._a3=!1;c._b3=a.pageX;c._c3=a.pageY;c._d3=c._v=(f?c._e3:c._h)?a.pageX:a.pageY; 1363c._f3=0;c._g3=0;c._h3=f?c._i3:c._p;c._j3=(new Date).getTime();if(e)c._e1.on(c._m1,function(a){c._y2(a,f)})}},_k3:function(b,f){if(this._l3){var c=this._m3,a=b.pageX-this._b3,e=b.pageY-this._c3,g=this._h3+a,d=this._h3+e,h=f?this._e3:this._h,g=h?g:d,d=this._z2;this._a3=!0;this._b3=b.pageX;this._c3=b.pageY;"x"===d&&0!==a?this._f3=0<a?1:-1:"y"===d&&0!==e&&(this._g3=0<e?1:-1);d=h?this._b3:this._c3;a=h?a:e;f?g>this._n3?g=this._h3+a*this._n1:g<this._o3&&(g=this._h3+a*this._n1):this._z||(0>=this.currSlideId&& 13640<d-this._d3&&(g=this._h3+a*this._n1),this.currSlideId>=this.numSlides-1&&0>d-this._d3&&(g=this._h3+a*this._n1));this._h3=g;200<c-this._j3&&(this._j3=c,this._v=d);f?this._q3(this._h3):this._l&&this._p3(this._h3)}},_x2:function(b,f){var c=this,a,e="touchmove"===b.type;if(!c._s2||e){if(e){if(c._r3)return;var g=b.originalEvent.touches;if(g){if(1<g.length)return;a=g[0]}else return}else a=b,c.pointerEnabled&&(a=a.originalEvent);c._a3||(c._e&&(f?c._s3:c._p1).css(c._g+c._u1,"0s"),function h(){c._l2&&(c._t3= 1365requestAnimationFrame(h),c._u3&&c._k3(c._u3,f))}());if(c._l3)b.preventDefault(),c._m3=(new Date).getTime(),c._u3=a;else if(g=f?c._e3:c._h,a=Math.abs(a.pageX-c._b3)-Math.abs(a.pageY-c._c3)-(g?-7:7),7<a){if(g)b.preventDefault(),c._z2="x";else if(e){c._v3(b);return}c._l3=!0}else if(-7>a){if(!g)b.preventDefault(),c._z2="y";else if(e){c._v3(b);return}c._l3=!0}}},_v3:function(b,f){this._r3=!0;this._a3=this._l2=!1;this._y2(b)},_y2:function(b,f){function c(a){return 100>a?100:500<a?500:a}function a(a,b){if(e._l|| 1366f)h=(-e._u-e._d1)*e._w,k=Math.abs(e._p-h),e._c=k/b,a&&(e._c+=250),e._c=c(e._c),e._x3(h,!1)}var e=this,g,d,h,k;g=-1<b.type.indexOf("touch");if(!e._s2||g)if(e._s2=!1,e.ev.trigger("rsDragRelease"),e._u3=null,e._l2=!1,e._r3=!1,e._l3=!1,e._m3=0,cancelAnimationFrame(e._t3),e._a3&&(f?e._q3(e._h3):e._l&&e._p3(e._h3)),e._b.off(e._k1).off(e._l1),g&&e._e1.off(e._m1),e._i1(),!e._a3&&!e._v2&&f&&e._w3){var l=n(b.target).closest(".rsNavItem");l.length&&e.goTo(l.index())}else{d=f?e._e3:e._h;if(!e._a3||"y"===e._z2&& 1367d||"x"===e._z2&&!d)if(!f&&e._t2){e._t2=!1;if(e.st.navigateByClick){e._i2(e.pointerEnabled?b.originalEvent:b);e.dragSuccess=!0;return}e.dragSuccess=!0}else{e._t2=!1;e.dragSuccess=!1;return}else e.dragSuccess=!0;e._t2=!1;e._z2="";var r=e.st.minSlideOffset;g=g?b.originalEvent.changedTouches[0]:e.pointerEnabled?b.originalEvent:b;var m=d?g.pageX:g.pageY,p=e._d3;g=e._v;var q=e.currSlideId,s=e.numSlides,v=d?e._f3:e._g3,u=e._z;Math.abs(m-p);g=m-g;d=(new Date).getTime()-e._j3;d=Math.abs(g)/d;if(0===v||1>= 1368s)a(!0,d);else{if(!u&&!f)if(0>=q){if(0<v){a(!0,d);return}}else if(q>=s-1&&0>v){a(!0,d);return}if(f){h=e._i3;if(h>e._n3)h=e._n3;else if(h<e._o3)h=e._o3;else{m=d*d/0.006;l=-e._i3;p=e._y3-e._z3+e._i3;0<g&&m>l?(l+=e._z3/(15/(m/d*0.003)),d=d*l/m,m=l):0>g&&m>p&&(p+=e._z3/(15/(m/d*0.003)),d=d*p/m,m=p);l=Math.max(Math.round(d/0.003),50);h+=m*(0>g?-1:1);if(h>e._n3){e._a4(h,l,!0,e._n3,200);return}if(h<e._o3){e._a4(h,l,!0,e._o3,200);return}}e._a4(h,l,!0)}else l=function(a){var b=Math.floor(a/e._w);a-b*e._w> 1369r&&b++;return b},p+r<m?0>v?a(!1,d):(l=l(m-p),e._m2(e.currSlideId-l,c(Math.abs(e._p-(-e._u-e._d1+l)*e._w)/d),!1,!0,!0)):p-r>m?0<v?a(!1,d):(l=l(p-m),e._m2(e.currSlideId+l,c(Math.abs(e._p-(-e._u-e._d1-l)*e._w)/d),!1,!0,!0)):a(!1,d)}}},_p3:function(b){b=this._p=b;this._e?this._p1.css(this._x1,this._y1+(this._h?b+this._z1+0:0+this._z1+b)+this._a2):this._p1.css(this._h?this._x1:this._w1,b)},updateSliderSize:function(b){var f,c;if(this.st.autoScaleSlider){var a=this.st.autoScaleSliderWidth,e=this.st.autoScaleSliderHeight; 1370this.st.autoScaleHeight?(f=this.slider.width(),f!=this.width&&(this.slider.css("height",e/a*f),f=this.slider.width()),c=this.slider.height()):(c=this.slider.height(),c!=this.height&&(this.slider.css("width",a/e*c),c=this.slider.height()),f=this.slider.width())}else f=this.slider.width(),c=this.slider.height();if(b||f!=this.width||c!=this.height){this.width=f;this.height=c;this._b4=f;this._c4=c;this.ev.trigger("rsBeforeSizeSet");this.ev.trigger("rsAfterSizePropSet");this._e1.css({width:this._b4,height:this._c4}); 1371this._w=(this._h?this._b4:this._c4)+this.st.slidesSpacing;this._d4=this.st.imageScalePadding;
1371for(f=0;f<this.slides.length;f++)b=this.slides[f],b.positionSet=!1,b&&b.images&&b.isLoaded&&(b.isRendered=!1,this._q2(b));if(this._e4)for(f=0;f<this._e4.length;f++)b=this._e4[f],b.holder.css(this._i,(b.id+this._d1)*this._w);this._n2();this._l&&(this._e&&this._p1.css(this._g+"transition-duration","0s"),this._p3((-this._u-this._d1)*this._w));this.ev.trigger("rsOnUpdateNav")}this._j2=this._e1.offset();this._j2= 1372this._j2[this._i]},appendSlide:function(b,f){var c=this._s(b);if(isNaN(f)||f>this.numSlides)f=this.numSlides;this.slides.splice(f,0,c);this.slidesJQ.splice(f,0,n('<div style="'+(this._l?"position:absolute;":this._n)+'" class="rsSlide"></div>'));f<this.currSlideId&&this.currSlideId++;this.ev.trigger("rsOnAppendSlide",[c,f]);this._f4(f);f===this.currSlideId&&this.ev.trigger("rsAfterSlideChange")},removeSlide:function(b){var f=this.slides[b];f&&(f.holder&&f.holder.remove(),b<this.currSlideId&&this.currSlideId--, 1373this.slides.splice(b,1),this.slidesJQ.splice(b,1),this.ev.trigger("rsOnRemoveSlide",[b]),this._f4(b),b===this.currSlideId&&this.ev.trigger("rsAfterSlideChange"))},_f4:function(b){var f=this;b=f.numSlides;b=0>=f._u?0:Math.floor(f._u/b);f.numSlides=f.slides.length;0===f.numSlides?(f.currSlideId=f._d1=f._u=0,f.currSlide=f._g4=null):f._u=b*f.numSlides+f.currSlideId;for(b=0;b<f.numSlides;b++)f.slides[b].id=b;f.currSlide=f.slides[f.currSlideId];f._r1=f.slidesJQ[f.currSlideId];f.currSlideId>=f.numSlides? 1374f.goTo(f.numSlides-1):0>f.currSlideId&&f.goTo(0);f._t();f._l&&f._z&&f._p1.css(f._g+f._u1,"0ms");f._h4&&clearTimeout(f._h4);f._h4=setTimeout(function(){f._l&&f._p3((-f._u-f._d1)*f._w);f._n2();f._l||f._r1.css({display:"block",opacity:1})},14);f.ev.trigger("rsOnUpdateNav")},_i1:function(){this._f1&&this._l&&(this._g1?this._e1.css("cursor",this._g1):(this._e1.removeClass("grabbing-cursor"),this._e1.addClass("grab-cursor")))},_w2:function(){this._f1&&this._l&&(this._h1?this._e1.css("cursor",this._h1): 1375(this._e1.removeClass("grab-cursor"),this._e1.addClass("grabbing-cursor")))},next:function(b){this._m2("next",this.st.transitionSpeed,!0,!b)},prev:function(b){this._m2("prev",this.st.transitionSpeed,!0,!b)},_m2:function(b,f,c,a,e){var g=this,d,h,k;g.ev.trigger("rsBeforeMove",[b,a]);k="next"===b?g.currSlideId+1:"prev"===b?g.currSlideId-1:b=parseInt(b,10);if(!g._z){if(0>k){g._i4("left",!a);return}if(k>=g.numSlides){g._i4("right",!a);return}}g._r2&&(g._u2(!0),c=!1);h=k-g.currSlideId;k=g._o2=g.currSlideId; 1376var l=g.currSlideId+h;a=g._u;var n;g._z?(l=g._n2(!1,l),a+=h):a=l;g._o=l;g._g4=g.slidesJQ[g.currSlideId];g._u=a;g.currSlideId=g._o;g.currSlide=g.slides[g.currSlideId];g._r1=g.slidesJQ[g.currSlideId];var l=g.st.slidesDiff,m=Boolean(0<h);h=Math.abs(h);var p=Math.floor(k/g._y),q=Math.floor((k+(m?l:-l))/g._y),p=(m?Math.max(p,q):Math.min(p,q))*g._y+(m?g._y-1:0);p>g.numSlides-1?p=g.numSlides-1:0>p&&(p=0);k=m?p-k:k-p;k>g._y&&(k=g._y);if(h>k+l)for(g._d1+=(h-(k+l))*(m?-1:1),f*=1.4,k=0;k<g.numSlides;k++)g.slides[k].positionSet= 1377!1;g._c=f;g._n2(!0);e||(n=!0);d=(-a-g._d1)*g._w;n?setTimeout(function(){g._j4=!1;g._x3(d,b,!1,c);g.ev.trigger("rsOnUpdateNav")},0):(g._x3(d,b,!1,c),g.ev.trigger("rsOnUpdateNav"))},_f2:function(){this.st.arrowsNav&&(1>=this.numSlides?(this._c2.css("display","none"),this._d2.css("display","none")):(this._c2.css("display","block"),this._d2.css("display","block"),this._z||this.st.loopRewind||(0===this.currSlideId?this._c2.addClass("rsArrowDisabled"):this._c2.removeClass("rsArrowDisabled"),this.currSlideId=== 1378this.numSlides-1?this._d2.addClass("rsArrowDisabled"):this._d2.removeClass("rsArrowDisabled"))))},_x3:function(b,f,c,a,e){function g(){var a;h&&(a=h.data("rsTimeout"))&&(h!==k&&h.css({opacity:0,display:"none",zIndex:0}),clearTimeout(a),h.data("rsTimeout",""));if(a=k.data("rsTimeout"))clearTimeout(a),k.data("rsTimeout","")}var d=this,h,k,l={};isNaN(d._c)&&(d._c=400);d._p=d._h3=b;d.ev.trigger("rsBeforeAnimStart");d._e?d._l?(d._c=parseInt(d._c,10),c=d._g+d._v1,l[d._g+d._u1]=d._c+"ms",l[c]=a?n.rsCSS3Easing[d.st.easeInOut]: 1379n.rsCSS3Easing[d.st.easeOut],d._p1.css(l),a||!d.hasTouch?setTimeout(function(){d._p3(b)},5):d._p3(b)):(d._c=d.st.transitionSpeed,h=d._g4,k=d._r1,k.data("rsTimeout")&&k.css("opacity",0),g(),h&&h.data("rsTimeout",setTimeout(function(){l[d._g+d._u1]="0ms";l.zIndex=0;l.display="none";h.data("rsTimeout","");h.css(l);setTimeout(function(){h.css("opacity",0)},16)},d._c+60)),l.display="block",l.zIndex=d._m,l.opacity=0,l[d._g+d._u1]="0ms",l[d._g+d._v1]=n.rsCSS3Easing[d.st.easeInOut],k.css(l),k.data("rsTimeout", 1380setTimeout(function(){k.css(d._g+d._u1,d._c+"ms");k.data("rsTimeout",setTimeout(function(){k.css("opacity",1);k.data("rsTimeout","")},20))},20))):d._l?(l[d._h?d._x1:d._w1]=b+"px",d._p1.animate(l,d._c,a?d.st.easeInOut:d.st.easeOut)):(h=d._g4,k=d._r1,k.stop(!0,!0).css({opacity:0,display:"block",zIndex:d._m}),d._c=d.st.transitionSpeed,k.animate({opacity:1},d._c,d.st.easeInOut),g(),h&&h.data("rsTimeout",setTimeout(function(){h.stop(!0,!0).css({opacity:0,display:"none",zIndex:0})},d._c+60)));d._r2=!0; 1381d.loadingTimeout&&clearTimeout(d.loadingTimeout);d.loadingTimeout=e?setTimeout(function(){d.loadingTimeout=null;e.call()},d._c+60):setTimeout(function(){d.loadingTimeout=null;d._k4(f)},d._c+60)},_u2:function(b){this._r2=!1;clearTimeout(this.loadingTimeout);if(this._l)if(!this._e)this._p1.stop(!0),this._p=parseInt(this._p1.css(this._x1),10);else{if(!b){b=this._p;var f=this._h3=this._l4();this._p1.css(this._g+this._u1,"0ms");b!==f&&this._p3(f)}}else 20<this._m?this._m=10:this._m++},_l4:function(){var b= 1382window.getComputedStyle(this._p1.get(0),null).getPropertyValue(this._g+"transform").replace(/^matrix\(/i,"").split(/, |\)$/g),f=0===b[0].indexOf("matrix3d");return parseInt(b[this._h?f?12:4:f?13:5],10)},_m4:function(b,f){return this._e?this._y1+(f?b+this._z1+0:0+this._z1+b)+this._a2:b},_k4:function(b){this._l||(this._r1.css("z-index",0),this._m=10);this._r2=!1;this.staticSlideId=this.currSlideId;this._n2();this._n4=!1;this.ev.trigger("rsAfterSlideChange")},_i4:function(b,f){var c=this,a=(-c._u-c._d1)* 1383c._w;if(0!==c.numSlides&&!c._r2)if(c.st.loopRewind)c.goTo("left"===b?c.numSlides-1:0,f);else if(c._l){c._c=200;var e=function(){c._r2=!1};c._x3(a+("left"===b?30:-30),"",!1,!0,function(){c._r2=!1;c._x3(a,"",!1,!0,e)})}}
1383,_q2:function(b,f){if(!b.isRendered){var c=b.content,a="rsMainSlideImage",e,g=this.st.imageAlignCenter,d=this.st.imageScaleMode,h;b.videoURL&&(a="rsVideoContainer","fill"!==d?e=!0:(h=c,h.hasClass(a)||(h=h.find("."+a)),h.css({width:"100%",height:"100%"}),a="rsMainSlideImage"));c.hasClass(a)|| 1384(c=c.find("."+a));if(c){var k=b.iW,l=b.iH;b.isRendered=!0;if("none"!==d||g){a="fill"!==d?this._d4:0;h=this._b4-2*a;var n=this._c4-2*a,m,p,q={};"fit-if-smaller"===d&&(k>h||l>n)&&(d="fit");if("fill"===d||"fit"===d)m=h/k,p=n/l,m="fill"==d?m>p?m:p:"fit"==d?m<p?m:p:1,k=Math.ceil(k*m,10),l=Math.ceil(l*m,10);"none"!==d&&(q.width=k,q.height=l,e&&c.find(".rsImg").css({width:"100%",height:"100%"}));g&&(q.marginLeft=Math.floor((h-k)/2)+a,q.marginTop=Math.floor((n-l)/2)+a);c.css(q)}}}}};n.rsProto=u.prototype; 1385n.fn.royalSlider=function(b){var f=arguments;return this.each(function(){var c=n(this);if("object"!==typeof b&&b){if((c=c.data("royalSlider"))&&c[b])return c[b].apply(c,Array.prototype.slice.call(f,1))}else c.data("royalSlider")||c.data("royalSlider",new u(c,b))})};n.fn.royalSlider.defaults={slidesSpacing:8,startSlideId:0,loop:!1,loopRewind:!1,numImagesToPreload:4,fadeinLoadedSlide:!0,slidesOrientation:"horizontal",transitionType:"move",transitionSpeed:600,controlNavigation:"bullets",controlsInside:!0, 1386arrowsNav:!0,arrowsNavAutoHide:!0,navigateByClick:!0,randomizeSlides:!1,sliderDrag:!0,sliderTouch:!0,keyboardNavEnabled:!1,fadeInAfterLoaded:!0,allowCSS3:!0,allowCSS3OnWebkit:!0,addActiveClass:!1,autoHeight:!1,easeOut:"easeOutSine",easeInOut:"easeInOutSine",minSlideOffset:10,imageScaleMode:"fit-if-smaller",imageAlignCenter:!0,imageScalePadding:4,usePreloader:!0,autoScaleSlider:!1,autoScaleSliderWidth:800,autoScaleSliderHeight:400,autoScaleHeight:!0,arrowsNavHideOnTouch:!1,globalCaption:!1,slidesDiff:2}; 1387n.rsCSS3Easing={easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)"};n.extend(jQuery.easing,{easeInOutSine:function(b,f,c,a,e){return-a/2*(Math.cos(Math.PI*f/e)-1)+c},easeOutSine:function(b,f,c,a,e){return a*Math.sin(f/e*(Math.PI/2))+c},easeOutCubic:function(b,f,c,a,e){return a*((f=f/e-1)*f*f+1)+c}})})(jQuery,window); 1388// jquery.rs.bullets v1.0.1 1389(function(c){c.extend(c.rsProto,{_i5:function(){var a=this;"bullets"===a.st.controlNavigation&&(a.ev.one("rsAfterPropsSetup",function(){a._j5=!0;a.slider.addClass("rsWithBullets");for(var b='<div class="rsNav rsBullets">',e=0;e<a.numSlides;e++)b+='<div class="rsNavItem rsBullet"><span></span></div>';a._k5=b=c(b+"</div>");a._l5=b.appendTo(a.slider).children();a._k5.on("click.rs",".rsNavItem",function(b){a._m5||a.goTo(c(this).index())})}),a.ev.on("rsOnAppendSlide",function(b,c,d){d>=a.numSlides?a._k5.append('<div class="rsNavItem rsBullet"><span></span></div>'): 1390a._l5.eq(d).before('<div class="rsNavItem rsBullet"><span></span></div>');a._l5=a._k5.children()}),a.ev.on("rsOnRemoveSlide",function(b,c){var d=a._l5.eq(c);d&&d.length&&(d.remove(),a._l5=a._k5.children())}),a.ev.on("rsOnUpdateNav",function(){var b=a.currSlideId;a._n5&&a._n5.removeClass("rsNavSelected");b=a._l5.eq(b);b.addClass("rsNavSelected");a._n5=b}))}});c.rsModules.bullets=c.rsProto._i5})(jQuery); 1391// jquery.rs.thumbnails v1.0.6 1392(function(g){g.extend(g.rsProto,{_h6:function(){var a=this;"thumbnails"===a.st.controlNavigation&&(a._i6={drag:!0,touch:!0,orientation:"horizontal",navigation:!0,arrows:!0,arrowLeft:null,arrowRight:null,spacing:4,arrowsAutoHide:!1,appendSpan:!1,transitionSpeed:600,autoCenter:!0,fitInViewport:!0,firstMargin:!0,paddingTop:0,paddingBottom:0},a.st.thumbs=g.extend({},a._i6,a.st.thumbs),a._j6=!0,!1===a.st.thumbs.firstMargin?a.st.thumbs.firstMargin=0:!0===a.st.thumbs.firstMargin&&(a.st.thumbs.firstMargin= 1393a.st.thumbs.spacing),a.ev.on("rsBeforeParseNode",function(a,b,c){b=g(b);c.thumbnail=b.find(".rsTmb").remove();c.thumbnail.length?c.thumbnail=g(document.createElement("div")).append(c.thumbnail).html():(c.thumbnail=b.attr("data-rsTmb"),c.thumbnail||(c.thumbnail=b.find(".rsImg").attr("data-rsTmb")),c.thumbnail=c.thumbnail?'<img src="'+c.thumbnail+'"/>':"")}),a.ev.one("rsAfterPropsSetup",function(){a._k6()}),a._n5=null,a.ev.on("rsOnUpdateNav",function(){var e=g(a._l5[a.currSlideId]);e!==a._n5&&(a._n5&& 1394(a._n5.removeClass("rsNavSelected"),a._n5=null),a._l6&&a._m6(a.currSlideId),a._n5=e.addClass("rsNavSelected"))}),a.ev.on("rsOnAppendSlide",function(e,b,c){e="<div"+a._n6+' class="rsNavItem rsThumb">'+a._o6+b.thumbnail+"</div>";c>=a.numSlides?a._s3.append(e):a._l5.eq(c).before(e);a._l5=a._s3.children();a.updateThumbsSize()}),a.ev.on("rsOnRemoveSlide",function(e,b){var c=a._l5.eq(b);c&&(c.remove(),a._l5=a._s3.children(),a.updateThumbsSize())}))},_k6:function(){var a=this,e="rsThumbs",b=a.st.thumbs, 1395c="",f,d,h=b.spacing;a._j5=!0;a._e3="vertical"===b.orientation?!1:!0;a._n6=f=h?' style="margin-'+(a._e3?"right":"bottom")+":"+h+'px;"':"";a._i3=0;a._p6=!1;a._m5=!1;a._l6=!1;a._q6=b.arrows&&b.navigation;d=a._e3?"Hor":"Ver";a.slider.addClass("rsWithThumbs rsWithThumbs"+d);c+='<div class="rsNav rsThumbs rsThumbs'+d+'"><div class="'+e+'Container">';a._o6=b.appendSpan?'<span class="thumbIco"></span>':"";for(var k=0;k<a.numSlides;k++)d=a.slides[k],c+="<div"+f+' class="rsNavItem rsThumb">'+d.thumbnail+a._o6+ 1396"</div>";c=g(c+"</div></div>");f={};b.paddingTop&&(f[a._e3?"paddingTop":"paddingLeft"]=b.paddingTop);b.paddingBottom&&(f[a._e3?"paddingBottom":"paddingRight"]=b.paddingBottom);c.css(f);a._s3=g(c).find("."+e+"Container");
1396a._q6&&(e+="Arrow",b.arrowLeft?a._r6=b.arrowLeft:(a._r6=g('<div class="'+e+" "+e+'Left"><div class="'+e+'Icn"></div></div>'),c.append(a._r6)),b.arrowRight?a._s6=b.arrowRight:(a._s6=g('<div class="'+e+" "+e+'Right"><div class="'+e+'Icn"></div></div>'),c.append(a._s6)),a._r6.click(function(){var b= 1397(Math.floor(a._i3/a._t6)+a._u6)*a._t6+a._v6;a._a4(b>a._n3?a._n3:b)}),a._s6.click(function(){var b=(Math.floor(a._i3/a._t6)-a._u6)*a._t6+a._v6;a._a4(b<a._o3?a._o3:b)}),b.arrowsAutoHide&&!a.hasTouch&&(a._r6.css("opacity",0),a._s6.css("opacity",0),c.one("mousemove.rsarrowshover",function(){a._l6&&(a._r6.css("opacity",1),a._s6.css("opacity",1))}),c.hover(function(){a._l6&&(a._r6.css("opacity",1),a._s6.css("opacity",1))},function(){a._l6&&(a._r6.css("opacity",0),a._s6.css("opacity",0))})));a._k5=c;a._l5= 1398a._s3.children();a.msEnabled&&a.st.thumbs.navigation&&a._s3.css("-ms-touch-action",a._e3?"pan-y":"pan-x");a.slider.append(c);a._w3=!0;a._v6=h;b.navigation&&a._e&&a._s3.css(a._g+"transition-property",a._g+"transform");a._k5.on("click.rs",".rsNavItem",function(b){a._m5||a.goTo(g(this).index())});a.ev.off("rsBeforeSizeSet.thumbs").on("rsBeforeSizeSet.thumbs",function(){a._w6=a._e3?a._c4:a._b4;a.updateThumbsSize(!0)});a.ev.off("rsAutoHeightChange.thumbs").on("rsAutoHeightChange.thumbs",function(b,c){a.updateThumbsSize(!0, 1399c)})},updateThumbsSize:function(a,e){var b=this,c=b._l5.first(),f={},d=b._l5.length;b._t6=(b._e3?c.outerWidth():c.outerHeight())+b._v6;b._y3=d*b._t6-b._v6;f[b._e3?"width":"height"]=b._y3+b._v6;b._z3=b._e3?b._k5.width():void 0!==e?e:b._k5.height();b._w3&&(b.isFullscreen||b.st.thumbs.fitInViewport)&&(b._e3?b._c4=b._w6-b._k5.outerHeight():b._b4=b._w6-b._k5.outerWidth());b._z3&&(b._o3=-(b._y3-b._z3)-b.st.thumbs.firstMargin,b._n3=b.st.thumbs.firstMargin,b._u6=Math.floor(b._z3/b._t6),b._y3<b._z3?(b.st.thumbs.autoCenter&& 1400b._q3((b._z3-b._y3)/2),b.st.thumbs.arrows&&b._r6&&(b._r6.addClass("rsThumbsArrowDisabled"),b._s6.addClass("rsThumbsArrowDisabled")),b._l6=!1,b._m5=!1,b._k5.off(b._j1)):b.st.thumbs.navigation&&!b._l6&&(b._l6=!0,!b.hasTouch&&b.st.thumbs.drag||b.hasTouch&&b.st.thumbs.touch)&&(b._m5=!0,b._k5.on(b._j1,function(a){b._g2(a,!0)})),b._s3.css(f),a&&e&&b._m6(b.currSlideId),b._e&&(f[b._g+"transition-duration"]="0ms"))},setThumbsOrientation:function(a,e){this._w3&&(this.st.thumbs.orientation=a,this._k5.remove(), 1401this.slider.removeClass("rsWithThumbsHor rsWithThumbsVer"),this._k6(),this._k5.off(this._j1),e||this.updateSliderSize(!0))},_q3:function(a){this._i3=a;this._e?this._s3.css(this._x1,this._y1+(this._e3?a+this._z1+0:0+this._z1+a)+this._a2):this._s3.css(this._e3?this._x1:this._w1,a)},_a4:function(a,e,b,c,f){var d=this;if(d._l6){e||(e=d.st.thumbs.transitionSpeed);d._i3=a;d._x6&&clearTimeout(d._x6);d._p6&&(d._e||d._s3.stop(),b=!0);var h={};d._p6=!0;d._e?(h[d._g+"transition-duration"]=e+"ms",h[d._g+"transition-timing-function"]= 1402b?g.rsCSS3Easing[d.st.easeOut]:g.rsCSS3Easing[d.st.easeInOut],d._s3.css(h),d._q3(a)):(h[d._e3?d._x1:d._w1]=a+"px",d._s3.animate(h,e,b?"easeOutCubic":d.st.easeInOut));c&&(d._i3=c);d._y6();d._x6=setTimeout(function(){d._p6=!1;f&&(d._a4(c,f,!0),f=null)},e)}},_y6:function(){this._q6&&(this._i3===this._n3?this._r6.addClass("rsThumbsArrowDisabled"):this._r6.removeClass("rsThumbsArrowDisabled"),this._i3===this._o3?this._s6.addClass("rsThumbsArrowDisabled"):this._s6.removeClass("rsThumbsArrowDisabled"))}, 1403_m6:function(a,e){var b=0,c,f=a*this._t6+2*this._t6-this._v6+this._n3,d=Math.floor(this._i3/this._t6);this._l6&&(this._j6&&(e=!0,this._j6=!1),f+this._i3>this._z3?(a===this.numSlides-1&&(b=1),d=-a+this._u6-2+b,c=d*this._t6+this._z3%this._t6+this._v6-this._n3):0!==a?(a-1)*this._t6<=-this._i3+this._n3&&a-1<=this.numSlides-this._u6&&(c=(-a+1)*this._t6+this._n3):c=this._n3,c!==this._i3&&(b=void 0===c?this._i3:c,b>this._n3?this._q3(this._n3):b<this._o3?this._q3(this._o3):void 0!==c&&(e?this._q3(c):this._a4(c))), 1404this._y6())}});g.rsModules.thumbnails=g.rsProto._h6})(jQuery); 1405// jquery.rs.tabs v1.0.2 1406(function(e){e.extend(e.rsProto,{_f6:function(){var a=this;"tabs"===a.st.controlNavigation&&(a.ev.on("rsBeforeParseNode",function(a,d,b){d=e(d);b.thumbnail=d.find(".rsTmb").remove();b.thumbnail.length?b.thumbnail=e(document.createElement("div")).append(b.thumbnail).html():(b.thumbnail=d.attr("data-rsTmb"),b.thumbnail||(b.thumbnail=d.find(".rsImg").attr("data-rsTmb")),b.thumbnail=b.thumbnail?'<img src="'+b.thumbnail+'"/>':"")}),a.ev.one("rsAfterPropsSetup",function(){a._g6()}),a.ev.on("rsOnAppendSlide", 1407function(c,d,b){b>=a.numSlides?a._k5.append('<div class="rsNavItem rsTab">'+d.thumbnail+"</div>"):a._l5.eq(b).before('<div class="rsNavItem rsTab">'+item.thumbnail+"</div>");a._l5=a._k5.children()}
1407),a.ev.on("rsOnRemoveSlide",function(c,d){var b=a._l5.eq(d);b&&(b.remove(),a._l5=a._k5.children())}),a.ev.on("rsOnUpdateNav",function(){var c=a.currSlideId;a._n5&&a._n5.removeClass("rsNavSelected");c=a._l5.eq(c);c.addClass("rsNavSelected");a._n5=c}))},_g6:function(){var a=this,c;a._j5=!0;c='<div class="rsNav rsTabs">'; 1408for(var d=0;d<a.numSlides;d++)c+='<div class="rsNavItem rsTab">'+a.slides[d].thumbnail+"</div>";c=e(c+"</div>");a._k5=c;a._l5=c.children(".rsNavItem");a.slider.append(c);a._k5.click(function(b){b=e(b.target).closest(".rsNavItem");b.length&&a.goTo(b.index())})}});e.rsModules.tabs=e.rsProto._f6})(jQuery); 1409// jquery.rs.fullscreen v1.0.5 1410(function(c){c.extend(c.rsProto,{_q5:function(){var a=this;a._r5={enabled:!1,keyboardNav:!0,buttonFS:!0,nativeFS:!1,doubleTap:!0};a.st.fullscreen=c.extend({},a._r5,a.st.fullscreen);if(a.st.fullscreen.enabled)a.ev.one("rsBeforeSizeSet",function(){a._s5()})},_s5:function(){var a=this;a._t5=!a.st.keyboardNavEnabled&&a.st.fullscreen.keyboardNav;if(a.st.fullscreen.nativeFS){a._u5={supportsFullScreen:!1,isFullScreen:function(){return!1},requestFullScreen:function(){},cancelFullScreen:function(){},fullScreenEventName:"", 1411prefix:""};var b=["webkit","moz","o","ms","khtml"];if(!a.isAndroid)if("undefined"!=typeof document.cancelFullScreen)a._u5.supportsFullScreen=!0;else for(var d=0;d<b.length;d++)if(a._u5.prefix=b[d],"undefined"!=typeof document[a._u5.prefix+"CancelFullScreen"]){a._u5.supportsFullScreen=!0;break}a._u5.supportsFullScreen?(a.nativeFS=!0,a._u5.fullScreenEventName=a._u5.prefix+"fullscreenchange"+a.ns,a._u5.isFullScreen=function(){switch(this.prefix){case "":return document.fullScreen;case "webkit":return document.webkitIsFullScreen; 1412default:return document[this.prefix+"FullScreen"]}},a._u5.requestFullScreen=function(a){return""===this.prefix?a.requestFullScreen():a[this.prefix+"RequestFullScreen"]()},a._u5.cancelFullScreen=function(a){return""===this.prefix?document.cancelFullScreen():document[this.prefix+"CancelFullScreen"]()}):a._u5=!1}a.st.fullscreen.buttonFS&&(a._v5=c('<div class="rsFullscreenBtn"><div class="rsFullscreenIcn"></div></div>').appendTo(a._o1).on("click.rs",function(){a.isFullscreen?a.exitFullscreen():a.enterFullscreen()}))}, 1413enterFullscreen:function(a){var b=this;if(b._u5)if(a)b._u5.requestFullScreen(c("html")[0]);else{b._b.on(b._u5.fullScreenEventName,function(a){b._u5.isFullScreen()?b.enterFullscreen(!0):b.exitFullscreen(!0)});b._u5.requestFullScreen(c("html")[0]);return}if(!b._w5){b._w5=!0;b._b.on("keyup"+b.ns+"fullscreen",function(a){27===a.keyCode&&b.exitFullscreen()});b._t5&&b._b2();a=c(window);b._x5=a.scrollTop();b._y5=a.scrollLeft();b._z5=c("html").attr("style");b._a6=c("body").attr("style");b._b6=b.slider.attr("style"); 1414c("body, html").css({overflow:"hidden",height:"100%",width:"100%",margin:"0",padding:"0"});b.slider.addClass("rsFullscreen");var d;for(d=0;d<b.numSlides;d++)a=b.slides[d],a.isRendered=!1,a.bigImage&&(a.isBig=!0,a.isMedLoaded=a.isLoaded,a.isMedLoading=a.isLoading,a.medImage=a.image,a.medIW=a.iW,a.medIH=a.iH,a.slideId=-99,a.bigImage!==a.medImage&&(a.sizeType="big"),a.isLoaded=a.isBigLoaded,a.isLoading=!1,a.image=a.bigImage,a.images[0]=a.bigImage,a.iW=a.bigIW,a.iH=a.bigIH,a.isAppended=a.contentAdded= 1415!1,b._c6(a));b.isFullscreen=!0;b._w5=!1;b.updateSliderSize();b.ev.trigger("rsEnterFullscreen")}},exitFullscreen:function(a){var b=this;if(b._u5){if(!a){b._u5.cancelFullScreen(c("html")[0]);return}b._b.off(b._u5.fullScreenEventName)}if(!b._w5){b._w5=!0;b._b.off("keyup"+b.ns+"fullscreen");b._t5&&b._b.off("keydown"+b.ns);c("html").attr("style",b._z5||"");c("body").attr("style",b._a6||"");var d;for(d=0;d<b.numSlides;d++)a=b.slides[d],a.isRendered=!1,a.bigImage&&(a.isBig=!1,a.slideId=-99,a.isBigLoaded= 1416a.isLoaded,a.isBigLoading=a.isLoading,a.bigImage=a.image,a.bigIW=a.iW,a.bigIH=a.iH,a.isLoaded=a.isMedLoaded,a.isLoading=!1,a.image=a.medImage,a.images[0]=a.medImage,a.iW=a.medIW,a.iH=a.medIH,a.isAppended=a.contentAdded=!1,b._c6(a,!0),a.bigImage!==a.medImage&&(a.sizeType="med"));b.isFullscreen=!1;a=c(window);a.scrollTop(b._x5);a.scrollLeft(b._y5);b._w5=!1;b.slider.removeClass("rsFullscreen");b.updateSliderSize();setTimeout(function(){b.updateSliderSize()},1);b.ev.trigger("rsExitFullscreen")}},_c6:function(a, 1417b){var d=a.isLoaded||a.isLoading?'<img class="rsImg rsMainSlideImage" src="'+a.image
1417+'"/>':'<a class="rsImg rsMainSlideImage" href="'+a.image+'"></a>';a.content.hasClass("rsImg")?a.content=c(d):a.content.find(".rsImg").eq(0).replaceWith(d);a.isLoaded||a.isLoading||!a.holder||a.holder.html(a.content)}});c.rsModules.fullscreen=c.rsProto._q5})(jQuery); 1418// jquery.rs.autoplay v1.0.5 1419(function(b){b.extend(b.rsProto,{_x4:function(){var a=this,d;a._y4={enabled:!1,stopAtAction:!0,pauseOnHover:!0,delay:2E3};!a.st.autoPlay&&a.st.autoplay&&(a.st.autoPlay=a.st.autoplay);a.st.autoPlay=b.extend({},a._y4,a.st.autoPlay);a.st.autoPlay.enabled&&(a.ev.on("rsBeforeParseNode",function(a,c,f){c=b(c);if(d=c.attr("data-rsDelay"))f.customDelay=parseInt(d,10)}),a.ev.one("rsAfterInit",function(){a._z4()}),a.ev.on("rsBeforeDestroy",function(){a.stopAutoPlay();a.slider.off("mouseenter mouseleave");b(window).off("blur"+ 1420a.ns+" focus"+a.ns)}))},_z4:function(){var a=this;a.startAutoPlay();a.ev.on("rsAfterContentSet",function(b,e){a._l2||a._r2||!a._a5||e!==a.currSlide||a._b5()});a.ev.on("rsDragRelease",function(){a._a5&&a._c5&&(a._c5=!1,a._b5())});a.ev.on("rsAfterSlideChange",function(){a._a5&&a._c5&&(a._c5=!1,a.currSlide.isLoaded&&a._b5())});a.ev.on("rsDragStart",function(){a._a5&&(a.st.autoPlay.stopAtAction?a.stopAutoPlay():(a._c5=!0,a._d5()))});a.ev.on("rsBeforeMove",function(b,e,c){a._a5&&(c&&a.st.autoPlay.stopAtAction? 1421a.stopAutoPlay():(a._c5=!0,a._d5()))});a._e5=!1;a.ev.on("rsVideoStop",function(){a._a5&&(a._e5=!1,a._b5())});a.ev.on("rsVideoPlay",function(){a._a5&&(a._c5=!1,a._d5(),a._e5=!0)});b(window).on("blur"+a.ns,function(){a._a5&&(a._c5=!0,a._d5())}).on("focus"+a.ns,function(){a._a5&&a._c5&&(a._c5=!1,a._b5())});a.st.autoPlay.pauseOnHover&&(a._f5=!1,a.slider.hover(function(){a._a5&&(a._c5=!1,a._d5(),a._f5=!0)},function(){a._a5&&(a._f5=!1,a._b5())}))},toggleAutoPlay:function(){this._a5?this.stopAutoPlay(): 1422this.startAutoPlay()},startAutoPlay:function(){this._a5=!0;this.currSlide.isLoaded&&this._b5()},stopAutoPlay:function(){this._e5=this._f5=this._c5=this._a5=!1;this._d5()},_b5:function(){var a=this;a._f5||a._e5||(a._g5=!0,a._h5&&clearTimeout(a._h5),a._h5=setTimeout(function(){var b;a._z||a.st.loopRewind||(b=!0,a.st.loopRewind=!0);a.next(!0);b&&(a.st.loopRewind=!1)},a.currSlide.customDelay?a.currSlide.customDelay:a.st.autoPlay.delay))},_d5:function(){this._f5||this._e5||(this._g5=!1,this._h5&&(clearTimeout(this._h5), 1423this._h5=null))}});b.rsModules.autoplay=b.rsProto._x4})(jQuery); 1424// jquery.rs.video v1.1.3 1425(function(f){f.extend(f.rsProto,{_z6:function(){var a=this;a._a7={autoHideArrows:!0,autoHideControlNav:!1,autoHideBlocks:!1,autoHideCaption:!1,disableCSS3inFF:!0,youTubeCode:'<iframe src="http://www.youtube.com/embed/%id%?rel=1&showinfo=0&autoplay=1&wmode=transparent" frameborder="no"></iframe>',vimeoCode:'<iframe src="http://player.vimeo.com/video/%id%?byline=0&portrait=0&autoplay=1" frameborder="no" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'};a.st.video=f.extend({},a._a7, 1426a.st.video);a.ev.on("rsBeforeSizeSet",function(){a._b7&&setTimeout(function(){var b=a._r1,b=b.hasClass("rsVideoContainer")?b:b.find(".rsVideoContainer");
1426a._c7&&a._c7.css({width:b.width(),height:b.height()})},32)});var d=a._a.mozilla;a.ev.on("rsAfterParseNode",function(b,c,e){b=f(c);if(e.videoURL){a.st.video.disableCSS3inFF&&d&&(a._e=a._f=!1);c=f('<div class="rsVideoContainer"></div>');var g=f('<div class="rsBtnCenterer"><div class="rsPlayBtn"><div class="rsPlayBtnIcon"></div></div></div>');b.hasClass("rsImg")? 1427e.content=c.append(b).append(g):e.content.find(".rsImg").wrap(c).after(g)}});a.ev.on("rsAfterSlideChange",function(){a.stopVideo()})},toggleVideo:function(){return this._b7?this.stopVideo():this.playVideo()},playVideo:function(){var a=this;if(!a._b7){var d=a.currSlide;if(!d.videoURL)return!1;a._d7=d;var b=a._e7=d.content,d=d.videoURL,c,e;d.match(/youtu\.be/i)||d.match(/youtube\.com/i)?(e=/^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#\&\?]*).*/,(e=d.match(e))&&11==e[7].length&& 1428(c=e[7]),void 0!==c&&(a._c7=a.st.video.youTubeCode.replace("%id%",c))):d.match(/vimeo\.com/i)&&(e=/(www\.)?vimeo.com\/(\d+)($|\/)/,(e=d.match(e))&&(c=e[2]),void 0!==c&&(a._c7=a.st.video.vimeoCode.replace("%id%",c)));a.videoObj=f(a._c7);a.ev.trigger("rsOnCreateVideoElement",[d]);a.videoObj.length&&(a._c7=f('<div class="rsVideoFrameHolder"><div class="rsPreloader"></div><div class="rsCloseVideoBtn"><div class="rsCloseVideoIcn"></div></div></div>'),a._c7.find(".rsPreloader").after(a.videoObj),b=b.hasClass("rsVideoContainer")?
1429b:b.find(".rsVideoContainer"),a._c7.css({width:b.width(),height:b.height()}).find(".rsCloseVideoBtn").off("click.rsv").on("click.rsv",function(b){a.stopVideo();b.preventDefault();b.stopPropagation();return!1}),b.append(a._c7),a.isIPAD&&b.addClass("rsIOSVideo"),a._f7(!1),setTimeout(function(){a._c7.addClass("rsVideoActive")},10),a.ev.trigger("rsVideoPlay"),a._b7=!0);return!0}return!1},stopVideo:function(){var a=this;return a._b7?(a.isIPAD&&a.slider.find(".rsCloseVideoBtn").remove(),a._f7(!0),setTimeout(function(){a.ev.trigger("rsOnDestroyVideoElement", 1430[a.videoObj]);var d=a._c7.find("iframe");if(d.length)try{d.attr("src","")}catch(b){}a._c7.remove();a._c7=null},16),a.ev.trigger("rsVideoStop"),a._b7=!1,!0):!1},_f7:function(a,d){var b=[],c=this.st.video;c.autoHideArrows&&(this._c2&&(b.push(this._c2,this._d2),this._e2=!a),this._v5&&b.push(this._v5));c.autoHideControlNav&&this._k5&&b.push(this._k5);c.autoHideBlocks&&this._d7.animBlocks&&b.push(this._d7.animBlocks);c.autoHideCaption&&this.globalCaption&&b.push(this.globalCaption);this.slider[a?"removeClass": 1431"addClass"]("rsVideoPlaying");if(b.length)for(c=0;c<b.length;c++)a?b[c].removeClass("rsHidden"):b[c].addClass("rsHidden")}});f.rsModules.video=f.rsProto._z6})(jQuery); 1432// jquery.rs.animated-blocks v1.0.7 1433(function(l){l.extend(l.rsProto,{_p4:function(){function m(){var g=a.currSlide;if(a.currSlide&&a.currSlide.isLoaded&&a._t4!==g){if(0<a._s4.length){for(b=0;b<a._s4.length;b++)clearTimeout(a._s4[b]);a._s4=[]}if(0<a._r4.length){var f;for(b=0;b<a._r4.length;b++)if(f=a._r4[b])a._e?(f.block.css(a._g+a._u1,"0s"),f.block.css(f.css)):f.block.stop(!0).css(f.css),a._t4=null,g.animBlocksDisplayed=!1;a._r4=[]}g.animBlocks&&(g.animBlocksDisplayed=!0,a._t4=g,a._u4(g.animBlocks))}}var a=this,b;a._q4={fadeEffect:!0, 1434moveEffect:"top",moveOffset:20,speed:400,easing:"easeOutSine",delay:200};a.st.block=l.extend({},a._q4,a.st.block);a._r4=[];a._s4=[];a.ev.on("rsAfterInit",function(){m()});a.ev.on("rsBeforeParseNode",function(a,b,d){b=l(b);d.animBlocks=b.find(".rsABlock").css("display","none");d.animBlocks.length||(b.hasClass("rsABlock")?d.animBlocks=b.css("display","none"):d.animBlocks=!1)});a.ev.on("rsAfterContentSet",function(b,f){f.id===a.slides[a.currSlideId].id&&setTimeout(function(){m()},a.st.fadeinLoadedSlide? 1435300:0)});a.ev.on("rsAfterSlideChange",function(){m()})},_v4:function(l,a){setTimeout(function(){l.css(a)},6)},_u4:function(m){var a=this,b,g,f,d,h,e,n;a._s4=[];m.each(function(m){b=l(this);g={};f={};d=null;var c=b.attr("data-move-offset"),c=c?parseInt(c,10):a.st.block.moveOffset;if(0<c&&((e=b.data("move-effect"))?(e=e.toLowerCase(),"none"===e?e=!1:"left"!==e&&"top"!==e&&"bottom"!==e&&"right"!==e&&(e=a.st.block.moveEffect,"none"===e&&(e=!1))):e=a.st.block.moveEffect,e&&"none"!==e)){var p;p="right"=== 1436e||"left"===e?!0:!1;var k;n=!1;a._e?(k=0,h=a._x1):(p?isNaN(parseInt(b.css("right"),10))?h="left":(h="right",n=!0):isNaN(parseInt(b.css("bottom"),10))?h="top":(h="bottom",n=!0),h="margin-"+h,n&&(c=-c),a._e?k=parseInt(b.css(h),10):(k=b.data("rs-start-move-prop"),void 0===k&&(k=parseInt(b.css(h),10),isNaN(k)&&(k=0),b.data("rs-start-move-prop",k))));f[h]=a._m4("top"===e||"left"===e?k-c:k+c,p);g[h]=a._m4(k,p)}c=b.attr("data-fade-effect");if(!c)c=a.st.block.fadeEffect;else if("none"===c.toLowerCase()|| 1437"false"===c.toLowerCase())c=!1;c&&(f.opacity=0,g.opacity=1);if(c||e)d={},d.hasFade=Boolean(c),Boolean(e)&&(d.moveProp=h,d.hasMove=!0),d.speed=b.data("speed"),isNaN(d.speed)&&(d.speed=a.st.block.speed),d.easing=b.data("easing"),d.easing||(d.easing=a.st.block.easing),d.css3Easing=l.rsCSS3Easing[d.easing],d.delay=b.data("delay"),isNaN(d.delay)&&(d.delay=a.st.block.delay*m);c={};a._e&&(c[a._g+a._u1]="0ms");c.moveProp=g.moveProp;c.opacity=g.opacity;c.display="none";a._r4.push({block:b,css:c});a._v4(b, 1438f);a._s4.push(setTimeout(function(b,d,c,e){return function(){b.css("display","block");if(c){var g={};if(a._e){var f="";c.hasMove&&(f+=c.moveProp);c.hasFade&&(c.hasMove&&(f+=", "),f+="opacity");g[a._g+a._t1]=f;g[a._g+a._u1]=c.speed+"ms";g[a._g+a._v1]=c.css3Easing;b.css(g);setTimeout(function(){b.css(d)},24)}else setTimeout(function(){b.animate(d,c.speed,c.easing)},16)}delete a._s4[e]}}(b,g,d,m),6>=d.delay?12:d.delay))})}});l.rsModules.animatedBlocks=l.rsProto._p4})(jQuery); 1439// jquery.rs.auto-height v1.0.3 1440(function(b){b.extend(b.rsProto,{_w4:function(){var a=this;if(a.st.autoHeight){var b,c,e,f=!0,d=function(d){e=a.slides[a.currSlideId];(b=e.holder)&&(c=b.height())&&void 0!==c&&c>(a.st.minAutoHeight||30)&&(a._c4=c,a._e||!d?a._e1.css("height",c):a._e1.stop(!0,!0).animate({height:c},a.st.transitionSpeed),a.ev.trigger("rsAutoHeightChange",c),f&&(a._e&&setTimeout(function(){a._e1.css(a._g+"transition","height "+a.st.transitionSpeed+"ms ease-in-out")},16),f=!1))};a.ev.on("rsMaybeSizeReady.rsAutoHeight", 1441function(a,b){e===b&&d()});a.ev.on("rsAfterContentSet.rsAutoHeight",function(a,b){e===b&&d()});a.slider.addClass("rsAutoHeight");a.ev.one("rsAfterInit",function(){setTimeout(function(){d(!1);setTimeout(function(){a.slider.append('<div style="clear:both; float: none;"></div>')},16)},16)});a.ev.on("rsBeforeAnimStart",function(){d(!0)});a.ev.on("rsBeforeSizeSet",function(){setTimeout(function(){d(!1)},16)})}}});b.rsModules.autoHeight=b.rsProto._w4})(jQuery); 1442// jquery.rs.global-caption v1.0 1443(function(b){b.extend(b.rsProto,{_d6:function(){var a=this;a.st.globalCaption&&(a.ev.on("rsAfterInit",function(){a.globalCaption=b('<div class="rsGCaption"></div>').appendTo(a.st.globalCaptionInside?a._e1:a.slider);a.globalCaption.html(a.currSlide.caption)}),a.ev.on("rsBeforeAnimStart",function(){a.globalCaption.html(a.currSlide.caption)}))}});b.rsModules.globalCaption=b.rsProto._d6})(jQuery); 1444// jquery.rs.active-class v1.0.1 1445(function(c){c.rsProto._o4=function(){var b,a=this;if(a.st.addActiveClass)a.ev.on("rsOnUpdateNav",function(){b&&clearTimeout(b);b=setTimeout(function(){a._g4&&a._g4.removeClass("rsActiveSlide");a._r1&&a._r1.addClass("rsActiveSlide");b=null},50)})};c.rsModules.activeClass=c.rsProto._o4})(jQuery); 1446// jquery.rs.deeplinking v1.0.6 + jQuery hashchange plugin v1.3 Copyright (c) 2010 Ben Alman 1447(function(d){d.extend(d.rsProto,{_o5:function(){var a=this,l,g,f;a._p5={enabled:!1,change:!1,prefix:""};a.st.deeplinking=d.extend({},a._p5,a.st.deeplinking);if(a.st.deeplinking.enabled){var k=a.st.deeplinking.change,c=a.st.deeplinking.prefix,e="#"+c,h=function(){var b=window.location.hash;return b&&0<b.indexOf(c)&&(b=parseInt(b.substring(e.length),10),0<=b)?b-1:-1},m=h();-1!==m&&(a.st.startSlideId=m);k&&(d(window).on("hashchange"+a.ns,function(b){l||(b=h(),0>b||(b>a.numSlides-1&&(b=a.numSlides-1), 1448a.goTo(b)))}),a.ev.on("rsBeforeAnimStart",function(){g&&clearTimeout(g);f&&clearTimeout(f)}),a.ev.on("rsAfterSlideChange",function(){g&&clearTimeout(g);f&&clearTimeout(f);f=setTimeout(function(){l=!0;window.location.replace((""+window.location).split("#")[0]+e+(a.currSlideId+1));g=setTimeout(function(){l=!1;g=null},60)},400)}));a.ev.on("rsBeforeDestroy",function(){g=f=null;k&&d(window).off("hashchange"+a.ns)})}}});d.rsModules.deeplinking=d.rsProto._o5})(jQuery); 1449(function(d,a,l){function g(b){b=b||location.href;return"#"+b.replace(/^[^#]*#?(.*)$/,"$1")}"$:nomunge";var f="hashchange",k=document,c,e=d.event.special,h=k.documentMode,m="on"+f in a&&(h===l||7<h);d.fn[f]=function(b){return b?this.bind(f,b):this.trigger(f)};d.fn[f].delay=50;e[f]=d.extend(e[f],{setup:function(){if(m)return!1;d(c.start)},teardown:function(){if(m)return!1;
1449d(c.stop)}});c=function(){function b(){var c=g(),n=r(h);c!==h?(p(h=c,n),d(a).trigger(f)):n!==h&&(location.href=location.href.replace(/#.*/, 1450"")+n);e=setTimeout(b,d.fn[f].delay)}var c={},e,h=g(),q=function(b){return b},p=q,r=q;c.start=function(){e||b()};c.stop=function(){e&&clearTimeout(e);e=l};a.attachEvent&&!a.addEventListener&&!m&&function(){var a,e;c.start=function(){a||(e=(e=d.fn[f].src)&&e+g(),a=d('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){e||p(g());b()}).attr("src",e||"javascript:0").insertAfter("body")[0].contentWindow,k.onpropertychange=function(){try{"title"===event.propertyName&&(a.document.title= 1451k.title)}catch(b){}})};c.stop=q;r=function(){return g(a.location.href)};p=function(b,e){var c=a.document,g=d.fn[f].domain;b!==e&&(c.title=k.title,c.open(),g&&c.write('<script>document.domain="'+g+'"\x3c/script>'),c.close(),a.location.hash=b)}}();return c}()})(jQuery,this); 1452// jquery.rs.visible-nearby v1.0.2 1453(function(d){d.rsProto._g7=function(){var a=this;a.st.visibleNearby&&a.st.visibleNearby.enabled&&(a._h7={enabled:!0,centerArea:0.6,center:!0,breakpoint:0,breakpointCenterArea:0.8,hiddenOverflow:!0,navigateByCenterClick:!1},a.st.visibleNearby=d.extend({},a._h7,a.st.visibleNearby),a.ev.one("rsAfterPropsSetup",function(){a._i7=a._e1.css("overflow","visible").wrap('<div class="rsVisibleNearbyWrap"></div>').parent();a.st.visibleNearby.hiddenOverflow||a._i7.css("overflow","visible");a._o1=a.st.controlsInside? 1454a._i7:a.slider}),a.ev.on("rsAfterSizePropSet",function(){var b,c=a.st.visibleNearby;b=c.breakpoint&&a.width<c.breakpoint?c.breakpointCenterArea:c.centerArea;a._h?(a._b4*=b,a._i7.css({height:a._c4,width:a._b4/b}),a._d=a._b4*(1-b)/2/b):(a._c4*=b,a._i7.css({height:a._c4/b,width:a._b4}),a._d=a._c4*(1-b)/2/b);c.navigateByCenterClick||(a._q=a._h?a._b4:a._c4);c.center&&a._e1.css("margin-"+(a._h?"left":"top"),a._d)}))};d.rsModules.visibleNearby=d.rsProto._g7})(jQuery); 1455 1456/*! Riloadr.js 1.5.0 (c) 2013 Tubal Martin - MIT license */ 1457!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):window.Riloadr=a(jQuery)}(function(a){"use strict";function ib(b){function ib(){cb=ob(),_=jb(k,cb,K),db=_[D]&&lb(k,_[D]),eb=eb||G&&kb(k),fb=H&&mb(_,eb)}function rb(){var b,a=0;if((R||G)&&Ab(U,u,X),R&&(Ab(U,s,W),bb&&(hb=U[M],Ab(U,Q,Y)),B))for(;b=B[a];)Ab(V[O](b),s,W),a++}function sb(){var b,a=0;if(!G&&(Bb(U,u,X),R)){if(Bb(U,s,W),B)for(;b=B[a];)Bb(V[O](b),s,W),a++;bb&&Bb(U,Q,Y)}}function tb(a,b){a[y]=0,a[D]=h,a[v]=ub,a[w]=a[x]=xb,a[d]=pb(a,g,_),Z.splice(b,1)}function ub(){var c,e,a=this;"naturalWidth"in a?e=a.naturalWidth+a.naturalHeight:(c=new Image,c[d]=a[d],e=c[o]+c[q],c=j),+e>0&&(a[v]=a[w]=a[x]=j,a[C]&&(a[E]=a[E].replace(n,"$1$2")),R&&(a.style.visibility="visible"),v in b&&b[v][l](a),Eb())}function xb(){var f,a=this,c=function(b){var c=new Image;c[v]=function(){a[d]=c[d],ub[l](a)},c[w]=a[x]=function(){xb[l](a)},c[d]=b};a[v]=a[w]=a[x]=j,w in b&&b[w][l](a),a[y]<N?(a[y]++,f=pb(a,g,a[D]?db:_,e),c(f)):D in _&&!a[D]?(a[y]=0,a[D]=e,f=pb(a,g,db),c(f)):Eb()}function Eb(){$--,0===$&&(sb(),J in b&&b[J]())}var _,ab,eb,fb,c=this,g=b.base||p,k=b.breakpoints||zb('"breakpoints" not defined.'),m=b.name||"responsive",n=new RegExp("(^|\\s)"+m+"(\\s|$)"),t=b.defer&&("string"==typeof b.defer?{mode:b.defer,threshold:b.foldDistance,overflownElemsIds:[]}:b.defer),z=t&&t.mode.toLowerCase(),A=t&&t.threshold||100,B=t&&t.overflownElemsIds,F=b.watchViewportWidth,G=!!F,H="wider"==F,I="*"==F,K=b.ignoreLowBandwidth||h,N=b[y]||0,P=b.root||j,R=("invisible"==z||"belowfold"==z)&&!gb,W=vb(function(){c[L]()},i),X=wb(function(){G&&ib(),c[L](G)},i),Y=wb(function(){U[M]!==hb&&(hb=U[M],c[L]())},i),Z=[],$=0,db={};c[L]=function(b){yb(function(c,d){if(Z[r]&&b!==e||(b&&rb(),a("img."+m,P).each(function(a,b){b&&!b[C]&&((!G||G&&(!ab||H&&nb(_,ab)||I&&!mb(_,ab)))&&(Z.push(b),$++),(!G||fb)&&(b[C]=e))}),G&&(fb&&(G=h),ab=_)),Z[r])for(d=0;c=Z[d];)c&&(!R||R&&qb(c,A))&&(tb(c,d),d--),d++;c=j})},Cb(function(){S=a(U),T=V[f],P=P&&a("#"+P)||T,ib(),rb(),!z||R?c[L]():Db(c[L])})}function jb(a,b,c){for(var g,h,i,j,d=b,e=0,f={};g=a[e];)h=g[z],i=g[A],j=g[R],b>0?(h&&i&&b>=h&&i>=b||h&&!i&&b>=h||i&&!h&&i>=b)&&(!j||j&&eb>=j&&(c||!c&&!fb))&&(f=g):(0>=d||d>h||d>i)&&(d=h||i||d,f=g),e++;return f}function kb(a){for(var d,b=0,c={};d=a[b];)nb(d,c)&&(c=d),b++;return c}function lb(a,b){for(var d,c=0;d=a[c];){if(d.name==b)return d;c++}}function mb(a,b){return a.name===b.name&&a[z]===b[z]&&a[A]===b[A]&&a[R]===b[R]&&a[F]===b[F]}function nb(a,b){var c=+a[R]||1,d=+b[R]||1;return a=Math.max(+a[z]||0,+a[A]||0)*(eb>=c?c:1),b=Math.max(+b[z]||0,+b[A]||0)*(eb>=d?d:1),a>b}function ob(){for(var f,a=Math,b=[W.clientWidth,W.offsetWidth,T.clientWidth],c=a.ceil(db/eb),d=b[r],e=0;d>e;e++)isNaN(b[e])&&(b.splice(e,1),e--);return b[r]&&(f=a.max[m](a,b),isNaN(c)),f||c||0}function pb(a,b,c,d){var e=(a.getAttribute("data-base")||b)+(a.getAttribute("data-src")||a.getAttribute("data-src-"+c.name)||p);return c[F]&&(e=e.split("."),e.pop(),e=e.join(".")+"."+c[F]),d&&(e+=(_.test(e)?"&":"?")+"riloadrts="+(new Date).getTime()),e.replace(ab,c.name)}function fb(){var a=U.navigator,b=a.connection||a.mozConnection||a.webkitConnection||a.oConnection||a.msConnection||{},c=b.type||"unknown",d=+b.bandwidth||1/0;return d>0&&.1>d||/^[23]g|3|4$/.test(c+p)}function qb(b,c){var d=a(b);
1457return!(rb(d,c)||sb(d,c)||tb(d,c)||ub(d,c))}function rb(a,b){return S[q]()+S[I]()<=a[t]()[c]-b}function sb(a,b){return S[I]()>=a[t]()[c]+b+a[q]()}function tb(a,b){return S[o]()+S[K]()<=a[t]()[g]-b}function ub(a,b){return S[K]()>=a[t]()[g]+b+a[o]()}function vb(a,b){function h(){g=new Date,f=j,a[m](e,c)}var c,d,e,f,g=0;return function(){var i=new Date,j=b-(i-g);return c=arguments,e=this,0>=j?(g=i,d=a[m](e,c)):f||(f=xb(h,j)),d}}function wb(a,b,c){function h(){g=j,c||a[m](f,d)}var d,e,f,g;return function(){var i=c&&!g;return d=arguments,f=this,clearTimeout(g),g=xb(h,b),i&&(e=a[m](f,d)),e}}function xb(a,b){var c=Array[G].slice[l](arguments,2);return U.setTimeout(function(){return a[m](j,c)},b)}function yb(a){return xb[m](j,[a,1].concat(Array[G].slice[l](arguments,1)))}function zb(a){throw new Error("Riloadr: "+a)}function Ab(a,b,c){a[Z](Y+b,c,h)}function Bb(a,b,c){a[$](Y+b,c,h)}function Cb(b){a(b)}function Db(a){if(V.readyState===B)a();else{var b=function(){Bb(U,k,b),a()};Ab(U,k,b)}}var S,T,cb,hb,b="on",c="top",d="src",e=!0,f="body",g="left",h=!1,i=250,j=null,k="load",l="call",m="apply",n="error",o="width",p="",q="height",r="length",s="scroll",t="offset",u="resize",v=b+k,w=b+n,x=b+"abort",y="retries",z="minWidth",A="maxWidth",B="complete",C="riloaded",D="fallback",E="className",F="imgFormat",G="prototype",I=s+"Top",J=b+B,K=s+"Left",L=k+"Images",M="orientation",N="EventListener",O="getElementById",P="add"+N,Q=M+"change",R="minDevicePixelRatio",U=window,V=U.document,W=V.documentElement,X=P in V,Y=X?p:b,Z=X?P:"attachEvent",$=X?"remove"+N:"detachEvent",_=/\?/,ab=/{breakpoint-name}/gi,bb=M in U&&b+Q in U,db=U.screen[o],eb=U.devicePixelRatio||1,fb=fb(),gb="[object OperaMini]"===Object[G].toString[l](U.operamini);return W[E]=W[E].replace(/(^|\s)no-js(\s|$)/,"$1$2"),ib.version="1.5.0",ib[G].riload=function(){this[L](e)},ib}); 1458 1459 /* --- $DEBOUNCES RESIZE --- */ 1460 1461 /* debouncedresize: special jQuery event that happens once after a window resize 1462 * https://github.com/louisremi/jquery-smartresize 1463 * Copyright 2012 @louis_remi 1464 */ 1465 (function($){var $event=$.event,$special,resizeTimeout;$special=$event.special.debouncedresize={setup:function(){$(this).on("resize",$special.handler);},teardown:function(){$(this).off("resize",$special.handler);},handler:function(event,execAsap){var context=this,args=arguments,dispatch=function(){event.type="debouncedresize";$event.dispatch.apply(context,args);};if(resizeTimeout){clearTimeout(resizeTimeout);}execAsap?dispatch():resizeTimeout=setTimeout(dispatch,$special.threshold);},threshold:150};})(jQuery); 1466 1467 1468 1469 /* --- $AUTORESIZE TEXTAREA --- */ 1470 1471 /* Autosize v1.18.1 - 2013-11-05 1472 * Automatically adjust textarea height based on user input. 1473 * (c) 2013 Jack Moore - http://www.jacklmoore.com/autosize 1474 * license: http://www.opensource.org/licenses/mit-license.php 1475 */ 1476 (function(e){var t,o={className:"autosizejs",append:"",callback:!1,resizeDelay:10},i='<textarea tabindex="-1" style="position:absolute; top:-999px; left:0; right:auto; bottom:auto; border:0; padding: 0; -moz-box-sizing:content-box; -webkit-box-sizing:content-box; box-sizing:content-box; word-wrap:break-word; height:0 !important; min-height:0 !important; overflow:hidden; transition:none; -webkit-transition:none; -moz-transition:none;"/>',n=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","textTransform","wordSpacing","textIndent"],s=e(i).data("autosize",!0)[0];s.style.lineHeight="99px","99px"===e(s).css("lineHeight")&&n.push("lineHeight"),s.style.lineHeight="",e.fn.autosize=function(i){return this.length?(i=e.extend({},o,i||{}),s.parentNode!==document.body&&e(document.body).append(s),this.each(function(){function o(){var t,o;"getComputedStyle"in window?(t=window.getComputedStyle(u,null),o=u.getBoundingClientRect().width,e.each(["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"],function(e,i){o-=parseInt(t[i],10)}),s.style.width=o+"px"):s.style.width=Math.max(p.width(),0)+"px"}function a(){var a={};if(t=u,s.className=i.className,d=parseInt(p.css("maxHeight"),10),e.each(n,function(e,t){a[t]=p.css(t)}),e(s).css(a),o(),window.chrome){var r=u.style.width;u.style.width="0px",u.offsetWidth,u.style.width=r}}function r(){var e,n;t!==u?a():o(),s.value=u.value+i.append,s.style.overflowY=u.style.overflowY,n=parseInt(u.style.height,10),s.scrollTop=0,s.scrollTop=9e4,e=s.scrollTop,d&&e>d?(u.style.overflowY="scroll",e=d):(u.style.overflowY="hidden",c>e&&(e=c)),e+=w,n!==e&&(u.style.height=e+"px",f&&i.callback.call(u,u))}function l(){clearTimeout(h),h=setTimeout(function(){var e=p.width();e!==g&&(g=e,r())},parseInt(i.resizeDelay,10))}var d,c,h,u=this,p=e(u),w=0,f=e.isFunction(i.callback),z={height:u.style.height,overflow:u.style.overflow,overflowY:u.style.overflowY,wordWrap:u.style.wordWrap,resize:u.style.resize},g=p.width();p.data("autosize")||(p.data("autosize",!0),("border-box"===p.css("box-sizing")||"border-box"===p.css("-moz-box-sizing")||"border-box"===p.css("-webkit-box-sizing"))&&(w=p.outerHeight()-p.height()),c=Math.max(parseInt(p.css("minHeight"),10)-w||0,p.height()),p.css({overflow:"hidden",overflowY:"hidden",
1476wordWrap:"break-word",resize:"none"===p.css("resize")||"vertical"===p.css("resize")?"none":"horizontal"}),"onpropertychange"in u?"oninput"in u?p.on("input.autosize keyup.autosize",r):p.on("propertychange.autosize",function(){"value"===event.propertyName&&r()}):p.on("input.autosize",r),i.resizeDelay!==!1&&e(window).on("resize.autosize",l),p.on("autosize.resize",r),p.on("autosize.resizeIncludeStyle",function(){t=null,r()}),p.on("autosize.destroy",function(){t=null,clearTimeout(h),e(window).off("resize",l),p.off("autosize").off(".autosize").css(z).removeData("autosize")}),r())})):this}})(window.jQuery||window.$); 1477 1478 1479 1480 /* --- $SHARRRE --- */ 1481 1482 /*! 1483 * Sharrre.com - Make your sharing widget! 1484 * Version: beta 1.3.5 1485 * Author: Julien Hany 1486 * License: MIT http://en.wikipedia.org/wiki/MIT_License or GPLv2 http://en.wikipedia.org/wiki/GNU_General_Public_License 1487 */ 1488 1489 ;(function ( $, window, document, undefined ) { 1490 1491 /* Defaults 1492 ================================================== */ 1493 var pluginName = 'sharrre', 1494 defaults = { 1495 className: 'sharrre', 1496 share: { 1497 googlePlus: false, 1498 facebook: false, 1499 twitter: false, 1500 digg: false, 1501 delicious: false, 1502 stumbleupon: false, 1503 linkedin: false, 1504 pinterest: false 1505 }, 1506 shareTotal: 0, 1507 template: '', 1508 title: '', 1509 url: document.location.href, 1510 text: document.title, 1511 urlCurl: sharrre_urlCurl, //PHP script for google plus... 1512 count: {}, //counter by social network 1513 total: 0, //total of sharing 1514 shorterTotal: true, //show total by k or M when number is to big 1515 enableHover: true, //disable if you want to personalize hover event with callback 1516 enableCounter: true, //disable if you just want use buttons 1517 enableTracking: false, //tracking with google analitycs 1518 hover: function(){}, //personalize hover event with this callback function 1519 hide: function(){}, //personalize hide event with this callback function 1520 click: function(){}, //personalize click event with this callback function 1521 render: function(){}, //personalize render event with this callback function 1522 buttons: { //settings for buttons 1523 googlePlus : { //http://www.google.com/webmasters/+1/button/ 1524 url: '', //if you need to personnalize button url 1525 urlCount: false, //if you want to use personnalize button url on global counter 1526 size: 'medium', 1527 lang: 'en-US', 1528 annotation: '' 1529 }, 1530 facebook: { //http://developers.facebook.com/docs/reference/plugins/like/ 1531 url: '', //if you need to personalize url button 1532 urlCount: false, //if you want to use personnalize button url on global counter 1533 action: 'like', 1534 layout: 'button_count', 1535 width: '', 1536 send: 'false', 1537 faces: 'false', 1538 colorscheme: '', 1539 font: '', 1540 lang: 'en_US' 1541 }, 1542 twitter: { //http://twitter.com/about/resources/tweetbutton 1543 url: '', //if you need to personalize url button 1544 urlCount: false, //if you want to use personnalize button url on global counter 1545 count: 'horizontal', 1546 showCount: true, 1547 hashtags: '', 1548 via: '', 1549 related: '', 1550 lang: 'en', 1551 action: 'share', 1552 screenName: '', 1553 showScreenName: false, 1554 size: 'medium' 1555 }, 1556 digg: { //http://about.digg.com/downloads/button/smart 1557 url: '', //if you need to personalize url button 1558 urlCount: false, //if you want to use personnalize button url on global counter 1559 type: 'DiggCompact' 1560 }, 1561 delicious: { 1562 url: '', //if you need to personalize url button 1563 urlCount: false, //if you want to use personnalize button url on global counter 1564 size: 'medium' //medium or tall 1565 }, 1566 stumbleupon: { //http://www.stumbleupon.com/badges/ 1567 url: '', //if you need to personalize url button 1568 urlCount: false, //if you want to use personnalize button url on global counter 1569 layout: '1' 1570 }, 1571 linkedin: { //http://developer.linkedin.com/plugins/share-button 1572 url: '', //if you need to personalize url button 1573 urlCount: false, //if you want to use personnalize button url on global counter 1574 counter: '' 1575 }, 1576 pinterest: { //http://pinterest.com/about/goodies/ 1577 url: '', //if you need to personalize url button 1578 media: '', 1579 description: '', 1580 layout: 'horizontal' 1581 } 1582 } 1583 }, 1584 /* Json URL to get count number 1585 ================================================== */ 1586 urlJson = { 1587 googlePlus: "", 1588 1589 //new FQL method by Sire 1590 facebook: "https://graph.facebook.com/fql?q=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url=%27{url}%27&callback=?", 1591 //old method facebook: "http://graph.facebook.com/?id={url}&callback=?", 1592 //facebook : "http://api.ak.facebook.com/restserver.php?v=1.0&method=links.getStats&urls={url}&format=json" 1593 1594 twitter: { 1595 share: "http://cdn.api.twitter.com/1/urls/count.json?url={url}&callback=?", 1596 follow: "https://cdn.api.twitter.com/1/users/show.json?screen_name={screen_name}&callback=?" 1597 }, 1598 digg: "http://services.digg.com/2.0/story.getInfo?links={url}&type=javascript&callback=?", 1599 delicious: 'http://feeds.delicious.com/v2/json/urlinfo/data?url={url}&callback=?', 1600 //stumbleupon: "http://www.stumbleupon.com/services/1.01/badge.getinfo?url={url}&format=jsonp&callback=?", 1601 stumbleupon: "", 1602 linkedin: "http://www.linkedin.com/countserv/count/share?format=jsonp&url={url}&callback=?", 1603 pinterest: "http://api.pinterest.com/v1/urls/count.json?url={url}&callback=?" 1604 }, 1605 /* Load share buttons asynchronously 1606 ================================================== */ 1607 loadButton = { 1608 googlePlus : function(self){ 1609 var sett = self.options.buttons.googlePlus; 1610 //$(self.element).find('.buttons').append('<div class="button googleplus"><g:plusone size="'+self.options.buttons.googlePlus.size+'" href="'+self.options.url+'"></g:plusone></div>'); 1611 $(self.element).find('.buttons').append('<div class="button googleplus"><div class="g-plusone" data-size="'+sett.size+'" data-href="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-annotation="'+sett.annotation+'"></div></div>'); 1612 window.___gcfg = { 1613 lang: self.options.buttons.googlePlus.lang 1614 }; 1615 var loading = 0; 1616 if(typeof gapi === 'undefined' && loading == 0){ 1617 loading = 1; 1618 (function() { 1619 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; 1620 po.src = '//apis.google.com/js/plusone.js'; 1621 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); 1622 })(); 1623 } 1624 else{ 1625 gapi.plusone.go(); 1626 } 1627 }, 1628 facebook : function(self){ 1629 var sett = self.options.buttons.facebook; 1630 $(self.element).find('.buttons').append('<div class="button facebook"><div id="fb-root"></div><div class="fb-like" data-href="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-send="'+sett.send+'" data-layout="'+sett.layout+'" data-width="'+sett.width+'" data-show-faces="'+sett.faces+'" data-action="'+sett.action+'" data-colorscheme="'+sett.colorscheme+'" data-font="'+sett.font+'" data-via="'+sett.via+'"></div></div>'); 1631 var loading = 0; 1632 if(typeof FB === 'undefined' && loading == 0){ 1633 loading = 1; 1634 (function(d, s, id) { 1635 var js, fjs = d.getElementsByTagName(s)[0]; 1636 if (d.getElementById(id)) {return;} 1637 js = d.createElement(s); js.id = id; 1638 js.src = '//connect.facebook.net/'+sett.lang+'/all.js#xfbml=1'; 1639 fjs.parentNode.insertBefore(js, fjs); 1640 }(document, 'script', 'facebook-jssdk')); 1641 } 1642 else{ 1643 FB.XFBML.parse(); 1644 } 1645 }, 1646 twitter : function(self){ 1647 var sett = self.options.buttons.twitter; 1648 if(sett.action == 'share'){ 1649 $(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/share" class="twitter-share-button" data-url="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-count="'+sett.count+'" data-text="'+self.options.text+'" data-via="'+sett.via+'" data-hashtags="'+sett.hashtags+'" data-related="'+sett.related+'" data-lang="'+sett.lang+'">Tweet</a></div>'); 1650 } else if(sett.action == 'follow'){ 1651 $(self.element).find('.buttons').append('<div class="button twitter"><a href="https://twitter.com/' + sett.screenName + '" class="twitter-follow-button" data-show-count="' + sett.showCount + '" data-size="' + sett.size + '" data-lang="' + sett.lang + '" data-show-screen-name="' + sett.showScreenName + '">Follow me</a></div>'); 1652 } 1653 var loading = 0; 1654 if(typeof twttr === 'undefined' && loading == 0){ 1655 loading = 1; 1656 (function() { 1657 var twitterScriptTag = document.createElement('script'); 1658 twitterScriptTag.type = 'text/javascript'; 1659 twitterScriptTag.async = true; 1660 twitterScriptTag.src = '//platform.twitter.com/widgets.js'; 1661 var s = document.getElementsByTagName('script')[0]; 1662 s.parentNode.insertBefore(twitterScriptTag, s); 1663 })(); 1664 } 1665 else{ 1666 $.ajax({ url: '//platform.twitter.com/widgets.js', dataType: '
1666script', cache:true}); //http://stackoverflow.com/q/6536108 1667 } 1668 }, 1669 digg : function(self){ 1670 var sett = self.options.buttons.digg; 1671 $(self.element).find('.buttons').append('<div class="button digg"><a class="DiggThisButton '+sett.type+'" rel="nofollow external" href="http://digg.com/submit?url='+encodeURIComponent((sett.url !== '' ? sett.url : self.options.url))+'"></a></div>'); 1672 var loading = 0; 1673 if(typeof __DBW === 'undefined' && loading == 0){ 1674 loading = 1; 1675 (function() { 1676 var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; 1677 s.type = 'text/javascript'; 1678 s.async = true; 1679 s.src = '//widgets.digg.com/buttons.js'; 1680 s1.parentNode.insertBefore(s, s1); 1681 })(); 1682 } 1683 }, 1684 delicious : function(self){ 1685 if(self.options.buttons.delicious.size == 'tall'){//tall 1686 var css = 'width:50px;', 1687 cssCount = 'height:35px;width:50px;font-size:15px;line-height:35px;', 1688 cssShare = 'height:18px;line-height:18px;margin-top:3px;'; 1689 } 1690 else{//medium 1691 var css = 'width:93px;', 1692 cssCount = 'float:right;padding:0 3px;height:20px;width:26px;line-height:20px;', 1693 cssShare = 'float:left;height:20px;line-height:20px;'; 1694 } 1695 var count = self.shorterTotal(self.options.count.delicious); 1696 if(typeof count === "undefined"){ 1697 count = 0; 1698 } 1699 $(self.element).find('.buttons').append( 1700 '<div class="button delicious">
1700<div style="'+css+'font:12px Arial,Helvetica,sans-serif;cursor:pointer;color:#666666;display:inline-block;float:none;height:20px;line-height:normal;margin:0;padding:0;text-indent:0;vertical-align:baseline;">'+ 1701 '<div style="'+cssCount+'background-color:#fff;margin-bottom:5px;overflow:hidden;text-align:center;border:1px solid #ccc;border-radius:3px;">'+count+'</div>'+ 1702 '<div style="'+cssShare+'display:block;padding:0;text-align:center;text-decoration:none;width:50px;background-color:#7EACEE;border:1px solid #40679C;border-radius:3px;color:#fff;">'+ 1703 '<img src="http://www.delicious.com/static/img/delicious.small.gif" height="10" width="10" alt="Delicious" /> Add</div></div></div>'); 1704 1705 $(self.element).find('.delicious').on('click', function(){ 1706 self.openPopup('delicious'); 1707 }); 1708 }, 1709 stumbleupon : function(self){ 1710 var sett = self.options.buttons.stumbleupon; 1711 $(self.element).find('.buttons').append('<div class="button stumbleupon"><su:badge layout="'+sett.layout+'" location="'+(sett.url !== '' ? sett.url : self.options.url)+'"></su:badge></div>'); 1712 var loading = 0; 1713 if(typeof STMBLPN === 'undefined' && loading == 0){ 1714 loading = 1; 1715 (function() { 1716 var li = document.createElement('script');li.type = 'text/javascript';li.async = true; 1717 li.src = '//platform.stumbleupon.com/1/widgets.js'; 1718 var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s); 1719 })(); 1720 s = window.setTimeout(function(){ 1721 if(typeof STMBLPN !== 'undefined'){ 1722 STMBLPN.processWidgets(); 1723 clearInterval(s); 1724 } 1725 },500); 1726 } 1727 else{ 1728 STMBLPN.processWidgets(); 1729 } 1730 }, 1731 linkedin : function(self){ 1732 var sett = self.options.buttons.linkedin; 1733 $(self.element).find('.buttons').append('<div class="button linkedin"><script type="in/share" data-url="'+(sett.url !== '' ? sett.url : self.options.url)+'" data-counter="'+sett.counter+'"></script></div>'); 1734 var loading = 0; 1735 if(typeof window.IN === 'undefined' && loading == 0){ 1736 loading = 1; 1737 (function() { 1738 var li = document.createElement('script');li.type = 'text/javascript';li.async = true; 1739 li.src = '//platform.linkedin.com/in.js'; 1740 var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s); 1741 })(); 1742 } 1743 else{ 1744 window.IN.init(); 1745 } 1746 }, 1747 pinterest : function(self){ 1748 var sett = self.options.buttons.pinterest; 1749 $(self.element).find('.buttons').append('<div class="button pinterest"><a href="http://pinterest.com/pin/create/button/?url='+(sett.url !== '' ? sett.url : self.options.url)+'&media='+sett.media+'&description='+sett.description+'" class="pin-it-button" count-layout="'+sett.layout+'">Pin It</a></div>'); 1750 1751 (function() { 1752 var li = document.createElement('script');li.type = 'text/javascript';li.async = true; 1753 li.src = '//assets.pinterest.com/js/pinit.js'; 1754 var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(li, s); 1755 })(); 1756 } 1757 }, 1758 /* Tracking for Google Analytics 1759 ================================================== */ 1760 tracking = { 1761 googlePlus: function(){}, 1762 facebook: function(){ 1763 //console.log('facebook'); 1764 fb = window.setInterval(function(){ 1765 if (typeof FB !== 'undefined') { 1766 FB.Event.subscribe('edge.create', function(targetUrl) { 1767 _gaq.push(['_trackSocial', 'facebook', 'like', targetUrl]); 1768 }); 1769 FB.Event.subscribe('edge.remove', function(targetUrl) { 1770 _gaq.push(['_trackSocial', 'facebook', 'unlike', targetUrl]); 1771 }); 1772 FB.Event.subscribe('message.send', function(targetUrl) { 1773 _gaq.push(['_trackSocial', 'facebook', 'send', targetUrl]); 1774 }); 1775 //console.log('ok'); 1776 clearInterval(fb); 1777 } 1778 },1000); 1779 }, 1780 twitter: function(){ 1781 //console.log('twitter'); 1782 tw = window.setInterval(function(){ 1783 if (typeof twttr !== 'undefined') { 1784 twttr.events.bind('tweet', function(event) { 1785 if (event) {
1786 _gaq.push(['_trackSocial', 'twitter', 'tweet']); 1787 } 1788 }); 1789 //console.log('ok'); 1790 clearInterval(tw); 1791 } 1792 },1000); 1793 }, 1794 digg: function(){ 1795 //if somenone find a solution, mail me ! 1796 /*$(this.element).find('.digg').on('click', function(){ 1797 _gaq.push(['_trackSocial', 'digg', 'add']); 1798 });*/ 1799 }, 1800 delicious: function(){}, 1801 stumbleupon: function(){}, 1802 linkedin: function(){ 1803 function LinkedInShare() { 1804 _gaq.push(['_trackSocial', 'linkedin', 'share']); 1805 } 1806 }, 1807 pinterest: function(){ 1808 //if somenone find a solution, mail me ! 1809 } 1810 }, 1811 /* Popup for each social network 1812 ================================================== */ 1813 popup = { 1814 googlePlus: function(opt){ 1815 window.open("https://plus.google.com/share?hl="+opt.buttons.googlePlus.lang+"&url="+encodeURIComponent((opt.buttons.googlePlus.url !== '' ? opt.buttons.googlePlus.url : opt.url)), "", "toolbar=0, status=0, width=900, height=500"); 1816 }, 1817 facebook: function(opt){ 1818 window.open("http://www.facebook.com/sharer/sharer.php?u="+encodeURIComponent((opt.buttons.facebook.url !== '' ? opt.buttons.facebook.url : opt.url))+"&t="+opt.text+"", "", "toolbar=0, status=0, width=900, height=500"); 1819 }, 1820 twitter: function(opt){ 1821 window.open("https://twitter.com/intent/tweet?text="+encodeURIComponent(opt.text)+"&url="+encodeURIComponent((opt.buttons.twitter.url !== '' ? opt.buttons.twitter.url : opt.url))+(opt.buttons.twitter.via !== '' ? '&via='+opt.buttons.twitter.via : ''), "", "toolbar=0, status=0, width=650, height=360"); 1822 }, 1823 digg: function(opt){ 1824 window.open("http://digg.com/tools/diggthis/submit?url="+encodeURIComponent((opt.buttons.digg.url !== '' ? opt.buttons.digg.url : opt.url))+"&title="+opt.text+"&related=true&style=true", "", "toolbar=0, status=0, width=650, height=360"); 1825 }, 1826 delicious: function(opt){ 1827 window.open('http://www.delicious.com/save?v=5&noui&jump=close&url='+encodeURIComponent((opt.buttons.delicious.url !== '' ? opt.buttons.delicious.url : opt.url))+'&title='+opt.text, 'delicious', 'toolbar=no,width=550,height=550'); 1828 }, 1829 stumbleupon: function(opt){ 1830 window.open('http://www.stumbleupon.com/badge/?url='+encodeURIComponent((opt.buttons.delicious.url !== '' ? opt.buttons.delicious.url : opt.url)), 'stumbleupon', 'toolbar=no,width=550,height=550'); 1831 }, 1832 linkedin: function(opt){ 1833 window.open('https://www.linkedin.com/cws/share?url='+encodeURIComponent((opt.buttons.delicious.url !== '' ? opt.buttons.delicious.url : opt.url))+'&token=&isFramed=true', 'linkedin', 'toolbar=no,width=550,height=550'); 1834 }, 1835 pinterest: function(opt){ 1836 window.open('http://pinterest.com/pin/create/button/?url='+encodeURIComponent((opt.buttons.pinterest.url !== '' ? opt.buttons.pinterest.url : opt.url))+'&media='+encodeURIComponent(opt.buttons.pinterest.media)+'&description='+opt.buttons.pinterest.description, 'pinterest', 'toolbar=no,width=700,height=300'); 1837 } 1838 }; 1839 1840 /* Plugin constructor 1841 ================================================== */ 1842 function Plugin( element, options ) { 1843 this.element = element; 1844 1845 this.options = $.extend( true, {}, defaults, options); 1846 this.options.share = options.share; //simple solution to allow order of buttons 1847 1848 this._defaults = defaults; 1849 this._name = pluginName; 1850 1851 this.init(); 1852 }; 1853 1854 /* Initialization method 1855 ================================================== */ 1856 Plugin.prototype.init = function () { 1857 var self = this; 1858 if(this.options.urlCurl !== ''){ 1859 urlJson.googlePlus = this.options.urlCurl + '?url={url}&type=googlePlus'; // PHP script for GooglePlus... 1860 urlJson.stumbleupon = this.options.urlCurl + '?url={url}&type=stumbleupon'; // PHP script for Stumbleupon... 1861 } 1862 $(this.element).addClass(this.options.className); //add class 1863 1864 //HTML5 Custom data 1865 if(typeof $(this.element).data('title') !== 'undefined'){ 1866 this.options.title = $(this.element).attr('data-title'); 1867 } 1868 if(typeof $(this.element).data('url') !== 'undefined'){ 1869 this.options.url = $(this.element).data('url'); 1870 } 1871 if(typeof $(this.element).data('text') !== 'undefined'){ 1872 this.options.text = $(this.element).data('text'); 1873 } 1874 1875 //how many social website have been selected 1876 $.each(this.options.share, function(name, val) { 1877 if(val === true){ 1878 self.options.shareTotal ++; 1879 } 1880 }); 1881 1882 if(self.options.enableCounter === true){ //if for some reason you don't need counter 1883 //get count of social share that have been selected 1884 $.each(this.options.share, function(name, val) { 1885 if(val === true){ 1886 //self.getSocialJson(name); 1887 try { 1888 self.getSocialJson(name); 1889 } catch(e){ 1890 } 1891 } 1892 }); 1893 } 1894 else if(self.options.template !== ''){ //for personalized button (with template) 1895 this.options.render(this, this.options); 1896 } 1897 else{ // if you want to use official button like example 3 or 5 1898 this.loadButtons(); 1899 } 1900 1901 //add hover event 1902 $(this.element).hover(function(){ 1903 //load social button if enable and 1 time 1904 if($(this).find('.buttons').length === 0 && self.options.enableHover === true){ 1905 self.loadButtons(); 1906 } 1907 self.options.hover(self, self.options); 1908 }, function(){ 1909 self.options.hide(self, self.options); 1910 }); 1911 1912 //click event 1913 $(this.element).click(function(){ 1914 self.options.click(self, self.options); 1915 return false;
1916 }); 1917 }; 1918 1919 /* loadButtons methode 1920 ================================================== */ 1921 Plugin.prototype.loadButtons = function () { 1922 var self = this; 1923 $(this.element).append('<div class="buttons"></div>'); 1924 $.each(self.options.share, function(name, val) { 1925 if(val == true){ 1926 loadButton[name](self); 1927 if(self.options.enableTracking === true){ //add tracking 1928 tracking[name](); 1929 } 1930 } 1931 }); 1932 }; 1933 1934 /* getSocialJson methode 1935 ================================================== */ 1936 Plugin.prototype.getSocialJson = function (name) { 1937 var self = this, 1938 count = 0, 1939 baseUrl = '', 1940 url = ''; 1941 1942 if(name == 'twitter'){ 1943 baseUrl = urlJson[name][this.options.buttons[name].action].replace('{screen_name}', this.options.buttons[name].screenName); 1944 }else{ 1945 baseUrl = urlJson[name]; 1946 } 1947 1948 url = baseUrl.replace('{url}', encodeURIComponent(this.options.url)); 1949 if(this.options.buttons[name].urlCount === true && this.options.buttons[name].url !== ''){ 1950 url = baseUrl.replace('{url}', this.options.buttons[name].url); 1951 } 1952 1953 //console.log('name : ' + name + ' - url : '+url); //debug 1954 if(url != '' && self.options.urlCurl !== ''){ //urlCurl = '' if you don't want to used PHP script but used social button 1955 $.getJSON(url, function(json){ 1956 if(typeof json.count !== "undefined"){ //GooglePlus, Stumbleupon, Twitter, Pinterest and Digg 1957 var temp = json.count + ''; 1958 temp = temp.replace('\u00c2\u00a0', ''); //remove google plus special chars 1959 count += parseInt(temp, 10); 1960 } 1961 else if(typeof json.followers_count != "undefined"){ 1962 count += json.followers_count; 1963 } 1964 //get the FB total count (shares, likes and more) 1965 else if(json.data && json.data.length > 0 && typeof json.data[0].total_count !== "undefined"){ //Facebook total count 1966 count += parseInt(json.data[0].total_count, 10); 1967 } 1968 else if(typeof json[0] !== "undefined"){ //Delicious 1969 count += parseInt(json[0].total_posts, 10); 1970 } 1971 else if(typeof json[0] !== "undefined"){ //Stumbleupon 1972 } 1973 self.options.count[name] = count; 1974 self.options.total += count; 1975 self.renderer(); 1976 self.rendererPerso(); 1977 //console.log(json); //debug 1978 }) 1979 .error(function() { 1980 self.options.count[name] = 0; 1981 self.rendererPerso(); 1982 }); 1983 } 1984 else{ 1985 self.renderer(); 1986 self.options.count[name] = 0; 1987 self.rendererPerso(); 1988 } 1989 }; 1990 1991 /* launch render methode 1992 ================================================== */ 1993 Plugin.prototype.rendererPerso = function () { 1994 //check if this is the last social website to launch render 1995 var shareCount = 0; 1996 for (e in this.options.count) { shareCount++; } 1997 if(shareCount === this.options.shareTotal){ 1998 this.options.render(this, this.options); 1999 } 2000 }; 2001 2002 /* render methode 2003 ================================================== */ 2004 Plugin.prototype.renderer = function () { 2005 var total = this.options.total, 2006 template = this.options.template; 2007 if(this.options.shorterTotal === true){ //format number like 1.2k or 5M 2008 total = this.shorterTotal(total); 2009 } 2010 2011 if(template !== ''){ //if there is a template 2012 template = template.replace('{total}', total); 2013 $(this.element).html(template); 2014 } 2015 else{ //template by defaults 2016 $(this.element).html( 2017 '<div class="box"><a class="count" href="#">' + total + '</a>' + 2018 (this.options.title !== '' ? '<a class="share" href="#">' + this.options.title + '</a>' : '') + 2019 '</div>' 2020 ); 2021 } 2022 2023 $(document).trigger("share-box-rendered"); 2024 }; 2025 2026 /* format total numbers like 1.2k or 5M 2027 ================================================== */ 2028 Plugin.prototype.shorterTotal = function (num) { 2029 if (num >= 1e6){ 2030 num = (num / 1e6).toFixed(2) + "M" 2031 } else if (num >= 1e3){ 2032 num = (num / 1e3).toFixed(1) + "k" 2033 } 2034 return num; 2035 }; 2036 2037 /* Methode for open popup 2038 ================================================== */ 2039 Plugin.prototype.openPopup = function (site) { 2040 popup[site](this.options); //open 2041 2042 if(this.options.enableTracking === true){ //tracking! 2043 var tracking = { 2044 googlePlus: {site: 'Google', action: '+1'}, 2045 facebook: {site: 'facebook', action: 'like'}, 2046 twitter: {site: 'twitter', action: 'tweet'},
2047 digg: {site: 'digg', action: 'add'}, 2048 delicious: {site: 'delicious', action: 'add'}, 2049 stumbleupon: {site: 'stumbleupon', action: 'add'}, 2050 linkedin: {site: 'linkedin', action: 'share'}, 2051 pinterest: {site: 'pinterest', action: 'pin'} 2052 }; 2053 _gaq.push(['_trackSocial', tracking[site].site, tracking[site].action]); 2054 } 2055 }; 2056 2057 /* Methode for add +1 to a counter 2058 ================================================== */ 2059 Plugin.prototype.simulateClick = function () { 2060 var html = $(this.element).html(); 2061 $(this.element).html(html.replace(this.options.total, this.options.total+1)); 2062 }; 2063 2064 /* Methode for add +1 to a counter 2065 ================================================== */ 2066 Plugin.prototype.update = function (url, text) { 2067 if(url !== ''){ 2068 this.options.url = url; 2069 } 2070 if(text !== ''){ 2071 this.options.text = text; 2072 } 2073 }; 2074 2075 /* A really lightweight plugin wrapper around the constructor, preventing against multiple instantiations 2076 ================================================== */ 2077 $.fn[pluginName] = function ( options ) { 2078 var args = arguments; 2079 if (options === undefined || typeof options === 'object') { 2080 return this.each(function () { 2081 if (!$.data(this, 'plugin_' + pluginName)) { 2082 $.data(this, 'plugin_' + pluginName, new Plugin( this, options )); 2083 } 2084 }); 2085 } else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') { 2086 return this.each(function () { 2087 var instance = $.data(this, 'plugin_' + pluginName); 2088 if (instance instanceof Plugin && typeof instance[options] === 'function') { 2089 instance[options].apply( instance, Array.prototype.slice.call( args, 1 ) ); 2090 } 2091 }); 2092 } 2093 }; 2094 })(jQuery, window, document); 2095 2096 2097 2098 /* --- $SMOOTH PAGE SCROLL --- */ 2099 /* 2100 * Performs a smooth page scroll to an anchor on the same page. 2101 * http://css-tricks.com/snippets/jquery/smooth-scrolling/ 2102 */ 2103 $(function() { 2104 $('a[href*=#]:not([href=#])').click(function(event) { 2105 //exclude some links from smooth scrolling like tabs 2106 if ($(this).parents('.tabs__nav').length) { 2107 //do nothing 2108 } else if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) { 2109 var target = $(this.hash); 2110 target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); 2111 if (target.length) { 2112 $('html,body').animate({ 2113 scrollTop: target.offset().top 2114 }, 700); 2115 event.preventDefault(); 2116 } 2117 } 2118 }); 2119 }); 2120 2121 /* ====== INTERNAL FUNCTIONS ====== */ 2122 2123 /* --- DETECT VIEWPORT SIZE --- */ 2124 2125 function browserSize(){ 2126 wh = $(window).height(); 2127 ww = $(window).width(); 2128 dh = $(document).height(); 2129 ar = ww/wh; 2130 }; 2131 2132 2133 /* --- Set Query Parameter--- */ 2134 // function setQueryParameter(uri, key, value) { 2135 // var re = new RegExp("([?|&])" + key + "=.*?(&|$)", "i"); 2136 // separator = uri.indexOf('?') !== -1 ? "&" : "?"; 2137 // if (uri.match(re)) { 2138 // return uri.replace(re, '$1' + key + "=" + value + '$2'); 2139 // } 2140 // else { 2141 // return uri + separator + key + "=" + value; 2142 // } 2143 // } 2144 2145 2146 /* --- $VIDEOS --- */ 2147 2148 // function resizeVideos() { 2149 2150 // var videos = $('iframe[src*="youtube.com"], iframe[src*="youtube-nocookie.com"], iframe[src*="vimeo.com"], video'); 2151 2152 // videos.each(function() { 2153 // var video = $(this), 2154 // ratio = video.data('aspectRatio'), 2155 // w = video.css('width', '100%').width(), 2156 // h = w/ratio; 2157 // video.height(h); 2158 // }); 2159 // } 2160 2161 // function initVideos() { 2162 2163 // var videos = $('iframe[src*="youtube.com"], iframe[src*="vimeo.com"], video'); 2164 2165 // // Figure out and save aspect ratio for each video 2166 // videos.each(function() { 2167 // if( this.width != 0 && this.height != 0 ){ 2168 // $(this).data('aspectRatio', this.width / this.height) 2169 // // and remove the hard coded width/height 2170 // .removeAttr('height') 2171 // .removeAttr('width'); 2172 // } else { // for the conflict with jetpack set an default aspect ration of 16/9 2173 // $(this).data('aspectRatio', 16/9 ) 2174 // .removeAttr('height') 2175 // .removeAttr('width'); 2176 // } 2177 // }); 2178 2179 // resizeVideos(); 2180 2181 // // Firefox Opacity Video Hack 2182 // $('iframe[src*="youtube.com"], iframe[src*="vimeo.com"]').each(function(){ 2183 // var url = $(this).attr("src"); 2184 2185 // $(this).attr("src", setQueryParameter(url, "wmode", "transparent")); 2186 // }); 2187 // } 2188 2189 2190 function stickyHeader(){ 2191 if($('body').hasClass('sticky-nav')){ 2192 var sticky = $('.js-sticky'); 2193 var offset = sticky.offset(); 2194 var stickyHeight = sticky.height(); 2195 2196 sticky.parent().height(stickyHeight); 2197 sticky.parent().css('margin-bottom', '24px'); 2198 2199 $(window).scroll(function() { 2200 2201 if ( $(window).scrollTop() > offset.top){ 2202 sticky.addClass('sticky'); 2203 } else { 2204 sticky.removeClass('sticky'); 2205 } 2206 2207 }); 2208 } 2209 } 2210 2211 2212 /* MAGNIFIC POPUP INIT */ 2213 /* 2214 function magnificPopupInit(){ 2215 2216 $('.js-post-gallery').each(function() { // the containers for all your galleries should have the class gallery 2217 $(this).magnificPopup({ 2218 delegate: 'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".png"], a[href$=".gif"]', // the container for each your gallery items 2219 type: 'image', 2220 removalDelay: 500, 2221 mainClass: 'mfp-fade', 2222 image: { 2223 titleSrc: function (item){ 2224 var output = ''; 2225 if ( typeof item.el.attr('data-title') !== "undefined" && item.el.attr('data-title') !== "") { 2226 output = item.el.attr('data-title'); 2227 } 2228 if ( typeof item.el.attr('data-alt') !== "undefined" && item.el.attr('data-alt') !== "") { 2229 output += '<small>'+item.el.attr('data-alt')+'</small>'; 2230 } 2231 return output; 2232 } 2233 }, 2234 gallery:{ 2235 enabled:true, 2236 navigateByImgClick: true 2237 } 2238 }); 2239 }); 2240 } 2241 */ 2242 /* RILOADR INIT */ 2243 function riloadrInit() { 2244 // Lazy loading for images with '.lazy' class 2245 var riloadrImages = new Riloadr({ 2246 name : 'lazy', 2247 breakpoints: [ 2248 {name: 'whatever' , minWidth: 1} 2249 ], 2250 defer: { 2251 mode: 'load' 2252 } 2253 }); 2254 2255 // Responsive Featured Image for single post page 2256 var riloadrSingle = new Riloadr({ 2257 name : 'riloadr-single', 2258 breakpoints: [ 2259 {name: 'small' , maxWidth: 400}, 2260 {name: 'big' , minWidth: 401} 2261 ], 2262 watchViewportWidth: "*" 2263 }); 2264 } 2265 2266 /* --- $ROYALSLIDER --- */ 2267 var $original_billboard_slider; 2268 2269 /* 2270 * Slider Initialization 2271 */ 2272 function sliderInit($slider){ 2273 2274 $slider.find('img').removeClass('invisible'); 2275 2276 var $children = $(this).children(), 2277 rs_arrows = typeof $slider.data('arrows') !== "undefined", 2278 rs_bullets = typeof $slider.data('bullets') !== "undefined" ? "bullets" : "none", 2279 rs_autoheight = typeof $slider.data('autoheight') !== "undefined", 2280 rs_autoScaleSlider = false, 2281 rs_autoScaleSliderWidth = $slider.data('autoscalesliderwidth'), 2282 rs_autoScaleSliderHeight = $slider.data('autoscalesliderheight'), 2283 rs_customArrows = typeof $slider.data('customarrows') !== "undefined", 2284 rs_slidesSpacing = typeof $slider.data('slidesspacing') !== "undefined" ? parseInt($slider.data('slidesspacing')) : 0, 2285 rs_keyboardNav = typeof $slider.data('fullscreen') !== "undefined", 2286 rs_imageScale = $slider.data('imagescale'), 2287 rs_visibleNearby = typeof $slider.data('visiblenearby') !== "undefined" ? true : false, 2288 rs_imageAlignCenter = typeof $slider.data('imagealigncenter') !== "undefined", 2289 rs_transition = typeof $slider.data('slidertransition') !== "undefined" && $slider.data('slidertransition') != '' ? $slider.data('slidertransition') : 'move', 2290 rs_autoPlay = typeof $slider.data('sliderautoplay') !== "undefined" ? true : false, 2291 rs_delay = typeof $slider.data('sliderdelay') !== "undefined" && $slider.data('sliderdelay') != '' ? $slider.data('sliderdelay') : '1000', 2292 rs_drag = true, 2293 rs_globalCaption = typeof $slider.data('showcaptions') !== "undefined" ? true : false;
2294 2295 if(rs_autoheight) { rs_autoScaleSlider = false } else { rs_autoScaleSlider = true } 2296 2297 // Single slide case 2298 if ($children.length == 1){ 2299 rs_arrows = false; 2300 rs_bullets = 'none'; 2301 rs_customArrows = false; 2302 rs_keyboardNav = false; 2303 rs_drag = false; 2304 rs_transition = 'fade'; 2305 } 2306 2307 // make sure default arrows won't appear if customArrows is set 2308 if (rs_customArrows) arrows = false; 2309 2310 //the main params for Royal Slider 2311 var royalSliderParams = { 2312 autoHeight: rs_autoheight, 2313 autoScaleSlider: rs_autoScaleSlider, 2314 loop: true, 2315 autoScaleSliderWidth: rs_autoScaleSliderWidth, 2316 autoScaleSliderHeight: rs_autoScaleSliderHeight, 2317 imageScaleMode: rs_imageScale, 2318 imageAlignCenter: rs_imageAlignCenter, 2319 slidesSpacing: rs_slidesSpacing, 2320 arrowsNav: rs_arrows, 2321 controlNavigation: rs_bullets, 2322 keyboardNavEnabled: rs_keyboardNav, 2323 arrowsNavAutoHide: false, 2324 sliderDrag: rs_drag, 2325 transitionType: rs_transition, 2326 autoPlay: { 2327 enabled: rs_autoPlay, 2328 stopAtAction: true, 2329 pauseOnHover: true, 2330 delay: rs_delay 2331 }, 2332 numImagesToPreload: 2, 2333 globalCaption:rs_globalCaption, 2334 navigateByClick: false 2335 }; 2336 2337 if (rs_visibleNearby) { 2338 royalSliderParams['visibleNearby'] = { 2339 enabled: true, 2340 //centerArea: 0.8, 2341 center: true, 2342 breakpoint: 0, 2343 //breakpointCenterArea: 0.64, 2344 navigateByCenterClick: false 2345 } 2346 } 2347 2348 //lets fire it up 2349 $slider.royalSlider(royalSliderParams); 2350 $slider.addClass('slider--loaded'); 2351 2352 var royalSlider = $slider.data('royalSlider'); 2353 var slidesNumber = royalSlider.numSlides; 2354 2355 // move arrows outside rsOverflow 2356 $slider.find('.rsArrow').appendTo($slider); 2357 2358 royalSlider.ev.on('rsVideoPlay', function() { 2359 if(rs_imageScale == 'fill'){ 2360 var $frameHolder = $('.rsVideoFrameHolder'); 2361 var top = Math.abs(royalSlider.height - $frameHolder.closest('.rsVideoContainer').height())/2; 2362 2363 $frameHolder.height(royalSlider.height); 2364 $frameHolder.css('margin-top', top+'px'); 2365 2366 } else { 2367 var $frameHolder = $('.rsVideoFrameHolder'); 2368 var $videoContainer = $('.rsVideoFrameHolder').closest('.rsVideoContainer'); 2369 var top = parseInt($frameHolder.closest('.rsVideoContainer').css('margin-top'), 10); 2370 2371 if(top < 0){ 2372 top = Math.abs(top); 2373 $frameHolder 2374 .height(royalSlider.height) 2375 .css('top', top + 'px'); 2376 } 2377 } 2378 }); 2379 2380 $slider.addClass('slider--loaded'); 2381 } 2382 2383 2384 2385 /* 2386 * Wordpress Galleries to Sliders 2387 * Create the markup for the slider from the gallery shortcode 2388 * take all the images and insert them in the .gallery <div> 2389 */ 2390 function sliderMarkupGallery($gallery){ 2391 var $old_gallery = $gallery, 2392 gallery_data = $gallery.data(), 2393 $images = $old_gallery.find('img'), 2394 $new_gallery = $('<div class="pixslider js-pixslider">'); 2395 2396 $images.prependTo($new_gallery).addClass('rsImg'); 2397 $old_gallery.replaceWith($new_gallery); 2398 2399 $new_gallery.data(gallery_data); 2400 } 2401 2402 2403 /* 2404 * Change the Slider markup from (1 big / 2 small) to (3 big) 2405 * ORIGINAL to MOBILE 2406 */ 2407 function sliderMarkupMobile($slider){ 2408 var $parent = $slider; 2409 2410 // Change markup to default 2411 $slider.replaceWith($original_billboard_slider); 2412 $slider = $('.billboard.js-pixslider'); 2413 2414 // Change parameters 2415 $slider.attr('data-autoheight', true); 2416 $slider.attr('data-imagescale', 'none'); 2417 2418 $slider.find('.billboard--article-group').each(function(){ 2419 // var $slide = $(this), 2420 // $slide_thumb = $slide.find('.article--billboard-small img'); 2421 2422 // // For each slide thumb(because there are two) 2423 // // we set the new image source 2424 // $slide_thumb.each(function(){ 2425 // slide_thumb_big_src = $(this).attr('data-src-big'); 2426 // $(this).attr('src', slide_thumb_big_src); 2427 // }); 2428 2429 // Change thumbnail for small articles 2430 $(this).children('.article').removeClass('rsABlock'); 2431 2432 $(this).before($(this).html()) 2433 .remove(); 2434 }); 2435 2436 // Mark as mobile 2437 $slider.addClass('js-pixslider-mobile'); 2438 2439 $slider.addClass('rsAutoHeight'); 2440 2441 sliderInit($slider); 2442 } 2443 2444 2445 2446 /* 2447 * Change the Slider Markup from (3 big) to (1 big / 2 small) 2448 * MOBILE to ORIGINAL 2449 */ 2450 function sliderMarkupOriginal($slider){ 2451 2452 // Change markup 2453 $slider.replaceWith($original_billboard_slider); 2454 $slider = $('.billboard.js-pixslider'); 2455 2456 // Change parameters 2457 $slider.removeAttr('data-autoheight'); 2458 $slider.removeAttr('imagescale'); 2459 2460 $slider.removeClass('js-pixslider-mobile'); 2461 $slider.removeClass('rsAutoHeight'); 2462 2463 sliderInit($slider); 2464 } 2465 2466 2467 2468 /* 2469 * Billboard Slider markup changes (on resize) 2470 */ 2471 function slider_billboard() { 2472 var window_size = $(window).width(); 2473 2474 $('.js-pixslider.billboard').each(function(){ 2475 $slider = $(this); 2476 var slider_rs = $slider.data('royalSlider'); 2477 2478 if((window_size < 900) && (!$slider.hasClass('js-pixslider-mobile'))) { 2479 if(slider_rs) slider_rs.destroy(); 2480 sliderMarkupMobile($slider); 2481 } else if((window_size > 900) && ($slider.hasClass('js-pixslider-mobile'))) { 2482 if(slider_rs) slider_rs.destroy(); 2483 sliderMarkupOriginal($slider); 2484 } 2485 }); 2486 2487 // riloadrSlider.riload(); 2488 } 2489 2490 2491 2492 /* 2493 * First Slider Initialization 2494 */ 2495 2496 function royalSliderInit() { 2497 // Transform Wordpress Galleries to Sliders 2498 $('.wp-gallery').each(function() { sliderMarkupGallery($(this)); }); 2499 2500 // Find and initialize each slider 2501 $('.js-pixslider').each(function(){ 2502 if(!$(this).hasClass('billboard')) 2503 sliderInit($(this)); 2504 }); 2505 }; 2506 2507 var royalSliderBillboardInitiated = false;
2508 function royalSliderBillboardInit(){ 2509 royalSliderBillboardInitiated = true; 2510 2511 $('.js-pixslider.billboard').each(function(){ 2512 // Cache The Original Billboard Slider HTML Markup 2513 $original_billboard_slider = $(this).outerHTML(); 2514 slider_billboard($(this)); 2515 2516 var height = $(this).find('img').first().height(); 2517 2518 sliderInit($(this)); 2519 2520 2521 }); 2522 } 2523 2524 2525 2526 function footerWidgetsTitles() { 2527 $('.widget--footer__title .hN, .panel__title .hN').each(function() { 2528 var $title = $(this), 2529 text = $title.text(), 2530 index = text.indexOf(" "); 2531 if (index != -1) { 2532 text = '<em>' + text.slice(0, index) + '</em>' + text.slice(text.indexOf(" "), text.length); 2533 } else { 2534 text = '<em>' + text + '</em>'; 2535 } 2536 $title.html(text); 2537 }); 2538 } 2539 2540 2541 2542 function popularPostsWidget() { 2543 $('.wpgrade_popular_posts, .pixcode--tabs').organicTabs(); 2544 } 2545 2546 //scan through the post meta tags and try to find the post image 2547 function getArticleImage() { 2548 var metas = document.getElementsByTagName('meta'); 2549 2550 for (i=0; i<metas.length; i++) { 2551 if (metas[i].getAttribute("property") == "og:image") { 2552 return metas[i].getAttribute("content"); 2553 } else if (metas[i].getAttribute("property") == "image") { 2554 return metas[i].getAttribute("content"); 2555 } else if (metas[i].getAttribute("property") == "twitter:image:src") { 2556 return metas[i].getAttribute("content"); 2557 } 2558 } 2559 2560 return ""; 2561 } 2562 2563 // Calculate total shares 2564 var shareTypes = 0; 2565 2566 function shareBox() { 2567 //get the via username for twitter share 2568 var twitterVia = $('#twitter').data('via'); 2569 2570 $('#twitter').sharrre({ 2571 share: { 2572 twitter: true 2573 }, 2574 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-twitter circle small"></i></div><div class="share-item__value">{total}</div>', 2575 enableHover: false, 2576 enableTracking: false, 2577 shorterTotal: false, 2578 click: function(api, options){ 2579 api.simulateClick(); 2580 api.openPopup('twitter'); 2581 }, 2582 buttons: { 2583 twitter: {via: twitterVia} 2584 } 2585 }).each(function() { shareTypes++; }); 2586 2587 $('#facebook').sharrre({ 2588 share: { 2589 facebook: true 2590 }, 2591 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-facebook circle small"></i></div><div class="share-item__value">{total}</div>', 2592 enableHover: false, 2593 enableTracking: false, 2594 shorterTotal: false, 2595 click: function(api, options){ 2596 api.simulateClick(); 2597 api.openPopup('facebook'); 2598 } 2599 }).each(function() { shareTypes++; }); 2600 2601 $('#gplus').sharrre({ 2602 share: { 2603 googlePlus: true 2604 }, 2605 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-gplus circle small"></i></div><div class="share-item__value">{total}</div>', 2606 enableHover: false, 2607 enableTracking: false, 2608 shorterTotal: false, 2609 click: function(api, options){ 2610 api.simulateClick(); 2611 api.openPopup('googlePlus'); 2612 } 2613 }).each(function() { shareTypes++; }); 2614 2615 $('#pinterest').sharrre({ 2616 share: { 2617 pinterest: true 2618 }, 2619 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-pinterest circle small"></i></div><div class="share-item__value">{total}</div>', 2620 enableHover: false, 2621 enableTracking: false, 2622 shorterTotal: false, 2623 click: function(api, options){ 2624 api.simulateClick(); 2625 api.openPopup('pinterest'); 2626 }, 2627 buttons: { 2628 pinterest: { 2629 media: getArticleImage(), 2630 description: $('#pinterest').data('text') 2631 } 2632 } 2633 }).each(function() { shareTypes++; }); 2634 } 2635 2636 function shareBoxTop() { 2637 //get the via username for twitter share 2638 var twitterVia = $('#twitter-top').data('via'); 2639 2640 $('#twitter-top').sharrre({ 2641 share: { 2642 twitter: true 2643 }, 2644 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-twitter circle small"></i></div><div class="share-item__value">{total}</div>', 2645 enableHover: false, 2646 enableTracking: false, 2647 shorterTotal: false, 2648 click: function(api, options){ 2649 api.simulateClick(); 2650 api.openPopup('twitter'); 2651 }, 2652 buttons: { 2653 twitter: {via: twitterVia} 2654 } 2655 }).each(function() { shareTypes++; }); 2656 2657 $('#facebook-top').sharrre({ 2658 share: { 2659 facebook: true 2660 }, 2661 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-facebook circle small"></i></div><div class="share-item__value">{total}</div>', 2662 enableHover: false, 2663 enableTracking: false, 2664 shorterTotal: false, 2665 click: function(api, options){ 2666 api.simulateClick(); 2667 api.openPopup('facebook'); 2668 } 2669 }).each(function() { shareTypes++; }); 2670 2671 $('#gplus-top').sharrre({ 2672 share: { 2673 googlePlus: true 2674 }, 2675 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-gplus circle small"></i></div><div class="share-item__value">{total}</div>', 2676 enableHover: false, 2677 enableTracking: false, 2678 shorterTotal: false, 2679 click: function(api, options){ 2680 api.simulateClick(); 2681 api.openPopup('googlePlus'); 2682 } 2683 }).each(function() { shareTypes++; }); 2684 2685 $('#pinterest-top').sharrre({ 2686 share: { 2687 pinterest: true 2688 }, 2689 template: '<div class="share-item__icon"><i class="pixcode pixcode--icon icon-e-pinterest circle small"></i></div><div class="share-item__value">{total}</div>', 2690 enableHover: false, 2691 enableTracking: false, 2692 shorterTotal: false, 2693 click: function(api, options){ 2694 api.simulateClick(); 2695 api.openPopup('pinterest'); 2696 }, 2697 buttons: { 2698 pinterest: { 2699 media: getArticleImage(), 2700 description: $('#pinterest-top').data('text') 2701 } 2702 } 2703 }).each(function() { shareTypes++; }); 2704 } 2705 2706 // Calculate total shares rendered 2707 var renders = 0; 2708 2709 $(document).on('share-box-rendered', function(){ 2710 renders++; 2711 2712 //if all have been rendered it's time to do the total 2713 if ( renders == shareTypes ) { 2714 var total_shares = 0; 2715 $('#share-box .share-item__value').each(function(i,e){ 2716 var numberText = $(this).text(), 2717 value = parseFloat(numberText); 2718 if ( !isNaN(value) ) {
2719 //now let's test if it is a short format number like 1.2k or 5M 2720 var leftover = numberText.replace(value,''); 2721 if (leftover) { 2722 if (leftover == 'k' || leftover == 'K') { 2723 value = value * 1000; 2724 } else if (leftover == 'm' || leftover == 'M') { 2725 value = value * 1000000; 2726 } 2727 } 2728 total_shares = total_shares + value; 2729 } 2730 $(this).text(wpgrade_shorterTotal(value)); 2731 }); 2732 $('.share-total__value').html(wpgrade_shorterTotal(total_shares)); 2733 2734 total_shares = 0; 2735 $('#share-box-top .share-item__value').each(function(i,e){ 2736 var numberText = $(this).text(), 2737 value = parseFloat(numberText); 2738 if ( !isNaN(value) ) { 2739 //now let's test if it is a short format number like 1.2k or 5M 2740 var leftover = numberText.replace(value,''); 2741 if (leftover) { 2742 if (leftover == 'k' || leftover == 'K') { 2743 value = value * 1000; 2744 } else if (leftover == 'm' || leftover == 'M') { 2745 value = value * 1000000; 2746 } 2747 } 2748 total_shares = total_shares + value; 2749 } 2750 $(this).text(wpgrade_shorterTotal(value)); 2751 }); 2752 $('.share-total__value-top').html(wpgrade_shorterTotal(total_shares)); 2753 } 2754 }); 2755 2756 /* format total numbers like 1.2k or 5M 2757 ================================================== */ 2758 var wpgrade_shorterTotal = function (num) { 2759 if (num >= 1e6){ 2760 num = parseFloat((num / 1e6).toFixed(2)) + "M" 2761 } else if (num >= 1e3){ 2762 num = parseFloat((num / 1e3).toFixed(1)) + "k" 2763 } 2764 return num; 2765 }; 2766 2767 // Mega-Menu Hover with delay 2768 function megaMenusHover() { 2769 $('.nav--main > li').hoverIntent({ 2770 interval: 100, 2771 timeout: 300, 2772 over: showMegaMenu, 2773 out: hideMegaMenu, 2774 }) 2775 2776 function showMegaMenu() { 2777 var self = $(this); 2778 self.removeClass('hidden'); 2779 setTimeout(function(){ 2780 self.addClass('open'); 2781 }, 50); 2782 } 2783 function hideMegaMenu() { 2784 var self = $(this); 2785 self.removeClass('open'); 2786 setTimeout(function(){ 2787 self.addClass('hidden'); 2788 }, 150); 2789 } 2790 } 2791 2792 2793 2794 2795 2796 /* ====== INITIALIZE ====== */ 2797 2798 function init() { 2799 2800 /* GLOBAL VARS */ 2801 touch = false; 2802 2803 /* GET BROWSER DIMENSIONS */ 2804 browserSize(); 2805 2806 /* DETECT PLATFORM */ 2807 platformDetect(); 2808 2809 /* Overthrow Polyfill */ 2810 overthrow.set(); 2811 2812 //FastClick.attach(document.body); 2813 2814 if (is_android) { 2815 $('html').addClass('android-browser'); 2816 } else { 2817 $('html').addClass('no-android-browser'); 2818 } 2819 2820 /* Retina Logo */ 2821 /* 2822 var is_retina = (window.retina || window.devicePixelRatio > 1); 2823 2824 if (is_retina && $('.site-logo--image-2x').length) { 2825 var image = $('.site-logo--image-2x').find('img'); 2826 2827 if (image.data('logo2x') !== undefined && image.data('logo2x').length) { 2828 image.attr('src', image.data('logo2x')); 2829 image.addClass('has--2x-image'); 2830 } 2831 } 2832 */ 2833 2834 /* Mega Menu */ 2835 megaMenusHover(); 2836 2837 /* ONE TIME EVENT HANDLERS */ 2838 eventHandlersOnce(); 2839 2840 /* INSTANTIATE EVENT HANDLERS */ 2841 eventHandlers(); 2842 2843 /* SHARE BOX BUTTONS (single only) */ 2844 //if($('body.single').length) { setTimeout(function(){shareBox();},500); } 2845 if($('body.single').length) { shareBox(); shareBoxTop(); } 2846 2847 /* INSTANTIATE RILOADR (lazy loading and responsive images) */ 2848 riloadrInit(); 2849 2850 if($('body').hasClass('custom-background')){ 2851 if($('body').css('background-repeat') == 'no-repeat') { 2852 $('body').addClass('background-cover'); 2853 } 2854 } 2855 2856 }; 2857 2858 2859 2860 2861 2862 /* ====== CONDITIONAL LOADING ====== */ 2863 2864 function loadUp(){ 2865 2866 //initVideos(); 2867 footerWidgetsTitles(); 2868 2869 //Set textareas to autosize 2870 if($("textarea").length) { $("textarea").autosize(); } 2871 2872 // if blog archive 2873 if ($('.masonry').length && !lteie9 && !is_android) 2874 salvattore(); 2875 2876 //lets test first if we have some riloadr images to work on 2877 if ($('.riloadr-slider').length > 0) { 2878 var riloadrSlider = new Riloadr({ 2879 name : 'riloadr-slider', 2880 breakpoints: [ 2881 {name: 'small' /*post-medium */ , minWidth: 901}, 2882 {name: 'big' /*post-medium */ , maxWidth: 900} 2883 ], 2884 watchViewportWidth: "*", 2885 oncomplete: function(){ 2886 if(royalSliderBillboardInitiated == false) 2887 royalSliderBillboardInit(); 2888 } 2889 }); 2890 } else { 2891 //we may as well initiate the billboard slider 2892 if(royalSliderBillboardInitiated == false) 2893 royalSliderBillboardInit(); 2894 }; 2895 2896 royalSliderInit(); 2897 //magnificPopupInit(); 2898 globalInit.magnificPopupInit(); 2899 globalInit.facebookPopup(); 2900 stickyHeader(); 2901 } 2902 2903 2904 2905 2906 /* ====== EVENT HANDLERS ====== */ 2907 2908 function eventHandlersOnce() { 2909 2910 /* NAVIGATION MOBILE */ 2911 // if (touch || ($(window).width() < 900)) { 2912 var windowHeigth = $(window).height(); 2913
2914 $('.js-nav-trigger').bind('click', function(e) { 2915 e.preventDefault(); 2916 e.stopPropagation(); 2917 2918 if($('html').hasClass('navigation--is-visible')){ 2919 $('#page').css('height', ''); 2920 $('html').removeClass('navigation--is-visible'); 2921 $('html').removeAttr('style'); 2922 $(".mask").hide(); 2923 $(".wrapper").removeAttr("style"); 2924 } else { 2925 //$('#page').height(windowHeigth); 2926 $("html").css({ height: "100%", overflow: "hidden"}); 2927 $('html').addClass('navigation--is-visible'); 2928 $(".mask").show(); 2929 $(".wrapper").css({ "z-index": "-1" }); 2930 } 2931 }); 2932 2933 $('.wrapper').bind('click', function(e) { 2934 if ($('html').hasClass('navigation--is-visible')) { 2935 e.preventDefault(); 2936 e.stopPropagation(); 2937 //$('#page').css('height', ''); 2938 $('html').removeClass('navigation--is-visible'); 2939 $(".mask").hide(); 2940 $(".wrapper").removeAttr("style"); 2941 } 2942 }); 2943 // } 2944 2945 2946 // Mega Menu Slider Size 2947 $('.nav--main .nav__item').on('hover', function() { 2948 $(this).parent().find('.js-pixslider').each(function() { 2949 var slider = $(this).data('royalSlider'); 2950 slider.updateSliderSize(); 2951 }); 2952 }); 2953 2954 }; 2955 2956 function eventHandlers(){}; 2957 2958 2959 2960 2961 /* ====== ON DOCUMENT READY ====== */ 2962 2963 $(function(){ 2964 2965 /* --- INITIALIZE --- */ 2966 init(); 2967 2968 /* --- CONDITIONAL LOADING --- */ 2969 loadUp(); 2970 2971 setTimeout(function(){ 2972 $('html').addClass('document-ready'); 2973 }, 300); 2974 }); 2975 2976 2977 2978 /* ====== ON WINDOW LOAD ====== */ 2979 2980 $(window).load(function(){ 2981 popularPostsWidget(); 2982 }); 2983 2984 2985 2986 2987 /* ====== ON RESIZE ====== */ 2988 2989 $(window).on("debouncedresize", function(e){ 2990 //resizeVideos(); 2991 slider_billboard(); 2992 }); 2993 2994 2995 2996 /* ====== ON SCROLL ====== */ 2997 2998 //$(window).scroll(function(e){}); 2999 3000 /* ====== ON SHARE-BAR-STICKY ====== */ 3001 3002 var header = $(".header"), 3003 hOffset = header.height(), 3004 siteNavTrigge = $(".js-nav-trigger"), 3005 navClose = $(".nav_close"), 3006 postHeader = $(".post-header"), 3007 navTrigger = postHeader.find(".fixed_nav"), 3008 navMain = postHeader.find(".navigation"), 3009 wrapper = $(".wrapper"), 3010 mask = $(".mask"), 3011 searchForm = navMain.find(".search-form"), 3012 navList = navMain.find(".nav--main"), 3013 searchBtn = postHeader.find(".icon-search"), 3014 sidebarWidth, 3015 sidebarRight; 3016 3017 var initNav = function() { 3018 $("html").removeAttr("style"); 3019 mask.hide(); 3020 wrapper.removeAttr("style"); 3021 if($("html").hasClass('navigation--is-visible')){ 3022 navMain.addClass("nav_show"); 3023 }else{ 3024 navMain.removeClass("nav_show"); 3025 } 3026 $(".sidebar").removeClass("about_end"); 3027 $(".sidebar").removeClass("fixed"); 3028 $(".sidebar").removeAttr("style"); 3029 if($("html").hasClass("navigation--is-visible")){ 3030 $("html").css({ height: "100%", overflow: "hidden"}); 3031 postHeader.addClass("pull_left"); 3032 mask.show(); 3033 wrapper.css({ "z-index": "-1" }); 3034 } 3035 } 3036 3037 navTrigger.unbind("click"); 3038 navTrigger.bind("click",function(){ 3039 if($(window).width() > 899){ 3040 searchBtn.removeClass("nav_close") 3041 searchForm.hide(); 3042 navMain.removeClass("nav_show2"); 3043 if(navMain.hasClass("nav_show")){ 3044 navMain.removeClass("nav_show"); 3045 navList.hide(); 3046 $('html').removeClass('navigation--is-visible'); 3047 //$('.banner_desktop').show(); 3048 }else{ 3049 navMain.addClass("nav_show"); 3050 navList.show(); 3051 $('html').addClass('navigation--is-visible'); 3052 //$('.banner_desktop').hide(); 3053 } 3054 } else { 3055 $("html").css({ height: "100%", overflow: "hidden"}); 3056 if(postHeader.hasClass("pull_left")){ 3057 3058 postHeader.removeClass("pull_left"); 3059 navTrigger.removeClass("close_nav"); 3060 $("html").removeAttr("style"); 3061 mask.hide(); 3062 wrapper.removeAttr("style"); 3063 //$('.banner_mobile').show(); 3064 }else{ 3065 postHeader.addClass("pull_left"); 3066 navTrigger.addClass("close_nav"); 3067 //searchBtn.addClass("close_nav"); 3068 mask.show(); 3069 wrapper.css({ "z-index": "-1" }); 3070 //$('.banner_mobile').show(); 3071 } 3072 if($("html").hasClass('navigation--is-visible')){ 3073 $(".navigation--mobile").removeAttr("style"); 3074 $("html").removeClass('navigation--is-visible'); 3075 }else{ 3076 $(".navigation--mobile").css({ top: 0 }); 3077 $("html").addClass('navigation--is-visible'); 3078 } 3079 } 3080 }); 3081 searchBtn.bind("click", function(){ 3082 var _t = $(this); 3083 $('html').removeClass('navigation--is-visible'); 3084 navMain.removeClass("nav_show"); 3085 navList.hide(); 3086 if(navMain.hasClass("nav_show2")){ 3087 navMain.removeClass("nav_show2"); 3088 _t.removeClass("nav_close"); 3089 searchForm.hide(); 3090 $('.banner_desktop').show(); 3091 }else{ 3092 navMain.addClass("nav_show2"); 3093 $('.banner_desktop').hide(); 3094 _t.addClass("nav_close"); 3095 searchForm.show(); 3096 } 3097 }); 3098 $(".wrapper").unbind("click"); 3099 $(".wrapper").bind("click",function(){ 3100 if($(window).width() < 900){ 3101 siteNavTrigge.removeAttr("style"); 3102 $(".navigation--mobile").removeAttr("style"); 3103 $("html").removeAttr("style"); 3104 postHeader.removeClass("pull_left"); 3105 navTrigger.removeClass("close_nav"); 3106 $('html').removeClass('navigation--is-visible'); 3107 mask.hide(); 3108 wrapper.removeAttr("style"); 3109 } 3110 }); 3111 3112 mask.unbind("click"); 3113 mask.bind("click",function(){ 3114 if($(window).width() < 900){ 3115 siteNavTrigge.removeAttr("style"); 3116 $('html').removeClass('navigation--is-visible'); 3117 $("html").removeAttr("style"); 3118 postHeader.removeClass("pull_left"); 3119 navTrigger.removeClass("close_nav"); 3120 mask.hide(); 3121 wrapper.removeAttr("style"); 3122 } 3123 }); 3124 3125 initNav(); 3126 3127 $(window).resize(function(){ 3128 sidebarWidth = (parseInt($(".container--main").width()) + parseInt($(".container--main").css("padding-left"))) * 0.33333; 3129 sidebarRight = parseInt($(".container--main").offset().left) + parseInt($(".container--main").css("padding-left")); 3130 if($(".sidebar").hasClass("fixed")){ 3131 $(".sidebar").css({ width: sidebarWidth, right: sidebarRight }); 3132 } 3133 hOffset = header.height(); 3134 initNav(); 3135 }); 3136 3137 3138 var nav = jQuery(".navigation--mobile .nav--main"), 3139 navLi = nav.find("li"); 3140 navLi.each(function(){ 3141 var _t = jQuery(this) 3142 subMenu = _t.children(); 3143 if(subMenu.hasClass("sub-menu")){ 3144 var subLink = subMenu.find("a"); 3145 _t.append("<div class='arrow_box'><i class='arrow d_arrow'></i></div"); 3146 subLink.append("<strong>--</strong>"); 3147 } 3148 }); 3149 var showMenu = function(){
3150 navLi.find(".arrow_box").off("click"); 3151 navLi.find(".arrow_box").on("click",function(){ 3152 var _t = jQuery(this), 3153 subMenu = _t.siblings(".sub-menu"), 3154 arrow = _t.find(".d_arrow"); 3155 subMenu.animate({height: "toggle", opacity: "toggle"}, 200,function(){ 3156 if(subMenu.css("display") == "block"){ 3157 arrow.addClass("t_arrow"); 3158 }else{ 3159 arrow.removeClass("t_arrow"); 3160 } 3161 }); 3162 3163 }); 3164 } 3165 3166 showMenu(); 3167 if (typeof FB !== 'undefined') { 3168 FB.Event.subscribe('edge.create', function (href, html_element) { 3169 if(typeof(dataLayer)!="undefined") { 3170 dataLayer.push({ 3171 'event': 'Facebook', 3172 'category': 'Facebook', 3173 'action':'LikePage', 3174 'label':document.title 3175 }); 3176 3177 } 3178 if (typeof(__gaTracker) != 'undefined') { 3179 __gaTracker('send', 'event','Facebook', 'LikePage',document.title ); 3180 return; 3181 } 3182 if (typeof(_gaq) != 'undefined') { 3183 _gaq.push(['_trackEvent','Facebook', 'LikePage',document.title]); 3184 return; 3185 } 3186 3187 }); 3188 3189 3190 FB.Event.subscribe('edge.remove', function(response) { 3191 if(typeof(dataLayer)!="undefined") { 3192 dataLayer.push({ 3193 'event': 'Facebook', 3194 'category': 'Facebook', 3195 'action':'UnlikePage', 3196 'label':document.title 3197 }); 3198 3199 } 3200 3201 if (typeof(__gaTracker) != 'undefined') { 3202 __gaTracker('send','event', 'Facebook', 'UnlikePage',document.title); 3203 return; 3204 } 3205 3206 if (typeof(_gaq) != 'undefined') { 3207 _gaq.push(['_trackEvent','Facebook', 'UnlikePage',document.title]); 3208 return; 3209 } 3210 }); 3211 } 3212 // if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.userAgent)) { 3213 // document.documentElement.addEventListener('touchstart', function (event) { 3214 3215 // if (event.touches.length > 1) { 3216 // //alert(123); 3217 // event.stopPropagation(); 3218 3219 // } 3220 // }, false); 3221 3222 // var lastTouchEnd = 0; 3223 // document.documentElement.addEventListener('touchmove', function (event) { 3224 // // alert(event.touches.length); 3225 3226 // //alert(666); 3227 // if (event.touches.length > 1) { 3228 // alert('test = '+event.touches.length); 3229 // event.stopPropagation(); 3230 // alert(6369); 3231 // } 3232 3233 3234 // }, false); 3235 //} 3236 // search form: 3237 // var showHot = function(parent){ 3238 // var searchInput = parent.find(".search-query"); 3239 // var hotTags = parent.find("#search-hot-tags"); 3240 // var search_banner = parent.find(".search_banner"); 3241 // var navigation = parent.find(".navigation"); 3242 // if (search_banner.length > 0) { 3243 // search_banner.each(function(){ 3244 // var hotTags = $(this).find("#search-hot-tags"); 3245 // hotTags.appendTo($(this)); 3246 // }); 3247 // } else if (navigation.length > 0) { 3248 // hotTags.appendTo(navigation[0]); 3249 // } 3250 // searchInput.on("focus", function(){ 3251 // hotTags.fadeIn(); 3252 // }).on("focusout", function(event){ 3253 // hotTags.fadeOut(); 3254 // }); 3255 // }; 3256 // showHot($(".site-header")); 3257 // showHot($(".post-header")); 3258 // showHot($(".post-container")); 3259 3260 // //search: 3261 $("#search-hot-tags a").on('click', function(){ 3262 var search_word = $.trim($(this).text()); 3263 var form_search = $(".form-search"); 3264 form_search.find("[name='s']").val(search_word); 3265 form_search.submit(); 3266 // add ga4: 3267 add_themes_ga4_tracking('search_popular_keyword_click',{'item_name':search_word}); 3268 }); 3269 3270})(jQuery, window); 3271 3272//fixï¼ipadçæ²hoverææé¡¯ç¤ºsubmenu: 3273document.addEventListener("DOMContentLoaded", function(){ 3274 if (typeof window.ontouchstart === 'undefined') { 3275 return; 3276 } 3277 var $menu_link = document.querySelectorAll('.main-menu-link'); 3278 var hideAll = function(){ 3279 for (var i = $menu_link.length - 1; i >= 0; i--) { 3280 $menu_link[i].parentNode.className = $menu_link[i].parentNode.className.replace(/( hidden| open)/g, '') + ' hidden'; 3281 } 3282 } 3283 for (var i = $menu_link.length - 1; i >= 0; i--) { 3284 $menu_link[i].style.cursor = "pointer"; 3285 $menu_link[i].addEventListener('click', function(e){ 3286 var $submenu = this.parentNode.querySelector('.sub-menu'); 3287 if ($submenu) { 3288 e.preventDefault(); 3289 } 3290 }); 3291 $menu_link[i].parentNode.addEventListener('touchend', function(e){ 3292 var $submenu = this.querySelector('.sub-menu'); 3293 var $a = this.querySelector('.menu-link'); 3294 if ($submenu) { 3295 if ($submenu.clientHeight == 0) { 3296 hideAll(); 3297 this.className = this.className.replace(/( hidden)/g,'') + ' open'; 3298 } else { 3299 location.href = $a.href; 3300 } 3301 } 3302 }); 3303 } 3304}); 3305 3306 3307function add_theme_ga_tracking(category, action, label, postUrl, id, type){ 3308 var ua = navigator.userAgent; 3309 var is_mobile = ua.match(/mobile/i); 3310 3311 if(is_mobile === null){ 3312 action = action+"_Desktop"; 3313 }else{ 3314 action = action+"_Mobile"; 3315 } 3316 if(id == ''){ 3317 id=0; 3318 } 3319 3320 if(!type){ type = 'action'; } 3321 3322 console.log('type: '+type+'--'+'action: '+action); 3323 if (typeof(__gaTracker) != 'undefined') { 3324 console.log('__gaTracker GA...'); 3325 if( type == 'not_action'){ 3326 __gaTracker('send','event', category, action, label, id, {nonInteraction:true}); 3327 }else{ 3328 __gaTracker('send','event', category, action, label, id); 3329 } 3330 if(postUrl != ''){ 3331 window.location.href = postUrl; 3332 } 3333 return; 3334 } 3335 3336 if (typeof(gtag) != 'undefined') { 3337 console.log('gtag GA...'); 3338 var gtag_param = {"event_category" : category, "event_label" : label, "value" : id}; 3339 if(type == 'not_action'){ 3340 gtag_param = {"event_category" : category, "event_label" : label, "value" : id, "non_interaction" : true}; 3341 } 3342 gtag('event', action, gtag_param); 3343 if(postUrl != ''){ 3344 window.location.href = postUrl; 3345 } 3346 return; 3347 } 3348 3349 if (typeof(_gaq) != 'undefined') { 3350 console.log('_gaq GA...'); 3351 var _gaq_param = ['_trackEvent', category, action, label, id]; 3352 if(type == 'not_action'){ 3353 _gaq_param = ['_trackEvent', category, action, label, id, true]; 3354 }
3355 _gaq.push(_gaq_param); 3356 if(postUrl != ''){ 3357 window.location.href = postUrl; 3358 } 3359 return; 3360 } 3361 3362 3363 if(typeof(dataLayer) != 'undefined'){ 3364 dataLayer.push({ 3365 'category': category, 3366 'action': action, 3367 'label': label, 3368 'event': action 3369 }); 3370 if(postUrl != ''){ 3371 window.location.href = postUrl; 3372 } 3373 return; 3374 } 3375 3376 if(typeof(_gaq) == 'undefined' && typeof(__gaTracker) == 'undefined' && typeof(gtag) == 'undefined' && typeof(dataLayer) == 'undefined'){ 3377 if(postUrl != ''){ 3378 window.location.href = postUrl; 3379 } 3380 return; 3381 } 3382 3383} 3384 3385/* 3386 * GA4 function 3387 * arguments : object (item_name/item_type/method/item_id/item_url/search_term/item_list_name) 3388*/ 3389function add_themes_ga4_tracking( action, arguments ){ 3390 var ga4_arguments = {}; 3391 ga4_arguments['event'] = 'ga4_event_trigger'; 3392 ga4_arguments['ga4_event'] = action; 3393 ga4_arguments['ga4_event_content_type'] = undefined; 3394 ga4_arguments['ga4_event_item_name'] = undefined; 3395 ga4_arguments['ga4_event_item_type'] = undefined; 3396 ga4_arguments['ga4_event_item_id'] = undefined; 3397 ga4_arguments['ga4_event_item_url'] = undefined; 3398 ga4_arguments['ga4_event_method'] = undefined; 3399 ga4_arguments['ga4_event_search_term'] = undefined; 3400 ga4_arguments['ga4_event_item_list_name'] = undefined; 3401 3402 // for plugin: seo-automated-link-building 3403 ga4_arguments['ga4_event_link_url'] = undefined; 3404 ga4_arguments['ga4_event_link_text'] = undefined; 3405 ga4_arguments['ga4_event_link_classes'] = undefined; 3406 ga4_arguments['ga4_event_link_id'] = undefined; 3407 ga4_arguments['ga4_event_link_domain'] = undefined; 3408 3409 var item_type = 'not item_type'; 3410 if(arguments.item_type){ 3411 item_type = arguments.item_type; 3412 } 3413 console.log('ga4_post_id : '+custom_common_ga4_post_id + '--- action: '+action + '--- item_type: '+item_type); 3414 3415 if(jQuery.isEmptyObject(arguments) == false){ 3416 jQuery.each(arguments, function(i, e) { 3417 if(e != ''){ 3418 var key = 'ga4_event_'+i; 3419 ga4_arguments[key] = e; 3420 } 3421 }); 3422 } 3423 3424 if(custom_common_ga4_post_id != ''){ 3425 setTimeout(function() { 3426 var ga4_gaq_push_arr = jQuery(document).find('#ga4_gaq_push_arr_'+custom_common_ga4_post_id).val(); 3427 if(ga4_gaq_push_arr != null){ 3428 var ga4_gaq_push_obj = JSON.parse(ga4_gaq_push_arr); 3429 if(jQuery.isEmptyObject(ga4_gaq_push_obj) == false){ 3430 jQuery.each(ga4_gaq_push_obj, function(j, k) { 3431 if((j != 'event') && (j != 'ga4_event')){ 3432 ga4_arguments[j] = k; 3433 } 3434 }); 3435 } 3436 } 3437 }, 500); 3438 } 3439 if(typeof(dataLayer) != 'undefined'){ 3440 dataLayer.push(ga4_arguments); 3441 } 3442 3443 if(action.indexOf('impression') == -1 && !document.querySelector('body.single-post')){ 3444 if( ga4_arguments['ga4_event_item_url'] != undefined){ 3445 window.location.href = ga4_arguments['ga4_event_item_url']; 3446 return; 3447 } 3448 3449 if( ga4_arguments['ga4_event_link_url'] != undefined){ 3450 window.location.href = ga4_arguments['ga4_event_link_url']; 3451 return; 3452 } 3453 } 3454 3455} 3456 3457function copyToClipboard(text, el) { 3458 var copyTest = document.queryCommandSupported('copy'); 3459 var elOriginalText = document.querySelector(".pomo_code .btn").getAttribute("data-copy"); 3460 if (copyTest === true) { 3461 var copyTextArea = document.createElement("textarea"); 3462 copyTextArea.id="data-copy"; 3463 copyTextArea.value = text; 3464 copyTextArea.style.userSelect='auto'; 3465 document.body.appendChild(copyTextArea); 3466 copyTextArea.select(); 3467 try { 3468 var successful = document.execCommand('copy'); 3469 copyTextArea.style.userSelect='none'; 3470 var msg = successful ? 'å·²è¤è£½åªæ 碼' : 'Whoops, not copied!'; 3471 alert(msg); 3472 } catch (err) { 3473 console.log('Oops, unable to copy'); 3474 } 3475 document.body.removeChild(copyTextArea); 3476 el.setAttribute('data-copy', elOriginalText); 3477 // console.log(copyTextArea.value); 3478 } else { 3479 // Fallback if browser doesn't support .execCommand('copy')
3480 window.prompt("Copy to clipboard: Ctrl+C or Command+C, Enter", text); 3481 } 3482} 3483 3484//toggleFAQ 3485function toggleFAQ(e) { 3486 if (e.querySelector(".fa-angle-down")) { 3487 e.classList.add("showa"); 3488 var a = e.querySelector(".fa-angle-down"); 3489 a.classList.add("fa-angle-up"); 3490 a.classList.remove("fa-angle-down"); 3491 } else if (e.querySelector(".fa-angle-up")) { 3492 e.classList.remove("showa"); 3493 a = e.querySelector(".fa-angle-up"); 3494 a.classList.add("fa-angle-down"); 3495 a.classList.remove("fa-angle-up"); 3496 } 3497} 3498 3499 3500//toggleMORE 3501function toggleMORE(e){ 3502 if(e.parentElement.classList.value.indexOf('showarrow')!=-1){ 3503 if (e.classList.value.indexOf('fa-angle-down')!=-1) { 3504 e.parentElement.classList.add('showmore'); 3505 e.classList.add("fa-angle-up"); 3506 e.classList.remove("fa-angle-down"); 3507 } else if (e.classList.value.indexOf('fa-angle-up')!=-1) { 3508 e.parentElement.classList.remove('showmore'); 3509 e.classList.add("fa-angle-down"); 3510 e.classList.remove("fa-angle-up"); 3511 } 3512 } 3513} 3514 3515const toggleFunction = ()=>{ 3516 tagEle = document.querySelectorAll('[id*="tag_position"]'); 3517 srcbyEle = document.querySelectorAll('.source_by_wrap'); 3518 tagEle.forEach((e)=>{ 3519 heightTAG = e.scrollHeight; 3520 heightTAG > 41 ? e.classList.add('showarrow'):e.classList.remove('showarrow'); 3521 }); 3522 srcbyEle.forEach((e)=>{ 3523 heightSB = e.scrollHeight; 3524 heightSB > 48 ? e.parentElement.classList.add('showarrow'):e.parentElement.classList.remove('showarrow'); 3525 }); 3526} 3527// on load DOM 3528document.addEventListener("DOMContentLoaded", toggleFunction()); 3529// lazy load DOM 3530const observer = new MutationObserver(function (mutations) { 3531 // console.log('mutations'); 3532 toggleFunction(); 3533}); 3534const pageLoad = document.querySelector("#page .wrapper"); 3535observer.observe(pageLoad, { 3536 childList: true, 3537 attributes: true, 3538 characterData: true, 3539});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.