Rich Text Editing in Movable Type
kurcula.com posted a hack to enable rich-text editing for Movable Type in Mozilla.
Maybe I was doing it wrong, but the part about adding the document.write table after the if/else didn't work for me, but the following did, when placed after that <script> block:
<TMPL_IF NAME=AGENT_MOZILLA>
<table border="0" cellspacing="0" cellpadding="0" width="107">
<tr>
<td width="24"><a href="javascript:wrapSelection('b')">
<img src="<TMPL_VAR NAME=STATIC_URI>images/bold-button.gif" alt="bold" width="24" height="18" border="0"></a></td>
<td width="24"><a href="javascript:wrapSelection('i')">
<img src="<TMPL_VAR NAME=STATIC_URI>images/italic-button.gif" alt="italic" width="24" height="18" border="0"></a></td>
<td width="24"><a href="javascript:wrapSelection('u')">
<img src="<TMPL_VAR NAME=STATIC_URI>images/underline-button.gif" alt="underline" width="24" height="18" border="0"></a></td>
<td width="26"><a href="javascript:insertMozLink()">
<img src="<TMPL_VAR NAME=STATIC_URI>images/url-button.gif" alt="link" width="26" height="18" border="0"></a></td>
</tr>
</table>
</TMPL_IF>
If you like, you can download this edit_entry.tmpl file where I have already made the changes, and upload it to MTPath/tmpl/cms/edit_entry.tmpl
. You of course do so at your discretion.
[link via asa]
Comments
The reason why I placed this piece of code inside <script> is that buttons won't be rendered if javascript is turned off.
Awesome. Thanks!
Doesn't seem to work with Mozilla Firebird? Did I implement the hack wrong?
works for me in phoenix, bu ti just downloaded the file and replaced.
Just a note to Safari users.
It seems as though the buttons will show up while you're in Safari, but they don't work the same way.
For example, if I hit 'B' (the bold button), this shows up:
Jasmeet<b>Jasmeet</b>Jasmeet
Works fine without text if you hit 'B'(or whatever else), then type your text.
Just a work of caution.
Very nice. I've added this to the bookmarklet template as well at http://kalsey.com/2003/05/mt_text_formatting_buttons_in_mozilla/
Thanks for the hack! However, I'd recommend substituting strong and em for b and i beginning on line 426.
Just what I was looking for. Thanks very much.
I would recommend adding title attributes to each button's img tag, since Firebird/Mozilla won't display alt tooltips by default.
Thanks for posting this.
Is this working *perfectly* for most? It seems to blow up when I go to new lines or try to add formatting (or URLs) to text I am editting (as opposed to freshly writing).
It doesn't like to add the formatting to new lines - the formatting shows up on the first line only, however, with the correct offset from "column zero"
I'm using Mozilla 1.2.1 and MT 2.63
Dan, The Rich Text stuff for Mozilla was only recently added. So I think it will only work with Mozilla 1.3+
Yup, you're right... I upgraded to Mozilla 1.3.1 and it's working properly.
In addition, you might want to mention the hack for bm_entry.tmpl - which is for the "Post to MT..." bookmarklet. (It's at Adam Kalsey's site)
thanks you, getting Firebird close to perfect now.
Thanks very much for the great research and code work. Are Ben and Mena aware of this issue so they can fix it in the next release? I'm definately up to writing them an email if no one else has yet.
Thanks again.
Totally rocks! Just did this for my Moz 1.5b on OS X 10.2.6 and works perfectly! Running MT 2.64
excellent. works with safari and with windows netscape. thank you very much.
Yep! Great job. Works with Galeon 1.2.7
THANK YOU!!!!!!!!!!!!!!!!!!
This does indeed work well with Firebird 0.7. Many thanks!
Well done.
Great comments guys. Peter FDA
Rock! One more step toward making Firebird 0.7 my default browser.
Perfect :)
It's working in Firebird 0.7
Great! Thank you very much.
I was just wanted to ask if you had a very Merry Christmas / Holiday, and to wish you the very best for the New Year.
BTW, In saw something on another blog site I think it is a good idea to let as many people / bloggers know about. I was just organizing my vacation for later this year and stumbled across the above web site about Bali, where I was considering going. But just read what it says there and especially between the lines; unreal. A travel agent there Bali Discovery Tours of Sanur went to their friend the police chief and made trouble for someone visiting the island who had caught this travel agent offering unauthorized room rates on the Internet for the Hotel Santika Beach in Kuta, which is where I was going to stay, but thank God I am not now (I am not even going to Bali becuase of this) - seems to me like the hotel did not exactly help!
The poor guy was detained by the police for 4 days and had his passport illegally seized. He was not released until the British Embassy filed a formal complaint. Of course, there were no charges!! This is absolutely terrible. Please, please, please, join me in saying "Stuff Bali - I'm going somewhere where they treat people like guests, not enemies".
Post a Comment
This discussion has been closed.