Here it is. You just have to apply it on a fresh checkout of the cvs tree. 
Included is a little fix too in the imap library.
Give some feedback.

Olivier

Le Vendredi 14 Octobre 2005 23:20, Brian Steere a écrit :
> I am definitely willing to test it.
>
> As a side note, can the reply-to header of the list be changed to the
> list address?
>
> Slaanesh wrote:
> > I have already done a preview panel but it is not yet in the repository.
> > If some are willing to test it, I will send the patch on list.
> >
> > Olivier
> >
> > Le Vendredi 14 Octobre 2005 21:11, Praneet Kandula a écrit :
> >> grr.. keep forgetting to "Reply All". We really need to set the
> >> "Reply-To" header to the dev lists automatically. My reply is below:
> >>
> >>
> >> I believe it's doable right now by making a new skin, but i'm not sure
> >> how exactly. Perhaps one of the developers can weigh in on this?
> >> Thomas?
> >>
> >> --
> >> Praneet Kandula
> >>
> >> On 10/14/05, Brian Steere <[EMAIL PROTECTED]> wrote:
> >>> Anybody working on and/or interested in a preview pane like outlook and
> >>> thunderbird? I don't have the skills to code it at the moment (although
> >>> I may be learning more to help with this project) but it is definitely
> >>> something I would like to see.
> >>>
> >>> ~Dianoga
Index: index.php
===================================================================
RCS file: /cvsroot/roundcubemail/roundcubemail/index.php,v
retrieving revision 1.10
diff -u -u -r1.10 index.php
--- index.php	14 Oct 2005 07:58:24 -0000	1.10
+++ index.php	14 Oct 2005 22:45:53 -0000
@@ -226,6 +226,9 @@
   if ($_action=='list' && $_GET['_remote'])
     include('program/steps/mail/list.inc');
 
+  if ($_action=='preview')
+    include('program/steps/mail/preview.inc');
+
   // kill compose entry from session
   if (isset($_SESSION['compose']))
     rcmail_compose_cleanup();
Index: program/js/app.js
===================================================================
RCS file: /cvsroot/roundcubemail/roundcubemail/program/js/app.js,v
retrieving revision 1.6
diff -u -u -r1.6 app.js
--- program/js/app.js	13 Oct 2005 22:21:10 -0000	1.6
+++ program/js/app.js	14 Oct 2005 22:45:53 -0000
@@ -826,6 +826,9 @@
     
     this.drag_start = false;
     this.in_selection_before = false;
+
+    if (this.task == 'mail' && this.list_rows)
+      this.show_preview_message(id);
         
     // row was double clicked
     if (this.task=='mail' && this.list_rows && this.list_rows[id].clicked && !shift)
@@ -949,6 +952,48 @@
       this.select(n, true);
     };
     
+    /**
+     * Preview message (single click on a row)
+     */
+    this.show_preview_message = function(id) {
+        this.set_busy(true, 'loading');
+        this.http_request('preview', '_uid=' + escape(id));
+    }
+
+    /**
+     * Append an html content after the message list
+     */
+    this.append_content = function(content) {
+        var parent;
+        var node;
+        var height;
+
+        if (this.env.task != 'mail') {
+            return ;
+        }
+
+        parent = this.gui_objects.messagelist.parentNode;
+        if (!parent) {
+            return ;
+        }
+
+        node = document.getElementById('preview_node');
+        if (node) {
+            parent.parentNode.removeChild(node);
+            height = parent.offsetHeight * 2;
+        } else {
+            height = parent.offsetHeight;
+            parent.style.height = (height / 2) + 'px';
+            parent.style.overflow = 'auto';
+        }
+
+        node = document.createElement('div');
+        node.id = 'preview_node';
+        node.innerHTML = content;
+        node.style.height = ((height / 2) - 10) + 'px';
+        node.style.width = (document.body.clientWidth - parent.offsetLeft - 25) + 'px';
+        parent.parentNode.appendChild(node);
+    }
 
   // when user doble-clicks on a row
   this.show_message = function(id, safe)
@@ -2263,6 +2308,10 @@
         case 'list':
           this.enable_command('select-all', 'select-none', this.env.messagecount ? true : false);
           break;
+
+        case 'preview':
+          this.append_content(this.request_obj.responseText);
+          break;
         }
       }
     };
Index: program/lib/imap.inc
===================================================================
RCS file: /cvsroot/roundcubemail/roundcubemail/program/lib/imap.inc,v
retrieving revision 1.4
diff -u -u -r1.4 imap.inc
--- program/lib/imap.inc	11 Oct 2005 21:11:42 -0000	1.4
+++ program/lib/imap.inc	14 Oct 2005 22:45:53 -0000
@@ -325,7 +325,7 @@
 	}
 	
 	//open socket connection
-	$conn->fp = @fsockopen($host, $ICL_PORT, &$errno, &$errstr, 10);
+	$conn->fp = @fsockopen($host, $ICL_PORT, $errno, $errstr, 10);
 	if (!$conn->fp){
         $iil_error = "Could not connect to $host at port $ICL_PORT: $errstr";
         $iil_errornum = -1;
Index: skins/default/mail.css
===================================================================
RCS file: /cvsroot/roundcubemail/roundcubemail/skins/default/mail.css,v
retrieving revision 1.3
diff -u -u -r1.3 mail.css
--- skins/default/mail.css	4 Oct 2005 20:28:01 -0000	1.3
+++ skins/default/mail.css	14 Oct 2005 22:45:53 -0000
@@ -402,6 +402,18 @@
   width: expression(document.body.clientWidth-240);
 }
 
+#preview_node
+{
+  border-width: 1px;
+  border-color: gray;
+  border-style: solid;
+  overflow: auto;
+  position: absolute;
+  right: 40px;
+  bottom: 80px;
+}
+
+
 table.headers-table
 {
   width: 100%;

Reply via email to