https://buy-zithromax.online buy kamagra usa https://antibiotics.top buy stromectol online https://deutschland-doxycycline.com https://ivermectin-apotheke.com kaufen cialis https://2-pharmaceuticals.com buy antibiotics online Online Pharmacy vermectin apotheke buy stromectol europe buy zithromax online https://kaufen-cialis.com levitra usa https://stromectol-apotheke.com buy doxycycline online https://buy-ivermectin.online https://stromectol-europe.com stromectol apotheke https://buyamoxil24x7.online deutschland doxycycline https://buy-stromectol.online https://doxycycline365.online https://levitra-usa.com buy ivermectin online buy amoxil online https://buykamagrausa.net

The Return of the Revenge of the Son of the MT Rich Text Formatting Buttons!

Okay, so not having a link button or italics buttons or stuff like that in the comments was driving me nuts. Time to re-insert the old code. But … wait….

Okay, so not having a link button or italics buttons or stuff like that in the comments was driving me nuts. Time to re-insert the old code.

But … wait. Movable Type’s rich text formatting buttons under 3.x seem to work just fine in the normal edit window in Firefox (huzzah!), so no fancy-schmancy rewriting of the code is needed for cross-platform editing — thus, easy beans, right?

Well … it would help if I understood Java better, but, yeah, ultimately it’s pretty straightforward to adopt the internal MT formatting buttons to the comments in your blog …

Step 1: Extract the appropriate display code from the edit_entry.tmpl file and put it into your template (e.g., the individual archives) comment area around the comment text box, as in this code.

Notes on that code block::

  • I’ve left out some formatting niceties, which would be driven by your own blog design.
  • The “/blog/mt/” statements should be replaced with the path to your MT directory (above the images directory).
  • The “comments_form” text should be replaced with whatever the form name is (e.g., <form name=”comments_form”>). This was the part that threw me the longest.

Those functions aren’t yet defined, of course, at least not in the template. But they are part of the base MT Javascript library (mt.js). And since the code is fairly universal, we can just refer to that file, rather than having to tweak things. So …

Step 2: Inside the <head></head> area at the top of the template, include the following statement:

<script type="text/javascript" src=&quot/blog/mt/mt.js&quot></script>

Again, substituting the path to your MT directory for “/blog/mt/”

And that, as they say, is that.

I probably won’t add any buttons beyond the basic four, but it’s straightforward enough to do so.

As far as I can tell, this should work not just in IE and Mozilla/Gecko-based browsers, but also in Safari.

40 view(s)  

8 thoughts on “The Return of the Revenge of the Son of the MT Rich Text Formatting Buttons!”

  1. Since the comment about Safari is probably aimed at me, I’ll report that the editing buttons don’t show up in Safari. They do in Firefox/Mac, but not Safari.

    In Firefox, however, if you click one when there’s no text selection, the main window scrolls to the top, hiding what you’re trying to edit.

    Also in Firefox, when I tried to post from the preview window, I got the following error:

    Build error in template ‘Comment Error Template’: Error in tag: Can’t find included template module ‘RememberMe Java AfterForm’

    Use of uninitialized value in pattern match (m//) at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 472.
    Use of uninitialized value in concatenation (.) or string at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 473.
    Use of uninitialized value in join or string at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 477.
    Use of uninitialized value in join or string at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 477.
    Use of uninitialized value in join or string at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 477.

  2. Since the comment about Safari is probably aimed at me, I’ll report that the editing buttons don’t show up in Safari. They do in Firefox/Mac, but not Safari.

    *Sigh*

    I know there’s some Safari detection code in mt.js, which was why I was hoping it would work here. Rats.

    I’ll dig around a bit.

    In Firefox, however, if you click one when there’s no text selection, the main window scrolls to the top, hiding what you’re trying to edit.

    Yup. Seems to be based on how the scripts are trying to determine where the focus is. May just be a FF thing (at the very least, it works that way in the MT modules I swiped the code from, so it’s not *my* bug).

    Also in Firefox, when I tried to post from the preview window, I got the following error:

    Build error in template ‘Comment Error Template’: Error in tag: Can’t find included template module ‘RememberMe Java AfterForm’

    Use of uninitialized value in pattern match (m//) at plugins/Blacklist/lib/Blacklist/App/Submission.pm line 472. [etc.]

    Hmmmm. Preview was working fine yesterday for me. I’ll try it again on this post.

  3. Interestingly enough, I didn’t get that error.

    Ah. There was some sort of error in your posted comment, which dropped it into the Comment Error Template, which I hadn’t updated yet. I guess I should go do that thing.

  4. I can live without the editing buttons, so don’t spend too much time on it, particularly if I’m your only regular Safari user. I’m still kind of waffling between Safari and Firefox anyway.

    As for errors in my post: me make an error? Never! Impossible! Inconcievable! <Inigo Montoya Voice> I don’t think that word means what you think it means. </Inigo Montoya Voice>.

    Well, maybe there was a mis-matched tag or something. I used the editing buttons in FireFox to compose that post, and some problem with the tags might have slipped in.

  5. I don’t know what sort of error would have caused going to the Comment Error template (certainly mismatched or unterminated tags wouldn’t have done it, he says ruefully). Unless it starts happening regularly …

Leave a Reply

Your email address will not be published. Required fields are marked *