[BluetoothChat]update BluetoothChat(tizen_2.1)
authorji.ji <ji.ji@samsung.com>
Thu, 23 May 2013 06:54:39 +0000 (15:54 +0900)
committerji.ji <ji.ji@samsung.com>
Thu, 23 May 2013 06:54:39 +0000 (15:54 +0900)
Change-Id: I9fdab13a61bf56e77b99bc345fccb63db025057f

icon.png
js/app.client.model.js
js/app.js
js/app.server.js
js/app.server.model.js
js/app.ui.events.js
js/app.ui.js
js/main.js

index 33fbb63..9765b1b 100644 (file)
Binary files a/icon.png and b/icon.png differ
index a891196..d51fd35 100644 (file)
@@ -64,7 +64,6 @@ function ClientModel(parent) {
                },
 
                sendPing: function ClientModel_sendPing(name, socket) {
-                       var i, len = name.length, sendTextMsg = [];
                        var sendTextMsg, messageObj, messageObjToString, i, len;
                        sendTextMsg = [];
                        messageObj = {name: encodeURIComponent(name), text: '', ping: true, bye: false};
index 114c13d..3c44ada 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -1,5 +1,4 @@
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
-/*global $, tizen, app */
+/*global $, tizen, app, Config, Helpers, Model, Ui, Server, Client */
 var App = null;
 
 (function () { // strict mode wrapper
@@ -98,16 +97,16 @@ var App = null;
                        return this.connection;
                },
 
-               setConnection: function App_setConnection(boolean) {
-                       this.connection = boolean;
+               setConnection: function App_setConnection(bool) {
+                       this.connection = bool;
                },
 
                getDoNotSendBye: function App_getDoNotSendBye() {
                        return this.doNotSendBye;
                },
 
-               setDoNotSendBye: function App_setDoNotSendBye(boolean) {
-                       this.doNotSendBye = boolean;
+               setDoNotSendBye: function App_setDoNotSendBye(bool) {
+                       this.doNotSendBye = bool;
                },
 
                getCurrentName: function App_getCurrentName() {
@@ -132,7 +131,9 @@ var App = null;
                checkPowerState: function App_checkPowerState() {
                        this.ui.setContentStartAttributes(
                                this.model.checkPowerState.bind(
-                                       this.model, this.ui.showPowerOnButton, this.ui.showStartButtons
+                                       this.model,
+                                       this.ui.showPowerOnButton,
+                                       this.ui.showStartButtons
                                )
                        );
                },
index e3b2465..6cf5c5a 100644 (file)
@@ -1,5 +1,4 @@
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
-/*global $, tizen, app */
+/*global $, tizen, app, ServerModel */
 /**
  * @class Server
  */
index 10e9023..771353e 100644 (file)
@@ -1,4 +1,3 @@
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
 /*global $, tizen, app */
 /**
  * @class Model
index ef152da..ff873f8 100644 (file)
@@ -1,4 +1,3 @@
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
 /*global $, tizen, app */
 /**
  * @class UiEvents
@@ -135,10 +134,15 @@ function UiEvents(parent) {
 
                        $('#chat').on('pageshow', function () {
                                if (app.getApplicationMode() === 'server') {
-                                       setTimeout(function() { app.ui.showVisibilityPopup(); }, 100);
+                                       setTimeout(function () { app.ui.showVisibilityPopup(); }, 100);
                                }
                        });
 
+                       $('#chat').on('pagehide', function () {
+                               $('#text').val('');
+                               app.setConnection(false);
+                       });
+
                        $('#text').on('input', function () {
                                self.ui.checkSendButtonState();
                        });
@@ -151,20 +155,20 @@ function UiEvents(parent) {
                                app.sendMessage(message);
                        });
 
-                       $('body').on('tap', '#byeOK' , function () {
+                       $('body').on('tap', '#byeOK', function () {
                                self.ui.hideByePopup();
                                $('#keyboard-back-button').trigger('tap');
                        });
 
-                       $('body').on('touchstart', '#byePopup-screen' , function () {
+                       $('body').on('touchstart', '#byePopup-screen', function () {
                                $('#byeOK').trigger('tap');
                        });
 
-                       $('body').on('tap', '#visibilityOK' , function () {
+                       $('body').on('tap', '#visibilityOK', function () {
                                self.ui.hideVisibilityPopup();
                        });
 
-                       $('body').on('touchstart', '#visibilityPopup-screen' , function () {
+                       $('body').on('touchstart', '#visibilityPopup-screen', function () {
                                $('#visibilityOK').trigger('tap');
                        });
                }
index 3addf9c..6317458 100644 (file)
@@ -1,4 +1,3 @@
-/*jslint devel: true */
 /*global $, tizen, app, UiEvents, TemplateManager, document, window, setTimeout */
 /**
  * @class Ui
@@ -35,14 +34,15 @@ function Ui(callback) {
                 * When DOM is ready, initialise it (bind events)
                 */
                domInit: function Ui_domInit(callback) {
-                       var templates = ['keyboard_page',
-                                        'chat_page',
-                                        'choose_page',
-                                        'server_row',
-                                        'left_bubble',
-                                        'right_bubble',
-                                        'bye_popup',
-                                        'visibility_popup'
+                       var templates = [
+                               'keyboard_page',
+                               'chat_page',
+                               'choose_page',
+                               'server_row',
+                               'left_bubble',
+                               'right_bubble',
+                               'bye_popup',
+                               'visibility_popup'
                        ];
 
                        this.templateManager.loadToCache(templates, this.initPages.bind(this, callback));
index 0bc2390..1a2870e 100644 (file)
@@ -14,8 +14,7 @@
  *      limitations under the License.
  */
 
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
-/*global $, tizen, app */
+/*global $, tizen, App */
 var app = null;
 
 (function () { // strict mode wrapper