Skip to content
Permalink
Browse files

build diffs/previews: treat txt as text files

  • Loading branch information...
bloerwald committed Aug 12, 2019
1 parent ab99240 commit 0918d56a2f299ce856cdd8027f0e836cc0217f45
Showing with 2 additions and 1 deletion.
  1. +1 −0 builds/diff_new.php
  2. +1 −1 files/scripts/preview_api.php
@@ -137,6 +137,7 @@ function actionToBadge(action){
case "lua":
case "sbt":
case "toc":
case "txt":
case "xml":
case "xsd":
content = "<a style='cursor: pointer' data-toggle='modal' data-target='#previewModal' onClick='fillDiffModal(\"<?= $fromBuild['hash'] ?>\", \"<?= $toBuild['hash'] ?>\", \"" + full.id + "\")'>Preview</a>";
@@ -78,7 +78,7 @@ function downloadFile($params, $outfile){
<div class="tab-pane" id="raw" role="tabpanel" aria-labelledby="raw-tab"><pre style='max-height: 500px;'><code><?=htmlentities($output)?></pre></code></div>
</div>
<?php
}else if($type == "xml" || $type == "xsd" || $type == "lua" || $type == "toc" || $type == "htm" || $type == "html" || $type == "sbt"){
}else if($type == "xml" || $type == "xsd" || $type == "lua" || $type == "toc" || $type == "htm" || $type == "html" || $type == "sbt" || $type == "txt"){
echo "<pre style='max-height: 500px;'><code>".htmlentities(file_get_contents($tempfile))."</pre></code>";
}else{
// dump via hd

0 comments on commit 0918d56

Please sign in to comment.
You can’t perform that action at this time.