menu.js

Das Menüsystem ist zum Teil selbstdokumentierend und verfügt über einige interessante Aspekte:

Am besten sieht man sich es an einer Beispielanwendung CD-Liste an.

JavaScript (v1.1):

js/menu.js

v1.1 (04.12.1999)

© M.Börger

See Copyright-Info at / Beachten Sie Copyright-Info in Seite:
http://www.marcus-boerger.de/js/DynamicJavaScript.html

Version History:

v1.0    25.01.1999  First Version

v1.0.1  30.01.1999  Changed Cookie Layot.
                    Length of cookies checked.
                    Read cookie by name compared based on maximum length for test first then by order.

v1.0.2  01.02.1999  MenuXxx_Key functions use new sCookieKey, cookieGet (may be used for databases and shorter Cookies).
                    Changed cookie layout (shorter: does not use cookiedevidesign between length and name).
                    Corrected expiration of cookie

v1.0.3  02.02.1999  Multiple cookies for oversized menues.
                    Extracted debugger.
                    New sEvalLate property for entry.
                    Fixed error writing undefined in ALINK Attribut of BODY Tag.

v1.0.4  13.10.1999  Set path and version of cookie.

v1.1    04.12.1999  Fix Problems with non whysiwyg browsers (all but netscape)

v1.1.1  19.03.2000  Mozilla works better with "whysiwig://". Without changing the menu results in displaying the frame-page.

v1.2    21.03.2000  Changed to XML. If Old Style is needed change doc.bXML property of menu to false.
                    Menu now uses tables. If Old Style is needed change bTable property of each entry to false.
                         This is used if text bloack should be displayed near an icon.
                         Other related new properties:
                         bTableImgColumn: A extra column for the image. (default=true)
                                          If set to true the text aligns to the right side of the image.
                                          If set to false the image is rendered with the text.
                    Fixup error: Writing StatusLine.

v1.2.1  25.03.2000  Fixup error: JavaScript: Nested Command in Line 2. Changed "/""*" to "/""/"

v1.2.2  28.03.2000  Fixup error: +If an entry had a target set then image-click did not work correctly
                                 +If changing sImageRoot the images are pre-loaded from wrong location

v1.2.3  03.04.2000  If iCookiesEnabled is set to false in initialisation it is temporarliy set to 2.

v1.2.4  01.05.2000  Changed Cookie from delimReplace/Restore to escape/unescape functions

v1.2.5  13.02.2002  Added sImgBaseUrl to support different base-directories
                    Corrected Status/DefaultStatus behaviour
                    When Status/DefaultStatus will receive html entities some of those are converted.
                    Now support for NS4, NS6, IE
                    XHTML corrections

todo:               Use sort for cookieinfo to write sorted cookie (fasten read), is sorting of indexes possible?
                    Cookie endsign

VARIABLES

menuMain
Normally there is only one menu and this variable stores the menuinformation. If not you have to keep track of it in your own variable. Therefore you then have to declare your own variable and set the relation to it with the sEval parameter of the MenuInit functioncall. This is done automatically for the default relation "parent" and for the varname "menuMain". Example:
Nested frames and the script is loaded on level 2 whereas the actual menu is on level 4.

Normalerweise ist nur ein Menü vorhanden. Wenn dies nicht der Fall ist, so muß eine eigene menu Variable erstellt werden und im Aufruf von MenuInit muß dann die Relation übergeben werden. Der Standard hierfür ist "parent" für die Relation und "menuMain" für den Variablennamen. Beispiel:
Verschachtelte Frames, wobei das Script auf Ebene 2 geladen wird und das aktuelle Menü auf Ebene 4.

var menu4;

MenuInit( <framerelation>,
          "Name",
          <cookies>,
          "this.sRelationUp = 'parent.parent'; this.sVarName = 'menu4'",
          <entries>);

CONSTANTS

var iMT_TOP = 0; // Level 1
var iMT_MEN = 1; // Level 2
var iMT_REG = 2; // Level 3
var iMT_SUB = 3; // Level 4
'); this.htmlWriteln( ''); } this.htmlWriteln( ''); if (this.doc.bXML) { this.htmlWriteln( ''); } else { this.htmlWriteln( ''); } // this.htmlWrite( ''); } function headerNoAction() { } function header( doc) { // methods this.extendHeader = headerNoAction; // method writes between last ... and this.write = headerWrite; // method writes between Menu and this.htmlWrite = headerHtmlWrite; this.htmlWriteln = headerHtmlWriteln; // properties this.doc = doc; this.sRobots = null; // Robot META-Information this.sKeywords = null; // Keyword META-Information return this; } /****************************************************************************/ // OBJECT: header function docHtmlWrite( sText) { this.window.document.write( sText); } function docHtmlWriteln( sText) { this.window.document.writeln( sText); } function docClear() { this.window.document.clear(); this.window.document.open( 'text/html'); } function docHtmlHeader() { this.header = new header( this); this.header.write(); } function docHtmlBody() { // Empty Page } function docHtmlFooter() { this.htmlWriteln( ''); this.htmlWriteln( ''); this.window.document.close(); } function docRedraw() { this.clear(); this.htmlHeader(); this.htmlBody(); this.htmlFooter(); } function doc( window, sTitle, user) { // methods this.htmlWrite = docHtmlWrite; this.htmlWriteln = docHtmlWriteln; this.clear = docClear; this.htmlHeader = docHtmlHeader; this.htmlBody = docHtmlBody; // overwrite to create non emptypages this.htmlFooter = docHtmlFooter; this.redraw = docRedraw; // properties this.window = window; this.bXML = true; this.sTitle = sTitle; this.user = user; this.iBaseFontSize = 4; this.sBaseFontFace = null; this.sBgcolor = "#FFFFFF"; this.sText = "#000000"; this.sLink = "#0000FF"; this.sVlink = "#FF0000"; this.sAlink = "#FF0000"; this.sBodyEx = ''; // Extension to return this; } /****************************************************************************/ // OBJECT: entryinfo function entryinfoGet() { var sCookieKey = this.sName; var sCookieLen = '' + sCookieKey.length; if ( sCookieLen.length < 2) sCookieLen = '0' + sCookieLen; return ((entryinfoNext.bMarked) ? '1' : '0') + (entryinfoNext.iOpenSub+0) + sCookieLen + sCookieKey; } function entryinfo( sName, bMarked, iOpenSub) { // methods this.get = entryinfoGet; // properties this.sName = sName; this.bMarked = bMarked; this.iOpenSub = iOpenSub; this.next = null; this.sNetx = null; return this; } /****************************************************************************/ // OBJECT: cookieinfo // array-index is sName of entryinfo (fast search on array-indexes) // simple concatenated list starts sFirst // last entryinfo.sName stored in sLast for indexing last entryinfo // while generating new entryinfo (this[this.sLast].sNext) function cookieinfoGet() { var sCookie = ''; var sNext; sNext = this.sFirst; while ( sNext != null) { entryinfoNext = this[sNext]; sNext = entryinfoNext.sNext; do { sCookie += entryinfoNext.get(); entryinfoNext = entryinfoNext.next; } while ( entryinfoNext != null); } return sCookie; } function cookieinfoAdd( sName, bMarked, iOpenSub) { var entryinfoNext; if ( this[sName] == null) { this.length++; this[sName] = new entryinfo( sName, bMarked, iOpenSub); if ( this.sFirst == null) this.sFirst = sName; if ( this.sLast != null) this[this.sLast].sNext = sName; this.sLast = sName; } else { entryinfoNext = this[sName]; while ( entryinfoNext.next != null) { entryinfoNext = entryinfoNext.next; } entryinfoNext.next = new entryinfo( sName, bMarked, iOpenSub); } } function cookieinfoScan( sCookie, iCookieCmpLen) { while( sCookie.length > 4) { bMarked = (parseInt( sCookie.substring( 0, 1), 10)==0) ? false : true; iOpenSub = parseInt( sCookie.substring( 1, 2), 10); l = parseInt( sCookie.substring( 2, 4), 10); if ( isNaN(l)) return; if ( sCookie.length < l + 4) return; l = Math.min( l, sCookie.length-2); sl = Math.min(l,iCookieCmpLen); sName = sCookie.substring( 4, 4+sl); this.add( sName, bMarked, iOpenSub); sCookie = sCookie.substring( 4+l, sCookie.length); } } function cookieinfo() { // methods this.get = cookieinfoGet; this.add = cookieinfoAdd; this.scan = cookieinfoScan ; // properties this.length = 0; this.sFirst = null; this.sLast = null; return this; } /****************************************************************************/ // OBJECT: menu function menuStatusSet( iIndex) { if ( iIndex < 0) { if ( iIndex==iGI_ABOUT ) StatusSet( 'About ' + menuinfo.sName, this.doc.sTitle); else if ( iIndex==iGI_COOKIE) StatusSet( 'Cookie - Information', this.doc.sTitle); else this.statusClear(); } else StatusSet( this.entryGet( iIndex).sInfo, this.doc.sTitle); } function menuStatusClear() { StatusClear( this.doc.sTitle); } function menu_doc_WriteHtmlBody() { // function of objecttype doc // user set to menu bJavaScript = true; this.user.entry.forEachOpen( 'this.htmlShow( ' + bJavaScript + ');'); } function menuGlobalButton( bJavaScript) { var sLine, sHREF, sImgSrc, sImgName, sAlternate; this.iGlobalIndex++; sHREF = menuinfo.sHelpRef; if ( this.iGlobalIndex == 1) { iIndex = iGI_ABOUT; sImgSrc = this.imgHelp.sourceGet( this.sImageRoot); sAlternate = menuinfo.sCopy; sImgName = 'ABOUT'; } else { if ( !bJavaScript) return ''; if ( this.iGlobalIndex == 2) { iIndex = iGI_COOKIE; sImgSrc = this.imgCookies[this.iCookiesEnabled?1:2].sourceGet( this.sImageRoot); sAlternate = 'Cookies'; sImgName = 'COOKIES'; } else { return ''; } } if ( bJavaScript) { sHREF = 'javascript:' + this.sRelationUp + '.' + this.sVarName + '.documentClick(' + iIndex + ');'; sMouse = ' onMouseOver="' + this.sRelationUp + '.' + this.sVarName + '.mouseOver(' + iIndex + ');" onMouseOut="' + this.sRelationUp + '.' + this.sVarName + '.mouseOut(' + iIndex + ');"'; sTarget = '';//' target="_self"'; } else { sMouse = ''; sTarget = ' target="_blank"'; } sLine = ''; sLine += '' + sAlternate + ''; sLine += ''; return sLine; } function menuHtmlDocument( iIndex) { this.doc.redraw(); this.statusSet( iIndex); } function menuEntryGet( iIndex) { return this.entry.indexGet( iIndex); } function menuDocumentChange( iIndex, bDoubleClick) { var entry; entry = this.entryGet( iIndex); if ( iIndex < 0) { if ( iIndex == iGI_ABOUT) { new aboutwindow( this); } else if ( iIndex == iGI_COOKIE) { if ( bDoubleClick) { this.cookieSet( !this.iCookiesEnabled); // only executed once because bCookieEnabled can only be true here or after next statement this.iCookiesEnabled = !this.iCookiesEnabled; this.window.document.images['COOKIES'].src = this.imgCookies[this.iCookiesEnabled ? 1 : 2].image.src; } else { new cookiewindow( this); } } } else if ( entry.iType == iMT_SUB || bDoubleClick) { entry.bMarked = !entry.bMarked; entry.imageChange(); } else { entry.iOpenSub = (entry.iOpenSub+1) % ( 2 + 2*( entry.iDepth+1 < entry.iDepthMax)); if ( entry.entrySub != null) { entry.entrySub.forEach( 'this.iOpenSub = ' + ((entry.iOpenSub % 2 == 0) ? entry.iOpenSub : 0) + ';'); } if ( (entry.iType == iMT_TOP || entry.iType == iMT_MEN || entry.iType == iMT_REG) || bDoubleClick) this.htmlDocument( iIndex); // reload: // 1) Netscape // document.URL contains the actual 'WYSIWYG' information // append the index as target and then reload // use location = instead of location.reload() last one would reload the parent document! // 2) others? no wysiwyg interface -> so reload if ( navigator.appName.toLowerCase().indexOf( "netscape")>=0 || navigator.appName.toLowerCase().indexOf( "mozilla")>=0) { //alert(this.window.document.location+'=>'+this.window.document.URL + '#' + iIndex); if (document.layers && !document.getElementById) { // Old Netscape 4 solution this.window.document.location = this.window.document.URL + '#' + iIndex; } else { // IE6 && NS6 this.window.document.location.hash = '#' + iIndex; } } else { this.window.document.location.reload(); } } this.statusSet( iIndex); this.cookieSet( this.iCookiesEnabled); } function menuSetLastClick( iIndex, tTime) { // called from mouseOver AND mouseOut AND documentClick // if this routine would clear the timeout, then mousemovement after clicking // would result in missing reaction //if ( this.timerLastClick != null) clearTimeout( this.timerLastClick); this.tLastClick = tTime; // must be executed before iLastClick = iIndex this.iLastClick = iIndex; } function menuMouseOver( iIndex) { this.setLastClick( -1); this.statusSet( iIndex); } function menuMouseOut( iIndex) { this.setLastClick( -1, (new Date()).getTime()); this.statusClear(); } function menuDocumentClick( iIndex) { var tTime; var bDoubleClick; if ( this.timerLastClick != null) clearTimeout( this.timerLastClick); tTime = (new Date()).getTime(); if ( this.iLastClick == iIndex && tTime-this.tLastClick < this.tDoubleClick) { this.documentChange( iIndex, true); } else { this.setLastClick( iIndex, tTime); this.timerLastClick = setTimeout( this.sRelationUp + '.' + this.sVarName + '.documentChange( ' + iIndex + ', false);', this.tDoubleClick+10); } } function menuCookieGet() { var sComplete, sNext, sCookie, sNum, info; var bMore; var iNum; if ( this.iCookiesEnabled == 2) { this.iCookiesEnabled = false; return; } iNum = 0; sCookie = ''; sComplete = parent.window.document.cookie; do { sNum = iNum.toString(); i = sComplete.indexOf( this.sVarName + sNum); sNext = sComplete.substring( i+this.sVarName.length+sNum.length, sComplete.length); bMore = ( sNext.charAt(0) == '+') ? true : false; if ( (i = sNext.indexOf( ";")) >= 0) sNext = sNext.substring( 0, i); sNext = sNext.substring( sNext.indexOf( cCookieDevide, 2)+1, sNext.length); // version sNext = sNext.substring( sNext.indexOf( cCookieDevide)+1, sNext.length); // iLastIndex sNext = sNext.substring( sNext.indexOf( cCookieDevide)+1, sNext.length); // iCookiesEnabled this.iCookiesEnabled = (parseInt( sNext.substring( 0, 1), 10)==0) ? false : true; if ( !this.iCookiesEnabled) return; sNext = sNext.substring( sNext.indexOf( cCookieDevide)+1, sNext.length); // Length of CookieInformation i = sNext.indexOf( cCookieDevide); l = parseInt( sNext.substring( 0, i), 10); sNext = sNext.substring( i+1, sNext.length); sNext = sNext.substring( 0, Math.min(l,sNext.length)); sNext = unescape( sNext); sCookie += sNext; iNum++; } while ( bMore); this.cookieinfo = new cookieinfo(); this.cookieinfo.scan( sCookie, this.iCookieCmpLen); this.entry.forEach( 'this.readCookieInfo()'); } function menuCookieSet( iCookiesEnabled) { // this.iCookiesEnabled is old state // iCookieEnabled is new state var tExpires; var sInfo, sNext, sState, sNext, sPath, sExpires; var iLen, iCount; if ( this.iCookiesEnabled != 1) return; sState = ''; this.cookieinfo = new cookieinfo(); if ( iCookiesEnabled) { this.entry.forEach( 'this.writeCookieInfo();'); sState = this.cookieinfo.get(); } sState = escape( sState); tExpires = new Date(); tExpires.setTime( tExpires.getTime()+(this.iCookieDays*86400000)); sExpires = tExpires.toGMTString(); sExpires = ';expires=' + sExpires;//escape(sExpires); sInfo = menuinfo.sCopy + " "; sInfo = sInfo.substring( 0, Math.min( sInfo.length, 128)) while( (i=sInfo.indexOf( cCookieDevide)) >= 0) sInfo = sInfo.substing( 0, i) + cCookieDevideRepl + sInfo.substring( i+1, sInfo.length); sInfo += cCookieDevide // name + '1.0'+cCookieDevide // version + this.iLastIndex+cCookieDevide // count + (iCookiesEnabled?'1':'0') + cCookieDevide // enabled sInfo = escape( sInfo); iCount = 0; sPath = eval( this.sRelationUp + '.window.location.pathname'); sPath = sPath.substring( 0, Math.max( 0, sPath.lastIndexOf( '/'))); if ( sPath == "") { sPath = "/"; } //sPath = escape(sPath); do { sHeader= this.sVarName + iCount; iLen = Math.min( sState.length, 4096-sHeader.length-2-sInfo.length-5-sExpires.length-1-17-sPath.length); sNext = sState.substring( iLen, sState.length); sState = sState.substring( 0, iLen); // max 4096 sState = sHeader + ((sNext.length>0)?'+':'-')+ '=' + sInfo + (sState.length) + cCookieDevide + sState + sExpires + ';path=' + sPath + ';version=1;'; // referencing sVarName does function correct because the site // must have different sVarName names for the diferent menus. eval( this.sRelationUp + '.window.document.cookie = "' + sState + ';"'); sState = sNext; } while ( sState.length > 0 && ++iCount < 300); } function menu( window, sInfo, bCookies, entryFirst, sEval, sImgBaseURL) { // methods this.globalButton = menuGlobalButton; this.htmlDocument = menuHtmlDocument; this.entryGet = menuEntryGet; this.documentChange = menuDocumentChange; this.documentClick = menuDocumentClick; this.statusSet = menuStatusSet; this.statusClear = menuStatusClear; this.mouseOver = menuMouseOver; this.mouseOut = menuMouseOut; this.setLastClick = menuSetLastClick; this.cookieGet = menuCookieGet; this.cookieSet = menuCookieSet; this.window = window; // properties this.entry = entryFirst; // automatic properties this.sRoot = ''; // if ( window.location.href.indexOf( "file") >= 0) { // this.sRoot = ""; // } else { // this.sRoot = "/"; // } this.sImageRoot = this.sRoot; this.sImgParam = ' border="0" width="17" height="17" hspace="3" vspace="1" align="middle"'; this.imgBlank = new img( sImgBaseURL, 'blank', '.gif'); this.imgHelp = new img( sImgBaseURL, 'help', '.gif'); this.imgCookies = new imgmark( sImgBaseURL, 'cookies', 'cookies_off', '.gif'); this.imgInfos = new imgtype( sImgBaseURL, 'shelf', 'book', 'register', 'document', '_open', '_mark', '.gif'); this.sRelationUp = 'parent.window'; this.sVarName = 'menuMain'; this.tDoubleClick = 200; // [150..350] is o.k. this.iCookieDays = 400; this.iCookiesEnabled= bCookies; this.cookieinfo = null; this.iCookieCmpLen = 10; this.iGlobalIndex = 0; // private properties this.iLastIndex = 0; // set in entry.initialise this.iDepthMax = 0; // set in entry.initialise this.iLastClick = -1; this.tLastClick = (new Date()).getTime(); this.timerLastClick = null; this.sInfo = sInfo; this.bImgLoad = true; this.bImgInfosLoad = true; this.doc = new doc( this.window, sInfo, this); this.doc.iBaseFontSize = 3; this.doc.iMarginLeft= 3; this.doc.iMarginTop = 3; this.doc.sBackground= ''; this.doc.sBgcolor = "#BFBFBF"; this.doc.sText = "#00003F"; this.doc.sLink = "#0000FF"; this.doc.sVlink = "#0000FF"; this.doc.sAlink = "#0000FF"; this.doc.htmlBody = menu_doc_WriteHtmlBody; // overwrite default emptypage generation // initialise all entries and notice last index, index 0 is first entry (should be root) if ( sEval != null) eval( sEval); eval( this.sRelationUp + '.' + this.sVarName + ' = this;'); if ( this.bImgLoad) { this.imgBlank.loadImage( this.sImageRoot); this.imgHelp.loadImage( this.sImageRoot); this.imgCookies.load( this.sImageRoot); } if ( this.bImgInfosLoad) { this.imgInfos.load( this.sImageRoot); } this.iLastIndex = this.entry.initialise( -1, 0, this); this.entry.iOpenSub = 1; // opens first shelf as mainmenu (root) if ( !this.iCookiesEnabled) this.iCookiesEnabled = 2; this.cookieGet(); // overwrites menustructure if set and enabled this.htmlDocument( 0); return this; } /****************************************************************************/ // HELP: clientwindow, aboutwindow, cookiewindow function clientwindowDisplay() { // if ( this.window != null) this.window.close(); this.window = window.open( "", this.sName, "TOOLBAR=NO,LOCATION=NO,DIRECTORIES=NO,STATUS=NO,MENUBAR=NO,SCROLLBARS=YES,RESIZABLE=YES,COPYHISTORY=NO,WIDTH=500,HEIGHT=580"); this.doc = new doc( this.window, this.sTitle, this.user); this.doc.htmlBody = this.htmlBody; // overwrite default emptypage generation this.doc.iBaseFontSize = 3; this.doc.sBgcolor = "#BFBFBF"; this.doc.sText = "#00003F"; this.doc.sLink = "#0000FF"; this.doc.sVlink = "#0000FF"; this.doc.sAlink = "#0000FF"; this.doc.redraw(); } function clientwindow( sName, sTitle, __doc_WriteHtmlBody, user) { // methods this.display = clientwindowDisplay;; this.htmlBody = __doc_WriteHtmlBody; // properties this.sName = sName; this.sTitle = sTitle; this.user = user; this.window = null; // init this.display(); return this; } function aboutwindowDisplay() { this.htmlWriteln( '

JavaScript:

'); this.htmlWriteln( '

js/menu.js

'); this.htmlWriteln( '

' + menuinfo.sHtmlVersion + '

'); this.htmlWriteln( '

© M.Börger

'); this.htmlWriteln( 'See Copyright-Info at / Beachten Sie Copyright-Info in Seite:
http://www.marcus-boerger.de/js/DynamicJavaScript.html
'); this.htmlWriteln( '

'); this.htmlWriteln( 'Das System verfügt standardmäßig über hierarchisch gegliederte Menü Ebenen, die durch die folgenden Icons dargestellt werden:


'); this.htmlWriteln( ''); for ( i=0; i<=4; i++) { this.htmlWriteln( ''); if ( i==0) { this.htmlWriteln( ''); } else { this.htmlWriteln( ''); } for ( m=1; m<=2; m++) { for ( o=1; o<=2; o++) { if ( i==0) { this.htmlWriteln( ''); } else { this.htmlWriteln( ''); } } } this.htmlWriteln( ''); } this.htmlWriteln( '
Ebene' + i + '' + ((m==1)?'normal':'markiert') + '
' + ((o==1)?'geschlossen':'offen') + '
Ebene ' + i + ', ' + ((m==1)?'normal':'markiert') + ', ' + ((o==1)?'geschlossen':'offen')+ '
'); this.htmlWriteln( 'Durch klicken der linken Maustaste auf das Menüicon wechselt der Menüeintrag zwischen offen, alle Untermenüs offen, offen und geschlossen.'); this.htmlWriteln( '
'); this.htmlWriteln( '

