diff --git a/README.md b/README.md index b5cf430..e95b239 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Hybrid Hale Template New and improved UConn Hale template using the latest Bootstrap, jQuery, and other technologies. +This is a Wordpress theme. Please note: It is up to the current web developer to maintain this repository since UITS will not support. diff --git a/global_header_no_sidebar.php b/global_header_no_sidebar.php index 392b322..139eb1a 100644 --- a/global_header_no_sidebar.php +++ b/global_header_no_sidebar.php @@ -19,22 +19,57 @@ $bsJSPath = $Path . 'lib/bootstrap-3.3.6-dist/js/bootstrap.min.js'; $customJSPath = $Path . 'lib/js/custom.js'; $alertJSPath = 'https://alert.uconn.edu/alert/alert.js'; $mainJS = array($modernJSPath, $JQPath, $bsJSPath, $customJSPath); -$resultJS = array_merge($mainJS, $JS); - -/* CSS External Libraries*/ +$resultJS = isset($JS) ? array_merge($mainJS, $JS) : $mainJS; +/* CSS External Libraries */ $bsCSSPath = $Path . 'lib/bootstrap-3.3.6-dist/css/bootstrap.min.css'; $styleCSSPath = $Path . 'lib/css/style.css'; $commonCSSPath = $Path . 'lib/css/common.css'; $ucPrintCSSPath = $Path . 'lib/css/uc-print.css'; // not sure why this is left out $mainCS = array($bsCSSPath, $styleCSSPath, $commonCSSPath); -$resultCS = array_merge($mainCS, $CS); +$resultCS = isset($CS) ? array_merge($mainCS, $CS) : $mainCS; +/* Menu Items + * This is the list of the top bar menu items available as Key => value pairs. + * key: url and page id + * value: menu name + * */ +$firstGroupMenu = + array('prospective' => 'Prospective Students', 'graduate' => 'Graduate Students', 'abroad' => 'Education Abroad', + 'bgs' => 'BGS Students', 'cein' => 'Certificate Entry into Nursing (CEIN/BS) Students', 'tcpcg' => 'TCPCG Students', + 'certificate-programs' => 'Certificate Program Students' + ); +// TODO: Optimize other menu items array +$secondGroupMenu = + array('aid-type' => 'Introduction', 'grants' => 'Grants', + array('loans' => 'Loans', + array('altloans' => 'Alternative Student Loans', 'ugrdalt' => 'Alternative Loans - Undergraduate Students', + 'gradalt' => 'Alternative Loans - Graduate Students' + ), + 'stafford' => 'Federal Stafford', 'perkins' => 'Perkins', 'plus#parents' => 'Parent Plus', + 'plus#graduates' => 'Graduate Plus' + ) + ); +function createDropdown(&$group) { // pass by reference + list($key, $value) = each($group); + if (!is_array($value) && $value != false) { + echo "
  • {$value}
  • "; + createDropdown($group); + } /*else if (is_array($value)) { + list($key, $value) = each($value); + echo + ""; // remember to close
  • + }*/ +} ?> - - + + @@ -200,48 +235,45 @@ $resultCS = array_merge($mainCS, $CS);
  • diff --git a/lib/css/style.css b/lib/css/style.css index 98e241a..a70b7bb 100644 --- a/lib/css/style.css +++ b/lib/css/style.css @@ -192,11 +192,13 @@ div#uc-titlebar>div.container { } /* Sub-menu Functionality -* https://stackoverflow.com/questions/18023493/bootstrap-3-dropdown-sub-menu-missing + * https://stackoverflow.com/questions/18023493/bootstrap-3-dropdown-sub-menu-missing + * http://www.bootply.com/92442 */ .dropdown-submenu { position: relative; } + .dropdown-submenu > .dropdown-menu { top: 0; left: 100%; @@ -206,9 +208,8 @@ div#uc-titlebar>div.container { -moz-border-radius: 0 6px 6px 6px; border-radius: 0 6px 6px 6px; } -.dropdown-submenu:hover > .dropdown-menu { - display: block; -} + +/*.dropdown-submenu:hover>.dropdown-menu{display:block;}*/ .dropdown-submenu > a:after { display: block; content: " "; @@ -222,12 +223,15 @@ div#uc-titlebar>div.container { margin-top: 5px; margin-right: -10px; } + .dropdown-submenu:hover > a:after { border-left-color: #ffffff; } + .dropdown-submenu.pull-left { float: none; } + .dropdown-submenu.pull-left > .dropdown-menu { left: -100%; margin-left: 10px; @@ -1239,3 +1243,16 @@ a.uup-user:hover { @media (max-width: 321px) { } + +/* Overrides */ +.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6{ + font-family:inherit; + font-weight: bold; + line-height:1.1; + color:inherit +} + +.h1, .h2, .h3, h1, h2, h3 { + margin-top: 10px; + margin-bottom: 10px; +} diff --git a/lib/css/style_intranet.css b/lib/css/style_intranet.css index f4859cd..5ceacab 100644 --- a/lib/css/style_intranet.css +++ b/lib/css/style_intranet.css @@ -1,5 +1,5 @@ -/* +/* Max width before this PARTICULAR table gets nasty This query will take effect for any screen smaller than 760px and also iPads specifically. diff --git a/lib/js/custom.js b/lib/js/custom.js index a04a76c..51d06c2 100644 --- a/lib/js/custom.js +++ b/lib/js/custom.js @@ -22,16 +22,27 @@ $(function() { // document ready checkNav(); }); /* Navbar */ -function checkNav() { // sets the proper active menu when clicked - $("nav li a.active").removeClass("active"); // Remove any active class - var a = location.pathname.split("/web9.uits.uconn.edu"); - $("nav li a").each(function(index, value) { - var menuPath = $(this).attr("href").split("http://financialaid.uconn.edu"); - //console.log(menuPath[1]); - //console.log(a[1]); - var regexUrl = new RegExp(menuPath + "\w*"); // matched menu path with any trailing alphanumeric value - /* if (a[1].match(regexUrl)) { - // TODO: set active list - }*/ +function checkNav() { // sets the proper active menu when page loads + var pathArray = location.pathname.split('/'); + var menuItem = pathArray[pathArray.length - 1]; + $("li#"+ menuItem).attr("active"); + setActiveMenu(); +} +function setActiveMenu() { // highlights the submenu when clicked + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) { + event.preventDefault(); // avoid following the href location when clicking + event.stopPropagation(); // avoid having the menu to close when clicking + // If a menu is already open we close it + //$('ul.dropdown-menu [data-toggle=dropdown]').parent().removeClass('open'); + // opening the one you clicked on + $(this).parent().addClass('open'); + var menu = $(this).parent().find("ul"); + var menupos = menu.offset(); + if ((menupos.left + menu.width()) + 30 > $(window).width()) { + var newpos = - menu.width(); + } else { + var newpos = $(this).parent().width(); + } + menu.css({ left:newpos }); }); } \ No newline at end of file