📄 html_editor.jsp
字号:
<%@ page language="java" %><%@ page import="org.jahia.data.fields.*" %><%@ page import="org.jahia.params.*" %><%@ 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();%><% // 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; } }%><script type="text/javascript" src="<%=theURL%>jahiatools/javascript/dynapi.js"></script><script type="text/javascript" src="<%=theURL%>jahiatools/javascript/html_editor.js"></script><script type="text/javascript"><!--DynAPI.setLibraryPath('<%=theURL%>/jahiatools/javascript/lib/');DynAPI.include('dynapi.api.*');if (!document.layers) { DynAPI.include('dynapi.event.*');}DynAPI.include('dynapi.util.thread.js');DynAPI.include('dynapi.util.pathanim.js');DynAPI.include('dynapi.gui.dynimage.js');DynAPI.include('dynapi.gui.button.js');DynAPI.include('dynapi.gui.scrollbar.js');DynAPI.include('dynapi.gui.viewport.js');DynAPI.include('dynapi.gui.scrollpane.js');DynAPI.include('dynapi.gui.label.js');//--></script><script type="text/javascript"><!--var selectedText = "";var selectedTextFlag = "";var selectedColor = "#000000";var Undo = "";var Redo = "";var ViewColorBG;var ViewColorPick;var ViewHTMLBG;var ViewHTML;var scrollobj;DynAPI.onLoad = function() { MM_preloadImages('<%=theURL%>/jahiatools/images/html_editor/link_on.gif'); if (!document.layers && parseInt(navigator.appVersion) != 5) { ViewColorBG = new DynLayer(null, 329 + offsetLayerX, 207 + offsetLayerY, 67, 67, '#000000'); ViewColorPick = new DynLayer(null,330 + offsetLayerX, 208 + offsetLayerY, 65, 65, '#000000'); ViewHTMLBG = new DynLayer(null, 24 + offsetLayerX, 542 + offsetLayerY, 582, 152, '#000000'); ViewHTML = new Label('<img src="<%=theURL%>/jahiatools/images/pix.gif" border="0" width="404" height="2000">'); ViewHTML.setWrap(true); ViewHTML.setWidth(404); ViewHTML.packHeight(); ViewHTML.setBgColor('#FFFFFF'); scrollobj = new ScrollPane(ViewHTML); scrollobj.setSize(580, 150); scrollobj.moveTo(25 + offsetLayerX, 543 + offsetLayerY); scrollobj.setBgColor('#FFFFFF'); DynAPI.document.addChild(ViewColorBG); DynAPI.document.addChild(ViewColorPick); DynAPI.document.addChild(ViewHTMLBG); DynAPI.document.addChild(scrollobj); } else if (parseInt(navigator.appVersion) == 5) { ViewColorBG = new DynLayer(null, 330 + offsetLayerX, 207 + offsetLayerY, 67, 67, '#000000'); ViewColorPick = new DynLayer(null, 331 + offsetLayerX, 208 + offsetLayerY, 65, 65, '#000000'); ViewHTMLBG = new DynLayer(null, 24 + offsetLayerX, 544 + offsetLayerY, 587, 152, '#000000'); ViewHTML = new DynLayer(null, 25 + offsetLayerX, 545 + offsetLayerY, 585, 150, '#FFFFFF'); DynAPI.document.addChild(ViewColorBG); DynAPI.document.addChild(ViewColorPick); DynAPI.document.addChild(ViewHTMLBG); DynAPI.document.addChild(ViewHTML); } else { // FIXME : For which browser is this code relevant ? Opera ? ViewColorBG = new DynLayer(null, 481 + offsetLayerX, 236 + offsetLayerY, 67, 67, '#000000'); ViewColorPick = new DynLayer(null, 482 + offsetLayerX, 237 + offsetLayerY, 65, 65, '#000000'); ViewHTMLBG = new DynLayer(null, 181 + offsetLayerX, 561 + offsetLayerY, 422, 152, '#000000'); ViewHTML = new DynLayer(null, 182 + offsetLayerX, 562 + offsetLayerY, 420, 150, '#FFFFFF'); DynAPI.document.addChild(ViewColorBG); DynAPI.document.addChild(ViewColorPick); DynAPI.document.addChild(ViewHTMLBG); DynAPI.document.addChild(ViewHTML); } displayHTML(document.mainForm.Text1.value); document.mainForm.Text1.focus(); if (document.all) { document.mainForm.Text1.onmouseup = getActiveText; } else { document.captureEvents(Event.MOUSEUP); }}function restoreImages(imageName) { eval('document.' + imageName + '.src=\"<%=theURL%>/jahiatools/images/html_editor/' + imageName + '_off.gif\";');}function setHiddenValue(txt) {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -