1 <!DOCTYPE html> 2 <html> 3 <head> 4 5 <script> 6 function addRow(name, url, isdir, size, date_modified) { 7 if (name == ".") 8 return; 9 10 var root = "" + document.location; 11 if (root.substr(-1) !== "/") 12 root += "/"; 13 14 var table = document.getElementById("table"); 15 var row = document.createElement("tr"); 16 var file_cell = document.createElement("td"); 17 var link = document.createElement("a"); 18 if (name == "..") { 19 link.href = root + ".."; 20 link.innerText = document.getElementById("parentDirText").innerText; 21 size = ""; 22 date_modified = ""; 23 } else { 24 if (isdir) { 25 name = name + "/"; 26 url = url + "/"; 27 size = ""; 28 } 29 link.innerText = name; 30 link.href = root + url; 31 } 32 file_cell.appendChild(link); 33 34 row.appendChild(file_cell); 35 row.appendChild(createCell(size)); 36 row.appendChild(createCell(date_modified)); 37 38 table.appendChild(row); 39 } 40 41 function createCell(text) { 42 var cell = document.createElement("td"); 43 cell.setAttribute("class", "detailsColumn"); 44 cell.innerText = text; 45 return cell; 46 } 47 48 function start(location) { 49 var header = document.getElementById("header"); 50 header.innerText = header.innerText.replace("LOCATION", location); 51 52 document.getElementById("title").innerText = header.innerText; 53 } 54 55 function onListingParsingError() { 56 var box = document.getElementById("listingParsingErrorBox"); 57 box.innerHTML = box.innerHTML.replace("LOCATION", document.location + "?raw"); 58 box.style.display = ""; 59 } 60 </script> 61 62 <title id="title"></title> 63 <style> 64 h1 { white-space: nowrap; } 65 td.detailsColumn { text-align: right; padding-left: 30px; white-space: nowrap; } 66 #listingParsingErrorBox { border: 1px solid black; background: #fae691; padding: 10px; display: none } 67 </style> 68 </head> 69 <body> 70 <div id="listingParsingErrorBox" i18n-values=".innerHTML:listingParsingErrorBoxText"></div> 71 <span id="parentDirText" style="display:none" i18n-content="parentDirText"></span> 72 <h1 id="header" i18n-content="header"></h1> 73 <hr/> 74 <table id="table"> 75 <tr style="font-weight: bold"> 76 <td i18n-content="headerName"></td> 77 <td class="detailsColumn" i18n-content="headerSize"></td> 78 <td class="detailsColumn" i18n-content="headerDateModified"></td> 79 </tr> 80 </table> 81 </body> 82 </html> 83