Skip to content
mkoengeter edited this page Feb 26, 2014 · 7 revisions

The Javascript Client is built on top of jQuery and its HTML5-based user interface system jQuery Mobile. The XMPP-Part is done by strophe.js.

The client consists of two parts:

  • The Javascript version of Mobilis XMPP MXJS
  • the actual application code split up into index.html, ninecards.css and ninecards.js

In this github repository the development of the Javascript client is done in the webclient branch. The MXJS-Part is integrated as a Git Submodule, which is indicated with a different folder-icon on Github.

The Application uses jQuery Mobiles multi-page template structure with four pages:

  • #start - Start Screen
  • #settings - enter XMPP login data, game server etc.
  • #games - available games list
  • #game - the game page

The javascript code is based on the global ninecards object. Every function is a property of this object. For example: ninecards.queryGames();.

The code makes heavy use of callback functions to ensure stability on slow networks.

The settings are saved in the browser's local storage using the key-value store database jstorage

The client connects to the XMPP server, after as the games page is loaded. Reloading the browser window on the #games page is fine. After joining a game the client forwards to the #game page. A browser reload on this page is not caught by now, it will destroy the connection to the xmpp server.

You can run the client on any desired webserver that can deliver HTML and Javascript. It is not necessary to run it on the same server as the XMPP server nor the Mobilis server.

When cloning this repository, remember to checkout only the webclient branch and add the recursive flag to also get the MXJS-submodule, ie:

git clone --branch webclient --recursive [email protected]:mobilis/9cards.git

Up: Home