support for F-Spot photo versioning, refs #67
[phpfspot.git] / phpfspot.js
index 57345ab1705caf7eb064fbce9b4aa4fa5974d08b..54395e2a8aa27497f62d5232302129a952b7c2ac 100644 (file)
@@ -820,6 +820,27 @@ function update_sort_order(obj)
 
 } // update_sort_order()
 
+/**
+ * if the photo-version Ń•elect-box has changed, set the newly
+ * choosen photo version as the to-be-displayed photo version
+ */
+function update_photo_version(obj, current_photo)
+{
+   var objTemp = new Object();
+   objTemp['photo_version'] = obj.options[obj.selectedIndex].value;
+   objTemp['photo_idx'] = current_photo;
+
+   var retr = HTML_AJAX.post(web_path + '/rpc.php?action=update_photo_version', objTemp);
+
+   if(retr == "ok") {
+      showPhoto(current_photo);
+   }
+   else {
+      window.alert("Server message: "+ retr);
+   }
+
+} // update_photo_version()
+
 /**
  * show rate stars
  *