1$(document).ready(function () { 2 let splide = document.getElementById("splide") 3 if (splide != null) { 4 5 new Splide('#splide', { 6 type: 'loop', 7 perPage: 1, 8 with : '100%', 9 autoplay: true, 10 //interval: 5000, 11 classes: { 12 arrows: 'splide__arrows slider_arrows', 13 }, 14 }).mount(); 15 } 16 window.addEventListener('resize', function ( { target }) { 17 if (target.innerWidth > 1024) {//Oculta el menu cuando no esta en Responsive 18 let menu_responsive = document.getElementById("menu_responsive") 19 let body = document.getElementsByTagName("html")[0] 20 menu_responsive.style.display = "none" 21 body.removeAttribute("style") 22 } 23 }, true); 24 $('.dropdown_items').click(function (e) { 25 let toDropElement = $(this).data("drop") 26 let dropdowns = document.querySelectorAll(".menuItems_dropdown") 27 for (const item of dropdowns) { 28 if (item.style.display == "block" && item.id != toDropElement) { 29 item.style.display = "none" 30 } 31 } 32 if ($(`#${toDropElement}`).css('display') == "none") { 33 $(`#${toDropElement}`).slideToggle('fast') 34 } else { 35 $(`#${toDropElement}`).css('display', 'none') 36 } 37 }) 38 39 40 $('#modalLogin .close').click(function (e) { 41 42 $('#modalLogin').modal('hide') 43 }) 44 45 $('#forgotPasswordModal .close').click(function (e) { 46 47 $('#forgotPasswordModal').modal('hide') 48 }) 49 50 //animateLoginLoading() 51 infiniteScrollLoadingPost() 52 $('.shortcut1').click(function () { 53 $('.shortcutsBtns').toggleClass('open'); 54 }) 55 responsiveMenu() 56 topBlackBarEvents() 57 getUrlOnLoginModal() 58 voteGirl() 59 60}); 61 62$('#btn-logout').on('click', function(){ 63 sessionStorage.removeItem('votomaximo'); 64}) 65 66function getUrlOnLoginModal() { 67 $('#login_modal').on('show.bs.modal', function ( { relatedTarget }) { 68 let url = relatedTarget.getAttribute('data-url') 69 let urlGo = document.getElementById('urlGo') 70 urlGo.value = url 71 }); 72} 73function infiniteScrollLoadingPost() { 74 let options = { 75 root: null, 76 rootMargins: "0px", 77 threshold: 0.5 78 } 79 let observerInfiniteScroll = document.getElementById("observerInfiniteScroll") 80 if (observerInfiniteScroll != null) { 81 const observer = new IntersectionObserver(eventIntersect, options) 82 observer.observe(observerInfiniteScroll) 83 } 84} 85 86async function eventIntersect(elements) { 87 88//se valida si se encontro un elemento del observer 89 if (elements[0].isIntersecting) { 90 let observerInfiniteScroll = document.getElementById("observerInfiniteScroll") 91 //se valida que el element del observer no se haya Observado anteriormente 92 if (observerInfiniteScroll.getAttribute('data-observer') == 0) { 93 let FrameloadingDataPosts = document.getElementById("loadingDataPosts") 94 95 //Se cambia el status del elemento del Observer a 1 "Visto" 96 observerInfiniteScroll.setAttribute("data-observer", 1) 97 98 //se obtienen los datos para la peticion 99 let mainArticleContainer = document.getElementById("mainArticleContainer") 100 let limit = mainArticleContainer.getAttribute("data-limit") 101 let skip = mainArticleContainer.getAttribute("data-skip") 102 let source = mainArticleContainer.getAttribute("data-source") 103 let element = mainArticleContainer.getAttribute("data-element") 104 let category = mainArticleContainer.getAttribute("data-category") 105 let title = mainArticleContainer.getAttribute("data-title") 106 107 //se genera un formulario y se agregan los datos a enviar por el fetch 108 let formData = new FormData() 109 formData.append("skip", skip) 110 formData.append("limit", limit) 111 formData.append("source", source) 112 formData.append("element", element) 113 formData.append("category", category) 114 formData.append("title", title) 115 //Se ejecuta el Fectch con await y se obtienen los datos 116 let getDataPost = await fetch("/VipFrontEnd/getDataSource", {method: "POST", body: formData}) 117 118 //se procesan los datos que retorno como html como TEXT 119 let posts = await getDataPost.text() 120 121 122 123 //Se valida si hay datos 124 if (posts != "") { 125//se calcula la proxima solicitud de datos y se actualiza el SKIP 126 skip = parseInt(skip) + parseInt(limit) 127 //se asigna el skip y se añade los nuevos POST a la lista actual al final 128 mainArticleContainer.setAttribute("data-skip", skip) 129 mainArticleContainer.insertAdjacentHTML('beforeend', posts) 130 131 //Se vuelve a setear el Observer a 0 "No visto"
132 observerInfiniteScroll.setAttribute("data-observer", 0) 133 } else { 134//Se remueve el PlaceHolder de carga y se muestra mensaje 135 if (FrameloadingDataPosts != null) { 136 FrameloadingDataPosts.remove() 137 let noContent = "No content to display" 138 let hasContent = "No more content to display" 139 let childs = mainArticleContainer.childElementCount 140 mainArticleContainer.insertAdjacentHTML('beforeend', `<h3 style='text-align:center;width:100%;margin-top:2rem;'>${childs == 0 ? noContent : hasContent}</h3>`) 141 } 142 } 143 } 144 } 145} 146 147function responsiveMenu() { 148//open menu 149 let menuResponsiveBtn = document.getElementById("menu_mobile_btn") 150 if (typeof (menuResponsiveBtn) != 'undefined' && menuResponsiveBtn != null) { 151 menuResponsiveBtn.addEventListener("click", (e) => { 152 let menu_responsive = document.getElementById("menu_responsive") 153 let body = document.getElementsByTagName("html")[0] 154 menu_responsive.style.display = "flex" 155 body.style.overflowY = "hidden" 156 }) 157 } 158 159 160//close menu 161 let btn_menu_responsive_close = document.getElementById("btn_menu_responsive_close") 162 if (typeof (btn_menu_responsive_close) != 'undefined' && btn_menu_responsive_close != null) { 163 btn_menu_responsive_close.addEventListener("click", (e) => { 164 let menu_responsive = document.getElementById("menu_responsive") 165 let body = document.getElementsByTagName("html")[0] 166 menu_responsive.style.display = "none" 167 body.removeAttribute("style") 168 }) 169 } 170 171 172//expand subMenu 173 let submenus = document.getElementsByClassName("submenu_links_container"); 174 for (const menu of submenus) { 175 menu.addEventListener("click", ({ target }) => { 176 let ul = target.parentElement.nextElementSibling; 177 ul.classList.toggle("open") 178 }, true) 179 } 180} 181 182function topBlackBarEvents() { 183 if ($('#search_article_btn').length) { 184 let search_article_btn = document.getElementById("search_article_btn").addEventListener("click", (e) => { 185 let search_article_btn = document.getElementById("search_article_btn") 186 let searchInputContainer = document.getElementById("searchInputContainer") 187 let searchArticleName = document.getElementById("searchArticleName") 188 searchArticleName.value = "" 189 searchArticleName.focus() 190 191 // language_selector.style.display = "none" 192 search_article_btn.style.display = "none" 193 searchInputContainer.style.display = "contents" 194 // searchInputContainer.classList.toggle("bar_container_
194center") 195 }); 196 } 197 if ($('#searchArticleName').length) { 198 let searchArticleName = document.getElementById("searchArticleName").addEventListener("keypress", (e) => { 199 if (e.key == "Enter") { 200 location.href = `/search/${e.target.value}` 201 } 202 }, true); 203 } 204 if ($('#btnSearchClose').length) { 205 let btnSearchClose = document.getElementById("btnSearchClose").addEventListener("click", (e) => { 206 let search_article_btn = document.getElementById("search_article_btn") 207 let searchInputContainer = document.getElementById("searchInputContainer") 208 search_article_btn.style.display = "block" 209 searchInputContainer.style.display = "none" 210 }, true); 211 } 212 213 _LOADING_ = ''; 214} 215 216function voteGirl() { 217 $('.btn_set_new_vote').on('click', function () { 218 var id = $(this).data("id"); 219 var today = new Date(); 220 var day = today.getDate(); 221 var month = today.getMonth() + 1; 222 var year = today.getFullYear(); 223 const fecha = `${day}-${month}-${year}`; 224 var votomaximo = sessionStorage.getItem('votomaximo'); 225 if (votomaximo != null && votomaximo != '') { 226 votomaximo = JSON.parse(votomaximo); 227 let i = 0; 228 votomaximo.forEach(function (e) { 229 if (e.fecha == fecha && e.id == id) { 230 i = 1; 231 $('small[data-error="' + id + '"]').removeClass('d-none'); 232 } 233 }); 234 if (i == 1) { 235 return false; 236 } 237 } 238 239 let formData = new FormData(); 240 formData.append("id", id); 241 fetch("/VipBmcmsServices/voteGirl", {method: "POST", body: formData}) 242 .then(response => response.json()) 243 .then(response => { 244 if (response.votesCount != null) { 245 $(`#girl_vote_${id}`).text(response.votesCount.Votes); 246 }else if (response.maxvoto != null) { 247 $('small[data-error="' + response.maxvoto + '"]').removeClass('d-none'); 248 if (votomaximo == null || votomaximo == '') { 249 sessionStorage.setItem('votomaximo', JSON.stringify([{'fecha': fecha, 'id': id}])); 250 } else { 251 let i = 2; 252 votomaximo.forEach(function (e) { 253 if (e.id == id) { 254 i = 0; 255 } 256 }); 257 if (i == 2) { 258 votomaximo.push({'fecha': fecha, 'id': id}); 259 sessionStorage.setItem('votomaximo', JSON.stringify(votomaximo)); 260 } 261 } 262 } else { 263 console.error(`No se pudo encontrar la Girl con el id ${id}`) 264 } 265 }); 266 return false; 267 }); 268} 269 270$('#iconLenguaje').on('click', function () { 271 $(this).addClass('d-none'); 272 $('#selectLenguaje').removeClass('d-none'); 273}); 274$('#selectLenguaje').on('change', function () { 275 var id = $(this).val(); 276 var text = $(this).text(); 277 if (id != '') { 278 $('#iconLenguaje').removeClass('d-none'); 279 $('#selectLenguaje').addClass('d-none'); 280 $('#text-idioma').text($('#selectLenguaje option:selected').text()); 281 } 282 if (id == 'en|en') { 283 $('#text-idioma').text(''); 284 } 285}); 286$('#modalRules .close').on('click', function () { 287 $('#modalRules').modal('hide'); 288 return false; 289}); 290$('#btnModalRule').on('click', function () { 291 $('#modalRules').modal('show'); 292 return false; 293}); 294function loadDetailArticle(sport, league, gameNum, lenguage) { 295 296 let redirect = '/' + lenguage + '/sportbook/'; 297 let form = $('<form action="' + redirect + '" method="post">' + 298 '<input type="hidden" name="sport" value="' + sport + '" />' + 299 '<input type="hidden" name="league" value="' + league + '" />' + 300 '<input type="hidden" name="gameNum" value="' + gameNum + '" />' + 301 '</form>'); 302 $('body').append(form); 303 $(form).submit(); 304}
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.