📄 bigtext_field.jsp
字号:
<%@ page language="java" %><%@ page import="org.jahia.data.*" %><%@ page import="org.jahia.data.fields.*" %><%@ page import="org.jahia.params.*" %><%@ page import="org.jahia.services.*" %><%@ page import="org.jahia.utils.*" %><%@ page import="java.util.*" %><% HashMap engineMap = (HashMap) request.getAttribute( "org.jahia.engines.EngineHashMap" ); JahiaField theField = (JahiaField) engineMap.get( "theField" ); ParamBean jParams = (ParamBean) engineMap.get( "jParams" ); String theURL = (String) jParams.settings().getJahiaEnginesHttpPath(); Boolean isSelectedField = (Boolean) engineMap.get( "isSelectedField" ); boolean isNS = false; String userAgent = request.getHeader( "user-agent" ); if (userAgent != null) { if (userAgent.indexOf( "MSIE" ) == -1) { isNS = true; } } int connectType = theField.getConnectType(); if (isNS && connectType == ConnectionTypes.HTMLEDITORAX) { connectType = ConnectionTypes.HTMLEDITOR; } if (userAgent.toUpperCase().indexOf("MAC") != -1 && connectType == ConnectionTypes.HTMLEDITORAX) { connectType = ConnectionTypes.LOCAL; } if (theField.getValue().toUpperCase().indexOf("JAHIA_HTMLEDITOR") != -1) { if (isNS) { connectType = ConnectionTypes.HTMLEDITOR; } else { connectType = ConnectionTypes.HTMLEDITORAX; } if (userAgent.toUpperCase().indexOf("MAC") != -1) { connectType = ConnectionTypes.LOCAL; } } String requestConnectType = request.getParameter("connectType"); if (requestConnectType != null ) { connectType = Integer.parseInt(requestConnectType); theField.setConnectType(connectType); String theNewFieldValue = request.getParameter("_" + theField.getID()); /* if (theNewFieldValue != null) { theField.setValue(theNewFieldValue); } */ }%><span class="input"><select name="connectType" class="input" onChange="changeConnectType();"> <option value="<%=ConnectionTypes.LOCAL%>" <% if (connectType == ConnectionTypes.LOCAL) { %> selected<% }%>> Simple Text </option> <% if ((userAgent.toUpperCase().indexOf("MAC") == -1) && (userAgent.toUpperCase().indexOf("OPERA") == -1)) { %> <option value="<%=ConnectionTypes.HTMLEDITOR%>" <% if (connectType == ConnectionTypes.HTMLEDITOR) { %> selected<% } %>> HTML Editor<% if (!isNS) { %> (Standard)<% } %> </option> <% } %> <% if ((!isNS && userAgent.toUpperCase().indexOf("MAC") == -1) && (userAgent.toUpperCase().indexOf("OPERA") == -1)) { %> <option value="<%=ConnectionTypes.HTMLEDITORAX%>" <% if (connectType == ConnectionTypes.HTMLEDITORAX) { %> selected<% } %>> HTML Editor (ActiveX) </option> <% } %></select></span><% if (connectType == ConnectionTypes.LOCAL) { %><% String theOldField = theField.getValue(); String theNewField = ""; String strToRemove[] = {"<jahia", "_htmleditor>", "<empty>"}; for (int i = 0; i < strToRemove.length; i++) { String lowerCaseField = theOldField.toLowerCase(); int index = lowerCaseField.indexOf(strToRemove[i]); if (index != -1) { theNewField = theOldField.substring(0, index) + theOldField.substring(index + strToRemove[i].length(), theOldField.length()); theOldField = theNewField; } }%><SCRIPT type="text/javascript"><!--function changeConnectType() { document.mainForm.submit();}//--></SCRIPT> : <br><br><TextArea class="fontfix1" name="_<%=theField.getID()%>" cols="80" rows="32" wrap="soft"><%=theOldField%></TextArea><br><br><% if (isSelectedField.booleanValue()){%> <SCRIPT type="text/javascript"> <!-- function setfocus() { document.mainForm.elements["_<%=theField.getID()%>"].focus(); } // --> </SCRIPT><% } %><% } %><% if (connectType == ConnectionTypes.HTMLEDITOR) { %><jsp:include page="html_editor.jsp" flush="true"/><% } %><% if (connectType == ConnectionTypes.HTMLEDITORAX) { %><jsp:include page="html_editorax.jsp" flush="true"/><% } %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -