1/** 2* jBility 3* jBility is a free set of accessibility functions that uses JQuery. 4* By: Uriel Cairê Balan Calvi 5* Available on: https://github.com/urielcaire/jBility 6*/ 7jQuery(document).ready(function( $ ){ 8 /*=================================================================== 9 * jBility uses JsCookie to manager cookies. 10 * JsCookie is available on: https://github.com/urielcaire/jscookie 11 *====================================================================*/ 12 function createCookie(name, value, days){ 13 var expires = ""; 14 if(days){ 15 var time = new Date(); 16 time.setTime(time.getTime()+(days*24*60*60*1000)); 17 } 18 document.cookie = name+"="+value+expires+"; path=/"; 19 } 20 21 function getCookie(name){ 22 var nameEQ = name + "="; 23 var ca = document.cookie.split(';'); 24 for(var i=0;i < ca.length;i++) { 25 var c = ca[i]; 26 while (c.charAt(0)==' ') c = c.substring(1,c.length); 27 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); 28 } 29 return ""; 30 } 31 32 function deleteCookie(name) { 33 createCookie(name,"",-1); 34 } 35 36 function checkCookie(name){ 37 var check = getCookie(name); 38 if(check != "") 39 return true; 40 return false; 41 } 42 43 /*====================================== 44 * jBility functions 45 *======================================*/ 46 function addConstrast(type){ 47 48 $('*').not('.not-color').not('.divmap *').not('.divmap').not('.flowplayer *').not('.flowplayer').not('.lumos-container').not('.lumos-container *').addClass('pagina-acessivel-'+type); 49 $('.acess-container').addClass('f-transparent-'+type); 50 $('img').addClass('f-transparent-'+type); 51 // $('#botao').addClass('f-transparent'); 52 // $('#acess-icons').addClass('f-transparent'); 53 // $('.acess-icon').addClass('f-transparent'); 54 // $('#jbbutton').addClass('f-transparent'); 55 } 56 57 function removeConstrast(type){ 58 $('*').removeClass('pagina-acessivel-'+type); 59 $('.acess-container').removeClass('f-transparent-'+type); 60 $('img').removeClass('f-transparent-'+type); 61 // $('#botao').removeClass('f-transparent'); 62 // $('#acess-icons').removeClass('f-transparent'); 63 // $('.acess-icon').removeClass('f-transparent'); 64 // $('#jbbutton').removeClass('f-transparent'); 65 } 66 67 if(checkCookie('ccontrast')){ 68 var type = getCookie('type'); 69 addConstrast(type); 70 } 71 72 $('.btn-color').click(function(){ 73 var type = $(this).attr('id'); 74 var ck = checkCookie('ccontrast'); 75 if(type == 'normal'){ 76 removeConstrast(getCookie('type')); 77 deleteCookie('type'); 78 deleteCookie('ccontrast'); 79 }else{ 80 // if(ck){ 81 // deleteCookie('ccontrast'); 82 removeConstrast(getCookie('type')); 83 // }else{ 84 createCookie('ccontrast', 'cookieContrast'); 85 addConstrast(type); 86 // } 87 createCookie('type',type); 88 } 89 }); 90 91 var $cElements = $("body").find("*:not(.not-resize,.not-resize *)"); 92 var fonts = []; 93 var status; 94 var actionadd; 95 var actiondel; 96 97 function getFontSize() { 98 for (var i = 0; i < $cElements.length; i++) { 99 fonts.push(parseFloat($cElements.eq(i).css('font-size'))); 100 } 101 } 102 103 getFontSize(); 104 $("#increaseFont").on('click', function() { 105 if(actionadd != 'Y'){ 106 if(actiondel == 'Y'){ 107 var numpush = 6; 108 }else{ 109 var numpush = 3; 110 } 111 for (var i = 0; i < $cElements.length; i++) { 112 fonts[i]+=numpush; 113 status = 'add'; 114 $cElements.eq(i).css('font-size', fonts[i], 'important'); 115 } 116 actionadd = 'Y'; 117 } 118 }); 119 120 $("#mediumFont").on('click', function() { 121 if(status != '' && (status == 'add' || status == 'del') ){ 122 for (var i = 0; i < $cElements.length; i++) { 123 124 if(status == 'add'){ 125 fonts[i]-=3; 126 }else if(status == 'del'){ 127 fonts[i]+=3; 128 } 129 130 $cElements.eq(i).css('font-size', fonts[i], 'important'); 131 } 132 status = ''; 133 actionadd = ''; 134 actiondel = ''; 135 } 136 }); 137 138 $("#decreaseFont").on('click', function() { 139 if(actiondel != 'Y'){ 140 if(actionadd == 'Y'){ 141 var numpush = 6; 142 }else{ 143 var numpush = 3; 144 } 145 146 for (var i = 0; i < $cElements.length; i++) { 147 fonts[i]-=numpush; 148 status = 'del'; 149 $cElements.eq(i).css('font-size', fonts[i], 'important'); 150 } 151 actiondel = 'Y'; 152 } 153 }); 154 155 $('#jbbutton').click(function(){ 156 $('#acess-icons').toggle(150); 157 }); 158 159});
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.