From ffc7b693a7c5045501d44607f491540cfa995905 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 4 Mar 2013 15:22:26 +0000 Subject: [PATCH] api/help dialog cleanup --- static/js/pandora/apiDialog.js | 22 ++++++++-------------- static/js/pandora/helpDialog.js | 2 +- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/static/js/pandora/apiDialog.js b/static/js/pandora/apiDialog.js index 5dd1411c4..628581249 100644 --- a/static/js/pandora/apiDialog.js +++ b/static/js/pandora/apiDialog.js @@ -31,10 +31,10 @@ pandora.ui.apiDialog = function() { title: 'Help...' }).bindEvent({ click: function() { - pandora.UI.set({page: 'help', 'hash.anchor': ''}) + pandora.UI.set({page: 'help', 'hash.anchor': ''}); } }), - {}, + {}, Ox.Button({ id: 'close', title: 'Close' @@ -66,7 +66,7 @@ pandora.ui.apiDialog = function() { pandora.user.ui.page == 'api' && that.select(data.value); } }), - overview = '

API Documentation

use this api in the browser with Ox.app or use pandora_client it in python. Further description of the api can be found on the wiki
'; + overview = '

API Documentation


use this api in the browser with Ox.app or use pandora_client it in python. Further description of the api can be found on the wiki'; pandora.api.api({docs: true, code: true}, function(results) { var items = [{ @@ -96,7 +96,7 @@ pandora.ui.apiDialog = function() { max: 1, min: 1, scrollbarVisible: true, - selected: [], + selected: [selected], sort: [{key: 'sort', operator: '+'}], unique: 'id' }) @@ -122,20 +122,14 @@ pandora.ui.apiDialog = function() { orientation: 'horizontal' }); - that.options({content: $panel}); + that.select(selected).options({content: $panel}); + $list.gainFocus(); }); that.select = function(id) { - if (id) { - $text.html(''); - $text.append( - $('

') - .html(id) - .css({ - marginBottom: '8px' - }) - ); + if (id && actions[id]) { + $text.html('

' + id + '


'); var code = actions[id].code[1], f = actions[id].code[0], line = Math.round(Ox.last(f.split(':')) || 0), diff --git a/static/js/pandora/helpDialog.js b/static/js/pandora/helpDialog.js index 15a6bbc5a..61f95f4d5 100644 --- a/static/js/pandora/helpDialog.js +++ b/static/js/pandora/helpDialog.js @@ -33,7 +33,7 @@ pandora.ui.helpDialog = function() { title: 'API Documentation...' }).bindEvent({ click: function() { - pandora.UI.set({page: 'api', 'hash.anchor': ''}) + pandora.UI.set({page: 'api', 'hash.anchor': ''}); } }), {},