function loginFacebook(obj) { FB.init({ appId: '470229489665987', status: true, cookie: true, xbfml: true,oauth : true }); try { FB.login(function(response) { if (response.authResponse) { jQuery('#fileUploader').hide(); jQuery('#facebookUploader').load(obj.href,{ "user_id" : response.authResponse.userID, "oauth_token" : response.authResponse.accessToken, "expires" : response.authResponse.expiresIn }, function() { jQuery('.fbPhoto').click(function() { jQuery('#facebookUploader').html( jQuery(this).html() ).append('

Please wait while we upload your photo.

').css('text-align','center').show(); jQuery.getJSON( '/static/uploadify/uploadify.php', { "file" : jQuery(this).children('.orig_image').val() }, function(pictureObj) { AddToGallery( pictureObj ); t.wizard.pictureAdd(pictureObj.id,jQuery('#replaceImage').attr('rel')); jQuery('#file_uploader_overlay').hide(); jQuery('#fileUploader').show(); jQuery('#facebookUploader').hide(); } ); }); }).show(); } }, { scope: 'user_photos,friends_photos,user_photo_video_tags,friends_photo_video_tags' }); } catch (ex) { } } function AddToGallery(photo) { var imgsrc = root + photo.thumbpath; var card_img = jQuery("#card_img").attr('value'); if(card_img == 0){ jQuery(".front img").attr("src",imgsrc); jQuery("#card_img").val("1"); }else{ jQuery(".back img").attr("src",imgsrc); } gallery[photo.id] = photo; //jQuery("#photos").css("width", Object.keys(gallery).length*240); jQuery('#photos').prepend('
Delete

' + photo.name + '

'); } function DeletePhoto(id) { jQuery('#'+id).hide(); delete gallery[id]; jQuery.get('/static/uploadify/uploadify.php',{ 'delete' : id } ); } /* jQuery(document).ready(function() { jQuery("#photos").css("width", Object.keys(gallery).length*240); jQuery('#file_upload').uploadifive({ 'fileType' : 'image', 'fileObjName' : 'file', 'itemTemplate' : '
|
', 'queueID' : 'upload_queue', 'auto' : true, 'dnd' : true, 'buttonText' : 'Upload From Computer', 'uploadScript' : '/static/uploadify/uploadify.php', 'onUploadComplete' : function(file, response) { AddToGallery( JSON.parse(response)); } }); }); */