Skip to content

Instantly share code, notes, and snippets.

@nozpheratu
Created January 14, 2013 23:21
Show Gist options
  • Save nozpheratu/4534493 to your computer and use it in GitHub Desktop.
Save nozpheratu/4534493 to your computer and use it in GitHub Desktop.
My Aloha Page
<script data-aloha-plugins="common/ui,common/format,common/highlighteditables,common/link,common/image,common/align,common/table,common/horizontalruler,extra/headerids,common/list,extra/metaview,common/abbr,extra/formatlesspaste,common/characterpicker,common/contenthandler,custom/videoembed" src="/assets/aloha/aloha-full.js"></script>
<div id="aloha"></div>
<script>
//<![CDATA[
Aloha.ready( function() {
Aloha.settings.contentHandler.insertHtml = [ 'word', 'generic', 'sanitize', 'videoembed' ];
Aloha.settings.contentHandler.sanitize = {
// elements allowed in the content
elements: [
'a', 'abbr', 'b', 'blockquote', 'br', 'cite', 'code', 'dd', 'del', 'dl', 'dt', 'em',
'i', 'li', 'ol', 'p', 'pre', 'q', 'small', 'strike', 'strong', 'sub',
'sup', 'u', 'ul', 'iframe' ],
// attributes allowed for specific elements
attributes: {
'a' : ['href'],
'blockquote' : ['cite'],
'q' : ['cite'],
'abbr': ['title'],
'iframe': ['src', 'frameborder','allowfullscreen']
},
// protocols allowed for certain attributes of elements
protocols: {
'a' : {'href': ['ftp', 'http', 'https', 'mailto', '__relative__']},
'blockquote' : {'cite': ['http', 'https', '__relative__']},
'q' : {'cite': ['http', 'https', '__relative__']},
'iframe': {'src': ['http', 'https']}
}
}
Aloha.jQuery('#aloha').aloha();
});
//]]>
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment