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

Pages: 1 2
16
HTML & templates / Re: Custom folder previews
« on: September 14, 2021, 04:48:30 PM »
Okay, variant with images behind buttons:
Code: [Select]
[+]
<script>
var list=document.querySelectorAll("table#files>tbody>tr");
function changepic(a1)
{
  var alink=a1.querySelector("a");
  var adress=alink.getAttribute("href");
  if(adress.endsWith("/"))
  {
  adress+="p.jpg";
  var button=document.createElement("button");
  button.setAttribute("onclick","showPreview(this)");
  button.setAttribute("link",adress);
  button.setAttribute("type","button");
  a1.children[3].setAttribute("style","text-align:center");
  a1.children[3].appendChild(button);
  button.appendChild(document.createTextNode("Preview"));
  } 
}
list.forEach(changepic);
function showPreview(butt)
{
  butt.setAttribute("style","display:none");
  var par=butt.parentElement;
  var img=document.createElement("img");
  img.setAttribute("src",butt.getAttribute("link"));
  par.appendChild(img);
}
</script>

17
HTML & templates / Custom folder previews
« on: September 11, 2021, 09:36:48 PM »
Let's say I have following folders

New folder
New folder 2
New folder 3

Each contains a "p.jpg", I want to use these as folder preview.

The code for diff template I'm currently using:
Code: [Select]
[+]
<script>
var list=document.querySelectorAll("table#files>tbody>tr");
function changepic(a1)
{
  var alink=a1.querySelector("a");
  var adress=alink.getAttribute("href");
  if(adress.endsWith("/"))
  {
  adress+="p.jpg";
  var img=document.createElement("img");
  img.setAttribute("src",adress);
  img.setAttribute("onerror","this.style.display='none'");
  a1.children[3].appendChild(img);
  }
}
list.forEach(changepic);
</script>
eats too much cpu if there are too many folders. Because script doesn't check if p.jpg is actually present in folder

How can I fix it? Thanks in advance.

18
HFS ~ HTTP File Server / Re: about freedns?
« on: June 17, 2021, 11:41:51 AM »
Freedns only work for routers doesn't it? You need to configure it there. Or try duckdns, it has a windows gui app

19
HFS ~ HTTP File Server / Re: Is there a way to add login message?
« on: May 29, 2021, 03:56:38 AM »
Yes that's what I was looking for, many thanks.

20
HFS ~ HTTP File Server / Is there a way to add login message?
« on: May 28, 2021, 02:14:30 AM »
Like in attachment.

21
HTML & templates / Re: How can I implement thing on image attached?
« on: March 18, 2021, 01:16:30 AM »
Code: [Select]
[+]
<script>
[...document.querySelectorAll('#files a[href$="/"]')].forEach(item =>
 item.insertAdjacentHTML('afterend', '<a href="http://example.site/view-2.php?name='+item.innerText.trim()+'"> Info </a>')
)
</script>
godsend

22
HTML & templates / Re: How can I implement thing on image attached?
« on: March 16, 2021, 08:09:25 PM »
You asked me to elaborate what I'm trying to do.

Let's say I want to include this feature for folder "My"


The script above works, but globally. I only need it for folder "My"

Editing diff template



results in this


23
HTML & templates / Re: How can I implement thing on image attached?
« on: March 16, 2021, 03:31:59 AM »
But how do I insert my code into template? I tried:
Code: [Select]
[+folder]
%item-name%
this edits "Hits" column instead of "Name" one

Putting this into head of hfs.tpl worked for me:
Code: [Select]
<script type="text/javascript">
  document.addEventListener('DOMContentLoaded',function(){
    let reg1=/~img_folder"> (.*)</g;
    let reg2='~img_folder"> $1 </a> [<a href="http://example.site/view-2.php?name=$1" >Info</a>]<';
    document.body.innerHTML=document.body.innerHTML.replace(reg1,reg2);
    let reg3=/view-2.php\?name=(.*)( \-)(.*?)">/
    let reg4='view-2.php\?name=$1:$3">';
    document.body.innerHTML=document.body.innerHTML.replace(reg3,reg4);
    });
</script>
however it works globally, not only for folder I want.

24
HTML & templates / How can I implement thing on image attached?
« on: March 15, 2021, 02:28:24 AM »
I need folder names to have additional link attached automatically, with part of foldername in it:

Folder "A - B C 3" [link to example.site/view-2.php?name=A]
or
Folder "A - B C 3" [link to example.site/view-2.php?name=A: B C III]

1. How can I use foldername as variable?
2. How can I edit that variable? (%20- = %3A)
3. How can I add my link through diff template?

25
router & port problems / Re: Discuss free alternatives to no-ip
« on: March 13, 2021, 12:46:45 AM »
You can try DuckDNS (but it's untested by me, but as far I know, it doesn't expire and works well with HFS).
I am using it for some months, works like charm. My ip is dedicated though.

26
by saving the HFS options to a file you have access to the ban list
Exactly what I was looking for, thank you kindly

27
fill the blank row with a ban, then press the 'add row' button fill the blank row with a ban, then press the 'add row' button
No way to paste multiple rows at once?

28
HFS ~ HTTP File Server / Is there a way to add multiple rows in banlist?
« on: February 25, 2021, 05:52:28 PM »
title

Pages: 1 2