diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-09-10 08:07:10 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-09-10 08:07:10 +0000 |
commit | cf16eec875de2a1dc13d569729c8565e9ade9fa5 (patch) | |
tree | 8968d480e0ca1164687b02bd957c5975d7171cb3 | |
parent | 63bc2714d44a15320b6fbc6ec5df93064a73170e (diff) | |
download | pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.gz pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.bz2 pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.xz pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.zip |
smaller preview box for short log files
-rw-r--r-- | js/pkgsubmit.js | 30 | ||||
-rw-r--r-- | style.css | 7 |
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", @@ -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%; |