Skip to content

Commit

Permalink
Merge pull request meetfranz#83 from byymster/develop
Browse files Browse the repository at this point in the history
Add Zimbra plugin
  • Loading branch information
adlk authored Dec 5, 2016
2 parents 99b7434 + 03b897c commit bb5fb21
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
Binary file added zimbra/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions zimbra/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions zimbra/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module.exports = (Franz) => {
class Zimbra extends Franz {
validateServer(URL) {
const api = `${URL}`;
return new Promise((resolve, reject) => {
$.get(api, (resp) => {
if (/zimbra/i.test(resp)) {
resolve();
} else {
reject();
}
}).fail(reject);
});
}
}


return Zimbra;
};
23 changes: 23 additions & 0 deletions zimbra/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "zimbra",
"version": "1.0.0",
"description": "Franz Zimbra Plugin",
"main": "index.js",
"author": "Maks Buriy <[email protected]>",
"license": "MIT",
"config": {
"serviceURL": "",
"serviceName": "Zimbra",
"message": "Enter Address of zimbra server. EG. https://zimbra.companyname.com/",
"popup": [],
"hasNotificationSound": false,
"hasTeamID": true,
"customURL": true,
"hostedOnly": true,
"hasIndirectMessages": false,
"webviewOptions": {
"disablewebsecurity": ""
},
"openDevTools": false
}
}
10 changes: 10 additions & 0 deletions zimbra/webview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = (Franz, options) => {
function getMessages() {
const title = document.querySelector("title").innerHTML.match(/\d+/)
, count = title !== null ? title[0] : 0;

Franz.setBadge(count);
}

Franz.loop(getMessages);
}

0 comments on commit bb5fb21

Please sign in to comment.