remove favico and emoji rendering

doesn't make much sense in an app...

keep emojione around though (and add with bower) because the
unicode replacement is useful on mobile. the glyphs not so much.
cordova
Lorenz Hübschle-Schneider 11 years ago
parent 38f5ba7e26
commit 8de80e06f6
  1. 23
      index.html
  2. 18
      js/filters.js
  3. 22
      js/glowingbear.js
  4. 27
      js/notifications.js

@ -46,7 +46,6 @@
<script type="text/javascript" src="js/models.js"></script>
<script type="text/javascript" src="js/plugins.js"></script>
<script type="text/javascript" src="js/imgur.js"></script>
<script type="text/javascript" src="3rdparty/favico-0.3.10.min.js"></script>
</head>
<body ng-controller="WeechatCtrl" ng-keydown="handleKeyPress($event)" ng-keyup="handleKeyRelease($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" ng-init="init()" lang="en-US">
<div class="alert alert-danger upload-error" ng-show="uploadError">
@ -287,7 +286,7 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
<td class="prefix"><span ng-class="::{'repeated-prefix': bufferline.prefixtext==bufferlines[$index-1].prefixtext}"><a ng-click="addMention(bufferline.prefix)"><span class="hidden-bracket">&lt;</span><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span><span class="hidden-bracket">&gt;</span></a></span></td><!--
--><td class="message"><!--
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!--
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
--><span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes.concat(['line-' + part.$$hashKey.replace(':','_')])" ng-bind-html="::part.text | linky:'_blank':{rel:'noopener noreferrer'} | DOMfilter:'irclinky' | DOMfilter:'inlinecolour' | DOMfilter:'latexmath':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
</td>
</tr>
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
@ -417,16 +416,6 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="settings.useFavico">
Display unread count in favicon
</label>
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
@ -438,16 +427,6 @@ chown -R <strong>username</strong>:<strong>username</strong> ~<strong>username</
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="settings.enableJSEmoji">
Enable non-native Emoji support <span class="text-muted settings-help">Displays Emoji characters as images. Emoji provided free by <a href="http://emojione.com">http://emojione.com</a></span>
</label>
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>

@ -157,24 +157,6 @@ weechat.filter('getBufferQuickKeys', function () {
};
});
// Emojifis the string using https://github.com/Ranks/emojione
weechat.filter('emojify', function() {
return function(text, enable_JS_Emoji) {
if (enable_JS_Emoji === true && window.emojione !== undefined) {
// Emoji live in the D800-DFFF surrogate plane; only bother passing
// this range to CPU-expensive unicodeToImage();
var emojiRegex = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
if (emojiRegex.test(text)) {
return emojione.unicodeToImage(text);
} else {
return(text);
}
} else {
return(text);
}
};
});
weechat.filter('latexmath', function() {
return function(text, selector, enabled) {
if (!enabled || typeof(katex) === "undefined") {

@ -42,7 +42,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
'fontsize': '14px',
'fontfamily': (utils.isMobileUi() ? 'sans-serif' : 'Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace'),
'readlineBindings': false,
'enableJSEmoji': (utils.isMobileUi() ? false : true),
'enableMathjax': false,
'customCSS': '',
"currentlyViewedBuffers":{},
@ -120,7 +119,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');
}
@ -223,7 +222,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
});
$rootScope.favico = new Favico({animation: 'none'});
$scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread');
@ -231,10 +229,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
notifications.updateTitle();
$scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread');
if (settings.useFavico && $rootScope.favico) {
notifications.updateFavico();
}
});
$rootScope.$on('relayDisconnect', function() {
@ -362,19 +356,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.predicate = orderbyserver ? 'serverSortKey' : 'number';
});
settings.addCallback('useFavico', function(useFavico) {
// this check is necessary as this is called on page load, too
if (!$rootScope.connected) {
return;
}
if (useFavico) {
notifications.updateFavico();
} else {
$rootScope.favico.reset();
notifications.updateBadge('');
}
});
// To prevent unnecessary loading times for users who don't
// want LaTeX math, load it only if the setting is enabled.
// This also fires when the page is loaded if enabled.
@ -792,7 +773,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if ($rootScope.connected) {
$scope.disconnect();
}
$scope.favico.reset();
}
};

@ -134,32 +134,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
}
};
var updateFavico = function() {
var notifications = unreadCount('notification');
if (notifications > 0) {
$rootScope.favico.badge(notifications, {
bgColor: '#d00',
textColor: '#fff'
});
// Set badge to notifications count
updateBadge(notifications);
} else {
var unread = unreadCount('unread');
if (unread === 0) {
$rootScope.favico.reset();
// Remove badge form app icon
updateBadge('');
} else {
$rootScope.favico.badge(unread, {
bgColor: '#5CB85C',
textColor: '#ff0'
});
// Set app badge to "." when only unread and no notifications
updateBadge("•");
}
}
};
// Update app badge (electron only)
var updateBadge = function(value) {
@ -220,7 +194,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
return {
requestNotificationPermission: requestNotificationPermission,
updateTitle: updateTitle,
updateFavico: updateFavico,
updateBadge: updateBadge,
createHighlight: createHighlight,
cancelAll: cancelAll,

Loading…
Cancel
Save