Toggle preview

Atto ::: atto_preview
Maintained by Daniel Thies
An Atto editor plugin that shows a preview of the filtered editor content.
Latest release:
1161 sites
128 downloads
41 fans
Current versions available: 2

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. 

Testing status

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Daniel Thies (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • David Mudrák
    Tue, 3 Mar 2015, 3:24 AM
    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!
  • Daniel Thies
    Tue, 3 Mar 2015, 4:42 AM
    Thanks for reviewing this David. After reading the formatting documentation, I made your suggested changes and updated the plugin.
  • Francis Feytout
    Thu, 11 Jun 2015, 4:49 PM
    Hi, Is there a particular trick to internationalisation ? I added my custom fr pack to the plugin and Moodle detected it in the fr langage pack, but the tooltips are still in English.
  • Daniel Thies
    Thu, 11 Jun 2015, 11:51 PM
    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.
  • SG
    Wed, 19 Aug 2015, 5:15 AM
    I have a question. How to understand this message:
    "414
    Request-URI Too Large
    The request URL is over the maximum size allowed!"

    What should I do?
  • Daniel Thies
    Wed, 19 Aug 2015, 7:18 AM
    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.
  • Daniel Thies
    Wed, 2 Sep 2015, 2:18 AM
    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.
  • Peter Halverson
    Wed, 15 Jun 2016, 11:35 AM
    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)
  • Daniel Thies
    Fri, 17 Jun 2016, 5:10 AM
    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.
  • Peter Halverson
    Wed, 8 Mar 2017, 4:44 AM
    Hello again,

    I had to give up on getting the Toggle Preview to work for me but now I have to get it working for my students.

    My installation is still Moodle 3.1+ and there are special themes. Yet the "eyeball" button still does not show up.

    I did check in Plugins->Text editors->Atto HTML editor->Atto toolbar settings and I do see that "Toggle Preview" in in the list that comes up.

    What I don't see is a list of actual buttons. Is there a list of buttons I can edit?

    Thanks,

    Peter Halverson
    (I wish I could attach screen shots to these comments.)
  • Peter Halverson
    Wed, 8 Mar 2017, 4:51 AM
    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
  • Peter Halverson
    Wed, 8 Mar 2017, 5:21 AM
    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!
Please login to post comments