commit
d75b420e4d
3 changed files with 6 additions and 14 deletions
|
@ -254,7 +254,7 @@ $ openssl req -nodes -newkey rsa:2048 -keyout relay.pem -x509 -days 365 -out rel
|
|||
</td>
|
||||
<td class="prefix"><span ng-repeat="part in bufferline.prefix" ng-class="{{ part.classes }}">{{ part.text }}</span></td>
|
||||
<td class="message">
|
||||
<span ng-repeat="part in bufferline.content" class="text" ng-class="{{ part.classes }}" ng-bind-html="part.text"></span>
|
||||
<span ng-repeat="part in bufferline.content" class="text" ng-class="{{ part.classes }}" ng-bind-html="part.text|linky:'_blank'"></span>
|
||||
|
||||
<div ng-repeat="metadata in bufferline.metadata">
|
||||
<div ng-show="metadata.visible">
|
||||
|
|
|
@ -80,19 +80,6 @@ plugins.service('plugins', ['userPlugins', '$sce', function(userPlugins, $sce) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Replace all URLs with hyperlinks */
|
||||
|
||||
var urlRegexp = RegExp(/(http|ftp|https):\/\/[\w-]+(\.[\w-]+)+([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-])?/g);
|
||||
for(k in message.content) {
|
||||
var text = message.content[k].text;
|
||||
var url = text.match(urlRegexp);
|
||||
for(i in url) {
|
||||
var u = url[i];
|
||||
text = text.replace(u, '<a target="_blank" href="' + u + '">' + u + '</a>');
|
||||
}
|
||||
message.content[k].text = $sce.trustAsHtml(text);
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
|
|
|
@ -667,6 +667,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
|||
}
|
||||
}
|
||||
|
||||
// Prevent user from accidentally leaving the page
|
||||
window.onbeforeunload = function(event) {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
}]
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue