📄 html_editorax.jsp
字号:
<%@ page language="java" %><%@ page import="org.jahia.data.fields.*" %><%@ page import="org.jahia.params.*" %><%@ 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(); String engineUrl = (String) engineMap.get( "engineUrl" ); String URLSep = (engineUrl.indexOf("?") == -1) ? "?" : "&";%><script type="text/javascript" src="<%=theURL%>/jahiatools/javascript/html_editorax.js"></script><script type="text/javascript" src="<%=theURL%>/jahiatools/javascript/html_editorax_var.js"></script><script type="text/javascript"><% // FIXME : Have these things really something to do here ??? String theOldField = theField.getValue(); String theNewField = ""; String strToRemove[] = {"<jahia", "_htmleditor>", "<html>", "</html>", "<html>", "</html>"}; 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; } }%><!--var TEXT_TOOLBARGIF_TEXT = "<%=theURL%>/jahiatools/images/html_editorax/standard_toolbar.gif";var theOldValue = "";// This is the entry point of the ActiveX editorwindow.onload = loadEditor;function setHiddenValue() { var txt; if (g_state.bMode) { txt = idEditbox.document.body.innerHTML; } else { txt = idEditbox.document.body.innerText; } document.mainForm.elements["_<%=theField.getID()%>"].value = "<HTML>" + txt + "</HTML>";}function changeConnectType() { setHiddenValue(); document.mainForm.submit();}function sendFormSave() { setHiddenValue(); document.mainForm.method = "POST"; document.mainForm.action = "<%=engineUrl%><%=URLSep%>screen=save"; if (check()) { document.mainForm.submit(); }}function sendFormApply(){ setHiddenValue(); document.mainForm.method = "POST"; document.mainForm.action = "<%=engineUrl%><%=URLSep%>screen=apply"; if ( check() ){ document.mainForm.submit(); }}function sendForm() { setHiddenValue(); document.mainForm.method = "POST"; document.mainForm.action = "<%=engineUrl%><%=URLSep%>screen=save"; if (check()) { document.mainForm.submit(); }}function changeField( fieldID ) { setHiddenValue(); document.mainForm.method = "POST"; document.mainForm.action = "<%=engineUrl%><%=URLSep%>screen=edit&fid=" + fieldID; document.mainForm.submit();}function handleActionChange() { setHiddenValue(); var theAction = document.selector.theaction.selectedIndex; document.mainForm.method = "POST"; document.mainForm.action = "<%=engineUrl%>" + "<%=URLSep%>screen=" + document.selector.theaction[theAction].value; document.mainForm.submit();}//--></SCRIPT><STYLE>body {margin:0pt;border:none;padding:0pt}#tbDBSelect {display:none;text-align:left;width: 100;margin-right: 1pt;margin-bottom: 0pt;margin-top: 0pt;padding: 0pt}#DBSelect, #idMode, .userButton {font:8pt arial}#DBSelect {width:100}#idMode {margin-top:0pt}.tbButton {text-align:left;margin:0pt 1pt 0pt 0pt;padding:0pt}#EditBox {position: relative}</STYLE><STYLE ID=skin DISABLED>#EditBox {margin: 8px 0px 0px 0px}#tbUpRight {width:0px}#tbUpLeft {width:0px}#idMode {margin-left:0px;padding:0px}#idMode LABEL {color: navy;text-decoration: underline}#tbTopBar {height:10px}#tbButtons, #tbContents {background: buttonface;vertical-align: top; border: 1px black solid; border-bottom:none; padding:0px}#tbContents2 {background: buttonface;vertical-align: top; border: 1px black solid; border-top:none; padding:2px }#tbBottomBar {height:0px}</STYLE><STYLE ID=defPopupSkin>#popup BODY {margin:0px;border-top:none; background: buttonface}#popup .colorTable {height:90px}#popup #header {width:100%}#popup #close {cursor:default;font:bold 8pt system;width:16px;text-align: center}#popup #content {padding:10pt}#popup TABLE {vertical-align:top}#popup .tabBody {border:1px black solid;border-top: none}#popup .tabItem, #popup .tabSpace {border-bottom:1px black solid;border-left:1px black solid; background: buttonface}#popup .tabItem {border-top:1px black solid;font:11px verdana,geneva,sans-serif; background: #FFFFFF}#popup .currentColor {width:50px;height:90px; margin: 0pt;margin-right:0px;border:1px black solid; background: #FFFFFF}#popup .tabItem DIV {margin:3px;padding:0px;cursor: hand; background: #FFFFFF}#popup .tabItem DIV.disabled {color: gray;cursor: default; background: #FFFFFF}#popup .selected {font-weight:bold}#popup .emoticon {cursor:hand}</STYLE><STYLE ID=popupSkin>#popup BODY {border: 0px #000000 solid; background: buttonface}#popup #header {background: #006699; color: white}#popup #caption {text-align: left;font: bold 12px verdana, arial , geneva, sans-serif}#popup .ColorTable, #popup #idList TD#current {border: 1px black solid}#popup #idList TD{cursor: hand;border: 1px #FFFFFF solid}#popup #close {border: 1px #99CCFF solid;cursor:hand;color: #99CCFF;font-weight: bold;margin-right: 6px}#popup #tableProps .tablePropsTitle {color:#006699;text-align:left;margin:0pt;border-bottom: 1px black solid;margin-bottom:5pt; background: #FFFFFF}#tableButtons, #tableProps {padding:5px; background: #FFFFFF}#popup #tableContents {height:175px; background: #FFFFFF}#popup #tableProps .tablePropsTitle, #popup #tableProps, #popup #tableProps TABLE {font:bold 10px Verdana, Geneva, Sans-serif; background: #FFFFFF}#popup #tableOptions {font:12px Arial, Geneva, Sans-serif;padding:15pt 5pt; background: #FFFFFF}#popup #puDivider {background:black;width:1px}#popup #content {margin: 0pt;padding:10px 10px 10px 10px}#popup #ColorPopup {width: 250px}#popup .ColorTable TR {height:10px}#popup .ColorTable TD {width:10px;cursor:hand}#popup .block P,#popup .block H1,#popup .block H2,#popup .block H3,#popup .block H4, #popup .block H5,#popup .block H6,#popup .block PRE {margin:0pt;padding:0pt}#popup #customFont {font:8pt Arial;text-decoration:italic}#popup .input { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; color: #000000}#popup .link { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; color: #006699;}#popup .link:link { color: #006699; text-decoration: none }#popup .link:visited { color: #006699; text-decoration: none }#popup .link:hover { color: #B42C29; text-decoration: none }</STYLE><img src="<%=theURL%>/jahiatools/images/pix.gif" border="0" width="240" height="1"><a onClick="setMode(!g_state.bMode); if (!g_state.bMode) { document.html.src='<%=theURL%>/jahiatools/images/html_editor/text_off.gif'; document.html.alt='Switch to Edit Mode'; } else { document.html.src='<%=theURL%>/jahiatools/images/html_editor/html_off.gif'; document.html.alt='Switch to HTML Source Code'; }"> <img name="html" alt="Switch to HTML Source Code" width="44" height="16" border="0" align="middle" src="<%=theURL%>/jahiatools/images/html_editor/html_off.gif"></a><DIV ID="idEditor" STYLE="VISIBILITY:hidden"><TABLE ID=idToolbar WIDTH="580" CELLSPACING=0 CELLPADDING=0><TR ID=tbTopBar> <TD ID=tbUpLeft></TD> <TD COLSPAN=2 ID=tbUpMiddle></TD> <TD ID=tbUpRight></TD></TR><TR> <TD ID=tbMidLeft></TD> <TD ID=tbContents><SCRIPT TYPE="TEXT/JAVASCRIPT">loadToolbar();</SCRIPT></TD> <TD ID=tbMidRight></TD></TR><TR> <TD ID=tbMidLeft></TD> <TD ID=tbContents2> <select name="FontBlock" class="input" onChange="util_SelectChange('block');"> <option value="P" selected>Normal</option> <option value="PRE">Formatted</option> </select> <select name="FontName" class="input" onChange="util_SelectChange('font');"> <option value="Arial, Helvetica, sans-serif" selected>Arial, Helvetica, sans-serif</option> <option value="Times New Roman, Times, serif">Times New Roman, Times, serif</option> <option value="Courier New, Courier, mono">Courier New, Courier, mono</option> <option value="Georgia, Times New Roman, Times, serif">Georgia, Times New Roman, Times, serif</option> <option value="Verdana, Arial, Helvetica, sans-serif">Verdana, Arial, Helvetica, sans-serif</option> <option value="Geneva, Arial, Helvetica, san-serif">Geneva, Arial, Helvetica, san-serif</option> </select> <select name="FontSize" class="input" onChange="util_SelectChange('size');"> <option value="1">1</option> <option value="2" selected>2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> </select> </TD> <TD ID=tbMidRight></TD></TR><TR ID=tbBottomBar> <TD ID=tbMidRight></TD> <TD COLSPAN=2 ID=tbMidMiddle></TD> <TD ID=tbMidLeft></TD></TR></TABLE><IFRAME ID="EditBox" NAME="idEditbox" WIDTH="100%" HEIGHT="100%"></IFRAME></DIV><% String hiddenField = org.jahia.utils.JahiaTools.replacePattern(theOldField,"\"",""");%><input type="hidden" name="_<%=theField.getID()%>" value="<HTML><%=hiddenField%></HTML>"><script type="text/javascript"> theOldValue = document.mainForm.elements["_<%=theField.getID()%>"].value; theOldValue.replace("<HTML>",""); theOldValue.replace("</HTML>",""); if (screen.height < 769) { document.body.style.overflowX = "hidden"; document.body.style.overflowY = "hidden"; } document.all.EditBox.style.overflowX = "auto"; document.all.EditBox.style.overflowY = "auto";</script><script type="text/javascript"><!--function check() { return true;}// --></script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -