diff --git a/cron/jquery-cron-min.js b/cron/jquery-cron-min.js
index 386fb37..5ef3583 100644
--- a/cron/jquery-cron-min.js
+++ b/cron/jquery-cron-min.js
@@ -1 +1 @@
-(function(e){var n={initial:"* * * * *",minuteOpts:{minWidth:100,itemWidth:30,columns:4,rows:undefined,title:"Minutes Past the Hour"},timeHourOpts:{minWidth:100,itemWidth:20,columns:2,rows:undefined,title:"Time: Hour"},domOpts:{minWidth:100,itemWidth:30,columns:undefined,rows:10,title:"Day of Month"},monthOpts:{minWidth:100,itemWidth:100,columns:2,rows:undefined,title:undefined},dowOpts:{minWidth:100,itemWidth:undefined,columns:undefined,rows:undefined,title:undefined},timeMinuteOpts:{minWidth:100,itemWidth:20,columns:4,rows:undefined,title:"Time: Minute"},effectOpts:{openSpeed:400,closeSpeed:400,openEffect:"slide",closeEffect:"slide",hideOnMouseOut:true},url_set:undefined,customValues:undefined,onChange:undefined,useGentleSelect:false};var y="";for(var u=0;u<60;u++){var t=(u<10)?"0":"";y+="\n"}var d="";for(var u=0;u<24;u++){var t=(u<10)?"0":"";d+="\n"}var v="";for(var u=1;u<32;u++){if(u==1||u==21||u==31){var c="st"}else{if(u==2||u==22){var c="nd"}else{if(u==3||u==23){var c="rd"}else{var c="th"}}}v+="\n"}var h="";var l=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var u=0;u"+l[u]+"\n"}var s="";var g=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];for(var u=0;u"+g[u]+"\n"}var r="";var b=["minute","hour","day","week","month","year"];for(var u=0;u"+b[u]+"\n"}var p={minute:[],hour:["mins"],day:["time"],week:["dow","time"],month:["dom","time"],year:["dom","month","time"]};var w={minute:/^(\*\s){4}\*$/,hour:/^\d{1,2}\s(\*\s){3}\*$/,day:/^(\d{1,2}\s){2}(\*\s){2}\*$/,week:/^(\d{1,2}\s){2}(\*\s){2}\d{1,2}$/,month:/^(\d{1,2}\s){3}\*\s\*$/,year:/^(\d{1,2}\s){4}\*$/};function a(i){if(typeof i=="undefined"){return false}else{return true}}function q(i){return(!a(i)||typeof i=="object")}function z(A,j){if(a(j.customValues)){for(key in j.customValues){if(A==j.customValues[key]){return key}}}var E=/^((\d{1,2}|\*)\s){4}(\d{1,2}|\*)$/;if(typeof A!="string"||!E.test(A)){e.error("cron: invalid initial value");return undefined}var C=A.split(" ");var D=[0,0,1,1,0];var G=[59,23,31,12,6];for(var B=0;B=D[B]){continue}e.error("cron: invalid value found (col "+(B+1)+") in "+o.initial);return undefined}for(var H in w){if(w[H].test(A)){return H}}e.error("cron: valid but unsupported cron format. sorry.");return undefined}function f(j,i){if(!a(z(i.initial,i))){return true}if(!q(i.customValues)){return true}if(a(i.customValues)){for(key in i.customValues){if(w.hasOwnProperty(key)){e.error("cron: reserved keyword '"+key+"' should not be used as customValues key.");return true}}}return false}function k(B){var i=B.data("block");var j=hour=day=month=dow="*";var A=i.period.find("select").val();switch(A){case"minute":break;case"hour":j=i.mins.find("select").val();break;case"day":j=i.time.find("select.cron-time-min").val();hour=i.time.find("select.cron-time-hour").val();break;case"week":j=i.time.find("select.cron-time-min").val();hour=i.time.find("select.cron-time-hour").val();dow=i.dow.find("select").val();break;case"month":j=i.time.find("select.cron-time-min").val();hour=i.time.find("select.cron-time-hour").val();day=i.dom.find("select").val();break;case"year":j=i.time.find("select.cron-time-min").val();hour=i.time.find("select.cron-time-hour").val();day=i.dom.find("select").val();month=i.month.find("select").val();break;default:return A}return[j,hour,day,month,dow].join(" ")}var x={init:function(i){var G=i?i:{};var B=e.extend([],n,G);var j=e.extend({},n.effectOpts,G.effectOpts);e.extend(B,{minuteOpts:e.extend({},n.minuteOpts,j,G.minuteOpts),domOpts:e.extend({},n.domOpts,j,G.domOpts),monthOpts:e.extend({},n.monthOpts,j,G.monthOpts),dowOpts:e.extend({},n.dowOpts,j,G.dowOpts),timeHourOpts:e.extend({},n.timeHourOpts,j,G.timeHourOpts),timeMinuteOpts:e.extend({},n.timeMinuteOpts,j,G.timeMinuteOpts)});if(f(this,B)){return this}var C=[],A="",D=B.customValues;if(a(D)){for(var F in D){A+="\n"}}C.period=e("Every ").appendTo(this).data("root",this);var E=C.period.find("select");E.bind("change.cron",m.periodChanged).data("root",this);if(B.useGentleSelect){E.gentleSelect(j)}C.dom=e(" on the ").appendTo(this).data("root",this);E=C.dom.find("select").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.domOpts)}C.month=e(" of ").appendTo(this).data("root",this);E=C.month.find("select").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.monthOpts)}C.mins=e(" at minutes past the hour ").appendTo(this).data("root",this);E=C.mins.find("select").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.minuteOpts)}C.dow=e(" on ").appendTo(this).data("root",this);E=C.dow.find("select").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.dowOpts)}C.time=e(" at :").appendTo(this).data("root",this);E=C.time.find("select.cron-time-hour").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.timeHourOpts)}E=C.time.find("select.cron-time-min").data("root",this);if(B.useGentleSelect){E.gentleSelect(B.timeMinuteOpts)}C.controls=e("« save ").appendTo(this).data("root",this).find("span.cron-button-save").bind("click.cron",m.saveClicked).data("root",this).end();this.find("select").bind("change.cron-callback",m.somethingChanged);this.data("options",B).data("block",C);this.data("current_value",B.initial);return x.value.call(this,B.initial)},value:function(C){if(!C){return k(this)}var A=this.data("options");var D=this.data("block");var F=A.useGentleSelect;var K=z(C,A);if(!a(K)){return false}if(a(A.customValues)&&A.customValues.hasOwnProperty(K)){K=A.customValues[K]}else{var H=C.split(" ");var J={mins:H[0],hour:H[1],dom:H[2],month:H[3],dow:H[4]};var G=p[K];for(var E=0;E"+a+r+"\n"}var i="";for(var r=0;r<24;r++){var a=r<10?"0":"";i+="\n"}var s="";for(var r=1;r<32;r++){if(r==1||r==21||r==31){var l="st"}else if(r==2||r==22){var l="nd"}else if(r==3||r==23){var l="rd"}else{var l="th"}s+="\n"}var d="";var c=["January","February","March","April","May","June","July","August","September","October","November","December"];for(var r=0;r"+c[r]+"\n"}var u="";var m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];for(var r=0;r"+m[r]+"\n"}var f={minute:[],hour:["mins"],day:["time"],week:["dow","time"],month:["dom","time"],year:["dom","month","time"]};var h={minute:/^(\*\s){4}\*$/,hour:/^\d{1,2}\s(\*\s){3}\*$/,day:/^(\d{1,2}\s){2}(\*\s){2}\*$/,week:/^(\d{1,2}\s){2}(\*\s){2}\d{1,2}$/,month:/^(\d{1,2}\s){3}\*\s\*$/,year:/^(\d{1,2}\s){4}\*$/};function p(e){if(typeof e=="undefined"){return false}else{return true}}function v(e){return!p(e)||typeof e=="object"}function y(t,n){if(p(n.customValues)){for(key in n.customValues){if(t==n.customValues[key]){return key}}}var r=/^((\d{1,2}|\*)\s){4}(\d{1,2}|\*)$/;if(typeof t!="string"||!r.test(t)){e.error("cron: invalid initial value");return undefined}var a=t.split(" ");var i=[0,0,1,1,0];var s=[59,23,31,12,6];for(var l=0;l=i[l])continue;e.error("cron: invalid value found (col "+(l+1)+") in "+o.initial);return undefined}for(var c in h){if(h[c].test(t)){return c}}e.error("cron: valid but unsupported cron format. sorry.");return undefined}function g(t,n){if(!p(y(n.initial,n))){return true}if(!v(n.customValues)){return true}if(p(n.customValues)){for(key in n.customValues){if(h.hasOwnProperty(key)){e.error("cron: reserved keyword '"+key+"' should not be used as customValues key.");return true}}}return false}function b(e){var t=e.data("block");var n=hour=day=month=dow="*";var o=t["period"].find("select").val();switch(o){case"minute":break;case"hour":n=t["mins"].find("select").val();break;case"day":n=t["time"].find("select.cron-time-min").val();hour=t["time"].find("select.cron-time-hour").val();break;case"week":n=t["time"].find("select.cron-time-min").val();hour=t["time"].find("select.cron-time-hour").val();dow=t["dow"].find("select").val();break;case"month":n=t["time"].find("select.cron-time-min").val();hour=t["time"].find("select.cron-time-hour").val();day=t["dom"].find("select").val();break;case"year":n=t["time"].find("select.cron-time-min").val();hour=t["time"].find("select.cron-time-hour").val();day=t["dom"].find("select").val();month=t["month"].find("select").val();break;default:return o}return[n,hour,day,month,dow].join(" ")}var O={init:function(o){var r=o?o:{};var a=e.extend([],t,r);var l=e.extend({},t.effectOpts,r.effectOpts);e.extend(a,{minuteOpts:e.extend({},t.minuteOpts,l,r.minuteOpts),domOpts:e.extend({},t.domOpts,l,r.domOpts),monthOpts:e.extend({},t.monthOpts,l,r.monthOpts),dowOpts:e.extend({},t.dowOpts,l,r.dowOpts),timeHourOpts:e.extend({},t.timeHourOpts,l,r.timeHourOpts),timeMinuteOpts:e.extend({},t.timeMinuteOpts,l,r.timeMinuteOpts)});if(g(this,a)){return this}var c="";for(var m=0;m"+a.periods[m]+"\n"}var f=[],h="",v=a.customValues;if(p(v)){for(var y in v){h+="\n"}}f["period"]=e(""+"Every ").appendTo(this).data("root",this);var b=f["period"].find("select");b.bind("change.cron",k.periodChanged).data("root",this);if(a.useGentleSelect)b.gentleSelect(l);f["dom"]=e(""+" on the ").appendTo(this).data("root",this);b=f["dom"].find("select").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.domOpts);f["month"]=e(""+" of ").appendTo(this).data("root",this);b=f["month"].find("select").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.monthOpts);f["mins"]=e(""+" at minutes past the hour ").appendTo(this).data("root",this);b=f["mins"].find("select").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.minuteOpts);f["dow"]=e(""+" on ").appendTo(this).data("root",this);b=f["dow"].find("select").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.dowOpts);f["time"]=e(""+" at :").appendTo(this).data("root",this);b=f["time"].find("select.cron-time-hour").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.timeHourOpts);b=f["time"].find("select.cron-time-min").data("root",this);if(a.useGentleSelect)b.gentleSelect(a.timeMinuteOpts);f["controls"]=e("« save "+""+" ").appendTo(this).data("root",this).find("span.cron-button-save").bind("click.cron",k.saveClicked).data("root",this).end();this.find("select").bind("change.cron-callback",k.somethingChanged);this.data("options",a).data("block",f);this.data("current_value",a.initial);return O["value"].call(this,a.initial)},value:function(e){if(!e){return b(this)}var t=this.data("options");var n=this.data("block");var o=t.useGentleSelect;var r=y(e,t);if(!p(r)){return false}if(p(t.customValues)&&t.customValues.hasOwnProperty(r)){r=t.customValues[r]}else{var a=e.split(" ");var i={mins:a[0],hour:a[1],dom:a[2],month:a[3],dow:a[4]};var s=f[r];for(var l=0;l" + days[i] + "\n";
}
- // options for period
- var str_opt_period = "";
- var periods = ["minute", "hour", "day", "week", "month", "year"];
- for (var i = 0; i < periods.length; i++) {
- str_opt_period += "\n";
- }
-
// display matrix
var toDisplay = {
"minute" : [],
@@ -298,6 +292,12 @@
// ---- define select boxes in the right order -----
+ // options for period
+ var str_opt_period = "";
+ for (var i = 0; i < o.periods.length; i++) {
+ str_opt_period += "\n";
+ }
+
var block = [], custom_periods = "", cv = o.customValues;
if (defined(cv)) { // prepend custom values if specified
for (var key in cv) {
@@ -389,9 +389,9 @@
var block = this.data("block");
var useGentleSelect = o.useGentleSelect;
var t = getCronType(cron_str, o);
-
+
if (!defined(t)) { return false; }
-
+
if (defined(o.customValues) && o.customValues.hasOwnProperty(t)) {
t = o.customValues[t];
} else {
@@ -420,7 +420,7 @@
}
}
}
-
+
// trigger change event
var bp = block["period"].find("select").val(t);
if (useGentleSelect) bp.gentleSelect("update");