jQuery(document).ready(function($){ var barInitialized = false; var barWidth; function initBar(){ if(!barInitialized){ barInitialized = true; $('#toolbar').css({ 'display':'block' }); $('#toolbar').jixedbar({ hoverOpaque: false, roundButtons: false }); $('#toolbar').css({ 'display':'none', 'width': '975px', }); if(window.location.pathname == '/'){ $('#toolbar').delay(2000).fadeIn('slow'); } else { $('#toolbar').fadeIn('slow'); } } } initBar(); if($(window).height() > $('#main').height()) { initBar(); } else { $(window).scroll(function(){ initBar(); }); } $("#toggle-bar").click(function(){ barWidth = $('#toolbar').css('width'); $('#toolbar').animate( { width: 115 }, 'slow', function(){ //$(this).toggleClass('jx-bar-compressed'); //$(this).show(); $('#showMenu').show(); }); return false; }) $("#showMenu a").click(function(){ $('#toolbar').animate({ width: barWidth },'slow',function(){ $('#showMenu').hide(); }); return false; }); Ext.onReady(function(){ Ext.QuickTips.init(); var menu = new Ext.menu.Menu({ items: [ { text: 'Hi', },{ text: 'Hi', } ] }); /* var feedbackForm = new Ext.menu.Menu({ plain: true, items:[{ xtype: 'panel', id: 'feedbackPanel', height: 500, width: 500 }] }); */ var tb = new Ext.Toolbar({ renderTo: 'toolbar', buttonAlign: 'left', enableOverflow: true, items: [ { id: 'toolbarHomeButton', text:'OSUL Home', title: 'Go to OSUL Home Page', icon: "https://portal.lib.ohio-state.edu/favicon.ico", handler: function(){ document.location.href = '/'; } },{ id: 'toolbarSearchButton', text: 'Search', title : 'Use our full-featured search box', iconCls: 'silk-magnifier', handler: function() { $('#globalSearchTab a').trigger('click'); } }, { id: 'toolbarFeedbackButton', text: 'Send Feedback/Report Problem', iconCls: 'silk-email-edit', title: 'Send us a comment, problem, or general feedback', handler: function() { document.location.href = '/about/contact-us/webmaster-mail' } },{ id: 'toolbarHelpButton', text: 'Help', title: 'Ask Us!', iconCls: 'silk-help', handler: function() { document.location.href = '/help'; } } ,'->' ,{ id: 'toolbarOffcampusButton', title: 'You are Off Campus', text: 'Off Campus Sign-In', iconCls: 'silk-lock-break', handler: function(){ document.location.href = 'http://proxy.lib.ohio-state.edu/login?url='+document.location.href; } } ,'-' ,{ id: 'toolbarAccountButton', text: 'My Account', title: 'Go to My Account', iconCls: 'silk-door-in', handler: function(){ document.location.href = '/Security/login?BackURL=/account'; } } ] }); var Tooltips = [{ target: 'toolbarOffcampusButton' }, { target: 'toolbarHelpButton' }, { target: 'toolbarFeedbackButton' }, { target: 'toolbarSearchButton' }, { target: 'toolbarAccountButton' }, { target: 'toolbarHomeButton' } ]; Ext.each(Tooltips, function(item){ var target = Ext.getCmp(item.target); Ext.apply(item, { anchor: 'bottom', html: target.title }); new Ext.ToolTip(item); }); }); }); var onCampus = false; /********************************************************* * Off Campus Link Rewriting Script * James Muir Systems Developer/Engineer, Ohio State University Libraries * Last Updated 5/6/2008 * Automatically adds prepends proxy url to the link if the user is off campus *********************************************************/ /* Constants - these values will be specific to your setup */ // Links with this class name will be affected. // Usage: Resource var className = 'offcampus_check'; // Proxy string prefix var proxyString = 'http://proxy.lib.ohio-state.edu/login?url='; /***********************************************************/ var done = 0; // Initializes 'done' to be false jQuery(document).ready(function($){ /* Goes through the document and checks for links with the classname specified above and prepends * the proxy string to them. */ function rewritelinks(){ if(done == 1) return; // if script has already run, return $('.'+className).each(function() { $(this).attr('href', proxyString + $(this).attr('href')); }); done = 1; // set done = 1 so the script will not run again! } /* This is where the actual check is done */ if(onCampus == false) { rewritelinks(); } $('.'+className).removeClass(className); if(onCampus == false){ $('.SSCentralSearchSearchForm').find('.searchSubmit').val('Search Articles (Will be prompted for Off Campus Sign-In)'); $('.SSCentralSearchSearchForm').submit(function(){ $(this).attr('action', 'http://nf4hr2ve4v.cs.serialssolutions.com.proxy.lib.ohio-state.edu/results'); }) } });