[ContactsExchanger]Updated Private -> RSA
authorji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:20:26 +0000 (19:20 +0900)
committerji.ji <ji.ji@samsung.com>
Tue, 9 Jul 2013 10:20:26 +0000 (19:20 +0900)
Change-Id: I0ebffe123c4e8438afeba5786dad161b4ace6cfd

config.xml
css/style.css
index.html
js/app.js
js/app.ui.js

index da81183..35fa3a7 100644 (file)
@@ -27,7 +27,7 @@
        <tizen:application id="CUflbBqLYv.ContactsExchanger" package="CUflbBqLYv" required_version="2.2"/>
        <content src="index.html"/>
        <icon src="icon.png"/>
-       <name>ContactsExchanger</name>
+       <name>Contacts exchanger</name>
        <tizen:privilege name="http://tizen.org/privilege/application.launch"/>
        <tizen:privilege name="http://tizen.org/privilege/contact.read"/>
        <tizen:privilege name="http://tizen.org/privilege/contact.write"/>
index 6f676be..9b8d148 100644 (file)
@@ -31,9 +31,6 @@
 .box {
        margin: 0px;
        padding: 0 32px;
-       display: table-cell;
-       vertical-align: middle;
-       height: inherit;
        width: 296px;
        text-align: center;
 }
        font-weight: bold;
 }
 
+#comment-phone {
+       color: #85837E;
+       white-space: nowrap;
+       width: 300px;
+       line-height: 20px;
+       overflow: hidden;
+       text-overflow: ellipsis;
+}
 #accept-choose {
        width: auto;
 }
 }
 #list-choose li.selected {
        background-color: #ccc;
+       margin-top: -1px;
 }
 
 .ui-content {
        padding: 0;
 }
-}
\ No newline at end of file
+
+.ui-btn-back {
+       visibility:hidden;
+}
index 4fbb56c..6741486 100644 (file)
        <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw-libs.min.js"></script>
        <script src="/usr/share/tizen-web-ui-fw/latest/js/tizen-web-ui-fw.min.js" data-framework-theme="tizen-white"></script>
 
-       <script type="text/javascript" src="./js/app.js"></script>
-       <script type="text/javascript" src="./js/app.config.js"></script>
-       <script type="text/javascript" src="./js/app.ui.js"></script>
-       <script type="text/javascript" src="./js/app.ui.templateManager.js"></script>
-       <script type="text/javascript" src="./js/app.nfc.js"></script>
-       <script type="text/javascript" src="./js/app.nfc.card.js"></script>
-       <script type="text/javascript" src="./js/app.nfc.peer.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.config.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.ui.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.ui.templateManager.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.nfc.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.nfc.card.js"></script>
+       <script defer="defer" type="text/javascript" src="./js/app.nfc.peer.js"></script>
 
        <link rel="stylesheet" type="text/css" href="./css/style.css"/>
 </head>
 
 <body>
-       <div id="start" data-role="page" data-add-back-btn="header">
+       <div id="start" data-role="page">
                <div data-role="header" id="header-start" data-position="fixed">
                        <h1>Contacts exchanger</h1>
                </div>
                <div data-role="content" id="content-start"></div>
        </div>
 
-       <div id="choose" data-role="page" data-add-back-btn="header" data-footer-exist="true">
+       <div id="choose" data-role="page" data-footer-exist="true">
                <div data-role="header" id="header-choose" data-position="fixed">
                        <h1>Contacts list</h1>
                </div>
 
                <div data-role="content" id="content-choose"></div>
-
-               <div data-role="footer" id="footer-choose" data-position="fixed"></div>
        </div>
 
        <div id="transfer" data-role="page">
@@ -50,7 +48,7 @@
                <div data-role="content" id="content-transfer"></div>
        </div>
 
-       <div id="contact" data-role="page" data-add-back-btn="footer" data-footer-exist="true">
+       <div id="contact" data-role="page" data-footer-exist="true">
                <div data-role="header" id="header-contact" data-position="fixed">
                        <h1>Add contact</h1>
                        <a data-role="button" id="save-contact">Save</a>
index 0c6ef90..9e1b8ad 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -46,7 +46,6 @@ var app = null;
 
                        this.ui.disableSelections();
                        this.ui.defineEvents();
-                       this.ui.fixContentHeight();
                        this.initAddressBook();
                        this.nfc.startNFC();
                },
@@ -55,6 +54,7 @@ var app = null;
                        var elementSelected = $('#list-choose li.selected');
                        localStorage.started = true;
                        localStorage.id = elementSelected.data('id');
+                       localStorage.caller = elementSelected.data('caller');
                        localStorage.firstName = elementSelected.data('firstName');
                        localStorage.lastName = elementSelected.data('lastName');
                        localStorage.phoneNumber = elementSelected.data('phoneNumber');
