lint
This commit is contained in:
parent
5e47768135
commit
147028f1a5
@ -131,7 +131,7 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
|
||||
// Show a TLS warning if GB was loaded over an unencrypted connection,
|
||||
// except for local instances (local files, testing)
|
||||
$scope.show_tls_warning = (["https:", "file:"].indexOf(window.location.protocol) === -1) &&
|
||||
(["localhost", "127.0.0.1", "::1"].indexOf(window.location.hostname) === -1)
|
||||
(["localhost", "127.0.0.1", "::1"].indexOf(window.location.hostname) === -1);
|
||||
|
||||
$rootScope.isWindowFocused = function() {
|
||||
if (typeof $scope.documentHidden === "undefined") {
|
||||
|
@ -239,34 +239,35 @@ plugins.factory('userPlugins', function() {
|
||||
|
||||
var twitchPlugin = new UrlPlugin('Twitch video', function(url) {
|
||||
var regex = /(?:https?:\/\/)?clips\.twitch\.tv\/([^\?\&\/\s]+)/i,
|
||||
match = url.match(regex);
|
||||
match = url.match(regex),
|
||||
embedurl,
|
||||
element;
|
||||
|
||||
if (match){
|
||||
if (match) {
|
||||
var clipId = match[1];
|
||||
var embedurl = "https://clips.twitch.tv/embed?clip=" + clipId + "&parent=" + window.location.hostname;
|
||||
|
||||
var element = angular.element('<iframe></iframe>')
|
||||
.attr('src', embedurl)
|
||||
.attr('width', '560')
|
||||
.attr('height', '315')
|
||||
.attr('allowfullscreen', 'true');
|
||||
embedurl = "https://clips.twitch.tv/embed?clip=" + clipId + "&parent=" + window.location.hostname;
|
||||
element = angular.element('<iframe></iframe>')
|
||||
.attr('src', embedurl)
|
||||
.attr('width', '560')
|
||||
.attr('height', '315')
|
||||
.attr('allowfullscreen', 'true');
|
||||
return element.prop('outerHTML');
|
||||
}
|
||||
|
||||
var regex = /(?:https?:(?:\/\/www\.)?)?twitch\.tv\/(?:videos\/(\d+)|(\w+))/i,
|
||||
match = url.match(regex);
|
||||
|
||||
regex = /(?:https?:(?:\/\/www\.)?)?twitch\.tv\/(?:videos\/(\d+)|(\w+))/i;
|
||||
match = url.match(regex);
|
||||
if (match) {
|
||||
var mediaType = "video";
|
||||
if(match[1] === undefined) {
|
||||
mediaType = "channel";
|
||||
}
|
||||
var mediaId = match[1] === undefined ? match[2] : match[1];
|
||||
var embedurl = "https://player.twitch.tv/?" + mediaType + "=" + mediaId + "&parent=" + window.location.hostname + "&autoplay=false&muted=true";
|
||||
var element = angular.element('<iframe></iframe>')
|
||||
.attr('src', embedurl)
|
||||
.attr('width', '560')
|
||||
.attr('height', '315')
|
||||
.attr('allowfullscreen', 'true');
|
||||
var mediaType = "video";
|
||||
if (match[1] === undefined) {
|
||||
mediaType = "channel";
|
||||
}
|
||||
var mediaId = match[1] === undefined ? match[2] : match[1];
|
||||
embedurl = "https://player.twitch.tv/?" + mediaType + "=" + mediaId + "&parent=" + window.location.hostname + "&autoplay=false&muted=true";
|
||||
element = angular.element('<iframe></iframe>')
|
||||
.attr('src', embedurl)
|
||||
.attr('width', '560')
|
||||
.attr('height', '315')
|
||||
.attr('allowfullscreen', 'true');
|
||||
return element.prop('outerHTML');
|
||||
}
|
||||
});
|
||||
|
@ -27,7 +27,7 @@ weechat.factory('utils', function() {
|
||||
const _isTauri = window.__TAURI__ !== undefined;
|
||||
var isTauri = function() {
|
||||
return _isTauri;
|
||||
}
|
||||
};
|
||||
|
||||
// Inject a javascript (used by KaTeX)
|
||||
var inject_script = function(script_url) {
|
||||
|
Loading…
Reference in New Issue
Block a user