summaryrefslogtreecommitdiffstats
path: root/net/base/dir_header.html
blob: 400febefb0a27c56463efa9a178e51147427b8de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html>
<head>

<script>
function addRow(name, url, isdir, size, date_modified) {
  if (name == ".")
    return;

  var root = "" + document.location;
  if (root.substr(-1) !== "/")
    root += "/";

  var table = document.getElementById("table");
  var row = document.createElement("tr");
  var file_cell = document.createElement("td");
  var link = document.createElement("a");
  if (name == "..") {
    link.href = root + "..";
    link.innerText = document.getElementById("parentDirText").innerText;
    size = "";
    date_modified = "";
  } else {
    if (isdir) {
      name = name + "/";
      url = url + "/";
      size = "";
    }
    link.innerText = name;
    link.href = root + url;
  }
  file_cell.appendChild(link);

  row.appendChild(file_cell);
  row.appendChild(createCell(size));
  row.appendChild(createCell(date_modified));

  table.appendChild(row);
}

function createCell(text) {
  var cell = document.createElement("td");
  cell.setAttribute("class", "detailsColumn");
  cell.innerText = text;
  return cell;
}

function start(location) {
  var header = document.getElementById("header");
  header.innerText = header.innerText.replace("LOCATION", location);

  document.getElementById("title").innerText = header.innerText;
}
</script>

<title id="title"></title>
<style>
  h1 { white-space: nowrap; }
  td.detailsColumn { text-align: right; padding-left: 30px; white-space: nowrap; }
</style>
</head>
<body>
<span id="parentDirText" style="display:none" i18n-content="parentDirText"></span>
<h1 id="header" i18n-content="header"></h1>
<hr/>
<table id="table">
<tr style="font-weight: bold">
 <td i18n-content="headerName"></td>
 <td class="detailsColumn" i18n-content="headerSize"></td>
 <td class="detailsColumn" i18n-content="headerDateModified"></td>
</tr>
</table>
</body>
</html>