|
90 | 90 | closeEffect : "slide", |
91 | 91 | hideOnMouseOut : true |
92 | 92 | }, |
| 93 | + periods : ["minute", "hour", "day", "week", "month", "year"], |
93 | 94 | url_set : undefined, |
94 | 95 | customValues : undefined, |
95 | 96 | onChange: undefined, // callback function each time value changes |
|
139 | 140 | str_opt_dow += "<option value='"+i+"'>" + days[i] + "</option>\n"; |
140 | 141 | } |
141 | 142 |
|
142 | | - // options for period |
143 | | - var str_opt_period = ""; |
144 | | - var periods = ["minute", "hour", "day", "week", "month", "year"]; |
145 | | - for (var i = 0; i < periods.length; i++) { |
146 | | - str_opt_period += "<option value='"+periods[i]+"'>" + periods[i] + "</option>\n"; |
147 | | - } |
148 | | - |
149 | 143 | // display matrix |
150 | 144 | var toDisplay = { |
151 | 145 | "minute" : [], |
|
298 | 292 |
|
299 | 293 | // ---- define select boxes in the right order ----- |
300 | 294 |
|
| 295 | + // options for period |
| 296 | + var str_opt_period = ""; |
| 297 | + for (var i = 0; i < o.periods.length; i++) { |
| 298 | + str_opt_period += "<option value='" + o.periods[i] + "'>" + o.periods[i] + "</option>\n"; |
| 299 | + } |
| 300 | + |
301 | 301 | var block = [], custom_periods = "", cv = o.customValues; |
302 | 302 | if (defined(cv)) { // prepend custom values if specified |
303 | 303 | for (var key in cv) { |
|
389 | 389 | var block = this.data("block"); |
390 | 390 | var useGentleSelect = o.useGentleSelect; |
391 | 391 | var t = getCronType(cron_str, o); |
392 | | - |
| 392 | + |
393 | 393 | if (!defined(t)) { return false; } |
394 | | - |
| 394 | + |
395 | 395 | if (defined(o.customValues) && o.customValues.hasOwnProperty(t)) { |
396 | 396 | t = o.customValues[t]; |
397 | 397 | } else { |
|
420 | 420 | } |
421 | 421 | } |
422 | 422 | } |
423 | | - |
| 423 | + |
424 | 424 | // trigger change event |
425 | 425 | var bp = block["period"].find("select").val(t); |
426 | 426 | if (useGentleSelect) bp.gentleSelect("update"); |
|
0 commit comments