From 47d886d7b15ec88714b8a44ade59cb7e575a4b36 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Sat, 21 Sep 2019 23:39:43 +0100 Subject: [PATCH] JS saved process example added --- processes/on-file-save.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/processes/on-file-save.php b/processes/on-file-save.php index 6d20dc1..8e4baf5 100644 --- a/processes/on-file-save.php +++ b/processes/on-file-save.php @@ -3,7 +3,7 @@ if (!isset($_SESSION['loggedIn'])) { die('Sorry, not logged in.'); } // Purpose: This file is run when a user saves a file, has $fileLoc and $fileName strings available to it -// Langs: PHP only +// Langs: PHP (tho can concat JS within $doNext string, see below) // Example: // $fh = fopen(dirname(__FILE__)."/../file-dir-access.log", 'a'); // fwrite($fh, "SAVE >>> ".date("D dS M Y h:i:sa").": ".$fileLoc."/".$fileName."\n"); @@ -51,3 +51,6 @@ if (strtolower($fileExt) == "less" && file_exists(dirname(__FILE__)."/../plugins echo ";top.ICEcoder.message('Couldn\'t compile your LESS, error info below:\\n\\n".$e->getMessage()."');"; } } + +// If JS is needed, add within $doNext string below, eg $doNext .= ";alert('saved');"; +$doNext .= "";