Fix links and embeds

Disable semi-broken plugins
cordova-0.4.3
Lorenz Hübschle-Schneider 11 years ago
parent 922a380fba
commit b40ab2f504
  1. 4
      index.html
  2. 9
      js/filters.js
  3. 4
      js/plugins.js
  4. 2
      test/unit/plugins.js

@ -197,7 +197,7 @@ $ openssl req -nodes -newkey rsa:4096 -keyout relay.pem -x509 -days 365 -out rel
</a>
<button ng-if="debugMode" ng-click="countWatchers()">Count<br />Watchers</button>
</div>
<div class="title" ng-bind-html="activeBuffer().title | irclinky:'_blank'" title="{{activeBuffer().title}}"></div>
<div class="title" ng-bind-html="activeBuffer().title | irclinky:'_system' | unsafe" title="{{activeBuffer().title}}"></div>
<div class="actions pull-right vertical-line-left">
<div class="pull-left">
<a class="settings-toggle" ng-click="showModal('settingsModal')" title="Options menu">
@ -251,7 +251,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"></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" ng-bind-html="::part.text | irclinky:'_blank' | inlinecolour"></span>
<span ng-repeat="part in ::bufferline.content" class="text" ng-class="::part.classes" ng-bind-html="::part.text | irclinky:'_system' | inlinecolour"></span>
</td>
</tr>
<tr class="readmarker" ng-if="activeBuffer().lastSeen==$index">

@ -23,6 +23,9 @@ weechat.filter('irclinky', ['$filter', function($filter) {
var linkiedText = $filter('linky')(text, target);
// Cordova: need to use window.open instead of href
linkiedText = linkiedText.replace(/href="([^"]+)"/gi, "onClick=\"window.open('$1', '_system')\"");
// This regex in no way matches all IRC channel names (they could also begin with &, + or an
// exclamation mark followed by 5 alphanumeric characters, and are bounded in length by 50).
// However, it matches all *common* IRC channels while trying to minimise false positives.
@ -49,4 +52,10 @@ weechat.filter('inlinecolour', ['$sce', function($sce) {
return $sce.trustAsHtml(text.replace(hexColourRegex, substitute));
};
}]);
weechat.filter('unsafe', ['$sce', function($sce) {
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
})();

@ -338,6 +338,7 @@ plugins.factory('userPlugins', function() {
);
yrPlugin.name = "meteogram";
/*
// Embed GitHub gists
var gistPlugin = new Plugin(
urlPlugin(function(url) {
@ -390,9 +391,10 @@ plugins.factory('userPlugins', function() {
})
);
tweetPlugin.name = 'Tweet';
*/
return {
plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin, gistPlugin, tweetPlugin]
plugins: [youtubePlugin, dailymotionPlugin, allocinePlugin, imagePlugin, spotifyPlugin, cloudmusicPlugin, googlemapPlugin, asciinemaPlugin, yrPlugin]
};

@ -119,6 +119,7 @@ describe('filter', function() {
plugins);
}));
/*
it('should recognize gists', inject(function(plugins) {
expectTheseMessagesToContain([
'https://gist.github.com/lorenzhs/e8c1a7d56fa170320eb8',
@ -135,6 +136,7 @@ describe('filter', function() {
'Tweet',
plugins);
}));
*/
});
});

Loading…
Cancel
Save