How to access the entry editor's text from a dialog in Movable Type
When in a modal dialog, the parent window has an object called "app" which is of type MT.App. This object in turn has a property called "editor" which is of type Editor. You can find the files for these objects under mt-static/js/common. From the modal dialog, you can access them with calls like this:
<script type="text/javascript">
window.parent.app.insertHTML("<strong>I just inserted text!</strong>");
alert("Now things are about to be reset!");
window.parent.app.editor.setHTML("");
//Now everything should be cleared out of the editor.
</script>
The MT.App class has an insertHTML method which is a thin wrapper around the one provided by Editor. Editor has two other methods, get and setHTML, which are of value for developers who want to manipulate the contents of the text editor.
Sign In
Google Search
Elsewhere
- Mike Answered Lost Username and PW during upgrade on MT.org
- Mike Answered Schema upgrade doesn’t happen with 4.261 on MT.org
- Mike Answered problem with flash applet in dashboard on MT.org
- Mike Answered multi-blog installation and discovery on MT.org
- Mike Answered Stylesheet Module problem on MT.org
- Mike Answered multi-blog installation and discovery on MT.org
- Mike Answered Stylesheet Module problem on MT.org
- Mike Answered Stylesheet Module problem on MT.org
- Mike Answered Server locks up when inserting file or image…. on MT.org
- Mike Answered Server locks up when inserting file or image…. on MT.org
- Mike Answered MT Styles - Was there any real effort? on MT.org
- Mike commented on [Ask Proggit] How do you figure out how much to charge for freelancing? at Reddit
- Mike Answered defining user’s access rights on MT.org
- Mike Answered altering the archive template on MT.org
- Mike Answered All entry edit fields are missing from the entry posting page on MT.org
July 2009
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Monthly Archives
- July 2009 (1)
- June 2009 (31)
- May 2009 (36)
- April 2009 (39)
- March 2009 (42)
- February 2009 (51)
- January 2009 (48)
- December 2008 (44)
- November 2008 (52)
- October 2008 (55)
- September 2008 (51)
- August 2008 (52)
- July 2008 (44)
- June 2008 (39)
- May 2008 (35)
- April 2008 (38)
- March 2008 (68)
- February 2008 (44)
- January 2008 (56)
- December 2007 (45)
- November 2007 (18)
- October 2007 (41)
- September 2007 (40)
- August 2007 (24)
- July 2007 (35)
- June 2007 (43)
- May 2007 (36)
- April 2007 (33)
- March 2007 (50)
- February 2007 (54)
- January 2007 (54)
- December 2006 (43)
- November 2006 (31)
- October 2006 (37)
- September 2006 (30)
- August 2006 (52)
- July 2006 (36)
- June 2006 (30)
- May 2006 (58)
- April 2006 (47)
- March 2006 (60)
- February 2006 (65)
- January 2006 (17)
- December 2005 (20)
- November 2005 (4)

