},
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};
-/*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
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() {
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
)
);
},
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
-/*global $, tizen, app */
+/*global $, tizen, app, ServerModel */
/**
* @class Server
*/
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
/*global $, tizen, app */
/**
* @class Model
-/*jslint plusplus: true, sloppy: true, todo: true, vars: true, browser: true, devel: true, maxerr: 999 */
/*global $, tizen, app */
/**
* @class UiEvents
$('#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();
});
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');
});
}
-/*jslint devel: true */
/*global $, tizen, app, UiEvents, TemplateManager, document, window, setTimeout */
/**
* @class Ui
* 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));
* 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