表行的高度:
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) - .w) /this.w) /this.w) /this.w) / 2 "px;top:" ((Math.min(document.documentElement.scrollHeight, document.documentElement.clientHeight) - this.h) / 2 document.documentElement.scrollTop) "px"
Css(this. str);
},
顯示: function() {
this.container.style.display = "";
},
關機: function() {
this. container.style.display = "none";
}
})
var LightBox = {
obj: null,
config: {
顏色: "#fff",
不透明度: 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 ")": ";opacity :" this.Opacity / 100);
CSS(this.obj, str);
if (Sys.IE6) {
這個。 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"
this; .obj.innerHTML = '
;' ;
}
回傳這個;
},
顯示: function() {
if (Sys.IE6) {
this._resize(); (視窗, "調整大小", this._resize);
}
this.obj.style.display = "block";
},
關閉: function() {
this. obj.style.display = "none"
if (Sys.IE6) removeListener(window, "resize", LightBox._resize);
}
}
window.onload = function() {
var data = [{
Class: "span0",
hover: "span0_hover",
title: "加粗",
action: "Exec",
args: "bold"
},
{
類: "span1",
hover: "span1_hover",
title: "斜體",
action: "Exec",
args: "斜體"
},
{
Class: "span2",
hover: "span2_hover ",
標題:“底線”,
操作:“執行”,
參數:“下劃線”
},
{
類別:“span3”,
懸停停: "span3_hover",
title: "字號",
action: "字體大小",
args: null
},
{
類別: "span4",
懸停:“span4_hover”,
標題:“字體”,
操作:“字體名稱”,
參數:null
},
{
類別:“ span5 ”,
hover: "span5_hover",
title: "文字顏色",
action: "字體顏色",
args: null
},
{
args: null
},
{
args: null
},
{
args: null
},
{
args: null
},
{
args: null
},
{
args: null
},
{
args: null
},
{
args: Class: "span6",
hover: "span6_hover",
title: "插入連結",
action: "CreateLink",
args: null
},
{
args: null
},
{
Class: "span7 ",
懸停:“span7_hover”,
標題:“剪切”,
操作:“執行”,
參數:“剪切”
} ,
{
類別: "span8",
hover: "span8_hover",
title: "複製",
action: "Exec",
args: "複製"
},
{
Class: "span9",
hover: "span9_hover",
title: "左橫",
action: "Exec",
args: "JustifyLeft "
},
{
Class: "span10",
hover: "span10_hover",
title: "居中橫",
action: "Exec",
args: "JustifyCenter"
},
{
Class: "span11",
hover: "span11_hover",
title: "右橫",
action: "🎜>action: " Exec" ,
args: " JustifyRight"
},
{
Class: "span12",
hover: "span12_hover",
title: "項目符號",
action : "Exec",
args: "InsertUnorderedList"
},
{
Class: "span13",
hover: "span13_hover",
title: "編號" ,
action: "Exec" ,
args: "InsertOrderedList"
},
{
Class: "span14",
hover: "span14_hover",
title: "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: "縮排"
},
{
類別: "span17",
href: "span17_hover",
title: "清除樣式",
action: "Exec",
args: "RemoveFormat"
},
{
Class)Class span18" ,
hover: "span18_hover ",
title: "插入圖片",
action: "InsertImage",
args: null
}, { args: null }, { Class Class ( > Class: "span20", href: "span20_hover", title: "自動排版", action: "版面配置", args: null }]; 新編輯器($('ss'), data, LightBox.init()); } 腳本>