[Twisted-Python] bug and patch: embedded LivePages
Hi, in the case when a LivePage happens to be itself the contents of an iframe, the input web conduit does not work as it attempts to execute js from "top". It should be "parent". To test, place the following script next to any LivePage example (such as the dhtmlLivePage.rpy posted some days ago by Donovan Preston): iframed_dhtmlLivePage.rpy: ================================ from twisted.web.woven import page resource = page.Page() resource.template = '''<html> <body style="margin:1em; background-color: gray;"> <iframe style="width: 80%; padding: 1em;" src="../dhtmlLivePage"> iframe contents </iframe> </body> </html> ''' ================================ The diff w.r.t. cvs version of twisted/web/woven/controller.py: ================================ --- twisted/web/woven/controller.py Tue May 27 10:58:55 2003 +++ twisted/web/woven/controller.py Sat May 24 12:26:22 2003 @@ -333,7 +333,7 @@ target.onEvent(request, eventName, *eventArgs) sess.sendScript = orig - scriptOutput.append('parent.woven_clientToServerEventComplete()') + scriptOutput.append('top.woven_clientToServerEventComplete()') #print "GATHERED JS", scriptOutput @@ -369,7 +369,7 @@ nodeXML = nodeXML.replace('\r', '') nodeXML = nodeXML.replace("\\", "\\\\") nodeXML = nodeXML.replace("'", "\\'") - js = "parent.woven_replaceElement('%s', '%s')" % (nodeId, nodeXML) + js = "top.woven_replaceElement('%s', '%s')" % (nodeId, nodeXML) #for key in widget.subviews.keys(): # view.subviews[key].unlinkViews() oldNode = page.view.subviews[nodeId] ================================ cheers, mario
On Tue, May 27, 2003 at 11:32:31AM +0200, Mario Ruggier wrote:
The diff w.r.t. cvs version of twisted/web/woven/controller.py: ================================ --- twisted/web/woven/controller.py Tue May 27 10:58:55 2003 +++ twisted/web/woven/controller.py Sat May 24 12:26:22 2003
You appear to have the diff backwards. -Andrew.
On Tue, May 27, 2003 at 11:32:31AM +0200, Mario Ruggier wrote:
The diff w.r.t. cvs version of twisted/web/woven/controller.py: ================================ --- twisted/web/woven/controller.py Tue May 27 10:58:55 2003 +++ twisted/web/woven/controller.py Sat May 24 12:26:22 2003
You appear to have the diff backwards.
Just did a file diff... sorry should have switched the 2 file arguments.
-Andrew.
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
Andrew Bennetts
-
Mario Ruggier