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

📄 editor.js

📁 很经典的Blog程序,呵呵
💻 JS
📖 第 1 页 / 共 5 页
字号:
                break;
            case "Strikethrough":
                if(this.btnStrikethrough)sHTMLIcons+=this.writeIconToggle("btnStrikethrough"+this.oName,this.oName+".doCmd('Strikethrough')","btnStrikethrough.gif",getTxt("Strikethrough"));
                break;
            case "Superscript":
                if(this.btnSuperscript)sHTMLIcons+=this.writeIconToggle("btnSuperscript"+this.oName,this.oName+".doCmd('Superscript')","btnSuperscript.gif",getTxt("Superscript"));
                break;
            case "Subscript":
                if(this.btnSubscript)sHTMLIcons+=this.writeIconToggle("btnSubscript"+this.oName,this.oName+".doCmd('Subscript')","btnSubscript.gif",getTxt("Subscript"));
                break;
            case "JustifyLeft":
                if(this.btnJustifyLeft)sHTMLIcons+=this.writeIconToggle("btnJustifyLeft"+this.oName,this.oName+".applyJustifyLeft()","btnLeft.gif",getTxt("Justify Left"));
                break;
            case "JustifyCenter":
                if(this.btnJustifyCenter)sHTMLIcons+=this.writeIconToggle("btnJustifyCenter"+this.oName,this.oName+".applyJustifyCenter()","btnCenter.gif",getTxt("Justify Center"));
                break;
            case "JustifyRight":
                if(this.btnJustifyRight)sHTMLIcons+=this.writeIconToggle("btnJustifyRight"+this.oName,this.oName+".applyJustifyRight()","btnRight.gif",getTxt("Justify Right"));
                break;
            case "JustifyFull":
                if(this.btnJustifyFull)sHTMLIcons+=this.writeIconToggle("btnJustifyFull"+this.oName,this.oName+".applyJustifyFull()","btnFull.gif",getTxt("Justify Full"));
                break;
            case "Numbering":
                if(this.btnNumbering)sHTMLIcons+=this.writeIconToggle("btnNumbering"+this.oName,this.oName+".applyNumbering()","btnNumber.gif",getTxt("Numbering"));
                break;
            case "Bullets":
                if(this.btnBullets)sHTMLIcons+=this.writeIconToggle("btnBullets"+this.oName,this.oName+".applyBullets()","btnList.gif",getTxt("Bullets"));
                break;
            case "Indent":
                if(this.btnIndent)sHTMLIcons+=this.writeIconStandard("btnIndent"+this.oName,this.oName+".doCmd('Indent')","btnIndent.gif",getTxt("Indent"));
                break;
            case "Outdent":
                if(this.btnOutdent)sHTMLIcons+=this.writeIconStandard("btnOutdent"+this.oName,this.oName+".doCmd('Outdent')","btnOutdent.gif",getTxt("Outdent"));
                break;
            case "LTR":
                if(this.btnLTR)sHTMLIcons+=this.writeIconToggle("btnLTR"+this.oName,this.oName+".applyBlockDirLTR()","btnLTR.gif",getTxt("Left To Right"));
                break;
            case "RTL":
                if(this.btnRTL)sHTMLIcons+=this.writeIconToggle("btnRTL"+this.oName,this.oName+".applyBlockDirRTL()","btnRTL.gif",getTxt("Right To Left"));
                break;
            case "ForeColor":
                if(this.btnForeColor)sHTMLIcons+=this.writeIconStandard("btnForeColor"+this.oName,this.oName+".expandSelection();"+this.oName+".oColor1.show(this)","btnForeColor.gif",getTxt("Foreground Color"));
                break;
            case "BackColor":
                if(this.btnBackColor)sHTMLIcons+=this.writeIconStandard("btnBackColor"+this.oName,this.oName+".expandSelection();"+this.oName+".oColor2.show(this)","btnBackColor.gif",getTxt("Background Color"));
                break;
            case "Bookmark":
                if(this.btnBookmark)sHTMLIcons+=this.writeIconStandard("btnBookmark"+this.oName,"modelessDialogShow('"+this.scriptPath+"bookmark.htm',245,170)","btnBookmark.gif",getTxt("Bookmark"));
                break;
            case "Hyperlink":
                if(this.btnHyperlink)sHTMLIcons+=this.writeIconStandard("btnHyperlink"+this.oName,"modelessDialogShow('"+this.scriptPath+"hyperlink.htm',420,150)","btnHyperlink.gif",getTxt("Hyperlink"));
                break;
            case "CustomTag":
                if(this.btnCustomTag)
                    {
                    sHTMLDropMenus+="<table id=dropCustomTag"+this.oName+" cellpadding=0 cellspacing=0 "+
                        "style='line-height:normal;z-index:1;display:none;position:absolute;border:#80788D 1px solid;"+
                        "cursor:default;background-color:#fbfbfd;' unselectable=on><tr><td valign=top style='padding:0px;'>";

                    //~~~~ up to 120 tags
                    sHTMLDropMenus+="<table cellpadding=0 cellspacing=0>";
                    for(var j=0;j<this.arrCustomTag.length;j++)
                        {
                        sHTMLDropMenus+="<tr><td onclick=\""+this.oName+".insertCustomTag("+j+")\" "+
                            "style=\"padding:1px;padding-left:5px;padding-right:5px;font-family:tahoma;font-size:11px;color:black;\" "+
                            "onmouseover=\"this.style.backgroundColor='#708090';this.style.color='#FFFFFF';\" "+
                            "onmouseout=\"this.style.backgroundColor='';this.style.color='#000000';\" unselectable=on align=center>"+
                            this.arrCustomTag[j][0]+"</td></tr>";

                        if(j==14||j==29||j==44||j==59||j==74||j==89||j==104)
                            {
                            if(j!=this.arrCustomTag.length-1)
                                {
                                sHTMLDropMenus+="</table>";
                                sHTMLDropMenus+="</td><td valign=top style='padding:0px;border-left:#80788D 1px solid'>";//main
                                sHTMLDropMenus+="<table cellpadding=0 cellspacing=0>";
                                }
                            }
                        }
                    sHTMLDropMenus+="</table>";
                    //~~~~

                    sHTMLDropMenus+="</td></tr></table>";
                    sHTMLIcons+=this.writeDropDown("btnCustomTag"+this.oName,this.oName+".dropShow(this,'dropCustomTag"+this.oName+"')","btnCustomTag.gif",getTxt("Tags"),60);
                    }
                break;
            case "Image":
                if(this.btnImage)sHTMLIcons+=this.writeIconStandard("btnImage"+this.oName,"modelessDialogShow('"+this.scriptPath+"image.htm',440,305)","btnImage.gif",getTxt("Image"));
                break;
            case "Flash":
                if(this.btnFlash)sHTMLIcons+=this.writeIconStandard("btnFlash"+this.oName,"modelessDialogShow('"+this.scriptPath+"flash.htm',410,205)","btnFlash.gif",getTxt("Flash"));
                break;
            case "Media":
                if(this.btnMedia)sHTMLIcons+=this.writeIconStandard("btnMediah"+this.oName,"modelessDialogShow('"+this.scriptPath+"media.htm',420,232)","btnMedia.gif",getTxt("Media"));
                break;
            case "ContentBlock":
                if(this.btnContentBlock)sHTMLIcons+=this.writeIconStandard("btnContentBlock"+this.oName,this.cmdContentBlock,"btnContentBlock.gif",getTxt("Content Block"));
                break;
            case "InternalLink":
                if(this.btnInternalLink)sHTMLIcons+=this.writeIconStandard("btnInternalLink"+this.oName,this.cmdInternalLink,"btnInternalLink.gif",getTxt("Internal Link"));
                break;
			case "InternalImage":
				if(this.btnInternalImage)sHTMLIcons+=this.writeIconStandard("btnInternalImage"+this.oName,this.cmdInternalImage,"btnInternalImage.gif",getTxt("Internal Image"));
				break;
            case "CustomObject":
                if(this.btnCustomObject)sHTMLIcons+=this.writeIconStandard("btnCustomObject"+this.oName,this.cmdCustomObject,"btnCustomObject.gif",getTxt("Object"));
                break;
            case "Table":
                if(this.btnTable)
                    {
                    sHTMLDropMenus+="<table id=dropTable"+this.oName+" cellpadding=0 cellspacing=0 "+
                        "style='line-height:normal;z-index:1;display:none;position:absolute;border:#80788D 1px solid;"+
                        "cursor:default;background-color:#fbfbfd;' unselectable=on>"+
                        "<tr><td id=\"mnuTableSize"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_size.htm',240,212);"+
                        "   document.getElementById('dropTable"+this.oName+"').style.display='none'}\""+
                        "   style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
                        "   onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
                        "   onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getTxt("Table Size")+" </td></tr>"+
                        "<tr><td id=\"mnuTableEdit"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_edit.htm',358,315);"+
                        "   document.getElementById('dropTable"+this.oName+"').style.display='none'}\""+
                        "   style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
                        "   onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
                        "   onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getTxt("Edit Table")+" </td></tr>"+
                        "<tr><td id=\"mnuCellEdit"+this.oName+"\" onclick=\"if(this.style.color!='gray'){modelessDialogShow('"+this.scriptPath+"table_editCell.htm',427,380);"+
                        "   document.getElementById('dropTable"+this.oName+"').style.display='none'}\""+
                        "   style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black\""+
                        "   onmouseover=\"if(this.style.color!='gray'){this.style.backgroundColor='#708090';this.style.color='#FFFFFF';}\""+
                        "   onmouseout=\"if(this.style.color!='gray'){this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on>"+getTxt("Edit Cell")+" </td></tr>"+
                        "</table>";

                    sHTMLDropMenus+="<table width=175 id=dropTableCreate"+this.oName+" onmouseout='//doOut_TabCreate(this);event.cancelBubble=true;' style='position:absolute;display:none;cursor:default;background:#f3f3f8;border:#d3d3d3 1px solid;' cellpadding=0 cellspacing=1 unselectable=on>";
                    for(var m=0;m<8;m++)
                        {
                        sHTMLDropMenus+="<tr>";
                        for(var n=0;n<8;n++)
                            {
                            sHTMLDropMenus+="<td onclick='"+this.oName+".doClick_TabCreate(this)' onmouseover='doOver_TabCreate(this);event.cancelBubble=true;' style='background:#ffffff;font-size:1px;border:#d3d3d3 1px solid;width:20px;height:20px;' unselectable=on>&nbsp;</td>";
                            }
                        sHTMLDropMenus+="</tr>";
                        }
                    sHTMLDropMenus+="<tr><td colspan=8 onclick=\""+this.oName+".hide();modelessDialogShow('"+this.scriptPath+"table_insert.htm',380,270);\" onmouseover=\"doOut_TabCreate(document.getElementById('dropTableCreate"+this.oName+"'));this.innerHTML='"+getTxt("Advanced Table Insert")+"';this.style.border='#777777 1px solid';this.style.backgroundColor='#8d9aa7';this.style.color='#ffffff'\" onmouseout=\"this.style.border='#f3f3f8 1px solid';this.style.backgroundColor='#f3f3f8';this.style.color='#000000'\" align=center style='font-family:verdana;font-size:10px;font-color:black;border:#f3f3f8 1px solid;padding:1px 1px 1px 1px' unselectable=on>"+getTxt("Advanced Table Insert")+"</td></tr>";
                    sHTMLDropMenus+="</table>";
                    
                    sHTMLIcons+=this.writeIconStandard("btnTable"+this.oName,this.oName+".dropShow(this, 'dropTableCreate"+this.oName+"')","btnTable.gif",getTxt("Insert Table"));
                    sHTMLIcons+=this.writeIconStandard("btnTableEdit"+this.oName,this.oName+".dropShow(this, 'dropTable"+this.oName+"')","btnTableEdit.gif",getTxt("Edit Table/Cell"));
                    }
                break;
            case "Absolute":
                if(this.btnAbsolute)sHTMLIcons+=this.writeIconStandard("btnAbsolute"+this.oName,this.oName+".makeAbsolute()","btnAbsolute.gif",getTxt("Absolute"));
                break;
            case "Characters":
                if(this.btnCharacters)sHTMLIcons+=this.writeIconStandard("btnCharacters"+this.oName,"modelessDialogShow('"+this.scriptPath+"characters.htm',520,150)","btnSymbol.gif",getTxt("Special Characters"));
                break;
            case "Line":
                if(this.btnLine)sHTMLIcons+=this.writeIconStandard("btnLine"+this.oName,this.oName+".doCmd('InsertHorizontalRule')","btnLine.gif",getTxt("Line"));
                break;
            case "Form":
                if(this.btnForm)
                    {
                    var arrFormMenu = [[getTxt("Form"),"form_form.htm","280","150"],
                                    [getTxt("Text Field"),"form_text.htm","285","239"],
                                    [getTxt("List"),"form_list.htm","295","272"],
                                    [getTxt("Checkbox"),"form_check.htm","235","150"],
                                    [getTxt("Radio Button"),"form_radio.htm","235","150"],
                                    [getTxt("Hidden Field"),"form_hidden.htm","235","150"],
                                    [getTxt("File Field"),"form_file.htm","235","150"],
                                    [getTxt("Button"),"form_button.htm","235","150"]];
                    sHTMLIcons+=this.writeIconStandard("btnForm"+this.oName,this.oName+".dropShow(this,'dropForm"+this.oName+"')","btnForm.gif",getTxt("Form Editor"));

                    sHTMLDropMenus+="<table id=dropForm"+this.oName+" cellpadding=0 cellspacing=0 "+
                        "style='line-height:normal;z-index:1;display:none;position:absolute;border:#80788D 1px solid;"+
                        "cursor:default;background-color:#fbfbfd;' unselectable=on>";
                        for(var j=0;j<arrFormMenu.length;j++)
                            {
                            sHTMLDropMenus+="<tr><td onclick=\"modelessDialogShow('"+this.scriptPath + arrFormMenu[j][1]+"',"+arrFormMenu[j][2]+","+arrFormMenu[j][3]+");"+
                            "document.getElementById('dropForm"+this.oName+"').style.display='none'\""+
                            " style=\"padding:2px;padding-top:1px;font-family:Tahoma;font-size:11px;color:black;\" "+
                            "onmouseover=\"this.style.backgroundColor='#708090';this.style.color='#FFFFFF';\" "+
                            "onmouseout=\"this.style.backgroundColor='';this.style.color='#000000';\" unselectable=on>"+arrFormMenu[j][0]+"</td></tr>";
                            }
                    sHTMLDropMenus+="</table>";
                    }
                break;
            case "RemoveFormat":
                if(this.btnRemoveFormat)sHTMLIcons+=this.writeIconStandard("btnRemoveFormat"+this.oName,this.oName+".doClean()","btnRemoveFormat.gif",getTxt("Remove Formatting"));
                break;
            case "HTMLFullSource":
                if(this.btnHTMLFullSource)
                  sHTMLIcons+=this.writeIconStandard("btnHTMLFullSource"+this.oName,"setActiveEditor("+this.oName+");modalDialogShow('"+this.scriptPath+"source_html_full.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"));
                break;
                
            case "HTMLSource":
              if(this.btnHTMLSource)
                sHTMLIcons+=this.writeIconStandard("btnHTMLSource"+this.oName,"setActiveEditor("+this.oName+");modalDialogShow('"+this.scriptPath+"source_html.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"));
                break;
                
            case "XHTMLFullSource":
              if(this.btnXHTMLFullSource)
                sHTMLIcons+=this.writeIconStandard("btnXHTMLFullSource"+this.oName,"setActiveEditor("+this.oName+");modalDialogShow('"+this.scriptPath+"source_xhtml_full.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"));
                break;

            case "XHTMLSource":
              if(this.btnXHTMLSource)
                sHTMLIcons+=this.writeIconStandard("btnXHTMLSource"+this.oName,"setActiveEditor("+this.oName+");modalDialogShow('"+this.scriptPath+"source_xhtml.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"));
                break;

            case "ClearAll":
                if(this.btnClearAll)sHTMLIcons+=this.writeIconStandard("btnClearAll"+this.oName,this.oName+".clearAll()","btnDelete.gif",getTxt("Clear All"));
                break;
            default:
                for(j=0;j<this.arrCustomButtons.length;j++)
                    {
                    if(sButtonName==this.arrCustomButtons[j][0])
                        {
                        sCbName=this.arrCustomButtons[j][0];
                        //sCbCommand=this.arrCustomButtons[j][1];
                        sCbCaption=this.arrCustomButtons[j][2];
                        sCbImage=this.arrCustomButtons[j][3];
						if(this.arrCustomButtons[j][4])
							sHTMLIcons+=this.writeIconStandard("btn"+sCbName+this.oName,"eval("+this.oName+".arrCustomButtons["+j+"][1])",sCbImage,sCbCaption,this.arrCustomButtons[j][4]);
						else
							sHTMLIcons+=this.writeIconStandard("btn"+sCbName+this.oName,"eval("+this.oName+".arrCustomButtons["+j+"][1])",sCbImage,sCbCaption);
                        }
                    }
                break;
            }
        }

    var sHTML="";

    if(!document.getElementById("id_refresh_z_index"))
        sHTML+="<div id=id_refresh_z_index style='margin:0px'></div>";

    sHTML+="<table id=idArea"+this.oName+" name=idArea"+this.oName+" border='0px' "+
            "cellpadding=0 cellspacing=0 width='"+this.width+"px' height='"+this.height+"px'>"+
            "<tr><td colspan=2 style=\"padding:0px;padding-left:1px;border:#cfcfcf 1px solid;background:url('"+this.scriptPath+"icons/bg.gif')\">"+
            "<table cellpadding=0 cellspacing=0 border=0 width=100%><tr><td dir=ltr style='padding:0px;'>"+
            sHTMLIcons+
            "</td></tr></table>"+
            "</td></tr>"+
            "<tr id=idTagSelTopRow"+this.oName+"><td colspan=2 id=idTagSelTop"+this.oName+" height=0px style='padding:0px;'></td></tr>";


    sHTML+="<tr><td colspan=2 valign=top height=100% style='padding:0px;background:white;padding-right:2px'>";
    
    sHTML+="<table cellpadding=0 cellspacing=0 width=100% height=100%><tr><td width='100%' height='100%' style='padding:0px;'>";//StyleSelect

⌨️ 快捷键说明

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