incubator-photark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r944109 - in /incubator/photark/trunk: photark-appengine-webapp/war/ photark-appengine-webapp/war/js/ photark-ui-admin/src/main/webapp/admin/ photark-ui-admin/src/main/webapp/admin/css/ photark-ui-admin/src/main/webapp/admin/js/ photark-ui/...
Date Fri, 14 May 2010 04:47:52 GMT
Author: lresende
Date: Fri May 14 04:47:51 2010
New Revision: 944109

URL: http://svn.apache.org/viewvc?rev=944109&view=rev
Log:
PHOTARK-39 - Applying patch from Henry Saputra to refactory images, js, etc to it's own folder/files

Added:
    incubator/photark/trunk/photark-appengine-webapp/war/js/
    incubator/photark/trunk/photark-appengine-webapp/war/js/constants.js
      - copied, changed from r943794, incubator/photark/trunk/photark-appengine-webapp/war/constants.js
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.css
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js   (with props)
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/upload.js   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.js
    incubator/photark/trunk/photark-ui/src/main/webapp/css/
    incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/styles.css
    incubator/photark/trunk/photark-ui/src/main/webapp/images/
    incubator/photark/trunk/photark-ui/src/main/webapp/images/index.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/index.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/index_on.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/index_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/next.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/next_disabled.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next_disabled.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/next_on.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/prev.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_disabled.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev_disabled.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_on.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_on.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow_on.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_before_start.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/slide_before_start.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_pause.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/slide_pause.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/images/space.gif   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/space.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/js/
    incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js   (contents, props changed)
      - copied, changed from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/constants.js
    incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js   (with props)
Removed:
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.css
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.js
    incubator/photark/trunk/photark-ui/src/main/webapp/constants.js
    incubator/photark/trunk/photark-ui/src/main/webapp/index.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/index_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/next.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/next_disabled.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/next_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/prev.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/prev_disabled.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/prev_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/show_slide.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow_on.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/slide_before_start.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/slide_pause.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/space.gif
    incubator/photark/trunk/photark-ui/src/main/webapp/styles.css
Modified:
    incubator/photark/trunk/photark-appengine-webapp/war/constants.js
    incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.html
    incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html
    incubator/photark/trunk/photark-webapp/src/main/webapp/META-INF/sca-contribution.xml

Modified: incubator/photark/trunk/photark-appengine-webapp/war/constants.js
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-appengine-webapp/war/constants.js?rev=944109&r1=944108&r2=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-appengine-webapp/war/constants.js (original)
+++ incubator/photark/trunk/photark-appengine-webapp/war/constants.js Fri May 14 04:47:51 2010
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-if (! photark) {
-	var photark = {};
-}
-
-if (! photark.constants) {
-	photark.constants = {};
-}
-
-photark.constants.GalleryServiceEndpoint = "/Gallery?smd";
\ No newline at end of file

Copied: incubator/photark/trunk/photark-appengine-webapp/war/js/constants.js (from r943794, incubator/photark/trunk/photark-appengine-webapp/war/constants.js)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-appengine-webapp/war/js/constants.js?p2=incubator/photark/trunk/photark-appengine-webapp/war/js/constants.js&p1=incubator/photark/trunk/photark-appengine-webapp/war/constants.js&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
    (empty)

Copied: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css (from r943794, incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.css)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css?p2=incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css&p1=incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.css&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.css (original)
+++ incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css Fri May 14 04:47:51 2010
@@ -32,6 +32,7 @@
       CSS treatments. */
 	margin:0;
 	padding:0;
+	text-align:center;
  }
  
 
@@ -101,3 +102,32 @@
 	padding-top: 40px;
 }
 
+.uploadBtn{
+    border:1px solid #333333;
+    background:url(images/buttonEnabled.png) #d0d0d0 repeat-x scroll 0px top;
+    font-size:14px;
+    width:201px;
+    height:30px;
+    vertical-align:middle; /* emulates a <button> if node is not */
+    text-align:center;
+}
+.uploadHover{
+    background-image:url(images/buttonHover.png);
+    cursor:pointer;
+    font-weight:bold;
+}
+.uploadPress{
+    background-image:url(images/buttonActive.png);
+}
+.uploadDisabled{
+    background-image:none;
+    background-color:#666;
+    color:#999;
+    border:1px solid #999;
+}
+
+#progressDiv,#progressBar {
+    font-family:helvetica,arial,sans-serif;
+    font-size:90%;
+    z-index: 1000;
+}

