NTLDR
04-04-2004, 10:00 PM
I just remembered that there used to be a link here for PHP/Code boxes thats selected the contents and copied them to the clipboard and thought I want that for the template manager, then noticed it was already there ;) Anyway, this adds a paste button next to it so after you've edited the template with your favourite editor you can click paste and it replaces the whole template.
Simple but useful IMO. (Note this only works in IE).
In clientscript/vbulletin_templatemgr.js find:
// ################################################## ###########################
// function to find text on a page
Add above:
function PasteClipboard()
{
var tempval = eval('document.cpform.template')
tempval.focus();
tempval.select();
if (document.all)
{
therange = tempval.createTextRange();
therange.execCommand('Paste');
setTimeout("window.status=''",1800)
}
}
In includes/adminfunctions_template.php find:
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
Add after:
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['paste'] . ' " accesskey="v" onclick="PasteClipboard();" tabindex="1" />
Add one new phrase in the Style Tools group:
Varname: paste
Text: Paste
Simple but useful IMO. (Note this only works in IE).
In clientscript/vbulletin_templatemgr.js find:
// ################################################## ###########################
// function to find text on a page
Add above:
function PasteClipboard()
{
var tempval = eval('document.cpform.template')
tempval.focus();
tempval.select();
if (document.all)
{
therange = tempval.createTextRange();
therange.execCommand('Paste');
setTimeout("window.status=''",1800)
}
}
In includes/adminfunctions_template.php find:
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['copy'] . ' " accesskey="c" onclick="HighlightAll();" tabindex="1" />
Add after:
<input type="button" class="button" style="font-weight:normal" value=" ' . $vbphrase['paste'] . ' " accesskey="v" onclick="PasteClipboard();" tabindex="1" />
Add one new phrase in the Style Tools group:
Varname: paste
Text: Paste