Permalink
Browse files

add glowing-bear plugin

  • Loading branch information...
1 parent 0d05c82 commit 9519b863de9a768577c0af56bf9121b0eaa2714e @matejc matejc committed Sep 29, 2016
Showing with 40 additions and 0 deletions.
  1. BIN glowing-bear/icon.png
  2. +1 −0 glowing-bear/icon.svg
  3. +2 −0 glowing-bear/index.js
  4. +23 −0 glowing-bear/package.json
  5. +14 −0 glowing-bear/webview.js
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="457px" height="437px" viewBox="0 0 457 437" version="1.1"><title>glowing-bear</title><description>Created with Sketch (http://www.bohemiancoding.com/sketch)</description><defs><filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-1"><feOffset dx="0" dy="27" in="SourceAlpha" result="shadowOffsetInner1"/><feGaussianBlur stdDeviation="6.5" in="shadowOffsetInner1" result="shadowBlurInner1"/><feComposite in="shadowBlurInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0" in="shadowInnerInner1" type="matrix" result="shadowMatrixInner1"/><feMerge><feMergeNode in="SourceGraphic"/><feMergeNode in="shadowMatrixInner1"/></feMerge></filter><path d="M412.43975 168.568132C428.929405 150.665226 439 126.75867 439 100.5 439 44.9953799 394.00462 0 338.5 0 312.24133 0 288.334774 10.0705946 270.431868 26.5602497 254.17316 22.2798026 237.102819 20 219.5 20 201.897181 20 184.82684 22.2798026 168.568132 26.5602497 150.665226 10.0705946 126.75867 0 100.5 0 44.9953799 0 0 44.9953799 0 100.5 0 126.75867 10.0705946 150.665226 26.5602497 168.568132 22.2798026 184.82684 20 201.897181 20 219.5 20 329.680813 109.319187 419 219.5 419 329.680813 419 419 329.680813 419 219.5 419 201.897181 416.720197 184.82684 412.43975 168.568132ZM404.819527 145.485732C413.761327 132.571077 419 116.897318 419 100 419 55.8172178 383.182782 20 339 20 322.102682 20 306.428923 25.2386726 293.514268 34.1804726 344.163467 54.4272495 384.57275 94.8365327 404.819524 145.485738ZM145.187218 34.3000815C132.526473 25.8957877 117.334973 21 101 21 56.8172178 21 21 56.8172178 21 101 21 117.334973 25.8957877 132.526473 34.3000815 145.187218 54.5461785 94.7772378 94.7772378 54.5461785 145.187225 34.3000863Z" id="path-2"/><filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-4"><feOffset dx="0" dy="12" in="SourceAlpha" result="shadowOffsetOuter1"/><feGaussianBlur stdDeviation="0" in="shadowOffsetOuter1" result="shadowBlurOuter1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0" in="shadowBlurOuter1" type="matrix" result="shadowMatrixOuter1"/><feOffset dx="0" dy="-21" in="SourceAlpha" result="shadowOffsetInner1"/><feGaussianBlur stdDeviation="0" in="shadowOffsetInner1" result="shadowBlurInner1"/><feComposite in="shadowBlurInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"/><feColorMatrix values="0 0 0 0 0.799641927 0 0 0 0 0.744202558 0 0 0 0 0.670283399 0 0 0 0.7 0" in="shadowInnerInner1" type="matrix" result="shadowMatrixInner1"/><feMerge><feMergeNode in="shadowMatrixOuter1"/><feMergeNode in="SourceGraphic"/><feMergeNode in="shadowMatrixInner1"/></feMerge></filter><path id="path-5" d="M219 390C263.182782 390 299 354.182782 299 310 299 265.817218 263.182782 230 219 230 174.817218 230 139 265.817218 139 310 139 354.182782 174.817218 390 219 390Z"/><filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-7"><feGaussianBlur stdDeviation="11.6761364" in="SourceGraphic" result="blur"/></filter><filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-8"><feGaussianBlur stdDeviation="24.9928977" in="SourceGraphic" result="blur"/></filter><filter x="-50%" y="-50%" width="200%" height="200%" filterUnits="objectBoundingBox" id="filter-9"><feOffset dx="0" dy="-10" in="SourceAlpha" result="shadowOffsetInner1"/><feGaussianBlur stdDeviation="0" in="shadowOffsetInner1" result="shadowBlurInner1"/><feComposite in="shadowBlurInner1" in2="SourceAlpha" operator="arithmetic" k2="-1" k3="1" result="shadowInnerInner1"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.7 0" in="shadowInnerInner1" type="matrix" result="shadowMatrixInner1"/><feMerge><feMergeNode in="SourceGraphic"/><feMergeNode in="shadowMatrixInner1"/></feMerge></filter></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="smalleyes-copy" transform="translate(9.000000, 9.000000)"><path d="M99 194C151.467054 194 194 151.467054 194 99 194 46.5329462 151.467054 4 99 4 46.5329462 4 4 46.5329462 4 99 4 151.467054 46.5329462 194 99 194ZM339 194C391.467054 194 434 151.467054 434 99 434 46.5329462 391.467054 4 339 4 286.532946 4 244 46.5329462 244 99 244 151.467054 286.532946 194 339 194Z" id="Path" fill="#907B62" filter="url(#filter-1)"/><mask id="mask-3" fill="white"><use xlink:href="#path-2"/></mask><use id="Oval-2" stroke="#000000" stroke-width="9" fill="#907B62" xlink:href="#path-2"/><path d="M416.042773 172.705747C416.675912 178.230264 417 183.83265 417 189.5 417 283.11227 328.576243 359 219.5 359 110.423757 359 22 283.11227 22 189.5 22 182.430104 22.5043471 175.461304 23.4838477 168.618655 -19.0938504 135.854737-45 92.5196696-45 45 -45-57.1726838 74.7638221-140 222.5-140 370.236178-140 490-57.1726838 490 45 490 94.523079 461.863419 139.501275 416.042773 172.705747Z" id="Oval-1-copy" fill="#BEAA90" mask="url(#mask-3)"/><path d="M408.22706 154.661565C419.983764 139.763619 427 120.951175 427 100.5 427 52.175082 387.824918 13 339.5 13 319.311734 13 300.720336 19.8370019 285.91493 31.3218822 343.193403 51.5375564 388.477901 97.1645735 408.227058 154.661567ZM153.772628 31.0806364C139.018494 19.7413227 120.546508 13 100.5 13 52.175082 13 13 52.175082 13 100.5 13 120.546508 19.7413227 139.018494 31.0806364 153.772628 51.0696744 96.4650894 96.4650894 51.0696744 153.772631 31.0806386Z" id="Oval-2-copy" fill="#907B62" mask="url(#mask-3)"/><mask id="mask-6" fill="white"><use xlink:href="#path-5"/></mask><use id="Oval-63" fill="#D9CDBD" filter="url(#filter-4)" xlink:href="#path-5"/><path d="M121.353143 210.466662C155.494975 219.614939 188.386871 207.570395 194.819253 183.564419 201.251635 159.558443 178.788689 132.681614 144.646857 123.533338 110.505025 114.385061 77.613129 126.429605 71.1807471 150.435581 64.7483653 174.441557 87.2113107 201.318386 121.353143 210.466662ZM317.646857 210.466662C351.788689 201.318386 374.251635 174.441557 367.819253 150.435581 361.386871 126.429605 328.494975 114.385061 294.353143 123.533338 260.211311 132.681614 237.748365 159.558443 244.180747 183.564419 250.613129 207.570395 283.505025 219.614939 317.646857 210.466662Z" id="Oval-4-copy" fill="#F6A623" filter="url(#filter-7)"/><path d="M121.353143 210.466662C155.494975 219.614939 188.386871 207.570395 194.819253 183.564419 201.251635 159.558443 178.788689 132.681614 144.646857 123.533338 110.505025 114.385061 77.613129 126.429605 71.1807471 150.435581 64.7483653 174.441557 87.2113107 201.318386 121.353143 210.466662ZM317.646857 210.466662C351.788689 201.318386 374.251635 174.441557 367.819253 150.435581 361.386871 126.429605 328.494975 114.385061 294.353143 123.533338 260.211311 132.681614 237.748365 159.558443 244.180747 183.564419 250.613129 207.570395 283.505025 219.614939 317.646857 210.466662Z" id="Oval-4-copy-3" fill="#FFFFFF" filter="url(#filter-8)"/><path d="M121.353143 210.466662C155.494975 219.614939 188.386871 207.570395 194.819253 183.564419 201.251635 159.558443 178.788689 132.681614 144.646857 123.533338 110.505025 114.385061 77.613129 126.429605 71.1807471 150.435581 64.7483653 174.441557 87.2113107 201.318386 121.353143 210.466662ZM317.646857 210.466662C351.788689 201.318386 374.251635 174.441557 367.819253 150.435581 361.386871 126.429605 328.494975 114.385061 294.353143 123.533338 260.211311 132.681614 237.748365 159.558443 244.180747 183.564419 250.613129 207.570395 283.505025 219.614939 317.646857 210.466662Z" id="Oval-4-copy" fill="#FFFFFF"/><path d="M220.000002 328.000001C200.000002 328.000001 160 288 180 268 200 248 239.999999 248.000003 260 268 280 288 240.000002 328.000001 220.000002 328.000001Z" id="Path-1" stroke="#979797" fill="#4A4A4A" filter="url(#filter-9)"/></g></g></svg>
@@ -0,0 +1,2 @@
+// just pass through Franz
+module.exports = Franz => Franz;
@@ -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
+ }
+}
@@ -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 9519b86

Please sign in to comment.