📄 ftb-pro.js
字号:
<td><input type='text' id='image_height' style='width:40px;' onblur='updatePreview();' /></td></tr>\
</table>\
</fieldset>\
</td></tr></table>\
</td></tr></table>\
<div class='footer'>\
<button type='button' name='updateImageButton' id='updateImageButton' onclick='updateImage();window.close();'>确定</button> \
<button type='button' name='cancel' id='cancelButton' onclick='window.close();'>取消</button>\
</div>\
<script type='text/javascript'>\
function load() {\
ftb = window.launchParameters['ftb'];\
img = ftb.GetNearest('img');\
src = document.getElementById('image_src');\
alt = document.getElementById('image_alt');\
align = document.getElementById('image_align');\
border = document.getElementById('image_border');\
hspace = document.getElementById('image_hspace');\
vspace = document.getElementById('image_vspace');\
width = document.getElementById('image_width');\
height = document.getElementById('image_height');\
if (img) {\
src.value = img.src;\
alt.value = img.alt;\
window.opener.FTB_SetListValue(align,img.align,true);\
border.value = img.border;\
hspace.value = img.hspace;\
vspace.value = img.vspace;\
width.value = img.width;\
height.value = img.height;\
updatePreview();\
}\
}\
</script>\
</form> \
</body> \
</html>");
var FTB_LinkPopUpHtml = new String("\
<html><body> \
<head>\
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\
<title>插入超链接</title>\
<style type='text/css'>\
html, body { \
background-color: #ECE9D8; \
color: #000000; \
font: 11px Tahoma,Verdana,sans-serif; \
padding: 0px; \
} \
body { margin: 5px; } \
form { margin: 0px; padding: 0px;} \
table { \
font: 11px Tahoma,Verdana,sans-serif; \
} \
form p { \
margin-top: 5px; \
margin-bottom: 5px; \
} \
h3 { margin: 0; margin-top: 4px; margin-bottom: 5px; font-size: 12px; border-bottom: 2px solid #90A8F0; color: #90A8F0;} \
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; } \
.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; } \
fieldset { padding: 0px 10px 5px 5px; } \
button { width: 75px; } \
select, input, button { font: 11px Tahoma,Verdana,sans-serif; } \
.space { padding: 2px; } \
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; \
border-bottom: 1px solid black; letter-spacing: 2px; \
} \
.f_title { text-align:right; }\
.footer { border-top:2px solid #90A8F0; padding-top: 3px; margin-top: 4px; text-align:right; }\
</style>\
<script type='text/javascript'>\
function insertLink() {\
ftb = window.launchParameters['ftb'];\
link = ftb.GetNearest('a');\
href = document.getElementById('link_href');\
if (href.value == '') {\
alert('请您输入链接地址!');\
return false;\
}\
if (!link) {\
ftb.ExecuteCommand('createlink',null,href.value);\
link = ftb.GetNearest('a');\
}\
updateLink(link);\
}\
function updateLink(link) {\
if (link) {\
href = document.getElementById('link_href');\
title = document.getElementById('link_title');\
target = document.getElementById('link_target');\
cssClass = document.getElementById('link_cssClass');\
targetVal = target.options[target.selectedIndex].value;\
customtarget = document.getElementById('link_customtarget');\
link.href = href.value;\
link.title = title.value;\
link.className = cssClass.value;\
if (targetVal == '_custom') link.target = customtarget.value; else link.target = targetVal;\
}\
}\
function link_target_changed() {\
list = document.getElementById('link_target');\
customtarget = document.getElementById('link_customtarget');\
if (list.options[list.options.selectedIndex].value == '_custom')\
customtarget.style.display = '';\
else\
customtarget.style.display = 'none';\
}\
</script>\
</head>\
<body style='border:0'>\
<form action=''> \
<h3>插入超链接</h3> \
<fieldset><legend>链接属性</legend><table>\
<tr><td class='f_title'>地址</td>\
<td><input type='text' id='link_href' style='width:250px;' /></td></tr>\
<tr><td class='f_title'>提示</td>\
<td><input type='text' id='link_title' style='width:250px;' /></td></tr>\
<tr><td class='f_title'>目标</td>\
<td><select id='link_target' style='width:150px;' onchange='link_target_changed();'>\
<option value=''>无</option>\
<option value='_blank'>新窗口 (_blank)</option>\
<option value='_top'>整页 (_top)</option>\
<option value='_parent'>父框架 (_parent)</option>\
<option value='_self'>相同框架 (_self)</option>\
<option value='_custom'>自定义</option>\
</select> \
<input type='text' id='link_customtarget' style='width:95px;display:none;' /> \
</td></tr>\
<tr style='display:none;'><td class='f_title'>样式</td>\
<td><input type='text' id='link_cssClass' style='width:250px;' /></td></tr>\
</table>\
</fieldset>\
<div class='footer'>\
<button type='button' name='insertLinkButton' id='insertLinkButton' onclick='insertLink();window.close();'>确定</button> \
<button type='button' name='cancel' id='cancelButton' onclick='window.close();'>取消</button>\
</div>\
<script type='text/javascript'>\
function load() {\
ftb = window.launchParameters['ftb'];\
link = ftb.GetNearest('a');\
href = document.getElementById('link_href');\
title = document.getElementById('link_title');\
target = document.getElementById('link_target');\
customtarget = document.getElementById('link_customtarget');\
cssClass = document.getElementById('link_cssClass');\
if (link) {\
href.value = link.href;\
title.value = link.title;\
cssClass.value = link.className;\
if (link.target == '' || link.target == '_blank' || link.target == '_top' || link.target == '_self' || link.target == '_parent')\
window.opener.FTB_SetListValue(target,link.target,true);\
else\
window.opener.FTB_SetListValue(target,'_custom',false);\
\
if (target.options[target.options.selectedIndex].value == '_custom') {\
customtarget.style.display='';\
customtarget.value = link.target;\
}\
}\
}\
</script>\
</form> \
</body> \
</html>");
var FTB_TablePopUpHtml = new String("\
<html><body> \
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\
<head>\
<title>插入表格</title>\
<style type='text/css'>\
html, body { \
background-color: #ECE9D8; \
color: #000000; \
font: 11px Tahoma,Verdana,sans-serif; \
padding: 0px; \
} \
body { margin: 5px; border:0px;} \
form { margin: 0px; padding: 0px;} \
table { \
font: 11px Tahoma,Verdana,sans-serif; \
} \
form p { \
margin-top: 5px; \
margin-bottom: 5px; \
} \
h3 { margin: 0; margin-top: 4px; margin-bottom: 5px; font-size: 12px; border-bottom: 2px solid #90A8F0; color: #90A8F0;} \
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; } \
.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; } \
fieldset { padding: 0px 10px 5px 5px; } \
button { width: 75px; } \
select, input, button { font: 11px Tahoma,Verdana,sans-serif; } \
.space { padding: 2px; } \
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; \
border-bottom: 1px solid black; letter-spacing: 2px; \
} \
.f_title { text-align:right; }\
.footer { border-top:2px solid #90A8F0; padding-top: 3px; margin-top: 4px; text-align:right; }\</style>\
<script type='text/javascript'>\
function doTable() { \
ftb = window.launchParameters['ftb'];\
table = window.launchParameters['table'];\
if (table) { \
table.style.width = document.getElementById('f_width').value + document.getElementById('f_unit').options[document.getElementById('f_unit').selectedIndex].value; \
table.align = document.getElementById('f_align').options[document.getElementById('f_align').selectedIndex].value; \
table.cellPadding = (document.getElementById('f_padding').value.length > 0 && !isNaN(document.getElementById('f_padding').value)) ? parseInt(document.getElementById('f_padding').value) : ''; \
table.cellSpacing = (document.getElementById('f_spacing').value.length > 0 && !isNaN(document.getElementById('f_spacing').value)) ? parseInt(document.getElementById('f_spacing').value) : ''; \
table.border = parseInt(document.getElementById('f_border').value); \
} else {\
cols = parseInt(document.getElementById('f_cols').value); \
rows = parseInt(document.getElementById('f_rows').value); \
width = document.getElementById('f_width').value; \
widthUnit = document.getElementById('f_unit').options[document.getElementById('f_unit').selectedIndex].value; \
align = document.getElementById('f_align').value; \
cellpadding = document.getElementById('f_padding').value; \
cellspacing = document.getElementById('f_spacing').value; \
border = document.getElementById('f_border').value; \
ftb.InsertTable(cols,rows,width,widthUnit,align,cellpadding,cellspacing,border); \
} \
window.close(); \
}\
</script>\
</head>\
<body>\
<form action=''> \
<h3>插入表格</h3> \
<table border='0' style='padding: 0px; margin: 0px'> \
<tbody> \
<tr> \
<td style='width: 4em; text-align: right'>行数:</td> \
<td><input type='text' name='rows' id='f_rows' size='5' title='Number of rows' value='2' /></td> \
<td></td> \
<td></td> \
<td></td> \
</tr> \
<tr> \
<td style='width: 4em; text-align: right'>列数:</td> \
<td><input type='text' name='cols' id='f_cols' size='5' title='Number of columns' value='4' /></td> \
<td style='width: 4em; text-align: right'>宽度:</td> \
<td><input type='text' name='width' id='f_width' size='5' title='Width of the table' value='100' /></td> \
<td><select size='1' name='unit' id='f_unit' title='Width unit'> \
<option value='%' selected='1' >百分比</option> \
<option value='px' >像素</option> \
<option value='em' >Em</option> \
</select></td> \
</tr> \
</tbody> \
</table> \
<table width='100%'>\
<tr><td valign='top'>\
<fieldset>\
<legend>布局</legend> \
<table>\
<tr><td class='f_title'>对齐方式:</td><td>\
<select size='1' name='align' id='f_align' \
title='Positioning of the table'> \
<option value='' selected='1' >默认</option> \
<option value='left' >左对齐</option> \
<option value='center' >居中</option> \
<option value='right' >右对齐</option> \
</select> \
</td></tr>\
<tr><td class='f_title'>边框:</td><td>\
<input type='text' name='border' id='f_border' size='5' value='1' title='Leave empty for no border' /> \
</td></tr></table>\
</fieldset>\
</td><td valign='top'>\
<fieldset>\
<legend>间距</legend> \
<table>\
<tr><td class='f_title'>单元格衬距:</td><td>\
<input type='text' name='spacing' id='f_spacing' size='5' value='1' title='Space between adjacent cells' /> \
</td></tr>\
<tr><td class='f_title'>单元格间距:</td><td>\
<input type='text' name='padding' id='f_padding' size='5' value='1' title='Space between content and border in cell' /> \
</td></tr></table>\
</fieldset> \
</td></tr></table>\
<div class='footer'> \
<button type='button' name='ok' id='f_goButton' onclick='doTable();window.close();'>确定</button> \
<button type='button' name='cancel' onclick='window.close();'>取消</button> \
</div> \
<script language='JavaScript'> \
function load() { \
ftb = window.launchParameters['ftb'];\
table = window.launchParameters['table'];\
if (table) { \
width = window.opener.FTB_ParseUnit(table.style.width); \
document.getElementById('f_width').value = width.value; \
window.opener.FTB_SetListValue(document.getElementById('f_align'),table.align,true); \
window.opener.FTB_SetListValue(document.getElementById('f_unit'),width.unitType,true); \
document.getElementById('f_border').value = table.border; \
document.getElementById('f_padding').value = table.cellPadding; \
document.getElementById('f_spacing').value = table.cellSpacing; \
document.getElementById('f_cols').disabled = true; \
document.getElementById('f_rows').disabled = true; \
} \
} \
</script></form> \
</body> \
</html>");
/* ColorPicker
---------------------------------------- */
var FTB_ColorPickerHtml = new String("\
<html><body> \
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>\
<head>\
<title>颜色选择</title>\
<style type='text/css'>\
html, body { \
background-color: #ECE9D8; \
color: #000000; \
font: 11px Tahoma,Verdana,sans-serif; \
padding: 0px; \
border: 0px; \
} \
body { margin: 5px; } \
form { margin: 0px; padding: 0px;} \
table { \
font: 11px Tahoma,Verdana,sans-serif; \
} \
form p { \
margin-top: 5px; \
margin-bottom: 5px; \
} \
h3 { margin: 0; margin-top: 4px; margin-bottom: 5px; font-size: 12px; border-bottom: 2px solid #90A8F0; color: #90A8F0;} \
.fl { width: 9em; float: left; padding: 2px 5px; text-align: right; } \
.fr { width: 7em; float: left; padding: 2px 5px; text-align: right; } \
fieldset { padding: 0px 10px 5px 5px; } \
button { width: 75px; } \
select, input, button { font: 11px Tahoma,Verdana,sans-serif; } \
.space { padding: 2px; } \
.title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px; \
border-bottom: 1px solid black; letter-spacing: 2px; \
} \
.f_title { text-align:right; }\
.footer { border-top:2px solid #90A8F0; padding-top: 3px; margin-top: 4px; text-align:right; }\
</style>\
<script type='text/javascript'>\
function cO(theTD) { \
color = theTD.style.backgroundColor; \
if (color.toString().toLowerCase().indexOf('rgb') > -1) color = window.opener.FTB_RgbStringToHex(color); \
previewColor(color); \
setTextField(color); \
} \
function cC(theTD) { \
color = theTD.style.backgroundColor; \
if (color.toString().toLowerCase().indexOf('rgb') > -1) color = window.opener.FTB_RgbStringToHex(color); \
setTextField(color); \
returnColor(color); \
} \
function setTextField(ColorString) { \
document.getElementById('ColorText').value = ColorString.toUpperCase(); \
} \
function returnColor(ColorString) { \
ftb = window.launchParameters['ftb'];\
if (ftb) {\
command = new String(window.launchParameters['commandName']);\
ftb.ExecuteCommand(command,'',ColorString);\
} else {\
}\
\
window.close(); \
} \
function userInput(theinput) { \
previewColor(theinput.value); \
} \
function previewColor(theColor) { \
try { \
document.getElementById('PreviewDiv').style.backgroundColor = theColor; \
} catch (e) {} \
}\
function okButton() { \
theColor = document.getElementById('ColorText').value; \
returnColor(theColor);\
}\
</script>\
</head>\
<body>\
<form action=''> \
<h3>颜色选择</h3> \
<style> \
.cc { width:10;height:8; } \
</style> \
<table><tr><td>\
<table cellpadding=0 cellspacing=1 style='background-color:ffffff;' border=0 ><tr> \
<td onmouseover='cO(this);' onclick='cC(this);' style='background-color:FFFFFF;' class=cc></td> \
<td onmouseover='cO(this);' on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -