Skip to content

Commit

Permalink
added ability to insert attached images in HTML editor
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Dec 11, 2007
1 parent deb3026 commit 4315b00
Show file tree
Hide file tree
Showing 29 changed files with 12,288 additions and 12,251 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CHANGELOG RoundCube Webmail
2007/12/10 (estadtherr)
----------
- Upgrade to TinyMCE 2.1.3
- Allow inserting image attachments into HTML messages while composing

2007/12/10 (thomasb)
----------
Expand Down
2 changes: 1 addition & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
if ($_action=='upload')
include('program/steps/mail/upload.inc');

if ($_action=='compose' || $_action=='remove-attachment')
if ($_action=='compose' || $_action=='remove-attachment' || $_action=='display-attachment')
include('program/steps/mail/compose.inc');

if ($_action=='addcontact')
Expand Down
3 changes: 1 addition & 2 deletions program/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ function rcube_webmail()

if (!this.check_compose_input())
break;

// Reset the auto-save timer
self.clearTimeout(this.save_timer);

Expand Down Expand Up @@ -1884,7 +1884,6 @@ function rcube_webmail()
// upload attachment file
this.upload_file = function(form)
{

if (!form)
return false;

Expand Down
4 changes: 2 additions & 2 deletions program/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ function rcmail_editor_init(skin_path)
theme_advanced_toolbar_align : 'left',
extended_valid_elements : 'font[face|size|color|style],span[id|class|align|style]',
content_css : skin_path + '/editor_content.css',
popups_css : skin_path + '/editor_popup.css',
editor_css : skin_path + '/editor_ui.css'
editor_css : skin_path + '/editor_ui.css',
external_image_list_url : 'program/js/editor_images.js'
});
}

Expand Down
20 changes: 20 additions & 0 deletions program/js/editor_images.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

var rc_client = tinyMCEPopup.windowOpener.rcube_webmail_client;
if (rc_client.gui_objects.attachmentlist)
{
var tinyMCEImageList = new Array();
var attachElems = rc_client.gui_objects.attachmentlist.getElementsByTagName("li");
for (i = 0; i < attachElems.length; i++)
{
var liElem = attachElems[i];
var fname = attachElems[i].id;
for (j = 0; j < liElem.childNodes.length; j++)
{
if (liElem.childNodes[j].nodeName == "#text")
{
fname = liElem.childNodes[j].nodeValue;
}
}
tinyMCEImageList.push([fname, rc_client.env.comm_path+'&_action=display-attachment&_file='+attachElems[i].id]);
}
};
1,008 changes: 504 additions & 504 deletions program/js/tiny_mce/license.txt

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions program/js/tiny_mce/plugins/media/css/content.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {
border: 1px dotted #cc0000;
background-position: center;
background-repeat: no-repeat;
background-color: #ffffcc;
}

.mceItemShockWave {
background-image: url('../images/shockwave.gif');
}

.mceItemFlash {
background-image: url('../images/flash.gif');
}

.mceItemQuickTime {
background-image: url('../images/quicktime.gif');
}

.mceItemWindowsMedia {
background-image: url('../images/windowsmedia.gif');
}

.mceItemRealMedia {
background-image: url('../images/realmedia.gif');
}
.mceItemFlash, .mceItemShockWave, .mceItemQuickTime, .mceItemWindowsMedia, .mceItemRealMedia {
border: 1px dotted #cc0000;
background-position: center;
background-repeat: no-repeat;
background-color: #ffffcc;
}

.mceItemShockWave {
background-image: url('../images/shockwave.gif');
}

.mceItemFlash {
background-image: url('../images/flash.gif');
}

.mceItemQuickTime {
background-image: url('../images/quicktime.gif');
}

.mceItemWindowsMedia {
background-image: url('../images/windowsmedia.gif');
}

.mceItemRealMedia {
background-image: url('../images/realmedia.gif');
}
136 changes: 68 additions & 68 deletions program/js/tiny_mce/plugins/media/css/media.css
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
#id, #name, #hspace, #vspace, #class_name, #align {
width: 100px;
}

#hspace, #vspace {
width: 50px;
}

#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
width: 100px;
}

#flash_base, #flash_flashvars {
width: 240px;
}

#width, #height {
width: 40px;
}

#src, #media_type {
width: 250px;
}

#class {
width: 120px;
}

#prev {
margin: 0;
border: 1px solid black;
width: 99%;
height: 230px;
overflow: auto;
}

.panel_wrapper div.current {
height: 390px;
overflow: auto;
}

#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
display: none;
}

.mceAddSelectValue {
background-color: #DDDDDD;
}

#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
width: 70px;
}

#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
width: 70px;
}

#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
width: 70px;
}

#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
width: 90px;
}

#qt_qtsrc {
width: 200px;
}
#id, #name, #hspace, #vspace, #class_name, #align {
width: 100px;
}

#hspace, #vspace {
width: 50px;
}

#flash_quality, #flash_align, #flash_scale, #flash_salign, #flash_wmode {
width: 100px;
}

#flash_base, #flash_flashvars {
width: 240px;
}

#width, #height {
width: 40px;
}

#src, #media_type {
width: 250px;
}

#class {
width: 120px;
}

#prev {
margin: 0;
border: 1px solid black;
width: 99%;
height: 230px;
overflow: auto;
}

.panel_wrapper div.current {
height: 390px;
overflow: auto;
}

#flash_options, #shockwave_options, #qt_options, #wmp_options, #rmp_options {
display: none;
}

.mceAddSelectValue {
background-color: #DDDDDD;
}

#qt_starttime, #qt_endtime, #qt_fov, #qt_href, #qt_moveid, #qt_moviename, #qt_node, #qt_pan, #qt_qtsrc, #qt_qtsrcchokespeed, #qt_target, #qt_tilt, #qt_urlsubstituten, #qt_volume {
width: 70px;
}

#wmp_balance, #wmp_baseurl, #wmp_captioningid, #wmp_currentmarker, #wmp_currentposition, #wmp_defaultframe, #wmp_playcount, #wmp_rate, #wmp_uimode, #wmp_volume {
width: 70px;
}

#rmp_console, #rmp_numloop, #rmp_controls, #rmp_scriptcallbacks {
width: 70px;
}

#shockwave_swvolume, #shockwave_swframe, #shockwave_swurl, #shockwave_swstretchvalign, #shockwave_swstretchhalign, #shockwave_swstretchstyle {
width: 90px;
}

#qt_qtsrc {
width: 200px;
}
Loading

0 comments on commit 4315b00

Please sign in to comment.