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/js/ drwxr-xr-x |
Viewing file: Select action/file-type: function debounce(func, wait, immediate) { var timeout; return function() { var context = this, args = arguments; var later = function() { timeout = null; if (!immediate) func.apply(context, args); }; var callNow = immediate && !timeout; clearTimeout(timeout); timeout = setTimeout(later, wait); if (callNow) func.apply(context, args); }; }; function guid() { function s4() { return Math.floor((1 + Math.random()) * 0x10000) .toString(16) .substring(1); } return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4(); } window.Cookies = { set: function (name, value, days, path) { if (days) { var date = new Date(); date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); var expires = "; expires=" + date.toGMTString(); } else var expires = ""; var dir = path || '/'; document.cookie = name + "=" + value + expires + "; path=" + dir; }, get: function (name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); } return null; }, delete: function (name) { this.set(name, "", -1); } } var ec; var Uid = { uid : null, get : function() { return ec.get("uid") || Cookies.get('uid'); // прочитать var u1 = Cookies.get('uid'); var u2 = localStorage.getItem('uid'); if (u1 != u2 && u2 != null) this.set(u2); return u2; }, set : function(uid) { Cookies.set('uid', uid,2000); ec.set("uid", uid); // установить return; Cookies.set('uid', uid, 2000); localStorage.setItem('uid', uid); } } $(document).ready(function() { ec = new evercookie({java : false, silverlight : false, history : false}); $(document).ready(function(){ $('.collapsible').collapsible({ accordion : false }); }); $(window).load(debounce(function(){ $('input:-webkit-autofill').each(function(){ if ($(this).val().length !== "") { $(this).siblings('label, i').addClass('active'); } }); },0)); ec.get('uid', function(value) { if (typeof value == 'undefined' || value == null) { var uid = guid(); console.log(uid); Cookies.set('uid', uid,2000); ec.set('uid', uid); } }); $(".button-collapse").sideNav(); var $regform = $("#reg-form"); $regform.find("#agreement").on('change', function() { if ($(this).prop('checked')) $regform.find("#register-button").removeClass('disabled'); else $regform.find("#register-button").addClass('disabled'); }); $regform.find("#password2").on('change', function() { var $p1 = $regform.find("#password2"); var $p2 = $regform.find("#password1"); if ($p1.val() != $p2.val()) document.getElementById('password2').setCustomValidity("Passwords Don't Match"); else document.getElementById('password2').setCustomValidity(""); }); $regform.find("input").on('change, blur', function() { if (!this.checkValidity()) document.getElementById('password2').setCustomValidity("Passwords Don't Match"); else document.getElementById('password2').setCustomValidity(""); }); $regform.find("#register-button").on('click', function() { if ($regform[0].checkValidity() == false) { Materialize.toast('Помилка. Перевірте ще раз правильність введених даних', 4000); return; } var formData = $regform.serialize(); $.post('/users/register/ajax', formData, function(data) { if (data.ok == true) location.href='/users/register/ok'; else Materialize.toast(data.error, 4000) },'json'); }); var $loginform = $("#login-form"); $loginform.on('submit', function() { return false; }); $loginform.find("#password").trigger('blur'); $loginform.find('#submit').on('click', function() { var formData = $loginform.serialize(); $.post('/users/login/ajax', formData, function(data) { if (data.ok == true) { var addr = '/'; var parser = document.createElement('a'); parser.href = $('#referer').val(); if (parser.host == location.host) addr = $('#referer').val(); location.href = addr; } else Materialize.toast(data.error, 4000) },'json'); }); var $petitionaddform = $("#petition-add-form"); $petitionaddform.find('#submit').on('click', function() { var formData = $petitionaddform.serialize(); $.post('/list/add/ajax', formData, function(data) { if (data.ok == true) location.href='/list/add/ok'; else Materialize.toast(data.error, 4000) },'json'); }); $("#sign:not(.disabled)").on('click', function() { var id = $(this).attr('number'); $.post('/list/sign/'+id, null, function(data) { if (data.ok) location.reload(); else Materialize.toast(data.error, 4000) },'json'); }); $("#edit").on('click', function() { var id = $(this).attr('number'); $.get('/list/edit/'+id, null, function(data) { $('#petition_theme').val(data.petition_theme).trigger('change'); $('#petition_number').val(data.petition_number).trigger('change'); $('#petition_text').val(data.petition_text).trigger('change').trigger('autoresize'); $('#edit-panel').openModal(); },'json'); }); $("#edit-answer").on('click', function() { var id = $(this).attr('number'); $.get('/list/answer/'+id, null, function(data) { $('#petition_answer_text').val(data.petition_answer_text).trigger('change').trigger('autoresize'); if (data.petition_status == 3) $("#publish").prop('checked', true); else $("#publish").prop('checked', false); $('#answer-panel').openModal(); },'json'); }); $(".petition-delete-confirm-button").on('click', function() { $("#yes-no-panel").openModal(); }); $("#petition-delete-button").on('click', function() { var id = $(this).attr('number'); if ($('#sendmessage').prop('checked') && $('#petition_reject_message').val().length < 10) { Materialize.toast('Потрібно вказати причину видалення петиції.', 4000); return false; } $.post('/list/delete/'+id, {'text' : $('#petition_reject_message').val(), 'sendmail' : $('#sendmessage').prop('checked')}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $("#yes-no-panel").closeModal(); $('#edit-panel').closeModal(); location.reload(); } },'json'); }); $("#restore-petition-button").on('click', function() { var id = $(this).attr('number'); $.post('/list/restore/'+id, {}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $('#edit-panel').closeModal(); location.reload(); } },'json'); }); $("#petition-answer-save").on('click', function() { var id = $(this).attr('number'); $.post('/list/answer/'+id, {'publish' : $("#publish").prop('checked'),'petition_answer_text' : $('#petition_answer_text').val()}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $('#answer-panel').closeModal(); location.reload(); } },'json'); }); $("#petition-edit-save").on('click', function() { var id = $(this).attr('number'); $.post('/list/edit/'+id, {'petition_number' : $('#petition_number').val(), 'petition_theme' : $('#petition_theme').val(), 'petition_text' : $('#petition_text').val()}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $('#edit-panel').closeModal(); location.reload(); } },'json'); }); $("#resend-button").on('click', function() { $('#resend-panel').openModal(); return false; }); $("#resend-button-send").on('click', function() { $.post('/users/resend/'+ $('#resend_email').val(), {}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $('#resend-panel').closeModal(); } },'json'); }); $("#restore-button").on('click', function() { $('#restore-panel').openModal(); }); $("#restore-button-send").on('click', function() { $.post('/users/restore', {'user_email' : $('#restore_email').val()}, function(data) { Materialize.toast(data.message, 4000); if (data.ok) { $('#restore-panel').closeModal(); } },'json'); }); var myCircle = Circles.create({ id: 'diagram', radius: 60, value: $('#diagram').attr('value'), maxValue: 100, width: 10, text: function(value){return value + '%';}, colors: ['#D3B6C6', '#4B253A'], duration: 400, wrpClass: 'circles-wrp', textClass: 'circles-text', valueStrokeClass: 'circles-valueStroke', maxValueStrokeClass: 'circles-maxValueStroke', styleWrapper: true, styleText: true }); $('select:not(.notmaterial)').material_select(); var $restoreform = $("#restore-form"); $restoreform.find("#password2").on('change', function() { var $p1 = $restoreform.find("#password2"); var $p2 = $restoreform.find("#password1"); if ($p1.val() != $p2.val()) document.getElementById('password2').setCustomValidity("Passwords Don't Match"); else document.getElementById('password2').setCustomValidity(""); }); $restoreform.find("input").on('change, blur', function() { if (!$(this).checkValidity()) document.getElementById('password2').setCustomValidity("Passwords Don't Match"); else document.getElementById('password2').setCustomValidity(""); }); $restoreform.find("#restore-password-button").on('click', function() { if ($restoreform[0].checkValidity() == false) { Materialize.toast('Помилка. Перевірте ще раз правильність введених даних', 4000); return; } var formData = $restoreform.serialize(); $.post('/users/restore/ajax', formData, function(data) { Materialize.toast(data.message, 4000); if (data.ok == true) { setTimeout(function() { location.href = '/users/login'; },4000); } },'json'); }); $("ul.tabs").tabs(); $("#sort-petitions").on('change', function() { $("#sort" + $(this).val()).trigger('click'); }); $("ul.statuses.tabs a").on('click', function() { $(".status1, .status2, .status3, .status4, .status0").hide(0); $('.' + $(this).attr('st')).show(0); }); $("ul.statuses.tabs a.active").trigger('click'); }); |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0255 ]-- |