function XEBInsertTalk(itm)
{
hideXEBPopup();
insertTags('','', code);
return false;
}
function XEBPopupImage(e)
{
m=new GetPos(e||event);
curPopup=new XEBPopup("image",m.x,m.y);
curPopup.width=300;
mt='<p>Enter the image parameters below: <\/p>'
+'<form name="XEBPopupImageForm">'
+'File:<input type="text" name="imgFile" value="' + XEBGetSelectedText() + '" size="30"><br>'
+'Type:<SELECT NAME="imgType">'
+'<OPTION VALUE="thumb">Thumbnail'
+'<OPTION VALUE="frame">Frame'
+'<OPTION VALUE="none">[not specified]'
+'</SELECT><br>'
+'Location:<SELECT NAME="imgLocation">'
+'<OPTION VALUE="left">Left'
+'<OPTION VALUE="center">Centre'
+'<OPTION VALUE="right">Right'
+'<OPTION VALUE="none">None'
+'</SELECT><br>'
+'Size:<input type="text" name="imgSize" value="100" size="3">px<br>'
+'Caption:<input type="text" name="imgCaption" value="" size="30"><\/p>'
+'<\/form>'
+'<p><button onClick="javascript:XEBInsertImage()">Insert</button>'
+'<button onClick="hideXEBPopup()">Cancel</button>';
curPopup.setInnerHTML(mt);
return true;
}
function XEBInsertImage()
{
f=document.XEBPopupImageForm;
hideXEBPopup();
var code='[[Image:';
code+=f.imgFile.value;
code+='|'+f.imgType.value;
code+='|'+f.imgLocation.value;
code+='|'+f.imgSize.value;
code+='|'+f.imgCaption.value;
code+=']]';
insertTags('','', code);
extendSummary('image');
return false;
}
function XEBPopupFormattedText(e)
{
m=new GetPos(e||event);
curPopup=new XEBPopup("image",m.x,m.y);
curPopup.width=300;
mt='<form name="XEBPopupImageForm">'
+'<table style="background: transparent;">'
+'<tr><td>Bold:<\/td><td><input type="checkbox" name="textBold"><\/td>'
+'<td>Superscript:<\/td><td><input type="checkbox" name="textSuperscript"><\/td><\/tr>'
+'<tr><td>Italic:<\/td><td><input type="checkbox" name="textItalic"><\/td>'
+'<td>Subscript:<\/td><td><input type="checkbox" name="textSubscript"><\/td><\/tr>'
+'<tr><td>Strike:<\/td><td><input type="checkbox" name="textStrike"><\/td>'
+'<td> <\/td><\/tr>'
+'</table>'
+'Size:<SELECT NAME="textSize">'
+'<OPTION VALUE="small">small'
+'<OPTION VALUE="normal">[Normal]'
+'<OPTION VALUE="big">big'
+'</SELECT><br><table style="background:transparent;"><tr><td>Colour:<\/td><td>'
+'<table width="100px">'
+'<tr><td colspan="4">None<\/td></tr>'
+'<tr><td bgcolor="aqua"> <\/td><td bgcolor="gray"> <\/td>'
+'<td bgcolor="olive"> <\/td><td bgcolor="navy"> <\/td><\/tr>'
+'<tr><td bgcolor="black"> <\/td><td bgcolor="green"> <\/td>'
+'<td bgcolor="purple"> <\/td><td bgcolor="teal"> <\/td><\/tr>'
+'<tr><td bgcolor="blue"> <\/td><td bgcolor="lime"> <\/td>'
+'<td bgcolor="red"> <\/td><td bgcolor="white"> <\/td><\/tr>'
+'<tr><td bgcolor="fuchsia"> <\/td><td bgcolor="maroon"> <\/td>'
+'<td bgcolor="silver"> <\/td><td bgcolor="yellow"> <\/td><\/tr>'
+'</table><\/td><\/tr>'
+'<\/form>'
+'Sample:'
+'<span id="sampleText">Text</span>"'
+'<p><button onClick="javascript:XEBInsertFormattedText()">Insert</button>'
+'<button onClick="hideXEBPopup()">Cancel</button>';
curPopup.setInnerHTML(mt);
return true;
}
function XEBUpdateSampleText()
{
f=document.XEBPopupImageForm;
}
//====================
function XEBMenuMouseOut(e)
{
var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
targ.style.color='black';
}
function XEBMenuMouseOver(e)
{ var targ;
if (!e) var e = window.event;
if (e.target) targ = e.target;
else if (e.srcElement) targ = e.srcElement;
targ.style.color='red';
}
//=======================================================================
// Other functions
//=======================================================================
function getElementsByClassName(parent,clsName,htmltag){
var arr = new Array();
var elems = parent.getElementsByTagName(htmltag);
for ( var cls, i = 0; ( elem = elems[i] ); i++ ){
if ( elem.className == clsName ){
arr[arr.length] = elem;
}
}
return arr;
}
function extendSummary(newText)
{
if(!XEBExtendEditSummary)return;
s=document.editform.elements['wpSummary'].value;
s+=(s=='')?newText:' +'+newText;
document.editform.elements['wpSummary'].value=s;
}
function bug(msg)
|