1"use strict"; 2 3(function ($) { 4 $(window).on('load', function () { 5 stm_lms_login(true); 6 }); 7})(jQuery); 8 9function stm_lms_login(redirect) { 10 var $ = jQuery; 11 $('.stm-lms-login:not(.loaded)').each(function () { 12 var $this = $(this); 13 $(this).addClass('loaded'); 14 var vue_obj = { 15 el: this, 16 data: function data() { 17 return { 18 vue_loaded: true, 19 loading: false, 20 login: '', 21 password: '', 22 remember: '', 23 message: '', 24 status: '', 25 site_key: '', 26 recaptcha: '', 27 captcha_error: '', 28 open_lost_password: false, 29 lost_password: '', 30 lost_password_process: '' 31 }; 32 }, 33 methods: { 34 logIn: function logIn() { 35 var vm = this; 36 vm.loading = true; 37 vm.message = ''; 38 var data = { 39 'user_login': vm.login, 40 'user_password': vm.password, 41 'remember': vm.remember 42 }; 43 44 if (vm.site_key && typeof grecaptcha !== 'undefined') { 45 grecaptcha.ready(function () { 46 grecaptcha.execute(vm.site_key, { 47 action: 'login' 48 }).then(function (token) { 49 data['recaptcha'] = token; 50 vm.processLogin(data); 51 }); 52 }); 53 } else { 54 vm.processLogin(data); 55 } 56 }, 57 processLogin: function processLogin(data) { 58 var vm = this; 59 vm.$http.post(stm_lms_ajaxurl + '?action=stm_lms_login&nonce=' + stm_lms_nonces['stm_lms_login'], data).then(function (response) { 60 vm.message = response.body['message']; 61 vm.status = response.body['status']; 62 vm.loading = false; 63 64 if (response.body['user_page']) { 65 if (redirect) { 66 window.location = response.body['user_page']; 67 } else { 68 location.reload(); 69 } 70 } 71 }); 72 }, 73 lostPassword: function lostPassword() { 74 var vm = this; 75 vm.lost_password_process = true; 76 vm.message = ''; 77 var data = { 78 'user_login': vm.lost_password 79 }; 80 this.$http.post(stm_lms_ajaxurl + '?action=stm_lms_lost_password&nonce=' + stm_lms_nonces['stm_lms_lost_password'], data).then(function (response) { 81 vm.message = response.body['message']; 82 vm.status = response.body['status']; 83 vm.lost_password_process = false; 84 }); 85 } 86 } 87 }; 88 new Vue(vue_obj); 89 }); 90}
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.