Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ジョブカンの出退勤編集画面の入力をサポートするジャバスクリプト(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
You can’t perform that action at this time.