Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - LeoNeeson

Pages: [1] 2 3 ... 30
1
HTML & templates / Re: Chat for HFS.
« on: July 16, 2018, 02:25:05 AM »
@username1565: Your idea is very interesting. I've tested it, and it works well, but I've also found some issues and ideas for enhancements.

Possible small enhancements:
- (Bug) if we insert ":" in a message, then any text/word after that is not shown.
- Automatically scroll-down messages, so we can always see the last posted message.
- Show the number of users online, or even better, have a simple online user list.
- Save/remember nickname on a cookie, and allow change nickname when clicking on it.
- Add an optional 'Send' button (as a fail-over, for old browsers not detecting when the 'Enter' key is pressed).

Possible complex enhancements:
- Privacy: If possible, save messages using the epoch Unix Time, to avoid someone automatically stealing all the messages, since it's currently searching for "message (2).txt", "message (3).txt", etc. which can be easily guessed. But since this can be very complex to implement, I have another better idea:

- Add a private chat mode: when a private chat with some user is started, a new window is opened, and a new -temporal- folder is created on HFS, with a random folder name (for example "TempChat-5560AFHG"), so, another users can't guess the folder path and steal or retrieve private chats. Folder name should be automatically exchanged in background, without user intervention. And when one of the users close your browser, the private chat ends, and the another user gets a message like 'John has closed this chat' (similar as IRC). And then, we can also automatically delete that temporal folder, when both parts close the window. We can also create a -permanent- private chat (with a folder name like "PermChat-EASY777"), adding a button to make it, so if 2 users know the 'private chat name' (aka: private chat folder name), for example "EASY777", then, they can join the chat anytime without having to post anything on the public chat (that folder stores the messages permanently). So basically, we can have a public chat, and a private chat and all without a database or anything special.

You can also check the chat made by DJ, here (which can give you some new fresh ideas).

Cheers,
Leo.-

2
Bug reports / Re: HFS Documentation (English)
« on: July 16, 2018, 02:14:06 AM »
also found a old revision
http://rejetto.com/wiki/index.php?title=HFS:_Template_symbols&oldid=5607
That's right. Most of the deleted Wikis are still available clicking on 'View history', then on the date of some revision (I've made another mirror of that Wiki page here, just in case). I hope Rejetto can make some time to at least fix the login error, so we can start fixing those errors, reverting those wikis to the last good revision. I've read somewhere that login error could be fixed updating the MediaWiki engine to the latest version, but I'm not sure (I've reported this bug several months ago, here).

3
I was referring to this:After the button is clicked, then that may be a good spot for a photo thumbnail, players, etc...

Also, I had a thought about the speed--duplicate call to %item-url% costs +25% delay and another +5% for the span tag (the sum is about a third); so, howabout no extra button whatsoever, but, instead long-click or right click the filename, and then only one call to %item-url%? I wonder if that is possible.
I've uploaded a mockup of this to give you an idea (it only works the first menu, but needs the correct code to work properly). It's based on the latest Throwback7.

To work fast and don't overload the server, %item-size% and %item-modified% should be only asked to the server "on-demand" when we click on the menu button (I've commented some unused code, and when everything is working, then we could expand the functions and add more buttons on the menu, to handle music and video files, like the original Throwback7 had).

4
I wish I could have an answer to help you to complete this, but sadly I don't know how to we can make a JavaScript function work correctly with a HFS Macro (like %item-added%). I was thinking using a 'onclick' action call to show a modal with a few option buttons.

And today I've found something interesting here to start testing with (I've adapted and minified the code, just to give you an idea, so you can replace the actual red 'delete' button, with this new 'plus' green button). Have a look:
Code: [Select]
<html>
<head>

<style>
.modal{display:none;position:fixed;z-index:1;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:#000;background-color:rgba(0,0,0,.4)}.modal-content{background-color:#fefefe;margin:15% auto;padding:20px;border:1px solid #888;width:50%;text-align:center}.close{color:#aaa;float:right;font-size:28px;font-weight:700}.close:focus,.close:hover{color:#000;text-decoration:none;cursor:pointer}
</style>

</head>
<body>

<button id="MoreInfoBtn" style="background:transparent;border:none;color:green;">&#10010;</button>

<div id="InfoModal" class="modal">
  <div class="modal-content">
    <span class="close">&times;</span>
    <p>FileSize: %item-size%</p>
    <p>TimeStamp: %item-added%</p>
    <button value=1 class="option_button">Rename</button>
    <button value=2 class="option_button">Delete</button>
    <button value=3 class="option_button" onclick='moveClicked()'>Move</button>
  </div>
</div>

<script>
var modal=document.getElementById("InfoModal"),btn=document.getElementById("MoreInfoBtn"),span=document.getElementsByClassName("close")[0];btn.onclick=function(){modal.style.display="block"},span.onclick=function(){modal.style.display="none"},window.onclick=function(n){n.target==modal&&(modal.style.display="none")};
</script>

<script>
document.querySelectorAll(".option_button").forEach(function(o){o.onclick=function(){window.alert(o.value)}});
</script>

</body>
</html>

It's only a basic idea, still needs some work to be done to function properly.
 

5
HTML & templates / Re: Need help with file delete feature.
« on: June 01, 2018, 10:22:36 PM »
Back when the web was new, sites had a sharp clarity look. The blue&silver colors probably help too. The 90's style of HTML forces more attention to detail, like using a little paint brush instead of a big paint brush.
+1 for using <marquee><b>HFS</b></marquee>, that gives the nostalgic touch. :)

The problem:
Slowdowns are caused by a feature inside file list loop (load*files*users).
Macros and server side scripts are disaster when magnified times the number of files.

Example:
Currently, the delete feature costs 28% of the speed when done like this:
   {.if|{.get|can delete.}|<td class=rw align=center><form method='post' id='filelist'><input type='hidden' name='selection' value='%item-url%'><button type='submit' name='action' value='delete' class='del' onclick='return confirm("Delete %item-name%?")'>X</button></form></td>.}
if 40 users browsing 1000 files, the code gets 40,000 times bigger, and you get a broken server
Sometime ago, I was thinking in another approach: removing the delete button, and adding a "+" button instead, which when clicked, it opens a modal screen (in dark grey color) with three nice and big buttons, giving options like: Rename, Delete and Move (and we could even add a 'Send to' when using a mobile). This way, the 'server side' check (to verify if we could delete the file), is only processed on-demand when that "+" button is clicked. I think this could be a win-win situation to solve this, not only because we don't overload the server, but we also add more options. The hard part is coding it... :-[

6
HFS ~ HTTP File Server / Re: HFS Network Storage Integration
« on: June 01, 2018, 10:22:10 PM »
@Funtime60: I don't know how you add those drives on HFS, but I think you should try adding those network drives not using 'drag-and-drop'. Do this way: right click on the 'House' of 'Virtual File System', and click on 'Add folder from disk...' then click on 'Real folder'. To do this, the network drive should be already listed on 'My PC' first. If it's not listed there, follow the next steps to mount the network drive, reading a guide HERE.

If it's not working, please attach a screenshot of your HFS.

7
there is a serious security hole in the use of this script, this one in the state allows access to the entire hard disk hosting HFS
Thanks for reporting the security issue. I've updated the first post to warn users about this.

I am studying the case taking into account the eventuality where the source file would be also the file of destination and would be destroyed irremediably during the transfer and its size becomes zero
Do you mean: if the same destination file exist, then delete the destination file? I think it's better to automatically rename the destination file, not to delete/overwrite it. So, if destination file ("filename.zzz") exists, then save new file destination as "filename_001.zzz". If "filename_001.zzz" exists, then save as "filename_002.zzz", or "filename_003.zzz", "filename_004.zzz", and so on...

8
More info would be needed, like HFS version you use, operating system, CPU model, and confirm if you are using the default HFS template.

Try disabling for a few minutes any security suite (antivirus), and see if this continues (most antivirus automatically scans any incoming/outgoing files and this could hang your PC).

9
HFS ~ HTTP File Server / Re: Why a session is limited to 1GB?
« on: May 27, 2018, 10:50:19 PM »
It could be your ISP. It's recommended to always use a Download Manager if you are having issues  (you can see a list of Download Managers here). HFS does NOT limit the amount you could download.

10
See if this post helps you.

11
HTML & templates / [Testing] Remote upload (Macro)
« on: May 26, 2018, 10:06:25 PM »
@Mars: After doing several tests, everything seems to be working OK, but somehow, I've found a small rare bug/issue: if connection gets closed (or dropped) by the remote server (or by bad connection quality) while downloading a chunk, then the result was getting a corrupted file (I've ended up with a corrupted 15,7MB file, instead of being 12,6MB). It only happened once, and then I couldn't recreate the error. I don't know if we can get a workaround or modify the code to avoid bugs like this happen again, but I will leave you the logs of my tests:

GOOD download (normal log):
Quote
10:25:05 127.0.0.1:1281 Requested GET /
10:25:13 127.0.0.1:1281 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:25:34 127.0.0.1:1281 chunk=10000000 from=0 size=10000000
10:26:08 127.0.0.1:1281 chunk=3256704 from=10000000 size=3256704
10:26:09 127.0.0.1:1281 saved file contain 13256704 bytes
10:26:09 127.0.0.1:1281 Requested POST /

BAD download (issue log):
(Marked in bold = are the abnormal execution of code)
(Marked in red = comments added by me to describe the situation)
Quote
10:36:05 127.0.0.1:1257 Requested GET /
10:36:17 127.0.0.1:1257 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:36:53 127.0.0.1:1257 chunk=10000000 from=0 size=10000000 > Connection dropped!
10:37:16 127.0.0.1:1269 loading from 'http://distro.ibiblio.org/tinycorelinux/9.x/x86/release/Core-9.0.iso' 13256704 bytes
10:37:38 127.0.0.1:1269 chunk=10000000 from=0 size=10000000
10:37:47 127.0.0.1:1269 chunk=3256704 from=10000000 size=3256704
10:37:48 127.0.0.1:1269 saved file contain 13256704 bytes
10:37:48 127.0.0.1:1269 Requested POST /
10:37:48 127.0.0.1:1257 chunk=3256704 from=10000000 size=3256704 > WTF!?
10:37:49 127.0.0.1:1257 saved file contain 13256704 bytes > Not true, file was bigger, (exactly 16513408 bytes)!
10:37:49 127.0.0.1:1257 Requested POST /

