#!/bin/sh # MetaCard 2.4 stack # The following is not ASCII text, # so now would be a good time to q out of more exec mc $0 "$@"  Docs251Patch2 8(Revolution Documentation 2.5.1 Enhancer ULucida Grande ULucida Grande WLucida Grande @ULucida Grande UGeorgiaUGeorgia cREVGeneral debugObjects bookmarks handlerList tempScript prevHandlerscript X]/* Revolution Documentation 2.5.1 Enhancer by Eric Chatonet sosmartsoftware.com March 2005 */ on preOpenStack set the loc of this stack to the screenloc set the style of this stack to modeless end preOpenStack --------------------------------- on openStack if there is no stack revDocsPath() then -- answer error "Could not find Revolution Documentation." with "Sorry" as sheet disable btn "Apply Patch" exit openStack end if ----- switch case revAppVersion() <> "2.5.1" answer error "This enhancer is for Rev 2.5.1 only." with "Sorry" as sheet disable btn "Apply Patch" break case the script of stack "revDocs" = the script of btn "NewStackScript" answer info "This enhancer has been already applied." as sheet disable btn "Apply Patch" break default enable btn "Apply Patch" end switch end openStack --------------------------------- function revDocsPath local tPath ----- set the itemDel to slash put the filename of stack "revmenubar" into tPath put "help/revdocumentation.rev" into item -2 to -1 of tPath return tPath end revDocsPath  cREVGeneralscriptChecksump0噲_X6G bookmarks handlerList"preOpenStack openStack revDocsPath tempScript prevHandler openStackscriptSelectionchar 501 to 500script

/*

Revolution Documentation 2.5.1 Enhancer by Eric Chatonet

sosmartsoftware.com

March 2005

*/

on preOpenStack

set the loc of this stack to the screenloc

set the style of this stack to modeless

end preOpenStack

---------------------------------

on openStack

if there is no stack revDocsPath() then -- 

answer error "Could not find Revolution Documentation." with "Sorry" as sheet

disable btn "Apply Patch"

exit openStack

end if

-----

switch

case revAppVersion() <> "2.5.1"

answer error "This enhancer is for Rev 2.5.1 only." with "Sorry" as sheet

disable btn "Apply Patch"

break

case the script of stack "revDocs" = the script of btn "NewStackScript"

answer info "This enhancer has been already applied." as sheet

disable btn "Apply Patch"

break

default

enable btn "Apply Patch"

end switch

end openStack

---------------------------------

function revDocsPath

local tPath

-----

set the itemDel to slash

put the filename of stack "revmenubar" into tPath

put "help/revdocumentation.rev" into item -2 to -1 of tPath

return tPath

end revDocsPath

@NewStackScriptEpi^local sCurrentNode,sCategories,sSeeAlso,sMergeData,sTimer,sDownload,sOldColor constant kDocsHTTP = "http://support.runrev.com/docs/webnotes/" on preOpenStack local tFolder if the cRevDocsRect of stack "revPreferences" <> "" then set the rect of this stack to the cRevDocsRect of stack "revPreferences" end if put "" into fld "status" if the platform = "MacOS" and char 1 of the systemVersion = "1" then set the decorations of this stack to "metal,title,minimize,maximize,close" else set the decorations of this stack to "default" end if repeat with X=1 to the number of btns of group "toolbar" if the platform = "MacOS" then set the style of btn X of group "toolbar" to "rectangle" else set the style of btn X of group "toolbar" to "standard" end if set the textAlign of btn X of group "toolbar" to "center" set the showBorder of btn X of group "toolbar" to false end repeat set the itemDel to "," repeat for each item tBtn in "Getting Started,Dictionary,Objects,Topics,Bookmarks" if the textStyle of btn tBtn is "bold" then goIndex tBtn end repeat ############# modified lines by Docs Enhancer: if the cRevDocs["uNav"] of stack "revPreferences" then -- restore previous navigation links: set the uBackList of this stack to the cRevDocs["uBackList"] of stack "revPreferences" set the uForwardList of this stack to the cRevDocs["uForwardList"] of stack "revPreferences" set the enabled of btn "back" to the uBackList of this stack <> empty set the enabled of btn "forward" to the uForwardList of this stack <> empty if the enabled of btn "Back" and the textStyle of btn "Dictionary" is "bold" then send "mouseUp" to btn "Back" end if else -- usual behaviour: set the uBackList of this stack to "" set the uForwardList of this stack to "" disable btn "forward" disable btn "back" end if ############# end preOpenStack setProp uDoc pPath put "" into sCategories put "" into sSeeAlso put "" into sMergeData put the milliseconds into sTimer enable btn "add bookmark" parseDoc pPath displayDoc pPath if the hilite of btn "Download and show web notes" then put "notes" into sDownload set the itemDel to "/" put item -2 to -1 of pPath into pPath set the itemDel to "." put "note" into item 2 of pPath unload url (kDocsHTTP&pPath) load url (kDocsHTTP&pPath) with "showDownloadStatus" end if pass uDoc end uDoc getProp uDocsFolder local tFolder set the itemDel to "/" put the effective filename of stack "revdocs" into tFolder delete item -1 of tFolder if the platform is "macos" and char 1 of the systemversion = 1 then --darwin uses utf8 paths in fopen which revxml uses return unidecode(uniencode(tFolder,"roman"),"utf8") end if return tFolder end uDocsFolder on setTitle pText set the htmlText of fld "label" to pText set the title of this stack to "Reference Documentation - "&fld "label" end setTitle on linkClicked pWhat goDoc pWhat end linkClicked on closeStack if the short name of this stack <> "RevDocs Edit Web Notes" and not the dontDelete of fld "list" of cd 1 then revDeleteXMLTree the docid of fld "List" of cd 1 end if set the cRevDocsRect of stack "revPreferences" to the rect of this stack put "" into fld "find" of cd 1 ############# added lines by Docs Enhancer: put the uBackList of this stack into tBackList put lineOffset(the uDoc of this stack,tBackList) into tLine if tLine <> 0 then delete line tLine of tBackList put the uDoc of this stack & cr before tBackList set the cRevDocs["uBackList"] of stack "revPreferences" to line 1 to 10 of tBackList set the cRevDocs["uForwardList"] of stack "revPreferences" to line 1 to 10 the uForwardList of this stack ############# end closeStack on displayDoc pPath local tMerge,tObj,tIntro delete char -2 of sMergeData["SeeAlso"] switch case pPath contains "/faq/" put "

[[sMergeData[topic] ]]

[[sMergeData[answer] ]]

" into tMerge break case pPath contains "/topics/" put "

[[sMergeData[topic] ]]

" into tMerge if sMergeData["summary"] <> "" then put "

[[sMergeData[summary] ]]

" after tMerge end if put "[[sMergeData[toc] ]]

[[sMergeData[answer] ]]

" after tMerge break case pPath contains "/dictionary/" delete char -1 of sMergeData["synonym"] if sMergeData["summary"] <> "" then put "

[[sMergeData[summary] ]]

" after tMerge if sMergeData["syntax"] <> "" then put "

" after tMerge end if if sMergeData["syntax"] <> "" then put "

[[sMergeData[syntax] ]]

" after tMerge end if if sMergeData["example"] <> "" then put "

[[sMergeData[example] ]]

" after tMerge end if if "xmlerr" is not in sMergeData["objects"] and sMergeData["objects"] <> "" then if sMergeData["objects"] <> "" then put "([[sMergeData[objects] ]])" into tObj end if else if "xmlerr" is not in sMergeData["library"] and sMergeData["library"] <> "" then put "([[sMergeData[library] ]])" into tObj end if end if if sMergeData["introduced"] <> "" then put "Introduced in version [[sMergeData[introduced] ]]" into tIntro else put "Introduced in version 1.0" into tIntro end if if sMergeData["changed"] <> "" and sMergeData["changed"] <> sMergeData["introduced"] then put " (Changed in version [[sMergeData[changed] ]])" after tIntro end if put "

[[sMergeData[name] ]] [[sMergeData[type] ]] "&tObj&"

[[sMergeData[synonym] ]]

Platform support: [[sMergeData[platforms] ]]

"&tIntro&"

"&tMerge&"

See also: [[sMergeData[seealso] ]]

Description[[sMergeData[description] ]]

" into tMerge break end switch set the htmlText of fld "doc" to merge(tMerge) end displayDoc on parseDoc pPath local tID put revCreateXMLTreeFromFile(pPath,true,true,false) into tID -- "topic" put ""&xmlToHTML(revXMLNodeContents(tID,"/doc/topic"))&"" into sMergeData["topic"] if "xmlerr" is not in sMergeData["name"] then setTitle revXMLNodeContents(tID,"/doc/topic") end if -- "answer" put xmlToHTML(revXMLNodeContents(tID,"/doc/answer")) into sMergeData["answer"] -- "category" --put sCurrentNode["data"] into sMergeData["type"] --put cr&sCurrentNode["data"] after sCategories -- "docRef" repeat for each line tRef in revXMLChildNames(tID,"/doc/related",cr,,true) put ""&revXMLNodeContents(tID,"/doc/related/"&tRef)&", " after sMergeData["seeAlso"] end repeat -- "toc" put xmlToHTML("

