1/* 2 * Copyright (c) 2014 Mike King (@micjamking) 3 * 4 * jQuery Succinct plugin 5 * Version 1.1.0 (October 2014) 6 * 7 * Licensed under the MIT License 8 */ 9/*global jQuery*/ 10! function(a) { 11 "use strict"; 12 a.fn.succinct = function(b) { 13 var c = a.extend({ size: 240, omission: "...", ignore: !0 }, b); 14 return this.each(function() { 15 var b, d, e = a(this), 16 f = /[!-\/:-@\[-`{-~]$/, 17 g = function() { e.each(function() { b = a(this).html(), b.length > c.size && (d = a.trim(b).substring(0, c.size).split(" ").slice(0, -1).join(" "), c.ignore && (d = d.replace(f, "")), a(this).html(d + c.omission)) }) }; 18 g() 19 }) 20 } 21}(jQuery); 22 23/* For blogs layout*/ 24 25(function($) { 26 27 $('.et_pb_section article.et_pb_post').on('click', function() { 28 var pageLink = $(this).find('.entry-title > a').attr('href'); 29 var thisPageLinkTarget = $(this).find('.entry-title > a').attr('target'); 30 31 if (pageLink) { 32 if (thisPageLinkTarget) { 33 window.open( 34 pageLink, 35 '_blank' 36 ); 37 } else window.location.href = pageLink; 38 } 39 }); 40 41 $('.blog_1 article, .blog_2 article, .blog_4 article').each(function() { 42 var avatarUrl = $(this).find('dataavatar').attr('data-avatar-url'); 43 console.log(avatarUrl); 44 var avatarCode = '<img alt="author avatar" src="'+ avatarUrl +'" class="avatar avatar-92 photo" height="92" width="92">'; 45 console.log(avatarCode); 46 $(avatarCode).insertBefore($(this).find('.author.vcard a')) 47 }); 48 49 $('.blog_1 .post-meta, .blog_2 .post-meta, .blog_5 .post-meta').each(function() { 50 var author = $(this).find('span.author')[0]; 51 var date = $(this).find('span.published')[0]; 52 var categories = $(this).find('a[rel="category tag"]').toArray(); 53 categories = $.map(categories, function(element) { 54 return element.outerHTML; 55 }); 56 categories = categories.join(', '); 57 58 var html = author.outerHTML; 59 html += date.outerHTML; 60 html += "<span class='categories'>" + categories + "</span>" 61 62 $(this).html(html); 63 }); 64 65 $('.blog_1 article').each(function () { 66 $(this).find('.post-meta .categories').insertBefore($(this).find('h2.entry-title a')); 67 }); 68 69 $('dataavatar').remove(); 70})(jQuery); 71 72(function ($) { 73 $('h4 a').each(function(){ 74 var headerText = $(this).text(); 75 newHeaderText = headerText.replace(/<dataavatar.+?dataavatar>/g, ''); 76 $(this).text(newHeaderText); 77 }) 78})(jQuery); 79 80(function($) { 81 82 $('.blog_1 h2 > a').each(function() { 83 $(this).succinct({ 84 size: 90 85 }); 86 87 }); 88 89 $('.blog_3 h2 > a').each(function() { 90 $(this).succinct({ 91 size: 50 92 }); 93 94 }); 95 96 $('.blog_4 h2 > a').each(function() { 97 $(this).succinct({ 98 size: 70 99 }); 100 101 }); 102 103 $('.blog_5 h2 > a').each(function() { 104 $(this).succinct({ 105 size: 70 106 }); 107 108 }); 109 110 $('.blog_6 h2').each(function() { 111 $(this).find('a').succinct({ 112 size: 90 113 }); 114 115 }); 116 117 118 // blog 6 title height 119 120 function blog_6_resize() { 121 blog_6 = []; 122 $('.blog_6 h2').each(function() { 123 var blog6h = $(this).height(); 124 blog_6.push(blog6h); 125 126 }); 127 128 var maxh = Math.max.apply(Math, blog_6); 129 130 $('.blog_6 h2').each(function() { 131 $(this).height(maxh); 132 }); 133 } 134 135 // blog 1 title height 136 137 function blog_1_resize() { 138 blog_1 = []; 139 $('.blog_1 h2 > a').each(function() { 140 var blog1h = $(this).height(); 141 blog_1.push(blog1h); 142 143 }); 144 145 var maxh = Math.max.apply(Math, blog_1); 146 147 $('.blog_1 h2 > a').each(function() { 148 $(this).height(maxh); 149 }); 150 } 151 152 // blog 2 title height 153 154 function blog_2_resize() { 155 blog_2 = []; 156 $('.blog_2 h2 > a').each(function() { 157 var blog2h = $(this).height(); 158 blog_2.push(blog2h); 159 160 }); 161 162 var maxh = Math.max.apply(Math, blog_2); 163 164 $('.blog_2 h2 > a').each(function() { 165 $(this).height(maxh); 166 }); 167 } 168 169 // blog 3 title height 170 171 function blog_3_resize() { 172 blog_3 = []; 173 $('.blog_3 h2 a').each(function() { 174 var blog3h = $(this).height(); 175 blog_3.push(blog3h); 176 177 }); 178 179 var maxh = Math.max.apply(Math, blog_3); 180 181 $('.blog_3 h2 a').each(function() { 182 $(this).height(maxh); 183 }); 184 } 185 186 // blog 4 title height 187 188 function blog_4_resize() { 189 blog_4 = []; 190 $('.blog_4 h2').each(function() { 191 var blog4h = $(this).height(); 192 blog_4.push(blog4h); 193 194 }); 195 196 var maxh = Math.max.apply(Math, blog_4); 197 198 $('.blog_4 h2').each(function() { 199 $(this).height(maxh); 200 }); 201 } 202 203 // blog 5 title height 204 205 function blog_5_resize() { 206 blog_5 = []; 207 $('.blog_5 h2').each(function() { 208 var blog5h = $(this).height(); 209 blog_5.push(blog5h); 210 211 }); 212 213 var maxh = Math.max.apply(Math, blog_5); 214 215 $('.blog_5 h2').each(function() { 216 $(this).height(maxh); 217 }); 218 } 219 220 // blurbs 1 height 221 222 function blurbs_1_resize() { 223 blurbs_1 = []; 224 $('.blurbs_1 .et_pb_blurb_container').each(function() {
225 var blurbs1h = $(this).height(); 226 blurbs_1.push(blurbs1h); 227 228 }); 229 230 var maxh = Math.max.apply(Math, blurbs_1); 231 232 $('.blurbs_1 .et_pb_blurb_container').each(function() { 233 $(this).height(maxh); 234 }); 235 } 236 237 // blurbs 2 238 239 $('.blurbs_2 .et_pb_blurb_description').each(function() { 240 $(this).succinct({ 241 size: 110 242 }); 243 244 }); 245 246 // blurbs 3 height 247 248 function blurbs_3_resize() { 249 blurbs_3 = []; 250 $('.blurbs_3 .et_pb_blurb_container').each(function() { 251 var blurbs3h = $(this).height(); 252 blurbs_3.push(blurbs3h); 253 254 }); 255 256 var maxh = Math.max.apply(Math, blurbs_3); 257 258 $('.blurbs_3 .et_pb_blurb_container').each(function() { 259 $(this).height(maxh + 15); 260 }); 261 } 262 263 264 265 setTimeout(function() { 266 blog_1_resize(); 267 blog_2_resize(); 268 blog_3_resize(); 269 blog_4_resize(); 270 blog_5_resize(); 271 blog_6_resize(); 272 273 blurbs_1_resize(); 274 blurbs_3_resize(); 275 }, 200); 276 277 278 var win = $(this); 279 280 281 282 if (win.width() <= 980) { 283 $('.blog_2 h2 > a').each(function() { 284 $(this).succinct({ 285 size: 1000 286 }); 287 288 }); 289 } else { 290 $('.blog_2 h2 > a').each(function() { 291 $(this).succinct({ 292 size: 85 293 }); 294 295 }); 296 } 297 298 $(window).on('resize', function() { 299 blog_1_resize(); 300 blog_2_resize(); 301 blog_3_resize(); 302 blog_4_resize(); 303 blog_5_resize(); 304 blog_6_resize(); 305 306 // blurbs_1_resize(); 307 // blurbs_3_resize(); 308 var win = $(this); //this = window 309 if (win.height() >= 820) { /* ... */ } 310 if (win.width() <= 600) {} else {} 311 }); 312})(jQuery); 313 314 315/* For Form module focus action*/ 316 317(function($) { 318 319 // clear the placeholder on click 320 321 $('input,textarea').focus(function() { 322 if ($(this).attr('placeholder') !== '') { 323 $(this).attr('data-placeholder', $(this).attr('placeholder')); 324 $(this).attr('placeholder', ''); 325 } 326 }); 327 $('input,textarea').blur(function() { 328 329 if ($(this).attr('placeholder') === '') { 330 $(this).attr('placeholder', $(this).attr('data-placeholder')); 331 console.log($(this).attr('placeholder')); 332 333 } 334 }); 335 336 // Contact Forms 337 338 339 $('.et_pb_section .et_pb_contact .et_pb_contact_form p:not([data-type="checkbox"]):not([data-type="radio"])').each(function() { 340 $(this).find('textarea').insertBefore($(this).find('label')); 341 $(this).find('input').insertBefore($(this).find('label')); 342 }); 343 344 345 $(' .et_pb_contact .et_pb_contact_form p:not([data-type="checkbox"]):not([data-type="radio"]) input, .et_pb_contact .et_pb_contact_form p:not([data-type="checkbox"]):not([data-type="radio"]) textarea').focus(function() { 346 $(this).parent("p").addClass("focus"); 347 }); 348 349 $(' .et_pb_contact .et_pb_contact_form p:not([data-type="checkbox"]):not([data-type="radio"]) input, .et_pb_contact .et_pb_contact_form p:not([data-type="checkbox"]):not([data-type="radio"]) textarea').blur(function() { 350 if ($(this).val()) { 351 $(this).parent().addClass("filled"); 352 } else { 353 $(this).parent().removeClass("filled"); 354 } 355 $(this).parent("p").removeClass("focus"); 356 }); 357 358})(jQuery); 359 360/*Unicorn Content Module 6 - Make the contact us box animation a clickable link - please change "#" url link in the first blurb settings */ 361 362(function($) { 363 364 $('.content6 .et_pb_column_1_3 .front').parent().on('click', function() { 365 var pageUrl = $(this).find('.et_pb_main_blurb_image a').attr('href'); 366 var thisPageUrlTarget = $(this).find('.et_pb_main_blurb_image a').attr('target'); 367 368 if (pageUrl) { 369 if (thisPageUrlTarget) { 370 window.open( 371 pageUrl, 372 '_blank' 373 ); 374 } else window.location.href = pageUrl; 375 } 376 }); 377 378 379})(jQuery); 380 381 382 383/* Person module click action*/ 384 385(function($) { 386 $('.et_pb_team_member').on('click', function() { 387 var personPageLink = $(this).find('.person_link a').attr('href'); 388 var thisPersonPageLinkTarget = $(this).find('.person_link a').attr('target'); 389 390 if (personPageLink) { 391 if (thisPersonPageLinkTarget) { 392 window.open( 393 personPageLink, 394 '_blank' 395 ); 396 } else window.location.href = personPageLink; 397 } 398 399 }) 400})(jQuery); 401 402/* For Email optin Divi kit focus action*/ 403 404(function($) { 405 406 // Newsletter Form 407 408 $(' .et_pb_newsletter .et_pb_newsletter_form p').each(function() { 409 $(this).find('input').insertBefore($(this).find('label')); 410 $(this).find('label[for="et_pb_signup_lastname"]').each(function() { 411 $(this).text("Surname"); 412 }); 413 $(this).find('label[for="et_pb_signup_firstname"]').each(function() {
414 if ($(this).prev().attr('placeholder') == 'Last Name') { 415 $(this).text("Surname"); 416 } else $(this).text("Name"); 417 }); 418 419 $(this).find('input.et_pb_signup_firstname').required = false; 420 }); 421 422 $(' .et_pb_newsletter .et_pb_newsletter_form input').focus(function() { 423 $(this).parent("p").addClass("focus"); 424 }); 425 426 $(' .et_pb_newsletter .et_pb_newsletter_form input').blur(function() { 427 if ($(this).val()) { 428 $(this).parent().addClass("filled"); 429 } else { 430 $(this).parent().removeClass("filled"); 431 } 432 $(this).parent("p").removeClass("focus"); 433 }); 434 435 436// Aweber Form 437 438 $('.form_2 .et_pb_newsletter .et_pb_newsletter_form p').each(function () { 439 console.log($('.form_2 .et_pb_newsletter .et_pb_newsletter_form p').length); 440 if($('.form_2 .et_pb_newsletter .et_pb_newsletter_form p').length == 3){ 441 $(this).parent('.et_pb_newsletter_form').addClass('aweber_form'); 442 } 443 }) 444 445})(jQuery); 446 447/* Blurb module click action*/ 448 449(function($) { 450 $('div.et_pb_section[class*=blurb]:not(.blurb5):not([class*=_f]):not([class*=_blurb]) .et_pb_blurb').each(function() { 451 $(this).addClass('unicorn_blurb'); 452 }); 453 454 $('.et_pb_blurb.unicorn_blurb').on('click', function() { 455 456 if ($(this).hasClass('back')) { 457 458 var blurbPageLink = $(this).prev().find('.et_pb_blurb_content a').attr('href'); 459 var blurbPageLinkTarget = $(this).prev().find('.et_pb_blurb_content a').attr('target'); 460 } else { 461 var blurbPageLink = $(this).find('.et_pb_blurb_content a').attr('href'); 462 var blurbPageLinkTarget = $(this).find('.et_pb_blurb_content a').attr('target'); 463 } 464 465 if (blurbPageLink) { 466 if (blurbPageLinkTarget) { 467 window.open( 468 blurbPageLink, 469 '_blank' 470 ); 471 } else window.location.href = blurbPageLink; 472 } 473 474 }) 475})(jQuery); 476 477/* For featured modules background*/ 478 479(function($) { 480 481 $('.features8 .et_pb_blurb').each(function() { 482 var src = $(this).find('.et_pb_blurb_container > p > img').attr('src'); 483 if (src) { 484 $("<style type='text/css'> .features8 .et_pb_blurb:before {background-image: url(" + src + ") !important;} </style>").appendTo("head"); 485 486 $(this).find('.et_pb_blurb_container > p').remove(); 487 488 489 } 490 }); 491 $('.features10 .et_pb_row:first-child .et_pb_blurb').each(function() { 492 var src = $(this).find('.et_pb_blurb_container > p > img').attr('src'); 493 if (src) { 494 $("<style type='text/css'> .features10 .et_pb_row:first-child .et_pb_blurb:before {background-image: url(" + src + ") !important;} </style>").appendTo("head"); 495 496 $(this).find('.et_pb_blurb_container > p > img').remove(); 497 498 499 } 500 }); 501})(jQuery); 502 503// Pricing tables 504 505(function($) { 506 $('.et_pb_pricing_table').each(function() { 507 if ($(this).find('.et_pb_dollar_sign').length > 0) { 508 var sign = $(this).find('.et_pb_dollar_sign').text(); 509 $(this).find('.et_pb_sum').attr('data-sign', sign); 510 } 511 }); 512})(jQuery); 513 514 515// Content 4 516 517(function($) { 518 $('.content4 .et_pb_toggle_content h5').each(function() { 519 $(this).addClass('et_pb_toggle_title'); 520 }); 521})(jQuery); 522 523(function($) { 524 $('.content1 .et_pb_toggle_title, .contact_4 .et_pb_toggle_title').click(function() { 525 var $toggle = $(this).closest('.et_pb_toggle'); 526 if (!$toggle.hasClass('et_pb_accordion_toggling')) { 527 var $accordion = $toggle.closest('.et_pb_accordion'); 528 if ($toggle.hasClass('et_pb_toggle_open')) { 529 $accordion.addClass('et_pb_accordion_toggling'); 530 $toggle.find('.et_pb_toggle_content').slideToggle(700, function() { 531 $toggle.removeClass('et_pb_toggle_open').addClass('et_pb_toggle_close'); 532 533 }); 534 } 535 setTimeout(function() { 536 $accordion.removeClass('et_pb_accordion_toggling'); 537 }, 750); 538 } 539 }); 540})(jQuery); 541 542 543// features 544 545 (function($) { 546 $('.features8 .et_pb_blurb h4').each(function() { 547 if ($(this).find('a').length > 0) { 548 $(this).find('a').succinct({ 549 size: 26 550 }); 551 } 552 else 553 { 554 $(this).succinct({ 555 size: 26 556 }); 557} 558 559 }); 560 })(jQuery); 561 562 563// Futures 7 564(function ($) { 565 var height = 1; 566 var blurbHeight = ""; 567 if($(window).width() > 1120){ 568 setTimeout(function () { 569 $('.features7 .et_pb_column.text_rigth .et_pb_blurb').each(function () { 570 blurbHeight = $(this).height(); 571 var blurbHeight2 = $('.features7 .et_pb_column:not(.text_rigth) .et_pb_blurb:nth-child(' + height + ')').height(); 572 if (blurbHeight > blurbHeight2) { 573 $('.features7 .et_pb_column:not(.text_rigth) .et_pb_blurb:nth-child(' + height + ')').height(blurbHeight) 574 } else { 575 $(this).height(blurbHeight2); 576 } 577 height++; 578 }) 579 }, 1000); 580 } 581})(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.