Code used (RemoteUpload3.tpl):
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.iso">
<br><input type='submit'>
</form>
{.set|url|{.postvar|url.}.}
{.break|if={.not|{.^url.}.}.}
{.set|dest|{.or|{.filename|{.postvar|dest.}.}|{.filename|{.^url.}.}|downloaded.}.}
{.delete|{.^dest.}.}
{.add to log| loading from '{.^url.}' {.filesize|{.^url.}.} bytes .}
{.break|if={.not|{.filesize|{.^url.}.}.}|result=Source file can't be downloaded: server return nul size.}
{.set|from|0.}
{.save|{.^dest.}|.}
{.comment| define CHUNK with the min size, if nul then WHILE is never executed.}
{.set|chunk|{.min|{.filesize|{.^url.}.}|10000000.}.}
{.while|chunk|{:
   {.load|{.^url.}|from={.^from.}|var=data|size={.^chunk.}.}
   {.add to log| chunk={.^chunk.} from={.^from.} size={.length|var=data.}.}
   {.if|{.length|var=data.}
      |   {:
         {.append|{.^dest.}|var=data.}{.inc|from|{.length|var=data.}.}
         {.comment| redefine CHUNK with the min size, if nul then WHILE is stoped.}
         {.set|chunk|{.min|{.^chunk.}|{.sub|{.filesize|{.^url.}.}|{.^from.}/sub.}.}.}
         :}
      | {:{.set|chunk|0.}:}
   /if.}:}
   |timeout=0
   |else={:{.add to log|Error during WHILE.}
   :}/while.}
{.add to log| saved file contain {.^from.} bytes.}

» Ideas for solutions/enhancements: I don't know if there is a way to 'detect' if a connection was closed (or dropped) while downloading a chunk, but I think a simple verification of file size after finish the download, could be of help. Also, perhaps a 'progress' bar could be of help, meanwhile the file is downloading (if the download on the server takes too long).

I was trying to add a 'progress' bar, like HFS has by default for uploads (useful if the download on the server takes too long), but using %progress-files%, %total% and %speed-kb% doesn't seem to have effect.

12
HTML & templates / Re: Update. Phone friendly.
« on: May 26, 2018, 09:15:35 PM »
@Mars: thanks for the explanation! (I've found very interesting how '[+special:alias]' work, especially on how we can combine macro code with an alias (an alias that works almost the same as a 'variable'). It surely gives endless possibilities and makes the code more easy to handle.

@Danny: I've tested the new Throwback7.tpl and this is getting better and better (that gradient background looks great). By the way, I don't see any more enhancements available without slowing down the server, so, it's done for me, at least for now.

Cheers,
Leo.-

13
The table can't have every col as a % because then the delete button won't appear.  On the phone, it is intentionally expanded off the right side, when the phone is held vertical; and that's because it is more important to see the filenames than to have the table stay within the bounds of the screen (especially 5cm screen).
@Danny: I agree, my mistake, sorry, I didn't have enabled the delete button when doing edits (take all this like my customized and very experimental version, you don't have to incorporate my changes to your version, which is already working great).

I choose to cut file names, because I usually have very long file names and they look like a mess on small screens. With JavaScript, I was also planning to use the tag 'title' to show the complete filename on mouse over, but on phones I guess that won't work).

To show %item-modified% as MM/DD/YYYY, change this:
%item-modified%

...to this:
{.cut|1|10|%item-added%.}

(Source)



@BMartino1: I was thinking in adding a "Parent Directory" item (like another item on the file list), at the top of the file list (except on root), like Apache usually does. See how this works, on this live example: https://unicode.org/Public/emoji/



I still have to see how to hide columns on small screen sizes (too much work for today, perhaps I'll do it on the next few days)

(I've uploaded a new revision, here. Report any bugs, if you find them)

14
Small enhancements:

Throwback6x.tpl - Change log:
- Font smoothing
- One line per file
- New background color

Throwback6y.tpl - Change log:
- New transparent delete button.
- Now displays only the file date
- Small tweaks on column width
 
Still missing:

- Hides columns if screen is small
- Use divs instead of tables? (info)
- "Parent Directory" like apache has.

(Feel free to fix/enhance it, if you find something wrong)

Cheers,
Leo.-

15
@Rejetto: There is no hurry for me, take all the time you need before publishing a new stable version (I also confirm that the 'remote upload' feature works perfect now on this new build). :)

@Mars: Your code posted here works fine with local files (and with small changes on the code, also with external files).

» EDIT: I'm currently doing several tests...
(I'll post the results on the next few days).
;)

Pages: [1] 2 3 ... 30