auto-browse needs to use the 16x16 icons instead of 32x32 which are used in slideshow
[phpfspot.git] / phpfspot.js
index 8db1f651b132cbf964f6fe4ef06280a5f31c2d2e..3421583e0c630e6a57cc1e461caf38bb8866c4b5 100644 (file)
@@ -337,8 +337,13 @@ function datesearch()
  * called for photo-index export. will return the
  * selected mode via AJAX from the server.
  */
-function setViewMode(mode)
+function setViewMode(srv_webpath, mode)
 {
+   if(srv_webpath != undefined)
+      web_path = srv_webpath;
+   else
+      web_path = '';
+
    var exprt = document.getElementById('output');
    exprt.innerHTML = "Loading...";
    exprt.innerHTML = HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=get_export&mode=' + mode));
@@ -655,17 +660,19 @@ function preloadPhotos(image_url) {
    var waiting = 100;
    var counting;
 
-   lbImg=WSR_getElementsByClassName(document,"img","thumb");
-   for(i=0;i<lbImg.length;i++){
-      lbImg[i].src=image_url[i];
-      // to not bomb the server with requests, give the page some time
-      // to load the images one by one. if a image exceeds the timeout,
-      // the next image will be loaded.
-      if(lbImg[i].complete != undefined && lbImg[i].complete != true) {
-         counting = 0;
-         while(lbImg[i].complete != true && counting < timeout) {
-            window.setTimeout("noop()", waiting);
-            counting+=waiting;
+   lbImg = WSR_getElementsByClassName(document,"img","thumb");
+   if(lbImg != undefined) {
+      for(i=0;i<lbImg.length;i++){
+         lbImg[i].src=image_url[i];
+         // to not bomb the server with requests, give the page some time
+         // to load the images one by one. if a image exceeds the timeout,
+         // the next image will be loaded.
+         if(lbImg[i].complete != undefined && lbImg[i].complete != true) {
+            counting = 0;
+            while(lbImg[i].complete != true && counting < timeout) {
+               window.setTimeout("noop()", waiting);
+               counting+=waiting;
+            }
          }
       }
    }
@@ -678,8 +685,13 @@ function noop() {}
 /**
  * start slideshow
  */
-function startSlideShow()
+function startSlideShow(srv_webpath)
 {
+   if(srv_webpath != undefined)
+      web_path = srv_webpath;
+   else
+      web_path = '';
+
    if(!sliding) {
       HTML_AJAX.grab(encodeURI(web_path + '/rpc.php?action=reset_slideshow'));
       nextSlide();
@@ -757,12 +769,12 @@ function autoBrowse()
    if(document.getElementById('next_link')) {
       var next_link = document.getElementById('next_link').href;
       window.location.href = next_link;
-      document.getElementById('autobrowse_ico').src = web_path + "/resources/32_pause.png";
+      document.getElementById('autobrowse_ico').src = web_path + "/resources/16_pause.png";
    }
    /* we have reached the last photo */
    else {
       if(ab_ico = document.getElementById('autobrowse_ico'))
-         ab_ico.src = web_path + "/resources/32_play.png";
+         ab_ico.src = web_path + "/resources/16_play.png";
       clearInterval(autobrowse);
    }