1var cff_js_exists = (typeof cff_js_exists !== 'undefined') ? true : false;� 2if(!cff_js_exists){� 3� 4//Masonry� 5!function(a){function b(){}� 6function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})}� 7function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")}� 8return this}� 9return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}}� 10if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}}� 11var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c}� 12var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){}� 13function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}� 14function c(a){return function(){return this[a].apply(this,arguments)}}� 15var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&-1===b(e[d],c)&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),-1!==d&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g=this.getListenersAsObject(a);for(e in g)if(g.hasOwnProperty(e))for(d=g[e].length;d--;)c=g[e][d],c.once===!0&&this.removeListener(a,c.listener),f=c.listener.apply(this,b||[]),f===this._getOnceReturnValue()&&this.removeListener(a,c.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1
15);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this),function(a){function b(a){if(a){if("string"==typeof d[a])return a;a=a.charAt(0).toUpperCase()+a.slice(1);for(var b,e=0,f=c.length;f>e;e++)if(b=c[e]+a,"string"==typeof d[b])return b}}� 16var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b}� 17function c(){}� 18function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0}� 19return a}� 20function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}}� 21function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q}� 22var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}}� 23function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c}� 24var j,k,l,m=!1;return h}� 25var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))}� 26function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()}� 27function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}}� 28function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b}� 29var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)}� 30function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}}� 31function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1}� 32function e(a,d){return c(a),b(a,d)}� 33var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c}� 34var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)}� 35return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue}� 36var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={}
36,a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0}� 37function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())}� 38var h=a.getComputedStyle,i=h?function(a){return h(a,null)}:function(a){return a.currentStyle},j=d("transition"),k=d("transform"),l=j&&k,m=!!d("perspective"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[j],o=["transform","transition","transitionDuration","transitionProperty"],p=function(){for(var a={},b=0,c=o.length;c>b;b++){var e=o[b],f=d(e);f&&f!==e&&(a[e]=f)}� 39return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=p[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=i(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=parseInt(a[c?"left":"right"],10),f=parseInt(a[d?"top":"bottom"],10);e=isNaN(e)?0:e,f=isNaN(f)?0:f;var g=this.layout.size;e-=c?g.paddingLeft:g.paddingRight,f-=d?g.paddingTop:g.paddingBottom,this.position.x=e,this.position.y=f},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];g=b.percentPosition&&!b.isHorizontal?g/a.width*100+"%":g+"px",c[e]=g,c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];k=b.percentPosition&&b.isHorizontal?k/a.height*100+"%":k+"px",c[i]=k,c[j]="",this.css(c),this.emitEvent("layout",[this])};var q=m?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isOriginLeft?h:-h,i=k.isOriginTop?i:-i,j.transform=q(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=l?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null}� 40this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r=k&&e.toDashed(k)+",opacity";g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(n,this,!1))},g.prototype.transition=g.prototype[j?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]}� 41this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(n,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!j||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={}
41,c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()}� 42var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)}� 43return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)}� 44return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)}� 45this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.emitEvent(a+"Complete",[b])}� 46function d(){g++,g===f&&c()}� 47var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored}
47,g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout}� 48this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)}� 49return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()}� 50this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]}
50,g.create=function(a,b){function c(){g.apply(this,arguments)}� 51return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth}� 52var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)}� 53return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d})� 54� 55function cffAddMasonry($self) {� 56 if (jQuery(window).width() > 780 || $self.hasClass('masonry-2-mobile') ) {� 57 //Add the class in case it was removed when resizing down� 58 $self.addClass('cff-masonry cff-masonry-js').removeClass('cff-disable-masonry');� 59 if($self.find('.cff-item').length) {� 60 $self.masonry({itemSelector: '.cff-new, .cff-item, .cff-likebox'});� 61 // Add margin to the bottom of each post to give some space� 62 $self.find('.cff-item').each( function() {� 63 jQuery(this).css('margin-bottom', '15px');� 64 });� 65 } else if($self.find('.cff-album-item').length) {� 66 $self.masonry({itemSelector: '.cff-album-item'});� 67 }� 68 } else {� 69 //Disable masonry in 1 col mobile as isn't needed� 70 $self.addClass('cff-disable-masonry');� 71 }� 72}� 73� 74� 75function cff_init( $cff ){� 76� 77 //JS is running� 78 jQuery('.cff-nojs').removeClass('cff-nojs');� 79� 80 //Check whether it's a touch device� 81 var cffTouchDevice = false;� 82 if (cffIsTouchDevice() === true) cffTouchDevice = true;� 83 function cffIsTouchDevice() {� 84 return true == ("ontouchstart" in window || window.DocumentTouch && document instanceof DocumentTouch);� 85 }� 86� 87 //If a feed selector isn't passed in then default to using selector for all feeds� 88 var firsttime = false;� 89 if(typeof $cff === 'undefined'){� 90 $cff = jQuery('.cff');� 91 firsttime = true;� 92 }� 93� 94 (function($){� 95� 96 //Set likebox width� 97 $('.cff-likebox iframe').each(function(){� 98 var $likebox = $(this),� 99 likeboxWidth = $likebox.attr('data-likebox-width'),� 100 cffFeedWidth = $likebox.parent().width();� 101� 102 //Default width is 340� 103 if( likeboxWidth == '' ) likeboxWidth = 340;� 104 //Change the width dynamically so it's responsive� 105 if( cffFeedWidth < likeboxWidth ) likeboxWidth = cffFeedWidth;� 106� 107 $likebox.attr('src', 'https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2F'+$likebox.attr('data-likebox-id')+'%2F&tabs&width='+likeboxWidth+'&small_header='+$likebox.attr('data-likebox-header')+'&adapt_container_width=true&hide_cover='+$likebox.attr('data-hide-cover')+'&hide_cta='+$likebox.attr('data-hide-cta')+'&show_facepile='+$likebox.attr('data-likebox-faces')+'&locale='+$likebox.attr('data-locale'));� 108 });� 109� 110 //Toggle comments� 111 jQuery(document).off('click', '#cff a.cff-view-comments').on('click', '#cff a.cff-view-comments', function(){� 112 var $self = jQuery(this),� 113 $commentsBox = $self.closest('.cff-item').find('.cff-comments-box');� 114 $self.toggleClass('cff-open');� 115 � 116 $commentsBox.slideToggle(300);� 117� 118 //Masonry - overlap comments box when open� 119 var $feed = $self.closest('#cff'),� 120 $item = $(this).closest('.cff-item');� 121 if( $feed.hasClass('cff-masonry-js') && !$feed.hasClass('cff-opaque-comments') ){� 122 setTimeout(function(){� 123 cffAddMasonry($feed);� 124 }, 500);� 125 }� 126� 127 //Add comment avatars� 128 $commentsBox.find('.cff-comment:visible').each(function(){� 129 var $thisComment = jQuery(this);� 130 $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a, .cff-comment-img:not(.cff-comment-reply-img) span').html( '<img src="'+$thisComment.attr("data-avatar")+'" alt="Avatar" onerror="this.style.display=\'none\'" />' );� 131 });� 132� 133 });� 134� 135 //Comments box hover� 136 var cffAnimateIconColorVar,� 137 stopAnimate = false;� 138 $cff.find('.cff-view-comments').hover(function(){� 139 var $self = $(this),� 140 time = 50;� 141 if( $self.hasClass('cff-open') ) return;� 142� 143 $self.find('.cff-icon').each(function() {� 144 var $cffIcon = jQuery(this);� 145 cffAnimateIconColor($cffIcon, time);� 146 time += 50;� 147 });� 148 }, function(){� 149 cffStopAnimateIconColor();� 150 $(this).find('.cff-icon').removeClass('cff-animate');� 151 });� 152 function cffAnimateIconColor($cffIcon, time){� 153 stopAnimate = false;� 154 cffAnimateIconColorVar = setTimeout( function(){� 155 if( !stopAnimate ) $cffIcon.addClass('cff-animate');� 156 }, time);� 157 }� 158 function cffStopAnimateIconColor() {� 159 clearTimeout(cffAnimateIconColorVar);� 160 stopAnimate = true;� 161 }� 162� 163 //Set paths for query.php� 164 if (typeof cffsiteurl === 'undefined' || cffsiteurl == '') cffsiteurl = window.location.host + '/wp-content/plugins';� 165 var locatefile = true;� 166�
167 //Create meta data array for caching likes and comments� 168 var metaArr = {},� 169 newMetaArr = {}; //For caching only new posts that are loaded� 170� 171 //Loop through the feeds on the page and add a unique attribute to each to use for lightbox groups� 172 var lb = 0;� 173 jQuery('#cff.cff-lb').each(function(){� 174 lb++;� 175 $(this).attr('data-cff-lb', lb);� 176 });� 177� 178 � 179 //If it's the first load then loop through all .cff-items on the page, otherwise, only loop through the feed where the load more button is clicked� 180 var $cff_post_selector = $cff.find('.cff-item.cff-new, .cff-album-item.cff-new');� 181 if( firsttime ){� 182 $cff_post_selector = jQuery('#cff .cff-item.cff-new, #cff .cff-album-item.cff-new');� 183 }� 184� 185 //Loop through each item� 186 $cff_post_selector.each(function(){� 187� 188 var $self = jQuery(this);� 189� 190 //Wpautop fix� 191 if( $self.find('.cff-viewpost-link, .cff-viewpost-facebook, .cff-viewpost').parent('p').length ){� 192 //Don't unwrap event only viewpost link� 193 if( !$self.hasClass('event') ) $self.find('.cff-viewpost-link, .cff-viewpost-facebook, .cff-viewpost').unwrap('p');� 194 }� 195 if( $self.find('.cff-photo').parent('p').length ){� 196 $self.find('p .cff-photo').unwrap('p');� 197 $self.find('.cff-album-icon').appendTo('.cff-photo:last');� 198 }� 199 if( $self.find('.cff-event-thumb').parent('p').length ){� 200 $self.find('.cff-event-thumb').unwrap('p');� 201 }� 202 if( $self.find('.cff-vidLink').parent('p').length ){� 203 $self.find('.cff-vidLink').unwrap('p');� 204 }� 205 if( $self.find('.cff-link').parent('p').length ){� 206 $self.find('.cff-link').unwrap('p');� 207 }� 208 if( $self.find('.cff-viewpost-link').parent('p').length ){� 209 $self.find('.cff-viewpost-link').unwrap('p');� 210 }� 211 if( $self.find('.cff-viewpost-facebook').parent('p').length ){� 212 $self.find('.cff-viewpost-facebook').unwrap('p');� 213 }� 214� 215 if( $self.find('iframe').parent('p').length ){� 216 $self.find('iframe').unwrap('p');� 217 }� 218 if( $self.find('.cff-author').parent('p').length ){� 219 $self.find('.cff-author').eq(1).unwrap('p');� 220 $self.find('.cff-author').eq(1).remove();� 221 }� 222 if( $self.find('.cff-view-comments').parent('p').length ){� 223 $self.find('.cff-meta-wrap > p').remove();� 224 $self.find('.cff-view-comments').eq(1).remove();� 225 //Move meta ul inside the link element� 226 var $cffMeta = $self.find('.cff-meta'),� 227 cffMetaClasses = $cffMeta.attr('class');� 228 $cffMeta.find('.cff-view-comments').unwrap().wrapInner('<ul class="'+cffMetaClasses+'">');� 229 }� 230 if( $self.find('.cff-photo').siblings('.cff-photo').length ){� 231 $self.find('.cff-photo').slice(0,2).remove();� 232 }� 233 //Fix the formatting issue that pushes avatar to the left� 234 if( $('.cff-author-img').parent().is('p') ) $('.cff-author-img').unwrap('p');� 235 //Remove empty p tags� 236 $self.find('p:empty').not('.cff-comments-box p').remove();� 237� 238 //Expand post� 239 var expanded = false;� 240 if( $self.hasClass('cff-event') ){� 241 var $post_text = $self.find('.cff-desc .cff-desc-text'),� 242 text_limit = $post_text.parent().attr('data-char');� 243 } else {� 244 var $post_text = $self.find('.cff-post-text .cff-text'),� 245 text_limit = $self.closest('#cff').attr('data-char');� 246 }� 247� 248 if (typeof text_limit === 'undefined' || text_limit == '') text_limit = 99999;� 249 � 250 //If the text is linked then use the text within the link� 251 if ( $post_text.find('a.cff-post-text-link').length ) $post_text = $self.find('.cff-post-text .cff-text a');� 252 var full_text = $post_text.html();� 253 if(full_text == undefined) full_text = '';� 254� 255� 256 //Truncate text taking HTML tags into account� 257 var cff_trunc_regx = new RegExp(/(<[^>]*>)/g);� 258 var cff_trunc_counter = 0;� 259� 260 //convert the string to array using the HTML tags as delimiter and keeping them as array elements� 261 full_text_arr = full_text.split(cff_trunc_regx);� 262� 263 for (var i = 0, len = full_text_arr.length; i < len; i++) {� 264 //ignore the array elements that are HTML tags� 265 if ( !(cff_trunc_regx.test(full_text_arr[i])) ) {� 266 //if the counter is 100, remove this element with text� 267 if (cff_trunc_counter == text_limit) {� 268 full_text_arr.splice(i, 1);� 269 continue; //ignore next commands and continue the for loop� 270 }� 271 //if the counter != 100, increase the counter with this element length� 272 cff_trunc_counter = cff_trunc_counter + full_text_arr[i].length;� 273 //if is over 100, slice the text of this element to match the total of 100 chars and set the counter to 100� 274 if (cff_trunc_counter > text_limit) {� 275 var diff = cff_trunc_counter - text_limit;� 276 full_text_arr[i] = full_text_arr[i].slice(0, -diff);� 277 cff_trunc_counter = text_limit;� 278� 279 //Show the 'See More' link if needed� 280 if (full_text.length > text_limit) $self.find('.cff-expand').show();� 281 }� 282 }� 283 }� 284� 285 //new string from the array� 286 var short_text = full_text_arr.join('');� 287� 288 //remove empty html tags from the array� 289 short_text = short_text.replace(/(<(?!\/)[^>]+>)+(<\/[^>]+>)/g, "");� 290�
291 //If the short text cuts off in the middle of a <br> tag then remove the stray '<' which is displayed� 292 var lastChar = short_text.substr(short_text.length - 1);� 293 if(lastChar == '<') short_text = short_text.substring(0, short_text.length - 1);� 294� 295 //Remove any <br> tags from the end of the short_text� 296 short_text = short_text.replace(/(<br>\s*)+$/,''); � 297 short_text = short_text.replace(/(<img class="cff-linebreak">\s*)+$/,''); � 298� 299 //Cut the text based on limits set� 300 $post_text.html( short_text );� 301� 302� 303 //Click function� 304 $self.find('.cff-expand a').unbind('click').bind('click', function(e){� 305 e.preventDefault();� 306 var $expand = jQuery(this),� 307 $more = $expand.find('.cff-more'),� 308 $less = $expand.find('.cff-less');� 309 if (expanded == false){� 310 $post_text.html( full_text );� 311 expanded = true;� 312 $more.hide();� 313 $less.show();� 314 } else {� 315 $post_text.html( short_text );� 316 expanded = false;� 317 $more.show();� 318 $less.hide(); � 319 }� 320 cffLinkHashtags();� 321 //Add target to links in text when expanded� 322 $post_text.find('a').attr('target', '_blank');� 323� 324 //Re-init masonry for JS� 325 if( $self.closest('.cff').hasClass('cff-masonry-js') && !$self.closest('.cff').hasClass('cff-masonry-css') ){� 326 cffAddMasonry($cff);� 327 }� 328� 329 });� 330 //Add target attr to post text links via JS so aren't included in char count� 331 $post_text.find('a').add( $self.find('.cff-post-desc a') ).attr({� 332 'target' : '_blank',� 333 'rel' : 'nofollow'� 334 });� 335� 336� 337 //This is the modified Post ID - so if the post is an album post then this could be the album ID which is used to get the lightbox thumbs� 338 var post_id = $self.attr('id').substring(4),� 339 //This is the original post ID which is used to get the number of likes and comments for the timeline post� 340 post_id_orig = $self.find('.cff-view-comments').attr('id');� 341� 342 if( locatefile != true ) $self.find('.cff-lightbox-thumbs-holder').css('min-height', 0);� 343 � 344� 345 //Show all comments on click� 346 jQuery(document).off('click', '#cff .cff-show-more-comments, .cff-lightbox-sidebar .cff-show-more-comments').on('click', '#cff .cff-show-more-comments, .cff-lightbox-sidebar .cff-show-more-comments', function(){� 347� 348 var $cffMoreCommentsLink = jQuery(this),� 349 thisCommentsTotal = parseInt($cffMoreCommentsLink.attr('data-cff-comments-total'));� 350� 351 //If there's more than 25 comments then link the "View more comments" link to post on Facebook� 352 if( $cffMoreCommentsLink.hasClass('cff-clicked') && thisCommentsTotal > 25 ){� 353 //Link to Facebook� 354 $cffMoreCommentsLink.find('a').attr({� 355 'href' : $cffMoreCommentsLink.closest('.cff-comments-box').find('.cff-comment-on-facebook a').attr('href'),� 356 'target' : '_blank'� 357 });� 358 }� 359 //Hide 'View more comments' link� 360 if( thisCommentsTotal <= 25 ) $cffMoreCommentsLink.hide();� 361� 362 //Add class so we can only trigger the above on the second click� 363 $cffMoreCommentsLink.addClass('cff-clicked');� 364� 365 //Show comments and add comment avatars� 366 $cffMoreCommentsLink.parent().find('.cff-comment').show().each(function(){� 367 var $thisComment = jQuery(this);� 368 $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a, .cff-comment-img:not(.cff-comment-reply-img) span').html( '<img src="'+$thisComment.attr("data-avatar")+'" alt="Avatar" onerror="this.style.display=\'none\'" />' );� 369 });� 370� 371 //Re-init masonry when more comments loaded� 372 var $closestCff = $cffMoreCommentsLink.closest('.cff');� 373 if( $closestCff.hasClass('cff-masonry-js') && !$closestCff.hasClass('cff-opaque-comments') ){� 374 setTimeout(function(){� 375 cffAddMasonry( $closestCff );� 376 }, 500);� 377 }� 378 });� 379 � 380� 381 //Remove event end date day if the same as the start date� 382 if( $self.hasClass('cff-timeline-event') || $self.hasClass('cff-event') ){� 383 if( $(this).find('.cff-date .cff-start-date k').text() !== $(this).find('.cff-date .cff
383-end-date k').text() ) $(this).find('.cff-date .cff-end-date k').show();� 384 }� 385� 386� 387 //Replace Photon (Jetpack CDN) images with the originals again� 388 var $cffPhotoImg = $self.find('.cff-photo img, .cff-event-thumb img, .cff-poster, .cff-album-cover img'),� 389 cffPhotoImgSrc = $cffPhotoImg.attr('src'),� 390 cffImgStringAttr = $cffPhotoImg.attr('data-querystring');� 391� 392 if( typeof cffPhotoImgSrc == 'undefined' ) cffPhotoImgSrc = '';� 393� 394 if( cffPhotoImgSrc.indexOf('i0.wp.com') > -1 || cffPhotoImgSrc.indexOf('i1.wp.com') > -1 || cffPhotoImgSrc.indexOf('i2.wp.com') > -1 || cffPhotoImgSrc.indexOf('i3.wp.com') > -1 || cffPhotoImgSrc.indexOf('i4.wp.com') > -1 || cffPhotoImgSrc.indexOf('i5.wp.com') > -1 ){� 395 � 396 //Create new src. Single slash in https is intentional as one is left over from removing i_.wp.com� 397 var photonSrc = $cffPhotoImg.attr('src').substring(0, $cffPhotoImg.attr('src').indexOf('?')),� 398 newSrc = photonSrc.replace('http://', 'https:/').replace(/i0.wp.com|i1.wp.com|i2.wp.com|i3.wp.com|i4.wp.com|i5.wp.com/gi, '') + '?' + cffImgStringAttr;� 399� 400 $cffPhotoImg.attr('src', newSrc);� 401 }� 402� 403 function cffLinkHashtags(){� 404 //Link hashtags� 405 var cffTextStr = $self.find('.cff-text').html(),� 406 cffDescStr = $self.find('.cff-post-desc').html(),� 407 regex = /(^|\s)#(\w*[\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFB
407D3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]+\w*)/gi,� 408 linkcolor = $self.find('.cff-text').attr('data-color'),� 409 linkcolorHTML = '';� 410� 411 function replacer(hash){� 412 //Remove white space at beginning of hash� 413 var replacementString = jQuery.trim(hash);� 414 //If the hash is a hex code then don't replace it with a link as it's likely in the style attr, eg: "color: #ff0000"� 415 if ( /^#[0-9A-F]{6}$/i.test( replacementString ) ){� 416 return replacementString;� 417 } else {� 418 if( typeof linkcolor !== 'undefined' ){� 419 if( linkcolor.length > 1 ) linkcolorHTML = 'style="color:#' + linkcolor + '"';� 420 }� 421 return ' <a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" rel="nofollow" '+linkcolorHTML+'>' + replacementString + '</a>';� 422 }� 423 }� 424� 425 //If it's not defined in the source code then set it to be true� 426 if (typeof cfflinkhashtags == 'undefined') cfflinkhashtags = 'true';� 427� 428 if(cfflinkhashtags == 'true'){� 429 //Replace hashtags in text� 430 var $cffText = $self.find('.cff-text');� 431 � 432 if($cffText.length > 0){� 433 //Add a space after all <br> tags so that #hashtags immediately after them are also converted to hashtag links. Without the space they aren't captured by the regex.� 434 cffTextStr = cffTextStr.replace(/<br>/g, "<br> ");� 435 $cffText.html( cffTextStr.replace( regex , replacer ) );� 436 }� 437 }� 438� 439 //Replace hashtags in desc� 440 if( $self.find('.cff-post-desc').length > 0 ) $self.find('.cff-post-desc').html( cffDescStr.replace( regex , replacer ) );� 441 }� 442 cffLinkHashtags();� 443� 444 //Add target attr to post text links via JS so aren't included in char count� 445 $self.find('.cff-text a').attr('target', '_blank');� 446� 447� 448 //Add lightbox tile link to photos� 449 if( $self.closest('#cff').hasClass('cff-lb') ){� 450 $self.find('.cff-photo, .cff-album-cover, .cff-event-thumb, .cff-html5-video, .cff-iframe-wrap').each(function(){� 451 var $photo = $(this),� 452 postId = post_id,� 453 cffLightboxTitle = '',� 454 cffShowThumbs = false,� 455 postType = '',� 456 cffgroupalbums = '';� 457� 458� 459 // if( $self.hasClass('cff-album') || $self.hasClass('cff-albums-only') ) cffShowThumbs = true;� 460 cffShowThumbs = true;� 461� 462 function cffFormatCaption(text){� 463 return String(text).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/\n/g, "<br/>");� 464 }� 465� 466 //Set the caption/title� 467 if( $self.hasClass('cff-albums-only') ){� 468 postType = 'albumsonly';� 469 cffLightboxTitle = cffFormatCaption( $self.find('img').attr('alt') );� 470 � 471 //Check whether there's an absolute path attr and if there is then add it to the query� 472 var dataGroup = $self.closest('#cff').attr('data-group');� 473 if( typeof dataGroup !== 'undefined' ) cffgroupalbums = 'data-cffgroupalbums="true"';� 474� 475 } else if( $self.hasClass('cff-timeline-event') ) {� 476 var capText = '';� 477 if( $self.find('.cff-author-text .cff-page-name').length ) capText += $self.find('.cff-author-text .cff-page-name').text() + '<br /><br />';� 478 //Display the full event details but the info is hidden in CSS as it's too long in some cases� 479 if( full_text.length > 5 ) capText += full_text;� 480 cffLightboxTitle = cffFormatCaption( capText );� 481 } else if ( $self.hasClass('cff-event') ) {� 482� 483 if( $self.find('.cff-details').length ) cffLightboxTitle = cffFormatCaption( $self.find('.cff-details').html() );� 484� 485 } else if( $self.hasClass('cff-album-item') ) {� 486 cffLightboxTitle = cffFormatCaption( $self.find('img').attr('alt') );� 487 } else {� 488 var lb_title = full_text;� 489 //If there's no post text then use the description� 490 if( full_text.trim() == '' ) lb_title = $self.find('.cff-post-desc').text();� 491� 492 //If there's no post text or desc then use the story� 493 if( lb_title == '' && $self.find('.cff-author .cff-story').length ) lb_title = $self.find('.cff-author .cff-page-name').text();� 494� 495 //If there's no text at all then just set it to be a space so that it renders as blank, otherwise it will use the caption from the post before� 496 if( lb_title == '' ) lb_title = ' ';� 497� 498 cffLightboxTitle = cffFormatCaption( lb_title );� 499 }� 500� 501 if(cffLightboxTitle.length > 1) cffLightboxTitle = cffLightboxTitle.replace(/"/g, '"');� 502� 503� 504 //Create the lightbox link� 505 //Add the hover tile� 506 var cffLightboxTile = '<a class="cff-lightbox-link nofancybox" rel="nofollow" ';� 507� 508 //If it's a YouTube or Vimeo then set the poster image to use in the lightbox� 509 if( $photo.hasClass('cff-iframe-wrap') ){� 510 //Add the image to the video lightbox placeholder as a query string so that the href value is unique and is added to the lightbox order. Otherwise, if it doesn't contain the query string then all videos that use the placeholder have the same URL and so they aren't added to the lightbox order. The actual video image is very small and so we need to use the placeholder to have the video display larger in the lightbox:� 511 cffLightboxTile += 'href="'+cffsiteurl+'/custom-facebook-feed-pro/img/vi
511deo-lightbox.png?'+postId+'" data-iframe="'+$photo.find('iframe').attr('src')+'" ';� 512 //If it's a swf then display it in an iframe� 513 } else if( $photo.hasClass('cff-swf') ) {� 514 cffLightboxTile += 'href="'+cffsiteurl+'/custom-facebook-feed-pro/img/video-lightbox.png" data-iframe="'+$photo.find('video').attr('src')+'" ';� 515 } else {� 516 var lb_href = $photo.find('img').attr('src');� 517 if( $photo.find('img').attr('data-cff-full-img') ) lb_href = $photo.find('img').attr('data-cff-full-img');� 518 cffLightboxTile += 'href="'+lb_href+'" data-iframe="" ';� 519 }� 520� 521 //No nav� 522 // cffLightboxTile += 'data-cff-lightbox="'+postId+'" data-title="'+cffLightboxTitle+'" data-id="'+postId+'" data-thumbs="'+cffShowThumbs+'" ';� 523 cffLightboxTile += 'data-cff-lightbox="cff-lightbox-'+$self.closest("#cff").attr("data-cff-lb")+'" data-title="'+cffLightboxTitle+'" data-id="'+postId+'" data-thumbs="'+cffShowThumbs+'" '+cffgroupalbums+' ';� 524� 525 //If it's an HTML5 video then set the data-video attr� 526 if( $photo.hasClass('cff-html5-video') ){� 527� 528 if($photo.hasClass('cff-swf')){� 529 cffLightboxTile += 'data-url="'+$photo.find('.cff-html5-play').attr('href')+'" data-video="';� 530 } else {� 531 cffLightboxTile += 'data-url="'+$photo.find('.cff-html5-play').attr('href')+'" data-video="'+$photo.find('img').attr('data-cff-video');� 532 }� 533� 534 //Videos only:� 535 } else if( $photo.hasClass('cff-video') ) {� 536 cffLightboxTile += 'data-url="http://facebook.com/'+$photo.attr('id')+'" data-video="'+$photo.attr('data-source');� 537 } else if( $photo.hasClass('cff-iframe-wrap') ) {� 538 cffLightboxTile += 'data-url="http://facebook.com/'+post_id+'" data-video="';� 539 } else {� 540 cffLightboxTile += 'data-url="'+$photo.attr('href')+'" data-video="';� 541 }� 542� 543 cffLightboxTile += '" data-type="'+postType+'" data-lb-comments="'+$photo.closest('.cff-lb').attr('data-lb-comments')+'"><div class="cff-photo-hover"><span class="fa fa-search-plus" aria-hidden="true"></span><span class="cff-screenreader">View</span></div></a>';� 544� 545 //Add the link to the photos/videos in the feed� 546 $photo.prepend(cffLightboxTile);� 547� 548 if( !cffTouchDevice ){ //Only apply hover effect if not touch screen device� 549 //Fade in links on hover� 550 $photo.hover(function(){� 551 $self.find('.cff-photo-hover').fadeIn(150);� 552 }, function(){� 553 $self.find('.cff-photo-hover').stop().fadeOut(500);� 554 });� 555 }� 556� 557 });� 558 }� 559� 560 //Share tooltip function� 561 $self.find('.cff-share-link').unbind().bind('click', function(){� 562 var $cffShareTooltip = $self.find('.cff-share-tooltip')� 563� 564 //Hide tooltip� 565 if( $cffShareTooltip.is(':visible') ){� 566 $cffShareTooltip.hide().find('a').removeClass('cff-show');� 567 } else {� 568 //Show tooltip� 569 $cffShareTooltip.show();� 570� 571 var time = 0;� 572 $cffShareTooltip.find('a').each(function() {� 573 var $cffShareIcon = jQuery(this);� 574 setTimeout( function(){� 575 $cffShareIcon.addClass('cff-show');� 576 }, time);� 577 time += 20;� 578 });� 579 }� 580 });� 581� 582� 583� 584� 585 � 586 //If it's a restricted page then use the lightbox src for the photo feed images� 587 if( typeof $cff.attr('data-restricted') !== 'undefined' ){� 588 var cff_restricted_page = true;� 589 } else {� 590 var cff_restricted_page = false;� 591 }� 592� 593 //Photos only� 594 if( $self.hasClass('cff-album-item') ){� 595 var cff_data_full_size = $self.attr('data-cff-full-size');� 596 � 597 if( typeof cff_data_full_size !== 'undefined' && cff_data_full_size != '' ){� 598� 599 if( cff_restricted_page ){� 600 $self.find('.cff-lightbox-link').attr('href', cff_data_full_size).closest('.cff-album-cover').css('background-image', 'url('+cff_data_full_size+')');� 601 $self.find('img').attr('src', cff_data_full_size);� 602 } else {� 603 $self.find('.cff-lightbox-link').attr('href', cff_data_full_size);� 604 }� 605� 606 }� 607 }� 608� 609� 610 //Add the HD video player� 611 //If it's a video post then add the video link to the video element so it can be used in the lightbox� 612 if( ( $self.find('.cff-html5-video').length || $self.hasClass('cff-video') ) ){� 613 � 614 var cff_live_video = false;� 615� 616 //Set the selector based on whether it's a timeline vid or videos only� 617 if( $self.find('.cff-html5-video').length ){� 618 var $vid_sel = $self.find('.cff-html5-video');� 619 if( $vid_sel.attr('data-cff-live') == 'true' ) cff_live_video = true;� 620 }� 621 if( $self.hasClass('cff-video') ) var $vid_sel = $self;� 622� 623 if( cff_live_video && $(window).width() <= 640 ){� 624 //If it's live video and on mobile then use HTMl5 player as live video doesn't work on mobile using Facebook player� 625 } else {� 626� 627 //If the Facebook Player is selected then pass the iframe URL into the lightbox.� 628 if( $vid_sel.attr('data-cff-video-player') != 'standard' ){� 629 $self.find('.cff-lightbox-link').attr({� 630 'data-iframe' : 'https://www.facebook.com/v2.3/plugins/video.php?href=' + $vid_sel.attr('data-cff-video-link'),�
631 'data-video' : ''� 632 });� 633 }� 634� 635 }� 636� 637 }� 638� 639 //Try to fix any video wrapper formatting issues� 640 setTimeout(function(){� 641 $self.find('.cff-iframe-wrap .fluid-width-video-wrapper iframe').unwrap().wrap('<div style="float: left; width: 100%;"></div>');� 642 $self.find('.cff-iframe-wrap .iframe-embed iframe').unwrap('iframe-embed');� 643 }, 500);� 644� 645� 646 //Open lightbox when clicking album or video title� 647 $self.find('.cff-album-info a').on('click', function(e){� 648 e.preventDefault();� 649 $self.find('.cff-lightbox-link').trigger('click');� 650 });� 651� 652� 653 }); //End $cff_post_selector.each loop� 654� 655� 656 //Load comment replies� 657 jQuery(document).off('click', '.cff-comment-replies a').on('click', '.cff-comment-replies a', function(){� 658 cffLoadCommentReplies( $(this) );� 659 });� 660� 661� 662 $('.cff-wrapper').each(function(){� 663 var $cff = $(this).find('#cff'),� 664 cff_grid_pag = $cff.attr('data-grid-pag');� 665� 666 //Get the Access Token from the shortcode so it can be used in the connect file� 667 var shortcode_token_param = cffGetShortcodeToken($cff);� 668� 669 //Masonry� 670 if( $cff.hasClass('cff-masonry-js') ){� 671� 672 if( $cff.find('.cff-album-item').length ){� 673 $cff.removeClass('cff-masonry-js');� 674 return;� 675 }� 676� 677 cffAddMasonry($cff);� 678 //Call it again in case images aren't fully loaded� 679 setTimeout(function(){ cffAddMasonry($cff); }, 1000);� 680� 681 // Resizing the window can affect the masonry feed so it is reset on resize� 682 $(window).resize(function () {� 683 setTimeout(function(){� 684 cffAddMasonry($cff);� 685 }, 500);� 686 });� 687� 688 if( $cff.find('.cff-credit').length ) $cff.css('padding-bottom', 30);� 689 }� 690� 691 //Allow us to make some tweaks when the feed is narrow� 692 function cffCheckWidth(){� 693� 694 if( $cff.hasClass('cff-album-items-feed') ){� 695 var $cffElement = $cff;� 696 } else {� 697 var $cffElement = $cff.find('.cff-item').first();� 698 }� 699� 700 if( $cffElement.innerWidth() < 400 ){� 701 if( !$cff.hasClass('cff-disable-narrow') ){� 702 $cff.addClass('narrow');� 703 }� 704 } else {� 705 $cff.removeClass('narrow');� 706 }� 707 if( $cffElement.innerWidth() < 250 ){� 708 $cff.addClass('cff-super-narrow');� 709 }� 710 }� 711 cffCheckWidth();� 712� 713 function cffActionLinksPos(){� 714 if( $cff.find('.cff-item').first().innerWidth() < (190 + $('.cff-post-links').innerWidth() ) ){� 715 $cff.find('.cff-post-links').addClass('cff-left')� 716 } else {� 717 $cff.find('.cff-post-links').removeClass('cff-left');� 718 }� 719 }� 720 cffActionLinksPos();� 721� 722 //Only check the width once the resize event is over� 723 var cffdelay = (function(){� 724 var cfftimer = 0;� 725 return function(cffcallback, cffms){� 726 clearTimeout (cfftimer);� 727 cfftimer = setTimeout(cffcallback, cffms);� 728 };� 729 })();� 730 window.addEventListener('resize', function(event){� 731 cffdelay(function(){� 732 cffCheckWidth();� 733 cffActionLinksPos();� 734 cffResizeAlbum();� 735 }, 500);� 736 });� 737� 738 //Albums only� 739 //Resize image height� 740 function cffResizeAlbum(last){� 741 var cffAlbumWidth = $cff.find('.cff-album-item').eq(0).find('a').innerWidth();� 742 $cff.find('.cff-album-item a').css('height', cffAlbumWidth);� 743 //Crops event images when selected� 744 $cff.find('.cff-photo.cff-crop').css( 'height', $cff.find('.cff-photo.cff-crop').width() );� 745� 746 //Sets crop height of main post image to be 60% (or the height of the thumbs - whichever is larger - so it's never shorter than the thumbs) to make room for the thumbs beneath� 747 $cff.find('.cff-item.cff-album .cff-photo.cff-multiple, .cff-video-post .cff-html5-video.cff-multiple').each(function(){� 748 var $cffPhotoEl = $(this);� 749� 750 //Crop image attachments in posts� 751 var cffPhotoImgWidth = $cffPhotoEl.find('img').first().width();� 752 if( cffPhotoImgWidth < 10 ) cffPhotoImgWidth = 300;� 753� 754 if($cffPhotoEl.hasClass('cff-img-layout-3')) $cffPhotoEl.find('.cff-img-attachments .cff-crop').css( 'height', cffPhotoImgWidth/2 );� 755 if($cffPhotoEl.hasClass('cff-img-layout-4')) $cffPhotoEl.find('.cff-img-attachments .cff-crop').css( 'height', cffPhotoImgWidth/3 );� 756� 757 //Crop main image� 758 if( $cffPhotoEl.is('.cff-img-layout-3, .cff-img-layout-4') ){� 759 var $cffMainImage = $cffPhotoEl.find('.cff-main-image'),� 760 cropPercentage = 0.6;� 761 if( $cffPhotoEl.hasClass('cff-img-layout-4') ) cropPercentage = 0.8;� 762� 763 //Set the height based on ratio� 764 var cffImageHeight = Math.round( cffPhotoImgWidth / $cffMainImage.find('img').attr('data-ratio') );� 765 $cffMainImage.css( 'height', Math.round( Math.max(cffImageHeight*cropPercentage, $cffPhotoEl.find('.cff-img-attachments').height() ) ) );� 766 } else if( $cffPhotoEl.is('.cff-img-layout-2') ) {� 767 var $cffCrop = $cffPhotoEl.find('.cff-img-wrap.cff-crop');� 768 if( $cffPhotoEl.hasClass('cff-portrait') ){� 769 $cffPhotoEl.find('.cff-img-wrap.cff-crop').css('height', $cffPhotoEl.width()*0.8 );� 770 } else {� 771 $cffPhotoEl.find('.cff-img-wrap.cff-crop').css('height', $cffPhotoEl.width()/2 );� 772 }� 773 }� 774� 775 //If the main image is being cropped to zero then remove the crop so the full image is shown� 776 if( last == true && ( $cffPhotoEl.is('.cff-img-layout-3') || $cffPhotoEl.is('.cff-img-layout-4') ) && $cffPhotoEl.find('.cff-main-image').height() < 10 ) $cffPhotoEl.find('.cff-img-layout-3 .cff-main-image img, .cff-img-layout-4 .cff-main-image img').css({� 777 'display' : 'block',� 778 'visibility' : 'visible'� 779 })� 780� 781 //Make "+6" text small if the images are small� 782 if( cffPhotoImgWidth < 200 ){� 783 $cffPhotoEl.addClass('cff-small-layout');� 784 } else {� 785 $cffPhotoEl.removeClass('cff-small-layout');� 786 }� 787 });� 788 � 789 }� 790 cffResizeAlbum(false);� 791 setTimeout(function(){ cffResizeAlbum(false); }, 50);� 792 setTimeout(function(){ cffResizeAlbum(true); }, 500);� 793 setTimeout(function(){ cffResizeAlbum(true); }, 1500);� 794� 795� 796 //PAGINATION� 797 //Events JS pagination� 798 var num_events = parseInt( $cff.attr('data-pag-num') ),� 799 show_events = num_events; //Iterated for each set� 800 //Show first set of events� 801 $cff.find('.cff-event').slice(0, num_events).css('display', 'inline-block');� 802 //cffResizeAlbum(); //Correctly recalcs height of event images when using eventimage=cropped� 803� 804 //Review JS pagination� 805 if( $cff.hasClass('cff-all-reviews') ){� 806 var num_reviews = parseInt( $cff.attr('data-pag-num') ),� 807 show_reviews = num_reviews;� 808� 809 //Offset� 810 var review_offset = parseInt($cff.attr('data-offset'));� 811 if( typeof review_offset == 'undefined' || isNaN(review_offset) ) review_offset = 0;� 812� 813 $cff.find('.cff-review').slice(0, num_reviews + review_offset ).css('display', 'inline-block');� 814� 815 //Hide some reviews if using offset setting� 816 if( review_offset > 0 ) $cff.find('.cff-review').slice(0, review_offset ).remove();� 817 }� 818� 819 //Set a data attr that lets us know whether no posts were loaded into the feed so that we can change the "until" value in the next request� 820 var $cffLoadMore = $cff.find('#cff-load-more'),� 821 cff_no_posts_added = $cff.find('.cff-load-more').attr('data-cff-no-posts-added');� 822 if (typeof cff_no_posts_added == typeof undefined || cff_no_posts_added == false) {� 823 $cffLoadMore.attr('data-cff-no-posts-added', 'false');� 824 }� 825�
826 //If there's no posts in the feed initially then set the data-attr to be true� 827 if( $cff.find('.cff-item, .cff-album-item').length < 1 ) $cffLoadMore.attr('data-cff-no-posts-added', 'true');� 828� 829 // add the load more button and input to simulate a dynamic json file call� 830 $cffLoadMore.off().on('click', function() {� 831� 832 // read the json that is in the cff-data-shortcode that contains all of the shortcode arguments� 833 var shortcodeData = $cff.attr('data-cff-shortcode'),� 834 $paginationURL = $cff.find('.cff-pag-url'),� 835 pag_url = $paginationURL.attr('data-cff-pag-url');� 836� 837 //Upmcoming events JS pagination� 838 var events_count = $cff.find('.cff-upcoming-event').length;� 839 //If it's an event feed� 840 if( events_count > 0 ){� 841 show_events = show_events + num_events;� 842 //Show the next set of events� 843 $cff.find('.cff-upcoming-event').slice(0, show_events).css('display', 'inline-block');� 844 if( show_events > events_count ){� 845 $cff.find('#cff-load-more').hide();� 846 cff_no_more_posts($cff, $cffLoadMore);� 847 }� 848� 849 //Re-init masonry for JS� 850 if( $cff.hasClass('cff-masonry-js') && !$cff.hasClass('cff-masonry-css') ){� 851 cffAddMasonry($cff);� 852 }� 853 return;� 854 }� 855� 856 //Reviews JS pagination� 857 if( $cff.hasClass('cff-all-reviews') ){� 858 var reviews_count = $cff.find('.cff-review').length;� 859 //If it's an reviews feed� 860 if( reviews_count > 0 ){� 861 show_reviews = show_reviews + num_reviews;� 862 //Show the next set of reviews� 863 $cff.find('.cff-review').slice(0, show_reviews).css('display', 'inline-block');� 864 if( show_reviews > reviews_count ){� 865 $cff.find('#cff-load-more').hide();� 866 cff_no_more_posts($cff, $cffLoadMore);� 867 }� 868� 869 //Re-init masonry for JS� 870 if( $cff.hasClass('cff-masonry-js') && !$cff.hasClass('cff-masonry-css') ){� 871 cffAddMasonry($cff);� 872 }� 873 return;� 874 }� 875 }� 876� 877� 878 //Remove the ID so it can't be clicked twice before the posts are loaded� 879 $cffLoadMore.off().removeAttr('id').addClass('cff-disabled');� 880� 881 // remove the hidden field since it will be replaced with new before token and after token next url data� 882 $paginationURL.remove();� 883� 884 � 885 //If it's a photo/vid/album feed then change the selector� 886 if( $cff.hasClass('cff-album-items-feed') ){� 887 var item_sel = '.cff-album-item';� 888 } else {� 889 var item_sel = '.cff-item';� 890 }� 891� 892 if( item_sel == '.cff-album-item' ){� 893 //If the next_url is empty then use the prev_url� 894 if( (pag_url == '' || pag_url == '{}') ) pag_url = $paginationURL.attr('data-cff-prev-url');� 895� 896 //Loop through the previous URLs and if the next URL is empty for an ID then add it in� 897 var prev_urls = $paginationURL.attr('data-cff-prev-url');� 898� 899 //Convert the JSON string into an object so we can loop through it� 900 var prev_urls_arr = ( typeof prev_urls == 'undefined' ) ? '' : JSON.parse( prev_urls );� 901 }� 902� 903 //Parse the urls string into an array so we can loop through it� 904 var pag_url_arr = ( typeof pag_url == 'undefined' ) ? '' : JSON.parse( pag_url );� 905� 906 if( item_sel == '.cff-album-item' ){� 907 //Add the URL to the next_urls if it doesn't exist in the array� 908 for (var key in prev_urls_arr) {� 909 if (prev_urls_arr.hasOwnProperty(key)) {� 910 if( typeof pag_url_arr[key] == 'undefined' ) pag_url_arr[key] = prev_urls_arr[key];� 911 }� 912 }� 913 }� 914� 915 if( (pag_url == '' || pag_url == '{}') && item_sel == '.cff-item' ){� 916 $cffLoadMore.hide();� 917 cff_no_more_posts($cff, $cffLoadMore);� 918 } else {� 919 //Display loader� 920 $cffLoadMore.addClass('cff-loading').append('<div class="cff-loader"></div>');� 921 $cffLoadMore.find('.cff-loader').css('background-color', $cffLoadMore.css('color'));� 922 }� 923� 924� 925 //Check which pagination method to use� 926 var cff_timeline_api_paging = false;� 927 if( $cff.attr('data-timeline-pag') ) cff_timeline_api_paging = true;� 928� 929 if( cff_timeline_api_paging == true ){� 930 //Use the raw "next" URL with the "paging_token" in it, as using the "until" method can cause a problem with groups due to the fact that the recent activity ordering method of groups can cause the last post in a feed to have an older date than those in the next batch, and so some are missed when paginating using the date.� 931 } else {� 932 //Loop through the pag array. Replace the until params for each id. Stringify to send in the aja
932x request� 933 for (var key in pag_url_arr) {� 934 if (pag_url_arr.hasOwnProperty(key)) {� 935� 936 var this_url = pag_url_arr[key],� 937 until_old = cffGetParameterByName('until', this_url),� 938 until_new = (parseInt( $cff.find(item_sel+'.cff-' + key).last().attr('data-cff-timestamp') ) - 1).toString();� 939� 940 //If there's no posts in the feed for a specific author then use the timestamp from the last post in the feed from any author� 941 if( isNaN(parseFloat(until_new)) ){� 942 until_new = (parseInt( $cff.find(item_sel).last().attr('data-cff-timestamp') ) - 1).toString();� 943 }� 944� 945 � 946 var new_url = this_url;� 947� 948 if( $cffLoadMore.attr('data-cff-no-posts-added') == 'true' ){� 949 //If there were no posts added to the feed from the previous response then don't replace the until_old with the until_new in the next request� 950 } else {� 951 //If it's a regular timeline feed then add the "until" param� 952 if( item_sel !== '.cff-album-item' ){� 953� 954 //V2.9+ of the API don't include "until" in the next url so only replace it if it exists� 955 if( this_url.indexOf("until=") !== -1 ){� 956 //Replace old until value with new one in the URL� 957 var new_url = this_url.replace("until="+until_old,"until="+until_new);� 958 } else {� 959 //If "until" doesn't exist then add it to the end of the URL� 960 var new_url = this_url + "&until="+until_new;� 961 }� 962� 963 //Remove the "after" param as it overrides the "until" param� 964 if( new_url.indexOf('&after=') > -1 ) new_url = new_url.replace("&after="+cffGetParameterByName('after', new_url),"");� 965� 966 }� 967� 968 }� 969� 970 //USE OFFSET PAGINATION METHOD� 971 if( cff_grid_pag == 'offset' ){� 972 if( item_sel == '.cff-album-item' ){� 973 //If it's an album item then remove the "after" param as it overrides the "until" param� 974 if( new_url.indexOf('&after=') > -1 ) new_url = new_url.replace("&after="+cffGetParameterByName('after', new_url),"");� 975� 976 //Add the offset param for pagination as time based doesn't work with albums due to the albums not always being in date order, and the other type of paging doesn't work due to filtering/higher post limits� 977 key = key.replace( /(:|\.|\[|\]|,|=)/g, "\\$1" );� 978 var albumItemCount = $cff.find('.cff-album-item.cff-' + key).length + $cff.find('.cff-empty-album.cff-' + key).length;� 979 if( new_url.indexOf('&offset=') > -1 ){� 980 new_url = new_url.replace("&offset="+cffGetParameterByName('offset', new_url), "&offset="+albumItemCount);� 981 } else {� 982 new_url = new_url + "&offset=" + albumItemCount;� 983 }� 984 key = key.replace(/\\/g, '');� 985 }� 986 }� 987 //END USE OFFSET PAGINATION METHOD� 988� 989� 990 //If it's an events only URL then remove the "after" param as we're using the "until" value instead� 991 if( (this_url.indexOf('/events') > -1 && this_url.indexOf('&after=') > -1) || (this_url.indexOf('/ratings') > -1 && this_url.indexOf('&after=') > -1 && $cff.hasClass('cff-all-reviews') ) ){� 992 new_url = new_url.replace("&after="+cffGetParameterByName('after', new_url),"");� 993 }� 994� 995 //Remove the "__paging_token" parameter from the URL as it causes some posts to be missing and it isn't needed as we're using "until"� 996 if( new_url.indexOf('&__paging_token') > -1 ){� 997 new_url = new_url.replace("&__paging_token="+cffGetParameterByName('__paging_token', new_url),"");� 998 }� 999� 1000 pag_url_arr[key] = new_url;� 1001 }� 1002 } // End pag_url_arr loop� 1003 } // End cff_timeline_api_paging if/else� 1004� 1005 //Convert the array back into a string� 1006 pag_url = JSON.stringify( pag_url_arr );� 1007� 1008 jQuery.ajax({� 1009 url : cffajaxurl,� 1010 type : 'post',� 1011 data : {� 1012 action : 'cff_get_new_posts',� 1013 shortcode_data : shortcodeData,� 1014 pag_url : pag_url� 1015 },� 1016 success : function(data) {� 1017� 1018 //If there's no posts added to the feed then set a data attr on the button so that we can change the "until" value to get a new batch next time� 1019 //Check by seeing if the data contains a div (ie. post)� 1020 if( data.indexOf('<div class=') == -1 && data.indexOf('<span class=') == -1 ){� 1021 $cffLoadMore.attr('data-cff-no-posts-added', 'true');� 1022 } else {� 1023 $cffLoadMore.attr('data-cff-no-posts-added', 'false');� 1024 }� 1025� 1026 //Appends the html echoed out in cff_get_new_posts() to the last existing post element� 1027 if( $cff.find('.cff-item, .cff-album-item').length ){� 1028 $cff.find('.cff-item, .cff-album-item').removeClass('cff-new').last().after(data);� 1029 } else {� 1030 //If there's no posts yet then just add it into the posts container� 1031 $cff.find('.cff-posts-wrap').append(data);� 1032 }� 1033� 1034 //Replace any duplicate album items with empty items so doesn't affect offset pagination � 1035 $cff.find('.cff-album-item').each(function (i) {� 1036 var $el = $('[id="' + this.id + '"]').eq(1);� 1037 if($el.length){� 1038 this_classes = $el.attr('class');� 1039 this_classes = this_classes.replace("cff-album-item","");� 1040 }� 1041 });� 1042� 1043 //Remove loader� 1044 $cffLoadMore.removeClass('cff-loading').find('.cff-loader').remove();� 1045 //Re-add the ID so it can be clicked again� 1046 $cffLoadMore.attr('id', 'cff-load-more').removeClass('cff-disabled');� 1047� 1048 //Rerun JS (only runs on new items - .cff-new)� 1049 cff_init( $cff );� 1050� 1051 //Re-init masonry� 1052 if( $cff.hasClass('cff-masonry-js') && !$cff.hasClass('cff-masonry-css') ){� 1053� 1054 $cff.masonry('appended', $cff.find('.cff-new'));� 1055� 1056 $cff.find('.cff-view-comments, .cff-comment-replies a, .cff-show-more-comments a').off().on('click', function() {� 1057 if( !$cff.hasClass('cff-opaque-comments') ){� 1058 setTimeout(function(){� 1059 cffAddMasonry($cff);� 1060 }, 500);� 1061 }� 1062 });� 1063� 1064 }� 1065� 1066 //If there's no more API URLs to hit then hide the load more button� 1067 var next_urls = $cff.find('.cff-pag-url').attr('data-cff-pag-url');� 1068 if( item_sel == '.cff-item' || cff_grid_pag == 'cursor' ){� 1069 if( next_urls == '{}' ) cff_no_more_posts($cff, $cffLoadMore);� 1070 } else {� 1071 if( data.indexOf('class="cff-album-item') < 0 && data.indexOf('class="cff-empty-album') < 0 ){� 1072 cff_no_more_posts($cff, $cffLoadMore);� 1073 }� 1074 }� 1075� 1076 // Call Custom JS if it exists� 1077 // if (typeof cff_custom_js == 'function') setTimeout(function(){ cff_custom_js(jQuery); }, 100);� 1078 if (typeof cff_custom_js == 'function') cff_custom_js(jQuery);� 1079� 1080 } // End success� 1081 }); // End Ajax call� 1082� 1083 }).hover( //Hover on Load More button� 1084 function() {� 1085 $(this).css('background', $(this).attr('data-cff-hover') );� 1086 }, function() {� 1087 $(this).css('background', $(this).attr('data-cff-bg') );� 1088 }� 1089 );� 1090� 1091 function cff_no_more_posts($cff, $cffLoadMore){� 1092 var no_more_posts_text = ( $cffLoadMore.attr('data-no-more') == '' ) ? 'No more posts' : $cffLoadMore.attr('data-no-more').replace(/\\'/g,"'");� 1093 if( $cff.find('.cff-no-more-posts').length < 1 ) $cffLoadMore.hide().after('<p class="cff-no-more-posts">'+no_more_posts_text+'</p>');� 1094 $cff.find('.cff-error-msg').remove();� 1095 }� 1096� 1097 //Remove the masonry css class if it's a grid feed� 1098 if( $cff.find('.cff-album-item').length ){� 1099 $cff.removeClass('cff-masonry cff-masonry-js cff-masonry-css');� 1100 }� 1101� 1102 //Multiple event dates toggle�
1103 $cff.find('.cff-more-dates').on('click', function(){� 1104 $(this).siblings('.cff-multiple-dates').slideToggle(100);� 1105 });� 1106� 1107� 1108 }); // End .$('.cff-wrapper').each� 1109� 1110� 1111 //GET/CACHE COMMENTS� 1112 //Check if the meta transient exists (set in head JS vars) and that a timeline feed exists on the page� 1113 if(cffmetatrans != 'false' && $('.cff-timeline-feed').length && (typeof cffdisablecommentcaching == 'undefined') ){� 1114� 1115 //If the comments data is cached then get it from the transient in the DB� 1116 $.ajax({� 1117 url: cffajaxurl,� 1118 type: 'POST',� 1119 async: true,� 1120 cache: false,� 1121 data:{� 1122 action: 'get_meta'� 1123 },� 1124 success: function(data) {� 1125� 1126 //If there's no data then set the array to be empty so that it hits the API for the data� 1127 if( data == '' || data.length < 1 ){� 1128 metaArr = [];� 1129 } else {� 1130 //Decode the JSON to that it can be used again� 1131 data = decodeURI(data);� 1132� 1133 //Replace any escaped single quotes as it results in invalid JSON� 1134 data = data.replace(/\\'/g, "'");� 1135� 1136 //Convert the cached JSON string back to a JSON object� 1137 metaArr = JSON.parse( data );� 1138 }� 1139� 1140 // $cff.find('.cff-item.cff-new').each(function(){� 1141 $cff.each(function(){� 1142 $(this).find('.cff-item.cff-new:not(.cff-event)').each(function(){� 1143 var $self = $(this),� 1144 post_id_orig = $self.find('.cff-view-comments').attr('id'),� 1145 object_id = $self.closest('.cff-item').attr('data-object-id');� 1146� 1147 //If the post ID doesn't exist in the array then use the API to get the data� 1148 if( metaArr.hasOwnProperty(post_id_orig) ){� 1149 cffCreateComments($self, metaArr[post_id_orig]);� 1150 cffAddFullsizeImageURLs($self, metaArr[post_id_orig]);� 1151 } else {� 1152 cffGetMetaAPI($self, post_id_orig, object_id);� 1153 } � 1154 });� 1155 });� 1156 � 1157 },� 1158 error: function(xhr,textStatus,e) {� 1159 return; � 1160 }� 1161� 1162 }); //End ajax� 1163� 1164 } else {� 1165� 1166 $('#cff .cff-item.cff-new:not(.cff-event)').each(function(){� 1167 var $self = $(this),� 1168 post_id_orig = $self.find('.cff-view-comments').attr('id'),� 1169 object_id = $self.closest('.cff-item').attr('data-object-id');� 1170� 1171 cffGetMetaAPI($self, post_id_orig, object_id);� 1172 }); � 1173� 1174 } //END GET/CACHE COMMENTS� 1175� 1176� 1177 function cffGetMetaAPI($self, post_id_orig, object_id){� 1178� 1179 //If there's no comments box on the page then return so we don't hit the API to get the data� 1180 if( $self.find('.cff-view-comments').length == 0 ) return;� 1181 � 1182 if( typeof object_id == 'undefined' || object_id.length < 2 ) object_id = '';� 1183� 1184 var object_id_query = ''+object_id,� 1185 post_id_query = '?post_id='+post_id_orig,� 1186 use_id = 'object',� 1187 post_comment_count = $self.find('.cff-comments .cff-count').text(),� 1188 post_likes_count = $self.find('.cff-likes .cff-count').text(),� 1189 cff_page_id = $self.attr('data-page-id');� 1190� 1191 if( typeof post_comment_count == 'undefined' || post_comment_count == '' ) post_comment_count = 0;� 1192 if( typeof post_likes_count == 'undefined' || post_likes_count == '' ) post_likes_count = 0;� 1193� 1194 //If it's a video post or there's no object ID then use the post ID (video posts don't have "images" field)� 1195 // if( typeof object_id == 'undefined' || object_id.length < 2 || $self.hasClass('cff-video-post') ) use_id = 'post';� 1196 if( typeof object_id == 'undefined' || object_id.length < 2 || $self.find('.cff-comments-box').hasClass('cff-shared-story') || $self.hasClass('cff-timeline-event') ) use_id = 'post';� 1197� 1198 var timeline_event = '';� 1199 if( $self.hasClass('cff-timeline-event') ) timeline_event = '&timeline_event=true';� 1200� 1201 var usegrouptoken = '',� 1202 useowntoken = '';� 1203 if( $self.closest('#cff').hasClass('cff-group') ) usegrouptoken = '&usegrouptoken=true';� 1204 if( $self.closest('#cff').attr('data-own-token') == 'true' ) useowntoken = '&useowntoken=true';� 1205� 1206 shortcode_token_param = cffGetShortcodeToken( $self.closest('#cff') );� 1207� 1208 //Is it a video post? If so, then we may be able to use the object ID to get the embeddable video object� 1209 var cff_is_video_post = $self.hasClass('cff-video-post') ? '&isvideo=true' : '';� 1210� 1211 var url = cffsiteurl + "/custom-facebook-feed-pro/query.php?o_id=" + object_id + '&post_id='+post_id_orig + '&use_id=' + use_id + timeline_event + usegrouptoken + useowntoken + '&comments_num=' + post_comment_count + '&likes_num=' + post_like
1211s_count + '&type=meta' + cff_is_video_post + '&pageid=' + cff_page_id + shortcode_token_param;� 1212� 1213 if( $self.hasClass('cff-album') ) url += '&timelinealbum=true';� 1214� 1215 //Get comments, reactions, and full size images data from the API� 1216 if( locatefile == true ){� 1217 $.ajax({� 1218 method: "GET",� 1219 url: url,� 1220 success: function(data) {� 1221� 1222 //Cache the comments by adding to the cache array� 1223 metaArr[ post_id_orig ] = data;� 1224 newMetaArr[ post_id_orig ] = data; //This is cached. Only the new comments.� 1225� 1226 //Add the comments HTML� 1227 cffCreateComments($self, data);� 1228� 1229 //Replace images URLs with full size ones� 1230 cffAddFullsizeImageURLs($self, data);� 1231� 1232 //Set the cache� 1233 cffSetMetaCache(newMetaArr);� 1234 � 1235 }//End ajax success� 1236� 1237 });� 1238 }� 1239� 1240 } //End cffGetMetaAPI()� 1241� 1242 //Only allow this function to run once every time new posts are loaded so that a load of ajax requests aren't all fired off at once. It's called once and then runs 3 times in total to cache all comments on the page into the cff_meta transient.� 1243 var cffSetMetaCache_executed = false;� 1244 function cffSetMetaCache(newMetaArr){� 1245� 1246 if( typeof cffdisablecommentcaching != 'undefined' ) return;� 1247� 1248 if( !cffSetMetaCache_executed ){� 1249� 1250 //Cache the comments data� 1251 var cffTimesCached = 0,� 1252 cffCacheDelay = setTimeout(function() {� 1253 //Try to cache it multiple times so that if the comments data isn't finished returning the first time then the subsequent attempts gets it� 1254 var cffCacheInterval = setInterval(function(){� 1255 � 1256 cffCacheMeta(newMetaArr);� 1257� 1258 cffTimesCached++;� 1259 if(cffTimesCached == 2) clearInterval(cffCacheInterval);� 1260 }, 3000);� 1261� 1262 //Send the data to DB initially via ajax after a 0.5 second delay� 1263 cffCacheMeta(newMetaArr);� 1264 }, 500);� 1265� 1266 cffSetMetaCache_executed = true;� 1267� 1268 } // End cffRunFunction check� 1269� 1270� 1271 //Cache the likes and comments counts by sending an array via ajax to the main plugin file which then stores it in a transient� 1272 function cffCacheMeta(newMetaArr){� 1273� 1274 //Convert the JSON object to a string� 1275 var jsonstring = JSON.stringify( newMetaArr );� 1276� 1277 //Encode the JSON string so that it can be stored in the database� 1278 jsonstring = encodeURI(jsonstring);� 1279� 1280 //Cache the data� 1281 var opts = {� 1282 url: cffajaxurl,� 1283 type: 'POST',� 1284 async: true,� 1285 cache: false,� 1286 data:{� 1287 action: 'cache_meta',� 1288 metadata: jsonstring // Passes array of meta data to WP to cache� 1289 },� 1290 success: function(response) {� 1291 return; � 1292 },� 1293 error: function(xhr,textStatus,e) {� 1294 return; � 1295 }� 1296 };� 1297 $.ajax(opts);� 1298 � 1299 } // End cffCacheMeta()� 1300� 1301 } // End cffSetMetaCache()� 1302� 1303� 1304 function cffGetParameterByName(name, url) {� 1305 name = name.replace(/[\[\]]/g, "\\$&");� 1306 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),� 1307 results = regex.exec(url);� 1308 if (!results) return null;� 1309 if (!results[2]) return '';� 1310 return decodeURIComponent(results[2].replace(/\+/g, " "));� 1311 }� 1312� 1313 function cffLinkify(inputText) {� 1314 var replacedText, replacePattern1, replacePattern2, replacePattern3;� 1315� 1316 //URLs starting with http://, https://, or ftp://� 1317 replacePattern1 = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;� 1318 replacedText = inputText.replace(replacePattern1, '<a href="$1" target="_blank">$1</a>');� 1319� 1320 //URLs starting with "www." (without // before it, or it'd re-link the ones done above).� 1321 replacePattern2 = /(^|[^\/])(www\.[\S]+(\b|$))/gim;� 1322 replacedText = replacedText.replace(replacePattern2, '$1<a href="http://$2" target="_blank">$2</a>');� 1323� 1324 //Change email addresses to mailto:: links.� 1325 replacePattern3 = /(([a-zA-Z0-9\-\_\.])+@[a-zA-Z\_]+?(\.[a-zA-Z]{2,6})+)/gim;� 1326 replacedText = replacedText.replace(replacePattern3, '<a href="mailto:$1">$1</a>');� 1327� 1328 return replacedText;� 1329 }� 1330� 1331� 1332 //HTML5 Video play button� 1333 $(document).off('click', '#cff .cff-html5-video .cff-html5-play').on('click', '#cff .cff-html5-video .cff-html5-play', function(e){� 1334 e.preventDefault();� 1335� 1336 var $self = $(this),� 1337 $videoWrapper = $self.closest('.cff-html5-video'),� 1338 video = $self.siblings('video')[0];� 1339 video.play();� 1340 $self.hide();� 1341 $self.siblings('.cff-poster').hide();� 1342� 1343 //Show controls when the play button is clicked� 1344 if (video.hasAttribute("controls")) {� 1345 video.removeAttribute("controls") � 1346 } else {� 1347 video.setAttribute("controls","controls") � 1348 }� 1349� 1350 if($videoWrapper.innerWidth() < 150 && !$videoWrapper.hasClass('cff-no-video-expand')) {� 1351 $videoWrapper.css('width','100%').closest('.cff-item').find('.cff-text-wrapper').css('width','100%');� 1352 }� 1353 });� 1354� 1355� 1356 //Replace the lightbox image with the full size image which is retrieved
1356in the meta API request� 1357 function cffAddFullsizeImageURLs($self, data){� 1358 var data = jQuery.parseJSON( data );� 1359� 1360 if( typeof data.images !== 'undefined' && data.images !== null ) $self.find('.cff-lightbox-link').attr('href', data.images[0].source);� 1361 � 1362 //Removed in v3.7 as shouldn't be needed any longer. Commenting out in case needs to be re-added.� 1363 //Add the full size video image which is retrieved from query.php to fix the Facebook video image size API bug� 1364 // if( $self.find('.cff-html5-video').length && typeof data.attachments !== 'undefined' && data.attachments !== null ){� 1365 // $self.find('.cff-poster').attr('src', data.attachments.data[0].media.image.src);� 1366 // console.log( data.attachments.data[0] );� 1367 // $self.find('.cff-lightbox-link').attr('href', data.attachments.data[0].media.image.src);� 1368 // }� 1369 }� 1370� 1371� 1372 //Create comments� 1373 function cffCreateComments($self, data){� 1374� 1375 if (data.substring(0, 1) == "<") return false;� 1376� 1377 //Convert string of data received from comments.php to a JSON object� 1378 var data = jQuery.parseJSON( data ),� 1379 cff_comments = '',� 1380 cff_likes_this = '',� 1381 commentShow = parseInt( $self.find('.cff-comments-box').attr('data-num') ),� 1382 like_count = ( typeof data.likes !== 'undefined' ) ? data.likes.summary.total_count : 0� 1383 $cffCommentsBox = $self.find('.cff-comments-box'),� 1384 $cffCommentLikes = $cffCommentsBox.find('.cff-comment-likes'),� 1385 cff_hide_comment_avatars = Boolean($self.find('.cff-comments-box').attr('data-cff-hide-avatars')),� 1386 cff_expand_comments = Boolean($self.find('.cff-comments-box').attr('data-cff-expand-comments')),� 1387 cff_translate_like_this_text = $cffCommentsBox.attr('data-cff-like-text'),� 1388 cff_translate_likes_this_text = $cffCommentsBox.attr('data-cff-likes-text'),� 1389 cff_translate_reacted_to_this_text = $cffCommentsBox.attr('data-cff-reacted-text'),� 1390 cff_translate_and_text = $cffCommentsBox.attr('data-cff-and-text'),� 1391 cff_translate_other_text = $cffCommentsBox.attr('data-cff-other-text'),� 1392 cff_translate_others_text = $cffCommentsBox.attr('data-cff-others-text'),� 1393 cff_translate_reply_text = $cffCommentsBox.attr('data-cff-reply-text'),� 1394 cff_translate_replies_text = $cffCommentsBox.attr('data-cff-replies-text'),� 1395 cff_total_comments_count = ( typeof data.comments !== 'undefined' ) ? data.comments.summary.total_count : 0,� 1396 cff_meta_link_color = $self.find('.cff-comments-box').attr('data-cff-meta-link-color'),� 1397 cff_post_tags = Boolean( $self.find('.cff-comments-box').attr('data-cff-post-tags') );� 1398� 1399 //ADD REACTIONS� 1400 var cff_haha_count = ( typeof data.haha !== 'undefined' ) ? data.haha.summary.total_count : 0;� 1401 var cff_love_count = ( typeof data.love !== 'undefined' ) ? data.love.summary.total_count : 0;� 1402 var cff_wow_count = ( typeof data.wow !== 'undefined' ) ? data.wow.summary.total_count : 0;� 1403 var cff_sad_count = ( typeof data.sad !== 'undefined' ) ? data.sad.summary.total_count : 0;� 1404 var cff_angry_count = ( typeof data.angry !== 'undefined' ) ? data.angry.summary.total_count : 0;� 1405� 1406 var reactions_arr = [cff_haha_count, cff_love_count, cff_wow_count, cff_sad_count, cff_angry_count];� 1407 var reaction_first_num = reactions_arr.sort(sortNumber)[0];� 1408 var reaction_second_num = reactions_arr.sort(sortNumber)[1];� 1409� 1410 //Sort array highest to lowest� 1411 function sortNumber(a,b) {� 1412 return b - a;� 1413 }� 1414� 1415 var reactions_html = '',� 1416 love_added = false,� 1417 haha_added = false,� 1418 wow_added = false,� 1419 sad_added = false,� 1420 angry_added = false,� 1421 love_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M462.3 62.7c-54.5-46.4-136-38.7-186.6 13.5L256 96.6l-19.7-20.3C195.5 34.1 113.2 8.7 49.7 62.7c-62.8 53.6-66.1 149.8-9.9 207.8l193.5 199.8c6.2 6.4 14.4 9.7 22.6 9.7 8.2 0 16.4-3.2 22.6-9.7L472 270.5c56.4-58 53.1-154.2-9.7-207.8zm-13.1 185.6L256.4 448.1 62.8 248.3c-38.4-39.6-46.4-115.1 7.7-161.2 54.8-46.8 119.2-12.9 142.8 11.5l42.7 44.1 42.7-44.1c23.2-24 88.2-58 142.8-11.5 54 46 46.1 121.5 7.7 161.2z"></path></svg>'+'<span class="cff-svg-bg-dark"><svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M462.3 62.6C407.5 15.9 326 24.3 275.7 76.2L256 96.5l-19.7-20.3C186.1 24.3 104.5 15.9 49.7 62.6c-62.8 53.6-66.1 149.8-9.9 207.9l193.5 199.8c12.5 12.9 32.8 12.9 45.3 0l193.5-199.8c56.3-58.1 53-154.3-9.8-207.9z"></path></svg></span>',� 1422 haha_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm152.7 400.7c-19.8 19.8-43 35.4-68.7 46.3-26.6 11.3-54.9 17-84.1 17s-57.5-5.7-84.1-17c-25.7-10.9-48.8-26.5-68.7-46.3-19.8-19.8-35.4-43-46.3-68.7-11.3-26.6-17-54.9-17-84.1s5.7-57.5 17-84.1c10.9-25.7 26.5-48.8 46.3-68.7 19.8-19.8 43-35.4 68.7-46.3 26.6-11.3 54.9-17 84.1-17s57.5 5.7 84.1 17c25.7 10.9 48.8 26.5 68.7 46.3 19.8 19.8 35.4 43 46.3 68.7 11.3 26.6 17 54.9 17 84.1s-5.7 57.5-17 84.1c-10.8 25.8-26.4 48.9-46.3 68.7zM281.8 206.3l80 48c11.5 6.8 24
1422-7.6 15.4-18L343.6 196l33.6-40.3c8.6-10.3-3.8-24.8-15.4-18l-80 48c-7.7 4.7-7.7 15.9 0 20.6zm-147.6 48l80-48c7.8-4.7 7.8-15.9 0-20.6l-80-48c-11.6-6.9-24 7.7-15.4 18l33.6 40.3-33.6 40.3c-8.7 10.4 3.8 24.8 15.4 18zM383 288H113c-9.6 0-17.1 8.4-15.9 18 8.8 71 69.4 126 142.9 126h16c73.4 0 134-55 142.9-126 1.2-9.6-6.3-18-15.9-18zM256 400h-16c-50.2 0-93.5-33.3-107.4-80h230.8c-13.9 46.7-57.2 80-107.4 80z"></path></svg>'+'<svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 152c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm88 272h-16c-73.4 0-134-55-142.9-126-1.2-9.5 6.3-18 15.9-18h270c9.6 0 17.1 8.4 15.9 18-8.9 71-69.5 126-142.9 126z"></path></svg>',� 1423 wow_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 464c-119.1 0-216-96.9-216-216S128.9 40 248 40s216 96.9 216 216-96.9 216-216 216zm0-184c-35.3 0-64 28.7-64 64s28.7 64 64 64 64-28.7 64-64-28.7-64-64-64zm0 96c-17.6 0-32-14.4-32-32s14.4-32 32-32 32 14.4 32 32-14.4 32-32 32zm-48-176c0-17.7-14.3-32-32-32s-32 14.3-32 32 14.3 32 32 32 32-14.3 32-32zm128-32c-17.7 0-32 14.3-32 32s14.3 32 32 32 32-14.3 32-32-14.3-32-32-32z"></path></svg>'+'<svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM136 208c0-17.7 14.3-32 32-32s32 14.3 32 32-14.3 32-32 32-32-14.3-32-32zm112 208c-35.3 0-64-28.7-64-64s28.7-64 64-64 64 28.7 64 64-28.7 64-64 64zm80-176c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"></path></svg>',� 1424 sad_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 464c-119.1 0-216-96.9-216-216S128.9 40 248 40s216 96.9 216 216-96.9 216-216 216zm0-152c-44.4 0-86.2 19.6-114.8 53.8-5.7 6.8-4.8 16.9 2 22.5 6.8 5.7 16.9 4.8 22.5-2 22.4-26.8 55.3-42.2 90.2-42.2s67.8 15.4 90.2 42.2c5.3 6.4 15.4 8 22.5 2 6.8-5.7 7.7-15.8 2-22.5C334.2 339.6 292.4 320 248 320zm-80-80c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32zm160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32-32 14.3-32 32 14.3 32 32 32z"></path></svg>'+'<svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm170.2 218.2C315.8 367.4 282.9 352 248 352s-67.8 15.4-90.2 42.2c-13.5 16.3-38.1-4.2-24.6-20.5C161.7 339.6 203.6 320 248 320s86.3 19.6 114.7 53.8c13.6 16.2-11 36.7-24.5 20.4z"></path></svg>',� 1425 angry_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm0 464c-119.1 0-216-96.9-216-216S128.9 40 248 40s216 96.9 216 216-96.9 216-216 216zm0-136c-31.2 0-60.6 13.8-80.6 37.8-5.7 6.8-4.8 16.9 2 22.5s16.9 4.8 22.5-2c27.9-33.4 84.2-33.4 112.1 0 5.3 6.4 15.4 8 22.5 2 6.8-5.7 7.7-15.8 2-22.5-19.9-24-49.3-37.8-80.5-37.8zm-48-96c0-2.9-.9-5.6-1.7-8.2.6.1 1.1.2 1.7.2 6.9 0 13.2-4.5 15.3-11.4 2.6-8.5-2.2-17.4-10.7-19.9l-80-24c-8.4-2.5-17.4 2.3-19.9 10.7-2.6 8.5 2.2 17.4 10.7 19.9l31 9.3c-6.3 5.8-10.5 14.1-10.5 23.4 0 17.7 14.3 32 32 32s32.1-14.3 32.1-32zm171.4-63.3l-80 24c-8.5 2.5-13.3 11.5-10.7 19.9 2.1 6.9 8.4 11.4 15.3 11.4.6 0 1.1-.2 1.7-.2-.7 2.7-1.7 5.3-1.7 8.2 0 17.7 14.3 32 32 32s32-14.3 32-32c0-9.3-4.1-17.5-10.5-23.4l31-9.3c8.5-2.5 13.3-11.5 10.7-19.9-2.4-8.5-11.4-13.2-19.8-10.7z"></path></svg><span class="cff-svg-bg-dark"><svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 496 512"><path d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zM136 240c0-9.3 4.1-17.5 10.5-23.4l-31-9.3c-8.5-2.5-13.3-11.5-10.7-19.9 2.5-8.5 11.4-13.2 19.9-10.7l80 24c8.5 2.5 13.3 11.5 10.7 19.9-2.1 6.9-8.4 11.4-15.3 11.4-.5 0-1.1-.2-1.7-.2.7 2.7 1.7 5.3 1.7 8.2 0 17.7-14.3 32-32 32S136 257.7 136 240zm168 154.2c-27.8-33.4-84.2-33.4-112.1 0-13.5 16.3-38.2-4.2-24.6-20.5 20-24 49.4-37.8 80.6-37.8s60.6 13.8 80.6 37.8c13.8 16.5-11.1 36.6-24.5 20.5zm76.6-186.9l-31 9.3c6.3 5.8 10.5 14.1 10.5 23.4 0 17.7-14.3 32-32 32s-32-14.3-32-32c0-2.9.9-5.6 1.7-8.2-.6.1-1.1.2-1.7.2-6.9 0-13.2-4.5-15.3-11.4-2.5-8.5 2.3-17.4 10.7-19.9l80-24c8.4-2.5 17.4 2.3 19.9 10.7 2.5 8.5-2.3 17.4-10.8 19.9z"></path></svg></span>',� 1426 like_svg = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M496.656 285.683C506.583 272.809 512 256 512 235.468c-.001-37.674-32.073-72.571-72.727-72.571h-70.15c8.72-17.368 20.695-38.911 20.695-69.817C389.819 34.672 366.518 0 306.91 0c-29.995 0-41.126 37.918-46.829 67.228-3.407 17.511-6.626 34.052-16.525 43.951C219.986 134.75 184
1426192 162.382 203.625c-2.189.922-4.986 1.648-8.032 2.223C148.577 197.484 138.931 192 128 192H32c-17.673 0-32 14.327-32 32v256c0 17.673 14.327 32 32 32h96c17.673 0 32-14.327 32-32v-8.74c32.495 0 100.687 40.747 177.455 40.726 5.505.003 37.65.03 41.013 0 59.282.014 92.255-35.887 90.335-89.793 15.127-17.727 22.539-43.337 18.225-67.105 12.456-19.526 15.126-47.07 9.628-69.405zM32 480V224h96v256H32zm424.017-203.648C472 288 472 336 450.41 347.017c13.522 22.76 1.352 53.216-15.015 61.996 8.293 52.54-18.961 70.606-57.212 70.974-3.312.03-37.247 0-40.727 0-72.929 0-134.742-40.727-177.455-40.727V235.625c37.708 0 72.305-67.939 106.183-101.818 30.545-30.545 20.363-81.454 40.727-101.817 50.909 0 50.909 35.517 50.909 61.091 0 42.189-30.545 61.09-30.545 101.817h111.999c22.73 0 40.627 20.364 40.727 40.727.099 20.363-8.001 36.375-23.984 40.727zM104 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"></path></svg>'+'<svg class="cff-svg-bg" role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M104 224H24c-13.255 0-24 10.745-24 24v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V248c0-13.255-10.745-24-24-24zM64 472c-13.255 0-24-10.745-24-24s10.745-24 24-24 24 10.745 24 24-10.745 24-24 24zM384 81.452c0 42.416-25.97 66.208-33.277 94.548h101.723c33.397 0 59.397 27.746 59.553 58.098.084 17.938-7.546 37.249-19.439 49.197l-.11.11c9.836 23.337 8.237 56.037-9.308 79.469 8.681 25.895-.069 57.704-16.382 74.757 4.298 17.598 2.244 32.575-6.148 44.632C440.202 511.587 389.616 512 346.839 512l-2.845-.001c-48.287-.017-87.806-17.598-119.56-31.725-15.957-7.099-36.821-15.887-52.651-16.178-6.54-.12-11.783-5.457-11.783-11.998v-213.77c0-3.2 1.282-6.271 3.558-8.521 39.614-39.144 56.648-80.587 89.117-113.111 14.804-14.832 20.188-37.236 25.393-58.902C282.515 39.293 291.817 0 312 0c24 0 72 8 72 81.452z"></path></svg>',� 1427 like_svg_2 = '<svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M466.27 286.69C475.04 271.84 480 256 480 236.85c0-44.015-37.218-85.58-85.82-85.58H357.7c4.92-12.81 8.85-28.13 8.85-46.54C366.55 31.936 328.86 0 271.28 0c-61.607 0-58.093 94.933-71.76 108.6-22.747 22.747-49.615 66.447-68.76 83.4H32c-17.673 0-32 14.327-32 32v240c0 17.673 14.327 32 32 32h64c14.893 0 27.408-10.174 30.978-23.95 44.509 1.001 75.06 39.94 177.802 39.94 7.22 0 15.22.01 22.22.01 77.117 0 111.986-39.423 112.94-95.33 13.319-18.425 20.299-43.122 17.34-66.99 9.854-18.452 13.664-40.343 8.99-62.99zm-61.75 53.83c12.56 21.13 1.26 49.41-13.94 57.57 7.7 48.78-17.608 65.9-53.12 65.9h-37.82c-71.639 0-118.029-37.82-171.64-37.82V240h10.92c28.36 0 67.98-70.89 94.54-97.46 28.36-28.36 18.91-75.63 37.82-94.54 47.27 0 47.27 32.98 47.27 56.73 0 39.17-28.36 56.72-28.36 94.54h103.99c21.11 0 37.73 18.91 37.82 37.82.09 18.9-12.82 37.81-22.27 37.81 13.489 14.555 16.371 45.236-5.21 65.62zM88 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"></path></svg>';� 1428� 1429� 1430 //Add first reaction� 1431 var reaction_one_html = '';� 1432 if( reaction_first_num > 0 ){� 1433 if(data.love.summary.total_count == reaction_first_num){� 1434 reaction_one_html += '<span class="cff-love cff-reaction-one cff-icon">'+love_svg+'</span>';� 1435 love_added = true;� 1436 }� 1437 if(data.haha.summary.total_count == reaction_first_num){� 1438 reaction_one_html += '<span class="cff-haha cff-reaction-one cff-icon">'+haha_svg+'</span>';� 1439 haha_added = true;� 1440 }� 1441 if(data.wow.summary.total_count == reaction_first_num){� 1442 reaction_one_html += '<span class="cff-wow cff-reaction-one cff-icon">'+wow_svg+'</span>';� 1443 wow_added = true;� 1444 }� 1445 if(data.sad.summary.total_count == reaction_first_num){� 1446 reaction_one_html += '<span class="cff-sad cff-reaction-one cff-icon">'+sad_svg+'</span>';� 1447 sad_added = true;� 1448 }� 1449 if(data.angry.summary.total_count == reaction_first_num){� 1450 reaction_one_html += '<span class="cff-angry cff-reaction-one cff-icon">'+angry_svg+'</span>';� 1451 angry_added = true;� 1452 }� 1453 reactions_html += reaction_one_html;� 1454 }� 1455� 1456 //If reaction one doesn't already contain two reactions (eg: if the two reaction_one
1456s are the same number) then don't include a reaction_two� 1457 if( reaction_one_html.split('cff-reaction-one').length < 3 ){� 1458 //Add second reaction� 1459 if( reaction_second_num > 0 ){� 1460 var reaction_two_html = '';� 1461� 1462 if(data.love.summary.total_count == reaction_second_num && !love_added){� 1463 reaction_two_html = '<span class="cff-love cff-reaction-two cff-icon">'+love_svg+'</span>';� 1464 }� 1465 if(data.haha.summary.total_count == reaction_second_num && !haha_added){� 1466 reaction_two_html = '<span class="cff-haha cff-reaction-two cff-icon">'+haha_svg+'</span>';� 1467 }� 1468 if(data.wow.summary.total_count == reaction_second_num && !wow_added){� 1469 reaction_two_html = '<span class="cff-wow cff-reaction-two cff-icon">'+wow_svg+'</span>';� 1470 }� 1471 if(data.sad.summary.total_count == reaction_second_num && !sad_added){� 1472 reaction_two_html = '<span class="cff-sad cff-reaction-two cff-icon">'+sad_svg+'</span>';� 1473 }� 1474 if(data.angry.summary.total_count == reaction_second_num && !angry_added){� 1475 reaction_two_html = '<span class="cff-angry cff-reaction-two cff-icon">'+angry_svg+'</span>';� 1476 }� 1477 reactions_html += reaction_two_html;� 1478 }� 1479 }� 1480� 1481 //Add the reaction icons� 1482 if( $self.find('.cff-meta .cff-likes').find('.cff-icon').length < 2 ) $self.find('.cff-meta .cff-likes .cff-icon').after( reactions_html );� 1483� 1484 //If there's no likes but there's a reacton then don't show the like icon - show the reaction icon instead� 1485 if( parseInt(like_count) == 0 && ( parseInt(cff_love_count) > 0 || parseInt(cff_haha_count) > 0 || parseInt(cff_wow_count) > 0 || parseInt(cff_sad_count) > 0 || parseInt(cff_angry_count) > 0 ) ){� 1486 $self.find('.cff-meta .cff-likes .cff-like').remove();� 1487 $self.find('.cff-meta .cff-likes span').addClass('cff-no-animate');� 1488 }� 1489� 1490 //Add reactions to like count� 1491 var cff_reactions_count = parseInt(like_count) + parseInt(cff_love_count) + parseInt(cff_haha_count) + parseInt(cff_wow_count) + parseInt(cff_sad_count) + parseInt(cff_angry_count);� 1492 if( cff_reactions_count > 0 ) $self.find('.cff-meta .cff-likes .cff-count').text( cff_reactions_count );� 1493� 1494� 1495 //ADDS REACTIONS TO COMMENTS BOX� 1496 var cff_no_reactions = false;� 1497 if( cff_love_count == 0 && cff_haha_count == 0 && cff_wow_count == 0 && cff_sad_count == 0 && cff_angry_count == 0 ) cff_no_reactions = true;� 1498� 1499 var reactions_count_html = '<span class="cff-reactions-count">';� 1500� 1501 if( parseInt(like_count) > 0){� 1502 reactions_count_html += '<span class="cff-like cff-icon">'+like_svg+'</span>';� 1503� 1504 if( !cff_no_reactions ){� 1505 if( parseInt(like_count) > 0 ) reactions_count_html += '<span class="cff-like-count">
1505'+like_count+'</span>';� 1506 if( cff_love_count > 0 ) reactions_count_html += '<span class="cff-reaction-wrap"><span class="cff-love cff-icon">'+love_svg+'</span><span class="cff-love-count">'+cff_love_count+'</span></span>';� 1507 if( cff_haha_count > 0 ) reactions_count_html += '<span class="cff-reaction-wrap"><span class="cff-haha cff-icon">'+haha_svg+'</span><span class="cff-haha-count">'+cff_haha_count+'</span></span>';� 1508 if( cff_wow_count > 0 ) reactions_count_html += '<span class="cff-reaction-wrap"><span class="cff-wow cff-icon">'+wow_svg+'</span><span class="cff-wow-count">'+cff_wow_count+'</span></span>';� 1509 if( cff_sad_count > 0 ) reactions_count_html += '<span class="cff-reaction-wrap"><span class="cff-sad cff-icon">'+sad_svg+'</span><span class="cff-sad-count">'+cff_sad_count+'</span></span>';� 1510 if( cff_angry_count > 0 ) reactions_count_html += '<span class="cff-reaction-wrap"><span class="cff-angry cff-icon">'+angry_svg+'</span><span class="cff-angry-count">'+cff_angry_count+'</span></span>';� 1511 }� 1512 }� 1513 reactions_count_html += '</span>';� 1514� 1515 //CREATE LIKES PART AT TOP OF COMMENTS BOX� 1516 if( typeof data.likes !== 'undefined' ){� 1517 if( data.likes.data.length ){� 1518� 1519 cff_likes_this += '<span class="cff-likes-this-text">';� 1520� 1521 var liker_one = '',� 1522 liker_two = '';� 1523� 1524 if ( like_count > 0 && typeof data.likes.data[0] !== 'undefined' ){� 1525� 1526 //Only link the name if a legit link is available for this user� 1527 var userHasLink = false;� 1528 if( typeof data.likes.data[0].link !== 'undefined' ){� 1529 if( data.likes.data[0].link.indexOf('/app_scoped_user_id/') == -1 ) userHasLink = true;� 1530 }� 1531� 1532 //Creat link or span� 1533 userHasLink ? liker_one += '<a href="'+data.likes.data[0].link+'" target="_blank" class="cff-liker-one-name" style="color:'+cff_meta_link_color+';' : liker_one = '<span class="cff-liker-one-name" style="';� 1534 if (cff_no_reactions) liker_one += ' margin-left: 5px';� 1535 liker_one += '">'+data.likes.data[0].name;� 1536� 1537 userHasLink ? liker_one += '</a>' : liker_one += '</span>';� 1538 }� 1539� 1540 if ( like_count > 1 && typeof data.likes.data[1] !== 'undefined' ){� 1541� 1542 //Only link the name if a legit link is available for this user� 1543 var userHasLink = false;� 1544 if( typeof data.likes.data[1].link !== 'undefined' ){� 1545 if( data.likes.data[1].link.indexOf('/app_scoped_user_id/') == -1 ) userHasLink = true;� 1546 }� 1547� 1548 //Creat link or span� 1549 userHasLink ? liker_two += '<a href="'+data.likes.data[1].link+'" target="_blank" style="color:'+cff_meta_link_color+'">;' : liker_two = '<span>';� 1550 liker_two += data.likes.data[1].name;� 1551� 1552 userHasLink ? liker_two += '</a>' : liker_two += '</span>';� 1553 }� 1554� 1555 if (like_count == 1){� 1556 cff_likes_this += liker_one+' '+cff_translate_likes_this_text;� 1557 } else if (like_count == 2){� 1558 cff_likes_this += liker_one+' '+cff_translate_and_text+' '+liker_two+' '+cff_translate_like_this_text;� 1559 } else if (like_count == 3){� 1560 cff_likes_this += liker_one+', '+liker_two+' '+cff_translate_and_text+' 1 '+cff_translate_other_text+' '+cff_translate_like_this_text;� 1561 } else {� 1562 cff_likes_this += liker_one+', '+liker_two+' '+cff_translate_and_text+' ';� 1563 if (like_count == 25) cff_likes_this += '<span class="cff-comment-likes-count">';� 1564 cff_likes_this += parseInt(cff_reactions_count)-2;� 1565 if (like_count == 25) cff_likes_this += '</span>';� 1566 cff_likes_this += ' '+cff_translate_others_text;� 1567� 1568 if( parseInt(cff_reactions_count) == parseInt(like_count) ){� 1569 cff_likes_this += ' '+cff_translate_like_this_text;� 1570 } else {� 1571 cff_likes_this += ' '+cff_translate_reacted_to_this_text;� 1572 }� 1573� 1574 }� 1575� 1576 cff_likes_this += '</span>';� 1577� 1578 if( $cffCommentLikes.find('.cff-reactions-count').length < 1 ) $cffCommentLikes.append(reactions_count_html + cff_likes_this);� 1579� 1580 } else {� 1581 //If there's no likes data then hide the top of the comments box that shows the "likes this" section� 1582 if( cff_no_reactions ){� 1583 $cffCommentLikes.hide();� 1584 } else {� 1585 if( $cffCommentLikes.find('.cff-reactions-count').length < 1 ) $cffCommentLikes.append(reactions_count_html);� 1586 }� 1587 }� 1588� 1589 }� 1590 � 1591� 1592 if( typeof data.comments !== 'undefined' ){� 1593 $.each(data.comments.data, function(i, commentItem) {� 1594� 1595 //Do a final encode of the comment message� 1596 var comment_message = cffEncodeHTML(commentItem.message),� 1597 comment_message = cffLinkify(comment_message),� 1598 cff_comment_author_info = true;� 1599� 1600 //Check whether comment author info exists - only accessible with page access token from the page now� 1601 if( typeof commentItem.from !== 'undefined' ){� 1602 cff_comment_from_id = commentItem.from.id;� 1603 } else {� 1604 cff_hide_comment_avatars = true;� 1605 cff_comment_author_info = false;� 1606 cff_comment_from_id = '';� 1607 }� 1608� 1609 cff_comments += '<div class="cff-comment" id="cff_'+commentItem.id+'" data-id="'+cff_comment_from_id+'"';� 1610 cff_comments += ' style="';� 1611 ( i >= commentShow ) ? cff_comments += 'display: none;' : cff_comments += 'display: block;';� 1612 if( typeof $self.find('#cff_'+commentItem.id).attr('style') !== 'undefined' ) cff_comments += $self.find('#cff_'+commentItem.id).attr('style');� 1613 cff_comments += '"';� 1614 if( typeof commentItem.from !== 'undefined' ){� 1615 if( typeof commentItem.from.picture !== 'undefined' ){� 1616 cff_comments += 'data-avatar="'+commentItem.from.picture.data.url+'"';� 1617 }� 1618 }� 1619 cff_comments += '>';� 1620 cff_comments += '<div class="cff-comment-text-wrapper">';� 1621 cff_comments += '<div class="cff-comment-text';� 1622 if( cff_hide_comment_avatars ) cff_comments += ' cff-no-image';� 1623 cff_comments += '"><p>';� 1624 if( cff_comment_author_info ){� 1625 if( typeof commentItem.from.link !== 'undefined' ){� 1626 cff_comments += '<a href="'+commentItem.from.link+'" class="cff-name" target="_blank" style="color:' + cff_meta_link_color + '">
1626'+commentItem.from.name+'</a>';� 1627 } else {� 1628 cff_comments += '<span class="cff-name">'+commentItem.from.name+'</span>';� 1629 }� 1630 }� 1631� 1632 //MESSAGE TAGS� 1633 if( cff_post_tags && commentItem.hasOwnProperty('message_tags') ){� 1634� 1635 //Loop through the tags and use the name to replace them� 1636 $.each(commentItem.message_tags, function(i, message_tag) {� 1637 tag_name = message_tag.name;� 1638 tag_link = '<a href="http://facebook.com/'+message_tag.id+'" target="_blank" style="color:'+cff_meta_link_color+'">'+message_tag.name+'</a>';� 1639� 1640 comment_message = comment_message.replace(tag_name, tag_link);� 1641 });� 1642� 1643 } //END MESSAGE TAGS� 1644� 1645 cff_comments += comment_message+'</p>';� 1646� 1647� 1648 //Add image attachment if exists� 1649 if( commentItem.hasOwnProperty('attachment') ){� 1650 if( commentItem.attachment.hasOwnProperty('media') ){� 1651 cff_comments += '<a class="cff-comment-attachment" href="https://facebook.com/'+commentItem.id+'" target="_blank"><img src="'+commentItem.attachment.media.image.src+'" alt="';� 1652 if( commentItem.attachment.hasOwnProperty('title') ){� 1653 cff_comments += commentItem.attachment.title;� 1654 } else {� 1655 cff_comments += 'Attachment';� 1656 }� 1657 cff_comments += '" /></a>';� 1658 }� 1659 }� 1660� 1661 cff_comments += '<span class="cff-time">';� 1662 var cff_middot = '',� 1663 cff_comment_time = $self.find('#cff_'+commentItem.id).attr('data-cff-comment-date');� 1664 //If the time is undefined then don't show it� 1665 if( typeof cff_comment_time !== 'undefined' ){� 1666 cff_comments += '<span class="cff-comment-date">'+cff_comment_time+'</span>';� 1667 cff_middot = ' · ';� 1668 }� 1669 if ( commentItem.like_count > 0 ) cff_comments += '<span class="cff-comment-likes"><span class="cff-comment-likes-bg"><b>'+like_svg_2+'</b>
1669'+commentItem.like_count+'</span></span>';� 1670 cff_comments += '</span>';� 1671� 1672 //Comment replies� 1673 var cff_comment_count = parseInt(commentItem.comment_count);� 1674 if( cff_comment_count > 0 ){� 1675 //Get this from a data attr on the comments box container� 1676 var cff_replies_text_string = '';� 1677 (cff_comment_count == 1) ? cff_replies_text_string = cff_translate_reply_text : cff_replies_text_string = cff_translate_replies_text;� 1678 cff_comments += '<p class="cff-comment-replies" data-id="'+commentItem.id+'"><a class="cff-comment-replies-a" href="javascript:void(0);" style="color:' + cff_meta_link_color + '"><span class="cff-replies-icon"></span>'+cff_comment_count+' '+cff_replies_text_string+'</a></p><div class="cff-comment-replies-box cff-empty"></div>';� 1679 }� 1680� 1681 cff_comments += '</div>'; //End .cff-comment-text� 1682 cff_comments += '</div>'; //End .cff-comment-text-wrapper� 1683� 1684 //Only load the comment avatars if they're being displayed initially, otherwise load via JS on click to save all the HTTP requests on page load� 1685 if( !cff_hide_comment_avatars && cff_comment_author_info ){� 1686 cff_comments += '<div class="cff-comment-img cff-avatar-fallback">';� 1687 if( typeof commentItem.from.link !== 'undefined' ) cff_comments += '<a href="https://facebook.com/'+commentItem.from.link+'" target="_blank">';� 1688 if( cff_expand_comments && (i < commentShow) ) {� 1689 cff_comments += '<img src="'+commentItem.from.picture.data.url+'" width=32 height=32 alt="'+commentItem.from.name+'" onerror="this.style.display=\'none\'">';� 1690 } else {� 1691 cff_comments += '<span class="cff-comment-avatar"></span>';� 1692 }� 1693 if( typeof commentItem.from.link !== 'undefined' ) cff_comments += '</a>';� 1694 cff_comments += '</div>';� 1695 }� 1696� 1697 cff_comments += '</div>'; //End .cff-comment� 1698� 1699 }); //End data.comments.data loop� 1700� 1701 } //End if� 1702� 1703 //Remove the comments added for SEO in PHP� 1704 $self.find('.cff-comments-wrap .cff-comment').remove();� 1705 //Add the comments to the page� 1706 $self.find('.cff-comments-wrap').prepend( cff_comments );� 1707 $self.find('.cff-show-more-comments').attr('data-cff-comments-total', cff_total_comments_count);� 1708� 1709 //Add border radius� 1710 if( $self.find('.cff-comment-likes span').length > 0 ) $self.find('.cff-comment-on-facebook').css({'border-top-left-radius':0,'border-top-right-radius':0});� 1711 if( $self.find('.cff-comments-wrap .cff-comment').length > 0 ) $self.find('.cff-comment-on-facebook').css({'border-bottom-left-radius':0,'border-bottom-right-radius':0});� 1712 //Add a little more padding if there's no comments� 1713 if( $self.find('.cff-comments-wrap .cff-comment').length < 1 ) $self.find('.cff-comment-on-facebook').css('padding','8px 15px 8px 10px');� 1714� 1715 setTimeout(function(){� 1716 if( $self.closest('.cff').hasClass('cff-masonry-js') && !$self.closest('.cff').hasClass('cff-masonry-css') ) cffAddMasonry( $self.closest('.cff') );� 1717 }, 200);� 1718� 1719 } //End cffCreateComments()� 1720� 1721� 1722 //Create shared link multi-image slider� 1723 setTimeout(function(){� 1724 var $cffLinkSliderSlides = $('.cff-link-slider .cff-link-slider-slides'),� 1725 $cffLinkSliderItem = $cffLinkSliderSlides.find('.cff-link-slider-item'),� 1726 cffLinkSliderCount = $cffLinkSliderItem.length,� 1727 cffLinkSliderWidth = $('.cff-link-slider').width(),� 1728 cffCurSlide = 0;� 1729 $cffLinkSliderSlides.css({ width: cffLinkSliderWidth * cffLinkSliderCount });� 1730 $cffLinkSliderItem.css({ width: cffLinkSliderWidth });� 1731� 1732 function cffMoveSlide(dir) {� 1733 //Change slides� 1734 dir == 'prev' ? cffCurSlide-- : cffCurSlide++;� 1735 $cffLinkSliderSlides.css('left', -cffCurSlide*cffLinkSliderWidth);� 1736� 1737 //Hide the nav arrows at beginning/end� 1738 cffCurSlide == cffLinkSliderCount-1 ? $('a.cff-slider-next').hide() : $('a.cff-slider-next').show();� 1739 cffCurSlide > 0 ? $('a.cff-slider-prev').show() : $('a.cff-slider-prev').hide();� 1740 };� 1741 //Nav arrows click� 1742 $('a.cff-slider-prev, a.cff-slider-next').click(function(e){� 1743 e.preventDefault();� 1744 $(this).hasClass('cff-slider-prev') ? cffMoveSlide('prev') : cffMoveSlide('next');� 1745 });� 1746 //Vertically center last image in slider� 1747 setTimeout(function(){� 1748 var cffLastSlideHeight = $cffLinkSliderSlides.find('.cff-link-slider-item').first().height();� 1749 $cffLinkSliderSlides.find('.cff-final-item').css('height', cffLastSlideHeight).find('img').css('margin-top', (cffLastSlideHeight/2)-100 );� 1750 }, 1000);� 1751 }, 10);� 1752� 1753� 1754 })(jQuery); //End (function($){ � 1755� 1756� 1757� 1758� 1759 /*!� 1760 imgLiquid v0.9.944 / 03-05-2013� 1761 https://github.com/karacas/imgLiquid� 1762 */� 1763� 1764 var imgLiquid = imgLiquid || {VER: '0.9.944'};� 1765 imgLiquid.bgs_Available = false;� 1766 imgLiquid.bgs_CheckRunned = false;� 1767 //Add the CSS using CSS as then it's only used when the JS file runs, otherwise with Ajax themes it's hiding the images but then the JS isn't running. This way still allows the images to display even if the JS doesn't run.� 1768 jQuery('.cff-new .cff-album-cover img, .cff-new .cff-crop img').css('visibility', 'hidden');� 1769 jQuery('#cff .cff-img-attachments .cff-crop img').css('opacity', 0);� 1770� 1771� 1772 (function ($) {� 1773� 1774 // ___________________________________________________________________� 1775� 1776 function checkBgsIsavailable() {� 1777 if (imgLiquid.bgs_CheckRunned) return;� 1778 else imgLiquid.bgs_CheckRunned = true;� 1779� 1780 var spanBgs = $('<span style="background-size:cover" />');� 1781 $('body').append(spanBgs);� 1782� 1783 !function () {� 1784 var bgs_Check = spanBgs[0];� 1785 if (!bgs_Check || !window.getComputedStyle) return;� 1786 var compStyle = window.getComputedStyle(bgs_Check, null);� 1787 if (!compStyle || !compStyle.backgroundSize) return;� 1788 imgLiquid.bgs_Available = (compStyle.backgroundSize === 'cover');� 1789 }();� 1790� 1791 spanBgs.remove();� 1792 }� 1793� 1794� 1795 // ___________________________________________________________________� 1796� 1797 $.fn.extend({� 1798 imgLiquid: function (options) {� 1799� 1800 this.defaults = {� 1801 fill: true,� 1802 verticalAlign: 'center', // 'top' // 'bottom' // '50%' // '10%'� 1803 horizontalAlign: 'center', // 'left' // 'right' // '50%' // '10%'�
1804 useBackgroundSize: false,� 1805 useDataHtmlAttr: true,� 1806� 1807 responsive: true, /* Only for use with BackgroundSize false (or old browsers) */� 1808 delay: false, /* Only for use with BackgroundSize false (or old browsers) */� 1809 fadeInTime: false, /* Only for use with BackgroundSize false (or old browsers) */� 1810 removeBoxBackground: true, /* Only for use with BackgroundSize false (or old browsers) */� 1811 hardPixels: true, /* Only for use with BackgroundSize false (or old browsers) */� 1812 responsiveCheckTime: 500, /* Only for use with BackgroundSize false (or old browsers) */ /* time to check div resize */� 1813 timecheckvisibility: 500, /* Only for use with BackgroundSize false (or old browsers) */ /* time to recheck if visible/loaded */� 1814� 1815 // CALLBACKS� 1816 onStart: null, // no-params� 1817 onFinish: null, // no-params� 1818 onItemStart: null, // params: (index, container, img )� 1819 onItemFinish: function(index, container, img){ // params: (index, container, img )� 1820 img.addClass('cffFadeIn');� 1821 }, � 1822 onItemError: null // params: (index, container, img )� 1823 };� 1824� 1825 checkBgsIsavailable();� 1826 var imgLiquidRoot = this;� 1827� 1828 // Extend global settings� 1829 this.options = options;� 1830 this.settings = $.extend({}, this.defaults, this.options);� 1831� 1832 // CallBack� 1833 if (this.settings.onStart) this.settings.onStart();� 1834� 1835� 1836 // ___________________________________________________________________� 1837� 1838 return this.each(function ($i) {� 1839� 1840 // MAIN >> each for image� 1841� 1842 var settings = imgLiquidRoot.settings,� 1843 $imgBoxCont = $(this),� 1844 $img = $('img:first',$imgBoxCont);� 1845 if (!$img.length) {onError(); return;}� 1846� 1847� 1848 // Extend settings� 1849 if (!$img.data('imgLiquid_settings')) {� 1850 // First time� 1851 settings = $.extend({}, imgLiquidRoot.settings, getSettingsOverwrite());� 1852 } else {� 1853 // Recall� 1854 // Remove Classes� 1855 $imgBoxCont.removeClass('imgLiquid_error').removeClass('imgLiquid_ready');� 1856 settings = $.extend({}, $img.data('imgLiquid_settings'), imgLiquidRoot.options);� 1857 }� 1858 $img.data('imgLiquid_settings', settings);� 1859� 1860� 1861 // Start CallBack� 1862 if (settings.onItemStart) settings.onItemStart($i, $imgBoxCont, $img); /* << CallBack */� 1863� 1864� 1865 // Process� 1866 if (imgLiquid.bgs_Available && settings.useBackgroundSize)� 1867 processBgSize();� 1868 else� 1869 processOldMethod();� 1870� 1871� 1872 // END MAIN <<� 1873� 1874 // ___________________________________________________________________� 1875� 1876 function processBgSize() {� 1877� 1878 // Check change img src� 1879 if ($imgBoxCont.css('background-image').indexOf(encodeURI($img.attr('src'))) === -1) {� 1880 // Change� 1881 $imgBoxCont.css({'background-image': 'url("' + encodeURI($img.attr('src')) + '")'});� 1882 }� 1883� 1884 $imgBoxCont.css({� 1885 'background-size': (settings.fill) ? 'cover' : 'contain',� 1886 'background-position': (settings.horizontalAlign + ' ' + settings.verticalAlign).toLowerCase(),� 1887 'background-repeat': 'no-repeat'� 1888 });� 1889� 1890 $('a:first', $imgBoxCont).css({� 1891 'display': 'block',� 1892 'width': '100%',� 1893 'height': '100%'� 1894 });� 1895� 1896 $('img', $imgBoxCont).css({'display': 'none'});� 1897� 1898 if (settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img); /* << CallBack */� 1899� 1900 $imgBoxCont.addClass('imgLiquid_bgSize');� 1901 $imgBoxCont.addClass('imgLiquid_ready');� 1902 checkFinish();� 1903 }� 1904� 1905 // ___________________________________________________________________� 1906� 1907 function processOldMethod() {� 1908� 1909 // Check change img src� 1910 if ($img.data('oldSrc') && $img.data('oldSrc') !== $img.attr('src')) {� 1911� 1912 /* Clone & Reset img */� 1913 var $imgCopy = $img.clone().removeAttr('style');� 1914 $imgCopy.data('imgLiquid_settings', $img.data('imgLiquid_settings'));� 1915 $img.parent().prepend($imgCopy);� 1916 $img.remove();� 1917 $img = $imgCopy;� 1918 $img[0].width = 0;� 1919� 1920 // Bug ie with > if (!$img[0].complete && $img[0].width) onError();� 1921 setTimeout(processOldMethod, 10);� 1922 return;� 1923 }� 1924� 1925� 1926 // Reproceess?� 1927 if ($img.data('imgLiquid_oldProcessed')) {� 1928 makeOldProcess(); return;� 1929 }� 1930� 1931� 1932 // Set data� 1933 $img.data('imgLiquid_oldProcessed', false);� 1934 $img.data('oldSrc', $img.attr('src'));� 1935� 1936� 1937 // Hide others images� 1938 $('img:not(:first)', $imgBoxCont).css('display', 'none');� 1939� 1940� 1941 // CSSs� 1942 $imgBoxCont.css({'overflow': 'hidden'});� 1943 $img.fadeTo(0, 0).removeAttr('width').removeAttr('height').css({� 1944 'visibility': 'visible',� 1945 'max-width': 'none',� 1946 'max-height': 'none',� 1947 'width': 'auto',� 1948 'height': 'auto',� 1949 'display': 'block'� 1950 });� 1951� 1952� 1953 // CheckErrors� 1954 $img.on('error', onError);� 1955 $img[0].onerror = onError;� 1956� 1957� 1958 // loop until load� 1959 function onLoad() {� 1960 if ($img.data('imgLiquid_error') || $img.data('imgLiquid_loaded') || $img.data('imgLiquid_oldProcessed')) return;� 1961 if ($imgBoxCont.is(':visible') && $img[0].complete && $img[0].width > 0 && $img[0].height > 0) {� 1962 $img.data('imgLiquid_loaded', true);� 1963 setTimeout(makeOldProcess, $i * settings.delay);� 1964 } else {� 1965 setTimeout(onLoad, settings.timecheckvisibility);� 1966 }� 1967 }� 1968� 1969� 1970 onLoad();� 1971 checkResponsive();� 1972 }� 1973� 1974 // ___________________________________________________________________� 1975� 1976 function checkResponsive() {� 1977� 1978 /* Only for oldProcessed method (background-size dont need) */� 1979� 1980 if (!settings.responsive && !$img.data('imgLiquid_oldProcessed')) return;� 1981 if (!$img.data('imgLiquid_settings')) return;� 1982� 1983 settings = $img.data('imgLiquid_settings');� 1984� 1985 $imgBoxCont.actualSize = $imgBoxCont.get(0).offsetWidth + ($imgBoxCont.get(0).offsetHeight / 10000);� 1986 if ($imgBoxCont.sizeOld && $imgBoxCont.actualSize !== $imgBoxCont.sizeOld) makeOldProcess();� 1987� 1988 $imgBoxCont.sizeOld = $imgBoxCont.actualSize;� 1989 setTimeout(checkResponsive, settings.responsiveCheckTime);� 1990 }� 1991� 1992 // ___________________________________________________________________� 1993� 1994 function onError() {� 1995 $img.data('imgLiquid_error', true);� 1996 $imgBoxCont.addClass('imgLiquid_error');� 1997 if (settings.onItemError) settings.onItemError($i, $imgBoxCont, $img); /* << CallBack */� 1998 checkFinish();� 1999 }� 2000� 2001 // ___________________________________________________________________� 2002� 2003 function getSettingsOverwrite() {� 2004 var SettingsOverwrite = {};� 2005� 2006 if (imgLiquidRoot.settings.useDataHtmlAttr) {� 2007 var dif = $imgBoxCont.attr('data-imgLiquid-fill'),� 2008 ha = $imgBoxCont.attr('data-imgLiquid-horizontalAlign'),� 2009 va = $imgBoxCont.attr('data-imgLiquid-verticalAlign');� 2010� 2011 if (dif === 'true' || dif === 'false') SettingsOverwrite.fill = Boolean (dif === 'true');� 2012 if (ha !== undefined && (ha === 'left' || ha === 'center' || ha === 'right' || ha.indexOf('%') !== -1)) SettingsOverwrite.horizontalAlign = ha;� 2013 if (va !== undefined && (va === 'top' || va === 'bottom' || va === 'center' || va.indexOf('%') !== -1)) SettingsOverwrite.verticalAlign = va;� 2014 }� 2015� 2016 if (imgLiquid.isIE && imgLiquidRoot.settings.ieFadeInDisabled) SettingsOverwrite.fadeInTime = 0; //ie no anims� 2017 return SettingsOverwrite;� 2018 }� 2019� 2020 // ___________________________________________________________________� 2021� 2022 function makeOldProcess() { /* Only for old browsers, or useBackgroun
2022dSize seted false */� 2023� 2024 // Calculate size� 2025 var w, h, wn, hn, ha, va, hdif, vdif,� 2026 margT = 0,� 2027 margL = 0,� 2028 $imgCW = $imgBoxCont.width(),� 2029 $imgCH = $imgBoxCont.height();� 2030� 2031� 2032 // Save original sizes� 2033 if ($img.data('owidth') === undefined) $img.data('owidth', $img[0].width);� 2034 if ($img.data('oheight') === undefined) $img.data('oheight', $img[0].height);� 2035� 2036� 2037 // Compare ratio� 2038 if (settings.fill === ($imgCW / $imgCH) >= ($img.data('owidth') / $img.data('oheight'))) {� 2039 w = '100%';� 2040 h = 'auto';� 2041 wn = Math.floor($imgCW);� 2042 hn = Math.floor($imgCW * ($img.data('oheight') / $img.data('owidth')));� 2043 } else {� 2044 w = 'auto';� 2045 h = '100%';� 2046 wn = Math.floor($imgCH * ($img.data('owidth') / $img.data('oheight')));� 2047 hn = Math.floor($imgCH);� 2048 }� 2049� 2050 // Align X� 2051 ha = settings.horizontalAlign.toLowerCase();� 2052 hdif = $imgCW - wn;� 2053 if (ha === 'left') margL = 0;� 2054 if (ha === 'center') margL = hdif * 0.5;� 2055 if (ha === 'right') margL = hdif;� 2056 if (ha.indexOf('%') !== -1){� 2057 ha = parseInt (ha.replace('%',''), 10);� 2058 if (ha > 0) margL = hdif * ha * 0.01;� 2059 }� 2060� 2061� 2062 // Align Y� 2063 va = settings.verticalAlign.toLowerCase();� 2064 vdif = $imgCH - hn;� 2065 if (va === 'left') margT = 0;� 2066 if (va === 'center') margT = vdif * 0.5;� 2067 if (va === 'bottom') margT = vdif;� 2068 if (va.indexOf('%') !== -1){� 2069 va = parseInt (va.replace('%',''), 10);� 2070 if (va > 0) margT = vdif * va * 0.01;� 2071 }� 2072� 2073� 2074 // Add Css� 2075 if (settings.hardPixels) {w = wn; h = hn;}� 2076 $img.css({� 2077 'width': w,� 2078 'height': h,� 2079 'margin-left': Math.floor(margL),� 2080 'margin-top': Math.floor(margT)� 2081 });� 2082� 2083� 2084 // FadeIn > Only first time� 2085 if (!$img.data('imgLiquid_oldProcessed')) {� 2086 $img.fadeTo(settings.fadeInTime, 1);� 2087 $img.data('imgLiquid_oldProcessed', true);� 2088 if (settings.removeBoxBackground) $imgBoxCont.css('background-image', 'none');� 2089 $imgBoxCont.addClass('imgLiquid_nobgSize');� 2090 $imgBoxCont.addClass('imgLiquid_ready');� 2091 }� 2092� 2093� 2094 if (settings.onItemFinish) settings.onItemFinish($i, $imgBoxCont, $img); /* << CallBack */� 2095 checkFinish();� 2096 }� 2097� 2098 // ___________________________________________________________________� 2099� 2100 function checkFinish() { /* Check callBack */�
2101 if ($i === imgLiquidRoot.length - 1) if (imgLiquidRoot.settings.onFinish) imgLiquidRoot.settings.onFinish();� 2102 }� 2103� 2104� 2105 });� 2106 } //End imgLiquid: function� 2107 }); //End $.fn.extend� 2108� 2109 })(jQuery);� 2110� 2111� 2112 //If a video is wrapped in this element then remove it as it causes an issue with some themes� 2113 setTimeout(function(){� 2114 jQuery('#cff .embed-responsive video, #cff .embed-responsive iframe').unwrap();� 2115 }, 500);� 2116� 2117� 2118 // Inject css styles ______________________________________________________� 2119 !function () {� 2120 var css = imgLiquid.injectCss,� 2121 head = document.getElementsByTagName('head')[0],� 2122 style = document.createElement('style');� 2123 style.type = 'text/css';� 2124 if (style.styleSheet) {� 2125 style.styleSheet.cssText = css;� 2126 } else {� 2127 style.appendChild(document.createTextNode(css));� 2128 }� 2129 head.appendChild(style);� 2130 }();� 2131 jQuery(".cff-new .cff-album-cover").imgLiquid({fill:true});� 2132 jQuery(".cff-new .cff-crop").imgLiquid({fill:true, useBackgroundSize:true});� 2133� 2134� 2135� 2136} //********* END cff_init() FUNCTION ************//� 2137� 2138cff_init();� 2139� 2140� 2141//Get the Access Token from the shortcode so it can be used in the connect file� 2142function cffGetShortcodeToken($cff){� 2143 var shortcode_token_param = '';� 2144 if ( $cff.attr('data-cff-shortcode') ){� 2145 if( $cff.attr('data-cff-shortcode').indexOf('accesstoken') !== -1 ){� 2146 var shortcode_att = $cff.attr('data-cff-shortcode'),� 2147 shortcode_att_arr = JSON.parse( shortcode_att );� 2148 shortcode_token_param = encodeURI('&at=' + shortcode_att_arr['accesstoken']);� 2149 }� 2150 }� 2151 return shortcode_token_param;� 2152}� 2153� 2154// Used for linking text in captions� 2155/* JavaScript Linkify - v0.3 - 6/27/2009 - http://benalman.com/projects/javascript-linkify/ */� 2156window.cffLinkify=(function(){var k="[a-z\\d.-]+://",h="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",c="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",n="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",f="(?:"+c+n+"|"+h+")",o="(?:[;/][^#?<>\\s]*)?",e="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",d="\\b"+k+"[^<>\\s]+",a="\\b"+f+o+e+"(?!\\w)",m="mailto:",j="(?:"+m+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+f+e+"(?!\\w)",l=new RegExp("(?:"+d+"|"+a+"|"+j+")","ig"),g=new RegExp("^"+k,"i"),b={"'":"`",">":"<",")":"(","]":"[","}":"{","B;":"B+","b:":"b9"},i={callback:function(q,p){return p?'<a href="'+p+'" title="'+p+'" target="_blank">'+q+"</a>":q},punct_regexp:/(?:[!?.,:;'"]|(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(u,z){z=z||{};var w,v,A,p,x="",t=[],s,E,C,y,q,D,B,r;for(v in i){if(z[v]===undefined){z[v]=i[v]}}while(w=l.exec(u)){A=w[0];E=l.lastIndex;C=E-A.length;if(/[\/:]/.test(u.charAt(C-1))){continue}do{y=A;r=A.substr(-1);B=b[r];if(B){q=A.match(new RegExp("\\"+B+"(?!$)","g"));D=A.match(new RegExp("\\"+r,"g"));if((q?q.length:0)<(D?D.length:0)){A=A.substr(0,A.length-1);E--}}if(z.punct_regexp){A=A.replace(z.punct_regexp,function(F){E-=F.length;return""})}}while(A.length&&A!==y);p=A;if(!g.test(p)){p=(p.indexOf("@")!==-1?(!p.indexOf(m)?"":m):!p.indexOf("irc.")?"irc://":!p.indexOf("ftp.")?"ftp://":"http://")+p}if(s!=C){t.push([u.slice(s,C)]);s=E}t.push([A,p])}t.push([u.substr(s)]);for(v=0;v<t.length;v++){x+=z.callback.apply(window,t[v])}return x||u}})();� 2157�
2158//Link #hashtags� 2159function cffReplaceHashtags(hash){� 2160 //Remove white space at beginning of hash� 2161 var replacementString = jQuery.trim(hash);� 2162 //If the hash is a hex code then don't replace it with a link as it's likely in the style attr, eg: "color: #ff0000"� 2163 if ( /^#[0-9A-F]{6}$/i.test( replacementString ) ){� 2164 return replacementString;� 2165 } else {� 2166 return '<a href="https://www.facebook.com/hashtag/'+ replacementString.substring(1) +'" target="_blank" rel="nofollow">' + replacementString + '</a>';� 2167 }� 2168}� 2169//Link @tags� 2170function cffReplaceTags(tag){� 2171 var replacementString = jQuery.trim(tag);� 2172 return '<a href="https://www.facebook.com/'+ replacementString.substring(1) +'" target="_blank" rel="nofollow">' + replacementString + '</a>';� 2173}� 2174var hashRegex = /[#]+[A-Za-z0-9-_]+/g,� 2175 tagRegex = /[@]+[A-Za-z0-9-_]+/g;� 2176// End caption linking functions� 2177� 2178//Encoding comments� 2179function cffEncodeHTML(raw) {� 2180 // make sure passed variable is defined� 2181 if (typeof raw === 'undefined') {� 2182 return '';� 2183 }� 2184 // replace greater than and less than symbols with html entity to disallow html in comments� 2185 var encoded = raw.replace(/(>)/g,'>'),� 2186 encoded = encoded.replace(/(<)/g,'<');� 2187 encoded = encoded.replace(/(<br\/>)/g,'<br>');� 2188 encoded = encoded.replace(/(<br>)/g,'<br>');� 2189� 2190 return encoded;� 2191}� 2192� 2193� 2194//Load comment replies using Ajax� 2195function cffLoadCommentReplies( $this ){� 2196� 2197 var usegrouptoken = '',� 2198 useowntoken = '',� 2199 $cffClosestContainer = jQuery('#cff_'+$this.parent().attr('data-id')).closest('#cff');� 2200 if( $cffClosestContainer.hasClass('cff-group') ) usegrouptoken = '&usegrouptoken=true';� 2201 if( $cffClosestContainer.attr('data-own-token') == 'true' ) useowntoken = '&useowntoken=true';� 2202� 2203 //Get the token from the shortcode� 2204 var cff_page_id = $this.closest('.cff-item').attr('data-page-id'),� 2205 shortcode_token_param = cffGetShortcodeToken( $cffClosestContainer ),� 2206 $commentReplies = $this.parent(),� 2207 $commentRepliesBox = $commentReplies.siblings('.cff-comment-replies-box'),� 2208 comments_url = cffsiteurl + "/custom-facebook-feed-pro/comments.php?id=" + $commentReplies.attr('data-id') + usegrouptoken + useowntoken + '&pageid=' + cff_page_id + shortcode_token_param;� 2209� 2210 if( $commentReplies.hasClass('cff-hide') ){� 2211� 2212 $commentRepliesBox.hide();� 2213 $commentReplies.removeClass('cff-hide');� 2214� 2215 } else {� 2216� 2217 $commentRepliesBox.show();� 2218 $commentReplies.addClass('cff-hide');� 2219� 2220 //If the replies haven't been retrieved yet then get them, otherwise just show the existing ones again� 2221 if( $commentRepliesBox.hasClass('cff-empty') ){� 2222� 2223 //Display loader� 2224 var $commentRepliesA = $commentReplies.find('a');� 2225 $commentRepliesA.append('<div class="cff-loader"></div>');� 2226 $commentReplies.find('.cff-loader').css('background-color', $commentRepliesA.css('color'));� 2227� 2228 jQuery.ajax({� 2229 method: "GET",� 2230 url: comments_url,� 2231 success: function(data) {� 2232� 2233 //Remove loader� 2234 $commentReplies.find('.cff-loader').remove();� 2235� 2236 //Convert string of data received from comments.php to a JSON object� 2237 var data = jQuery.parseJSON( data ),� 2238 allComments = '';� 2239� 2240 if( typeof data.comments !== 'undefined' ){� 2241 jQuery.each(data.comments.data, function(i, commentItem) {� 2242� 2243 //Check whether comment author info exists - only accessible with page access token from the page now� 2244 var cff_comment_author_info = true;� 2245 if( typeof commentItem.from !== 'undefined' ){� 2246 cff_comment_from_id = commentItem.from.id;� 2247 } else {� 2248 cff_comment_author_info = false;� 2249 cff_comment_from_id = '';� 2250 }� 2251� 2252� 2253 allComments += '<div class="cff-comment-reply" id="cff_'+commentItem.id+'"><div class="cff-comment-text-wrapper"><div class="cff-comment-text';� 2254 if(!cff_comment_author_info) allComments += ' cff-no-name';� 2255 allComments += '"><p>';� 2256� 2257� 2258 if(cff_comment_author_info){� 2259 if( typeof commentItem.from.link != 'undefined' ){� 2260 allComments += '<a href="http://facebook.com/'+commentItem.from.id+'" class="cff-name" target="_blank" rel="nofollow">
2260'+commentItem.from.name+'</a>';� 2261 } else {� 2262 allComments += '<span class="cff-name">'+commentItem.from.name+'</span>';� 2263 }� 2264 }� 2265� 2266� 2267 var cffCommentMessage = cffEncodeHTML(commentItem.message);� 2268 allComments += cffCommentMessage;� 2269� 2270 //Show like count if exists� 2271 if(parseInt(commentItem.like_count) > 0) allComments += '<span class="cff-comment-likes"><span class="cff-comment-likes-bg"><b style="padding-top: 3px;"><svg role="img" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M466.27 286.69C475.04 271.84 480 256 480 236.85c0-44.015-37.218-85.58-85.82-85.58H357.7c4.92-12.81 8.85-28.13 8.85-46.54C366.55 31.936 328.86 0 271.28 0c-61.607 0-58.093 94.933-71.76 108.6-22.747 22.747-49.615 66.447-68.76 83.4H32c-17.673 0-32 14.327-32 32v240c0 17.673 14.327 32 32 32h64c14.893 0 27.408-10.174 30.978-23.95 44.509 1.001 75.06 39.94 177.802 39.94 7.22 0 15.22.01 22.22.01 77.117 0 111.986-39.423 112.94-95.33 13.319-18.425 20.299-43.122 17.34-66.99 9.854-18.452 13.664-40.343 8.99-62.99zm-61.75 53.83c12.56 21.13 1.26 49.41-13.94 57.57 7.7 48.78-17.608 65.9-53.12 65.9h-37.82c-71.639 0-118.029-37.82-171.64-37.82V240h10.92c28.36 0 67.98-70.89 94.54-97.46 28.36-28.36 18.91-75.63 37.82-94.54 47.27 0 47.27 32.98 47.27 56.73 0 39.17-28.36 56.72-28.36 94.54h103.99c21.11 0 37.73 18.91 37.82 37.82.09 18.9-12.82 37.81-22.27 37.81 13.489 14.555 16.371 45.236-5.21 65.62zM88 432c0 13.255-10.745 24-24 24s-24-10.745-24-24 10.745-24 24-24 24 10.745 24 24z"></path></svg></b>
2271'+commentItem.like_count+'</span></span>';� 2272� 2273 allComments += '</p>';� 2274� 2275 //Add image attachment if exists� 2276 if( typeof commentItem.attachment !== 'undefined' ) allComments += '<a class="cff-comment-attachment" href="'+commentItem.attachment.url+'" target="_blank"><img src="'+commentItem.attachment.media.image.src+'" alt="'+commentItem.attachment.title+'" /></a>';� 2277� 2278 allComments += '</div></div>';� 2279 if(cff_comment_author_info) allComments += '<div class="cff-comment-img cff-comment-reply-img"><a href="http://facebook.com/'+commentItem.from.id+'" target="_blank" rel="nofollow"><img src="'+commentItem.from.picture.data.url+'" width="20" height="20" alt="Avatar" onerror="this.style.display=\'none\'"></a></div>';� 2280 allComments += '</div>';� 2281 });� 2282 }� 2283� 2284 $commentRepliesBox.html(allComments).removeClass('cff-empty');� 2285� 2286 //Re-init masonry layout when loading comment replies� 2287 if( $this.closest('#cff').hasClass('cff-masonry-js') && !$this.closest('#cff').hasClass('cff-masonry-css') && !$this.closest('#cff').hasClass('cff-opaque-comments') ){� 2288 cffAddMasonry( $this.closest('#cff') );� 2289 }� 2290� 2291 } //End success� 2292� 2293 }); //End ajax� 2294� 2295 } //End if� 2296� 2297 } //End if/else� 2298� 2299} // End cffLoadCommentReplies()� 2300� 2301� 2302� 2303� 2304function cffLightbox(){� 2305 /**� 2306 * Lightbox v2.7.1� 2307 * by Lokesh Dhakar - http://lokeshdhakar.com/projects/lightbox2/� 2308 *� 2309 * @license http://creativecommons.org/licenses/by/2.5/� 2310 * - Free for use in both personal and commercial projects� 2311 * - Attribution requires leaving author name, author link, and the license info intact� 2312 */� 2313� 2314 (function() {� 2315 // Use local alias� 2316 var $ = jQuery;� 2317� 2318 var LightboxOptions = (function() {� 2319 function LightboxOptions() {� 2320 this.fadeDuration = 300;� 2321 this.fitImagesInViewport = true;� 2322 this.resizeDuration = 400;� 2323 this.positionFromTop = 50;� 2324 this.showImageNumberLabel = true;� 2325 this.alwaysShowNavOnTouchDevices = false;� 2326 this.wrapAround = false;� 2327 }� 2328� 2329 // Change to localize to non-english language� 2330 LightboxOptions.prototype.albumLabel = function(curImageNum, albumSize) {� 2331 return curImageNum + " / " + albumSize;� 2332 };� 2333� 2334 return LightboxOptions;� 2335 })();� 2336� 2337� 2338 var Lightbox = (function() {� 2339 function Lightbox(options) {� 2340 this.options = options;� 2341 this.album = [];� 2342 this.currentImageIndex = void 0;� 2343 this.init();� 2344 }� 2345� 2346 Lightbox.prototype.init = function() {� 2347 this.enable();� 2348 this.build();� 2349 };� 2350� 2351 // Loop through anchors and areamaps looking for either data-lightbox attributes or rel attributes� 2352 // that contain 'cff-lightbox'. When these are clicked, start lightbox.� 2353 Lightbox.prototype.enable = function() {� 2354 var self = this;� 2355 $('body').on('click', 'a[data-cff-lightbox], area[data-cff-lightbox]', function(event) {� 2356 self.start($(event.currentTarget));� 2357 return false;� 2358 });� 2359 };� 2360� 2361 // Build html for the lightbox and the overlay.� 2362 // Attach event handlers to the new DOM elements. click click click� 2363 Lightbox.prototype.build = function() {� 2364� 2365 //Disable SVG icons?� 2366 var cff_lightbox_svg_class = '';� 2367 if( $('.cff.cff-no-svgs').length ) cff_lightbox_svg_class = 'cff-no-svgs';� 2368� 2369 var self = this;� 2370 $("<div id='cff-lightbox-overlay' class='cff-lightbox-overlay'></div><div id='cff-lightbox-wrapper' class='cff-lightbox-wrapper "+cff_lightbox_svg_class+"'><div class='cff-lightbox-outerContainer'><div class='cff-lightbox-container'><iframe type='text/html' src='' allowfullscreen frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen title='Video'></iframe><img class='cff-lightbox-image' src='' alt='"+$('#cff').attr('data-fb-text')+"' /><div class='cff-lightbox-nav'><a class='cff-lightbox-prev' href=''><span>Previous</span></a><a class='cff-lightbox-next' href=''><span>Next</span></a></div><div class='cff-lightbox-loader'><a class='cff-lightbox-cancel'></a></div><div class='cff-lightbox-sidebar'></div></div></div><div class='cff-lightbox-dataContainer'><div class='cff-lightbox-data'><div class='cff-lightbox-details'><p class='cff-lightbox-caption'><span class='cff-lightbox-caption-text'></span><a class='cff-lightbox-facebook' href=''><span class='fa fab fa-facebook-square' aria-hidden='true' style='margin-right:6px;'></span>"+$('#cff').attr('data-fb-text')+"</a></p><div class='cff-lightbox-thumbs'><div class='cff-lightbox-thumbs-holder'></div></div></div><div class='cff-lightbox-closeContainer'><a class='cff-lightbox-close'><span class='fa fa-times' aria-hidden='true'></span></a></div></div></div></div>").appendTo($('body'));� 2371 � 2372 // Cache jQuery objects�
2373 this.$lightbox = $('#cff-lightbox-wrapper');� 2374 this.$overlay = $('#cff-lightbox-overlay');� 2375 this.$outerContainer = this.$lightbox.find('.cff-lightbox-outerContainer');� 2376 this.$container = this.$lightbox.find('.cff-lightbox-container');� 2377� 2378 // Store css values for future lookup� 2379 this.containerTopPadding = parseInt(this.$container.css('padding-top'), 10);� 2380 this.containerRightPadding = parseInt(this.$container.css('padding-right'), 10);� 2381 this.containerBottomPadding = parseInt(this.$container.css('padding-bottom'), 10);� 2382 this.containerLeftPadding = parseInt(this.$container.css('padding-left'), 10);� 2383� 2384 // Attach event handlers to the newly minted DOM elements� 2385 this.$overlay.hide().on('click', function() {� 2386 self.end();� 2387 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2388 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2389 return false;� 2390 });� 2391� 2392� 2393 this.$lightbox.hide().on('click', function(event) {� 2394 if ($(event.target).attr('id') === 'cff-lightbox-wrapper') {� 2395 self.end();� 2396 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2397 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2398 }� 2399 return false;� 2400 });� 2401 this.$outerContainer.on('click', function(event) {� 2402 if ($(event.target).attr('id') === 'cff-lightbox-wrapper') {� 2403 self.end();� 2404 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2405 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2406 }� 2407 return false;� 2408 });� 2409� 2410� 2411 this.$lightbox.find('.cff-lightbox-prev').on('click', function() {� 2412 if (self.currentImageIndex === 0) {� 2413 self.changeImage(self.album.length - 1);� 2414 } else {� 2415 self.changeImage(self.currentImageIndex - 1);� 2416 }� 2417 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2418 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2419 return false;� 2420 });� 2421� 2422 this.$lightbox.find('.cff-lightbox-next').on('click', function() {� 2423 if (self.currentImageIndex === self.album.length - 1) {� 2424 self.changeImage(0);� 2425 } else {� 2426 self.changeImage(self.currentImageIndex + 1);� 2427 }� 2428 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2429 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2430 return false;� 2431 });� 2432� 2433� 2434 //CHANGE IMAGE ON THUMB CLICK� 2435 $('.cff-lightbox-thumbs').on('click', '.cff-lightbox-attachment', function (){� 2436 var $thumb = $(this),� 2437 $thumbImg = $thumb.find('img'),� 2438 captionText = $thumb.attr('data-caption');� 2439� 2440 if(captionText == '' || captionText == 'undefined') captionText = $thumb.attr('orig-caption');� 2441� 2442 //Pass image URL, width and height to the change image function� 2443 self.changeImage(parseInt( $thumb.attr('data-cff-lightbox-order') ), $thumb.attr('href'), $thumbImg.attr('width'), $thumbImg.attr('height'), $thumb.attr('data-facebook'), captionText);� 2444 return false;� 2445 });� 2446� 2447� 2448 this.$lightbox.find('.cff-lightbox-loader, .cff-lightbox-close').on('click', function() {� 2449 self.end();� 2450 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2451 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2452 return false;� 2453 });� 2454� 2455 }; //End build()� 2456� 2457 // Show overlay and lightbox. If the image is part of a set, add siblings to album array.� 2458 Lightbox.prototype.start = function($link) {� 2459 var self = this;� 2460 var $window = $(window);� 2461� 2462 $window.on('resize', $.proxy(this.sizeOverlay, this));� 2463� 2464 $('select, object, embed').css({� 2465 visibility: "hidden"� 2466 });� 2467� 2468 this.sizeOverlay();� 2469� 2470 //Only set the album to be empty when the page first loads, otherwise don't empty it otherwise it's rebuilt using the "push" method below and it pushes the lightbox thumbnails onto the end of the array instead of them being spliced in at their correct location� 2471 if(this.album.length == 0) this.album = [];� 2472 var imageNumber = 0;� 2473� 2474 function addToAlbum($link) {� 2475 //If an image with the same href has already been added then don't add it to the lightbox order again� 2476 var found = false;� 2477 $.each(self.album, function(i, imageitem) {� 2478 if( imageitem.link == $link.attr('href') ){� 2479 found = true;� 2480 return;� 2481 }� 2482 });� 2483 if(found == true) return; � 2484� 2485 self.album.push({� 2486 link: $link.attr('href'),� 2487 title: $link.attr('data-title') || $link.attr('title'),� 2488 postid: $link.attr('data-id'),� 2489 showthumbs: $link.attr('data-thumbs'),� 2490 facebookurl: $link.attr('data-url'),� 2491 video: $link.attr('data-video'),� 2492 iframe: $link.attr('data-iframe'),� 2493 type: $link.attr('data-type'),� 2494 cffgroupalbums: $link.attr('data-cffgroupalbums'),�
2495 isthumbnail: $link.attr('data-cff-isthumbnail'),� 2496 pagename: $link.parent().attr('data-cff-page-name'),� 2497 posttime: $link.parent().attr('data-cff-post-time'),� 2498 lbcomments: $link.attr('data-lb-comments')� 2499 });� 2500 }� 2501� 2502 // Support both data-lightbox attribute and rel attribute implementations� 2503 var dataLightboxValue = $link.attr('data-cff-lightbox');� 2504 var $links;� 2505� 2506 if (dataLightboxValue) {� 2507 $links = $($link.prop("tagName") + '[data-cff-lightbox="' + dataLightboxValue + '"]');� 2508 for (var i = 0; i < $links.length; i = ++i) {� 2509 addToAlbum($($links[i]));� 2510 if ($links[i] === $link[0]) {� 2511 imageNumber = i;� 2512� 2513 //Loop through the album array and try to match the ID of the image that was clicked on with an image within the album array. We can then use that to set the lightbox order for that image, as otherwise it's incorrect if there have been thumbs added into the album array which aren't physically present on the page as they're loaded dynamically from the thumbs array within the lightbox. Only do this for post images and not thumbnails.� 2514 $.each(self.album, function(i, image) {� 2515 if( (image.postid == $link.attr('data-id')) && image.isthumbnail != true ) imageNumber = i;� 2516 });� 2517 }� 2518 }� 2519 } else {� 2520 if ($link.attr('rel') === 'lightbox') {� 2521 // If image is not part of a set� 2522 addToAlbum($link);� 2523 } else {� 2524 // If image is part of a set� 2525 $links = $($link.prop("tagName") + '[rel="' + $link.attr('rel') + '"]');� 2526 for (var j = 0; j < $links.length; j = ++j) {� 2527 addToAlbum($($links[j]));� 2528 if ($links[j] === $link[0]) {� 2529 imageNumber = j;� 2530 }� 2531 }� 2532 }� 2533 }� 2534� 2535 // Position Lightbox� 2536 var top = $window.scrollTop() + this.options.positionFromTop;� 2537 var left = $window.scrollLeft();� 2538 this.$lightbox.css({� 2539 top: top + 'px',� 2540 left: left + 'px'� 2541 }).fadeIn(this.options.fadeDuration);� 2542� 2543 this.changeImage(imageNumber);� 2544 };� 2545� 2546 // Hide most UI elements in preparation for the animated resizing of the lightbox.� 2547 Lightbox.prototype.changeImage = function(imageNumberVal, imageUrl, imgWidth, imgHeight, facebookLink, captionText) {� 2548 var self = this,� 2549 isThumb = false,� 2550 bottomPadding = 120;� 2551� 2552 imageNumber = imageNumberVal;� 2553� 2554 //Is this a thumb being clicked?� 2555 if(typeof imageUrl !== 'undefined') isThumb = true;� 2556� 2557 this.disableKeyboardNav();� 2558 var $image = this.$lightbox.find('.cff-lightbox-image');� 2559� 2560 this.$overlay.fadeIn(this.options.fadeDuration);� 2561� 2562 $('.cff-lightbox-loader').fadeIn('slow');� 2563 this.$lightbox.find('.cff-lightbox-image, .cff-lightbox-nav, .cff-lightbox-prev, .cff-lightbox-next, .cff-lightbox-dataContainer, .cff-lightbox-numbers, .cff-lightbox-caption').hide();� 2564� 2565 this.$outerContainer.addClass('animating');� 2566� 2567� 2568 // When image to show is preloaded, we send the width and height to sizeContainer()� 2569 var preloader = new Image();� 2570 preloader.onload = function() {� 2571 var $preloader, imageHeight, imageWidth, maxImageHeight, maxImageWidth, windowHeight, windowWidth;� 2572� 2573 $image.attr('src', self.album[imageNumber].link);� 2574� 2575 /*** THUMBS ***/� 2576 //Change the main image when it's a thumb that's being clicked� 2577 if(isThumb){� 2578 $image.attr('src', imageUrl);� 2579 $('.cff-lightbox-facebook').attr('href', facebookLink);� 2580 $('.cff-lightbox-caption .cff-lightbox-caption-text').html(captionText);� 2581� 2582 //Set width and height of image when thumb is clicked� 2583 preloader.width = imgWidth;� 2584 preloader.height = imgHeight;� 2585� 2586 //Increase bottom padding to make room for at least one row of thumbs� 2587 bottomPadding = 180;� 2588 }� 2589 /*** THUMBS ***/� 2590� 2591 $preloader = $(preloader);� 2592� 2593 $image.width(preloader.width);� 2594 $image.height(preloader.height);� 2595� 2596 if (self.options.fitImagesInViewport) {� 2597 // Fit image inside the viewport.� 2598 // Take into account the border around the image and an additional 10px gutter on each side.� 2599 windowWidth = $(window).width();� 2600 windowHeight = $(window).height();� 2601� 2602 //If this feed has lightbox comments enabled then add room for the sidebar� 2603 var cff_lb_comments_width = 0,� 2604 cffNavArrowsWidth = 80;� 2605� 2606 if( $('#cff_' + self.album[0].postid).closest('#cff').attr('data-lb-comments') == 'true' && windowWidth > 640 ) cff_lb_comments_width = 300;� 2607� 2608 //Use narrower arrows on mobile� 2609 if(window.innerWidth < 640) cffNavArrowsWidth = 40;� 2610� 2611 maxImageWidth = windowWidth - self.containerLeftPadding - self.containerRightPadding - 20 - cff_lb_comments_width - cffNavArrowsWidth;� 2612 maxImageHeight = windowHeight - self.containerTopPadding - self.containerBottomPadding - bottomPadding;� 2613� 2614 // Is there a fitting issue?� 2615 if ((preloader.width > maxImageWidth) || (preloader.height > maxImageHeight)) {� 2616 if ((preloader.width / maxImageWidth) > (preloader.height / maxImageHeight)) {� 2617 imageWidth = maxImageWidth;� 2618 imageHeight = parseInt(preloader.height / (preloader.width / imageWidth), 10);� 2619 $image.width(imageWidth);� 2620 $image.height(imageHeight);� 2621 } else {� 2622 imageHeight = maxImageHeight;� 2623 imageWidth = parseInt(preloader.width / (preloader.height / imageHeight), 10);� 2624 $image.width(imageWidth);� 2625 $image.height(imageHeight);� 2626 }� 2627 }� 2628 }� 2629� 2630 //Pass the width and height of the main image� 2631 self.sizeContainer($image.width(), $image.height());� 2632� 2633 };� 2634� 2635 preloader.src = this.album[imageNumber].link;� 2636 this.currentImageIndex = imageNumber;� 2637 };� 2638� 2639 // Stretch overlay to fit the viewport� 2640 Lightbox.prototype.sizeOverlay = function() {� 2641 this.$overlay� 2642 .width($(window).width())� 2643 .height($(document).height());� 2644 };� 2645� 2646 // Animate the size of the lightbox to fit the image we are showing� 2647 Lightbox.prototype.sizeContainer = function(imageWidth, imageHeight) {� 2648 var self = this;� 2649� 2650 var oldWidth = this.$outerContainer.outerWidth();� 2651 var oldHeight = this.$outerContainer.outerHeight();� 2652 var newWidth = imageWidth + this.containerLeftPadding + this.containerRightPadding;� 2653 var newHeight = imageHeight + this.containerTopPadding + this.containerBottomPadding;� 2654� 2655 function postResize() {� 2656 self.$lightbox.find('.cff-lightbox-dataContainer').width(newWidth);� 2657 self.$lightbox.find('.cff-lightbox-prevLink').height(newHeight);� 2658 self.$lightbox.find('.cff-lightbox-nextLink').height(newHeight);� 2659 self.showImage();� 2660 }� 2661� 2662 if (oldWidth !== newWidth || oldHeight !== newHeight) {� 2663 this.$outerContainer.animate({� 2664 width: newWidth,� 2665 height: newHeight� 2666 }, this.options.resizeDuration, 'swing', function() {� 2667 postResize();� 2668 });� 2669 } else {� 2670 postResize();� 2671 }� 2672 };� 2673� 2674 // Display the image and it's details and begin preload neighboring images.� 2675 Lightbox.prototype.showImage = function() {� 2676 this.$lightbox.find('.cff-lightbox-loader').hide();� 2677 this.$lightbox.find('.cff-lightbox-image').fadeIn('slow');� 2678� 2679 this.updateNav();� 2680 this.updateDetails();� 2681 this.preloadNeighboringImages();� 2682 this.enableKeyboardNav();� 2683 };� 2684� 2685 // Display previous and next navigation if appropriate.� 2686 Lightbox.prototype.updateNav = function() {� 2687 // Check to see if the browser supports touch events. If so, we take the conservative approach� 2688 // and assume that mouse hover events are not supported and always show prev/next navigation� 2689 // arrows in image sets.� 2690 var alwaysShowNav = false;� 2691 try {� 2692 document.createEvent("TouchEvent");� 2693 alwaysShowNav = (this.options.alwaysShowNavOnTouchDevices)? true: false;� 2694 } catch (e) {}� 2695� 2696 this.$lightbox.find('.cff-lightbox-nav').show();� 2697� 2698 if (this.album.length > 1) {� 2699 if (this.options.wrapAround) {� 2700 if (alwaysShowNav) {� 2701 this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').css('opacity', '1');� 2702 }� 2703 this.$lightbox.find('.cff-lightbox-prev, .cff-lightbox-next').show();� 2704 } else {� 2705 if (this.currentImageIndex > 0) {� 2706 this.$lightbox.find('.cff-lightbox-prev').show();� 2707 if (alwaysShowNav) {� 2708 this.$lightbox.find('.cff-lightbox-prev').css('opacity', '1');� 2709 }� 2710 }� 2711 if (this.currentImageIndex < this.album.length - 1) {� 2712 this.$lightbox.find('.cff-lightbox-next').show();� 2713 if (alwaysShowNav) {� 2714 this.$lightbox.find('.cff-lightbox-next').css('opacity', '1');� 2715 }� 2716 }� 2717 }� 2718 }� 2719 };� 2720� 2721 var thumbsArr = {};� 2722� 2723 // Display caption, image number, and closing button.� 2724 Lightbox.prototype.updateDetails = function() {� 2725 var self = this;� 2726 var origCaption = '';� 2727� 2728 this.$lightbox.find('.cff-lightbox-nav, .cff-lightbox-nav a').show();� 2729� 2730 /** NEW PHOTO ACTION **/� 2731� 2732 //Add the video element to the lightbox dynamically (as it causes issues with some themes if an empty tag is in there on page load
2732)� 2733 if( $('.cff-lightbox-video').length == 0 ) $('.cff-lightbox-container').prepend("<video class='cff-lightbox-video' src='' poster='' controls></video>");� 2734� 2735 //Switch video when either a new popup or navigating to new one� 2736 if( cff_supports_video() ){� 2737 $('#cff-lightbox-wrapper').removeClass('cff-has-video');� 2738� 2739 if (typeof this.album[this.currentImageIndex].video !== 'undefined'){� 2740 if( this.album[this.currentImageIndex].video.length ){� 2741� 2742 $('#cff-lightbox-wrapper').addClass('cff-has-video');� 2743 $('.cff-lightbox-video').attr({� 2744 'src' : this.album[this.currentImageIndex].video,� 2745 'poster' : this.album[this.currentImageIndex].link,� 2746 'autoplay' : 'true'� 2747 });� 2748 }� 2749 }� 2750� 2751 }� 2752� 2753 //***LIGHTBOX COMMENTS***� 2754 //Enable/disable lightbox comments. If it's a lightbox thumbnail then check whether the parent post has lb_comments enabled/disabled.� 2755 var cff_lb_comments = (this.album[this.currentImageIndex].lbcomments == 'true' && $('#cff_'+this.album[this.currentImageIndex].postid+' .cff-lightbox-link').attr('data-lb-comments') != 'false') ? true : false;� 2756� 2757 if( $(window).width() <= 640 ) cff_lb_comments = false;� 2758� 2759 //Add lightbox sidebar� 2760 if( cff_lb_comments ){� 2761 var lb_post_id = this.album[this.currentImageIndex].postid,� 2762 page_id = lb_post_id.split('_')[0],� 2763 author_name = this.album[this.currentImageIndex].pagename,� 2764 date_in_correct_format = this.album[this.currentImageIndex].posttime,� 2765 $lightbox_sidebar = $('.cff-lightbox-container .cff-lightbox-sidebar'),� 2766 $lightbox_thumbs_holder = $('.cff-lightbox-thumbs-holder'),� 2767 from_id = $( '#cff_'+this.album[this.currentImageIndex].postid ).attr('data-cff-from');� 2768� 2769 //Add class to the lightbox container� 2770 $('.cff-lightbox-wrapper').addClass('cff-enable-lb-comments');� 2771� 2772 //Adjust width to make room for the sidebar� 2773 $('.cff-lightbox-dataContainer').css( 'width', $('.cff-lightbox-dataContainer').innerWidth() + 300 );� 2774 $lightbox_sidebar.css('display', 'block');� 2775� 2776 //If the from info isn't available then display a placeholder avatar and the date� 2777 var cff_post_author = "";� 2778 if( typeof from_id !== 'undefined' ){� 2779 cff_post_author = "<div class='cff-author'><div class='cff-author-text'><p class='cff-page-name cff-author-date'><a href='https://facebook.com/"+from_id+"' target='_blank' rel='nofollow'>"+author_name+"</a><span class='cff-story'> </span></p><p class='cff-date'>"+date_in_correct_format+"</p></div><a href='https://facebook.com/"+from_id+"' target='_blank' rel='nofollow' class='cff-author-img'><img src='https://graph.facebook.com/"+from_id+"/picture?type=square' title='"+author_name+"' alt='"+author_name+"' width='40' height='40'></a></div>";� 2780 } else {� 2781 cff_post_author = "<div class='cff-author cff-no-author-info'><div class='cff-author-text'><p class='cff-date'>"+date_in_correct_format+"</p></div><div class='cff-author-img'></div></div>";� 2782 }� 2783� 2784 //Remove the close button from the bottom of lightbox as it's added to the top of the sidebar� 2785 $('.cff-lightbox-dataContainer .cff-lightbox-close').remove();� 2786� 2787 $lightbox_sidebar.html("<div class='cff-lightbox-closeContainer'><div class='cff-lightbox-close'><span class='fa fa-times' aria-hidden='true'></span></div></div><div class='cff-lightbox-sidebar-content'>" + cff_post_author + "<p class='cff-lightbox-caption'><span class='cff-lightbox-caption-text'>" + $('.cff-lightbox-caption-text').html() + '</span></p></div>' + $('#cff_'+this.album[this.currentImageIndex].postid+' .cff-comments-box')[0].outerHTML );� 2788� 2789 this.$lightbox.find('.cff-lightbox-close').on('click', function() {� 2790 self.end();� 2791 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 2792 $('#cff-lightbox-wrapper iframe').attr('src', '');� 2793 return false;� 2794 });� 2795� 2796 //Use a timeout to delay this as the thumbs aren't added till further down� 2797 setTimeout(function(){� 2798 if( $lightbox_thumbs_holder.find('a').length > 1 ){� 2799 $lightbox_sidebar.find('.cff-page-name a').text( $lightbox_thumbs_holder.find('a.cff-selected').attr('data-page-name') );� 2800 $lightbox_sidebar.find('.cff-date').text( $lightbox_thumbs_holder.find('a.cff-selected').attr('data-post-date') );� 2801 }� 2802 }, 0);� 2803� 2804 //Delete the caption from under the photo if the sidebar section is enabled� 2805 $('.cff-lightbox-dataContainer .cff-lightbox-caption').remove();� 2806 $lightbox_thumbs_holder.css('margin-top', -10);� 2807� 2808 //If the "__ likes this" text is too long then bump it onto the next line� 2809 if( $lightbox_sidebar.find('.cff-reactions-count').innerWidth() > 150 ){� 2810 $lightbox_sidebar.find('.cff-likes-this-text').addClass('cff-long');� 2811 }� 2812� 2813 //Add comment avatars� 2814 $lightbox_sidebar.find('.cff-comment:visible').each(function(){� 2815 var $thisComment = jQuery(this);� 2816 $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a, .cff-comment-img:not(.cff-comment-reply-img) span').html( '<img src="'+$thisComment.attr("data-avatar")+'" alt="Avatar" onerror="this.style.display=\'none\'" />' );� 2817 });� 2818� 2819 //Load comment replies� 2820 $lightbox_sidebar.find('.cff-comment-replies a').on('click', function(){� 2821 cffLoadCommentReplies( $(this) );� 2822 });� 2823� 2824 $lightbox_sidebar.find('.cff-show-more-comments a').attr('href', $lightbox_sidebar.find('.cff-comment-on-facebook a').attr('href') );� 2825� 2826 } else { //End add lightbox sidebar� 2827� 2828 //Disable lightbox� 2829 $('.cff-lightbox-wrapper .cff-lightbox-sidebar').html('');� 2830 $('.cff-lightbox-wrapper').removeClass('cff-enable-lb-comments');� 2831� 2832 }� 2833 //***END LIGHTBOX COMMENTS***� 2834� 2835� 2836� 2837 $('#cff-lightbox-wrapper').removeClass('cff-has-iframe cff-fb-player cff-has-thumbs');� 2838� 2839 //If it's an iframe video (embed or FB video player)� 2840 if( typeof this.album[this.currentImageIndex].iframe !== 'undefined' ){� 2841 if( this.album[this.currentImageIndex].iframe.length ){� 2842 var videoURL = this.album[this.currentImageIndex].iframe;� 2843 $('#cff-lightbox-wrapper').addClass('cff-has-iframe');� 2844� 2845 if( videoURL.indexOf("https://www.facebook.com/v2.3/plugins/video.php?") !=-1 ) $('#cff
2845-lightbox-wrapper').addClass('cff-fb-player');� 2846� 2847 //If it's a swf then don't add the autoplay parameter. This is only for embedded videos like YouTube or Vimeo.� 2848 if( videoURL.indexOf(".swf") > -1 || videoURL.indexOf("&autoplay=1") !=-1 ){� 2849 var autoplayParam = '';� 2850 } else {� 2851 var autoplayParam = '?autoplay=1';� 2852 }� 2853� 2854 //Add a slight delay before adding the URL else it doesn't autoplay on Firefox� 2855 var vInt = setTimeout(function() {� 2856 $('#cff-lightbox-wrapper iframe').attr({� 2857 'src' : videoURL + autoplayParam + "&mute=0"� 2858 });� 2859 }, 500);� 2860 }� 2861 }� 2862� 2863 //Check whether it's a thumbnail image that's currently being shown in the lightbox� 2864 var isThumbnail = false;� 2865 if( this.album[this.currentImageIndex].isthumbnail ) isThumbnail = true;� 2866� 2867 //Remove existing thumbs unless it's a thumbnail image which is being navigated through in which case keep the existing thumbnails� 2868 if( !isThumbnail ) $('.cff-lightbox-thumbs-holder').empty().removeClass('cff-animate');� 2869� 2870 //Change the link on the Facebook icon to be the link to the Facebook post only if it's the first image in the lightbox and one of the thumbs hasn't been clicked� 2871 if( this.album[this.currentImageIndex].link == $('.cff-lightbox-image').attr('src') ){� 2872 $('.cff-lightbox-facebook').attr('href', this.album[this.currentImageIndex].facebookurl);� 2873 }� 2874� 2875 //Show thumbs area if there are thumbs� 2876 if( this.album[this.currentImageIndex].showthumbs == 'true' ){� 2877 $('.cff-lightbox-thumbs').show();� 2878� 2879 //Get the post ID� 2880 var thisPostId = this.album[this.currentImageIndex].postid,� 2881 albumInfo = '',� 2882 albumThumbs = '',� 2883 albumsonly = false;� 2884 if( this.album[this.currentImageIndex].type == 'albumsonly' ) albumsonly = true;� 2885� 2886� 2887 if( typeof thumbsArr[thisPostId] !== 'undefined' ){� 2888� 2889 //load them in from array in local var� 2890 // console.log(thumbsArr[thisPostId]);� 2891 $.each(thumbsArr[thisPostId], function(i, thumb) {� 2892 var origCaption = thumb[5].replace(/"/g, '"');� 2893� 2894 //Loop through the album array and find the imageindex of the item with this post ID. Then set the current image index to be this. Otherwise when going backwards through the lightbox the imageindex is set to be the current thumb index and then once i is added the index is too high.� 2895 var albumIndex = 0;� 2896 $.each(self.album, function(i, albumItem) {� 2897 if( albumItem.postid == thisPostId ){� 2898 albumIndex = i;� 2899 //Once found the first match exit the loop� 2900 return false;� 2901 }� 2902 });� 2903� 2904 var lightboxImageOrder = (parseInt(albumIndex)+parseInt(i));� 2905� 2906 //If the small thumb isn't defined (like in regular posts) then use the full image instead� 2907 if( typeof thumb[8] == 'undefined' ) thumb[8] = thumb[0];� 2908� 2909 albumThumbs += '<a href="'+thumb[0]+'" class="cff-lightbox-attachment" data-cff-lightbox="cff-lightbox-1" data-facebook="'+thumb[3]+'" data-caption="'+thumb[4]+'" orig-caption="'+origCaption+'" data-page-name="'+thumb[6]+'" data-post-date="'+thumb[7]+'" data-cff-lightbox-order="'+lightboxImageOrder+'" lbcomments="true" data-thumbs="true" data-url="'+thumb[3]+'" data-iframe data-video ';� 2910� 2911 (albumsonly) ? albumThumbs += 'data-type="albumsonly" ' : albumThumbs += 'data-type ';� 2912 albumThumbs += 'data-cff-isthumbnail="true"><img src="'+thumb[8]+'" width="'+thumb[1]+'" height="'+thumb[2]+'" /></a>';� 2913� 2914 //Add all of the thumbs (apart from the first thumb) to the lightbox order� 2915 if( i > 0 ){� 2916 cffInsertLightboxImage(lightboxImageOrder, thumb[0], thumb[4], thumb[3], thisPostId, albumsonly, true, thumb[6], thumb[7], thumb[8]);� 2917 }� 2918 });� 2919� 2920 //Add thumbs to the page� 2921 $('.cff-lightbox-thumbs-holder').html( '<div class="cff-lightbox-thumbs-wrap">' + albumThumbs + '</div>' ).addClass('cff-animate');� 2922 $('.cff-lightbox-wrapper').addClass('cff-has-thumbs');� 2923� 2924 //Liquidfill the thumbs� 2925 jQuery(".cff-lightbox-thumbs-holder a").imgLiquid({fill:true, useBackgroun
2925dSize:true});� 2926� 2927 //Hide the loader� 2928 $('.cff-loader').hide();� 2929 $('.cff-lightbox-thumbs-holder').css('min-height', 0);� 2930� 2931 } else {� 2932 //Use ajax to get them from Facebook API� 2933� 2934 //Set paths for thumbs.php� 2935 if (typeof cffsiteurl === 'undefined' || cffsiteurl == '') cffsiteurl = window.location.host + '/wp-content/plugins';� 2936� 2937 //Get the token from the shortcode� 2938 var $cffClosest = $('#cff_'+thisPostId).closest('.cff'),� 2939 cff_page_id = $('#cff_'+thisPostId).attr('data-page-id'),� 2940 shortcode_token_param = cffGetShortcodeToken( $cffClosest ),� 2941 useowntoken = '';� 2942 if( $cffClosest.attr('data-own-token') == 'true' ) useowntoken = '&useowntoken=true';� 2943� 2944 //AJAX� 2945 var cffAttachmentsUrl = cffsiteurl + "/custom-facebook-feed-pro/thumbs.php?id=" + thisPostId + '&pageid=' + cff_page_id + useowntoken + shortcode_token_param,� 2946 thumbsData = [];� 2947� 2948 //If this is an albums only item and the thumbs will� 2949 if( albumsonly ){� 2950 cffAttachmentsUrl = cffAttachmentsUrl + '&albumsonly=true';� 2951 $('.cff-lightbox-thumbs-holder').css('min-height', 45).after('<div class="cff-loader"></div>');� 2952 }� 2953� 2954 //If it's a group album then add the absolute path so we can get the User Access Token from the DB� 2955 var cffgroupalbums = this.album[this.currentImageIndex].cffgroupalbums;� 2956 if( cffgroupalbums ) cffAttachmentsUrl = cffAttachmentsUrl + '&usegrouptoken=' + cffgroupalbums;� 2957� 2958 $.ajax({� 2959 method: "GET",� 2960 url: cffAttachmentsUrl,� 2961 // dataType: "jsonp",� 2962 success: function(data) {� 2963� 2964 //Convert string of data received from thumbs.php to a JSON object� 2965 data = jQuery.parseJSON( data );� 2966� 2967 if(albumsonly){� 2968 //Compile the thumbs� 2969 $.each(data.data, function(i, photoItem) {� 2970 var dataCaption = '';� 2971 if( photoItem.name ) dataCaption = photoItem.name;� 2972 // origCaption = String(origCaption).replace(/"/g, '"');� 2973� 2974 //Format the caption and add links� 2975 dataCaption = cffLinkify(dataCaption);� 2976 dataCaption = dataCaption.replace( hashRegex , cffReplaceHashtags );� 2977� 2978 // dataCaption = dataCaption.replace( tagRegex , cffReplaceTags ); - causes an issue with email address linking� 2979 dataCaption = String(dataCaption).replace(/& /g, '& ').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/\n/g, "<br/>");� 2980� 2981 origCaption = String(origCaption).replace(/& /g, '& ').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/\n/g, "<br/>");� 2982� 2983 var lightboxImageOrder = (parseInt(self.currentImageIndex)+parseInt(i));� 2984� 2985 //If it's a group then use the source otherwise it displays as question marks� 2986 var cffThumbHref = photoItem.source,� 2987 cffPhotoItemWidth = photoItem.width,� 2988 cffPhotoItemHeight = photoItem.height;� 2989� 2990 //Use the full size image if available� 2991 if( typeof photoItem.images[0] !== 'undefined' ){� 2992 cffThumbHref = photoItem.images[0].source;� 2993 cffPhotoItemWidth = photoItem.images[0].width;� 2994 cffPhotoItemHeight = photoItem.images[0].height;� 2995 }� 2996� 2997 //Set the thumbnail image to be the smallest size available, which is the second from last in images arr� 2998 if( typeof photoItem.images[ photoItem.images.length-2 ] !== 'undefined' ){� 2999 var cffThumbImg = photoItem.images[ photoItem.images.length-2 ].source;� 3000 } else {� 3001 var cffThumbImg = cffThumbHref;� 3002 }� 3003� 3004 albumThumbs += '<a href="'+cffThumbHref+'" class="cff-lightbox-attachment" data-facebook="http://facebook.com/'+photoItem.id+'" data-caption="'+dataCaption+'" orig-caption="'+origCaption+'" data-cff-lightbox-order="'+lightboxImageOrder+'" data-thumbs="true" data-url="http://facebook.com/'+photoItem.id+'" data-iframe data-video data-type="albumsonly" data-cff-isthumbnail="true"><img src="'+cffThumbImg+'" lbcomments="false" width="'+cffPhotoItemWidth+'" height="'+cffPhotoItemHeight+'" /></a>';� 3005� 3006 thumbsData.push([cffThumbHref, cffPhotoItemWidth, cffPhotoItemHeight, 'http://facebook.com/'+photoItem.id, dataCaption, origCaption, undefined, undefined, cffThumbImg]);� 3007� 3008 //Add all of the thumbs (apart from the first thumb) to the lightbox order� 3009 if( i > 0 ){� 3010 cffInsertLightboxImage(lightboxImageOrder, cffThumbHref, dataCaption, 'http://facebook.com/'+photoItem.id, thisPostId, albumsonly, true, cffThumbImg);� 3011 }� 3012� 3013 }); //End each� 3014� 3015 } else {� 3016 //Check whether there's data..� 3017 if (typeof data.attachments !== 'undefined') {� 3018� 3019 //..Then compile the thumbs� 3020 $.each(data.attachments.data[0].subattachments.data, function(i, subattachment) {� 3021 var dataCaption = '';� 3022 if( subattachment.description ) dataCaption = subattachment.description;� 3023 origCaption = String(origCaption).replace(/"/g, '"');� 3024� 3025 //Format the caption and add links� 3026 dataCaption = cffLinkify(dataCaption);� 3027 dataCaption = dataCaption.replace( hashRegex , cffReplaceHashtags );� 3028 // dataCaption = dataCaption.replace( tagRegex , cffReplaceTags ); - causes an issue with email address linking� 3029 dataCaption = String(dataCaption).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/\n/g, "<br/>");� 3030� 3031 var lightboxImageOrder = (parseInt(self.currentImageIndex)+parseInt(i));� 3032� 3033 albumThumbs += '<a href="'+subattachment.media.image.src+'" class="cff-lightbox-attachment" data-facebook="'+subattachment.url+'" data-caption="'+dataCaption+'" orig-caption="'+origCaption+'" lbcomments="true" data-page-name="'+author_name+'" data-post-date="'+date_in_correct_format
3033+'" data-cff-lightbox-order="'+lightboxImageOrder+'" data-thumbs="true" data-url="'+subattachment.url+'" data-iframe data-video data-type data-cff-isthumbnail="true"><img src="'+subattachment.media.image.src+'" width="'+subattachment.media.image.width+'" height="'+subattachment.media.image.height+'" /></a>';� 3034� 3035 thumbsData.push([subattachment.media.image.src, subattachment.media.image.width, subattachment.media.image.height, subattachment.url, dataCaption, origCaption, author_name, date_in_correct_format]);� 3036� 3037 //Add all of the thumbs (apart from the first thumb) to the lightbox order� 3038 if( i > 0 ){� 3039 cffInsertLightboxImage(lightboxImageOrder, subattachment.media.image.src, dataCaption, subattachment.url, thisPostId, albumsonly, true, author_name, date_in_correct_format, subattachment.media.image.src);� 3040 }� 3041� 3042 });� 3043� 3044 } //End undefined check� 3045 � 3046 } //End if/else� 3047� 3048 //Add thumbs to the page� 3049 if( albumThumbs.length > 0 ){� 3050 $('.cff-lightbox-thumbs-holder').html( '<div class="cff-lightbox-thumbs-wrap">' + albumThumbs + '</div>' ).addClass('cff-animate');� 3051 $('.cff-lightbox-wrapper').addClass('cff-has-thumbs');� 3052 }� 3053� 3054 //Liquidfill the thumbs� 3055 jQuery(".cff-lightbox-thumbs-holder .cff-lightbox-attachment").imgLiquid({fill:true, useBackgroundSize:true});� 3056� 3057 //Hide the loader� 3058 $('.cff-loader').hide();� 3059� 3060 $('.cff-lightbox-thumbs-holder').css('min-height', 0);� 3061� 3062 //Add the thumbs to the thumbs array to store them� 3063 thumbsArr[ thisPostId ] = thumbsData;� 3064� 3065 } //End success� 3066� 3067 }); //End ajax� 3068� 3069 } //End if/else� 3070� 3071 } else {� 3072 //If there are no thumbs then hide the thumbs area� 3073 $('.cff-lightbox-thumbs').hide();� 3074 }� 3075� 3076 //Add a class to the selected thumb� 3077 $(".cff-lightbox-attachment").removeClass('cff-selected');� 3078 $(".cff-lightbox-attachment[href='"+$('.cff-lightbox-image').attr('src')+"']").addClass('cff-selected');� 3079� 3080� 3081 function cffInsertLightboxImage(currentImageIndex, link, title, facebookurl, postid, albumsonly, isThumbnail, cffThumbImg){� 3082� 3083 //Make sure the thumbs aren't added to the lightbox order more than once� 3084 var found = false;� 3085 $.each(self.album, function(i, thumbitem) {� 3086 if( thumbitem.link == link ){� 3087 found = true;� 3088 return;� 3089 }� 3090 });� 3091 if(found == true) return;� 3092� 3093 ( albumsonly ) ? postType = 'albumsonly' : postType = '';� 3094 ( albumsonly ) ? lbcomments = 'false' : lbcomments = 'true';� 3095� 3096 //Push the image into the album array at the correct location so it's included in the lightbox order� 3097 self.album.splice(currentImageIndex, 0, {� 3098 link: link,� 3099 title: title,� 3100 postid: postid,� 3101 showthumbs: 'true',� 3102 facebookurl: facebookurl,� 3103 video: '',� 3104 iframe: '',� 3105 type: postType,� 3106 cffgroupalbums: undefined,� 3107 isthumbnail: isThumbnail,� 3108 lbcomments: lbcomments,� 3109 thumbimg: cffThumbImg� 3110 });� 3111� 3112 } //End cffInsertLightboxImage()� 3113� 3114 /** END NEW PHOTO ACTION **/� 3115� 3116 � 3117 //Still show the caption section even if there's not a caption as it contains the View on Facebook link� 3118 this.$lightbox.find('.cff-lightbox-caption').fadeIn('fast');� 3119� 3120 // Enable anchor clicks in the injected caption html.� 3121 if (typeof this.album[this.currentImageIndex].title !== 'undefined' && this.album[this.currentImageIndex].title !== "") {� 3122� 3123 //If it's the first image in the lightbox then set the caption to be the text from the post. For all subsequent images the caption is changed on the fly based elsehwere in the code based on an attr from the thumb that's clicked� 3124 var origCaption = this.album[this.currentImageIndex].title;� 3125� 3126 //Add hashtag and tag links� 3127 // origCaption = cffLinkify(origCaption); - Caused issues with @tag links in regular lightbox popup� 3128 origCaption = origCaption.replace( hashRegex , cffReplaceHashtags );� 3129 // origCaption = origCaption.replace( tagRegex , cffReplaceTags ); - causes an issue with email address linking� 3130 //Decode the caption back so that the tags are rendered as HTML:� 3131 origCaption = String(origCaption).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, '"');� 3132� 3133 var $lightboxCaption = this.$lightbox.find('.cff-lightbox-caption'),� 3134 $lightboxCaptionText = $lightboxCaption.find('.cff-lightbox-caption-text');� 3135 if( this.album[this.currentImageIndex].link == $('.cff-lightbox-image').attr('src') ) $lightboxCaptionText.html( origCaption );� 3136� 3137 //If there's no caption then remove the border and margin from the View on Facebook link� 3138 if( $lightboxCaptionText.text() == ' ' || $lightboxCaptionText.text() == '' ){� 3139 $lightboxCaption.addClass('cff-no-caption');� 3140 } else {� 3141 $lightboxCaption.removeClass('cff-no-caption');� 3142 }� 3143� 3144 } else {� 3145 this.$lightbox.find('.cff-lightbox-caption').addClass('cff-no-caption').find('.cff-lightbox-caption-text').html('');� 3146 }� 3147� 3148 this.$lightbox.find('.cff-lightbox-facebook, .cff-lightbox-caption-text a, .cff-lightbox-sidebar a:not(.cff-comment-replies-a)').unbind().on('click', function(event){� 3149 window.open(� 3150 $(this).attr('href'),� 3151 '_blank'� 3152 )� 3153 }� 3154 );� 3155 � 3156 if (this.album.length > 1 && this.options.showImageNumberLabel) {� 3157 this.$lightbox.find('.cff-lightbox-number').text(this.options.albumLabel(this.currentImageIndex + 1, this.album.length)).fadeIn('fast');� 3158 } else {� 3159 this.$lightbox.find('.cff-lightbox-number').hide();� 3160 }� 3161� 3162 this.$outerContainer.removeClass('animating');� 3163� 3164 this.$lightbox.find('.cff-lightbox-dataContainer').fadeIn(this.options.resizeDuration, function() {� 3165 return self.sizeOverlay();� 3166 });� 3167� 3168 }; //End Lightbox.prototype.updateDetails� 3169� 3170 // Preload previous and next images in set.� 3171 Lightbox.prototype.preloadNeighboringImages = function() {� 3172 if (this.album.length > this.currentImageIndex + 1) {� 3173 var preloadNext = new Image();� 3174 preloadNext.src = this.album[this.currentImageIndex + 1].link;� 3175 }� 3176 if (this.currentImageIndex > 0) {� 3177 var preloadPrev = new Image();� 3178 preloadPrev.src = this.album[this.currentImageIndex - 1].link;� 3179 }� 3180 };� 3181� 3182 Lightbox.prototype.enableKeyboardNav = function() {� 3183 $(document).on('keyup.keyboard', $.proxy(this.keyboardAction, this));� 3184 };� 3185� 3186 Lightbox.prototype.disableKeyboardNav = function() {� 3187 $(document).off('.keyboard');� 3188 };� 3189� 3190 Lightbox.prototype.keyboardAction = function(event) {� 3191 var KEYCODE_ESC = 27;� 3192 var KEYCODE_LEFTARROW = 37;� 3193 var KEYCODE_RIGHTARROW = 39;� 3194� 3195 var keycode = event.keyCode;� 3196 var key = String.fromCharCode(keycode).toLowerCase();� 3197 if (keycode === KEYCODE_ESC || key.match(/x|o|c/)) {�
3198 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 3199 $('#cff-lightbox-wrapper iframe').attr('src', '');� 3200 � 3201 this.end();� 3202 } else if (key === 'p' || keycode === KEYCODE_LEFTARROW) {� 3203 if (this.currentImageIndex !== 0) {� 3204 this.changeImage(this.currentImageIndex - 1);� 3205 } else if (this.options.wrapAround && this.album.length > 1) {� 3206 this.changeImage(this.album.length - 1);� 3207 }� 3208� 3209 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 3210 $('#cff-lightbox-wrapper iframe').attr('src', '');� 3211� 3212 } else if (key === 'n' || keycode === KEYCODE_RIGHTARROW) {� 3213 if (this.currentImageIndex !== this.album.length - 1) {� 3214 this.changeImage(this.currentImageIndex + 1);� 3215 } else if (this.options.wrapAround && this.album.length > 1) {� 3216 this.changeImage(0);� 3217 }� 3218� 3219 if( cff_supports_video() ) $('#cff-lightbox-wrapper video.cff-lightbox-video')[0].pause();� 3220 $('#cff-lightbox-wrapper iframe').attr('src', '');� 3221� 3222 }� 3223 };� 3224� 3225 // Closing time� 3226 Lightbox.prototype.end = function() {� 3227 this.disableKeyboardNav();� 3228 $(window).off("resize", this.sizeOverlay);� 3229 this.$lightbox.fadeOut(this.options.fadeDuration);� 3230 this.$overlay.fadeOut(this.options.fadeDuration);� 3231 $('select, object, embed').css({� 3232 visibility: "visible"� 3233 });� 3234 };� 3235� 3236 return Lightbox;� 3237� 3238 })(); //End Lightbox = (function()� 3239� 3240 $(function() {� 3241 var options = new LightboxOptions();� 3242 var lightbox = new Lightbox(options);� 3243 });� 3244� 3245 }).call(this); //End (function() {� 3246� 3247 //Checks whether browser support HTML5 video element� 3248 function cff_supports_video() {� 3249 return !!document.createElement('video').canPlayType;� 3250 }� 3251� 3252� 3253} //End cffLightbox function� 3254� 3255//Only call the lightbox if the class is on at least one feed on the page� 3256if( jQuery('#cff.cff-lb').length ) cffLightbox();� 3257� 3258� 3259� 3260} //End cff_js_exists check
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.