]> git.plutz.net Git - serve0/commitdiff
send reference to return page for various actions
authorpaul <paul@plutz.net>
Wed, 8 Feb 2017 14:09:26 +0000 (14:09 +0000)
committerpaul <paul@plutz.net>
Wed, 8 Feb 2017 14:09:26 +0000 (14:09 +0000)
svn path=/trunk/; revision=174

actions/multitag.sh
actions/watch.sh
pages/browse.sh
pages/common.sh
pages/list.sh
templates/browse.html.sh
templates/list.html.sh

index 91a787b4a896130d17b414625dd4631d7bbfe995..3c9848e8cf938b8365560f24313fdb274f48151a 100755 (executable)
@@ -64,4 +64,5 @@ done
 rm "${_DATA}"/cache/\?* 2>/dev/null
 [ -n "${_POST[tags]}" ] && rm "${_DATA}"/cache/taglist_set "${_DATA}"/cache/taglist_filter 2>/dev/null
 
-redirect "?o=$order&s=$search&f=$filter&pn=$page"
+#redirect "?o=$order&s=$search&f=$filter&pn=$page"
+redirect "${_POST[page]}"
index b7fad863753d47f28bc40b94c5c9cd81e1a80d4d..546654c6adfcdd2b7583d615e46d2b31dab94991 100755 (executable)
@@ -9,13 +9,9 @@ search="${_POST[s]}"
 filter="${_POST[f]}"
 page="${_POST[pn]}"
 
-watch_link=''
+watch_link="${_POST[page]}&"
 [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&"
 [ -n "$info" ]     && watch_link="i=$(urlsafe "${info}")&"
-[ -n "$order" ]    && watch_link="${watch_link}o=${order}&"
-[ -n "$search" ]   && watch_link="${watch_link}s=${search}&"
-[ -n "$filter" ]   && watch_link="${watch_link}f=${filter}&"
-[ -n "$page" ]     && watch_link="${watch_link}pn=${page}"
 
 meta="${_DATA}/meta/$info.meta"
 head -n1 "$meta" |read length width height filename
@@ -31,6 +27,7 @@ if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then
 elif [ -n "$foreign" ]; then
   _COOKIE[watch]=server
   videourl="${_GET[url]}"
+  watch_link="${_POST[return]}"
 elif [ -z "$info" ]; then
   videourl="$(urlsafe "${location#/}")"
 else
@@ -39,8 +36,8 @@ fi
 
 case "$_COOKIE[watch]" in
   raspi)
-    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url="
-    redirect "${rpiaddr}$(urlsafe "http://${HTTP_HOST}/${videourl}")"
+    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch"
+    redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/?${_POST[page]}")"
   ;;
   480p)
     [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \
index adde4d8f2c2f06ad579e493e08a5316a9f3eaf94..eba470b045463e8d14f229d1701560b05c297134 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' \
index ba4cf27b5d6bdc2055d57a9e363076901dfd0cf0..75320556d326e92366c5a86515f067b8d0978be9 100755 (executable)
@@ -24,8 +24,8 @@ page="${_GET[pn]}" #validated
 pagesize="${_COOKIE[pagesize]}" #validated
 pagecount=0
 
-page_link=''
-[ -n "$info" ]   && page_link="i=$(urlsafe "$info")&"
+#page_link=''
+[ -n "$info" ]   && page_link="${page_link}i=$(urlsafe "$info")&"
 [ -n "$order" ]  && page_link="${page_link}o=${order}&"
 [ -n "$search" ] && page_link="${page_link}s=${search}&"
 [ -n "$filter" ] && page_link="${page_link}f=${filter}&"
index 37f764e4bf15979d809a53d3bf91512929574ea7..757d5418e95bebff8123b5859c13c89579e862c9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/zsh
 
-# Copyright 2014 - 2016 Paul Hänsch
+# Copyright 2014 - 2017 Paul Hänsch
 #
 # This file is part of Serve0.
 # 
@@ -17,6 +17,8 @@
 # You should have received a copy of the GNU Affero General Public License
 # along with Serve0.  If not, see <http://www.gnu.org/licenses/>. 
 
+page_link="p=list&"
+
 . $_EXEC/pages/common.sh
 
 LF='
index ff1944eecac25f6533489352529ed61335a68d6f..eae9ce9caf59f376a666d113ad0a14c7c29076ea 100755 (executable)
@@ -47,6 +47,7 @@ cat <<EOF
   </div>
 
   <form action="?action=multitag" method="post" accept-charset="UTF-8">
+    <input type="hidden" name="page" value="?$(attribsafe "${page_this}")">
     <input type="hidden" name="o" value="${order}">
     <input type="hidden" name="s" value="${search}">
     <input type="hidden" name="f" value="${filter}">
index ed41b3ac08da1ec08d72148fba4ea71c292c55bf..28ce6c503e3bc12a3befc9150ecd8ffaa8dbbcd8 100755 (executable)
@@ -47,6 +47,7 @@ cat <<EOF
   </div>
 
   <form action="?action=multitag" method="post" accept-charset="UTF-8">
+    <input type="hidden" name="page" value="?$(attribsafe "${page_this}")">
     <input type="hidden" name="o" value="${order}">
     <input type="hidden" name="s" value="${search}">
     <input type="hidden" name="f" value="${filter}">