if ( !StructKeyExists(request, "renderSocialMediaJS") )
{
application.ptSocialMedia.scripts.loadUnregisteredResource("/ADF/apps/pt_social_media/js/socialmedia.js","javascript","foot","tertiary");
request.renderSocialMediaJS = 1;
}
var apiURL = "//connect.facebook.net/en_US/all.js"; // TODO: move URL to config element
var outputHTML = "";
var appConfigStruct = StructNew();
var appID = "";
var fbChannelFileDomain = REREPLACE(request.site.url,"http:|https:","","one");
var fbChannelFileURL = fbChannelFileDomain & "ADF/apps/pt_social_media/html/fbChannel.html";
var fbAppID = application.ptSocialMedia.getFacebookAppID(); // Get the Facebook AppID from the config element
if ( !StructKeyExists(request, "renderFacebookJS") )
{
application.ptSocialMedia.scripts.addFooterHTML(outputHTML,"tertiary");
request.renderFacebookJS = 1;
}
var twitterID = Application.ptSocialMedia.getTwitterConsumerKey(); //application.twitter.getAppConfig("twitter").consumerKey
if ( !StructKeyExists(request, "renderTwitterAnywhereJS") )
{
application.ptSocialMedia.scripts.loadUnregisteredResource("https://platform.twitter.com/anywhere.js?id=#twitterID#&v=#arguments.version#","javascript","foot","tertiary");
request.renderTwitterAnywhereJS = 1;
}
if ( !StructKeyExists(request, "renderTwitterWidgetsJS") )
{
application.ptSocialMedia.scripts.loadUnregisteredResource("https://platform.twitter.com/widgets.js","javascript","foot","tertiary");
request.renderTwitterWidgetsJS = 1;
}
if ( !StructKeyExists(request, "renderSocialMediaStyles") )
{
application.ptSocialMedia.scripts.loadUnregisteredResource("/ADF/apps/pt_social_media/style/socialmedia.css","stylesheet","head","tertiary");
request.renderSocialMediaStyles = 1;
}
if ( !StructKeyExists(request, "renderSocialMediaAdminStyles") )
{
application.ptSocialMedia.scripts.loadUnregisteredResource("/ADF/apps/pt_social_media/style/socialmediaadmin.css","stylesheet","head","tertiary");
request.renderSocialMediaAdminStyles = 1;
}