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 pr...@apache.org on 2012/08/19 17:26:01 UTC
svn commit: r1374801 - in /incubator/photark/mobile/trunk/assets/www:
index.html scripts/contacts.js scripts/photark_events.js scripts/tagging.js
Author: prabhathp
Date: Sun Aug 19 17:26:01 2012
New Revision: 1374801
URL: http://svn.apache.org/viewvc?rev=1374801&view=rev
Log:
tagging with contacts feature
Modified:
incubator/photark/mobile/trunk/assets/www/index.html
incubator/photark/mobile/trunk/assets/www/scripts/contacts.js
incubator/photark/mobile/trunk/assets/www/scripts/photark_events.js
incubator/photark/mobile/trunk/assets/www/scripts/tagging.js
Modified: incubator/photark/mobile/trunk/assets/www/index.html
URL: http://svn.apache.org/viewvc/incubator/photark/mobile/trunk/assets/www/index.html?rev=1374801&r1=1374800&r2=1374801&view=diff
==============================================================================
--- incubator/photark/mobile/trunk/assets/www/index.html (original)
+++ incubator/photark/mobile/trunk/assets/www/index.html Sun Aug 19 17:26:01 2012
@@ -301,11 +301,6 @@
<label for="textarea"> Location </label>
<input type="text" name="searchbox" id="editLocation" value="" />
</div>
- <!-- <div data-role="fieldcontain">
- <label for="textarea"> People: </label>
- <textarea cols="40" rows="8" name="textarea" id="editPeople"></textarea>
- <a href="#ContactsPage" data-role="button" data-theme="a" data-mini="true">Browse</a>
- </div> -->
<div data-role="fieldcontain">
<label for="textarea"> Discription </label>
@@ -588,6 +583,23 @@
</div>
<!-- Page End -->
+ <!-- Add Tag Page-->
+ <div id="NewTag" data-role="dialog">
+ <div data-role="header">
+ <h1>Confirm Delete</h1>
+ </div>
+ <div data-role="content">
+ <p>
+ Are you sure you want to delete this photo?
+ </p>
+ <a href="index.html"
+ data-role="button" onclick="deleteFile()">Delete</a>
+ <a href="index.html"
+ data-role="button">Cancel</a>
+ </div>
+ </div>
+ <!-- Page End -->
+
<!-- help page-->
<div id="help" data-role="page" data-add-back-btn="true" data-theme="a">
<div data-role="header" >
Modified: incubator/photark/mobile/trunk/assets/www/scripts/contacts.js
URL: http://svn.apache.org/viewvc/incubator/photark/mobile/trunk/assets/www/scripts/contacts.js?rev=1374801&r1=1374800&r2=1374801&view=diff
==============================================================================
--- incubator/photark/mobile/trunk/assets/www/scripts/contacts.js (original)
+++ incubator/photark/mobile/trunk/assets/www/scripts/contacts.js Sun Aug 19 17:26:01 2012
@@ -16,18 +16,22 @@
* specific language governing permissions and limitations
* under the License.
*/
-
+var contactsLoaded=false;
function getContacts() {
- var optFilter = new ContactFindOptions();
- optFilter.filter = "";
- // to return all contacts
- optFilter.multiple = true;
- // return multiple results
- fields = [ "name" ];
-
- // get all contacts
- navigator.contacts.find(fields, gcsSuccess, gcsError, optFilter);
+ if(!contactsLoaded){
+ contactsLoaded=true;
+ var optFilter = new ContactFindOptions();
+ optFilter.filter = "";
+ // to return all contacts
+ optFilter.multiple = true;
+ // return multiple results
+ fields = [ "name" ];
+
+ // get all contacts
+ navigator.contacts.find(fields, gcsSuccess, gcsError, optFilter);
+ }
+
}
/* get all contacts error */
@@ -79,10 +83,8 @@ function gcsSuccess(contacts) {
}
function onContactsClick(name){
- var temp=$('#editPeople').val();
- temp=temp+name;
- people=temp.split(",");
- $.mobile.changePage( $("#EditMetadata") );
+ $('#editPeople').val(name);
+ $.mobile.changePage( $("#NewTag") );
}
Modified: incubator/photark/mobile/trunk/assets/www/scripts/photark_events.js
URL: http://svn.apache.org/viewvc/incubator/photark/mobile/trunk/assets/www/scripts/photark_events.js?rev=1374801&r1=1374800&r2=1374801&view=diff
==============================================================================
--- incubator/photark/mobile/trunk/assets/www/scripts/photark_events.js (original)
+++ incubator/photark/mobile/trunk/assets/www/scripts/photark_events.js Sun Aug 19 17:26:01 2012
@@ -53,6 +53,11 @@ function initializePageShowFunctions() {
$('#tagPicture').html('<img id="tagImage"/>');
displayTagImage(uri) ;
markTags(tagObjectsSaved);
+ markTags(tagObjects);
+ });
+
+ $('#ContactsPage').live('pageshow', function () {
+ getContacts();
});
}
Modified: incubator/photark/mobile/trunk/assets/www/scripts/tagging.js
URL: http://svn.apache.org/viewvc/incubator/photark/mobile/trunk/assets/www/scripts/tagging.js?rev=1374801&r1=1374800&r2=1374801&view=diff
==============================================================================
--- incubator/photark/mobile/trunk/assets/www/scripts/tagging.js (original)
+++ incubator/photark/mobile/trunk/assets/www/scripts/tagging.js Sun Aug 19 17:26:01 2012
@@ -18,26 +18,36 @@
*/
var tagEnabled=false;
+var eValue;
+var xValue;
+var yValue;
+
function showDialog(e, x, y) {
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);
- }
- },
- }
- })
+// $('<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);
+// }
+// },
+// }
+// })
+
+ eValue=e;
+ xValue=x;
+ yValue=y;
+
+ $.mobile.changePage("#NewTag");
}else{
alert("Tagging not enabled.");
}
@@ -132,3 +142,18 @@ function enableTagging() {
$('#enableTaggingButton').show();
}
}
+
+function addTagClicked() {
+ var name = $('#editPeople').val();
+ showTag(name, xValue, yValue);
+ var tgx = new TagObject(name, xValue, yValue);
+ tagObjects.push(tgx);
+ xValue=null;
+ yValue=null;
+ $.mobile.changePage("#photoTag");
+}
+
+function cancelTagging() {
+ tagObjects=new Array();
+ enableTagging();
+}