]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/javascript/lib/js/opac/config.js
8af0e213fc9cc6c486f5f6c728c45d6f0803630c
[working/Evergreen.git] / Open-ILS / src / javascript / lib / js / opac / config.js
1 /* Export some constants  ----------------------------------------------------- */
2
3 /* URL params */
4 var PARAM_TERM                                  = "term";               /* search term */
5 var PARAM_STYPE                         = "stype";              /* search type */
6 var PARAM_LOCATION                      = "location"    /* current location */;
7 var PARAM_DEPTH                         = "depth";              /* search depth */
8 var PARAM_FORM                                  = "format";             /* search format */
9 var PARAM_OFFSET                                = "offset";             /* search offset */
10 var PARAM_COUNT                         = "count";              /* hits per page */
11 var PARAM_HITCOUNT                      = "hitcount";   /* hits per page */
12 var PARAM_RANKS                         = "hitcount";   /* hits per page */
13 var PARAM_MRID                                  = "mrid";               /* metarecord id */
14 var PARAM_RID                                   = "rid";                        /* metarecord id */
15
16 /* cookies */
17 var COOKIE_SB = "sbe";
18 var COOKIE_SES = "ses";
19
20 /* these are the actual param values - set on page load */
21
22 /* pages */
23 var MRESULT             = "mresult";
24 var RRESULT             = "rresult";
25 var MYOPAC              = "myopac";
26 var ADVANCED    = "advanced";
27 var HOME                        = "home";
28 var PREFS               = "prefs";
29
30 /* search type (STYPE) options */
31 STYPE_AUTHOR    = "author";
32 STYPE_TITLE             = "title";
33 STYPE_SUBJECT   = "subject";
34 STYPE_SERIES    = "series";
35 STYPE_KEYWORD   = "keyword";
36
37
38 /* container for global variables shared accross pages */
39 var G           = {};
40 G.user  = null; /* global user object */
41 G.ui            = {} /* cache of UI components */
42
43
44 /* call me after page init and I will load references 
45         to all of the ui object id's defined below 
46         They will be stored in G.ui.<page>.<thingy>
47  */
48 function loadUIObjects() {
49         for( var p in config.ids ) {
50                 G.ui[p] = {};
51                 for( var o in config.ids[p] ) 
52                         G.ui[p][o] = getId(config.ids[p][o]);
53         }
54 }
55
56 function clearUIObjects() {
57         for( var p in config.ids ) {
58                 for( var o in config.ids[p] ) 
59                         G.ui[p][o] = null;
60                 G.ui[p] = null;
61         }
62 }
63
64
65
66 /* ---------------------------------------------------------------------------- */
67 /* Set up ID's and CSS classes */
68 /* ---------------------------------------------------------------------------- */
69
70 var config = {};
71 config.text = {};
72 config.ids = {};
73 config.names = {};
74
75 config.ids.all = {};
76 config.ids.all.loading          = "loading_div";        /* generic 'loading..' message */
77 config.ids.all.canvas           = "canvas";                     /* outer UI canvas that holds the main canvas and any other hidden help components*/    
78 config.ids.all.canvas_main      = "canvas_main";        /* main data display canvas */
79
80 config.css = {};
81 config.css.hide_me = "hide_me";
82
83 config.page = {};
84 config.page[HOME]                       = "/webxml/index.xml";
85 config.page[ADVANCED]   = "/webxml/advanced.xml";
86 config.page[MRESULT]            = "/webxml/mresult.xml";
87 config.page[RRESULT]            = "/webxml/rresult.xml";
88 config.page[PREFS]              = "/webxml/webprefs.xml"
89 config.page[MYOPAC]             = "/webxml/myopac/index.xml"
90
91
92 /* mresult */
93 config.ids.mresult = {};
94
95 /* result */
96 config.ids.result = {};
97 config.css.result = {};
98 config.names.result = {};
99 config.ids.result.offset_start  = "offset_start";
100 config.ids.result.offset_end            = "offset_end";
101 config.ids.result.result_count  = "result_count";
102 config.ids.result.next_link             = 'next_link';
103 config.ids.result.prev_link             = 'prev_link';
104 config.ids.result.home_link             = 'home_link';
105 config.ids.result.end_link                      = 'end_link';
106 config.ids.result.main_table            = 'result_table';
107 config.ids.result.row_template  = 'result_table_template';
108 config.ids.result.num_pages             = 'num_pages';
109 config.ids.result.current_page  = 'current_page';
110 config.css.result.nav_active            = "nav_link_active";
111 config.ids.result.top_div                       = "result_table_div";
112 config.ids.result.nav_links             = "search_nav_links";
113 config.names.result.item_jacket = "item_jacket";
114 config.names.result.item_title  = "item_title";
115 config.names.result.item_author = "item_author";
116 config.names.result.counts_row  = "counts_row";
117 config.names.result.count_cell  = "copy_count_cell";
118
119 config.ids.login = {};
120 config.css.login = {};
121 config.ids.login.box                    = "login_box";
122 config.ids.login.username       = "login_username";
123 config.ids.login.password       = "login_password";
124 config.ids.login.button         = "login_button";
125 config.ids.login.cancel         = "login_cancel_button";
126
127
128
129 /* searchbar ids and css */
130 config.ids.searchbar = {};
131 config.css.searchbar = {};
132 config.ids.searchbar.text                               = 'search_box'; 
133 config.ids.searchbar.submit                     = 'search_submit';      
134 config.ids.searchbar.type_selector      = 'search_type_selector';
135 config.ids.searchbar.depth_selector     = 'depth_selector';
136 config.ids.searchbar.form_selector      = 'form_selector';
137 config.ids.searchbar.extra_row          = 'searchbar_extra';
138 config.ids.searchbar.main_row                   = 'searchbar_main_row';
139 config.ids.searchbar.table                              = 'searchbar_table';
140 config.ids.searchbar.tag                                = 'search_tag_link';
141 config.ids.searchbar.tag_on                     = 'searchbar_tag_on';
142 config.ids.searchbar.tag_off                    = 'searchbar_tag_off';
143
144
145 /*  sidebar */
146 config.ids.sidebar = {};
147 config.css.sidebar = {};
148 config.css.sidebar.item = {};
149 config.ids.sidebar.home                         = 'home_link_div';
150 config.ids.sidebar.advanced             = 'advanced_link_div';
151 config.ids.sidebar.myopac                       = 'myopac_link_div';
152 config.ids.sidebar.prefs                        = 'prefs_link_div';
153 config.css.sidebar.item.active  = 'side_bar_item_active';
154 config.ids.sidebar.mresult                      = 'mresult_link_div';
155 config.ids.sidebar.rresult                      = 'result_link_div';
156 config.ids.sidebar.login                        = 'login_link';
157 config.ids.sidebar.logout                       = 'logout_link';
158 config.ids.sidebar.logoutbox            = 'logout_link_div';
159 config.ids.sidebar.loginbox             = 'login_link_div';
160 config.ids.sidebar.logged_in_as = 'logged_in_as_div';
161 config.ids.sidebar.username_dest        = 'username_dest';
162
163
164
165