To add a new view link: create makeXXXSpt(), makeXXXHelp() Above getLinkIndex() in jcontrol.js, add a new xxxIndex variable and number. In getLinkIndex() in jcontrol.js, add a new if: return. currentView ?? // ------------------------------------------------------------------------- If in preContacts, method for canceling it: selectMode = ""; When adding something (or removing it) from the current view (e.g. toFind, target * marks for Contacts) the code to toggle the addition should be in doMolViewSpt() (see instances of doMolViewSpt("") in jcontrol.js and top.js) consider also reDisplay("", "") which calls doMolViewSpt() // ------------------------------------------------------------------------- makeViewLink() (jcontrol.js) puts the NAME of a script (variable name or function name) in viewLinkSptName[], and puts the NAME of the help (variable name or function name) in viewLinkHelpName[]. N.B. the help function often does some crucial settings. ------------------ doViewLink() (jcontrol.js) is executed when the link is clicked, called with the matching linkIndex. It prepares for the new view. then shows help: showHelp2(viewLinkHelpName[lnum]) then does some initialization in the displayed help. If the view link has no script (more views, troubleshooting) it does cancelCenteringNoHelp(); // sends script set picking on selectMode = ""; // in doViewLink() If it does have a script top.showNonStandardResidues = false; top.hideMode = ""; and if not preContacts top.selectMode = ""; Next BUTTONS are forced up/down as needed for the new view. It records in currentView the new script NAME. currentView = viewLinkSptName[lnum] = e.g. "rocketSpt", "makeChargeSpt()" or if there is no script, an identifier such as "Ends" or "moreViews". Does some final preparations, Turns centering off (unless we're centering) top.centerMode = false; finally doMolViewSpt( eval( viewLinkSptName[] )) ------------------ doMolViewSpt() (scripts.js) inserts makeHideSpt() regenerates dots as needed if not uncertainty, resets default hoverSpt and clears top right echo. scriptToJmol(spt) ------------------ scriptToJmol() (top.js) does set picking ident if centering was in effect but not now. does makeMarkContactsTargetSpt() does makeLabelSSBondsSpt() does S-,X,? labeling marks broken ends (or clears empty baskets/gapmeshes) according to markBrokenEnds boolean. adds halos as needed if debugging, showSptInWindow(spt) unchangedScriptToJmol() ----------