Skip to content

Commit

Permalink
show the print button in new tab/window
Browse files Browse the repository at this point in the history
fix: #1
  • Loading branch information
Barry de Graaff committed Mar 18, 2016
1 parent e33eceb commit 03603d6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
17 changes: 3 additions & 14 deletions tk_barrydegraaff_printpatch/tk_barrydegraaff_printpatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,6 @@ var PrintpatchZimlet = tk_barrydegraaff_printpatch_HandlerObject;
*/
PrintpatchZimlet.prototype.init =
function() {
AjxPackage.require({name:"MailCore", callback:new AjxCallback(this, this._applyRequestHeaders)});
};

/**
* Applies the request headers.
* Request Zimbra to expose "List-Unsubscribe" header to the Zimlet framework
*/
PrintpatchZimlet.prototype._applyRequestHeaders =
function() {
ZmMailMsg.requestHeaders["List-Unsubscribe"] = "List-Unsubscribe";
};

PrintpatchZimlet.prototype._handlePrintpatchZimletMenuClick = function(controller) {
Expand Down Expand Up @@ -92,11 +82,10 @@ PrintpatchZimlet.prototype._handlePrintpatchZimletMenuClick = function(controlle

};

PrintpatchZimlet.prototype.onMsgView = function (msg, oldMsg, msgView) {

PrintpatchZimlet.prototype.initializeToolbar =
function(app, toolbar, controller, viewId) {
try {
var app = appCtxt.getCurrentApp();
var controller = app.getMailListController();
var toolbar = controller.getCurrentToolbar();
if (toolbar)
{
Expand All @@ -118,7 +107,7 @@ PrintpatchZimlet.prototype.onMsgView = function (msg, oldMsg, msgView) {
tooltip: 'Print email',
index: 9, //position of the button
image: "zimbraicon", //icon
enabled: true //default if undefined is true, defining it for documentation purpose
enabled: false
};
var button = toolbar.createOp("PrintpatchZimletButton", buttonArgs);
button.addSelectionListener(new AjxListener(this, this._handlePrintpatchZimletMenuClick, controller));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<zimlet name="tk_barrydegraaff_printpatch" version="0.3" label="Print button" description="Print a message with inline images without displaying them as attachments" target="main view-window">
<zimlet name="tk_barrydegraaff_printpatch" version="0.4" label="Print button" description="Print a message with inline images without displaying them as attachments" target="main view-window">
<include>tk_barrydegraaff_printpatch.js</include>
<handlerObject>tk_barrydegraaff_printpatch_HandlerObject</handlerObject>
</zimlet>

0 comments on commit 03603d6

Please sign in to comment.