[Zope] Optimized HTML for the manage UI

Robb Shecter shecter@darmstadt.gmd.de
Thu, 17 Feb 2000 12:33:45 +0100


Hi,

I made changes in some of the Zope code that generates the UI because
I often have to connect from slower computers over slow connections.
I found that replacing TABLE tags with BR and nbsp elements lets the
browser lay out pages much faster.  Also, hardcoding image sizes makes
a big difference.

I made a bunch of changes, and the apparent speedup of the /manage
interface redraws is nearly 2x, I'd say.

Here's an example.  Cut out the code below and save it as
lib/python/OFS/main.dtml.  (You may want to back up the original file
first.)  This will give the right hand side of the Zope Folder display
a decent speed boost on slower systems, without changing the
appearance.  I made these changes on Zope 2.1.3/4.  I hope including
it here inline doesn't mess it up in a big way.  If there's interest,
I could make my modified files public in some way.

- Robb


--------cut here: OFS/main.dtml------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/T
R/REC-html40/loose.dtd">
<HTML lang="en">
<HEAD>
<TITLE>Contents</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#000099" VLINK="#555555">
<dtml-var manage_tabs>
<P>

<FORM ACTION="<dtml-var URL1>" METHOD="POST">
<dtml-if objectItems>

<dtml-in objectItems sort>

  &nbsp;

  <INPUT TYPE="CHECKBOX" NAME="ids:list" VALUE="<dtml-var sequence-key
html_quote>
">

  &nbsp;&nbsp;

  <dtml-if icon>
  <A HREF="<dtml-var sequence-key url_quote>/manage_workspace">
  <IMG SRC="<dtml-var SCRIPT_NAME>/<dtml-var icon>" height="16"
width="16"
   ALT="[<dtml-var meta_type>]" BORDER="0"></A>
  </dtml-if icon>

  &nbsp;&nbsp;

  <A HREF="<dtml-var sequence-key url_quote>/manage_workspace">
  <dtml-var sequence-key fmt="html-quote"> <dtml-if title>(<dtml-var
   title fmt="html-quote">)</dtml-if>
  </A>
  <dtml-if locked_in_version>
    <dtml-if modified_in_version>
      <IMG SRC="<dtml-var SCRIPT_NAME>/p_/locked"
       ALT="This item has been modified in this version">
    <dtml-else>
      <IMG SRC="<dtml-var SCRIPT_NAME>/p_/lockedo"
       ALT="This item has been modified in another version">
       (<em><dtml-var locked_in_version></em>)
    </dtml-if>
  </dtml-if>

  <br>

</dtml-in>


  &nbsp;<br>&nbsp;&nbsp;

  <dtml-unless dontAllowCopyAndPaste>
  <INPUT TYPE="SUBMIT" NAME="manage_renameForm:method" VALUE="Rename">

  <INPUT TYPE="SUBMIT" NAME="manage_cutObjects:method" VALUE="Cut">
  <INPUT TYPE="SUBMIT" NAME="manage_copyObjects:method" VALUE="Copy">
  <dtml-if cb_dataValid>
  <INPUT TYPE="SUBMIT" NAME="manage_pasteObjects:method"
VALUE="Paste">
  </dtml-if>
  </dtml-unless>