贴上原来的层插件:
KE.plugin['layer'] = {
click : function(id) {
var cmd = 'layer';
var styles = [
'margin:5px;border:1px solid #FF9900;',
'margin:5px;border:2px solid #FF9900;',
'margin:5px;border:1px dashed #FF9900;',
'margin:5px;border:2px dashed #FF9900;',
'margin:5px;border:1px dotted #FF9900;',
'margin:5px;border:2px dotted #FF9900;'
];
KE.util.selection(id);
var table = KE.$$('table');
table.width = 150;
table.cellPadding = 0;
table.cellSpacing = 2;
table.border = 0;
table.style.margin = 0;
table.style.padding = 0;
table.style.borderCollapse = 'separate';
table.style.borderSpacing = '2px';
for (var i = 0; i < styles.length; i++) {
var row = table.insertRow(i);
for (var j = 0; j < 1; j++) {
var cell = row.insertCell(j);
cell.style.padding = '1px';
cell.style.margin = 0;
cell.style.border = '1px solid #F9FCEF';
cell.style.fontSize = '12px';
cell.style.cursor = 'pointer';
cell.onmouseover = function() {this.style.borderColor = '#FF9900'; }
cell.onmouseout = function() {this.style.borderColor = '#F9FCEF'; }
cell.onclick = new Function('KE.plugin["' + cmd + '"].exec("' + id + '", "padding:5px;' + styles[i] + '")');
cell.innerHTML = '<div class="ke-reset" style="height:15px;' + styles[i] + '"></div>';
}
}
var menu = new KE.menu({
id : id,
cmd : cmd
});
menu.append(table);
menu.show();
},
exec : function(id, value) {
KE.util.select(id);
var html = '<div style="' + value + 'width:90%;background-color:#FFFBE8;">' + KE.lang['pleaseInput'] + '</div>';
KE.util.insertHtml(id, html);
KE.layout.hide(id);
KE.util.focus(id);
}
};
特殊符号插件:
KE.plugin.specialchar = {
click : function(id) {
var charTable = [
['§','№','☆','★','○','●','◎','◇','◆','□'],
['℃','‰','■','△','▲','※','→','←','↑','↓'],
['〓','¤','°','#','&','@','\','︿','_',' ̄'],
['―','α','β','γ','δ','ε','ζ','η','θ','ι'],
['κ','λ','μ','ν','ξ','ο','π','ρ','σ','τ'],
['υ','φ','χ','ψ','ω','≈','≡','≠','=','≤'],
['≥','<','>','≮','≯','∷','±','+','-','×'],
['÷','/','∫','∮','∝','∞','∧','∨','∑','∏'],
['∪','∩','∈','∵','∴','⊥','∥','∠','⌒','⊙'],
['≌','∽','〖','〗','【','】','(',')','[',']']
];
var cmd = 'specialchar';
KE.util.selection(id);
var table = KE.$$('table');
table.cellPadding = 0;
table.cellSpacing = 2;
table.border = 0;
table.style.margin = 0;
table.style.padding = 0;
table.style.borderCollapse = 'separate';
table.style.borderSpacing = '2px';
for (var i = 0; i < charTable.length; i++) {
var row = table.insertRow(i);
for (var j = 0; j < charTable[i].length; j++) {
var cell = row.insertCell(j);
cell.style.padding = '1px';
cell.style.margin = 0;
cell.style.border = '1px solid #FFFFFF';
cell.style.fontSize = '12px';
cell.style.cursor = 'pointer';
cell.onmouseover = function() {this.style.borderColor = '#FF6600'; }
cell.onmouseout = function() {this.style.borderColor = '#FFFFFF'; }
cell.onclick = new Function('KE.plugin["' + cmd + '"].exec("' + id + '", "' + charTable[i][j] + '")');
cell.innerHTML = charTable[i][j];
}
}
var menu = new KE.menu({
id : id,
cmd : cmd
});
menu.append(table);
menu.show();
},
exec : function(id, value) {
KE.util.select(id);
KE.util.insertHtml(id, value);
KE.layout.hide(id);
KE.util.focus(id);
}
};
现在4.0要如何修改这两部分代码?