Dieses Menüsystem kannn sich selbständig an den Benutzer anpassen. Hierzu bitte im Menü auf '); this.htmlWriteln( 'Cookies'); this.htmlWriteln( 'clicken.

'); } function aboutwindow( menu) { this.menu = menu; this.clientwindow = new clientwindow( 'About', 'About - ' + menuinfo.sName, aboutwindowDisplay, this); return this; } function cookiewindowDisplay() { this.htmlWriteln( '

JavaScript:

'); this.htmlWriteln( '

js/menu.js

'); this.htmlWriteln( '

' + menuinfo.sHtmlVersion + '

'); this.htmlWriteln( '

See Copyright-Info at / Beachten Sie Copyright-Info in Seite:
' + menuinfo.sCopyRef + '
'); this.htmlWriteln( '

'); this.htmlWriteln( 'Für weitere Hilfe bitte im Menü auf '); this.htmlWriteln( '' + menuinfo.sCopyRef + ''); this.htmlWriteln( 'clicken.

'); this.htmlWriteln( 'Wenn Cookies angeschaltet sind werden die Informationen darüber, welche Menüeinträge geöffnet '); this.htmlWriteln( 'sind und deren Markierungszustand vom Browser des Benutzers abgespeichert. Diese Information kann ausschließlich '); this.htmlWriteln( 'von diesem Script auf genau dieser Seite abgefragt werden. Es keine Möglichkeit auf andere Weise an diese Informationen zu '); this.htmlWriteln( 'gelangen, nochweniger hat irgendjemand anderes die Möglichkeit diese zu bekommen.'); this.htmlWriteln( '