"&revXMLAttribute(tID,"/doc/toc","heading")&"

") into sMergeData["toc"] repeat for each line tRef in revXMLChildNames(tID,"/doc/toc",cr,,true) put xmlToHTML("

"&tab&""&revXMLNodeContents(tID,"/doc/toc/"&tRef)&"

") after sMergeData["toc"] end repeat -- "name" put revXMLNodeContents(tID,"/doc/name") into sMergeData["name"] if "xmlerr" is not in sMergeData["name"] then setTitle revXMLNodeContents(tID,"/doc/name")&&revXMLNodeContents(tID,"/doc/type") end if -- "syntax" if the length of revXMLNodeContents(tID,"/doc/syntax") > 4 then put xmlToHTML(""&revXMLNodeContents(tID,"/doc/syntax")&"") into sMergeData["syntax"] end if -- "library" put revXMLNodeContents(tID,"/doc/library") into sMergeData["library"] -- "objects" put revXMLNodeContents(tID,"/doc/objects") into sMergeData["objects"] -- "type" put revXMLNodeContents(tID,"/doc/type") into sMergeData["type"] -- "synonym" repeat for each line tSynonym in revXMLChildNames(tID,"/doc/synonyms",cr,,true) put revXMLNodeContents(tID,"/doc/synonyms/"&tSynonym)&"," after sMergeData["synonym"] end repeat -- "introduced" put revXMLAttribute(tID,"/doc/introduced","version") into sMergeData["introduced"] -- "changed" put revXMLAttribute(tID,"/doc/changed","version") into sMergeData["changed"] -- "Win32" if revXMLAttribute(tID,"/doc/win32","support") = "true" then put "" after sMergeData["platforms"] else put "" after sMergeData["platforms"] end if -- "OSX" if revXMLAttribute(tID,"/doc/osx","support") = "true" then put "" after sMergeData["platforms"] else put "" after sMergeData["platforms"] end if -- "MacOS" if revXMLAttribute(tID,"/doc/macos","support") = "true" then put "" after sMergeData["platforms"] else put "" after sMergeData["platforms"] end if -- "unix" if revXMLAttribute(tID,"/doc/unix","support") = "true" then put "" after sMergeData["platforms"] else put "" after sMergeData["platforms"] end if -- "platform" if revXMLAttribute(tID,"/doc/platform","warning") = "true" then put "" before sMergeData["platforms"] end if -- "summary" put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) into sMergeData["summary"] -- "example" if the length of revXMLNodeContents(tID,"/doc/example") > 7 then put xmlToHTML(""&revXMLNodeContents(tID,"/doc/example")&"") into sMergeData["example"] end if -- "description" put xmlToHTML(revXMLNodeContents(tID,"/doc/description")) into sMergeData["description"] revDeleteXMLTree tID end parseDoc function replaceEntities pData replace "&" with "&" in pData replace "<" with "<" in pData replace ">" with ">" in pData return pData end replaceEntities setProp XMLstring pXML set the XMLString of fld "List" to pXML pass XMLstring end XMLstring on goDoc pDoc local tFile,destinationLineNumber,neededScroll,tBackList,tLine set the itemDel to "." switch case item -1 of pDoc = "rev" put the uDocsFolder of this stack&"/"&toLower(pDoc) into tFile if there is not a file tFile then --put "doc" into sDownload --downloadDoc kDocsHTTP&"docs/"&toLower(pDoc),tFile exit goDoc end if go tFile break case pDoc contains "http://revonline" case pDoc contains "pdf:" send "revGoOnline" &"e&pDoc"e to stack "revOnline" --send "rcvGoto" &"e&pDoc"e to stack "revOnline" break case "@" is in pDoc and "keyword" is not in pDoc case pDoc contains "www" case pDoc contains "http://" case pDoc contains "ftp://" revGoURL pDoc case pDoc contains "index:" click at the loc of btn char 7 to -1 of pDoc break case pDoc contains "TOC:" set the wholeMatches to true put lineOffset(the clickText, the text of field "doc") into destinationLineNumber put the formattedHeight of line 1 to destinationLineNumber - 1 of field "doc" into neededScroll set the scroll of field "doc" to neededScroll break case "glossary/" is in pDoc set the hilite of btn "Show mouse over text" to true resizeStack the width of this stack,the height of this stack mouseOverDoc pDoc break default put the uDocsFolder of this stack&"/"&pDoc into tFile if there is not a file tFile then --put "doc" into sDownload --downloadDoc kDocsHTTP&"docs/"&pDoc,tFile exit goDoc end if if there is a file the uDoc of this stack then put the uBackList of this stack into tBackList put lineOffset(the uDoc of this stack,tBackList) into tLine if tLine <> 0 then delete line tLine of tBackList set the uBackList of this stack to the uDoc of this stack &cr&tBackList enable btn "back" end if set the uDoc of this stack to tFile break end switch end goDoc on downloadDoc pURL,pFile repeat for each line tLine in the cachedUrls unload url tLine end repeat libURLDownloadToFile pURL,pFile,"showDownloadStatus" end downloadDoc on showDownloadStatus pURL local tStatus,tDownloadStatus,tFile put the urlStatus of pURL into tStatus switch item 1 of tStatus case "loading" put "downloading: "&item 2 of tStatus div 1024&"/"&item 3 of tStatus div 1024 into tDownloadStatus break case "error" if sDownload = "doc" then put "error downloading" into tDownloadStatus else put "" into tDownloadStatus end if break case "cached" put "" into tDownloadStatus set the itemDel to "/" if libURLErrorData(pURL) = "" then switch sDownload case "doc" goDoc item -2 to -1 of pURL break case "mouse" mouseOverDoc item -2 to -1 of pURL break case "notes" set the htmlText of fld "doc" to the htmlText of fld "doc" & xmlToHTML("

Web Notes

"& url pURL) break end switch put "" into fld "Status" else set the itemDel to "/" put the uDocsFolder of this stack&"/"&item -2 to -1 of pURL into tFile if there is a file tFile then delete file tFile end if default put tStatus into tDownloadStatus break end switch put tDownloadStatus into fld "Status" end showDownloadStatus on mouseOverDoc pDoc local tFile,tID,tHTML set the itemDel to "." switch case item -1 of pDoc = "rev" case "@" is in pDoc and "keyword" is not in pDoc case pDoc contains "www" case pDoc contains "http://" case pDoc contains "ftp://" case pDoc contains "TOC:" case pDoc contains "index:" exit mouseOverDoc break case "glossary/" is in pDoc put the uDocsFolder of this stack&"/"&pDoc into tFile if there is not a file tFile then --downloadDoc kDocsHTTP&"docs/"&pDoc,tFile --put "mouse" into sDownload exit mouseOverDoc end if put revCreateXMLTreeFromFile(tFile,true,true,false) into tID put ""&xmlToHTML(revXMLNodeContents(tID,"/doc/term"))&"" &\ xmlToHTML(revXMLNodeContents(tID,"/doc/definition")) into tHTML revDeleteXMLTree tID break case "dictionary/" is in pDoc put the uDocsFolder of this stack&"/"&pDoc into tFile if there is not a file tFile then --downloadDoc kDocsHTTP&"docs/"&pDoc,tFile --put "mouse" into sDownload exit mouseOverDoc end if put revCreateXMLTreeFromFile(tFile,true,true,false) into tID put "

"&xmlToHTML(revXMLNodeContents(tID,"/doc/name"))&&xmlToHTML(revXMLNodeContents(tID,"/doc/type"))&"

" into tHTML if the length of revXMLNodeContents(tID,"/doc/syntax") > 4 then put "

"&xmlToHTML(""&revXMLNodeContents(tID,"/doc/syntax")&"")&"

" after tHTML end if put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) after tHTML revDeleteXMLTree tID break default put the uDocsFolder of this stack&"/"&pDoc into tFile if there is not a file tFile then --downloadDoc kDocsHTTP&"docs/"&pDoc,tFile --put "mouse" into sDownload exit mouseOverDoc end if put revCreateXMLTreeFromFile(tFile,true,true,false) into tID put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) into tHTML revDeleteXMLTree tID break end switch if "xmlerr" is not in tHTML then set the htmlText of fld "mouseOver" to replaceText(tHTML,"

","") lock screen set the height of fld "mouseOver" to the formattedHeight of fld "mouseOver" resizeStack the width of this stack,the height of this stack end mouseOverDoc function xmlToHTML pData local tSize,tFont put parseLinks(pData) into pData replace "

" with "" in pData replace "

" with "

" in pData replace "

" with "" in pData replace "

" with "" in pData replace "

" with "" in pData replace "

" with "" in pData replace "" with "" in pData replace "" with "" in pData put the scriptTextSize into tSize if tSize = "" then put 12 into tSize put the scriptTextFont into tFont if tFont = "" then if the platform = "MacOS" and char 1 of the systemVersion = 1 then put "Courier" into tFont else put "Courier New" into tFont end if end if replace "" with "" in pData replace "" with "" in pData return pData end xmlToHTML function parseLinks tData local tStart,tEnd,tLinkText,tID,tReplaceTag repeat for 1000 -- enough to loop, but not "forever" in case I get stuck get matchChunk(tData,"(?si)()",tStart,tEnd) if it is true then put char (tStart) to (tEnd) of tData into tLinkText put revCreateXMLTree(tLinkText,true,true,false) into tID if "xmlerr" is in the result then replace "docRef" with "dummy" in tLinkText put tLinkText into tReplaceTag else put "" & revXMLNodeContents(tID,"/docRef") & "" into tReplaceTag end if revDeleteXMLTree tID put tReplaceTag into char tStart to tEnd of tData else exit repeat end if end repeat return tData end parseLinks constant kFromEdge = 3 constant kStatusBar = 21 constant kToolBar = 45 on resizeStack pWidth,pHeight lock screen lock messages if the hilite of btn "Show mouse over text" then set the rect of fld "doc" to the right of btn "resizer",kToolBar,pWidth-kFromEdge,pHeight-kStatusBar-the height of fld "mouseover"-kFromEdge else set the rect of fld "doc" to the right of btn "resizer",kToolBar,pWidth-kFromEdge,pHeight-kStatusBar end if set the rect of fld "mouseover" to the right of btn "resizer",pHeight-kStatusBar-the height of fld "mouseover",pWidth-kFromEdge,pHeight-kStatusBar set the rect of fld "List" to kFromEdge,kToolBar+kStatusBar+kFromEdge,the left of btn "resizer",pHeight-kStatusBar set the rect of fld "Find" to 105,kToolBar,the left of btn "resizer"-kFromEdge-the width of btn "go",kToolBar+kStatusBar set the loc of btn "go" to the left of btn "resizer"-(the width of btn "go" div 2),item 2 of the loc of btn "go" set the rect of btn "resizer" to the left of btn "resizer",kToolBar,the right of btn "resizer",pHeight-kStatusBar set the top of btn "Show mouse over text" to pHeight-kStatusBar set the top of btn "Download and show web notes" to pHeight-kStatusBar set the top of fld "status" to pHeight-kStatusBar unlock messages unlock screen end resizeStack on popupAction pMenuPick local tName,tBookmarks,tID,tSection set the itemDel to "|" switch case pMenuPick= "Open linked document in a new window" revDocsGoDoc the uLink of btn "linkPopup" break case pMenuPick = "Add to bookmarks section|New bookmarks section" ask question "What is the name of your new bookmarks section?" titled "New Bookmarks Section" as sheet if the result is "cancel" or it is empty then exit to top put it into tName put bookmarksFile() into tBookmarks if there is a file tBookmarks then put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID repeat for each line tRef in revXMLChildNames(tID,"/index",cr,,true) if tName = revXMLAttribute(tID,"/index/"&tRef,"name") then answer information "There is already a bookmarks section with that name" as sheet exit to top end if end repeat put "
"&the uText of btn "linkPopup"&"
" into tSection revAppendXML tID,"/index",tSection put revXMLText(tID) into url ("file:"&tBookmarks) revDeleteXMLTree tID else put "
"&the uText of btn "linkPopup"&"
" into tSection put tSection into url ("file:"&tBookmarks) end if if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks" break case item 1 of pMenuPick = "Add to bookmarks section" put bookmarksFile() into tBookmarks if there is a file tBookmarks then put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID repeat for each line tRef in revXMLChildNames(tID,"/index",cr,,true) if item 2 to -1 of pMenuPick = revXMLAttribute(tID,"/index/"&tRef,"name") then revAddXMLNode tID,"/index/"&tRef,"docRef",the uText of btn "linkPopup" revSetXMLAttribute tID,the result,"src",the uLink of btn "linkPopup" end if end repeat put revXMLText(tID) into url ("file:"&tBookmarks) revDeleteXMLTree tID end if if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks" break case pMenuPick = "Delete from bookmarks" put bookmarksFile() into tBookmarks if there is a file tBookmarks then put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID repeat for each line tSection in revXMLChildNames(tID,"/index",cr,,true) repeat for each line tRef in revXMLChildNames(tID,"/index/"&tSection,cr,,true) if the uLink of btn "linkPopup" = revXMLAttribute(tID,"/index/"&tSection&"/"&tRef,"src") then revDeleteXMLNode tID,"/index/"&tSection&"/"&tRef end if end repeat end repeat put revXMLText(tID) into url ("file:"&tBookmarks) revDeleteXMLTree tID end if if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks" break default goDoc the uRelatedLinks[item 2 to -1 of pMenuPick] of btn "linkPopup" end switch end popupAction -- ---------------------------------- -- handlers for glossary highlighting -- ---------------------------------- on highlightLink currentMouseChunk local tText -- set cursor to hand over hypertext phrases, I-beam over Find field, arrow otherwise -- highlight hypertext phrases (if they're not Transcript terms or URLs) --if char 1 to 7 of the short name of this stack is not "revDocs" then exit revDocsHighlight if currentMouseChunk is empty then put the mouseChunk into currentMouseChunk global gRevHelpHiliteColor -- first unhighlight the "old" phrase if necessary clearHighlight -- check where we are to see the desired state of the cursor if the mouseStack is not the short name of this stack then lock cursor else -- within the stack's rect if currentMouseChunk is empty then -- not over a field lock cursor set the cursor to arrow else -- over a field if the lockText of the mouseControl is false then exit highlightLink if the mouse is down then exit highlightLink -- don't hilite when dragging put the linkText of currentMouseChunk into tText if tText <> "" then -- over hypertext set the storedHilitedChunk of this stack to currentMouseChunk -- save for later unhighlighting if the foregroundColor of currentMouseChunk <> gRevHelpHiliteColor then put the foregroundColor of currentMouseChunk into sOldColor end if set the foregroundColor of currentMouseChunk to gRevHelpHiliteColor mouseOverDoc the linkText of currentMouseChunk if "glossary/" is not in tText or not the hilite of btn "Show mouse over text" then set the cursor to hand end if else -- not over hypertext set the cursor to arrow end if end if end if end highlightLink on clearHighlight if the storedHilitedChunk of this stack is not empty then if sOldColor <> "" then do "set the foregroundColor of" && (the storedHilitedChunk of this stack) && "to "&sOldColor else do "set the foregroundColor of" && (the storedHilitedChunk of this stack) && "to empty" end if set the storedHilitedChunk of this stack to empty end if if the mouseStack is not the short name of this stack then unlock cursor end clearHighlight function bookmarksFile local tPath switch the platform case "MacOS" put specialFolderPath("preferences") into tPath break case "Win32" put specialFolderPath(26) into tPath break default put $HOME into tPath end switch put "/Revolution" after tPath if there is not a folder tPath then create folder tPath return tPath&"/docsbookmarks.xml" end bookmarksFile on goIndex pIndex local tFolder,tFile if pIndex = "Getting Started" then go cd "Getting Started" else go cd "Welcome to revolution" put the uDocsFolder of this stack into tFolder switch pIndex case "Objects" set the XMLstring of this stack to url ("file:"&tFolder&"/objects.xml") break case "FAQ" set the XMLstring of this stack to url ("file:"&tFolder&"/faq.xml") break case "Dictionary" --set the htmlText of fld "List" to the uDictionaryList of this stack break case "Topics" set the XMLstring of this stack to url ("file:"&tFolder&"/topics.xml") break case "Bookmarks" put bookmarksFile() into tFile if there is a file tFile then set the XMLstring of this stack to url ("file:"&tFile) else set the XMLstring of this stack to "" end if break end switch if the label of btn "filter type" = "Search for:" then put "" into fld "find" send "mouseUp" to btn "go" end if end goIndex function docFileName pData replace ":" with "colon" in pData replace "\" with "backslash" in pData replace "/" with "slash" in pData replace " " with "_" in pData replace ">" with "gt" in pData replace "<" with "lt" in pData replace "*" with "asterisk" in pData replace "&" with "amp" in pData replace "?" with "" in pData replace "+" with "plus" in pData replace "-" with "dash" in pData replace "@" with "at" in pData replace "=" with "equals" in pData replace ";" with "semicolon" in pData --replace "," with "comma" in pData return char 1 to 27 of pData end docFileName --workaround for xml issue on OpenStack put the effective filename of stack home into tFilePath put matchText(tFilePath,"^[ -~]+$") into tMatch if tMatch is false then answer info "The documentation will not work correctly because you have located it in a directory that contains non English characters somewhere in its name. This is a known issue that will be fixed shortly. In the mean time, please move your installation or rename the directory(s) involved to use the documentation." end if pass OpenStack end OpenStack ^R cREVGeneral@scriptChecksumC revUniqueID 1109925894429 bookmarks handlerListpreOpenStack uDoc uDocsFolder setTitle linkClicked closeStack displayDoc parseDoc replaceEntities XMLstring goDoc downloadDoc showDownloadStatus mouseOverDoc xmlToHTML parseLinks resizeStack popupAction highlightLink clearHighlight bookmarksFile goIndex docFileName OpenStack tempScript prevHandler preOpenStackscriptSelection char 1 to 0scriptO

local sCurrentNode,sCategories,sSeeAlso,sMergeData,sTimer,sDownload,sOldColor

constant kDocsHTTP = "http://support.runrev.com/docs/webnotes/"

on preOpenStack

local tFolder

if the cRevDocsRect of stack "revPreferences" <> "" then

set the rect of this stack to the cRevDocsRect of stack "revPreferences"

end if

put "" into fld "status"

if the platform = "MacOS" and char 1 of the systemVersion = "1" then

set the decorations of this stack to "metal,title,minimize,maximize,close"

else

set the decorations of this stack to "default"

end if

repeat with X=1 to the number of btns of group "toolbar"

if the platform = "MacOS" then

set the style of btn X of group "toolbar" to "rectangle"

else

set the style of btn X of group "toolbar" to "standard"

end if

set the textAlign of btn X of group "toolbar" to "center"

set the showBorder of btn X of group "toolbar" to false

end repeat

set the itemDel to ","

repeat for each item tBtn in "Getting Started,Dictionary,Objects,Topics,Bookmarks"

if the textStyle of btn tBtn is "bold" then goIndex tBtn

end repeat

############# modified lines by Docs Enhancer:

if the cRevDocs["uNav"] of stack "revPreferences" then -- restore previous navigation links:

set the uBackList of this stack to the cRevDocs["uBackList"] of stack "revPreferences"

set the uForwardList of this stack to the cRevDocs["uForwardList"] of stack "revPreferences"

set the enabled of btn "back" to the uBackList of this stack <> empty

set the enabled of btn "forward" to the uForwardList of this stack <> empty

if the enabled of btn "Back" and the textStyle of btn "Dictionary" is "bold" then

send "mouseUp" to btn "Back"

end if

else -- usual behaviour:

set the uBackList of this stack to ""

set the uForwardList of this stack to ""

disable btn "forward"

disable btn "back"

end if

#############

end preOpenStack

setProp uDoc pPath

put "" into sCategories

put "" into sSeeAlso

put "" into sMergeData

put the milliseconds into sTimer

enable btn "add bookmark"

parseDoc pPath

displayDoc pPath

if the hilite of btn "Download and show web notes" then

put "notes" into sDownload

set the itemDel to "/"

put item -2 to -1 of pPath into pPath

set the itemDel to "."

put "note" into item 2 of pPath

unload url (kDocsHTTP&pPath)

load url (kDocsHTTP&pPath) with "showDownloadStatus"

end if

pass uDoc

end uDoc

getProp uDocsFolder

local tFolder

set the itemDel to "/"

put the effective filename of stack "revdocs" into tFolder

delete item -1 of tFolder

if the platform is "macos" and char 1 of the systemversion = 1 then

--darwin uses utf8 paths in fopen which revxml uses

return unidecode(uniencode(tFolder,"roman"),"utf8")

end if

return tFolder

end uDocsFolder

on setTitle pText

set the htmlText of fld "label" to pText

set the title of this stack to "Reference Documentation - "&fld "label"

end setTitle

on linkClicked pWhat

goDoc pWhat

end linkClicked

on closeStack

if the short name of this stack <> "RevDocs Edit Web Notes" and not the dontDelete of fld "list" of cd 1 then

revDeleteXMLTree the docid of fld "List" of cd 1

end if

set the cRevDocsRect of stack "revPreferences" to the rect of this stack

put "" into fld "find" of cd 1

############# added lines by Docs Enhancer:

put the uBackList of this stack into tBackList

put lineOffset(the uDoc of this stack,tBackList) into tLine

if tLine <> 0 then delete line tLine of tBackList

put the uDoc of this stack & cr before tBackList

set the cRevDocs["uBackList"] of stack "revPreferences" to line 1 to 10 of tBackList

set the cRevDocs["uForwardList"] of stack "revPreferences" to line 1 to 10 the uForwardList of this stack

#############

end closeStack

on displayDoc pPath

local tMerge,tObj,tIntro

delete char -2 of sMergeData["SeeAlso"]

switch

case pPath contains "/faq/"

put "<p>[[sMergeData[topic] ]]</p><p>[[sMergeData[answer] ]]</p>" into tMerge

break

case pPath contains "/topics/"

put "<p>[[sMergeData[topic] ]]</p>" into tMerge

if sMergeData["summary"] <> "" then

put "<p>[[sMergeData[summary] ]]</p>" after tMerge

end if

put "[[sMergeData[toc] ]]<p>[[sMergeData[answer] ]]</p>" after tMerge

break

case pPath contains "/dictionary/"

delete char -1 of sMergeData["synonym"]

if sMergeData["summary"] <> "" then

put "<p>[[sMergeData[summary] ]]</p>" after tMerge

if sMergeData["syntax"] <> "" then put "<p></p>" after tMerge

end if

if sMergeData["syntax"] <> "" then

put "<p><b>[[sMergeData[syntax] ]]</b></p>" after tMerge

end if

if sMergeData["example"] <> "" then

put "<p>[[sMergeData[example] ]]</p>" after tMerge

end if

if "xmlerr" is not in sMergeData["objects"] and sMergeData["objects"] <> "" then

if sMergeData["objects"] <> "" then

put "([[sMergeData[objects] ]])" into tObj

end if

else

if "xmlerr" is not in sMergeData["library"] and sMergeData["library"] <> "" then

put "([[sMergeData[library] ]])" into tObj

end if

end if

if sMergeData["introduced"] <> "" then

put "Introduced in version [[sMergeData[introduced] ]]" into tIntro

else

put "Introduced in version 1.0" into tIntro

end if

if sMergeData["changed"] <> "" and sMergeData["changed"] <> sMergeData["introduced"] then

put " (Changed in version [[sMergeData[changed] ]])" after tIntro

end if

put "<p><font size=18 color=#606060><b>[[sMergeData[name] ]]</b> [[sMergeData[type] ]]</font> "&tObj&"</p><p><font color=#606060>[[sMergeData[synonym] ]]</font></p><p><font size=14 color=#606060>Platform support: [[sMergeData[platforms] ]]</font></p><p><font size=10>"&tIntro&"</font></p>"&tMerge&"<p></p><p><font size=14 color=#606060>See also: </font>[[sMergeData[seealso] ]]</p><p></p><p><font size=14 color=#606060><b>Description</b></font>[[sMergeData[description] ]]</p>" into tMerge

break

end switch

set the htmlText of fld "doc" to merge(tMerge)

end displayDoc

on parseDoc pPath

local tID

put revCreateXMLTreeFromFile(pPath,true,true,false) into tID

-- "topic"

put "<b><font size=18 color=#606060 face=Verdana>"&xmlToHTML(revXMLNodeContents(tID,"/doc/topic"))&"</font></b>" into sMergeData["topic"]

if "xmlerr" is not in sMergeData["name"] then

setTitle revXMLNodeContents(tID,"/doc/topic")

end if

-- "answer"

put xmlToHTML(revXMLNodeContents(tID,"/doc/answer")) into sMergeData["answer"]

-- "category"

--put sCurrentNode["data"] into sMergeData["type"]

--put cr&sCurrentNode["data"] after sCategories

-- "docRef"

repeat for each line tRef in revXMLChildNames(tID,"/doc/related",cr,,true)

put "<a href="&quote&revXMLAttribute(tID,"/doc/related/"&tRef,"src")&quote&">"&revXMLNodeContents(tID,"/doc/related/"&tRef)&"</a>, " after sMergeData["seeAlso"]

end repeat

-- "toc"

put xmlToHTML("<p></p><p><h2>"&revXMLAttribute(tID,"/doc/toc","heading")&"</h2></p>") into sMergeData["toc"]

repeat for each line tRef in revXMLChildNames(tID,"/doc/toc",cr,,true)

put xmlToHTML("<p>"&tab&"<important><a href="&quote&"TOC:"&revXMLNodeContents(tID,"/doc/toc/"&tRef)&quote&">"&revXMLNodeContents(tID,"/doc/toc/"&tRef)&"</a></important></p>") after sMergeData["toc"]

end repeat

-- "name"

put revXMLNodeContents(tID,"/doc/name") into sMergeData["name"]

if "xmlerr" is not in sMergeData["name"] then

setTitle revXMLNodeContents(tID,"/doc/name")&&revXMLNodeContents(tID,"/doc/type")

end if

-- "syntax"

if the length of revXMLNodeContents(tID,"/doc/syntax") > 4 then

put xmlToHTML("<code>"&revXMLNodeContents(tID,"/doc/syntax")&"</code>") into sMergeData["syntax"]

end if

-- "library"

put revXMLNodeContents(tID,"/doc/library") into sMergeData["library"]

-- "objects"

put revXMLNodeContents(tID,"/doc/objects") into sMergeData["objects"]

-- "type"

put revXMLNodeContents(tID,"/doc/type") into sMergeData["type"]

-- "synonym"

repeat for each line tSynonym in revXMLChildNames(tID,"/doc/synonyms",cr,,true)

put revXMLNodeContents(tID,"/doc/synonyms/"&tSynonym)&"," after sMergeData["synonym"]

end repeat

-- "introduced"

put revXMLAttribute(tID,"/doc/introduced","version") into sMergeData["introduced"]

-- "changed"

put revXMLAttribute(tID,"/doc/changed","version") into sMergeData["changed"]

-- "Win32"

if revXMLAttribute(tID,"/doc/win32","support") = "true" then

put "<img src=204121 \>" after sMergeData["platforms"]

else

put "<img src=204122 \>" after sMergeData["platforms"]

end if

-- "OSX"

if revXMLAttribute(tID,"/doc/osx","support") = "true" then

put "<img src=204123 \>" after sMergeData["platforms"]

else

put "<img src=204124 \>" after sMergeData["platforms"]

end if

-- "MacOS"

if revXMLAttribute(tID,"/doc/macos","support") = "true" then

put "<img src=204117 \>" after sMergeData["platforms"]

else

put "<img src=204118 \>" after sMergeData["platforms"]

end if

-- "unix"

if revXMLAttribute(tID,"/doc/unix","support") = "true" then

put "<img src=204119 \>" after sMergeData["platforms"]

else

put "<img src=204120 \>" after sMergeData["platforms"]

end if

-- "platform"

if revXMLAttribute(tID,"/doc/platform","warning") = "true" then

put "<img src=202648 \>" before sMergeData["platforms"]

end if

-- "summary"

put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) into sMergeData["summary"]

-- "example"

if the length of revXMLNodeContents(tID,"/doc/example") > 7 then

put xmlToHTML("<code>"&revXMLNodeContents(tID,"/doc/example")&"</code>") into sMergeData["example"]

end if

-- "description"

put xmlToHTML(revXMLNodeContents(tID,"/doc/description")) into sMergeData["description"]

revDeleteXMLTree tID

end parseDoc

function replaceEntities pData

replace "&" with "&amp;" in pData

replace "<" with "&lt;" in pData

replace ">" with "&gt;" in pData

return pData

end replaceEntities

setProp XMLstring pXML

set the XMLString of fld "List" to pXML

pass XMLstring

end XMLstring

on goDoc pDoc

local tFile,destinationLineNumber,neededScroll,tBackList,tLine

set the itemDel to "."

switch

case item -1 of pDoc = "rev"

put the uDocsFolder of this stack&"/"&toLower(pDoc) into tFile

if there is not a file tFile then

--put "doc" into sDownload

--downloadDoc kDocsHTTP&"docs/"&toLower(pDoc),tFile

exit goDoc

end if

go tFile

break

case pDoc contains "http://revonline"

case pDoc contains "pdf:"

send "revGoOnline" &&quote&pDoc&quote to stack "revOnline"

--send "rcvGoto" &&quote&pDoc&quote to stack "revOnline"

break

case "@" is in pDoc and "keyword" is not in pDoc

case pDoc contains "www"

case pDoc contains "http://"

case pDoc contains "ftp://"

revGoURL pDoc

case pDoc contains "index:"

click at the loc of btn char 7 to -1 of pDoc

break

case pDoc contains "TOC:"

set the wholeMatches to true

put lineOffset(the clickText, the text of field "doc") into destinationLineNumber

put the formattedHeight of line 1 to destinationLineNumber - 1 of field "doc" into neededScroll

set the scroll of field "doc" to neededScroll

break

case "glossary/" is in pDoc

set the hilite of btn "Show mouse over text" to true

resizeStack the width of this stack,the height of this stack

mouseOverDoc pDoc

break

default

put the uDocsFolder of this stack&"/"&pDoc into tFile

if there is not a file tFile then

--put "doc" into sDownload

--downloadDoc kDocsHTTP&"docs/"&pDoc,tFile

exit goDoc

end if

if there is a file the uDoc of this stack then

put the uBackList of this stack into tBackList

put lineOffset(the uDoc of this stack,tBackList) into tLine

if tLine <> 0 then delete line tLine of tBackList

set the uBackList of this stack to the uDoc of this stack &cr&tBackList

enable btn "back"

end if

set the uDoc of this stack to tFile

break

end switch

end goDoc

on downloadDoc pURL,pFile

repeat for each line tLine in the cachedUrls

unload url tLine

end repeat

libURLDownloadToFile pURL,pFile,"showDownloadStatus"

end downloadDoc

on showDownloadStatus pURL

local tStatus,tDownloadStatus,tFile

put the urlStatus of pURL into tStatus

switch item 1 of tStatus

case "loading"

put "downloading: "&item 2 of tStatus div 1024&"/"&item 3 of tStatus div 1024 into tDownloadStatus

break

case "error"

if sDownload = "doc" then

put "error downloading" into tDownloadStatus

else

put "" into tDownloadStatus

end if

break

case "cached"

put "" into tDownloadStatus

set the itemDel to "/"

if libURLErrorData(pURL) = "" then

switch sDownload

case "doc"

goDoc item -2 to -1 of pURL

break

case "mouse"

mouseOverDoc item -2 to -1 of pURL

break

case "notes"

set the htmlText of fld "doc" to the htmlText of fld "doc" & xmlToHTML("<p></p><p><h2>Web Notes</h2></p>"& url pURL)

break

end switch

put "" into fld "Status"

else

set the itemDel to "/"

put the uDocsFolder of this stack&"/"&item -2 to -1 of pURL into tFile

if there is a file tFile then delete file tFile

end if

default

put tStatus into tDownloadStatus

break

end switch

put tDownloadStatus into fld "Status"

end showDownloadStatus

on mouseOverDoc pDoc

local tFile,tID,tHTML

set the itemDel to "."

switch

case item -1 of pDoc = "rev"

case "@" is in pDoc and "keyword" is not in pDoc

case pDoc contains "www"

case pDoc contains "http://"

case pDoc contains "ftp://"

case pDoc contains "TOC:"

case pDoc contains "index:"

exit mouseOverDoc

break

case "glossary/" is in pDoc

put the uDocsFolder of this stack&"/"&pDoc into tFile

if there is not a file tFile then

--downloadDoc kDocsHTTP&"docs/"&pDoc,tFile

--put "mouse" into sDownload

exit mouseOverDoc

end if

put revCreateXMLTreeFromFile(tFile,true,true,false) into tID

put "<font size=14><b>"&xmlToHTML(revXMLNodeContents(tID,"/doc/term"))&"</b></font>" &\

xmlToHTML(revXMLNodeContents(tID,"/doc/definition")) into tHTML

revDeleteXMLTree tID

break

case "dictionary/" is in pDoc

put the uDocsFolder of this stack&"/"&pDoc into tFile

if there is not a file tFile then

--downloadDoc kDocsHTTP&"docs/"&pDoc,tFile

--put "mouse" into sDownload

exit mouseOverDoc

end if

put revCreateXMLTreeFromFile(tFile,true,true,false) into tID

put "<p><font size=14><b>"&xmlToHTML(revXMLNodeContents(tID,"/doc/name"))&&xmlToHTML(revXMLNodeContents(tID,"/doc/type"))&"</b></font></p>" into tHTML

if the length of revXMLNodeContents(tID,"/doc/syntax") > 4 then

put "<p>"&xmlToHTML("<code>"&revXMLNodeContents(tID,"/doc/syntax")&"</code>")&"</p>" after tHTML

end if

put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) after tHTML

revDeleteXMLTree tID

break

default

put the uDocsFolder of this stack&"/"&pDoc into tFile

if there is not a file tFile then

--downloadDoc kDocsHTTP&"docs/"&pDoc,tFile

--put "mouse" into sDownload

exit mouseOverDoc

end if

put revCreateXMLTreeFromFile(tFile,true,true,false) into tID

put xmlToHTML(revXMLNodeContents(tID,"/doc/summary")) into tHTML

revDeleteXMLTree tID

break

end switch

if "xmlerr" is not in tHTML then set the htmlText of fld "mouseOver" to replaceText(tHTML,"<p></p>","")

lock screen

set the height of fld "mouseOver" to the formattedHeight of fld "mouseOver"

resizeStack the width of this stack,the height of this stack

end mouseOverDoc

function xmlToHTML pData

local tSize,tFont

put parseLinks(pData) into pData

replace "<h1>" with "<b><font size=18 color=#404040>" in pData

replace "</h1>" with "</b></font><p></p>" in pData

replace "<h2>" with "<b><font size=16 color=#404040>" in pData

replace "</h2>" with "</b></font>" in pData

