<h1>Contacts exchanger</h1>
</div>
- <div data-role="content" id="content-start"></div>
+ <div data-role="content" id="content-start">
+ <div id="contact-nfc-error" data-role="popup" class="center_title_1btn">
+ <div class="ui-popup-title"><h1>Warning</h1></div>
+ <div class="ui-popup-text">
+ If you want to use "Contact Exchanger" you must agree to access
+ Contacts and NFC by this application.
+ </div>
+ <div class="ui-popup-button-bg">
+ <a data-role="button" data-rel="back" data-inline="true"
+ id="acceptWarning">OK</a>
+ </div>
+ </div>
+ </div>
</div>
<div id="choose" data-role="page" data-footer-exist="true">
this.getAddressBooksError.bind(this)
);
} catch (e) {
+ if (e.name === "SecurityError") {
+ this.ui.showPopupWarning();
+ }
console.error('getAddressBooks() error: ' + e.message);
}
},
this.nfcAdapter.setPowered(true, this.onPowerOn.bind(this), this.onPowerOnFails.bind(this));
} catch (e) {
console.error('startNFC problem', e);
+ this.app.ui.showPopupWarning();
}
},
/**
* @returns {string}
*/
+ showPopupWarning: function ui_showPopupWarning(){
+ setTimeout(function(){
+ $("#contact-nfc-error").popup("open",{"positionTo":"window"});
+ },500);
+ },
+
getTemporaryBoxContentHtml: function ui_getTemporaryBoxContentHtml() {
return '<p class="defaultText">'
+ 'Default card is not defined yet!<br/>'
self.verticalCenter($('#startBox'));
}, 20);
});
+ $( "#contact-nfc-error" ).bind({
+ popupafterclose: function(){
+ tizen.application.getCurrentApplication().exit();
+ }
+ });
document.addEventListener('tizenhwkey', function(e) {
if (e.keyName == "back") {
}
});
+ document.addEventListener('webkitvisibilitychange', function () {
+ if(document.webkitVisibilityState === "visible") {
+ if ($.mobile.activePage.attr('id') === "choose") {
+ $.mobile.activePage.trigger('pageshow');
+ }
+ }
+ });
+
$('#transfer').on('pageshow', function () {
if (tizen.nfc.getDefaultAdapter().powered) {
try {