rejetto forum

Software => HFS ~ HTTP File Server => Programmers corner => Topic started by: tdv on November 24, 2013, 09:38:51 AM

Title: loading file list
Post by: tdv on November 24, 2013, 09:38:51 AM
I was so hoping that this method will work to get the files list, but alas.  :(

Template code:
Code: [Select]
[]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
</head>
<body>
 <div id="FilesContainer"></div>

<script type="text/javascript">
jQuery(document).ready(function()
 {
  $("#FilesContainer").load("%folder%?mode=section&id=FileList.html");
 });
</script>

</body>
</html>

[file=folder=link|private]
<br>%item-url%

[FileList.html]
%list%

May be worth processing a list of files in such (%folder%?mode=section&id=FileList.html) requests?
Title: Re: loading file list
Post by: rejetto on November 24, 2013, 03:49:37 PM
try this

  $("#FilesContainer").load("{.get|url|tpl=list.}");
Title: Re: loading file list
Post by: tdv on November 24, 2013, 05:06:21 PM
Maybe {.get item|a|b.}? But unfortunately, it will not work.
jQuery.load send http request via ajax mechanism on the server, and all that I want is to process it according to all rules but from another section to eliminate all unnecessary html code. The result of this query is placed directly in the DIV tag. By the way, thus it is possible build and XML  response

I want to make walking on directories without reloading the page.
Title: Re: loading file list
Post by: rejetto on December 08, 2013, 07:21:54 PM
i tried what i suggested, and it works to me.
you can eventually change {.get|url|tpl=list.} with ?tpl=list
the first form is actually translated by the server itself, but the second should always work.
here is an example
$('body').load('?tpl=list')

in HFS 3 i already made a default template where you change folder without reloading the page.
They are not compatible, anyway, but you may eventually get inspiration.