//main_toolbar.js depends on utility.js //main_toolbar.js depends on utility.js //main_toolbar.js depends on utility.js /** Uncompressed: 0 Standard-ly compressed: 1 Maximally-compressed: 2 **/ var sCK_NAME = "vf_compression_level"; //Needed in or out of the cswitch directories. //The prefix for compression directories, as contained in // - documentation/concepts // - documentation/object_typyes // - documentation/tutorial var sVFCD_PRE = "vfc_"; //The compression-level postfix for the directory name. Follows //sVFCD_PRE. var asVFCD_POST = ["un", "std", "max"]; //The level value for the cookie. var asCK_LVL = ["uncompressed", "standard", "maximum"]; //Needed in or out of the cswitch directories. //The (array) index of the current compression level. //Assume guilty until proven innocent. var iCMPRS_LVL; if(df(document.cookie) && document.cookie.length > 1) { for(var i = 0; i < asCK_LVL.length; i++) { var sCkV = sCK_NAME + "=" + asCK_LVL[i]; //Code to prevent multiple cookies is nuts. As long as *our* cookie exists, that's all we care about (even if they're sneaky and add an illegal cookie value such as 'maximumBOGUS', or name such as 'BOGUSvf_compression_level'). if(document.cookie.indexOf(sCkV) != -1) { //Our cookie exists! iCMPRS_LVL = i; break; } } } //If we're in a clevel directory, set the cookie based upon it. var sPATH = window.location.pathname; for(var i = 0; i < asVFCD_POST.length; i++) { if(sPATH.indexOf(getCDir(i)) != -1) { if(iCMPRS_LVL != i) { //*This* compression level (based on the directory were //in), is equal to something other than the cookie //level. //Update the level id... iCMPRS_LVL = i; if(df(iCMPRS_LVL)) { //And update the cookie, too. setCK(true); } break; } } } if(!df(iCMPRS_LVL)) { //This is their first call to this code and they're in a non- //clevel directory, or there are no cookies. //Default to maximum iCMPRS_LVL = 2; if(df(document.cookie) && document.cookie != "") { //There are cookies. Set it to the current compression level. setCK(true); } } //Either the cookie is valid, or there are no cookies. //Regardless, there is a compression level. /**
Write the main toolbar.
s_thisCFileNoPost
: The name of this file, which needs compression, minus the '.html'. If this is a non-index file, within tutorial, concept, or object_types, then this is the name of that file. Otherwise, this may not be defined.s_thisDirInDocs
: The sub-directory, within 'documentation', of this file. Must equal '', 'concepts', 'object_types', 'tutorial' or 'javascript' (no url slashes). This is not the compression-level directory below that. That's managed within this function.s_relUrlDocRoot
: The relative url to the 'documentation' directory, from here, including the final url slash ('/'). Must equal '' (for files directly in the 'documentation' directory), or one or more '../' (for those files within a sub-directory of 'documentation').s_urlBack
: The <<BACK
url, or undefined if this is 'documentation/index.html'.s_title
: The sub-title for this page, to be displayed in H1, directly under 'validate_form.js
'. If undefined, then no sub-title.[ ' +
getCLUn(s_thisDirInDocs) + ' | ' +
getCLStd(s_thisDirInDocs) + ' | ' +
getCLMax(s_thisDirInDocs) +
' | ?';
//For testing purposes...START
// sCmprsTB += ' | view | ' +
// ' del';
//For testing purposes...END
sCmprsTB += ' ]
'); if(!df(s_urlBack)) { wrtnl('<<BACK'); } else { wrtnl('<<BACK'); } //object_types is not in the toolbar. They're considered //under the "CNCEPT" heading for(var i = 0; i < asMajorDir.length; i++) { wrtnl(" "); bUnderMajorHeading = false; if(i == 0) { //Only documentation/index.html is under HOME. //Every other file in documentation is considered //under *no* major heading. //Only the home page has an undefined title. bUnderMajorHeading = (s_title == undefined); } else if(i == 1) { //Both concept and object_types files are considered //under "CNCPTS" bUnderMajorHeading = (s_thisDirInDocs == "concepts" || s_thisDirInDocs=="object_types"); } else { bUnderMajorHeading = (s_thisDirInDocs == asMajorDir[i]); } if(bUnderMajorHeading) { wrtnl('' + asMajor[i] + ''); } else { var sCDir = ""; if(i == 1 || i == 2) { //concepts (and object_types) and tutorials are //always in clevel dirs. sCDir = getCDir(iCMPRS_LVL); } var sUrlDir = getUrlDir(s_relUrlDocRoot, (asMajorDir[i] != ""), asMajorDir[i], ""); wrtnl('' + asMajor[i] + ''); } } //Must split "//", to prevent it from being deleted as an //SLC during compression. wrtnl(' | sf.net/projects/validateformjs | ' + sCmprsTB + '\n|
');
getConceptOTList(true, asConcepts, s_thisCFileNoPost, s_thisDirInDocs, s_relUrlDocRoot);
wrtnl(' | All Concepts | \n|
');
getConceptOTList(false, asObjTypes, s_thisCFileNoPost, s_thisDirInDocs, s_relUrlDocRoot);
wrtnl(' | All Object Types | \n
validate_form.js
' + s_title + '