tabNum and formatting updates

This commit is contained in:
mattpass
2020-06-25 18:11:30 +01:00
parent ff55ce6425
commit d319095b6a
4 changed files with 10 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ class FTP
}
public function writeFile() {
global $fileLoc, $fileName, $ftpConn, $ftpRoot, $ftpHost, $ftpMode, $ICEcoder, $doNext, $filemtime;
global $fileLoc, $fileName, $ftpConn, $ftpRoot, $ftpHost, $ftpMode, $ICEcoder, $doNext, $filemtime, $tabNum;
$ftpFilepath = ltrim($fileLoc . "/" . $fileName, "/");
if (isset($_POST['changes'])) {
@@ -56,8 +56,8 @@ class FTP
if (!$this->ftpWriteFile($ftpConn, $ftpFilepath, $contents, $ftpMode)) {
$doNext .= 'ICEcoder.message("Sorry, could not write ' . $ftpFilepath . ' at ' . $ftpHost . '");';
} else {
$doNext .= 'ICEcoder.openFileMDTs[ICEcoder.selectedTab - 1]="' . $filemtime . '";';
$doNext .= '(function() {var x = ICEcoder.openFileVersions; var y = ICEcoder.selectedTab-1; x[y] = "undefined" != typeof x[y] ? x[y] + 1 : 1})(); ICEcoder.updateVersionsDisplay();';
$doNext .= 'ICEcoder.openFileMDTs[' . ($tabNum - 1) .']="' . $filemtime . '";';
$doNext .= '(function() {var x = ICEcoder.openFileVersions; var y = ' . ($tabNum - 1) .'; x[y] = "undefined" != typeof x[y] ? x[y] + 1 : 1})(); ICEcoder.updateVersionsDisplay();';
}
}

View File

@@ -335,7 +335,7 @@ class File
}
}, 10);' .
($newFileAutoSave
? '} else {ICEcoder.closeTab(ICEcoder.selectedTab, "dontSetPV", "dontAsk");'
? '} else {ICEcoder.closeTab(' . $tabNum . ', "dontSetPV", "dontAsk");'
: ''
) .
'};
@@ -646,7 +646,7 @@ class File
ICEcoder.savedPoints[' . ($tabNum - 1) .'] = cM.changeGeneration();
ICEcoder.savedContents[' . ($tabNum - 1) .'] = cM.getValue();
ICEcoder.redoTabHighlight(' . $tabNum .');
ICEcoder.switchTab(ICEcoder.selectedTab);';
ICEcoder.switchTab(' . $tabNum . ');';
return $doNext;
}

View File

@@ -209,7 +209,7 @@ if (!isset($_GET['timestamp']) || !isset($prevIndexData["timestamps"]) || $_GET[
// If we have a data/git-diff.php file
if (file_exists($docRoot . $ICEcoderDir . "/data/git-diff.php")) {
// Get serialized array back out of PHP file inside a comment block as git data for git diff display
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/git-diff.php");
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/git-diff.php");
$gitDiffData = file_get_contents($docRoot . $ICEcoderDir . "/data/git-diff.php");
if (strpos($gitDiffData, "<?php") !== false) {
$gitDiffData = str_replace("<?php\n/*\n\n", "", $gitDiffData);
@@ -222,7 +222,7 @@ if (!isset($_GET['timestamp']) || !isset($prevIndexData["timestamps"]) || $_GET[
// If we have a data/git-content.php file
if (file_exists($docRoot . $ICEcoderDir . "/data/git-content.php")) {
// Get serialized array back out of PHP file inside a comment block as git data for git content usage
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/git-content.php");
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/git-content.php");
$gitContent = file_get_contents($docRoot . $ICEcoderDir . "/data/git-content.php");
if (strpos($gitContent, "<?php") !== false) {
$gitContent = str_replace("<?php\n/*\n\n", "", $gitContent);

View File

@@ -106,7 +106,7 @@ function getData($url, $type='fopen', $dieMessage = false, $timeout = 60) {
'timeout' => $timeout // secs
)
));
$systemClass->invalidateOPCache($url);
$systemClass->invalidateOPCache($url);
$data = @file_get_contents($url, false, $context);
if (!$data) {
$data = @file_get_contents(str_replace("https:", "http:", $url), false, $context);
@@ -132,7 +132,7 @@ function requireReIndexNextTime() {
global $docRoot, $ICEcoderDir, $systemClass;
if (true === file_exists($docRoot . $ICEcoderDir . "/data/index.php")) {
// Get serialized array back out of PHP file inside a comment block as prevIndexData
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/index.php");
$systemClass->invalidateOPCache($docRoot . $ICEcoderDir . "/data/index.php");
$prevIndexData = file_get_contents($docRoot . $ICEcoderDir . "/data/index.php");
if (strpos($prevIndexData, "<?php") !== false) {
$prevIndexData = str_replace("<?php\n/*\n\n", "", $prevIndexData);
@@ -357,7 +357,7 @@ function serializedFileData($do, $path, $output=null) {
global $systemClass;
if ($do === "get") {
$systemClass->invalidateOPCache($path);
$systemClass->invalidateOPCache($path);
$data = file_get_contents($path);
$data = str_replace("<"."?php\n/*\n\n", "", $data);
$data = str_replace("\n\n*/\n?".">", "", $data);