📄 newsedit.asp
字号:
function makeRectangularDropShadow(el, color, size)
{
var i;
for (i=size; i>0; i--)
{
var rect = document.createElement('div');
var rs = rect.style
rs.position = 'absolute';
rs.left = (el.style.posLeft + i) + 'px';
rs.top = (el.style.posTop + i) + 'px';
rs.width = el.offsetWidth + 'px';
rs.height = el.offsetHeight + 'px';
rs.zIndex = el.style.zIndex - i;
rs.backgroundColor = color;
var opacity = 1 - i / (i + 1);
rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
el.insertAdjacentElement('afterEnd', rect);
global.fo_shadows[global.fo_shadows.length] = rect;
}
}
function scolor(obj)
{
obj.style.backgroundColor="";
}
function rcolor(obj)
{
obj.style.backgroundColor="#E1F4EE";
}
</script>
<script language="javascript">
<!--
function checkdata()
{
if (document.form1.title.value=="")
{
alert("对不起,请输入文章标题!")
document.form1.title.focus()
return false
}
}
function MM_goToURL() { //v3.0
var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}
function MM_openBrWindow(theURL,winName,features) { //v3.0
window.open(theURL,winName,features);
}
//-->
</script>
<script language="JavaScript">
<!-- Hide from older browsers...
//Function to format text in the text box
function FormatText(command, option){
frames.message.document.execCommand(command, true, option);
frames.message.focus();
}
//Function to add image
function AddImage(){
imagePath = prompt('请输入图片地址', 'http://');
if ((imagePath != null) && (imagePath != "")){
frames.message.document.execCommand('InsertImage', false, imagePath);
frames.message.focus();
}
frames.message.focus();
}
//Function to clear form
function ResetForm(){
if (window.confirm('确认要清空对话框内容?')){
frames.message.document.body.innerHTML = '';
return true;
}
return false;
}
//Function to open pop up window
function openWin(theURL,winName,features) {
window.open(theURL,winName,features);
}
function setMode(newMode)
{
bTextMode = newMode;
var cont;
if (bTextMode) {
cleanHtml();
cleanHtml();
cont=message.document.body.innerHTML;
message.document.body.innerText=cont;
} else {
cont=message.document.body.innerText;
message.document.body.innerHTML=cont;
}
message.focus();
}
function cleanHtml()
{
var fonts = message.document.body.all.tags("FONT");
var curr;
for (var i = fonts.length - 1; i >= 0; i--) {
curr = fonts[i];
if (curr.style.backgroundColor == "#ffffff") curr.outerHTML = curr.innerHTML;
}
}
// -->
</script>
<script language="JavaScript">
function tablecommand(command)
{
var cellflag=false;
var rowflag=false;
var tableflag=false;
var cellindex,rowindex,tableref;
message.focus();
var xsel=message.document.selection;
var xobj=message.document.selection.createRange();
if(xsel.type=="None"||xsel.type=="Text"){
xsel=xobj.parentElement();
while(xsel.tagName!="BODY"&&cellflag==false){
if(xsel.tagName=="TD"){cellindex=xsel.cellIndex;cellflag=true;}
if(cellflag==false){xsel=xsel.parentElement;}
}
}else if(xsel.type=="Control"){
xsel=xobj.item(0);
if(xsel.tagName=="TD"){
cellindex=xsel.cellIndex;
cellflag=true;
}else{
while(xsel.tagName!="BODY"&&cellflag==false){
if(xsel.tagName=="TD"){cellindex=xsel.cellIndex;cellflag=true;}
if(cellflag==false){xsel=xsel.parentElement;}
}
}
}
if(cellflag==true){
xsel=message.document.selection;
xobj=message.document.selection.createRange();
if(xsel.type=="None"||xsel.type=="Text"){
xsel=xobj.parentElement();
while(xsel.tagName!="BODY"&&rowflag==false){
if(xsel.tagName=="TR"){
rowindex=xsel.rowIndex;
rowflag=true;
}
if(rowflag==false){xsel=xsel.parentElement;}
}
}else if(xsel.type=="Control"){
xsel=xobj.item(0);
if(xsel.tagName=="TR"){
rowindex=xsel.rowIndex;
rowflag=true;
}else{
while(xsel.tagName!="BODY"&&rowflag==false){
if(xsel.tagName=="TR"){
rowindex=xsel.rowIndex;
rowflag=true;
}
if(rowflag==false){
xsel=xsel.parentElement;
}
}
}
}
xsel=message.document.selection;
xobj=message.document.selection.createRange();
if(xsel.type=="None"||xsel.type=="Text"){
xsel=xobj.parentElement();
while(xsel.tagName!="BODY"&&tableflag==false){
if(xsel.tagName=="TABLE"){tableflag=true;}
if(tableflag==false){xsel=xsel.parentElement;}
}
}else if(xsel.type=="Control"){
xsel=xobj.item(0);
if(xsel.tagName=="TABLE"){
tableflag=true;
}else{
while(xsel.tagName!="BODY"&&tableflag==false){
if(xsel.tagName=="TABLE"){tableflag=true;}
if(tableflag==false){xsel=xsel.parentElement;}
}
}
}
if(command==3){
var temprowcount=xsel.rows.length;
var tempcell;
var tempspancount=0;
var tempspanholder;
var tempcellwidth=xsel.rows[rowindex].cells[cellindex].width;
var xpositequiv=-1;
var xposcount=0;
while(xposcount<=cellindex){
xpositequiv+=parseInt(xsel.rows[rowindex].cells[xposcount].colSpan);
xposcount++;
}
var ypositequiv=-1;
var yposcount=0;
var ymax=xsel.rows[rowindex].cells.length;
while(yposcount<=ymax-1){
ypositequiv+=parseInt(xsel.rows[rowindex].cells[yposcount].colSpan);
yposcount++;
}
var idealinsert=xpositequiv+1;
var zi2=0;
var zirowtouse=0;
var zirowtot=xsel.rows.length;
var rowarray=new Array(zirowtot);
var rowarray2=new Array(zirowtot);
for(init1=0;init1<=zirowtot-1;init1++){
rowarray[init1]=0;
rowarray2[init1]=0;
}
for(zi1=0;zi1<=zirowtot-1;zi1++){
zi2=0;
while(zi2<idealinsert&&(rowarray[zi1]==null||rowarray[zi1]<idealinsert)){
rowarray[zi1]+=parseInt(xsel.rows[zi1].cells[zi2].colSpan);
rowarray2[zi1]++;
zi2++;
}
}
var allequal=true;
var zi3a,zi3b;
var zthemax=0;
for(zi3=0;zi3<=zirowtot-1;zi3++){
zi3a=rowarray[0];
zi3b=rowarray[zi3];
if(zi3b>zthemax){zthemax=zi3b;}
if(zi3a!=zi3b){allequal=false;}
}
if(allequal==false){
var zi4=0;
var allequal2=true;
while(zthemax<=ypositequiv&&allequal==false){
for(zi5=0;zi5<=zirowtot-1;zi5++){
rowarray[zi5]+=parseInt(xsel.rows[zi5].cells[rowarray2[zi5]].colSpan);
}
for(zi3=0;zi3<=zirowtot-1;zi3++){
zi3a=rowarray[0];
zi3b=rowarray[zi3];
if(zi3b>zthemax){zthemax=zi3b;}
if(zi3a!=zi3b){allequal2=false;}
}
if(allequal2==true){allequal=true;}
for(zi8=0;zi8<=zirowtot-1;zi8++){rowarray2[zi8]++;}
}
}
var zi9;
for(zi7=0;zi7<=zirowtot-1;zi7++){
zi9=xsel.rows[zi7].insertCell(rowarray2[zi7]);
zi9.width=tempcellwidth;
}
}else if(command==4){
var temprowcount=xsel.rows.length;
for(iccount=0;iccount<=temprowcount-1;iccount++){
xsel.rows[iccount].deleteCell(cellindex);
}
}else if(command==1){
var tempcell;
var tempcellb;
var tempcellcount=xsel.rows[rowindex].cells.length;
var cellcolarray=new Array(tempcellcount);
var cellrowarray=new Array(tempcellcount);
for(cacount=0;cacount<=tempcellcount-1;cacount++){
cellcolarray[cacount]=xsel.rows[rowindex].cells(cacount).colSpan;
cellrowarray[cacount]=xsel.rows[rowindex].cells(cacount).rowSpan;
}
tempcell=xsel.insertRow(rowindex);
for(cbcount=0;cbcount<=tempcellcount-1;cbcount++){
tempcellb=tempcell.insertCell();
if(cellcolarray[cbcount]!=1){tempcellb.colSpan=cellcolarray[cbcount];}
}
}else if(command==2){
var temprowcount=xsel.rows.length;tempcell=xsel.deleteRow(rowindex);
}else if(command==5){
if(xsel.rows[rowindex].cells[cellindex+1]){
var x=parseInt(xsel.rows[rowindex].cells[cellindex].colSpan)+parseInt(xsel.rows[rowindex].cells[cellindex+1].colSpan);
var y=xsel.rows[rowindex].cells[cellindex].innerHTML+" "+xsel.rows[rowindex].cells[cellindex+1].innerHTML;
xsel.rows[rowindex].deleteCell(cellindex+1);
xsel.rows[rowindex].cells[cellindex].colSpan=x;
xsel.rows[rowindex].cells[cellindex].innerHTML=y;
}
}else if(command==6){
var yatemprow=xsel.rows.length;
var yamax=0;
for(ya1=0;ya1<=yatemprow-1;ya1++){
var ypositequiv=-1;
var yposcount=0;
var ymax=xsel.rows[ya1].cells.length;
while(yposcount<=ymax-1){
ypositequiv+=parseInt(xsel.rows[ya1].cells[yposcount].colSpan);
yposcount++;
}
if(ypositequiv>yamax){yamax=ypositequiv;}
}
var rowarray=new Array();
var rowarray2=new Array();
var myrowcount=xsel.rows.length;
for(ra1=0;ra1<=myrowcount-1;ra1++){
rowarray[ra1]=new Array();
rowarray2[ra1]=0;
for(cr1=0;cr1<=yamax;cr1++){rowarray[ra1][cr1]=777;}
}
var tempra;
var ra2=0;
for(ra3=0;ra3<=yamax;ra3++){
ra2=0;
while(ra2<=myrowcount-1){
if(xsel.rows[ra2].cells[ra3]){
tempra=parseInt(xsel.rows[ra2].cells[ra3].rowSpan);
if(tempra>1){
rowarray[ra2][ra3]=ra3+rowarray2[ra2];
for(zoo=1;zoo<=tempra-1;zoo++){rowarray2[ra2+zoo]--;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -