]> source.dussan.org Git - vaadin-framework.git/commitdiff
Wrap javascript callback entry points in $entry (#8699)
authorLeif Åstrand <leif@vaadin.com>
Tue, 24 Apr 2012 13:41:05 +0000 (13:41 +0000)
committerLeif Åstrand <leif@vaadin.com>
Tue, 24 Apr 2012 13:41:05 +0000 (13:41 +0000)
svn changeset:23623/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java
src/com/vaadin/terminal/gwt/client/HistoryImplIEVaadin.java
src/com/vaadin/terminal/gwt/client/Util.java
src/com/vaadin/terminal/gwt/client/ui/UploadIFrameOnloadStrategy.java
src/com/vaadin/terminal/gwt/client/ui/UploadIFrameOnloadStrategyIE.java
src/com/vaadin/terminal/gwt/client/ui/VCustomLayout.java
src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapper.java
src/com/vaadin/terminal/gwt/client/ui/VDragAndDropWrapperIE.java
src/com/vaadin/terminal/gwt/client/ui/VTextField.java
src/com/vaadin/terminal/gwt/client/ui/VVideo.java

index 4c6fc8462bd182e950861e39e32ef1b30082595b..de7ad83b54f78bca8023f52cc1137459e1752891 100644 (file)
@@ -220,10 +220,10 @@ public class ApplicationConnection {
     /*-{
        var ap = this;
        var client = {};
-       client.isActive = function() {
+       client.isActive = $entry(function() {
                return ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::hasActiveRequest()()
                                || ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::isExecutingDeferredCommands()();
-       }
+       });
        
        var vi = ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::getVersionInfo()();
        if (vi) {
@@ -232,21 +232,21 @@ public class ApplicationConnection {
                }
        }
        
-       client.getProfilingData = function() {
+       client.getProfilingData = $entry(function() {
            var pd = [
                    ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::lastProcessingTime,
                     ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::totalProcessingTime
                ];
            pd = pd.concat(ap.@com.vaadin.terminal.gwt.client.ApplicationConnection::testBenchServerStatus);
            return pd;
-       }
+       });
 
-       client.getElementByPath = function(id) {
+       client.getElementByPath = $entry(function(id) {
                return componentLocator.@com.vaadin.terminal.gwt.client.ComponentLocator::getElementByPath(Ljava/lang/String;)(id);
-       }
-       client.getPathForElement = function(element) {
+       });
+       client.getPathForElement = $entry(function(element) {
                return componentLocator.@com.vaadin.terminal.gwt.client.ComponentLocator::getPathForElement(Lcom/google/gwt/user/client/Element;)(element);
-       }
+       });
 
        if (!$wnd.vaadin.clients) {
                $wnd.vaadin.clients = {};
@@ -292,22 +292,22 @@ public class ApplicationConnection {
        if ($wnd.vaadin.forceSync) {
                oldSync = $wnd.vaadin.forceSync;
        }
-       $wnd.vaadin.forceSync = function() {
+       $wnd.vaadin.forceSync = $entry(function() {
                if (oldSync) {
                        oldSync();
                }
                app.@com.vaadin.terminal.gwt.client.ApplicationConnection::sendPendingVariableChanges()();
-       }
+       });
        var oldForceLayout;
        if ($wnd.vaadin.forceLayout) {
                oldForceLayout = $wnd.vaadin.forceLayout;
        }
-       $wnd.vaadin.forceLayout = function() {
+       $wnd.vaadin.forceLayout = $entry(function() {
                if (oldForceLayout) {
                        oldForceLayout();
                }
                app.@com.vaadin.terminal.gwt.client.ApplicationConnection::forceLayout()();
-       }
+       });
     }-*/;
 
     /**
index 217013095aaf82667e2d42e44eb5be4891bb42c2..05719593398c9c27442cbd139c3189bfddb71b90 100644 (file)
@@ -139,9 +139,9 @@ public class HistoryImplIEVaadin extends HistoryImpl {
     /*-{
        var historyImplRef = this;
 
-       $wnd.__gwt_onHistoryLoad = function(token) {
+       $wnd.__gwt_onHistoryLoad = $entry(function(token) {
          historyImplRef.@com.google.gwt.user.client.impl.HistoryImpl::newItemOnEvent(Ljava/lang/String;)(token);
-       };
+       });
      }-*/;
 
     protected native void navigateFrame(String token)
index e033e5adfe4d3c5351e21c9648e0ca7c3aaff4a3..b9baf362e473d97b1a842f681a10e668a18ac644 100644 (file)
@@ -282,9 +282,9 @@ public class Util {
      */
     public native static void addPngFix(Element el)
     /*-{
-        el.attachEvent("onload", function() {
+        el.attachEvent("onload", $entry(function() {
             @com.vaadin.terminal.gwt.client.Util::doIE6PngFix(Lcom/google/gwt/user/client/Element;)(el);
-        },false);
+        }),false);
     }-*/;
 
     private native static void doPngFix(Element el, String blankImageUrl)
index eabb21eb4ff0436a11436e9dca52586182db648e..455a9bf60114341e2fd728460153d76d8a2aa564 100644 (file)
@@ -8,9 +8,9 @@ public class UploadIFrameOnloadStrategy {
     native void hookEvents(com.google.gwt.dom.client.Element iframe,
             VUpload upload)
     /*-{
-        iframe.onload = function() {
+        iframe.onload = $entry(function() {
             upload.@com.vaadin.terminal.gwt.client.ui.VUpload::onSubmitComplete()();
-        };
+        });
     }-*/;
 
     /**
index f4b41b0646dea723470609470fdf424e0e7757d0..b23d82fa2212933eec1c1a705fe7781afc4c40b2 100644 (file)
@@ -13,11 +13,11 @@ public class UploadIFrameOnloadStrategyIE extends UploadIFrameOnloadStrategy {
     @Override
     native void hookEvents(Element iframe, VUpload upload)
     /*-{
-      iframe.onreadystatechange = function() {
+      iframe.onreadystatechange = $entry(function() {
         if (iframe.readyState == 'complete') {
           upload.@com.vaadin.terminal.gwt.client.ui.VUpload::onSubmitComplete()();
         }
-      };
+      });
     }-*/;
 
     @Override
index 2a40cd0fe324365d0f7a1c492cf8ae3cda41ba8a..f4aacf3ea23620ec5438ff456d040d706c26e3f1 100644 (file)
@@ -479,9 +479,9 @@ public class VCustomLayout extends ComplexPanel implements Paintable,
     private native void publishResizedFunction(Element element)
     /*-{
        var self = this;
-       element.notifyChildrenOfSizeChange = function() {
+       element.notifyChildrenOfSizeChange = $entry(function() {
                self.@com.vaadin.terminal.gwt.client.ui.VCustomLayout::notifyChildrenOfSizeChange()();
-       };
+       });
     }-*/;
 
     /**
index 072754e0ce121a138349e34c2bd528967715d6a5..ff649ebeb187222c621567b9eca149350c112312 100644 (file)
@@ -560,9 +560,9 @@ public class VDragAndDropWrapper extends VCustomComponent implements
     protected native void hookHtml5DragStart(Element el)
     /*-{
         var me = this;
-        el.addEventListener("dragstart",  function(ev) {
+        el.addEventListener("dragstart",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragStart(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        }, false);
+        }), false);
     }-*/;
 
     /**
@@ -574,21 +574,21 @@ public class VDragAndDropWrapper extends VCustomComponent implements
     /*-{
             var me = this;
 
-            el.addEventListener("dragenter",  function(ev) {
+            el.addEventListener("dragenter",  $entry(function(ev) {
                 return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragEnter(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-            }, false);
+            }), false);
 
-            el.addEventListener("dragleave",  function(ev) {
+            el.addEventListener("dragleave",  $entry(function(ev) {
                 return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragLeave(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-            }, false);
+            }), false);
 
-            el.addEventListener("dragover",  function(ev) {
+            el.addEventListener("dragover",  $entry(function(ev) {
                 return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragOver(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-            }, false);
+            }), false);
 
-            el.addEventListener("drop",  function(ev) {
+            el.addEventListener("drop",  $entry(function(ev) {
                 return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragDrop(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-            }, false);
+            }), false);
     }-*/;
 
     public boolean updateDropDetails(VDragEvent drag) {
index ce4a19462f610beb85a325f6080d6ef93cbe5e05..30483545e992247097567f7d49704fdf03b876f7 100644 (file)
@@ -39,9 +39,9 @@ public class VDragAndDropWrapperIE extends VDragAndDropWrapper {
     /*-{
         var me = this;
 
-        el.attachEvent("ondragstart",  function(ev) {
+        el.attachEvent("ondragstart",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragStart(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        });
+        }));
     }-*/;
 
     @Override
@@ -49,21 +49,21 @@ public class VDragAndDropWrapperIE extends VDragAndDropWrapper {
     /*-{
         var me = this;
 
-        el.attachEvent("ondragenter",  function(ev) {
+        el.attachEvent("ondragenter",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragEnter(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        });
+        }));
 
-        el.attachEvent("ondragleave",  function(ev) {
+        el.attachEvent("ondragleave",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragLeave(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        });
+        }));
 
-        el.attachEvent("ondragover",  function(ev) {
+        el.attachEvent("ondragover",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragOver(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        });
+        }));
 
-        el.attachEvent("ondrop",  function(ev) {
+        el.attachEvent("ondrop",  $entry(function(ev) {
             return me.@com.vaadin.terminal.gwt.client.ui.VDragAndDropWrapper::html5DragDrop(Lcom/vaadin/terminal/gwt/client/ui/dd/VHtml5DragEvent;)(ev);
-        });
+        }));
     }-*/;
 
 }
index 44ee7c11df19f234c853f17db3621b9361875d47..d1e4f7ca5b478d4c030ec5b5afe38ec4aceebcce 100644 (file)
@@ -357,9 +357,9 @@ public class VTextField extends TextBoxBase implements Paintable, Field,
     protected native void attachCutEventListener(Element el)
     /*-{
         var me = this;
-        el.oncut = function() {
+        el.oncut = $entry(function() {
             me.@com.vaadin.terminal.gwt.client.ui.VTextField::onCut()();
-        };
+        });
     }-*/;
 
     protected native void detachCutEventListener(Element el)
index 92b93ac96b8c1906b96e7d9bb93572a9bb01d9bb..8599ffb279f48700d53eca4ef065ca71acff5f7d 100644 (file)
@@ -52,9 +52,9 @@ public class VVideo extends VMediaBase {
     private native void updateDimensionsWhenMetadataLoaded(Element el)
     /*-{
               var self = this;
-              el.addEventListener('loadedmetadata', function(e) {
-                  $entry(self.@com.vaadin.terminal.gwt.client.ui.VVideo::updateElementDynamicSize(II)(el.videoWidth, el.videoHeight));
-              }, false);
+              el.addEventListener('loadedmetadata', $entry(function(e) {
+                  self.@com.vaadin.terminal.gwt.client.ui.VVideo::updateElementDynamicSize(II)(el.videoWidth, el.videoHeight);
+              }), false);
 
     }-*/;