Propchange: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/css/upload.css
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js?rev=944109&view=auto
==============================================================================
--- incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js (added)
+++ incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js Fri May 14 04:47:51 2010
@@ -0,0 +1,201 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//gallery json-rpc service
+dojo.require("dojo.rpc.JsonService");
+dojo.require("dojo._base.xhr");
+
+var albumCover;
+var albums;
+var albumName="New Album";
+var albumIndex;
+var albumDescEditOn=false;
+var albumDesc="";
+
+var gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
+
+function populateSelect(){
+    gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
+    gallery.getAlbums().addCallback( function(albums, exception) {
+        if(exception) {
+            alert(exception.msg);
+            return;
+        }
+        this.albums=albums;
+        var selectAlbum = dojo.byId("selectAlbum");
+
+        selectAlbum.options.length=0;
+        selectAlbum.options[selectAlbum.options.length] =  new Option("New Album", "New Album", true, false);
+        for(var pos = 0; pos<albums.length; pos++) {
+            selectAlbum.options[selectAlbum.options.length] =  new Option(albums[pos].name, albums[pos].name, false, false);
+        }
+        dojo.byId("selectAlbum").value=albumName;
+        manageAlbumFields();
+
+    });
+}
+
+//to set the album cover
+function setAlbumCoverResponse(cover, exception) {
+    if(exception){
+        alert(exception.msg);
+        return;
+    }
+    document.getElementById('albumCoverDiv').innerHTML = "<table id='albumCover' style='width:200px;' border='0' cellspacing='0' cellpadding='1'></table>";
+
+    var table=document.getElementById('albumCover');
+    var row = table.insertRow(0);
+    var column = row.insertCell(0);
+    if (cover != null) {
+        var img = document.createElement("img");
+        img.src = (window.location.href).replace("admin/upload.html","") + "gallery/"+ albumName +"/" + cover;
+        var img_html = "<img src=" + img.src + " class=\"slideImage\" width=200px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
+        var html = "<table border=\"0\" style=\"width:180px; text-align: center;\"><tr style=\"cellpadding:10\"><td><a>" + img_html + "</a></td></tr><tr><td>"+albumName+"</td></tr></table>";
+        column.innerHTML = html;
+    }
+}
+
+function initializeAdminGallery() {
+    var table=document.getElementById('adminTableGallery');
+    var lastRow = table.rows.length;
+    for (var i = 0; i < albums[albumIndex].pictures.length;) {
+        var row = table.insertRow( Math.floor(i/4));
+    for (var j = 0; j < 4;j++) {
+            var column = row.insertCell(i%4);
+            if (albums[albumIndex].pictures[i] != null) {
+                var albumName = albums[albumIndex].name;
+                var img = document.createElement("img");
+                img.src = (window.location.href).replace("admin/upload.html","") + "gallery/"+ albumName +"/" + albums[albumIndex].pictures[i];
+                var img_html = "<img src=" + img.src + " class=\"slideImage\" width=200px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
+                var html = "<table border=\"0\" style=\"width:180px; text-align: center;\"><tr style=\"cellpadding:10\"><td colspan=\"2\"><a>" + img_html + "</a></td></tr><tr><td>"+albums[albumIndex].pictures[i]+"</td><td><a href=\"javascript:confirmDelete('"+albums[albumIndex].pictures[i]+"');\">Remove</a></td></tr></table>";
+                column.innerHTML = html;
+            }
+        i++;
+        }
+
+    }
+}
+
+function manageAlbumFields(){
+    var selectAlbum = dojo.byId("selectAlbum");
+    albumName = selectAlbum.value;
+    document.getElementById('adminGallery').innerHTML = "<table id='adminTableGallery' style='width:720px;' border='0' cellspacing='0' cellpadding='1'></table>";
+    albumIndex=selectAlbum.selectedIndex-1;
+    cancelAlbumDesc();
+    dojo.byId("progressBar").style.display="none";
+
+    if(albumName == "New Album") {
+        document.getElementById('albumCoverDiv').innerHTML = "<table id='albumCover' style='width:200px;' border='0' cellspacing='0' cellpadding='1'></table>";
+        dojo.byId("newAlbumName").style.display = "";
+        dojo.byId("newAlbumLabel").style.display = "";
+        dojo.byId("btnAlbumDesc").style.display = "none";
+        dojo.byId("deleteAlbum").style.display = "none";
+        dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription'></textarea>";
+    }else{
+        dojo.byId("newAlbumName").style.display = "none";
+        dojo.byId("newAlbumLabel").style.display = "none";
+        dojo.byId("btnAlbumDesc").style.display = "";
+        dojo.byId("deleteAlbum").style.display = "";
+        gallery.getAlbums().addCallback( function(albums, exception) {
+            if(exception) {
+                alert(exception.msg);
+                return;
+            }
+            dojo.byId("albumDescription").value=albums[selectAlbum.selectedIndex-1].description;
+            gallery.getAlbumCover(albums[albumIndex].name).addCallback(setAlbumCoverResponse);
+            initializeAdminGallery();
+        });
+        dojo.byId("albumDescription").value="";
+    }
+}
+
+//this method will delete the selected image from the current album
+function addAlbumDesc(){
+    if(albumDescEditOn==false){
+        albumDescEditOn=true;
+        albumDesc=dojo.byId("albumDescription").value;
+        dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription'></textarea>";
+        dojo.byId("albumDescription").value=albumDesc;
+        dojo.byId("albumDescription").focus();
+        dojo.byId("btnAlbumDesc").innerHTML="Save album Description";
+        dojo.byId("cancelBtnAlbumDesc").style.display="";
+    }else{
+        var desc=dojo.byId("albumDescription").value;
+        cancelAlbumDesc();
+
+        dojo.xhrPost({
+            url:"upload",
+            content:{albumName:albumName,addAlbumDesc:desc},
+            handleAs: "text",
+            load: function(response, ioArgs){
+                reloadAdminGallery();
+            },
+            error: function(response, ioArgs){
+            console.error("Error in editing album description");
+            }
+        });
+    }
+}
+
+//to cancel the editing of the albumDescription
+function cancelAlbumDesc(){
+    dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription' readonly='readonly' style='background-color:#F4F2F2;'></textarea>";
+    dojo.byId("albumDescription").value=albumDesc;
+    dojo.byId("btnAlbumDesc").innerHTML="Edit album Description";
+    dojo.byId("cancelBtnAlbumDesc").style.display="none";
+    albumDescEditOn=false;
+}
+
+//this method will delete the selected image from the current album
+function removeImage(imageName){
+    dojo.xhrDelete({
+        url:"upload",
+        content:{imageName:imageName,albumName:albumName},
+        handleAs: "text",
+        load: function(response, ioArgs){
+            reloadAdminGallery();
+        },
+        error: function(response, ioArgs){
+        console.error("Error in deleting file");
+        }
+    });
+}
+
+function reloadAdminGallery(){
+    gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
+    populateSelect();
+}
+
+//confirm before deletion
+function confirmDelete(item ){
+var r;
+    if(item==undefined){
+        r=confirm("Are you sure to delete the album "+albumName+"?");
+    }else{
+        r=confirm("Are you sure to delete the image "+item+"?");
+    }
+    if (r==true){
+        removeImage(item);
+    }
+}
+
+dojo.addOnLoad( function() {
+    populateSelect();
+
+});

Propchange: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/admin.js
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/upload.js (from r943794, incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.js)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/upload.js?p2=incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/upload.js&p1=incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.js&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
    (empty)

Propchange: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/js/upload.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.html
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.html?rev=944109&r1=944108&r2=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.html (original)
+++ incubator/photark/trunk/photark-ui-admin/src/main/webapp/admin/upload.html Fri May 14 04:47:51 2010
@@ -20,243 +20,30 @@
 <html>
 
 <head>
