]> git.plutz.net Git - serve0/blobdiff - pages/list.sh
submit page locators via post instead of relying on referrer
[serve0] / pages / list.sh
index 4d25103059d14932a90e552442c7cd152ca41df1..7b68f29098e9463ca90edc50875a4d589e2a0724 100755 (executable)
@@ -74,14 +74,13 @@ _printVideo(){
     linkinfo="$(urlsafe "$info")"
     htmlinfo="$(htmlsafe "$info")"
 
-    [ "$(($length % 60))" -lt 10 ] && minutes="$(($length / 60)):0$(($length % 60))" \
-                                   || minutes="$(($length / 60)):$(($length % 60))"
+    minutes="$(printf "%d:%02d" $(($length / 60)) $(($length % 60)) )"
 
     tee "$cache" <<VIDEOend
       <li class="thumb">
-        <a class="watchlink" name="${linkinfo}" href="?action=watch&i=${linkinfo}">
+        <button class="watchlink" name="${linkinfo}" formaction="?action=watch&i=${linkinfo}">
           <img src="$thumb" alt="Preview not yet available">
-        </a>
+        </button>
         <h2>${htmlinfo}</h2>
         
         <input type="checkbox" name="tagsel" value="${htmlinfo}">
@@ -141,4 +140,6 @@ thumblist() {
   done
 }
 
-pagecount="$(( $(selectionlist | wc -l) / $pagesize + 1 ))"
+pagecount() {
+  printf "$(( $(selectionlist | wc -l) / $pagesize + 1 ))"
+}