Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-40648

Tinymce plugin API new functions

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5
    • 2.6
    • HTML Editor (TinyMCE)
    • MOODLE_25_STABLE
    • MOODLE_26_STABLE
    • wip-MDL-40648-master
    • Hide
      1. Enable filters: TeX notation, emoticons and Algebra.
      2. Enable all tinymce plugins (should be all enabled by default).
      3. Try to change the Tinymce buttons layout and make sure that buttons appear where they are supposed to. Note that all moodle tinymce plugins add their buttons automatically if they are not present. The automatic button location should be following:

      moodleemoticon: after image. If image is not present - in the end of the LAST row.

      moodlemedia: after moodleemoticon (if it is present), otherwise after image. If image is not present - in the end of the FIRST row.

      moodlenolink: after unlink, or in the end of the FIRST row.

      Toolbar Toggle: the very first button in the first row.

      dragmath: before nonbreaking or in the end of the LAST row.

      spellchecker (IE 8 & 9 only): after 'code' button. (Have no idea why it is not added at all if code button is not present but I did not change this logic)

      Show
      Enable filters: TeX notation, emoticons and Algebra. Enable all tinymce plugins (should be all enabled by default). Try to change the Tinymce buttons layout and make sure that buttons appear where they are supposed to. Note that all moodle tinymce plugins add their buttons automatically if they are not present. The automatic button location should be following: moodleemoticon: after image. If image is not present - in the end of the LAST row. moodlemedia: after moodleemoticon (if it is present), otherwise after image. If image is not present - in the end of the FIRST row. moodlenolink: after unlink, or in the end of the FIRST row. Toolbar Toggle: the very first button in the first row. dragmath: before nonbreaking or in the end of the LAST row. spellchecker (IE 8 & 9 only): after 'code' button. (Have no idea why it is not added at all if code button is not present but I did not change this logic)

    Description

      Since in 2.6 we introduce at least another 3 plugins for tinymce (wrap, pdw and managefiles) I want to suggest 2 new functions
      editor_tinymce_plugin::find_button()
      editor_tinymce_plugin::count_button_rows()
      and also remove function is_button_present() - it is private so nothing will be broken

      With the help of those new API functions we can make sure that automatic adding of buttons by plugins is smarter and when the tinymce layout is changed by admin, the new buttons are added in the correct place.

      Example: At the moment moodleemoticon adds itself after the 'image' button in the 3rd row. If layout is changed by admin and 'image' is no longer in the 3rd row, moodleemoticon adds itself in the end of the 3rd row.
      After the fix: moodleemoticon finds the 'image' button and adds itself in the same row.

      Also after the introduction of pdw the default buttons layout was changed and not all plugins were altered. Which leaded to strangely placed icons.

      Attachments

        Issue Links

          Activity

            People

              marina Marina Glancy
              marina Marina Glancy
              Damyon Wiese Damyon Wiese
              Dan Poltawski Dan Poltawski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                18/Nov/13