|
|
@ -564,13 +564,7 @@ plugins.factory('userPlugins', function() { |
|
|
|
if (match) { |
|
|
|
if (match) { |
|
|
|
|
|
|
|
|
|
|
|
return function() { |
|
|
|
return function() { |
|
|
|
|
|
|
|
fetch("https://www.tiktok.com/oembed?url=" + url) |
|
|
|
var element = this.getElement(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetEmbedContent( "https://www.tiktok.com/oembed?url=" + url, element); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function GetEmbedContent(embedurl, element) { |
|
|
|
|
|
|
|
fetch(embedurl) |
|
|
|
|
|
|
|
.then(function(response) { |
|
|
|
.then(function(response) { |
|
|
|
return response.json(); |
|
|
|
return response.json(); |
|
|
|
}) |
|
|
|
}) |
|
|
@ -579,6 +573,7 @@ plugins.factory('userPlugins', function() { |
|
|
|
var scriptIndex = data.html.indexOf("<script "); |
|
|
|
var scriptIndex = data.html.indexOf("<script "); |
|
|
|
var content = data.html.substr(0, scriptIndex); |
|
|
|
var content = data.html.substr(0, scriptIndex); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var element = this.getElement(); |
|
|
|
element.innerHTML = content; |
|
|
|
element.innerHTML = content; |
|
|
|
|
|
|
|
|
|
|
|
// The script tag needs to be generated manually or the browser won't load it
|
|
|
|
// The script tag needs to be generated manually or the browser won't load it
|
|
|
@ -587,7 +582,6 @@ plugins.factory('userPlugins', function() { |
|
|
|
scriptElem.src = "https://www.tiktok.com/embed.js"; |
|
|
|
scriptElem.src = "https://www.tiktok.com/embed.js"; |
|
|
|
element.appendChild(scriptElem); |
|
|
|
element.appendChild(scriptElem); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|