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-touch": "1.4.x",
"underscore": "~1.7",
"bootstrap": "~3.1"
"bootstrap": "~3.1",
"emojione": "1.3.x"
},
"keywords": [
"weechat",

@ -24,6 +24,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>
@ -44,7 +45,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.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}" ng-init="init()" lang="en-US">
<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="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">
@ -410,16 +410,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">
@ -429,16 +419,6 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</label>
</div>
</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">

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

@ -44,7 +44,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;
@ -108,7 +107,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');
}
@ -213,7 +212,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
}
});
$rootScope.favico = new Favico({animation: 'none'});
$scope.notifications = notifications.unreadCount('notification');
$scope.unread = notifications.unreadCount('unread');
@ -221,10 +219,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() {
@ -351,17 +345,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.
@ -750,7 +733,6 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if ($rootScope.connected) {
$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 */
var createHighlight = function(buffer, message) {
var title = '';
@ -202,7 +182,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