1 Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
3 Ext.override(Ext.Panel,{
5 return { collapsed: this.collapsed };
9 var quick_msg = function(msg)
14 buttons: Ext.MessageBox.OK,
15 icon: Ext.MessageBox.INFO
19 var goto_url = function(www_url)
21 window.location = www_url;
24 $(document).ready(function(){
26 //----------------------------------------
27 // Dynamically Generate Panels from HTML!
28 var create_dynamic_panels = function(){
29 var wp_items = Ext.fly('west_panel_items');
30 var ul_items = wp_items.query('ul');
32 var dynamic_panels = new Array();
33 Ext.each(ul_items, function(ul) {
34 var panel_obj = new Ext.Panel({
38 //titleCollapse: true,
41 //stateId: 'freezer_panel_state',
45 //stateEvents: ['collapse', 'expand']
47 dynamic_panels.push(panel_obj);
49 return dynamic_panels;
52 var panel_bcmagic = new Ext.Panel({
55 contentEl: 'bcmagic_div',
59 var menuPanel = new Ext.Panel({
66 //cmargins: '2 2 0 2',
77 // Add dynamically generated panels from html and include barcode magic
78 items: create_dynamic_panels().concat([panel_bcmagic])
81 var get_east_panel_content = function(){
82 // East panel contentEl id is supplied in html div id of east_region_config.
83 var east_id = Ext.fly('east_region_config').dom.textContent;
85 // If no element exists with the supplied content id, report and error.
86 if (Ext.fly(east_id) == null){
87 return 'east_region_config_error';
92 var east_panel_content_id = get_east_panel_content();
93 if (east_panel_content_id.length > 0){
94 var eastPanel = new Ext.Panel({
101 collapseMode: 'mini',
103 contentEl: east_panel_content_id
106 var eastPanel = new Ext.Panel({
109 //margins: '0 2 0 2',
114 collapseMode: 'mini',
121 //-------------------------------
122 // Main Viewport Setup
123 //-------------------------------
124 var mainBorderPanel = new Ext.Viewport({
144 handler: function() { quick_msg('Messages can be fun!'); }
157 //title: 'Inner Panel',
158 contentEl: 'body_content',
165 //-------------------------------
167 //-------------------------------
168 var main_tb = Ext.getCmp('main_toolbar');
170 var add_buttons_from_html_left = function(main_tb){
171 var left_tbar_data = Ext.fly('left_tbar_data');
172 var div_array = left_tbar_data.query('div');
174 // Loop through each div since it defines a button and link or a spacer and add it to the right side of the toolbar
175 Ext.each(div_array, function(divobj) {
177 if (div_id == 'spacer'){
182 handler: function() { goto_url(divobj.getAttribute('href')); }
186 //return right_tbar_data;
189 var add_buttons_from_html_right = function(main_tb){
190 var right_tbar_data = Ext.fly('right_tbar_data');
191 var div_array = right_tbar_data.query('div');
193 // Loop through each div since it defines a button and link or a spacer and add it to the right side of the toolbar
194 Ext.each(div_array, function(divobj) {
196 if (div_id == 'spacer'){
201 handler: function() { goto_url(divobj.getAttribute('href')); }
205 //return right_tbar_data;
208 add_buttons_from_html_left(main_tb);
210 // Shifts the remaining toolbar options to the right side.
211 main_tb.add({ xtype: 'tbfill' });
212 var user_info = Ext.fly('login_info');
213 var logout_url = user_info.getAttribute('logouturl');
214 var login_url = user_info.getAttribute('loginurl');
216 if (user_info.getAttribute('authenticated') == 'true') {
219 text: 'User: ' + user_info.getAttribute('user')
222 add_buttons_from_html_right(main_tb);
226 handler: function() { goto_url(logout_url); }
232 handler: function() { goto_url(login_url) }