📄 latticeeditor.js
字号:
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Cut")==true){
document.frames("LatticeEditDocument").document.execCommand("Cut",false);
state_btn_cut=0;
changebutton("btn_cut",0);
}
}
if(btn=="btn_copy"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Copy")==true){
document.frames("LatticeEditDocument").document.execCommand("Copy",false);
state_btn_copy=0;
changebutton("btn_copy",0);
}
}
if(btn=="btn_paste"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Paste")==true){
document.frames("LatticeEditDocument").document.execCommand("Paste",false);
state_btn_paste=0;
changebutton("btn_paste",0);
}
}
if(btn=="btn_undo"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Undo")==true){
document.frames("LatticeEditDocument").focus();
document.frames("LatticeEditDocument").document.execCommand("Undo",false);
state_btn_undo=0;changebutton("btn_undo",0);
}
}
if(btn=="btn_redo"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Redo")==true){
document.frames("LatticeEditDocument").document.execCommand("Redo",false);
state_btn_redo=0;
changebutton("btn_redo",0);
}
}
if(btn=="btn_find"){
if(find_status!=1){
find_status=1;
state_btn_find=5;
changebutton("btn_find",0);
window.showModelessDialog("HtmlEditor/find.htm",window,"dialogHeight: 125px; dialogWidth: 420px; help: no;scroll: no; status: no");
}else{
state_btn_find=5;
changebutton("btn_find",0);
}
}
if(btn=="btn_table"){
if(table_status!=1){
table_status=1;
state_btn_table=5;
changebutton("btn_table",0);
tablemoondowneropen=1;
window.showModalDialog("HtmlEditor/inserttable.htm",window,"dialogHeight: 350px; dialogWidth: 400px; help: no;scroll: no; status: no");
if(tableiscancel=="no"){
var inserttabletext='<TABLE BORDER="';
var temptablestyle="";
var tempcellstyle="";
if(tableclass!=""){temptablestyle=' class="'+tableclass+'"';}
if(tablecellclass!=""){tempcellstyle=' class="'+tablecellclass+'"';}
inserttabletext+=(parseInt(tablebordersize)+1);
inserttabletext+='"';
if(tablewidthspecified=="yes"){
inserttabletext+=' WIDTH="';
inserttabletext+=tablewidth;
if(tablewidthtype=="percentage"){
inserttabletext+='%';
}
inserttabletext+='"';
}
inserttabletext+=temptablestyle;
if(tablebordercolor!="Default"){inserttabletext+=' BORDERCOLOR="'+tablebordercolor+'"';}
if(tablebackgroundcolor!="Default"){inserttabletext+=' BGCOLOR="'+tablebackgroundcolor+'"';}
if(tablealign!="Default"){inserttabletext+=' ALIGN="'+tablealign+'"';}
inserttabletext+=' CELLPADDING="'+tablecellpadding+'"';
inserttabletext+=' CELLSPACING="'+tablecellspacing+'"';
inserttabletext+='>\n';
var tempcellwidth=""+parseInt(100/tablecolumns)+"%";
var temprowtext="<TR>";
for(var i=1;i<=tablecolumns;i++){temprowtext+='<TD WIDTH="'+tempcellwidth+'"'+tempcellstyle+'></TD>';}
temprowtext+="</TR>\n";
for(var j=1;j<=tablerows;j++){inserttabletext+=temprowtext;}
inserttabletext+='</TABLE>';
var xman=frames ['LatticeEditDocument'].document.selection.createRange();
xman.pasteHTML(inserttabletext);
}
}else{
state_btn_table=5;
changebutton("btn_table",0);
}
}
if(btn=="btn_image"){
if(image_status!=1){
image_status=1;
state_btn_image=5;
changebutton("btn_image",0);
imagedialogopen=1;
window.showModalDialog("HtmlEditor/insertimage.htm",window,"dialogHeight: 350px; dialogWidth:450px; help: no;scroll: no; status: no");
if((imageiscancel=="no")&&(imageurl!="Default")&&(imageurl!="")){
imageisinserted=0;
frames ['LatticeEditDocument'].document.testimage=new Object();
frames ['LatticeEditDocument'].document.testimage.ImageCache=new Array();
frames ['LatticeEditDocument'].document.testimage.ImageCache[0]=new Image();
frames ['LatticeEditDocument'].document.testimage.ImageCache[0].onload=addimage;
frames ['LatticeEditDocument'].document.testimage.ImageCache[0].src=imageurl;
}
}else{
state_btn_image=5;changebutton("btn_image",0);
}
}
if(btn=="btn_hyperlink"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("CreateLink")==true){
setlink();
state_btn_hyperlink=5;
changebutton("btn_hyperlink",0);
}else{
state_btn_hyperlink=5;
changebutton("btn_hyperlink",0);
}
}
if(btn=="btn_unlink"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("Unlink")==true){
document.frames("LatticeEditDocument").document.execCommand("Unlink");
state_btn_unlink=5;
changebutton("btn_unlink",0);
}else{
state_btn_unlink=5;
changebutton("btn_unlink",0);
}
}
if(btn=="btn_hr"){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("InsertHorizontalRule")==true){
document.frames("LatticeEditDocument").document.execCommand("InsertHorizontalRule");
state_btn_hr=5;
changebutton("btn_hr",0);
}else{
state_btn_hr=5;
changebutton("btn_hr",0);
}
}if(btn=="btn_html"){
if(html_status!=1){
html_status=1;
state_btn_html=5;
changebutton("btn_html",0);
htmlmoondowneropen=1;
originalwysiwyg=document.frames("LatticeEditDocument").document.body.innerHTML;
locationhere=""+parent.location.href;
window.showModalDialog("HtmlEditor/edithtml.htm",window,"dialogHeight: 440px; dialogWidth: 630px; help: no;scroll: no; status: no");
if(htmliscancel=="no"){
document.frames("LatticeEditDocument").document.body.innerHTML=originalwysiwyg;
}
}else{
state_btn_table=5;changebutton("btn_table",0);
}
}
if(btn=="btn_special"){
if(specialchar_status!=1){
specialchar_status=1;
state_btn_special=5;
changebutton("btn_special",0);
specialcharmoondowneropen=1;
window.showModalDialog("HtmlEditor/specialchar.htm",window,"dialogHeight: 200px; dialogWidth: 300px; help: no;scroll: no; status: no");
if(specialchariscancel=="no"){
var xman=frames ['LatticeEditDocument'].document.selection.createRange();
xman.pasteHTML(chartoinsert);
}
}else{
state_btn_special=5;
changebutton("btn_special",0);
}
}
if(btn=="btn_about"){
if(about_status!=1){
about_status=1;
state_btn_about=5;
changebutton("btn_about",0);
window.showModalDialog("HtmlEditor/about.htm",window,"dialogHeight: 300px; dialogWidth: 410px; help: no;scroll: no; status: no");
}else{
state_btn_about=5;
changebutton("btn_about",0);
}
}
if(btn=="btn_save"){
if(0!=1){
state_btn_save=5;
changebutton("btn_save",0);
document.frames("LatticeEditDocument").document.execCommand('SaveAs',true);
//eval("window.parent."+SaveFunction);
}else{
state_btn_save=5;
changebutton("btn_save",0);
}
}
if(btn=="FormatSelect"){
if(document.getElementById("FormatSelect")){
var x=window.myform.FormatSelect.selectedIndex;
var y=window.myform.FormatSelect.options[x].value;
if(x>0){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("FormatBlock")==true){
document.frames("LatticeEditDocument").document.execCommand("FormatBlock",false,"Normal");
document.frames("LatticeEditDocument").document.execCommand("FormatBlock",false,y);
window.myform.FormatSelect.options[0].value=y;
window.myform.FormatSelect.options[0].selected=true;
}
}
}
}
if(btn=="FontNameSelect"){
if(document.getElementById("FontNameSelect")){
var x=window.myform.FontNameSelect.selectedIndex;
var y=window.myform.FontNameSelect.options[x].value;
if(x>0){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("FontName")==true){
document.frames("LatticeEditDocument").document.execCommand("FontName",false,y);
window.myform.FontNameSelect.options[0].value=y;
window.myform.FontNameSelect.options[0].selected=true;
}
}
}
}
if(btn=="FontSizeSelect"){
if(document.getElementById("FontSizeSelect")){
var x=window.myform.FontSizeSelect.selectedIndex;
var y=window.myform.FontSizeSelect.options[x].value;
if(x>0){
if(document.frames("LatticeEditDocument").document.queryCommandEnabled("FontSize")==true){
document.frames("LatticeEditDocument").document.execCommand("FontSize",false,y);
window.myform.FontSizeSelect.options[0].value=y;
window.myform.FontSizeSelect.options[0].selected=true;
}
}
}
}
if(btn=="btn_fontcolor"){
col = websn_getTblCol();
if (col != "" && col != null) {
document.frames("LatticeEditDocument").document.execCommand("ForeColor",false,col);
}
}
if(btn=="btn_fonthilight"){
col = websn_getTblCol();
if (col != "" && col != null) {
document.frames("LatticeEditDocument").document.execCommand("BackColor",false,col);
}
}
if((btn!="btn_find")&&(btn!="btn_fontcolor")&&(btn!="btn_fonthilight")){displayChanged();}
}
}
function websn_getTblCol() {
if (document.createAttribute) {
var retCol = top.dlgColHelperTbl.ChooseColorDlg();
retCol = retCol.toString(16);
if (retCol.length < 6) {
var tmp = "000000".substring(0,6-retCol.length);
retCol = tmp.concat(retCol);
var c = 66;
}
}
else {
bascol = showModalDialog("HtmlEditor/colpick.html", "", "dialogWidth:350px; dialogHeight:370px; status:no; help:no");
if (bascol != null) {
retCol = bascol['col'];
}
}
return retCol;
}
function itag(x){alert(x);}
function thisspot(){
var devid=DeveloperID;
var x=""+window.location.hostname;
var y=x.length;
var count=0;
var total=0;
var holder=0;
var getdevid=parseInt(devid);
if(y>0){
for(count=0;count<=y-1;count++){
holder=parseInt(x.charCodeAt(count));
holder=holder+((holder-count)+(holder*count));
total+=holder;
}
holder=total*getdevid*y;
var xholder=holder*7;
var yholder=xholder.toString();
var zholder=holder.toString();
var tempchar=zholder.charAt(3);
if(tempchar=="0"){
total=""+zholder+"9J7G3F"+yholder;
}else if(tempchar=="1"){
total=""+zholder+"Z37J8"+yholder;
}else if(tempchar=="2"){
total=""+zholder+"8VF6H92"+yholder;
}else if(tempchar=="3"){
total=""+zholder+"BN95T5S"+yholder;
}else if(tempchar=="4"){
total=""+zholder+"NF62CZ9P"+yholder;
}else if(tempchar=="5"){
total=""+zholder+"YW4Q7RB88K"+yholder;
}else if(tempchar=="6"){
total=""+zholder+"BS9JM52F"+yholder;
}else if(tempchar=="7"){
total=""+zholder+"63GE9U"+yholder;
}else if(tempchar=="8"){
total=""+zholder+"D7PWFBVCX"+yholder;
}else{
total=""+zholder+"2FV95HY6"+yholder;
}
}else{
}
return total;
}
function displayChanged(){
var tempState;
var tempSupported;
if(document.getElementById("btn_bold")){
tempSupported=document.frames("LatticeEditDocument").document.queryCommandEnabled("Bold");
tempState=document.frames("LatticeEditDocument").document.queryCommandValue("Bold");
if(tempSupported==false){
changebutton("btn_bold",1);
}else{
if(tempState==true){
state_btn_bold=5;changebutton("btn_bold",3);
}else{
state_btn_bold=5;changebutton("btn_bold",0);
}
}
}
if(document.getElementById("btn_italics")){
tempSupported=document.frames("LatticeEditDocument").document.queryCommandEnabled("Italic");
tempState=document.frames("LatticeEditDocument").document.queryCommandValue("Italic");
if(tempSupported==false){
changebutton("btn_italics",1);
}else{
if(tempState==true){
state_btn_italics=5;changebutton("btn_italics",3);
}else{
state_btn_italics=5;changebutton("btn_italics",0);
}
}
}
if(document.getElementById("btn_underline")){
tempSupported=document.frames("LatticeEditDocument").document.queryCommandEnabled("Underline");
tempState=document.frames("LatticeEditDocument").document.queryCommandValue("Underline");
if(tempSupported==false){
changebutton("btn_underline",1);
}else{
if(tempState==true){
state_btn_underline=5;changebutton("btn_underline",3);
}else{
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -