]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/javascript/opac/Page.js
web batch update
[Evergreen.git] / Open-ILS / src / javascript / opac / Page.js
1 /* Top level page object.  All pages descend from this class */
2
3 function Page() {}
4
5 Page.prototype.init = function() {
6         debug("Falling back to Page.init()");
7 }
8
9 /* override me */
10 Page.prototype.instance = function() {
11         throw new EXAbstract(
12                         "instance() must be overridden by all Page subclasses");
13 }
14
15
16 /* XXX move me to the status bar */
17
18 Page.prototype.updateSelectedLocation = function(org) {
19         var node;
20         if( typeof org == 'object' ) node = org;
21         else node = getOrgById(org);
22         globalSelectedLocation = node;
23         this.setLocDisplay();
24 }
25
26
27 /* tells the user where he is searching */
28 Page.prototype.setLocDisplay = function(name) {
29
30         this.searchingCell = getById("now_searching_cell");
31         this.searchRange        = getById("search_range_select");
32
33         if( this.searchingCell == null ) return;
34         var name;
35         
36         var orgunit;
37         if( globalSelectedLocation )
38                 orgunit = globalSelectedLocation;
39         else { orgunit = globalLocation; }
40
41         var arr = orgNodeTrail(orgunit);
42
43         this.searchingCell.innerHTML = "";
44         var names = new Array()
45         for( var i in arr) 
46                 names.push(arr[i].name());
47
48         this.searchingCell.innerHTML = 
49                 "<span class='breadcrumb_label'>" + 
50                 names.join("</span> / <span class='breadcrumb_label'>") + 
51                 "</span>";
52
53         if(globalSearchBarFormChunk)
54                 globalSearchBarFormChunk.resetPage();
55
56 }
57
58 Page.prototype.updateCurrentLocation = function(org) {
59         if( typeof org == 'object' ) node = org;
60         else node = getOrgById(orgid);
61         globalLocation = node;
62         this.setLocDisplay();
63 }
64                 
65
66
67