comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:7ecd1a4ef557
1
2 package global;
3
4 import global.web.Terms;
5 import nabble.view.lib.HtmlViewUtils;
6 import nabble.model.Init;
7
8 import javax.servlet.http.HttpServletRequest;
9 import javax.servlet.http.HttpServletResponse;
10 import java.io.IOException;
11 import java.io.PrintWriter;
12 import java.util.Calendar;
13
14
15 public class HtmlGlobalUtils {
16
17 public static final String nabbleHost = (String)Init.get("nabbleHost");
18 public static final String nabbleContextUrl = "http://" + nabbleHost;
19
20 private static final int cssVersion = 13;
21
22 public static final String nabbleSupportUrl = "http://support.nabble.com/";
23
24 public static void head(HttpServletRequest request, HttpServletResponse response, String title)
25 throws IOException
26 {
27 PrintWriter out = response.getWriter();
28
29 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; " );
30 out.print( (title) );
31 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?" );
32 out.print( (cssVersion) );
33 out.print( "\">\r\n<link rel=\"stylesheet\" href=\"/assets/global.css?" );
34 out.print( (cssVersion) );
35 out.print( "\">\r\n" );
36
37 HtmlViewUtils.googleAnalytics(out);
38 }
39
40 public static void header(HttpServletRequest request,HttpServletResponse response)
41 throws IOException
42 {
43 PrintWriter out = response.getWriter();
44
45 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" );
46
47 }
48
49 public static void footer(HttpServletRequest request,HttpServletResponse response)
50 throws IOException
51 {
52 PrintWriter out = response.getWriter();
53
54 out.print( "\r\n<div dark full marginTop center footer>\r\n <div content>\r\n <a href=\"" );
55 out.print( (HtmlGlobalUtils.nabbleContextUrl) );
56 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=\"" );
57 out.print( (Terms.path(false)) );
58 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-" );
59 out.print( (Calendar.getInstance().get(Calendar.YEAR)) );
60 out.print( " Nabble, LLC.</div>\r\n </div>\r\n</div>\r\n" );
61
62 }
63
64 private HtmlGlobalUtils() {} // never
65 }
66
67