Fix README
Fix README

file:a/README.md -> file:b/README.md
--- a/README.md
+++ b/README.md
@@ -2,6 +2,15 @@
 A small clone of [1024](https://play.google.com/store/apps/details?id=com.veewo.a1024), based on [Saming's 2048](http://saming.fr/p/2048/) (also a clone).
 
 Made just for fun. [Play it here!](http://gabrielecirulli.github.io/2048/)
+
+### Contributions
+
+ - [TimPetricola](https://github.com/TimPetricola) added best score storage
+ - [chrisprice](https://github.com/chrisprice) added custom code for swipe handling on mobile
+
+Many thanks to [rayhaanj](https://github.com/rayhaanj), [Mechazawa](https://github.com/Mechazawa), [grant](https://github.com/grant), [remram44](https://github.com/remram44) and [ghoullier](https://github.com/ghoullier) for the many other good contributions.
+
+### Screenshot
 
 [![Screenshot](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)](http://pictures.gabrielecirulli.com/2048-20140309-234100.png)
 

file:a/index.html -> file:b/index.html
--- a/index.html
+++ b/index.html
@@ -6,6 +6,8 @@
 
   <link href="style/main.css" rel="stylesheet" type="text/css">
   <link rel="shortcut icon" href="favicon.ico">
+  <link rel="apple-touch-icon" href="meta/apple-touch-icon.png">
+  <meta name="apple-mobile-web-app-capable" content="yes">
 
   <meta name="HandheldFriendly" content="True">
   <meta name="MobileOptimized" content="320">

--- a/js/local_score_manager.js
+++ b/js/local_score_manager.js
@@ -1,14 +1,21 @@
 window.fakeStorage = {
-  _data       : {},
-  setItem     : function (id, val) {
-    console.log("set");
+  _data: {},
+
+  setItem: function (id, val) {
     return this._data[id] = String(val);
   },
-  getItem     : function (id) {
+
+  getItem: function (id) {
     return this._data.hasOwnProperty(id) ? this._data[id] : undefined;
   },
-  removeItem  : function (id) { return delete this._data[id]; },
-  clear       : function () { return this._data = {}; }
+
+  removeItem: function (id) {
+    return delete this._data[id];
+  },
+
+  clear: function () {
+    return this._data = {};
+  }
 };
 
 function LocalScoreManager() {
@@ -19,11 +26,7 @@
 }
 
 LocalScoreManager.prototype.get = function () {
-  var score = this.storage.getItem(this.key);
-  if (typeof score === "undefined" || score === null) {
-    score = 0;
-  }
-  return score;
+  return this.storage.getItem(this.key) || 0;
 };
 
 LocalScoreManager.prototype.set = function (score) {

 Binary files /dev/null and b/meta/apple-touch-icon.png differ
comments