diff --git a/Source/assets/html/firstCodes.twig b/Source/assets/html/firstCodes.twig index 759ba73..e3c55b0 100644 --- a/Source/assets/html/firstCodes.twig +++ b/Source/assets/html/firstCodes.twig @@ -1,5 +1,10 @@
+ {% if page.last is empty %} +
+

No more code to load

+
+ {% endif %} {% for code in page.last %} {% if loop.index0 is divisible by(2) %}
diff --git a/Source/assets/js/functions.js b/Source/assets/js/functions.js index 5f4b6be..a3a8978 100644 --- a/Source/assets/js/functions.js +++ b/Source/assets/js/functions.js @@ -9,7 +9,7 @@ function doAjax(postValue) { conexion.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); conexion.send(postValue); //Las variables a mandar, en este caso POST } - +newFilter=false; function ajaxresponse(){ if(conexion.readyState == 4){ //Esto es para que cambie cuando haya respuesta, que no es en todos los momentos o++; @@ -18,7 +18,8 @@ function ajaxresponse(){ 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{ - ajaxPut.innerHTML = ajaxPut.innerHTML+conexion.responseText; + if($("#end").length == 0) + ajaxPut.innerHTML = ajaxPut.innerHTML+conexion.responseText; } } reHightlight(); @@ -41,7 +42,9 @@ function getAjax(reset=false) { if(reset){ resetFilter(); } - + if(!newFilter && $("#end").length!=0){ + return; + } var checkboxes = document.getElementsByClassName("codeFilterCheckBoxInput"); var i; var count = false;