Skip to content

Commit

Permalink
Drag/drop and pasted images should not be uploaded in html signature …
Browse files Browse the repository at this point in the history
…preview
  • Loading branch information
slusarz committed Apr 14, 2014
1 parent ecfad06 commit 6b68ca0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
7 changes: 6 additions & 1 deletion imp/js/compose-dimp.js
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,8 @@ var DimpCompose = {

rteInit: function(rte)
{
var config;

if (rte && !ImpComposeBase.rte) {
if (Object.isUndefined(ImpComposeBase.rte_loaded)) {
CKEDITOR.on('instanceReady', function(evt) {
Expand All @@ -560,7 +562,10 @@ var DimpCompose = {
}.bind(this));
}

ImpComposeBase.rte = CKEDITOR.replace('composeMessage', Object.clone(IMP.ckeditor_config));
config = Object.clone(IMP.ckeditor_config);
config.extraPlugins = 'pasteattachment';
ImpComposeBase.rte = CKEDITOR.replace('composeMessage', config);

ImpComposeBase.rte.on('getData', function(evt) {
var elt = new Element('SPAN').insert(evt.data.dataValue),
elts = elt.select('IMG[dropatc_id]');
Expand Down
6 changes: 5 additions & 1 deletion imp/js/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ var ImpCompose = {

onDomLoad: function()
{
var handler;
var config, handler;

HordeCore.initHandler('click');

Expand Down Expand Up @@ -350,6 +350,10 @@ var ImpCompose = {
}

if (ImpComposeBase.editor_on) {
config = Object.clone(IMP.ckeditor_config);
config.extraPlugins = 'pasteignore';
CKEDITOR.replace('composeMessage', config)

document.observe('SpellChecker:after', this._onAfterSpellCheck.bind(this));
document.observe('SpellChecker:before', this._onBeforeSpellCheck.bind(this));
}
Expand Down
2 changes: 1 addition & 1 deletion imp/lib/Basic/Compose.php
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ protected function _init()
}

if ($rtemode && !$redirect) {
$injector->getInstance('IMP_Editor')->init('composeMessage');
$injector->getInstance('IMP_Editor')->init();
}
}

Expand Down
1 change: 0 additions & 1 deletion imp/lib/Script/Package/ComposeBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ public function __construct()
$page_output->addInlineScript(array(
'if (window.CKEDITOR) { CKEDITOR.on("loaded", function(e) {' .
'CKEDITOR.plugins.addExternal("' . $plugin . '", "' . $js->url->url . '", "");' .
'CKEDITOR.config.extraPlugins = CKEDITOR.config.extraPlugins.split(",").concat("' . $plugin . '").join(",");' .
'CKEDITOR.config.filebrowserImageUploadUrl = "' . $upload_url . '";' .
'}); };'
), true);
Expand Down

0 comments on commit 6b68ca0

Please sign in to comment.