Fixes #1250 Change favicon color when unread messages
This commit is contained in:
parent
285bbbc2f1
commit
9f548ae8de
|
@ -41,6 +41,7 @@ Soon we'll deprecate the latter, so prepare now.
|
||||||
- #2307: BootstrapModal is not accessible to plugins
|
- #2307: BootstrapModal is not accessible to plugins
|
||||||
- #2308: Allow getHats method to be overriden in the `overrides` object in plugins.
|
- #2308: Allow getHats method to be overriden in the `overrides` object in plugins.
|
||||||
- #2321: When Converse runs inside a browser extension, enable browser sync and local storage for persistent storage
|
- #2321: When Converse runs inside a browser extension, enable browser sync and local storage for persistent storage
|
||||||
|
- #1250: Change favicon color when unread messages
|
||||||
- The `trusted` configuration setting has been removed in favor of two new settings:
|
- The `trusted` configuration setting has been removed in favor of two new settings:
|
||||||
[allow_user_trust_override](https://conversejs.org/docs/html/configuration.html#allow-user-trust-override)
|
[allow_user_trust_override](https://conversejs.org/docs/html/configuration.html#allow-user-trust-override)
|
||||||
[clear_cache_on_logout](https://conversejs.org/docs/html/configuration.html#clear-cache-on-logout)
|
[clear_cache_on_logout](https://conversejs.org/docs/html/configuration.html#clear-cache-on-logout)
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
"eslint-plugin-lodash": "^7.1.0",
|
"eslint-plugin-lodash": "^7.1.0",
|
||||||
"exports-loader": "^0.7.0",
|
"exports-loader": "^0.7.0",
|
||||||
"fast-text-encoding": "^1.0.2",
|
"fast-text-encoding": "^1.0.2",
|
||||||
|
"favico.js-slevomat": "^0.3.11",
|
||||||
"file-loader": "^6.0.0",
|
"file-loader": "^6.0.0",
|
||||||
"haunted": "^4.7.0",
|
"haunted": "^4.7.0",
|
||||||
"html-webpack-plugin": "^4.3.0",
|
"html-webpack-plugin": "^4.3.0",
|
||||||
|
|
|
@ -7,6 +7,7 @@ import "./converse-emoji";
|
||||||
import { Collection } from "@converse/skeletor/src/collection";
|
import { Collection } from "@converse/skeletor/src/collection";
|
||||||
import { _converse, api, converse } from "./converse-core";
|
import { _converse, api, converse } from "./converse-core";
|
||||||
import log from "./log";
|
import log from "./log";
|
||||||
|
import Favico from 'favico.js-slevomat';
|
||||||
|
|
||||||
const { Strophe } = converse.env;
|
const { Strophe } = converse.env;
|
||||||
|
|
||||||
|
@ -32,9 +33,11 @@ converse.plugins.add('converse-chatboxes', {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let msg_counter = 0;
|
let msg_counter = 0;
|
||||||
|
const favicon = new Favico({type : 'circle', position: 'up', animation: 'none'});
|
||||||
|
|
||||||
_converse.incrementMsgCounter = function () {
|
_converse.incrementMsgCounter = function () {
|
||||||
msg_counter += 1;
|
msg_counter += 1;
|
||||||
|
favicon.badge(msg_counter);
|
||||||
const title = document.title;
|
const title = document.title;
|
||||||
if (!title) {
|
if (!title) {
|
||||||
return;
|
return;
|
||||||
|
@ -48,6 +51,7 @@ converse.plugins.add('converse-chatboxes', {
|
||||||
|
|
||||||
_converse.clearMsgCounter = function () {
|
_converse.clearMsgCounter = function () {
|
||||||
msg_counter = 0;
|
msg_counter = 0;
|
||||||
|
favicon.badge(msg_counter);
|
||||||
const title = document.title;
|
const title = document.title;
|
||||||
if (!title) {
|
if (!title) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user