This plugin makes a preview button available to the Atto editor. When the button is pressed the content of the editor is passed through the filters enabled on the editing page and the result is displayed over the editor content window. Pressing the button again closes the preview.

Thanks Daniel for sharing this plugin with the Moodle community. It is really a nice and very useful feature! I did not find any approval blockers in the code. Two things that caught my eye during the code review: (1) Why do you clean the passed $content as PARAM_CLEANHTML? Should not it better be PARAM_RAW (like the Moodle does normally in this case), given that you are displaying it back processed by format_text()? (2) Why is FORMAT_MOODLE used here? The Atto editor supports the only format and that's FORMAT_HTML. These two issues could potentially lead to differences between the preview and the final result. You may want to review and eventually change them in an updated version of the plugin.
Said that, you are cleared to land now. Welcome to the Plugins directory!

Hi Fancis, I just checked in French and German, and the tool tips translations are working for me with the current standard language packs. You updated your local language cache it seems, but did you try clearing the strings cache? Thanks for the translation help.

Hello Sławomir,
Thanks for reporting this. We have only test this before with small content. The GET method used is limited by web server. For default Apache this means max is about 8K characters. The server limit could be expanded with the LimitRequestLine directive, but it would probably be better if I could use the POST to implement it instead which is what is usually used to save the editor contents.

I just added an update to fix the issue with larger text size. The filtered text is now fetched very POST method so the PHP upload_max_filesize is the limit in browsers that support srcdoc attribute on iframe. Others which includes IE will default back to old behavior.

Hello,
I just upgraded to Moodle 3.1 and I installed preview version 2016021500. However the "eyeball" icon is not showing up. Is atto_preview known to work with Moodle 3.1? (To be clear I installed Moodle 3.1 from scratch and added the preview plug-in)

Hi Peter,
To add any plugin in to Atto you need to remember to add the button to the list of buttons in Plugins->Text editors->Atto HTML editor->Atto toobar settings. Did you remember to do this? I have been using the preview plugin on 3.1 for some time without issue, but it is an updated site not a new one. Otherwise, it might be helpful to know whether you are using a new theme.

Hi again,
I think I have a clue as to the problem. There is a "Toolbar Config" list that seems to have all the buttons listed. I think if I were to add the Toggle Preview button's name to that list, it might work. Question: what is the *name* of the button?
Thanks again,
Peter Halverson
PS: Here are the contents of the Toolbar Config field as it is right now.
collapse = collapse
style1 = title, bold, italic
list = unorderedlist, orderedlist
links = link
files = image, media, managefiles
style2 = underline, strike, subscript, superscript
align = align
indent = indent
insert = equation, charmap, table, clear
undo = undo
accessibility = accessibilitychecker, accessibilityhelper
other = html

I got it to work!!!!
I made a guess...
I appended ", preview" to the line beginning with "style1"
So now it reads "style1 = title, bold, italic, preview"
Logged, out and in and now it works. The "eyeball" show up and does what it is supposed to.
Yay!