'); this.htmlWriteln( 'Durch einen Doppelclick auf das Cookie Symbol kann man die Fähigkeit des Systemes Cookies zu benutzen an- und abschalten.'); this.htmlWriteln( '


'); this.htmlWriteln( 'Wenn Cookies angeschaltet sind, so erscheint: '); this.htmlWriteln( 'Cookies angeschaltet'); this.htmlWriteln( '
'); this.htmlWriteln( 'Wenn Cookies abgeschaltet sind, so erscheint: '); this.htmlWriteln( 'Cookies abgeschaltet'); this.htmlWriteln( '
'); } function cookiewindow( menu) { this.menu = menu; this.clientwindow = new clientwindow( 'Cookies', 'Cookies - ' + menuinfo.sName, cookiewindowDisplay, this); return this; } /************************************************************************* // FUNCTIONS: Accessing Menu -->

MenuTop( sName, sURL, sTarget, sInfo, sEval, entryFirst, entryNext)

MenuAdd( sName, sURL, sTarget, sInfo, sEval, entrySub, entryNext)

MenuReg( sName, sURL, sTarget, sInfo, sEval, entrySub, entryNext)

MenuSub( sName, sURL, sTarget, sInfo, sEval, entryNext)

MenuTop_Key( sName, sURL, sTarget, sInfo, sEval, sKey, entryFirst, entryNext)

