1/*==================================================== 2 TABLE OF CONTENT 3 1. function declearetion 4 2. Initialization 5 3. function for facebook status 6====================================================*/ 7 8/*=========================== 9 1. function declearetion 10===========================*/ 11 (function($) { 12var themeApp = { 13 magnificPopupInit: function() { 14 $('.magnific-popup-image').magnificPopup({ 15 delegate: 'a', 16 type: 'image', 17 gallery:{ 18 enabled:false 19 }, 20 image:{ 21 titleSrc: 'data-caption' 22 } 23 }); 24 $('.magnific-popup-gallery').magnificPopup({ 25 delegate: 'a', 26 type: 'image', 27 gallery:{ 28 enabled:true 29 }, 30 image:{ 31 titleSrc: 'data-caption' 32 } 33 }); 34 }, 35 latestSlider: function(data) { 36 var latest = $("#title-slider"); 37 latest.owlCarousel({ 38 singleItem : true, 39 autoPlay : 4000, 40 pagination : false, 41 paginationSpeed : 400, 42 transitionStyle : $slidestyle, 43 }); 44 $(".latest-prev").click(function(e){ 45 e.preventDefault(); 46 latest.trigger('owl.prev'); 47 }); 48 $(".latest-next").click(function(e){ 49 e.preventDefault(); 50 latest.trigger('owl.next'); 51 }); 52 }, 53 responsiveIframe: function() { 54 $('.full-post').fitVids(); 55 }, 56 highlighter: function() { 57 $('pre, pre code').each(function(i, block) { 58 hljs.highlightBlock(block); 59 }); 60 }, 61 mailchimp:function() { 62 function IsEmail(email) { 63 var regex = /^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/; 64 return regex.test(email); 65 } 66 if (typeof mailchimp_form_url !== 'undefined') { 67 var form = jQuery('#mc-embedded-subscribe-form'); 68 form.attr("action", mailchimp_form_url); 69 var message = jQuery('#message'); 70 var submit_button = jQuery('mc-embedded-subscribe'); 71 form.submit(function(e){ 72 e.preventDefault(); 73 jQuery('#mc-embedded-subscribe').attr('disabled','disabled'); 74 if(jQuery('#mce-EMAIL').val() != '' && IsEmail(jQuery('#mce-EMAIL').val())) { 75 message.html('please wait...').fadeIn(1000); 76 var url=form.attr('action'); 77 if(url=='' || url=='YOUR_MAILCHIMP_WEB_FORM_URL_HERE') { 78 alert('Please config your mailchimp form url for this widget'); 79 return false; 80 } 81 else{ 82 url=url.replace('?u=', '/post-json?u=').concat('&c=?'); 83 console.log(url); 84 var data = {}; 85 var dataArray = form.serializeArray(); 86 jQuery.each(dataArray, function (index, item) { 87 data[item.name] = item.value; 88 }); 89 jQuery.ajax({ 90 url: url, 91 type: "POST", 92 data: data, 93 success: function(response, text){ 94 if (response.result === 'success') { 95 message.html(response.result+ ": " + response.msg).delay(10000).fadeOut(500); 96 jQuery('#mc-embedded-subscribe').removeAttr('disabled'); 97 jQuery('#mce-EMAIL').val(''); 98 } 99 else{ 100 message.html(response.result+ ": " + response.msg).delay(10000).fadeOut(500); 101 jQuery('#mc-embedded-subscribe').removeAttr('disabled'); 102 jQuery('#mce-EMAIL').focus().select(); 103 } 104 }, 105 dataType: 'jsonp', 106 error: function (response, text) { 107 console.log('mailchimp ajax submit error: ' + text); 108 jQuery('#mc-embedded-subscribe').removeAttr('disabled'); 109 jQuery('#mce-EMAIL').focus().select(); 110 } 111 }); 112 return false; 113 } 114 } 115 else { 116 message.html('Please provide valid email').fadeIn(1000); 117 jQuery('#mc-embedded-subscribe').removeAttr('disabled'); 118 jQuery('#mce-EMAIL').focus().select(); 119 } 120 }); 121 } 122 }, 123 searchPopup: function() { 124 var toggle_btn = $('#search-open'); 125 toggle_btn.on('click', function(e) { 126 e.preventDefault(); 127 $('#search-wrap').toggleClass('visible'); 128 toggle_btn.toggleClass('opened'); 129 if ($('#search-wrap').hasClass('visible')) { 130 $('#search-wrap').find('.search-input').focus(); 131 toggle_btn.find('i').removeClass('fa-search'); 132 toggle_btn.find('i').addClass('fa-close'); 133 } else { 134 toggle_btn.find('i').removeClass('fa-close'); 135 toggle_btn.find('i').addClass('fa-search'); 136 }; 137 }); 138 }, 139 mobileMenu:function() { 140 $('.navbar-nav').find('.menu-item-has-children').prepend('<span class="submenu-button"></span>'); 141 $('.menu-item-has-children').find('.submenu-button').on('click', function(){ 142 $(this).toggleClass('opened'); 143 $(this).siblings('ul').slideToggle(); 144 }) 145 }, 146 backToTop: function() { 147 $(window).scroll(function(){ 148 if ($(this).scrollTop() > 100) { 149 $('#back-to-top').fadeIn(); 150 } else { 151 $('#back-to-top').fadeOut(); 152 } 153 }); 154 $('#back-to-top').on('click', function(e){ 155 e.preventDefault(); 156 $('html, body').animate({scrollTop : 0},1000); 157 return false;
158 }); 159 }, 160 161 init:function(){ 162 themeApp.magnificPopupInit(); 163 themeApp.latestSlider(); 164 themeApp.responsiveIframe(); 165 themeApp.highlighter(); 166 themeApp.mailchimp(); 167 themeApp.searchPopup(); 168 themeApp.mobileMenu(); 169 themeApp.backToTop(); 170 } 171} 172 173/*=========================== 1742. Initialization 175===========================*/ 176$(document).ready(function(){ 177 themeApp.init(); 178}); 179$(window).load(function() { 180 $('.flexslider').flexslider({ 181 controlNav: false, 182 prevText: '<i class="fa fa-angle-left"></i>', 183 nextText: '<i class="fa fa-angle-right"></i>', 184 slideshowSpeed: '3000', 185 pauseOnHover: true 186 }); 187 }); 188}(jQuery)); 189 190/*==================================================== 1913. function for facebook status 192====================================================*/ 193(function(d, s, id) { 194 var js, fjs = d.getElementsByTagName(s)[0]; 195 if (d.getElementById(id)) return; 196 js = d.createElement(s); js.id = id; 197 js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.2"; 198 fjs.parentNode.insertBefore(js, fjs); 199}(document, 'script', 'facebook-jssdk'));
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.