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

Pages: 1 2 [3] 4 5 ... 123
31
HTML & templates / Re: base64 Re: Responsive small screen template
« on: November 03, 2018, 09:36:01 PM »
it seems that I'm not up to date I'm only with OverbyteIcsV6
Quote
// ============================================================================
// D5-implementation of "US Secure Hash Algorithm 1 (SHA1)" (RFC3174)
// Copyright (c) 2001, Juergen Haible.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
// ============================================================================

{------------------------------------------------------------------------------
Update by F. Piette for ICS (http://www.overbyte.be)
Jan 10, 2004 Defined uint32_t as LongWord instead of LongInt
Jul 23, 2004 Revised SHA1Reset to check for nil reference to comply with RFC-3174
             Made the unit compatible with Delphi 2
May 08, 2007 Added a few casts to uint32_t to constants.
Jul 30, 2007 V2.00 Updated for .NET
Mar 24, 2008 V2.01 Made some changes to prepare code for Unicode
                   Use only AnsiString

------------------------------------------------------------------------------}


 with a portable vesion of Borland® Delphi® for Microsoft® Windows™ Version 10.0.2558.35231

all the resources I add are placed in a separate subdirectory in lib and added to the options in the form $ (BDS) \ lib \ ... ,  this allows my delphi to be transferred to any media as usb key for use  it on any machine

32
HTML & templates / Re: base64 Re: Responsive small screen template
« on: November 03, 2018, 09:07:54 PM »
for my use I would just add aliases  ;D

encode64=base64|$1
decode64=base64decode|$1
encodemd5=md5|$1

I was based on these two macros, encodeuri and decodeuri,  which was in the sense of continuity

do not confuse the md5 and md5 file macros that have different uses


33
Beta / Re: version 2.4
« on: October 31, 2018, 10:03:49 PM »
Quote from: rejetto
mars was just guessing, but he was not right
it's understandable, javascript gives me Urticaria on neurons  ;D

34
HTML & templates / Re: base64 Re: Responsive small screen template
« on: October 31, 2018, 09:58:01 PM »

But I was wondering if is it possible make HFS decode Base64 'on-the-fly' using a macro like: {.mime|text/css;base64.}

Also, neither of the following works:

Code: [Select]
[mystyle.css]
{.base64|YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==.}

Code: [Select]
[mystyle.css]
{.base64decode|YSB7dGV4dC1kZWNvcmF0aW9uOiBub25lfQ==.}

I'm curious to know if this is possible using macros. ???

it would be enough simply to add this in scriptlib.pas before 'encodeuri'

Quote
    if name = 'encode64' then
      result:=base64encode(p);

    if name = 'decode64' then
      result:=base64decode(p);
      

including OverbyteicsMD5and OverbyteicsSha1 in the uses,we can allow two other codifications

 
Quote
   if name = 'encodemd5' then
      result:=strMD5(p);

    if name = 'encodesha1' then
      result:=SHA1ofStr(p);   

the latter two can be used to code the sending of a verification code or password

a wacky example as how encrypt download url and redirect it to be managed in a section

   
Quote
   {.if|{.=|%item-type%|folder.}|<a href="%item-url%">|<a href="/~download?name=%item-name%&id={.encode64|%item-full-url%.}&md5={.encodemd5|%item-url%.}">.}

[download|no log]
<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="0; url={.decode64|{.urlvar|id.}.}">
        <script type="text/javascript">
            window.location.href = "{.decode64|{.urlvar|id.}.}"
        </script>
        <title>Page Redirection</title>
    </head>
    <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        If you are not redirected automatically, follow this <a href='{.decode64|{.urlvar|id.}.}'>direct link </a>.
    </body>
</html>
   


35
HTML & templates / Re: base64 Re: Responsive small screen template
« on: October 30, 2018, 09:37:29 AM »
they do not exist in hfs, but this is not the realm of the impossible

36
Bug reports / Re: LARGE folders
« on: October 25, 2018, 11:04:16 PM »
show waiting time in (default) template or better not :)

Code: [Select]
[+]
<script>
window['folder-stats'].textContent += ', '+((Date.now()-sessionStorage.start)/1000).toFixed()+'s'
window.onbeforeunload = function(){sessionStorage.start=Date.now(); window['folder-stats'].textContent='\u231B'}
</script>

you can update template with this at choice:

Quote
[folder panel]
<div id='folder-path'>
   {.breadcrumbs|{:<a class='pure-button' href="%bread-url%"/> {.if|{.length|%bread-name%.}|/ %bread-name%|<i class='fa fa-home'></i>.}</a>:} .}
</div>
<div id='folder-stats'>
{.if|%number%|%number-folders% {.!folders.}, %number-files% {.!files.}, {.add bytes|%total-size%.}, .}   
 {.!Build time.}: %build-time%''
</div>

{.123 if 2| <div id='foldercomment' class="comment"><i class="fa fa-quote-left"></i>|{.commentNL|%folder-item-comment%.}|</div> .}


[list panel]
{.if not| %number% |{:
   <div id='nothing'>{.!{.if|{.length|{.?search.}.}|No results|No files.}.}</div>
:}|{:
   <div id='files' class="hideTs {.for each|z|mkdir|comment|move|rename|delete|{: {.if|{.can {.^z.}.}|can-{.^z.} .}:}.}">
   %list%
   </div>
:}.}
<div id="serverinfo">
   <a href="http://www.rejetto.com/hfs/"><i class="fa fa-clock-o"></i> {.!Build time.}: %build-time% <i class="fa fa-coffee"></i> {.!Uptime.}: %uptime%</a>
</div>
[/list]

37
Bug reports / Re: LARGE folders
« on: October 25, 2018, 08:20:06 PM »
You have to take into account that it's not just about displaying a file list like the old DIR command in MSDOS.
For my previous test, a DIR whose result was put in a text file took only about twenty seconds to finalize.

each file is subject to a number of mandatory tests for display in the web page, additional data associated with it even if some are empty in the end.

All data associated with a file on the disk is stored in a temporary memory record, and this space is freed after each refresh of the web page. converting this data to web representation takes a few milliseconds, depending on the machines, but this repeated action countless times may look like an eternity.
The VFS keeps this data indefinitely, whereas for the real files and files, it amounts to constructing a new building each time to create spaces there, to store carefully what will be used, then all methodically to clear to have a new location for the following requests.

we can see this as an album of photos for which we must at each consultation by the web systematically recreate the thumbnails

38
Bug reports / Re: LARGE folders
« on: October 24, 2018, 07:30:35 PM »
trial, with a directory in recursive mode, containing 83000 elements of all types, satisfactory result after 59'13 ''

slower than a snail ;D

39
Beta / Re: version 2.4
« on: October 14, 2018, 10:35:28 PM »
another bug with comment ?? 

when creating or modifying a comment, the multilines are sent with LF and not with CRLF, therefore the comments of the items of the vfs, as well as those recorded in the ".comment" files are saved in the wrong format and do not appear more correctly in a new edition

the solution found is the following:

Quote
procedure Tfile.setDynamicComment(cmt:string);
var
  s, path, name: string;
  i: integer;
begin
if countSubstr(#13#10,cmt) = 0 then
  cmt:=xtpl(cmt,[#10,#13#10]);

if not isTemp() then
  begin
  comment:=cmt; // quite easy
  exit;
  end;

....
the bug is also effective in version of hfs24b5.exe

another unimportant detail
Quote
    function getAccountRedirect():string;
.....
    // if it's not a complete url, it may require some fixing
    // mod mars 10-2018

    result:=xtpl(result,['\','/']); // if result ansiStart with '\' not necessary to add '/' with  next line of code
    if not ansiStartsStr('/', result) then result:='/'+result;
    end; // getAccountRedirect

40
Bug reports / Re: LARGE folders
« on: October 13, 2018, 05:17:54 PM »
certainly we can impose a limit on the number of files that will be displayed but whatever the filtering of the names used, the complete analysis of the physical support is still necessary, and only the elements that will correspond to the filter mask will be retained.

41
Beta / Re: version 2.4
« on: October 07, 2018, 09:38:10 PM »
Are you sure you are using the default template with no customization.
Do other people have problems?


Sorry, i was using the new template of  24b3 as external template new 24b4

yes, you can find a function explicitly adding the bytes, escapeIon()

that's what I understood but too late


EDIT:
@rejetto
do you think you can make a drop-down menu for the "more options" button instead of a central popup, as in the following image?


EDIT: hfs24b4 with internal template
I am again confronted with a reported problem: check boxes checked have the same effect as clicking the name of the associated item

EDIT:
a really strange thing, with the last exe in two different directories, on one the upload progress works but not the other, I realized that in the one that works I had a default.tpl while in the other I did not have it, I ended up comparing the default.tps of the first with the internal hfs.tpl of the second one, and I realized that réjetto had made a dumpling (fluff, stupidity)

by changing "upload-panel" by "upload panel" he had thus transformed $('#upload-panel') into $('#upload panel') leaving <div id="upload-panel"

EDIT:
@rejetto
do you think you can make a drop-down menu for the "more options" button instead of a central popup, as in the following image?

42
Beta / Re: version 2.4
« on: October 07, 2018, 05:54:09 PM »
     {.set item|{.force ansi|%folder%{.^fn.}.}|comment={.force ansi|{.postvar|text.}.}.}

not working:   the tag <BR> always appears when editing the comment

however, what I proposed works despite everything

var value = it.find('.comment-text').text() || ''


43
Beta / Re: version 2.4
« on: October 06, 2018, 07:21:22 PM »
Quote
when used multilines in comments, lines are serapated wit '\n'  (that is correct), but when editing
comment with web page \n are converted as <br> and appear on screen

same bug  in previous versions,  the offender is discovered, it is necessary to correct the setcomment function of the template

        function setComment() {
            var value = it.find('.comment-text').html() || ''    // change .html() by .text()
            ask(this.innerHTML, {type:'textarea', value}, s=>
                s===value || ajax('comment', { text:s, files:name }))
        }//setComment

Quote
test.txt=there is a &quot;bug&quot;\nwith comments\ntext is saved as\nhtml code \nas with &quot;htmlencode&quot; function
failing to do better: , this patch provides a temporary solution

procedure Tfile.setDynamicComment(cmt:string);
var
  s, path, name: string;
  i: integer;
begin
//as a possible function htmlDecode(s:string):string
cmt:=xtpl(cmt,[
      '&amp;', '&',
      '&lt;', '<',
      '&gt;', '>',
      '&quot;','"',
      '&#039;',''''
      ]);

if not isTemp() then
  begin
  comment:=cmt; // quite easy
  exit;
  end;
....

although in reality the previous conversion is not necessary, there is the problem of the codification of the languages of certain languages and their restitution.

an example is better than all explanations

how to define  comments in Russian characters, store them, and restore them correctly to the web page

this comment как возможная функция saved as %EF%B7%90%D0%BA%D0%B0%D0%BA %D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%B0%D1%8F %D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D1%8F%EF%B7%AF in comments file

the question is how to force the creation of comment files in UTF8 and not in ANSI by default


44
Beta / Re: version 2.4
« on: October 06, 2018, 04:29:50 PM »
@rejetto

discovery new bug with comment  hfs 2.3 and 2.4 are same

comments in hfs.comment.txt or descript.ion  seem saved trough "htmlEconde" function

    case s of
      '&': p:='&amp;';
      '<': p:='&lt;';
      '>': p:='&gt;';
      '"': p:='&quot;';
      '''': p:='&#039;';
      else p:=s;
      end;

test.txt=there is a &quot;bug&quot;\nwith comments\ntext is saved as\nhtml code \nas with &quot;htmlencode&quot; function



when used multilines in comments, lines are serapated wit '\n'  (that is correct), but when editing
comment with web page \n are converted as <br> and appear on screen

when comments are saved in descript.ion, each line of comment is ended with code 0x04,0xC,x0D,x0A

Quote
Here, I mean that the descript.ion file contains a backslash and a letter 'n' where I typed a line break, and two special characters 04 C2 at the end of the comment. In addition, the line is ended by a Windows line break 0D 0A.

Apparently, the two extra characters at the end of the line signal the end of a multiline comment. If I remove them, the comment is rendered as a single line in the GUI, and the '\n' sequences are displayed literally.

45
Beta / Re: version 2.4
« on: October 06, 2018, 03:50:13 PM »
with just 10KB (4 when gzipped)

women often say that it is not the size that is the most important, but the quality of the "work" and the pleasure it gives  ;D

can you load the demo version that I put and test the addition of userCFG and see result in hfs.ini  ;)

user data can be defined with SET INI and GET INI for use in a template, and managed from the options dialog (F7 last tab)

these data can be used as persistent variables between two hfs launches

Pages: 1 2 [3] 4 5 ... 123