Need you GDev key for youtube stuff
Этот коммит содержится в:
@@ -303,18 +303,25 @@ var getYoutubeEmbed = function(link) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var success = function(data) {
|
var success = function(data) {
|
||||||
$('.video-uploader.'+youtubeId).html(data.data.uploader);
|
if(!data.items.length || !data.items[0].snippet) {
|
||||||
$('.video-title.'+youtubeId).find('a').html(data.data.title);
|
return;
|
||||||
|
}
|
||||||
|
metadata = data.items[0].snippet;
|
||||||
|
$('.video-uploader.'+youtubeId).html(metadata.channelTitle);
|
||||||
|
$('.video-title.'+youtubeId).find('a').html(metadata.title);
|
||||||
$(".post-list-holder-by-time").scrollTop($(".post-list-holder-by-time")[0].scrollHeight);
|
$(".post-list-holder-by-time").scrollTop($(".post-list-holder-by-time")[0].scrollHeight);
|
||||||
$(".post-list-holder-by-time").perfectScrollbar('update');
|
$(".post-list-holder-by-time").perfectScrollbar('update');
|
||||||
};
|
};
|
||||||
|
|
||||||
$.ajax({
|
if(config.GoogleDeveloperKey) {
|
||||||
async: true,
|
$.ajax({
|
||||||
url: 'https://gdata.youtube.com/feeds/api/videos/'+youtubeId+'?v=2&alt=jsonc',
|
async: true,
|
||||||
type: 'GET',
|
url: "https://www.googleapis.com/youtube/v3/videos",
|
||||||
success: success
|
type: 'GET',
|
||||||
});
|
data: {part:"snippet", id:youtubeId, key:config.GoogleDeveloperKey},
|
||||||
|
success: success
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="post-comment">
|
<div className="post-comment">
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ var config = {
|
|||||||
RequireInviteNames: false,
|
RequireInviteNames: false,
|
||||||
AllowSignupDomainsWizard: false,
|
AllowSignupDomainsWizard: false,
|
||||||
|
|
||||||
|
// Google Developer Key (for Youtube API links)
|
||||||
|
// Leave blank to disable
|
||||||
|
GoogleDeveloperKey: "",
|
||||||
|
|
||||||
// Privacy switches
|
// Privacy switches
|
||||||
ShowEmail: true,
|
ShowEmail: true,
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user