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 6d9ed5a6b7
commit d991cbac9e
  1. 7
      3rdparty/favico-0.3.5.min.js
  2. 3
      bower.json
  3. 24
      index.html
  4. 18
      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.4.x", "angular-sanitize": "1.4.x",
"angular-touch": "1.4.x", "angular-touch": "1.4.x",
"underscore": "~1.7", "underscore": "~1.7",
"bootstrap": "~3.1" "bootstrap": "~3.1",
"emojione": "1.3.x"
}, },
"keywords": [ "keywords": [
"weechat", "weechat",

@ -24,6 +24,7 @@
<script type="text/javascript" src="3rdparty/angular-sanitize.min.js"></script> <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/angular-touch.min.js"></script>
<script type="text/javascript" src="3rdparty/underscore-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="3rdparty/inflate.min.js"></script>
<script type="text/javascript" src="js/localstorage.js"></script> <script type="text/javascript" src="js/localstorage.js"></script>
<script type="text/javascript" src="js/weechat.js"></script> <script type="text/javascript" src="js/weechat.js"></script>
@ -44,7 +45,6 @@
<script type="text/javascript" src="js/models.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="js/plugins.js"></script>
<script type="text/javascript" src="js/imgur.js"></script> <script type="text/javascript" src="js/imgur.js"></script>
<script type="text/javascript" src="3rdparty/favico-0.3.5.min.js"></script>
</head> </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"> <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"> <div class="alert alert-danger upload-error" ng-show="uploadError">
@ -270,7 +270,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 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></td><!-- <td class="prefix"><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></td><!--
--><td class="message"><!-- --><td class="message"><!--
--><div ng-repeat="metadata in ::bufferline.metadata" plugin data="::metadata"></div><!-- --><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> </td>
</tr> </tr>
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index"> <tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">
@ -410,16 +410,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</div> </div>
</form> </form>
</li> </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> <li>
<form class="form-inline" role="form"> <form class="form-inline" role="form">
<div class="checkbox"> <div class="checkbox">
@ -429,16 +419,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</label> </label>
</div> </div>
</form> </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>
<li> <li>
<form class="form-inline" role="form"> <form class="form-inline" role="form">

@ -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('mathjax', function() { weechat.filter('mathjax', function() {
return function(text, selector, enabled) { return function(text, selector, enabled) {
if (!enabled || typeof(MathJax) === "undefined") { if (!enabled || typeof(MathJax) === "undefined") {

@ -44,7 +44,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
'fontsize': '14px', 'fontsize': '14px',
'fontfamily': (utils.isMobileUi() ? 'sans-serif' : 'Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace'), 'fontfamily': (utils.isMobileUi() ? 'sans-serif' : 'Inconsolata, Consolas, Monaco, Ubuntu Mono, monospace'),
'readlineBindings': false, 'readlineBindings': false,
'enableJSEmoji': (utils.isMobileUi() ? false : true),
'enableMathjax': false, 'enableMathjax': false,
}); });
$scope.settings = settings; $scope.settings = settings;
@ -108,7 +107,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
buffer.unread = 0; buffer.unread = 0;
buffer.notification = 0; buffer.notification = 0;
// Trigger title and favico update // Trigger title update
$rootScope.$emit('notificationChanged'); $rootScope.$emit('notificationChanged');
} }
@ -213,7 +212,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
} }
}); });
$rootScope.favico = new Favico({animation: 'none'});
$scope.notifications = notifications.unreadCount('notification'); $scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread'); $scope.unread = notifications.unreadCount('unread');
@ -221,10 +219,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
notifications.updateTitle(); notifications.updateTitle();
$scope.notifications = notifications.unreadCount('notification'); $scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread'); $scope.unread = notifications.unreadCount('unread');
if (settings.useFavico && $rootScope.favico) {
notifications.updateFavico();
}
}); });
$rootScope.$on('relayDisconnect', function() { $rootScope.$on('relayDisconnect', function() {
@ -351,17 +345,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.predicate = orderbyserver ? 'serverSortKey' : 'number'; $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 // To prevent unnecessary loading times for users who don't
// want MathJax, load it only if the setting is enabled. // want MathJax, load it only if the setting is enabled.
@ -750,7 +733,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if ($rootScope.connected) { if ($rootScope.connected) {
$scope.disconnect(); $scope.disconnect();
} }
$scope.favico.reset();
} }
}; };

@ -133,26 +133,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 */ /* Function gets called from bufferLineAdded code if user should be notified */
var createHighlight = function(buffer, message) { var createHighlight = function(buffer, message) {
var title = ''; var title = '';
@ -202,7 +182,6 @@ weechat.factory('notifications', ['$rootScope', '$log', 'models', 'settings', fu
return { return {
requestNotificationPermission: requestNotificationPermission, requestNotificationPermission: requestNotificationPermission,
updateTitle: updateTitle, updateTitle: updateTitle,
updateFavico: updateFavico,
createHighlight: createHighlight, createHighlight: createHighlight,
cancelAll: cancelAll, cancelAll: cancelAll,
unreadCount: unreadCount unreadCount: unreadCount

Loading…
Cancel
Save