local (now = clock.now ())
siteChanges.init ()
local (adroutline = @user.sitechanges.outline)
bundle «set up the outline
if not defined (adroutline^)
new (outlinetype, adroutline)
target.set (adroutline)
op.firstSummit ()
if op.getlinetext () == ""
op.setlinetext (now)
else
op.insert (now + " " + user.siteChanges.timeZone, up)
edit (adroutline)
bundle «update the outline
local (insertdir = right)
on checkFolder (folder)
local (f)
fileloop (f in folder)
if file.isfolder (f)
if file.modified (f) > user.siteChanges.lastRefresh
msg (f)
checkFolder (f)
else
if f endswith ".html"
local (moddate = file.modified (f))
if moddate > user.siteChanges.lastRefresh
local (s = f - user.siteChanges.siteFolder)
s = "http://" + user.siteChanges.siteURL + string.replaceall (s, ":", "/")
op.insert (s, insertdir)
insertdir = down
op.insert (moddate + " " + user.siteChanges.timeZone, right)
op.go (left, 1)
rollbeachball ()
checkFolder (user.siteChanges.siteFolder)
op.firstSummit ()
target.clear ()
user.siteChanges.lastRefresh = now
bundle «write out the text file
local (f = user.siteChanges.siteFolder + "siteChanges.txt")
local (s = string (adroutline^))
local (created)
if file.exists (f)
created = file.created (f)
else
created = clock.now ()
toys.writeWholeFile (f, s, 'TEXT', user.siteChanges.textFileCreator, created)