Skip to content

Commit

Permalink
Merge pull request #49 from matejc/glowing-bear
Browse files Browse the repository at this point in the history
add glowing-bear plugin
  • Loading branch information
adlk committed Dec 5, 2016
2 parents ed23718 + 9519b86 commit 302faf0
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
Binary file added glowing-bear/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions glowing-bear/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions glowing-bear/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// just pass through Franz
module.exports = Franz => Franz;
23 changes: 23 additions & 0 deletions glowing-bear/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "glowing-bear",
"version": "1.0.0",
"description": "A client for WeeChat",
"main": "index.js",
"author": "Matej Cotman <cotman.matej@gmail.com>",
"license": "MIT",
"config": {
"serviceURL": "https://www.glowing-bear.org/",
"serviceName": "Glowing-Bear",
"message": "",
"popup": [],
"hasNotificationSound": true,
"hasIndirectMessages": false,
"hasTeamID": false,
"customURL": false,
"hostedOnly": false,
"webviewOptions": {
"disablewebsecurity": ""
},
"openDevTools": false
}
}
14 changes: 14 additions & 0 deletions glowing-bear/webview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const path = require('path');

global.window.Notification = null;

module.exports = (Franz, options) => {
const getMessages = () => {
let badge = document.querySelectorAll('span[ng-show="notifications > 0"]')[0];
let direct = badge ? parseInt(badge.innerHTML) : 0;
Franz.setBadge(direct);
};

// check for new messages every second and update Franz badge
Franz.loop(getMessages);
};

0 comments on commit 302faf0

Please sign in to comment.