Actions

Difference between revisions of "Developer Area/Specifications in Development/External media block extension"

From Mahara Wiki

< Developer Area‎ | Specifications in Development
(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…")
 
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
This feature is funded by the [http://www.canberra.edu.au/ University of Canberra] and carried out by [http://catalyst.net.nz Catalyst IT].
 +
 
Mahara 1.5 will have the [https://bugs.launchpad.net/mahara/+bug/922360 SafeIFrame feature of HTML Purifier].
 
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 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).
 +
 +
= Add support for oEmbed/ogp to the external media block =
 +
 +
Features carried out by the [http://www.unige.ch/ University of Geneva]
 +
 +
When a url is added to the Media block the embed code and the block's title are extracted/constructed using the oEmbed/ogp protocols. The allows to support any site that supports one of those protocols without having to write ad-hoc code - filter.

Latest revision as of 22:58, 19 March 2012

This feature is funded by the University of Canberra and carried out by Catalyst IT.

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).

Add support for oEmbed/ogp to the external media block

Features carried out by the University of Geneva

When a url is added to the Media block the embed code and the block's title are extracted/constructed using the oEmbed/ogp protocols. The allows to support any site that supports one of those protocols without having to write ad-hoc code - filter.