remove favico

doesn't make much sense in an app...
Lorenz Hübschle-Schneider 11 years ago
parent 10d2f81c75
commit 81c2f42f00
  1. 7
      3rdparty/favico-0.3.5.min.js
  2. 11
      index.html
  3. 23
      js/glowingbear.js
  4. 21
      js/notifications.js

File diff suppressed because one or more lines are too long

@ -34,7 +34,6 @@
<script type="text/javascript" src="js/websockets.js"></script>
<script type="text/javascript" src="js/models.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="3rdparty/favico-0.3.5.min.js"></script>
</head>
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
<div ng-hide="connected" class="container">
@ -374,16 +373,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="useFavico">
Display unread count in favicon
</label>
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">

@ -76,7 +76,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
buffer.unread = 0;
buffer.notification = 0;
// Trigger title and favico update
// Trigger title update
$rootScope.$emit('notificationChanged');
}
@ -162,14 +162,8 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
});
$rootScope.favico = new Favico({animation: 'none'});
$rootScope.$on('notificationChanged', function() {
notifications.updateTitle();
if ($scope.useFavico && $rootScope.favico) {
notifications.updateFavico();
}
});
$rootScope.$on('relayDisconnect', function() {
@ -229,8 +223,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$store.bind($scope, "noembed", noembed);
// Save setting for channel ordering
$store.bind($scope, "orderbyserver", true);
// Save setting for updating favicon
$store.bind($scope, "useFavico", true);
// Save setting for showtimestamp
$store.bind($scope, "showtimestamp", showtimestamp);
// Save setting for showing seconds on timestamps
@ -320,18 +312,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.predicate = $scope.orderbyserver ? 'serverSortKey' : 'number';
});
$scope.$watch('useFavico', function() {
// this check is necessary as this is called on page load, too
if (!$rootScope.connected) {
return;
}
if ($scope.useFavico) {
notifications.updateFavico();
} else {
$rootScope.favico.reset();
}
});
// Update font family when changed
$scope.$watch('fontfamily', function() {
utils.changeClassStyle('favorite-font', 'fontFamily', $scope.fontfamily);
@ -598,7 +578,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if ($rootScope.connected) {
$scope.disconnect();
}
$scope.favico.reset();
}
};

@ -56,26 +56,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', function($root
}
};
var updateFavico = function() {
var notifications = unreadCount('notification');
if (notifications > 0) {
$rootScope.favico.badge(notifications, {
bgColor: '#d00',
textColor: '#fff'
});
} else {
var unread = unreadCount('unread');
if (unread === 0) {
$rootScope.favico.reset();
} else {
$rootScope.favico.badge(unread, {
bgColor: '#5CB85C',
textColor: '#ff0'
});
}
}
};
/* Function gets called from bufferLineAdded code if user should be notified */
var createHighlight = function(buffer, message) {
var title = '';
@ -135,7 +115,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', function($root
return {
requestNotificationPermission: requestNotificationPermission,
updateTitle: updateTitle,
updateFavico: updateFavico,
createHighlight: createHighlight,
};
}]);

Loading…
Cancel
Save