You are viewing a plain text version of this content. The canonical link for it is here.
Posted to photark-commits@incubator.apache.org by su...@apache.org on 2011/08/19 18:57:10 UTC

svn commit: r1159743 - in /incubator/photark/trunk/photark-ui/src/main/webapp: gallery.html js/gallery.js

Author: subash
Date: Fri Aug 19 18:57:09 2011
New Revision: 1159743

URL: http://svn.apache.org/viewvc?rev=1159743&view=rev
Log:
Added pre loader button to wait until pending face app results

Modified:
    incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html
    incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js

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=1159743&r1=1159742&r2=1159743&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/gallery.html Fri Aug 19 18:57:09 2011
@@ -115,8 +115,10 @@
     	 			<input id="addtag-input" style="width:20;" type="text" style="display:inline;" value="" size="20" alt="add tag..."/><input type="button" onclick="addTag();" style="display:inline;" value="Add Tag"/><input type="button" onclick="showFriends();" style="display:inline;" value="Recognize Friends"/>From
                               <select  id="faceAppType" name="faceAppType" >
                                 <option value="facebook">Facebook</option>
-                                <option value="private">Private NameSpace</option>
+                                <option value="private">Private</option>
                               </select>
+                    <div id="map" style="position:relative; width:50px; height:50px; border:1px solid #000;">
+<img id="loadingImg" src="https://lh4.googleusercontent.com/-B8cbfUZ3RdY/Tk6Z6A1xwKI/AAAAAAAAANQ/afWGPBp9fNg/s128/ajax-loader.gif" style=" visibility:hidden; right:0px; top:30px; z-index:100;" /></div>
 
                      <table id='faceTable' width="300" border="0" cellspacing="0" cellpadding="1">
 			         </table>

Modified: 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=1159743&r1=1159742&r2=1159743&view=diff
==============================================================================
--- incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js (original)
+++ incubator/photark/trunk/photark-ui/src/main/webapp/js/gallery.js Fri Aug 19 18:57:09 2011
@@ -311,6 +311,20 @@ function showFriends() {
 
 }
 
+function showPreLoader(){
+    var img = dojo.byId("loadingImg");
+                    dojo.attr(img, {
+                       style: {visibility:"visible"}
+                    });
+}
+
+function hidePreLoader(){
+    var img = dojo.byId("loadingImg");
+                    dojo.attr(img, {
+                       style: {visibility:"hidden"}
+                    });
+}
+
 function showGenericFriends(userName) {
 //  var file_path =  document.getElementById("albumImage").src;
     var file_path = "https://lh4.googleusercontent.com/-rb_m-GQcL00/Ti8sqThvrDI/AAAAAAAAAMY/kUBurbFKJ0A/s640/friends_2.jpg";
@@ -320,6 +334,7 @@ function showGenericFriends(userName) {
         content:{request:"getUser"},
         handleAs: "json",
         load: function(response, ioArgs) {
+            showPreLoader();
             genericFaceService.getAllMyFriendsFromPictureUrl(file_path, userName, response.user.userId).addCallback(facebook_gff_callback);
         },
         error: function(response, ioArgs) {
@@ -338,6 +353,7 @@ function showFacebookFriends() {
         content:{request:"getUser"},
         handleAs: "json",
         load: function(response, ioArgs) {
+            showPreLoader();
             facebook_ff.getAllMyFBFriendsFromPictureUrl(file_path, response.user.userId).addCallback(facebook_ff_callback);
         },
         error: function(response, ioArgs) {
@@ -360,6 +376,7 @@ function facebook_gff_callback(entries, 
     if (exception) {
         alert("FB AUTH Error");
     } else {
+        hidePreLoader();
         viewFaceResults(entries,"gff"); // gff refers to Generic Friend Finder
     }
 
@@ -371,6 +388,7 @@ function facebook_ff_callback(entries, e
     if (exception) {
         alert("Error");
     } else {
+        hidePreLoader();
         viewFaceResults(entries,"fff"); // fff refers to Facebook Friend Finder
     }