1$(document).ready(function() { 2 $('body').on('submit', '.form--profile_picture', function(e) { 3 e.preventDefault(); 4 5 if (!saving) { 6 $(this).ajaxSubmit({ 7 url: templateDir + "/services/actors/services/save_profile_picture.php", 8 dataType: 'JSON', 9 beforeSubmit: function(formData, formObject, formOptions) { 10 if (noty !== '') noty.close(); 11 $(".form--profile_picture :input").prop("disabled", true); 12 $(".form--profile_picture button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 13 saving = true; 14 }, 15 uploadProgress: function(event, position, total, percentComplete) {}, 16 success: function(res) { 17 $(".form--profile_picture :input").prop("disabled", false); 18 $(".form--profile_picture button[type=submit]").removeClass('button--withIcon').find('i').remove(); 19 saving = false; 20 21 if (res.errors) { 22 let errors = "<ul>"; 23 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 24 errors += "</ul>"; 25 26 noty = new Noty({ 27 text: errors, 28 theme: "nest", 29 type: "error", 30 closeWith: ['click', 'button'], 31 killer: true 32 }).show(); 33 } else { 34 noty = new Noty({ 35 text: "De profielfoto is ingesteld.", 36 theme: "nest", 37 type: "success", 38 closeWith: ['click', 'button'], 39 timeout: 3500, 40 killer: true 41 }).show(); 42 43 $(".form--profile_picture .form_column--img_uploader input[name=file_url]").val(''); 44 45 if (res.own) { 46 $('.header .profile_menu_link a span').css('background-image','URL(' + res.img + '?v=' + Math.random() + ')'); 47 } 48 updateActorPage(); 49 } 50 }, 51 error: function() { 52 $(".form--profile_picture :input").prop("disabled", false); 53 $(".form--profile_picture button[type=submit]").removeClass('button--withIcon').find('i').remove(); 54 saving = false; 55 56 noty = new Noty({ 57 text: "Er is iets fout gegaan.", 58 theme: "nest", 59 type: "error", 60 closeWith: ['click', 'button'], 61 killer: true 62 }).show(); 63 64 // updateActorPage(); 65 } 66 }); 67 } 68 }); 69});
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.