1;(function($){ 2 jQuery.fn.posttabs=function(args){ 3 var defaults= { 4 tabname : '', 5 fade : '0', 6 active : '', 7 reload : '', 8 nav : '0', 9 nexttext : '', 10 prevtext : '', 11 enablecookie : '0' 12 } 13 options=jQuery.extend({},defaults,args); 14 var tabreload = '0',tabname=options.tabname; 15 jQuery(this).tabs().addClass( "ui-tabs-horizontal-top ui-helper-clearfix" ); 16 if(options.fade == '1') 17 jQuery(this).tabs({ fx: { opacity: "toggle" } }); 18 19 // Enable cookie for last active tab 20 if(options.enablecookie == '1') { 21 jQuery(this).tabs({ 22 activate: function( event, ui ) { 23 jQuery.cookie(tabname, jQuery(this).tabs("option","active")); 24 }, 25 active: jQuery.cookie(tabname) 26 }); 27 } 28 if( options.reload.length > 0 && options.reload=='1') { 29 tabreload = '1'; 30 var anchor=jQuery(document).attr("location").hash; 31 if(anchor){ 32 var index = jQuery("#"+options.tabname+" > div.ui-tabs-panel").index(jQuery(anchor)); 33 if(index != -1) jQuery(this).tabs("option", "active", index); 34 } 35 else 36 { 37 //Set default tab on load 38 if(options.active.length > 0) 39 jQuery(this).tabs("option", "active", options.active ); 40 } 41 42 } 43 else 44 { 45 //Set default tab on load 46 if(options.active.length > 0 ) 47 jQuery(this).tabs("option", "active", options.active ); 48 } 49 jQuery(this).on("tabsactivate", function(event, ui){ 50 // Tab reload 51 if(tabreload.length > 0 && tabreload == '1') 52 { 53 var currid = "#"+ui.newPanel.attr("id"); 54 window.location.hash = "#"+ui.newPanel.attr("id"); 55 jQuery("body,html").animate({"scrollTop":jQuery(currid).parents(".wordpress-post-tabs").offset().top}, 1000); 56 } 57 }); 58 // Prev & Next arrows 59 if(options.nav.length > 0 && options.nav=='1') { 60 var wpts_j=0; 61 jQuery("#"+options.tabname+" > .ui-tabs-panel").each(function(wpts_j){ 62 var totalSize = jQuery("#"+tabname+" .ui-tabs-panel").size(); 63 if (wpts_j < (totalSize-1)) { 64 var wpts_next = wpts_j + 1; 65 jQuery(this).append("<a href='#' class='wpts-next-tab wpts-mover' rel='" + wpts_next + "'>"+options.nexttext+"</a>"); 66 } 67 if (wpts_j >= 1) { 68 var wpts_prev = wpts_j - 1; 69 jQuery(this).append("<a href=\'#\' class=\'wpts-prev-tab wpts-mover\' rel=\'" + wpts_prev + "\'>"+options.prevtext+"</a>"); 70 } 71 }); 72 jQuery(".wpts-next-tab, .wpts-prev-tab").click(function() { 73 jQuery("#"+tabname).tabs("option", "active", jQuery(this).attr("rel")); 74 return false; 75 }); 76 } 77 return this; 78 } 79})(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.