Stats

  • Category: webapp
  • License: GNU Affero General Public License (AGPL) version 3
  • Updated: 2011-6-21
  • Downloads: 467

Releases

Author Recommended: 0.9

Previous releases:

1

Recommendations

Summary:

View office documents in Zarafa WebApp

Full description:

WebODF can show OpenDocument Format office documents in a browser. This plugin adds this functionality to Zarafa.

These files should be put in the root of the WebApp:

http://webodf.org/demo/webodf.js
http://webodf.org/demo/webodf.css

This requires a patch to Zarafa WebApp.

diff --git a/client/zarafa/common/ui/messagepanel/AttachmentLinks.js b/client/zarafa/common/ui/messagepanel/AttachmentLinks.js
index 9b745bc..e6861b8 100644
--- a/client/zarafa/common/ui/messagepanel/AttachmentLinks.js
+++ b/client/zarafa/common/ui/messagepanel/AttachmentLinks.js
@@ -163,15 +163,20 @@ Zarafa.common.ui.messagepanel.AttachmentLinks = Ext.extend(Ext.Container, {
"&attachNum[]=" + attach_num);
}*/
} else {
-
- var action = attachment.getAttachmentUrl(this.record);
- var iframe = document.getElementById('zarafa-attachment-iframedownload');
+ var action = attachment.getAttachmentUrl(this.record),
+ name = attachment.get('name'),
+ extension = name.substring(name.lastIndexOf('.') + 1);
+ if (extension === "odt" || extension === "ods" || extension === "odp") {
+ Zarafa.plugins.OdfDialog.create({url:action, name:name});
+ } else {
+ var iframe = document.getElementById('zarafa-attachment-iframedownload');

// Set the hidden iframe to make the browser save/open file
- iframe.contentWindow.location = action;
+ iframe.contentWindow.location = action;
+ }
}
}
}
});

 

The code for WebODF is placed in the root folder of Zarafa, perhaps there is a better place for it. WebODF is loaded dynamically: unless it is used, it does not take any browser memory.Missing functionality:- Scrolling is not working yet, should not be hard to fix.- The document is editable, this should be turned off.- Page border is not shown at the moment: the page size is not quite right.