help pages + bug fixes
git-svn-id: https://svn.apache.org/repos/asf/incubator/photark/mobile/trunk@1373583 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/assets/www/index.html b/assets/www/index.html
index a4b32c4..786be83 100644
--- a/assets/www/index.html
+++ b/assets/www/index.html
@@ -105,15 +105,7 @@
]
};
- // if(google) {
- var autocomplete = new google.maps.places.Autocomplete($("#editLocation")[0], options);
- google.maps.event.addListener(autocomplete, 'place_changed', function() {
- var place = autocomplete.getPlace();
- //console.log(place.address_components);
- });
- // } else {
-//
- // }
+
}
//Document ready function
@@ -166,6 +158,16 @@
$("#tagPicture").css({
'position': 'relative'
});
+
+ if(google) {
+ var autocomplete = new google.maps.places.Autocomplete($("#editLocation")[0], options);
+ google.maps.event.addListener(autocomplete, 'place_changed', function() {
+ var place = autocomplete.getPlace();
+ //console.log(place.address_components);
+ });
+ } else {
+ alert("location services not available");
+ }
});
@@ -188,8 +190,6 @@
uri= imageURI;
window.resolveLocalFileSystemURI(imageURI, onFileEntryComplete, isFail);
- displayTagImage(imageURI) ;
-
tagObjects=new Array();
$('#largeImage').css({
@@ -290,6 +290,8 @@
});
$('#photoTag').live('pageshow', function () {
+ $('#tagPicture').html('<img id="tagImage"/>');
+ displayTagImage(uri) ;
markTags(tagObjectsSaved);
});
@@ -362,7 +364,7 @@
<div data-role="footer" data-position="fixed">
<div id="toolbar_icons" style="text-align: center" >
<a href="#" id="homeButton" data-role="button" data-icon="home" style="display: none" onclick="onHomeButtonClicked()">Home</a>
- <a href="#" id="helpButton" data-role="button" data-icon="info" >Help</a>
+ <a href="#help" id="helpButton" data-role="button" data-icon="info" >Help</a>
</div>
</div>
@@ -408,7 +410,7 @@
<textarea cols="40" rows="8" name="textarea" id="editDiscription"></textarea>
</div>
</div>
- <div data-role="footer" data-position="fixed" style="text-align: center">
+ <div data-role="footer" style="text-align: center">
<a href="index.html" data-icon="check" onclick="save()">Save</a>
<a href="index.html" data-icon="delete">Cancel</a>
</div>
@@ -644,8 +646,10 @@
data-role="button" data-mini="false" data-icon="grid" onclick=''>View all in map</a>
<a href="#help"
data-role="button" data-mini="false" data-icon="info" onclick=''>Help</a>
+ <a href="#about"
+ data-role="button" data-mini="false" data-icon="info" onclick=''>About</a>
<a href="#"
- data-role="button" data-mini="false" data-icon="back" onclick='navigator.app.exitApp()'>Exit</a>
+ data-role="button" data-mini="false" data-icon="delete" onclick='navigator.app.exitApp()'>Exit</a>
</div>
</div>
</div>
@@ -673,6 +677,39 @@
</div>
<!-- Page End -->
+ <!-- help page-->
+ <div id="help" data-role="page" data-add-back-btn="true" data-theme="a">
+ <div data-role="header" >
+ <h1>Help</h1>
+ </div>
+ <div data-role="content">
+ <ul>
+ <li>To get started caputre a photo, open exsisting photo or go to web albums</li>
+ <li>You can organize photoes by editing image related data and saving</li>
+ <li>You can search photoes according to data you have added</li>
+ <li>You can tag people in your photo by going to view tags section</li>
+ <li>You can view a image full screen by tapping on it</li>
+ <li>Deleting a photo through the application will delete the photo from phone memory too</li>
+ </ul>
+ </div>
+ </div>
+ <!-- Page End -->
+
+ <!-- About page-->
+ <div id="about" data-role="dialog" data-add-back-btn="true" data-theme="a">
+ <div data-role="header" >
+ <h1>About</h1>
+ </div>
+ <div data-role="content" style="text-align:center">
+ <p>A free and open source photo manager application for mobile devices.</p>
+ <br/>
+ <a href="http://incubator.apache.org/photark/">Project home page</a>
+ <br/>
+ <p align="center">Apache Software foundation 2012</p>
+ </div>
+ </div>
+ <!-- Page End -->
+
</body>
</html>
diff --git a/assets/www/scripts/MapView.js b/assets/www/scripts/MapView.js
index 5de8843..5c29f38 100644
--- a/assets/www/scripts/MapView.js
+++ b/assets/www/scripts/MapView.js
@@ -23,7 +23,7 @@
var geocoder2 = new google.maps.Geocoder();
geocoder2.geocode({'address': getLocation()}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
- $('#map_canvas').gmap({'center': new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()), 'zoom': 10, 'disableDefaultUI':true, 'callback': function() {
+ $('#map_canvas').gmap({'center': new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng()), 'zoom': 10, 'disableDefaultUI':false, 'callback': function() {
var self = this;
self.addMarker({'position': this.get('map').getCenter() }).click(function() {
self.openInfoWindow({ 'content': 'Hello World!' }, this);
diff --git a/assets/www/scripts/dataAccess.js b/assets/www/scripts/dataAccess.js
index b948605..5d1d4a4 100644
--- a/assets/www/scripts/dataAccess.js
+++ b/assets/www/scripts/dataAccess.js
@@ -101,7 +101,6 @@
loc=results.rows.item(i).location;
description=results.rows.item(i).description;
}
- updateHome();
}
function clearData(){
@@ -116,12 +115,12 @@
function queryPeopleSuccess(tx, results) {
var len = results.rows.length;
-
for (var i=0; i<len; i++){
- people[i]=results.rows.item(i).name;
+ people.push(results.rows.item(i).name);
var tg1=new TagObject(results.rows.item(i).name,results.rows.item(i).x,results.rows.item(i).y);
tagObjectsSaved.push(tg1);
}
+ updateHome();
}
function updateDB(){
@@ -138,11 +137,15 @@
}
function updateHome(){
+ temp4="";
+ for (i = 0; i < tagObjectsSaved.length; i++) {
+ temp4+=tagObjectsSaved[i].name+", ";
+ }
$("#metadata").html("");
$("#metadata").append("<p> Name: "+nickname+"</p>");
$("#metadata").append("<p> Location: "+loc+"</p>");
$("#metadata").append("<p> Description: "+description+"</p>");
- $("#metadata").append("<p> Tags: "+people+"</p>");
+ $("#metadata").append("<p> Tags: "+temp4+"</p>");
$("#metadata").append("<p> Date: "+date+"</p>");
$("#metadata").append("<p> Time: "+time+"</p>");
}
@@ -170,7 +173,6 @@
}
function queryDB(tx){
- alert(clause);
tx.executeSql(clause,[], searchSuccess, errorCB);
}
diff --git a/assets/www/scripts/tagging.js b/assets/www/scripts/tagging.js
index 586dbff..cbe73f7 100644
--- a/assets/www/scripts/tagging.js
+++ b/assets/www/scripts/tagging.js
@@ -20,23 +20,27 @@
var tagEnabled=false;
function showDialog(e, x, y) {
- $('<div>').simpledialog2({
- mode : 'button',
- headerText : 'Tag',
- headerClose : true,
- buttonPrompt : 'Type Name',
- buttonInput : true,
- buttons : {
- 'OK' : {
- click : function() {
- var name = $.mobile.sdLastInput;
- showTag(name, x, y);
- var tgx = new TagObject(name, x, y);
- tagObjects.push(tgx);
- }
- },
- }
- })
+ if(tagEnabled){
+ $('<div>').simpledialog2({
+ mode : 'button',
+ headerText : 'Tag',
+ headerClose : true,
+ buttonPrompt : 'Type Name',
+ buttonInput : true,
+ buttons : {
+ 'OK' : {
+ click : function() {
+ var name = $.mobile.sdLastInput;
+ showTag(name, x, y);
+ var tgx = new TagObject(name, x, y);
+ tagObjects.push(tgx);
+ }
+ },
+ }
+ })
+ }else{
+ alert("Tagging not enabled.");
+ }
}
function TagObject(name, x, y) {