1$(document).ready(function() { 2 $('body').on('submit', '.form--actor', function(e) { 3 e.preventDefault(); 4 5 if (!saving) { 6 if ($('.form--actor input[name=gender]').val() === '') { 7 noty = new Noty({ 8 text: "Man / vrouw is verplicht.", 9 theme: "nest", 10 type: "error", 11 closeWith: ['click', 'button'], 12 killer: true 13 }).show(); 14 } else { 15 $(this).ajaxSubmit({ 16 url: templateDir + "/services/actors/services/save_account.php", 17 dataType: 'JSON', 18 beforeSubmit: function(formData, formObject, formOptions) { 19 $(".form--actor :input").prop("disabled", true); 20 $(".form--actor button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 21 saving = true; 22 }, 23 success: function(res) { 24 $(".form--actor :input").prop("disabled", false); 25 $(".form--actor button[type=submit]").removeClass('button--withIcon').find('i').remove(); 26 saving = false; 27 28 if (res.errors) { 29 let errors = "<ul>"; 30 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 31 errors += "</ul>"; 32 33 noty = new Noty({ 34 text: errors, 35 theme: "nest", 36 type: "error", 37 closeWith: ['click', 'button'], 38 killer: true 39 }).show(); 40 } else { 41 noty = new Noty({ 42 text: "Accountgegevens zijn opgeslagen.", 43 theme: "nest", 44 type: "success", 45 closeWith: ['click', 'button'], 46 killer: true, 47 timeout: 3000 48 }).show(); 49 50 if (res.own) { 51 $('.header .profile_menu_link a font').html(res.firstname); 52 } 53 } 54 }, 55 error: function() { 56 $(".form--actor :input").prop("disabled", false); 57 $(".form--actor button[type=submit]").removeClass('button--withIcon').find('i').remove(); 58 saving = false; 59 60 noty = new Noty({ 61 text: "Er is iets fout gegaan.", 62 theme: "nest", 63 type: "error", 64 closeWith: ['click', 'button'], 65 killer: true 66 }).show(); 67 } 68 }); 69 } 70 } 71 }); 72 73 $('body').on('submit', '.form--password', function(e) { 74 e.preventDefault(); 75 76 if (!saving) { 77 let blacklistArray = ['black', 'listed', 'word']; 78 blacklistArray = blacklistArray.concat( wp.passwordStrength.userInputBlacklist() ) 79 var strength = wp.passwordStrength.meter($('.form--password input[name=new_password]').val(), blacklistArray, $('.form--password input[name=new_password_2]').val() ); 80 81 if (strength === 3 || strength === 4) { 82 $(this).ajaxSubmit({ 83 url: templateDir + "/services/actors/services/save_password.php", 84 dataType: 'JSON', 85 beforeSubmit: function(formData, formObject, formOptions) { 86 $(".form--password :input").prop("disabled", true); 87 $(".form--password button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 88 saving = true; 89 }, 90 success: function(res) { 91 $(".form--password :input").prop("disabled", false); 92 $(".form--password button[type=submit]").removeClass('button--withIcon').find('i').remove(); 93 saving = false; 94 95 if (res.errors && res.errors.length > 0) { 96 let errors = "<ul>"; 97 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 98 errors += "</ul>"; 99 100 noty = new Noty({ 101 text: errors, 102 theme: "nest", 103 type: "error", 104 closeWith: ['click', 'button'], 105 killer: true 106 }).show(); 107 } else if (res.done) { 108 showPopup($(".form--password").find('input[name=actorid]').val(),'password'); 109 110 noty = new Noty({ 111 text: "Je wachtwoord is aangepast.", 112 theme: "nest", 113 type: "success", 114 closeWith: ['click', 'button'], 115 killer: true, 116 timeout: 3000 117 }).show(); 118 } else { 119 noty = new Noty({ 120 text: "Er is iets fout gegaan.", 121 theme: "nest", 122 type: "error", 123 closeWith: ['click', 'button'], 124 killer: true 125 }).show(); 126 } 127 }, 128 error: function() { 129 $(".form--password :input").prop("disabled", false); 130 $(".form--password button[type=submit]").removeClass('button--withIcon').find('i').remove(); 131 saving = false;
132 133 noty = new Noty({ 134 text: "Er is iets fout gegaan.", 135 theme: "nest", 136 type: "error", 137 closeWith: ['click', 'button'], 138 killer: true 139 }).show(); 140 } 141 }); 142 } else { 143 noty = new Noty({ 144 text: 'Kies een beter wachtwoord.', 145 theme: "sunset", 146 type: "error", 147 closeWith: ['click', 'button'], 148 killer: true 149 }).show(); 150 } 151 } 152 }); 153 154 $('body').on('keyup','.form--password input[name=new_password]', function(event) { 155 checkPasswordStrength( 156 $('.form--password input[name=new_password]'), 157 $('.form--password input[name=new_password_2]'), 158 $('.form--password #password-strength'), 159 $('.form--password button[type=submit]'), 160 ['black', 'listed', 'word'] 161 ); 162 }); 163 164 $('body').on('submit', '.form--invoice', function(e) { 165 e.preventDefault(); 166 167 if (!saving) { 168 $(this).ajaxSubmit({ 169 url: templateDir + "/services/actors/services/save_invoice.php", 170 dataType: 'JSON', 171 beforeSubmit: function(formData, formObject, formOptions) { 172 $(".form--invoice :input").prop("disabled", true); 173 $(".form--invoice button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 174 saving = true; 175 }, 176 success: function(res) { 177 $(".form--invoice :input").prop("disabled", false); 178 $(".form--invoice button[type=submit]").removeClass('button--withIcon').find('i').remove(); 179 saving = false; 180 181 if (res.errors) { 182 let errors = "<ul>"; 183 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 184 errors += "</ul>"; 185 186 noty = new Noty({ 187 text: errors, 188 theme: "nest", 189 type: "error", 190 closeWith: ['click', 'button'], 191 killer: true 192 }).show(); 193 } else { 194 noty = new Noty({ 195 text: "Je facturatie gegevens zijn aangepast.", 196 theme: "nest", 197 type: "success", 198 closeWith: ['click', 'button'], 199 killer: true, 200 timeout: 3000 201 }).show(); 202 } 203 }, 204 error: function() { 205 $(".form--invoice :input").prop("disabled", false); 206 $(".form--invoice button[type=submit]").removeClass('button--withIcon').find('i').remove(); 207 saving = false; 208 209 noty = new Noty({ 210 text: "Er is iets fout gegaan.", 211 theme: "nest", 212 type: "error", 213 closeWith: ['click', 'button'], 214 killer: true 215 }).show(); 216 } 217 }); 218 } 219 }); 220 221 $('body').on('submit', '.form--actor_agent', function(e) { 222 e.preventDefault(); 223 224 if (!saving) { 225 $(this).ajaxSubmit({ 226 url: templateDir + "/services/actors/services/save_agent.php", 227 dataType: 'JSON', 228 beforeSubmit: function(formData, formObject, formOptions) { 229 $(".form--agent :input").prop("disabled", true); 230 $(".form--agent button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 231 saving = true; 232 }, 233 success: function(res) { 234 $(".form--agent :input").prop("disabled", false); 235 $(".form--agent button[type=submit]").removeClass('button--withIcon').find('i').remove(); 236 saving = false; 237 238 if (res.errors) { 239 let errors = "<ul>"; 240 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 241 errors += "</ul>"; 242 243 noty = new Noty({ 244 text: errors, 245 theme: "nest", 246 type: "error", 247 closeWith: ['click', 'button'], 248 killer: true 249 }).show(); 250 } else { 251 noty = new Noty({ 252 text: "Je agent is aangepast.", 253 theme: "nest", 254 type: "success", 255 closeWith: ['click', 'button'], 256 killer: true, 257 timeout: 3000 258 }).show(); 259 260 updateActorPage(); 261 } 262 }, 263 error: function() { 264 $(".form--agent :input").prop("disabled", false); 265 $(".form--agent button[type=submit]").removeClass('button--withIcon').find('i').remove(); 266 saving = false;
267 268 noty = new Noty({ 269 text: "Er is iets fout gegaan.", 270 theme: "nest", 271 type: "error", 272 closeWith: ['click', 'button'], 273 killer: true 274 }).show(); 275 } 276 }); 277 } 278 }); 279 280 $('body').on('submit', '.form--actor_topofmind', function(e) { 281 e.preventDefault(); 282 283 if (!saving) { 284 $(this).ajaxSubmit({ 285 url: templateDir + "/services/actors/services/save_topofmind.php", 286 dataType: 'JSON', 287 beforeSubmit: function(formData, formObject, formOptions) { 288 $(".form--actor_topofmind :input").prop("disabled", true); 289 $(".form--actor_topofmind button[type=submit]").addClass('button--withIcon').prepend('<i class="fas fa-spinner fa-spin"></i>'); 290 saving = true; 291 }, 292 success: function(res) { 293 $(".form--actor_topofmind :input").prop("disabled", false); 294 $(".form--actor_topofmind button[type=submit]").removeClass('button--withIcon').find('i').remove(); 295 saving = false; 296 297 if (res.errors) { 298 let errors = "<ul>"; 299 res.errors.map((error) => { errors += "<li>" + error + "</li>"; }); 300 errors += "</ul>"; 301 302 noty = new Noty({ 303 text: errors, 304 theme: "nest", 305 type: "error", 306 closeWith: ['click', 'button'], 307 killer: true 308 }).show(); 309 } else { 310 noty = new Noty({ 311 text: "De instelling is aangepast.", 312 theme: "nest", 313 type: "success", 314 closeWith: ['click', 'button'], 315 killer: true, 316 timeout: 3000 317 }).show(); 318 } 319 }, 320 error: function() { 321 $(".form--actor_topofmind :input").prop("disabled", false); 322 $(".form--actor_topofmind button[type=submit]").removeClass('button--withIcon').find('i').remove(); 323 saving = false; 324 325 noty = new Noty({ 326 text: "Er is iets fout gegaan.", 327 theme: "nest", 328 type: "error", 329 closeWith: ['click', 'button'], 330 killer: true 331 }).show(); 332 } 333 }); 334 } 335}); 336});
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.