home *** CD-ROM | disk | FTP | other *** search
/ The Electronic Whole Earth Catalog / ElectronicWholeEarthCatalog.img / COMMUNITY / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-02-09  |  20KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>655</cardCount>
  7.     <cardID>15017</cardID>
  8.     <listID>3474</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-- final stack script 2/2/89 jdt------------------------------ Initialize Stack ------------------------------on openstackhide menuBarinitStackListinitSoundsend "initAccUpdate" to bg "Access"    -- for access updatingend openstackon initStackListglobal stackList-- note: there is no stack 13; MUSIC is #14put "COMMUNITY,COMMUNICATIONS,CRAFT,HEALTH" into stackListput ",HOUSEHOLD,LEARNING,LIVELIHOOD,MEDIA,NOMADICS" after stackListput ",PLACE,WHOLE SYSTEMS,INTRODUCTION,,MUSIC" after stackListend initStackList--------------------------- Misc HyperCard Msgs ------------------------------on closeStacksend "exitAccUpdate" to bg "Access"   -- for access updatingend closeStackon closeCard-- turn off sound, if any, before leaving cardsoundCloseCardend closeCardon doMenu menuChoiceif menuChoice = "Help" thengoHelpelsepass doMenuend ifend doMenu------------------------------ Sound Scripts ------------------------------on initSoundglobal curSnd, sndRefNumput 0 into sndRefNumput empty into curSndend initSoundfunction openSound shortnameput the long name of this stack into foodelete first word of foodelete first char of foodelete last char of foorepeat with i = length(foo) down to 1if char i of foo is ":" then exit repeatend repeatput (char 1 to i of foo) & shortname into barreturn OpenRes(bar)end openSoundon idleglobal curSnd, curChunkif curSnd is not empty thenput curSnd & "." & curChunk into chunkNameif the sound is chunkName thenadd 1 to curChunkplay curSnd & "." & curChunkelse if the sound is "done" thenget curSndput empty into curSndset hilite of card button ("Sound " & it) to falseend ifend ifpass idleend idleon playLong sndNameglobal curSnd, curChunk, sndRefNumif curSnd is not empty thenstopSndelseput char 1 to 2 of sndName into prefix-- special case for down home recordsif prefix is "dh" OR prefix is "DH" thenput char 3 to 4 of sndName into numif num > 35 then put "d2" into prefixelse put "d1" into prefixend ifput openSound( "SoundFiles:" & prefix & ".chunx" ) into sndRefNumput sndName into curSndset hilite of card button ("Sound " & curSnd) to trueput 1 into curChunkplay curSnd & "." & curChunkend ifend playLongon stopSndglobal curSnd, curChunkplay stopif curSnd is not emptythenset hilite of card button ("Sound " & curSnd) to falseend ifput empty into curSndput 0 into curChunkend stopSndon soundCloseCardglobal sndRefNumstopSndif sndRefNum is not 0 thencloseRes sndRefNumend ifput 0 into sndRefNumend soundCloseCardon newSoundBtn sndCode-- authoring script to create a new sound button to play 'sndCode' resourcedoMenu "New Button"put "Sound" && sndCode into sndBtnNameset the name of last button to sndBtnNameset the style of btn sndBtnName to transparentset the icon of btn sndBtnName to 13667   -- musical note icon idset the rect of btn sndBtnName to "291,301,329,337"set the autoHilite of btn sndBtnName to trueset the showName of btn sndBtnName to falseput "on mouseUp" & return into sndScriptput "  playLong" && sndCode & return after sndScriptput "end mouseUp" & return after sndScriptset the script of btn sndBtnName to sndScriptchoose Browse toolend newSoundBtn---------------------- Misc Hypercard Object Utilities ----------------------function hasCdField whatrepeat with i = 1 to number of cd fieldsif short name of cd field i = what then return trueend repeatreturn falseend hasCdFieldfunction hasBgField whatrepeat with i = 1 to number of bg fieldsif short name of bg field i = what then return trueend repeatreturn falseend hasBgFieldon listFields-- handy utility for listing names of all fields on a card-- hidden fields are marked with asterisksset lockScreen to truedoMenu "New Field"put the number of card fields into hereset name of card field here to "fieldListing"set style of card field "fieldListing" to scrollingset the rect of card field "fieldListing" to "0,20,200,300"set textFont of card field "fieldListing" to monacoset textSize of card field "fieldListing" to 9set lockScreen to falserepeat with cntr = 1 to the number of bkgnd fieldsput short name of bg fld cntr into fldNameget the visible of bg fld cntrif it is true thenput " " && "bg" && "fld" && Quote & fldName & Quote & Return¬¨after cd fld "fieldListing"elseput "*" && "bg" && "fld" && Quote & fldName & Quote  & Return¬¨after cd fld "fieldListing"end ifend repeatput Return after card field "fieldListing"repeat with cntr = 1 to the number of card fieldsput short name of cd fld cntr into fldNameget the visible of cd fld cntrif it is true thenput " " && "cd" && "fld" && Quote & fldName & Quote & Return¬¨after cd fld "fieldListing"elseput "*" && "cd" && "fld" && Quote & fldName & Quote  & Return¬¨after cd fld "fieldListing"end ifend repeatend listFieldson listButtonsset lockScreen to truedoMenu "New Field"put the number of card fields into hereset name of card field here to "fieldListing"set style of card field "fieldListing" to scrollingset the rect of card field "fieldListing" to "0,20,200,300"set textFont of card field "fieldListing" to monacoset textSize of card field "fieldListing" to 9set lockScreen to falserepeat with cntr = 1 to the number of bkgnd buttonsput short name of bg btn cntr into btnNameget the visible of bg btn cntrif it is true thenput " " && "bg" && "btn" && Quote & btnName & Quote & Return¬¨after cd fld "fieldListing"elseput "*" && "bg" && "btn" && Quote & btnName & Quote  & Return¬¨after cd fld "fieldListing"end ifend repeatput Return after card field "fieldListing"repeat with cntr = 1 to the number of card buttonsput short name of cd btn cntr into btnNameget the visible of cd btn cntrif it is true thenput " " && "cd" && "btn" && Quote & btnName & Quote & Return¬¨after cd fld "fieldListing"elseput "*" && "cd" && "btn" && Quote & btnName & Quote  & Return¬¨after cd fld "fieldListing"end ifend repeatend listButtons------------------------------ Make New Cards --------------------------------- Authoring scripts for creating new article cards.--on emptyFields-- empties all card and bkgnd fields on the present cardput number of bg fields into fcrepeat with i = 1 to fcput empty into bg field iend repeatput number of cd fields into fcrepeat with i = 1 to fcput empty into cd field iend repeatend emptyFieldson copyFields srcCard, destCardgo to srcCardput number of fields into fcrepeat with i = 1 to fcput short name of fld i into thisFldNameput fld thisFldName of srcCard into fld thisFldName of destCardend repeatput number of cd fields into fcrepeat with i = 1 to fcput short name of cd fld i into thisFldNameput cd fld thisFldName of srcCard into cd fld thisFldName ¬¨of destCardend repeatend copyFieldson newReviewpush cardgo to first card of bkgnd "Review"put the id of this bg into goodBgIDdomenu copy cardpop carddomenu paste cardemptyFieldsif the id of this bg is not goodBgID thenanswer "The background ID is bad.  Deleting..." with "OK"doMenu "Delete Card"exit newReviewend ifput "Review" into fld "theIdent"put "Menu" into field "theHeading"answer "Do you want?" with "New Title" or "Prev Title"if it is "New Title" thenask "What Title for this Review?"put it into fld "theTitle"elseput fld "theTitle" of prev card into fld "theTitle"end ifanswer "Use?" with "New Acc#" or "Prev Acc#"if it is "New Acc#" thenask "What Accession number for this Review?"put it into field "Accession"elseput fld "Accession" of prev card into fld "Accession"end ifend newReviewon newAccesspush cardgo to first card of bkgnd "Access"put the id of this bg into goodBgIDdomenu copy cardpop carddomenu paste cardemptyFieldsif the id of this bg is not goodBgID thenanswer "The background ID is bad.  Deleting..." with "OK"doMenu "Delete Card"exit newAccessend ifput "Access" into fld "theIdent"put "Menu" into field "theHeading"put field "theTitle" of previous card into field "theTitle"put field "accession" of previous card into field "accession"Answer "Does this item require a Survey Acc #?" ¬¨with "Yes" or "No"if it is "Yes" thenask "What Survey Accession number for this item?"put it into field "SurveyAccession"end ifend newAccesson newExcerptpush cardgo to first card of bkgnd "Excerpt"put the id of this bg into goodBgIDdomenu copy cardpop carddomenu paste cardemptyFieldsif the id of this bg is not goodBgID thenanswer "The background ID is bad.  Deleting..." with "OK"doMenu "Delete Card"exit newExcerptend ifput "Excerpt" into fld "theIdent"put "Menu" into field "theHeading"put field "theTitle" of previous card into field "theTitle"put field "accession" of previous card into field "accession"end newExcerpton newPicturepush cardgo to first card of bkgnd "Picture"domenu copy cardpop carddomenu paste cardemptyFieldsif the id of this bg is not goodBgID thenanswer "The background ID is bad.  Deleting..." with "OK"doMenu "Delete Card"exit newPictureend ifput "Picture" into fld "theIdent"put "Menu" into field "theHeading"put field "theTitle" of previous card into field "theTitle"put field "accession" of previous card into field "accession"Answer "Is this Picture a full-screen graphic?" ¬¨with "Yes" or "No"if it is "Yes" thenput "X" into fld "fullScreen"elseput empty into fld "fullScreen"end ifend newPicture---------------------------- Lookup Scripts -------------------------------- Most of the action in the Catalog consists of jumping from one card to-- another.  These are the underlying scripts for 'lookup'.function whichstack theAccess-- Each stack has a unique two-digit identifier.  Thses identifiers are used-- as prefixes for all accession numbers in the Whole Earth stacks.  By-- examining the first two digits of any accession number we can deternine-- what Whole Earth stack contains the article corresponding to an accession-- number.global stackListput char 1 to 2 of theAccess into theStackreturn item theStack of stackListend whichstackon lookup theAccess, theEffect-- This is the key navigation script.  'theAccess' is either a card id or-- an accession number.  If it is a card id, we go there forthwith.-- Otherwise it is an accession number and we must find the accession-- number in theaccList and then get the card id from the corresponding-- line in the idList.global accList, idListlock screenif theAccess contains "card id" then     -- theAccess is a card id, go therego to theAccessunlock screen with theEffectexit lookupend if-- it's an accession; check to see if it is in a different stack and if so,-- go there.put whichStack(theAccess) into theStackif theStack is not (short name of this stack) thenset lockrecent to truego to stack theStackset lockrecent to falseend if-- reload accList and idList-- only necessary if 'lookup' is given an accession numberput char 1 to 2 of theAccess into accStackput char 1 to 2 of accList into accListStackif accStack <> accListStack thenput field "theIDs" of card "Contents" into idListput field "theAccessions" of card "Contents" into accListend if-- find access number in accListput offset(theAccess, accList) into whereif where is 0 thenbeepput "Lookup failed on access #" & theAccess && "..." into errMsganswer errMsg with "OK"else-- calculate its line and get corresponding card id in idListput line (where div 9 + 1) of idList into targetIDgo to targetIDunlock screen with theEffectend ifend lookup----------------------- Navigation on the Fly --------------------------------- Normally the navigation buttons ("Map", "Right", "Left", "Up" and "Down")-- check their corresponding "dest" field for a card id or an accession-- number and then call 'lookup' with that information.  However, if the-- "dest" field is empty, the button will call one of the following scripts-- which calculates the destination on the fly.  This was useful during-- development when the "dest" fields were empty.--function getLastIMapput empty into lastIMapFldput number of cd flds into cdFldCountrepeat with i = 1 to cdFldCountif short name of cd fld i = "iMap" thenput i into lastIMapFldend ifend repeatreturn lastIMapFldend getLastIMapon prevSectionset lockscreen to truebackupToBG "Cluster Map"if bkgnd field "theIdent" of prev card is "Section Map" thenbackupToBG "Cluster Map"end ifunlock screen with scroll rightend prevSectionon nextSectionset lockscreen to truego to next card of bkgnd "Cluster Map"if bkgnd field "theIdent" of prev card is "Section Map" thengo to next card of bkgnd "Cluster Map"end ifunlock screen with scroll leftend nextSectionon prevMapset lockscreen to trueif bkgnd field "theIdent" of prev card is "Cluster Map" thengo to next card of bkgnd "Cluster Map"end ifbackupToBG "Item Map"unlock screen with scroll rightend prevMapon nextMapset lockscreen to truego to next card of bkgnd "Item Map"if bkgnd field "theIdent" of prev card is "Cluster Map" thengo to prev cardbackupToBG "Cluster Map"go to next card of bkgnd "Item Map"end ifunlock screen with scroll leftend nextMapon prevArticlelock screen-- back out of present article by looking for different accessionput fld "accession" into thisAccrepeat while fld "accession" = thisAccset cursor to busygo to prev cardend repeat-- if in Item Map, go to article in last "iMap" field-- else if in prev article, go to page 1if short name of this bg is "Item Map" thenput getLastIMap() into lastIMapsend mouseUp to cd fld lastIMapelserepeatset cursor to busyif short name of this bg <> "Picture" then  -- "thePage" is cd fldif word 1 of fld "thePage" is "1" thenexit repeatend ifend ifgo to prev cardend repeatend ifunlock screen with scroll right slowend prevArticleon nextArticlelock screenput fld "accession" into thisAcc-- push forward out of present articlerepeat while fld "accession" = thisAccset cursor to busygo to next cardend repeat-- if we're in a Review, stop-- else we are in a Map bg,-- back up to Item Map, then forward oneif short name of this bg contains "Map" thengo to prev card    -- in case at "Section Map"backupToBG "Item Map"go to next cardend ifunlock screen with scroll left slowend nextArticleon prevPage                            -- page back in articleput fld "accession" into thisAccput fld "accession" of prev card into prevAcclock screenif prevAcc <> thisAcc then    -- wrap from first page to last pagerepeat while fld "accession" of next card = thisAccgo to next cardend repeatelsego to prev cardend ifunlock screen with scroll leftend prevPageon nextPage                            -- page forward in articleput fld "accession" into thisAccput fld "accession" of next card into nextAcclock screenif nextAcc <> thisAcc then    -- wrap from last page to first pagerepeat while fld "accession" of prev card = thisAccgo to prev cardend repeatelsego to next cardend ifunlock screen with scroll leftend nextPageon backupToBG bgNamerepeat with i = (the number of this card -1 ) down to 1if (field theIdent of card i) is bgName then exit repeatset cursor to busyend repeatif (field theIdent of card i) is not bgName thengo to last cardrepeat with i = (the number of this card -1 ) down to 1if (field theIdent of card i) is bgName then exit repeatset cursor to busyend repeatend ifgo to card iend backupToBG-------------------------- Navigation Buttons --------------------------------- The Navigation Buttons are the "Map", "Left", and "Right" buttons, and the-- pager buttons: "Up" and "Down" on the Article cards.  Their scripts are-- centralized at the stack level (rather than in the buttons themselves)-- for convenience during development.---------------------- Cluster Map Navigation Buttons -----------------------on doClusterMapButtonif fld "MapDest" is not empty thenlookup fld "MapDest", "dissolve"elsevisual effect dissolvego to first card of bg "Section map"end ifend doClusterMapButtonon doClusterLeftButtonif fld "LeftDest" is not empty thenlookup fld "LeftDest", "scroll right"elseprevSectionend ifend doClusterLeftButtonon doClusterRightButtonif fld "RightDest" is not empty thenlookup fld "RightDest", "scroll left"elsenextSectionend ifend doClusterRightButton------------------------ Item Map Navigation Buttons --------------------------on doItemMapButtonif fld "MapDest" is not empty thenlookup fld "MapDest", "dissolve"elselock screenbackUpToBG "Cluster Map"unlock screen with dissolveend ifend doItemMapButtonon doItemLeftButtonif fld "LeftDest" is not empty thenlookup fld "LeftDest", "scroll right"elseprevMapend ifend doItemLeftButtonon doItemRightButtonif fld "RightDest" is not empty thenlookup fld "RightDest", "scroll left"elsenextMapend ifend doItemRightButton------------------------ Article Navigation Buttons --------------------------on doArticleMapButtonif fld "MapDest" is not empty thenlookup fld "MapDest", "dissolve"elselock screenbackUpToBG "Item Map"unlock screen with dissolveend ifend doArticleMapButtonon doArticleLeftButtonif fld "LeftDest" is not empty thenlookup fld "LeftDest", "scroll right slow"elseprevArticleend ifend doArticleLeftButtonon doArticleRightButtonif fld "RightDest" is not empty thenlookup fld "RightDest", "scroll left slow"elsenextArticleend ifend doArticleRightButtonon doArticleUpButtonif fld "UpDest" is not empty thenlookup fld "UpDest", "scroll right"elseprevPageend ifend doArticleUpButtonon doArticleDownButtonif fld "DownDest" is not empty thenlookup fld "DownDest", "scroll left"elsenextPageend ifend doArticleDownButton--------------------------- Popdown Menu Scripts -----------------------------function popMenu itemList, itemCount-- itemCount is the number of items passed by client-- put the paramCountput the short name of this bg into bgNameif bgName is "Access" thenput ",(-,Help,Contents,Index,Print Article,Print Order Form,Quick Search,Quit"¬¨into menuStringelse if bgName is in "Review,Excerpt,Picture" thenput ",(-,Help,Contents,Index,Print Article,(Print Order Form,Quick Search,Quit"¬¨into menuStringelseput ",(-,Help,Contents,Index,(Print Article,(Print Order Form,Quick Search,Quit"¬¨into menuStringend ifput the rect of target into popRectadd 1 to item 3 of popRect        -- compensate for error in XFCN codeput popDown( itemList & menuString, popRect ) into theCommand-- should client handle the command?if theCommand <= itemCountthen RETURN theCommand-- otherwise, we should handle itsubtract itemCount+1 from theCommandif theCommand = 1 thengoHelpelse if theCommand = 2 thengo to card "contents"else if theCommand = 3 thengoIndexelse if theCommand = 4 thenprintArtelse if theCommand = 5 thenprintOrderFormelse if theCommand = 6 thengo to stack "Quick Search"else if theCommand = 7 thendoMenu "Quit Hypercard"end ifreturn 0end popMenuon goWholeEarth-- called by "Earth" buttons and the popdown menusvisual effect checkerboard slowgo to card 2 of stack "WHOLE EARTH"end goWholeEarthon goIndexglobal indexLetterif indexLetter is not in "ABCDEFGHIJKLMNOPQRSTUVWXYZ" thenput "A" into indexLetterend ifvisual effect checkerboard slowdo "go to card" && indexLetter && "of stack Index"end goIndexon printArt-- no user control is offered-- we just print all the cards of the article in successionlock screenset lockRecent to truepush card-- back up jus