You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
103 lines
3.1 KiB
103 lines
3.1 KiB
|
|
$('.input-group.date').datepicker({
|
|
todayBtn: false,
|
|
language: "ru",
|
|
orientation: "top auto",
|
|
keyboardNavigation: false,
|
|
autoclose: true,
|
|
toggleActive: true,
|
|
defaultViewDate: { year: 1990, month: 11, day: 18 }
|
|
});
|
|
|
|
function password_validate(obj){
|
|
if (check_password($(obj).val())){
|
|
$(obj).attr('class', 'alert-success');
|
|
} else {
|
|
$(obj).attr('class', 'alert-danger');
|
|
}
|
|
}
|
|
$('[name$="password"]').on('input', function(){
|
|
password_validate(this)
|
|
});
|
|
$('[name$="password1"]').on('input', function(){
|
|
password_validate(this)
|
|
});
|
|
$('[name="password2"]').on('input', function(){
|
|
check_password_compare()
|
|
});
|
|
$('[name="email"]').on('input', function(){
|
|
$(this).val($.trim($(this).val()));
|
|
if (check_email($(this).val())){
|
|
$(this).attr('class', 'alert-success');
|
|
} else {
|
|
$(this).attr('class', 'alert-danger');
|
|
}
|
|
});
|
|
$('[type="email"]').on('input', function(){
|
|
$(this).val($.trim($(this).val()));
|
|
if (check_email($(this).val())){
|
|
$(this).attr('class', 'alert-success');
|
|
} else {
|
|
$(this).attr('class', 'alert-danger');
|
|
}
|
|
});
|
|
function get_by_type_action_parent(block, attr){
|
|
var search = true;
|
|
while(search){
|
|
if (block.parent().attr(attr)){
|
|
search = false;
|
|
return block.parent();
|
|
} else {
|
|
block = block.parent()
|
|
}
|
|
}
|
|
}
|
|
$( document.body ).on( "click", "[by_type]", function( event ) {
|
|
var element_action = $(event.target);
|
|
if (!element_action.attr('by_type')){
|
|
element_action = get_by_type_action_parent(element_action, 'by_type');
|
|
}
|
|
var text = element_action.html();
|
|
var border = element_action.css('border-bottom');
|
|
element_action.html('<img src="/static/img/ui-anim_basic_16x16.gif" style="margin-top:-5px;margin-right:5px;"> Получение доступа');
|
|
|
|
if (!check_access(element_action.attr('by_type'), element_action.attr('self_id'))){
|
|
event.preventDefault();
|
|
element_action.html(text);
|
|
element_action.css('border-bottom', border);
|
|
open_service_request_window(element_action.attr('course_id'))
|
|
} else if (!check_jaccess(element_action.attr('by_type'), element_action.attr('self_id'))){
|
|
event.preventDefault();
|
|
element_action.html(text);
|
|
element_action.css('border-bottom', border);
|
|
open_journal_request_window()
|
|
} else if (!check_block(element_action.attr('by_type'), element_action.attr('self_id'))) {
|
|
event.preventDefault();
|
|
element_action.html(text);
|
|
element_action.css('border-bottom', border);
|
|
open_block_request_window()
|
|
}
|
|
});
|
|
|
|
window.achievement_in_work=false;
|
|
$(function() {
|
|
$("a#single_image").fancybox();
|
|
setInterval(function(){
|
|
if(!window.achievement_in_work){
|
|
check_ahievements()
|
|
}
|
|
}
|
|
, 5000);
|
|
});
|
|
function NotEmpty(obj) {
|
|
// Проверка объекта на пустоту
|
|
for (var key in obj){
|
|
if (key) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
$('.material').click(function() {
|
|
$(this).toggleClass('full');
|
|
});
|
|
|