David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 3 | <html dir="$i18n{textdirection}" lang="$i18n{language}"> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 4 | |
| 5 | <head> |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 6 | <meta charset="utf-8"> |
| 7 | <meta name="google" value="notranslate"> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 8 | |
| 9 | <script> |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 10 | function addRow(name, url, isdir, |
| 11 | size, size_string, date_modified, date_modified_string) { |
| 12 | if (name == "." || name == "..") |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 13 | return; |
| 14 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 15 | var root = document.location.pathname; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 16 | if (root.substr(-1) !== "/") |
| 17 | root += "/"; |
| 18 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 19 | var tbody = document.getElementById("tbody"); |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 20 | var row = document.createElement("tr"); |
| 21 | var file_cell = document.createElement("td"); |
| 22 | var link = document.createElement("a"); |
| 23 | |
| 24 | link.className = isdir ? "icon dir" : "icon file"; |
| 25 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 26 | if (isdir) { |
| 27 | name = name + "/"; |
| 28 | url = url + "/"; |
| 29 | size = 0; |
| 30 | size_string = ""; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 31 | } else { |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 32 | link.draggable = "true"; |
| 33 | link.addEventListener("dragstart", onDragStart, false); |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 34 | } |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 35 | link.innerText = name; |
| 36 | link.href = root + url; |
| 37 | |
| 38 | file_cell.dataset.value = name; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 39 | file_cell.appendChild(link); |
| 40 | |
| 41 | row.appendChild(file_cell); |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 42 | row.appendChild(createCell(size, size_string)); |
| 43 | row.appendChild(createCell(date_modified, date_modified_string)); |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 44 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 45 | tbody.appendChild(row); |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | function onDragStart(e) { |
| 49 | var el = e.srcElement; |
| 50 | var name = el.innerText.replace(":", ""); |
| 51 | var download_url_data = "application/octet-stream:" + name + ":" + el.href; |
| 52 | e.dataTransfer.setData("DownloadURL", download_url_data); |
| 53 | e.dataTransfer.effectAllowed = "copy"; |
| 54 | } |
| 55 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 56 | function createCell(value, text) { |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 57 | var cell = document.createElement("td"); |
| 58 | cell.setAttribute("class", "detailsColumn"); |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 59 | cell.dataset.value = value; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 60 | cell.innerText = text; |
| 61 | return cell; |
| 62 | } |
| 63 | |
| 64 | function start(location) { |
| 65 | var header = document.getElementById("header"); |
| 66 | header.innerText = header.innerText.replace("LOCATION", location); |
| 67 | |
| 68 | document.getElementById("title").innerText = header.innerText; |
| 69 | } |
| 70 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 71 | function onHasParentDirectory() { |
| 72 | var box = document.getElementById("parentDirLinkBox"); |
| 73 | box.style.display = "block"; |
| 74 | |
| 75 | var root = document.location.pathname; |
| 76 | if (!root.endsWith("/")) |
| 77 | root += "/"; |
| 78 | |
| 79 | var link = document.getElementById("parentDirLink"); |
| 80 | link.href = root + ".."; |
| 81 | } |
| 82 | |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 83 | function onListingParsingError() { |
| 84 | var box = document.getElementById("listingParsingErrorBox"); |
| 85 | box.innerHTML = box.innerHTML.replace("LOCATION", encodeURI(document.location) |
| 86 | + "?raw"); |
| 87 | box.style.display = "block"; |
| 88 | } |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 89 | |
| 90 | function sortTable(column) { |
| 91 | var theader = document.getElementById("theader"); |
| 92 | var oldOrder = theader.cells[column].dataset.order || '1'; |
| 93 | oldOrder = parseInt(oldOrder, 10) |
| 94 | var newOrder = 0 - oldOrder; |
| 95 | theader.cells[column].dataset.order = newOrder; |
| 96 | |
| 97 | var tbody = document.getElementById("tbody"); |
| 98 | var rows = tbody.rows; |
| 99 | var list = [], i; |
| 100 | for (i = 0; i < rows.length; i++) { |
| 101 | list.push(rows[i]); |
| 102 | } |
| 103 | |
| 104 | list.sort(function(row1, row2) { |
| 105 | var a = row1.cells[column].dataset.value; |
| 106 | var b = row2.cells[column].dataset.value; |
| 107 | if (column) { |
| 108 | a = parseInt(a, 10); |
| 109 | b = parseInt(b, 10); |
| 110 | return a > b ? newOrder : a < b ? oldOrder : 0; |
| 111 | } |
| 112 | |
| 113 | // Column 0 is text. |
| 114 | if (a > b) |
| 115 | return newOrder; |
| 116 | if (a < b) |
| 117 | return oldOrder; |
| 118 | return 0; |
| 119 | }); |
| 120 | |
| 121 | // Appending an existing child again just moves it. |
| 122 | for (i = 0; i < list.length; i++) { |
| 123 | tbody.appendChild(list[i]); |
| 124 | } |
| 125 | } |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 126 | </script> |
| 127 | |
| 128 | <style> |
| 129 | |
| 130 | h1 { |
| 131 | border-bottom: 1px solid #c0c0c0; |
| 132 | margin-bottom: 10px; |
| 133 | padding-bottom: 10px; |
| 134 | white-space: nowrap; |
| 135 | } |
| 136 | |
| 137 | table { |
| 138 | border-collapse: collapse; |
| 139 | } |
| 140 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 141 | th { |
| 142 | cursor: pointer; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | td.detailsColumn { |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 146 | -webkit-padding-start: 2em; |
| 147 | text-align: end; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 148 | white-space: nowrap; |
| 149 | } |
| 150 | |
| 151 | a.icon { |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 152 | -webkit-padding-start: 1.5em; |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 153 | text-decoration: none; |
| 154 | } |
| 155 | |
| 156 | a.icon:hover { |
| 157 | text-decoration: underline; |
| 158 | } |
| 159 | |
| 160 | a.file { |
| 161 | background : url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAABnRSTlMAAAAAAABupgeRAAABHUlEQVR42o2RMW7DIBiF3498iHRJD5JKHurL+CRVBp+i2T16tTynF2gO0KSb5ZrBBl4HHDBuK/WXACH4eO9/CAAAbdvijzLGNE1TVZXfZuHg6XCAQESAZXbOKaXO57eiKG6ft9PrKQIkCQqFoIiQFBGlFIB5nvM8t9aOX2Nd18oDzjnPgCDpn/BH4zh2XZdlWVmWiUK4IgCBoFMUz9eP6zRN75cLgEQhcmTQIbl72O0f9865qLAAsURAAgKBJKEtgLXWvyjLuFsThCSstb8rBCaAQhDYWgIZ7myM+TUBjDHrHlZcbMYYk34cN0YSLcgS+wL0fe9TXDMbY33fR2AYBvyQ8L0Gk8MwREBrTfKe4TpTzwhArXWi8HI84h/1DfwI5mhxJamFAAAAAElFTkSuQmCC ") left top no-repeat; |
| 162 | } |
| 163 | |
| 164 | a.dir { |
| 165 | background : url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAd5JREFUeNqMU79rFUEQ/vbuodFEEkzAImBpkUabFP4ldpaJhZXYm/RiZWsv/hkWFglBUyTIgyAIIfgIRjHv3r39MePM7N3LcbxAFvZ2b2bn22/mm3XMjF+HL3YW7q28YSIw8mBKoBihhhgCsoORot9d3/ywg3YowMXwNde/PzGnk2vn6PitrT+/PGeNaecg4+qNY3D43vy16A5wDDd4Aqg/ngmrjl/GoN0U5V1QquHQG3q+TPDVhVwyBffcmQGJmSVfyZk7R3SngI4JKfwDJ2+05zIg8gbiereTZRHhJ5KCMOwDFLjhoBTn2g0ghagfKeIYJDPFyibJVBtTREwq60SpYvh5++PpwatHsxSm9QRLSQpEVSd7/TYJUb49TX7gztpjjEffnoVw66+Ytovs14Yp7HaKmUXeX9rKUoMoLNW3srqI5fWn8JejrVkK0QcrkFLOgS39yoKUQe292WJ1guUHG8K2o8K00oO1BTvXoW4yasclUTgZYJY9aFNfAThX5CZRmczAV52oAPoupHhWRIUUAOoyUIlYVaAa/VbLbyiZUiyFbjQFNwiZQSGl4IDy9sO5Wrty0QLKhdZPxmgGcDo8ejn+c/6eiK9poz15Kw7Dr/vN/z6W7q++091/AQYA5mZ8GYJ9K0AAAAAASUVORK5CYII= ") left top no-repeat; |
| 166 | } |
| 167 | |
| 168 | a.up { |
| 169 | background : url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAmlJREFUeNpsU0toU0EUPfPysx/tTxuDH9SCWhUDooIbd7oRUUTMouqi2iIoCO6lceHWhegy4EJFinWjrlQUpVm0IIoFpVDEIthm0dpikpf3ZuZ6Z94nrXhhMjM3c8895977BBHB2PznK8WPtDgyWH5q77cPH8PpdXuhpQT4ifR9u5sfJb1bmw6VivahATDrxcRZ2njfoaMv+2j7mLDn93MPiNRMvGbL18L9IpF8h9/TN+EYkMffSiOXJ5+hkD+PdqcLpICWHOHc2CC+LEyA/K+cKQMnlQHJX8wqYG3MAJy88Wa4OLDvEqAEOpJd0LxHIMdHBziowSwVlF8D6QaicK01krw/JynwcKoEwZczewroTvZirlKJs5CqQ5CG8pb57FnJUA0LYCXMX5fibd+p8LWDDemcPZbzQyjvH+Ki1TlIciElA7ghwLKV4kRZstt2sANWRjYTAGzuP2hXZFpJ/GsxgGJ0ox1aoFWsDXyyxqCs26+ydmagFN/rRjymJ1898bzGzmQE0HCZpmk5A0RFIv8Pn0WYPsiu6t/Rsj6PauVTwffTSzGAGZhUG2F06hEc9ibS7OPMNp6ErYFlKavo7MkhmTqCxZ/jwzGA9Hx82H2BZSw1NTN9Gx8ycHkajU/7M+jInsDC7DiaEmo1bNl1AMr9ASFgqVu9MCTIzoGUimXVAnnaN0PdBBDCCYbEtMk6wkpQwIG0sn0PQIUF4GsTwLSIFKNqF6DVrQq+IWVrQDxAYQC/1SsYOI4pOxKZrfifiUSbDUisif7XlpGIPufXd/uvdvZm760M0no1FZcnrzUdjw7au3vu/BVgAFLXeuTxhTXVAAAAAElFTkSuQmCC ") left top no-repeat; |
| 170 | } |
| 171 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 172 | html[dir=rtl] a { |
| 173 | background-position-x: right; |
| 174 | } |
| 175 | |
| 176 | #parentDirLinkBox { |
| 177 | margin-bottom: 10px; |
| 178 | padding-bottom: 10px; |
| 179 | } |
| 180 | |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 181 | #listingParsingErrorBox { |
| 182 | border: 1px solid black; |
| 183 | background: #fae691; |
| 184 | padding: 10px; |
| 185 | display: none; |
| 186 | } |
| 187 | </style> |
| 188 | |
| 189 | <title id="title"></title> |
| 190 | |
| 191 | </head> |
| 192 | |
| 193 | <body> |
| 194 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 195 | <div id="listingParsingErrorBox">$i18nRaw{listingParsingErrorBoxText}</div> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 196 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 197 | <h1 id="header">$i18n{header}</h1> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 198 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 199 | <div id="parentDirLinkBox" style="display:none"> |
| 200 | <a id="parentDirLink" class="icon up"> |
| 201 | <span id="parentDirText">$i18n{parentDirText}</span> |
| 202 | </a> |
| 203 | </div> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 204 | |
Andrew Top | 0d1858f | 2019-05-15 22:01:47 -0700 | [diff] [blame] | 205 | <table> |
| 206 | <thead> |
| 207 | <tr class="header" id="theader"> |
| 208 | <th onclick="javascript:sortTable(0);">$i18n{headerName}</th> |
| 209 | <th class="detailsColumn" onclick="javascript:sortTable(1);"> |
| 210 | $i18n{headerSize} |
| 211 | </th> |
| 212 | <th class="detailsColumn" onclick="javascript:sortTable(2);"> |
| 213 | $i18n{headerDateModified} |
| 214 | </th> |
| 215 | </tr> |
| 216 | </thead> |
| 217 | <tbody id="tbody"> |
| 218 | </tbody> |
David Ghandehari | 9e5b587 | 2016-07-28 09:50:04 -0700 | [diff] [blame] | 219 | </table> |
| 220 | |
| 221 | </body> |
| 222 | |
| 223 | </html> |