def mobile_html_head(title): # type: (Text) -> None html.mobile = True html.write( """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">""" ) html.open_html() html.open_head() html.default_html_headers() html.meta(name="viewport", content="initial-scale=1.0") html.meta(name="apple-mobile-web-app-capable", content="yes") html.meta(name="apple-mobile-web-app-title", content="Check_MK") html.title(title) html.stylesheet(href="jquery/jquery.mobile-1.2.1.css") html.stylesheet(href="themes/classic/theme.css") html.write( html._render_start_tag("link", rel="apple-touch-icon", href="themes/classic/images/ios_logo.png", close_tag=True)) html.javascript_file(src='js/mobile_min.js') # Never allow the mobile page to be opened in an iframe. Redirect top page to the current content page. # This will result in a full screen mobile interface page. html.javascript( '''if(top != self) { window.top.location.href = location; }''') html.javascript(""" $(document).ready(function() { $("a").click(function (event) { event.preventDefault(); window.location = $(this).attr("href"); }); });""") html.close_head() html.open_body(class_="mobile")
def mobile_html_head(title: str) -> None: html.write( """<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">""" ) html.open_html() html.open_head() html.default_html_headers() html.meta(name="viewport", content="initial-scale=1.0") html.meta(name="apple-mobile-web-app-capable", content="yes") html.meta(name="apple-mobile-web-app-title", content="Check_MK") html.title(title) html.stylesheet(href="jquery/jquery.mobile-1.4.5.min.css") html.stylesheet(href="themes/facelift/theme.css") html.write( html._render_start_tag("link", rel="apple-touch-icon", href="themes/facelift/images/ios_logo.png", close_tag=True)) html.javascript_file(src='js/mobile_min.js') html.close_head() html.open_body(class_="mobile")