-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maks Buriy
committed
Nov 13, 2016
1 parent
0d05c82
commit 03b897c
Showing
5 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |