1(function ($) { 2 'use strict'; 3 jQuery.each(portfolio_resp_lightbox_obj, function(index, value) { 4 if(value.indexOf('true')>-1 || value.indexOf('false')>-1) 5 portfolio_resp_lightbox_obj[index] = value == "true"; 6 }); 7 8 var groupID = '1-1'; 9 10 jQuery('.portfolio-gallery-content a').on('click', function(e){ 11 groupID = jQuery(this).attr('data-groupID'); 12 jQuery(this).lightboxPortfolio(); 13 14 }); 15 jQuery('.portfolio-gallery-content img').on('click', function(e){ 16 e.preventDefault(); 17 groupID = jQuery(this).parents('a').attr('data-groupID'); 18 jQuery(this).lightboxPortfolio(); 19 20 }); 21 jQuery(' .portfolio-gallery-content .open-close-button, .portfolio-gallery-content .title').on('click', function(){ 22 groupID = jQuery(this).parent().parent().find('a').attr('data-groupID'); 23 jQuery(this).lightboxPortfolio(); 24 }); 25 jQuery('.portfolio-gallery-content .title-block').on('click', function(){ 26 groupID = jQuery(this).parent().find('a').attr('data-groupID'); 27 jQuery(this).lightboxPortfolio(); 28 }); 29 jQuery(' .portfolio-gallery-content .play-icon').on('click', function(){ 30 groupID = jQuery(this).parent().attr('data-groupID'); 31 jQuery(this).lightboxPortfolio(); 32 }); 33 34 function Lightbox(element, options) { 35 36 this.el = element; 37 this.$element = $(element); 38 this.$body = $('body'); 39 this.objects = {}; 40 this.videoModul = {}; 41 this.$item = ''; 42 this.$cont = ''; 43 if(jQuery('.pfhub_portfolio_portfolio_container').hasClass('view-grid') || jQuery('.pfhub_portfolio_portfolio_container').hasClass('view-masonry') || jQuery('.pfhub_portfolio_portfolio_container').hasClass('view-list') || jQuery('.portfolio-gallery-content').hasClass('view-content-slider')) { 44 if (window.location.hash.indexOf('rlightbox') > 0) { 45 groupID = window.location.hash.split('rlightbox=')[1].substr(0,3); 46 } 47 this.$items = this.$body.find('a.portfolio-group' + groupID); 48 49 } else { 50 this.$items = this.$body.find('a.portfolio_responsive_lightbox'); 51 } 52 53 this.settings = $.extend({}, this.constructor.defaults, options); 54 55 this.init(); 56 57 return this; 58 } 59 60 Lightbox.defaults = { 61 idPrefix: 'rwd-', 62 classPrefix: 'rwd-', 63 attrPrefix: 'data-', 64 slideAnimationType: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_slideAnimationType, /* effect_1 effect_2 effect_3 65 effect_4 effect_5 effect_6 66 effect_7 effect_8 effect_9 */ 67 lightboxView: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_lightboxView, // view1, view2, view3, view4 68 speed: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_speed_new, 69 width: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_width_new+'%', 70 height: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_height_new+'%', 71 videoMaxWidth: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_videoMaxWidth, 72 sizeFix: true, //not for option 73 overlayDuration: +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_overlayDuration, 74 slideAnimation: true, //not for option 75 overlayClose: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_overlayClose_new, 76 loop: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_loop_new, 77 escKey: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_escKey_new, 78 keyPress: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_keyPress_new, 79 arrows: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_arrows, 80 mouseWheel: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_mouseWheel, 81 download: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_download, 82 showCounter: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_showCounter, 83 defaultTitle: '', //some text 84 preload: 1, //not for option 85 showAfterLoad: true, //not for option 86 nextHtml: '', //not for option 87 prevHtml: '', //not for option 88 sequence_info: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_sequence_info, 89 sequenceInfo: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_sequenceInfo, 90 slideshow: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_slideshow_new, 91 slideshowAuto: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_slideshow_auto_new, 92 slideshowSpeed: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_slideshow_speed_new, 93 slideshowStart: '', //not for option 94 slideshowStop: '', //not for option 95 hideControlOnEnd: false, //not for option 96 watermark: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark, 97 socialSharing: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_socialSharing, 98 share: { 99 facebookButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_facebookButton===true, 100 twitterButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_twitterButton===true, 101 googleplusButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_googleplusButton===true, 102 pinterestButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_pinterestButton===true, 103 linkedinButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_linkedinButton===true, 104 tumblrButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_tumblrButton===true, 105 redditButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_redditButton===true, 106 bufferButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_bufferButton===true, 107 diggButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_diggButton===true, 108 vkButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_vkButton===true, 109 yummlyButton: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_yummlyButton===true 110 } 111 }; 112 113 Lightbox.prototype.init = function () { 114 115 var $object = this, 116 $hash; 117 118 $hash = window.location.hash; 119 120 ($object.settings.watermark && $('.watermark').watermark()); 121 122 if ($hash.indexOf('rlightbox') > 0) { 123 $object.index = parseInt($hash.split('&slide=')[1], 10) - 1; 124 125 $object.$body.addClass('rwd-share'); 126 if (!$object.$body.hasClass('rwd-on')) { 127 setTimeout(function () { 128 $object.build($object.index); 129 }, 900); 130 $object.$body.addClass('rwd-on'); 131 } 132 } 133 134 (($object.settings.preload > $object.$items.length) && ($object.settings.preload = $object.$items.length)); 135 136 $object.$items.on('click.rwdcustom', function (event) { 137 138 event = event || window.event; 139 event.preventDefault ? event.preventDefault() : (event.returnValue = false); 140 141 $object.index = $object.$items.index(this); 142 143 if (!$object.$body.hasClass($object.settings.classPrefix + 'on')) { 144 $object.build($object.index); 145 $object.$body.addClass($object.settings.classPrefix + 'on'); 146 } 147 148 }); 149 150 $('body').on('click', function () { 151 $object.$_y_ = window.pageYOffset; 152 }); 153 154 }; 155 156 Lightbox.prototype.build = function (index) { 157 158 var $object = this; 159 160 $object.structure(); 161 162 $object.videoModul['video'] = new $.fn.lightboxPortfolio.videoModul['video']($object.el); 163 164 $object.slide(index, false, false); 165 166 ($object.settings.keyPress && $object.addKeyEvents()); 167 168 if ($object.$items.length > 1) { 169 170 $object.arrow(); 171 172 ($object.settings.mouseWheel && $object.mousewheel()); 173 174 ($object.settings.slideshow && $object.slideShow()); 175 176 } 177 178 $object.counter(); 179 180 $object.closeGallery(); 181 182 $object.$cont.on('click.rwd-container', function () { 183 184 $object.$cont.removeClass($object.settings.classPrefix + 'hide-items'); 185 186 }); 187 188 $('.shareLook').on('click.rwd-container', function(){ 189 $(this).css({'display' : 'none'}); 190 $('.rwd-share-buttons').css({'display' : 'block'}); 191 /* setTimeout(function(){ 192 $('.shareLook').css({'display' : 'block'}); 193 $('.rwd-share-buttons').css({'display' : 'none'}); 194 }, 9000);*/ 195 }); 196 197 $object.calculateDimensions(); 198 199 }; 200 201 Lightbox.prototype.structure = function () { 202 203 var $object = this, list = '', controls = '',i, 204 subHtmlCont1 = '', subHtmlCont2 = '',subHtmlCont3 = '', 205 close1 = '', close2 = '', socialIcons = '', 206 template, $arrows, $next, $prev, 207 $_next, $_prev, $close_bg, $download_bg,$download_bg_, $contInner, $view; 208 209 $view = (this.settings.lightboxView === 'view6') ? 'rwd-view6' : ''; 210 211 this.$body.append(
212 this.objects.overlay = $('<div class="' + this.settings.classPrefix + 'overlay ' + $view + '"></div>') 213 ); 214 this.objects.overlay.css('transition-duration', this.settings.overlayDuration + 'ms'); 215 216 for (i = 0; i < this.$items.length; i++) { 217 list += '<div class="' + this.settings.classPrefix + 'item"></div>'; 218 } 219 220 $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' + 221 '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' + 222 '</svg>'; 223 224 switch (this.settings.lightboxView) { 225 case 'view1': 226 default: 227 $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' + 228 '<path d="M-311.8,340.5c-0.4-0.4-1.1-0.4-1.6,0c-0.4,0.4-0.4,1.1,0,1.6l8,8h-26.6c-0.6,0-1.1,0.5-1.1,1.1s0.5,1.1,1.1,1.1h26.6l-8,8c-0.4,0.4-0.4,1.2,0,1.6c0.4,0.4,1.2,0.4,1.6,0l10-10c0.4-0.4,0.4-1.1,0-1.6L-311.8,340.5z"/>' + 229 '</svg>'; 230 $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-333 335.5 31.5 31.5" >' + 231 '<path d="M-322.7,340.5c0.4-0.4,1.1-0.4,1.6,0c0.4,0.4,0.4,1.1,0,1.6l-8,8h26.6c0.6,0,1.1,0.5,1.1,1.1c0,0.6-0.5,1.1-1.1,1.1h-26.6l8,8c0.4,0.4,0.4,1.2,0,1.6c-0.4,0.4-1.1,0.4-1.6,0l-10-10c-0.4-0.4-0.4-1.1,0-1.6L-322.7,340.5z"/>' + 232 '</svg>'; 233 subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>'; 234 close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>'; 235 break; 236 case 'view2': 237 $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' + 238 '<g><path d="M222.4,373.4L28.2,567.7c-12.4,12.4-32.4,12.4-44.8,0c-12.4-12.4-12.4-32.4,0-44.7l171.9-171.9L-16.6,179.2c-12.4-12.4-12.4-32.4,0-44.7c12.4-12.4,32.4-12.4,44.8,0l194.3,194.3c6.2,6.2,9.3,14.3,9.3,22.4C231.7,359.2,228.6,367.3,222.4,373.4z"/></g>' + 239 '</svg>'; 240 $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' + 241 '<g><path d="M-25.9,351.1c0-8.1,3.1-16.2,9.3-22.4l194.3-194.3c12.4-12.4,32.4-12.4,44.8,0c12.4,12.4,12.4,32.4,0,44.7L50.5,351.1L222.4,523c12.4,12.4,12.4,32.4,0,44.7c-12.4,12.4-32.4,12.4-44.7,0L-16.6,373.4C-22.8,367.3-25.9,359.2-25.9,351.1z"/></g>' + 242 '</svg>'; 243 subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>'; 244 close2 = '<div class="barCont"></div><span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>'; 245 break; 246 case 'view3': 247 $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' + 248 '<g><g><path d="M141.2,596c135.2,0,245.2-110,245.2-245.2s-110-245.2-245.2-245.2S-104,215.6-104,350.8S6,596,141.2,596z M141.2,130.1c121.7,0,220.7,99,220.7,220.7s-99,220.7-220.7,220.7s-220.7-99-220.7-220.7S19.5,130.1,141.2,130.1z"/>' + 249 '<path d="M34.7,363.1h183.4l-48,48c-4.8,4.8-4.8,12.5,0,17.3c2.4,2.4,5.5,3.6,8.7,3.6s6.3-1.2,8.7-3.6l68.9-68.9c4.8-4.8,4.8-12.5,0-17.3l-68.9-68.9c-4.8-4.8-12.5-4.8-17.3,0s-4.8,12.5,0,17.3l48,48H34.7c-6.8,0-12.3,5.5-12.3,12.3C22.4,357.7,27.9,363.1,34.7,363.1z"/></g></g>' + 250 '</svg>'; 251 $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-104 105.6 490.4 490.4" >' + 252 '<g><g><path d="M141.2,596c135.2,0,245.2-110,245.2-245.2s-110-245.2-245.2-245.2S-104,215.6-104,350.8S6,596,141.2,596z M141.2,130.1c121.7,0,220.7,99,220.7,220.7s-99,220.7-220.7,220.7s-220.7-99-220.7-220.7S19.5,130.1,141.2,130.1z"/>' + 253 '<path d="M94.9,428.4c2.4,2.4,5.5,3.6,8.7,3.6s6.3-1.2,8.7-3.6c4.8-4.8,4.8-12.5,0-17.3l-48-48h183.4c6.8,0,12.3-5.5,12.3-12.3c0-6.8-5.5-12.3-12.3-12.3H64.3l48-48c4.8-4.8,4.8-12.5,0-17.3c-4.8-4.8-12.5-4.8-17.3,0l-68.9,68.9c-4.8,4.8-4.8,12.5,0,17.3L94.9,428.4z"/></g></g>' + 254 '</svg>'; 255 subHtmlCont1 = '<div class="' + this.settings.classPrefix + 'title"></div>'; 256 close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>'; 257 break; 258 case 'view4': 259 $_next = '<svg class="next_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' + 260 '<g><path d="M222.4,373.4L28.2,567.7c-12.4,12.4-32.4,12.4-44.8,0c-12.4-12.4-12.4-32.4,0-44.7l171.9-171.9L-16.6,179.2c-12.4-12.4-12.4-32.4,0-44.7c12.4-12.4,32.4
260-12.4,44.8,0l194.3,194.3c6.2,6.2,9.3,14.3,9.3,22.4C231.7,359.2,228.6,367.3,222.4,373.4z"/></g>' + 261 '</svg>'; 262 $_prev = '<svg class="prev_bg" width="22px" height="22px" fill="#999" viewBox="-123 125.2 451.8 451.8" >' + 263 '<g><path d="M-25.9,351.1c0-8.1,3.1-16.2,9.3-22.4l194.3-194.3c12.4-12.4,32.4-12.4,44.8,0c12.4,12.4,12.4,32.4,0,44.7L50.5,351.1L222.4,523c12.4,12.4,12.4,32.4,0,44.7c-12.4,12.4-32.4,12.4-44.7,0L-16.6,373.4C-22.8,367.3-25.9,359.2-25.9,351.1z"/></g>' + 264 '</svg>'; 265 $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' + 266 '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' + 267 '</svg>'; 268 subHtmlCont2 = '<div class="' + this.settings.classPrefix + 'title"></div>'; 269 close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>'; 270 break; 271 case 'view5': 272 case 'view6': 273 $_next = '<svg class="next_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' + 274 'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' + 275 '<path id="XMLID_2_" class="st0" d="M3.3,1.5L1.8,2.9l31.8,31.8c0.5,0.5,0.5,0.9,0,1.4L1.8,67.9l1.5,1.4c0.3,0.5,0.9,0.5,1.4,0' + 276 'l33.2-33.2c0.3-0.5,0.3-0.9,0-1.4L4.7,1.5C4.3,1,3.6,1,3.3,1.5L3.3,1.5z"/>' + 277 '</svg>'; 278 $_prev = '<svg class="prev_bg" width="22px" height="44px" fill="#999" x="0px" y="0px"' + 279 'viewBox="0 0 40 70" style="enable-background:new 0 0 40 70;" xml:space="preserve">' + 280 '<path id="XMLID_2_" class="st0" d="M37.1,68.9l1.5-1.4L6.8,35.7c-0.3-0.5-0.3-0.9,0-1.4L38.6,2.5l-1.5-1.4c-0.3-0.5-0.9-0.5-1.2,0' + 281 'L2.5,34.3c-0.3,0.5-0.3,0.9,0,1.4l33.4,33.2C36.2,69.4,36.8,69.4,37.1,68.9L37.1,68.9z"/>' + 282 '</svg>'; 283 $close_bg = '<svg class="close_bg" width="16px" height="16px" fill="#999" viewBox="-341 343.4 15.6 15.6">' + 284 '<path d="M-332.1,351.2l6.5-6.5c0.3-0.3,0.3-0.8,0-1.1s-0.8-0.3-1.1,0l-6.5,6.5l-6.5-6.5c-0.3-0.3-0.8-0.3-1.1,0s-0.3,0.8,0,1.1l6.5,6.5l-6.5,6.5c-0.3,0.3-0.3,0.8,0,1.1c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2l6.5-6.5l6.5,6.5c0.1,0.1,0.3,0.2,0.5,0.2s0.4-0.1,0.5-0.2c0.3-0.3,0.3-0.8,0-1.1L-332.1,351.2z"/>' + 285 '</svg>'; 286 subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'title"></div>'; 287 subHtmlCont3 += '<div class="' + this.settings.classPrefix + 'description"></div>'; 288 close1 = '<span class="' + this.settings.classPrefix + 'close ' + $object.settings.classPrefix + 'icon">' + $close_bg + '</span>'; 289 break; 290 } 291 292 if (this.settings.arrows && this.$items.length > 1) { 293 controls = '<div class="' + this.settings.classPrefix + 'arrows">' + 294 '<div class="' + this.settings.classPrefix + 'prev ' + $object.settings.classPrefix + 'icon">' + $_prev + this.settings.prevHtml + '</div>' + 295 '<div class="' + this.settings.classPrefix + 'next ' + $object.settings.classPrefix + 'icon">' + $_next + this.settings.nextHtml + '</div>' + 296 '</div>'; 297 } 298 299 if (this.settings.socialSharing && (this.settings.lightboxView !== 'view5' || this.settings.lightboxView !== 'view6')) { 300 socialIcons = '<div class="' + this.settings.classPrefix + 'socialIcons"><button class="shareLook">share</button></div>'; 301 } 302 $contInner = (this.settings.lightboxView === 'view5' || this.settings.lightboxView === 'view6') ? '<div class="contInner">' + subHtmlCont3 + '</div>' : ''; 303 var arrowHE = (this.settings.lightboxView !== 'view2' && this.settings.lightboxView !== 'view3') ? this.settings.arrowsHoverEffect : ''; 304 305 template = '<div class="' + this.settings.classPrefix + 'cont ">' + 306 '<div class="rwd-container rwd-' + this.settings.lightboxView + ' rwd-arrows_hover_effect-' + arrowHE + '">' + 307 '<div class="cont-inner">
307' + list + '</div>' + 308 $contInner + 309 '<div class="' + this.settings.classPrefix + 'toolbar group">' + 310 close1 + subHtmlCont2 + 311 '</div>' + 312 controls + 313 '<div class="' + this.settings.classPrefix + 'bar">' + 314 close2 + subHtmlCont1 + socialIcons + '</div>' + 315 '</div>' + 316 '</div>'; 317 318 319 320 if ($object.settings.socialSharing) { 321 setTimeout(function () { 322 $object.socialShare(); 323 }, 50); 324 } 325 326 this.$body.append(template); 327 this.$cont = $('.' + $object.settings.classPrefix + 'cont'); 328 this.$item = this.$cont.find('.' + $object.settings.classPrefix + 'item'); 329 330 if (!this.settings.slideAnimation) { 331 this.$cont.addClass(this.settings.classPrefix + 'animation'); 332 this.settings.slideAnimationType = this.settings.classPrefix + 'slide'; 333 } else { 334 this.$cont.addClass(this.settings.classPrefix + 'use'); 335 } 336 337 $object.calculateDimensions(); 338 339 $(window).on('resize.rwd-container', function () { 340 setTimeout(function () { 341 $object.calculateDimensions(); 342 }, 100); 343 }); 344 345 this.$item.eq(this.index).addClass(this.settings.classPrefix + 'current'); 346 347 if (this.effectsSupport()) { 348 this.$cont.addClass(this.settings.classPrefix + 'support'); 349 } else { 350 this.$cont.addClass(this.settings.classPrefix + 'noSupport'); 351 this.settings.speed = 0; 352 } 353 354 this.$cont.addClass(this.settings.slideAnimationType); 355 356 ((this.settings.showAfterLoad) && (this.$cont.addClass(this.settings.classPrefix + 'show-after-load'))); 357 358 if (this.effectsSupport()) { 359 var $inner = this.$cont.find('.cont-inner'); 360 $inner.css('transition-timing-function', 'ease'); 361 $inner.css('transition-duration', this.settings.speed + 'ms'); 362 } 363 364 switch($object.settings.lightboxView){ 365 case 'view1': 366 case 'view2': 367 case 'view3': 368 var $h = 92, 369 $t = 47; 370 371 $inner.css({ 372 height: 'calc(100% - ' + $h + 'px)', 373 top: $t + 'px' 374 }); 375 break; 376 case 'view4': 377 $inner.css({ 378 height: 'calc(100% - 92px)', 379 top: '45px' 380 }); 381 break; 382 case 'view5': 383 var $w = Math.abs(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh) + 'px', $l; 384 385 if(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh < 0){ 386 $l = Math.abs(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh); 387 jQuery('.cont-inner').css({ 388 width: 'calc(60% - ' + $w + ')', 389 left: $l + 'px' 390 }); 391 } else { 392 jQuery('.cont-inner').css({ 393 width: 'calc(60% - ' + $w + ')' 394 }); 395 } 396 break; 397 case 'view6': 398 var $w_ = Math.abs(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh) + 'px', $l_; 399 400 if(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh < 0){ 401 $l_ = Math.abs(portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_imageshadowh); 402 jQuery('.cont-inner').css({ 403 width: 'calc(80% - ' + $w_ + ')', 404 left: $l_ + 'px' 405 }); 406 } else { 407 jQuery('.cont-inner').css({ 408 width: 'calc(80% - ' + $w_ + ')' 409 }); 410 } 411 break; 412 } 413 414 $object.objects.overlay.addClass('in'); 415 416 setTimeout(function () { 417 $object.$cont.addClass($object.settings.classPrefix + 'visible'); 418 }, this.settings.overlayDuration); 419 420 if (this.settings.download) { 421 $download_bg = '<svg class="download_bg" width="20px" height="20px" stroke="#999" fill="#999" viewBox="-328 330.3 41.7 41.7" >' + 422 '<path class="st0" d="M-296.4,352.1c0.4-0.4,0.4-1.1,0-1.6c-0.4-0.4-1.1-0.4-1.6,0l-8,8V332c0-0.6-0.5-1.1-1.1-1.1c-0.6,0-1.1,0.5-1.1,1.1v26.5l-8-8c-0.4-0.4-1.2-0.4-1.6,0c-0.4,0.4-0.4,1.1,0,1.6l10,10c0.4,0.4,1.1,0.4,1.6,0L-296.4,352.1zM-288.5,359.4c0-0.6,0.5-1.1,1.1-1.1c0.6,0,1.1,0.5,1.1,1.1v10.9c0,0.6-0.5,1.1-1.1,1.1h-39.5c-0.6,0-1.1-0.5-1.1-1.1v-10.9c0-0.6,0.5-1.1,1.1-1.1c0.6,0,1.1,0.5,1.1,1.1v9.8h37.2V359.4z"/>' + 423 '</svg>'; 424 $download_bg_ = '<svg class="download_bg" width="36px" height="34px" stroke="#999" fill="#999" x="0px" y="0px"' + 425 'viewBox="0 0 90 90" style="enable-background:new 0 0 90 90;" xml:space="preserve">' +
426 '<path id="XMLID_2_" class="st0" d="M61.3,31.8L45.5,47.7c-0.2,0.2-0.5,0.2-0.7,0l-16-15.9c-0.2-0.2-0.2-0.5,0-0.7l2.1-2.1l12.6,12.6' + 427 'V7.4c0-0.9,0.7-1.7,1.7-1.7s1.8,0.8,1.8,1.7v34l12.2-12.3l2.1,2.1C61.5,31.3,61.5,31.6,61.3,31.8L61.3,31.8z"/>' + 428 '<path id="XMLID_3_" class="st0" d="M25.6,50.7L25.6,50.7h38.7c1.6,0,2.8,1.2,2.8,2.7v1.5c0,1.6-1.2,2.9-2.8,2.9H25.6' + 429 'c-1.5,0-2.8-1.3-2.8-2.9v-1.5C22.9,51.9,24.1,50.7,25.6,50.7L25.6,50.7z"/>' + 430 '</svg>'; 431 switch (this.settings.lightboxView) { 432 case 'view1': 433 default: 434 this.$cont.find('.' + $object.settings.classPrefix + 'toolbar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>'); 435 break; 436 case 'view2': 437 this.$cont.find('.' + $object.settings.classPrefix + 'bar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>'); 438 break; 439 case 'view4': 440 $('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg + '</a>').insertBefore($('.rwd-title'));; 441 break; 442 case 'view5': 443 case 'view6': 444 $('.rwd-toolbar').append('<a id="' + $object.settings.classPrefix + 'download" target="_blank" download class="' + this.settings.classPrefix + 'download ' + $object.settings.classPrefix + 'icon">' + $download_bg_ + '</a>'); 445 break; 446 } 447 } 448 449 $arrows = $('.rwd-arrows .rwd-next, .rwd-arrows .rwd-prev'); 450 $next = $('.rwd-arrows .rwd-next'); 451 $prev = $('.rwd-arrows .rwd-prev'); 452 453 switch (this.settings.lightboxView) { 454 case 'view1': 455 default: 456 $arrows.css({'top' : '50%'}); 457 $next.css({'right' : '20px'}); 458 $prev.css({'left' : '20px'}); 459 break; 460 case 'view2': 461 $arrows.css({'bottom' : '0'}); 462 $next.css({'right' : '40%'}); 463 $prev.css({'left' : '40%'}); 464 break; 465 case 'view3': 466 $arrows.css({'top' : '14px', 'z-index' : '1090000'}); 467 $next.css({'right' : '20px'}); 468 $prev.css({'right' : '55px'}); 469 $('.rwd-title').css({'text-align' : 'left','border-top' : '1px solid #999'}); 470 $('.rwd-close').css({'margin-right' : '45%'}); 471 $('.rwd-overlay, .rwd-toolbar, .rwd-title, .rwd-next, .rwd-prev').css({'background' : 'rgba(255, 255, 255, 1)'}); 472 $('.rwd-title, .shareLook').css({'color' : '#999'}); 473 $('.rwd-toolbar').css({'border-bottom' : '1px solid #999'}); 474 $('.rwd-toolbar .rwd-icon, .rwd-arrows .rwd-icon').addClass('rwd-icon0'); 475 break; 476 } 477 478 this.prevScrollTop = $(window).scrollTop(); 479 480 $object.objects.content = $('.rwd-container'); 481 482 $object.objects.content.css({ 483 'width': $object.settings.width, 484 'height': $object.settings.height 485 }); 486 487 if(portfolioGalleryDisableRightClickLightbox == 'on') { 488 setTimeout(function () { 489 $('.rwd-container').bind('contextmenu', function () { 490 return false; 491 }); 492 }, 50); 493 } 494 495 }; 496 497 Lightbox.prototype.calculateDimensions = function () { 498 var $object = this, $width; 499 500 $width = $('.' + $object.settings.classPrefix + 'current').height() * 16 / 9; 501 502 if ($width > $object.settings.videoMaxWidth) { 503 $width = $object.settings.videoMaxWidth; 504 } 505 506 $('.' + $object.settings.classPrefix + 'video-cont ').css({ 507 'max-width': $width + 'px' 508 }); 509 510 }; 511 512 Lightbox.prototype.effectsSupport = function () { 513 var transition, root, support; 514 support = function () { 515 transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 516 root = document.documentElement; 517 for (var i = 0; i < transition.length; i++) { 518 if (transition[i] in root.style) { 519 return transition[i] in root.style; 520 } 521 } 522 }; 523 524 return support(); 525 }; 526 527 Lightbox.prototype.isVideo = function (src, index) { 528 529 var youtube, vimeo; 530 531 youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); 532 vimeo = src.match(/\/\/?player.vimeo.com\/([0-9a-z\-_]+)/i); 533 534 if (youtube) { 535 return { 536 youtube: youtube 537 }; 538 } else if (vimeo) { 539 return { 540 vimeo: vimeo 541 }; 542 } 543 }; 544 545 Lightbox.prototype.counter = function () { 546 if (this.settings.showCounter) { 547 switch (this.settings.lightboxView) { 548 case 'view1': 549 default: 550 $('.' + this.settings.classPrefix + 'toolbar').append(this.objects.counter = $('<
550div id="' + this.settings.idPrefix + 'counter"></div>')); 551 $('#rwd-counter').css({'padding-left' : '23px'}); 552 break; 553 case 'view2': 554 case 'view4': 555 $('.' + this.settings.classPrefix + 'bar').append('<div class="barCont"></div>').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>')); 556 break; 557 case 'view5': 558 case 'view6': 559 $('.contInner').append(this.objects.counter = $('<div id="' + this.settings.idPrefix + 'counter"></div>')); 560 break; 561 } 562 563 this.objects.counter.append( 564 this.objects.current = $('<div>' + this.settings.sequence_info + ' <span id="' + this.settings.idPrefix + 'counter-current">' + (parseInt(this.index, 10) + 1) + '</span> ' + 565 this.settings.sequenceInfo + ' <span id="' + this.settings.idPrefix + 'counter-all">' + this.$items.length + '</span></div>') 566 ); 567 } 568 }; 569 570 Lightbox.prototype.setTitle = function (index) { 571 var $object = this, $title, $currentElement; 572 573 574 $currentElement = this.$items.eq(index); 575 $title = $currentElement.find('img').attr('alt') || 576 $currentElement.find('img').attr('title') || 577 this.settings.defaultTitle || ''; 578 579 580 this.$cont.find('.' + this.settings.classPrefix + 'title').html('<div class="rwd-title-text">'+$title+'</div>'); 581 582 (($object.settings.lightboxView === 'view2') && $('.rwd-title-text').css({'width' : '100%'})); 583 584 if($object.settings.lightboxView !== 'view1' && $object.settings.lightboxView !== 'view3' && $object.settings.lightboxView !== 'view4'){ 585 ($title === '' && $object.settings.socialSharing) ? 586 this.$cont.find('.' + this.settings.classPrefix + 'title').hide() : 587 this.$cont.find('.' + this.settings.classPrefix + 'title').show(); 588 } 589 }; 590 Lightbox.prototype.setDescription = function (index) { 591 var $object = this, $description, $currentElement; 592 593 $currentElement = this.$items.eq(index); 594 $description = $currentElement.attr('data-description') || ''; 595 596 this.$cont.find('.' + this.settings.classPrefix + 'description').html('<div class="rwd-description-text" title="' + $description + '">' + $description + '</div>'); 597 }; 598 Lightbox.prototype.preload = function (index) { 599 for (var i = 1; i <= this.settings.preload; i++) { 600 if (i >= this.$items.length - index) { 601 break; 602 } 603 604 this.loadContent(index + i, false, 0); 605 } 606 607 for (var j = 1; j <= this.settings.preload; j++) { 608 if (index - j < 0) { 609 break; 610 } 611 612 this.loadContent(index - j, false, 0); 613 } 614 }; 615 616 Lightbox.prototype.socialShare = function () { 617 var $object = this; 618 619 var shareButtons = '<ul class="rwd-share-buttons">'; 620 shareButtons += $object.settings.share.facebookButton ? '<li><a title="Facebook" id="rwd-share-facebook" target="_blank"></a></li>' : ''; 621 shareButtons += $object.settings.share.twitterButton ? '<li><a title="Twitter" id="rwd-share-twitter" target="_blank"></a></li>' : ''; 622 shareButtons += $object.settings.share.googleplusButton ? '<li><a title="Google Plus" id="rwd-share-googleplus" target="_blank"></a></li>' : ''; 623 shareButtons += $object.settings.share.pinterestButton ? '<li><a title="Pinterest" id="rwd-share-pinterest" target="_blank"></a></li>' : ''; 624 shareButtons += $object.settings.share.linkedinButton ? '<li><a title="Linkedin" id="rwd-share-linkedin" target="_blank"></a></li>' : ''; 625 shareButtons += $object.settings.share.tumblrButton ? '<li><a title="Tumblr" id="rwd-share-tumblr" target="_blank"></a></li>' : ''; 626 shareButtons += $object.settings.share.redditButton ? '<li><a title="Reddit" id="rwd-share-reddit" target="_blank"></a></li>' : ''; 627 shareButtons += $object.settings.share.bufferButton ? '<li><a title="Buffer" id="rwd-share-buffer" target="_blank"></a></li>' : ''; 628 shareButtons += $object.settings.share.diggButton ? '<li><a title="Digg" id="rwd-share-digg" target="_blank"></a></li>' : ''; 629 shareButtons += $object.settings.share.vkButton ? '<li>
629<a title="VK" id="rwd-share-vk" target="_blank"></a></li>' : ''; 630 shareButtons += $object.settings.share.yummlyButton ? '<li><a title="Yummly" id="rwd-share-yummly" target="_blank"></a></li>' : ''; 631 shareButtons += '</ul>'; 632 633 if (this.settings.lightboxView === 'view5' || this.settings.lightboxView === 'view6') { 634 $('.contInner').append(shareButtons); 635 } else { 636 $('.' + this.settings.classPrefix + 'socialIcons').append(shareButtons); 637 } 638 639 640 setTimeout(function () { 641 $('#rwd-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(window.location.href))); 642 $('#rwd-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=&url=' + (encodeURIComponent(window.location.href))); 643 $('#rwd-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(window.location.href))); 644 $('#rwd-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(window.location.href))); 645 $('#rwd-share-linkedin').attr('href', 'http://www.linkedin.com/shareArticle?mini=true&url=' + (encodeURIComponent(window.location.href))); 646 $('#rwd-share-tumblr').attr('href', 'http://www.tumblr.com/share/link?url=' + (encodeURIComponent(window.location.href))); 647 $('#rwd-share-reddit').attr('href', 'http://reddit.com/submit?url=' + (encodeURIComponent(window.location.href))); 648 $('#rwd-share-buffer').attr('href', 'https://bufferapp.com/add?url=' + (encodeURIComponent(window.location.href))); 649 $('#rwd-share-digg').attr('href', 'http://www.digg.com/submit?url=' + (encodeURIComponent(window.location.href))); 650 $('#rwd-share-vk').attr('href', 'http://vkontakte.ru/share.php?url=' + (encodeURIComponent(window.location.href))); 651 $('#rwd-share-yummly').attr('href', 'http://www.yummly.com/urb/verify?url=' + (encodeURIComponent(window.location.href))); 652 }, 200); 653 }; 654 655 Lightbox.prototype.changeHash = function (index) { 656 var $object = this; 657 658 (($object.settings.socialSharing) && (window.location.hash = '/rlightbox=' + groupID + '&slide=' + (index + 1))); 659 }; 660 661 Lightbox.prototype.loadContent = function (index, rec, delay) { 662 663 var $object, src, isVideo; 664 665 $object = this; 666 667 function isImg() { 668 src = $object.$items.eq(index).attr('href'); 669 670 return src.match(/\.(jpg|png|gif)\b/); 671 } 672 673 if ($object.settings.watermark) { 674 675 if (isImg()) { 676 if(performance.navigation.type === 1 && !jQuery('.pfhub_portfolio_portfolio_container').hasClass('view-image-grid') && this.settings.socialSharing){ 677 src = $object.$items.eq(index).attr('href'); 678 } else { 679 src = $object.$items.eq(index).find('img').attr('data-src'); 680 } 681 } 682 } else { 683 src = $object.$items.eq(index).attr('href'); 684 } 685 686 isVideo = $object.isVideo(src, index); 687 688 if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'loaded')) { 689 if (isVideo) { 690 $object.$item.eq(index).prepend('<div class="' + this.settings.classPrefix + 'video-cont "><div class="' + this.settings.classPrefix + 'video"></div></div>'); 691 $object.$element.trigger('hasVideo.rwd-container', [index, src]); 692 } else { 693 $object.$item.eq(index).prepend('<div class="rwd-img-wrap"><img class="rwd-object rwd-image watermark" src="' + src + '" /></div>'); 694 } 695 696 $object.$element.trigger('onAferAppendSlide.rwd-container', [index]); 697 698 $object.$item.eq(index).addClass($object.settings.classPrefix + 'loaded'); 699 } 700 701 $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () { 702 703 var speed = 0; 704 if (delay) { 705 speed = delay; 706 } 707 708 setTimeout(function () { 709 $object.$item.eq(index).addClass($object.settings.classPrefix + 'complete'); 710 }, speed); 711 712 }); 713 714 if (rec === true) { 715 716 if (!$object.$item.eq(index).hasClass($object.settings.classPrefix + 'complete')) { 717 $object.$item.eq(index).find('.' + $object.settings.classPrefix + 'object').on('load.rwd-container error.rwd-container', function () { 718 $object.preload(index); 719 }); 720 } else { 721 $object.preload(index); 722 } 723 } 724 725 }; 726 727 Lightbox.prototype.slide = function (index, fromSlide, fromThumb) { 728 729 var $object, prevIndex; 730 $object = this; 731 prevIndex = this.$cont.find('.' + $object.settings.classPrefix + 'current').index(); 732 733 var length = this.$item.length, 734 time = 0, 735 next = false, 736 prev = false;
737 738 if (this.settings.download) { 739 var src; 740 if (! this.settings.watermark ) { 741 src = $object.$items.eq(index).attr('data-download-url') !== 'false' && ($object.$items.eq(index).attr('data-download-url') || $object.$items.eq(index).attr('href')); 742 } 743 else{ 744 src = $object.$items.eq(index).find('img').attr('data-src'); 745 } 746 if (src) { 747 $('#' + $object.settings.classPrefix + 'download').attr('href', src); 748 $object.$cont.removeClass($object.settings.classPrefix + 'hide-download'); 749 } else { 750 $object.$cont.addClass($object.settings.classPrefix + 'hide-download'); 751 } 752 } 753 754 this.$element.trigger('onBeforeSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]); 755 756 setTimeout(function () { 757 $object.setTitle(index); 758 }, time); 759 if ($object.settings.lightboxView === 'view5' || $object.settings.lightboxView === 'view6') { 760 setTimeout(function () { 761 $object.setDescription(index); 762 }, time); 763 } 764 this.arrowDisable(index); 765 766 767 $object.$cont.addClass($object.settings.classPrefix + 'no-trans'); 768 769 this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'next-slide'); 770 if (!fromSlide) { 771 772 if (index < prevIndex) { 773 prev = true; 774 if ((index === 0) && (prevIndex === length - 1) && !fromThumb) { 775 prev = false; 776 next = true; 777 } 778 } else if (index > prevIndex) { 779 next = true; 780 if ((index === length - 1) && (prevIndex === 0) && !fromThumb) { 781 prev = true; 782 next = false; 783 } 784 } 785 786 if (prev) { 787 788 this.$item.eq(index).addClass($object.settings.classPrefix + 'prev-slide'); 789 this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'next-slide'); 790 } else if (next) { 791 792 this.$item.eq(index).addClass($object.settings.classPrefix + 'next-slide'); 793 this.$item.eq(prevIndex).addClass($object.settings.classPrefix + 'prev-slide'); 794 } 795 796 setTimeout(function () { 797 $object.$item.removeClass($object.settings.classPrefix + 'current'); 798 799 $object.$item.eq(index).addClass($object.settings.classPrefix + 'current'); 800 801 $object.$cont.removeClass($object.settings.classPrefix + 'no-trans'); 802 }, 50); 803 } else { 804 805 var slidePrev = index - 1; 806 var slideNext = index + 1; 807 808 if ((index === 0) && (prevIndex === length - 1)) { 809 810 slideNext = 0; 811 slidePrev = length - 1; 812 } else if ((index === length - 1) && (prevIndex === 0)) { 813 814 slideNext = 0; 815 slidePrev = length - 1; 816 } 817 818 this.$item.removeClass($object.settings.classPrefix + 'prev-slide ' + $object.settings.classPrefix + 'current ' + $object.settings.classPrefix + 'next-slide'); 819 $object.$item.eq(slidePrev).addClass($object.settings.classPrefix + 'prev-slide'); 820 $object.$item.eq(slideNext).addClass($object.settings.classPrefix + 'next-slide'); 821 $object.$item.eq(index).addClass($object.settings.classPrefix + 'current'); 822 } 823 824 $object.loadContent(index, true, $object.settings.overlayDuration); 825 826 $object.$element.trigger('onAfterSlide.rwd-container', [prevIndex, index, fromSlide, fromThumb]); 827 828 if (this.settings.showCounter) { 829 $('#' + $object.settings.classPrefix + 'counter-current').text(index + 1); 830 } 831 832 if (this.settings.socialSharing) { 833 $object.changeHash(index); 834 } 835 836 $object.calculateDimensions(); 837 838 }; 839 840 Lightbox.prototype.goToNextSlide = function (fromSlide) { 841 var $object = this; 842 if (($object.index + 1) < $object.$item.length) { 843 $object.index++; 844 $object.slide($object.index, fromSlide, false); 845 } else { 846 if ($object.settings.loop) { 847 $object.index = 0; 848 $object.slide($object.index, fromSlide, false); 849 } 850 } 851 }; 852 853 Lightbox.prototype.goToPrevSlide = function (fromSlide) { 854 var $object = this; 855 if ($object.index > 0) { 856 $object.index--; 857 $object.slide($object.index, fromSlide, false); 858 } else { 859 if ($object.settings.loop) { 860 $object.index = $object.$items.length - 1; 861 $object.slide($object.index, fromSlide, false); 862 } 863 } 864 }; 865 866 Lightbox.prototype.slideShow = function () { 867 var $object = this, $toolbar, $play_bg, $pause_bg; 868 869 $play_bg = '<svg class="play_bg" width="20px" height="20px" fill="#999" viewBox="-192 193.9 314.1 314.1">' + 870 '<g><g id="_x33_56._Play"><g><path d="M101,272.5C57.6,197.4-38.4,171.6-113.5,215c-75.1,43.4-100.8,139.4-57.5,214.5c43.4,75.1,139.4,100.8,214.5,57.5C118.6,443.6,144.4,347.6,101,272.5z M27.8,459.7c-60.1,34.7-136.9,14.1-171.6-46c-34.7-60.1-14.1-136.9,46-171.6c60.1-34.7,136.9-14.1,171.6,46C108.5,348.2,87.9,425,27.8,459.7z M21.6,344.6l-82.2-47.9c-7.5-4.4-13.5-0.9-13.5,7.8l0.4,95.2c0,8.7,6.2,12.2,13.7,7.9l81.6-47.1C29,356,29,349,21.6,344.6z"/></g></g></g>' + 871 '</svg>'; 872 $pause_bg = '<svg class="pause_bg" width="20px" height="20px" fill="#999" viewBox="-94 96 510 510" >' + 873 '<g><g id="pause-circle-outline"><path d="M84.5,453h51V249h-51V453z M161,96C20.8,96-94,210.8-94,351S20.8,606,161,606s255-114.8,255-255S301.3,96,161,96zM161,555C48.8,555-43,463.2-43,351s91.8-204,204-204s204,91.8,204,204S273.2,555,161,555z M186.5,453h51V249h-51V453z"/></g></g>' + 874 '</svg>'; 875 876 $toolbar = $('.' + $object.settings.classPrefix + 'toolbar'); 877 switch (this.settings.lightboxView) { 878 case 'view1': 879 default: 880 $toolbar.append('<span class="' + $object.settings.classPrefix + 'auto
880play-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>'); 881 break; 882 case 'view2': 883 $('.' + $object.settings.classPrefix + 'bar').append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>'); 884 break; 885 case 'view3': 886 $toolbar.append('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>'); 887 $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0'); 888 break; 889 case 'view4': 890 $('<span class="' + $object.settings.classPrefix + 'autoplay-button ' + $object.settings.classPrefix + 'icon">' + $play_bg + $pause_bg + '</span>').insertBefore($('.rwd-title')); 891 $('.rwd-toolbar .rwd-icon').addClass('rwd-icon0'); 892 break; 893 } 894 if ($object.settings.slideshowAuto) { 895 $object.slideshowAuto(); 896 } 897 898 $object.$cont.find('.' + $object.settings.classPrefix + 'autoplay-button').on('click.rwd-container', function () { 899 !$($object.$cont).hasClass($object.settings.classPrefix + 'show-autoplay') ? $object.startSlide() : $object.stopSlide(); 900 }); 901 902 }; 903 904 Lightbox.prototype.slideshowAuto = function () { 905 var $object = this; 906 907 $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay'); 908 $object.startSlide(); 909 }; 910 911 Lightbox.prototype.startSlide = function () { 912 var $object = this; 913 $object.$cont.addClass('' + $object.settings.classPrefix + 'show-autoplay'); 914 $('.rwd-autoplay-button > .pause_bg').css({'display' : 'inline-block'}); 915 $('.rwd-autoplay-button > .play_bg').css({'display' : 'none'}); 916 $object.interval = setInterval(function () { 917 $object.goToNextSlide(); 918 }, $object.settings.slideshowSpeed); 919 }; 920 921 Lightbox.prototype.stopSlide = function () { 922 clearInterval(this.interval); 923 this.$cont.removeClass(this.settings.classPrefix + 'show-autoplay'); 924 $('.rwd-autoplay-button > .pause_bg').css({'display' : 'none'}); 925 $('.rwd-autoplay-button > .play_bg').css({'display' : 'inline-block'}); 926 }; 927 928 Lightbox.prototype.addKeyEvents = function () { 929 var $object = this; 930 if (this.$items.length > 1) { 931 $(window).on('keyup.rwd-container', function (e) { 932 if ($object.$items.length > 1) { 933 if (e.keyCode === 37) { 934 e.preventDefault(); 935 $object.goToPrevSlide(); 936 } 937 938 if (e.keyCode === 39) { 939 e.preventDefault(); 940 $object.goToNextSlide(); 941 } 942 } 943 }); 944 } 945 946 $(window).on('keydown.rwd-container', function (e) { 947 if ($object.settings.escKey === true && e.keyCode === 27) { 948 e.preventDefault(); 949 if (!$object.$cont.hasClass($object.settings.classPrefix + 'thumb-open')) { 950 $object.destroy(); 951 } else { 952 $object.$cont.removeClass($object.settings.classPrefix + 'thumb-open'); 953 } 954 } 955 }); 956 }; 957 958 Lightbox.prototype.arrow = function () { 959 var $object = this; 960 this.$cont.find('.' + $object.settings.classPrefix + 'prev').on('click.rwd-container', function () { 961 $object.goToPrevSlide(); 962 }); 963 964 this.$cont.find('.' + $object.settings.classPrefix + 'next').on('click.rwd-container', function () { 965 $object.goToNextSlide(); 966 }); 967 }; 968 969 Lightbox.prototype.arrowDisable = function (index) { 970 971 if (!this.settings.loop && this.settings.hideControlOnEnd) { 972 if ((index + 1) < this.$item.length) { 973 this.$cont.find('.' + this.settings.classPrefix + 'next').removeAttr('disabled').removeClass('disabled'); 974 } else { 975 this.$cont.find('.' + this.settings.classPrefix + 'next').attr('disabled', 'disabled').addClass('disabled'); 976 } 977 978 if (index > 0) { 979 this.$cont.find('.' + this.settings.classPrefix + 'prev').removeAttr('disabled').removeClass('disabled'); 980 } else { 981 this.$cont.find('.' + this.settings.classPrefix + 'prev').attr('disabled', 'disabled').addClass('disabled'); 982 } 983 } 984 }; 985 986 Lightbox.prototype.setTranslate = function ($element, xValue, yValue) { 987 if (!this.settings.slideAnimation) { 988 $element.css('left', xValue); 989 } else { 990 $element.css({ 991 transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' 992 }); 993 } 994 }; 995 996 Lightbox.prototype.mousewheel = function () { 997 var $object = this, delta; 998 999 $object.$cont.on('mousewheel', function (e) { 1000 e = e || window.event; 1001 delta = e.deltaY || e.detail || e.wheelDelta; 1002 1003 (delta > 0) ? $object.goToNextSlide() : $object.goToPrevSlide(); 1004 e.preventDefault ? e.preventDefault() : (e.returnValue = false); 1005 }); 1006 1007 }; 1008 1009 Lightbox.prototype.closeGallery = function () { 1010 1011 var $object = this, mousedown = false;
1012 1013 this.$cont.find('.' + $object.settings.classPrefix + 'close').on('click.rwd-container', function () { 1014 $object.destroy(); 1015 }); 1016 1017 if ($object.settings.overlayClose) { 1018 1019 $object.$cont.on('mousedown.rwd-container', function (e) { 1020 1021 mousedown = ($(e.target).is('.' + $object.settings.classPrefix + 'cont') || $(e.target).is('.' + $object.settings.classPrefix + 'item ') || $(e.target).is('.' + $object.settings.classPrefix + 'img-wrap')); 1022 1023 }); 1024 1025 $object.$cont.on('mouseup.rwd-container', function (e) { 1026 1027 if ($(e.target).is('.' + $object.settings.classPrefix + 'cont') || $(e.target).is('.' + $object.settings.classPrefix + 'item ') || $(e.target).is('.' + $object.settings.classPrefix + 'img-wrap') && mousedown) { 1028 if (!$object.$cont.hasClass($object.settings.classPrefix + 'dragEvent')) { 1029 $object.destroy(); 1030 } 1031 } 1032 1033 }); 1034 1035 } 1036 1037 }; 1038 1039 Lightbox.prototype.destroy = function (d) { 1040 1041 var $object = this; 1042 1043 clearInterval($object.interval); 1044 1045 $object.$body.removeClass($object.settings.classPrefix + 'on'); 1046 1047 $(window).scrollTop($object.prevScrollTop); 1048 1049 if (d) { 1050 $.removeData($object.el, 'lightbox'); 1051 } 1052 1053 ($object.settings.socialSharing && (window.location.hash = '')); 1054 1055 this.$element.off('.rwd-container.tm'); 1056 1057 $(window).off('.rwd-container'); 1058 1059 if ($object.$cont) { 1060 $object.$cont.removeClass($object.settings.classPrefix + 'visible'); 1061 } 1062 1063 $object.objects.overlay.removeClass('in'); 1064 1065 setTimeout(function () { 1066 if ($object.$cont) { 1067 $object.$cont.remove(); 1068 } 1069 1070 $object.objects.overlay.remove(); 1071 1072 }, $object.settings.overlayDuration + 50); 1073 1074 window.scrollTo(0, $object.$_y_); 1075 }; 1076 $.fn.lightboxPortfolio = function (options) { 1077 return this.each(function () { 1078 if (!$.data(this, 'lightbox')) { 1079 $.data(this, 'lightbox', new Lightbox(this, options)); 1080 } 1081 }); 1082 }; 1083 1084 $.fn.lightboxPortfolio.videoModul = {}; 1085 1086 var Video = function (element) { 1087 1088 this.core = $(element).data('lightbox'); 1089 1090 this.$element = $(element); 1091 this.core.videoSettings = $.extend({}, this.constructor.defaultsVideo, this.core.videoSettings); 1092 1093 this.init(); 1094 1095 return this; 1096 }; 1097 1098 Video.defaultsVideo = { 1099 idPrefix: 'rwd-', 1100 classPrefix: 'rwd-', 1101 attrPrefix: 'data-', 1102 videoMaxWidth: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_videoMaxWidth, //Assigned with line 34 1103 //videoMaxHeight: '100%', 1104 youtubePlayerParams: false, 1105 vimeoPlayerParams: false 1106 }; 1107 1108 Video.prototype.init = function () { 1109 var $object = this; 1110 1111 $object.core.$element.on('hasVideo.rwd-container.tm', function (event, index, src) { 1112 $object.core.$item.eq(index).find('.' + $object.core.videoSettings.classPrefix + 'video').append($object.loadVideo(src, '' + $object.core.videoSettings.classPrefix + 'object', index)); 1113 }); 1114 1115 $object.core.$element.on('onAferAppendSlide.rwd-container.tm', function (event, index) { 1116 $object.core.$item.eq(index).find('.' + $object.core.settings.classPrefix + 'video-cont').css({ 1117 'max-width': $object.core.videoSettings.videoMaxWidth + 'px' 1118 //'max-height' : $object.core.videoSettings.videoMaxHeight 1119 }); 1120 }); 1121 1122 $object.core.$element.on('onBeforeSlide.rwd-container.tm', function (event, prevIndex, index) { 1123 1124 var $videoSlide = $object.core.$item.eq(prevIndex), 1125 youtubePlayer = $videoSlide.find('.rwd-youtube').get(0), 1126 vimeoPlayer = $videoSlide.find('.rwd-vimeo').get(0); 1127 1128 if (youtubePlayer) { 1129 youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 1130 } else if (vimeoPlayer) { 1131 try { 1132 $f(vimeoPlayer).api('pause'); 1133 } catch (e) { 1134 console.error('Make sure you have included froogaloop2 js'); 1135 } 1136 } 1137 1138 var src; 1139 src = $object.core.$items.eq(index).attr('href'); 1140 1141 var isVideo = $object.core.isVideo(src, index) || {}; 1142 if (isVideo.youtube || isVideo.vimeo) { 1143 $object.core.$cont.addClass('' + $object.core.videoSettings.classPrefix + 'hide-download'); 1144 } 1145 1146 }); 1147 1148 $object.core.$element.on('onAfterSlide.rwd-container.tm', function (event, prevIndex) { 1149 $object.core.$item.eq(prevIndex).removeClass($object.core.videoSettings.classPrefix + 'video-playing'); 1150 }); 1151 }; 1152 1153 Video.prototype.loadVideo = function (src, addClass, index) { 1154 var video = '', 1155 autoplay = 0, 1156 a = '', 1157 isVideo = this.core.isVideo(src, index) || {}; 1158 1159 if (isVideo.youtube) { 1160 1161 a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; 1162 if (this.core.videoSettings.youtubePlayerParams) { 1163 a = a + '&' + $.param(this.core.videoSettings.youtubePlayerParams); 1164 } 1165 1166 video = '<iframe class="' + this.core.videoSettings.classPrefix + 'video-object ' + this.core.videoSettings.classPrefix + 'youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>'; 1167 1168 } else if (isVideo.vimeo) { 1169 1170 a = '?autoplay=' + autoplay + '&api=1'; 1171 if (this.core.videoSettings.vimeoPlayerParams) { 1172 a = a + '&' + $.param(this.core.videoSettings.vimeoPlayerParams); 1173 } 1174 1175 video = '<iframe class="' + this.core.videoSettings.classPrefix + 'video-object ' + this.core.videoSettings.classPrefix + 'vimeo ' + addClass + '" width="560" height="315" src="'+src + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; 1176 1177 } 1178 1179 return video; 1180 }; 1181 1182 $.fn.lightboxPortfolio.videoModul.video = Video; 1183 1184 var WaterMark = function (element) { 1185 this.element = element; 1186 this.settings = $.extend({}, this.constructor.defaults); 1187 this.init(); 1188 }; 1189 1190 WaterMark.defaults = { 1191 imgSrc: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_img_src_new, 1192 text: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_text, 1193 textColor: '#' + portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_textColor, 1194 textFontSize: +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_textFontSize,
1195 containerBackground: portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_container_bg_color, 1196 containerWidth: +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_containerWidth, 1197 position: 'pos'+portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_position_new, 1198 opacity: +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_opacity / 100, 1199 margin: +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_margin, 1200 done: function (imgURL) { 1201 this.dataset.src = imgURL; 1202 } 1203 }; 1204 1205 WaterMark.prototype.init = function () { 1206 1207 var $object = this, 1208 $elem = $object.element, 1209 $settings = $object.settings, 1210 wmData = {}, 1211 imageData = {}; 1212 1213 var WatermarkImage = jQuery('<img />'); 1214 WatermarkImage.attr('src',$object.settings.imgSrc); 1215 WatermarkImage.css('display','none').attr('id','pfhub_portfolio_watermark_img_sample'); 1216 if(!jQuery('body').find('#pfhub_portfolio_watermark_img_sample').length) { 1217 jQuery('body').append(WatermarkImage); 1218 } 1219 1220 wmData = { 1221 imgurl: $settings.imgSrc, 1222 type: 'jpeg' 1223 }; 1224 1225 imageData = { 1226 imgurl: $elem.dataset.imgsrc 1227 }; 1228 1229 var defer = $.Deferred(); 1230 1231 $.when(defer).done(function (imgObj) { 1232 imageData.$wmObject = imgObj; 1233 1234 $object.imgurltodata(imageData, function (dataURL) { 1235 $settings.done.call($elem, dataURL); 1236 }); 1237 }); 1238 1239 if ($settings.text !== '') { 1240 wmData.imgurl = $object.textwatermark(); 1241 } 1242 1243 $object.imgurltodata(wmData, function (imgObj) { 1244 defer.resolve(imgObj); 1245 }); 1246 }; 1247 1248 WaterMark.prototype.textwatermark = function () { 1249 var $object = this, 1250 $settings, 1251 canvas, 1252 context, 1253 $width, 1254 $height; 1255 1256 $settings = $object.settings; 1257 canvas = document.createElement('canvas'); 1258 context = canvas.getContext('2d'); 1259 1260 $width = $settings.containerWidth; 1261 $height = $settings.textFontSize; 1262 1263 canvas.width = $width; 1264 canvas.height = $height; 1265 1266 context.fillStyle = $settings.containerBackground; 1267 context.fillRect(0, 0, $width, $height); 1268 1269 context.fillStyle = $settings.textColor; 1270 context.textAlign = 'center'; 1271 context.font = '500 ' + $settings.textFontSize + 'px Sans-serif'; 1272 1273 context.fillText($settings.text, ($width / 2), ($height - 5)); 1274 1275 return canvas.toDataURL(); 1276 }; 1277 1278 WaterMark.prototype.imgurltodata = function (data, callback) { 1279 1280 var $object = this, 1281 $settings = $object.settings, 1282 img; 1283 1284 img = new Image(); 1285 img.setAttribute('crossOrigin', 'anonymous'); 1286 img.onload = function () { 1287 1288 var canvas = document.createElement('canvas'), 1289 context = canvas.getContext('2d'), 1290 1291 $imgWidth = this.width, 1292 $imgHeight = this.height; 1293 1294 if (data.$wmObject) { 1295 1296 if (data.width !== 'auto' && data.height === 'auto' && data.width < $imgWidth) { 1297 $imgHeight = $imgHeight / $imgWidth * data.width; 1298 $imgWidth = data.width; 1299 } else if (data.width === 'auto' && data.height !== 'auto' && data.height < $imgHeight) { 1300 $imgWidth = $imgWidth / $imgHeight * data.height; 1301 $imgHeight = data.height; 1302 } else if (data.width !== 'auto' && data.height !== 'auto' && data.width < $imgWidth && data.height < $imgHeight) { 1303 $imgWidth = data.width; 1304 $imgHeight = data.height; 1305 } 1306 1307 } 1308 1309 1310 canvas.width = $imgWidth; 1311 canvas.height = $imgHeight; 1312 1313 /*if (data.type === 'jpeg') { 1314 context.fillStyle = '#ffffff'; 1315 context.fillRect(0, 0, $imgWidth, $imgHeight); 1316 }*/ 1317 1318 context.drawImage(this, 0, 0, $imgWidth, $imgHeight); 1319 1320 if (data.$wmObject) { 1321 1322 var $opacity = +portfolio_resp_lightbox_obj.pfhub_portfolio_lightbox_watermark_containerOpacity/100; 1323 if ($opacity >= 0 && $opacity <= 1) { 1324 //context.globalAlpha = $settings.opacity; 1325 context.globalAlpha = $opacity; 1326 } 1327 1328 var $wmWidth, 1329 $wmHeight, 1330 pos = $settings.margin, 1331 $x, $y; 1332 if ($settings.text !== '') { 1333 $wmWidth = data.$wmObject.width; 1334 $wmHeight = data.$wmObject.height; 1335 } 1336 else{ 1337 $wmWidth = $settings.containerWidth; 1338 $wmHeight = (jQuery('img#pfhub_portfolio_watermark_img_sample').prop('naturalHeight')*$wmWidth)/jQuery('img#pfhub_portfolio_watermark_img_sample').prop('naturalWi
1338dth'); 1339 } 1340 1341 switch ($settings.position) { 1342 case 'pos1': 1343 $x = pos; 1344 $y = pos; 1345 break; 1346 case 'pos2': 1347 $x = $imgWidth / 2 - $wmWidth / 2; 1348 $y = pos; 1349 break; 1350 case 'pos3': 1351 $x = $imgWidth - $wmWidth - pos; 1352 $y = pos; 1353 break; 1354 case 'pos4': 1355 $x = pos; 1356 $y = $imgHeight / 2 - $wmHeight / 2; 1357 break; 1358 case 'pos5': 1359 $x = $imgWidth / 2 - $wmWidth / 2; 1360 $y = $imgHeight / 2 - $wmHeight / 2; 1361 break; 1362 case 'pos6': 1363 $x = $imgWidth - $wmWidth - pos; 1364 $y = $imgHeight / 2 - $wmHeight / 2; 1365 break; 1366 case 'pos7': 1367 $x = pos; 1368 $y = $imgHeight - $wmHeight - pos; 1369 break; 1370 case 'pos8': 1371 $x = $imgWidth / 2 - $wmWidth / 2; 1372 $y = $imgHeight - $wmHeight - pos; 1373 break; 1374 case 'pos9': 1375 $x = $imgWidth - $wmWidth - pos; 1376 $y = $imgHeight - $wmHeight - pos; 1377 break; 1378 default: 1379 $x = $imgWidth - $wmWidth - pos; 1380 $y = $imgHeight - $wmHeight - pos; 1381 } 1382 context.drawImage(data.$wmObject, $x, $y, $wmWidth, $wmHeight); 1383 } 1384 1385 var dataURL = canvas.toDataURL('image/' + data.type); 1386 1387 if (typeof callback === 'function') { 1388 1389 if (data.$wmObject) { 1390 callback(dataURL); 1391 1392 } else { 1393 var $wmNew = new Image(); 1394 $wmNew.src = dataURL; 1395 callback($wmNew); 1396 } 1397 } 1398 1399 canvas = null; 1400 }; 1401 1402 img.src = data.imgurl; 1403 1404 }; 1405 1406 $.fn['watermark'] = function () { 1407 return this.each(function () { 1408 if (!$.data(this, 'watermark')) { 1409 $.data(this, 'watermark', new WaterMark(this)); 1410 } 1411 }); 1412 }; 1413 1414})(jQuery);
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.