|
From: creedon <icr...@us...> - 2006-01-31 20:12:34
|
Update of /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26303 Modified Files: cmd2Click Log Message: if name is "date" most certainly the user wants to see the system.verbs.builtins.date table, not system.verbs.globals.date Index: cmd2Click =================================================================== RCS file: /cvsroot/frontierkernel/odbs/frontierRoot/system/callbacks/cmd2Click,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cmd2Click 17 Jan 2006 23:17:50 -0000 1.3 --- cmd2Click 31 Jan 2006 20:12:24 -0000 1.4 *************** *** 1,3 **** FrontierVcsFile:1:scpt:system.callbacks.cmd2Click ! on cmd2Click (name) { ÇChanges Ç1/17/06; 10:35:24 AM by TAC Çif name is string most certainly the user wants to see the system.verbs.builtins.string table, not system.verbs.globals.string Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables Ç4/20/01; 4:05:40 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇTue, Oct 7, 1997 at 11:37:49 AM by PBS ÇNew callbacks for cmd2click. Callback script returns true if it handled the click, then this script immediately returns true. Otherwise, this script handles the click. ÇWed, Dec 11, 1996 at 11:16:00 PM by DW Ç4.2, handles macros in web pages Ç8/15/96 by dmb Ç integrated ssl's "enhanced2click" functionality Ç3/19/96 by ssl Çmoved checkWith etc. to enhanced2click table to simplify distribution Ç6/17/95 by ssl Çadded support for local scripts (via checkScript) Çssl change notes Çenhanced to walk up the script/outline hierarchy and check every "with" path in an outline window, assume it's a oneLiner Çadded support for reserved constants, keywords & builtins Çchanges are Pioneerware by Scott S. Lawton ÇInternet: ss...@pr..., http://www.tiac.net/prefab/ Çcalled when you cmd-double-click on an identifier ÇIt enhances the default, built-in behavior of jumping to the named object. ÇIt checks for the option key, and closes the front window if it's pressed. ÇIf the name is a file rather than a db object, it will reveal it in the Finder on checkWith (name, callbackAction) { Çwalk up the script/outline hierarchy checking in "with" for a match: "table.[name]" Çcalled by my cmd2click, control2click ÇPioneerware by Scott S. Lawton Çrevisions Ç6/13/96: handle menuscripts Ç5/16/96: now handle an "object database map" Ç3/19/96: moved to enhanced2click table, updated paths Ç1/27/96 to handle double-clicking on part of the hierarchy within a single "with" Ç5/28/95 to handle comment in the "with" Ç5/15/95 to handle hierarchy within a single "with" Çe.g. "with ObjectModel, QXP, defs" Ç(Actually, I only look at pairs. It didn't seem worth the effort to test every combination.) Çpossible improvements Çlook for nested "with" (as I do for outlines & an "object database map"), e.g. Çwith Player Çwith Keys Çlook for all combinations with multiple "fields" (not just pairs), e.g. Çwith QXP, ObjectModel, defs Çlook at every "with" in an outline oneLiner Çcall Simple.window.frontmostType to handle menuscripts Çbut then the enhanced2click package wouldn't stand on its own local { categorizedName = name; theLine; space = " "; windowType = "Unknown"; Ç modified below... windowName = window.frontmost(); whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... the only one we need is handled in the else windowType = typeOf(windowName^)} else { Ç 6/13/96 if window.isMenuScript(windowName) { windowType = scriptType}}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay(false); Ç no need to show the user our travels case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { whereAmI = op.getCursor()}}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { op.setCursor(whereAmI)}}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; on checkAllFields() { Çglobals ÇtheLine Ç which has the spaces removed Çname ÇwhereAmI local { comma = ","; fieldCount; previous; i}; fieldCount = string.countFields(theLine, comma); for i = 1 to fieldCount { categorizedName = string.nthField(theLine, comma, i) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}; for i = 1 to fieldCount { Ç 5/15/95: check pairs next (less likely) previous = string.nthField(theLine, comma, i); for j = i+1 to fieldCount { categorizedName = previous + "." + string.nthField(theLine, comma, j) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}}; return false}; Ç won't get here if it finds a match on handleWith() { Ç1/27/96: call twice ==> moved to a subroutine theLine = string.popLeading( string.lower(op.getLineText()), space ); if theLine beginsWith "with " { theLine = string.commentDelete(theLine); Ç 5/28/95 Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll( theLine - "with", space, "" ); if checkAllFields() { Çit also performs the callbackAction return true} else { return false}} else { return false}}; on handleOutlineHierarchy() { Ç5/16/96: doesn't actually check "with", but something similar Çit's easier to add here than as a separate script since it calls initialize & restoreOutline categorizedName = string.nthField(string.popLeading(op.getLineText(), space), space, 1) + "." + categorizedName; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)} else { return false}}; case windowType { scriptType { initialize(); if handleWith () { Ç 1/27/96: for cases like "with Player, keys"; 2click on keys return true}; Ç i.e. out of the whole script while op.go (left, 1) { if handleWith () { return true}}; Ç i.e. out of the whole script restoreOutline (); return false}; outlineType { Ç assume it's a oneLiner (5/16/96: also handle an "object database map") initialize(); local { theLine = string.lower(op.getLineText())}; if theLine contains "with " { Ç at present: only looks at the FIRST "with" local { fromPosition = string.patternMatch("with ", theLine) + 5; toPosition = string.patternMatch("{", theLine); numChars = toPosition - fromPosition}; Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll(string.mid(theLine, fromPosition, numChars), space, ""); if checkAllFields() { Çit also performs the callbackAction return true}} Ç i.e. out of the whole script else { Ç modified 5/16/96 to walk up the hierarchy Çunlike "with", do NOT check the current line ÇcategorizedName starts out as just name; that's what we want here too while op.go(left, 1) { Ç 5/16/96 if handleOutlineHierarchy() { return true}}; Ç i.e. out of the whole script restoreOutline(); return false}}} else { return false}}; on pathToBracketedPath (s) { ÇSunday, January 25, 1998 at 4:21:03 PM by PBS local (path, flinquotes, flinbrackets, fladd, flend); local (i, ch = "", lastch = "", piece); local (oneElement = "", elementList = {}); for i = 1 to sizeOf (s) { fladd = false; flend = false; lastch = ch; ch = s [i]; case ch { '"' { if lastch == '\\' { fladd = true} else { if !flinquotes { flinquotes = true} else { flinquotes = false}}}; '[' { if !flinquotes { flinbrackets = true}}; ']' { if !flinquotes { flinbrackets = false}}; '.' { if !flinquotes and !flinbrackets { flend = true} else { fladd = true}}} else { fladd = true}; if fladd { oneElement = oneElement + ch}; if flend { elementList = elementList + oneElement; oneElement = ""}}; elementList = elementList + oneElement; for oneElement in elementList { path = path + "[\"" + oneElement + "\"]."}; path = string.mid (path, 1, sizeOf (path) - 1); // strip off trailing dot return (path)}; Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.cmd2click) // old code Çnew (tabletype, @user.callbacks.cmd2click) local (i); local (bracketedName); for i = 1 to sizeof (user.callbacks.cmd2click) { local (adrScript = @user.callbacks.cmd2click [i]); try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (name) { return (true)}}}; on checkOtherTables (name, callbackAction) { Çlook in tables that UserTalk references, but aren't global ... to match "table.[name]" Çcalled by my cmd2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç5/15/95: handle subtables, e.g. "dialog.getFile" (in Simple) should NOT be bracketed local { jumpPaths = { "system.compiler.language.constants", "system.compiler.language.builtins", "system.compiler.language.keywords", "system.misc", "people", "system.verbs", "Simple"}; path; test}; for path in jumpPaths { test = path + "." + name; Ç added 5/15/95 if defined (test^) { callbackAction^ (test); return true}; test = path + "." + "[\"" + name + "\"]"; if defined (test^) { callbackAction^ (test); return true}}; return false}; Ç will only get here if the above fails on checkScript (name) { Çlook in the script itself for a local "handler" Çcalled by my cmd2click, control2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç6/17/95: created local { windowType = "Unknown"; Ç modified below... whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... though it isn't needed here windowType = typeOf (window.frontmost()^)}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay (false); Ç no need to show the user our travels if windowType equals scriptType { whereAmI = op.getCursor()}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}; };Çelse: the left/right of selection are correct at zero on restoreOutline() { if windowType equals scriptType { op.setCursor(whereAmI)}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; if windowType equals scriptType { initialize(); bundle { Ç set the search parameters user.prefs.search.casesensitive = false; user.prefs.search.wholewords = false; user.prefs.search.wraparound = true}; op.firstSummit (); Ç FIND seems to take current heading as its scope if op.find ("on " + name) { Ç look for the "category" text wp.setTextMode (true); op.setDisplay (displayStatus); return true} else { restoreOutline (); return false}} else { return false}}; on doIt (objectName, fromWith = false) { ÇSSL: moved standard behavior here if kb.optionKey () { local (front = window.frontMost ()); edit (address (objectName)); if window.getFile (front) == nil { window.close (front)} else { window.hide (front)}} else { edit (address (objectName))}}; if string.lower (name) == "string" { name = "system.verbs.builtins." + name}; if defined (name^) { Çsimple: just jump to it doIt (name); return (true)}; bracketedName = pathToBracketedPath (name); if defined (bracketedName^) { doIt (bracketedName); return (true)}; if defined (("websites." + name)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + name); return (true)}; if defined (("websites." + bracketedName)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + bracketedName); return (true)}; bundle { Ç4.2 -- make cmd-2clicking work for macros ÇWed, Dec 11, 1996 at 7:30:25 PM by DW try { if defined (websites.["#data"].tools) { if defined (websites.["#data"].tools^.[name]) { edit (@websites.["#data"].tools^.[name]); return (true)}}}; try { if defined (user.html.macros.[name]) { edit (@user.html.macros.[name]); return (true)}}; try { if defined (user.html.renderers.[name]) { edit (@user.html.renderers.[name]); return (true)}}; try { if defined (html.data.standardMacros.[name]) { edit (@html.data.standardMacros.[name]); return (true)}}}; if checkOtherTables (name, @doIt) { Çcheck reserved words return (true)}; if checkWith (name, @doIt) { Çcheck every "with" return (true)}; if checkScript (name) { Çcheck this script return (true)}; if file.exists (name) { // maybe it's a filename if sys.os () == "MacOS" { return (Finder.reveal (name))} else { return (webBrowser.openDocument (file.folderFromPath (name)))}}; if name beginsWith "http://" or name beginsWith "www." { // it's a URL if not (name beginsWith "http://") { name = "http://" + name}; if webBrowser.openURL (name) { webBrowser.bringToFront ()}; return (true)}; return (false)}; Çbundle // testing Çcmd2Click ("string") \ No newline at end of file --- 1,3 ---- FrontierVcsFile:1:scpt:system.callbacks.cmd2Click ! on cmd2Click (name) { ÇChanges Ç1/27/06; 2:27:38 PM by TAC Çif name is "date" most certainly the user wants to see the system.verbs.builtins.date table, not system.verbs.globals.date Ç1/17/06; 10:35:24 AM by TAC Çif name is "string" most certainly the user wants to see the system.verbs.builtins.string table, not system.verbs.globals.string Ç6/18/05; 1:34:38 PM by TAC Çuse Frontier.createUserCallbacksSubtable to initialize tables Ç4/20/01; 4:05:40 PM by JES ÇAllow callbacks to be addresses or addresses of addresses... ÇTue, Oct 7, 1997 at 11:37:49 AM by PBS ÇNew callbacks for cmd2click. Callback script returns true if it handled the click, then this script immediately returns true. Otherwise, this script handles the click. ÇWed, Dec 11, 1996 at 11:16:00 PM by DW Ç4.2, handles macros in web pages Ç8/15/96 by dmb Ç integrated ssl's "enhanced2click" functionality Ç3/19/96 by ssl Çmoved checkWith etc. to enhanced2click table to simplify distribution Ç6/17/95 by ssl Çadded support for local scripts (via checkScript) Çssl change notes Çenhanced to walk up the script/outline hierarchy and check every "with" path in an outline window, assume it's a oneLiner Çadded support for reserved constants, keywords & builtins Çchanges are Pioneerware by Scott S. Lawton ÇInternet: ss...@pr..., http://www.tiac.net/prefab/ Çcalled when you cmd-double-click on an identifier ÇIt enhances the default, built-in behavior of jumping to the named object. ÇIt checks for the option key, and closes the front window if it's pressed. ÇIf the name is a file rather than a db object, it will reveal it in the Finder on checkWith (name, callbackAction) { Çwalk up the script/outline hierarchy checking in "with" for a match: "table.[name]" Çcalled by my cmd2click, control2click ÇPioneerware by Scott S. Lawton Çrevisions Ç6/13/96: handle menuscripts Ç5/16/96: now handle an "object database map" Ç3/19/96: moved to enhanced2click table, updated paths Ç1/27/96 to handle double-clicking on part of the hierarchy within a single "with" Ç5/28/95 to handle comment in the "with" Ç5/15/95 to handle hierarchy within a single "with" Çe.g. "with ObjectModel, QXP, defs" Ç(Actually, I only look at pairs. It didn't seem worth the effort to test every combination.) Çpossible improvements Çlook for nested "with" (as I do for outlines & an "object database map"), e.g. Çwith Player Çwith Keys Çlook for all combinations with multiple "fields" (not just pairs), e.g. Çwith QXP, ObjectModel, defs Çlook at every "with" in an outline oneLiner Çcall Simple.window.frontmostType to handle menuscripts Çbut then the enhanced2click package wouldn't stand on its own local { categorizedName = name; theLine; space = " "; windowType = "Unknown"; Ç modified below... windowName = window.frontmost(); whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... the only one we need is handled in the else windowType = typeOf(windowName^)} else { Ç 6/13/96 if window.isMenuScript(windowName) { windowType = scriptType}}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay(false); Ç no need to show the user our travels case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { whereAmI = op.getCursor()}}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}}; Çelse: the left/right of selection are correct at zero on restoreOutline() { case windowType { outlineType; Ç added 5/16/96 ==> changed to a case statement scriptType { op.setCursor(whereAmI)}}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; on checkAllFields() { Çglobals ÇtheLine Ç which has the spaces removed Çname ÇwhereAmI local { comma = ","; fieldCount; previous; i}; fieldCount = string.countFields(theLine, comma); for i = 1 to fieldCount { categorizedName = string.nthField(theLine, comma, i) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}; for i = 1 to fieldCount { Ç 5/15/95: check pairs next (less likely) previous = string.nthField(theLine, comma, i); for j = i+1 to fieldCount { categorizedName = previous + "." + string.nthField(theLine, comma, j) + "." + name; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)}}}; return false}; Ç won't get here if it finds a match on handleWith() { Ç1/27/96: call twice ==> moved to a subroutine theLine = string.popLeading( string.lower(op.getLineText()), space ); if theLine beginsWith "with " { theLine = string.commentDelete(theLine); Ç 5/28/95 Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll( theLine - "with", space, "" ); if checkAllFields() { Çit also performs the callbackAction return true} else { return false}} else { return false}}; on handleOutlineHierarchy() { Ç5/16/96: doesn't actually check "with", but something similar Çit's easier to add here than as a separate script since it calls initialize & restoreOutline categorizedName = string.nthField(string.popLeading(op.getLineText(), space), space, 1) + "." + categorizedName; if defined (categorizedName^) { restoreOutline(); callbackAction^(categorizedName, true); Ç second parameter: yes it's in a "with" return (true)} else { return false}}; case windowType { scriptType { initialize(); if handleWith () { Ç 1/27/96: for cases like "with Player, keys"; 2click on keys return true}; Ç i.e. out of the whole script while op.go (left, 1) { if handleWith () { return true}}; Ç i.e. out of the whole script restoreOutline (); return false}; outlineType { Ç assume it's a oneLiner (5/16/96: also handle an "object database map") initialize(); local { theLine = string.lower(op.getLineText())}; if theLine contains "with " { Ç at present: only looks at the FIRST "with" local { fromPosition = string.patternMatch("with ", theLine) + 5; toPosition = string.patternMatch("{", theLine); numChars = toPosition - fromPosition}; Çget rid of the with, then strip out spaces so they don't interfere with nthField theLine = string.replaceAll(string.mid(theLine, fromPosition, numChars), space, ""); if checkAllFields() { Çit also performs the callbackAction return true}} Ç i.e. out of the whole script else { Ç modified 5/16/96 to walk up the hierarchy Çunlike "with", do NOT check the current line ÇcategorizedName starts out as just name; that's what we want here too while op.go(left, 1) { Ç 5/16/96 if handleOutlineHierarchy() { return true}}; Ç i.e. out of the whole script restoreOutline(); return false}}} else { return false}}; on pathToBracketedPath (s) { ÇSunday, January 25, 1998 at 4:21:03 PM by PBS local (path, flinquotes, flinbrackets, fladd, flend); local (i, ch = "", lastch = "", piece); local (oneElement = "", elementList = {}); for i = 1 to sizeOf (s) { fladd = false; flend = false; lastch = ch; ch = s [i]; case ch { '"' { if lastch == '\\' { fladd = true} else { if !flinquotes { flinquotes = true} else { flinquotes = false}}}; '[' { if !flinquotes { flinbrackets = true}}; ']' { if !flinquotes { flinbrackets = false}}; '.' { if !flinquotes and !flinbrackets { flend = true} else { fladd = true}}} else { fladd = true}; if fladd { oneElement = oneElement + ch}; if flend { elementList = elementList + oneElement; oneElement = ""}}; elementList = elementList + oneElement; for oneElement in elementList { path = path + "[\"" + oneElement + "\"]."}; path = string.mid (path, 1, sizeOf (path) - 1); // strip off trailing dot return (path)}; Frontier.createUserCallbacksSubtable (nameOf (this^)); Çif not defined (user.callbacks.cmd2click) // old code Çnew (tabletype, @user.callbacks.cmd2click) local (i); local (bracketedName); for i = 1 to sizeof (user.callbacks.cmd2click) { local (adrScript = @user.callbacks.cmd2click [i]); try { while typeOf (adrScript^) == addressType { adrScript = adrScript^}; if adrScript^ (name) { return (true)}}}; on checkOtherTables (name, callbackAction) { Çlook in tables that UserTalk references, but aren't global ... to match "table.[name]" Çcalled by my cmd2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç5/15/95: handle subtables, e.g. "dialog.getFile" (in Simple) should NOT be bracketed local { jumpPaths = { "system.compiler.language.constants", "system.compiler.language.builtins", "system.compiler.language.keywords", "system.misc", "people", "system.verbs", "Simple"}; path; test}; for path in jumpPaths { test = path + "." + name; Ç added 5/15/95 if defined (test^) { callbackAction^ (test); return true}; test = path + "." + "[\"" + name + "\"]"; if defined (test^) { callbackAction^ (test); return true}}; return false}; Ç will only get here if the above fails on checkScript (name) { Çlook in the script itself for a local "handler" Çcalled by my cmd2click, control2click, Cmd-Jump & possibly others ÇPioneerware by Scott S. Lawton Çrevisions Ç3/19/96: moved to enhanced2click table, updated paths Ç6/17/95: created local { windowType = "Unknown"; Ç modified below... whereAmI; displayStatus; leftOfSelection = 0; rightOfSelection = 0}; try { Çthe following fails for a few cases, see Simple.window.frontmostType() ... though it isn't needed here windowType = typeOf (window.frontmost()^)}; on initialize() { displayStatus = op.getDisplay(); Ç want to restore it to original state op.setDisplay (false); Ç no need to show the user our travels if windowType equals scriptType { whereAmI = op.getCursor()}; Ç uniqueID, to restore at end if wp.inTextMode() { Ç doesn't apply to cmd2Click, but may to Jump wp.getSelect(@leftOfSelection, @rightOfSelection)}}; Çelse: the left/right of selection are correct at zero on restoreOutline() { if windowType equals scriptType { op.setCursor(whereAmI)}; wp.setTextMode(true); wp.setSelect(leftOfSelection, rightOfSelection); op.setDisplay(displayStatus)}; if windowType equals scriptType { initialize(); bundle { Ç set the search parameters user.prefs.search.casesensitive = false; user.prefs.search.wholewords = false; user.prefs.search.wraparound = true}; op.firstSummit (); Ç FIND seems to take current heading as its scope if op.find ("on " + name) { Ç look for the "category" text wp.setTextMode (true); op.setDisplay (displayStatus); return true} else { restoreOutline (); return false}} else { return false}}; on doIt (objectName, fromWith = false) { ÇSSL: moved standard behavior here if kb.optionKey () { local (front = window.frontMost ()); edit (address (objectName)); if window.getFile (front) == nil { window.close (front)} else { window.hide (front)}} else { edit (address (objectName))}}; case string.lower (name) { // override some globals with builtins "date"; "string" { name = "system.verbs.builtins." + name}}; if defined (name^) { Çsimple: just jump to it doIt (name); return (true)}; bracketedName = pathToBracketedPath (name); if defined (bracketedName^) { doIt (bracketedName); return (true)}; if defined (("websites." + name)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + name); return (true)}; if defined (("websites." + bracketedName)^) { //it's in the websites table ÇSaturday, January 24, 1998 at 4:03:20 PM by PBS doIt ("websites." + bracketedName); return (true)}; bundle { Ç4.2 -- make cmd-2clicking work for macros ÇWed, Dec 11, 1996 at 7:30:25 PM by DW try { if defined (websites.["#data"].tools) { if defined (websites.["#data"].tools^.[name]) { edit (@websites.["#data"].tools^.[name]); return (true)}}}; try { if defined (user.html.macros.[name]) { edit (@user.html.macros.[name]); return (true)}}; try { if defined (user.html.renderers.[name]) { edit (@user.html.renderers.[name]); return (true)}}; try { if defined (html.data.standardMacros.[name]) { edit (@html.data.standardMacros.[name]); return (true)}}}; if checkOtherTables (name, @doIt) { Çcheck reserved words return (true)}; if checkWith (name, @doIt) { Çcheck every "with" return (true)}; if checkScript (name) { Çcheck this script return (true)}; if file.exists (name) { // maybe it's a filename if sys.os () == "MacOS" { return (Finder.reveal (name))} else { return (webBrowser.openDocument (file.folderFromPath (name)))}}; if name beginsWith "http://" or name beginsWith "www." { // it's a URL if not (name beginsWith "http://") { name = "http://" + name}; if webBrowser.openURL (name) { webBrowser.bringToFront ()}; return (true)}; return (false)}; Çbundle // testing Çcmd2Click ("string") \ No newline at end of file |