Atto: Paste special

Maintained by Picture of Joseph Inhofer Joseph Inhofer
PasteSpecial button for Atto reduces clutter when pasting from non-Atto text editors.
619 sites
25 fans

This is a plugin for Atto editor in Moodle that allows the user to paste content from several different rich formatting areas and either import the styling or import as unformatted text. To install, unpack to lib/editor/atto/plugins/pastespecial and visit the admin notifications page to install. Then add the button on that Atto toolbar settings page. The pastespecial settings page can be used to configure the allowed styles when importing formatting.

Pastespecial now "allows" tables (as of version 2016021100). It gets pasted in as normal without any handling. I STRONGLY encourage you to create your tables within Atto, but apparently not enough to artificially prohibit this. 


Screenshot #0


Picture of Joseph Inhofer
Joseph Inhofer (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of David Mudrák
    Tue, 15 Sep 2015, 5:43 PM

    Thanks Joseph for sharing the plugin with the community. I can confirm I was able to successfully install and use the plugin. I have not spotted approval blockers while reviewing the code. Let me just recommend to fix the issues detected by our automated coding style checker scripts. Most of them are quite easy to fix formal issues related to the coding style. Related to that, you may want to re-check the section in the checklist.

    Assuming the raised issues will be fixed in a future update, you are cleared to land now. Welcome to the Plugins directory.

  • Picture of Joseph Inhofer
    Fri, 18 Sep 2015, 5:05 AM

    I have updated the code as per the prechecker suggestions. Is there a way to run it again and see if all of the issues have been corrected and if any new ones arise?
  • Picture of Bernhard Weichel
    Mon, 14 Dec 2015, 5:52 PM
    This is one of the most urgently required plugins. In particular while working with Chrome, cut&paste in the editor adds a lot of style garbage. So I highly appreciate this plugin (even if I think that ATTO should cleanup the pasted HTML by itself wink

    So I installed it on my test drive. It seems to pass some styles per default:

    I made an experiment in Chrome:

    1. create a simple paragraph
    2. do cut & paste
    3. paste from word
    4. paste from other.

    The raw HTML looks like this. You can see that direct paste adds a lot of styles. Add "from word" and "add from other" yields the same result. I added a style named "foo" to the configuration of "paste from other", just to ensure that no hidden default (e.g. the one from word) is applied. But color and font size are always pasted.

    Simple paragraph with bold .

    -------------------- direct paste

    Simple paragraph with bold .

    -------------------- paste from other

    Simple paragraph with bold .

    --------------------- paste from word

    Simple paragraph with bold .


    I still find ATTO being indeed simpler to use than TinyMce but, the generated HTML is still not optimal (not to say a nightmare). You can see that the paste
  • Picture of Bernhard Weichel
    Mon, 14 Dec 2015, 5:57 PM
    I see that the comment function interprets the HTML: so I try again (sorry for polluting this here).

    <p>paragraph="" with=""
    <b="">bold .</b=""> </p> <p></p> <p> <br> </p> <p>-------------------- direct paste</p> <p> </p> <p style="margin: 0px 0px 10px; color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: auto; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">Simple paragraph with <b>bold</b> .</p> <br>-------------------- paste from other
    <p></p> <p> </p> <p style="color: rgb(51, 51, 51);font-size: 14px;">Simple paragraph with <b>bold</b> .</p>
    <p>--------------------- paste from word</p> <p></p> <p style="color: rgb(51, 51, 51);font-size: 14px;">Simple paragraph with <b>bold</b> .</p> <p style="color: rgb(51, 51, 51);font-size: 14px;"> <br> </p> <p></p> <p></p> <p></p>

  • Picture of Iñigo Zendegi Urzelai
    Thu, 3 Mar 2016, 9:06 PM
    Hi Joseph,

    We've been using this plugin and it's great!

    We've tried the 'Set as default' option and realized it is quite aggressive (many people are used to paste with 'Ctrl+V' and complained because they want it to do just that), but a user came with another option that I'd like to see in this plugin: the option to trigger Paste Special when the user types 'Ctrl+Shift+V', as this is the special paste command used in other software. This could added as another option to the actual 'Set as default' setting: Disabled, Set as default Ctrl+V, Set as default Ctrl+Shift+V (new).
  • Picture of Joseph Inhofer
    Wed, 16 Mar 2016, 4:02 AM

    Thank you for your suggestion! The latest version, 2016031100, does have the "set as default" setting changed to a single select that has the options of "none", "ctrl+v", and "ctrl+shift+v". Let me know if this is different from what you'd like, or if you'd be interested in having any more improvements to this plugin.
  • Picture of Iñigo Zendegi Urzelai
    Wed, 16 Mar 2016, 3:48 PM
    Hi Joseph,

    It does just what I expected. I think the most reasonable default value is "Ctrl+Shift+V" as you decided so it couldn't be better smile

    Great work Joseph!
  • Ricardo Caiado
    Wed, 7 Dec 2016, 8:43 PM
    Any upgrade to Moodle 3.2?
  • Picture of Michael Milette
    Tue, 6 Feb 2018, 11:47 PM
    Hi Joseph,

    Any chance that we might be seeing a version of Paste Special that is compatible with newer releases of Moodle (3.1 to 3.4) in the near future or have you abandoned the project? I could really use this functionality in Moodle 3.4.

    Best regards,

  • Picture of Alexandre Bento Martins
    Thu, 8 Feb 2018, 2:23 AM
    Any upgrade to MOODLE 3.4 ?
  • Ricardo Caiado
    Sun, 15 Apr 2018, 9:10 AM
    Is this plugin discontinued?
  • Picture of Michael Milette
    Tue, 10 Jul 2018, 2:47 PM
    Hi Joseph,

    Hope to see a version of Paste Special for Moodle 3.5 in the near future.

    Best regards,

  • Picture of Bert van der Hooft
    Wed, 22 Aug 2018, 1:51 PM
    Hi Joseph,

    Your plugin is highly appreciated. Any chance for a newer version

  • Al
    Sun, 25 Nov 2018, 11:15 PM
    Please, can you add moodle auto-updater to this plugin? We update moodle every week and have to find the plugin when the others all do it automatically. It would save so much time, thank you.

Commenting temporarily disabled