mirror of
https://gitlab.com/CodeSolutionsProject/CodeShare.git
synced 2026-02-14 17:11:34 +01:00
Improve ajax for dynamic load of snippets
This commit is contained in:
@@ -17,7 +17,7 @@ function ajaxresponse(){
|
||||
if(newFilter){
|
||||
newFilter=false;
|
||||
ajaxPut.innerHTML = conexion.responseText; //Pondra todo lo devuelto por "file" (Que sera un php que de //echos dependiendo de lo enviado) en un div
|
||||
}else{
|
||||
}else{
|
||||
if($("#end").length == 0)
|
||||
ajaxPut.innerHTML = ajaxPut.innerHTML+conexion.responseText;
|
||||
}
|
||||
@@ -29,7 +29,9 @@ function reHightlight(){
|
||||
var codebox = document.getElementsByClassName("toHightlight");
|
||||
for(var i=0;i<codebox.length;++i){
|
||||
hljs.highlightBlock(codebox[i]);
|
||||
codebox.classList.remove('toHightlight');
|
||||
}
|
||||
for(var i=0;i<codebox.length;++i){
|
||||
codebox[i].classList.remove('toHightlight');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,13 +103,6 @@ function borrarCookie(clave){
|
||||
crearCookie(clave,"",-1);
|
||||
}
|
||||
|
||||
function desloguearse(){
|
||||
borrarCookie("logueado");
|
||||
borrarCookie("usuario");
|
||||
borrarCookie("token");
|
||||
location.reload(true);
|
||||
}
|
||||
|
||||
function unselectAll() {
|
||||
var checkboxes = document.getElementsByClassName("codeFilterCheckBoxInput");
|
||||
var i;
|
||||
@@ -145,10 +140,10 @@ function resetFilter(){
|
||||
resetOffset();
|
||||
}
|
||||
|
||||
resetOffset();
|
||||
o=1;
|
||||
|
||||
$(window).scroll(function () {
|
||||
if ($(window).scrollTop() >= $(document).height() - $(window).height() - 10) {
|
||||
if (Math.ceil($(window).scrollTop() + $(window).height())== Math.ceil($(document).height())) {
|
||||
getAjax();
|
||||
}
|
||||
});
|
||||
|
||||
6
Source/assets/js/jquery-3.2.1.min.js
vendored
6
Source/assets/js/jquery-3.2.1.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user