📄 de_functions.js
字号:
}
foo.focus();
}
}
function doVideoInsert()
{
if (isAllowed())
{
var NodeID= parent.NodeID;
var sId = parent.sId;
var info = parent.showMeDialog("admin_select.php?sId="+ sId +"&o=psn_picker&psn=","color","dialogWidth:600px;dialogHeight:266px;help:0;status:0;scroll:no");
if (info['filename'] != null && info['filename'] != '') {
var cd= info['URL'] + info['filename'];
cd = "<EMBED src=\" " + cd + "\" width=300 height=250 type=application/x-mplayer2 showdisplay=\"0\" showstatusbar=\"1\" showcontrols=\"1\" enablepositioncontrols=\"true\" clicktoplay=\"true\" enablecontextmenu=\"true\" autostart=\"0\" > </EMBED>";
var sel
sel = foo.document.selection.createRange();
sel.pasteHTML( cd );
sel.select();
}
foo.focus();
}
}
function doMusicInsert()
{
if (isAllowed())
{
var NodeID= parent.NodeID;
var sId = parent.sId;
var info = parent.showMeDialog("admin_select.php?sId="+ sId +"&o=psn_picker&psn=","color","dialogWidth:600px;dialogHeight:266px;help:0;status:0;scroll:no");
if (info['filename'] != null && info['filename'] != '') {
var cd= info['URL'] + info['filename'];
cd = "<EMBED src=\" " + cd + "\" width=300 height=68 type=application/x-mplayer2 showdisplay=\"0\" showstatusbar=\"1\" showcontrols=\"1\" enablepositioncontrols=\"true\" clicktoplay=\"true\" enablecontextmenu=\"true\" autostart=\"0\" loop=\"1\"> </EMBED>";
var sel
sel = foo.document.selection.createRange();
sel.pasteHTML( cd );
sel.select();
}
foo.focus();
}
}
/*
*圖片列表
*
**/
function doImagesList() {
if (isAllowed())
{
var NodeID= parent.NodeID;
var sId = parent.sId;
//imageWin = window.open(HTTPStr + '://' + URL + '/icms/publish/de/upload.php?o=display&mode=single&type=img&cId=' + cId,'','width=530,height=480,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
cd=parent.showMeDialog(HTTPStr + '://' + URL + AdminPath + '/upload.php?sId='+ sId +'&o=display&mode=single&type=img&NodeID=' + NodeID,"color","dialogWidth:490pxt;dialogHeight:470px;help:0;status:0;scroll:0");
if (cd!="" ) {
var sel
sel = foo.document.selection.createRange();
sel.pasteHTML( cd );
sel.select();
}
foo.focus();
}
}
//
function doIncludeImages() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-300) / 2
propWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=IncludeImages&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=300,scrollbars=no,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
var flashEdit = false
function doFlash() {
if (isAllowed())
{
if (isFlashSelected()) {
flashEdit = true
} else {
flashEdit = false
}
var leftPos = (screen.availWidth-770) / 2
var topPos = (screen.availHeight-660) / 2
imageWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertFlash&DEP1='+deveditPath1+'&DEP='+deveditPath +'&flashDir=' + flashDir + '&wi=' + HideWebFlash + '&tn=' + showFlashThumbnails + '&du=' + disableFlashUploading + '&dd=' + disableFlashDeleting + '&dt=' + isEditingHTMLPage,'','width=755,height=630,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function ModifyProperties() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-410) / 2
propWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=PageProperties&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=410,scrollbars=no,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function ShowInsertTable() {
if (isAllowed())
{
var leftPos = (screen.availWidth-450) / 2
var topPos = (screen.availHeight-295) / 2
inserttableWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertTable&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=450,height=293,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function ModifyTable() {
if (isAllowed())
{
if (isTableSelected() || isCursorInTableCell()) {
var leftPos = (screen.availWidth-450) / 2
var topPos = (screen.availHeight-293) / 2
modifytableWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyTable&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=450,height=262,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function ModifyCell() {
if (isAllowed())
{
if (isCursorInTableCell()) {
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-230) / 2
modifytableWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyCell&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=234,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function modifyForm() {
if (isAllowed)
{
if (isCursorInForm()) {
var leftPos = (screen.availWidth-500) / 2
var topPos = (screen.availHeight-300) / 2
modifyFormWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyForm&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=223,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function insertForm() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-223) / 2
insertFormWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertForm&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=223,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function doCustomInserts() {
if (isAllowed())
{
var leftPos = (screen.availWidth-450) / 2
var topPos = (screen.availHeight-297) / 2
customInsertWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=CustomInsert&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=450,height=297,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function doChars() {
if (isAllowed())
{
var leftPos = (screen.availWidth-420) / 2
var topPos = (screen.availHeight-400) / 2
charWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=Chars&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=420,height=400,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function doAnchor() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-162) / 2
if ((foo.document.selection.type == "Control") && (foo.document.selection.createRange()(0).tagName == "A") && (foo.document.selection.createRange()(0).href == ""))
{
anchorWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyAnchor&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=162,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
} else {
anchorWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertAnchor&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=162,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doEmail() {
if (isAllowed())
{
if (isSelection()) {
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-223) / 2
emailWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertEmail&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=223,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
} else
return
}
}
popupColorWin = HTTPStr + '://' + URL + ScriptName + '?ToDo=MoreColors&DEP1='+deveditPath1+'&DEP='+deveditPath
function doMoreColors() {
var leftPos = (screen.availWidth-420) / 2
var topPos = (screen.availHeight-400) / 2
colorWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=MoreColors&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=420,height=370,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function ShowFindDialog() {
if (isAllowed())
{
showModelessDialog(HTTPStr + "://" + URL + ScriptName + "?ToDo=FindReplace&DEP1='+deveditPath1+'&DEP="+deveditPath, foo, "dialogWidth:385px; dialogHeight:165px; scroll:no; status:no; help:no;" );
}
}
function spellCheck(){
var leftPos = (screen.availWidth-300) / 2
var topPos = (screen.availHeight-220) / 2
arr = getWords();
rng = getRange();
spellcheckWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=SpellCheck&DEP1='+deveditPath1+'&DEP='+deveditPath, "spellwin", "width=300,height=220,scrollbars=no, top=" + topPos + ",left=" + leftPos);
}
function doHelp() {
var leftPos = (screen.availWidth-500) / 2
var topPos = (screen.availHeight-400) / 2
showHelpWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ShowHelp&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=500,height=400,scrollbars=yes,resizable=yes,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
function doTextField() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-230) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "INPUT") {
if ((oControlRange(0).type.toUpperCase() == "TEXT") || (oControlRange(0).type.toUpperCase() == "PASSWORD")) {
selectedTextField = foo.document.selection.createRange()(0);
textFieldWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyTextField&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=230,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
return true;
}
} else {
textFieldWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertTextField&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=230,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doHidden() {
if (isAllowed())
{
var leftPos = (screen.availWidth-350) / 2
var topPos = (screen.availHeight-192) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "INPUT") {
if (oControlRange(0).type.toUpperCase() == "HIDDEN") {
selectedHidden = foo.document.selection.createRange()(0);
hiddenWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyHidden&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=350,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
return true;
}
} else {
hiddenWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertHidden&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=350,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doTextArea() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-230) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "TEXTAREA") {
selectedTextArea = foo.document.selection.createRange()(0);
textFieldWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyTextArea&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=230,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
return true;
}
} else {
textFieldWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertTextArea&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=230,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doButton() {
if (isAllowed())
{
var leftPos = (screen.availWidth-500) / 2
var topPos = (screen.availHeight-300) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "INPUT") {
if ((oControlRange(0).type.toUpperCase() == "RESET") || (oControlRange(0).type.toUpperCase() == "SUBMIT") || (oControlRange(0).type.toUpperCase() == "BUTTON")) {
selectedButton = foo.document.selection.createRange()(0);
buttonWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyButton&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
return true;
}
} else {
buttonWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertButton&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doCheckbox() {
if (isAllowed())
{
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-192) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "INPUT") {
if (oControlRange(0).type.toUpperCase() == "CHECKBOX") {
selectedCheckbox = foo.document.selection.createRange()(0);
checkboxWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyCheckbox&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
return true;
}
} else {
checkboxWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertCheckbox&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function doSelect()
{
var leftPos = (screen.availWidth-520) / 2
var topPos = (screen.availHeight-340) / 2
if (foo.document.selection.type == "Control")
{
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "SELECT")
{
selectedSelectBox = foo.document.selection.createRange()(0);
selectBoxWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifySelect&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=520,height=340,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
return true;
}
}
else
{
selectBoxWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertSelect&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=520,height=340,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
function doRadio() {
if (isAllowed()) {
var leftPos = (screen.availWidth-400) / 2
var topPos = (screen.availHeight-192) / 2
if (foo.document.selection.type == "Control") {
var oControlRange = foo.document.selection.createRange();
if (oControlRange(0).tagName.toUpperCase() == "INPUT") {
if (oControlRange(0).type.toUpperCase() == "RADIO") {
selectedRadio = foo.document.selection.createRange()(0);
radioWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=ModifyRadio&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
return true;
}
} else {
radioWin = window.open(HTTPStr + '://' + URL + ScriptName + '?ToDo=InsertRadio&DEP1='+deveditPath1+'&DEP='+deveditPath,'','width=400,height=192,scrollbars=no,resizable=no,titlebar=0,top=' + topPos + ',left=' + leftPos);
}
}
}
function cleanCode() {
if (confirm(sTxtClean)){
var borderwason
if (borderShown == "yes") {
toggleBorders()
borderwason = true
}
//foo.document.write(doCleanCode(foo.document.body.innerHTML));
foo.document.body.innerHTML = doCleanCode(foo.document.body.innerHTML)
foo.document.close()
if (borderwason) {
toggleBorders()
}
}
}
// Colorize Code in Source Mode
function colourCode(code) {
htmlTag = /(<([\s\S]*?)>)/gi
tableTag = /(<(table|tbody|th|tr|td|\/table|\/tbody|\/th|\/tr|\/td)([\s\S]*?)>)/gi
commentTag = /(<!--([\s\S]*?)>)/gi
imageTag = /(<img([\s\S]*?)>)/gi
objectTag = /(<(object|\/object)([\s\S]*?)>)/gi
linkTag = /(<(a|\/a)([\s\S]*?)>)/gi
scriptTag = /(<(script|\/script)([\s\S]*?)>)/gi
code = code.replace(htmlTag,"<font color=#000080>$1</font>")
code = code.replace(tableTag,"<font color=#008080>$1</font>")
code = code.replace(commentTag,"<font color=#808080>$1</font>")
code = code.replace(imageTag,"<font color=#800080>$1</font>")
code = code.replace(objectTag,"<font color=#840000>$1</font>")
code = code.replace(linkTag,"<font color=#008000>$1</font>")
code = code.replace(scriptTag,"<font color=#800000>$1</font>")
return code;
}
foo.document.designMode="On";
foo.document.open();
foo.document.close();
foo.focus();
// End colorize
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -