diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/filesystem/test/data | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/filesystem/test/data')
8 files changed, 334 insertions, 0 deletions
diff --git a/xbmc/filesystem/test/data/httpdirectory/apache-default.html b/xbmc/filesystem/test/data/httpdirectory/apache-default.html new file mode 100644 index 0000000..e29ff27 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/apache-default.html @@ -0,0 +1,15 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> + <head> + <title>Index of /</title> + </head> + <body> +<h1>Index of /</h1> +<ul><li><a href="folder1/"> folder1/</a></li> +<li><a href="folder2/"> folder2/</a></li> +<li><a href="./sample3:%20the%20sampling.mpg"> sample3: the sampling.mpg</a></li> +<li><a href="sample%20&%20samplability%204.mpg"> sample & samplability 4.mpg</a></li> +<li><a href="sample5.mpg"> sample5.mpg</a></li> +<li><a href="sample6.mpg"> sample6.mpg</a></li> +</ul> +</body></html>
\ No newline at end of file diff --git a/xbmc/filesystem/test/data/httpdirectory/apache-fancy.html b/xbmc/filesystem/test/data/httpdirectory/apache-fancy.html new file mode 100644 index 0000000..a45d52a --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/apache-fancy.html @@ -0,0 +1,15 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> + <head> + <title>Index of /</title> + </head> + <body> +<h1>Index of /</h1> +<pre> <a href="?C=N;O=D;F=1">Name</a> <a href="?C=M;O=A;F=1">Last modified</a> <a href="?C=S;O=A;F=1">Size</a> <a href="?C=D;O=A;F=1">Description</a><hr> <a href="folder1/">folder1/</a> 2019-01-01 01:01 - + <a href="folder2/">folder2/</a> 2019-02-02 02:02 - + <a href="./sample3:%20the%20sampling.mpg">sample3: the sampling.mpg</a> 2019-03-03 03:03 123 + <a href="sample%20&%20samplability%204.mpg">sample & samplability 4.mpg</a> 2019-04-04 04:04 123K + <a href="sample5.mpg">sample5.mpg</a> 2019-05-05 05:05 123M + <a href="sample6.mpg">sample6.mpg</a> 2019-06-06 06:06 123G +<hr></pre> +</body></html> diff --git a/xbmc/filesystem/test/data/httpdirectory/apache-html.html b/xbmc/filesystem/test/data/httpdirectory/apache-html.html new file mode 100644 index 0000000..8e69ab4 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/apache-html.html @@ -0,0 +1,19 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> + <head> + <title>Index of /</title> + </head> + <body> +<h1>Index of /</h1> + <table> + <tr><th valign="top"> </th><th><a href="?C=N;O=D;F=2">Name</a></th><th><a href="?C=M;O=A;F=2">Last modified</a></th><th><a href="?C=S;O=A;F=2">Size</a></th><th><a href="?C=D;O=A;F=2">Description</a></th></tr> + <tr><th colspan="5"><hr></th></tr> +<tr><td valign="top"> </td><td><a href="folder1/">folder1/</a> </td><td align="right">2019-01-01 01:01 </td><td align="right"> - </td><td> </td></tr> +<tr><td valign="top"> </td><td><a href="folder2/">folder2/</a> </td><td align="right">2019-02-02 02:02 </td><td align="right"> - </td><td> </td></tr> +<tr><td valign="top"> </td><td><a href="./sample3:%20the%20sampling.mpg">sample3: the sampling.mpg</a> </td><td align="right">2019-03-03 03:03 </td><td align="right">123 </td><td> </td></tr> +<tr><td valign="top"> </td><td><a href="sample%20&%20samplability%204.mpg">sample & samplability 4.mpg</a> </td><td align="right">2019-04-04 04:04 </td><td align="right">123K</td><td> </td></tr> +<tr><td valign="top"> </td><td><a href="sample5.mpg">sample5.mpg</a> </td><td align="right">2019-05-05 05:05 </td><td align="right">123M</td><td> </td></tr> +<tr><td valign="top"> </td><td><a href="sample6.mpg">sample6.mpg</a> </td><td align="right">2019-06-06 06:06 </td><td align="right">123G</td><td> </td></tr> + <tr><th colspan="5"><hr></th></tr> +</table> +</body></html> diff --git a/xbmc/filesystem/test/data/httpdirectory/basic-multiline.html b/xbmc/filesystem/test/data/httpdirectory/basic-multiline.html new file mode 100644 index 0000000..707a1f0 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/basic-multiline.html @@ -0,0 +1,16 @@ +<html> + <head> + <title>Directory Listing</title> + </head> + <body> + <a href="folder1/">folder1/</a> + <a href="folder2/"> + folder2/ + </a> + <a href="./sample3:%20the%20sampling.mpg">sample3: the sampling.mpg</a> + <a href="sample%20&%20samplability%204.mpg">sample & samplability 4.mpg</a> <a href="sample5.mpg">sample5.mpg</a> + <a href="sample6.mpg"> + sample6.mpg + </a> + </body> +</html>
\ No newline at end of file diff --git a/xbmc/filesystem/test/data/httpdirectory/basic.html b/xbmc/filesystem/test/data/httpdirectory/basic.html new file mode 100644 index 0000000..ce98a10 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/basic.html @@ -0,0 +1,13 @@ +<html> + <head> + <title>Directory Listing</title> + </head> + <body> + <a href="folder1/">folder1/</a> + <a href="folder2/">folder2/</a> + <a href="./sample3:%20the%20sampling.mpg">sample3: the sampling.mpg</a> + <a href="sample%20&%20samplability%204.mpg">sample & samplability 4.mpg</a> + <a href="sample5.mpg">sample5.mpg</a> + <a href="sample6.mpg">sample6.mpg</a> + </body> +</html>
\ No newline at end of file diff --git a/xbmc/filesystem/test/data/httpdirectory/lighttp-default.html b/xbmc/filesystem/test/data/httpdirectory/lighttp-default.html new file mode 100644 index 0000000..505f477 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/lighttp-default.html @@ -0,0 +1,211 @@ +<!DOCTYPE html> +<html> +<head> +<title>Index of /</title> +<style type="text/css"> +a, a:active {text-decoration: none; color: blue;} +a:visited {color: #48468F;} +a:hover, a:focus {text-decoration: underline; color: red;} +body {background-color: #F5F5F5;} +h2 {margin-bottom: 12px;} +table {margin-left: 12px;} +th, td { font: 90% monospace; text-align: left;} +th { font-weight: bold; padding-right: 14px; padding-bottom: 3px;} +td {padding-right: 14px;} +td.s, th.s {text-align: right;} +div.list { background-color: white; border-top: 1px solid #646464; border-bottom: 1px solid #646464; padding-top: 10px; padding-bottom: 14px;} +div.foot { font: 90% monospace; color: #787878; padding-top: 4px;} +</style> +</head> +<body> +<h2>Index of /</h2> +<div class="list"> +<table summary="Directory Listing" cellpadding="0" cellspacing="0"> +<thead><tr><th class="n">Name</th><th class="m">Last Modified</th><th class="s">Size</th><th class="t">Type</th></tr></thead> +<tbody> +<tr class="d"><td class="n"><a href="folder1/">folder1</a>/</td><td class="m">2019-Jan-01 01:01:01</td><td class="s">- </td><td class="t">Directory</td></tr> +<tr class="d"><td class="n"><a href="folder2/">folder2</a>/</td><td class="m">2019-Feb-02 02:02:02</td><td class="s">- </td><td class="t">Directory</td></tr> +<tr><td class="n"><a href="sample3%3a%20the%20sampling.mpg">sample3: the sampling.mpg</a></td><td class="m">2019-Mar-03 03:03:03</td><td class="s">0.1K</td><td class="t">video/mpeg</td></tr> +<tr><td class="n"><a href="sample%20%26%20samplability%204.mpg">sample & samplability 4.mpg</a></td><td class="m">2019-Apr-04 04:04:04</td><td class="s">123.0K</td><td class="t">video/mpeg</td></tr> +<tr><td class="n"><a href="sample5.mpg">sample5.mpg</a></td><td class="m">2019-May-05 05:05:05</td><td class="s">123.0M</td><td class="t">video/mpeg</td></tr> +<tr><td class="n"><a href="sample6.mpg">sample6.mpg</a></td><td class="m">2019-Jun-06 06:06:06</td><td class="s">123.0G</td><td class="t">video/mpeg</td></tr> +</tbody> +</table> +</div> +<div class="foot">lighttpd/1.4.49</div> + +<script type="text/javascript"> +// <!-- + +var click_column; +var name_column = 0; +var date_column = 1; +var size_column = 2; +var type_column = 3; +var prev_span = null; + +if (typeof(String.prototype.localeCompare) === 'undefined') { + String.prototype.localeCompare = function(str, locale, options) { + return ((this == str) ? 0 : ((this > str) ? 1 : -1)); + }; +} + +if (typeof(String.prototype.toLocaleUpperCase) === 'undefined') { + String.prototype.toLocaleUpperCase = function() { + return this.toUpperCase(); + }; +} + +function get_inner_text(el) { + if((typeof el == 'string')||(typeof el == 'undefined')) + return el; + if(el.innerText) + return el.innerText; + else { + var str = ""; + var cs = el.childNodes; + var l = cs.length; + for (i=0;i<l;i++) { + if (cs[i].nodeType==1) str += get_inner_text(cs[i]); + else if (cs[i].nodeType==3) str += cs[i].nodeValue; + } + } + return str; +} + +function isdigit(c) { + return (c >= '0' && c <= '9'); +} + +function unit_multiplier(unit) { + return (unit=='K') ? 1000 + : (unit=='M') ? 1000000 + : (unit=='G') ? 1000000000 + : (unit=='T') ? 1000000000000 + : (unit=='P') ? 1000000000000000 + : (unit=='E') ? 1000000000000000000 : 1; +} + +var li_date_regex=/(\d{4})-(\w{3})-(\d{2}) (\d{2}):(\d{2}):(\d{2})/; + +var li_mon = ['Jan','Feb','Mar','Apr','May','Jun', + 'Jul','Aug','Sep','Oct','Nov','Dec']; + +function li_mon_num(mon) { + var i; for (i = 0; i < 12 && mon != li_mon[i]; ++i); return i; +} + +function li_date_cmp(s1, s2) { + var dp1 = li_date_regex.exec(s1) + var dp2 = li_date_regex.exec(s2) + for (var i = 1; i < 7; ++i) { + var cmp = (2 != i) + ? parseInt(dp1[i]) - parseInt(dp2[i]) + : li_mon_num(dp1[2]) - li_mon_num(dp2[2]); + if (0 != cmp) return cmp; + } + return 0; +} + +function sortfn_then_by_name(a,b,sort_column) { + if (sort_column == name_column || sort_column == type_column) { + var ad = (a.cells[type_column].innerHTML === 'Directory'); + var bd = (b.cells[type_column].innerHTML === 'Directory'); + if (ad != bd) return (ad ? -1 : 1); + } + var at = get_inner_text(a.cells[sort_column]); + var bt = get_inner_text(b.cells[sort_column]); + var cmp; + if (sort_column == name_column) { + if (at == '..') return -1; + if (bt == '..') return 1; + } + if (a.cells[sort_column].className == 'int') { + cmp = parseInt(at)-parseInt(bt); + } else if (sort_column == date_column) { + var ad = isdigit(at.substr(0,1)); + var bd = isdigit(bt.substr(0,1)); + if (ad != bd) return (!ad ? -1 : 1); + cmp = li_date_cmp(at,bt); + } else if (sort_column == size_column) { + var ai = parseInt(at, 10) * unit_multiplier(at.substr(-1,1)); + var bi = parseInt(bt, 10) * unit_multiplier(bt.substr(-1,1)); + if (at.substr(0,1) == '-') ai = -1; + if (bt.substr(0,1) == '-') bi = -1; + cmp = ai - bi; + } else { + cmp = at.toLocaleUpperCase().localeCompare(bt.toLocaleUpperCase()); + if (0 != cmp) return cmp; + cmp = at.localeCompare(bt); + } + if (0 != cmp || sort_column == name_column) return cmp; + return sortfn_then_by_name(a,b,name_column); +} + +function sortfn(a,b) { + return sortfn_then_by_name(a,b,click_column); +} + +function resort(lnk) { + var span = lnk.childNodes[1]; + var table = lnk.parentNode.parentNode.parentNode.parentNode; + var rows = new Array(); + for (j=1;j<table.rows.length;j++) + rows[j-1] = table.rows[j]; + click_column = lnk.parentNode.cellIndex; + rows.sort(sortfn); + + if (prev_span != null) prev_span.innerHTML = ''; + if (span.getAttribute('sortdir')=='down') { + span.innerHTML = '↑'; + span.setAttribute('sortdir','up'); + rows.reverse(); + } else { + span.innerHTML = '↓'; + span.setAttribute('sortdir','down'); + } + for (i=0;i<rows.length;i++) + table.tBodies[0].appendChild(rows[i]); + prev_span = span; +} + +function init_sort(init_sort_column, ascending) { + var tables = document.getElementsByTagName("table"); + for (var i = 0; i < tables.length; i++) { + var table = tables[i]; + //var c = table.getAttribute("class") + //if (-1 != c.split(" ").indexOf("sort")) { + var row = table.rows[0].cells; + for (var j = 0; j < row.length; j++) { + var n = row[j]; + if (n.childNodes.length == 1 && n.childNodes[0].nodeType == 3) { + var link = document.createElement("a"); + var title = n.childNodes[0].nodeValue.replace(/:$/, ""); + link.appendChild(document.createTextNode(title)); + link.setAttribute("href", "#"); + link.setAttribute("class", "sortheader"); + link.setAttribute("onclick", "resort(this);return false;"); + var arrow = document.createElement("span"); + arrow.setAttribute("class", "sortarrow"); + arrow.appendChild(document.createTextNode(":")); + link.appendChild(arrow) + n.replaceChild(link, n.firstChild); + } + } + var lnk = row[init_sort_column].firstChild; + if (ascending) { + var span = lnk.childNodes[1]; + span.setAttribute('sortdir','down'); + } + resort(lnk); + //} + } +} + +init_sort(0, 0); + +// --> +</script> + +</body> +</html> diff --git a/xbmc/filesystem/test/data/httpdirectory/nginx-default.html b/xbmc/filesystem/test/data/httpdirectory/nginx-default.html new file mode 100644 index 0000000..77bcd75 --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/nginx-default.html @@ -0,0 +1,11 @@ +<html> +<head><title>Index of /</title></head> +<body> +<h1>Index of /</h1><hr><pre><a href="folder1/">folder1/</a> 01-Jan-2019 01:01 - +<a href="folder2/">folder2/</a> 02-Feb-2019 02:02 - +<a href="sample3%3A%20the%20sampling.mpg">sample3: the sampling.mpg</a> 03-Mar-2019 03:03 123 +<a href="sample%20%26%20samplability%204.mpg">sample & samplability 4.mpg</a> 04-Apr-2019 04:04 125952 +<a href="sample5.mpg">sample5.mpg</a> 05-May-2019 05:05 128974848 +<a href="sample6.mpg">sample6.mpg</a> 06-Jun-2019 06:06 132070244352 +</pre><hr></body> +</html> diff --git a/xbmc/filesystem/test/data/httpdirectory/nginx-fancyindex.html b/xbmc/filesystem/test/data/httpdirectory/nginx-fancyindex.html new file mode 100644 index 0000000..d9772df --- /dev/null +++ b/xbmc/filesystem/test/data/httpdirectory/nginx-fancyindex.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta http-equiv="content-type" content="text/html; charset=utf-8"/> + <meta name="viewport" content="width=device-width"/> + <link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo="> + <title>Files...</title> +</head> +<body> +<div class="box box-breadcrumbs"> + <div class="box-header"> + <div class="box-header-content"> + <div id="breadcrumbs" class="breadcrumbs"> + <a href="#"></a> + </div> + </div> + </div> + <div class="box-content clearfix"> + <h1>Index of: +/</h1> +<table id="list"><thead><tr><th style="width:55%"><a href="?C=N&O=A">File Name</a> <a href="?C=N&O=D"> ↓ </a></th><th style="width:20%"><a href="?C=S&O=A">File Size</a> <a href="?C=S&O=D"> ↓ </a></th><th style="width:25%"><a href="?C=M&O=A">Date</a> <a href="?C=M&O=D"> ↓ </a></th></tr></thead> +<tbody><tr><td class="link"><a href="../">Parent directory/</a></td><td class="size">-</td><td class="date">-</td></tr> +<tr><td class="link"><a href="folder1/" title="folder1">folder1/</a></td><td class="size">-</td><td class="date">2019-Jan-01 01:01</td></tr> +<tr><td class="link"><a href="folder2/" title="folder2">folder2/</a></td><td class="size">-</td><td class="date">2019-Feb-02 02:02</td></tr> +<tr><td class="link"><a href="sample3%3A%20the%20sampling.mpg" title="sample3: the sampling.mpg">sample3: the sampling.mpg</a></td><td class="size">123 B</td><td class="date">2019-Mar-03 03:03</td></tr> +<tr><td class="link"><a href="sample%20%26%20samplability%204.mpg" title="sample & samplability 4.mpg">sample & samplability 4.mpg</a></td><td class="size">123.0 KiB</td><td class="date">2019-Apr-04 04:04</td></tr> +<tr><td class="link"><a href="sample5.mpg" title="sample5.mpg">sample5.mpg</a></td><td class="size">123.0 MiB</td><td class="date">2019-May-05 05:05</td></tr> +<tr><td class="link"><a href="sample6.mpg" title="sample6.mpg">sample6.mpg</a></td><td class="size">123.0 GiB</td><td class="date">2019-Jun-06 06:06</td></tr> +</tbody></table> +</div> +</div> +</body> +</html> |