1// For all hopscotch related actions. 2var hlpOpt = {}; 3$(document).ready(function() { 4 $('#help-box-list').hide(); 5 loadNeedHelpItems(); 6 7 function init(scroll){ 8 removeHelp(); 9 if(scroll) scrollTo(scroll); 10 $.cookie("help", JSON.stringify(hlpOpt)); 11 loadTour(); 12 startHelpMeTour(0, true, 1); 13 $('#help-box-list').hide(); 14 } 15 // Beneficiary tour action 16 $('#beneficiariesStart').on('mouseup', function(event){ 17 if(event.which == 1){ 18 hlpOpt.tourFor = "beneficiaries"; 19 init("beneficiaries"); 20 } 21 }); 22 $('#beneficiaries').on('mouseup', function(event){ 23 if(event.which == 1){ 24 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && (JSON.parse($.cookie("help")).tourFor === "beneficiaries" || JSON.parse($.cookie("help")).tourFor === "domesticBeneficiary") ){ 25 let checkExist = setInterval(function() { 26 if($('#addEditBeneficiaryLabel').length){ 27 clearInterval(checkExist); 28 document.addEventListener('click', clickEvent, false); 29 startHelpMeTour(1, true, 500); 30 } 31 }, 100); 32 } 33 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "editBeneficiary" ){ 34 let checkExist = setInterval(function() { 35 $('[title$="Edit Beneficiary"]').attr('id', 'edit_beneficiary'); 36 if($('#edit_beneficiary').length > 0){ 37 clearInterval(checkExist); 38 document.addEventListener('click', clickEvent, false); 39 startHelpMeTour(1, true); 40 } 41 }, 500); 42 } 43 } 44 }); 45 46 // New Payment tour action 47 $('#newpaymentStart').on('mouseup', function(event){ 48 if(event.which == 1){ 49 hlpOpt.tourFor = "newpayment"; 50 init("payments"); 51 } 52 }); 53 $('#payments').on('mouseup', function(event){ 54 if(event.which == 1){ 55 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "newpayment"){ 56 let checkExist = setInterval(function() { 57 $('[ui-sref$="home.makePayment.makeAPayment"]').attr('id', 'new_payment'); 58 if($('#new_payment').length){ 59 clearInterval(checkExist); 60 document.addEventListener('click', clickEvent, false); 61 startHelpMeTour(1, true, 100); 62 } 63 }, 100); 64 } 65 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "managePayments"){ 66 let checkExist = setInterval(function() { 67 $("h3:contains(PENDING APPROVAL)").parent().attr('id', 'mng_pymntInprogress'); 68 $("h3:contains(Scheduled Payments)").parent().attr('id', 'mng_pymntScheduledPayments'); 69 $("h3:contains(Recent Payments)").parent().attr('id', 'mng_pymntRecentPaymentss'); 70 if($('#mng_pymntInprogress').length){ 71 clearInterval(checkExist); 72 startHelpMeTour(1, true, 100); 73 } 74 }, 100); 75 } 76 } 77 }); 78 79 // Add New User 80 $('#addnewuserStart').on('mouseup', function(event){ 81 if(event.which == 1){ 82 hlpOpt.tourFor = "addnewuser"; 83 init("users"); 84 } 85 }); 86 $('#users').on('mouseup', function(event){ 87 if(event.which == 1){ 88 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "addnewuser"){ 89 let checkExist = setInterval(function() { 90 $('[ui-sref$="home.admin.addUser"]').attr('id', 'addNewUser');
91 if($('#addNewUser').length){ 92 clearInterval(checkExist); 93 document.addEventListener('click', clickEvent, false); 94 startHelpMeTour(1, true, 1000); 95 } 96 }, 300); 97 } 98 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "editUser"){ 99 let checkExist = setInterval(function() { 100 if( $('#edit_user').length == 0 ) $("#responsive-tbl th:contains(Action)").attr('id', 'edit_user'); 101 //$('[title$="View User"]').attr('id', 'edit_user') 102 if($('#responsive-tbl').length > 0 && $('#edit_user').length > 0){ 103 clearInterval(checkExist); 104 document.addEventListener('click', clickEvent, false); 105 startHelpMeTour(1, true, 700); 106 } 107 }, 100); 108 } 109 } 110 }); 111 112 // Add Domestic Beneficiary 113 $('#domesticBeneficiaryStart').on('mouseup', function(event){ 114 if(event.which == 1){ 115 hlpOpt.tourFor = "domesticBeneficiary"; 116 init("beneficiaries"); 117 } 118 }); 119 120 // View Accounts and Activity 121 $('#viewAccountsActivitesStart').on('mouseup', function(event){ 122 if(event.which == 1){ 123 hlpOpt.tourFor = "viewAccountsActivites"; 124 init("accounts"); 125 } 126 }); 127 $('#accounts').on('mouseup', function(event){ 128 if(event.which == 1){ 129 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "viewAccountsActivites"){ 130 let checkExist = setInterval(function() { 131 $('.summary_outer div > .viewall_btn').attr('id', 'acc_view_all'); 132 if($('#acc_view_all').length){ 133 clearInterval(checkExist); 134 startHelpMeTour(1, true, 100); 135 } 136 }, 100); 137 } 138 } 139 }); 140 141 // Manage Payments 142 $('#managePaymentsStart').on('mouseup', function(event){ 143 if(event.which == 1){ 144 hlpOpt.tourFor = "managePayments"; 145 init("payments"); 146 } 147 }); 148 149 // USER PROFILE 150 $('#userProfileStart').on('mouseup', function(event){ 151 if(event.which == 1){ 152 hlpOpt.tourFor = "userProfile"; 153 init(); 154 } 155 }); 156 157 // SETTING 158 $('#settingsStart').on('mouseup', function(event){ 159 if(event.which == 1){ 160 hlpOpt.tourFor = "settings"; 161 init("settings"); 162 } 163 }); 164 $('#settings').on('mouseup', function(event){ 165 if(event.which == 1){ 166 if( ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "settings"){ 167 let checkExist = setInterval(function() { 168 $("h3:contains(Security Settings)").attr('id', 'security_settings'); 169 $("h3:contains(Invoice Settings)").attr('id', 'invoice_settings'); 170 $('#legalEntityForm .btn-primary').attr('id', 'settings_update_btn'); 171 if($('#security_settings').length){ 172 clearInterval(checkExist); 173 startHelpMeTour(1, true, 100); 174 } 175 }, 100); 176 } 177 } 178 }); 179 // Edit User 180 $('#editUserStart').on('mouseup', function(event){ 181 if(event.which == 1){ 182 hlpOpt.tourFor = "editUser"; 183 init("users"); 184 } 185 }); 186 // EDIT BENEFICIARY 187 $('#editBeneficiaryStart').on('mouseup',function(event){ 188 if(event.which == 1){ 189 hlpOpt.tourFor = "editBeneficiary"; 190 init("beneficiaries"); 191 } 192 }); 193 194 function scrollTo(eleId){ 195 if(eleId)document.getElementById(eleId).scrollIntoView(); 196 } 197 198 $('#move-help-me-icon').click(function(){ 199 $('#searchForHelpmeItem').val(''); 200 $("#helpme-box a").filter(function() { 201 $(this).toggle($(this).text().toLowerCase().indexOf('') > -1) 202 }); 203 $('#help-box-list').show(); 204 }); 205 $('#close-help-box').click(function(){ 206 $('#help-box-list').hide(); 207 }); 208 // search for help me item 209 $('#searchForHelpmeItem').on("keyup", function(){ 210 let searchVal = $('#searchForHelpmeItem').val().toLowerCase(); 211 $("#helpme-box a").filter(function() { 212 $(this).toggle($(this).text().toLowerCase().indexOf(searchVal) > -1) 213 }); 214 }); 215 216 // Documnets for help me item 217 $('#documentsStart').on("mouseup", function(event){ 218 if(event.which == 1){ 219 if( window.location.hash.search("documents") != -1 && $('[class=list-group-item]').parent().hasClass('active') ){ 220 addDocumentsIds(); 221 hlpOpt.tourFor = "documents"; 222 $.cookie("help", JSON.stringify(hlpOpt)); 223 loadTour(); 224 $('#help-box-list').hide(); 225 startHelpMeTour(getTargetIndex("docName"), true, 500); 226 }else{ 227 hlpOpt.tourFor = "documents"; 228 init("documents"); 229 } 230 } 231 }); 232 $('#documents').on("mouseup", function(event){ 233 if( event.which == 1 && ($.cookie("help") != null && JSON.parse($.cookie("help")) != null ) && JSON.parse($.cookie("help")).tourFor === "documents" ){ 234 let checkExist = setInterval(function() { 235 addDocumentsIds(); 236 if($('#docName').length){ 237 clearInterval(checkExist); 238 startHelpMeTour(1, true, 500); 239 } 240 }, 500); 241 } 242 }); 243 244 $('#BeneficiaryGrp').click(function(event){ 245 if(event.which == 1){ 246 if(!$('#BeneficiaryGrp').hasClass('collapsed')){ 247 $('#BeneficiaryGrp').find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); 248 }else{ 249 $('#BeneficiaryGrp').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); 250 } 251 } 252 }); 253 $('#PaymentsGrp').click(function(event){ 254 if(event.which == 1){ 255 if(!$('#PaymentsGrp').hasClass('collapsed')){ 256 $('#PaymentsGrp').find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); 257 }else{ 258 $('#PaymentsGrp').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); 259 } 260 } 261 }); 262 $('#UsersGrp').click(function(event){ 263 if(event.which == 1){ 264 if(!$('#UsersGrp').hasClass('collapsed')){ 265 $('#UsersGrp').find('i').removeClass('glyphicon-chevron-up').addClass('glyphicon-chevron-down'); 266 }else{ 267 $('#UsersGrp').find('i').removeClass('glyphicon-chevron-down').addClass('glyphicon-chevron-up'); 268 } 269 } 270 }); 271}); // End of Doc-Ready 272
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.