home *** CD-ROM | disk | FTP | other *** search
/ The Electronic Whole Earth Catalog / ElectronicWholeEarthCatalog.img / INTRODUCTION / card_2598.txt < prev    next >
Text File  |  1989-02-08  |  14KB  |  608 lines

  1. -- card: 2598 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 2833
  5. -- name: Contents
  6. ----- HyperTalk script -----
  7. -- do not remove
  8. -- cd Contents script
  9. on showMover
  10.   show btn "Put Article"
  11.   show btn "After"
  12.   show btn "PushMover"
  13.   show btn "To Other Stack"
  14.   show btn "Do It"
  15.   show btn "Un/Lock"
  16.   show bg fld "theMover"
  17.   show bg fld "theTarget"
  18. end showMover
  19.  
  20. on hideMover
  21.   hide btn "Put Article"
  22.   hide btn "After"
  23.   hide btn "PushMover"
  24.   hide btn "To Other Stack"
  25.   hide btn "Do It"
  26.   hide btn "Un/Lock"
  27.   hide bg fld "theMover"
  28.   hide bg fld "theTarget"
  29. end hideMover
  30.  
  31.  
  32.  
  33. -- part 50 (button)
  34. -- low flags: 80
  35. -- high flags: 8002
  36. -- rect: left=12 top=0 right=17 bottom=87
  37. -- title width / last selected line: 0
  38. -- icon id / first selected line: 0 / 0
  39. -- text alignment: 1
  40. -- font id: 0
  41. -- text size: 12
  42. -- style flags: 0
  43. -- line height: 16
  44. -- part name: Put Article
  45. ----- HyperTalk script -----
  46. on mouseUp
  47.   put value( the selectedLine ) into bg field "theMover"
  48. end mouseUp
  49.  
  50.  
  51.  
  52. -- part 51 (button)
  53. -- low flags: 80
  54. -- high flags: 8002
  55. -- rect: left=12 top=20 right=38 bottom=53
  56. -- title width / last selected line: 0
  57. -- icon id / first selected line: 0 / 0
  58. -- text alignment: 1
  59. -- font id: 0
  60. -- text size: 12
  61. -- style flags: 0
  62. -- line height: 16
  63. -- part name: After
  64. ----- HyperTalk script -----
  65. on mouseUp
  66.   put value( the selectedLine) into bg field "theTarget"
  67. end mouseUp
  68.  
  69.  
  70.  
  71. -- part 52 (button)
  72. -- low flags: 80
  73. -- high flags: 0000
  74. -- rect: left=380 top=0 right=31 bottom=404
  75. -- title width / last selected line: 0
  76. -- icon id / first selected line: 2730 / 2730
  77. -- text alignment: 1
  78. -- font id: 0
  79. -- text size: 12
  80. -- style flags: 0
  81. -- line height: 16
  82. -- part name: pushMover
  83. ----- HyperTalk script -----
  84. on mouseUp
  85.   put bg field "theMover" into bg field "theTarget"
  86. end mouseUp
  87.  
  88.  
  89.  
  90. -- part 53 (button)
  91. -- low flags: 80
  92. -- high flags: A004
  93. -- rect: left=406 top=0 right=16 bottom=512
  94. -- title width / last selected line: 0
  95. -- icon id / first selected line: 0 / 0
  96. -- text alignment: 1
  97. -- font id: 0
  98. -- text size: 12
  99. -- style flags: 0
  100. -- line height: 16
  101. -- part name: To Other Stack
  102. ----- HyperTalk script -----
  103. on mouseUp
  104.   global lastStack, stackList
  105.   put bkgnd field "theMover" into sourceTitle
  106.   if sourceTitle is empty then
  107.     beep
  108.     put "No Source Title given!"
  109.     exit mouseUp
  110.   end if
  111.   put bkgnd field "theTarget" into targetTitle
  112.   if targetTitle is empty then
  113.     --   beep
  114.     put "No Target Title given!"
  115.     --   exit mouseUp
  116.   end if
  117.   go to first card in background "Review"
  118.   find sourceTitle in bkgnd field "theTitle"
  119.   if the result is "not found" then
  120.     go to card "Contents"
  121.     beep
  122.     put "Source Title not found!" into msg
  123.     exit mouseUp
  124.   end if
  125.   put bkgnd field "theTitle" into sourceTitle2
  126.   put empty into sourceIds
  127.   repeat while sourceTitle2 is in bkgnd field "theTitle"
  128.     get the id of this card
  129.     put it & return after sourceIds
  130.     go to next card
  131.     if number of this card is 1 then exit repeat
  132.   end repeat
  133.   repeat
  134.     go to card "Contents"
  135.     answer "Found" && number of lines in sourceIds && "cards to move." with "Cancel" or "Review" or "OK"
  136.     if it is "Cancel" then exit mouseUp
  137.     if it is "OK" then exit repeat
  138.     repeat with thisID = 1 to number of lines in sourceIds
  139.       go to (line thisID of sourceIds)
  140.     end repeat
  141.   end repeat
  142.   -- start new code
  143.   repeat
  144.     Ask "Domain Number of target stack?" with lastStack
  145.     if it is empty then exit mouseUp
  146.     put it into targStackNum
  147.     if length( targStackNum ) < 2 then put "0" before targStackNum
  148.     put item it of stackList into targetStack
  149.     put it into lastStack
  150.     put id of this card into testID
  151.     push card
  152.     go to stack targetStack
  153.     if id of this card is testID then
  154.       beep
  155.       put "Stack not found"
  156.       pop card
  157.     else
  158.       exit repeat
  159.     end if
  160.   end repeat
  161.   go to first card in background "Review"
  162.   if targetTitle is empty then
  163.     go to last card
  164.     put field "theTitle" into targetTitle
  165.   else
  166.     find targetTitle in bkgnd field "theTitle"
  167.     if the result is "not found" then
  168.       go to card "Contents"
  169.       beep
  170.       put "Target Title not found!" into msg
  171.       pop card
  172.       exit mouseUp
  173.     end if
  174.   end if
  175.   put bkgnd field "theTitle" into targetTitle2
  176.   repeat while bkgnd field "theTitle" is targetTitle2
  177.     get the id of this card
  178.     put it into targetID
  179.     go to next card
  180.     if number of this card is 1 then exit repeat
  181.   end repeat
  182.   go to (targetId)
  183.   answer "Put them after this card?" with "Cancel" or "OK"
  184.   if it is "Cancel" then
  185.     pop card
  186.     exit mouseUp
  187.   end if
  188.  
  189.   pop card
  190.   -- now to actually move the cards
  191.   repeat with thisId = 1 to number of lines in sourceIds
  192.     put (line thisId of sourceIds) into srcCard
  193.     go to srcCard
  194.     lock screen
  195.     put the short name of this bkgnd into thisBkgnd
  196.     put getFields() into fieldCount
  197.     put "fc: " & fieldCount
  198.  
  199.     push card
  200.  
  201.     -- go get blank template card for this bg
  202.     do ("go to first card of bkgnd" && thisBkgnd && "of stack" && targetStack)
  203.     doMenu Copy Card
  204.     go to targetId
  205.     doMenu Paste Card
  206.     get the long id of this card
  207.     put it into targetId
  208.  
  209.     putFields fieldCount
  210.     put targetStack into bg field "theTopic"
  211.     put targStackNum & char 3 to length( field accession) of field accession into field accession
  212.  
  213.     if field "theIdent" is "access" then
  214.       if field surveyAccession is not empty then
  215.         put targStackNum & char 3 to length( field surveyAccession) of field surveyAccession into field surveyAccession
  216.       end if
  217.     end if
  218.     -- move graphic, if appropriate
  219.     if thisBkgnd is in "access,picture" then
  220.       pop card
  221.       -- horrible kluge...
  222.       -- make a speck on the card picture, so we never copy a blank pict
  223.       choose pencil tool
  224.       click at 280,180  -- where there's prob'ly some graphic already
  225.       -- we unmake the speck with another pencil click
  226.       -- our card looks the same as originally, but is guaranteed to
  227.       -- have a nonempty card picture
  228.       click at 280,180
  229.       choose select tool
  230.       domenu "Select All"
  231.       doMenu "Copy Picture"
  232.       push card
  233.       go to targetId
  234.       doMenu "Paste Picture"
  235.       choose browse tool
  236.       -- make it transparent in all cases EXCEPT when fullScreen picture
  237.       put no into decision
  238.       if thisBkgnd is "access"
  239.       then put yes into decision
  240.     else if thisBkgnd is "picture" then
  241.       -- put "fs: " & field "fullScreen"
  242.       if field "fullScreen" is empty
  243.       then put yes into decision
  244.     end if
  245.     if decision is "yes" then
  246.       choose select tool
  247.       domenu "Select All"
  248.       doMenu "transparent"
  249.       choose browse tool
  250.     end if
  251.   end if
  252.   unlock screen
  253.   pop card
  254. end repeat
  255.  
  256. -- update both TOC
  257. go to card "Contents"
  258. put offset (sourceTitle, bkgnd field "theContents") into sourceOff
  259. if sourceOff is 0 then
  260.   beep
  261.   put "Regenerate Contents of Source!"
  262. else
  263.   delete char sourceOff to (sourceOff + length(sourceTitle) - 1) of bkgnd field "theContents"
  264.   if char sourceOff of bkgnd field "theContents" is return then
  265.     delete char sourceOff of bkgnd field "theContents"
  266.   end if
  267.   if last char of sourceTitle is not return then put return after sourceTitle
  268. end if
  269. push card
  270. go to card "Contents" of stack targetStack
  271. put offset(targetTitle, bkgnd field "theContents") into targetOff
  272. if targetOff is 0 then
  273.   beep
  274.   put "Regenerate Contents of Target!"
  275.   pop card
  276.   exit mouseUp
  277. end if
  278. add length(targetTitle) to targetOff
  279. if char targetOff of bkgnd field "theContents" is return then add 1 to targetOff
  280. put sourceTitle before char targetOff of bkgnd field "theContents"
  281. pop card
  282. end mouseUp
  283.  
  284. function getFields
  285. global nameList
  286. global fContents
  287.  
  288. put empty into nameList
  289. put empty into fContents
  290.  
  291. put the number of bg fields into bgfc
  292. repeat with f = 1 to bgfc
  293.   put the name of bg field f & tab after nameList
  294.   put bg field f & tab after fContents
  295. end repeat
  296.  
  297. put the number of card fields into crdfc
  298. repeat with f = 1 to crdfc
  299.   put the name of card field f & tab after nameList
  300.   put card field f & tab after fContents
  301. end repeat
  302.  
  303. return bgfc + crdfc
  304. end getFields
  305.  
  306. on putFields fCounts
  307.   global nameList
  308.   global fContents
  309.  
  310.   put first item of fCounts into bgfc
  311.   put last item of fCounts into crdfc
  312.   repeat with f = 1 to bgfc
  313.     put pullName() into fName
  314.     put fName
  315.     do "put pullContents() into " & fName
  316.   end repeat
  317.  
  318. end putFields
  319.  
  320. function pullContents
  321. -- returns tab-delimited chunk from global fContents
  322. -- deletes it from global fContents, too
  323. global fContents
  324. put offset( tab, fContents ) into tabSpot
  325. if tabSpot > 0 then
  326.   get char 1 to tabSpot-1 of fContents
  327.   delete char 1 to tabSpot of fContents
  328.   return it
  329. end if
  330. return empty
  331. end pullContents
  332.  
  333. function pullName
  334. -- returns tab-delimited chunk from global nameList
  335. -- deletes it from global nameList, too
  336. global nameList
  337. put offset( tab, nameList ) into tabSpot
  338. if tabSpot > 0 then
  339.   get char 1 to tabSpot-1 of nameList
  340.   delete char 1 to tabSpot of nameList
  341.   return it
  342. end if
  343. return empty
  344. end pullName
  345.  
  346.  
  347.  
  348.  
  349. -- part 54 (button)
  350. -- low flags: 80
  351. -- high flags: A004
  352. -- rect: left=406 top=16 right=32 bottom=512
  353. -- title width / last selected line: 0
  354. -- icon id / first selected line: 0 / 0
  355. -- text alignment: 1
  356. -- font id: 0
  357. -- text size: 12
  358. -- style flags: 0
  359. -- line height: 16
  360. -- part name: Do It
  361. ----- HyperTalk script -----
  362. on mouseUp
  363.   put bkgnd field "theMover" into sourceTitle
  364.   if sourceTitle is empty then
  365.     beep
  366.     put "No Source Title given!"
  367.     exit mouseUp
  368.   end if
  369.   put bkgnd field "theTarget" into targetTitle
  370.   if targetTitle is empty then
  371.     beep
  372.     put "No Target Title given!"
  373.     exit mouseUp
  374.   end if
  375.   go to first card in background "Review"
  376.   find sourceTitle in bkgnd field "theTitle"
  377.   if the result is "not found" then
  378.     go to card "Contents"
  379.     beep
  380.     put "Source Title not found!" into msg
  381.     exit mouseUp
  382.   end if
  383.   put bkgnd field "theTitle" into sourceTitle2
  384.   put empty into sourceIds
  385.   repeat while sourceTitle2 is in bkgnd field "theTitle"
  386.     get the id of this card
  387.     put it & return after sourceIds
  388.     go to next card
  389.     if number of this card is 1 then exit repeat
  390.   end repeat
  391.   repeat
  392.     go to card "Contents"
  393.     answer "Found" && number of lines in sourceIds && "cards to move." with "Cancel" or "Review" or "OK"
  394.     if it is "Cancel" then exit mouseUp
  395.     if it is "OK" then exit repeat
  396.     repeat with thisID = 1 to number of lines in sourceIds
  397.       go to (line thisID of sourceIds)
  398.     end repeat
  399.   end repeat
  400.   go to first card in background "Review"
  401.   find targetTitle in bkgnd field "theTitle"
  402.   if the result is "not found" then
  403.     go to card "Contents"
  404.     beep
  405.     put "Target Title not found!" into msg
  406.     exit mouseUp
  407.   end if
  408.   put bkgnd field "theTitle" into targetTitle2
  409.   repeat while bkgnd field "theTitle" is targetTitle2
  410.     get the id of this card
  411.     put it into targetID
  412.     go to next card
  413.     if number of this card is 1 then exit repeat
  414.   end repeat
  415.   go to (targetId)
  416.   answer "Put them after this card?" with "Cancel" or "OK"
  417.   if it is "Cancel" then exit mouseUp
  418.   push card
  419.   repeat with thisId = 1 to number of lines in sourceIds
  420.     go to (line thisId of sourceIds)
  421.     doMenu Cut Card
  422.     pop card
  423.     doMenu Paste Card
  424.     push card
  425.   end repeat
  426.   pop card
  427.   go to card "Contents"
  428.   put offset (sourceTitle, bkgnd field "theContents") into sourceOff
  429.   if sourceOff is 0 then
  430.     beep
  431.     put "Regenerate Contents!"
  432.     exit mouseUp
  433.   end if
  434.   delete char sourceOff to (sourceOff + length(sourceTitle) - 1) of bkgnd field "theContents"
  435.   if char sourceOff of bkgnd field "theContents" is return then
  436.     delete char sourceOff of bkgnd field "theContents"
  437.   end if
  438.   if last char of sourceTitle is not return then put return after sourceTitle
  439.   put offset(targetTitle, bkgnd field "theContents") into targetOff
  440.   if targetOff is 0 then
  441.     beep
  442.     put "Regenerate Contents!"
  443.     exit mouseUp
  444.   end if
  445.   add length(targetTitle) to targetOff
  446.   if char targetOff of bkgnd field "theContents" is return then add 1 to targetOff
  447.   put sourceTitle before char targetOff of bkgnd field "theContents"
  448. end mouseUp
  449.  
  450.  
  451.  
  452. -- part 55 (button)
  453. -- low flags: 80
  454. -- high flags: A004
  455. -- rect: left=406 top=32 right=48 bottom=512
  456. -- title width / last selected line: 0
  457. -- icon id / first selected line: 0 / 0
  458. -- text alignment: 1
  459. -- font id: 0
  460. -- text size: 12
  461. -- style flags: 0
  462. -- line height: 16
  463. -- part name: Un/Lock
  464. ----- HyperTalk script -----
  465. on mouseUp
  466.   get the lockText of fld "theContents"
  467.   if it is false then
  468.     set the lockText of fld "theContents" to true
  469.   else
  470.     set the lockText of fld "theContents" to false
  471.   end if
  472. end mouseUp
  473.  
  474.  
  475.  
  476. -- part contents for background part 6
  477. ----- text -----
  478. Contents
  479.  
  480. -- part contents for background part 11
  481. ----- text -----
  482. Menu
  483.  
  484. -- part contents for background part 17
  485. ----- text -----
  486. INTRODUCTION CONTENTS
  487.  
  488. -- part contents for background part 33
  489. ----- text -----
  490. card id 66833
  491. card id 64901
  492. card id 8560
  493. card id 17724
  494. card id 2461
  495. card id 16098
  496. card id 5154
  497. card id 20722
  498. card id 57549
  499. card id 44130
  500. card id 44712
  501. card id 18482
  502. card id 48259
  503. card id 63588
  504. card id 63823
  505. card id 26630
  506. card id 29354
  507. card id 33037
  508. card id 40838
  509. card id 51937
  510. card id 17998
  511. card id 65919
  512. card id 39834
  513. card id 40507
  514.  
  515.  
  516. -- part contents for background part 34
  517. ----- text -----
  518. 12115519
  519. 12095003
  520. 12095105
  521. 12095116
  522. 12095127
  523. 12095138
  524. 12095150
  525. 12095149
  526. 12095401
  527. 12095412
  528. 12095423
  529. 12095445
  530. 12095536
  531. 12097005
  532. 12097107
  533. 12114676
  534. 12114687
  535. 12114698
  536. 12114723
  537. 12114712
  538. 12114734
  539. 12097209
  540. 12097210
  541. 12097221
  542.  
  543.  
  544. -- part contents for background part 35
  545. ----- text -----
  546. 1
  547. 2
  548. 3
  549. 4
  550. 4
  551. 4
  552. 4
  553. 4
  554. 3
  555. 4
  556. 4
  557. 4
  558. 4
  559. 2
  560. 3
  561. 4
  562. 4
  563. 4
  564. 4
  565. 4
  566. 4
  567. 3
  568. 4
  569. 4
  570.  
  571.  
  572. -- part contents for background part 18
  573. ----- text -----
  574. INTRODUCTION
  575.   ABOUT THE DISC
  576.     Genesis and Purpose
  577.       The Whole Earth Catalog
  578.       PURPOSE
  579.       FUNCTION
  580.       ORDERING INFORMATION
  581.       ORIGIN OF THE SPECIES & EVOLUTION THROUGH THE AGES
  582.     Staff and Business
  583.       STAFF
  584.       THANK YOUS
  585.       BUSINESS
  586.       FURTHER
  587.   HELP
  588.     First Time Help
  589.       GETTING AROUND IN THE DISC
  590.       CONTENTS AND INDEX
  591.       QUICK SEARCH
  592.       PICTURES AND SOUND
  593.       THE PULL DOWN MENU
  594.       MORE ABOUT QUICK SEARCH
  595.     Practice Navigating
  596.       FIRST PRACTICE ARTICLE
  597.       SECOND PRACTICE ARTICLE
  598.  
  599.  
  600. -- part contents for background part 38
  601. ----- text -----
  602. ‚Ä¢ WHOLE EARTH
  603.  ‚Ä¢ INTRODUCTION
  604.  
  605. -- part contents for background part 39
  606. ----- text -----
  607. stack "WHOLE EARTH"
  608. stack "INTRODUCTION"