* Implement Ctrl+S or Command+S for save draft * rename * add Typecho.savePost * fix upload file size * add new uploader * replace new uploader * fix textarea change * fix preview * refactor post edit * fix issue * fix page edit --------- Co-authored-by: joyqi <joyqi@segmentfault.com> Co-authored-by: joyqi <magike.net@gmail.com>
33 lines
1006 B
PHP
33 lines
1006 B
PHP
<?php if(!defined('__TYPECHO_ADMIN__')) exit; ?>
|
|
<script>
|
|
(function () {
|
|
$(document).ready(function () {
|
|
var error = $('.typecho-option .error:first');
|
|
|
|
if (error.length > 0) {
|
|
$('html,body').scrollTop(error.parents('.typecho-option').offset().top);
|
|
}
|
|
|
|
$('.main form').submit(function () {
|
|
const self = $(this);
|
|
|
|
if (self.hasClass('submitting')) {
|
|
return false;
|
|
} else {
|
|
$('button[type=submit]', this).attr('disabled', 'disabled');
|
|
self.addClass('submitting');
|
|
}
|
|
}).on('submitted', function () {
|
|
$('button[type=submit]', this).removeAttr('disabled');
|
|
$(this).removeClass('submitting');
|
|
});
|
|
|
|
$('label input[type=text]').click(function (e) {
|
|
var check = $('#' + $(this).parents('label').attr('for'));
|
|
check.prop('checked', true);
|
|
return false;
|
|
});
|
|
});
|
|
})();
|
|
</script>
|