1/** 2* @package Helix3 Framework 3* @author JoomShaper http://www.joomshaper.com 4* @copyright Copyright (c) 2010 - 2015 JoomShaper 5* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later 6*/ 7jQuery(function($) { 8 9 $('#offcanvas-toggler').on('click', function(event){ 10 event.preventDefault(); 11 $('body').addClass('offcanvas'); 12 }); 13 14 $( '<div class="offcanvas-overlay"></div>' ).insertBefore( '.body-innerwrapper > .offcanvas-menu' ); 15 16 $('.close-offcanvas, .offcanvas-overlay').on('click', function(event){ 17 event.preventDefault(); 18 $('body').removeClass('offcanvas'); 19 }); 20 21 //Mega Menu 22 $('.sp-megamenu-wrapper').parent().parent().css('position','static').parent().css('position', 'relative'); 23 $('.sp-menu-full').each(function(){ 24 $(this).parent().addClass('menu-justify'); 25 }); 26 27 //Sticky Menu 28 $(document).ready(function(){ 29 $("body.sticky-header").find('#sp-main-menu').sticky({topSpacing:0}) 30 }); 31 32 // Slideshow disaper and conflict with motools 33 var carousel = jQuery('.carousel'); 34 if(carousel){ 35 if (typeof jQuery != 'undefined' && typeof MooTools != 'undefined' ) { 36 Element.implement({ 37 slide: function(how, mode){ 38 return this; 39 } 40 }); 41 } 42 } 43 44 // j2store-cart 45 $('.j2store-cart-module .cart-icon').on('click', function () { 46 $(this).toggleClass('active'); 47 }); 48 49 // share articles 50 $('.share-button').on('click', function () { 51 $(this).toggleClass('active'); 52 }); 53 54 // j2store input control 55 $('.product-qty .j2store-qty-up').on('click', function() { 56 $('.product-qty input.qty-details').val( parseInt($('.product-qty input.qty-details').val(), 10) + 1); 57 }); 58 59 $('.product-qty .j2store-qty-down').on('click', function() { 60 if ($('.product-qty input.qty-details').val() > 1) { 61 $('.product-qty input.qty-details').val( parseInt($('.product-qty input.qty-details').val(), 10) - 1); 62 } 63 }); 64 65 //tab disapear 66 $(document).off('click.tab.data-api'); 67 $(document).on('click.tab.data-api', '[data-toggle="tab"]', function (e) { 68 e.preventDefault(); 69 var tab = $($(this).attr('href')); 70 var activate = !tab.hasClass('active'); 71 $('div.tab-content>div.tab-pane.active').removeClass('active'); 72 $('ul.nav.nav-tabs>li.active').removeClass('active'); 73 if (activate) { 74 $(this).tab('show') 75 } 76 }); 77 78 79 // has social share 80 if ( $( ".sppb-post-share-social" ).length || $( ".helix-article-social-share-icon" ).length) { 81 // social share 82 $('.prettySocial').prettySocial(); 83 }; 84 85 86 $(document).ready(function () { 87 var shareUrl = 'http://joomshaper.com'; 88 $.getJSON('http://share-count.appspot.com/?url=' + encodeURIComponent(shareUrl) + "&callback=?", function (data) { 89 shares = data.shares; 90 $(".count").each(function (index, el) { 91 service = $(el).parents(".share-btn").attr("data-service"); 92 count = shares[service]; 93 if(count>1000) { 94 count = (count / 1000).toFixed(1); 95 if(count>1000) count = (count / 1000).toFixed(1) + "M"; 96 else count = count + "k"; 97 } 98 $(el).html(count); 99 }); 100 }); 101 }); 102 103 //Tooltip 104 $('[data-toggle="tooltip"]').tooltip(); 105 106 // // fix conflicting with mootools 107 if (typeof MooTools !== 'undefined') { 108 var mHide = Element.prototype.hide; 109 Element.implement({ 110 hide: function() { 111 if ($('[data-toggle="tooltip"]').attr('itemprop')) { 112 return this; 113 } 114 mHide.apply(this, arguments); 115 } 116 }); 117 } 118 119 120 $(document).on('click', '.sp-rating .star', function(event) { 121 event.preventDefault(); 122 123 var data = { 124 'action':'voting', 125 'user_rating' : $(this).data('number'), 126 'id' : $(this).closest('.post_rating').attr('id') 127 }; 128 129 var request = { 130 'option' : 'com_ajax', 131 'plugin' : 'helix3', 132 'data' : data, 133 'format' : 'json' 134 }; 135 136 $.ajax({ 137 type : 'POST', 138 data : request, 139 beforeSend: function(){ 140 $('.post_rating .ajax-loader').show(); 141 }, 142 success: function (response) { 143 var data = $.parseJSON(response.data); 144 145 $('.post_rating .ajax-loader').hide(); 146
147 if (data.status == 'invalid') { 148 $('.post_rating .voting-result').text('You have already rated this entry!').fadeIn('fast'); 149 }else if(data.status == 'false'){ 150 $('.post_rating .voting-result').text('Somethings wrong here, try again!').fadeIn('fast'); 151 }else if(data.status == 'true'){ 152 var rate = data.action; 153 $('.voting-symbol').find('.star').each(function(i) { 154 if (i < rate) { 155 $( ".star" ).eq( -(i+1) ).addClass('active'); 156 } 157 }); 158 159 $('.post_rating .voting-result').text('Thank You!').fadeIn('fast'); 160 } 161 162 }, 163 error: function(){ 164 $('.post_rating .ajax-loader').hide(); 165 $('.post_rating .voting-result').text('Failed to rate, try again!').fadeIn('fast'); 166 } 167 }); 168 }); 169 170});
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.