1/* JavaScript Document */ 2 3var Rotacion = $("#configdata").attr("rotation") === 'off' ? false : true; 4var Actual = 0; 5var TotalFotos = ($("#configdata").attr("TotalFotos") - 1); 6var Thum_height = $("#configdata").attr("Thum_height"); 7var Thum_width = $("#configdata").attr("Thum_width"); 8var Photo_height = $("#configdata").attr("Photo_height"); 9var Photo_width = $("#configdata").attr("Photo_width"); 10var duration = $("#configdata").attr("duration") * 100; 11var RotationInterval; 12 13function activateModuleFotos() { 14 15 $(".ModuloWrap_fotos").each(function () { 16 ModuloContainer = $(this); 17 var activeModule = $(this).attr("module-status"); 18 if (activeModule !== "active") { 19 20 21 console.log('TotalFotos: ' + TotalFotos); 22 23 $(this).find('.container').each(function (e) { 24 if (e == 0) { 25 $(this).addClass('currentPhoto'); 26 } 27 $(this).attr('id', 'handle' + e); 28 29 }) 30 31 32 $(this).find('.ModuloFotos_Tabs .ModuloFotos_Li').each(function (e) { 33 if (e == 0) { 34 $(this).addClass('currentPhoto'); 35 } 36 $(this).append('<div class="chooseFoto"><img id="Thum' + e + 'img" height="' + Thum_height + 'px" width="' + Thum_width + 'px"/></div>'); 37 $(this).children('.chooseFoto').attr('fotoid', '#handle' + e); 38 t = $(this).children('.ModuloFotos_AltText').text(); 39 $(this).children('.ModuloFotos_AltText').hide(); 40 if (t != "") { 41 $('#handle' + e).append('<div class="AlternativeText">' + t + '</div>'); 42 } 43 $(this).find('.ModuloFotos_AltText').hide(); 44 45 }) 46 47 function CargarResto() { 48 //console.log('Cargar resto!'); 49 $(this).find('.container').each(function (e) { 50 var imgPaht = $(this).attr('img'); 51 var imgPaht_big = imgPaht; 52 var Contenedor = $(this); 53 if (e > 0) { 54 $('<img height="' + Photo_height + 'px" width="' + Photo_width + 'px" src="' + imgPaht_big + '">').load(function () { 55 $(this).appendTo(Contenedor); 56 }) 57 } 58 }) 59 60 }; 61 var len = $(this).find('.container').length - 1; 62 $(this).find('.container').each(function (e) { 63 if ($(this).attr("container-status") !== "active") { 64 65 var imgPaht = $(this).attr('img'); 66 var imgPaht_small = $(this).attr('img_small'); 67 $('#Thum' + e + 'img').attr('src', imgPaht_small); 68 if (e == len) { 69 console.log('Cargo len: ' + len); 70 console.log('imgPaht_small: ' + imgPaht_small); 71 $('#Thum' + len + 'img').load(function () { 72 $(this).find('.container').each(function (e) { 73 var imgPaht = $(this).attr('img'); 74 var imgPaht_big = imgPaht; 75 var Contenedor = $(this); 76 if (e == 0) { 77 $('<img height="' + Photo_height + 'px" width="' + Photo_width + 'px" src="' + imgPaht_big + '">').load(function () { 78 $(this).appendTo(Contenedor); 79 if (e == 0) { 80 $(this).find("#handle" + e).show(); 81 } 82 CargarResto(); 83 }) 84 } 85 }) 86 }); 87 } 88 $(this).attr("container-status", "active"); 89 } 90 91 }) 92 93 function showImage(img, ModuloContainer) { 94 var Imagen = $(img); 95 $(ModuloContainer).find('.currentPhoto').removeClass('currentPhoto'); 96 Imagen.addClass('currentPhoto'); 97 ActualLi = $(ModuloContainer).find(".chooseFoto[fotoid='" + img + "']"); 98 $(ModuloContainer).find('.ModuloFotos_Tabs .ModuloFotos_Li').removeClass('currentPhoto'); 99 $(ActualLi).parent().addClass('currentPhoto'); 100 } 101 102 function rotateFotos(container) { 103 104 if (Rotacion) { 105 console.log(Rotacion); 106 var Actual = container.find("#featured").find(".currentPhoto"); 107 var ActualTab = container.find(".ModuloFotos_Tabs").find(".currentPhoto"); 108 Actual.removeClass("currentPhoto"); 109 ActualTab.removeClass("currentPhoto"); 110 111 if (Actual.next(".container").length > 0) { 112 Actual.next(".container").addClass("currentPhoto"); 113 } else { 114 container.find("#featured .container:first").addClass("currentPhoto"); 115 } 116 117 if (ActualTab.next(".ModuloFotos_Li").length > 0) { 118 ActualTab.next(".ModuloFotos_Li").addClass("currentPhoto"); 119 } else { 120 container.find(".ModuloFotos_Tabs .ModuloFotos_Li:first").addClass("currentPhoto"); 121 } 122 123 } 124 } 125 126 setInterval(function () { 127 rotateFotos(ModuloContainer); 128 }, duration); 129 130 $(ModuloContainer).find('.ModuloFotos_Tabs .ModuloFotos_Li .chooseFoto').click(function () { 131 Rotacion = false;
132 console.log("chooseFoto"); 133 c = $(this).attr('fotoid'); 134 if ($(c).hasClass('currentPhoto')) { 135 return false; 136 } else { 137 showImage(c, ModuloContainer); 138 return false; 139 } 140 }) 141 142 $(this).attr("module-status", "active"); 143 console.log('Load Galery OK', ModuloContainer); 144 145 } 146 }) 147} 148 149activateModuleFotos();
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.