站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Javascript 专题Freeonline在线编辑器(自由软件)

Freeonline在线编辑器(自由软件)

摘要: Freeonline在线编辑器(自由软件)


<textarea id=xxcode style='width:100%;height:100%'>
<textarea style='display:none' name=xxabout>
Freeonline[Version8],Copyright(C)2003,Bxxxr
本程序是自由软件,遵循GPL,没有任何担保。详细情况请参阅GNU通用公共许可证。http://www.gnu.org/
本程序是用JavaScript在网吧里写的。(98SE IE5 CR1G 128M)它的基本用途是在线编写脚本程序,还有一些小功能。
Email:bxxxr@yahoo.com.cn
&lt;/textarea>
<textarea style='display:none' name=xxhelp>
状态切换(Esc或RightClick)
运行(F5或Ctrl+Enter)
帮助(F1)
&lt;/textarea>
<script>
function window.onbeforeunload(){
if (event.clientY<0 && event.clientX>document.body.clientWidth-20
|| event.clientY<0 && event.clientX<20
|| event.altKey
|| event.clientY>document.body.clientHeight)
event.returnValue='Exit freeonline ?'
}

function window.onload()
{
document.title=xxabout.value
self.moveTo(-4,-4)
self.resizeTo(screen.availWidth+8,screen.availHeight+8)
xxcodearea.select()
xxsource.value=window.location.href
xxmenudiv.style.visibility="visible"
linebar.checked=1
xxlinenum()
}

function xxrun()
{
xxwww=xxcodearea.value;
xxrrr=open('','','');
xxrrr.document.open();
xxrrr.document.write(xxwww);
xxrrr.document.close();
}

function document.onkeydown()
{
if(event.ctrlKey&&event.keyCode==13)
{
xxrun()
}
else if(event.keyCode==116)
{
event.keyCode=0
event.returnValue=false
xxrun()
}
else if(event.keyCode==27)
{
event.keyCode=0
event.returnValue=false
if(xxmenudiv.style.visibility=="visible")
{
xxmenudiv.style.visibility="hidden"
}
else if(xxmenudiv.style.visibility=="hidden")
{
xxmenudiv.style.visibility="visible"
}
}
}

function document.onhelp()
{
alert(xxhelp.value)
return false
}

function xxlinenum()
{
if(linebar.checked)
{
xxlinediv.style.visibility="visible"
var xxthenum=xxcodearea.value
xxthenum=xxthenum.split('\n')
xxthenum=xxthenum.length
xxlinearea.cols=xxthenum.toString().length
xxcodediv.style.left=xxlinediv.clientWidth
xxcodediv.style.width=document.body.clientWidth-xxlinediv.clientWidth

xxlinearea.value=''
var xxc=1
while(xxthenum!=xxc-1)
{
var xxc1=xxthenum.toString().length-xxc.toString().length
while(xxc1!=0)
{
xxlinearea.value=xxlinearea.value+'0'
xxc1--
}
xxlinearea.value=xxlinearea.value+xxc
xxc++
}
}
else
{
xxlinediv.style.visibility="hidden"
xxcodediv.style.left=0
xxcodediv.style.width=document.body.clientWidth
}
}
</script>

<body bgcolor=menu style=border:none scroll=no topmargin=0 leftmargin=0>

style="position:absolute;
top:0;
left:0;
height:100%;
overflow:none;">
<textarea id=xxlinearea readonly border:#ae34f8 solid 0px;
font-size: 12px; font-family: 宋体;
height:100%;
overflow:hidden">
&lt;/textarea>

style="position:absolute;
top:0;
left:0;
width:90%;
height:100%;
overflow:none;">
<textarea id=xxcodearea wrap=off onPropertyChange='xxlinenum();'
oncontextmenu='window.event.returnValue=false;xxmenudiv.style.visibility="visible";'
style="border:#ae34f8 solid 0px;
font-size: 12px; font-family: 宋体;
width:100%;
height:100%;
overflow:auto">
&lt;/textarea>

oncontextmenu='window.event.returnValue=false;xxmenudiv.style.visibility="hidden";'
style="background-color:menu;
filter:alpha(opacity=60);
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
overflow:auto;">
<input onclick='xxmenudiv.style.visibility="hidden";xxrun();' value="运行">


<table border="1" cellpadding="0" cellspacing="0">
<tr>
<td height=1>
<input onclick='xxmenudiv.style.visibility="hidden"' type=button

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Undo")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Redo")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Cut")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Copy")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Paste")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("Delete")'

<input onclick='xxmenudiv.style.visibility="hidden";xxcodearea.focus();document.execCommand("SelectAll")'

</td>
</tr>
</table>


<input TYPE=checkbox id=linebar onclick=xxlinenum()>行号


<input onclick='xxmenudiv.style.visibility="hidden";window.open(location.href,"","");'
<form style="display:inline" action="file:///c|/My Documents/"
<input onclick='xxmenudiv.style.visibility="hidden"' type="submit" </form> &nbsp;
<input onclick='xxmenudiv.style.visibility="hidden";alert(xxabout.value);'
<input onclick='xxmenudiv.style.visibility="hidden";alert(xxhelp.value);'



<input type="text" name="xxsource">
<input onclick='xxmenudiv.style.visibility="hidden";window.location="view-source:"+xxsource.value;'

</body>
</textarea>

<script>
function window.onload()
{
xxclose.Click()
var xxclone=window.open("","","resizable=1,status=1")
xxclone.document.open()
xxclone.document.write(xxcode.value)
xxclone.document.close()
}
</script>

</td> </tr> <tr> <td vAlign=top align=left height="100%">
↑返回目录
前一篇: 类似 MSDN CSDN 左边导航树效果的实现! [JavaScript + ASP]
后一篇: 相当于delphi的日历控件