#!/bin/sh ## ## Nautilus ## SCRIPT: htm02_multi-img-files_imgsSLIDESHOW_NOfit2page_echo_for-loop.sh ## ## PURPOSE: Generate a SLIDESHOW HTML page for showing a sequence of ## user-selected image files ('.jpg' or '.png' or '.gif' or whatever) ## displayed in an area at least 300 pixels high on the HTML page. ## ## Controls (links) are provided on the page for ## - auto-stepping through the images, with a given delay time ## per image ## - manually stepping forward or backward through the images ## - zooming the displayed image up or down, 10% at a click ## - showing the displayed image at its original (actual) size. ## ## This script also puts a couple of javascripts --- ## 'add-load-listener.js' and 'slideshow_funcs.js' --- ## in a 'javascripts' subdirectory of the directory containing ## the selected image files. ## ## This script also puts a tile image file in a 'tiles' ## subdirectory of the directory containing the selected image files. ## ## METHOD: There is no prompt for a parameter. ## ## The 'echo' command is used to put HTML statements in a '.htm' file. ## ## This script shows the HTML file in an html-viewer of the user's choice ## ($HTMLVIEWER), and puts the user in edit mode on the HTML file ## using a text-editor of the user's choice ($TEXTEDITOR). ## ## HOW TO USE: In Nautilus, navigate to a directory of image files and ## select the images to be shown. (Use Ctrl or Shift keys ## as appropriate.) ## Right-click and choose this script to run (name above). ## ## This script puts the '.htm' HTML file in the directory ## with the image files. ## ###################################################################### ## Started: 2012feb08 ## Changed: 2012may14 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ########################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################### ## Set the htm output file name. ################################### HTMFILE="00_slideshow_NOfit2page.htm" # HTMFILE="00_SLIDESHOW_NOfit2page.htm" if test -f "$HTMFILE" then rm "$HTMFILE" fi ###################################################### ## ECHO SECTION 1: ## Put the 1st part of 'head' section in the HTML file. ###################################################### echo " SLIDESHOW - viewport at least 300 pixels high

SLIDESHOW of user-selected images

in a 'viewport' at least 300 pixels high

Introduction to the image area and slideshow controls :

By default, images are shown at their original (actual pixels) size in a 'viewport' area. The 'viewport' is an area within your HTML viewer (web browser) window, below.

You have zoomIN, zoomOUT, and (return-to-)original-size functions --- below, on the left, beside the image. These controls can be used to over-ride the default 'actual size' image display function. If the image is too large, try 'zoomOUT'.

Scroll down to position the images appropriately.

AutoSlideshow : Start Stop
Delay secs:

of

Img Step Controls :
plusONE
minusONE
plusTEN
minusTEN

Img Size Controls :
zoomIN-20%
zoomOUT-20%
Original-Size

of

of

NOTES on slideshow controls usage:

You can use the 'plusONE' link above to advance through the images, one image at a time.

Or, click on the 'Start' link to start an automatic slideshow. You can change the 'Delay secs' to speed up or slow down the show.

Also, you can click on the 'plus' or 'minus' controls while the auto-slideshow is going, to adjust the position of the slideshow. Similarly, you can click on the img-size controls while the slideshow is going.

This slideshow page works with Mozilla Seamonkey and Firefox browsers. It works with some versions of other browsers, like Microsoft IE (Internet Explorer) and Opera. Maybe Mac Safari.

" >> "$HTMFILE" ## END OF echo for Controls and Image-display section of the HTML page. #################################################### ## ECHO SECTION 4: ## Write out BOTTOM of HTML file. #################################################### echo "

Bottom of the SLIDESHOW ('as-is' display of image sizes) page.

To return to a previously visited web page location, click on the
Back button of your web browser, a sufficient number of times.
OR, use the History-list option of your web browser.
OR ...

< Go to Top of Viewport, above. >
< Go to Top of Page, above. >

Page created 2012 xxx 00.

" >> "$HTMFILE" ################################################################ ## 1) Make subdirectory 'javascripts' in the images directory, ## if it does not already exist, and ## 2) Copy the 'add-load-listener.js' and 'slideshow_funcs.js' ## javascripts into that 'javascripts' directory. ################################################################ CURDIR="`pwd`" if test ! -d "$CURDIR/javascripts" then mkdir "$CURDIR/javascripts" chmod 755 "$CURDIR/javascripts" fi DIR_THISSCRIPT="`dirname $0`" if test ! -f "$CURDIR/javascripts/add-load-listener.js" then cp "$DIR_THISSCRIPT/.javascripts/add-load-listener.js" \ "$CURDIR/javascripts/add-load-listener.js" fi if test ! -f "$CURDIR/javascripts/slideshow_funcs.js" then cp "$DIR_THISSCRIPT/.javascripts/slideshow_funcs.js" \ "$CURDIR/javascripts/slideshow_funcs.js" fi ################################################################ ## 1) Make subdirectory 'tiles' in the images directory, ## if it does not already exist, and ## 2) Copy the a seamless tile file into that 'tiles' directory. ################################################################ if test ! -d "$CURDIR/tiles" then mkdir "$CURDIR/tiles" chmod 755 "$CURDIR/tiles" fi if test ! -f "$CURDIR/tiles/tile_ripple_gray_320x200.jpg" then cp "$DIR_THISSCRIPT/.tiles/tile_ripple_gray_320x200.jpg" \ "$CURDIR/tiles/tile_ripple_gray_320x200.jpg" fi ################################### ## SHOW HTML FILE in a web browser. ################################### ## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi . $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi . $DIR_NautilusScripts/.set_VIEWERvars.shi $HTMLVIEWER "$HTMFILE" & ################################## ## Put HTML FILE in a text editor. ################################## $TXTEDITOR "$HTMFILE"