home *** CD-ROM | disk | FTP | other *** search
/ Netscape Plug-Ins Developer's Kit / Netscape_Plug-Ins_Developers_Kit.iso / EDITORS / grinder / wheels / linker.hqx / sequential_linker.hqx / background_3885.xml next >
Encoding:
Extensible Markup Language  |  1995-09-29  |  6.3 KB  |  44 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
  3. <background>
  4.     <id>3885</id>
  5.     <filler1>0</filler1>
  6.     <cantDelete> <false /> </cantDelete>
  7.     <showPict> <true /> </showPict>
  8.     <dontSearch> <false /> </dontSearch>
  9.     <link rel="stylesheet" type="text/css" href="stylesheet_3279.css" />
  10.     <part>
  11.         <id>5</id>
  12.         <type>button</type>
  13.         <visible> <true /> </visible>
  14.         <reserved5> 0 </reserved5>
  15.         <reserved4> 0 </reserved4>
  16.         <reserved3> 0 </reserved3>
  17.         <reserved2> 0 </reserved2>
  18.         <reserved1> 0 </reserved1>
  19.         <enabled> <true /> </enabled>
  20.         <rect>
  21.             <left>0</left>
  22.             <top>279</top>
  23.             <right>17</right>
  24.             <bottom>296</bottom>
  25.         </rect>
  26.         <style>opaque</style>
  27.         <showName> <false /> </showName>
  28.         <highlight> <false /> </highlight>
  29.         <autoHighlight> <true /> </autoHighlight>
  30.         <sharedHighlight> <true /> </sharedHighlight>
  31.         <family>0</family>
  32.         <titleWidth>0</titleWidth>
  33.         <icon>29540</icon>
  34.         <textAlign>center</textAlign>
  35.         <font>Chicago</font>
  36.         <textSize>12</textSize>
  37.         <textStyle>plain</textStyle>
  38.         <name>Help</name>
  39.         <script>on mouseUp
  40. fullhelp
  41. end mouseUp
  42.  
  43. on mouseenter
  44. helper "Click here for more help for HTML Grinder."
  45. end mouseenter</script>
  46.     </part>
  47.     <name></name>
  48.     <script>on process
  49. global allfiles
  50. put cd fld tocpage into tocFile
  51. put length(cd fld delimiter) into delLong
  52. put the number of lines in allfiles into numfiles
  53. get windowscript("Grinding...")
  54. set thermometer_max of window "Grinding..." to numfiles
  55. repeat with x = 1 to the number of lines in allfiles
  56. set the cursor to busy
  57. put line x of allfiles into thisFile
  58. put line x-1 of allfiles into prevfile
  59. put line x+1 of allfiles into nextfile
  60. --
  61. --create the links
  62. if prevfile is not empty and cd fld prevText is not empty then
  63. put relativepath(thisfile,prevFile) into prevFile
  64. put "<a href="&quote& prevFile &quote&">"&cd fld prevtext&"</a>" into prever
  65. else put empty into prever
  66. --
  67. if tocfile is not empty and cd fld returntext is not empty ┬¼
  68. and the hilite of cd btn "use table of contents page" is true then
  69. put relativepath(thisfile,tocFile) into relTocFile
  70. put "<a href="&quote&relTocFile&quote&">"&cd fld returnText&"</a>" into toccer
  71. else put empty into toccer
  72. --
  73. if nextfile is not empty and cd fld nextText is not empty then
  74. put relativepath(thisfile,nextFile) into nextFile
  75. put "<a href="&quote&nextfile&quote&">"&cd fld nextText&"</a>" into nexter
  76. else put empty into nexter
  77. --
  78. --format the links
  79. put "<!--Sequential Linkers-->"&return into addendum
  80. if prever is not empty
  81. then put prever&cd fld delimiter after addendum
  82. if toccer is not empty
  83. then put toccer&cd fld delimiter after addendum
  84. if nexter is not empty
  85. then put nexter&cd fld delimiter after addendum
  86. repeat dellong times
  87. delete last char of addendum
  88. end repeat
  89. put return&"<!--End of Sequential Linkers-->" after addendum
  90. --
  91. --get the old file
  92. if there is no file thisfile then
  93. beep
  94. next repeat
  95. end if
  96. open file thisfile
  97. read from file thisFile until eof
  98. close file thisfile
  99. put it into thecontents
  100. --
  101. --create the new file
  102. get search(thecontents,"<!--Sequential Linkers-->",true)
  103. put item 1 of it into startline
  104. get search(thecontents,"<!--End of Sequential Linkers-->",true)
  105. put item 1 of it into endline
  106. if startline is empty or endline is empty then
  107. put word 2 of the selectedline of cd btn append into appendo
  108. if appendo is 1
  109. then put "0" into chartouche
  110. else if appendo is 2
  111. then put length(thecontents) into chartouche
  112. else if appendo is 3
  113. then put fulloffset(thecontents,cd fld texto,starter) into chartouche
  114. else if appendo is 4
  115. then put fulloffset(thecontents,cd fld texto,ender) into chartouche
  116. if chartouche is not "error" then
  117. if appendo is 1
  118. then put addendum &return&return after char chartouche of thecontents
  119. else put return&return& addendum &return&return after char chartouche of thecontents
  120. else put return& addendum after thecontents
  121. else put addendum into line startline to endline of thecontents
  122. replacefile thisfile,thecontents
  123. if iconnum =1
  124. then put 3 into iconnum
  125. else put 1 into iconnum
  126. set thermometer_value of window "grinding..." to x
  127. set i3_name of window "grinding..." to "grinder"&iconnum
  128. end repeat
  129. close window "grinding..."
  130. alldone
  131. end process
  132.  
  133. function fulloffset thecontents,thetext,whichway
  134. put thecontents into cd fld holding
  135. find string thetext in cd fld holding
  136. if the result is not empty then return "ERROR"
  137. else if whichway is starter
  138. then return (word 2 of the foundchunk) -1
  139. else return (word 4 of the foundchunk)
  140. end fulloffset
  141.  
  142. on enterkey
  143. set the hilite of cd btn "link pages" to true
  144. wait 5
  145. set the hilite of cd btn "link pages" to false
  146. send mouseup to cd btn "link pages"
  147. end enterkey
  148.  
  149. on converter thefile,thecontents
  150. put cd fld startTag into thestart
  151. put cd fld endTag into theEnd
  152. get search(thecontents,thestart,true)
  153. if it is empty then exit converter
  154. put item 1 of it into startline
  155. get search(thecontents,theEnd,true)
  156. if it is empty then exit converter
  157. put item 1 of it into endline
  158. put thestart&return&cd fld thetext&return&theEnd into replacer
  159. put replacer into line startline to endline of thecontents
  160. ReplaceFile thefile,thecontents
  161. end converter
  162.  
  163. function lastchar thecontents,tagaware
  164. put thecontents into cd fld holding
  165. if tagaware then
  166. find string "<!--footer-->" in cd fld holding
  167. if the result is not empty then
  168. find string "</html>" in cd fld holding
  169. if the result is not empty
  170. then put length(cd fld holding) into chunky
  171. else put (word 2 of the foundchunk)-1 into chunky
  172. else put (word 2 of the foundchunk)-1 into chunky
  173. else put length(cd fld holding) into chunky
  174. put empty into cd fld holding
  175. return chunky
  176. end lastchar
  177.  
  178. function firstchar thecontents,tagaware
  179. put thecontents into cd fld holding
  180. if tagaware then
  181. find string "<body>" in cd fld holding
  182. if the result is not empty then
  183. find string "</head>" in cd fld holding
  184. if the result is not empty then
  185. find string "</title>" in cd fld holding
  186. if the result is not empty
  187. then put "0" into chunky
  188. else put word 4 of the foundchunk into chunky
  189. else put word 4 of the foundchunk into chunky
  190. else put word 4 of the foundchunk into chunky
  191. else put "0" into chunky
  192. put empty into cd fld holding
  193. return chunky
  194. end firstchar</script>
  195. </background>
  196.