diff src/global/HtmlGlobalUtils.java @ 0:7ecd1a4ef557

add content
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 21 Mar 2019 19:15:52 -0600
parents
children e424dc827823
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/global/HtmlGlobalUtils.java	Thu Mar 21 19:15:52 2019 -0600
@@ -0,0 +1,67 @@
+
+package global;
+
+import global.web.Terms;
+import nabble.view.lib.HtmlViewUtils;
+import nabble.model.Init;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Calendar;
+
+
+public class HtmlGlobalUtils {
+
+	public static final String nabbleHost = (String)Init.get("nabbleHost");
+	public static final String nabbleContextUrl = "http://" + nabbleHost;
+
+	private static final int cssVersion = 13;
+
+	public static final String nabbleSupportUrl = "http://support.nabble.com/";
+
+	public static void head(HttpServletRequest request, HttpServletResponse response, String title)
+		throws IOException
+	{
+		PrintWriter out = response.getWriter();
+		
+		out.print( "\r\n<meta charset=\"utf-8\">\r\n        <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\r\n<title>Nabble &bull; " );
+		out.print( (title) );
+		out.print( "</title>\r\n<link href='https://fonts.googleapis.com/css?family=Lato|Oswald' rel='stylesheet' type='text/css'>\r\n<link rel=\"stylesheet\" href=\"/assets/font-awesome/css/font-awesome.min.css?" );
+		out.print( (cssVersion) );
+		out.print( "\">\r\n<link rel=\"stylesheet\" href=\"/assets/global.css?" );
+		out.print( (cssVersion) );
+		out.print( "\">\r\n" );
+
+		HtmlViewUtils.googleAnalytics(out);
+	}
+
+	public static void header(HttpServletRequest request,HttpServletResponse response)
+		throws IOException
+	{
+		PrintWriter out = response.getWriter();
+		
+		out.print( "\r\n<div header center>\r\n	<a href=\"/\"><img src=\"/assets/images/logo_nabble_home.png\" width=\"236\" height=\"50\" alt=\"Nabble\"/></a>\r\n</div>\r\n" );
+
+	}
+
+	public static void footer(HttpServletRequest request,HttpServletResponse response)
+		throws IOException
+	{
+		PrintWriter out = response.getWriter();
+		
+		out.print( "\r\n<div dark full marginTop center footer>\r\n	<div content>\r\n		<a href=\"" );
+		out.print( (HtmlGlobalUtils.nabbleContextUrl) );
+		out.print( "/help/Index.jtp\" title=\"Nabble help articles\">Help</a>\r\n		<a href=\"/PoweredBy.jtp\" rel=\"nofollow\">Powered by</a>\r\n		<a href=\"" );
+		out.print( (Terms.path(false)) );
+		out.print( "\" rel=\"nofollow\">Terms of Use</a>\r\n		<a href=\"/PrivacyPolicy.jtp\" rel=\"nofollow\">Privacy Policy</a>\r\n		<a href=\"/ContactUs.jtp\">Contact Us</a>\r\n		<div>&copy; 2005-" );
+		out.print( (Calendar.getInstance().get(Calendar.YEAR)) );
+		out.print( " Nabble, LLC.</div>\r\n	</div>\r\n</div>\r\n" );
+
+	}
+
+	private HtmlGlobalUtils() {}  // never
+}
+
+