📄 main.html
字号:
function fisEditable(obj)
{
if(oo){
(obj.checked)?oo.contentEditable=true:oo.contentEditable=false
}
}
//工具栏右上角按钮
function fEditTool(obj,isHighlight)
{
if(!obj) return;
if(isHighlight==1){
obj.filters.alpha.opacity=60;
obj.style.cursor="hand";
}
else
obj.filters.alpha.opacity=100;
}
//关闭浮动工具框
function fClsTool()
{
with(oTool.style){
if(display=="block"){
fHide(oTool);
}
}
}
function fHide(obj)
{
if(obj.filters.alpha.opacity!=0){
obj.filters.alpha.opacity-=10;
setTimeout("fHide(oTool)",1)
}
else{
obj.style.display="none";
obj.style.top=0;
obj.style.left=0;
}
}
//最小化浮动工具栏
function fMinTool()
{
if(oTool.style.display=="block"&&sToolStatus!="min"){
sys_subTool.style .display ="none";
fMinimize();
}
}
function fMinimize()
{
with(oTool.style){
if(parseInt(width)>120){
width=parseInt(width)-10;
height=parseInt(height)-4;
setTimeout("fMinimize()",1);
}
else{
sToolStatus="min";
sys_ToolMin.src ="images/max.gif";
fMovetoBaseline();
}
}
}
function fMovetoBaseline()
{
with(oTool.style){
if(parseInt(top)<cHeight-parseInt(height)-30){
top=parseInt(top)+20;
setTimeout("fMovetoBaseline()",1);
}
//left=5;
}
}
//还原浮动工具栏
function fMaxTool()
{
if(sToolStatus=="min"){
with(oTool.style){
if(parseInt(top)+120>cHeight)
top=cHeight -170;
if(parseInt(left)+400>cWidth)
left=cWidth -400;
}
fExpaning();
}
}
function fExpaning()
{
with(oTool.style){
if(parseInt(width)<400){
width=parseInt(width)+parseInt(10);
height=parseInt(height)+4;
setTimeout("fExpaning()",1);
}
else{
sys_ToolMin.src="images/min.gif"
sToolStatus="normal";
sys_subTool.style .display ="block";
}
}
}
//清空当前层的内容
function fClearDiv()
{
if(!oo) return;
if(confirm("确定要清空当前层内所有内容吗?")){
oo.innerHTML="";
}
}
//判断最小化/最大化
function fMinorMax(obj)
{
if(sToolStatus=="normal") fMinTool();
else
fMaxTool();
}
//插入表格
function fInsertTable()
{
if(!oo) return;
var tables=window.showModalDialog ("tools/table.htm","","dialogWidth:23.6em; dialogHeight:11.3em; status:0")
fApplyInsert(oo,tables);
}
//插入图片
function fInsertImg()
{
if(!oo) return;
var imgs=window.showModalDialog ("tools/pic.htm","","dialogWidth:30em; dialogHeight:13em; status:0");
if(imgs!=""){
fApplyInsert(oo,imgs);
}
}
//插入本地图片
function fInsertLocalImg()
{
if(!oo) return;
var localimg=window.showModalDialog("tools/localpic.htm","","dialogWidth:30em;dialogHeight:13em;status:0");
if(localimg!=""){
var local=localimg.split("|");
var ohidden=document.createElement ("input");
ohidden.type="hidden";
ohidden.id=local[1];
ohidden.value=local[2];
sys_upload.appendChild (ohidden);
fApplyInsert(oo,local[0]);
}
}
//插入文本
function fInsertText()
{
if(!oo) return;
//var text=window.showModalDialog ("tools/text.htm","","dialogWidth:460px;dialogHeight:490px;status=0")
var owin=window.open ("tools/text.htm","","width=460px,height=470px,resizable=no;menubar=no,status=no,location=no,toolbar=no")
}
function fInsertTextStep2()
{
if(!oo) return;
fApplyInsert(oo,sys_tmpTxt.sys_text.value);
}
//插入电子邮件地址
function fInsertEmail()
{
if(!oo) return;
var email=window.showModalDialog ("tools/email.htm","","dialogWidth:30em;dialogHeight:8em;status:0")
fApplyInsert(oo,email);
}
//插入超级链接
function fInsertLink()
{
if(!oo) return;
var link=window.showModalDialog ("tools/link.htm","","dialogWidth:30em;dialogHeight:10em;status:0;")
fApplyInsert(oo,link);
}
//插入导航栏
function fInsertNavi()
{
if(!oo) return;
var navi=window.showModalDialog ("tools/navigator.htm","","dialogWidth:800px;dialogHeight:200px;status:0;")
fApplyInsert(oo,navi)
}
//插入层
function fInsertDiv()
{
//if(oo) return;
var divpara=window.showModalDialog("tools/div.htm","","dialogWidth:20em;dialogHeight:10em;status:0");
if(divpara!=null){
var arr=divpara.split("|");
if(arr.length!=4) return false;
oo=createDiv();
with(oo.style){
top=arr[0];
left=arr[1];
width=arr[2];
height=arr[3];
display="block";
}
oo.focus();
}
}
//编辑当前层中的HTML代码
function fEditHTML()
{
if(!oo || oo.innerHTML=="") return;
var html=window.showModalDialog ("tools/html.htm",oo,"dialogWidth:31em;dialogHeight:27em;status:0;");
if(html!=null) oo.innerHTML=html;
}
//执行插入动作
function fApplyInsert(obj,sHtml)
{
if(!obj||sHtml==null) return;
if(obj.innerHTML!="") obj.innerHTML+=sHtml;
else
obj.innerHTML=sHtml;
}
//重新开始
function fRenew()
{
var arr=document.all.tags ("div");
var i;
for(i=0;i<arr.length;i++)
if(arr[i].id.substring(0,4)=="user") window.location.reload (true);
}
//提交并生成页面
function fpreSubmit()
{
var arrDiv=document.all.tags ("DIV");
if(arrDiv.length==0) return;
else{
if(confirm("是否提交当前页面?")){
oo=null;
//fnReplaceImgSrc();
if(!fPageGenerate(arrDiv,"generate"))
alert("页面生成失败!")
}
}
}
//页面预览
function fnPagePreview(cate)
{
var arrDiv=document.all.tags ("DIV");
var i;
if(arrDiv.length ==0) return;
if(cate==1){
oo=null;
status="preview";
document.body .style.background ="#ffffff";
fClsTool();
fHideEditTool();
for(i=0;i<arrDiv.length ;i++){
arrDiv[i].className="previewing";
}
with(sys_endpreview.style ){
display="block";
left=event.x;
top=event.y;
}
}
else{
oo=null;
status="ready";
document.body.style.background ="LightGrey";
for(i=0;i<arrDiv.length ;i++){
arrDiv[i].className="usualDiv";
}
sys_endpreview.style .display ="none";
}
//fPageGenerate(arrDiv,"preview");
}
//生成页面元素信息并提交
function fPageGenerate(arrObj,action)
{
var arrDiv=new Array();
var arrDivHTML=new Array();
var i;
var sDiv="",sDivHTML="";
//var oDiv=document.all.tags("DIV");
if(arrObj.length!=0){
for(i=0;i<arrObj.length;i++){
if(arrObj[i].id.substring(0,4).toLowerCase()=="user"){
with(arrObj[i]){
arrDiv[i]= id + "|";
//arrDiv[i]+= zIndex + "|";
arrDiv[i]+= style.pixelLeft + "|";
arrDiv[i]+= style.pixelTop + "|";
arrDiv[i]+= style.pixelWidth + "|";
arrDiv[i]+= style.pixelHeight ;
arrDivHTML[i]=innerHTML;
}
sDiv+=arrDiv[i] + "||";
sDivHTML+=arrDivHTML[i] + "||";
}
else continue;
}
sDiv=sDiv.substring(0,sDiv.length-2);
sDivHTML=sDivHTML.substring(0,sDivHTML.length-2);
}
else
return false;
sys_pageSubmit.sys_divPosition.value=sDiv;
sys_pageSubmit.sys_divHTML.value=sDivHTML;
switch (action.toLowerCase()){
case "generate":
window.open ("multiupload.aspx",'','');
sys_pageSubmit.submit();
break;
case "preview":
window.open("preview.htm","","");
break;
default:
sys_pageSubmit.sys_divPosition .value ="";
sys_pageSubmit.sys_divHTML.value ="";
return false;
break;
}
return true;
}
//编辑页面基本信息
function feditInfo()
{
var info=window.showModalDialog("tools/info.htm",window,"dialogWidth:33em;dialogHeight:17em;status:0");
if(info!=""){
var ai=info.split("|");
sys_pageSubmit.sys_head.value=ai[0];
sys_pageSubmit.sys_filename.value=ai[2];
sys_pageSubmit.sys_title.value=ai[1];
}
}
</script>
<script language="VBScript">
'从完整路径中获得纯文件名
public function fnGetFilename(sfull)
if sfull="" or instr(1,sfull,".")=0 then
fnGetFilename=false
else
dim pos
do until instr(1,sfull,"\")=0
pos=instr(1,sfull,"\")
sfull=right(sfull,len(sfull)-pos)
start=pos+1
loop
fnGetFilename=sfull
end if
end function
</script>
</head>
<body name="wholebody" bgcolor=LightGrey ondragstart="return false" onselectstart="return false;">
<!-- System Toolbox-->
<table id=sys_toolbox border="0" cellpadding="0" cellspacing="0" bgcolor="#990000" style="display:none;position:absolute;left:0;top:0;width:400;height:120;z-index:99;filter:alpha(OPACITY=100)">
<tr>
<td><table width="100%" height="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td bgcolor="#8B0000"><font id=sys_toolTip onmouseover="fChgCursor(this,'hand')" onmousedown="fMoveToolBox()" color="ffffff">系统工具</font></td>
<td align="right" bgcolor="#8B0000">
<img id="sys_ToolMin" src="images/min.gif" onmouseout="fEditTool(this,0)" onmouseover="fEditTool(this,1)" onclick="fMinorMax(this)" style="filter:alpha(OPACITY=100)">
<img id="sys_ToolClose" src="images/cls.gif" onmouseout="fEditTool(this,0)" onmouseover="fEditTool(this,1)" onclick="fClsTool()" style="filter:alpha(OPACITY=100)">
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><table height="100%" width="100%" border="0" cellspacing="1" cellpadding="0" id=sys_subTool>
<tr>
<td bgcolor="#f5fffa" colspan="2">
<table width="100%" border="0" cellspacing="1" cellpadding="3" id=sys_divedit>
<tr>
<td>当前层 <input type="text" id=sys_currentDivId class="text60">
层列表 <select id=sys_divlist onchange="fShowAttrib(this.options[this.selectedIndex].text)" style="width:70px">
<option value="">请选择</option>
</select>
锁定该层 <input type="checkbox" id=sys_islock onclick="fLockDiv(this)">
编辑 <input type="checkbox" id=sys_isEditable onclick="fisEditable(this)">
</td>
</tr>
<tr>
<td>顶端:<input type="text" id="sys_currentDivTop" class="text30" onkeypress="fApplyDivAdjust(this.value,'top')" onblur="fApplyDivAdjust(this.value,'top')"> px
左端:<input type="text" id="sys_currentDivLeft" class="text30" onkeypress="fApplyDivAdjust(this.value,'left')" onblur="fApplyDivAdjust(this.value,'left')"> px
高:<input type="text" id="sys_currentDivHeight" class="text30" onkeypress="fApplyDivAdjust(this.value,'height')" onblur="fApplyDivAdjust(this.value,'height')"> px
宽:<input type="text" id="sys_currentDivWidth" class="text30" onkeypress="fApplyDivAdjust(this.value,'width')" onblur="fApplyDivAdjust(this.value,'width')"> px
</td>
</tr>
<tr>
<td>移动单位 <input type="text" id="sys_movestep" class="text30" onblur="fCheck(this.value)" value=1>px
<input type="button" id=sys_moveUp onclick="fMoveStep('up')" value="上" class="button40">
<input type="button" id=sys_moveDown onclick="fMoveStep('down')" value="下" class="button40">
<input type="button" id=sys_moveLeft onclick="fMoveStep('left')" value="左" class="button40">
<input type="button" id=sys_moveRight onclick="fMoveStep('right')" value="右" class="button40">
<input type="button" id=sys_delDiv onclick="fDelDiv()" value="删除该层" class="del">
<input type="button" id=sys_clearDiv onclick="fClearDiv()" class="del" value="清空">
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="ffffff">
<td colspan="2">
<table id=sys_functions width="100%" border="0" cellspacing="0" cellpadding="1">
<tr bgcolor="#ECE9D8">
<td><img alt="插入新层" id=sys_insertDiv src="images/div.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertDiv()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="重新开始" id=sys_Renew src="images/ref.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fRenew()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="插入表格" id=sys_insertTable src="images/table.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertTable()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="从网络插入图片" id=sys_insertImg src="images/image.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertImg()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="从本地插入图片" id=sys_insertLocalImg src="images/localimg.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertLocalImg()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="插入文本" id=sys_insertText src="images/textEdit.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertText()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="插入超级链接" id=sys_insertLink src="images/link.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertLink()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="插入导航栏" id=sys_insertEmail src="images/navigator.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertNavi()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="插入电子邮件地址" id=sys_insertEmail src="images/email.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fInsertEmail()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="编辑当前层HTML代码" id=sys_editHTML src="images/htm.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fEditHTML()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="网页基本信息" id=sys_editPageInfo src="images/ifo.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="feditInfo()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="页面预览" id=sys_pagePreview src="images/preview.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fnPagePreview(1)" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="生成页面" id=sys_pageGenerate src="images/gen.gif" onmouseover="fEditTool(this,1)" onmouseout="fEditTool(this,0)" onclick="fpreSubmit()" style="filter:alpha(OPACITY=100)"></td>
<td><img alt="根据文本编辑器的返回值向当前层添加内容" id=sys_insertTextStep2 src="images/textEdit.gif" onclick="fInsertTextStep2()" style="display:none"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2" bgcolor="#FFFFFF" id=sys_status></td>
</tr>
</table></td>
</tr>
</table>
<!-- Change DIV size , cs=ChangeSize -->
<img id=sys_csleft class="cs" src="images/cs.gif" onmouseover="fChgCursor(this,'e-resize')" onclick="fChgSize(this,'left')">
<img id=sys_csright class="cs" src="images/cs.gif" onmouseover="fChgCursor(this,'w-resize')" onmousedown="fChgSize('right')">
<img id=sys_csup class="cs" src="images/cs.gif" onmouseover="fChgCursor(this,'s-resize')" onclick="fChgSize('up')">
<img id=sys_csdown class="cs" src="images/cs.gif" onmouseover="fChgCursor(this,'n-resize')" onmousedown="fChgSize('down')">
<img id=sys_csmoving class="cs" src="images/cs.gif" onmouseover="fChgCursor(this,'move')" onmousedown="fMove()">
<!-- Save the page information and submit to ASP programme -->
<form id=sys_pageSubmit method="post" action="generatePage.asp" target="_blank">
<input type="hidden" name="sys_divPosition">
<input type="hidden" name="sys_divHTML">
<input type="hidden" name="sys_head" id="sys_head" value="<META NAME='Author' CONTENT=''><META NAME='Keywords' CONTENT=''><META NAME='Description' CONTENT=''>">
<input type="hidden" name="sys_filename" id="sys_filename" value="default.htm">
<input type="hidden" name="sys_title" id="sys_title" value="默认网页">
</form>
<!-- Save the temp text info -->
<form id=sys_tmpTxt>
<textarea id=sys_text style="display:none"></textarea>
</form>
<!-- End preview -->
<input type="button" id=sys_endpreview value="结束预览" style="position:absolute;display:none;z-index:99" onclick="fnPagePreview(0)">
<!-- Upload files-->
<form id=sys_upload method="post" target="_blank">
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -