PDA

View Full Version : 'Paste' Button in Template Editor


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

Boofo
04-04-2004, 10:47 PM
Excellent idea. Clicks install. ;)

Vivi Ornitier
04-05-2004, 03:01 AM
nice, might save a click or two ;)

gmarik
04-05-2004, 03:35 AM
This should be in 3.1 by default for sure!

BarBeQue
04-06-2004, 08:36 AM
paste button??

* BarBeQue always uses ctrl+v :D

NTLDR
04-06-2004, 11:50 AM
So did I, but click, ctrl-a, ctrl-v takes alot more time then a signgle click ;)

corsacrazy
04-06-2004, 01:16 PM
So did I, but click, ctrl-a, ctrl-v takes alot more time then a signgle click ;)
im kinda in the routine of doint that now it comes naturally if u know wot i mean, may take a while to get used to the simple one clik

Chris M
04-12-2004, 05:22 PM
Great idea - Installed :)

Satan

weitalia
07-15-2004, 01:30 PM
Nice job ;)

;)

Onkel_Tom
08-19-2004, 10:30 PM
thanks for this mod, Onkel_Tom clicks install ;)