diff --git a/module/integration/css/create.css b/module/integration/css/create.css index acd32fac18..3f41118252 100644 --- a/module/integration/css/create.css +++ b/module/integration/css/create.css @@ -1,7 +1,2 @@ -.row.text-with-input .col { - line-height: 32px; -} - -.only-pick-time thead th, .only-pick-time tfoot th { - color: transparent !important; -} +.row.text-with-input .col{line-height: 32px;} +.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;} diff --git a/module/integration/css/edit.css b/module/integration/css/edit.css index acd32fac18..88df220e48 100644 --- a/module/integration/css/edit.css +++ b/module/integration/css/edit.css @@ -1,7 +1,2 @@ -.row.text-with-input .col { - line-height: 32px; -} - -.only-pick-time thead th, .only-pick-time tfoot th { - color: transparent !important; -} +.row.text-with-input .col {line-height: 32px;} +.only-pick-time thead th, .only-pick-time tfoot th {color: transparent !important;} diff --git a/module/integration/js/create.js b/module/integration/js/create.js index 23d8f2b937..81467fb498 100644 --- a/module/integration/js/create.js +++ b/module/integration/js/create.js @@ -61,14 +61,9 @@ $(document).on('change', '#svnFolder', function() }) }) -$(function() -{ - $('#repo').change(); - triggerTypeChanged(triggerType); -}); - -function triggerTypeChanged(type) +$('#triggerType').change(function() { + var type = $(this).val(); if(type == 'tag') { $('.tag-fields').removeClass('hidden'); @@ -92,7 +87,13 @@ function triggerTypeChanged(type) var val = $("input[name='scheduleType']:checked").val(); scheduleTypeChanged(val ? val : 'custom'); } -} +}); + +$(function() +{ + $('#repo').change(); + $('#triggerType').change(); +}); function scheduleTypeChanged(type) { diff --git a/module/integration/js/edit.js b/module/integration/js/edit.js index 8794917787..4508e54151 100644 --- a/module/integration/js/edit.js +++ b/module/integration/js/edit.js @@ -63,56 +63,65 @@ $(document).on('change', '#svnFolder', function() }) }) -$(function() +$('#triggerType').change(function() { - $('#repo').change(); - triggerTypeChanged(triggerType); -}); - -function execJob(id) { - var link = createLink('integration', 'exec', 'id=' + id); - $.ajax({ - type:"POST", - url: link, - data: {}, - datatype: "json", - success:function(str) - { - $('.exe-job-button').tooltip('show', '发送执行请求成功!'); - } - }); -} - -function triggerTypeChanged(type) { - if(type == 'tag') { + var type = $(this).val(); + if(type == 'tag') + { $('.tag-fields').removeClass('hidden'); $('.comment-fields').addClass('hidden'); scheduleTypeChanged(); - } else if(type == 'commit') { + } + else if(type == 'commit') + { $('.tag-fields').addClass('hidden'); $('.comment-fields').removeClass('hidden'); - $('.custom-fields').addClass('hidden'); scheduleTypeChanged(); - } else if(type == 'schedule') { + } + else if(type == 'schedule') + { $('.tag-fields').addClass('hidden'); $('.comment-fields').addClass('hidden'); var val = $("input[name='scheduleType']:checked").val(); scheduleTypeChanged(val? val: 'custom'); } +}); + +$(function() +{ + $('#repo').change(); + $('#triggerType').change(); +}); + +function execJob(id) +{ + $.ajax( + { + type:"POST", + url: createLink('integration', 'exec', 'id=' + id), + data: {}, + datatype: "json", + success:function(data) + { + $('.exe-job-button').tooltip('show', sendExec); + } + }); } -function scheduleTypeChanged(type) { - if(type == 'custom') { +function scheduleTypeChanged(type) +{ + if(type == 'custom') + { $('.schedule-fields').removeClass('hidden'); - $('.custom-fields').removeClass('hidden'); - } else { + } + else + { $('.schedule-fields').addClass('hidden'); - $('.custom-fields').addClass('hidden'); } } diff --git a/module/integration/lang/zh-cn.php b/module/integration/lang/zh-cn.php index 8195a9d6e0..8ad5e03d2e 100644 --- a/module/integration/lang/zh-cn.php +++ b/module/integration/lang/zh-cn.php @@ -30,6 +30,7 @@ $lang->integration->example = '举例'; $lang->integration->tagEx = 'build_#15,其中15为Jenkins任务编号'; $lang->integration->commitEx = 'start build #15,其中15为Jenkins任务编号'; $lang->integration->cronSample = '如 0 0 2 * * 2-6/1 表示每个工作日凌晨2点'; +$lang->integration->sendExec = '发送执行请求成功!'; $lang->integration->dayTypeList['workDay'] = '工作日'; $lang->integration->dayTypeList['everyDay'] = '每天'; diff --git a/module/integration/view/create.html.php b/module/integration/view/create.html.php index 8df29c404d..d0b5179ae1 100644 --- a/module/integration/view/create.html.php +++ b/module/integration/view/create.html.php @@ -42,7 +42,7 @@