cubicweb__loadurl -> cubicweb:lazyloadurl
authorsylvain.thenault@logilab.fr
Fri, 30 Jan 2009 12:29:37 +0100
changeset 522 385ce5e0b30b
parent 521 b3430af22580
child 523 f01cfce2e8d2
child 538 da51759027d0
cubicweb__loadurl -> cubicweb:lazyloadurl
common/view.py
web/data/cubicweb.lazy.js
web/views/tabs.py
--- a/common/view.py	Fri Jan 30 11:55:05 2009 +0100
+++ b/common/view.py	Fri Jan 30 12:29:37 2009 +0100
@@ -28,9 +28,9 @@
   <!ATTLIST html xmlns:cubicweb CDATA  #FIXED \'http://www.logilab.org/2008/cubicweb\'  >
 
 <!ENTITY % coreattrs
- "id          ID             #IMPLIED
-  class       CDATA          #IMPLIED
-  style       CDATA   #IMPLIED
+ "id          ID            #IMPLIED
+  class       CDATA         #IMPLIED
+  style       CDATA         #IMPLIED
   title       CDATA         #IMPLIED
 
  cubicweb:sortvalue         CDATA   #IMPLIED
@@ -58,6 +58,7 @@
  cubicweb:size              CDATA   #IMPLIED   
  cubicweb:tlunit            CDATA   #IMPLIED
  cubicweb:loadurl           CDATA   #IMPLIED
+ cubicweb:lazyloadurl       CDATA   #IMPLIED
  cubicweb:uselabel          CDATA   #IMPLIED
  cubicweb:facetargs         CDATA   #IMPLIED
  cubicweb:facetName         CDATA   #IMPLIED
--- a/web/data/cubicweb.lazy.js	Fri Jan 30 11:55:05 2009 +0100
+++ b/web/data/cubicweb.lazy.js	Fri Jan 30 12:29:37 2009 +0100
@@ -4,7 +4,7 @@
   var hole = lazydiv.children(holesel);
   if (hole.length == 0) /* the hole is already filled */
     return;
-  var vid_eid = lazydiv.attr('cubicweb__loadurl');
+  var vid_eid = lazydiv.attr('cubicweb:lazyloadurl');
   /* XXX see what could be done with jquery.loadxhtml(...)   */
   var later = async_rawremote_exec('lazily', vid_eid);
   later.addCallback(function(req) {
--- a/web/views/tabs.py	Fri Jan 30 11:55:05 2009 +0100
+++ b/web/views/tabs.py	Fri Jan 30 12:29:37 2009 +0100
@@ -35,9 +35,10 @@
         w = w or self.w
         self.req.add_js('cubicweb.lazy.js')
         eid = eid or ''
-        w(u'<div id="lazy-%s" cubicweb__loadurl="%s-%s">' % (vid, vid, eid))
+        w(u'<div id="lazy-%s" cubicweb:lazyloadurl="%s-%s">' % (vid, vid, eid))
         if show_spinbox:
-            w(u'<img src="data/loading.gif" id="%s-hole"/>' % vid)
+            w(u'<img src="data/loading.gif" id="%s-hole" alt="%s"/>'
+              % (vid, self.req._('loading')))
         w(u'</div>')
         self.req.html_headers.prepend_post_inline_script(u"""
 jQuery(document).ready(function () {
@@ -82,7 +83,8 @@
 
     def render_tabs(self, tabs, default, entity):
         self.req.add_css('ui.tabs.css')
-        self.req.add_js(('ui.core.js', 'ui.tabs.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js'))
+        self.req.add_js(('ui.core.js', 'ui.tabs.js',
+                         'cubicweb.ajax.js', 'cubicweb.tabs.js', 'cubicweb.lazy.js'))
         # prune tabs : not all are to be shown
         tabs = self.prune_tabs(tabs)
         # select a tab