var w=$("content").contentWindow;
w.document.designMode="on";
w.document.open();
w.document.write("")
w.document.close();
if(sx.comm.ver=="ie"){
//w.document.body.style.lineHeight="10px";
}
w.document.onkeydown=function(){
if(sx.comm.ver=="ie"){
if(w.event.keyCode==13){
var s=w.document.selection.createRange();
s.pasteHTML("
");
w.focus();
거짓을 반환합니다.
}
}
}
function wnd(){
var main=document.createElement("div");
sx.dom.setstyle(main,{
위치:"절대",
너비:"100%",
높이:"100%",
배경색상:"lightblue",
필터:"알파(불투명도=50)",
불투명도:0.5
});
var body=document.createElement("div");
sx.dom.setstyle(body,{
위치:"절대",
너비:"200px",
높이:"250px",
배경색상:"녹색",
zIndex:1000
});
var title=document.createElement("div");
sx.dom.setstyle(title,{
너비:"200px",
높이:"20px",
배경색상:"blue",
});
var close=document.createElement("span");
sx.dom.setstyle(close,{
marginLeft:"180px",
디스플레이:"block",
너비:"20px",
높이:"20px",
textAlign:"center",
커서:"포인터"
});
close.innerHTML="X";
close.onclick=function(){
main.parentNode.removeChild(main);
body.parentNode.removeChild(body);
}
title.appendChild(닫기);
body.appendChild(제목);
var content=document.createElement("div");
sx.dom.setstyle(content,{
너비:"200px",
높이:"230px"
});
body.appendChild(콘텐츠);
this.show=function(e){
document.body.appendChild(main);
sx.dom.setstyle(main,{
상단:"0px",
왼쪽:"0px"
});
document.body.appendChild(body);
sx.dom.setstyle(body,{
top:sx.dom.top(e) e.clientHeight "px",
left:sx.dom.left(e) e.clientWidth "px ",
});
}
this.close=close;
this.main=main;
this.body=body;
this.title=제목;
this.content=content;
}
펑션 볼드(){
w.document.execCommand("bold",null,null);
}
function italic(){
w.document.execCommand("italic",null,null);
}
function left(){
w.document.execCommand("JustifyLeft",null,null);
}
기능 센터(){
w.document.execCommand("Justifycenter",null,null);
}
function right(){
w.document.execCommand("Justifyright",null,null);
}
function FontName(값){
w.document.execCommand("FontName", false, value);
}
function FontSize(value){
w.document.execCommand("FontSize", false, value);
}
function inserthr(){
if(document.selection){
w.focus();
var s=w.document.selection.createRange();
s.pasteHTML("<시간/>");
}else{
w.focus();
var s=w.getSelection().getRangeAt(0);
s.insertNode(w.document.createElement("hr"));
}
}
function insertlink(){
if (document.selection) {
w.focus();
var s = w.document.selection.createRange();
}
else {
w.focus();
var s = w.getSelection().getRangeAt(0);
}
var e=sx.event.target();
var ww=new wnd();
ww.content.appendChild(document.createTextNode("请输入链接地址;")));
var link=document.createElement("input");
link.type="text";
link.size=20;
ww.content.appendChild(링크);
var b=document.createElement("버튼");
b.innerHTML="결정";
ww.content.appendChild(b);
b.onclick=function(){
if(sx.comm.ver=="ie"){
s.pasteHTML("
" s.htmlText "");
}
else{
var a=w.document.createElement("a");
a.href=link.value;
s.surroundContents(a);
}
sx.event.parseevent(ww.close,"클릭");
}
ww.show(e);
}
function inserttable(){
if (document.selection) {
w.focus();
var s = w.document.selection.createRange();
}
else {
w.focus();
var s = w.getSelection().getRangeAt(0);
}
var e=sx.event.target();
var ww=new wnd();
ww.content.appendChild(document.createTextNode("请输入行数;")));
var tr=document.createElement("input");
tr.type="text";
tr.size=20;
ww.content.appendChild(tr);
ww.content.appendChild(document.createElement("br"));
ww.content.appendChild(document.createTextNode("请输入列数;")));
var td=document.createElement("input");
td.type="text";
td.size=20;
ww.content.appendChild(td);
ww.content.appendChild(document.createElement("br"));
ww.content.appendChild(document.createTextNode("请输入单元格높이도;")));
var height=document.createElement("input");
height.type="text";
높이.크기=20;
ww.content.appendChild(높이);
ww.content.appendChild(document.createElement("br"));
ww.content.appendChild(document.createTextNode("请输入单元格宽島;"));
var width=document.createElement("input");
width.type="text";
너비.크기=20;
ww.content.appendChild(너비);
ww.content.appendChild(document.createElement("br"));
var b=document.createElement("버튼");
b.innerHTML="결정";
ww.content.appendChild(b);
b.onclick=function(){
var l1=Number(tr.value);
var l2=숫자(td.value);
var h1=숫자(높이.값);
var w1=숫자(너비.값);
ww.content.appendChild(document.createTextNode("请输入单元格높이도;")));
var t=document.createElement("테이블");
t.border="1";
var tb=document.createElement("tbody");
t.appendChild(tb);
for(var i=0;i
var tr1=document.createElement("tr");
for(var i1=0;i1var td1=document.createElement("td");
td1.innerHTML="";
sx.dom.setstyle(td1,{
너비:w1 "px",
높이:h1 "px"
});
tr1.appendChild(td1);
}
tb.appendChild(tr1);
}
if(sx.comm.ver=="ie"){
s.pasteHTML(t.outerHTML);
}
else{
s.insertNode(t);
s.insertNode(document.createElement("br"));
}
sx.event.parseevent(ww.close,"클릭");
}
ww.show(e);
}
function color(){
var e=sx.event.target();
if (document.selection) {
w.focus();
var s = w.document.selection.createRange();
}
else {
w.focus();
var s = w.getSelection().getRangeAt(0);
}
var ww=new wnd();
var colors = ["00","33","66","99","CC","FF"];
var cp=document.createElement("span");
sx.dom.setstyle(cp,{
디스플레이:"inline-block",
너비:"10px",
높이:"10px",
여백:"2px"
});
for(var i1=5;i1>=0;i1--){
for(var i2=5;i2>=0;i2--){
for(var i3=5; i3>=0;i3--){
var cp1=cp.cloneNode(true);
cp1.style.BackgroundColor="#" 색상[i1] 색상[i2] 색상[i3];
cp1.title="#" 색상[i1] 색상[i2] 색상[i3];
cp1.onclick=function(){
if(sx.comm.ver=="ie"){
w.focus();
s.pasteHTML("" s.htmlText "");
}
else{
var a=w.document.createElement("font");
a.color=this.title;
s.surroundContents(a);
}
sx.event.parseevent(ww.close,"클릭");
}
ww.content.appendChild(cp1);
}
}
}
ww.show(e);
}