Recent Posts

Pages: 1 2 [3] 4 5 ... 10
22
Bug reports / HFS Documentation (English)
« Last post by dj on July 10, 2018, 01:00:38 AM »
23
HTML & templates / Re: Need help with file delete feature
« Last post by dj on July 09, 2018, 12:27:37 PM »
[file]
Code: [Select]
{.if|{.get|can delete.}|<span onclick='del("%item-url%")'>x</span>.}
and add script
Code: [Select]
<script>
function del(it) {
if(!confirm("Delete "+it+"?")) return 0;
var xhr = new XMLHttpRequest();
xhr.open("POST", "%folder%")
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
xhr.onload = function() {document.write(xhr.responseText);}
xhr.send("action=delete&selection="+it)
}
</script>

tested with chrome,FF,Edge


Update: more elegant

[file]
Code: [Select]
{.if|{.get|can delete.}|<span class='del' data-it='%item-url%'>x</span>.}
and add script at the end
Code: [Select]
<script>
document.querySelectorAll('.del').forEach(function(userItem) {
  userItem.addEventListener('click',function(){del(this.getAttribute("data-it"))})
})
</script>

or use a single event handler


Update2: if {.get|can delete.} slowes down, you can try

[file]
Code: [Select]
<span class='del' data-it='%item-url%'>x</span>
and add to function del
Code: [Select]
if (!'{.get|can delete.}') return 0
24
Я использовал NOIP. С полгода всё работало, потом опять та же песня. Взял в Ростелекоме статический айпи- помогло.
25
HTML & templates / Re: Chat for HFS.
« Last post by username1565 on July 08, 2018, 07:21:42 AM »
Also, I want to recommend you all to see this:



This is web-based interface for Tox!
Here is source code: https://github.com/codedust/WebTox and there is server-side code, writed as .go files.
This must to be compiled and this is a different server.
GO-installer have over 100 MB size. Not good for downloading.

Utox, Toxcore, or http://isotoxin.im/
this all is a P2P-programs, yes this can working in LAN,
and there is, inside the p2p tox-programs, already exists server-side soft.
But tox-programs is not web-based chat. So, webTox can make this web-based.

In this case, compiled go-files code in server-side of webtox
can be included in HFS server code, and working if tox-node will be running.
But I think this will make more sence, if WebTox will be included in server-side code for tox-programs.

So I just leave this here, and you can learn Tox working principles
and include something of this in HFS.
For example, NaCl encryption, with generate private key and public key,
or DHT to make peer exchange - all this can be inside HFS.
26
HTML & templates / Re: Chat for HFS.
« Last post by username1565 on July 08, 2018, 07:10:36 AM »
Also, as example, I can leave here this chat: https://www.pubnub.com/developers/demos/10chat/
If two tabs with this, in browser, will be opened together, you can chat with yourself.
This chat not a p2p, and this need to register room or channel on the site pubnub.
But I think traffic will go between peers, and the channel don't save the traffic.
I think this, because reloading the page not give all previous messages.
In this case pubnub channel working as relay server or stun server for peer exchange and then chat is really P2P.
This can working in LAN if stun server or relay server will be inside HFS.

Also, I want to recommend you all to test this WebRTC-examples: https://github.com/muaz-khan/WebRTC-Experiment/
There is examples for file-sharing, voice chat, and webcam-chat,
but this not a p2p, not working in LAN without Interned,
and this all working with requirements for runing server-side code,
and need socket.io, or Peer.js to be runned on node.js.
Node.js source code is to large to be included in HFS server but maybe can using
minify and compactly implementation for requirements only this all.
27
HTML & templates / Re: Chat for HFS.
« Last post by username1565 on July 08, 2018, 06:56:47 AM »
Maybe there is possible to add websockets, or another methods, like WebRTC.
Maybe there is possible to add file sharing, webcam-streaming, or voice chat.
In this case, HFS can working just as relay-server (like IRC), or as a STUN-server, without large traffic loading.
STUN server need only to make peer exchange!

For example, this chat https://github.com/ScaleDrone/webrtc-text-chat-tutorial/
can be downloaded as zip, and this working in HFS, like web-based p2p chat,
but only when Internet connection exists.
Else, this not working, and in script.js you can see this:
Quote
stun:stun.l.google.com:19302
This is just a public STUN server for making peer exchange through NAT:
https://gist.github.com/mondain/b0ec1cf5f60ae726202e

In the case of using stun server or relay servers, no need any loading of traffic on HFS,
for example if webcam or voice chat will be using by users.
This users will be a peers, will connected each by each,
and stun server inside HFS
will make the warranty of stable peer exchange in this P2P chat.
28
HTML & templates / Chat for HFS.
« Last post by username1565 on July 08, 2018, 06:05:22 AM »
Hello. I'm from here: https://github.com/rejetto/hfs/issues/7

I'd implemented the file-chat for HFS, using Javascript and JQuery.
This connected to HTTPFileServer, using XHR-queries (you can see this in browser, in console.log).

Source code you can find in attached file, then you can test this.
To make this workable, put (by using drag and drop)
the folder "Upload_messages" inside the main folder of this chat in HFS
and make this uploadable for anyone.

Best regards.
29
HTML & templates / Re: Responsive small screen template
« Last post by dj on July 07, 2018, 08:07:50 AM »
Put the hfs.diff.tpl in your picture-folder.

Added close × (Esc) button,
fullscreen ⛶  (click first image on the left)

30
HTML & templates / Re: Jpg-image Template
« Last post by dj on July 06, 2018, 12:09:50 AM »
Don't change the standard template. Put the hfs.diff.tpl in your picture-folder. http://rejetto.com/forum/index.php?topic=11754.msg1061359#msg1061359

For preview pict you need thumbnails (or a lot of memory)
check if you have thumbnails in your photos http://exif.regex.info/exif.cgi
otherwise you can generate it with http://rejetto.com/forum/index.php?topic=11298.msg1061004#msg1061004
Pages: 1 2 [3] 4 5 ... 10