1/******************/ 2 3/* Gestione Scroll ancore */ 4 5/******************/ 6 7 8// example 9/* 10 if ($j(".box-messages").length > 0) { 11 $j(".box-messages.box-danger ul li a").click(function (e) { 12 e.preventDefault(); 13 anchorScrollingToFocus(this , 80 , true); 14 }); 15 } 16*/ 17 18function anchorScrollingToFocus(myElement, extraOffset, focused) { 19 var myAnchor = $j(myElement).attr('href'); 20 if (myAnchor.match('#')) { 21 writeLog('anchor detected on messages link - scrolling'); 22 var hash = myAnchor.substring(myAnchor.indexOf("#") + 1); 23 if ($j('#' + hash).length > 0) { 24 startScrollandFocus($j('#' + hash), extraOffset, focused); 25 } 26 return false; 27 } else { 28 writeLog('no anchor detected on messages link'); 29 } 30} 31 32function startScrollandFocus(element, extraOffset, focused) { 33 var myoffset = element.offset().top; 34 //alert("myoffset.top "+myoffset.top); 35 var scrollto = myoffset - extraOffset; 36 $j('html, body').animate({ 37 scrollTop: scrollto 38 }, 1500, function () { 39 if (focused == true) { 40 $j(element).focus(); 41 writeLog('focus on input'); 42 } 43 }); 44} 45 46 47/******************/ 48 49/* Radio Collapse div */ 50 51/******************/ 52function radioCollapse() { 53 $j('input[type=radio][data-toggle=radio-collapse]').each(function (index, item) { 54 var $jitem = $j(item); 55 var $jtarget = $j($jitem.data('target')); 56 57 $j('input[type=radio][name="' + item.name + '"]').on('change', function () { 58 if ($jitem.is(':checked')) { 59 $jtarget.collapse('show'); 60 //$jtarget.slideDown('slow'); 61 } else { 62 $jtarget.collapse('hide'); 63 //$jtarget.slideUp('slow'); 64 } 65 }); 66 }); 67} 68 69 70/******************/ 71 72/* Btn toggle */ 73 74/******************/ 75$j(document).ready(function () { 76 $j('.btn-toggle').click(function () { 77 var $j = $j; 78 $j(this).children('.btn').toggleClass('active'); 79 80 if (!$j(this).children('label').hasClass('disabled')) { 81 82 $j(this).find('.btn').toggleClass('active'); 83 //writeLog( $j(this).find('.btn').attr('class') ); 84 85 86 if ($j(this).find('.btn-primary').size() > 0) { 87 $j(this).find('.btn').toggleClass('btn-primary'); 88 } 89 if ($j(this).find('.btn-danger').size() > 0) { 90 $j(this).find('.btn').toggleClass('btn-danger'); 91 } 92 if ($j(this).find('.btn-success').size() > 0) { 93 $j(this).find('.btn').toggleClass('btn-success'); 94 } 95 if ($j(this).find('.btn-info').size() > 0) { 96 $j(this).find('.btn').toggleClass('btn-info'); 97 } 98 99 $j(this).find('.btn').toggleClass('btn-default'); 100 101 102 } else { 103 writeLog('disabled btn-toggle click event'); 104 } 105 106 }); 107});
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.