📄 ftb-pro.js
字号:
if (width.value == ''|| height.value == '') preview.src = new Image();\
preview.src = src.value;\
preview.alt = alt.value;\
preview.align = align.value;\
preview.border = border.value;\
preview.hspace = hspace.value;\
preview.vspace = vspace.value;\
if (width.value != '') preview.width = width.value;\
if (height.value != '') preview.height = height.value;\
}\
</script>\
</head>\
<body>\
<form action=''> \
<h3>Image Editor</h3> \
<table><tr><td>\
<table>\
<tr><td class='f_title'>Image Source:</td>\
<td><input type='text' id='image_src' style='width:200px;' onblur='updatePreview();' /></td></tr>\
<tr><td class='f_title'>Alternate Text:</td>\
<td><input type='text' id='image_alt' style='width:200px;' onblur='updatePreview();' /></td></tr>\
</table>\
</td><td rowspan='3' valign='top'>\
<fieldset><legend>Preview</legend>\
<div style='width:180px;height:180px;overflow:scroll;background-color:#fff;'>\
<p><img id='preview' />Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum accumsan, ipsum ut dapibus dapibus, nunc arcu congue velit, sit amet pretium est felis ut libero. Suspendisse hendrerit vestibulum pede.</p>\
</div>\
</fieldset>\
</td></tr><tr><td>\
<fieldset><legend>Layout</legend><table>\
<tr><td class='f_title'>Alignment:</td>\
<td><select id='image_align' style='width:70px;' onchange='updatePreview();'>\
<option value='' selected='1'>Not set</option> \
<option value='left' >Left</option> \
<option value='center' >Center</option> \
<option value='right'>Right</option> \
<option value='texttop' >TextTop</option> \
<option value='AbsMiddle'>AbsMiddle</option> \
<option value='Baseline' >Baseline</option> \
<option value='AbsBottom'>AbsBottom</option> \
<option value='Middle' >Middle</option> \
<option value='Top' >Top</option> \
</select> \
</td></tr>\
<tr><td class='f_title'>Border Thickness:</td>\
<td><input type='text' id='image_border' style='width:70px;' onblur='updatePreview();' /></td></tr>\
</table>\
</fieldset>\
</td></tr><tr><td>\
<table cellspacing='0' cellpadding='0'><tr><td style='padding-right:5px;'>\
<fieldset><legend>Spacing</legend><table>\
<tr><td class='f_title'>Horizontal:</td>\
<td><input type='text' id='image_hspace' style='width:30px;' onblur='updatePreview();' /></td></tr>\
<tr><td class='f_title'>Vertical:</td>\
<td><input type='text' id='image_vspace' style='width:30px;' onblur='updatePreview();' /></td></tr>\
</table>\
</fieldset>\
</td><td>\
<fieldset><legend>Dimensions</legend><table>\
<tr><td class='f_title'>Width:</td>\
<td><input type='text' id='image_width' style='width:40px;' onblur='updatePreview();' /></td></tr>\
<tr><td class='f_title'>Height:</td>\
<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();'>OK</button>\
<button type='button' name='cancel' id='cancelButton' onclick='window.close();'>Cancel</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>\
<title>Link Editor</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('You must enter a link');\
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>\
<form action=''> \
<h3>Link Editor</h3> \
<fieldset><legend>Link Properties</legend><table>\
<tr><td class='f_title'>URL</td>\
<td><input type='text' id='link_href' style='width:250px;' /></td></tr>\
<tr><td class='f_title'>Title</td>\
<td><input type='text' id='link_title' style='width:250px;' /></td></tr>\
<tr><td class='f_title'>Target</td>\
<td><select id='link_target' style='width:150px;' onchange='link_target_changed();'>\
<option value=''>None</option>\
<option value='_blank'>New Window (_blank)</option>\
<option value='_top'>Top Frame (_top)</option>\
<option value='_parent'>Parent Frame (_parent)</option>\
<option value='_self'>Same Frame (_self)</option>\
<option value='_custom'>Custom Target</option>\
</select> \
<input type='text' id='link_customtarget' style='width:95px;display:none;' /> \
</td></tr>\
<tr style='display:none;'><td class='f_title'>Class</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();'>OK</button>\
<button type='button' name='cancel' id='cancelButton' onclick='window.close();'>Cancel</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> \
<head>\
<title>Table Editor</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 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>\
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -