Skip to content

Commit

Permalink
Merge pull request #85 from croby/ACAD-994
Browse files Browse the repository at this point in the history
ACAD-994 Remove any base64-encoded images that have been pasted in to TinyMCE
  • Loading branch information
lancespeelmon committed Apr 30, 2012
2 parents ec6e1ae + 0585be2 commit 68c4854
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions devwidgets/sakaidocs/javascript/sakaidocs.js
Expand Up @@ -478,6 +478,7 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
theme_advanced_statusbar_location: "none",
handle_node_change_callback: selectWidgetInEditor,

paste_preprocess: paste_preprocess,
// Example content CSS (should be your site CSS)
content_css: sakai.config.URL.TINY_MCE_CONTENT_CSS,

Expand Down Expand Up @@ -601,6 +602,13 @@ require(["jquery", "sakai/sakai.api.core"], function($, sakai) {
}
};

var paste_preprocess = function(pl, o) {
var $content = $('<div>' + o.content + '</div>');
// Remove any base64-encoded images that have been pasted
$content.find('img[src^="data:image"]').remove();
o.content = $content.html();
};

///////////////////////////////////
// Rendering a page in view mode //
///////////////////////////////////
Expand Down

0 comments on commit 68c4854

Please sign in to comment.