From ba2df13122ef77b0928c1abe639f41b7d2d1429b Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Wed, 8 Jul 2020 13:27:07 +0200 Subject: [PATCH] removed jquery dependency from default tpl --- README.md | 2 + default.tpl | 838 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 480 insertions(+), 360 deletions(-) diff --git a/README.md b/README.md index 8c8388e..251daf4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,8 @@ The virtual file system will allow you to easily share even one single file. Initially developed in 2002 with Delphi 6, now with Delphi 10.3.3 (Community Edition). Icons are generated at http://fontello.com/ . Use fontello.json for further modifications. +For the default template we are targeting compatibility with Chrome 49 as it's the latest version running on Windows XP. + ## Libs used - [ICS v8.64](http://www.overbyte.be) by François PIETTE - [TRegExpr v0.952b](https://github.com/andgineer/TRegExpr/releases) by Andrey V. Sorokin diff --git a/default.tpl b/default.tpl index e6f022e..c795cc3 100644 --- a/default.tpl +++ b/default.tpl @@ -4,7 +4,7 @@ Here below you'll find some options affecting the template. Consider 1 is used for "yes", and 0 is used for "no". DO NOT EDIT this template just to change options. It's a very bad way to do it, and you'll pay for it! -Correct way: create a new text file 'hfs.diff.tpl' in the same folder of the program. +Correct way: create a new text file 'hfs.diff.tpl' in the same folder of the program. Add this as first line [+special:strings] and following all the options you want to change, using the same syntax you see here. That's all. To know more about diff templates read the documentation. @@ -30,11 +30,10 @@ def 3.0 - @@ -155,23 +155,24 @@ var darkOs = window.matchMedia('(prefers-color-scheme:dark)').matches var curTheme = localStorage['theme'] if (!themes.includes(curTheme)) curTheme = themes[+darkOs] -$('body').addClass(curTheme+themePostfix) -$(function(){ +var body = document.body +body.classList.add(curTheme+themePostfix) +$domReady(()=>{ - var titleBar = $('#title-bar') - var h = titleBar.height() + var titleBar = $sel('#title-bar') + var h = titleBar.clientHeight var k = 'shrink' window.onscroll = function(){ if (window.scrollY > h) - titleBar.addClass(k) + titleBar.classList.add(k) else if (!window.scrollY) - titleBar.removeClass(k) + titleBar.classList.remove(k) } - $('#switch-theme').click(()=>{ - $('body').toggleClass(curTheme+themePostfix); + $click('#switch-theme', ()=>{ + $xclass(body, curTheme+themePostfix); curTheme = themes[themes.indexOf(curTheme) ^1] - $('body').toggleClass(curTheme+themePostfix); + $xclass(body, curTheme+themePostfix); localStorage.setItem('theme', curTheme); }); }); @@ -225,25 +226,26 @@ $(function(){ #search-panel button { float:right } [+special:strings] @@ -313,8 +315,8 @@ button i.fa { font-size:110% } .item img { vertical-align: text-bottom; margin:0 0.2em; } .item .fa-lock { margin-right: 0.2em; } .item .clearer { clear:both } -.comment { color:#666; padding:.1em 1.8em .2em; border-radius: 1em; margin-top: 0.1em; - background-color:rgba(0,0,0,.04); /* dynamically darker, as also hover is darker */ } +.comment { color:#666; padding:.1em 1.8em .2em; border-radius: 1em; margin-top: 0.1em; + background-color:rgba(0,0,0,.04); /* dynamically darker, as also hover is darker */ } .comment>i:first-child { margin-right:0.5em; margin-left:-1.4em; } .item-size { margin-left:.3em } .selector { float:left; width: 1.2em; height:1.2em; margin-right: .5em; filter:grayscale(1); } @@ -354,6 +356,7 @@ button i.fa { font-size:110% } } .dialog-content input { border: 1px solid #888; } /* without this the border on chrome83 is not consistent */ .ask input { border:1px solid rgba(0,0,0,0.5); padding: .2em; margin-top: .5em; } +.ask textarea { margin:1em 0; width:25em; height:8em; } .ask .close { float: right; font-size: 1.2em; color: red; position: relative; top: -0.4em; right: -0.3em; } #additional-panels input { border:0; color: #555; padding: .1em .3em .2em; border-radius: 0.4em; } @@ -584,9 +587,10 @@ z-index:1; /* without this .item-menu will be over*/ } [ajax.comment|public|no log] {.check session.} {.break|if={.not|{.can comment.}.} |result=forbidden.} +{.set|t|{.escape html|{.postvar|text.}.}.} {.for each|fn|{.replace|:|{.no pipe||.}|{.postvar|files.}.}|{: {.break|if={.is file protected|var=fn.}|result=forbidden.} - {.set item|%folder%{.^fn.}|comment={.postvar|text.}.} + {.set item|%folder%{.^fn.}|comment={.^t.}.} :}.} {.pipe|ok.} @@ -604,27 +608,262 @@ can delete=get|can delete can change pwd={.{.member of|can change password.} >.} can move=and|{.get|can delete.}|{.!option.move.} escape attr=replace|"|"|$1 +escape html=replace|<|<|{.replace|>|>|$1.} commentNL=if|{.pos||$1.} add bytes=switch|{.cut|-1||$1.}|,|0,1,2,3,4,5,6,7,8,9|$1 {.!Bytes.}|K,M,G,T|$1B [special:import] {.new account|can change password|enabled=1|is group=1|notes=accounts members of this group will be allowed to change their password.} -[lib.js|public|no log|cache] -//