1$ = jQuery.noConflict(); 2 3$(document).ready(function () { 4 5 chamarCSS(); 6 alterarBotoesDirectionUltimasCapacitacoes(); 7 montarDataHoraUltimasCapacitacoes(); 8 montarBotaoVerMaisUltimasCapacitacoes(); 9 alteraPosicaoItensCarouselUltimasCapacitacoes(); 10 delimitarEspacoSubtitulosCarouselUltimasCapacitacoes(); 11 12 alterarBotoesDirectionUltimasCapacitacoesMobile(); 13 montarDataHoraUltimasCapacitacoesMobile(); 14 montarBotaoVerMaisUltimasCapacitacoesMobile(); 15 alteraPosicaoItensCarouselUltimasCapacitacoesMobile(); 16 delimitarEspacoSubtitulosCarouselUltimasCapacitacoesMobile(); 17 18 function chamarCSS() { 19 var protocolo = window.location.protocol; 20 var host = window.location.host; 21 22 var linkCss = protocolo + '//' + host + '/assets/css/solucoes-coop-capacita-coop.css'; 23 24 $('head').append('<link rel="stylesheet" type="text/css" href="' + linkCss + '">'); 25 } 26 27 function alterarBotoesDirectionUltimasCapacitacoes() { 28 var prevSvg = '<svg id="Grupo_2994" data-name="Grupo 2994" xmlns="http://www.w3.org/2000/svg" width="35.789" height="35.789" viewBox="0 0 35.789 35.789"> < path id = "Caminho_26899" data-name="Caminho 26899" d = "M17.9.4A17.495,17.495,0,1,0,35.39,17.894,17.5,17.5,0,0,0,17.9.4" fill = "none" /> <circle id="Elipse_215" data-name="Elipse 215" cx="17.495" cy="17.495" r="17.495" transform="translate(0.4 0.399)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> <path id="Caminho_26900" data-name="Caminho 26900" d="M21.937,8.343l-9.551,9.551,9.551,9.551" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> </svg > '; 29 30 var nextSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="35.789" height="35.789" viewBox="0 0 35.789 35.789"><g id="Grupo_2995" data-name="Grupo 2995" transform="translate(-1151.063 -2928.999)"> <path id="Caminho_26901" data-name="Caminho 26901" d="M70.927.4a17.495,17.495,0,1,1-17.5,17.495A17.5,17.5,0,0,1,70.927.4" transform="translate(1098.029 2929)" fill="none"/> <circle id="Elipse_216" data-name="Elipse 216" cx="17.495" cy="17.495" r="17.495" transform="translate(1151.462 2929.398)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> <path id="Caminho_26902" data-name="Caminho 26902" d="M66.886,8.343l9.551,9.551-9.551,9.551" transform="translate(1098.029 2929)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/></g></svg>'; 31 32 $('.carousel-ultimas-capacitacoes') 33 .children('.sppb-addon-content') 34 .children('.sppb-row') 35 .children('.bx-wrapper') 36 .children('.bx-controls.bx-has-controls-direction') 37 .children('.bx-controls-direction') 38 .children('a.bx-prev') 39 .children('i').remove() 40 41 $('.carousel-ultimas-capacitacoes') 42 .children('.sppb-addon-content') 43 .children('.sppb-row') 44 .children('.bx-wrapper') 45 .children('.bx-controls.bx-has-controls-direction') 46 .children('.bx-controls-direction') 47 .children('a.bx-next') 48 .children('i').remove() 49 50 $('.carousel-ultimas-capacitacoes') 51 .children('.sppb-addon-content') 52 .children('.sppb-row') 53 .children('.bx-wrapper') 54 .children('.bx-controls.bx-has-controls-direction') 55 .children('.bx-controls-direction') 56 .children('a.bx-prev').append(prevSvg) 57 58 $('.carousel-ultimas-capacitacoes') 59 .children('.sppb-addon-content') 60 .children('.sppb-row') 61 .children('.bx-wrapper') 62 .children('.bx-controls.bx-has-controls-direction') 63 .children('.bx-controls-direction') 64 .children('a.bx-next').append(nextSvg) 65 } 66 67 function montarDataHoraUltimasCapacitacoes() { 68 $('.carousel-ultimas-capacitacoes') 69 .children('.sppb-addon-content') 70 .children('.sppb-row') 71 .children('.bx-wrapper') 72 .children('.bx-viewport') 73 .children('.sppb-articles-carousel-wrap') 74 .children('.sppb-col-md-4') 75 .each(function () { 76 77 var textoCompleto = $(this) 78 .children('.sppb-articles-carousel-content') 79 .children('.sppb-articles-carousel-introtext') 80 .text(); 81 82 var arrText = textoCompleto.split('$'); 83 84 var duracaoCurso = arrText[0]; 85 var modalidade = arrText[1]; 86 87 $(this).children('.sppb-articles-carousel-content') 88 .children('.sppb-articles-carousel-introtext') 89 .before('<div class="data-e-hora-evento"><div class="data-evento"><i class="far fa-clock"></i> ' + duracaoCurso + '</div></div>'); 90 91 $(this).children('.sppb-articles-carousel-content') 92 .children('.data-e-hora-evento') 93 .append('<div class="hora-evento"><i class="fa fa-globe" aria-hidden="true"></i>' + modalidade + '</div>'); 94 95 $(this).children('.sppb-articles-carousel-content') 96 .children('.sppb-articles-carousel-introtext') 97 .text(arrText[2]); 98 99 }); 100 } 101 102 function montarBotaoVerMaisUltimasCapacitacoes() { 103 $('.carousel-ultimas-capacitacoes') 104 .children('.sppb-addon-content') 105 .children('.sppb-row') 106 .children('.bx-wrapper') 107 .children('.bx-viewport') 108 .children('.sppb-articles-carousel-wrap') 109 .children('.sppb-articles-carousel-column') 110 .each(function (key, data) { 111 var linkPublicacao = $(this) 112 .children('.sppb-articles-carousel-content') 113 .children('.sppb-articles-carousel-link')[0].href; 114 115 $(this).children('.sppb-articles-carousel-content') 116 .append('<div class="inscreva-se"><a href="' + linkPublicacao + '" class="botao-inscreva-se botao-borda-azul-petroleo">insecreva-se</a></div>'); 117 118 }); 119 } 120 121 function alteraPosicaoItensCarouselUltimasCapacitacoes() { 122 $('.carousel-ultimas-capacitacoes') 123 .children('.sppb-addon-content') 124 .children('.sppb-row') 125 .children('.bx-wrapper') 126 .children('.bx-viewport') 127 .children('.sppb-articles-carousel-wrap') 128 .children('.sppb-col-md-4') 129 .children('.sppb-articles-carousel-content') 130 .each(function () { 131 var titulo = $(this).children('.sppb-articles-carousel-link'); 132 var dataEHora = $(this).children('.data-e-hora-evento') 133 var texto = $(this).children('.sppb-articles-carousel-introtext') 134 var botaoInscreva = $(this).children('.inscreva-se') 135 136 $(this).append(titulo, texto, dataEHora,botaoInscreva) 137 }) 138 } 139 140 function delimitarEspacoSubtitulosCarouselUltimasCapacitacoes() { 141 $('.carousel-ultimas-capacitacoes') 142 .children('.sppb-addon-content') 143 .children('.sppb-row') 144 .children('.bx-wrapper') 145 .children('.bx-viewport') 146 .children('.sppb-articles-carousel-wrap') 147 .children('.sppb-col-md-4') 148 .children('.sppb-articles-carousel-content') 149 .each(function () { 150 151 var titulo = $(this) 152 .children('.sppb-articles-carousel-link') 153 .text(); 154 155 var texto = $(this) 156 .children('.sppb-articles-carousel-introtext') 157 .text(); 158 159 if (titulo.length <= 20) { 160 161 $(this) 162 .children('.sppb-articles-carousel-introtext') 163 .text(limitarTextoArtigo(texto, 150)); 164 165 $(this) 166 .children('.sppb-articles-carousel-link') 167 .css('height', '1rem'); 168 169 $(this) 170 .children('.sppb-articles-carousel-introtext') 171 .css('height', '5.5rem'); 172 173 } 174 175 if (titulo.length > 20 && titulo.length <= 30) { 176 $(this) 177 .children('.sppb-articles-carousel-introtext') 178 .text(limitarTextoArtigo(texto, 110)); 179 180 $(this) 181 .children('.sppb-articles-carousel-link') 182 .css('height', '2.5rem'); 183 184 $(this) 185 .children('.sppb-articles-carousel-introtext') 186 .css('height', '4rem'); 187 188 } 189 190 if (titulo.length > 30 && titulo.length <= 40) { 191 $(this) 192 .children('.sppb-articles-carousel-introtext') 193 .text(limitarTextoArtigo(texto, 85)); 194 195 $(this) 196 .children('.sppb-articles-carousel-link') 197 .css('height', '2.5rem'); 198 199 $(this) 200 .children('.sppb-articles-carousel-introtext') 201 .css('height', '4rem'); 202 203 } 204 205 if (titulo.length > 40 && titulo.length <= 50) { 206 $(this) 207 .children('.sppb-articles-carousel-introtext') 208 .text(limitarTextoArtigo(texto, 60)); 209 210 $(this) 211 .children('.sppb-articles-carousel-link') 212 .css('height', '3.7rem'); 213 214 $(this) 215 .children('.sppb-articles-carousel-introtext') 216 .css('height', '2.8rem'); 217 218 } 219 220 if (titulo.length >= 50) { 221 $(this) 222 .children('.sppb-articles-carousel-introtext') 223 .text(limitarTextoArtigo(texto, 0)); 224 $(this) 225 .children('.sppb-articles-carousel-link') 226 .css('height', '6.5rem'); 227 } 228 229 }); 230 231 } 232 233 function limitarTextoArtigo(texto, tamanhoTexto) { 234 235 var textoReduzido = texto.slice(0, tamanhoTexto); 236 237 return textoReduzido; 238 } 239 240 // mobile 241 function alterarBotoesDirectionUltimasCapacitacoesMobile() { 242 var prevSvg = '<svg id="Grupo_2994" data-name="Grupo 2994" xmlns="http://www.w3.org/2000/svg" width="35.789" height="35.789" viewBox="0 0 35.789 35.789">
242 < path id = "Caminho_26899" data-name="Caminho 26899" d = "M17.9.4A17.495,17.495,0,1,0,35.39,17.894,17.5,17.5,0,0,0,17.9.4" fill = "none" /> <circle id="Elipse_215" data-name="Elipse 215" cx="17.495" cy="17.495" r="17.495" transform="translate(0.4 0.399)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> <path id="Caminho_26900" data-name="Caminho 26900" d="M21.937,8.343l-9.551,9.551,9.551,9.551" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> </svg > '; 243 244 var nextSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="35.789" height="35.789" viewBox="0 0 35.789 35.789"><g id="Grupo_2995" data-name="Grupo 2995" transform="translate(-1151.063 -2928.999)"> <path id="Caminho_26901" data-name="Caminho 26901" d="M70.927.4a17.495,17.495,0,1,1-17.5,17.495A17.5,17.5,0,0,1,70.927.4" transform="translate(1098.029 2929)" fill="none"/> <circle id="Elipse_216" data-name="Elipse 216" cx="17.495" cy="17.495" r="17.495" transform="translate(1151.462 2929.398)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/> <path id="Caminho_26902" data-name="Caminho 26902" d="M66.886,8.343l9.551,9.551-9.551,9.551" transform="translate(1098.029 2929)" fill="none" stroke="#5080b9" stroke-linecap="round" stroke-miterlimit="10" stroke-width="0.799"/></g></svg>'; 245 246 $('.carousel-ultimas-capacitacoes-mobile') 247 .children('.sppb-addon-content') 248 .children('.sppb-row') 249 .children('.bx-wrapper') 250 .children('.bx-controls.bx-has-controls-direction') 251 .children('.bx-controls-direction') 252 .children('a.bx-prev') 253 .children('i').remove() 254 255 $('.carousel-ultimas-capacitacoes-mobile') 256 .children('.sppb-addon-content') 257 .children('.sppb-row') 258 .children('.bx-wrapper') 259 .children('.bx-controls.bx-has-controls-direction') 260 .children('.bx-controls-direction') 261 .children('a.bx-next') 262 .children('i').remove() 263 264 $('.carousel-ultimas-capacitacoes-mobile') 265 .children('.sppb-addon-content') 266 .children('.sppb-row') 267 .children('.bx-wrapper') 268 .children('.bx-controls.bx-has-controls-direction') 269 .children('.bx-controls-direction') 270 .children('a.bx-prev').append(prevSvg) 271 272 $('.carousel-ultimas-capacitacoes-mobile') 273 .children('.sppb-addon-content') 274 .children('.sppb-row') 275 .children('.bx-wrapper') 276 .children('.bx-controls.bx-has-controls-direction') 277 .children('.bx-controls-direction') 278 .children('a.bx-next').append(nextSvg) 279 } 280 281 function montarDataHoraUltimasCapacitacoesMobile() { 282 $('.carousel-ultimas-capacitacoes-mobile') 283 .children('.sppb-addon-content') 284 .children('.sppb-row') 285 .children('.bx-wrapper') 286 .children('.bx-viewport') 287 .children('.sppb-articles-carousel-wrap') 288 .children('.sppb-col-md-4') 289 .each(function () { 290 291 var textoCompleto = $(this) 292 .children('.sppb-articles-carousel-content') 293 .children('.sppb-articles-carousel-introtext') 294 .text(); 295 296 var arrText = textoCompleto.split('$'); 297 298 var duracaoCurso = arrText[0]; 299 var modalidade = arrText[1]; 300 301 $(this).children('.sppb-articles-carousel-content') 302 .children('.sppb-articles-carousel-introtext') 303 .before('<div class="data-e-hora-evento"><div class="data-evento"><i class="far fa-clock"></i> ' + duracaoCurso + '</div></div>'); 304 305 $(this).children('.sppb-articles-carousel-content') 306 .children('.data-e-hora-evento') 307 .append('<div class="hora-evento"><i class="fa fa-globe" aria-hidden="true"></i>' + modalidade + '</div>'); 308 309 $(this).children('.sppb-articles-carousel-content') 310 .children('.sppb-articles-carousel-introtext') 311 .text(arrText[2]); 312 313 }); 314 } 315 316 function montarBotaoVerMaisUltimasCapacitacoesMobile() { 317 $('.carousel-ultimas-capacitacoes-mobile') 318 .children('.sppb-addon-content') 319 .children('.sppb-row') 320 .children('.bx-wrapper') 321 .children('.bx-viewport') 322 .children('.sppb-articles-carousel-wrap') 323 .children('.sppb-articles-carousel-column') 324 .each(function (key, data) { 325 var linkPublicacao = $(this) 326 .children('.sppb-articles-carousel-content') 327 .children('.sppb-articles-carousel-link')[0].href; 328 329 $(this).children('.sppb-articles-carousel-content') 330 .append('<div class="inscreva-se"><a href="' + linkPublicacao + '" class="botao-inscreva-se botao-borda-azul-petroleo">insecreva-se</a></div>'); 331 332 }); 333 } 334 335 function alteraPosicaoItensCarouselUltimasCapacitacoesMobile() { 336 $('.carousel-ultimas-capacitacoes-mobile') 337 .children('.sppb-addon-content') 338 .children('.sppb-row') 339 .children('.bx-wrapper') 340 .children('.bx-viewport') 341 .children('.sppb-articles-carousel-wrap') 342 .children('.sppb-col-md-4') 343 .children('.sppb-articles-carousel-content') 344 .each(function () { 345 var titulo = $(this).children('.sppb-articles-carousel-link'); 346 var dataEHora = $(this).children('.data-e-hora-evento') 347 var texto = $(this).children('.sppb-articles-carousel-introtext') 348 var botaoInscreva = $(this).children('.inscreva-se') 349 350 $(this).append(titulo, texto, dataEHora,botaoInscreva) 351 }) 352 } 353 354 function delimitarEspacoSubtitulosCarouselUltimasCapacitacoesMobile() { 355 $('.carousel-ultimas-capacitacoes-mobile') 356 .children('.sppb-addon-content') 357 .children('.sppb-row') 358 .children('.bx-wrapper') 359 .children('.bx-viewport') 360 .children('.sppb-articles-carousel-wrap') 361 .children('.sppb-col-md-4') 362 .children('.sppb-articles-carousel-content') 363 .each(function () { 364 365 var titulo = $(this) 366 .children('.sppb-articles-carousel-link') 367 .text(); 368 369 var texto = $(this) 370 .children('.sppb-articles-carousel-introtext') 371 .text(); 372 373 if (titulo.length <= 20) { 374 375 $(this) 376 .children('.sppb-articles-carousel-introtext') 377 .text(limitarTextoArtigo(texto, 150)); 378 379 $(this) 380 .children('.sppb-articles-carousel-link') 381 .css('height', '1rem'); 382 383 $(this) 384 .children('.sppb-articles-carousel-introtext') 385 .css('height', '5.5rem'); 386 387 } 388 389 if (titulo.length > 20 && titulo.length <= 30) { 390 $(this) 391 .children('.sppb-articles-carousel-introtext') 392 .text(limitarTextoArtigo(texto, 110)); 393 394 $(this) 395 .children('.sppb-articles-carousel-link') 396 .css('height', '2.5rem'); 397 398 $(this) 399 .children('.sppb-articles-carousel-introtext') 400 .css('height', '4rem'); 401 402 } 403 404 if (titulo.length > 30 && titulo.length <= 40) { 405 $(this) 406 .children('.sppb-articles-carousel-introtext') 407 .text(limitarTextoArtigo(texto, 85)); 408 409 $(this) 410 .children('.sppb-articles-carousel-link') 411 .css('height', '2.5rem'); 412 413 $(this) 414 .children('.sppb-articles-carousel-introtext') 415 .css('height', '4rem'); 416 417 } 418 419 if (titulo.length > 40 && titulo.length <= 50) { 420 $(this) 421 .children('.sppb-articles-carousel-introtext') 422 .text(limitarTextoArtigo(texto, 60)); 423 424 $(this) 425 .children('.sppb-articles-carousel-link') 426 .css('height', '3.7rem'); 427 428 $(this) 429 .children('.sppb-articles-carousel-introtext') 430 .css('height', '2.8rem'); 431 432 } 433 434 if (titulo.length >= 50) { 435 $(this) 436 .children('.sppb-articles-carousel-introtext') 437 .text(limitarTextoArtigo(texto, 0)); 438 $(this) 439 .children('.sppb-articles-carousel-link') 440 .css('height', '6.5rem'); 441 } 442 443 }); 444 445 } 446 447}); 448
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.