-<script type="text/javascript" src="../dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true, debugAtAllCosts:false"></script>
-<script type="text/javascript" src="../constants.js"></script>
-<script type="text/javascript" src="upload.js" charset="utf-8"></script>
-
-<link rel="stylesheet" type="text/css" href="../dijit/themes/tundra/tundra.css">
-<link href="upload.css" rel="stylesheet">
-
-<style type="text/css">
-	.uploadBtn{
-	    border:1px solid #333333;
-	    background:url(buttonEnabled.png) #d0d0d0 repeat-x scroll 0px top;
-	    font-size:14px;
-	    width:201px;
-	    height:30px;
-	    vertical-align:middle; /* emulates a <button> if node is not */
-	    text-align:center;
-	}
-	.uploadHover{
-	    background-image:url(buttonHover.png);
-	    cursor:pointer;
-	    font-weight:bold;
-	}
-	.uploadPress{
-	    background-image:url(buttonActive.png);
-	}
-	.uploadDisabled{
-	    background-image:none;
-	    background-color:#666;
-	    color:#999;
-	    border:1px solid #999;
-	}
-</style>
-
-<style type="text/css">
-    #progressDiv,#progressBar { font-family:helvetica,arial,sans-serif; font-size:90%;z-index: 1000; }
-</style>
-
-<script type="text/javascript">
-	//gallery json-rpc service
-	dojo.require("dojo.rpc.JsonService");
-	dojo.require("dojo._base.xhr");
-	
-	var albumCover;
-	var albums;
-	var albumName="New Album";
-	var albumIndex;
-	var albumDescEditOn=false;
-	var albumDesc="";
-
-	var gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
-	
-	function populateSelect(){
-		gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
-		gallery.getAlbums().addCallback( function(albums, exception) {
-			if(exception) {
-				alert(exception.msg);
-				return;
-			}
-			this.albums=albums;
-			var selectAlbum = dojo.byId("selectAlbum");
-
-			selectAlbum.options.length=0;
-			selectAlbum.options[selectAlbum.options.length] =  new Option("New Album", "New Album", true, false);
-	        for(var pos = 0; pos<albums.length; pos++) {	
-				selectAlbum.options[selectAlbum.options.length] =  new Option(albums[pos].name, albums[pos].name, false, false);
-			}
-			dojo.byId("selectAlbum").value=albumName;
-			manageAlbumFields();
-
-		});
-	}
-	
-	//to set the album cover
-	function setAlbumCoverResponse(cover, exception) {
-		if(exception){
-			alert(exception.msg);
-			return;
-		}
-		document.getElementById('albumCoverDiv').innerHTML = "<table id='albumCover' style='width:200px;' border='0' cellspacing='0' cellpadding='1'></table>";
-		
-		var table=document.getElementById('albumCover');
-		var row = table.insertRow(0);
-		var column = row.insertCell(0);
-		if (cover != null) {
-			var img = document.createElement("img");
-			img.src = (window.location.href).replace("admin/upload.html","") + "gallery/"+ albumName +"/" + cover;
-			var img_html = "<img src=" + img.src + " class=\"slideImage\" width=200px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
-			var html = "<table border=\"0\" style=\"width:180px; text-align: center;\"><tr style=\"cellpadding:10\"><td><a>" + img_html + "</a></td></tr><tr><td>"+albumName+"</td></tr></table>";
-			column.innerHTML = html;
-		}
-	}
-		
-	function initializeAdminGallery() {
-		var table=document.getElementById('adminTableGallery');
-		var lastRow = table.rows.length;
-		for (var i = 0; i < albums[albumIndex].pictures.length;) {
-			var row = table.insertRow( Math.floor(i/4));
-		for (var j = 0; j < 4;j++) {
-				var column = row.insertCell(i%4);
-				if (albums[albumIndex].pictures[i] != null) {
-					var albumName = albums[albumIndex].name;
-					var img = document.createElement("img");
-					img.src = (window.location.href).replace("admin/upload.html","") + "gallery/"+ albumName +"/" + albums[albumIndex].pictures[i];
-					var img_html = "<img src=" + img.src + " class=\"slideImage\" width=200px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
-					var html = "<table border=\"0\" style=\"width:180px; text-align: center;\"><tr style=\"cellpadding:10\"><td colspan=\"2\"><a>" + img_html + "</a></td></tr><tr><td>"+albums[albumIndex].pictures[i]+"</td><td><a href=\"javascript:confirmDelete('"+albums[albumIndex].pictures[i]+"');\">Remove</a></td></tr></table>";
-					column.innerHTML = html;
-				}
-			i++;				
-			}
-	   		
-	   	}
-	}
-		
-	function manageAlbumFields(){
-		var selectAlbum = dojo.byId("selectAlbum");
-		albumName = selectAlbum.value;
-		document.getElementById('adminGallery').innerHTML = "<table id='adminTableGallery' style='width:720px;' border='0' cellspacing='0' cellpadding='1'></table>";
-		albumIndex=selectAlbum.selectedIndex-1;
-		cancelAlbumDesc();
-		dojo.byId("progressBar").style.display="none";
-
-		if(albumName == "New Album") {
-			document.getElementById('albumCoverDiv').innerHTML = "<table id='albumCover' style='width:200px;' border='0' cellspacing='0' cellpadding='1'></table>";
-			dojo.byId("newAlbumName").style.display = "";
-			dojo.byId("newAlbumLabel").style.display = "";
-			dojo.byId("btnAlbumDesc").style.display = "none";
-			dojo.byId("deleteAlbum").style.display = "none";
-			dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription'></textarea>";
-		}else{
-			dojo.byId("newAlbumName").style.display = "none";
-			dojo.byId("newAlbumLabel").style.display = "none";
-			dojo.byId("btnAlbumDesc").style.display = "";
-			dojo.byId("deleteAlbum").style.display = "";
-			gallery.getAlbums().addCallback( function(albums, exception) {
-				if(exception) {
-					alert(exception.msg);
-					return;
-				}
-				dojo.byId("albumDescription").value=albums[selectAlbum.selectedIndex-1].description;
-				gallery.getAlbumCover(albums[albumIndex].name).addCallback(setAlbumCoverResponse);
-				initializeAdminGallery();
-			});
-			dojo.byId("albumDescription").value=""; 
-		}
-	}
-	
-	//this method will delete the selected image from the current album
-	function addAlbumDesc(){
-		if(albumDescEditOn==false){
-			albumDescEditOn=true;
-			albumDesc=dojo.byId("albumDescription").value;
-			dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription'></textarea>";
-			dojo.byId("albumDescription").value=albumDesc;
-			dojo.byId("albumDescription").focus();
-			dojo.byId("btnAlbumDesc").innerHTML="Save album Description";
-			dojo.byId("cancelBtnAlbumDesc").style.display="";
-		}else{
-			var desc=dojo.byId("albumDescription").value;
-			cancelAlbumDesc();
-	
-			dojo.xhrPost({
-				url:"upload",
-				content:{albumName:albumName,addAlbumDesc:desc},
-				handleAs: "text",
-		        load: function(response, ioArgs){
-		        	reloadAdminGallery();
-				},
-		        error: function(response, ioArgs){
-		        console.error("Error in editing album description");
-		        }	
-			});
-		}
-	}
-	
-	//to cancel the editing of the albumDescription
-	function cancelAlbumDesc(){
-		dojo.byId("albumDescriptionDiv").innerHTML="<textarea cols='20' rows='5' class='textarea' name='albumDescription' id='albumDescription' readonly='readonly' style='background-color:#F4F2F2;'></textarea>";
-		dojo.byId("albumDescription").value=albumDesc;
-		dojo.byId("btnAlbumDesc").innerHTML="Edit album Description";
-		dojo.byId("cancelBtnAlbumDesc").style.display="none";
-		albumDescEditOn=false;
-	}	
-	
-	//this method will delete the selected image from the current album
-	function removeImage(imageName){
-		dojo.xhrDelete({
-			url:"upload",
-			content:{imageName:imageName,albumName:albumName},
-			handleAs: "text",
-	        load: function(response, ioArgs){
-	        	reloadAdminGallery();
-			},
-	        error: function(response, ioArgs){
-	        console.error("Error in deleting file");
-	        }	
-		});
-	}
-		
-	function reloadAdminGallery(){
-		gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
-		populateSelect();
-	}
-	
-	//confirm before deletion
-	function confirmDelete(item ){
-	var r;
-		if(item==undefined){
-			r=confirm("Are you sure to delete the album "+albumName+"?");
-		}else{
-			r=confirm("Are you sure to delete the image "+item+"?");
-		}
-		if (r==true){
-			removeImage(item);
-  		}
-	}
-	
-	dojo.addOnLoad( function() { 
-		populateSelect();
-		
-	});
-	
-	
-</script>
+    <script type="text/javascript" src="../dojo/dojo.js" djConfig="isDebug:false, parseOnLoad: true, debugAtAllCosts:false"></script>
+    <script type="text/javascript" src="../js/constants.js"></script>
+    <script type="text/javascript" src="js/upload.js" charset="utf-8"></script>
+    <link rel="stylesheet" type="text/css" href="../dijit/themes/tundra/tundra.css" />
+    <link href="css/upload.css" rel="stylesheet" />
+    <script type="text/javascript" src="js/admin.js" charset="utf-8"></script>
 </head>
 
 <body>
