', { 'class': 'edit-person-bg' })); $('.edit-person-bg').show(); if ($('.edit-person-popup').length == 0) $('body').append($('
', { 'class': 'edit-person-popup' })); $.ajax({ url: "/ajax/editperson?v=" + ISCommon.GetV(), data: { Id: Id }, cache: true, success: function (d) { $('.edit-person-popup').html(d.View); ISPersonEdit.EditShowInit(); ISPersonEdit.HistoryId = d.HistoryId; } }); }, EditShowInit: function () { if ($('.edit-person-form #Id').val() != '0') $('.edit-person-popup .heading .messages p').text('Корректировка записи в базе ПЕРСОНАЛИЙ'); else $('.edit-person-popup .heading .messages p').text('Новая запись в базе ПЕРСОНАЛИЙ'); var newWidth = ($("#container").width() < 1000) ? $("#container").width() : 1000; $('.edit-person-bg').css({ top: 0, height: $(document).outerHeight() }); $('.edit-person-popup').css({ top: $(window).scrollTop(), width: newWidth, marginLeft: 0 - (newWidth / 2) }); $('.edit-person-popup .heading a.close').unbind('click'); $('.edit-person-popup .heading a.close').click(function () { ISPersonEdit.EditHide(); return false; }); $(".edit-person-form select").not(".ex").chosen(); $(".edit-person-form #Text").ckeditor({ height: 180, width: 723, toolbar: [['Source', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'RemoveFormat', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList', 'Table'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink'], ["Maximize", "Image"]] }) .ckeditor(function () { ISPersonEdit.DataForForm = ISPersonEdit.GetDataFromForm(); $('.edit-person-popup').show(); }); $(".edit-person-form #Coach, .edit-person-form #Coachs").ckeditor({ height: 140, width: 723, toolbar: [['Source', 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', 'RemoveFormat', 'SpellChecker', 'Scayt', '-', 'NumberedList', 'BulletedList', 'Table'], ['JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'], ['Link', 'Unlink'], ["Maximize", "Image"]] }).ckeditor(function () { ISPersonEdit.DataForForm = ISPersonEdit.GetDataFromForm(); $('.edit-person-popup').show(); }); $(".edit-person-form #BirthDate") .datepicker({ addClass: 'edit-person', language: "ru", format: "dd.mm.yyyy" }) .on('changeDate', function (ev) { var BirthDate = new Date(ev.date); $('#BirthYear').val(BirthDate.getFullYear().toString()).trigger("liszt:updated"); }).data('datepicker'); $(".datepicker.datepicker-edit-person .datepicker-days th.prev").html('‹'); $(".datepicker.datepicker-edit-person .datepicker-days th.next").html('›'); $('.edit-person-form .form-actions a.button').unbind('click'); $('.edit-person-form .form-actions a.button').click(function () { ISPersonEdit.Save(); return false; }); $(".edit-person-form .control-group.upload-photo #fileupload").unbind('change'); $(".edit-person-form .control-group.upload-photo #fileupload").change(function () { $('.edit-person-form').ajaxSubmit({ url: '/ajax/uploadperson?v=' + ISCommon.GetV(), success: function (d) { if ('yes' == d.Result) { $(".edit-person-form .control-group.upload-photo .messages").text(''); $('.control-group.upload-photo #Photo').val(d.FileNameGuid); $('.control-group.upload-photo #FileName').val(d.FileName); $(".control-group.upload-photo .controls.image").html('
'); } else if (d.Message != null && d.Message != '') $(".edit-person-form .control-group.upload-photo .messages").text(d.Message); } }); }); $('.edit-person-form #SportsIdsList').unbind('change'); $('.edit-person-form #SportsIdsList').change(function () { if ($(this).val()) { $.ajax({ url: "/ajax/filteredbysports?v=" + ISCommon.GetV(), data: { filter: JSON.stringify($(this).val()) }, success: function (d) { var selected = $("#DisciplinesIdsList").val(); $("#DisciplinesIdsList").empty(); $.each(d, function () { if ($.inArray(this.Id.toString(), selected) > -1) $("#DisciplinesIdsList").append($("