Version: , by Mutt
Developer Last Online: Mar 2013
Version: Unknown
Rating:
Released: 06-27-2001
Last Update: Never
Installs: 1
No support by the author.
Ok don't give me a bunch of crap if I'm posting this wrong, this is my first little contribution to VB.
In the short time I've been playing around with VB, I've already become annoyed at editing templates. I added two little javascript buttons to the page to make things easier.
Copy - click the button to highlight all the text in the textarea and copy it to the clipboard in one step
Preview - opens a new window displaying the html from the message area. It doesn't replace the variables with any value, but does gives you an idea of layout and color changes
for VB v2.0.1
updated attachment below
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
ok here's another post from me!
i don't know why the people here don't tell me the answer on my questions!
In the attachtment
Quote:
Adds some helpful features to the admin edit template page - Highlight All and Copy - Quick & Dirty Preview Template - Find in template Made By Mutt VB2.0.1 edit templete.php right at the begining of the script just after function displayHTML() { var inf = document.name.template.value; win = window.open(\", \", 'popup', 'toolbar = no, status = no, scrollbars=yes'); win.document.write(\"\" + inf + \"\"); } function HighlightAll() { var tempval=eval(\"document.name.template\") tempval.focus() tempval.select() if (document.all){ therange=tempval.createTextRange() therange.execCommand(\"Copy\") window.status=\"Contents highlighted and copied to clipboard!\" setTimeout(\"window.status=''\",1800) } } var NS4 = (document.layers); // Which browser? var IE4 = (document.all); var win = window; // window to search. var n = 0; function findInPage(str) { var txt, i, found; if (str == '') return false; if (NS4) { if (!win.find(str)) while(win.find(str, false, true)) n++; else n++; if (n == 0) alert('Not found.'); } if (IE4) { txt = win.document.body.createTextRange(); for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) { txt.moveStart('character', 1); txt.moveEnd('textedit'); } if (found) { txt.moveStart('character', -1); txt.findText(str); txt.select(); txt.scrollIntoView(); n++; } else { if (n > 0) { n = 0; findInPage(str); } else alert('Not found.'); } } return false; } "; find ###################### Start add ####################### add makelabelcode("","$ButtonExtra"); right before makehiddencode("group", "$group"); find ###################### Start edit ####################### add makelabelcode("","$ButtonExtra"); right before makehiddencode("group", "$group");
ok what must i now change in the template "template.php"??
pleazz tell it me! this is a great hack and i want it too!!!
The find feature doesn't work for me either.. there must be some wrong coding in the java cause everytime I push the find button I get the Error on Page message in the status bar of IE.
Ok.. after I posted this I went back to the templates to try it again and found out this:
The Find button will ONLY work until you hit the preview button. Once the preview button loads up the new page.. the Find will NO longer work.. simply refresh the template page and the find will work again.. however your code changes will be lost.
It still works after you press copy.. but for some reason it must not like the popup feature of the preview.
Just wanted everyone to know that this works in 2.03 and I fixed the javascript bug that kills find after using the preview. the only changes were where $ButtonExtra is defined.
I'd like to add an undo button. Alt+U will undo changes to the text area and I need a way to make a button that simulates pressing Alt+U. Any ideas? If you know of anything where you can use javascript to make a link simulate a key press, let me know. thanx!