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
1
HTML & templates / Re: Responsive small screen template
« on: July 18, 2018, 10:31:44 AM »
V2 loads the javascript part from browser cache
http://rejetto.com/forum/index.php?topic=12054.msg1062730#msg1062730

2
do you mean a querystring? https://www.w3schools.com/jsref/prop_loc_search.asp
<a hef="pagetoreach.htm?id=%item-url%">☰</a>
see also http://www.rejetto.com/wiki/index.php?title=HFS:_scripting_commands urlvar | A

update:
a working example you find in the new mobil-light template with the newfolder option +
http://rejetto.com/forum/index.php?topic=11754.msg1062933#msg1062933
in the next version I will try a popup dialog

3
HTML & templates / Re: Responsive small screen template
« on: July 13, 2018, 11:52:51 AM »
Inspired by the throwback template http://rejetto.com/forum/index.php?topic=12055.msg1062882#msg1062882

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

5
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


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

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

tested with chrome,FF,Edge


Update: more elegant

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

or use a single event handler


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

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

8
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)


9
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. http://rejetto.com/forum/index.php?topic=11754.msg1061359#msg1061359

For preview pict you need thumbnails (or a lot of memory)
check if you have thumbnails in your photos http://exif.regex.info/exif.cgi
otherwise you can generate it with http://rejetto.com/forum/index.php?topic=11298.msg1061004#msg1061004

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

13
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]
[list]
{.if |{.%ip%=192.168.1.2.}|

<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>:} .}
            <th>{.^sortlink|n|Name.}{.^sortlink|e|.extension.}
            <th>{.^sortlink|s|Size.}
            <th>{.^sortlink|t|Timestamp.}
            <th>{.^sortlink|d|Hits.}
            %list%
            </table>
        </form>
:}.}
</div>

|forbidden.}

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

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

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

15
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