[Zope] customize zope manage_main
richard lanham
rlanham@speakeasy.net
Sat, 9 Dec 2000 12:07:30 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0206_01C061D8.9AAC7EC0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have looked at many of files in lib/python/app and a other folders in =
the zope installation. I am looking for a way to change the interface a =
little. I see some recognizable stuff there, but can't figure out how =
most of the pages are created, how I could change them. I want to add a =
frame to the edit page so I can submit while editing without refreshing =
the page. I would have to put a frame and javascript function I wrote, =
and include below because it is very useful.
This makes editing long docs in a textarea tolerable. I use it on a site =
with a lower frame where the user can see their changes and not lose =
their place as they edit/save.
thanks,
Richard
function bgSubmit(frm)
{
frmHide =3D parent.frames["hidden"].document
var nd=3D"<form name=3D'" + frm.name + "' action=3D'" + frm.action + "' =
method=3D'" + frm.method + "'>"
for (i=3D0;i<document.forms[frm.name].elements.length;++i)
{
elem=3Ddocument.forms[frm.name].elements[i]
if (elem.type=3D=3D"select-one" || elem.type=3D=3D"select-multiple")
{
nd+=3D"<select name=3D'" + elem.name + "'"
if (elem.type=3D=3D"select-multiple") {nd+=3D" multiple "}
nd+=3D">"
for (x=3D0;x<elem.options.length;++x)=20
{
nd+=3D"<option "
if (elem.options[x].selected) {nd+=3D"selected "}
nd+=3D"value=3D'" + elem.options[x].value + "'>" + =
elem.options[x].text + "</option>"
}
nd+=3D"</select>"
}else if (elem.type=3D=3D"textarea"){
nd +=3D"<textarea name=3D'" + elem.name + "'>" + elem.value + =
"</textarea>"
} else {
nd +=3D"<input type=3D'" + elem.type + "' name=3D'" + elem.name + "' =
value=3D'" + elem.value + "'"
if (elem.checked) {nd+=3D" checked "}
nd+=3D">"
}
}
nd+=3D"</form>"
frmHide.open("text/html");
frmHide.write( nd );
frmHide.close();
parent.frames["hidden"].document.forms[0].submit()
}
//this function assume you have a frame named "hidden" and takes a form =
object as arg, e.g., bgSubmit (window.document.frmToSave)
------=_NextPart_000_0206_01C061D8.9AAC7EC0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I have looked at many of files in =
lib/python/app=20
and a other folders in the zope installation. I am looking for a way to =
change=20
the interface a little. I see some recognizable stuff there, but can't =
figure=20
out how most of the pages are created, how I could change them. I want =
to add a=20
frame to the edit page so I can submit while editing without refreshing =
the=20
page. I would have to put a frame and javascript function I =
wrote, and=20
include below because it is very useful.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>This makes editing long docs in a =
textarea=20
tolerable. I use it on a site with a lower frame where the =
user can=20
see their changes and not lose their place as they =
edit/save.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Richard</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>function bgSubmit(frm)<BR>{<BR>frmHide =
=3D=20
parent.frames["hidden"].document<BR>var nd=3D"<form name=3D'" + =
frm.name + "'=20
action=3D'" + frm.action + "' method=3D'" + frm.method + "'>"<BR>for=20
(i=3D0;i<document.forms[frm.name].elements.length;++i)<BR> {<BR>&=
nbsp;elem=3Ddocument.forms[frm.name].elements[i]<BR> if=20
(elem.type=3D=3D"select-one" ||=20
elem.type=3D=3D"select-multiple")<BR> {<BR> &=
nbsp; nd+=3D"<select=20
name=3D'" + elem.name + "'"<BR> if=20
(elem.type=3D=3D"select-multiple") {nd+=3D" multiple=20
"}<BR> nd+=3D">"<BR> for=
=20
(x=3D0;x<elem.options.length;++x)=20
<BR> {<BR> nd+=3D"<=
;option=20
"<BR> if (elem.options[x].selected) =
{nd+=3D"selected=20
"}<BR> nd+=3D"value=3D'" + =
elem.options[x].value +=20
"'>" + elem.options[x].text +=20
"</option>"<BR> }<BR>  =
; nd+=3D"</select>"<BR> }else=20
if (elem.type=3D=3D"textarea"){<BR> nd =
+=3D"<textarea=20
name=3D'" + elem.name + "'>" + elem.value +=20
"</textarea>"<BR> } else =
{<BR> nd=20
+=3D"<input type=3D'" + elem.type + "' name=3D'" + elem.name + "' =
value=3D'" +=20
elem.value + "'"<BR> if =
(elem.checked) {nd+=3D"=20
checked=20
"}<BR> nd+=3D">"<BR> }<BR>&nbs=
p;}<BR>nd+=3D"</form>"<BR>frmHide.open("text/html");<BR>frmHide.wri=
te(=20
nd=20
);<BR>frmHide.close();<BR>parent.frames["hidden"].document.forms[0].submi=
t()<BR>}</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>//this function assume you have a frame =
named=20
"hidden" and takes a form object as arg, e.g., bgSubmit=20
(window.document.frmToSave)<BR></DIV></FONT>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV></BODY></HTML>
------=_NextPart_000_0206_01C061D8.9AAC7EC0--