|
From: creedon <icr...@us...> - 2005-06-13 21:41:34
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21566 Modified Files: buildGlossary Log Message: change comments follow current stylistic practices Index: buildGlossary =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/verbs/builtins/html/buildGlossary,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** buildGlossary 26 Mar 2005 19:42:56 -0000 1.1.1.1 --- buildGlossary 13 Jun 2005 21:41:25 -0000 1.2 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.verbs.builtins.html.buildGlossary ! on buildGlossary (adrGlossary = table.getCursorAddress (), flinteract = false, adrFilterScript = nil) { Ç10/9/98; 7:28:39 AM by DW Çadded filter callback script, to allow custom glossary builders for specific websites ÇI needed this to convert the Scripting News site to run dynamically. Çif there's an error, we display a dialog... Çasking if the user wants to edit the object, or continue building the glossary Çif flinteract is true, show the addresses of tables we add thru msg. ÇThu, Jan 14, 1999 at 4:25:18 PM by PBS ÇIf an object has a . character in its name, don't convert the dot to a /. ÇThis allows for pages whose names contain their file suffix. ÇThe same fix was made to html.addPageToGlossary. local (name = nameOf (adrGlossary^)); if (string.lower (name) != "glossary") and (string.lower (name) != "#glossary") { scriptError ("Can't build the glossary because \"" + name + "\" is not named #glossary or glossary.")}; local (ctAdded = 0); local (flquit = false); //if true, we unwind recusion on visit (adrtable) { local (i, ct = sizeof (adrtable^), adritem, type, title, stringstrip, path, pagetable); for i = 1 to ct { if flquit { //unwind recursion return}; adritem = @adrtable^ [i]; if html.traversalSkip (adritem) { continue}; type = typeOf (adritem^); if type == tableType { if not defined (adritem^.["#glossary"]) { //don't dive into tables that already have glossaries visit (adritem)}} else { new (tabletype, @pagetable); try { case type { //we only preflight outlines and wptexts wptextType { html.runDirectives (string (adritem^), @pagetable)}; outlineType { local (outlinecopy = adritem^); html.runOutlineDirectives (@outlinecopy, @pagetable)}} else { continue}} else { local (s = "Error processing " + nameof (adritem^) + ": \"" + tryError + "\""); if dialog.twoWay (s, "Continue", "Edit") { //user chose Continue continue} else { //user chose Edit edit (adritem); flquit = true; return}}; html.buildPageTable (adritem, @pagetable); //for file extension if adrFilterScript != nil { //10/9/98; 8:11:51 AM by DW if not adrFilterScript^ (adritem, @pagetable) { continue}}; if flinteract { msg (adritem)}; stringstrip = (string (siteroot) - "root.") + "."; local (name = nameOf (pageTable.adrObject^)); //PBS 1/14/99 path = string (adritem) - stringstrip; path = string.replaceall (path, "[\"", ""); path = string.replaceall (path, "\"]", ""); path = string.mid (path, 1, sizeOf (path) - sizeOf (name)); //PBS 1/14/99 path = string.replaceall (path, ".", "/"); path = path + name; //PBS 1/14/99 local (adrsubtable = @adrGlossary^.[pagetable.title]); new (tableType, adrsubtable); adrsubtable^.linetext = pagetable.title; adrsubtable^.path = path + html.getPref ("fileExtension", @pagetable); if flinteract { msg (adritem)}; ctAdded++}}; return (true)}; local (basetable = parentOf (adrGlossary^)); //the objects that get added to the glossary local (siteroot); bundle { //set the siteroot to the root of the site, relative to the ftpsite. local (nomad = basetable); loop { if defined (nomad^.["#ftpsite"]) { siteroot = nomad; break}; try { //see if the #ftpsite is in a #prefs table if defined (nomad^.["#prefs"].ftpsite) or defined (nomad^.prefs.["#ftpsite"]) { siteroot = nomad; break}}; nomad = parentOf (nomad^); if (nomad == @root) or (nomad == "") { siteroot = parentOf (adrGlossary^); break}}}; if flinteract { if not dialog.confirm ("Rebuild \"" + adrGlossary + "?") { return}}; visit (basetable); if flinteract { dialog.notify (ctAdded + " glossary entries added.")}; return (true)} \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.verbs.builtins.html.buildGlossary ! on buildGlossary (adrGlossary = table.getCursorAddress (), flinteract = false, adrFilterScript = nil) { ÇChanges ÇThu, Jan 14, 1999 at 4:25:18 PM by PBS ÇIf an object has a . character in its name, don't convert the dot to a /. ÇThis allows for pages whose names contain their file suffix. ÇThe same fix was made to html.addPageToGlossary. Ç10/9/98; 7:28:39 AM by DW Çadded filter callback script, to allow custom glossary builders for specific websites ÇI needed this to convert the Scripting News site to run dynamically. Çif there's an error, we display a dialog... Çasking if the user wants to edit the object, or continue building the glossary Çif flinteract is true, show the addresses of tables we add thru msg. local (name = nameOf (adrGlossary^)); if (string.lower (name) != "glossary") and (string.lower (name) != "#glossary") { scriptError ("Can't build the glossary because \"" + name + "\" is not named #glossary or glossary.")}; local (ctAdded = 0); local (flquit = false); //if true, we unwind recusion on visit (adrtable) { local (i, ct = sizeof (adrtable^), adritem, type, title, stringstrip, path, pagetable); for i = 1 to ct { if flquit { //unwind recursion return}; adritem = @adrtable^ [i]; if html.traversalSkip (adritem) { continue}; type = typeOf (adritem^); if type == tableType { if not defined (adritem^.["#glossary"]) { //don't dive into tables that already have glossaries visit (adritem)}} else { new (tabletype, @pagetable); try { case type { //we only preflight outlines and wptexts wptextType { html.runDirectives (string (adritem^), @pagetable)}; outlineType { local (outlinecopy = adritem^); html.runOutlineDirectives (@outlinecopy, @pagetable)}} else { continue}} else { local (s = "Error processing " + nameof (adritem^) + ": \"" + tryError + "\""); if dialog.twoWay (s, "Continue", "Edit") { //user chose Continue continue} else { //user chose Edit edit (adritem); flquit = true; return}}; html.buildPageTable (adritem, @pagetable); //for file extension if adrFilterScript != nil { //10/9/98; 8:11:51 AM by DW if not adrFilterScript^ (adritem, @pagetable) { continue}}; if flinteract { msg (adritem)}; stringstrip = (string (siteroot) - "root.") + "."; local (name = nameOf (pageTable.adrObject^)); //PBS 1/14/99 path = string (adritem) - stringstrip; path = string.replaceall (path, "[\"", ""); path = string.replaceall (path, "\"]", ""); path = string.mid (path, 1, sizeOf (path) - sizeOf (name)); //PBS 1/14/99 path = string.replaceall (path, ".", "/"); path = path + name; //PBS 1/14/99 local (adrsubtable = @adrGlossary^.[pagetable.title]); new (tableType, adrsubtable); adrsubtable^.linetext = pagetable.title; adrsubtable^.path = path + html.getPref ("fileExtension", @pagetable); if flinteract { msg (adritem)}; ctAdded++}}; return (true)}; local (basetable = parentOf (adrGlossary^)); //the objects that get added to the glossary local (siteroot); bundle { //set the siteroot to the root of the site, relative to the ftpsite. local (nomad = basetable); loop { if defined (nomad^.["#ftpsite"]) { siteroot = nomad; break}; try { //see if the #ftpsite is in a #prefs table if defined (nomad^.["#prefs"].ftpsite) or defined (nomad^.prefs.["#ftpsite"]) { siteroot = nomad; break}}; nomad = parentOf (nomad^); if (nomad == @root) or (nomad == "") { siteroot = parentOf (adrGlossary^); break}}}; if flinteract { if not dialog.confirm ("Rebuild \"" + adrGlossary + "?") { return}}; visit (basetable); if flinteract { dialog.notify (ctAdded + " glossary entries added.")}; return (true)} \ No newline at end of file |