From 1404b49412f8df1abbebc2923a48ce5cf9397df9 Mon Sep 17 00:00:00 2001 From: Yakov Litvin Date: Tue, 19 Dec 2023 11:24:53 +0300 Subject: [PATCH] codestyle: move some inline comments to separate lines --- index.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index 9213a1b..174359a 100644 --- a/index.php +++ b/index.php @@ -211,7 +211,8 @@ + set dirty: false on saving response, not when sending request */ -$injectedJsHelpers = 'function isGranulatedSavingSupported() { // TW v2.8.0 and above where recreateOriginal is finished and used +$injectedJsHelpers = '// TW v2.8.0 and above where recreateOriginal is finished and used +function isGranulatedSavingSupported() { return version.major > 2 || (version.major == 2 && version.minor >= 8); } @@ -737,7 +738,8 @@ function hasHtmlLikeExtension($nameOrPath) { or substr_compare($nameOrPath, ".htm", -4, 4) == 0 or substr_compare($nameOrPath, ".hta", -4, 4) == 0; } -function isTwLike($file_full_path_and_name) { // doesn't allow PureStore for now +// doesn't support PureStore yet +function isTwLike($file_full_path_and_name) { if(!hasHtmlLikeExtension($file_full_path_and_name)) return false; @@ -1120,8 +1122,9 @@ function showWikisOrWiki() { function showDocPage() { } -// reads TW, applies changes, saves back; returns 0 on success and error text otherwise (not quite: see //#) -function updateTW($wikiPath, $changes) { // TW-format-gnostic +// reads TW, applies changes, saves back (TW-format-gnostic) +// returns 0 on success and error text otherwise (not quite: see //#) +function updateTW($wikiPath, $changes) { if($changes == new stdClass()) // no changes return 'no changes, nothing to save'; @@ -1347,7 +1350,8 @@ function getFullWikiLink($nameOrPath) { //# .oO can removeInjectedJsFromWiki fail? $error = lock_and_write_file($wikiPath, $content); echo $error ? $error : 'saved'; - } else { // incremental saving from the saveChanges request + } else { + // incremental saving from the saveChanges request $changesJSON = $_POST['saveChanges']; $changes = json_decode($changesJSON); $errors = updateTW($wikiPath, $changes);