Skip to content

Instantly share code, notes, and snippets.

@osk2
Last active February 6, 2018 03:08
Show Gist options
  • Save osk2/9cc1a0d97ee13f7b3a1153aa55366723 to your computer and use it in GitHub Desktop.
Save osk2/9cc1a0d97ee13f7b3a1153aa55366723 to your computer and use it in GitHub Desktop.
Auto apply Taishin activities
(function () {
var strings = {
id: '%E8%BA%AB%E5%88%86%E8%AD%89%E5%AD%97%E8%99%9F',
// id = "身分證字號"
tip: '%E5%97%A8%EF%BC%8C%E8%BC%B8%E5%85%A5%E5%BE%8C%E6%9C%83%E8%87%AA%E5%8B%95%E9%80%81%E5%87%BA%E5%93%A6%EF%BC%9A%EF%BC%89'
// tip = "嗨,輸入後會自動送出哦:)"
}
var id = prompt(decodeURIComponent(strings.id), 'A123456789');
if (id) {
$('#CustID').val(id);
$('.jqTransformCheckbox').addClass('jqTransformChecked');
$('input[name="EventIDs"]').prop('checked', true);
$('#checkCode').focus().bind('keyup', function () {
// Since Taishin uses jQuery 1.6 (no kidding), we can only use `bind()` here
if ($(this).val().length >= 6) {
checkInput();
}
});
$('.txt_05.pt5').after('<h3 style="color: red">' + decodeURIComponent(strings.tip) + '</h3>');
}
}());
@osk2
Copy link
Author

osk2 commented Jul 28, 2017

Minified version

!function(){var e={id:"%E8%BA%AB%E5%88%86%E8%AD%89%E5%AD%97%E8%99%9F",tip:"%E5%97%A8%EF%BC%8C%E8%BC%B8%E5%85%A5%E5%BE%8C%E6%9C%83%E8%87%AA%E5%8B%95%E9%80%81%E5%87%BA%E5%93%A6%EF%BC%9A%EF%BC%89"},E=prompt(decodeURIComponent(e.id),"A123456789");E&&($("#CustID").val(E),$(".jqTransformCheckbox").addClass("jqTransformChecked"),$('input[name="EventIDs"]').prop("checked",!0),$("#checkCode").focus().bind("keyup",function(){$(this).val().length>=6&&checkInput()}),$(".txt_05.pt5").after('<h3 style="color: red">'+decodeURIComponent(e.tip)+"</h3>"))}();

@osk2
Copy link
Author

osk2 commented Feb 6, 2018

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