]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/javascript/lib/js/opac/config.js
710f1147f790746e2e29e60d118b02dad4979807
[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
57
58 /* ---------------------------------------------------------------------------- */
59 /* Set up ID's and CSS classes */
60 /* ---------------------------------------------------------------------------- */
61
62 var config = {};
63 config.text = {};
64 config.ids = {};
65 config.names = {};
66
67 config.ids.all = {};
68 config.ids.all.loading          = "loading_div";        /* generic 'loading..' message */
69 config.ids.all.canvas           = "canvas";                     /* outer UI canvas that holds the main canvas and any other hidden help components*/    
70 config.ids.all.canvas_main      = "canvas_main";        /* main data display canvas */
71
72 config.css = {};
73 config.css.hide_me = "hide_me";
74
75 config.page = {};
76 config.page[HOME]                       = "/webxml/index.xml";
77 config.page[ADVANCED]   = "/webxml/advanced.xml";
78 config.page[MRESULT]            = "/webxml/mresult.xml";
79 config.page[RRESULT]            = "/webxml/rresult.xml";
80 config.page[PREFS]              = "/webxml/webprefs.xml"
81 config.page[MYOPAC]             = "/webxml/myopac/index.xml"
82
83
84 /* mresult */
85 config.ids.mresult = {};
86
87 /* result */
88 config.ids.result = {};
89 config.css.result = {};
90 config.names.result = {};
91 config.ids.result.offset_start  = "offset_start";
92 config.ids.result.offset_end            = "offset_end";
93 config.ids.result.result_count  = "result_count";
94 config.ids.result.next_link             = 'next_link';
95 config.ids.result.prev_link             = 'prev_link';
96 config.ids.result.home_link             = 'home_link';
97 config.ids.result.end_link                      = 'end_link';
98 config.ids.result.main_table            = 'result_table';
99 config.ids.result.row_template  = 'result_table_template';
100 config.ids.result.num_pages             = 'num_pages';
101 config.ids.result.current_page  = 'current_page';
102 config.css.result.nav_active            = "nav_link_active";
103 config.ids.result.top_div                       = "result_table_div";
104 config.ids.result.nav_links             = "search_nav_links";
105 config.names.result.item_jacket = "item_jacket";
106 config.names.result.item_title  = "item_title";
107 config.names.result.item_author = "item_author";
108 config.names.result.counts_row  = "counts_row";
109 config.names.result.count_cell  = "copy_count_cell";
110
111 config.ids.login = {};
112 config.css.login = {};
113 config.ids.login.box                    = "login_box";
114 config.ids.login.username       = "login_username";
115 config.ids.login.password       = "login_password";
116 config.ids.login.button         = "login_button";
117 config.ids.login.cancel         = "login_cancel_button";
118
119
120
121 /* searchbar ids and css */
122 config.ids.searchbar = {};
123 config.css.searchbar = {};
124 config.ids.searchbar.text                               = 'search_box'; 
125 config.ids.searchbar.submit                     = 'search_submit';      
126 config.ids.searchbar.type_selector      = 'search_type_selector';
127 config.ids.searchbar.depth_selector     = 'depth_selector';
128 config.ids.searchbar.form_selector      = 'form_selector';
129 config.ids.searchbar.extra_row          = 'searchbar_extra';
130 config.ids.searchbar.main_row                   = 'searchbar_main_row';
131 config.ids.searchbar.table                              = 'searchbar_table';
132 config.ids.searchbar.tag                                = 'search_tag_link';
133 config.ids.searchbar.tag_on                     = 'searchbar_tag_on';
134 config.ids.searchbar.tag_off                    = 'searchbar_tag_off';
135
136
137 /*  sidebar */
138 config.ids.sidebar = {};
139 config.css.sidebar = {};
140 config.css.sidebar.item = {};
141 config.ids.sidebar.home                         = 'home_link_div';
142 config.ids.sidebar.advanced             = 'advanced_link_div';
143 config.ids.sidebar.myopac                       = 'myopac_link_div';
144 config.ids.sidebar.prefs                        = 'prefs_link_div';
145 config.css.sidebar.item.active  = 'side_bar_item_active';
146 config.ids.sidebar.mresult                      = 'mresult_link_div';
147 config.ids.sidebar.rresult                      = 'result_link_div';
148 config.ids.sidebar.login                        = 'login_link';
149 config.ids.sidebar.logged_in_as = 'logged_in_as_div';
150 config.ids.sidebar.username_dest        = 'username_dest';
151
152
153
154