1(function($) { 2 /* DOCUMENT READY */ 3 $(document).ready(function() { 4 var currentFontSize; 5 var step = Drupal.settings.vtextresize.step; 6 var maxFontSize = Drupal.settings.vtextresize.max_font_size; 7 var minFontSize = Drupal.settings.vtextresize.min_font_size; 8 9 // Hide/show increase/decrease font size links 10 function vtextresize_toggle_link_visibility() { 11 currentFontSize = parseInt($('body').css('font-size')); 12 13 var $elLinkDecreaseFontSize = $('a#vtextresize_decrease'); 14 var $elLinkIncreaseFontSize = $('a#vtextresize_increase'); 15 16 if (currentFontSize - step < minFontSize) { 17 $elLinkDecreaseFontSize.hide(); 18 } 19 else { 20 $elLinkDecreaseFontSize.show(); 21 } 22 23 if (currentFontSize + step > maxFontSize) { 24 $elLinkIncreaseFontSize.hide(); 25 } 26 else { 27 $elLinkIncreaseFontSize.show(); 28 } 29 } 30 31 vtextresize_toggle_link_visibility(); 32 33 // Set font size from cookie 34 if ($.cookie('vtextresize')) { 35 $('body').css('font-size', $.cookie('vtextresize') + 'px'); 36 } 37 38 $('div#block-vtextresize-vtextresize a.vtextresize').click(function(e){ 39 e.preventDefault(); 40 41 var linkID = $(this).attr('id'); 42 var currentFontSize = parseInt($('body').css('font-size')); 43 var newFontSize = currentFontSize; 44 45 switch(linkID) { 46 case 'vtextresize_decrease': 47 // Decrease font size 48 if(currentFontSize - step >= minFontSize) { 49 newFontSize = currentFontSize - step; 50 } 51 break; 52 53 case 'vtextresize_increase': 54 // Increase font size 55 if(currentFontSize + step <= maxFontSize) { 56 newFontSize = currentFontSize + step; 57 } 58 break; 59 60 case 'vtextresize_reset': 61 // Reset font size 62 // Delete cookie 63 $.cookie('vtextresize', null, { path: '/', expires: -1 }); 64 // Delete inline style 65 $('body').css('font-size', ''); 66 67 break; 68 69 } 70 71 if (newFontSize != currentFontSize) { 72 // Change body font size 73 $('body').css('font-size', newFontSize + 'px'); 74 75 // Store cookie 76 $.cookie('vtextresize', newFontSize, { path: '/' }); 77 } 78 79 vtextresize_toggle_link_visibility(); 80 }); 81 }); 82 83})(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.