Hi,
I managed to spend some time on my preview pane, to make it work in the current SVN revision 361.
Two options were added to config/main.inc.php:
// Enable preview pane $rcmail_config['enable_preview'] = FALSE;
// display preview pane if enabled $rcmail_config['preview'] = FALSE;
Some issues that I have:
them correctly.
Robin
--- config/main.inc.php.dist (revision 361) +++ config/main.inc.php.dist (working copy) @@ -171,6 +171,9 @@ // Leave empty for default set of Google spell check languages $rcmail_config['spellcheck_languages'] = NULL;
+// Enable preview pane +$rcmail_config['enable_preview'] = FALSE;
// path to a text file which will be added to each sent message // paths are relative to the RoundCube root folder $rcmail_config['generic_message_footer'] = ''; @@ -216,6 +219,9 @@ // prefer displaying HTML messages $rcmail_config['prefer_html'] = TRUE;
+// display preview pane if enabled +$rcmail_config['preview'] = FALSE;
// show pretty dates as standard $rcmail_config['prettydate'] = TRUE;
--- program/include/main.inc (revision 361) +++ program/include/main.inc (working copy) @@ -1200,6 +1200,7 @@ 'editorselector' => 'rcmail_editor_selector', 'searchform' => 'rcmail_search_form', 'receiptcheckbox' => 'rcmail_receipt_checkbox',
'preview' => 'rcmail_message_preview',
// ADDRESS BOOK
'addresslist' => 'rcmail_contacts_list',
--- program/localization/nl_NL/labels.inc (revision 361) +++ program/localization/nl_NL/labels.inc (working copy) @@ -202,6 +202,7 @@ $labels['pagesize'] = 'Rijen per pagina'; $labels['signature'] = 'Onderschrift'; $labels['dstactive'] = 'Zomertijd'; +$labels['preview'] = 'Voorbeeldvenster';
$labels['folder'] = 'Map'; $labels['folders'] = 'Mappen'; Index: program/localization/en_US/labels.inc =================================================================== --- program/localization/en_US/labels.inc (revision 361) +++ program/localization/en_US/labels.inc (working copy) @@ -207,6 +207,7 @@ $labels['dstactive'] = 'Daylight savings'; $labels['htmleditor'] = 'Compose HTML messages'; $labels['htmlsignature'] = 'HTML signature'; +$labels['preview'] = 'Preview message';
$labels['autosavedraft'] = 'Automatically save draft'; $labels['everynminutes'] = 'every $n minutes'; Index: program/js/app.js =================================================================== --- program/js/app.js (revision 361) +++ program/js/app.js (working copy) @@ -135,7 +135,7 @@ }
// enable mail commands
this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', true);
this.enable_command('list', 'checkmail', 'compose', 'add-contact', 'search', 'reset-search', 'load-attachment', true);
if (this.env.action=='show')
{
@@ -552,6 +552,7 @@ var input_pagesize = rcube_find_object('_pagesize'); var input_name = rcube_find_object('_name'); var input_email = rcube_find_object('_email');
var input_preview = rcube_find_object('_preview');
// user prefs
if (input_pagesize && isNaN(input_pagesize.value))
@@ -1039,6 +1040,8 @@ this.enable_command('show', 'reply', 'reply-all', 'forward', 'print', selected); this.enable_command('delete', 'moveto', list.selection.length>0 ? true : false); }
this.show_preview(list.selection[0]);
};@@ -1067,6 +1070,30 @@ /*********************************************************/
{
rcmail.set_busy(true, 'loading');
if (previewpane.style.display=='none')
{
contentframe.style.height = (contentframe.offsetHeight/2) + 'px';
previewpane.style.top = (contentframe.offsetTop+contentframe.offsetHeight) + 'px';
previewpane.style.display = 'block';
var message = rcube_find_object('rcmrow' + id);
message.scrollIntoView();
}
var url = '_action=preview&_uid='+id;
rcmail.http_request('preview', url, true);
}
@@ -3115,6 +3142,12 @@ case 'expunge': this.enable_command('select-all', 'select-none', 'expunge', this.env.messagecount ? true : false); break;
case 'preview':
var previewpane = rcube_find_object('previewpane');
previewpane.innerHTML = request_obj.get_text();
previewpane.scrollTop = 0;
break;
}
request_obj.reset();
--- program/steps/settings/func.inc (revision 361) +++ program/steps/settings/func.inc (working copy) @@ -155,6 +155,17 @@ rep_specialchars_output(rcube_label('htmleditor')), $input_htmleditor->show($CONFIG['htmleditor']?1:0));
$field_id,
rep_specialchars_output(rcube_label('preview')),
$input_preview->show($CONFIG['preview']?1:0));
@@ -242,4 +253,4 @@ }
-?> \ No newline at end of file +?> Index: program/steps/settings/save_prefs.inc =================================================================== --- program/steps/settings/save_prefs.inc (revision 361) +++ program/steps/settings/save_prefs.inc (working copy) @@ -29,8 +29,11 @@ $a_user_prefs['pagesize'] = is_numeric($_POST['_pagesize']) ? (int)$_POST['_pagesize'] : $CONFIG['pagesize']; $a_user_prefs['prefer_html'] = isset($_POST['_prefer_html']) ? TRUE : FALSE; $a_user_prefs['htmleditor'] = isset($_POST['_htmleditor']) ? TRUE : FALSE; +if ($CONFIG['enable_preview'])
$a_user_prefs['draft_autosave'] = isset($_POST['_draft_autosave']) ? intval($_POST['_draft_autosave']) : 0;
// MM: Date format toggle (Pretty / Standard) $a_user_prefs['prettydate'] = isset($_POST['_pretty_date']) ? TRUE : FALSE;
--- program/steps/mail/show.inc (revision 361) +++ program/steps/mail/show.inc (working copy) @@ -171,6 +171,8 @@
if ($_action=='print') parse_template('printmessage'); +else if ($_action=='preview')
else parse_template('message'); -?> \ No newline at end of file +?> Index: program/steps/mail/func.inc =================================================================== --- program/steps/mail/func.inc (revision 361) +++ program/steps/mail/func.inc (working copy) @@ -480,6 +480,8 @@ $javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($message_count/$IMAP->page_size)); $javascript .= sprintf("%s.set_env('sort_col', '%s');\n", $JS_OBJECT_NAME, $sort_col); $javascript .= sprintf("%s.set_env('sort_order', '%s');\n", $JS_OBJECT_NAME, $sort_order);
if ($CONFIG['enable_preview'])
$javascript .= sprintf("%s.set_env('preview', '%s');\n", $JS_OBJECT_NAME, $CONFIG['preview']);
if ($attrib['messageicon']) $javascript .= sprintf("%s.set_env('messageicon', '%s%s');\n", $JS_OBJECT_NAME, $skin_path, $attrib['messageicon']);
--- skins/default/templates/mail.html (revision 361) +++ skins/default/templates/mail.html (working copy) @@ -52,6 +52,8 @@ attachmentIcon="/images/icons/attachment.png" />
</div>
+<div id="previewpane" style="display: none;"></div>
<div id="listcontrols"> <roundcube:label name="select" />: <roundcube:button command="select-all" label="all" classAct="active" /> Index: skins/default/mail.css =================================================================== --- skins/default/mail.css (revision 361) +++ skins/default/mail.css (working copy) @@ -120,7 +120,30 @@ height: expression((parseInt(document.documentElement.clientHeight)-125)+'px'); }
+#previewpane +{
+}
+body > div#previewpane +{
+}
#messagepartframe { border: 1px solid #999999; Index: index.php =================================================================== --- index.php (revision 361) +++ index.php (working copy) @@ -262,7 +262,7 @@ { include_once('program/steps/mail/func.inc');
if ($_action=='show' || $_action=='print' || $_action=='preview') include('program/steps/mail/show.inc');
if ($_action=='get')
I've laid this down on top of a fresh svn and haven't been able to get it to work. I've set both config options to TRUE and havent been able to get it to appear. After some poking around I forced the preview pane to open by changing app.js:
if (selected && this.env.enable_preview && this.env.preview) to if (selected && this.env.preview)
I got a seperate pane this way but it had the RC start page with "SERVICE CURRENTLY NOT AVAILABLE!".
On the off chance this was a browser problem I tried it on Firefox 1.5, Firefox 2.0rc3, and IE 6 in Linux and Windows. No luck.
Anyone else having this problem? Or have I done something stupid?
-Ryan
Robin Elfrink wrote:
Hi,
I managed to spend some time on my preview pane, to make it work in the current SVN revision 361.
Two options were added to config/main.inc.php:
// Enable preview pane $rcmail_config['enable_preview'] = FALSE;
// display preview pane if enabled $rcmail_config['preview'] = FALSE;
Some issues that I have:
- Attachment filenames are gone, even though the preview pane displays
them correctly.
- There should be a 'view source' button if a message is previewed.
Robin