new 'init' section for events file, executed at each reload

This commit is contained in:
Massimo Melina 2020-06-16 23:13:22 +02:00
parent 07f5f2ca6b
commit 65d4a142e4

View File

@ -1,4 +1,4 @@
{
{
Copyright (C) 2002-2020 Massimo Melina (www.rejetto.com)
This file is part of HFS ~ HTTP File Server.
@ -7867,7 +7867,12 @@ finally freeAndNIL(info) end;
end; // autoCheckUpdates
procedure loadEvents();
begin eventScripts.fullText:=loadTextFile(cfgpath+EVENTSCRIPTS_FILE) end;
begin
if not newMtime(cfgpath+EVENTSCRIPTS_FILE, eventScriptsLast) then
exit;
eventScripts.fullText:=loadTextFile(cfgpath+EVENTSCRIPTS_FILE);
runEventScript('init');
end;
procedure Tmainfrm.updateCopyBtn();
resourcestring
@ -8124,8 +8129,6 @@ var
updateCopyBtn();
keepTplUpdated();
updateCurrentCFG();
if newMtime(cfgpath+EVENTSCRIPTS_FILE, eventScriptsLast) then
loadEvents();
if assigned(runScriptFrm) and runScriptFrm.visible