Pass iceRoot in config, set in func, update display

This commit is contained in:
mattpass
2020-12-23 17:26:31 +00:00
parent 3f0604fff4
commit 2e7e5a8bcd
3 changed files with 7 additions and 3 deletions

View File

@@ -3691,6 +3691,10 @@ var ICEcoder = {
useNewSettings: function(settings) {
let styleNode, thisCSS, strCSS, activeLineBG;
// Set iceRoot and update in settings display
iceRoot = settings.iceRoot;
this.content.contentWindow.document.getElementById('iceRootDisplay').innerText = "" !== iceRoot ? iceRoot : "[Default]";
// Cut out path prefix, .css file extension and ?microtime= querystring
const newTheme = settings.themeURL.replace(/.+\/|.css.+/g, "");
// If theme was not changed - no need to do all these tricks

View File

@@ -115,7 +115,7 @@ h2 {color: rgba(0,198,255,0.7)}
<span class="heading"><?php echo $t['Root'];?></span><br>
<?php echo $docRoot;?><br><br>
<span class="heading"><?php echo $t['ICEcoder root'];?></span><br>
<?php echo "" !== $iceRoot ? $iceRoot : "[Default]";?><br><br>
<div id="iceRootDisplay"><?php echo "" !== $iceRoot ? $iceRoot : "[Default]";?></div><br><br>
<span class="heading"><?php echo $t['PHP version'];?></span><br>
<?php echo phpversion();?><br><br>
<span class="heading"><?php echo $t['Date & time'];?></span><br>

View File

@@ -119,6 +119,7 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S
// With all that worked out, we can now hide the settings screen and apply the new settings
$jsBugFilePaths = "['" . str_replace(",", "','", str_replace(" ", "", $_POST['bugFilePaths'])) . "']";
echo "<script>parent.ICEcoder.settingsScreen(true); parent.ICEcoder.useNewSettings({" .
"iceRoot: '" . $ICEcoder["root"] . "', " .
"themeURL: '" . $themeURL . "', " .
"codeAssist: " . (true === $ICEcoder["codeAssist"] ? "true" : "false") . ", " .
"lockedNav: " . (true === $ICEcoder["lockedNav"] ? "true" : "false") . ", " .
@@ -143,6 +144,5 @@ if (false === $demoMode && true === isset($_SESSION['loggedIn']) && true === $_S
"updateDiffOnSave: " . (true === $ICEcoder["updateDiffOnSave"] ? "true" : "false") . ", " .
"autoLogoutMins: " . $ICEcoder["autoLogoutMins"] . ", " .
"refreshFM: " . $refreshFM .
"}); iceRoot = '" . $ICEcoder["root"] .
"';</script>";
"});</script>";
}