⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menu.jsp

📁 HomePlayer is an extention of the FreePlayer software provided by the french internet provider Free
💻 JSP
字号:
<%@page import="org.homeplayer.web.*"%>
<%@page import="org.homeplayer.util.StringUtil" %>
<%@page import="java.util.*" %>
<jsp:useBean id="hppc" class="org.homeplayer.web.HPPageContext" scope="request"/>
<%
// find thre previous link
HPMenuPrevious previousLink = null;
for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
	HPMenuItem item = (HPMenuItem) it.next();
	if (item.getType() == HPMenuItem.PREVIOUS) {
		previousLink = (HPMenuPrevious) item;
	}
}
// if no focus set, set the focus to the first link of the list
if (! hppc.isFocusSetOnPage()) {
	boolean focusOnLink = false;
	for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
		HPMenuItem item = (HPMenuItem) it.next();
		if (item.getType() == HPMenuItem.LINK) {
			if (((HPMenuLink) item).isFocused()) {
				focusOnLink = true;
				break;
			}
		}
	}
	if (! focusOnLink) {
		for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
			HPMenuItem item = (HPMenuItem) it.next();
			if (item.getType() == HPMenuItem.LINK) {
				((HPMenuLink) item).setFocused(true);
				break;
			}
		}
	}
}
%>
<table border=0 cellspacing="0" cellpadding="0" width="100%">
	<tr>
		<td align="center" bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" height="25" colspan="3">
			<table border=0 cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td height="25" width="25" align="center" valign="bottom">
					<% if (previousLink != null) { %>
		                 <a href="<%= previousLink.getUrl() %>" onfocus="<%= previousLink.getUrl() %>">
		                  	<font family="Symbol" size="+2">V</font>
		                 </a>
					<% } else { %>
						&nbsp;
					<% } %>
					</td>
					<td valign="bottom">
						<font color="<%= hppc.color(hppc.getSkin().getProp("headerTextColor"))%>" size="+1">
							<%= hppc.getMenuTitle() %>
						</font>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" width="5"></td>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" height="440" valign="top">
			<img width="1" height="10" src="/images/blanck.gif">
	<% 
	for (Iterator it = hppc.getMenuItems().iterator(); it.hasNext();) {
		HPMenuItem item = (HPMenuItem) it.next();
		
		if (item.getType() == HPMenuItem.SEPARATOR) {
	%>
					<table border="0" cellpadding="0" cellspacing="0" width="100%">
						<tr><td height=5><img width="1" height="1" src="/images/blanck.gif"></td></tr>
						<tr><td height=2 bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" ><img width="1" height="1" src="/images/blanck.gif"></td></tr>
						<tr><td height=5><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
	<%
		} else if (item.getType() == HPMenuItem.TITLE) {
			HPMenuTitle title = (HPMenuTitle) item;
	%>
                  <%= title.getName() %><br>
	<%
		} else {
			HPMenuLink link = (HPMenuLink) item;
			if (link.getType() == HPMenuItem.NEXT) {
	%>
					<table bgcolor="<%= hppc.color(hppc.getSkin().getProp("headerColor")) %>" border="0" cellpadding="0" cellspacing="0" width="100%">
						<tr><td height=2><img width="1" height="1" src="/images/blanck.gif"></td></tr>
					</table>
                  <a href="<%= link.getUrl() %>" onfocus="<%= link.getUrl() %>">
					<% if (link.getIcone() != null) { %>
						<%= link.getIcone() %>
					<% } else { %>
                   		<font family="Symbol" size="+2">U</font>
					<% } %>
                  </a><br>
	<% 	} else if (link.getType() == HPMenuItem.PREVIOUS) {
			continue;
		} else { /* link */ 
  	   			String titleItem = link.getName();
  	   			String label;
  	   			if ( link.isAlreadyFitToWidth() ) {
  	   				label = titleItem;
  	   			} else {
  					String titleWithoutHtml = StringUtil.removeHTMLCode(titleItem);
  					String labelWithoutHtml =  titleWithoutHtml.length()>50 ? (titleWithoutHtml.substring(0,50)+"...") : titleWithoutHtml; 
  					label = titleItem.substring(0, titleItem.indexOf(titleWithoutHtml)) + labelWithoutHtml + titleItem.substring(titleItem.indexOf(titleWithoutHtml) + titleWithoutHtml.length());
  	   			}
  	  %>
					<table bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" abgcolor="#E8D934F3" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td height=22>
                  <a href="<%= link.getUrl() %>" 
                  	<% if (link.isActivateOnFocus()) {%> onfocus="<%= link.getUrl() %>"<% } %>
                  	<% if (link.isFocused()) {%> focused<% } %>
                  >
                  <table <% if (hppc.isFreeBox()) { %>border=1<% } %> bordercolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" cellpadding="2" cellspacing="0" bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" abgcolor="<%= hppc.color(hppc.getSkin().getProp("bgSelectColor")) %>">
                  	<tr>
                  		<td >
                  <a href="<%= link.getUrl() %>" 
                  	<% if (link.isActivateOnFocus()) {%> onfocus="<%= link.getUrl() %>"<% } %>
                  	<% if (link.isFocused()) {%> focused<% } %>
                  >
							<% if (link.getIcone() != null) { %>
								<%= link.getIcone() %>
							<% } %>
							<%= label %>
							</a>
				</td></tr></table>
                  </a>
							</td>
						</tr>
					</table>
	<%		}
		}
	} 
	%>
	<% if (hppc.getMenuInfo() != null) { %>
		<hr size=1>
		<%= hppc.getMenuInfo() %></td>
	<% } %>
		<img width="1" height="1" src="/images/blanck.gif">
		</td>
		<td bgcolor="<%= hppc.color(hppc.getSkin().getProp("bodyColor")) %>" width="5"></td>
	</tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -