本帖最后由 sky2227 于 2009-10-27 21:49 编辑
SupeSite总觉得不错,前段时间测试了一哈7.5beta版,可是那编辑器总是不敢恭维,始终用不习惯~!
而且还没有插入代码的功能,在网上也找不到好的方法解决,得了,自己解决~!
使用的是FCKeditor的插入代码插件修改而来的~!
1、下载附件
直接解压覆盖
2、另外在模板样式文件common.css中最后添间一下代码- /*=============================================== Insert Code Style*/
- /*块引用处理*/
- blockquote,pre {background:#F8F8F8;border:1px solid #CCC;padding:4px;padding-left:10px;margin:0 auto 10px 0;width:95%;border-left:4px solid #CCC;}
- blockquote h6 {font-size:11px;color:#999;padding:0 4px 4px;margin:0;border-bottom:1px dashed #CCC;}
- blockquote p {margin:0;padding:4px 4px 0;font-size:12px;}
- blockquote ul,blockquote ol {padding-left:15px;}
- .Content-body li {list-style:disc;}
- /*InsertCode*/
- .codeText {border:1px solid #ddd;border-top:3px solid #ddd;width:98%;overflow:auto;margin:0 0 1.1em;padding:0;word-break:break-all;background:#fff;font:12px "Courier New", Monospace;}
- .codeHead {font-weight:700;font-size:12px;padding:5px;padding-left:10px;background:#f2f2f2;/*border-top: 3px solid #ddd;*/border-bottom:1px solid #ddd;height:15px;}
- .lantxt,.zhedie {float:left;}
- /*语言名称和折叠span*/
- .lantxt {padding-left:5px;}
- /*复制内容*/
- .copyCodeText {float:right;cursor:pointer;font-weight:400;}
- .wbyText {width:100%;height:250px;border:0;border-bottom:1px solid #ddd;background:#f2f2f2;}
- .codeText input {border:0 solid #ddd;margin:2px;height:20px;width:80px;background:#89E0F6;}
- .codeText ol {list-style-type:outside;list-style:decimal-leading-zero;margin:0 1px 0 45px;padding:2px 0;color:#5C5C5C;border-left:1px solid #ddd;background:#fff;}
- .codeText ol li {padding-left:5px;background:#FFF;color:#a00;}
- .codeText ol li.alt {background:#FFF;}
- .codeText ol li span {color:#000;}
- .codeText .comment,.codeText .comments {color:#008200;}
- .codeText .string {color:blue;}
- .codeText .keyword {color:#069;font-weight:700;}
- .codeText .preprocessor {color:gray;}
- .dp-c .comment {color:green;}
- .dp-c .string {color:blue;}
- .dp-c .preprocessor {color:gray;}
- .dp-c .keyword {color:blue;}
- .dp-c .vars {color:#d00;}
- .dp-vb .comment {color:green;}
- .dp-vb .string {color:blue;}
- .dp-vb .preprocessor {color:gray;}
- .dp-vb .keyword {color:blue;}
- .dp-sql .comment {color:green;}
- .dp-sql .string {color:red;}
- .dp-sql .keyword {color:#7f0055;}
- .dp-sql .func {color:#ff1493;}
- .dp-sql .op {color:blue;}
- .dp-xml .cdata {color:#ff1493;}
- .dp-xml .comments {color:green;}
- .dp-xml .tag {font-weight:700;color:blue;}
- .dp-xml .tag-name {color:#7f0055;font-weight:700;}
- .dp-xml .attribute {color:red;}
- .dp-xml .attribute-value {color:blue;}
- .dp-delphi .comment {color:#008200;font-style:italic;}
- .dp-delphi .string {color:blue;}
- .dp-delphi .number {color:blue;}
- .dp-delphi .directive {color:#008284;}
- .dp-delphi .keyword {font-weight:700;color:navy;}
- .dp-delphi .vars {color:#000;}
- .dp-py .comment {color:green;}
- .dp-py .string {color:red;}
- .dp-py .docstring {color:green;}
- .dp-py .keyword {color:blue;font-weight:700;}
- .dp-py .builtins {color:#ff1493;}
- .dp-py .magicmethods {color:gray;}
- .dp-py .exceptions {color:#A52A2A;}
- .dp-py .types {color:#A52A2A;font-style:italic;}
- .dp-py .commonlibs {color:#8A2BE2;font-style:italic;}
- .dp-rb .comment {color:#c00;}
- .dp-rb .string {color:#f0c;}
- .dp-rb .symbol {color:#02b902;}
- .dp-rb .keyword {color:#069;}
- .dp-rb .variable {color:#6cf;}
- .dp-css .comment {color:green;}
- .dp-css .string {color:red;}
- .dp-css .keyword {color:blue;}
- .dp-css .colors {color:#8B0000;}
- .dp-css .vars {color:#d00;}
- .dp-j .comment {color:#3f7f5f;}
- .dp-j .string {color:#2a00ff;}
- .dp-j .keyword {color:#7f0055;font-weight:700;}
- .dp-j .annotation {color:#646464;}
- .dp-j .number {color:#C00000;}
- .dp-cpp .comment {color:green;}
- .dp-cpp .string {color:red;}
- .dp-cpp .preprocessor {color:#CD00CD;font-weight:700;}
- .dp-cpp .keyword {color:#5697D9;font-weight:700;}
- .dp-cpp .datatypes {color:blue;font-weight:700;}
复制代码 3、并修改第13行代码:
原代码:
ul li { list-style:none; }
修改:
ul{ list-style:none; }
4、并在文章模板页加入以下的js代码。
=========================================================
<script>
//以下是实现复制的代码,请自己添加
//javascript
function $(id){
return document.getElementById(id);
}
//复制文本
function copyIdText(id) {
copy( $(id).innerText,$(id) );
}
function copyIdHtml(id) {
copy( $(id).innerHTML,$(id) );
}
function copy(txt,obj) {
if(window.clipboardData) {
window.clipboardData.clearData();
window.clipboardData.setData("Text", txt);
alert("复制成功!")
if(obj.style.display != 'none'){
var rng = document.body.createTextRange();
rng.moveToElementText(obj);
rng.scrollIntoView();
rng.select();
rng.collapse(false);
}
}
else
alert("请选中文本,使用 Ctrl+C 复制!");
}
</script>
OK 解决了~!
上图看效果:
图一:
图二:
图三:
图四:
本人乃菜鸟一个,有不足之处,望指教~! |