Last active
May 16, 2019 06:47
-
-
Save oh-sky/d198724f2168b7f16932caae84b39391 to your computer and use it in GitHub Desktop.
ジョブカンの出退勤編集画面の入力をサポートするジャバスクリプト(bookmarklet)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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