Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
@ leo :) i did it :)
Sorry for being a little off the forum (I'm barely having free time lately). About what you want, I think the most easy solution is to "clone" (copy and paste) the code of the "Select" or "Sort" buttons (from the Live 3 template), and add the buttons you want, copying only the functions found on the default template. I'm not good editing templates, so, it's not an easy task for me (it could take me a lot of time, which I currently don't have). May be you or someone else here could do this.
Cool! :)
22
@ leo :) i did it :)

Sorry for being a little off the forum (I'm barely having free time lately). About what you want, I think the most easy solution is to "clone" (copy and paste) the code of the "Select" or "Sort" buttons (from the Live 3 template), and add the buttons you want, copying only the functions found on the default template. I'm not good editing templates, so, it's not an easy task for me (it could take me a lot of time, which I currently don't have). May be you or someone else here could do this.
23
HFS ~ HTTP File Server / Re: Wrong encoding in SaveAs dialog in Chrome
« Last post by Winand on May 15, 2018, 06:04:45 AM »
Oh! I understand now. I've set spanish interface in Chrome, so it fails to interpret russian filenames. If I change interface to russian everything is ok.
24
HTML & templates / Update. faster page loading
« Last post by danny on May 15, 2018, 04:00:30 AM »
Updates are located at the first two posts. 

I completed the transition to Unicode icons so that Throwback4.tpl never uses an http request for icon display.  That provides significantly faster support for multiple users.  Brisk browsing is possible despite multiple concurrent downloads.
25
{.load|http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso|/Upload.}
That loads 5596 bytes of the iso into ram.  Needs the {.save


However, from rejetto's posts, I found an example of saving big files 
Except that the chunk size maximum is bigger than the buffer, which may fill and exit.
{.set|#url|http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso.}
{.set|#out|test.}
{.set|#from|0.}
{.set|#chunk|1000000.}
{.save|{.^#out.}|.}
{.while|chunk|{:
   {.load|{.^#url.}|var=#x|size={.^#chunk.}|from={.^#from.}.}
   {.if|{.length|var=#x.}
      | {:{.append|{.^#out.}|var=#x.}
         {.inc|#from|{.length|var=#x.}.}
        :}
      | {:{.set|#chunk|0.}:}.}
:}|timeout=0.}

I guess you could try the chunk size at 4096 if that is bytes or 32768 if bits?  Hard drives write 4k chunks.  Even 5k might work; but, larger would probably exit the script before it could append more.
Might want to replace "test" with the destination?  Folder or filename?
Seems that "Remote Upload" is in alpha status. 

P.S.
Maybe Openmediavault has Remote Upload for your Raspberry Pi? 

26
Hi there! I was reading these wiki pages (Template macros & scripting commands), trying to being able to download and save an external file to the current folder (Remote upload), but I can't get it working.

Please check my code (in my example, there is an URL already loaded, of a Tiny Core Linux ISO file). The following code works fine, but it's NOT recommended as it could overload the RAM if you are downloading a big file (I only leave this as reference):

THIS CODE WORKS:
Code: [Select]
<form method='post'>
URL: <input name='url' value="http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso">
<br>Filename: <input name='dest' value="%folder%Core-9.0-GOOD.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest| {.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.} .}

{.load|{.^url.}|var=data.}
{.and
| {.length|{.save| ./{.^dest.} |var=data.}.}
| Downloaded {.^dest.} for {.length|var=data.} bytes
.}

The following is the recommended code by rejetto here (chinking the file every 1MB), but it doesn't work as expected (the download has a never ending loop). This code not only doesn't work, but besides that, it also have missing the text "Downloaded Core-9.0.iso for 13256704 bytes" and the event doesn't get logged on HFS's log.

THIS CODE DOESN'T WORK: (why?)
Quote
<form method='post'>
URL: <input name='url' value="http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso">
<br>Filename: <input name='dest' value="%folder%Core-9.0-BAD.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest| {.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.} .}

{.set|from|0.}
{.set|chunk|1000000.}
{.save|{.^dest.}|.}
{.while|chunk|{:
   {.load|{.^url.}|var=data|size={.^chunk.}|from={.^from.}.}
   {.if|{.length|var=data.}
      | {:{.append|{.^dest.}|var=data.}
         {.inc|from|{.length|var=data.}.}
        :}
      | {:{.set|chunk|0.}:}.}
:}|timeout=0.}

Could someone point me where is the fault?... :-\
27
HTML & templates / Updated for even more speed.
« Last post by LeoNeeson on May 12, 2018, 04:34:57 AM »
P.S. My other project is startfetch.com  Picture this, you're at your pc, your phone messenger goes off (facebook, hangouts, whatsapp), and do you go get it to type on the little screen if the battery permits, or do you go to startfetch.com, click once and enjoy the full size keyboard?  Peek under the hood (view source) and check the code.  That another case of "looks simple, after it is done" and that all fits in just 24k.
That was fast! opening StartFetch.com was blazing fast (I see you've encoded icons in Base64 to speed things up, nice trick). I really miss those good old days where every website was almost as fast as that. But on these days, only checking emails via webmail, could take 1.5MB at best (and all thanks to WebFonts and JavaScript libraries). Thanks God there is still POP3/IMAP to check emails, but for all the rest, I get used to overload my browser to view just a simple website. And the same happens with software and games, everything it's made to make our PCs slow without sense. That's why I love HFS, because it's small enough to be a full featured-packed program.

Anyway, I do that remoting task myself, not with a web server, but with tightvnc (or realvnc) on the server and bvnc on the phone.
Thanks, I'll have a look to bVNC (it looks good).

That's a server-side script, possibly ajax? I don't know how to do that.
Don't worry. I'll leave the question open if someone else knows what server-side script (macro) use.

Revised to double the speed.  Updates at post#1 and 2. 
Good work! :)
28
HTML & templates / Updated for even more speed.
« Last post by danny on May 12, 2018, 03:35:56 AM »
Revised to double the speed.  Updates at post#1 and 2. 

Now, it goes maximum speed by default.  The pingdom test reports: Faster than 99% of websites. 

Extra features, such as that delete button, can be provided for a specific folder, without slowing your other folders.  This method is much faster than provisioning that button site-wide. 

P.S.
This got put to work on my own server. 
29
Love the simplicty, and ease / look
( if eel like i can finaly use standard html coding to hfs again :)

On another not,

I think the CSS and HTML code (JavaScript could active the login box, here is what w3 schools has about it.0

https://www.w3schools.com/howto/howto_css_login_form.asp

looking into this

I only know of a php soulion to the web form, w3 scholls claims thaetre is a jhavascript (ajax/arco/etc)
way to acomplis a login form

thanks fr your help/support and work danny
30
HFS ~ HTTP File Server / Re: Wrong encoding in SaveAs dialog in Chrome
« Last post by bmartino1 on May 11, 2018, 05:15:21 PM »
The encoding is an issue inside hfs, not the webpage.

Adding a web page character set will still alow a browser to see the character set code:

https://www.w3schools.com/html/html_charset.asp

Code: [Select]
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
Pages: 1 2 [3] 4 5 ... 10