From eb6fdd66de0ccd2a95e8e51fb18c4bba3b0c94e2 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Dec 2010 16:01:20 +0530 Subject: [PATCH] add api name in hashurl --- static/js/pandora.api.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/js/pandora.api.js b/static/js/pandora.api.js index 6272518..ed1b687 100755 --- a/static/js/pandora.api.js +++ b/static/js/pandora.api.js @@ -40,6 +40,11 @@ var app = new Ox.App({ }); $main.appendTo(app.$body); + if(document.location.hash) { + var action = document.location.hash.substring(1); + //FIXME: how to select item in Ox.TextList? + //app.$ui.actionList + } }); function constructList() { @@ -83,12 +88,15 @@ function constructList() { ] }).bindEvent({ select: function(event, data) { - var info = $('
'); + var info = $('
'), + hash = '#'; $.each(data.ids, function(v, k) { console.log(k) info.append($("

").html(k)); info.append($('
').html(app.docs[k].replace('/\n/
\n/g'))); + hash += k + ',' }); + document.location.hash = hash.substring(0, hash.length-1); app.$ui.actionInfo.html(info); } });