]> git.plutz.net Git - serve0/blobdiff - pages/browse.sh
styling for pagination links
[serve0] / pages / browse.sh
index adde4d8f2c2f06ad579e493e08a5316a9f3eaf94..faf4e67a20977521290d3cf82d96d2ff58bdcf84 100755 (executable)
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0.  If not, see <http://www.gnu.org/licenses/>. 
 
+directory="$(invalidate "${_GET[d]}" '(.*/)?\.\.(/.*)?|' /)"
+page_link="p=browse&d=$(urlsafe "$directory")&"
+
 . $_EXEC/pages/common.sh
 
-directory="$(invalidate "${_GET[d]}" '(.*/)?\.\.(/.*)?|' /)"
 [ -d "${treeroot%/}${directory%/}/.index" ] && indexed=true || indexed=false
 filters="${_GET[f]}"
 debug "FILTERS: $filters"
 
-page_link="p=browse&d=$(urlsafe "$directory")&${page_link}"
-
 present_filter(){
   printf %s\\n "$*" \
   | sed -r 's;(^|!|\^|\|)([^!\^\|:]+:);\1;g;s;\^;\n;g' \
@@ -78,7 +78,7 @@ _printVideo(){
   cat <<VIDEOend
     <li id="${location}" class="thumb">
       <button class="watchlink" name="${location}" formaction="?action=watch&l=${location}">
-        <img src="${thumblocation}" alt="Preview not yet available">
+        <img src="${thumblocation}" width="212" height="162" alt="Preview not yet available">
       </button>
       <h2><a href="?action=watch&l=${location}">${display}</a></h2>
       
@@ -128,17 +128,17 @@ filelist(){
   case "$order" in
     Name)
       find -L "$dir" -mindepth 1 -maxdepth 1 -type d \! -name ".index" -print0 \
-      | sort -z \
+      | sort -fz \
       | xargs -0 printf 'directory %s\n'
 
       find -L "$dir" -mindepth 1 -maxdepth 1 \! -type d -print0 \
       | grep -ziE "$file_pattern" \
-      | sort -z \
+      | sort -fz \
       | xargs -0 printf 'video %s\n'
 
       find -L "$dir" -mindepth 1 -maxdepth 1 \! -type d -print0 \
       | grep -zviE "$file_pattern" \
-      | sort -z \
+      | sort -fz \
       | xargs -0 printf 'plain %s\n'
       ;;
     Date)