rejetto forum

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 - XCanG

Pages: 1 2 3
16
HTML & templates / Re: private messenger chat
« on: December 10, 2015, 09:34:07 PM »
Hi dj, but also think: what chat needed in HFS? Needed chat where users can open chat page (or see in left panel), see that other users or anonymous saying, say something if needed. Users need to be highlighted (like v3.1), so all people can understand this user staying in server or not (one-time random user), PM is also important, it the way saying to server admin some information, that need to transmit (because user don't know how to contact admin by mail, or messenger or other site) and admin can reading his special history file (chat_admin.txt for example). Or just chatting between anon→user or user→user.
About template. I think need to use template rather, than chat.htm, because in template you can use HFS logic. For example (also important note) user nick. If user=anon - he can use input field to come up with nickname, if user logined he/she don't view input, but sending on his own nick.

Just see this logic: (I use it to add registration field if user don't logined)
Code: [Select]
1 <h3><img src="/~img27">{.!Account.}</h3>
2 <div id='login' align="right">
3 {.if| %user% |{:%user%
4 <br/>{.if|{.can change pwd.} |
5 <button onclick='changePwd.call(this)'>{.!Change password.}</button>
6 .} <button onclick='location.href="~login"'>Logout</button>
7 :}
8 | <a href="#" onclick="location.href='~login';">Login</a>
9 <br><div id='registration'><a href="#" title="1 click — extend
2 click — shrink" onclick='regform()'>Register</a>
11 <div id='susp' class='hiddenr popupr'></div></div>
12 <script type="text/javascript">
13 function regform() {
14 var str = '\
15 {.if|{.{.postvar|modid.}=mod.roessi.register.}|{:\
16 {.if|{.and|{.postvar|name.}|{.postvar|password.}.}|{:\
17 {.if|{.{.postvar|password.}={.postvar|confirmpass.}.}|{:\
18 <div>You account:<br>{.postvar|name.} has been created compleately.</div>\
19 {.add to log|%ip% creating account with name {.postvar|name.}.}\
20 {.new account|{.postvar|name.}|password={.postvar|password.}|enabled={.modopt|mod.roessi.register|enabled.}|member of=Autoreg|notes=Autoreg.}\
21 {.for each|#access|{.femodsection|access|/|.}|{:{.set item|{.^#access.}|add access={.postvar|name.}.}:}.}\
22 {.for each|#upload|{.femodsection|upload|/|.}|{:{.set item|{.^#upload.}|add upload={.postvar|name.}.}:}.}\
23 {.for each|#delete|{.femodsection|delete|/|.}|{:{.set item|{.^#delete.}|add delete={.postvar|name.}.}:}.}\
24 :}.}\
25 :}.}\
26 :}.}\
27 {.if not|{.postvar|modid.}|{:\
28 <form method="post" name="register">\
29 Nick:\
30 <input type="text" name="name" class="textbox"><br>\
31 Password:\
32 <input type="password" name="password" class="textbox"><br>\
33 Confirm password:\
34 <input type="password" name="confirmpass" class="textbox">\
35 <input type="hidden" name="modid" value="mod.roessi.register">\
36 <input type="submit" action="" value="Registration">\
37 :}.}\
38 ';
39 document.getElementById('susp').innerHTML = str;
40 }
41 </script>
42 .}
43 </div>
And see at line 3,7,8,42. This is simple checking if user logined. You can also write template like that (example later).

Also, I do some changes in chat.htm
Quote
...
<body>
   <div>Name <input type="text"><input type="color" style="height: 28px;">
   <span onclick='document.querySelector("input[title=text]").value+="&amp;#"+event.target.textContent.charCodeAt(0)+";"; document.getElementById("text").focus();'>
   <span>&#9786;</span><span>&#9785;</span><span>&hearts;</span></span></div>
   <input id="text" type="text" size="60"  onkeydown="return returnpress(event);" title="text">
   <section>You are joined in chat.</section>

   <script>
function returnpress(event) {if (event.which == 13 || event.keyCode == 13) {send(document.getElementById("text").value); document.getElementById("text").value=""; return false;} return true;}

if(typeof(EventSource) == "undefined") alert("browser don't support SSE")
var t0, sec=document.querySelector("section"), col=document.querySelector("input[type=color]"), source = new EventSource("server/")
source.onmessage = function(event) {show(event.data)}

function send(txt) {
   txt=document.querySelector("input").value+"~=~ "+encodeURIComponent('<span style=\"color:'+col.value+';\">'+txt+"</span>")
   var xhr = new XMLHttpRequest()
   //xhr.onload = function() { }
   xhr.open("GET", "server/?text="+txt)
   //xhr.responseType = ""
   xhr.send()
}

function show(txt) {var d=new Date(); if(txt!=t0) sec.innerHTML="["+("0"+d.getHours().toLocaleString()).slice(-2)+":"+("0"+d.getMinutes().toLocaleString()).slice(-2)+":"+("0"+d.getSeconds().toLocaleString()).slice(-2)+"] \&lt;"+txt.replace(/~=~/g, "&gt;")+"<br/>"+sec.innerHTML; t0=txt}
</script>
</body>
</html>
1) First problem, that I found if I post smile in text field, it can't send if we don't typing nothing else, but if I use Enter checking, it work good.
2) If we click on smiles we lost focus and input can send without our permission, but method 1 solve this problem and I adding focus changing (after we post smile we back to input and can write easely)
3) Change formatting in fast chat (we don't see days, month, year) to this: [HH:mm:ss]. I think we need see y, m and d only if it changing, i.e. if time go to 24:00:00→00:00:00 in chat writed empty string with text: "Date DD.MM.YYYY"
Also please ignore ~=~, \&lt, .replace(/~=~/g, "&gt;"). This is trix to format chat that I need [HH.mm.ss] <nick> text. I say about it earlier.

Now about example. If we use hfs.diff.tpl instread of chat.htm, and use same code, but with some changes:
Code: [Select]
{.if| %user% |{:<div><input type="text" style="display:none;" value="%user%">:}|<div>Name <input type="text">.}<input type="color" style="height: 28px;">(first line after <body>)
See at the result. (Of course you need to test without login and with login.)

17
HTML & templates / Re: private messenger chat
« on: December 09, 2015, 10:20:30 PM »
Hm, this method have strange long updating after I send messange and I think this is bad method. Just think: this chat no have history, so users need only reading chat in online, BUT because updating so long (about 5 sec), think if chat using 10 users, so in one second 2 users (No.1 and No.2) send message, in next second send another user (No.3), but some people recieve message one of user in group of first two (No.2>>No.1), read and send answer (No.4), some people in other time request to recieve message and recieve message user No.3 send him answer (No.5). So user No.4 recieve message user No.5, but user No.5 recieve only his message. Just because every new message replace in chat.txt all content.

I think this is bad method, because chat requires instant messaging and staying in chat (no have history), but if users accept the terms, if chat call high speed traffic then it will not cope with this problem. It's like it is not working.

P.S. sorry for my English, I think I write this text bad.

18
HTML & templates / Re: private messenger chat
« on: December 09, 2015, 09:22:03 PM »
Hm, no way to save history? May be use chat.txt + history.txt
When user open page he's loading history.txt
Also this is better to use:
Code: [Select]
txt=document.querySelector("input").value+": <span style=\"color:"+encodeURIComponent(col.value)+";\">"+txt+"</span>"
Woops, I writed it for 4.0. But also think about quotes in style=""


For 4.1:
Code: [Select]
txt=document.querySelector("input").value+": "+encodeURIComponent('<span style=\"color:'+col.value+';\">'+txt+"</span>")

19
HTML & templates / Re: private messenger chat
« on: December 08, 2015, 01:30:20 PM »
I tried your template and understand now your problem.
Try first without modifying the time.
You can modify the  --- in line 21 and last line(30). Must both be the same!

Before use this variant I use long dash "—" and it's work fine. Just type & # 8 2 1 2 ; on place "---"

20
HTML & templates / Re: private messenger chat
« on: December 08, 2015, 07:33:08 AM »
I don't understand, what you mean with [ or ] char.
Enter  [] character in text field works.
\r?\n is a linebreak (https://en.wikipedia.org/wiki/Newline)
Try this hfs.diff.tpl:
Code: [Select]
{.comment | <!-- Define special:begin -->.}
{.set | pass | !clear .}
{.if | {.regexp|{.?room.};|{.get|accounts.};.}| {:{.set | room |{.?room.}.}:} .}
{.set | chatfile | %folder%chat_{.^room.}.txt .}
{.set | chattext | {.load|{.^chatfile.} .} .}
{.set| maxlength | 10240.}

{.comment | <!-- Limit Length of file and reset it when pass is given -->.}
{.if|{.length | {.^chattext.} .}>{.^maxlength.}|
  {. set | chattext |{.cut||{.div|{.^maxlength.}|2.}|{.^chattext.} .}/set.}
 /if.}
{.if|{.?text={.^pass.}.}|{:{.save | {.^chatfile.}|.}:}.}

{.comment | <!-- Save chat file on hard drive -->.}

{.if| {.and|{.?name.}|{.?text.}|{.not| {.?text={.^pass.}.}.}/and.}
     |{:
          {.set | chattext |</b>&gt; {.?text.}
{.^chattext.}.}
{.if | {.=|{.?name.}|%user%.}| {:{.set | chattext |&#8505;{.^chattext.}.}:} .}
          {.set | chattext |&#91;{.time.}&#93; &lt;<b>{.?name.}{.^chattext.}.}
          {.save | {.^chatfile.}|{.^chattext.} /save.}
      :}
/if.}

{. if | {.?delta.} | {:{.regexp|\r?\n|var=chattext|replace=<br>.}{.regexp|(.*){.?delta.}.*|var=chattext|replace=$1.}{.^chattext.}:} .}
{. if | {.?info.} | {.get account | {.?info.} | notes.} .}
{. if | {.?user.} | %user% .}
{.comment | {. if | {.and|{.?name.}|{.?text.}|{.not| {.?delta.}.}.} | message sent .}.}
{. if | {.?del.} | {:{.regexp|^\s?{.?del.} &#8212; .*$\r?\n?|var=chattext|replace=.}{.save | {.^chatfile.}|{.^chattext.}.}:} .}

21
HTML & templates / Re: private messenger chat
« on: December 07, 2015, 08:57:38 PM »
v3.1

About formatting, it is possible to format:
Code: [Select]
[time] <name> textJust because if I use [ or ] char, text in chat will be adding at end every time it update. I thing problem in regex and in this line in hfs.diff.tpl
Code: [Select]
{. if | {.?delta.} | {:{.regexp|\r?\n|var=chattext|replace=<br>.}{.regexp|(.*){.?delta.}.*|var=chattext|replace=$1.}{.^chattext.}:} .}But I try to think how it work and do not understand. {.^chattext.} at the lasi is the main text (if I don't use it - text don't appear), so may be problem in \r?\n or (.*){.?delta.}.*
First is Enter symbol, second I don't know (because don't know on that replace {.?delta.} string).

Anybody know how it fix for [] character?

22
HFS ~ HTTP File Server / Re: New version: 2.3g
« on: December 07, 2015, 06:25:39 PM »
It is possible to add grouped download bar for segmenting downloads? Download Master program like separate files per segments and parallel download it, but in log it seems too bulky.


This is 2 users, that download 2 files by using agent Download Master. It good, if we see every part of download, but if we can collapse every group of download in one line it would be best, because not every time we need to see full detalis, rather than quick overview.

Also, my suggestion is adding style changing for log. I use black (inverted) scheme in Windows, for this situation I do gray color of window (to view black text like this).
I also say thanks if you adding only two themes (switching between white (default, white window - black text) and black (black window - white text) themes).

23
HFS ~ HTTP File Server / Re: 2 dns
« on: March 11, 2014, 04:14:05 PM »
Maybe... try to open two copies HFS and in the first set to one DNS, the second - to another.

One problem, that may cause: ports, but I think that it can be solved.

24
Beta / Re: Testing build #286
« on: December 18, 2013, 01:32:38 PM »
this is a very well-known problem.
http://www.rejetto.com/forum/bug-reports/please-do-unicode/
mm, I don't writing in none-beta subforum, because I use beta hfs. Now, about this topic I will write in the topic to which you refer.
HFS3, and it already has unicode.
I can go for it right now in order to my server functionality have been better and I would have been rewritten the template file.

25
Beta / Re: Testing build #286
« on: December 11, 2013, 06:19:07 PM »
Now, in Beta subforum locked for adding new threads? Ow, ok.

In our forum a theme repeatedly raised about "Unicode characters". But I asked again: Could hfs support Unicode, especially as UTF-8?
The fact is my file containing Japanese characters and is not displayed in the list of available files. These characters are not just symbols, it's a alphabetic characters.

You can check on this file name:
京騒戯画 第二弾5話 (終) 「古都、黒兎回想録」 (ONA 1920x1080 x264 AAC).ass
Also, file in attachment.

It must be maintained! This also expand opportunities of your program.

P.S. HFS #287

26
Beta / Re: paging with many files
« on: June 04, 2013, 05:06:18 PM »
I forgot to write on time.

The problem was only one line:
<script type="text/javascript" src="/jq.js"></script>
Here I include my jQuery, but rather just another version 1.8.3
And with that line problem was solved:
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
Still, it is possible to use the library 1.8.3 instead 1.4.4?

27
Beta / Re: paging with many files
« on: April 26, 2013, 01:40:34 PM »
crazyboris, that's the problem. The original script and the one in the tpl-file are the same. And I have not changed it. Maybe there are some another dependent parts of the code?

rejetto, if I start to do it all over again, chances are that get on the same thing, because all I was doing it: stylized design (css) and translated into my language all the titles and error pages.

28
Beta / Re: paging with many files
« on: April 02, 2013, 09:25:31 AM »
Try yourself the default template and see.
hmm. In a default template page switcher working good, but in my template I didn't change this javascript. How return working this script without starting a new template?

29
Beta / Re: paging with many files
« on: March 29, 2013, 12:39:36 PM »
i see you have 15k files in your folder.
On my i7 with SSD it took 24 seconds to get 2k files the first time, and 10 seconds later.
I bet you are getting very terrible times with your configuration,  how can it be acceptable?
you should reorganize your files in more folders.
I took at first time in 3 minutes, and next time in 1 minute(all time, see next). But this is not a problem, the problem lies elsewhere. When the browser starts to load the page first: it hangs for 10 seconds; second: switches pages do not work properly. 1 page: 1—N; 2 page: 2—N+1; 1000 page: 1000—N+999 (P.S. original javascript don't changing) this is not good. The only solution is to display all.
About this folder: I can not reorganize it, and I'd rather use the links to the files in it, rather than a reference to the folder.
Quote
I bet you are getting very terrible times with your configuration
Do not have anything like this. HFS does not load my computer, and he has such a configuration:
Processor    x86 Family 15 Model 3 Stepping 4 GenuineIntel ~2999 MHz
Memory(RAM)   2 304,00 MB
Hard Disk    WDC WD2001FASS-00W2B0 2 TB

30
Beta / paging with many files
« on: March 24, 2013, 06:02:11 PM »
Hello! Can you improve it somehow change pages? I would be very happy ^_^°

PS interface translated into my language, it does not pay any attention

Pages: 1 2 3