asadiqbal08/SOL-766: Add Facebook sharing to certificate view
* updated the flags for social media sharing * added facebook feed ui to share public url * update the condition logic * update the code as per suggestion and added pick new style for share buttons * update the css class reference * update the bok-choy test * updated description and some text touch-ups * moved the JS related to facebook into separate location * js formatting * Add trailing comma per chrisndodge * Add wait to fix flaky test...maybe
This commit is contained in:
32
lms/static/js/utils/facebook.js
Normal file
32
lms/static/js/utils/facebook.js
Normal file
@@ -0,0 +1,32 @@
|
||||
var FaceBook = (function() {
|
||||
var _args = {};
|
||||
|
||||
return {
|
||||
init : function (Args) {
|
||||
_args = Args;
|
||||
window.fbAsyncInit = function() {
|
||||
FB.init({
|
||||
appId : _args.facebook_app_id,
|
||||
xfbml : true,
|
||||
version : 'v2.3'
|
||||
});
|
||||
};
|
||||
(function(d, s, id){
|
||||
var js, fjs = d.getElementsByTagName(s)[0];
|
||||
if (d.getElementById(id)) {return;}
|
||||
js = d.createElement(s); js.id = id;
|
||||
js.src = "//connect.facebook.net/en_US/sdk.js";
|
||||
fjs.parentNode.insertBefore(js, fjs);
|
||||
}(document, 'script', 'facebook-jssdk'));
|
||||
},
|
||||
share: function (feed_data) {
|
||||
FB.ui({
|
||||
method: 'feed',
|
||||
name: feed_data['share_text'],
|
||||
link: feed_data['share_link'],
|
||||
picture: feed_data['picture_link'],
|
||||
description: feed_data['description']
|
||||
});
|
||||
}
|
||||
};
|
||||
}());
|
||||
Reference in New Issue
Block a user