VRFS-1436 allow unauthenticated uses to share recordings and sessions from landing pages

This commit is contained in:
Brian Smith 2014-04-26 14:21:17 -04:00
parent ce80b1a09b
commit c06458550c
3 changed files with 16 additions and 16 deletions

View File

@ -40,6 +40,10 @@
function launchShareDialog(entityId, entityType) {
console.log("launching share dialog for %o %o", entityType, entityId);
var shareDialog = new JK.ShareDialog(JK.app, entityId, entityType);
shareDialog.initialize(JK.FacebookHelperInstance);
shareDialog.showDialog();
};
this.addSessionLike = addSessionLike;

View File

@ -2,7 +2,8 @@
context.JK.ShowRecording = function(app) {
var logger = context.JK.logger;
var rest = new JK.Rest();
var rest = JK.Rest();
var ui = context.JK.UIHelper();
var recordingId = null;
var claimedRecordingId = null;
var $scope = $(".landing-details");
@ -105,14 +106,11 @@
$controls.bind('statechange.listenRecording', stateChange);
$controls.listenRecording({recordingId: recordingId, claimedRecordingId: claimedRecordingId, sliderSelector:'.recording-slider', sliderBarSelector: '.recording-playback', currentTimeSelector:'.recording-current'});
$("#btnShare", $scope).click(function(e) {
ui.launchShareDialog(claimedRecordingId, "recording");
});
if (JK.currentUserId) {
var shareDialog = new JK.ShareDialog(JK.app, claimedRecordingId, "recording");
shareDialog.initialize(JK.FacebookHelperInstance);
$("#btnShare", $scope).click(function(e) {
shareDialog.showDialog();
});
$("#btnPostComment").click(function(e) {
if ($.trim($("#txtRecordingComment").val()).length > 0) {
addComment();

View File

@ -2,7 +2,8 @@
context.JK.ShowMusicSession = function(app) {
var logger = context.JK.logger;
var rest = new JK.Rest();
var rest = JK.Rest();
var ui = context.JK.UIHelper();
var sessionId = null;
var $scope = $(".landing-details");
var $controls = null;
@ -107,14 +108,11 @@
sessionId = musicSessionId;
$("#btnShare").click(function(e) {
ui.launchShareDialog(sessionId, "session");
});
if (JK.currentUserId) {
var shareDialog = new JK.ShareDialog(context.JK.app, sessionId, "session");
shareDialog.initialize(JK.FacebookHelperInstance);
$("#btnShare").click(function(e) {
shareDialog.showDialog();
});
$("#btnPostComment").click(function(e) {
if ($.trim($("#txtSessionComment").val()).length > 0) {
addComment();