Skip to content
Snippets Groups Projects
Commit ff47a1f7 authored by Matthew Juhl's avatar Matthew Juhl
Browse files

Temporarily use an updated copy of mobile.js from mobileunl repo to fix...

Temporarily use an updated copy of mobile.js from mobileunl repo to fix navigation issue since Brett won't be here until Monday.
parent 38fe1217
No related branches found
No related tags found
No related merge requests found
window.onorientationchange = function() {
/*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the
left, or landscape mode with the screen turned to the right. */
var orientation = window.orientation;
switch(orientation) {
case 0:
/* If in portrait mode, sets the body's class attribute to portrait. Consequently, all style definitions matching the body[class="portrait"] declaration
in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
//WDN.jQuery('body').addClass("portrait");
WDN.jQuery('head meta[name=viewport]').attr('content', 'width = 320');
document.body.setAttribute("class","popup portrait");
break;
case 90:
/* If in landscape mode with the screen turned to the left, sets the body's class attribute to landscapeLeft. In this case, all style definitions matching the
body[class="landscapeLeft"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
WDN.jQuery('head meta[name=viewport]').attr('content', 'width = 480');
document.body.setAttribute("class","popup landscapeLeft");
break;
case -90:
/* If in landscape mode with the screen turned to the right, sets the body's class attribute to landscapeRight. Here, all style definitions matching the
body[class="landscapeRight"] declaration in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or iPod touch Orientation Events". */
//WDN.jQuery('body').addClass("landscapeRight");
WDN.jQuery('head meta[name=viewport]').attr('content', 'width = 480');
document.body.setAttribute("class","popup landscapeRight");
break;
}
}
/* TODO sniff hash values and display accordingly
*
* #navigation - parent navigation displayed
* #sec_nav[index] - secondary navigation displayed
*
*/
WDN.jQuery(document).ready(function() {
WDN.jQuery("#mobile_navigation ul").hide();
WDN.jQuery("#mobile_navigation").css({'position' : 'absolute'});
WDN.jQuery("#mobile_navigation h2").css({'display' : 'none'});
if (WDN.jQuery('ul#mobile_breadcrumbs > li.parent_site > a').text().length > 5) {
var allText = WDN.jQuery('ul#mobile_breadcrumbs > li.parent_site > a').text();
WDN.jQuery('ul#mobile_breadcrumbs > li.parent_site > a').text(allText.substr(0,5)+'...');
}
if (WDN.jQuery('ul#mobile_breadcrumbs > li:last-child > a').text().length > 19) {
var allText = WDN.jQuery('ul#mobile_breadcrumbs > li:last-child > a').text();
WDN.jQuery('ul#mobile_breadcrumbs > li:last-child > a').text(allText.substr(0,19)+'...');
}
WDN.jQuery('#mobile_navigation ul:first').has('ul').addClass('parentNav');
WDN.jQuery('#mobile_navigation > ul > li').has('ul').each(function(index) {
WDN.jQuery(this).children('ul').children('li:first').before('<li class="mainLink'+index+'"></li>');
WDN.jQuery(this).children('a').clone().prependTo('li.mainLink'+index);
WDN.jQuery(this).children('a').replaceWith(WDN.jQuery(this).children('a').contents());
WDN.jQuery(this).removeClass().addClass('nav'+index).children('ul').addClass('nav'+index);
WDN.jQuery(this).css({"background":"url('images/arrowForward.png') no-repeat right"})
});
WDN.jQuery("#mobile_navigation > ul > li > ul").insertAfter('#mobile_navigation ul:first');
WDN.jQuery('ul#mobile_breadcrumbs li:last-child a').click(function(event) { //show the navigation
event.preventDefault();
if (WDN.jQuery('#mobile_navigation ul:first').css('display') === 'none') {
WDN.jQuery('#mobile_navigation h2').show();
WDN.jQuery('#mobile_navigation ul:first').show();
WDN.jQuery('#mobile_navigation ul[class^=nav]').hide();
} else {
WDN.jQuery('#mobile_navigation ul:first').hide();
WDN.jQuery('#mobile_navigation h2').hide();
};
window.location.hash = 'navigation';
return false;
});
WDN.jQuery('#mobile_navigation > ul.parentNav > li').click(function() { //show the secondary navigation
secondaryNav = WDN.jQuery(this).attr('class');
WDN.jQuery(this).parent('ul').hide();
WDN.jQuery('#mobile_navigation ul.'+secondaryNav).show();
window.location.hash = 'sec_'+secondaryNav;
});
WDN.jQuery('#mobile_navigation > ul[class!=parentNav] > li').has('a').click(function(){
window.location = WDN.jQuery(this).children('a').attr('href');
});
})
\ No newline at end of file
...@@ -38,9 +38,8 @@ $page = UNL_Templates::factory('Popup'); ...@@ -38,9 +38,8 @@ $page = UNL_Templates::factory('Popup');
$page->doctitle = '<title>'.$vars['title'].'</title>'; $page->doctitle = '<title>'.$vars['title'].'</title>';
$page->titlegraphic = '<h1><a href="'.$vars['config']->url.'" title="Planet Red Home">'.$vars['config']->sitename.'</a></h1>'; $page->titlegraphic = '<h1><a href="'.$vars['config']->url.'" title="Planet Red Home">'.$vars['config']->sitename.'</a></h1>';
$page->head .= '<link rel="stylesheet" href="' . $vars['url'] .'_css/css.css?lastcache='.$vars['config']->lastcache.'>&amp;viewtype=mobile&view=mobile" type="text/css" />'; $page->head .= '<link rel="stylesheet" href="' . $vars['url'] .'_css/css.css?lastcache='.$vars['config']->lastcache.'>&amp;viewtype=mobile&view=mobile" type="text/css" />';
$page->head .= '<script type="text/javascript" src="' . $vars['url'] . 'mod/mobile_unl/mobile.js"></script>';
$page->head .= <<<END $page->head .= <<<END
<script type="text/javascript" src="http://m.unl.edu/mobile.js"></script>
<link media="only screen and (max-device-width: 480px)" href="http://m.unl.edu/mobile.css" type="text/css" rel="stylesheet" /> <link media="only screen and (max-device-width: 480px)" href="http://m.unl.edu/mobile.css" type="text/css" rel="stylesheet" />
<link media="screen" href="http://m.unl.edu/mobile.css" type="text/css" rel="stylesheet" /> <link media="screen" href="http://m.unl.edu/mobile.css" type="text/css" rel="stylesheet" />
END; END;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment