issue56, play and pause of autobrowsing is now possible
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 22 Jul 2007 07:02:58 +0000 (07:02 +0000)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 22 Jul 2007 07:02:58 +0000 (07:02 +0000)
git-svn-id: file:///var/lib/svn/phpfspot/trunk@238 fa6a889d-dae6-447d-9e79-4ba9a3039384

phpfspot.js
resources/32_pause.png [new file with mode: 0644]
resources/32_play.png [new file with mode: 0644]
themes/default/templates/single_photo.tpl

index 588298ab3691f53755d013e34bdf31aadcfa73b5..6bc0d2c96be4857ad1c8859a6286c832f640a1fb 100644 (file)
@@ -313,12 +313,25 @@ function nextSlide()
    document.getElementById('slide_img').src = next_img;
 }
 
+function startAutoBrowse()
+{
+   if(!autobrowse) {
+      autoBrowse();
+      autobrowse = setInterval("autoBrowse()", 5000);
+   }
+   else {
+      clearInterval(autobrowse);
+      autobrowse = 0;
+      document.getElementById('autobrowse_ico').src = "resources/32_play.png";
+   }
+
+}
 function autoBrowse()
 {
    if(document.getElementById('next_link')) {
       var next_link = document.getElementById('next_link').href;
       window.location.href = next_link;
-      setTimeout("autoBrowse()", 5000);
+      document.getElementById('autobrowse_ico').src = "resources/32_pause.png";
    }
 }  
 
diff --git a/resources/32_pause.png b/resources/32_pause.png
new file mode 100644 (file)
index 0000000..7abcb23
Binary files /dev/null and b/resources/32_pause.png differ
diff --git a/resources/32_play.png b/resources/32_play.png
new file mode 100644 (file)
index 0000000..00f094d
Binary files /dev/null and b/resources/32_play.png differ
index bb8c9179e2599caa7aaf03e9504135aa08ae5904..0965b078bc4bfb4c9085df939c34813030621f55 100644 (file)
@@ -16,7 +16,7 @@
    {/if}
   </td>
   <td class="index_header" style="text-align: right;">
-   <a href="javascript:autoBrowse();"><img src="resources/slideshow.png" /></a>
+   <a href="javascript:startAutoBrowse();" title="auto browsing"><img id="autobrowse_ico" src="resources/32_play.png" /></a>
    {if $extern_link }
     <a href="{$extern_link}" title="Use this link to return to the current view"><img src="resources/link.png" /></a>
    {/if}