📄 skin.jsp
字号:
<%-- - - $RCSfile: skin.jsp,v $ - $Revision: 1.21.2.1 $ - $Date: 2003/06/08 22:02:18 $ - - Copyright (C) 1999-2002 Jive Software. All rights reserved. - - This software is the proprietary information of Jive Software. Use is subject to license terms. ---%><%@ page import="java.util.*, com.jivesoftware.forum.*, com.jivesoftware.util.*, com.jivesoftware.forum.util.*" %><%! // global methods, vars, etc // Default properties values. (Maintenance note: this list is duplicated in upgrade.jsp) static Map properties = new HashMap(); static { properties.put("fontFace", "tahoma,arial,helvetica,sans-serif"); properties.put("descrFontFace", "verdana,arial,sans-serif"); properties.put("fontSize", "0.8em"); properties.put("descrFontSize", "0.8em"); properties.put("homeURL", ""); properties.put("bgColor", "#ffffff"); properties.put("textColor", "#000000"); properties.put("linkColor", "#003399"); properties.put("vLinkColor", "#003399"); properties.put("aLinkColor", "#99ccff"); properties.put("borderColor", "#cccccc"); properties.put("evenColor", "#ffffff"); properties.put("oddColor", "#eeeeee"); properties.put("activeColor", "#ffffcc"); properties.put("tableHeaderColor", "#ffffff"); properties.put("tableHeaderBgColor", "#336699"); properties.put("breadcrumbColor", "#660000"); properties.put("breadcrumbColorHover", "#660000"); properties.put("communityName", "Community Forums"); properties.put("communityDescription", "Welcome to our online community. Please choose from one of the forums below or log-in to your user account to start using this service."); properties.put("headerLogo", "<img src=\"images/logo.gif\" width=\"300\" height=\"45\" alt=\"Jive Community Forums\" border=\"0\">"); properties.put("headerBorderColor", "#003366"); properties.put("headerBgColor", "#336699"); properties.put("threadMode", "flat"); // other values are "threaded" or "tree" properties.put("trackIP", "true"); properties.put("newAccountCreationEnabled", "true"); properties.put("showLastPostLink", "true"); properties.put("usersChooseLocale", "false"); properties.put("useDefaultCommunityName", "true"); properties.put("useDefaultWelcomeText", "true"); properties.put("useDefaultHeaderImage", "true"); properties.put("readTracker.enabled", "true"); properties.put("questions.enabled", "true"); properties.put("rssFeeds.enabled", "false"); properties.put("usersChooseThreadMode", "false"); }%><%@ include file="global.jsp" %><% // Get parameters boolean save = "save".equals(request.getParameter("formAction")); boolean cancel = "cancel".equals(request.getParameter("formAction")); boolean restoreDefaults = "defaults".equals(request.getParameter("formAction")); String mode = ParamUtils.getParameter(request,"mode"); // Cancel if requested if (cancel) { response.sendRedirect("skin.jsp"); return; } // Get the current theme. The current theme will be "default" if no // current theme is detected. String theme = "default"; // Save properties to current theme if (save) { // Loop through the list of properties, save whatever is not null for (Iterator iter=properties.keySet().iterator(); iter.hasNext();) { String propName = (String)iter.next(); String propValue = ParamUtils.getParameter(request, propName, true); if (propValue != null) { if (propName.indexOf(".") > -1) { JiveGlobals.setJiveProperty(propName, propValue); } else { JiveGlobals.setJiveProperty("skin." + theme + "." + propName, propValue); } } } } // Restore the current theme to use the default if (restoreDefaults) { // Loop through the defaults, set jive properties accordingly for (Iterator iter=properties.keySet().iterator(); iter.hasNext();) { String key = (String)iter.next(); String value = (String)properties.get(key); if (key.indexOf(".") > -1) { JiveGlobals.setJiveProperty(key,value); } else { JiveGlobals.setJiveProperty("skin.default."+key, value); } } } // List o' properties String skinTheme = "skin." + theme + "."; String fontFace = JiveGlobals.getJiveProperty(skinTheme + "fontFace"); String descrFontFace = JiveGlobals.getJiveProperty(skinTheme + "descrFontFace"); String fontSize = JiveGlobals.getJiveProperty(skinTheme + "fontSize"); String descrFontSize = JiveGlobals.getJiveProperty(skinTheme + "descrFontSize"); String homeURL = JiveGlobals.getJiveProperty(skinTheme + "homeURL"); String bgColor = JiveGlobals.getJiveProperty(skinTheme + "bgColor"); String textColor = JiveGlobals.getJiveProperty(skinTheme + "textColor"); String linkColor = JiveGlobals.getJiveProperty(skinTheme + "linkColor"); String vLinkColor = JiveGlobals.getJiveProperty(skinTheme + "vLinkColor"); String aLinkColor = JiveGlobals.getJiveProperty(skinTheme + "aLinkColor"); String borderColor = JiveGlobals.getJiveProperty(skinTheme + "borderColor"); String evenColor = JiveGlobals.getJiveProperty(skinTheme + "evenColor"); String oddColor = JiveGlobals.getJiveProperty(skinTheme + "oddColor"); String activeColor = JiveGlobals.getJiveProperty(skinTheme + "activeColor"); String tableHeaderColor = JiveGlobals.getJiveProperty(skinTheme + "tableHeaderColor"); String tableHeaderBgColor = JiveGlobals.getJiveProperty(skinTheme + "tableHeaderBgColor"); String breadcrumbColor = JiveGlobals.getJiveProperty(skinTheme + "breadcrumbColor"); String breadcrumbColorHover = JiveGlobals.getJiveProperty(skinTheme + "breadcrumbColorHover"); String communityName = JiveGlobals.getJiveProperty(skinTheme + "communityName"); String communityDescription = JiveGlobals.getJiveProperty(skinTheme + "communityDescription"); String headerLogo = JiveGlobals.getJiveProperty(skinTheme + "headerLogo"); String headerBorderColor = JiveGlobals.getJiveProperty(skinTheme + "headerBorderColor"); String headerBgColor = JiveGlobals.getJiveProperty(skinTheme + "headerBgColor"); String threadMode = JiveGlobals.getJiveProperty(skinTheme + "threadMode"); if (threadMode == null || "".equals(threadMode)) { // set "flat" mode as the default thread view threadMode = "flat"; } String trackIP = JiveGlobals.getJiveProperty(skinTheme + "trackIP"); if (trackIP == null) { // on by default trackIP = "true"; } else if (!"true".equals(trackIP)) { trackIP = "false"; } String newAccountCreationEnabled = JiveGlobals.getJiveProperty("skin.default.newAccountCreationEnabled"); if (newAccountCreationEnabled == null) { // enable by default newAccountCreationEnabled = "true"; } String showLastPostLink = JiveGlobals.getJiveProperty("skin.default.showLastPostLink"); if (showLastPostLink == null) { // enable by default showLastPostLink = "true"; } String usersChooseLocale = JiveGlobals.getJiveProperty("skin.default.usersChooseLocale"); if (usersChooseLocale == null) { // not enabled by default usersChooseLocale = "false"; } String useDefaultWelcomeText = JiveGlobals.getJiveProperty("skin.default.useDefaultWelcomeText"); if (useDefaultWelcomeText == null) { // enable by default useDefaultWelcomeText = "true"; } String useDefaultCommunityName = JiveGlobals.getJiveProperty("skin.default.useDefaultCommunityName"); if (useDefaultCommunityName == null) { // enable by default useDefaultCommunityName = "true"; } String useDefaultHeaderImage = JiveGlobals.getJiveProperty("skin.default.useDefaultHeaderImage"); if (useDefaultHeaderImage == null) { // enable by default useDefaultHeaderImage = "true"; } String usersChooseThreadMode = JiveGlobals.getJiveProperty("skin.default.usersChooseThreadMode"); if (usersChooseThreadMode == null) { usersChooseThreadMode = (String)properties.get("usersChooseThreadMode"); JiveGlobals.setJiveProperty("skin.default.usersChooseThreadMode", usersChooseThreadMode); } String readTrackerEnabled = JiveGlobals.getJiveProperty("readTracker.enabled"); if (readTrackerEnabled == null) { readTrackerEnabled = (String)properties.get("readTracker.enabled"); JiveGlobals.setJiveProperty("readTracker.enabled", readTrackerEnabled); } String questionsEnabled = JiveGlobals.getJiveProperty("questions.enabled"); if (questionsEnabled == null) { questionsEnabled = (String)properties.get("questions.enabled"); JiveGlobals.setJiveProperty("questions.enabled", questionsEnabled); } String rssFeedsEnabled = JiveGlobals.getJiveProperty("rssFeeds.enabled"); if (rssFeedsEnabled == null) { rssFeedsEnabled = (String)properties.get("rssFeeds.enabled"); JiveGlobals.setJiveProperty("rssFeeds.enabled", rssFeedsEnabled); } if (activeColor == null) { activeColor = "#ffcccc"; JiveGlobals.setJiveProperty("skin.default.activeColor", activeColor); } // escape the < and > and quotes from necessary fields communityName = StringUtils.escapeHTMLTags(communityName); communityName = StringUtils.replace(communityName, "\"", """); communityDescription = StringUtils.escapeHTMLTags(communityDescription); communityDescription = StringUtils.replace(communityDescription, "\"", """); headerLogo = StringUtils.escapeHTMLTags(headerLogo); headerLogo = StringUtils.replace(headerLogo, "\"", """);%><%@ include file="header.jsp" %><% // Title of this page and breadcrumbs String title = "Skin Settings"; String[][] breadcrumbs = null; if ("fonts".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Fonts", "skin.jsp?mode=fonts"} }; } else if ("colors".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Colors", "skin.jsp?mode=colors"} }; } else if ("forumtext".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Forum Text", "skin.jsp?mode=forumtext"} }; } else if ("headerandfooter".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Header & Footer", "skin.jsp?mode=headerandfooter"} }; } else if ("features".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Features", "skin.jsp?mode=features"} }; } else if ("threadmode".equals(mode)) { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"}, {"Thread Mode", "skin.jsp?mode=threadmode"} }; } else { breadcrumbs = new String[][] { {"Main", "main.jsp"}, {title, "skin.jsp"} }; }%><%@ include file="title.jsp" %><script language="JavaScript" type="text/javascript"><!--var theEl;function colorPicker(el) { var val = el.value.substr(1,6); var win = window.open("colorPicker.jsp?element="+el.name+"&defaultColor="+val,"","menubar=yes,location=no,personalbar=no,scrollbar=yes,width=580,height=300,resizable");}//--></script><style type="text/css">.demo { text-decoration : underline; color : <%= linkColor %>;}.demo:hover { text-decoration : underline; color : <%= aLinkColor %>;}</style><form action="skin.jsp" name="skinForm" method="post"><input type="hidden" name="formAction" value=""><% if (mode != null) { %><input type="hidden" name="mode" value="<%= mode %>"><% } %><% // Depending on the "mode", we'll print out a different page. The default // mode (when mode == null) is to print out the list of editable skin // categories. if (mode == null) {%> You can edit the attributes of the default Jive Forums skin by choosing one of the options below: <ul><li><a href="skin.jsp?mode=fonts">Fonts</a> - Adjust the list of fonts and their sizes. <li><a href="skin.jsp?mode=colors">Colors</a> - Adjust colors of backgrounds, fonts, links, and borders. <li><a href="skin.jsp?mode=forumtext">Forum Text</a> - Edit the welcome text for your community. <li><a href="skin.jsp?mode=headerandfooter">Header & Footer</a> - Edit the image and colors of the header and footer as well as the text and links for the breadcrumbs. <li><a href="skin.jsp?mode=features">Features</a> - Turn on or off various features in the default skin. </ul><% } else if ("fonts".equals(mode)) { %> <b>Font Settings</b> <ul> <table bgcolor="<%= tblBorderColor %>" cellpadding="0" cellspacing="0" border="0"> <tr><td> <table bgcolor="<%= tblBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%"> <tr bgcolor="#ffffff"> <td rowspan="2">Global Font:</td> <td nowrap>Font List:</td><td><input type="text" size="25" name="fontFace" maxlength="100" value="<%= (fontFace!=null)?fontFace:"" %>"></td> <td rowspan="2" style="font-size:<%= fontSize %>;font-family:<%= fontFace %>;"> This is an example of this font </td> </tr> <tr bgcolor="#ffffff"> <td nowrap>Font Size:</td> <td><input type="text" size="25" name="fontSize" maxlength="100" value="<%= (fontSize!=null)?fontSize:"" %>"></td> </tr> <tr bgcolor="#ffffff"> <td rowspan="2"> Description Font: <font size="-2"> <br>(Size is relative to the global font.) </font>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -