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

Pages: [1] 2 3 4
HTML & templates / Re: Responsive small screen template
« on: July 18, 2018, 10:31:44 AM »
V2 loads the javascript part from browser cache

do you mean a querystring?
<a hef="pagetoreach.htm?id=%item-url%">☰</a>
see also urlvar | A

a working example you find in the new mobil-light template with the newfolder option +
in the next version I will try a popup dialog

HTML & templates / Re: Responsive small screen template
« on: July 13, 2018, 11:52:51 AM »
Inspired by the throwback template

I changed mobil-light to a lightweight and accessible stand-alone template without jquery
Thanks danny

and the pictureviewer for this template as diff template

HTML & templates / Re: file delete feature, and Throwback9
« on: July 12, 2018, 07:23:55 AM »
Remove the link from the span and add ;cursor:pointer to the style.

You can even hide the X (remove the textContent from the span):

Code: [Select]
<script>if('{.get|can delete.}') document.querySelectorAll('.del').forEach(function(userItem) {userItem.textContent=' \u2718'; userItem.addEventListener('click',function(){del(this.getAttribute("data-it"))})})</script>
Place the script before the first </body> tag

remove frm.upbtn.disabled=true; and add  multiple to the input tag

HTML & templates / Re: Need help with file delete feature
« on: July 09, 2018, 12:27:37 PM »
Code: [Select]
{.if|{.get|can delete.}|<span onclick='del("%item-url%")'>x</span>.}
and add script
Code: [Select]
function del(it) {
if(!confirm("Delete "+it+"?")) return 0;
var xhr = new XMLHttpRequest();"POST", "%folder%")
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
xhr.onload = function() {document.write(xhr.responseText);}

tested with chrome,FF,Edge

Update: more elegant

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

or use a single event handler

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

Code: [Select]
<span class='del' data-it='%item-url%'>x</span>
and add to function del
Code: [Select]
if (!'{.get|can delete.}') return 0

HTML & templates / Re: Responsive small screen template
« 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)

HTML & templates / Re: Jpg-image Template
« on: July 06, 2018, 12:09:50 AM »
Don't change the standard template. Put the hfs.diff.tpl in your picture-folder.

For preview pict you need thumbnails (or a lot of memory)
check if you have thumbnails in your photos
otherwise you can generate it with

alternativ add attribute accept to input type='file' in [box upload], e.g. accept='video/*'

HFS ~ HTTP File Server / Re: Feature request: folder access by IP address
« on: December 02, 2016, 08:36:43 AM »
Change ip and Add diff template
Code: [Select]
{.if |{.%ip%=}|

<div id='files_outer'>
<div style='height:1.6em;'></div> {.comment| this is quite ugly, i know, but if i use any vertical padding with height:100% i'll get a scrollbar .}
{.if not| %number% |{: <div style='font-size:200%; padding:1em;'>{.!No {.if|{.length|{.?search.}.}|results|files.}.}</div> :}|{:
        <form method='post'>
            <table id='files'>
            {.set|sortlink| {:<a href="{.trim|
                    {.get|url|sort=$1| {.if| {.{.?sort.} = $1.} |  rev={.not|{.?rev.} .} /if.} /get.}
                /trim.}">{.!$2.}{.if| {.{.?sort.} = $1.} | &{.if|{.?rev.}|u|d.}arr;.}</a>:} .}


update for your case:
{.if |{.regexp|10\.0\.0\.|%ip%.}|
or {.if |{.{.regexp|.*\.|%host%.}={.regexp|.*\.|%ip%.}.}| or {.if |{.match|10.0.0.*|%ip%.}|

HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 12, 2016, 11:36:20 AM »

if Sunday then 3
else if Saturday then 2
else 1

Code: [Select]
{. if |{.{.time|ddd.}=Sun.} | 3 | {:{.if|{.{.time|ddd.}=Sat.}|2|1.}:} .}
remind to replace Mon to Sun by their translations

HFS ~ HTTP File Server / Re: set expiry to delete content
« on: September 10, 2016, 12:27:55 AM »
I wonder how difficult it would be to have it not delete on a ... Sunday?

replace 1 (number of days) with
Code: [Select]
{. if |{.{.time|ddd.}=Sun.} | 2 | 1 .}

Pages: [1] 2 3 4