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

📄 editor.js

📁 博客系统 博客系统 博客系统 博客系统 博客系统 博客系统
💻 JS
📖 第 1 页 / 共 5 页
字号:
            sHTMLDropMenus+="<tr><td onclick=\""+this.oName+".applyFontSize('"+this.arrFontSize[j][1]+"')\" "+
              "style=\"padding:0;padding-left:5px;padding-right:5px;font-family:tahoma;color:black;\" "+
              "onmouseover=\"if(this.style.backgroundColor=='#708090')this.sel='true';this.style.backgroundColor='#708090';this.style.color='#FFFFFF';\" "+
              "onmouseout=\"if(this.sel=='true'){this.sel='false'}else{this.style.backgroundColor='';this.style.color='#000000';}\" unselectable=on align=center>"+
              "<font unselectable=on size=\""+this.arrFontSize[j][1]+"\">"+
              this.arrFontSize[j][0]+"</font></td></tr>";
            }
          sHTMLDropMenus+="</table>";
          sHTMLIcons+=this.writeDropDown("btnFontSize"+this.oName,this.oName+".expandSelection();"+this.oName+".dropShow(this,dropFontSize"+this.oName+");realtimeSizeSelect('"+this.oName+"')","btnFontSize.gif",getTxt("Font Size"),60);
          }
        break;
      case "Cut":
        if(this.btnCut)sHTMLIcons+=this.writeIconStandard("btnCut"+this.oName,this.oName+".doCmd('Cut')","btnCut.gif",getTxt("Cut"));
        break;
      case "Copy":
        if(this.btnCopy)sHTMLIcons+=this.writeIconStandard("btnCopy"+this.oName,this.oName+".doCmd('Copy')","btnCopy.gif",getTxt("Copy"));
        break;
      case "Paste":
        if(this.btnPaste)sHTMLIcons+=this.writeIconStandard("btnPaste"+this.oName,this.oName+".doPaste()","btnPaste.gif",getTxt("Paste"));
        break;
      case "PasteWord":
        if(this.btnPasteWord)sHTMLIcons+=this.writeIconStandard("btnPasteWord"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"paste_word.htm',400,280)","btnPasteWord.gif",getTxt("Paste from Word"));
        break;
      case "PasteText":
        if(this.btnPasteText)sHTMLIcons+=this.writeIconStandard("btnPasteText"+this.oName,this.oName+".doPasteText()","btnPasteText.gif",getTxt("Paste Text"));
        break;
      case "Undo":
        if(this.btnUndo)sHTMLIcons+=this.writeIconStandard("btnUndo"+this.oName,this.oName+".doUndo()","btnUndo.gif",getTxt("Undo"));
        break;
      case "Redo":
        if(this.btnRedo)sHTMLIcons+=this.writeIconStandard("btnRedo"+this.oName,this.oName+".doRedo()","btnRedo.gif",getTxt("Redo"));
        break;
      case "Bold":
        if(this.btnBold)sHTMLIcons+=this.writeIconToggle("btnBold"+this.oName,this.oName+".applyBold()","btnBold.gif",getTxt("Bold"));
        break;
      case "Italic":
        if(this.btnItalic)sHTMLIcons+=this.writeIconToggle("btnItalic"+this.oName,this.oName+".applyItalic()","btnItalic.gif",getTxt("Italic"));
        break;
      case "Underline":
        if(this.btnUnderline)sHTMLIcons+=this.writeIconToggle("btnUnderline"+this.oName,this.oName+".applyLine('underline')","btnUnderline.gif",getTxt("Underline"));
        break;
      case "Strikethrough":     
        if(this.btnStrikethrough)sHTMLIcons+=this.writeIconToggle("btnStrikethrough"+this.oName,this.oName+".applyLine('line-through')","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+".oColor1.show(this)","btnForeColor.gif",getTxt("Foreground Color"));
        break;
      case "BackColor":
        if(this.btnBackColor)sHTMLIcons+=this.writeIconStandard("btnBackColor"+this.oName,this.oName+".oColor2.show(this)","btnBackColor.gif",getTxt("Background Color"));
        break;
      case "Bookmark":
        if(this.btnBookmark)sHTMLIcons+=this.writeIconStandard("btnBookmark"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"bookmark.htm',245,216)","btnBookmark.gif",getTxt("Bookmark"));
        break;
      case "Hyperlink":
        if(this.btnHyperlink)sHTMLIcons+=this.writeIconStandard("btnHyperlink"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"hyperlink.htm',380,200)","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 1 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,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"image.htm',440,351)","btnImage.gif",getTxt("Image"));
        break;
      case "Flash":
        if(this.btnFlash)sHTMLIcons+=this.writeIconStandard("btnFlash"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"flash.htm',340,275)","btnFlash.gif",getTxt("Flash"));
        break;
      case "Media":
        if(this.btnMedia)sHTMLIcons+=this.writeIconStandard("btnMedia"+this.oName,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"media.htm',340,272)","btnMedia.gif",getTxt("Media"));
        break;
      case "ContentBlock":
        if(this.btnContentBlock)sHTMLIcons+=this.writeIconStandard("btnContentBlock"+this.oName,this.oName+".hide();"+this.cmdContentBlock,"btnContentBlock.gif",getTxt("Content Block"));
        break;
      case "InternalLink":
        if(this.btnInternalLink)sHTMLIcons+=this.writeIconStandard("btnInternalLink"+this.oName,this.oName+".hide();"+this.cmdInternalLink,"btnInternalLink.gif",getTxt("Internal Link"));
        break;
      case "InternalImage":
        if(this.btnInternalImage)sHTMLIcons+=this.writeIconStandard("btnInternalImage"+this.oName,this.oName+".hide();"+this.cmdInternalImage,"btnInternalImage.gif",getTxt("Internal Image"));
        break;
      case "CustomObject":
        if(this.btnCustomObject)sHTMLIcons+=this.writeIconStandard("btnCustomObject"+this.oName,this.oName+".hide();"+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,262);"+
            " 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,380);"+
            " 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,440);"+
            " 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=195 id=dropTableCreate"+this.oName+" onmouseout='doOut_TabCreate();event.cancelBubble=true' style='position:absolute;display:none;cursor:default;background:#f3f3f8;border:#8a867a 1px solid;' cellpadding=0 cellspacing=2 border=0 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()' onmouseover='doOver_TabCreate()' style='background:#ffffff;font-size:1px;border:#8a867a 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',300,322);\" onmouseover=\"this.innerText='"+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;' 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 "Guidelines":
        if(this.btnGuidelines)sHTMLIcons+=this.writeIconStandard("btnGuidelines"+this.oName,this.oName+".runtimeBorder(true)","btnGuideline.gif",getTxt("Show/Hide Guidelines"));
        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,this.oName+".hide();modelessDialogShow('"+this.scriptPath+"characters.htm',495,162)","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","177"],
            [getTxt("Text Field"),"form_text.htm","285","289"],
            [getTxt("List"),"form_list.htm","295","332"],
            [getTxt("Checkbox"),"form_check.htm","235","174"],
            [getTxt("Radio Button"),"form_radio.htm","235","177"],
            [getTxt("Hidden Field"),"form_hidden.htm","235","152"],
            [getTxt("File Field"),"form_file.htm","235","132"],
            [getTxt("Button"),"form_button.htm","235","174"]];
          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]+");"+
            "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+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_html_full.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"),35);
        break;
      case "HTMLSource":
        if(this.btnHTMLSource)sHTMLIcons+=this.writeIconStandard("btnHTMLSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_html.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"),35);
        break;
      case "XHTMLFullSource":
        if(this.btnXHTMLFullSource)sHTMLIcons+=this.writeIconStandard("btnXHTMLFullSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_xhtml_full.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"),35);
        break;
      case "XHTMLSource":
        if(this.btnXHTMLSource)sHTMLIcons+=this.writeIconStandard("btnXHTMLSource"+this.oName,"setActiveEditor('"+this.oName+"');"+this.oName+".hide();modalDialogShow('"+this.scriptPath+"source_xhtml.htm',600,450);","btnSource.gif",getTxt("View/Edit Source"),35);
        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);
            }
          }

⌨️ 快捷键说明

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