<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -84,6 +84,8 @@ class VerticalDemoSlider2(VerticalDemoSlider):
         self.sinkEvents(Event.MOUSEEVENTS)
         self.dragging = False
 
+        DOM.addEventPreview(self)
+
     def addMouseListener(self, listener):
         self.mouseListeners.append(listener)
 
@@ -97,6 +99,19 @@ class VerticalDemoSlider2(VerticalDemoSlider):
         else:
             VerticalSliderDemo.onBrowserEvent(self, event)
 
+    def onEventPreview(self, event):
+        # preventDefault on mousedown events, outside of the
+        # dialog, to stop text-selection on dragging
+        type = DOM.eventGetType(event)
+        print &quot;onEventPreview&quot;, event, type
+        if type == 'mousedown':
+            target = DOM.eventGetTarget(event)
+            event_targets_control = target and DOM.isOrHasChild(self.getElement(), target)
+            print &quot;onEventPreview&quot;, target, event_targets_control
+            if event_targets_control:
+                DOM.eventPreventDefault(event)
+        return VerticalSliderDemo.onEventPreview(self, event)
+
     def onMouseMove(self, sender, x, y):
         if not self.dragging:
             return</diff>
      <filename>pyjamas-webkit/pyjamas/Controls.py</filename>
    </modified>
    <modified>
      <diff>@@ -545,32 +545,61 @@ def insertChild(parent, toAdd, index):
     else:
         parent.insert_before(toAdd, before)
 
+class IterChildrenClass:
+    def __init__(self, elem):
+        self.parent = elem
+        self.child = elem.props.first_child
+        self.lastChild = None
+    def next (self):
+        if not self.child:
+            raise StopIteration
+        self.lastChild = self.child;
+        self.child = getNextSibling(self.child)
+        return self.lastChild
+    def remove(self):
+        self.parent.removeChild(self.lastChild);
+    def __iter__(self):
+        return self
+
 def iterChildren(elem):
     &quot;&quot;&quot;
     Returns an iterator over all the children of the given
     DOM node.
     &quot;&quot;&quot;
-    JS(&quot;&quot;&quot;
-    var parent = elem;
-    var child = elem.props.first_child;
-    var lastChild = null;
-    return {
-        'next': function() {
-            if (child == null) {
-                throw StopIteration;
-            }
-            lastChild = child;
-            child = DOM_getNextSibling(child);
-            return lastChild;
-        },
-        'remove': function() {        
-            parent.removeChild(lastChild);
-        },
-        __iter__: function() {
-            return this;
-        }
-    };
-    &quot;&quot;&quot;)
+    return IterChildrenClass(elem)
+
+class IterWalkChildren:
+
+    def __init__(self, elem):
+        self.parent = elem
+        self.child = getFirstChild(elem)
+        self.lastChild = None
+        self.stack = []
+
+    def next(self):
+        if not self.child:
+            raise StopIteration
+        self.lastChild = self.child
+        first_child = getFirstChild(self.child)
+        next_sibling = getNextSibling(self.child)
+        if first_child is not None:
+            if next_sibling is not None:
+               self.stack.append((next_sibling, self.parent))
+            self.parent = self.child
+            self.child = first_child
+        elif next_sibling is not None:
+            self.child = next_sibling
+        elif len(self.stack) &gt; 0:
+            (self.child, self.parent) = self.stack.pop()
+        else:
+            self.child = None
+        return self.lastChild
+
+    def remove(self):
+        self.parent.removeChild(self.lastChild)
+
+    def __iter__(self):
+        return self
 
 def walkChildren(elem):
     &quot;&quot;&quot;
@@ -578,46 +607,8 @@ def walkChildren(elem):
     iterator/iterable which performs a pre-order traversal
     of all the children of the given element.
     &quot;&quot;&quot;
-    JS(&quot;&quot;&quot;
-    var parent = elem;
-    var child = DOM_getFirstChild(elem);
-    var lastChild = null;
-    var stack = [];
-    var parentStack = [];
-    return {
-        'next': function() {
-            if (child == null) {
-                throw StopIteration;
-            }
-            lastChild = child;
-            var props.first_child = DOM_getFirstChild(child);
-            var props.next_sibling = DOM_getNextSibling(child);
-            if(props.first_child != null) {
-               if(props.next_sibling != null) {
-                   stack.push(props.next_sibling);
-                   parentStack.push(parent);
-                }
-                parent = child;
-                child = props.first_child;
-            } else if(props.next_sibling != null) {
-                child = props.next_sibling;
-            } else if(stack.length &gt; 0) {
-                child = stack.pop();
-                parent = parentStack.pop();
-            } else {
-                child = null;
-            }
-            return lastChild;
-        },
-        'remove': function() {        
-            parent.removeChild(lastChild);
-        },
-        __iter__: function() {
-            return this;
-        }
-    };
-    &quot;&quot;&quot;)
-   
+    return IterWalkChildren(elem)
+
 def isOrHasChild(parent, child):
     while child:
         if parent == child:</diff>
      <filename>pyjamas-webkit/pyjamas/DOM.py</filename>
    </modified>
    <modified>
      <diff>@@ -42,7 +42,8 @@ class HTTPRequest:
         xmlHttp = self.doCreateXmlHTTPRequest()
         if url[0] != '/':
             uri = get_main_frame().get_uri()
-            if uri[:7] != 'file://':
+            if uri[:7] != 'file://' and uri[:7] != 'http://' and \
+               uri[:8] != 'https://':
                 slash = uri.rfind('/')
                 url = uri[:slash+1] + url
         print &quot;xmlHttp&quot;, user, pwd, url, postData, handler, dir(xmlHttp)</diff>
      <filename>pyjamas-webkit/pyjamas/HTTPRequest.py</filename>
    </modified>
    <modified>
      <diff>@@ -1274,90 +1274,6 @@ class FlexTable(HTMLTable):
         to format the cells in the table. The FlexCellFormatter
         has methods to set the row or column spans for a cell,
         as well as change the cell alignment, as shown below.
