}
}
+function spawn_paged_tree(d,placement,place,passthru_params) {
+ var chrome = 'chrome://evergreen/content/main/paged_tree.xul';
+ return spawn_interface(d,placement,place,chrome,'paged_tree',passthru_params);
+}
+
function spawn_patron_edit(d,placement,place,passthru_params) {
var chrome = 'chrome://evergreen/content/patron/patron_edit.xul';
return spawn_interface(d,placement,place,chrome,getString('patron_editor_interface_label'),passthru_params);
return spawn_interface(d,placement,place,chrome,getString('patron_search_interface_label'),passthru_params);
}
+function spawn_patron_search_results(d,placement,place,passthru_params) {
+ var chrome = 'chrome://evergreen/content/patron/patron_search_results.xul';
+ return spawn_interface(d,placement,place,chrome,getString('patron_search_interface_label'),passthru_params);
+}
+
function spawn_copy_stat_cat_edit(d,placement,place,passthru_params) {
var chrome = 'chrome://evergreen/content/stat_cat/copy_stat_cat_editor.xul';
return spawn_interface(d,placement,place,chrome,getString('copy_stat_cat_editor_interface'),passthru_params);
// Subsequent arguments are treated as textual values for treecells in that treeitem.
var treeitem_id = 0;
function append_treeitem(d,e) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) != 'object') { e = d.getElementById(e); }
if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
var treechildren = e;
// and the third argument is an array of values to cycle through for setting the
// element's attribute. Ex: var toggle = cycle_attribute( target,'toggle',['1','2','3'] );
function cycle_attribute(d,e,a,v) {
+ sdump('D_WIDGETS',arg_dump(arguments));
try {
if (typeof(e) != 'object') { e = d.getElementById(e); }
if (typeof(e) != 'object') { throw('typeof e != object : typeof e = ' + typeof(e)); }
// Treats each argument as an element to disable
function disable_widgets(d) {
+ sdump('D_WIDGETS',arg_dump(arguments));
for (var i = 1; i < arguments.length; i++) {
if (typeof(arguments[i]) == 'object') {
sdump('D_WIDGETS',arguments[i] + '.disabled = true;\n');
// removes listitems from listboxes
function empty_listbox(d,e) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) != 'object') { e = d.getElementById(e); }
if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_listbox\n'); return; }
var nl = e.getElementsByTagName('listitem');
// removes all of an element's children
function empty_widget(d,e) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) != 'object') { e = d.getElementById(e); }
if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on empty_widget\n'); return; }
while (e.lastChild) { e.removeChild(e.lastChild); }
// Treats each argument as an element to enable
function enable_widgets(d) {
+ sdump('D_WIDGETS',arg_dump(arguments));
for (var i = 1; i < arguments.length; i++) {
if (typeof(arguments[i]) == 'object') {
sdump('D_WIDGETS',arguments[i] + '.disabled = false;\n');
// argument is the current textbox. This function finds the next textbox and
// gives it focus.
function fake_tab_for_textboxes(d,w,current) {
+ sdump('D_WIDGETS',arg_dump(arguments));
var flag = false; var next_one;
if (typeof(w)!='object') {
w = d.getElementById(w);
// Ah, looks like it could handle XUL trees and fieldmapper trees
// Ex. find( org_tree, function(o){return o.children();}, function(o){return (o.id == 'the winner');})
function find_tree_via_children(d,tree,children_func,find_func) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(tree)!='object') tree = d.getElementById(tree);
var t = find_func(tree); if (t) return t;
// Give this element focus
function focus_widget(d,e) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) == 'object') {
e.focus();
} else {
// Returns a list of selected treeitems from the specified tree
function get_list_from_tree_selection(d,tree_w) {
+ sdump('D_WIDGETS',arg_dump(arguments));
sdump('D_WIDGETS','entering get_list_from_tree...\n');
var hitlist;
if (typeof(tree_w) != 'object') {
// Make sure we a widget
function get_widget(d,e) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) == 'object') {
return e;
} else {
// Increment a XUL progressmeter
function incr_progressmeter(d,meter,increment) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(meter)!='object')
meter = d.getElementById(meter);
if (typeof(meter)!='object')
meter.value = Math.ceil( real );
}
+// Populate a treeitem row
+function map_array_to_treecells_via_treeitem( cols, treeitem ) {
+ sdump('D_WIDGETS',arg_dump(arguments));
+ var treerow = treeitem.firstChild;
+ for (var i = 0; i < treerow.childNodes.length; i++) {
+ var treecell = treerow.childNodes[i];
+ treecell.setAttribute('label',cols[i]);
+ }
+}
+
// Simulates radio buttons with checkboxes. Include this in command event listeners
// for the pertinent textboxes. For any set of checkboxes that have the same 'group'
// attribute, only one can be checked at a time.
function radio_checkbox(d,ev) {
+ sdump('D_WIDGETS',arg_dump(arguments));
var target = ev.target;
var group = target.getAttribute('group');
if (group) {
// simpler version of set_decks
function set_deck(d,deck,idx) {
+ sdump('D_WIDGETS',arg_dump(arguments));
set_decks(d,{ deck : idx });
}
// Takes a hash with key:value => deck element id : page index
// Sets each deck to the corresponding index
function set_decks(d,params) {
+ sdump('D_WIDGETS',arg_dump(arguments));
for (var deck_id in params) {
var deck;
if (typeof(deck) != 'object')
// swaps the values of two attributes for an element
function swap_attributes(d,e,a1,a2) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(e) != 'object') { e = d.getElementById(e); }
if (typeof(e) != 'object') { sdump('D_WIDGETS','Failed on swap_attributes\n'); return; }
var a1_v = e.getAttribute(a1);
// Flips the hidden value for each row in a grid
function toggle_hidden_grid_rows(d,grid) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(grid) != 'object') {
grid = d.getElementById(grid);
}
/* The first parameter is the id of the element to set, or an array of ids for elements to set in batch. The second parameter is an object containing the attribute/value pairs to assign to the element or elements */
function xul_setAttributes(d,el,attrs) {
+ sdump('D_WIDGETS',arg_dump(arguments));
if (typeof(el) == 'object') {
for (var e in el) {
var w = d.getElementById(e);