From 4f47b9faa7d5b441e3c095c88301a9b4591fa9d3 Mon Sep 17 00:00:00 2001 From: "opi@no-log.org" Date: Thu, 20 Nov 2014 15:20:00 +0100 Subject: [PATCH] Update apps.md --- apps.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/apps.md b/apps.md index b1554a10..a9195cbc 100644 --- a/apps.md +++ b/apps.md @@ -37,8 +37,16 @@ function timeConverter(UNIX_timestamp) { $(document).ready(function () { $.getJSON('/list.json', function(app_list) { - console.log(app_list); - $.each(app_list, function(app_id, infos) { + // Cast as array + var app_list = $.map(app_list, function(el) { return el; }); + // Sort alpha + app_list.sort(function(a, b){ + if (a.manifest.id > b.manifest.id) {return 1;} + else if (a.manifest.id < b.manifest.id) {return -1;} + return 0; + }); + $.each(app_list, function(k, infos) { + app_id = infos.manifest.id; html = $('#app-template').html() .replace(/{app_id}/g, app_id) .replace(/{app_name}/g, infos.manifest.name)