MenuAdd_Key( sName, sURL, sTarget, sInfo, sEval, sKey, entrySub, entryNext)

MenuReg_Key( sName, sURL, sTarget, sInfo, sEval, sKey, entrySub, entryNext)

MenuSub_Key( sName, sURL, sTarget, sInfo, sEval, sKey, entryNext)

sName (HTML-String)
Name to display as Reference.

Name der im Menü angezeigt wird.

sUrl (Escaped-String)
Destination as URL or null if none.

Ziel für Menüeintrag oder null falls kein Ziel.

sTarget
Windowname for destination or null if same window.

Fenstername für Ziel oder null falls gleiches Fenster.

sInfo
Name to Display as Image alternate and in Statusbar.

Name der als Bildinformation oder in Statusbar angezeigt wird.

sEval
JavaScript Statement to be executed after default initialisation.

JavaScript Ausdruck, der nach der default Initialisierung ausgewertet wird.

sKey
Key used as cookie name for menuentries (may generate shorter cookie).

Key der als Cookiename für Menüeinträge benutzt wird (ggf. kürzere Cookies).

entrySub
First submenuentry.

Erster Untermeüeintrag.

entryNext
Next menuentry on same level.

Nächster Menüeintrag auf gleicher Ebene.

return
The retrun variable is the generated entry. This can be used in subsequent calls or in MenuInit.

