I use tiny_mce as word-like editor in textareas that are in iframes. I want to use whole iframe space. TinyMCE has a fullscreen button, but I need to set full-screen mode automatically when plugin has loaded. Is there a function/trigger to call this mode (or the button)? Thanks for help.
max_width. This option sets the maximum width that a user can stretch the entire TinyMCE interface (by grabbing the draggable area in the bottom right of the editor interface). This behavior is different than the autoresize plugin, which controls the resizing of the editable area only, not the entire editor.
Use the branding option to disable the “Powered by Tiny” link displayed in the status bar for product attribution.
In the IFRAME document you can instruct TinyMCE to switch to fullscreen mode once the textarea has initialized. The following code will need to go into your IFRAME:
<script type="text/javascript">
tinyMCE.init({
mode : "exact",
elements : "description", // This is the id of the textarea
plugins : "fullscreen",
theme : "advanced",
theme_advanced_buttons1 : "fullscreen,code",
theme_advanced_buttons2 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
oninit : function() { // Once initialized, tell the editor to go fullscreen
tinyMCE.get('description').execCommand('mceFullScreen');
}
});
</script>
....
<textarea id="description"></textarea>
The TinyMCE fullscreen plugin will fill up the current window - and, since the IFRAME is it's own window, the this should fill the IFRAME.
Edit: This technique can also be used with the TinyMCE JQuery library. The options are the same but the invocation syntax is a little different. Again, the key lines are the oninit
callback:
$(document).ready(function() {
$('#description').tinymce({ // "description" is the id of the TEXTAREA
// ... same options inserted here ...
oninit : function() {
tinyMCE.get('description').execCommand('mceFullScreen');
}
});
});
You just need to insert the following code into the tinyMCE.init({}) function:
setup : function(ed) {
ed.on('load',function(e){
ed.execCommand('mceFullScreen');
});
},
Ps: remember the comma if you have other instruction after it or it will fail. ;-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With