v0.31 : 0018322 et 0018323 V00.31
authorcavaliet
Fri, 06 Dec 2013 14:38:11 +0100
changeset 213 defe7ee70fa2
parent 212 cb7987ab3f80
child 214 f04228275641
v0.31 : 0018322 et 0018323
src/jocondelab/__init__.py
src/jocondelab/locale/fr/LC_MESSAGES/django.mo
src/jocondelab/locale/fr/LC_MESSAGES/django.po
src/jocondelab/static/jocondelab/js/front-search.js
src/jocondelab/views/front_office.py
--- a/src/jocondelab/__init__.py	Thu Dec 05 18:56:29 2013 +0100
+++ b/src/jocondelab/__init__.py	Fri Dec 06 14:38:11 2013 +0100
@@ -1,4 +1,4 @@
-VERSION = (0, 30, 0, "final", 0)
+VERSION = (0, 31, 0, "final", 0)
 
 
 def get_version():
Binary file src/jocondelab/locale/fr/LC_MESSAGES/django.mo has changed
--- a/src/jocondelab/locale/fr/LC_MESSAGES/django.po	Thu Dec 05 18:56:29 2013 +0100
+++ b/src/jocondelab/locale/fr/LC_MESSAGES/django.po	Fri Dec 06 14:38:11 2013 +0100
@@ -302,7 +302,7 @@
 #: templates/jocondelab/front_geo.html:37
 #: templates/jocondelab/front_home.html:34
 msgid "Mappemonde"
-msgstr "Mappemonde"
+msgstr "Carte du monde"
 
 #: templates/jocondelab/front_base.html:103
 #: templates/jocondelab/front_home.html:41
--- a/src/jocondelab/static/jocondelab/js/front-search.js	Thu Dec 05 18:56:29 2013 +0100
+++ b/src/jocondelab/static/jocondelab/js/front-search.js	Fri Dec 06 14:38:11 2013 +0100
@@ -26,4 +26,44 @@
     		im.addClass("visited");
     	}
     });
+    
+    // Check if a dom element is the current viewport
+    // el is dom element, not jquery object
+    function isElementInViewport(el) {
+        var rect = el.getBoundingClientRect();
+        return (
+            rect.top >= 0 &&
+            rect.left >= 0 &&
+            rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) && /*or $(window).height() */
+            rect.right <= (window.innerWidth || document.documentElement.clientWidth) /*or $(window).width() */
+            );
+    }
+    var myTimeOut = false;
+    function startTimeOut(){
+    	myTimeOut = setInterval(function(){ testIfLastLiInViewport() }, 3000);
+    }
+    function testIfLastLiInViewport(){
+    	var el = $($(".results ul")[0]).children().last()[0];
+    	if ( isElementInViewport(el) ) {
+            // Last li is visible, so we have to call next page manually
+        	if (typeof queryobj === "object" && queryobj) {
+        		$(window).trigger("scroll.ajaxload");
+            }
+        }
+    	else{
+    		clearInterval(myTimeOut);
+    	}
+    }
+    
+    if (window.addEventListener) {
+        //addEventListener('DOMContentLoaded', testIfLastLiInViewport(), false); 
+        addEventListener('load', startTimeOut(), false); 
+        //addEventListener('scroll', testIfLastLiInViewport(), false); 
+        //addEventListener('resize', testIfLastLiInViewport(), false); 
+    } else if (window.attachEvent)  {
+        //attachEvent('DOMContentLoaded', testIfLastLiInViewport());
+        attachEvent('load', startTimeOut());
+        //attachEvent('scroll', testIfLastLiInViewport());
+        //attachEvent('resize', testIfLastLiInViewport());
+    }
 });
\ No newline at end of file
--- a/src/jocondelab/views/front_office.py	Thu Dec 05 18:56:29 2013 +0100
+++ b/src/jocondelab/views/front_office.py	Fri Dec 06 14:38:11 2013 +0100
@@ -153,8 +153,7 @@
             context["page_count"] = paginator.num_pages
             ids = paginator.page(min(int(page),paginator.num_pages))
             context["count"] = paginator.count
-            if paginator.count==0:
-                context["wkinfo"] = None
+            
             # Now that we have the list of ids
             ns = Notice.objects.filter(pk__in=ids).extra(select={'relative_url': '"core_noticeimage"."relative_url"'}).filter(image=True).filter(images__main=True).order_by('id')