@@ -142,6 +142,7 @@ var app = null;
                        try {
                                contact = new tizen.Contact({
                                        name: new tizen.ContactName({
+                                               caller: data.caller,
                                                firstName: data.first,
                                                lastName: data.last
                                        }),
index ab021f8..52fb5a4 100644 (file)
@@ -110,8 +110,9 @@ App.Ui = null;
                        waitingBox.append(waitingContent);
                        contentTransfer.append(waitingBox);
                        $('#content-start').trigger('create');
-                       $('#waitingBox').css("display", "table-cell");
                        this.app.countDown(10, $('#counter'));
+                       this.verticalCenter($('#waitingBox'));
+                       $('#waitingBox').show();
                },
 
                /**
@@ -164,14 +165,14 @@ App.Ui = null;
                 * @param {string} lastName
                 * @returns {string}
                 */
-               getCommentHtml: function ui_getCommentHtml(firstName, lastName) {
-                       var html = '<div id="comment">'
+               getCommentHtml: function ui_getCommentHtml(data) {
+                       return '<div id="comment">'
                                + '<p class="comment">Your default contact</p>'
                                + '<p class="comment" id="comment-name">'
-                               + (firstName || '') + ' ' + (lastName || '')
-                               + '</p>'
+                               + data.caller + '</p>'
+                               + '<p class="comment" id="comment-phone">'
+                               + data.phoneNumber + '</p>'
                                + '</div>';
-                       return html;
                },
 
                /**
@@ -285,7 +286,7 @@ App.Ui = null;
                        contentStart = $('#content-start');
                        startBox = $('<div class="box" id="startBox"></div>');
                        gap = $('<div class="gap"></div>');
-                       comment = $(this.getCommentHtml(localStorage.firstName, localStorage.lastName));
+                       comment = $(this.getCommentHtml(localStorage));
 
                        contentStart.empty();
                        startBox
@@ -308,6 +309,7 @@ App.Ui = null;
                        } else {
                                this.loadStartContent();
                        }
+                       $.mobile.activePage.page('refresh');
                },
 
                /**
@@ -423,6 +425,7 @@ App.Ui = null;
                                if (contact.phoneNumber !== '') {
                                        listElement = $(this.getContactsListElement(contact));
                                        listElement
+                                               .data('caller', contact.caller)
                                                .data('firstName', contact.firstName)
                                                .data('lastName', contact.lastName)
                                                .data('phoneNumber', contact.phoneNumber)
@@ -469,12 +472,14 @@ App.Ui = null;
                        $.mobile.tizen.disableSelection(document);
                },
 
-               /**
-                * Fix for height of the content area
-                */
-               fixContentHeight: function fixContentHeight() {
-                       var contentHeight = screen.availHeight - $('div[data-role="header"]').outerHeight() - $('div[data-role="footer"]').outerHeight();
-                       $('div[data-role="content"]').css('height', contentHeight);
+               verticalCenter: function (obj) {
+                       var marginTop = ($(window).height()
+                               - $('[data-role=header]:visible').height()
+                               - $('[data-role=footer]:visible').height()
+                               - obj.outerHeight())/2;
+                       if (parseInt(obj.css('margin-top'), 10) !== marginTop) {
+                               obj.hide().css('margin-top', marginTop).show();
+                       }
                },
 
                defineEvents: function ui_defineEvents() {
@@ -527,6 +532,13 @@ App.Ui = null;
                                if (monit !== '' && monit !== undefined) {
                                        self.showPopup(obj.data('monit'), obj);
                                }
+                               self.verticalCenter($('#startBox'));
+                       });
+
+                       $('#start').one('pageshow', function () {
+                               setTimeout(function () {
+                                       self.verticalCenter($('#startBox'));
+                               }, 20);
                        });
 
                        document.addEventListener('tizenhwkey', function(e) {
@@ -534,7 +546,7 @@ App.Ui = null;
                                        if ($.mobile.activePage.attr('id') === 'start') {
                                                tizen.application.getCurrentApplication().exit();
                                        } else {
-                                               history.back();
+                                               self.app.nfc.timeExpired();
                                        }
                                }
                        });
@@ -544,13 +556,13 @@ App.Ui = null;
                                        try {
                                                var option = $(this).data('option');
                                                if (option === 'read') {
-                                                       self.prepareWaitingPage('Card to Device', 'PUT WIRELESS TAG<br>CLOSE TO<br>YOUR DEVICE');
+                                                       self.prepareWaitingPage('Card to device', 'PUT WIRELESS TAG<br>CLOSE TO<br>YOUR DEVICE');
                                                        self.app.nfc.card.setTagDetectRead();
                                                } else if (option === 'write') {
-                                                       self.prepareWaitingPage('Device to Card', 'PUT WIRELESS TAG<br>CLOSE TO<br>YOUR DEVICE');
+                                                       self.prepareWaitingPage('Device to card', 'PUT WIRELESS TAG<br>CLOSE TO<br>YOUR DEVICE');
                                                        self.app.nfc.card.setTagDetectWrite();
                                                } else {
-                                                       self.prepareWaitingPage('Device to Device', 'PUT YOUR DEVICE<br>CLOSE TO<br>OTHER DEVICE');
+                                                       self.prepareWaitingPage('Device to device', 'PUT YOUR DEVICE<br>CLOSE TO<br>OTHER DEVICE');
                                                        self.app.nfc.peer.setTargetDetect();
                                                }
                                        } catch (e) {