1//$(document).ready(function(){ 2// $('.startAdvocacyCampaign').on('click',function(){ 3// var contentItemId = $(this).data('content-item-id'); 4// if(contentItemId){ 5// getNewCampaignOptions(contentItemId); 6// } 7// }); 8//}); 9var advocacyLastPopUp = false; 10function getNewCampaignOptions(contentItemId, title, description) 11{ 12 if(!contentItemId){ 13 return; 14 } 15 16 $.ajax({ 17 url: SS.route('Advocacy', 'Advocacy', 'getNewCampaignOptions', ''), 18 cache: false, 19 type: 'POST', 20 data: { 21 contentItemId: contentItemId 22 }, 23 dataType : 'json', 24 abortOnRetry: false, 25 error : function(jqXHR, textStatus, errorThrown){ 26 showNewCampaignErrors(__d('advocacy','Error receiving server data.')); 27 }, 28 success : function(responseData, textStatus, jqXHR){ 29 if( responseData.success ){ 30 showNewCampaignOptions(responseData.promoteLinks, title, description); 31 }else{ 32 showNewCampaignErrors(responseData.errors); 33 } 34 } 35 }); 36} 37
38function showNewCampaignOptions(links, title, description) 39{ 40 if(!title){ 41 title = __d('advocacy','Start A Campaign'); 42 } 43 if(!description){ 44 description = __d('advocacy','Please choose the type of campaign you would like to start.'); 45 } 46 47 if(advocacyLastPopUp){ 48 advocacyLastPopUp.destroyAlert(); 49 advocacyLastPopUp = false; 50 } 51 52 var content = '<div class="description">'+description+'</div>'; 53 content += '<div class="pop-up-buttons">'; 54 $.each(links,function(index, link){ 55 var linkText = link.startCampaignTitle ? link.startCampaignTitle : link.name; 56 content += '<a href="'+link.url+'">'+linkText+'</a>'; 57 }); 58 content += '</div>'; 59 60 advocacyLastPopUp = new SS.customAlert({ 61 title: title, 62 msg: content, 63 cls: 'newCampaignOptions', 64 buttonAlign: 'center', 65 closeButton: true, 66 buttons: { 67 ok: false, 68 cancel: false 69 }, 70 callback: function( clickedButton ){ 71 advocacyLastPopUp.closeAlert(); 72 } 73 }); 74} 75 76function showNewCampaignErrors(errors) 77{ 78 if(advocacyLastPopUp){ 79 advocacyLastPopUp.destroyAlert(); 80 advocacyLastPopUp = false; 81 } 82 83 if($.type(errors) == 'array'){ 84 errors = errors.join('<br/>'); 85 } 86 87 advocacyLastPopUp = new SS.customAlert({ 88 title: __d('advocacy','Advocacy Error'), 89 msg: errors, 90 buttonAlign: 'center', 91 closeButton: true, 92 callback: function( clickedButton ){ 93 advocacyLastPopUp.closeAlert(); 94 } 95 }); 96}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.