]> git.evergreen-ils.org Git - Evergreen.git/commit
utility functions for Javascript Shell
authorJason Etheridge <jason@esilibrary.com>
Thu, 22 Mar 2012 04:12:34 +0000 (00:12 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 28 Mar 2012 19:32:33 +0000 (15:32 -0400)
commit0e06c711fe06322a44f8a019d63027c92201463a
tree5cae0117598bc183a470ddd4579b1b3cc021d399
parent4ec1d1489bc6978354dbb0cbd2c2478d4559f077
utility functions for Javascript Shell

win_list() returns an array of "eg_main" chrome windows

get_tab() takes two forms:

    get_tab(chrome_window,tab_index)
    get_tab(tab_index)

The latter invocation assumes the first chrome window returned by win_list().

get_tab returns an object with the keys 'name' and 'content', pointing to the
tab label and the tab panel -> iframe -> contentWindow, respectively.

So let's say you had a patron account open in tab 1, and the Javascript Shell
open in tab 2.  In the shell, you could do:

    var o = get_tab(1);

o.name might contain something like

    1 Patron: Circulator, Ima

and you could do this to refresh that interface:

    o.content.g.patron.refresh_all()

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/util/shell.js