Actions

Difference between revisions of "Proposals/External media block extension"

From Mahara Wiki

< Proposals
(Created page with "Mahara 1.5 will have the [https://bugs.launchpad.net/mahara/+bug/922360 SafeIFrame feature of HTML Purifier]. The existing "External media" block is to be expanded so that any i…")
 
(expanding on Kristina's description)
Line 3: Line 3:
 
The existing "External media" block is to be expanded so that any iFrame that is allowed by the site admin can be used besides the special filters we already have which allow users not only to use the embed code but also to just provide the URL.
 
The existing "External media" block is to be expanded so that any iFrame that is allowed by the site admin can be used besides the special filters we already have which allow users not only to use the embed code but also to just provide the URL.
  
* A site admin setting is created in the HTML Extensions (or the existing one is used) which allows a site admin to add URLs for iFrames from the frontend (add, edit, delete). This setting will then pull the favicon from the service to be displayed and the admin can also add / edit / delete the alt text / title to be displayed with the favicon. The favicon is also displayed on the admin page so that the site admin sees them there.
+
= New config option for HTML Purifier =
* The external media block gets refactored so that sites that have an iFrame embed code which is allowed on the site by HTML Purifier get their favicon added (like Slideshare and the others now) and users can put the embed code in.
+
 
* The current text field is changed into a text area. This makes it easier to see the entire iFrame code instead of only the first 50 or so characters.
+
A site admin setting is created in the HTML Extensions (or the existing one is used) which allows a site admin to add URLs for iFrames from the frontend (add, edit, delete).
 +
 
 +
This setting will then pull the favicon from the service to be displayed and the admin can also add / edit / delete the alt text / title to be displayed with the favicon. The favicon is also displayed on the admin page so that the site admin sees them there.
 +
 
 +
= External media block to use HTML Purifier =
 +
 
 +
Currently, the external media block has a list of embedded code that it supports along with fragile parsers for each of these.
 +
 
 +
We will remove this custom parsing code and just let HTML Purifier filter the code when we detect that the user has pasted embed code (as opposed to just a URL). This will remove code duplication and will also enable admins to add new websites easily to the list of services supported by this block.
 +
 
 +
The current text field will be changed into a text area to make it easier to see the entire iframe code instead of only the first 50 or so characters.
 +
 
 +
= Listing services supported by the external media block =
 +
 
 
* The services for which a filter exists that allows users to put in the embed code or just the page URL are identified and listed first under a heading in alphabetical order according to their alt text.
 
* The services for which a filter exists that allows users to put in the embed code or just the page URL are identified and listed first under a heading in alphabetical order according to their alt text.
 
* All other embed codes for which only the entire iFrame embed code works are listed under another heading in alphabetical order according to their alt text.
 
* All other embed codes for which only the entire iFrame embed code works are listed under another heading in alphabetical order according to their alt text.
 
* The icon of any service displayed is linked to its homepage (as is currently the case already).
 
* The icon of any service displayed is linked to its homepage (as is currently the case already).

Revision as of 12:12, 9 March 2012

Mahara 1.5 will have the SafeIFrame feature of HTML Purifier.

The existing "External media" block is to be expanded so that any iFrame that is allowed by the site admin can be used besides the special filters we already have which allow users not only to use the embed code but also to just provide the URL.

New config option for HTML Purifier

A site admin setting is created in the HTML Extensions (or the existing one is used) which allows a site admin to add URLs for iFrames from the frontend (add, edit, delete).

This setting will then pull the favicon from the service to be displayed and the admin can also add / edit / delete the alt text / title to be displayed with the favicon. The favicon is also displayed on the admin page so that the site admin sees them there.

External media block to use HTML Purifier

Currently, the external media block has a list of embedded code that it supports along with fragile parsers for each of these.

We will remove this custom parsing code and just let HTML Purifier filter the code when we detect that the user has pasted embed code (as opposed to just a URL). This will remove code duplication and will also enable admins to add new websites easily to the list of services supported by this block.

The current text field will be changed into a text area to make it easier to see the entire iframe code instead of only the first 50 or so characters.

Listing services supported by the external media block

  • The services for which a filter exists that allows users to put in the embed code or just the page URL are identified and listed first under a heading in alphabetical order according to their alt text.
  • All other embed codes for which only the entire iFrame embed code works are listed under another heading in alphabetical order according to their alt text.
  • The icon of any service displayed is linked to its homepage (as is currently the case already).