[pypy-svn] r39855 - pypy/dist/pypy/translator/js/modules

guido at codespeak.net guido at codespeak.net
Sun Mar 4 12:05:17 CET 2007


Author: guido
Date: Sun Mar  4 12:05:15 2007
New Revision: 39855

Modified:
   pypy/dist/pypy/translator/js/modules/dom.py
   pypy/dist/pypy/translator/js/modules/mochikit.py
Log:
Moved some stuff from KeyEvent to Event to allow more generic event
registration, extended the MochiKit event interface a tiny bit.


Modified: pypy/dist/pypy/translator/js/modules/dom.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/dom.py	(original)
+++ pypy/dist/pypy/translator/js/modules/dom.py	Sun Mar  4 12:05:15 2007
@@ -429,6 +429,8 @@
     # XXX: From HTMLInputElement to make pythonconsole work.
     'value': str,
     'checked': bool,
+    # IMG specific
+    'src': str,
 })
 
 Element._methods = Node._methods.copy()
@@ -696,6 +698,13 @@
     'relatedTarget': Element,
     'target': Element,
     'type': str,
+    'returnValue': bool,
+    'which': int,
+    'keyCode' : int,
+    'charCode': int,
+    'altKey'  : bool,
+    'ctrlKey' : bool,
+    'shiftKey': bool,
 }
 
 Event._methods = {
@@ -707,13 +716,6 @@
 KeyEvent._methods = Event._methods.copy()
 
 KeyEvent._fields = Event._fields.copy()
-KeyEvent._fields.update({
-    'keyCode' : int,
-    'charCode': int,
-    'altKey'  : bool,
-    'ctrlKey' : bool,
-    'shiftKey': bool,
-})
 
 class _FunctionWrapper(object):
     """makes sure function return values are wrapped if appropriate"""

Modified: pypy/dist/pypy/translator/js/modules/mochikit.py
==============================================================================
--- pypy/dist/pypy/translator/js/modules/mochikit.py	(original)
+++ pypy/dist/pypy/translator/js/modules/mochikit.py	Sun Mar  4 12:05:15 2007
@@ -52,7 +52,11 @@
     pass
 
 Event._fields = {
-    '_event': dom.KeyEvent,
+    '_event': dom.Event,
+}
+
+Event._methods = {
+    'preventDefault': MethodDesc([]),
 }
 
 



More information about the Pypy-commit mailing list