-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEditor.asp
1636 lines (1509 loc) · 56.5 KB
/
Editor.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<html>
<head>
<title>HTML在线编辑器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="STYLESHEET" type="text/css" href="editor.css">
<script language="JavaScript" type="text/JavaScript">
//菜单列表
var menu_table="<table width='100%' cellspacing='0' cellpadding='2'>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_cr.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertTable()'>插入表格</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_sx.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tableProp()'>表格属性</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_sx2.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='cellProp()'>单元格属性</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_tr.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(1)'>插入一行</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_trdel.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(2)'>删除一行</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_td.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(3)'>插入一列</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_tddel.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(4)'>删除一列</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_hby.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(5)'>向右合并</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_hbx.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(6)'>向下合并</a></td></tr>";
menu_table+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/table_cf.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='tablecommand(7)'>拆分单元格</a></td></tr>";
menu_table+="</table>";
var menu_chars="<table width='100%' cellspacing='0' cellpadding='2'>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars1.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(0)'>换行符</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars2.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(1)'>版权符号</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars3.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(2)'>注册商标</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars4.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(3)'>商标符号</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars5.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(4)'>圆点</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars6.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(5)'>省略号</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars7.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(6)'>破折号</a></td></tr>";
menu_chars+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/chars8.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertChars(7)'>中划线</a></td></tr>";
menu_chars+="</table>";
var menu_eq="<table width='100%' cellspacing='0' cellpadding='2'>";
menu_eq+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/eq1.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InsertEQ()'>插入公式</a></td></tr>";
menu_eq+="<tr onmouseout='scolor(this)' onmouseover='rcolor(this)'><td><img src='Images/Editor/eq2.gif' width='16' height='16' align='absmiddle'></td><td><a href='#' onclick='InstallEQ()'>安装公式编辑器插件</a></td></tr>";
menu_eq+="</table>";
//下拉菜单相关代码
var h;
var w;
var l;
var t;
var topMar = 1;
var leftMar = -2;
var space = 1;
var isvisible;
var MENU_SHADOW_COLOR='#E1F4EE';//定义下拉菜单阴影色
var global = window.document
global.fo_currentMenu = null
global.fo_shadows = new Array
function HideMenu()
{
var mX;
var mY;
var vDiv;
var mDiv;
if (isvisible == true)
{
vDiv = document.all("menuDiv");
mX = window.event.clientX + document.body.scrollLeft;
mY = window.event.clientY + document.body.scrollTop;
if ((mX < parseInt(vDiv.style.left)) || (mX > parseInt(vDiv.style.left)+vDiv.offsetWidth) || (mY < parseInt(vDiv.style.top)-h) || (mY > parseInt(vDiv.style.top)+vDiv.offsetHeight)){
vDiv.style.visibility = "hidden";
isvisible = false;
}
}
}
function ShowMenu(vMnuCode,tWidth) {
vSrc = window.event.srcElement;
vMnuCode = "<table id='submenu' cellspacing=1 cellpadding=3 style='width:"+tWidth+"' class=menu onmouseout='HideMenu()'><tr height=23><td nowrap align=left class=MenuBody>" + vMnuCode + "</td></tr></table>";
h = vSrc.offsetHeight;
w = vSrc.offsetWidth;
l = vSrc.offsetLeft + leftMar+4;
t = vSrc.offsetTop + topMar + h + space-2;
vParent = vSrc.offsetParent;
while (vParent.tagName.toUpperCase() != "BODY")
{
l += vParent.offsetLeft;
t += vParent.offsetTop;
vParent = vParent.offsetParent;
}
menuDiv.innerHTML = vMnuCode;
menuDiv.style.top = t;
menuDiv.style.left = l;
menuDiv.style.visibility = "visible";
isvisible = true;
makeRectangularDropShadow(submenu, MENU_SHADOW_COLOR, 4)
}
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="#eeeeee";
}
</script>
</head>
<body bgcolor="#FFFFFF" leftmargin='0' topmargin='0' onmousemove='HideMenu()'>
<div id=menuDiv style='Z-INDEX: 1000; VISIBILITY: hidden; WIDTH: 1px; POSITION: absolute; HEIGHT: 1px; BACKGROUND-COLOR: #9cc5f8'></div>
<div class="yToolbar">
<div class="TBHandle"> </div>
<div class="Btn" TITLE="全部选择" LANGUAGE="javascript" onClick="format('selectall')">
<img class="Ico" src="images/editor/selectall.gif" > </div>
<div class="TBSep"></div>
<div class="Btn" TITLE="剪切" LANGUAGE="javascript" onClick="format('cut')"> <img class="Ico" src="images/editor/cut.gif" >
</div>
<div class="Btn" TITLE="复制" LANGUAGE="javascript" onClick="format('copy')">
<img class="Ico" src="images/editor/copy.gif" > </div>
<div class="Btn" TITLE="粘贴" LANGUAGE="javascript" onClick="format('paste')">
<img class="Ico" src="images/editor/paste.gif" > </div>
<div class="Btn" TITLE="从word中粘贴" LANGUAGE="javascript" onClick="word()"> <img class="Ico" src="images/editor/wordpaste.gif" >
</div>
<div class="TBSep"></div>
<div class="Btn" TITLE="查找替换" LANGUAGE="javascript" onClick="findstr()"><img class="Ico" src="images/editor/findreplace.gif" ></div>
<div class="Btn" TITLE="删除" LANGUAGE="javascript" onClick="format('delete')"><img class="Ico" src="images/editor/del.gif" ></div>
<div class="Btn" TITLE="删除文字格式" LANGUAGE="javascript" onClick="format('RemoveFormat')"><img class="Ico" src="images/editor/clear.gif" ></div>
<div class="TBSep"></div>
<div class="Btn" TITLE="撤消" LANGUAGE="javascript" onClick="format('undo')">
<img class="Ico" src="images/editor/undo.gif" > </div>
<div class="Btn" TITLE="恢复" LANGUAGE="javascript" onClick="format('redo')">
<img class="Ico" src="images/editor/redo.gif" > </div>
<div class="TBSep"></div>
<div class="Btn" TITLE="计算器" LANGUAGE="javascript" onClick="calculator()"> <img class="Ico" src="images/editor/calculator.gif" >
</div>
<div class="TBSep"></div>
<div class="Btn" TITLE="保存" LANGUAGE="javascript" onClick="Insermenu('<%=now()%>')">
<img class="Ico" src="images/editor/save.gif" > </div>
<div class="TBSep"></div>
<div class="Btn" TITLE="查看帮助" LANGUAGE="javascript" onClick="help()"><img class="Ico" src="images/editor/help.gif" >
</div>
<div class="TBSep"></div>
<%
DownClass=trim(request("DownClass"))
if DownClass<>"Down" then
%>
<iframe class="TBGen" style="top:2px" ID="UploadFiles" src="Upload_Product.asp" frameborder=0 scrolling=no width="250" height="25"></iframe>
<%
end if
%>
</div>
<div class="yToolbar">
<div class="TBHandle"> </div>
<select ID="formatSelect" class="TBGen" onChange="format('FormatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected>段落格式</option>
<option VALUE="<P>">普通</option>
<option VALUE="<PRE>">已编排格式</option>
<option VALUE="<H1>">标题一</option>
<option VALUE="<H2>">标题二</option>
<option VALUE="<H3>">标题三</option>
<option VALUE="<H4>">标题四</option>
<option VALUE="<H5>">标题五</option>
<option VALUE="<H6>">标题六</option>
<option VALUE="<H7>">标题七</option>
</select>
<select id="FontName" class="TBGen" onChange="format('fontname',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected>字体</option>
<option value="宋体">宋体</option>
<option value="黑体">黑体</option>
<option value="楷体_GB2312">楷体</option>
<option value="仿宋_GB2312">仿宋</option>
<option value="隶书">隶书</option>
<option value="幼圆">幼圆</option>
<option value="Arial">Arial</option>
<option value="Arial Black">Arial Black</option>
<option value="Arial Narrow">Arial Narrow</option>
<option value="Brush Script MT">Brush Script MT</option>
<option value="Century Gothic">Century Gothic</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="Courier">Courier</option>
<option value="Courier New">Courier New</option>
<option value="MS Sans Serif">MS Sans Serif</option>
<option value="Script">Script</option>
<option value="System">System</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Verdana">Verdana</option>
<option value="Wide Latin">Wide Latin</option>
<option value="Wingdings">Wingdings</option>
</select>
<select id="FontSize" class="TBGen" onChange="format('fontsize',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected>字号</option>
<option value="7">一号</option>
<option value="6">二号</option>
<option value="5">三号</option>
<option value="4">四号</option>
<option value="3">五号</option>
<option value="2">六号</option>
<option value="1">七号</option>
</select>
<div class="TBSep"></div>
<div class="Btn" TITLE="字体颜色" LANGUAGE="javascript" onClick="foreColor()"><img class="Ico" src="images/editor/fgcolor.gif" ></div>
<div class="Btn" TITLE="文字背景色" LANGUAGE="javascript" onClick="backColor()"><img class="Ico" src="images/editor/fgbgcolor.gif" ></div>
<div class="TBSep"></div>
<div class="Btn" TITLE="加粗" LANGUAGE="javascript" onClick="format('bold')">
<img class="Ico" src="images/editor/bold.gif" > </div>
<div class="Btn" TITLE="斜体" LANGUAGE="javascript" onClick="format('italic')">
<img class="Ico" src="images/editor/italic.gif" > </div>
<div class="Btn" TITLE="下划线" LANGUAGE="javascript" onClick="format('underline')">
<img class="Ico" src="images/editor/underline.gif" > </div>
<div class="Btn" TITLE="删除线" LANGUAGE="javascript" onClick="format('StrikeThrough')">
<img class="Ico" src="images/editor/strikethrough.gif" > </div>
<div class="TBSep"></div>
<div class="Btn" TITLE="左对齐" NAME="Justify" LANGUAGE="javascript" onClick="format('justifyleft')"><img class="Ico" src="images/editor/aleft.gif" ></div>
<div class="Btn" TITLE="居中" NAME="Justify" LANGUAGE="javascript" onClick="format('justifycenter')"><img class="Ico" src="images/editor/acenter.gif" ></div>
<div class="Btn" TITLE="右对齐" NAME="Justify" LANGUAGE="javascript" onClick="format('justifyright')"><img class="Ico" src="images/editor/aright.gif" ></div>
<div class="Btn" TITLE="两端对齐" NAME="Justify" LANGUAGE="javascript" onClick="format('JustifyFull')"><img class="Ico" src="images/editor/JustifyFull.gif" ></div>
<div class="Btn" TITLE="绝对或相对位置" LANGUAGE="javascript" onClick="absolutePosition()"><img class="Ico" src="images/editor/abspos.gif" ></div>
</div>
<div class="yToolbar">
<div class="TBHandle"> </div>
<div class="Btn" TITLE="字体变大" LANGUAGE="javascript" onClick="inserteshu('big')"><img class="Ico" src="images/editor/tobig.gif" ></div>
<div class="Btn" TITLE="字体变小" LANGUAGE="javascript" onClick="inserteshu('small')"><img class="Ico" src="images/editor/tosmall.gif" ></div>
<div class="Btn" TITLE="上标" LANGUAGE="javascript" onClick="format('superscript')"><img class="Ico" src="images/editor/sup.gif" ></div>
<div class="Btn" TITLE="下标" LANGUAGE="javascript" onClick="format('subscript')"><img class="Ico" src="images/editor/sub.gif" ></div>
<div class="Btn" TITLE="编号" LANGUAGE="javascript" onClick="format('insertorderedlist')">
<img class="Ico" src="images/editor/num.gif" > </div>
<div class="Btn" TITLE="项目符号" LANGUAGE="javascript" onClick="format('insertunorderedlist')">
<img class="Ico" src="images/editor/list.gif" > </div>
<div class="Btn" TITLE="减少缩进量" LANGUAGE="javascript" onClick="format('outdent')">
<img class="Ico" src="images/editor/outdent.gif" > </div>
<div class="Btn" TITLE="增加缩进量" LANGUAGE="javascript" onClick="format('indent')">
<img class="Ico" src="images/editor/indent.gif" > </div>
<div class="Btn" TITLE="上移一层" LANGUAGE="javascript" onClick="zIndex('forward')"><img class="Ico" src="images/editor/forward.gif" >
</div>
<div class="Btn" TITLE="下移一层" LANGUAGE="javascript" onClick="zIndex('backward')"><img class="Ico" src="images/editor/backward.gif" >
</div>
<div class="TBSep"></div>
<div class="Btn" TITLE="插入超级连接" LANGUAGE="javascript" onClick="UserDialog('CreateLink')">
<img class="Ico" src="images/editor/url.gif" > </div>
<div class="Btn" TITLE="取消超级链接" LANGUAGE="javascript" onClick="UserDialog('unLink')">
<img class="Ico" src="images/editor/nourl.gif" > </div>
<div class="Btn" TITLE="插入普通水平线" LANGUAGE="javascript" onClick="format('InsertHorizontalRule')">
<img class="Ico" src="images/editor/line.gif" > </div>
<div class="Btn" TITLE="插入特殊水平线" LANGUAGE="javascript" onClick="hr()"><img class="Ico" src="images/editor/sline.gif" >
</div>
<div class="TBSep"></div>
<div class="Btn" TITLE="插入输入框" LANGUAGE="javascript" onClick="Insergongneng('input')">
<img class="Ico" src="images/editor/FormText.gif" > </div>
<div class="Btn" TITLE="插入文字输入区" LANGUAGE="javascript" onClick="Insergongneng('textarea')">
<img class="Ico" src="images/editor/FormTextArea.gif" > </div>
<div class="Btn" TITLE="插入单选钮" LANGUAGE="javascript" onClick="Insergongneng('radio')">
<img class="Ico" src="images/editor/FormRadio.gif" > </div>
<div class="Btn" TITLE="插入复选框" LANGUAGE="javascript" onClick="Insergongneng('checkbox')">
<img class="Ico" src="images/editor/FormCheckbox.gif" > </div>
<div class="Btn" TITLE="插入下拉菜单" LANGUAGE="javascript" onClick="Insermenu('<%=now()%>')">
<img class="Ico" src="images/editor/menu.gif" > </div>
<div class="Btn" TITLE="插入按钮" LANGUAGE="javascript" onClick="Insergongneng('bottom')">
<img class="Ico" src="images/editor/FormButton.gif" > </div>
</div>
<div class="yToolbar">
<div class="TBHandle"> </div>
<div class="Btn" TITLE="插入手动分页符" LANGUAGE="javascript" onClick="page()"><img class="Ico" src="images/editor/page.gif" >
</div>
<div class="Btn" TITLE="插入当前日期" LANGUAGE="javascript" onClick="nowdate()"> <img class="Ico" src="images/editor/date.gif" >
</div>
<div class="Btn" TITLE="插入当前时间" LANGUAGE="javascript" onClick="nowtime()"> <img class="Ico" src="images/editor/time.gif" >
</div>
<div class="Btn" TITLE="插入栏目框" LANGUAGE="javascript" onClick="FIELDSET()"><img class="Ico" src="images/editor/fieldset.gif" >
</div>
<div class="Btn" TITLE="插入网页" LANGUAGE="javascript" onClick="iframe()"><img class="Ico" src="images/editor/htm.gif" >
</div>
<div class="Btn" TITLE="插入Excel表格" LANGUAGE="javascript" onClick="excel()"><img class="Ico" src="images/editor/excel.gif" >
</div>
<div class="Btn" TITLE="插入表格" LANGUAGE="javascript" onClick="InsertTable()">
<img class="Ico" src="images/editor/table.gif" > </div>
<div class="BtnMenu" TITLE="表格操作" LANGUAGE="javascript" onClick="ShowMenu(menu_table,100)">
<img class="Ico" src="images/editor/arrow.gif" WIDTH="5" HEIGHT="18"> </div>
<div class="Btn" TITLE="插入换行符号" LANGUAGE="javascript" onClick="InsertChars(0)"><img class="Ico" src="images/editor/chars.gif" ></div>
<div class="Btn" TITLE="插入公式" LANGUAGE="javascript" onClick="InsertEQ()"><img class="Ico" src="images/editor/eq.gif" ></div>
<div class="BtnMenu" TITLE="公式操作" LANGUAGE="javascript" onClick="ShowMenu(menu_eq,100)"><img class="Ico" src="images/editor/arrow.gif"></div>
<div class="Btn" TITLE="插入特殊符号" LANGUAGE="javascript" onClick="Insertlr('editor_tsfh.htm',300,200,<%=(now()-date())*24*60*60*1000%>)"><img class="Ico" src="images/editor/symbol.gif" ></div>
<div class="Btn" TITLE="插入表情符号" LANGUAGE="javascript" onClick="inseremot()"><img class="Ico" src="images/editor/Emot.gif" ></div>
<div class="Btn" TITLE="插入图片,支持格式为:jpg、gif、bmp、png等" LANGUAGE="javascript" onClick="pic()"><img class="Ico" src="images/editor/img.gif" ></div>
<div class="Btn" TITLE="插入flash多媒体文件" LANGUAGE="javascript" onClick="swf()"><img class="Ico" src="images/editor/flash.gif" ></div>
<div class="Btn" TITLE="插入视频文件,支持格式为:avi、wmv、asf" LANGUAGE="javascript" onClick="wmv()"><img class="Ico" src="images/editor/wmv.gif" ></div>
<div class="Btn" TITLE="插入RealPlay文件,支持格式为:rm、ra、ram" LANGUAGE="javascript" onClick="rm()"><img class="Ico" src="images/editor/rm.gif" ></div>
<div class="TBSep"></div>
<div class="Btn" TITLE="代码样式" LANGUAGE="javascript" onClick="Insercode()"> <img class="Ico" src="images/editor/code.gif" >
</div>
<div class="Btn" TITLE="引用样式" LANGUAGE="javascript" onClick="Inserquote()">
<img class="Ico" src="images/editor/quote.gif" > </div>
<div class="TBSep"></div>
<div class="Btn" TITLE="插入或修改字幕" LANGUAGE="javascript" onClick="insermarquee()">
<img class="Ico" src="images/editor/Marquee.gif" > </div>
<div class="Btn" TITLE="打印" LANGUAGE="javascript" onClick="format('Print')">
<img class="Ico" src="images/editor/print.gif" > </div>
</div>
<iframe class="HtmlEdit" ID="HtmlEdit" src="ProductContent.asp?Action=<%=trim(request("Action"))%>&ID=<%=trim(request("ID"))%>" MARGINHEIGHT="1" MARGINWIDTH="1" style="width=100%; height=266;"> </iframe>
<iframe class="HtmlEdit" ID="HtmlPreview" MARGINHEIGHT="1" MARGINWIDTH="1" style="width=100%; height=266; display:none"> </iframe>
<img id="setMode0" src="Images/Editor/Editor2.gif" width="59" height="20" onClick="setMode(0)">
<img id="setMode1" src="Images/Editor/html.gif" width="59" height="20" onClick="setMode(1)">
<img id="setMode2" src="Images/Editor/browse.gif" width="59" height="20" onClick="setMode(2)">
<script type="text/javascript">
SEP_PADDING = 5;
HANDLE_PADDING = 7;
var yToolbars = new Array();
var YInitialized = false;
var bLoad=false;
var pureText=true;
var bodyTag="<head><style type=\"text/css\">body {font-size: 9pt}</style><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\"></head><BODY bgcolor=\"#FFFFFF\" MONOSPACE>";
var EditMode=true;
var SourceMode=false;
var PreviewMode=false;
var CurrentMode=0;
function document.onreadystatechange(){
if (YInitialized) return;
YInitialized = true;
var i, s, curr;
for (i=0; i<document.body.all.length; i++)
{
curr=document.body.all[i];
if (curr.className == "yToolbar")
{
InitTB(curr);
yToolbars[yToolbars.length] = curr;
}
}
DoLayout();
window.onresize = DoLayout;
//HtmlEdit.document.open();
//HtmlEdit.document.write(bodyTag);
//HtmlEdit.document.close();
HtmlEdit.document.designMode="On";
}
function InitBtn(btn)
{
btn.onmouseover = BtnMouseOver;
btn.onmouseout = BtnMouseOut;
btn.onmousedown = BtnMouseDown;
btn.onmouseup = BtnMouseUp;
btn.ondragstart = YCancelEvent;
btn.onselectstart = YCancelEvent;
btn.onselect = YCancelEvent;
btn.YUSERONCLICK = btn.onclick;
btn.onclick = YCancelEvent;
btn.YINITIALIZED = true;
return true;
}
function InitBtnMenu(BtnMenu)
{
BtnMenu.onmouseover = BtnMenuMouseOver;
BtnMenu.onmouseout = BtnMenuMouseOut;
BtnMenu.onmousedown = BtnMenuMouseDown;
BtnMenu.onmouseup = BtnMenuMouseUp;
BtnMenu.ondragstart = YCancelEvent;
BtnMenu.onselectstart = YCancelEvent;
BtnMenu.onselect = YCancelEvent;
BtnMenu.YUSERONCLICK = BtnMenu.onclick;
BtnMenu.onclick = YCancelEvent;
BtnMenu.YINITIALIZED = true;
return true;
}
function InitTB(y)
{
y.TBWidth = 0;
if (! PopulateTB(y)) return false;
y.style.posWidth = y.TBWidth;
return true;
}
function YCancelEvent()
{
event.returnValue=false;
event.cancelBubble=true;
return false;
}
function PopulateTB(y)
{
var i, elements, element;
elements = y.children;
for (i=0; i<elements.length; i++) {
element = elements[i];
if (element.tagName == "SCRIPT" || element.tagName == "!") continue;
switch (element.className) {
case "Btn":
if (element.YINITIALIZED == null) {
if (! InitBtn(element))
return false;
}
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
case "BtnMenu":
if (element.YINITIALIZED == null) {
if (! InitBtnMenu(element))
return false;
}
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
case "TBGen":
element.style.posLeft = y.TBWidth;
y.TBWidth += element.offsetWidth + 1;
break;
case "TBSep":
element.style.posLeft = y.TBWidth + 2;
y.TBWidth += SEP_PADDING;
break;
case "TBHandle":
element.style.posLeft = 2;
y.TBWidth += element.offsetWidth + HANDLE_PADDING;
break;
default:
return false;
}
}
y.TBWidth += 1;
return true;
}
function DebugObject(obj)
{
var msg = "";
for (var i in TB) {
ans=prompt(i+"="+TB[i]+"\n");
if (! ans) break;
}
}
function LayoutTBs()
{
NumTBs = yToolbars.length;
if (NumTBs == 0) return;
var i;
var ScrWid = (document.body.offsetWidth) - 6;
var TotalLen = ScrWid;
for (i = 0 ; i < NumTBs ; i++) {
TB = yToolbars[i];
if (TB.TBWidth > TotalLen) TotalLen = TB.TBWidth;
}
var PrevTB;
var LastStart = 0;
var RelTop = 0;
var LastWid, CurrWid;
var TB = yToolbars[0];
TB.style.posTop = 0;
TB.style.posLeft = 0;
var Start = TB.TBWidth;
for (i = 1 ; i < yToolbars.length ; i++) {
PrevTB = TB;
TB = yToolbars[i];
CurrWid = TB.TBWidth;
if ((Start + CurrWid) > ScrWid) {
Start = 0;
LastWid = TotalLen - LastStart;
}
else {
LastWid = PrevTB.TBWidth;
RelTop -= TB.offsetHeight;
}
TB.style.posTop = RelTop;
TB.style.posLeft = Start;
PrevTB.style.width = LastWid;
LastStart = Start;
Start += CurrWid;
}
TB.style.width = TotalLen - LastStart;
i--;
TB = yToolbars[i];
var TBInd = TB.sourceIndex;
var A = TB.document.all;
var item;
for (i in A) {
item = A.item(i);
if (! item) continue;
if (! item.style) continue;
if (item.sourceIndex <= TBInd) continue;
if (item.style.position == "absolute") continue;
item.style.posTop = RelTop;
}
}
function DoLayout()
{
LayoutTBs();
}
function BtnMouseOver()
{
if (event.srcElement.tagName != "IMG") return false;
var image = event.srcElement;
var element = image.parentElement;
if (image.className == "Ico") element.className = "BtnMouseOverUp";
else if (image.className == "IcoDown") element.className = "BtnMouseOverDown";
event.cancelBubble = true;
}
function BtnMouseOut()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
yRaisedElement = null;
element.className = "Btn";
image.className = "Ico";
event.cancelBubble = true;
}
function BtnMouseDown()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
event.returnValue=false;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
element.className = "BtnMouseOverDown";
image.className = "IcoDown";
event.cancelBubble = true;
event.returnValue=false;
return false;
}
function BtnMouseUp()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
// if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
if (element.YUSERONCLICK){
try{
eval(element.YUSERONCLICK + "onclick(event)");
}
catch(e)
{
eval(element.YUSERONCLICK + "anonymous()");
}
}
element.className = "BtnMouseOverUp";
image.className = "Ico";
event.cancelBubble = true;
return false;
}
function BtnMenuMouseOver()
{
if (event.srcElement.tagName != "IMG") return false;
var image = event.srcElement;
var element = image.parentElement;
if (image.className == "Ico") element.className = "BtnMenuMouseOverUp";
else if (image.className == "IcoDown") element.className = "BtnMenuMouseOverDown";
event.cancelBubble = true;
}
function BtnMenuMouseOut()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
yRaisedElement = null;
element.className = "BtnMenu";
image.className = "Ico";
event.cancelBubble = true;
}
function BtnMenuMouseDown()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
event.returnValue=false;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
element.className = "BtnMenuMouseOverDown";
image.className = "IcoDown";
event.cancelBubble = true;
event.returnValue=false;
return false;
}
function BtnMenuMouseUp()
{
if (event.srcElement.tagName != "IMG") {
event.cancelBubble = true;
return false;
}
var image = event.srcElement;
var element = image.parentElement;
if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()");
element.className = "BtnMenuMouseOverUp";
image.className = "Ico";
event.cancelBubble = true;
return false;
}
function cleanHtml()
{
var fonts = HtmlEdit.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;
}
}
function validateMode()
{
if (EditMode) return true;
alert("请先点编辑器下方的“编辑”按钮,进入“编辑”状态,然后再使用系统编辑功能!");
HtmlEdit.focus();
return false;
}
function UserDialog(what)
{
if (!validateMode()) return;
HtmlEdit.document.execCommand(what, true);
pureText = false;
HtmlEdit.focus();
}
function format(what,opt)
{
if (!validateMode()) return;
if (opt=="removeFormat")
{
what=opt;
opt=null;
}
if (opt==null) HtmlEdit.document.execCommand(what);
else HtmlEdit.document.execCommand(what,"",opt);
pureText = false;
HtmlEdit.focus();
}
function setMode(newMode)
{
var cont;
if (CurrentMode==newMode){
return false;
}
if (newMode==0)
{
setMode0.src="Images/Editor/Editor2.gif";
setMode1.src="Images/Editor/html.gif";
setMode2.src="Images/Editor/browse.gif";
if (PreviewMode){
document.all.HtmlEdit.style.display="";
document.all.HtmlPreview.style.display="none";
}
if(SourceMode){
cont=HtmlEdit.document.body.innerText;
HtmlEdit.document.designMode="On";
HtmlEdit.document.body.innerHTML=cont;
HtmlEdit.document.body.contentEditable="true";
HtmlEdit.document.oncontextmenu=new Function("return showContextMenu(eWebEditor.event);");
HtmlEdit.document.execCommand("2D-Position",true,true);
HtmlEdit.document.execCommand("MultipleSelection", true, true);
}
EditMode=true;
SourceMode=false;
PreviewMode=false;
}
else if (newMode==1)
{
setMode0.src="Images/Editor/Editor.gif";
setMode1.src="Images/Editor/html2.gif";
setMode2.src="Images/Editor/browse.gif";
if (PreviewMode){
document.all.HtmlEdit.style.display="";
document.all.HtmlPreview.style.display="none";
}
if(EditMode){
cleanHtml();
cleanHtml();
cont=HtmlEdit.document.body.innerHTML;
HtmlEdit.document.body.innerText=cont;
}
EditMode=false;
SourceMode=true;
PreviewMode=false;
}
else if (newMode==2)
{
setMode0.src="Images/Editor/Editor.gif";
setMode1.src="Images/Editor/html.gif";
setMode2.src="Images/Editor/browse2.gif";
var str1="<head><style type=\"text/css\">body {font-size: 9pt}</style><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\"></head><BODY bgcolor=\"#F6F6F6\" MONOSPACE>";
if(CurrentMode==0){
str1=str1+HtmlEdit.document.body.innerHTML;
}
else{
str1=str1+HtmlEdit.document.body.innerText;
}
HtmlPreview.document.open();
HtmlPreview.document.write(str1);
HtmlPreview.document.close();
document.all.HtmlEdit.style.display="none";
document.all.HtmlPreview.style.display="";
PreviewMode=true;
}
CurrentMode=newMode;
HtmlEdit.focus();
}
function foreColor()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var RangeType = HtmlEdit.document.selection.type;
if (RangeType != "Text"){
alert("请先选择一段文字!");
return;
}
var arr = showModalDialog("editor_selcolor.asp", "", "dialogWidth:18.5em; dialogHeight:17.5em; help: no; scroll: no; status: no");
if (arr != null) format('forecolor', arr);
else HtmlEdit.focus();
}
function backColor()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var RangeType = HtmlEdit.document.selection.type;
if (RangeType != "Text"){
alert("请先选择一段文字!");
return;
}
var arr = showModalDialog("editor_selcolor.asp", "", "dialogWidth:18.5em; dialogHeight:17.5em; help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML("<span style='background-color:"+arr+"'>"+range.text+"</span> ");
range.select();
}
HtmlEdit.focus();
}
function page()
{
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
if(range.text!=""){
alert("请不要选择任何文本");
}
else{
range.text="\n\n[NextPage]\n\n";
parent.selectPaginationType()
}
}
function InsertTable()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_inserttable.asp", "", "dialogWidth:450px;dialogHeight:200px;help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML(arr);
}
HtmlEdit.focus();
}
function FIELDSET()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_fieldset.asp", "", "dialogWidth:25em; dialogHeight:12.5em; help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML(arr);
}
HtmlEdit.focus();
}
function iframe()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_insertiframe.asp", "", "dialogWidth:30em; dialogHeight:12em; help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML(arr);
}
HtmlEdit.focus();
}
function hr()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_inserthr.asp", "", "dialogWidth:30em; dialogHeight:12em; help: no; scroll: no; status: no");
if (arr != null){
range.pasteHTML(arr);
}
HtmlEdit.focus();
}
function pic()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_insertpic.asp", "", "dialogWidth:31em; dialogHeight:17em; help: no; scroll: no; status: no");
if (arr != null){
var ss=arr.split("$$$");
range.pasteHTML(ss[0]);
parent.myform.IncludePic.checked=true;
if (ss[1]!="None")
{
parent.AddItem(ss[1]);
}
}
HtmlEdit.focus();
}
function swf()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_insertflash.asp", "", "dialogWidth:31em; dialogHeight:12em; help: no; scroll: no; status: no");
if (arr != null){
var ss=arr.split("$$$");
range.pasteHTML(ss[0]);
parent.myform.IncludePic.checked=true;
if (ss[1]!="None")
{
parent.AddItem(ss[1]);
}
}
HtmlEdit.focus();
}
function wmv()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_insertmedia.asp", "", "dialogWidth:31em; dialogHeight:12em; help: no; scroll: no; status: no");
if (arr != null){
var ss=arr.split("$$$");
range.pasteHTML(ss[0]);
parent.myform.IncludePic.checked=true;
if (ss[1]!="None")
{
parent.AddItem(ss[1]);
}
}
HtmlEdit.focus();
}
function rm()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range = HtmlEdit.document.selection.createRange();
var arr = showModalDialog("editor_insertrm.asp", "", "dialogWidth:31em; dialogHeight:12em; help: no; scroll: no; status: no");
if (arr != null){
var ss=arr.split("$$$");
range.pasteHTML(ss[0]);
parent.myform.IncludePic.checked=true;
if (ss[1]!="None")
{
parent.AddItem(ss[1]);
}
}
HtmlEdit.focus();
}
function excel()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range =HtmlEdit.document.selection.createRange();
var str1="<object classid='clsid:0002E510-0000-0000-C000-000000000046' id='Spreadsheet1' codebase='file:\\Bob\software\office2000\msowc.cab' width='100%' height='250'><param name='EnableAutoCalculate' value='-1'><param name='DisplayTitleBar' value='0'><param name='DisplayToolbar' value='-1'><param name='ViewableRange' value='1:65536'></object>";
range.pasteHTML(str1);
HtmlEdit.focus();
}
function nowdate()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range =HtmlEdit.document.selection.createRange();
var d = new Date();
var str1=d.getYear()+"年"+(d.getMonth() + 1)+"月"+d.getDate() +"日";
range.pasteHTML(str1);
HtmlEdit.focus();
}
function nowtime()
{
if (! validateMode()) return;
HtmlEdit.focus();
var range =HtmlEdit.document.selection.createRange();
var d = new Date();
var str1=d.getHours() +":"+d.getMinutes()+":"+d.getSeconds();
range.pasteHTML(str1);
HtmlEdit.focus();
}
function findstr()
{
if (! validateMode()) return;
var arr = showModalDialog("editor_find.asp", window, "dialogWidth:320px; dialogHeight:170px; help: no; scroll: no; status: no");
}
function help()
{
var arr = showModalDialog("editor_help.asp", "", "dialogWidth:580px; dialogHeight:460px; help: no; scroll: no; status: no");