表行的高度:
px
"
var o = $$(this.tablepopup.container, "input");
this.tablepopup.elm = [o[0], o[1], o[2], o[3], $$(this.tablepopup.container, "img")[0], $$(this.tablepopup.container, "img")[1]];
addListener(this.tablepopup.elm[4], 'click', Bind(this, this.Execa, null, "CreateTable"));
addListener(this.tablepopup.elm[5], 'click',
function() {
self.lightbox.Close();
self.tablepopup.Close();
});
}
else with(this.tablepopup) {
pos();
Show();
elm[0].focus();
}
this.Fpop = Bind(this, this.Hide);
addListener(this.ed, 'click', this.Fpop);
addListener(document, 'mousedown', this.Fpop);
},
Hide: function(o) {
this.facebgpopup && (this.facebgpopup.style.display = "none");
this.fontsizepopup && (this.fontsizepopup.style.display = "none");
this.fontnamepopup && (this.fontnamepopup.style.display = "none");
this.fontcolorpopup && (this.fontcolorpopup.style.display = "none");
removeListener(this.ed, 'click', this.Fpop);
removeListener(document, 'mousedown', this.Fpop);
},
Bubble: function(e) {
if (Sys.IE) {
e.cancelBubble = true
} else {
e.stopPropagation()
}
},
Execa: function(num, stamp) {
var exec = {
fontname: function() {
this.fontnamepopup.style.display = "none";
this.ed.execCommand('FontName', false, num);
},
fontSize: function() {
this.fontsizepopup.style.display = "none";
this.ed.execCommand("FontSize", false, num + 1)
},
fontColor: function() {
this.fontcolorpopup.style.display = "none";
this.ed.execCommand("ForeColor", false, num);
},
CreateLink: function() {
this.lightbox.Close();
this.Linkpopoup.Close();
if (this.Linkpopoup.elm[0].value == "") return;
if (Sys.IE) {
this.rang.execCommand("CreateLink", false, this.Linkpopoup.elm[0].value);
this.rang.parentElement().target = "_blank ";
}
else {
this.ed.execCommand("CreateLink", false, this.Linkpopoup.elm[0].value);
this.rang = this.iframe.contentWindow.getSelection().getRangeAt(0);
this.rang.commonAncestorContainer.parentNode.target = "_blank ";
}
},
InsertImage: function() {
this.lightbox.Close();
this.Imagepopoup.Close();
if (this.Imagepopoup.elm[0].value == "") return;
Sys.IE ? this.rang.execCommand("InsertImage", false, this.Imagepopoup.elm[0].value) : this.ed.execCommand("InsertImage", false, this.Imagepopoup.elm[0].value);
},
Expression: function() {
this.facebgpopup.style.display = "none";
Sys.IE && (this.iframe.contentWindow.focus());
this.ed.execCommand("InsertImage", false, num);
},
CreateTable: function() {
this.lightbox.Close();
this.tablepopup.Close();
var o = this.tablepopup.elm,
p = null;
if (Sys.IE) {
this.rang.execCommand("InsertImage", false, "http://xxx.com/xxxxx.gif");
p = this.rang.parentElement();
}
else {
this.ed.execCommand("InsertImage", false, "http://xxx.com/xxxxx.gif");
p = this.iframe.contentWindow.getSelection().getRangeAt(0).commonAncestorContainer;
}
var tab = createtab(o[0].value, o[1].value,
function(tab) {
Attr(tab, {
cellPadding: 0,
cellSpacing: 1,
border: 0,
bgColor: "#CCCCCC",
width: o[2].value
});
},
null,
function(i, j, td) {
td.height = o[3].value;
td.width = o[2].value / o[1].value;
td.style.backgroundColor = "#FFFFFF"
},
this.ed);
var imgs = p.getElementsByTagName("img");
for (var i = 0, l = p.childNodes.length; i < l; i++) {
if (imgs[i].src == "http://xxx.com/xxxxx.gif") {
p.replaceChild(tab, imgs[i])
}
}
p.insertBefore(this.ed.createElement("br"), tab.nextSibling);
}
};
Bind(this, exec[stamp])();
}
});
var popoup = new Class({
options: {
width: "200px",
title: "标题"
},
initialize: function(options) {
this.container = create("div", document.body);
Extend(this.options, options);
this.title = this.options.title;
this.container.className = "pp";
this.container.style.width = this.options.width;
this.container.innerHTML = "
";
this.w = this.container.offsetWidth;
this.h = this.container.offsetHeight;
$$(this.container, "span")[0].innerHTML = this .title;
},
pos: function() {
var str = "left:" (Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) - this.w) / 2 "px;top:" ((Math.min(document.documentElement.scrollHeight, document.documentElement.clientHeight) - this.h) / 2 document.documentElement.scrollTop) "px"
Css(this.container, str);
},
表示: function() {
this.container.style.display = "";
},
閉じる: function() {
this. container.style.display = "none";
}
})
var LightBox = {
obj: null,
config: {
Color: "#fff",
Opacity: 80,
zIndex: 5
},
init: function(options) {
Extend(this.config, options || {}); this.config);
this.config を削除します;
this.obj = document.body.insertBefore(document.createElement("div"), document.body.childNodes[0]); = "表示:なし; z-index:" this.zIndex ";left:0px;top:0px;position:fixed;width:100%;height:100%;background-color:"this.Color (Sys.IE ? ";filter : alpha) (不透明度:" this.Opacity ")": ";不透明度 :" this.Opacity / 100);
Css(this.obj, str);
if (Sys.IE6) {
this. obj.style.position = "絶対";
var _self = this;
this._resize = function() {
_self.obj.style.width = Math.max(document.documentElement.scrollWidth, document.documentElement.clientWidth) "px";
_self.obj.style.height = Math.max(document.documentElement.scrollHeight, document.documentElement.clientHeight) "px"; .obj.innerHTML = '
}
return this;
},
Show: function() {
if (Sys.IE6) {
this._resize(); (window, "resize", this._resize);
}
this.obj.style.display = "ブロック";
},
Close: function() {
this. obj.style.display = "none";
if (Sys.IE6) RemoveListener(window, "resize", LightBox._resize);
}
}
window.onload = function() {
var data = [{
クラス: "span0",
hover: "span0_hover",
title: "加粗",
action: "Exec",
args: "bold"
},
{
Class: "span1",
hover: "span1_hover",
title: "斜体",
action: "Exec",
args: "Italic"
},
{
Class: "span2",
hover: "span2_hover ",
title: "下划線",
action: "Exec",
args: "Underline"
},
{
Class: "span3",
hover : "span3_hover",
title: "文字号",
action: "Fontsize",
args: null
},
{
Class: "span4",
hover: "span4_hover"、
title: "文字"、
action: "FontName"、
args: null
}、
{
Class: "span5"、
hover: "span5_hover",
title: "文字颜色",
action: "Fontcolor",
args: null
},
{
Class: "span6",
hover: "span6_hover"、
title: "插入链接"、
action: "CreateLink"、
args: null
}、
{
クラス: "span7 ",
hover: "span7_hover",
title: "剪贴",
action: "Exec",
args: "Cut"
},
{
クラス: "span8",
hover: "span8_hover",
title: "复制",
action: "Exec",
args: "Copy"
},
{
クラス: "span9",
hover: "span9_hover",
title: "左对齐",
action: "Exec",
args: "JustifyLeft"
},
{
クラス: "span10"、
ホバー: "span10_hover"、
タイトル: "居中对齐"、
アクション: "Exec"、
引数: "JustifyCenter"
},
{
クラス: "span11",
hover: "span11_hover",
title: "右对齐",
action: "Exec",
args: " JustifyRight"
},
{
クラス: "span12",
hover: "span12_hover",
title: "项目記号",
action: "Exec",
args: "InsertUnownedList"
},
{
クラス: "span13",
hover: "span13_hover",
title: "编号",
action: "Exec" ,
args: "InsertOrderedList"
},
{
Class: "span14",
hover: "span14_hover",
title: "插入表格",
action : "Addtable",
args: null
},
{
Class: "span15",
hover: "span15_hover",
title: "减少缩进",
action: "Exec"、
args: "Outdent"
}、
{
Class: "span16"、
hover: "span16_hover"、
title: "增加缩进",
action: "Exec",
args: "Indent"
},
{
Class: "span17",
hover: "span17_hover",
title: "清除样式",
action: "Exec",
args: "RemoveFormat"
},
{
Class: "span18",
hover: "span18_hover ",
title: "插入图片",
action: "InsertImage",
args: null
},
{
Class: "span19",
hover: "span19_hover",
title: "插入表情",
action: "Expression",
args: null
},
{
Class: "span20",
hover: "span20_hover",
title: "自アニメーション排版",
action: "Layout",
args: null
}];
new Editor($('ss'), data, LightBox.init());
}