-	<center>
     <div id="newAlbum">
-	  <fieldset id="newAlbumDetails" style="text-align: left;">
+	  <fieldset id="newAlbumDetails" style="text-align:left;">
 		  <legend>Album Details</legend>
 		  <ol>
 			  <li>
-				  <label for="selectAlbum">Select Album:</label>
-				  <select  id="selectAlbum" name="selectAlbum" autoComplete="true" onChange="manageAlbumFields();"></select>
-				  <label  id="newAlbumLabel">New Album:</label>
+				  <label id="selectAlbumLabel" for="selectAlbum">Select Album:</label>
+				  <select id="selectAlbum" name="selectAlbum" autoComplete="true" onChange="manageAlbumFields();">
+                  </select>
+				  <label id="newAlbumLabel" for="newAlbumName" >
+                      New Album:
+                  </label>
 				  <input type="text" class="text" name="newAlbumName" id="newAlbumName">
-				  <button type="button" name="deleteAlbum" id="deleteAlbum"  onClick="confirmDelete(null);" >Delete Album</button>
+				  <button type="button" name="deleteAlbum" id="deleteAlbum" onClick="confirmDelete(null);">
+                      Delete Album
+                  </button>
 			  </li>
 			  <li>
 				  <table border="0">
@@ -276,8 +63,13 @@
   					<tr>
     					<td></td>
 					<td>
-						<div id="btnAlbumDesc" class="uploadBtn btn" onClick="addAlbumDesc();" style="float: right;" >Edit album Description</div>
-						<div id="cancelBtnAlbumDesc" class="uploadBtn btn" onClick="cancelAlbumDesc();" style="float: right;" >Cancel</div>
+						<div id="btnAlbumDesc" class="uploadBtn btn" onClick="addAlbumDesc();" style="float: right;">
+                            Edit album Description
+                        </div>
+						<div id="cancelBtnAlbumDesc" class="uploadBtn btn" onClick="cancelAlbumDesc();"
+                             style="float: right;" >
+                            Cancel
+                        </div>
 					</td>
   					</tr>
 				</table>
@@ -289,19 +81,23 @@
               </li>
               <li>
                	<div id="progressDiv" class="tundra" > 
-                	<div id="progressBar" dojoType="dijit.ProgressBar" style="width:300px;display:none;" jsId="jsProgress"></div> 
+                	<div id="progressBar" dojoType="dijit.ProgressBar" style="width:300px;display:none;"
+                         jsId="jsProgress">                    
+                    </div>
                	</div>
               </li>
               <li >
-               	<div id="btnUploader" class="uploadBtn btn" >Select Files</div>
-    		<div id="btnUpload" class="uploadBtn btn" onClick="doUpload();">Upload</div>
+               	<div id="btnUploader" class="uploadBtn btn">
+                       Select Files
+                </div>
+    		    <div id="btnUpload" class="uploadBtn btn" onClick="doUpload();">
+                    Upload
+                </div>
               </li>
 		  </ol>
 	  </fieldset>
 	</div>
-	<div id='adminGallery'>
-   		
+	<div id="adminGallery">
     </div>
-	</center>
 </body>
 </html>
