Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Unread badge favicon #2045

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified app/favicon.ico
Binary file not shown.
Binary file removed app/favicon_unread.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_1.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_2.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_3.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_4.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_5.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_6.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_7.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_8.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_9.ico
Binary file not shown.
Binary file added app/img/favicons/favicon_unread_9_plus.ico
Binary file not shown.
8 changes: 6 additions & 2 deletions app/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -3804,14 +3804,18 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
titleBackup = document.title

titlePromise = $interval(function () {
if (titleChanged || !notificationsCount) {
if (!notificationsCount) {
titleChanged = false
document.title = titleBackup
setFavicon()
} else {
titleChanged = true
document.title = langNotificationsPluralize(notificationsCount)
setFavicon('favicon_unread.ico')
if (notificationsCount <= 9) {
setFavicon('img/favicons/favicon_unread_' + notificationsCount + '.ico')
} else {
setFavicon('img/favicons/favicon_unread_9_plus.ico')
}
}
}, 1000)
}
Expand Down
4 changes: 2 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ gulp.task('copy-images', function () {

gulp.task('copy', gulp.parallel(
function () {
return gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.webapp.json', 'app/manifest.json', 'app/**/*worker.js'])
return gulp.src(['app/favicon.ico', 'app/img/favicons/*.ico', 'app/manifest.webapp', 'app/manifest.webapp.json', 'app/manifest.json', 'app/**/*worker.js'])
.pipe(gulp.dest('dist'))
},
function () {
Expand Down Expand Up @@ -263,7 +263,7 @@ gulp.task('package-dev', gulp.parallel(
.pipe(gulp.dest('dist_package/js'));
},
function () {
return gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json'])
return gulp.src(['app/favicon.ico', 'app/img/favicons/*.ico', 'app/manifest.webapp', 'app/manifest.json'])
.pipe(gulp.dest('dist_package'));
},
function () {
Expand Down
Loading