heitml Source Display

File: /usr/local/httpd/htdocs/heitml2.0/lib/component.hei


// Component Class
// $Id: component.hei,v 1.51 2000/12/16 17:33:17 heitml Exp $
// Copyright (C) 1996-2000 by H.E.I. Informationssysteme GmbH and suppliers.
// This file is part of heitml.  All licensing conditions of the
// heitml package apply.  See the license file contained in the heitml
// distribution.
//
<includeonce>//
<include std.hei>//
<include 
layoutlib.hei>//
<include javasc.hei>//
<include browcomp.hei>//
//
<stdinit;
   gl._compnr=1;
   gl._complevel=0;
   gl._compcontext=
"H"; gl._compcontextg="H";
   
if SrvDebug && isdecl(ff._cookie); gl._complevel=integer(default(ff._cookie.hcomplevel,0)); /if;
   gl._compimg=
"png";
   
if ((containscase (srv_server_software,"iis") || (containscase (srv_server_software,"iis")))
      && gl.bc_dynhtml==
"N");
        gl._compimg=
"jpg"
   
/if;
/stdinit


def _initcomponents;
if default(gl.bc_dynhtml)=="N"
>
<layer name="yhpreview"></layer><layer name="yhbackground"></layer>
</if;

>
<script language="JavaScript" src="/heitml2.0/control/jslpage.hei?b=<?SrvUserAgent"U">"></script>
<js>//
var yhpuri=<?SrvLocalUrl quoted>;
var yhpfile=<? substall(SrvFileName,"\\","\\\\") quoted>;
<if !isempty(se._pkey)>var yhcard=<? se._pkey "P">;
</if;

if (default(gl.bc_dynhtml)=="M" || default(gl.bc_dynhtml)=="G") && default(ff._cookie.heitmldragdrop)==1>  // Microsoft dynamic HTML

document.onmouseup  = yhmouseup;
// document.onmousedown= yhmousedown;
document.ondragstart= yhdrag;
// document.onselectstart= mousedown;
// document.onmousemove= mousemove;
</if;

if default(gl.bc_dynhtml)=="N"&&default(ff._cookie.heitmldragdrop)==1> // N e t s c a p e   4 . 0 
document.captureEvents(Event.MOUSEUP);
document.onmouseup=yh.enddrag;
</if;
/js;

stdins "bgbody";
   
if 10<gl._complevel;
      
if isdecl(gl._outline); ? default(gl._outline.outlinepos) html; /if;
      
if !isempty(gl.bc_dynhtml) && default(ff._cookie.heitmldragdrop)==1
         >
<style TYPE="text/css" id="yhstyle">
img.yhhandle  {cursor:hand; vertical-align:baseline};
#HeitmlDrag {POSITION: absolute; VISIBILITY: hidden; TOP:100px; LEFT:100px; Z-INDEX:10; cursor:move};
<hei      ></style>
<hei      ><DIV ID="HeitmlDrag">
<hei      ><font color="red" size=+2><b>[-----]</b></font>
<hei      ></DIV>
<     /if;
   
/if;
/stdins

bodyevent "onload"bodyevent "onunload";
stdins "onload";
   
if 0<gl._complevel>
    yh.pw=window; yh.loaded(window,yhpuri,yhpfile);
   </if;
/stdins
stdins "onunload";
   
if 0<gl._complevel>
     x=yh+"";
     if (x!="undefined" && x!="null" && !yh.closed) yh.pw=null;
   </if;
/stdins
/def; /* _initcomponents */

if 0<gl._complevel; _initcomponents; /if;



def _EncodePositions outercontext innercontext start end close=null;
   >
"<?outercontext>!<?innercontext>]<? start.Line>S<?start.Column>e<? end.Line>E<?end.Column;
   
if !isempty(close)>c<? close.Line>C<? close.Column></if;
   >
