summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--js/pkgsubmit.js30
-rw-r--r--style.css7
2 files changed, 33 insertions, 4 deletions
diff --git a/js/pkgsubmit.js b/js/pkgsubmit.js
index 6f432fa..d5f6931 100644
--- a/js/pkgsubmit.js
+++ b/js/pkgsubmit.js
@@ -1,3 +1,26 @@
+function isLogFile(path) {
+
+ var ext = path.split(".").pop();
+ if (["log", "done", "youri"].indexOf(ext) < 0) {
+ return true;
+ }
+
+ return false;
+}
+
+function isShortFile(path) {
+
+ var ext = path.split(".").pop();
+ var file = path.split("/").pop();
+
+ if (["done"].indexOf(ext) >= 0
+ || ["status.log"].indexOf(file) >= 0) {
+ return true;
+ }
+
+ return false;
+}
+
$(function () {
$('.status-link').on("click", function (ev) {
@@ -31,17 +54,15 @@ $(function () {
$("table#submitted-packages tbody").on("click", "tr td li a.view-inline", function (ev) {
- // only open text log files
- var ext = $(this).attr("href").split(".").pop();
- if (["log", "done", "youri"].indexOf(ext) < 0)
+ if (isLogFile($(this).attr("href"))) {
return true;
+ }
if (!ev.metaKey) {
ev.preventDefault();
var elId = 'view-' + $(this).attr("href").replace(/\/|\./g, '-');
var cId = elId + '-container';
-
var c = $("#" + cId);
var el = $("#" + elId);
@@ -49,6 +70,7 @@ $(function () {
$(this).after($("<div />", {
id: cId
})
+ .addClass(isShortFile($(this).attr("href")) ? "short" : "")
.append($("<textarea />", {
id: elId,
class: "file-view",
diff --git a/style.css b/style.css
index 53dc7aa..9c7fac6 100644
--- a/style.css
+++ b/style.css
@@ -66,11 +66,18 @@ tr.build-files-list td { font-size: 85%; padding: 1em 0 2em 1em; color: #555; }
position: relative;
}
+.short .file-view {
+ height: 1.5em;
+ width: 500px;
+}
+
.controls {
float: right;
display: block;
text-align: right;
}
+.short .controls { display: none; }
+
.gotobo, .gototop {
margin-left: 0.5em;
font-size: 90%;