Skip to content

Instantly share code, notes, and snippets.

@oh-sky
Last active May 16, 2019 06:47
Show Gist options
  • Save oh-sky/d198724f2168b7f16932caae84b39391 to your computer and use it in GitHub Desktop.
Save oh-sky/d198724f2168b7f16932caae84b39391 to your computer and use it in GitHub Desktop.
ジョブカンの出退勤編集画面の入力をサポートするジャバスクリプト(bookmarklet)
void((function() {
var editJikoku = function (jikoku) {
return function () {
var inputForm = jQuery(this);
if (inputForm.parents('tr').css('background-color') != 'transparent') {
return;
}
if (inputForm.val() != jikoku) {
inputForm.val(jikoku);
inputForm.css('background-color', '#fcc');
inputForm.change();
}
};
};
var formTypeAndJikokus = [
{formType: 'start', jikoku:'10:00'},
{formType: 'end', jikoku:'19:00'},
{formType: 'rest', jikoku:'01:00'}
];
jQuery.each(formTypeAndJikokus, function(i, v) {
jQuery('div#editable_' + v.formType + ' input').each(editJikoku(v.jikoku));
});
})());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment