提交 | 用户 | 时间
|
e7c126
|
1 |
(function ($) { |
H |
2 |
// var resultsName = ""; |
|
3 |
var inputElement; |
|
4 |
var displayElement; |
|
5 |
$.fn.extend({ |
|
6 |
cronGen: function (options) { |
|
7 |
if (options == null) { |
|
8 |
options = {}; |
|
9 |
} |
|
10 |
options = $.extend({}, $.fn.cronGen.defaultOptions, options); |
|
11 |
//create top menu |
|
12 |
var cronContainer = $("<div/>", { id: "CronContainer", style: "display:none;width:300px;height:300px;" }); |
|
13 |
var mainDiv = $("<div/>", { id: "CronGenMainDiv", style: "width:410px;height:420px;" }); |
|
14 |
var topMenu = $("<ul/>", { "class": "nav nav-tabs", id: "CronGenTabs" }); |
|
15 |
$('<li/>', { 'class': 'active' }).html($('<a id="SecondlyTab" href="#Secondly">秒</a>')).appendTo(topMenu); |
|
16 |
$('<li/>').html($('<a id="MinutesTab" href="#Minutes">Minute</a>')).appendTo(topMenu); |
|
17 |
$('<li/>').html($('<a id="HourlyTab" href="#Hourly">Hour</a>')).appendTo(topMenu); |
|
18 |
$('<li/>').html($('<a id="DailyTab" href="#Daily">Day</a>')).appendTo(topMenu); |
|
19 |
$('<li/>').html($('<a id="MonthlyTab" href="#Monthly">Month</a>')).appendTo(topMenu); |
|
20 |
$('<li/>').html($('<a id="WeeklyTab" href="#Weekly">Week</a>')).appendTo(topMenu); |
|
21 |
$('<li/>').html($('<a id="YearlyTab" href="#Yearly">Year</a>')).appendTo(topMenu); |
|
22 |
$(topMenu).appendTo(mainDiv); |
|
23 |
|
|
24 |
//create what's inside the tabs |
|
25 |
var container = $("<div/>", { "class": "container-fluid", "style": "margin-top: 30px;margin-left: -14px;" }); |
|
26 |
var row = $("<div/>", { "class": "row-fluid" }); |
|
27 |
var span12 = $("<div/>", { "class": "span12" }); |
|
28 |
var tabContent = $("<div/>", { "class": "tab-content", "style": "border:0px; margin-top:-20px;" }); |
|
29 |
|
|
30 |
|
|
31 |
//creating the secondsTab |
|
32 |
var secondsTab = $("<div/>", { "class": "tab-pane active", id: "Secondly" }); |
|
33 |
var seconds1 = $("<div/>",{"class":"line"}); |
|
34 |
$("<input/>",{type : "radio", value : "1", name : "second"}).appendTo(seconds1); |
|
35 |
$(seconds1).append("Per second, allowed wildcard[, - * /]"); |
|
36 |
$(seconds1).appendTo(secondsTab); |
|
37 |
|
|
38 |
var seconds2 = $("<div/>",{"class":"line"}); |
|
39 |
$("<input/>",{type : "radio", value : "2", name : "second"}).appendTo(seconds2); |
|
40 |
$(seconds2).append("Cycle, from"); |
|
41 |
$("<input/>",{type : "text", id : "secondStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(seconds2); |
|
42 |
$(seconds2).append("-"); |
|
43 |
$("<input/>",{type : "text", id : "secondEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(seconds2); |
|
44 |
$(seconds2).append("second"); |
|
45 |
$(seconds2).appendTo(secondsTab); |
|
46 |
|
|
47 |
var seconds3 = $("<div/>",{"class":"line"}); |
|
48 |
$("<input/>",{type : "radio", value : "3", name : "second"}).appendTo(seconds3); |
|
49 |
$(seconds3).append("from"); |
|
50 |
$("<input/>",{type : "text", id : "secondStart_1", value : "0", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(seconds3); |
|
51 |
$(seconds3).append("seconds start, per"); |
|
52 |
$("<input/>",{type : "text", id : "secondEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(seconds3); |
|
53 |
$(seconds3).append("second execute once"); |
|
54 |
$(seconds3).appendTo(secondsTab); |
|
55 |
|
|
56 |
var seconds4 = $("<div/>",{"class":"line"}); |
|
57 |
$("<input/>",{type : "radio", value : "4", name : "second", id: "sencond_appoint"}).appendTo(seconds4); |
|
58 |
$(seconds4).append("specify"); |
|
59 |
$(seconds4).appendTo(secondsTab); |
|
60 |
|
|
61 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="0">00<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">01<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">02<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">03<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">04<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">05<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">06<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">07<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="8">08<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="9">09</div>'); |
|
62 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="10">10<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="11">11<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="12">12<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="13">13<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="14">14<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="15">15<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="16">16<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="17">17<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="18">18<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="19">19</div>'); |
|
63 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="20">20<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="21">21<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="22">22<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="23">23<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="24">24<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="25">25<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="26">26<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="27">27<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="28">28<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="29">29</div>'); |
|
64 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="30">30<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="31">31<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="32">32<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="33">33<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="34">34<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="35">35<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="36">36<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="37">37<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="38">38<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="39">39</div>'); |
|
65 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="40">40<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="41">41<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="42">42<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="43">43<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="44">44<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="45">45<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="46">46<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="47">47<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="48">48<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="49">49</div>'); |
|
66 |
$(secondsTab).append('<div class="imp secondList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="50">50<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="51">51<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="52">52<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="53">53<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="54">54<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="55">55<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="56">56<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="57">57<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="58">58<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="59">59</div>'); |
|
67 |
$("<input/>",{type : "hidden", id : "secondHidden"}).appendTo(secondsTab); |
|
68 |
$(secondsTab).appendTo(tabContent); |
|
69 |
|
|
70 |
//creating the minutesTab |
|
71 |
var minutesTab = $("<div/>", { "class": "tab-pane", id: "Minutes" }); |
|
72 |
|
|
73 |
var minutes1 = $("<div/>",{"class":"line"}); |
|
74 |
$("<input/>",{type : "radio", value : "1", name : "min"}).appendTo(minutes1); |
|
75 |
$(minutes1).append("Per minute, allowed wildcard[, - * /]"); |
|
76 |
$(minutes1).appendTo(minutesTab); |
|
77 |
|
|
78 |
var minutes2 = $("<div/>",{"class":"line"}); |
|
79 |
$("<input/>",{type : "radio", value : "2", name : "min"}).appendTo(minutes2); |
|
80 |
$(minutes2).append("Cycle, from"); |
|
81 |
$("<input/>",{type : "text", id : "minStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(minutes2); |
|
82 |
$(minutes2).append("-"); |
|
83 |
$("<input/>",{type : "text", id : "minEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(minutes2); |
|
84 |
$(minutes2).append("minute"); |
|
85 |
$(minutes2).appendTo(minutesTab); |
|
86 |
|
|
87 |
var minutes3 = $("<div/>",{"class":"line"}); |
|
88 |
$("<input/>",{type : "radio", value : "3", name : "min"}).appendTo(minutes3); |
|
89 |
$(minutes3).append("from"); |
|
90 |
$("<input/>",{type : "text", id : "minStart_1", value : "0", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(minutes3); |
|
91 |
$(minutes3).append("seconds start, per"); |
|
92 |
$("<input/>",{type : "text", id : "minEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(minutes3); |
|
93 |
$(minutes3).append("second execute once"); |
|
94 |
$(minutes3).appendTo(minutesTab); |
|
95 |
|
|
96 |
var minutes4 = $("<div/>",{"class":"line"}); |
|
97 |
$("<input/>",{type : "radio", value : "4", name : "min", id: "min_appoint"}).appendTo(minutes4); |
|
98 |
$(minutes4).append("specify"); |
|
99 |
$(minutes4).appendTo(minutesTab); |
|
100 |
|
|
101 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="0">00<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">01<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">02<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">03<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">04<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">05<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">06<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">07<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="8">08<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="9">09</div>'); |
|
102 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="10">10<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="11">11<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="12">12<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="13">13<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="14">14<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="15">15<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="16">16<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="17">17<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="18">18<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="19">19</div>'); |
|
103 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="20">20<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="21">21<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="22">22<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="23">23<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="24">24<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="25">25<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="26">26<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="27">27<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="28">28<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="29">29</div>'); |
|
104 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="30">30<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="31">31<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="32">32<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="33">33<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="34">34<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="35">35<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="36">36<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="37">37<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="38">38<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="39">39</div>'); |
|
105 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="40">40<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="41">41<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="42">42<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="43">43<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="44">44<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="45">45<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="46">46<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="47">47<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="48">48<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="49">49</div>'); |
|
106 |
$(minutesTab).append('<div class="imp minList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="50">50<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="51">51<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="52">52<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="53">53<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="54">54<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="55">55<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="56">56<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="57">57<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="58">58<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="59">59</div>'); |
|
107 |
$("<input/>",{type : "hidden", id : "minHidden"}).appendTo(minutesTab); |
|
108 |
$(minutesTab).appendTo(tabContent); |
|
109 |
|
|
110 |
//creating the hourlyTab |
|
111 |
var hourlyTab = $("<div/>", { "class": "tab-pane", id: "Hourly" }); |
|
112 |
|
|
113 |
var hourly1 = $("<div/>",{"class":"line"}); |
|
114 |
$("<input/>",{type : "radio", value : "1", name : "hour"}).appendTo(hourly1); |
|
115 |
$(hourly1).append("Per hour, allowed wildcard[, - * /]"); |
|
116 |
$(hourly1).appendTo(hourlyTab); |
|
117 |
|
|
118 |
var hourly2 = $("<div/>",{"class":"line"}); |
|
119 |
$("<input/>",{type : "radio", value : "2", name : "hour"}).appendTo(hourly2); |
|
120 |
$(hourly2).append("Cycle, from"); |
|
121 |
$("<input/>",{type : "text", id : "hourStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(hourly2); |
|
122 |
$(hourly2).append("-"); |
|
123 |
$("<input/>",{type : "text", id : "hourEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(hourly2); |
|
124 |
$(hourly2).append("hour"); |
|
125 |
$(hourly2).appendTo(hourlyTab); |
|
126 |
|
|
127 |
var hourly3 = $("<div/>",{"class":"line"}); |
|
128 |
$("<input/>",{type : "radio", value : "3", name : "hour"}).appendTo(hourly3); |
|
129 |
$(hourly3).append("from"); |
|
130 |
$("<input/>",{type : "text", id : "hourStart_1", value : "0", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(hourly3); |
|
131 |
$(hourly3).append("hour start, per"); |
|
132 |
$("<input/>",{type : "text", id : "hourEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(hourly3); |
|
133 |
$(hourly3).append("hour execute once"); |
|
134 |
$(hourly3).appendTo(hourlyTab); |
|
135 |
|
|
136 |
var hourly4 = $("<div/>",{"class":"line"}); |
|
137 |
$("<input/>",{type : "radio", value : "4", name : "hour", id: "hour_appoint"}).appendTo(hourly4); |
|
138 |
$(hourly4).append("specify"); |
|
139 |
$(hourly4).appendTo(hourlyTab); |
|
140 |
|
|
141 |
$(hourlyTab).append('<div class="imp hourList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="0">00<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">01<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">02<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">03<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">04<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">05</div>'); |
|
142 |
$(hourlyTab).append('<div class="imp hourList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">06<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">07<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="8">08<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="9">09<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="10">10<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="11">11</div>'); |
|
143 |
$(hourlyTab).append('<div class="imp hourList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="12">12<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="13">13<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="14">14<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="15">15<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="16">16<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="17">17</div>'); |
|
144 |
$(hourlyTab).append('<div class="imp hourList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="18">18<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="19">19<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="20">20<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="21">21<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="22">22<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="23">23</div>'); |
|
145 |
$("<input/>",{type : "hidden", id : "hourHidden"}).appendTo(hourlyTab); |
|
146 |
$(hourlyTab).appendTo(tabContent); |
|
147 |
|
|
148 |
|
|
149 |
//creating the dailyTab |
|
150 |
var dailyTab = $("<div/>", { "class": "tab-pane", id: "Daily" }); |
|
151 |
|
|
152 |
var daily1 = $("<div/>",{"class":"line"}); |
|
153 |
$("<input/>",{type : "radio", value : "1", name : "day"}).appendTo(daily1); |
|
154 |
$(daily1).append("Per day, allowed wildcard[, - * / L W]"); |
|
155 |
$(daily1).appendTo(dailyTab); |
|
156 |
|
|
157 |
var daily5 = $("<div/>",{"class":"line"}); |
|
158 |
$("<input/>",{type : "radio", value : "2", name : "day"}).appendTo(daily5); |
|
159 |
$(daily5).append("not specify"); |
|
160 |
$(daily5).appendTo(dailyTab); |
|
161 |
|
|
162 |
var daily2 = $("<div/>",{"class":"line"}); |
|
163 |
$("<input/>",{type : "radio", value : "3", name : "day"}).appendTo(daily2); |
|
164 |
$(daily2).append("Cycle, from"); |
|
165 |
$("<input/>",{type : "text", id : "dayStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(daily2); |
|
166 |
$(daily2).append("-"); |
|
167 |
$("<input/>",{type : "text", id : "dayEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(daily2); |
|
168 |
$(daily2).append("day"); |
|
169 |
$(daily2).appendTo(dailyTab); |
|
170 |
|
|
171 |
var daily3 = $("<div/>",{"class":"line"}); |
|
172 |
$("<input/>",{type : "radio", value : "4", name : "day"}).appendTo(daily3); |
|
173 |
$(daily3).append("from"); |
|
174 |
$("<input/>",{type : "text", id : "dayStart_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(daily3); |
|
175 |
$(daily3).append("day start, per"); |
|
176 |
$("<input/>",{type : "text", id : "dayEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(daily3); |
|
177 |
$(daily3).append("day execute once"); |
|
178 |
$(daily3).appendTo(dailyTab); |
|
179 |
|
|
180 |
var daily6 = $("<div/>",{"class":"line"}); |
|
181 |
$("<input/>",{type : "radio", value : "5", name : "day"}).appendTo(daily6); |
|
182 |
$(daily6).append("The most recent working day on the 1"); |
|
183 |
$("<input/>",{type : "text", id : "dayStart_2", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(daily6); |
|
184 |
$(daily6).append(" of each month"); |
|
185 |
$(daily6).appendTo(dailyTab); |
|
186 |
|
|
187 |
var daily7 = $("<div/>",{"class":"line"}); |
|
188 |
$("<input/>",{type : "radio", value : "6", name : "day"}).appendTo(daily7); |
|
189 |
$(daily7).append("The last day of the month"); |
|
190 |
$(daily7).appendTo(dailyTab); |
|
191 |
|
|
192 |
var daily4 = $("<div/>",{"class":"line"}); |
|
193 |
$("<input/>",{type : "radio", value : "7", name : "day", id: "day_appoint"}).appendTo(daily4); |
|
194 |
$(daily4).append("specify"); |
|
195 |
$(daily4).appendTo(dailyTab); |
|
196 |
|
|
197 |
$(dailyTab).append('<div class="imp dayList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">01<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">02<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">03<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">04<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">05<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">06<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">07<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="8">08<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="9">09<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="10">10</div>'); |
|
198 |
$(dailyTab).append('<div class="imp dayList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="11">11<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="12">12<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="13">13<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="14">14<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="15">15<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="16">16<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="17">17<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="18">18<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="19">19<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="20">20</div>'); |
|
199 |
$(dailyTab).append('<div class="imp dayList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="21">21<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="22">22<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="23">23<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="24">24<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="25">25<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="26">26<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="27">27<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="28">28<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="29">29<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="30">30</div>'); |
|
200 |
$(dailyTab).append('<div class="imp dayList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="31">31</div>'); |
|
201 |
$("<input/>",{type : "hidden", id : "dayHidden"}).appendTo(dailyTab); |
|
202 |
$(dailyTab).appendTo(tabContent); |
|
203 |
|
|
204 |
|
|
205 |
//creating the monthlyTab |
|
206 |
var monthlyTab = $("<div/>", { "class": "tab-pane", id: "Monthly" }); |
|
207 |
|
|
208 |
var monthly1 = $("<div/>",{"class":"line"}); |
|
209 |
$("<input/>",{type : "radio", value : "1", name : "month"}).appendTo(monthly1); |
|
210 |
$(monthly1).append("Per month, allowed wildcard[, - * /]"); |
|
211 |
$(monthly1).appendTo(monthlyTab); |
|
212 |
|
|
213 |
var monthly2 = $("<div/>",{"class":"line"}); |
|
214 |
$("<input/>",{type : "radio", value : "2", name : "month"}).appendTo(monthly2); |
|
215 |
$(monthly2).append("not specify"); |
|
216 |
$(monthly2).appendTo(monthlyTab); |
|
217 |
|
|
218 |
var monthly3 = $("<div/>",{"class":"line"}); |
|
219 |
$("<input/>",{type : "radio", value : "3", name : "month"}).appendTo(monthly3); |
|
220 |
$(monthly3).append("Cycle, from"); |
|
221 |
$("<input/>",{type : "text", id : "monthStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(monthly3); |
|
222 |
$(monthly3).append("-"); |
|
223 |
$("<input/>",{type : "text", id : "monthEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(monthly3); |
|
224 |
$(monthly3).append("month"); |
|
225 |
$(monthly3).appendTo(monthlyTab); |
|
226 |
|
|
227 |
var monthly4 = $("<div/>",{"class":"line"}); |
|
228 |
$("<input/>",{type : "radio", value : "4", name : "month"}).appendTo(monthly4); |
|
229 |
$(monthly4).append("Starting from "); |
|
230 |
$("<input/>",{type : "text", id : "monthStart_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(monthly4); |
|
231 |
$(monthly4).append("day, once every"); |
|
232 |
$("<input/>",{type : "text", id : "monthEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(monthly4); |
|
233 |
$(monthly4).append("month"); |
|
234 |
$(monthly4).appendTo(monthlyTab); |
|
235 |
|
|
236 |
var monthly5 = $("<div/>",{"class":"line"}); |
|
237 |
$("<input/>",{type : "radio", value : "5", name : "month", id: "month_appoint"}).appendTo(monthly5); |
|
238 |
$(monthly5).append("specify"); |
|
239 |
$(monthly5).appendTo(monthlyTab); |
|
240 |
|
|
241 |
$(monthlyTab).append('<div class="imp monthList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">01<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">02<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">03<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">04<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">05<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">06</div>'); |
|
242 |
$(monthlyTab).append('<div class="imp monthList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">07<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="8">08<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="9">09<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="10">10<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="11">11<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="12">12</div>'); |
|
243 |
$("<input/>",{type : "hidden", id : "monthHidden"}).appendTo(monthlyTab); |
|
244 |
$(monthlyTab).appendTo(tabContent); |
|
245 |
|
|
246 |
//creating the weeklyTab |
|
247 |
var weeklyTab = $("<div/>", { "class": "tab-pane", id: "Weekly" }); |
|
248 |
|
|
249 |
var weekly1 = $("<div/>",{"class":"line"}); |
|
250 |
$("<input/>",{type : "radio", value : "1", name : "week"}).appendTo(weekly1); |
|
251 |
$(weekly1).append("Per week, allowed wildcard[, - * / L #]"); |
|
252 |
$(weekly1).appendTo(weeklyTab); |
|
253 |
|
|
254 |
var weekly2 = $("<div/>",{"class":"line"}); |
|
255 |
$("<input/>",{type : "radio", value : "2", name : "week"}).appendTo(weekly2); |
|
256 |
$(weekly2).append("not specify"); |
|
257 |
$(weekly2).appendTo(weeklyTab); |
|
258 |
|
|
259 |
var weekly3 = $("<div/>",{"class":"line"}); |
|
260 |
$("<input/>",{type : "radio", value : "3", name : "week"}).appendTo(weekly3); |
|
261 |
$(weekly3).append("Cycle, from week"); |
|
262 |
$("<input/>",{type : "text", id : "weekStart_0", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(weekly3); |
|
263 |
$(weekly3).append("-"); |
|
264 |
$("<input/>",{type : "text", id : "weekEnd_0", value : "2", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(weekly3); |
|
265 |
$(weekly3).appendTo(weeklyTab); |
|
266 |
|
|
267 |
var weekly4 = $("<div/>",{"class":"line"}); |
|
268 |
$("<input/>",{type : "radio", value : "4", name : "week"}).appendTo(weekly4); |
|
269 |
$(weekly4).append("The"); |
|
270 |
$("<input/>",{type : "text", id : "weekStart_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(weekly4); |
|
271 |
$(weekly4).append("th week, and day "); |
|
272 |
$("<input/>",{type : "text", id : "weekEnd_1", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(weekly4); |
|
273 |
$(weekly4).appendTo(weeklyTab); |
|
274 |
|
|
275 |
var weekly5 = $("<div/>",{"class":"line"}); |
|
276 |
$("<input/>",{type : "radio", value : "5", name : "week"}).appendTo(weekly5); |
|
277 |
$(weekly5).append("Last week of the month"); |
|
278 |
$("<input/>",{type : "text", id : "weekStart_2", value : "1", style:"width:35px; height:20px; text-align: center; margin: 0 3px;"}).appendTo(weekly5); |
|
279 |
$(weekly5).appendTo(weeklyTab); |
|
280 |
|
|
281 |
var weekly6 = $("<div/>",{"class":"line"}); |
|
282 |
$("<input/>",{type : "radio", value : "6", name : "week", id: "week_appoint"}).appendTo(weekly6); |
|
283 |
$(weekly6).append("specify"); |
|
284 |
$(weekly6).appendTo(weeklyTab); |
|
285 |
|
|
286 |
$(weeklyTab).append('<div class="imp weekList"><input type="checkbox" disabled="disabled" style="margin-left: 5px" value="1">1<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="2">2<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="3">3<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="4">4<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="5">5<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="6">6<input type="checkbox" disabled="disabled" style="margin-left: 5px" value="7">7</div>'); |
|
287 |
|
|
288 |
$("<input/>",{type : "hidden", id : "weekHidden"}).appendTo(weeklyTab); |
|
289 |
$(weeklyTab).appendTo(tabContent); |
|
290 |
|
|
291 |
//creating the yearlyTab |
|
292 |
var yearlyTab = $("<div/>", { "class": "tab-pane", id: "Yearly" }); |
|
293 |
|
|
294 |
var yearly1 = $("<div/>",{"class":"line"}); |
|
295 |
$("<input/>",{type : "radio", value : "1", name : "year"}).appendTo(yearly1); |
|
296 |
$(yearly1).append("not specify allowed wildcard[, - * /] not required"); |
|
297 |
$(yearly1).appendTo(yearlyTab); |
|
298 |
|
|
299 |
var yearly3 = $("<div/>",{"class":"line"}); |
|
300 |
$("<input/>",{type : "radio", value : "2", name : "year"}).appendTo(yearly3); |
|
301 |
$(yearly3).append("Per year"); |
|
302 |
$(yearly3).appendTo(yearlyTab); |
|
303 |
|
|
304 |
var yearly2 = $("<div/>",{"class":"line"}); |
|
305 |
$("<input/>",{type : "radio", value : "3", name : "year"}).appendTo(yearly2); |
|
306 |
$(yearly2).append("Cycle, from "); |
|
307 |
$("<input/>",{type : "text", id : "yearStart_0", value : "2016", style:"width:45px; height:20px;"}).appendTo(yearly2); |
|
308 |
$(yearly2).append("-"); |
|
309 |
$("<input/>",{type : "text", id : "yearEnd_0", value : "2017", style:"width:45px; height:20px;"}).appendTo(yearly2); |
|
310 |
$(yearly2).append("year"); |
|
311 |
$(yearly2).appendTo(yearlyTab); |
|
312 |
$("<input/>",{type : "hidden", id : "yearHidden"}).appendTo(yearlyTab); |
|
313 |
$(yearlyTab).appendTo(tabContent); |
|
314 |
|
|
315 |
$(tabContent).appendTo(span12); |
|
316 |
|
|
317 |
//creating the button and results input |
|
318 |
// resultsName = $(this).prop("id"); |
|
319 |
// $(this).prop("name", resultsName); |
|
320 |
|
|
321 |
var runTime = '<br style="padding-top: 10px"><label>Recent Run Time: </label></br><textarea id="runTime" rows="6" style="width: 90%;resize: none;background: none;border: none;outline: none;" readonly = readonly></textarea></div>'; |
|
322 |
|
|
323 |
$(span12).appendTo(row); |
|
324 |
$(row).appendTo(container); |
|
325 |
$(container).appendTo(mainDiv); |
|
326 |
$(runTime).appendTo(mainDiv); |
|
327 |
$(cronContainer).append(mainDiv); |
|
328 |
|
|
329 |
var that = $(this); |
|
330 |
|
|
331 |
// Hide the original input |
|
332 |
that.hide(); |
|
333 |
|
|
334 |
// Replace the input with an input group |
|
335 |
var $g = $("<div>").addClass("input-group"); |
|
336 |
// Add an input |
|
337 |
var $i = $("<input>", { type: 'text', placeholder: 'cron expression...', name: 'cronGen_display' }).addClass("form-control").val($(that).val()); |
|
338 |
$i.appendTo($g); |
|
339 |
// Add the button |
|
340 |
var $b = $("<button class=\"btn btn-default\"><i class=\"fa fa-edit\"></i></button>"); |
|
341 |
// Put button inside span |
|
342 |
var $s = $("<span>").addClass("input-group-btn"); |
|
343 |
$b.appendTo($s); |
|
344 |
$s.appendTo($g); |
|
345 |
|
|
346 |
$(this).before($g); |
|
347 |
|
|
348 |
inputElement = that; |
|
349 |
displayElement = $i; |
|
350 |
|
|
351 |
$b.popover({ |
|
352 |
html: true, |
|
353 |
content: function () { |
|
354 |
return $(cronContainer).html(); |
|
355 |
}, |
|
356 |
template: '<div class="popover" style="max-width:500px !important; width:425px;left:-341.656px;"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>', |
|
357 |
sanitize:false, |
|
358 |
placement: options.direction |
|
359 |
|
|
360 |
}).on('click', function (e) { |
|
361 |
if (inputElement.val().trim() !== '') { |
|
362 |
refreshRunTime(); |
|
363 |
} |
|
364 |
e.preventDefault(); |
|
365 |
|
|
366 |
//fillDataOfMinutesAndHoursSelectOptions(); |
|
367 |
//fillDayWeekInMonth(); |
|
368 |
//fillInWeekDays(); |
|
369 |
//fillInMonths(); |
|
370 |
|
|
371 |
$.fn.cronGen.tools.cronParse(inputElement.val()); |
|
372 |
|
|
373 |
//绑定指定事件 |
|
374 |
$.fn.cronGen.tools.initChangeEvent(); |
|
375 |
|
|
376 |
|
|
377 |
$('#CronGenTabs a').click(function (e) { |
|
378 |
e.preventDefault(); |
|
379 |
$(this).tab('show'); |
|
380 |
//generate(); |
|
381 |
}); |
|
382 |
$("#CronGenMainDiv select,input").change(function (e) { |
|
383 |
generate(); |
|
384 |
refreshRunTime(); |
|
385 |
}); |
|
386 |
$("#CronGenMainDiv input").focus(function (e) { |
|
387 |
generate(); |
|
388 |
}); |
|
389 |
//generate(); |
|
390 |
}); |
|
391 |
return; |
|
392 |
} |
|
393 |
}); |
|
394 |
|
|
395 |
|
|
396 |
var fillInMonths = function () { |
|
397 |
var days = [ |
|
398 |
{ text: "January", val: "1" }, |
|
399 |
{ text: "February", val: "2" }, |
|
400 |
{ text: "March", val: "3" }, |
|
401 |
{ text: "April", val: "4" }, |
|
402 |
{ text: "May", val: "5" }, |
|
403 |
{ text: "June", val: "6" }, |
|
404 |
{ text: "July", val: "7" }, |
|
405 |
{ text: "August", val: "8" }, |
|
406 |
{ text: "September", val: "9" }, |
|
407 |
{ text: "October", val: "10" }, |
|
408 |
{ text: "November", val: "11" }, |
|
409 |
{ text: "December", val: "12" } |
|
410 |
]; |
|
411 |
$(".months").each(function () { |
|
412 |
fillOptions(this, days); |
|
413 |
}); |
|
414 |
}; |
|
415 |
|
|
416 |
var fillOptions = function (elements, options) { |
|
417 |
for (var i = 0; i < options.length; i++) |
|
418 |
$(elements).append("<option value='" + options[i].val + "'>" + options[i].text + "</option>"); |
|
419 |
}; |
|
420 |
var fillDataOfMinutesAndHoursSelectOptions = function () { |
|
421 |
for (var i = 0; i < 60; i++) { |
|
422 |
if (i < 24) { |
|
423 |
$(".hours").each(function () { $(this).append(timeSelectOption(i)); }); |
|
424 |
} |
|
425 |
$(".minutes").each(function () { $(this).append(timeSelectOption(i)); }); |
|
426 |
} |
|
427 |
}; |
|
428 |
var fillInWeekDays = function () { |
|
429 |
var days = [ |
|
430 |
{ text: "Tuesday", val: "2" }, |
|
431 |
{ text: "Wednesday", val: "3" }, |
|
432 |
{ text: "Thursday", val: "4" }, |
|
433 |
{ text: "Friday", val: "5" }, |
|
434 |
{ text: "Saturday", val: "6" }, |
|
435 |
{ text: "Sunday", val: "7" }, |
|
436 |
{ text: "Monday", val: "1" } |
|
437 |
]; |
|
438 |
$(".week-days").each(function () { |
|
439 |
fillOptions(this, days); |
|
440 |
}); |
|
441 |
|
|
442 |
}; |
|
443 |
var fillDayWeekInMonth = function () { |
|
444 |
var days = [ |
|
445 |
{ text: "First", val: "1" }, |
|
446 |
{ text: "Second", val: "2" }, |
|
447 |
{ text: "Third", val: "3" }, |
|
448 |
{ text: "Fourth", val: "4" } |
|
449 |
]; |
|
450 |
$(".day-order-in-month").each(function () { |
|
451 |
fillOptions(this, days); |
|
452 |
}); |
|
453 |
}; |
|
454 |
var displayTimeUnit = function (unit) { |
|
455 |
if (unit.toString().length == 1) |
|
456 |
return "0" + unit; |
|
457 |
return unit; |
|
458 |
}; |
|
459 |
var timeSelectOption = function (i) { |
|
460 |
return "<option id='" + i + "'>" + displayTimeUnit(i) + "</option>"; |
|
461 |
}; |
|
462 |
|
|
463 |
var generate = function () { |
|
464 |
|
|
465 |
var activeTab = $("ul#CronGenTabs li.active a").prop("id"); |
|
466 |
if (activeTab == undefined) { |
|
467 |
return; |
|
468 |
} |
|
469 |
var results = ""; |
|
470 |
switch (activeTab) { |
|
471 |
case "SecondlyTab": |
|
472 |
switch ($("input:radio[name=second]:checked").val()) { |
|
473 |
case "1": |
|
474 |
$.fn.cronGen.tools.everyTime("second"); |
|
475 |
results = $.fn.cronGen.tools.cronResult(); |
|
476 |
break; |
|
477 |
case "2": |
|
478 |
$.fn.cronGen.tools.cycle("second"); |
|
479 |
results = $.fn.cronGen.tools.cronResult(); |
|
480 |
break; |
|
481 |
case "3": |
|
482 |
$.fn.cronGen.tools.startOn("second"); |
|
483 |
results = $.fn.cronGen.tools.cronResult(); |
|
484 |
break; |
|
485 |
case "4": |
|
486 |
$.fn.cronGen.tools.initCheckBox("second"); |
|
487 |
results = $.fn.cronGen.tools.cronResult(); |
|
488 |
break; |
|
489 |
} |
|
490 |
break; |
|
491 |
case "MinutesTab": |
|
492 |
switch ($("input:radio[name=min]:checked").val()) { |
|
493 |
case "1": |
|
494 |
$.fn.cronGen.tools.everyTime("min"); |
|
495 |
results = $.fn.cronGen.tools.cronResult(); |
|
496 |
break; |
|
497 |
case "2": |
|
498 |
$.fn.cronGen.tools.cycle("min"); |
|
499 |
results = $.fn.cronGen.tools.cronResult(); |
|
500 |
break; |
|
501 |
case "3": |
|
502 |
$.fn.cronGen.tools.startOn("min"); |
|
503 |
results = $.fn.cronGen.tools.cronResult(); |
|
504 |
break; |
|
505 |
case "4": |
|
506 |
$.fn.cronGen.tools.initCheckBox("min"); |
|
507 |
results = $.fn.cronGen.tools.cronResult(); |
|
508 |
break; |
|
509 |
} |
|
510 |
break; |
|
511 |
case "HourlyTab": |
|
512 |
switch ($("input:radio[name=hour]:checked").val()) { |
|
513 |
case "1": |
|
514 |
$.fn.cronGen.tools.everyTime("hour"); |
|
515 |
results = $.fn.cronGen.tools.cronResult(); |
|
516 |
break; |
|
517 |
case "2": |
|
518 |
$.fn.cronGen.tools.cycle("hour"); |
|
519 |
results = $.fn.cronGen.tools.cronResult(); |
|
520 |
break; |
|
521 |
case "3": |
|
522 |
$.fn.cronGen.tools.startOn("hour"); |
|
523 |
results = $.fn.cronGen.tools.cronResult(); |
|
524 |
break; |
|
525 |
case "4": |
|
526 |
$.fn.cronGen.tools.initCheckBox("hour"); |
|
527 |
results = $.fn.cronGen.tools.cronResult(); |
|
528 |
break; |
|
529 |
} |
|
530 |
break; |
|
531 |
case "DailyTab": |
|
532 |
switch ($("input:radio[name=day]:checked").val()) { |
|
533 |
case "1": |
|
534 |
$.fn.cronGen.tools.everyTime("day"); |
|
535 |
results = $.fn.cronGen.tools.cronResult(); |
|
536 |
break; |
|
537 |
case "2": |
|
538 |
$.fn.cronGen.tools.unAppoint("day"); |
|
539 |
results = $.fn.cronGen.tools.cronResult(); |
|
540 |
break; |
|
541 |
case "3": |
|
542 |
$.fn.cronGen.tools.cycle("day"); |
|
543 |
results = $.fn.cronGen.tools.cronResult(); |
|
544 |
break; |
|
545 |
case "4": |
|
546 |
$.fn.cronGen.tools.startOn("day"); |
|
547 |
results = $.fn.cronGen.tools.cronResult(); |
|
548 |
break; |
|
549 |
case "5": |
|
550 |
$.fn.cronGen.tools.workDay("day"); |
|
551 |
results = $.fn.cronGen.tools.cronResult(); |
|
552 |
break; |
|
553 |
case "6": |
|
554 |
$.fn.cronGen.tools.lastDay("day"); |
|
555 |
results = $.fn.cronGen.tools.cronResult(); |
|
556 |
break; |
|
557 |
case "7": |
|
558 |
$.fn.cronGen.tools.initCheckBox("day"); |
|
559 |
results = $.fn.cronGen.tools.cronResult(); |
|
560 |
break; |
|
561 |
} |
|
562 |
break; |
|
563 |
case "WeeklyTab": |
|
564 |
switch ($("input:radio[name=week]:checked").val()) { |
|
565 |
case "1": |
|
566 |
$.fn.cronGen.tools.everyTime("week"); |
|
567 |
results = $.fn.cronGen.tools.cronResult(); |
|
568 |
break; |
|
569 |
case "2": |
|
570 |
$.fn.cronGen.tools.unAppoint("week"); |
|
571 |
results = $.fn.cronGen.tools.cronResult(); |
|
572 |
break; |
|
573 |
case "3": |
|
574 |
$.fn.cronGen.tools.cycle("week"); |
|
575 |
results = $.fn.cronGen.tools.cronResult(); |
|
576 |
break; |
|
577 |
case "4": |
|
578 |
$.fn.cronGen.tools.startOn("week"); |
|
579 |
results = $.fn.cronGen.tools.cronResult(); |
|
580 |
break; |
|
581 |
case "5": |
|
582 |
$.fn.cronGen.tools.lastWeek("week"); |
|
583 |
results = $.fn.cronGen.tools.cronResult(); |
|
584 |
break; |
|
585 |
case "6": |
|
586 |
$.fn.cronGen.tools.initCheckBox("week"); |
|
587 |
results = $.fn.cronGen.tools.cronResult(); |
|
588 |
break; |
|
589 |
} |
|
590 |
break; |
|
591 |
case "MonthlyTab": |
|
592 |
switch ($("input:radio[name=month]:checked").val()) { |
|
593 |
case "1": |
|
594 |
$.fn.cronGen.tools.everyTime("month"); |
|
595 |
results = $.fn.cronGen.tools.cronResult(); |
|
596 |
break; |
|
597 |
case "2": |
|
598 |
$.fn.cronGen.tools.unAppoint("month"); |
|
599 |
results = $.fn.cronGen.tools.cronResult(); |
|
600 |
break; |
|
601 |
case "3": |
|
602 |
$.fn.cronGen.tools.cycle("month"); |
|
603 |
results = $.fn.cronGen.tools.cronResult(); |
|
604 |
break; |
|
605 |
case "4": |
|
606 |
$.fn.cronGen.tools.startOn("month"); |
|
607 |
results = $.fn.cronGen.tools.cronResult(); |
|
608 |
break; |
|
609 |
case "5": |
|
610 |
$.fn.cronGen.tools.initCheckBox("month"); |
|
611 |
results = $.fn.cronGen.tools.cronResult(); |
|
612 |
break; |
|
613 |
} |
|
614 |
break; |
|
615 |
case "YearlyTab": |
|
616 |
switch ($("input:radio[name=year]:checked").val()) { |
|
617 |
case "1": |
|
618 |
$.fn.cronGen.tools.unAppoint("year"); |
|
619 |
results = $.fn.cronGen.tools.cronResult(); |
|
620 |
break; |
|
621 |
case "2": |
|
622 |
$.fn.cronGen.tools.everyTime("year"); |
|
623 |
results = $.fn.cronGen.tools.cronResult(); |
|
624 |
break; |
|
625 |
case "3": |
|
626 |
$.fn.cronGen.tools.cycle("year"); |
|
627 |
results = $.fn.cronGen.tools.cronResult(); |
|
628 |
break; |
|
629 |
} |
|
630 |
break; |
|
631 |
} |
|
632 |
|
|
633 |
// Update original control |
|
634 |
inputElement.val(results); |
|
635 |
// Update display |
|
636 |
displayElement.val(results); |
|
637 |
}; |
|
638 |
|
|
639 |
var refreshRunTime = function () { |
|
640 |
$.ajax({ |
|
641 |
type : 'GET', |
|
642 |
url : base_url + "/jobinfo/nextTriggerTime", |
|
643 |
data : { |
|
644 |
"scheduleType" : 'CRON', |
|
645 |
"scheduleConf" : inputElement.val() |
|
646 |
}, |
|
647 |
dataType : "json", |
|
648 |
success : function(data){ |
|
649 |
if (data.code === 200) { |
|
650 |
$('#runTime').val(data.content.join("\n")); |
|
651 |
} else { |
|
652 |
$('#runTime').val(data.msg); |
|
653 |
} |
|
654 |
} |
|
655 |
}); |
|
656 |
}; |
|
657 |
|
|
658 |
})(jQuery); |
|
659 |
|
|
660 |
(function($) { |
|
661 |
$.fn.cronGen.defaultOptions = { |
|
662 |
direction : 'bottom' |
|
663 |
}; |
|
664 |
$.fn.cronGen.tools = { |
|
665 |
/** |
|
666 |
* 每周期 |
|
667 |
*/ |
|
668 |
everyTime : function(dom){ |
|
669 |
$("#"+dom+"Hidden").val("*"); |
|
670 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
671 |
}, |
|
672 |
/** |
|
673 |
* 不指定 |
|
674 |
*/ |
|
675 |
unAppoint : function(dom){ |
|
676 |
var val = "?"; |
|
677 |
if (dom == "year") |
|
678 |
{ |
|
679 |
val = ""; |
|
680 |
} |
|
681 |
$("#"+dom+"Hidden").val(val); |
|
682 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
683 |
}, |
|
684 |
/** |
|
685 |
* 周期 |
|
686 |
*/ |
|
687 |
cycle : function(dom){ |
|
688 |
var start = $("#"+dom+"Start_0").val(); |
|
689 |
var end = $("#"+dom+"End_0").val(); |
|
690 |
$("#"+dom+"Hidden").val(start + "-" + end); |
|
691 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
692 |
}, |
|
693 |
/** |
|
694 |
* 从开始 |
|
695 |
*/ |
|
696 |
startOn : function(dom) { |
|
697 |
var start = $("#"+dom+"Start_1").val(); |
|
698 |
var end = $("#"+dom+"End_1").val(); |
|
699 |
$("#"+dom+"Hidden").val(start + "/" + end); |
|
700 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
701 |
}, |
|
702 |
/** |
|
703 |
* 最后一天 |
|
704 |
*/ |
|
705 |
lastDay : function(dom){ |
|
706 |
$("#"+dom+"Hidden").val("L"); |
|
707 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
708 |
}, |
|
709 |
/** |
|
710 |
* 每周的某一天 |
|
711 |
*/ |
|
712 |
weekOfDay : function(dom){ |
|
713 |
var start = $("#"+dom+"Start_0").val(); |
|
714 |
var end = $("#"+dom+"End_0").val(); |
|
715 |
$("#"+dom+"Hidden").val(start + "#" + end); |
|
716 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
717 |
}, |
|
718 |
/** |
|
719 |
* 最后一周 |
|
720 |
*/ |
|
721 |
lastWeek : function(dom){ |
|
722 |
var start = $("#"+dom+"Start_2").val(); |
|
723 |
$("#"+dom+"Hidden").val(start+"L"); |
|
724 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
725 |
}, |
|
726 |
/** |
|
727 |
* 工作日 |
|
728 |
*/ |
|
729 |
workDay : function(dom) { |
|
730 |
var start = $("#"+dom+"Start_2").val(); |
|
731 |
$("#"+dom+"Hidden").val(start + "W"); |
|
732 |
$.fn.cronGen.tools.clearCheckbox(dom); |
|
733 |
}, |
|
734 |
initChangeEvent : function(){ |
|
735 |
var secondList = $(".secondList").children(); |
|
736 |
$("#sencond_appoint").click(function(){ |
|
737 |
if (this.checked) { |
|
738 |
if ($(secondList).filter(":checked").length == 0) { |
|
739 |
$(secondList.eq(0)).attr("checked", true); |
|
740 |
} |
|
741 |
secondList.eq(0).change(); |
|
742 |
} |
|
743 |
}); |
|
744 |
|
|
745 |
secondList.change(function() { |
|
746 |
var sencond_appoint = $("#sencond_appoint").prop("checked"); |
|
747 |
if (sencond_appoint) { |
|
748 |
var vals = []; |
|
749 |
secondList.each(function() { |
|
750 |
if (this.checked) { |
|
751 |
vals.push(this.value); |
|
752 |
} |
|
753 |
}); |
|
754 |
var val = "?"; |
|
755 |
if (vals.length > 0 && vals.length < 59) { |
|
756 |
val = vals.join(","); |
|
757 |
}else if(vals.length == 59){ |
|
758 |
val = "*"; |
|
759 |
} |
|
760 |
$("#secondHidden").val(val); |
|
761 |
} |
|
762 |
}); |
|
763 |
|
|
764 |
var minList = $(".minList").children(); |
|
765 |
$("#min_appoint").click(function(){ |
|
766 |
if (this.checked) { |
|
767 |
if ($(minList).filter(":checked").length == 0) { |
|
768 |
$(minList.eq(0)).attr("checked", true); |
|
769 |
} |
|
770 |
minList.eq(0).change(); |
|
771 |
} |
|
772 |
}); |
|
773 |
|
|
774 |
minList.change(function() { |
|
775 |
var min_appoint = $("#min_appoint").prop("checked"); |
|
776 |
if (min_appoint) { |
|
777 |
var vals = []; |
|
778 |
minList.each(function() { |
|
779 |
if (this.checked) { |
|
780 |
vals.push(this.value); |
|
781 |
} |
|
782 |
}); |
|
783 |
var val = "?"; |
|
784 |
if (vals.length > 0 && vals.length < 59) { |
|
785 |
val = vals.join(","); |
|
786 |
}else if(vals.length == 59){ |
|
787 |
val = "*"; |
|
788 |
} |
|
789 |
$("#minHidden").val(val); |
|
790 |
} |
|
791 |
}); |
|
792 |
|
|
793 |
var hourList = $(".hourList").children(); |
|
794 |
$("#hour_appoint").click(function(){ |
|
795 |
if (this.checked) { |
|
796 |
if ($(hourList).filter(":checked").length == 0) { |
|
797 |
$(hourList.eq(0)).attr("checked", true); |
|
798 |
} |
|
799 |
hourList.eq(0).change(); |
|
800 |
} |
|
801 |
}); |
|
802 |
|
|
803 |
hourList.change(function() { |
|
804 |
var hour_appoint = $("#hour_appoint").prop("checked"); |
|
805 |
if (hour_appoint) { |
|
806 |
var vals = []; |
|
807 |
hourList.each(function() { |
|
808 |
if (this.checked) { |
|
809 |
vals.push(this.value); |
|
810 |
} |
|
811 |
}); |
|
812 |
var val = "?"; |
|
813 |
if (vals.length > 0 && vals.length < 24) { |
|
814 |
val = vals.join(","); |
|
815 |
}else if(vals.length == 24){ |
|
816 |
val = "*"; |
|
817 |
} |
|
818 |
$("#hourHidden").val(val); |
|
819 |
} |
|
820 |
}); |
|
821 |
|
|
822 |
var dayList = $(".dayList").children(); |
|
823 |
$("#day_appoint").click(function(){ |
|
824 |
if (this.checked) { |
|
825 |
if ($(dayList).filter(":checked").length == 0) { |
|
826 |
$(dayList.eq(0)).attr("checked", true); |
|
827 |
} |
|
828 |
dayList.eq(0).change(); |
|
829 |
} |
|
830 |
}); |
|
831 |
|
|
832 |
dayList.change(function() { |
|
833 |
var day_appoint = $("#day_appoint").prop("checked"); |
|
834 |
if (day_appoint) { |
|
835 |
var vals = []; |
|
836 |
dayList.each(function() { |
|
837 |
if (this.checked) { |
|
838 |
vals.push(this.value); |
|
839 |
} |
|
840 |
}); |
|
841 |
var val = "?"; |
|
842 |
if (vals.length > 0 && vals.length < 31) { |
|
843 |
val = vals.join(","); |
|
844 |
}else if(vals.length == 31){ |
|
845 |
val = "*"; |
|
846 |
} |
|
847 |
$("#dayHidden").val(val); |
|
848 |
} |
|
849 |
}); |
|
850 |
|
|
851 |
var monthList = $(".monthList").children(); |
|
852 |
$("#month_appoint").click(function(){ |
|
853 |
if (this.checked) { |
|
854 |
if ($(monthList).filter(":checked").length == 0) { |
|
855 |
$(monthList.eq(0)).attr("checked", true); |
|
856 |
} |
|
857 |
monthList.eq(0).change(); |
|
858 |
} |
|
859 |
}); |
|
860 |
|
|
861 |
monthList.change(function() { |
|
862 |
var month_appoint = $("#month_appoint").prop("checked"); |
|
863 |
if (month_appoint) { |
|
864 |
var vals = []; |
|
865 |
monthList.each(function() { |
|
866 |
if (this.checked) { |
|
867 |
vals.push(this.value); |
|
868 |
} |
|
869 |
}); |
|
870 |
var val = "?"; |
|
871 |
if (vals.length > 0 && vals.length < 12) { |
|
872 |
val = vals.join(","); |
|
873 |
}else if(vals.length == 12){ |
|
874 |
val = "*"; |
|
875 |
} |
|
876 |
$("#monthHidden").val(val); |
|
877 |
} |
|
878 |
}); |
|
879 |
|
|
880 |
var weekList = $(".weekList").children(); |
|
881 |
$("#week_appoint").click(function(){ |
|
882 |
if (this.checked) { |
|
883 |
if ($(weekList).filter(":checked").length == 0) { |
|
884 |
$(weekList.eq(0)).attr("checked", true); |
|
885 |
} |
|
886 |
weekList.eq(0).change(); |
|
887 |
} |
|
888 |
}); |
|
889 |
|
|
890 |
weekList.change(function() { |
|
891 |
var week_appoint = $("#week_appoint").prop("checked"); |
|
892 |
if (week_appoint) { |
|
893 |
var vals = []; |
|
894 |
weekList.each(function() { |
|
895 |
if (this.checked) { |
|
896 |
vals.push(this.value); |
|
897 |
} |
|
898 |
}); |
|
899 |
var val = "?"; |
|
900 |
if (vals.length > 0 && vals.length < 7) { |
|
901 |
val = vals.join(","); |
|
902 |
}else if(vals.length == 7){ |
|
903 |
val = "*"; |
|
904 |
} |
|
905 |
$("#weekHidden").val(val); |
|
906 |
} |
|
907 |
}); |
|
908 |
}, |
|
909 |
initObj : function(strVal, strid){ |
|
910 |
var ary = null; |
|
911 |
var objRadio = $("input[name='" + strid + "'"); |
|
912 |
if (strVal == "*") { |
|
913 |
objRadio.eq(0).attr("checked", "checked"); |
|
914 |
} else if (strVal.split('-').length > 1) { |
|
915 |
ary = strVal.split('-'); |
|
916 |
objRadio.eq(1).attr("checked", "checked"); |
|
917 |
$("#" + strid + "Start_0").val(ary[0]); |
|
918 |
$("#" + strid + "End_0").val(ary[1]); |
|
919 |
} else if (strVal.split('/').length > 1) { |
|
920 |
ary = strVal.split('/'); |
|
921 |
objRadio.eq(2).attr("checked", "checked"); |
|
922 |
$("#" + strid + "Start_1").val(ary[0]); |
|
923 |
$("#" + strid + "End_1").val(ary[1]); |
|
924 |
} else { |
|
925 |
objRadio.eq(3).attr("checked", "checked"); |
|
926 |
if (strVal != "?") { |
|
927 |
ary = strVal.split(","); |
|
928 |
for (var i = 0; i < ary.length; i++) { |
|
929 |
$("." + strid + "List input[value='" + ary[i] + "']").attr("checked", "checked"); |
|
930 |
} |
|
931 |
$.fn.cronGen.tools.initCheckBox(strid); |
|
932 |
} |
|
933 |
} |
|
934 |
}, |
|
935 |
initDay : function(strVal) { |
|
936 |
var ary = null; |
|
937 |
var objRadio = $("input[name='day'"); |
|
938 |
if (strVal == "*") { |
|
939 |
objRadio.eq(0).attr("checked", "checked"); |
|
940 |
} else if (strVal == "?") { |
|
941 |
objRadio.eq(1).attr("checked", "checked"); |
|
942 |
} else if (strVal.split('-').length > 1) { |
|
943 |
ary = strVal.split('-'); |
|
944 |
objRadio.eq(2).attr("checked", "checked"); |
|
945 |
$("#dayStart_0").val(ary[0]); |
|
946 |
$("#dayEnd_0").val(ary[1]); |
|
947 |
} else if (strVal.split('/').length > 1) { |
|
948 |
ary = strVal.split('/'); |
|
949 |
objRadio.eq(3).attr("checked", "checked"); |
|
950 |
$("#dayStart_1").val(ary[0]); |
|
951 |
$("#dayEnd_1").val(ary[1]); |
|
952 |
} else if (strVal.split('W').length > 1) { |
|
953 |
ary = strVal.split('W'); |
|
954 |
objRadio.eq(4).attr("checked", "checked"); |
|
955 |
$("#dayStart_2").val(ary[0]); |
|
956 |
} else if (strVal == "L") { |
|
957 |
objRadio.eq(5).attr("checked", "checked"); |
|
958 |
} else { |
|
959 |
objRadio.eq(6).attr("checked", "checked"); |
|
960 |
ary = strVal.split(","); |
|
961 |
for (var i = 0; i < ary.length; i++) { |
|
962 |
$(".dayList input[value='" + ary[i] + "']").attr("checked", "checked"); |
|
963 |
} |
|
964 |
$.fn.cronGen.tools.initCheckBox("day"); |
|
965 |
} |
|
966 |
}, |
|
967 |
initMonth : function(strVal) { |
|
968 |
var ary = null; |
|
969 |
var objRadio = $("input[name='month'"); |
|
970 |
if (strVal == "*") { |
|
971 |
objRadio.eq(0).attr("checked", "checked"); |
|
972 |
} else if (strVal == "?") { |
|
973 |
objRadio.eq(1).attr("checked", "checked"); |
|
974 |
} else if (strVal.split('-').length > 1) { |
|
975 |
ary = strVal.split('-'); |
|
976 |
objRadio.eq(2).attr("checked", "checked"); |
|
977 |
$("#monthStart_0").val(ary[0]); |
|
978 |
$("#monthEnd_0").val(ary[1]); |
|
979 |
} else if (strVal.split('/').length > 1) { |
|
980 |
ary = strVal.split('/'); |
|
981 |
objRadio.eq(3).attr("checked", "checked"); |
|
982 |
$("#monthStart_1").val(ary[0]); |
|
983 |
$("#monthEnd_1").val(ary[1]); |
|
984 |
|
|
985 |
} else { |
|
986 |
objRadio.eq(4).attr("checked", "checked"); |
|
987 |
|
|
988 |
ary = strVal.split(","); |
|
989 |
for (var i = 0; i < ary.length; i++) { |
|
990 |
$(".monthList input[value='" + ary[i] + "']").attr("checked", "checked"); |
|
991 |
} |
|
992 |
$.fn.cronGen.tools.initCheckBox("month"); |
|
993 |
} |
|
994 |
}, |
|
995 |
initWeek : function(strVal) { |
|
996 |
var ary = null; |
|
997 |
var objRadio = $("input[name='week'"); |
|
998 |
if (strVal == "*") { |
|
999 |
objRadio.eq(0).attr("checked", "checked"); |
|
1000 |
} else if (strVal == "?") { |
|
1001 |
objRadio.eq(1).attr("checked", "checked"); |
|
1002 |
} else if (strVal.split('/').length > 1) { |
|
1003 |
ary = strVal.split('/'); |
|
1004 |
objRadio.eq(2).attr("checked", "checked"); |
|
1005 |
$("#weekStart_0").val(ary[0]); |
|
1006 |
$("#weekEnd_0").val(ary[1]); |
|
1007 |
} else if (strVal.split('-').length > 1) { |
|
1008 |
ary = strVal.split('-'); |
|
1009 |
objRadio.eq(3).attr("checked", "checked"); |
|
1010 |
$("#weekStart_1").val(ary[0]); |
|
1011 |
$("#weekEnd_1").val(ary[1]); |
|
1012 |
} else if (strVal.split('L').length > 1) { |
|
1013 |
ary = strVal.split('L'); |
|
1014 |
objRadio.eq(4).attr("checked", "checked"); |
|
1015 |
$("#weekStart_2").val(ary[0]); |
|
1016 |
} else { |
|
1017 |
objRadio.eq(5).attr("checked", "checked"); |
|
1018 |
ary = strVal.split(","); |
|
1019 |
for (var i = 0; i < ary.length; i++) { |
|
1020 |
$(".weekList input[value='" + ary[i] + "']").attr("checked", "checked"); |
|
1021 |
} |
|
1022 |
$.fn.cronGen.tools.initCheckBox("week"); |
|
1023 |
} |
|
1024 |
}, |
|
1025 |
initYear : function(strVal) { |
|
1026 |
var ary = null; |
|
1027 |
var objRadio = $("input[name='year'"); |
|
1028 |
if (strVal == "*") { |
|
1029 |
objRadio.eq(1).attr("checked", "checked"); |
|
1030 |
} else if (strVal.split('-').length > 1) { |
|
1031 |
ary = strVal.split('-'); |
|
1032 |
objRadio.eq(2).attr("checked", "checked"); |
|
1033 |
$("#yearStart_0").val(ary[0]); |
|
1034 |
$("#yearEnd_0").val(ary[1]); |
|
1035 |
} |
|
1036 |
}, |
|
1037 |
cronParse : function(cronExpress) { |
|
1038 |
//获取参数中表达式的值 |
|
1039 |
if (cronExpress) { |
|
1040 |
var regs = cronExpress.split(' '); |
|
1041 |
$("#secondHidden").val(regs[0]); |
|
1042 |
$("#minHidden").val(regs[1]); |
|
1043 |
$("#hourHidden").val(regs[2]); |
|
1044 |
$("#dayHidden").val(regs[3]); |
|
1045 |
$("#monthHidden").val(regs[4]); |
|
1046 |
$("#weekHidden").val(regs[5]); |
|
1047 |
|
|
1048 |
$.fn.cronGen.tools.initObj(regs[0], "second"); |
|
1049 |
$.fn.cronGen.tools.initObj(regs[1], "min"); |
|
1050 |
$.fn.cronGen.tools.initObj(regs[2], "hour"); |
|
1051 |
$.fn.cronGen.tools.initDay(regs[3]); |
|
1052 |
$.fn.cronGen.tools.initMonth(regs[4]); |
|
1053 |
$.fn.cronGen.tools.initWeek(regs[5]); |
|
1054 |
|
|
1055 |
if (regs.length > 6) { |
|
1056 |
$("input[name=yearHidden]").val(regs[6]); |
|
1057 |
$.fn.cronGen.tools.initYear(regs[6]); |
|
1058 |
} |
|
1059 |
} |
|
1060 |
}, |
|
1061 |
cronResult : function() { |
|
1062 |
var result; |
|
1063 |
var second = $("#secondHidden").val(); |
|
1064 |
second = second== "" ? "*":second; |
|
1065 |
var minute = $("#minHidden").val(); |
|
1066 |
minute = minute== "" ? "*":minute; |
|
1067 |
var hour = $("#hourHidden").val(); |
|
1068 |
hour = hour== "" ? "*":hour; |
|
1069 |
var day = $("#dayHidden").val(); |
|
1070 |
day = day== "" ? "*":day; |
|
1071 |
var month = $("#monthHidden").val(); |
|
1072 |
month = month== "" ? "*":month; |
|
1073 |
var week = $("#weekHidden").val(); |
|
1074 |
week = week== "" ? "?":week; |
|
1075 |
var year = $("#yearHidden").val(); |
|
1076 |
if(year!="") |
|
1077 |
{ |
|
1078 |
result = second+" "+minute+" "+hour+" "+day+" "+month+" "+week+" "+year; |
|
1079 |
}else |
|
1080 |
{ |
|
1081 |
result = second+" "+minute+" "+hour+" "+day+" "+month+" "+week; |
|
1082 |
} |
|
1083 |
return result; |
|
1084 |
}, |
|
1085 |
clearCheckbox : function(dom){ |
|
1086 |
//清除选中的checkbox |
|
1087 |
var list = $("."+dom+"List").children().filter(":checked"); |
|
1088 |
if ($(list).length > 0) { |
|
1089 |
$.each(list, function(index){ |
|
1090 |
$(this).attr("checked", false); |
|
1091 |
$(this).attr("disabled", "disabled"); |
|
1092 |
$(this).change(); |
|
1093 |
}); |
|
1094 |
} |
|
1095 |
}, |
|
1096 |
initCheckBox : function(dom) { |
|
1097 |
//移除checkbox禁用 |
|
1098 |
var list = $("."+dom+"List").children(); |
|
1099 |
if ($(list).length > 0) { |
|
1100 |
$.each(list, function(index){ |
|
1101 |
$(this).removeAttr("disabled"); |
|
1102 |
}); |
|
1103 |
} |
|
1104 |
} |
|
1105 |
}; |
|
1106 |
})(jQuery); |