jQuery(document).ready(function() { jQuery("table#tarjetas").each(function(e) { if (this) { var numRepo = $("tr",this).length; jQuery(this).addClass("S-CARDS cards" + e); var itemRepo = ""; var a = "", s = "", l = "", f = "", o = jQuery("
"); i = jQuery(".cards" + e + " tr:lt("+numRepo+")"), jQuery(i).each(function(e) { jQuery("th, td", this).each(function(e) { switch (e) { case 0: a = jQuery(this).text(); break; case 1: s = jQuery(this).text(); break; case 2: f = jQuery(this).text(); break; case 3: l = jQuery("img", this).attr('src'); break; } }); itemRepo = `
${a}
${a}
`; o.append(itemRepo); }); var c = jQuery("
"); c.append(o), jQuery(".S-CARDS").replaceWith(c), jQuery(this).removeClass("S-CARDS"); } }); jQuery("table#documentos").each(function(e) { if (this) { var numRepo = $("tr",this).length; jQuery(this).addClass("S-DOCUMENTS document" + e); var itemRepo = ""; var a = "", s = "", l = "", f = "", icon = "", color = "", o = jQuery("
"); i = jQuery(".document" + e + " tr:lt("+numRepo+")"), jQuery(i).each(function(e) { jQuery("th, td", this).each(function(e) { switch (e) { case 0: a = jQuery(this).text(); break; case 1: s = jQuery(this).text(); f = s.split(".").pop(); break; } switch (f) { case 'pdf': case 'PDF': icon = 'file-pdf'; color = '#CC4533'; break; case 'doc': case 'docx': case 'DOC': case 'DOCX': icon = 'file-word'; color = '#2544B3'; break; case 'xls': case 'xlsx': case 'XLS': case 'XLSX': icon = 'file-excel'; color = '#348030'; break; } }); itemRepo = `
${a}
${a} ${a}
`; o.append(itemRepo); }); var c = jQuery("
"); c.append(o), jQuery(".S-DOCUMENTS").replaceWith(c), jQuery(this).removeClass("S-DOCUMENTS"); } }); jQuery("table#recursos").each(function(e) { if (this) { var numRepo = $("tr",this).length; jQuery(this).addClass("S-CARDS cards" + e); var itemRepo = ""; var a = "", s = "", l = "", o = jQuery("
"); i = jQuery(".cards" + e + " tr:lt("+numRepo+")"), jQuery(i).each(function(e) { jQuery("th, td", this).each(function(e) { switch (e) { case 0: a = jQuery(this).text(); break; case 1: s = jQuery(this).text(); break; case 2: l = jQuery("img", this).attr('src'); break; } }); itemRepo = ``; o.append(itemRepo); }); var c = jQuery("
"); c.append(o), jQuery(".S-CARDS").replaceWith(c), jQuery(this).removeClass("S-CARDS"); } }); jQuery("table#preguntas").each(function(e) { if (this) { var numRepo = $("tr",this).length; jQuery(this).addClass("S-CARDS cards" + e); var itemRepo = ""; var a = "", s = "", l = "", o = jQuery("
"); i = jQuery(".cards" + e + " tr:lt("+numRepo+")"), jQuery(i).each(function(e) { jQuery("th, td", this).each(function(e) { switch (e) { case 0: a = jQuery(this).text(); break; case 1: s = jQuery(this).text(); break; case 2: l = jQuery("img", this).attr('src'); break; } }); itemRepo = `
${a}
${s}
${a}
`; o.append(itemRepo); }); var c = jQuery("
"); c.append(o), jQuery(".S-CARDS").replaceWith(c), jQuery(this).removeClass("S-CARDS"); } }); });