The Artima Developer Community
Sponsored Link

Python Buzz Forum
Plone and Dojo part I

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Carlos de la Guardia

Posts: 219
Nickname: cguardia
Registered: Jan, 2006

Carlos de la Guardia is an independent web developer in Mexico
Plone and Dojo part I Posted: May 29, 2006 5:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Carlos de la Guardia.
Original Post: Plone and Dojo part I
Feed Title: I blog therefore I am
Feed URL: http://blog.delaguardia.com.mx/feed.atom
Feed Description: A space to put my thoughts into writing.
Latest Python Buzz Posts
Latest Python Buzz Posts by Carlos de la Guardia
Latest Posts From I blog therefore I am

Advertisement

We needed some of the widgets provided by the Dojo Javascript Toolkit, so I started looking into the best way of using it inside Plone.

Turns out there is a Plone product available, ZPDojo, which takes care of a couple of Dojo incompatibilities with Zope (filenames beginning with a double underscore won't be served by Zope but Dojo uses __Package__.js files) and Plone (the skin machinery strips the .html extension off Dojo's template files, so they are not found when needed). The only problem was that ZPDojo contains release 0.2 of Dojo, and we planned to use the newer 0.3 release.

Well, since the issues outlined in the previous paragraph seemed easy to solve, I downloaded the product and combined it with the new Dojo Toolkit, in effect creating my own 0.3 version of ZPDojo. I also used this opportunity to register dojo.js with Plone's javascript registry at installation.

I installed my new product and all seemed right. I added a custom skin template with a tree widget demo and it worked ok. Then I added the needed use-macro and fill-slot declarations needed to make the template work inside Plone and suddenly the tree didn't work right any more.

The first problem was only cosmetic, since Plone's and Dojo's CSS stylesheets seem to conflict with each other. The other problem actually was a show stopper: Dojo's drag and drop functionality just ceased to work.

This is were Plone's relatively new javascript registry really proved to be very helpful. I just unchecked all javascripts from the management page and then added them all one by one again. In this way I found out that the dropdown.js javascript from plone_ecmascript hijacks the whole document's onmousedown event:

document.onmousedown = actionMenuDocumentMouseDown;

This is done so that a click anywhere on the document hides any menus that may be open. This is a good usability feature, but not one that we value over drag and drop support for our tree widget, so for the time being I just commented out the line. I would like to fix this eventually, though.

I may have to find some time to carry out some serious javascript study, but until then my quick fix will have to do.


Read: Plone and Dojo part I

Topic: Acme Corp. Do something. Previous Topic   Next Topic Topic: As the world wakes up…

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use