Die Rückgabe ist der generierte Eintrag. Dies kann in verschachtelten Aufrufen oder in MenuInit genutzt werden.

MenuInit( window, sInfo, bCookies, sEval, entryFirst)

MenuInit( window, sInfo, bCookies, sEval, entryFirst, sImgBaseURL)

window
Window to display menu in.

Window in dem das Menü dargestellt werden soll.

sInfo (Escaped-String)
Titel and default status of menu.

Titel und default Status des Menüs.

bCookies
Enable or disable Cookies, see Information behind Cookie in loaded menu-instance. This affects the menu only if no cookie is written yet.

Cookies aktivieren oder deaktivieren. Weitere Informationen über das Cookie Symbol in einer Menuanwendung. Diese Einstellung wirkt sich nur aus, wenn noch kein Cookie geschrieben wurde.

sEval
JavaScript Statement to be executed after default initialisation and before executing Statements of menuentries.

JavaScript Ausdruck wird ausgewertet nach der default Initialisierung und vor der ausgewertung der Ausdrücke der Bilder.

entryFirst
rootmenuentry.

Erster Meüeintrag.

sImgBaseURL
Prefix to images src attribut, default: 'js/img/'

Prefix für src Attribut von Bildern, default: 'js/img/'

return
The return value is the generated menu Object, globally stored in the variable menuMain.

Die Rügabe ist das generierte menu Object, global in der Variablen menuMain gespeichert.