ui.js

来自「.NET 网页编辑器」· JavaScript 代码 · 共 190 行

JS
190
字号
/*
    //Get a SELECT's OPTIONS's JSON data
    
    for(var i=0;i<sel.options.length;i++)
	    {
	        var option = sel.options[i];
	       
	        var options_JSON = "{";
	        options_JSON += "text:\""+option.innerText+"\",";
	        options_JSON += "value:\""+option.value+"\",";
	        options_JSON += "cssText:\""+option.style.cssText+"\",";
	        options_JSON += "selected:"+option.selected;
	        options_JSON += "}";
	        
	        if(i<sel.options.length -1)
	            options_JSON +=",";
	        
	        document.write("<br>"+options_JSON);
	       
	    }
*/


var UI = {};

UI.editor = {
    
};


UI.footBar = {
    Seperater:"separator.gif",
    Buttons:{
        Mod:"<input type=\"button\" value=\"HTML\">"
    }
    
};


UI.toolBar ={
    Selects:{
         FontName:{
            options:[
             {text:"字体",value:"",cssText:"",selected:true},
             {text:"",value:"Arial",cssText:"",selected:true},
             {text:"",value:"Courier New",cssText:"",selected:true},
             {text:"",value:"Garamond",cssText:"",selected:true},
             {text:"",value:"Georgia",cssText:"",selected:true},
             {text:"",value:"Tahoma",cssText:"",selected:true},
             {text:"",value:"Times New Roman",cssText:"",selected:true},
             {text:"",value:"Verdana",cssText:"",selected:true},
             {text:"",value:"宋体",cssText:"",selected:true},
             {text:"",value:"幼圆",cssText:"",selected:true},
             {text:"",value:"楷体_GB2312",cssText:"",selected:true},
             {text:"",value:"仿宋_GB2312",cssText:"",selected:true},
             {text:"",value:"黑体",cssText:"",selected:true},
             {text:"",value:"隶书",cssText:"",selected:true}
            ],
            cssText:""
    				    
        },
        
        FontSize:{
             options:[
             {text:"字号",value:"",cssText:"",selected:true},
             {text:"",value:"1",cssText:"",selected:true},
             {text:"",value:"2",cssText:"",selected:true},
             {text:"",value:"3",cssText:"",selected:true},
             {text:"",value:"4",cssText:"",selected:true},
             {text:"",value:"5",cssText:"",selected:true},
             {text:"",value:"6",cssText:"",selected:true}
            ],
            cssText:""
            		
        },
        
        ForeColor:{
            options:[
                {text:"字体颜色",value:"",cssText:"",selected:true},
                {text:"黑色",value:"#000000",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: black",selected:false},
                {text:"灰色",value:"#808080",cssText:"BACKGROUND-COLOR: gray",selected:false},
                {text:"深灰色",value:"#A9A9A9",cssText:"BACKGROUND-COLOR: darkgray",selected:false},
                {text:"浅灰色",value:"#D3D3D3",cssText:"BACKGROUND-COLOR: lightgrey",selected:false},
                {text:"白色",value:"#FFFFFF",cssText:"BACKGROUND-COLOR: white",selected:false},
                {text:"碧绿色",value:"#7FFFD4",cssText:"BACKGROUND-COLOR: aquamarine",selected:false},
                {text:"蓝色",value:"#0000FF",cssText:"BACKGROUND-COLOR: blue",selected:false},
                {text:"海军蓝",value:"#000080",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: navy",selected:false},
                {text:"紫色",value:"#800080",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: purple",selected:false},
                {text:"紫红色",value:"#FF1493",cssText:"BACKGROUND-COLOR: deeppink",selected:false},
                {text:"紫罗兰色",value:"#EE82EE",cssText:"BACKGROUND-COLOR: violet",selected:false},
                {text:"粉红色",value:"#FFC0CB",cssText:"BACKGROUND-COLOR: pink",selected:false},
                {text:"深绿色",value:"#006400",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: darkgreen",selected:false},
                {text:"绿色",value:"#008000",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: green",selected:false},
                {text:"草绿色",value:"#9ACD32",cssText:"BACKGROUND-COLOR: yellowgreen",selected:false},
                {text:"黄色",value:"#FFFF00",cssText:"BACKGROUND-COLOR: yellow",selected:false},
                {text:"橙色",value:"#FFA500",cssText:"BACKGROUND-COLOR: orange",selected:false},
                {text:"红色",value:"#FF0000",cssText:"BACKGROUND-COLOR: red",selected:false},
                {text:"红棕色",value:"1",cssText:"BACKGROUND-COLOR: brown",selected:false},
                {text:"棕色",value:"#DEB887",cssText:"BACKGROUND-COLOR: burlywood",selected:false},
                {text:"浅褐色",value:"#F5F5DC",cssText:"BACKGROUND-COLOR: beige",selected:false} 
            ],
            cssText:""
                   
                   			
        },
        BackColor:{
            options:[
                {text:"背景颜色",value:"",cssText:"",selected:true},
                {text:"黑色",value:"#000000",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: black",selected:false},
                {text:"灰色",value:"#808080",cssText:"BACKGROUND-COLOR: gray",selected:false},
                {text:"深灰色",value:"#A9A9A9",cssText:"BACKGROUND-COLOR: darkgray",selected:false},
                {text:"浅灰色",value:"#D3D3D3",cssText:"BACKGROUND-COLOR: lightgrey",selected:false},
                {text:"白色",value:"#FFFFFF",cssText:"BACKGROUND-COLOR: white",selected:false},
                {text:"碧绿色",value:"#7FFFD4",cssText:"BACKGROUND-COLOR: aquamarine",selected:false},
                {text:"蓝色",value:"#0000FF",cssText:"BACKGROUND-COLOR: blue",selected:false},
                {text:"海军蓝",value:"#000080",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: navy",selected:false},
                {text:"紫色",value:"#800080",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: purple",selected:false},
                {text:"紫红色",value:"#FF1493",cssText:"BACKGROUND-COLOR: deeppink",selected:false},
                {text:"紫罗兰色",value:"#EE82EE",cssText:"BACKGROUND-COLOR: violet",selected:false},
                {text:"粉红色",value:"#FFC0CB",cssText:"BACKGROUND-COLOR: pink",selected:false},
                {text:"深绿色",value:"#006400",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: darkgreen",selected:false},
                {text:"绿色",value:"#008000",cssText:"COLOR: #ffffff; BACKGROUND-COLOR: green",selected:false},
                {text:"草绿色",value:"#9ACD32",cssText:"BACKGROUND-COLOR: yellowgreen",selected:false},
                {text:"黄色",value:"#FFFF00",cssText:"BACKGROUND-COLOR: yellow",selected:false},
                {text:"橙色",value:"#FFA500",cssText:"BACKGROUND-COLOR: orange",selected:false},
                {text:"红色",value:"#FF0000",cssText:"BACKGROUND-COLOR: red",selected:false},
                {text:"红棕色",value:"1",cssText:"BACKGROUND-COLOR: brown",selected:false},
                {text:"棕色",value:"#DEB887",cssText:"BACKGROUND-COLOR: burlywood",selected:false},
                {text:"浅褐色",value:"#F5F5DC",cssText:"BACKGROUND-COLOR: beige",selected:false} 
            ],
            cssText:""
        },
        
        Paragraph:{
            options:[
             {text:"段落样式",value:"",cssText:"",selected:true},
             {text:"正文",value:"<body>",cssText:"",selected:true},
             {text:"标题 1",value:"<h1>",cssText:"",selected:true},
             {text:"标题 2",value:"<h2>",cssText:"",selected:true},
             {text:"标题 3",value:"<h3>",cssText:"",selected:true},
             {text:"标题 4",value:"<h4>",cssText:"",selected:true},
             {text:"标题 5",value:"<h5>",cssText:"",selected:true},
             {text:"标题 6",value:"<h6>",cssText:"",selected:true},
             {text:"带格式的",value:"<pre>",cssText:"",selected:true},
             {text:"地址",value:"<address>",cssText:"",selected:true}
            ],
            cssText:""
                   
        }
        
    },
   
           
    Seperater:"separator.gif",
    Buttons:{
        ForeColor:["fontforecolorpicker.gif","ForeColor"],
        BackColor:["fontbackcolorpicker.gif","BackColor"],
        ZoomIn:["inserttime.gif","ZoomIn"],
        ZoomOut:["inserttime.gif","ZoomOut"],
        Bold:["bold.gif","bold"],
        Italic:["italic.gif","italic"],
        Underline:["underline.gif","underline"],
        Strikethrough:["strikethrough.gif","strikethrough"],
        Subscript:["subscript.gif","subscript"],
        Superscript:["superscript.gif","superscript"],
        Undo:["undo.gif","undo"],
        Redo:["redo.gif","redo"],
        Print:["print.gif","print"],
        Insertimagefromgallery:["insertimagefromgallery.gif","insertimagefromgallery"],
        Createlink:["createlink.gif","createlink"],
        Unlink:["unlink.gif","unlink"],
        Removeformat:["removeformat.gif","removeformat"],
        Inserttime:["inserttime.gif","inserttime"],
        Insertdate:["insertdate.gif","insertdate"],
        Wordcount:["wordcount.gif","wordcount"],
        Justifyright:["justifyright.gif","justifyright"],
        Justifyleft:["justifyleft.gif","justifyleft"],
        Justifycenter:["justifycenter.gif","justifycenter"],
        Justifyfull:["justifyfull.gif","justifyfull"],
        Bullets:["bullets.gif","bullets"],
        Numberedlist:["numberedlist.gif","numberedlist"],
        Indent:["indent.gif","indent"],
        Outdent:["outdent.gif","outdent"]       
        
    }  
    
    
};

⌨️ 快捷键说明

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