summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-10 08:07:10 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-10 08:07:10 +0000
commitcf16eec875de2a1dc13d569729c8565e9ade9fa5 (patch)
tree8968d480e0ca1164687b02bd957c5975d7171cb3 /js
parent63bc2714d44a15320b6fbc6ec5df93064a73170e (diff)
downloadpkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar
pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.gz
pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.bz2
pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.tar.xz
pkgsubmit-cf16eec875de2a1dc13d569729c8565e9ade9fa5.zip
smaller preview box for short log files
Diffstat (limited to 'js')
-rw-r--r--js/pkgsubmit.js30
1 files changed, 26 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",