$(document).ready(function () { $('#fnc-post-photo-selector').fineUploader({ request: { endpoint: jsbase_url+'images/ajaxUpload', inputName: 'qqfile', disableDefaultDropzone: false }, multiple: false, element: $('#fnc-post-photo-selector'), maxConnections: 1, button: $('#fnc-post-photo-button'), debug: false, listElement: $('#fnc-post-thumbnail-container') }).on('complete', function(event, id, filename, responseJSON){ //empty div to put image later in there if(responseJSON==="error"){ $('#error').prepend('' +'Error Uploding file '+file+'X' +''); console.log('Error uploading file ' + filename); } else { //Firefox browser $('.qq-upload-file').append(''+'X'); $('.qq-upload-file').append(""); $('.qq-upload-file').append(""); //fix for chrome $('input:hidden[name=filepath]').val(responseJSON.filepath); $('input:hidden[name=filename]').val(responseJSON.filename); $('#new-img-thumb').show().attr("src", responseJSON.thumbpath); $('.close-thumb').show(); } $('.close-thumb').on('click', function(e){ $('.qq-upload-file').remove(); $('.qq-upload-success').remove(); $(this).hide(); $('#new-img-thumb').hide().attr("src", ''); $('input:hidden[name=filepath]').val(''); $('input:hidden[name=filename]').val(''); e.preventDefault(); }); }); var postOptions = { config: { effect: 'slideToggle', close_effect: 'slideUp', speed: 500, button: '.ico-post-options-video', container: '.fnc-post-opt-slide' }, init: function(config) { $.extend(this.config, config); $(this.config.button).on( 'click', this.show ); }, show: function() { var po = postOptions, container = $(po.config.container), config = po.config, ss = scheduleSlide; ss.close(); container[config.effect](config.speed); }, close: function() { $(postOptions.config.container)[postOptions.config.close_effect](postOptions.config.speed); } } var scheduleSlide = { config: { effect: 'slideToggle', close_effect: 'slideUp', speed: 200, button: '.ico-post-options-video', container: '.fnc-post-opt-slide' }, init: function(config) { $.extend(this.config, config); $(this.config.button).on( 'click', this.show ); }, show: function() { var ss = scheduleSlide, container = $(ss.config.container), config = ss.config, po = postOptions; po.close(); container[config.effect](config.speed); }, close: function() { $(scheduleSlide.config.container)[scheduleSlide.config.close_effect](scheduleSlide.config.speed); } } postOptions.init({ button: '.ico-post-options-video', container: '.fnc-post-opt-slide' }); scheduleSlide.init({ button: '.ico-post-options-schedule', container: '.fnc-post-options-schedule' }); //Starts Quote Tweet or Retweet checbox stuff /* $('.func-chk-quote-tweet').change(function() { var quote_tweet_status = 0;//alert('Retweet'); if($(this).is(":checked")) { //alert('quote tweet'); quote_tweet_status = 1; } $.ajax({ type: "POST", url: jsbase_url+"posts/repost/setQuoteTweetStatus/"+quote_tweet_status, success: function(result){ } }); }); */ //Starts Quote Tweet or Retweet checbox stuff }); function pageCopy(pageId) { var id = "pagecopy_"+pageId; $.ajax({ type: "POST" , url: jsbase_url+"livepages/copy/"+pageId+"/1" , success: function(result){ if(result == "true"){ $("#"+id).html("COPIED"); } } }); } function sampleFollowPeople() { $("#followpeople").submit(); var data = $('#followpeople').serialize(); $.ajax({ type: "POST" , //url: jsbase_url+"users/sampleFollowPeopleWizard" , url: jsbase_url+"followers/sampleFollowPeople" , data: data, success: function(result){ if(result == "true"){ $("#message-bar-followPeople").css('display', 'block'); } } }); } function signupWizard() { $("#signupWizardfrm").submit(); var data = $('#signupWizardfrm').serialize(); $.ajax({ type: "POST" , url: jsbase_url+"users/edit_wizard_post" , // url: jsbase_url+"account/edit_wizard_post" , data: data, success: function(result){ if(result == "true"){ //Starts Storing Social posts $("#signupWizardfrm").hide();//hide EndTour Button $('#loading-tweets').show(); $.ajax({ url: jsbase_url+"posts/storeTwitterPosts", type: 'POST', success: function( response ) { $('#loading-tweets').hide(); $("#message-bar").css('display', 'block'); $("#message-bar p").removeClass('error'); $("#message-bar p").addClass('awesome'); $("#message-bar p").text('Awesome! You just created your profile!'); } }); //Ends Storing Social posts }else{ $("#message-bar").css('display', 'block'); $("#message-bar p").removeClass('awesome'); $("#message-bar p").addClass('error'); $("#message-bar p").text(result); } } }); } function resendEmail() { $.ajax({ type: "POST" , url: jsbase_url+"users/resendEmail", success: function(result){ if(result == "true"){ $( "#effect" ).show( "blind", 500, callback ); } } }); } function donotConnectSocialAccount() { $.ajax({ type: "POST" , url: jsbase_url+"users/donotConnectSocialAccount", success: function(result){ $( "#connectSocialAccountMsgBox" ).hide(); } }); } function postNew() { var message=$("#fnc-post-form-div textarea#linkBox").val(); if(message.length > 0) { if($("#fnc-post-form-div input#acc-qweboo").val() == 1 || $("#fnc-post-form-div input#post-acc-twitter").val() == 1 || $("#fnc-post-form-div input#post-acc-facebook").val() == 1){ $("#global-nav li:contains('Write Post')").removeClass(); var data = $('#fnc-post-form').serialize(); $('#fnc-write-post .close').click(); $.ajax({ type: "POST", data: data, url: jsbase_url+"posts/createNew_post", success: function(result){ if(result){ $("
You've successfully posted.
") .prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); restartPostForm('#fnc-post-form-div'); } } }); }else{ alert('Please select the platform first where you want to post.'); e.preventDefault(); } }else{ alert('Please write something first.'); e.preventDefault(); } } function repost() { /* var message=$("#fnc-repost-form-div textarea#linkBox").val(); if(message.length > 0 || $("#fnc-repost-form-div input#quoted-tweet").is(':checked') === false) { */ if($("#fnc-repost-form-div input#acc-qweboo").val() == 1 || $("#fnc-repost-form-div input#post-acc-twitter").val() == 1 || $("#fnc-repost-form-div input#post-acc-facebook").val() == 1){ $("#global-nav li:contains('Write Post')").removeClass(); var data = $('#fnc-repost-form').serialize(); $('#fnc-repost-post .close').click(); restartPostForm('#fnc-repost-form-div'); $.ajax({ type: "POST", data: data, url: jsbase_url+"posts/repost/createNew_post", success: function(result){ if(result){ if(result == 2) { $('.twitter-retweet-alert').lightbox_me({ centered: true, overlayCSS: { background: 'black', opacity: .75 }, closeEsc: true, closeSelector: ".close" }); } else { $("
You've successfully posted.
") .prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); //restartPostForm('#fnc-repost-form-div'); } } } }); }else{ alert('Please select the platform first where you want to post.'); e.preventDefault(); } /* }else{ alert('Please write something first.'); e.preventDefault(); } */ } function twitterReply() { var message=$("#fnc-twitterReply-form-div textarea#twitterReplyBox").val(); if(message.length > 0) { //$("#global-nav li:contains('Write Post')").removeClass(); var data = $('#fnc-twitterReply-form').serialize(); $('#fnc-twitter-reply-post .close').click(); restartPostForm('#fnc-twitterReply-form-div'); $.ajax({ type: "POST", data: data, url: jsbase_url+"posts/repost/twitterReplyPost", success: function(result){ if(result){ if(result == 2) { $('.twitter-reply-alert').lightbox_me({ centered: true, overlayCSS: { background: 'black', opacity: .75 }, closeEsc: true, closeSelector: ".close" }); } else { $("
You've successfully posted reply.
") .prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); //restartPostForm('#fnc-twitterReply-form-div'); } } } }); } else { alert('Please write something first.'); e.preventDefault(); } } function sendTwitterMessage() { var message=$("#fnc-twitterMessage-form-div textarea#twitterMessageBox").val(); if(message.length > 0) { var data = $('#fnc-twitterMessage-form').serialize(); $('#fnc-twitter-message-post .close').click(); restartPostForm('#fnc-twitterMessage-form-div'); $.ajax({ type: "POST", data: data, url: jsbase_url+"messages/private_messages/sendTwitterMessage", success: function(result){ if(result){ $("
You've successfully sent message.
") .prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); //restartPostForm('#fnc-twitterReply-form-div'); } else { $("
You cannot send a direct message to that user because they are not following you
") .prependTo('body').hide().slideDown('fast').delay(6000).fadeOut(1000, function() { $('.bs-example').remove(); }); } } }); } else { alert('Please write something first.'); e.preventDefault(); } } function restartPostForm( form_id ){ var $form = $( form_id ), $section = $form.parent('section'); $(':input',form_id) .not(':button, :submit, :reset, :hidden') .val('') .removeAttr('checked') .removeAttr('selected'); $form.find('.post-tags-list').empty(); $form.find('.post-tags-list').css('display','none'); $form.find('textarea.fnc-post-textarea').val(''); $form.find('.fnc-text-counter').text('0'); $section.find('div.post-recent-tags .btn-tags-list').children().removeClass('selected'); if (form_id == "#fnc-post-form-div"){ $('#fnc-post-thumbnail-container').empty(); $('.post-recent-tags').find('.btn-tags-list').children().removeClass('selected'); //emebd video, schedule $form.find('.fnc-post-opt-slide').css('display','none'); $form.find('.fnc-post-opt-slide textarea').val(''); $form.find('.post-options-schedule').css('display','none'); $section.find('#postOptions_panel').children().removeClass('selected'); //Reset Preview // $('#scrapper').hide();$('#postOptions_panel').show(); $form.find('#scrapper').css('display','none'); $form.find('#postOptions_panel').css('display','block'); $form.find('#h_scrapperLinkImageURL').val(''); $form.find('#h_scrapperText').val(''); $form.find('#h_scrapperLinkURL').val(''); $form.find('#h_scrapperLinkTitle').val(''); $form.find('#h_scrapperLinkDescription').val(''); $form.find('#h_remove_preview').val('0'); // $('#scrapper_description').text('');$('#scrapper_title').text('');$('#scrapper_url').text('');$('#scrapper_img').css('backgroundImage',''); //Post over qw,fb,twt $form.find('.post-acc .post-acc-list label').addClass('selected'); $form.find('.post-acc .post-acc-list label input').val(1); } else if(form_id == "#fnc-twitterReply-form-div") { $('#fnc-post-thumbnail-container').empty(); $('#fnc-post-form #fnc-post-thumbnail-container').empty(); } } function twitterCommunity(livepageId, pageId) { if(pageId!=undefined) { var nextPage = parseInt(pageId)+1; //$("#buildCommunity #pageId").val(nextPage); } else { $('#buildCommunity #keyword').val(''); $('#buildCommunity #buildCommunityListContainer').html(""); //$("#buildCommunity #loading-more-search").hide(); //$("#buildCommunity #pageId").val(2); pageId=""; } var loading_div = $('#buildCommunity .progress'), url = $('#buildCommunity article:last').data('href'); loading_div.show(); //$("#buildCommunity #loading-more").hide(); //$("#buildCommunity #loading-tweets").show(); $.ajax({ url: jsbase_url+'livepages/buildTwitterCommunity/'+livepageId+'/'+pageId, success: function(data) { loading_div.hide(); $('#buildCommunity #buildCommunityListContainer').append(data); //$("#buildCommunity #loading-tweets").hide(); //$("#buildCommunity #loading-more").show(); } }); } function getSearchBarTwitterProfiles(livepageId, pageId) { var keyword = $("#keyword").val(); if(keyword != "") { if(pageId!=undefined) { var nextPage = parseInt(pageId)+1; }else{ $('#buildCommunity #buildCommunityListContainer').html(""); pageId=""; } $("#buildCommunity .progressBuildCommunity").show(); $.ajax({ type: "POST", url: jsbase_url+'livepages/getSearchBarTwitterProfiles/'+$("#keyword").val()+'/'+$("#search_type").val()+'/'+livepageId+'/'+pageId, success: function(data) { $('#buildCommunity #buildCommunityListContainer').append(data); $("#buildCommunity .progressBuildCommunity").hide(); } }); }else{ alert('Please write search keyword first.'); } } function twitterCommunitySearch(livepageId, pageId) { if(pageId!=undefined) { var nextPage = parseInt(pageId)+1; //$("#buildCommunity #pageId").val(nextPage); } else { $('#buildCommunity #keyword').val(''); $('#buildCommunity #buildCommunityListContainerSearch').html(""); pageId=""; } var loading_div = $('#buildCommunity .progress'), url = $('#buildCommunity article:last').data('href'); loading_div.show(); $.ajax({ url: jsbase_url+'livepages/buildTwitterCommunity/'+livepageId+'/'+pageId, success: function(data) { loading_div.hide(); $('#buildCommunity #buildCommunityListContainerSearch').append(data); } }); } function getSearchBarTwitterProfilesSearch(livepageId, pageId) { var keyword = $("#keyword_search").val(); if(keyword != "") { if(pageId!=undefined) { var nextPage = parseInt(pageId)+1; } else { $('#buildCommunity #buildCommunityListContainerSearch').html(""); pageId=""; } var loading_div = $('#buildCommunity .progress'); loading_div.show(); $.ajax({ type: "POST", url: jsbase_url+'livepages/getSearchBarTwitterProfiles/'+$("#keyword_search").val()+'/'+$("#search_type").val()+'/'+livepageId+'/'+pageId, success: function(data) { loading_div.hide(); $('#buildCommunity #buildCommunityListContainerSearch').append(data); } }); } else { alert('Please write search keyword first.'); } } function followTwitterProfile(id, follow, following, pageId, twitterUserName, twitterUserScreenName, disappear, insertProfile, twtList = 0, source_tab = 0) { if (twtList === undefined) { twtList = 0; } if (source_tab === undefined) { source_tab = 0; } insertProfile = 1; if(disappear == 1) { $("#art-"+id).hide(); var span = $("#countTwitterNonFollowing"); span.html(parseInt(span.html()) - 1); }else{ $("#"+following).css("display", "block"); $("#"+follow).css("display", "none"); } $.ajax({ url: jsbase_url+'livepages/followTwitterProfile/' + id + '/' + pageId + '/' + twitterUserName + '/' + twitterUserScreenName + '/' + $("#providerId").val()+ '/' + insertProfile + '/' + twtList + '/' + source_tab, success: function(data) { if(data == 2) { if(disappear == 1) { $("#art-"+id).show(); var span = $("#countTwitterNonFollowing"); span.html(parseInt(span.html()) + 1); }else{ $("#"+following).css("display", "none"); $("#"+follow).css("display", "block"); } $('.twitter-follow-alert').lightbox_me({ centered: true, overlayCSS: { background: 'black', opacity: .75 }, closeEsc: true, closeSelector: ".close" }); } } }); } function unfollowTwitterProfile(id, follow, following, pageId, twitterUserName, twitterUserScreenName, disappear, counterId, profileDelete, twtList = 0, source_tab = 0) { if (twtList === undefined) { twtList = 0; } if (source_tab === undefined) { source_tab = 0; } if(disappear == 1) { $("#art-"+id).hide(); var span = $("#"+counterId); span.html(parseInt(span.html()) - 1); }else{ $("#"+follow).css("display", "block"); $("#"+following).css("display", "none"); } $.ajax({ url: jsbase_url+'livepages/unfollowTwitterProfile/' + id + '/' + pageId + '/' + twitterUserName + '/' + twitterUserScreenName + '/' + $("#providerId").val() + '/' + twtList + '/' + source_tab, success: function(data) { if(data == 2) { if(disappear == 1) { $("#art-"+id).show(); var span = $("#"+counterId); span.html(parseInt(span.html()) + 1); }else{ $("#"+follow).css("display", "none"); $("#"+following).css("display", "block"); } $('.twitter-unfollow-alert').lightbox_me({ centered: true, overlayCSS: { background: 'black', opacity: .75 }, closeEsc: true, closeSelector: ".close" }); } } }); } function twitterProfilesLoadMore() { var loading_div = $('#twitterPeoplePostingUl .progress'), url = $('#twitterPeoplePostingListContainer article:last').data('href'); loading_div.show(); $('#buildCommunity #loading-more').hide(); $.ajax({ url: url, success: function(data) { loading_div.hide(); if( $(data).filter('article').length ){ $('#twitterPeoplePostingListContainer article:last').after( data ); $('#buildCommunity #loading-more').show(); }else{ $('#buildCommunity #loading-more').hide(); } } }); } function FetchTwitterFollowersAndFollowing() { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'followers/FetchTwitterFollowersAndFollowing', success: function(data) { if(data == true) { $('#loading-tweets').hide(); location.reload(); } } }); } function delTwitterListMember(twitter_list_id, user_id, pageId, twitterUserName, twitterUserScreenName, providerId, twtList = 0) { $.ajax({ url: jsbase_url+'livepages/delTwitterListMember/' + twitter_list_id + '/' + user_id + '/' + pageId + '/' + twitterUserName + '/' + twitterUserScreenName + '/' + providerId + '/' + twtList, success: function(data) { if(data == true) { $("#article-"+user_id).css("display", "none"); } } }); } function addTwitterListMembers(livepage_id, provider_uid) { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'livepages/addTwitterListMembers/' + livepage_id + '/' + provider_uid, success: function(data) { if(data == true) { location.reload(); } } }); } function importOwnedTwitterLists() { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'livepages/importOwnedTwitterLists', success: function(data) { if(data == 'done') { //location.reload(); $.ajax({ url: jsbase_url+'livepages/displayList/0/owned', type: 'POST', data: params, success: function( response ) { //After import make owned as default tab $( "#tabsTwtLists ul > li > a" ).removeClass( "selected" ); $( "#tabsTwtLists ul > li > a" ).first().addClass( "selected" ); $('#fnc-livepages-container').empty().append( response ); $('#loading-tweets').hide(); } }); } } }); } function importListTweets(livepage_id) { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'posts/importListTweets/'+livepage_id, success: function(data) { if(data == 'done') { location.reload(); /* $.ajax({ url: jsbase_url+'livepages/displayList/0/owned', type: 'POST', data: params, success: function( response ) { //After import make owned as default tab $( "#tabsTwtLists ul > li > a" ).removeClass( "selected" ); $( "#tabsTwtLists ul > li > a" ).first().addClass( "selected" ); $('#fnc-livepages-container').empty().append( response ); $('#loading-tweets').hide(); } }); */ } } }); } function addToWhitelist(livepage_id, provider_uid) { $.ajax({ url: jsbase_url+'users/users_list/addToWhitelist/' + livepage_id + '/' + provider_uid, success: function(data) { if(data == true) { $("#removeFromWhitelist-"+provider_uid).css("display", "block"); $("#addToWhitelist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile added to Whitelist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function delFromWhitelist(provider_uid, disappear) { if(disappear != undefined) { $("#art-"+provider_uid).remove(); } $.ajax({ url: jsbase_url+'users/users_list/delFromWhitelist/' + provider_uid, success: function(data) { if(data == true) { $("#addToWhitelist-"+provider_uid).css("display", "block"); $("#removeFromWhitelist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile deleted from Whitelist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function updateWhitelist(provider_uid, disappear, counterId) { if(disappear == 1) { $("#art-"+provider_uid).remove(); var span = $("#"+counterId); span.html(parseInt(span.html()) - 1); } $.ajax({ url: jsbase_url+'users/users_list/updateWhitelist/' + provider_uid, success: function(data) { if(data == true) { $("#addToWhitelist-"+provider_uid).css("display", "block"); $("#removeFromWhitelist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile deleted from Whitelist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function addToBlacklist(livepage_id, provider_uid) { $.ajax({ url: jsbase_url+'users/users_list/addToBlacklist/' + livepage_id + '/' + provider_uid, success: function(data) { if(data == true) { $("#removeFromBlacklist-"+provider_uid).css("display", "block"); $("#addToBlacklist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile added to Blacklist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function delFromBlacklist(provider_uid, disappear) { if(disappear != undefined) { $("#art-"+provider_uid).remove(); } $.ajax({ url: jsbase_url+'users/users_list/delFromBlacklist/' + provider_uid, success: function(data) { if(data == true) { $("#addToBlacklist-"+provider_uid).css("display", "block"); $("#removeFromBlacklist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile deleted from Blacklist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function updateBlacklist(provider_uid, disappear, counterId) { if(disappear == 1) { $("#art-"+provider_uid).remove(); var span = $("#"+counterId); span.html(parseInt(span.html()) - 1); } $.ajax({ url: jsbase_url+'users/users_list/updateBlacklist/' + provider_uid, success: function(data) { if(data == true) { $("#addToBlacklist-"+provider_uid).css("display", "block"); $("#removeFromBlacklist-"+provider_uid).css("display", "none"); $('#successAlertMsg').delay(0).fadeIn('slow'); $('#successAlertMsg .successAlertMsgText').text("Profile deleted from Blacklist"); $('#successAlertMsg').delay(5000).fadeOut('slow'); } } }); } function displayTwitterListsOwned(provider_uid,twitter_list_id) { //var visible = $('#twitterlistTable-'+provider_uid).is(":visible"); //$("#twitterlistTable-"+provider_uid).slideToggle(); //if (visible === false){ //if($("#twitterlistTableDataBox").html() === ""){ $("#twitterlistTable-" + provider_uid + " ul").html(''); $('#loading-tweets-'+provider_uid).show(); $.ajax({ url: jsbase_url+'livepages/displayTwitterListsOwned/'+provider_uid+'/'+twitter_list_id, success: function(data) { if(data) { $("#twitterlistTable-" + provider_uid + " ul").html(data); $("#twitterlistTableDataBox").html(data); $('#loading-tweets-'+provider_uid).hide(); $('.loading-bar').hide(); } } }); /* }else{ $("#twitterlistTable-" + provider_uid + " ul").html($("#twitterlistTableDataBox").html()); } */ //} } $(document).on('click', 'ul.fnc-add-list-member > li > input[type=checkbox]', function(){ //alert($(this).data("listid")); //alert($(this).closest("article").attr('data-id')); var list_id = $(this).data("listid"); var user_id = $(this).closest("article").attr('data-id'); if ($(this).closest("article").attr('data-user_id') !== undefined) user_id = $(this).closest("article").attr('data-user_id'); var pageId = $(this).closest("article").attr('data-pageId'); var twitterUserName = $(this).closest("article").attr('data-twitterUserName'); var twitterUserScreenName = $(this).closest("article").attr('data-twitterUserScreenName'); var providerId = $(this).closest("article").attr('data-providerId'); var twtList = $(this).closest("article").attr('data-twtList'); var dis = $(this); if (!this.checked) { //alert('Unchecked'); $.ajax({ url: jsbase_url+'livepages/delTwitterListMember/' + list_id + '/' + user_id + '/' + pageId + '/' + twitterUserName + '/' + twitterUserScreenName + '/' + providerId + '/' + twtList, success: function(data) { if(data == true) { dis.siblings("span.twitter-list-msg").html(" (Member removed from this Twitter List)"); //$("#twitterlistTableDataBox").html("");//Should remove this line to avoid rate limit api error and if we are not showing checked checkbox on list reload } } }); }else{ //alert('Checked'); $.ajax({ url: jsbase_url+'livepages/createTwitterListSingleMember/' + list_id + '/' + user_id + '/' + pageId + '/' + twitterUserName + '/' + twitterUserScreenName + '/' + providerId + '/' + twtList, success: function(data) { if(data == true) { dis.siblings("span.twitter-list-msg").html(" (Member added to this Twitter List)"); //$("#twitterlistTableDataBox").html("");//Should remove this line to avoid rate limit api error and if we are not showing checked checkbox on list reload } } }); } }); function FetchTwitterMessages() { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'messages/private_messages/getDirectMessages', success: function(data) { $('#loading-tweets').hide(); location.reload(); } }); } function fetchMentionsTweets() { $('#loading-tweets').show(); $.ajax({ url: jsbase_url+'posts/getTwitterMentionsPosts', success: function(data) { $('#loading-tweets').hide(); location.reload(); } }); } function pinTweet(twitterPostId, livePageId) { $.ajax({ url: jsbase_url+"livepages/pinTweet/"+twitterPostId+'/'+livePageId, success: function(result){ if(result){ $("
Your tweet has been pinned! Please refresh your tab.
").prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); } } }); } function unpinTweet(livePageId) { $.ajax({ url: jsbase_url+"livepages/unpinTweet/"+livePageId, success: function(result){ if(result){ $("
Your tweet has been unpinned! Please refresh your tab.
").prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); } } }); } function followAndUnfollowCsvfileAccounts() { $('#loading-tweets').show(); var data = new FormData($('#twitterCommunityForm')[0]); $.ajax({ type: "POST", url: jsbase_url+'followers/followAndUnfollowCsvfileAccounts', data:data, processData: false, contentType:false, success: function(data) { if(data == true) { $('#loading-tweets').hide(); $("#csvfile").val(""); $("
Your file has been imported successfully.
").prependTo('body').hide().slideDown('fast').delay(5000).fadeOut(1000, function() { $('.bs-example').remove(); }); } else { $('#loading-tweets').hide(); $("#csvfile").val(""); alert("Please upload .csv file"); } } }); } function tagAnalytics(tag, tab) { $('#loading-tagAnalytics').show(); //$('#barchart').html(''); $('#container').html(''); $('#container').append(''); $.ajax({ url: jsbase_url+'livepages/livepage/tagAnalyticsGraph/'+tag+'/'+tab, success: function(result) { var result2 = JSON.parse(result); var tagCounts = JSON.parse("[" + result2.counts + "]"); var tagDates = JSON.parse("[" + result2.dates + "]"); var color = Chart.helpers.color; var barChartData = { labels: tagDates, datasets: [{ label: 'Date wise data', backgroundColor: color(window.chartColors.red).alpha(0.5).rgbString(), borderColor: window.chartColors.red, borderWidth: 1, data: tagCounts }] }; var ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx, { type: 'bar', data: barChartData, options: { responsive: true, legend: { position: 'top', }, title: { display: false, text: 'Chart.js Bar Chart' } } }); $('#loading-tagAnalytics').hide(); } }); }