[<
   
if start.File != SrvFilename;
      
?substall(start.File,"\\","\\\\");
   
/if;
   >
"<
/def

// Evaluate body with Component Editor switched off.
defenv nocompedit; defautoclose;
  l=gl._complevel;
  
if (10<l); gl._complevel=10; /if;
  
defbody;
  gl._complevel=l;
/defenv;

defenv stackcompedit;
    l=gl._complevel; 
defbody; gl._complevel=l;
/defenv;

def singlecompedit;
    
if gl._complevel &gt 10; gl._complevel=10; /if;
/def;

defclass component; inherit object;
   
defenv _marker st="tlbl" end="brbl" stalign="baseline" endalign="baseline"
                  stnr=default(this._compnr) endnr=default(this._compnr) tag=class(this) inline=true;
//   defbody; return;
   
if (20<=gl._complevel)&&!isempty(stnr); 

//  N E T S C A P E   W I T H   D R A G / D R O P
    
if default(gl.bc_dynhtml)=="N" && default(ff._cookie.heitmldragdrop)==1
//       <script>yh.mark(<? st"P">,<? stalign"P">,<?compnr>,false)</script><defbody>
//       <script>yh.mark(<? end"P">,<? endalign"P">,<?compnr>,true)</script>
       >
<a href="javascript:yh.compedfc(window,<?stnr>,false);" onmouseout="yh.mouseout(window,event,<? stnr>)" <hei
                      >
onmouseup="return yh.mouseup(window,event,<? stnr>,false)" <hei
                      >
onmousedown="return yh.mousedown(window,event,<? stnr>,false)" <hei
                      >
onmouseover="return yh.yhmmoverb(<? stnr>)"><hei
       >
<\img src="/heitml2.0/pictures/control/co<? st>.<?gl._compimg>" name="yhbm<? stnr><hei
                      >
border=0 align=<?stalign>  alt=<?tag "P">><hei
       >
</a>//
<defbody>//
<hei   ><a href="javascript:yh.compedfc(window,<?endnr>,true);" onmouseout="yh.mouseout(window,event,<? endnr>)" <hei
                      >
onmouseup="return yh.mouseup(window,event,<? endnr>,true)" <hei
                      >
onmousedown="return yh.mousedown(window,event,<? endnr>,true)" <hei
                      >
onmouseover="return yh.yhmmovere(<? endnr>)"><hei
       >
<\img src="/heitml2.0/pictures/control/co<? end>.<?gl._compimg>" name="yhem<? endnr><hei
                      >
border=0 align=<?endalign> alt=<?"/"+tag "P">><hei
       >
</a>
//  I E   W I T H   D R A G / D R O P
    <elsif (default(gl.bc_dynhtml)=="M"||default(gl.bc_dynhtml)=="G") && default(ff._cookie.heitmldragdrop)==1
       >
<\img src="/heitml2.0/pictures/control/co<?st>.<?gl._compimg>" align="<?stalign>" name="yhbm<?stnr>" onmouseover="return yhmmoverb(<?stnr>)" class="yhhandle" < hei
//           > onmouseout="yhmmout(<?stnr>);" <hei
//           > ondblclick="yhimgclick();" <hei
           >
alt=<?tag "P">><if !(inline)><\br></if><defbody
       >
<\img src="/heitml2.0/pictures/control/co<?end>.<?gl._compimg>" align="<?endalign>" name="yhem<?endnr>" onmouseover="return yhmmovere(<?endnr>)" class="yhhandle" < hei
//             > onmouseout="yhmmout(<?endnr>);" <hei
//           > onclick="yhimgclick();" ondblclick="yhimgclick();" <hei
           >
alt=<? "/"+tag "P">><
           
if !(inline)><\br></if;
//  N O   D R A G / D R O P
    
else
       >
<a href="javascript:yh.compedfc(window,<?stnr>,false)" onmouseover="return yhmmoverb(<?stnr>)" onmouseout="yhmmout(<?stnr>);"><hei
       >
<\img src="/heitml2.0/pictures/control/co<?st>.<?gl._compimg>" align="<?stalign>" border=0 name="yhbm<?stnr>" alt=<?tag "P">></a><if !(inline)><\br></if><defbody
       >
<a href="javascript:yh.compedfc(window,<?endnr>,true)" onmouseover="return yhmmovere(<?endnr>)" onmouseout="yhmmout(<?endnr>);"><hei
       >
<\img src="/heitml2.0/pictures/control/co<?end>.<?gl._compimg>" align="<?endalign>" name="yhem<?endnr>" border=0 alt=<? "/"+tag "P">></a><
       
if !(inline)><\br></if
     
/if
   
else
      
defbody;
   
/if;
   
/defenv;

   
defenv _automarker; defbody; /defenv;

   
def    _seteditortype>"H"</def

   
def    _actionpos b f c> </def;

   
defenv _evalcontext; this._outercontext=gl._compcontext;
      gl._compcontext=gl._compcontextg; this._innercontext=gl._compcontext;
      
defbody; gl._compcontext=this._outercontext; /defenv;

   
defenv _privcontext context; this._outercontext=gl._compcontext;
      gl._compcontext=context; this._innercontext=gl._compcontext;
      
defbody; gl._compcontext=this._outercontext; /defenv;

   
defenv _setcontext context; this._outercontext=gl._compcontext;
      gl._compcontext=context; this._innercontext=gl._compcontext;
      y = gl._compcontextg; gl._compcontextg=context;
      
defbody; gl._compcontext=this._outercontext; gl._compcontextg=y; /defenv;

   
defenv _addcontext context priv=""; this._outercontext=gl._compcontext; y=gl._compcontextg;
      
if !Contains(gl._compcontextg,context); gl._compcontextg=gl._compcontextg+context; /if;
      gl._compcontext=gl._compcontextg;
      
if !Contains(gl._compcontextg,priv); gl._compcontext=gl._compcontextg+priv; /if;
      this._innercontext=gl._compcontext;
      
defbody; gl._compcontext=this._outercontext; gl._compcontextg=y; /defenv;

   
defenv _privaddcontext context; this._outercontext=gl._compcontext; y=gl._compcontextg;
      gl._compcontext=gl._compcontextg;
      
if !Contains(gl._compcontextg,context); gl._compcontext=gl._compcontextg+context; /if;
      this._innercontext=gl._compcontext;
      
defbody; gl._compcontext=this._outercontext; gl._compcontextg=y; /defenv;

   
defenv _CompEditWrapper ...;
      
if (gl._complevel<15); defbody; return; /if;
      startpos=_GetCallerPosition(1);
//       ? startpos.File;      ? "==";  ? default(gl._compfile,SrvFileName);
//      if right(startpos.File,'\\')!=right(default(gl._compfile,SrvFileName),'\\') &&
//       right(startpos.File,'/')!=right(default(gl._compfile,SrvFileName),'/'); 
      
if startpos.File!=SrvFileName && default(gl._compfile)!="woutline.hei";
         
_evalcontext; defbody; /_evalcontext; return; /if;

      
if !isempty(param) && !isempty(param._rest);
          np = emptytuple; TuAssign (np,param);
          TuAssign(np,param._rest); param=np; 
      
/if; 
      this._compnr=gl._compnr; gl._compnr=gl._compnr+1;
      
if !isdecl(se.comps); se.comps=array(1); /if;
      resize(se.comps,this._compnr+1);
      se.comps[this._compnr]=this; this._param=param; this._name=_GetCallerName(1);
      
if tolower(this._name)=="_object"; this._name="object"/if;
      endpos=_GetCallerPosition(1,1);
      closepos=_GetCallerPosition(1,2);
      defpos=_GetCallerPosition(1,3);
      defendpos=_GetCallerPosition(1,4);
      name2=_GetCallerName(1,2);
//      ><? _GetCallerPosition(1)> <? _GetCallerPosition(1,1)><? _GetCallerPosition(1,2)><
//      ><? _GetCallerPosition(1,3)><? _GetCallerPosition(1,4)><
      
_evalcontext
      >
<script><hei
//        >var x=new yhcoo();yhco[<?this._compnr>]=x;yhco.length=<? this._compnr+1>;x.p=new yhfldo();<
        oid = 
""; life="";
        
if !isnull(_GetLastIdId());
           oid=_GetLastIdId();
           
if _GetLastIdObject()==se;
                life=
"session";
           
else
                life=
"parent";
           
/if;
        
/if;
        >
x=yhdco(<?this._compnr>,<? substall(this._name,"\\","\\\\""P">,<_seteditortype>,<? !isnull(closepos)>,<?oid"P">,<?life"P">,<
         
_EncodePositions this._outercontext this._innercontext startpos endpos closepos>);<
        
let i=0;
//        ? param;
        
while i<len(param);
          
if !isempty(param[i]) && !istuple(param[i]);
                p =  param[i]; 
if isstring(p); p=substall(p,"\\","\\\\"); /if;
                >
x.p.x_<? tolower(fname(param[i]))>=<? p "PNe">;<
          
/if; let i=i+1;
        
/while
//      if !isnull(closepos)
//           >x.env=true;<
//      else
//           >x.env=false;<
//      /if;
//      _seteditortype
//     >x.pos=<_EncodePositions this._outercontext this._innercontext startpos endpos closepos>;//
       >
<_actionpos  defpos  defendpos name2>
<hei   ></script>< 
        
let this._startpos=startpos; this._endpos=endpos; this._closepos=closepos;
        
_automarker;
        
defbody;
        
/_automarker></_evalcontext;
   
/defenv;
/defclass;

defclass InlineComponent; inherit component;
   
defenv _automarker; _marker st="eabl" end="babl" stalign="baseline" endalign="baseline";
                      >
<defbody></_marker; /defenv;
/defclass;

defclass ActionComponent; inherit object;
   
def    _seteditortype>"H"</def
   
def    _actionpos f b c> yhdefco(x,<_EncodePositions "H" "H" f b>,<?c"P">);</def;
/defclass


defclass SimpleComponent; inherit Component;
   
def    _seteditortype>"J"</def
/defclass

defclass SimpleInlineComponent; inherit SimpleComponent;
   
defenv _automarker; _marker st="eabl" end="babl" stalign="baseline" endalign="baseline";
                      
defbody; /_marker; /defenv;
/defclass


// Is the Component Editor is active?
def iscompediting;
  
return 20 <= gl._complevel;
/def


defenv RADpageLink path=null afterload=null always=null; inherit InlineComponent; deftranspara;
  
if isempty(afterload); assign afterload; ? SrvLocalUrl >?< ?ff.s"&%Unt"></assign; /if;
  
if htmlbool(always) || SrvDebug ;
     >
<\a href="<?path>heitml.hei?<?afterload "Un">&<? ff.s"Unt">"><defbody><\/a><
  
/if
/defenv;

defenv RADpageDocumentationLink always=null; inherit InlineComponent; deftranspara;
  
if htmlbool(always) || SrvDebug;
     >
<\a href="/heitml2.0/tutor/index.hei" target="heitmldoc"><defbody><\/a><
  
/if;
/defenv


defenv conddebug  negate=null; inherit component; deftranspara;
   
_marker;
   
if (SrvDebug&&!htmlbool(negate) || !SrvDebug&&htmlbool(negate));
      
defbody;
   
/if;
   
/_marker;
/defenv;

// this definition is supposed to be overridden by a layout file,
// but in case this is missing ...
defenv body @p ...; inherit component; defwysiwyg; defhtml; defautoclose;defcontpara;
   
_body p; _innerbody; defbody; /_innerbody; /_body;
/defenv; 

defenv heitmldefs; defremovecdata; defnowysiwyg; /defenv
>
//