5 # Copyright (C) 2006 matteo.nastasi@milug.org
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABLILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details. You should have received a
16 # copy of the GNU General Public License along with this program; if
17 # not, write to the Free Software Foundation, Inc, 59 Temple Place -
18 # Suite 330, Boston, MA 02111-1307, USA.
23 OUTFILE=web/preload_img.js
28 # echo 'header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1'
29 # echo 'header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past'
34 ls -S `find $1 -type f -name '*.jpg' -o -name '*.png' -o -name '*.gif' | grep -v '/src_' | sort`
40 echo "var g_preload_img_arr = new Array( "
43 ltri="`echo "$IMGPATH" | wc -c`"
44 for i in `imglist $IMGPATH`; do
45 if [ $first -ne 1 ]; then
47 if [ $((ct % 2)) -eq 0 ]; then
54 outna="`echo "$i" | cut -c $((ltri + 1))-`"
64 echo "var g_preload_imgsz_arr = new Array( "
69 for i in `imglist $IMGPATH`; do
70 sz="`stat -c '%s' $IMGPATH/$i`"
74 for i in `imglist $IMGPATH`; do
75 if [ $first -ne 1 ]; then
77 if [ $((ct % 8)) -eq 0 ]; then
84 sz="`stat -c '%s' $IMGPATH/$i`"
86 cur="`echo "100.0 * $sum / $tot" | bc -l | sed 's/\(\.[0-9]\)[0-9]*/\1/g'`"