📄 code.js
字号:
/**
* @public
*/
function Code(){
}
//alert(1)
if(!/KHTML\/[123]\./.test(navigator.userAgent)){
$import(this.scriptPackage.name.replace(/\./g,'/')+"/code.css");
}
var scriptBase = this.scriptPackage.scriptBase;
Code.prototype = new Decorator();
Code.prototype.before = function(){
}
Code.prototype.decorate = function(){
var container = this.getContainer();
var content = null;
var e = container.firstChild;
while(e){
if(e.nodeType == 1){
if(e.tagName.toUpperCase() == 'TEXTAREA'){
content = e.value;
break;
}
}
e = e.nextSibling;
}
if(content!=null){
var p = new ECMAParser(content);
p.parse();
it = p.buildLineIterator();
var tp = new Template($package.scriptBase + "code.xhtml");
tp.doc = tp.doc.getElementsByTagName("table")[0];
//while(it.hasNext()){
// lines.push(it.next());
//}
if(window.showModalDialog){
var helpCommand = "window.showModalDialog('"+scriptBase+"code-about.html',null,'center:1;dialogWidth:350px;dialogHeight:168px;status:no;scroll:no')"
var printCommand = "alert('未实现')";
var viewCommand = "alert('未实现')";
}else{
var helpCommand = "window.open('"+scriptBase+"code-about.html','_blank','menubar=0,resizable=0,scrollbars=0,status=1,width=350px,height=168px,dependent=1,modal=1')"
var printCommand = "alert('未实现')";
var viewCommand = "alert('未实现')";
}
var out = new Writer();
tp.render({
lines:it,
helpCommand:helpCommand,
printCommand:printCommand,
viewCommand:viewCommand
},out);
container.innerHTML = out.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -