Skip to content

Instantly share code, notes, and snippets.

@ulysses4ever
Last active October 25, 2015 20:16
Show Gist options
  • Save ulysses4ever/de23b31f7683f5b430ce to your computer and use it in GitHub Desktop.
Save ulysses4ever/de23b31f7683f5b430ce to your computer and use it in GitHub Desktop.
Добавляем возможность подстановки пароля в форму логина СБРС мехмата ЮФУ
// ==UserScript==
// @name formAdder
// @description Добавляем возможность подстановки пароля в форму логина СБРС мехмата ЮФУ
// @author dummer <yadummer@gmail.com>, ulysses <ulysses4ever@gmail.com>
// @license MIT
// @version 1.3
// @include http://rating.mmcs.sfedu.ru/
// @include http://rating.mmcs.sfedu.ru/sign
// @include https://rating.mmcs.sfedu.ru/
// @include https://rating.mmcs.sfedu.ru/sign
// @include http://grade.sfedu.ru/
// @include http://grade.sfedu.ru/sign
// @include https://grade.sfedu.ru/
// @include https://grade.sfedu.ru/sign
// @grant none
// ==/UserScript==
// For recording your credential form should be submit, but it brokes up manual redirect after ajax request and make quite strange url. And that's why I check the value of password field and switch off submission only after recordind the credential.
isFirstUsage = false;
$(document).ready(function(){
if ( $('#password').val() == '' )
{
isFirstUsage = true;
}
});
form = $('<form id="Auth" action="" autocomplete="on"></form>');
$('.AuthForm').first().wrapInner(form);
// Some hacks for firefox.
$('<input type="submit" name="share_entry_form_submit" id="share_entry_form_submit"></input>').insertAfter("#signin_b");
$('#share_entry_form_submit').css('display', 'none');
$('#share_entry_form').submit(function() {
return true;
});
$(document).keypress(function(event){
if( event.keyCode==13 && !isFirstUsage)
{
event.preventDefault();
}
});
@ulysses4ever
Copy link
Author

Спасибо, @nolane! Я обновил опиание первого видео — оно актуально для пользователей Линукса — и добавил второе для пользователей Виндовса.

@artemkonenko
Copy link

Утащил в полноценный репозиторий на github.com.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment