[js] remove deprecation warnings by using $.noop instead of noop
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 19 Oct 2010 12:01:35 +0200
changeset 6543 66145280a7e6
parent 6542 f13c47ac9137
child 6544 e0d20fb46389
[js] remove deprecation warnings by using $.noop instead of noop
web/component.py
web/request.py
web/views/basecontrollers.py
web/views/cwproperties.py
web/views/formrenderers.py
--- a/web/component.py	Tue Oct 19 11:59:23 2010 +0200
+++ b/web/component.py	Tue Oct 19 12:01:35 2010 +0200
@@ -116,7 +116,7 @@
         # XXX hack to avoid opening a new page containing the evaluation of the
         # js expression on ajax call
         if url.startswith('javascript:'):
-            url += '; noop();'
+            url += '; $.noop();'
         return url
 
     def ajax_page_url(self, **params):
--- a/web/request.py	Tue Oct 19 11:59:23 2010 +0200
+++ b/web/request.py	Tue Oct 19 12:01:35 2010 +0200
@@ -609,7 +609,7 @@
         """
         extraparams.setdefault('fname', 'view')
         url = self.build_url('json', **extraparams)
-        return "javascript: $('#%s').%s; noop()" % (
+        return "javascript: $('#%s').%s; $.noop()" % (
             nodeid, js.loadxhtml(url, None, 'get', replacemode))
 
     # urls/path management ####################################################
--- a/web/views/basecontrollers.py	Tue Oct 19 11:59:23 2010 +0200
+++ b/web/views/basecontrollers.py	Tue Oct 19 12:01:35 2010 +0200
@@ -464,6 +464,7 @@
     @jsonize
     def js_i18n(self, msgids):
         """returns the translation of `msgid`"""
+        print 'translate', msgids, [self._cw._(msgid) for msgid in msgids]
         return [self._cw._(msgid) for msgid in msgids]
 
     @jsonize
--- a/web/views/cwproperties.py	Tue Oct 19 11:59:23 2010 +0200
+++ b/web/views/cwproperties.py	Tue Oct 19 12:01:35 2010 +0200
@@ -162,10 +162,10 @@
                                            for o, f in objects.iteritems())
             for label, oid, form in sorted_objects:
                 w(u'<div class="component">')
-                w(u'''<div class="componentLink"><a href="javascript:noop();"
+                w(u'''<div class="componentLink"><a href="javascript:$.noop();"
                            onclick="javascript:toggleVisibility('field_%(oid)s_%(group)s')"
                            class="componentTitle">%(label)s</a>''' % {'label':label, 'oid':oid, 'group':group})
-                w(u''' (<div class="openlink"><a href="javascript:noop();"
+                w(u''' (<div class="openlink"><a href="javascript:$.noop();"
                              onclick="javascript:openFieldset('fieldset_%(group)s')">%(label)s</a></div>)'''
                   % {'label':_('open all'), 'group':group})
                 w(u'</div>')
--- a/web/views/formrenderers.py	Tue Oct 19 11:59:23 2010 +0200
+++ b/web/views/formrenderers.py	Tue Oct 19 12:01:35 2010 +0200
@@ -460,7 +460,7 @@
             values['removemsg'] = self._cw._('remove-inlined-entity-form')
             w(u'<div class="iformTitle"><span>%(title)s</span> '
               '#<span class="icounter">%(counter)s</span> '
-              '[<a href="javascript: %(removejs)s;noop();">%(removemsg)s</a>]</div>'
+              '[<a href="javascript: %(removejs)s;$.noop();">%(removemsg)s</a>]</div>'
               % values)
         else:
             w(u'<div class="iformTitle"><span>%(title)s</span> '