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.
Lorenz Hübschle-Schneider 11 years ago
parent 9cc32055eb
commit f640ef2a64
  1. 7
      3rdparty/favico-0.3.5.min.js
  2. 3
      bower.json
  3. 24
      index.html
  4. 11
      js/filters.js
  5. 20
      js/glowingbear.js
  6. 21
      js/notifications.js

File diff suppressed because one or more lines are too long

@ -16,7 +16,8 @@
"angular-sanitize": "1.3.x",
"angular-touch": "1.3.x",
"underscore": "~1.7",
"bootstrap": "~3.1"
"bootstrap": "~3.1",
"emojione": "1.3.x"
},
"keywords": [
"weechat",

@ -21,6 +21,7 @@
<script type="text/javascript" src="3rdparty/angular-sanitize.min.js"></script>
<script type="text/javascript" src="3rdparty/angular-touch.min.js"></script>
<script type="text/javascript" src="3rdparty/underscore-min.js"></script>
<script type="text/javascript" src="3rdparty/emojione.min.js"></script>
<script type="text/javascript" src="3rdparty/inflate.min.js"></script>
<script type="text/javascript" src="js/localstorage.js"></script>
<script type="text/javascript" src="js/weechat.js"></script>
@ -37,7 +38,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-keyup="handleKeyRelease($event)" ng-keypress="handleKeyPress($event)" ng-class="{'no-overflow': connected}" lang="en-US">
<div ng-hide="connected" class="container">
@ -260,7 +260,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
<td class="prefix"><a ng-click="addMention(bufferline.prefix)"><span ng-repeat="part in ::bufferline.prefix" ng-class="::part.classes" ng-bind="::part.text|prefixlimit:25"></span></a></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' | DOMfilter:'irclinky' | DOMfilter:'emojify':settings.enableJSEmoji | DOMfilter:'inlinecolour' | DOMfilter:'mathjax':('.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' | DOMfilter:'irclinky' | DOMfilter:'inlinecolour' | DOMfilter:'mathjax':('.line-' + part.$$hashKey.replace(':','_')):settings.enableMathjax"></span>
</td>
</tr>
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
@ -400,16 +400,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="settings.useFavico">
Display unread count in favicon
</label>
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
@ -421,16 +411,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</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</span>
</label>
</div>
</form>
</li>
<li>
<form class="form-inline" role="form">
<div class="checkbox">
<label>

@ -141,17 +141,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) {
return emojione.unicodeToImage(text);
} else {
return(text);
}
};
});
weechat.filter('mathjax', function() {
return function(text, selector, enabled) {
if (!enabled || typeof(MathJax) === "undefined") {

@ -36,7 +36,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,
});
$scope.settings = settings;
@ -114,7 +113,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');
}
@ -217,7 +216,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
});
$rootScope.favico = new Favico({animation: 'none'});
$scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread');
@ -225,10 +223,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() {
@ -353,17 +347,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();
}
});
// To prevent unnecessary loading times for users who don't
// want MathJax, load it only if the setting is enabled.
@ -697,7 +680,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if ($rootScope.connected) {
$scope.disconnect();
}
$scope.favico.reset();
}
};

@ -57,26 +57,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'
});
} 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 = '';
@ -154,7 +134,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
return {
requestNotificationPermission: requestNotificationPermission,
updateTitle: updateTitle,
updateFavico: updateFavico,
createHighlight: createHighlight,
cancelAll: cancelAll,
unreadCount: unreadCount

Loading…
Cancel
Save