rejetto forum

The Throwback (retro) template. With large folder and mobile support.

danny · 127 · 56506

0 Members and 1 Guest are viewing this topic.


Offline Chris Harris

  • Occasional poster
  • *
    • Posts: 27
    • View Profile
This, I tried for 3 hours with hfs 299-1/2 (the pre-release).  :) 
After upgrading to the official hfs 300, the remove headers command worked for cookies, not for etag.

Where is version 299 or official hfs 300?

Chris



Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1986
    • View Profile
Quote
[+file]
<td>%item-size%B<td><script type="text/javascript" >mdy(%item-modified-dt%)</script><td>%item-dl-count%

[+folder]
<td class='nosize'>{.!folder-item|folder.}<td><script type="text/javascript" >mdy(%item-modified-dt%) </script><td>%item-dl-count%

Quote
[lib.js|no log]
// <script> // this is here for the syntax highlighter


function mdy(data) {
   var options={ year: '2-digit', month: '2-digit', day: 'numeric' }
   var locales=navigator.language;
   document.write( new Date((data*24-613658)*3600*1000).toLocaleString(locales, options));
}


function outsideV(e, additionalMargin) {
......
« Last Edit: September 15, 2018, 08:58:42 PM by Mars »


Offline dj

  • Tireless poster
  • ****
    • Posts: 215
  • 👣 🐾
    • View Profile
    • PWAs
Until then, a possible workaround solution

my modified addon, adapted to throwback1998

Code: [Select]
[+]
<script>  //formatmodified for mobil-light.tpl
//use ISO Date Format in hfs
var options={ year: '2-digit', month: '2-digit', day: 'numeric' }  //edit here
 //year, month, day, hour, minute, second  "numeric", "2-digit"; weekday  "narrow", "short", "long"
var locales=navigator.language

var ref=document.querySelectorAll('td:nth-child(3) font')  //addapted to throwback1998
if(!ref.length) ref=document.querySelectorAll('tr td:nth-child(3)')  //std-tpl
for (var i=0; i<ref.length; i++)  {
 var tmp=Date.parse(ref[i].textContent.slice(0,19))
 if(tmp) ref[i].textContent = new Date(tmp).toLocaleString(locales, options)
}

</script>


Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 1986
    • View Profile
Thank you DJ for the idea, my previous post edited accordingly regarding the javascript part ,works as simply as necessary ;)

I'm still working on the changes that can be made to the default template with a minimum of modifications and that are as simple as possible

probably it will not work on platforms where javascript is disabled,  I do not know if it also has an impact on jquery
« Last Edit: September 15, 2018, 09:22:54 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile
for those interested in reducing the CPU load on the server, make a test disabling "use system icons" under Menu > virtual file system.



Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
http://www.rejetto.com/wiki/index.php/HFS:_scripting_commands#Others

Probably a macro manpulatuon

time | A
returns current time information. The format is specified by optional parameter A. Refer to this page for format syntax. If A is not supplied, value "c" will be used.
Optional parameter when to specify a time other than current.
Optional parameter offset to specify the number of days differing from the current time

%time% which give us the full extent time day etc

Or mby pull from the client not the server

https://www.w3schools.com/html/html_form_input_types.asp
And do a reverse feed script to output the current date in the format you want.

Input Type Date
The <input type="date"> is used for input fields that should contain a date.

Depending on browser support, a date picker can show up in the input field.

https://www.w3schools.com/js/js_dates.asp

« Last Edit: January 02, 2019, 05:37:09 PM by bmartino1 »
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
@Rejetto: Template bug found on v2.4 beta 6!

I've tried Throwback1998.tpl and Throwback9.tpl on the latest v2.4 beta 6, and it looks like a bug was introduced on beta 6, since on beta 5 was working fine (see screenshots). The bug is that 'files panel' is not shown when using those templates! (I can't find the reason why it happens).

Can you add %item-modified-mdy% short format 12.25.18 file date?
If this is added to HFS's source code, then some other common formats should be added too:
%item-modified-mdy% = MONTH-DAY-YEAR short format > 12.25.18 (proposed by danny)
%item-modified-dmy% = DAY-MONTH-YEAR short format > 25.12.18 (proposed by me)
%item-modified-ymd% = YEAR-MONTH-DAY short format > 18.12.25 (also useful)

Cheers,
Leo.-
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile

Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13275
    • View Profile
for the timestamp: that's why i introduced %item-modified-dt%
such format is compatible with {.time.} and you can transform it as you want.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
Very nice! :D I quickly tested and everything looks good, congrats.
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 700
  • Status: On hiatus (unspecified time)
    • View Profile
    • twitter.com/LeoNeeson
Is that date reformat script sync or async?
I'm not expert on this, but I guess it's synchronous by default. If you want to make it asynchronous, you could add the attribute 'async', here (marked in red color):

Quote
<script type="text/javascript" language="javascript" async>function mdy(data)

...but I haven't tested (and I don't know if this makes any difference on speed).
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline dj

  • Tireless poster
  • ****
    • Posts: 215
  • 👣 🐾
    • View Profile
    • PWAs
@danny, do you mean time?
//year, month, day, hour, minute, second  "numeric", "2-digit"; weekday  "narrow", "short", "long"
{hour: '2-digit', minute: '2-digit'} docu

PS: I added readme.txt to my last post