** Changed in: mahara
   Importance: Medium => Wishlist

** Changed in: mahara
     Assignee: Aaron Wells (u-aaronw) => (unassigned)

** Changed in: mahara
    Milestone: 17.04.0 => None

** Tags added: third-party

You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask 
on #mahara-dev or mahara.org forum before editing or unsubscribing it!

  Make TinyMCE Embedded Image support more automatic

Status in Mahara:

Bug description:
  We've added that great plugin to TinyMCE that lets you select and
  embed your Mahara images easily, and we've added some library code to
  make sure that people can view your images if they're embedded
  (instead of the old system of relying on the image being shared
  specifically in an image block).

  However, the current implementation relies on the developer
  specifically calling a series of functions in the form submission
  function, and there's no warning or penalty if they fail to do that,
  so it is often overlooked when creating new places that use a wysiwyg
  text editor.

  I'd like to see the support for this become more automatic, ideally by
  making the pieform "wysiwyg" form element handle all of the linking
  logic for the embedded images.

  My proposal is this:

  1. Check to see if there is a post-submit hook in Pieforms for pieform
  elements. If there isn't, add one.

  2. Write a post-submit hook handler for the wysiwyg element, that
  takes care of calling the necessary embedded image libraries

  3. Add settings for the wysiwyg element to get the extra data we
  needed for this (i.e., the "resource type" for

  4. Add another setting to the wysiwyg element (off by default) to say
  "don't use the Mahara image picker in this one". For wysiwygs where we
  don't want to support embedded Mahara images (if there are any)

  5. The tricky part here is that the embedded image thing will need to
  know the id of the "Resource" that you're embedding the image in. And
  if you're creating a new resource, you won't know that until after the
  form's submit method has finished. So, we'll have to expect the
  developer to provide the new resource's ID back to the $form object,
  and to help enforce that, we can make the wysiwyg post-submit hook
  throw an error if the wysiwyg element has embedded images turned on
  but it did not receive a resource ID.

To manage notifications about this bug go to:

Mailing list: https://launchpad.net/~mahara-contributors
Post to     : mahara-contributors@lists.launchpad.net
Unsubscribe : https://launchpad.net/~mahara-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to