plugins/kolab_notes

Thomas Brüderli bruederli at kolabsys.com
Thu Jun 26 10:26:22 CEST 2014


 plugins/kolab_notes/notes.js                         |   12 +++++++++++-
 plugins/kolab_notes/skins/larry/print.css            |    5 +----
 plugins/kolab_notes/skins/larry/templates/print.html |    1 -
 3 files changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 25a6882a156e34e63bd90c991429bf82c4bd4973
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Thu Jun 26 10:26:14 2014 +0200

    Fix notes printing

diff --git a/plugins/kolab_notes/notes.js b/plugins/kolab_notes/notes.js
index 5d903d1..6f65623 100644
--- a/plugins/kolab_notes/notes.js
+++ b/plugins/kolab_notes/notes.js
@@ -905,9 +905,19 @@ function rcube_kolab_notes_ui(settings)
      */
     function print_note()
     {
-        var printwin, data;
+        var printwin, data, list;
         if (me.selected_note && (printwin = rcmail.open_window(settings.print_template))) {
+            list = me.notebooks[me.selected_note.list] || me.notebooks[me.selected_list] || {};
             data = get_save_data();
+
+            // for read-only notes, get_save_data() won't return the content
+            if (me.selected_note.readonly || !list.editable) {
+                data.description = me.selected_note.html || me.selected_note.description;
+                if (!me.selected_note.html || !data.description.match(/<(html|body)/)) {
+                    data.description = text2html(data.description);
+                }
+            }
+
             $(printwin).load(function(){
                 printwin.document.title = data.title;
                 $('#notetitle', printwin.document).html(Q(data.title));
diff --git a/plugins/kolab_notes/skins/larry/print.css b/plugins/kolab_notes/skins/larry/print.css
index 2744aaa..976f2f6 100644
--- a/plugins/kolab_notes/skins/larry/print.css
+++ b/plugins/kolab_notes/skins/larry/print.css
@@ -1,14 +1,11 @@
 body {
 	font-family: Arial, Helvetica, sans-serif;
 	font-size: 10pt;
-}
-
-body {
 	background-color: #FFF;
 	margin: 1em;
 }
 
-#notebody {
+#notebody * {
 	font-family: "Lucida Grande", Verdana,  Arial, Helvetica, sans-serif;
 }
 
diff --git a/plugins/kolab_notes/skins/larry/templates/print.html b/plugins/kolab_notes/skins/larry/templates/print.html
index 0387e93..42d9101 100644
--- a/plugins/kolab_notes/skins/larry/templates/print.html
+++ b/plugins/kolab_notes/skins/larry/templates/print.html
@@ -2,7 +2,6 @@
 <html>
 <head>
 <title>Print</title>
-<link rel="stylesheet" type="text/css" href="/this/editor.css" />
 <link rel="stylesheet" type="text/css" href="/this/print.css" />
 </head>
 <body class="notesprint">




More information about the commits mailing list