1/* iconcolor.js contains all js for icon changes */ 2/* Author : CrdioStudio Dev team */ 3 4jQuery.noConflict(); 5/* for 1.2.9 */ 6 7function changeColInUri(data, colfrom, colto) { 8 // create fake image to calculate height / width 9 //var img = document.createElement("img"); 10 var img = new Image(); 11 img.src = data; 12 img.style.visibility = "hidden"; 13 document.body.appendChild(img); 14 15 var canvas = document.createElement("canvas"); 16 canvas.id = 'canvas'; 17 canvas.width = img.offsetWidth; 18 canvas.height = img.offsetHeight; 19 var ctx = canvas.getContext("2d"); 20 ctx.drawImage(img, 0, 0); 21 22 // remove image 23 img.parentNode.removeChild(img); 24 25 // do actual color replacement 26 27 if (canvas.width != 0 && canvas != undefined) { 28 var imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); 29 30 var data = imageData.data; 31 32 var rgbfrom = hexToRGB(colfrom); 33 var rgbto = hexToRGB(colto); 34 35 var r, g, b; 36 for (var x = 0, len = data.length; x < len; x += 4) { 37 r = data[x]; 38 g = data[x + 1]; 39 b = data[x + 2]; 40 41 42 data[x] = rgbto.r; 43 data[x + 1] = rgbto.g; 44 data[x + 2] = rgbto.b; 45 46 47 } 48 49 ctx.putImageData(imageData, 0, 0); 50 } 51 return canvas.toDataURL(); 52} 53 54 55jQuery(document).ready(function($) { 56 57 58 jQuery('#input-dropdown').find('li').each(function() { 59 var iconsrc = jQuery(this).find('img').attr('src'); 60 if (iconsrc != '' && iconsrc != undefined) { 61 var changecolor = changeColInUri(iconsrc, "#41A6DF", "#ffffff"); 62 jQuery(this).prepend('<img class="h-icon" alt="image" src="' + changecolor + '" />'); 63 } 64 }); 65 66 jQuery('.listing-single-cat').find('li').each(function() { 67 var iconsrc = jQuery(this).find('.base-icon').attr('src'); 68 if (iconsrc != '' && iconsrc != undefined) { 69 var changecolor = changeColInUri(iconsrc, "#41A6DF", "#ffffff"); 70 jQuery(this).find('.base-icon').attr("src", changecolor); 71 } 72 }); 73 74 jQuery('.user-portfolio ul.post-socials').find('li').each(function() { 75 var iconsrc = jQuery(this).find('.icon').attr('src'); 76 if (iconsrc != '' && iconsrc != undefined) { 77 var changecolor = changeColInUri(iconsrc, "#ffffff", "#41A6DF"); 78 jQuery(this).find('.icon').attr("src", changecolor); 79 } 80 }); 81 82 83 jQuery('.blog-social ul.blog-social').find('li').each(function() { 84 var iconsrc = jQuery(this).find('.icon').attr('src'); 85 if (iconsrc != '' && iconsrc != undefined) { 86 var changecolor = changeColInUri(iconsrc, "#ffffff", "#41A6DF"); 87 jQuery(this).find('.icon').attr("src", changecolor); 88 } 89 }); 90 91 jQuery('.user-info ul.social-icons').find('li').each(function() { 92 var iconsrc = jQuery(this).find('.icon').attr('src'); 93 if (iconsrc != '' && iconsrc != undefined) { 94 var changecolor = changeColInUri(iconsrc, "#ffffff", "#6e6e6e"); 95 jQuery(this).find('.icon').attr("src", changecolor); 96 } 97 }); 98 99 jQuery('.popup-post-left-bottom ul.social-icons').find('li').each(function() { 100 var iconsrc = jQuery(this).find('.icon').attr('src'); 101 if (iconsrc != '' && iconsrc != undefined) { 102 var changecolor = changeColInUri(iconsrc, "#ffffff", "#6e6e6e"); 103 jQuery(this).find('.icon').attr("src", changecolor); 104 } 105 }); 106 107}); 108/* end for 1.2.9 */
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.