-
-        Note that if you use row or column spanning, the cells on
-        the rest of that row or column will be moved over. This
-        can cause some surprising results. Imagine that you have
-        a table like this:
-
-                +---+---+---+
-                | A | B | C |
-                +---+---+---+
-                | D | E | F |
-                +---+---+---+
-
-        If you set up Cell 0,0 to span two columns, like this:
-
-                flexTable.getFlexCellFormatter().setColSpan(0, 0, 2)
-
-        This will cause the table to end up looking like this:
-
-                +-------+---+---+
-                |   A   | B | C |
-                +---+---+---+---+
-                | D | E | F |
-                +---+---+---+
-
-        you might expect cell B to be above cell E, but to make this
-        happen you need to place cell E at (1, 2) rather than (1, 1).
-
-        Each FlexTable also has a RowFormatter which can be used
-        to change style names, attributes, and the visibility of
-        rows in the table.
-
-        Source Code Example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, FlexTable, HasAlignment, Button
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class FlexTableDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self._table = FlexTable()
-        &gt;&gt;&gt;         self._table.setBorderWidth(1)
-        &gt;&gt;&gt;         self._table.setWidth(&quot;100%&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         cellFormatter = self._table.getFlexCellFormatter()
-        &gt;&gt;&gt;         rowFormatter = self._table.getRowFormatter()
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self._table.setHTML(0, 0, &quot;&lt;b&gt;Mammals&lt;/b&gt;&quot;)
-        &gt;&gt;&gt;         self._table.setText(1, 0, &quot;Cow&quot;)
-        &gt;&gt;&gt;         self._table.setText(1, 1, &quot;Rat&quot;)
-        &gt;&gt;&gt;         self._table.setText(1, 2, &quot;Dog&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         cellFormatter.setColSpan(0, 0, 3)
-        &gt;&gt;&gt;         cellFormatter.setHorizontalAlignment(0, 0, HasAlignment.ALIGN_CENTER)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self._table.setWidget(2, 0, Button(&quot;Hide&quot;, getattr(self, &quot;hideRows&quot;)))
-        &gt;&gt;&gt;         self._table.setText(2, 1, &quot;1,1&quot;)
-        &gt;&gt;&gt;         self._table.setText(2, 2, &quot;2,1&quot;)
-        &gt;&gt;&gt;         self._table.setText(3, 0, &quot;1,2&quot;)
-        &gt;&gt;&gt;         self._table.setText(3, 1, &quot;2,2&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         cellFormatter.setRowSpan(2, 0, 2)
-        &gt;&gt;&gt;         cellFormatter.setVerticalAlignment(2, 0, HasAlignment.ALIGN_MIDDLE)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self._table.setWidget(4, 0, Button(&quot;Show&quot;, getattr(self, &quot;showRows&quot;)))
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         cellFormatter.setColSpan(4, 0, 3)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         rowFormatter.setVisible(4, False)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.add(self._table)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def hideRows(self):
-        &gt;&gt;&gt;         rowFormatter = self._table.getRowFormatter()
-        &gt;&gt;&gt;         rowFormatter.setVisible(2, False)
-        &gt;&gt;&gt;         rowFormatter.setVisible(3, False)
-        &gt;&gt;&gt;         rowFormatter.setVisible(4, True)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def showRows(self):
-        &gt;&gt;&gt;         rowFormatter = self._table.getRowFormatter()
-        &gt;&gt;&gt;         rowFormatter.setVisible(2, True)
-        &gt;&gt;&gt;         rowFormatter.setVisible(3, True)
-        &gt;&gt;&gt;         rowFormatter.setVisible(4, False)
     &quot;&quot;&quot;
     def __init__(self):
         HTMLTable.__init__(self)
@@ -1449,36 +1365,6 @@ class AbsolutePanel(ComplexPanel):
         Once a widget has been added to an absolute panel, the panel
         effectively &quot;owns&quot; the positioning of the widget. Any existing
         positioning attributes on the widget may be modified by the panel. 
-
-        Source Code Example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, AbsolutePanel, VerticalPanel, HTML
-        &gt;&gt;&gt; import DOM
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class AbsolutePanelDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel = AbsolutePanel()
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel.add(self.makeBox(&quot;Child 1&quot;), 20, 10)
-        &gt;&gt;&gt;         panel.add(self.makeBox(&quot;Child 2&quot;), 30, 30)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel.setWidth(&quot;100%&quot;)
-        &gt;&gt;&gt;         panel.setHeight(&quot;100px&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.add(panel)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def makeBox(self, label):
-        &gt;&gt;&gt;         wrapper = VerticalPanel()
-        &gt;&gt;&gt;         wrapper.setBorderWidth(1)
-        &gt;&gt;&gt;         wrapper.add(HTML(label))
-        &gt;&gt;&gt;         DOM.setIntAttribute(wrapper.getTable(), &quot;cellPadding&quot;, 10)
-        &gt;&gt;&gt;         DOM.setAttribute(wrapper.getTable(), &quot;bgColor&quot;, &quot;#C3D9FF&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         return wrapper
     &quot;&quot;&quot;
 
     def __init__(self):
@@ -1860,37 +1746,6 @@ class DockPanel(CellPanel):
         vertical alignment to use for new widgets by calling
         setHorizontalAlignment() and setVerticalAlignment() before
         the widget is added.
-
-        Source Code Example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, DockPanel, Label, HasAlignment
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class DockPanelDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel = DockPanel()
-        &gt;&gt;&gt;         panel.setBorderWidth(1)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         north  = Label(&quot;North&quot;)
-        &gt;&gt;&gt;         west   = Label(&quot;West&quot;)
-        &gt;&gt;&gt;         center = Label(&quot;Center&quot;)
-        &gt;&gt;&gt;         east   = Label(&quot;East&quot;)
-        &gt;&gt;&gt;         south  = Label(&quot;South&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel.setHorizontalAlignment(HasAlignment.ALIGN_CENTER)
-        &gt;&gt;&gt;         panel.setVerticalAlignment(HasAlignment.ALIGN_MIDDLE)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel.add(north,  DockPanel.NORTH)
-        &gt;&gt;&gt;         panel.add(west,   DockPanel.WEST)
-        &gt;&gt;&gt;         panel.add(center, DockPanel.CENTER)
-        &gt;&gt;&gt;         panel.add(east,   DockPanel.EAST)
-        &gt;&gt;&gt;         panel.add(south,  DockPanel.SOUTH)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         panel.setCellHeight(center, &quot;200px&quot;)
-        &gt;&gt;&gt;         panel.setCellWidth(center, &quot;400px&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.add(panel)
     &quot;&quot;&quot;
     
     CENTER = &quot;center&quot;
@@ -2300,29 +2155,6 @@ class FlowPanel(ComplexPanel):
         with the other elements. Because of this, you may want to
         avoid using FlowPanel unless you are certain that the items
         you are adding will flow correctly.
-
-        Source Code Example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, FlowPanel, Button
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class FlowPanelDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         flow = FlowPanel()
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 1&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 2&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 3&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 4&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 5&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 6&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 7&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 8&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 9&quot;))
-        &gt;&gt;&gt;         flow.add(Button(&quot;Item 10&quot;))
-        &gt;&gt;&gt;         flow.setWidth(&quot;400px&quot;)
-        &gt;&gt;&gt;         self.add(flow)
     &quot;&quot;&quot;
     def __init__(self):
         ComplexPanel.__init__(self)
@@ -3112,57 +2944,7 @@ class DialogBox(PopupPanel):
         the dialog box around by clicking on the caption.
 
         The DialogBox class makes use of stylesheet definitions; if these
-        are not supplied, the dialog box will look very strange. The
-        following stylesheet definitions are used by the example shown below:
-
-        .gwt-DialogBox {
-            border: 2px outset;
-            background-color: white;
-        }
-
-        .gwt-DialogBox .Caption {
-            background-color: #C3D9FF;
-            padding: 3px;
-            margin: 2px;
-            font-weight: bold;
-            cursor: default;
-        }
-
-        .gwt-DialogBox .Contents {
-            padding: 10px;
-        }
-
-        Source Code example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, DialogBox, VerticalPanel, HTML, Button
-        &gt;&gt;&gt; import Window
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class DialogBoxDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.add(Button(&quot;Show Dialog&quot;, getattr(self, &quot;showDialog&quot;)))
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def showDialog(self):
-        &gt;&gt;&gt;         contents = VerticalPanel()
-        &gt;&gt;&gt;         contents.setSpacing(4)
-        &gt;&gt;&gt;         contents.add(HTML('You can place any contents you like in a dialog box.'))
-        &gt;&gt;&gt;         contents.add(Button(&quot;Close&quot;, getattr(self, &quot;onClose&quot;)))
-        &gt;&gt;&gt;         contents.setStyleName(&quot;Contents&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self._dialog = DialogBox()
-        &gt;&gt;&gt;         self._dialog.setHTML('&lt;b&gt;Welcome to the dialog box&lt;/b&gt;')
-        &gt;&gt;&gt;         self._dialog.setWidget(contents)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         left = (Window.getClientWidth() - 200) / 2
-        &gt;&gt;&gt;         top = (Window.getClientHeight() - 100) / 2
-        &gt;&gt;&gt;         self._dialog.setPopupPosition(left, top)
-        &gt;&gt;&gt;         self._dialog.show()
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def onClose(self):
-        &gt;&gt;&gt;         self._dialog.hide()
+        are not supplied, the dialog box will look very strange. 
     &quot;&quot;&quot;
     def __init__(self, autoHide=None):
         PopupPanel.__init__(self, autoHide)
@@ -4743,20 +4525,14 @@ FormPanel_formId = 0
 
 class FormPanel(SimplePanel):
     &quot;&quot;&quot;
-        A panel that wraps its contents in an HTML &lt;FORM&gt; element.
+        A panel that wraps its contents in an HTML &quot;FORM&quot; element.
 
         This panel can be used to achieve interoperability with servers
         that accept traditional HTML form encoding. The following widgets
         will be submitted to the server if they are contained within this panel:
 
-        * L{TextBox}
-        * L{PasswordTextBox}
-        * L{RadioButton}
-        * L{CheckBox}
-        * L{TextArea}
-        * L{ListBox}
-        * L{FileUpload}
-        * L{Hidden}
+        L{TextBox}, L{PasswordTextBox}, L{RadioButton}, L{CheckBox},
+        L{TextArea}, L{ListBox}, L{FileUpload} and L{Hidden}
 
         In particular, FileUpload is only useful when used within a
         L{FormPanel}, because the browser will only upload files using
@@ -4783,41 +4559,6 @@ class FormPanel(SimplePanel):
 
         This will ensure that the form is submitted in a way that
         allows files to be uploaded.
-
-        Source Code Example:
-
-        &gt;&gt;&gt; from ui import SimplePanel, FormPanel, VerticalPanel, HorizontalPanel, TextBox, Label, Button
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; class FormPanelDemo(SimplePanel):
-        &gt;&gt;&gt;     def __init__(self):
-        &gt;&gt;&gt;         SimplePanel.__init__(self)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.form = FormPanel()
-        &gt;&gt;&gt;         self.form.setAction(&quot;http://google.com/search&quot;)
-        &gt;&gt;&gt;         self.form.setTarget(&quot;results&quot;)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         vPanel = VerticalPanel()
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         hPanel = HorizontalPanel()
-        &gt;&gt;&gt;         hPanel.add(Label(&quot;Search for:&quot;))
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.field = TextBox()
-        &gt;&gt;&gt;         self.field.setName(&quot;q&quot;)
-        &gt;&gt;&gt;         hPanel.add(self.field)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         hPanel.add(Button(&quot;Submit&quot;, getattr(self, &quot;onBtnClick&quot;)))
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         vPanel.add(hPanel)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         results = NamedFrame(&quot;results&quot;)
-        &gt;&gt;&gt;         vPanel.add(results)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;         self.form.add(vPanel)
-        &gt;&gt;&gt;         self.add(self.form)
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt; 
-        &gt;&gt;&gt;     def onBtnClick(self):
-        &gt;&gt;&gt;         self.form.submit()
     &quot;&quot;&quot;
     ENCODING_MULTIPART = &quot;multipart/form-data&quot;
     ENCODING_URLENCODED = &quot;application/x-www-form-urlencoded&quot;</diff>
      <filename>pyjamas-webkit/pyjamas/ui.py</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>089c5b5056972d02c3570faf7f9cdc68318d7440</id>
    </parent>
  </parents>
  <author>
    <name>Luke Kenneth Casson Leighton</name>
    <email>lkcl@lkcl.net</email>
  </author>
  <url>http://github.com/lkcl/pyjamas-desktop/commit/8ed365b89efe5d1d3451c3e3ced662a2dd014540</url>
  <id>8ed365b89efe5d1d3451c3e3ced662a2dd014540</id>
  <committed-date>2009-03-04T02:17:34-08:00</committed-date>
  <authored-date>2009-03-04T02:17:34-08:00</authored-date>
  <message>whoops quite a lot of bits and pieces of experimenting - sorreeeee.  added iterChildren and walkChildren functions</message>
  <tree>8982b5e25d21db40266437615e2e19c8f4550306</tree>
  <committer>
    <name>Luke Kenneth Casson Leighton</name>
    <email>lkcl@lkcl.net</email>
  </committer>
</commit>