replace "<h3>" with "<font size=14 color=#404040>" in pData

replace "</h3>" with "</font>" in pData

replace "<important>" with "<b><font size=14 color=#404040>" in pData

replace "</important>" with "</font></b>" in pData

put the scriptTextSize into tSize

if tSize = "" then put 12 into tSize

put the scriptTextFont into tFont

if tFont = "" then

if the platform = "MacOS" and char 1 of the systemVersion = 1 then

put "Courier" into tFont

else

put "Courier New" into tFont

end if

end if

replace "<code>" with "<font face="&quote&tFont&quote&" size="&tSize&" >" in pData

replace "</code>" with "</font>" in pData

return pData

end xmlToHTML

function parseLinks tData

local tStart,tEnd,tLinkText,tID,tReplaceTag

repeat for 1000 -- enough to loop, but not "forever" in case I get stuck

get matchChunk(tData,"(?si)(<docRef.*?</docRef>)",tStart,tEnd)

if it is true then

put char (tStart) to (tEnd) of tData into tLinkText

put revCreateXMLTree(tLinkText,true,true,false) into tID

if "xmlerr" is in the result then

replace "docRef" with "dummy" in tLinkText

put tLinkText into tReplaceTag

else

put "<a href=" &quote& revXMLAttribute(tID,"/docRef","src") &quote& ">" & revXMLNodeContents(tID,"/docRef") & "</a>" into tReplaceTag

end if

revDeleteXMLTree tID

put tReplaceTag into char tStart to tEnd of tData

else

exit repeat

end if

end repeat

return tData

end parseLinks

constant kFromEdge = 3

constant kStatusBar = 21

constant kToolBar = 45

on resizeStack pWidth,pHeight

lock screen

lock messages

if the hilite of btn "Show mouse over text" then

set the rect of fld "doc" to the right of btn "resizer",kToolBar,pWidth-kFromEdge,pHeight-kStatusBar-the height of fld "mouseover"-kFromEdge

else

set the rect of fld "doc" to the right of btn "resizer",kToolBar,pWidth-kFromEdge,pHeight-kStatusBar

end if

set the rect of fld "mouseover" to the right of btn "resizer",pHeight-kStatusBar-the height of fld "mouseover",pWidth-kFromEdge,pHeight-kStatusBar

set the rect of fld "List" to kFromEdge,kToolBar+kStatusBar+kFromEdge,the left of btn "resizer",pHeight-kStatusBar

set the rect of fld "Find" to 105,kToolBar,the left of btn "resizer"-kFromEdge-the width of btn "go",kToolBar+kStatusBar

set the loc of btn "go" to the left of btn "resizer"-(the width of btn "go" div 2),item 2 of the loc of btn "go"

set the rect of btn "resizer" to the left of btn "resizer",kToolBar,the right of btn "resizer",pHeight-kStatusBar

set the top of btn "Show mouse over text" to pHeight-kStatusBar

set the top of btn "Download and show web notes" to pHeight-kStatusBar

set the top of fld "status" to pHeight-kStatusBar

unlock messages

unlock screen

end resizeStack

on popupAction pMenuPick

local tName,tBookmarks,tID,tSection

set the itemDel to "|"

switch

case pMenuPick= "Open linked document in a new window"

revDocsGoDoc the uLink of btn "linkPopup"

break

case pMenuPick = "Add to bookmarks section|New bookmarks section"

ask question "What is the name of your new bookmarks section?" titled "New Bookmarks Section" as sheet

if the result is "cancel" or it is empty then exit to top

put it into tName

put bookmarksFile() into tBookmarks

if there is a file tBookmarks then

put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID

repeat for each line tRef in revXMLChildNames(tID,"/index",cr,,true)

if tName = revXMLAttribute(tID,"/index/"&tRef,"name") then

answer information "There is already a bookmarks section with that name" as sheet

exit to top

end if

end repeat

put "<section name="&quote&tName&quote&"><docRef src="&quote&the uLink of btn "linkPopup"&quote&">"&the uText of btn "linkPopup"&"</docRef></section>" into tSection

revAppendXML tID,"/index",tSection

put revXMLText(tID) into url ("file:"&tBookmarks)

revDeleteXMLTree tID

else

put "<index><section name="&quote&tName&quote&"><docRef src="&quote&the uLink of btn "linkPopup"&quote&">"&the uText of btn "linkPopup"&"</docRef></section></index>" into tSection

put tSection into url ("file:"&tBookmarks)

end if

if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks"

break

case item 1 of pMenuPick = "Add to bookmarks section"

put bookmarksFile() into tBookmarks

if there is a file tBookmarks then

put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID

repeat for each line tRef in revXMLChildNames(tID,"/index",cr,,true)

if item 2 to -1 of pMenuPick = revXMLAttribute(tID,"/index/"&tRef,"name") then

revAddXMLNode tID,"/index/"&tRef,"docRef",the uText of btn "linkPopup"

revSetXMLAttribute tID,the result,"src",the uLink of btn "linkPopup"

end if

end repeat

put revXMLText(tID) into url ("file:"&tBookmarks)

revDeleteXMLTree tID

end if

if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks"

break

case pMenuPick = "Delete from bookmarks"

put bookmarksFile() into tBookmarks

if there is a file tBookmarks then

put revCreateXMLTreeFromFile(tBookmarks,true,true,false) into tID

repeat for each line tSection in revXMLChildNames(tID,"/index",cr,,true)

repeat for each line tRef in revXMLChildNames(tID,"/index/"&tSection,cr,,true)

if the uLink of btn "linkPopup" = revXMLAttribute(tID,"/index/"&tSection&"/"&tRef,"src") then

revDeleteXMLNode tID,"/index/"&tSection&"/"&tRef

end if

end repeat

end repeat

put revXMLText(tID) into url ("file:"&tBookmarks)

revDeleteXMLTree tID

end if

if the textStyle of btn "Bookmarks" = "bold" then goIndex "Bookmarks"

break

default

goDoc the uRelatedLinks[item 2 to -1 of pMenuPick] of btn "linkPopup"

end switch

end popupAction

-- ----------------------------------

-- handlers for glossary highlighting

-- ----------------------------------

on highlightLink currentMouseChunk

local tText

-- set cursor to hand over hypertext phrases, I-beam over Find field, arrow otherwise

-- highlight hypertext phrases (if they're not Transcript terms or URLs)

--if char 1 to 7 of the short name of this stack is not "revDocs" then exit revDocsHighlight

if currentMouseChunk is empty then put the mouseChunk into currentMouseChunk

global gRevHelpHiliteColor

-- first unhighlight the "old" phrase if necessary

clearHighlight

-- check where we are to see the desired state of the cursor

if the mouseStack is not the short name of this stack then

lock cursor

else -- within the stack's rect

if currentMouseChunk is empty then -- not over a field

lock cursor

set the cursor to arrow

else -- over a field

if the lockText of the mouseControl is false then exit highlightLink

if the mouse is down then exit highlightLink -- don't hilite when dragging

put the linkText of currentMouseChunk into tText

if tText <> "" then -- over hypertext

set the storedHilitedChunk of this stack to currentMouseChunk -- save for later unhighlighting

if the foregroundColor of currentMouseChunk <> gRevHelpHiliteColor then

put the foregroundColor of currentMouseChunk into sOldColor

end if

set the foregroundColor of currentMouseChunk to gRevHelpHiliteColor

mouseOverDoc the linkText of currentMouseChunk

if "glossary/" is not in tText or not the hilite of btn "Show mouse over text" then

set the cursor to hand

end if

else -- not over hypertext

set the cursor to arrow

end if

end if

end if

end highlightLink

on clearHighlight

if the storedHilitedChunk of this stack is not empty then

if sOldColor <> "" then

do "set the foregroundColor of" && (the storedHilitedChunk of this stack) && "to "&sOldColor

else

do "set the foregroundColor of" && (the storedHilitedChunk of this stack) && "to empty"

end if

set the storedHilitedChunk of this stack to empty

end if

if the mouseStack is not the short name of this stack then unlock cursor

end clearHighlight

function bookmarksFile

local tPath

switch the platform

case "MacOS"

put specialFolderPath("preferences") into tPath

break

case "Win32"

put specialFolderPath(26) into tPath

break

default

put $HOME into tPath

end switch

put "/Revolution" after tPath

if there is not a folder tPath then create folder tPath

return tPath&"/docsbookmarks.xml"

end bookmarksFile

on goIndex pIndex

local tFolder,tFile

if pIndex = "Getting Started" then

go cd "Getting Started"

else

go cd "Welcome to revolution"

put the uDocsFolder of this stack into tFolder

switch pIndex

case "Objects"

set the XMLstring of this stack to url ("file:"&tFolder&"/objects.xml")

break

case "FAQ"

set the XMLstring of this stack to url ("file:"&tFolder&"/faq.xml")

break

case "Dictionary"

--set the htmlText of fld "List" to the uDictionaryList of this stack

break

case "Topics"

set the XMLstring of this stack to url ("file:"&tFolder&"/topics.xml")

break

case "Bookmarks"

put bookmarksFile() into tFile

if there is a file tFile then

set the XMLstring of this stack to url ("file:"&tFile)

else

set the XMLstring of this stack to "<index></index>"

end if

break

end switch

if the label of btn "filter type" = "Search for:" then put "" into fld "find"

send "mouseUp" to btn "go"

end if

end goIndex

function docFileName pData

replace ":" with "colon" in pData

replace "\" with "backslash" in pData

replace "/" with "slash" in pData

replace " " with "_" in pData

replace ">" with "gt" in pData

replace "<" with "lt" in pData

replace "*" with "asterisk" in pData

replace "&" with "amp" in pData

replace "?" with "" in pData

replace "+" with "plus" in pData

replace "-" with "dash" in pData

replace "@" with "at" in pData

replace "=" with "equals" in pData

replace ";" with "semicolon" in pData

--replace "," with "comma" in pData

return char 1 to 27 of pData

end docFileName

--workaround for xml issue

on OpenStack

put the effective filename of stack home into tFilePath

put matchText(tFilePath,"^[ -~]+$") into tMatch

if tMatch is false then

answer info "The documentation will not work correctly because you have located it in a directory that contains non English characters somewhere in its name. This is a known issue that will be fixed shortly. In the mean time, please move your installation or rename the directory(s) involved to use the documentation."

end if

pass OpenStack

end OpenStack

 Apply Patchepon mouseUp local tCurPath,tSavePath,tFileType,tNewStackScript,tNewCardScript,tPrompt ----- set the cursor to watch ----- saving current docs: put revDocsPath() into tCurPath -- C put tCurPath into tSavePath set the itemDel to slash put "revdocumentation old.rev" into item -1 of tSavePath if the platform = "MacOS" then put the fileType into tFileType set the fileType to "revoRSTK" end if put url("binfile:" & tCurPath) into url("binfile:" & tSavePath) put the result if the platform = "MacOS" then set the fileType to tFileType ------ preparing: put the script of btn "NewStackScript" into tNewStackScript put the script of btn "NewCardScript" into tNewCardScript copy btn "Box" if tCurPath is among the lines of the stacks then close stack tCurPath lock messages set the cantModify of stack tCurPath to false set the botright of stack tCurPath to "-10,-10" ----- modifying: go to cd "getting started" of stack tCurPath paste choose browse tool set the left of last btn to 2 set the script of this cd to tNewCardScript set the script of this stack to tNewStackScript send "resizeStack" to this cd set the cantModify of stack tCurPath to true save stack tCurPath close stack tCurPath ----- cleaning up: disable the target unlock messages put "

Rev Docs enhancer has been applied succesfully.

" & cr \ & "

You might need to resize Docs window in order to refresh it and display the check box.

" \ & cr & "

To ensure the security, a copy of your previous Revolution Documentation has been saved as

" & tSavePath & ".

" into tPrompt replace cr with cr & "

" & cr in tPrompt answer info tPrompt ----- opening the docs: go stack tCurPath end mouseUp Kd!Enhance Revolution Documentation cREVGeneral scriptChecksumOon mouseUp

local tCurPath,tSavePath,tFileType,tNewStackScript,tNewCardScript,tPrompt

-----

set the cursor to watch

----- saving current docs:

put revDocsPath() into tCurPath -- C

put tCurPath into tSavePath

set the itemDel to slash

put "revdocumentation old.rev" into item -1 of tSavePath

if the platform = "MacOS" then

put the fileType into tFileType

set the fileType to "revoRSTK"

end if

put url("binfile:" & tCurPath) into url("binfile:" & tSavePath)

put the result

if the platform = "MacOS" then set the fileType to tFileType

------ preparing:

put the script of btn "NewStackScript" into tNewStackScript

put the script of btn "NewCardScript" into tNewCardScript

copy btn "Box"

if tCurPath is among the lines of the stacks then close stack tCurPath

lock messages

set the cantModify of stack tCurPath to false

set the botright of stack tCurPath to "-10,-10"

----- modifying:

go to cd "getting started" of stack tCurPath

paste

choose browse tool

set the left of last btn to 2

set the script of this cd to tNewCardScript

set the script of this stack to tNewStackScript

send "resizeStack" to this cd

set the cantModify of stack tCurPath to true

save stack tCurPath

close stack tCurPath

----- cleaning up:

disable the target

unlock messages

put "<p><b>Rev Docs enhancer has been applied succesfully.</b></p>" & cr \

& "<p>You might need to resize Docs window in order to refresh it and display the check box.</p>" \

& cr & "<p><i>To ensure the security, a copy of your previous Revolution Documentation has been saved as</i></p><p><i>" & tSavePath & ".</i></p>" into tPrompt

replace cr with cr & "<p></p>" & cr in tPrompt

answer info tPrompt

----- opening the docs:

go stack tCurPath

end mouseUp

Info xon linkClicked revmail "feedback@sosmartsoftware.com",,"About Rev 2.5.1 Docs Enhancer","Thanks for giving me your feedback!" & cr & cr end linkClicked (|)  cREVGeneralscriptChecksumtI~q.[ܼ revUniqueID 1109926471772 bookmarks handlerList linkClicked tempScript prevHandlerscriptSelectionchar 126 to 125script

on linkClicked

revmail "feedback@sosmartsoftware.com",,"About Rev 2.5.1 Docs Enhancer","Thanks for giving me your feedback!" & cr & cr

end linkClicked

 This enhancer for the Revolution/DreamCard 2.5.1 documentation adds a check box labeled Remember my navigation at the bottom of the Getting started card of the docs. + + 0( X o   X When this box stays unchecked, Rev documentation behaves strictly as it usually does: @1600  U The last visited topic in Topics, Objects or Bookmarks sections of the Revolution Documentation is displayed when opening again the docs. @ SOther previous consultings and all of them in the dictionnary section are lost :-( @R  When this box is checked: @1600    }The dictionnary section behaves properly: the last visited topic is automatically displayed when opening again this section. | In addition, the ten last visited topics in any section and even between 2 sessions stay available in the Back pop up menu. n n r Enjoy! Eric Chatonet  Boxheaon mouseUp set the cRevDocs["uNav"] of stack "revPreferences" to the hilite of me end mouseUp Remember my navigation cREVGeneralscriptChecksumoubp8Oq revUniqueID 1110531530827 bookmarks handlerListmouseUp tempScript prevHandlermouseUpscriptSelection char 96 to 95script6

on mouseUp

set the cRevDocs["uNav"] of stack "revPreferences" to the hilite of me

end mouseUp

NewCardScriptEplocal sLabel,sEnabledA on preOpenCard put the label of this stack into sLabel set the label of this stack to "Getting started with Revolution" disable btn "print" disable btn "web notes" disable btn "add bookmark" put the enabled of btn "Back" into sEnabledA["Back"] put the enabled of btn "Forward" into sEnabledA["Forward"] disable btn "Back" disable btn "forward" hide group "resources" show group "start" ############# added line: set the hilite of btn "Box" to the cRevDocs["uNav"] of stack "revPreferences" ############# resizeStack the width of this stack,the height of this stack end preOpenCard on closeCard set the label of this stack to sLabel enable btn "print" enable btn "web notes" enable btn "add bookmark" set the enabled of btn "Back" to sEnabledA["Back"] set the enabled of btn "Forward" to sEnabledA["Forward"] end closeCard constant kFromEdge = 3 constant kStatusBar = 21 constant kToolBar = 45 on resizeStack pWidth,pHeight lock screen lock messages set the rect of fld "main" to kFromEdge,kToolBar,pWidth-kFromEdge,pHeight-kStatusBar ############# added line by Docs Enhancer: set the top of btn "Box" to pHeight - kStatusBar ############# unlock messages unlock screen end resizeStack R cREVGeneralscriptChecksum;;CKzne revUniqueID 1110532180597 bookmarks handlerList!preOpenCard closeCard resizeStack tempScript prevHandlerarrowKeyscriptSelectionchar 185 to 184script

local sLabel,sEnabledA

on preOpenCard

put the label of this stack into sLabel

set the label of this stack to "Getting started with Revolution"

disable btn "print"

disable btn "web notes"

disable btn "add bookmark"

put the enabled of btn "Back" into sEnabledA["Back"]

put the enabled of btn "Forward" into sEnabledA["Forward"]

disable btn "Back"

disable btn "forward"

hide group "resources"

show group "start"

############# added line:

set the hilite of btn "Box" to the cRevDocs["uNav"] of stack "revPreferences"

#############

resizeStack the width of this stack,the height of this stack

end preOpenCard

on closeCard

set the label of this stack to sLabel

enable btn "print"

enable btn "web notes"

enable btn "add bookmark"

set the enabled of btn "Back" to sEnabledA["Back"]

set the enabled of btn "Forward" to sEnabledA["Forward"]

end closeCard

constant kFromEdge = 3

constant kStatusBar = 21

constant kToolBar = 45

on resizeStack pWidth,pHeight

lock screen

lock messages

set the rect of fld "main" to kFromEdge,kToolBar,pWidth-kFromEdge,pHeight-kStatusBar

############# added line by Docs Enhancer:

set the top of btn "Box" to pHeight - kStatusBar

#############

unlock messages

unlock screen

end resizeStack

@ Flche2.png q PNG  IHDR Kpl_ pHYs  gAMA|Q cHRMz%u0`:o_FIDATxb?,Xv$ϯ.?~~e'P#@11 @?~23_k_?V@p /÷>|()%ţ,%-F2\@ *n w JU牓/_ o_ū(II` b`AM]Nk5 _ ,?d+@021~K?@fӬ ~W XXY};w<||| ߿}Kw^W@koǑ74;Gڷo_߿uLL7qe`&Fqϟ_sPuFFfbA8`(10r=zk~ TxNP`=l|,IENDB` cREVGeneral revUniqueID 1110540770416SSS.png  "-PNG  IHDR". pHYs.#.#x?v 9iCCPPhotoshop ICC profilexڝwTTϽwz0z.0. Qf Ml@DEHb!(`HPb0dFJ|yyǽgs{.$O./ 'z8WGбx0Y驾A@$/7z HeOOҬT_lN:K"N3"$F/JPrb[䥟}Qd[Sl1x{#bG\NoX3I[ql2$ 8xtrp/8 pCfq.Knjm͠{r28?.)ɩL^6g,qm"[Z[Z~Q7%" 3R`̊j[~: w!$E}kyhyRm333: }=#vʉe tqX)I)B>== <8Xȉ9yP:8p΍Lg kk Ѐ$t!0V87`ɀ2A. @JPA#h'@8 .: ``a!2D!UH 2 dA>P ECqB**Z:]B=h~L2  5pN:|ó@ QC !H,G6 H9R ]H/r Aw( Q(OTJCm@*QGQ-(j MF+ 6h/*t:].G7Зw7 Xa<1:L1s3bXyeb~19 vGĩp+5qy^ oó|= ?'Htv`Ba3BDxHxE$Չ"XAP44077&9$An0;T2421t.54ld+s;# V]=iY9FgM֚k&=%Ō:nc1gcbcfX.}lGv{c)LŖN퉛w/p+/<j$.$%&㒣OdxTԂԑ4i3|o~C:&S@L u[Uo3C3OfIgwdO|;W-wsz 17jl8c͉̈́3+{%lKWr[ $ llGmnacOkE&EEY׾2⫅;K,KhtiN=e²{^-_V^Oo§s]?TWީrjVQ=w}`嚢zԶiו8>k׍ E  [ly邟~_Y53rW򯎼^{7so}x>|쇊z>yzgAMA|Q cHRMz%u0`:o_F"IDATxbax& O?"?z$<@,X< dz,,2{H?Hk4^B˧̌<4i_rD@,hgaӊb:޾zo]ǷDr8 4y6{5ݕ]WMż#٩ƧoZQqm8$Iyon0w 3+ `8 K d+ ,?ۏҟ]xۥW/~g33+?@S_B9.3_823J{;kc :e'HfCqΈ#{x#Sxs`]Ϛ[^>Y5c+?8r2,FF zh(~(M Ѱ狻v%?d|\>}aeE,^%oΦU{ǃ_Tdگ?w>ytfo <"JYղC"%.686lq-dG &pK\j{H@FeoFWwnAςDE|Փg{Y8~#%̅~f^U8]#50Ln>n^>~f[v6&߰ d cvF>H?~ߟ郹,",Z9}WX%ëXDHĄŠ 9J02qrrﳃ_+yop6E[?;3R.QYy844>?ǛGW50s[s|DYޜs%fq-9_KLu~W=\j^n+!a&lgǯ^ӏ]m rB#ǻ? hV.n6%Lz<х ;'￿ ?g{3蟿~/,r6 ~rOmsy9<9'x9 s-RXxծ|:,>̲ܿ?R= w3< 0 C_>;%'o3_?*imcރ?"2BqN.z6UI/"N~|zʲ/Ho_8AII[9Ԟ|d/O^0Q-$*ۻ= ?:Ű̢*'c*fy_ο> ^Q0si.c``_̒NL l [{p H),x]^ F o1ٍ-w}R0XxkqF_bh6^ . f6F Y. M;S.!IΞz+ *rO3߿z:;;El9%5<{{ˣa!0F6q!qNq M ߿,Oمye-d~82ċsɫ }?R\]WɫJEYDMI\XBV^]$L\ҺJj\6_d x }#ǩB__=r{ 73昳ps0+hڙ7}T~˻oya!!#v</^#.+YXUGN?FSHERTYQHXVDWߞ\RP&-<*e|o:ԹDZO\C7VUAqc㗶ɔ2SRS^!ѕ򊼡r2\vont@W޳2.>eͩ\Pvw׾zY-NݛoM7+Iq+Z( V2{sW/~PvKꙟ(wnZ_V!_xDľTbƯ@I]u &vnn:aAJJ}0-{aQf_>\~A>/x a|x]=҆'?X=ۜ\VqIe̩>[g$\be4 KkabEXOH9 ϟqɍO^-V`ʇ{<~y1I 2sps2 }g,,j2 UWUgWĿ630~}go |mĦ#".$"oϸd⃥>_v>AFN~A&HFLOhpIY PW&У O7., ٲ;|e  ,(|w(㷕 ~ մ6岛6mcC  ŋ"Ogw^z`)PK(B ]SLhُn gyf quc|xw铦-Wfh9Ӌn?zzȅ<U6t5J{ʜ&'O;/?_SģNZƯƐ1D#Ey8rD9*{2hl8zi{᧖UqP$(M[QWc 'Ӆn@ȏ>ov7V9:V Ɇ12 QWB`"EkyщYeWާӝwZ\i+7M4+' 6 7J7tAcV3! abF$Lup!5ӭ4ՠn es=>zZ$g?./}<9YS8RGJRpVܩ-M/)=PXT<_1CWMr!lqy[KIE 1A fzY-3W‘W]d7ۑRVͿ h(Tb 69|yfʖ V&%a&'Jt^c N@JXJԎ0yof6>0S'_!à-c0_cFˮ ¶ 2.5 XjS%-X%ԑ0ꀣÝz]m?^8%g*@̶2)x+[V,$p59'>qdI@%˟x/Ⱥ)e9RJ)sRCbN+$ %\w7[:·mwhMNl'bIг܂:m֐kuF]i.w/_ߞo]e3 p ؂_.b,&kWLZSϯ_nlvӓ~K@LTKT]PRV }xuc&G%+v6FQIUVPqyV<<>~z';;0v..Vf&fv6VfV`A痏RQJEME&X@w2(9XW.wLrjɲ&(A[հxUe||RZ*)b< D.N`Q+,'ۤ ԳQxɗ<~}i]`b'lg54`g|}ƉOOE.FB XKl ɻuVGDTT`}yBXvRbgW1P燔vx4v  _vM{Dun` `C73\&vU+_R^;LJן_]>[DLk~5+RigvYJQˏ[̎ZN32;?߿???ٝ;?>|sbҒڞR?>~x!*h/|&xwoJDX̎[cƒ+_ X'*fZ+k”WCּs Ý _=l>$ٹ#WTOGOGp[`0W'=?Ǡw\"zi+'Z{7Μ r7/_ZAˋfeTxoW@Ps&on?MM(WT ֥y E 6!ßon7?ҿ?>zr[ Ƿ7?y򆘦<^\۽bꅅ Wuov>ZBݩ>SV'_]:2@W_?6Zd~|t󯰲S_:w5w~O_7;GL7H^츹kfamo>xtv!޳+O=`F`]7^\9xɉ-o8ee~¯oo iWԿ=4!MU3A~1?@KOa}`~H/7737?>o(2A_?{u'>7 `==Wpi}dϧ'v.Ⱦ2Y^<ӇXyy~~{'6~u+h ë >q^!eV w2{*wξ ?pf/+po?>+a%,-G!xs{ UziN:Lȉj?bFbFZ`X!C_5 lfUHv#H{ y*ϊa-Xc \|(:mJ[}pwwK\ӻ^7#`@jE f{&0HaOeR^b:"8r G#Rτ%P>-Z[XhWCC VAGL[X _DGY36ؘs`AX@z?6e_4B+LI=88hY X"=G1"978H3X˄ ۦ { nfh !l8t~C)yyޞoՙoo-Hu,k-Te5ʈfFK\{Hpehu?" GDÆGZK'h?D⡕B>,,7ug'H= `ı} /Q@60,lk1'!l"F?M!H \2nha?h"?͈+#Ă'?[BX?Z'$V} e@)ii@:TZVJ@, \͌o'zM[{@D}3<bhT``4Ӥ(IENDB` cREVGeneral revUniqueID 1110548807876