\ No newline at end of file

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/styles.css)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css?p2=incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css&p1=incubator/photark/trunk/photark-ui/src/main/webapp/styles.css&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/styles.css (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css Fri May 14 04:47:51 2010
@@ -22,6 +22,7 @@ body {
 	color: #888888;
 	background-color: #000000;
 	margin-top: 0px;
+	text-align: center;
 }
 
 html {

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/css/styles.css
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html?rev=944109&r1=944108&r2=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html Fri May 14 04:47:51 2010
@@ -18,306 +18,77 @@
 -->
 <html>
 <head>
-<title>Apache PhotArk - Photo Gallery</title>
+    <title>Apache PhotArk - Photo Gallery</title>
 
-<link href="styles.css" rel="stylesheet">
-
-<script type="text/javascript" src="constants.js"></script>
-<script type="text/javascript" src="dojo/dojo.js"></script>
-
-<script language="JavaScript">
-
-    index_off= new Image(31,31); index_off.src = "index.gif";
-    index_on = new Image(31,31); index_on.src = "index_on.gif";
-    next_off = new Image(31,31); next_off.src = "next.gif";
-    next_on  = new Image(31,31); next_on.src = "next_on.gif";
-    prev_off = new Image(31,31); prev_off.src = "prev.gif";
-    prev_on  = new Image(31,31); prev_on.src = "prev_on.gif";
-    slide_before_start  = new Image(31,31); slide_before_start.src = "slide_before_start.gif";
-    slide_pause  = new Image(31,31); slide_pause.src = "slide_pause.gif";
-    show_slide  = new Image(31,31); show_slide.src = "show_slide.gif";
-    show_slide_on  = new Image(31,31); show_slide_on.src = "show_slide_on.gif";
-    show_slide_slow  = new Image(31,31); show_slide_slow.src = "show_slide_slow.gif";
-    show_slide_slow_on  = new Image(31,31); show_slide_slow_on.src = "show_slide_slow_on.gif";
- 
-    var gallery;
-	var galleryName;
-	var galleryAlbums;
-	var albumCovers = new Array();
-	var albumName;
-	var albumItems;
-	var albumPos = 0;
-    var pos = 0;
-    var slideShowSpeed=0;
-    var timer;
-	
-	dojo.addOnLoad(function() {
-		dojo.require("dojo.rpc.JsonService");
-	    dojo.addOnLoad(initServices);
-	    dojo.addOnLoad(initGallery);
-	 });
-	 	 
-	function initServices(){
-		gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
-	}
-	
-	function initGallery() {
-		try {
-			if( !gallery) {
-				gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
-			}
-			gallery.getAlbums().addCallback(gallery_getAlbumsResponse);
-		} catch(exception) {
-			alert(exception);
-		}
-	}
-	
-	function gallery_getAlbumsResponse(albums, exception) {
-		if(exception) {
-			alert(exception.msg);
-			return;
-		}
-		galleryAlbums = albums;
-
-		for(i=0; i< galleryAlbums.length; i++)
-		{
-			gallery.getAlbumCover(galleryAlbums[i].name).addCallback(gallery_getAlbumCoverResponse);
-		}
-	}
-
-
-	function gallery_getAlbumCoverResponse(cover, exception) {
-		if(exception){
-			alert(exception.msg);
-			return;
-		}
-		albumCovers[pos] = cover;
-		pos += 1;
-		if(albumCovers.length == galleryAlbums.length) 
-		{
-			initializeGallery();
-			displayGallery();
-		}
-	}
-
-	function initializeGallery() {
-		var table=document.getElementById('tableGallery');
-		var lastRow = table.rows.length;
-		for (i = 0; i < galleryAlbums.length; i++) {
-			var row = table.insertRow(lastRow++);
-			var column = row.insertCell(0);
-			
-			if (albumCovers[i] != null) {
-			
-				var albumName = galleryAlbums[i].name;
-				var img = document.createElement("img");
-				img.src = window.location.href + "gallery/"+ albumName +"/" + albumCovers[i];
-				var img_html = "<img src=" + img.src + " class=\"slideImage\" width=180px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
-				var html = "<a href=\"javascript:initializeAlbum('" + albumName + "')\">" + img_html + "</a>";
-				column.innerHTML = html;
-				
-				column = row.insertCell(1);
-				column.innerHTML = "<div style=\"width:500\">"+galleryAlbums[i].description+"</div>";
-				
-				row = table.insertRow(lastRow++);
-				column = row.insertCell(0)
-				column.innerHTML = albumName;
-			
-				row = table.insertRow(lastRow++);
-				column = row.insertCell(0)
-				column.innerHTML = "<img src=\"space.gif\" class=\"slideImage\" width=\"10\" height=\"10\" ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\">";
-			}
-	   }
-	}
-
-	function displayGallery() {
-		setVisibility('gallery',true);
-		setVisibility('album',false);
-	}
-
-	function initializeAlbum(albumName) {
-		try {
-			this.albumName = albumName; 
-			gallery.getAlbumPictures(albumName).addCallback(gallery_getAlbumPicturesResponse);
-		} catch(exception) {
-			alert(e);
-		}		
-	}
-
-	function gallery_getAlbumPicturesResponse(items, exception) {
-		if(exception) {
-			alert(exception.msg);
-			displayGallery();
-			return;
-		}
-		albumItems = items;
-		albumPos = 0;
-		showAlbum();
-	}
-
-	function showAlbum() {
-		if(albumItems.length > 0) {
-			showImage(albumPos);
-		}
-		displayAlbum();
-	}	
-	
-	function displayAlbum() {
-		setVisibility('gallery',false);
-		setVisibility('album',true);
-	}
-
-	function showImage(albumPos) {		
-	   	var img = document.createElement("img");
-		img.onload = function(evt) {
-			document.getElementById("albumImage").src = this.src;
-	        document.getElementById("albumImage").width=this.width;
-	        document.getElementById("albumImage").height=this.height;
-	    }
-	    img.src = window.location.href + "gallery/"+ this.albumName +"/" + albumItems[albumPos];
-	    return false;
-	}
-	
-	function goNext() {
-		if(albumPos < albumItems.length - 1) {
-			albumPos++;
-			showImage(albumPos);
-		}
-	}
-
-	function goPrevious() {
-		if(albumPos > 0) {
-			albumPos--;
-			showImage(albumPos);
-		}
-	}
-	
-	function setVisibility(divId, visible) {
-		//valid values { visible, hidden }
-		if (document.getElementById) {
-			var element = document.getElementById(divId)
-			if(visible) {
-				element.style.display = 'block';
-				element.style.visibility = 'visible';
-			} else {
-				element.style.display = 'none';
-				element.style.visibility = 'hidden';
-			}
-		}
-	} 
-	
-	function onGoPreviousMouseOver(){
-		if(albumPos == 0){
-			document.previous.src=prev_off.src;
-		}else{
-			document.previous.src=prev_on.src;
-		}
-	}
-	
-	function onGoNextMouseOver(){
-		if(albumPos == albumItems.length - 1){
-			document.next.src=next_off.src;
-		}else{
-			document.next.src=next_on.src;
-		}
-	}
-	
-	function goSlideShow(){		
-		if(slideShowSpeed==0){
-			slideShowSpeed=1;
-			clearTimeout(timer);
-			startTimer(5000);
-		}else if(slideShowSpeed==1) {
-			slideShowSpeed=2;
-			clearTimeout(timer);
-			startTimer(2000);
-		}else{
-			slideShowSpeed=0;
-			clearTimeout(timer);
-		}
-	}
-	
-	function beforeClick(){
-			clearTimeout(timer);
-			slideShowSpeed=0;
-			document.show.src=slide_before_start.src;			
-	}
-	
-	function onSlideShow(){
-		if(slideShowSpeed==0){
-			document.show.src=show_slide_slow_on.src;
-		}else if(slideShowSpeed==1){
-			document.show.src=show_slide_on.src;
-		}else{
-			document.show.src=slide_pause.src;
-		}
-	}
-	
-	function offSlideShow(){
-		if(slideShowSpeed==0){
-			document.show.src=slide_before_start.src;
-		}else if(slideShowSpeed==1){
-			document.show.src=show_slide_slow.src;
-		}else{
-			document.show.src=show_slide.src;
-		}
-	}
-	
-	function startTimer(time){
-		if(albumPos < albumItems.length - 1) {
-			albumPos++;
-		}else{
-			albumPos=1;
-		}
-		showImage(albumPos);
-		timer=setTimeout("startTimer("+time+")",time);
-	}
-	
-</script>
+    <link href="css/styles.css" rel="stylesheet">
 
+    <script type="text/javascript" src="js/constants.js"></script>
+    <script type="text/javascript" src="dojo/dojo.js"></script>
+    <script type="text/javascript" src="js/gallery.js"></script>
 </head>
 
 <body onload="initGallery()">
-<br>
-<h1><center>Apache PhotArk Gallery</center></h1>
-<br>
-<br>
-
-<div id='gallery' style='display:none;visibility:hidden;'>
-     <center>
-     <table id='tableGallery' style='width:720px;' border='0' cellspacing='0' cellpadding='1'></table>
-     </center>
-</div>
-  
-<div id="album" style="display:none;visibility:hidden;">
-  <center>
-
-  <table style="height:54px;" cellspacing="0" cellpadding="0" border="0">
-     <tr>
-     	<td valign="middle">
-     	   <!-- Navigation Header -->
-		   <table style="width:100%;" cellspacing="0" cellpadding="0" border="0">
-             <tr>
-             	<td style="width:31px;"><a href="javascript:displayGallery()" onmouseover="document.index.src=index_on.src" onmouseout="document.index.src=index_off.src" onmousedown="beforeClick();"><img src="index.gif" width="31" height="31" border="0" title="Index page" name="index" alt=""></a></td>
-                <td style="width:31px;"><a href="javascript:goPrevious()" onmouseover="onGoPreviousMouseOver();" onmouseout="document.previous.src=prev_off.src" onmousedown="beforeClick();"><img src="prev.gif" width="31" height="31" border="0" title="Previous image" name="previous" alt=""></a></td>
-                <td style="width:31px;"><a href="javascript:goNext()" onmouseover="onGoNextMouseOver();" onmouseout="document.next.src=next_off.src" onmousedown="beforeClick();"><img src="next.gif" width="31" height="31" border="0" title="Next image" name="next" alt=""></a></td>
-                <td style="width:31px;"><a href="javascript:goSlideShow()" onmouseover="onSlideShow();" onmouseout="offSlideShow();"><img src="slide_before_start.gif" width="31" height="31" border="0" title="Start(Slow)/Fast/Stop slideshow" name="show" alt=""></a></td> 
-             </tr>
-		   </table>
-		</td>
-	</tr>
-  </table>
-
-  <table style="width:720px;" border="0" cellspacing="0" cellpadding="0">
-    <tr>
-     	<td align="center"> <!-- Image without original -->
-        <img id="albumImage" src="space.gif" class="slideImage" width="720" height="540" ondragstart="return false" onselectstart="return false" oncontextmenu="return false" galleryimg="no" usemap="#imagemap" alt="">
-		</td>
-    </tr>
-  </table>
-
-  </center>  
-</div>
+    <div>
+        <h1>Apache PhotArk Gallery</h1>
+    </div>
+        
+    <br>
+
+    <div id="gallery" style="display:none;visibility:hidden;">
+         <table id='tableGallery' style="margin-left:auto; margin-right:auto;width:720px;" border="0"
+                cellspacing="0" cellpadding="1">
+         </table>
+    </div>
+
+    <div id="album" style="display:none;visibility:hidden;">
+      <table style="margin-left:auto; margin-right:auto; height:54px;" cellspacing="0" cellpadding="0" border="0">
+         <tr>
+            <td valign="middle">
+               <!-- Navigation Header -->
+               <table style="width:100%;" cellspacing="0" cellpadding="0" border="0">
+                 <tr>
+                    <td style="width:31px;">
+                        <a href="javascript:displayGallery()" onmouseover="document.index.src=index_on.src"
+                           onmouseout="document.index.src=index_off.src" onmousedown="beforeClick();">
+                            <img src="images/index.gif" width="31" height="31" border="0" title="Index page"
+                                 name="index" alt="" />
+                        </a>
+                    </td>
+                    <td style="width:31px;">
+                        <a href="javascript:goPrevious()" onmouseover="onGoPreviousMouseOver();"
+                           onmouseout="document.previous.src=prev_off.src" onmousedown="beforeClick();">
+                            <img src="images/prev.gif" width="31" height="31" border="0" title="Previous image"
+                                 name="previous" alt="" />
+                        </a>
+                    </td>
+                    <td style="width:31px;">
+                        <a href="javascript:goNext()" onmouseover="onGoNextMouseOver();"
+                           onmouseout="document.next.src=next_off.src" onmousedown="beforeClick();">
+                            <img src="images/next.gif" width="31" height="31" border="0" title="Next image"
+                                 name="next" alt="" />
+                        </a>
+                    </td>
+                    <td style="width:31px;">
+                        <a href="javascript:goSlideShow()" onmouseover="onSlideShow();" onmouseout="offSlideShow();">
+                            <img src="images/slide_before_start.gif" width="31" height="31" border="0"
+                                 title="Start(Slow)/Fast/Stop slideshow" name="show" alt=""/>
+                        </a>
+                    </td>
+                 </tr>
+               </table>
+            </td>
+        </tr>
+      </table>
+
+      <table style="margin-left:auto; margin-right:auto;width:720px;" border="0" cellspacing="0" cellpadding="0">
+        <tr>
+            <td align="center"> <!-- Image without original -->
+                <img id="albumImage" src="images/space.gif" class="slideImage" width="720" height="540" ondragstart="return false"
+                     onselectstart="return false" oncontextmenu="return false" galleryimg="no" usemap="#imagemap" alt=""/>
+            </td>
+        </tr>
+      </table>
+    </div>
 
 </body>
-</html>
\ No newline at end of file
+</html>

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/index.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/index.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/index.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/index.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/index.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/index.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/index_on.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/index_on.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/index_on.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/index_on.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/index_on.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/index_on.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/next.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/next.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/next.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/next.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/next.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/next_disabled.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next_disabled.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/next_disabled.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/next_disabled.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/next_disabled.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/next_disabled.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/next_on.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/next_on.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/next_on.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/next_on.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/next_on.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/next_on.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/prev.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/prev.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/prev.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_disabled.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev_disabled.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_disabled.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_disabled.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/prev_disabled.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_disabled.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_on.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/prev_on.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_on.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_on.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/prev_on.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/prev_on.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/show_slide.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_on.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_on.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_on.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_on.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_on.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_on.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow_on.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow_on.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow_on.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow_on.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/show_slide_slow_on.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/show_slide_slow_on.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_before_start.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/slide_before_start.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_before_start.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_before_start.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/slide_before_start.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_before_start.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_pause.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/slide_pause.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_pause.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_pause.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/slide_pause.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/slide_pause.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/images/space.gif (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/space.gif)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/images/space.gif?p2=incubator/photark/trunk/photark-ui/src/main/webapp/images/space.gif&p1=incubator/photark/trunk/photark-ui/src/main/webapp/space.gif&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
Binary files - no diff available.

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/images/space.gif
------------------------------------------------------------------------------
    svn:mime-type = image/gif

Copied: incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js (from r943794, incubator/photark/trunk/photark-ui/src/main/webapp/constants.js)
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js?p2=incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js&p1=incubator/photark/trunk/photark-ui/src/main/webapp/constants.js&r1=943794&r2=944109&rev=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/constants.js (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js Fri May 14 04:47:51 2010
@@ -31,4 +31,4 @@ photark.constants.adminContextRoot = "/p
 
 photark.constants.GalleryServiceEndpoint = photark.constants.contextRoot + "GalleryService?smd";
 
-photark.constants.UploadEndpoint = photark.constants.adminContextRoot + "upload";
\ No newline at end of file
+photark.constants.UploadEndpoint = photark.constants.adminContextRoot + "upload";

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/js/constants.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js?rev=944109&view=auto
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js (added)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js Fri May 14 04:47:51 2010
@@ -0,0 +1,264 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+var index_off= new Image(31,31); index_off.src = "images/index.gif";
+var index_on = new Image(31,31); index_on.src = "images/index_on.gif";
+var next_off = new Image(31,31); next_off.src = "images/next.gif";
+var next_on  = new Image(31,31); next_on.src = "images/next_on.gif";
+var prev_off = new Image(31,31); prev_off.src = "images/prev.gif";
+var prev_on  = new Image(31,31); prev_on.src = "images/prev_on.gif";
+var slide_before_start  = new Image(31,31); slide_before_start.src = "images/slide_before_start.gif";
+var slide_pause  = new Image(31,31); slide_pause.src = "images/slide_pause.gif";
+var show_slide  = new Image(31,31); show_slide.src = "images/show_slide.gif";
+var show_slide_on  = new Image(31,31); show_slide_on.src = "images/show_slide_on.gif";
+var show_slide_slow  = new Image(31,31); show_slide_slow.src = "images/show_slide_slow.gif";
+var show_slide_slow_on  = new Image(31,31); show_slide_slow_on.src = "images/show_slide_slow_on.gif";
+
+var gallery;
+var galleryName;
+var galleryAlbums;
+var albumCovers = new Array();
+var albumName;
+var albumItems;
+var albumPos = 0;
+var pos = 0;
+var slideShowSpeed=0;
+var timer;
+
+dojo.addOnLoad(function() {
+    dojo.require("dojo.rpc.JsonService");
+    dojo.addOnLoad(initServices);
+    dojo.addOnLoad(initGallery);
+ });
+
+function initServices(){
+    gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
+}
+
+function initGallery() {
+    try {
+        if( !gallery) {
+            gallery = new dojo.rpc.JsonService( photark.constants.GalleryServiceEndpoint );
+        }
+        gallery.getAlbums().addCallback(gallery_getAlbumsResponse);
+    } catch(exception) {
+        alert(exception);
+    }
+}
+
+function gallery_getAlbumsResponse(albums, exception) {
+    if(exception) {
+        alert(exception.msg);
+        return;
+    }
+    galleryAlbums = albums;
+
+    for(i=0; i< galleryAlbums.length; i++)
+    {
+        gallery.getAlbumCover(galleryAlbums[i].name).addCallback(gallery_getAlbumCoverResponse);
+    }
+}
+
+
+function gallery_getAlbumCoverResponse(cover, exception) {
+    if(exception){
+        alert(exception.msg);
+        return;
+    }
+    albumCovers[pos] = cover;
+    pos += 1;
+    if(albumCovers.length == galleryAlbums.length)
+    {
+        initializeGallery();
+        displayGallery();
+    }
+}
+
+function initializeGallery() {
+    var table=document.getElementById('tableGallery');
+    var lastRow = table.rows.length;
+    for (i = 0; i < galleryAlbums.length; i++) {
+        var row = table.insertRow(lastRow++);
+        var column = row.insertCell(0);
+
+        if (albumCovers[i] != null) {
+
+            var albumName = galleryAlbums[i].name;
+            var img = document.createElement("img");
+            img.src = window.location.href + "gallery/"+ albumName +"/" + albumCovers[i];
+            var img_html = "<img src=" + img.src + " class=\"slideImage\" width=180px ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\"/>";
+            var html = "<a href=\"javascript:initializeAlbum('" + albumName + "')\">" + img_html + "</a>";
+            column.innerHTML = html;
+
+            column = row.insertCell(1);
+            column.innerHTML = "<div style=\"width:500\">"+galleryAlbums[i].description+"</div>";
+
+            row = table.insertRow(lastRow++);
+            column = row.insertCell(0)
+            column.innerHTML = albumName;
+
+            row = table.insertRow(lastRow++);
+            column = row.insertCell(0)
+            column.innerHTML = "<img src=\"images/space.gif\" class=\"slideImage\" width=\"10\" height=\"10\" ondragstart=\"return false\" onselectstart=\"return false\" oncontextmenu=\"return false\" galleryimg=\"no\" usemap=\"#imagemap\" alt=\"\">";
+        }
+   }
+}
+
+function displayGallery() {
+    setVisibility('gallery',true);
+    setVisibility('album',false);
+}
+
+function initializeAlbum(albumName) {
+    try {
+        this.albumName = albumName;
+        gallery.getAlbumPictures(albumName).addCallback(gallery_getAlbumPicturesResponse);
+    } catch(exception) {
+        alert(e);
+    }
+}
+
+function gallery_getAlbumPicturesResponse(items, exception) {
+    if(exception) {
+        alert(exception.msg);
+        displayGallery();
+        return;
+    }
+    albumItems = items;
+    albumPos = 0;
+    showAlbum();
+}
+
+function showAlbum() {
+    if(albumItems.length > 0) {
+        showImage(albumPos);
+    }
+    displayAlbum();
+}
+
+function displayAlbum() {
+    setVisibility('gallery',false);
+    setVisibility('album',true);
+}
+
+function showImage(albumPos) {
+    var img = document.createElement("img");
+    img.onload = function(evt) {
+        document.getElementById("albumImage").src = this.src;
+        document.getElementById("albumImage").width=this.width;
+        document.getElementById("albumImage").height=this.height;
+    }
+    img.src = window.location.href + "gallery/"+ this.albumName +"/" + albumItems[albumPos];
+    return false;
+}
+
+function goNext() {
+    if(albumPos < albumItems.length - 1) {
+        albumPos++;
+        showImage(albumPos);
+    }
+}
+
+function goPrevious() {
+    if(albumPos > 0) {
+        albumPos--;
+        showImage(albumPos);
+    }
+}
+
+function setVisibility(divId, visible) {
+    //valid values { visible, hidden }
+    if (document.getElementById) {
+        var element = document.getElementById(divId)
+        if(visible) {
+            element.style.display = 'block';
+            element.style.visibility = 'visible';
+        } else {
+            element.style.display = 'none';
+            element.style.visibility = 'hidden';
+        }
+    }
+}
+
+function onGoPreviousMouseOver(){
+    if(albumPos == 0){
+        document.previous.src=prev_off.src;
+    }else{
+        document.previous.src=prev_on.src;
+    }
+}
+
+function onGoNextMouseOver(){
+    if(albumPos == albumItems.length - 1){
+        document.next.src=next_off.src;
+    }else{
+        document.next.src=next_on.src;
+    }
+}
+
+function goSlideShow(){
+    if(slideShowSpeed==0){
+        slideShowSpeed=1;
+        clearTimeout(timer);
+        startTimer(5000);
+    }else if(slideShowSpeed==1) {
+        slideShowSpeed=2;
+        clearTimeout(timer);
+        startTimer(2000);
+    }else{
+        slideShowSpeed=0;
+        clearTimeout(timer);
+    }
+}
+
+function beforeClick(){
+        clearTimeout(timer);
+        slideShowSpeed=0;
+        document.show.src=slide_before_start.src;
+}
+
+function onSlideShow(){
+    if(slideShowSpeed==0){
+        document.show.src=show_slide_slow_on.src;
+    }else if(slideShowSpeed==1){
+        document.show.src=show_slide_on.src;
+    }else{
+        document.show.src=slide_pause.src;
+    }
+}
+
+function offSlideShow(){
+    if(slideShowSpeed==0){
+        document.show.src=slide_before_start.src;
+    }else if(slideShowSpeed==1){
+        document.show.src=show_slide_slow.src;
+    }else{
+        document.show.src=show_slide.src;
+    }
+}
+
+function startTimer(time){
+    if(albumPos < albumItems.length - 1) {
+        albumPos++;
+    }else{
+        albumPos=1;
+    }
+    showImage(albumPos);
+    timer=setTimeout("startTimer("+time+")",time);
+}

Propchange: incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/photark/trunk/photark-webapp/src/main/webapp/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/photark/trunk/photark-webapp/src/main/webapp/META-INF/sca-contribution.xml?rev=944109&r1=944108&r2=944109&view=diff
==============================================================================
--- incubator/photark/trunk/photark-webapp/src/main/webapp/META-INF/sca-contribution.xml (original)
+++ incubator/photark/trunk/photark-webapp/src/main/webapp/META-INF/sca-contribution.xml Fri May 14 04:47:51 2010
@@ -21,8 +21,4 @@
               xmlns:photark="http://org.apache.photoark">
    <deployable composite="photark:photo-gallery-jcr"/>
    
-   <!-- 
-   <import.java package="org.apache.photark.services.album"/>
-   <import.java package="org.apache.photark.services.gallery"/>
-    -->
 </contribution>



Mime
View raw message