📄 skin.jsp
字号:
<%@ page contentType="text/html;charset=GB2312" %>
<%
/**
* $RCSfile: skin.jsp,v $
* $Revision: 1.1.1.1 $
* $Date: 2002/09/09 13:50:18 $
*/
%>
<%@ page import="java.util.*,
com.jivesoftware.forum.*,
com.jivesoftware.util.*,
com.jivesoftware.forum.util.*" %>
<%! // global methods, vars, etc
// Default properties values.
static Map properties = new HashMap();
static {
properties.put("fontFace", "arial,sans-serif");
properties.put("buttonFontFace", "verdana,arial,sans-serif");
properties.put("headerFontFace", "verdana,arial,sans-serif");
properties.put("homeURL", "index.jsp");
properties.put("bgColor", "#ffffff");
properties.put("textColor", "#000000");
properties.put("linkColor", "#003399");
properties.put("vLinkColor", "#003399");
properties.put("aLinkColor", "#99ccff");
properties.put("tableBorderColor", "#cccccc");
properties.put("tableHeaderBgColor", "#336699");
properties.put("tableHeaderTextColor", "#ffffff");
properties.put("tableRowColor1", "#eeeeee");
properties.put("tableRowColor2", "#d9e4f9");
properties.put("paginatorTextColor", "#333333");
properties.put("paginatorTableBgColor", "#eeeeee");
properties.put("sidebarHeaderBgColor", "#eeeeee");
properties.put("sidebarHeaderTextColor", "#000000");
properties.put("sidebarBgColor", "#ffffff");
properties.put("prefsHeaderBgColor", "#eeeeee");
properties.put("prefsHeaderTextColor", "#000000");
properties.put("prefsBgColor", "#ffffff");
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=\"242\" height=\"38\" alt=\"Community Forums\" border=\"0\">");
properties.put("headerBorderColor", "#003366");
properties.put("headerBgColor", "#336699");
properties.put("threadMode", "flat"); // other value is "threaded"
}
%>
<%@ include file="global.jsp" %>
<% // Get parameters
boolean save = "save".equals(request.getParameter("formAction"));
boolean restoreDefaults = "defaults".equals(request.getParameter("formAction"));
// Save properties
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) {
JiveGlobals.setJiveProperty("skin.default."+propName, propValue);
}
}
}
// Restore defaults
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);
JiveGlobals.setJiveProperty("skin.default."+key, value);
}
}
// redirect
if (save || restoreDefaults) {
//response.sendRedirect("skin.jsp");
//return;
}
// List o' properties
String fontFace = JiveGlobals.getJiveProperty("skin.default.fontFace");
String buttonFontFace = JiveGlobals.getJiveProperty("skin.default.buttonFontFace");
String headerFontFace = JiveGlobals.getJiveProperty("skin.default.headerFontFace");
String homeURL = JiveGlobals.getJiveProperty("skin.default.homeURL");
String bgColor = JiveGlobals.getJiveProperty("skin.default.bgColor");
String textColor = JiveGlobals.getJiveProperty("skin.default.textColor");
String linkColor = JiveGlobals.getJiveProperty("skin.default.linkColor");
String vLinkColor = JiveGlobals.getJiveProperty("skin.default.vLinkColor");
String aLinkColor = JiveGlobals.getJiveProperty("skin.default.aLinkColor");
String tableBorderColor = JiveGlobals.getJiveProperty("skin.default.tableBorderColor");
String tableHeaderBgColor = JiveGlobals.getJiveProperty("skin.default.tableHeaderBgColor");
String tableHeaderTextColor = JiveGlobals.getJiveProperty("skin.default.tableHeaderTextColor");
String tableRowColor1 = JiveGlobals.getJiveProperty("skin.default.tableRowColor1");
String tableRowColor2 = JiveGlobals.getJiveProperty("skin.default.tableRowColor2");
String paginatorTextColor = JiveGlobals.getJiveProperty("skin.default.paginatorTextColor");
String paginatorTableBgColor = JiveGlobals.getJiveProperty("skin.default.paginatorTableBgColor");
String sidebarHeaderBgColor = JiveGlobals.getJiveProperty("skin.default.sidebarHeaderBgColor");
String sidebarHeaderTextColor = JiveGlobals.getJiveProperty("skin.default.sidebarHeaderTextColor");
String sidebarBgColor = JiveGlobals.getJiveProperty("skin.default.sidebarBgColor");
String prefsHeaderBgColor = JiveGlobals.getJiveProperty("skin.default.prefsHeaderBgColor");
String prefsHeaderTextColor = JiveGlobals.getJiveProperty("skin.default.prefsHeaderTextColor");
String prefsBgColor = JiveGlobals.getJiveProperty("skin.default.prefsBgColor");
String communityDescription = JiveGlobals.getJiveProperty("skin.default.communityDescription");
String headerLogo = JiveGlobals.getJiveProperty("skin.default.headerLogo");
String headerBorderColor = JiveGlobals.getJiveProperty("skin.default.headerBorderColor");
String headerBgColor = JiveGlobals.getJiveProperty("skin.default.headerBgColor");
String threadMode = JiveGlobals.getJiveProperty("skin.default.threadMode");
// set "flat" mode as the default thread view
if (threadMode == null || "".equals(threadMode)) {
threadMode = "flat";
}
// escape the < and > and quotes from necessary fields
communityDescription = StringUtils.escapeHTMLTags(communityDescription);
communityDescription = StringUtils.replace(communityDescription, "\"", """);
headerLogo = StringUtils.escapeHTMLTags(headerLogo);
headerLogo = StringUtils.replace(headerLogo, "\"", """);
%>
<%@ include file="header.jsp" %>
<p>
<% // Title of this page and breadcrumbs
String title = "外观设置";
String[][] breadcrumbs = {
{"主页面", "main.jsp"},
{title, "skin.jsp"}
};
%>
<%@ include file="title.jsp" %>
<font size="-1">
编辑Jive论坛的缺省外观。请注意,这些改变是立即生效的。
</font>
<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,width=580,height=300,resizable");
}
//-->
</script>
<style type="text/css">
.demo {
text-decoration : underline;
color : <%= linkColor %>;
}
.demo:hover {
text-decoration : underline;
color : <%= linkColor %>;
}
</style>
<p>
<form action="skin.jsp" name="skinForm" method="post">
<input type="hidden" name="formAction" value="">
<font size="-1">
<b>字体设置</b>
</font>
<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><font size="-1">全局字体列表:</font></td>
<td><input type="text" size="25" name="fontFace" maxlength="100" value="<%= (fontFace!=null)?fontFace:"" %>"></td>
<td><font size="-1" face="<%= fontFace %>">字体范例ABCabc123</font></td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">按钮字体列表:</font></td>
<td><input type="text" size="25" name="buttonFontFace" maxlength="100" value="<%= (buttonFontFace!=null)?buttonFontFace:"" %>"></td>
<td><img src="images/post.gif" width="16" height="17" alt="" border="0"> <font size="-2" face="<%= buttonFontFace %>"><b>按钮字体范例ABCabc123</b></font></td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">题头字体列表:</font></td>
<td><input type="text" size="25" name="headerFontFace" maxlength="100" value="<%= (headerFontFace!=null)?headerFontFace:"" %>"></td>
<td><font size="-2" face="<%= headerFontFace %>"><b>题头范例ABCabc123</b></font></td>
</tr>
</table>
</td></tr>
</table>
</ul>
<font size="-1">
<b>颜色设置</b>
</font>
<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><font size="-1">背景色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (bgColor!=null)?bgColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.bgColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="bgColor" size="10" maxlength="20" value="<%= (bgColor!=null)?bgColor:"" %>"></td>
</tr>
</table>
</td>
<td rowspan="5" align="center" bgcolor="<%= bgColor %>">
<table cellpadding="5" cellspacing="0" border="0" width="200">
<tr><td>
<font size="-1" color="<%= textColor %>"
face="<%= JiveGlobals.getJiveProperty("skin.default.fontFace") %>">
页面文本范例。
<br>
<a href="#" onclick="return false;" class="demo">链接范例</a>
</font>
</td></tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">文本颜色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (textColor!=null)?textColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.textColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="textColor" size="10" maxlength="20" value="<%= (textColor!=null)?textColor:"" %>"></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">链接颜色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (linkColor!=null)?linkColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.linkColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="linkColor" size="10" maxlength="20" value="<%= (linkColor!=null)?linkColor:"" %>"></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">已访问链接颜色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (vLinkColor!=null)?vLinkColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.vLinkColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="vLinkColor" size="10" maxlength="20" value="<%= (vLinkColor!=null)?vLinkColor:"" %>"></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">活动链接颜色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (aLinkColor!=null)?aLinkColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.aLinkColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="aLinkColor" size="10" maxlength="20" value="<%= (aLinkColor!=null)?aLinkColor:"" %>"></td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td><font size="-1">表格边界颜色:</font></td>
<td><table border="0" cellpadding="2" cellspacing="0">
<tr>
<td><table cellpadding="0" cellspacing="1" border="1"
><td bgcolor="<%= (tableBorderColor!=null)?tableBorderColor:"" %>"
><a href="#" onclick="colorPicker(document.skinForm.tableBorderColor);"
><img src="images/blank.gif" width="15" height="15" border="0"></a></td></table>
</td>
<td><input type="text" name="tableBorderColor" size="10" maxlength="20" value="<%= (tableBorderColor!=null)?tableBorderColor:"" %>"></td>
</tr>
</table>
</td>
<td rowspan="7" align="center" bgcolor="<%= bgColor %>">
<table bgcolor="<%= tableBorderColor %>" cellpadding="0" cellspacing="0" border="0" width="">
<tr><td>
<table bgcolor="<%= tableBorderColor %>" cellpadding="3" cellspacing="1" border="0" width="100%">
<tr bgcolor="<%= tableHeaderBgColor %>">
<td><font size="-2" face="<%= headerFontFace %>" color="<%= tableHeaderTextColor %>">
<b>主题</b>
</font>
</td>
</tr>
<tr bgcolor="<%= tableRowColor1 %>">
<td><font size="-1" face="<%= fontFace %>" color="<%= textColor %>">
消息范例一abc...
</font>
</td>
</tr>
<tr bgcolor="<%= tableRowColor2 %>">
<td><font size="-1" face="<%= fontFace %>" color="<%= textColor %>">
消息范例二abc...
</font>
</td>
</tr>
<tr bgcolor="<%= paginatorTableBgColor %>">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -