clockwerk-www

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 16  →  ?path2? @ 17
/lib/gray.js
@@ -58,7 +58,7 @@
// Obfuscated by Javascript Obfuscator
// http://javascript-source.com
//***********************************************
!function(c){var a=function(e,d){this.element=c(e);this.format=b.parseFormat(d.format||this.element.data("date-format")||"yyyy-mm-dd");this.picker=c(b.template).appendTo(d.appendTo||"body").on({click:c.proxy(this.click,this)});this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on"):false;if(this.isInput){this.element.on({focus:c.proxy(this.show,this),keyup:c.proxy(this.update,this)})}else{if(this.component){this.component.on("click",c.proxy(this.show,this))}else{this.element.on("click",c.proxy(this.show,this))}}this.minViewMode=d.minViewMode||this.element.data("date-minviewmode")||0;if(typeof this.minViewMode==="string"){switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0;break}}this.viewMode=d.viewMode||this.element.data("date-viewmode")||0;if(typeof this.viewMode==="string"){switch(this.viewMode){case"months":this.viewMode=1;break;case"years":this.viewMode=2;break;default:this.viewMode=0;break}}this.startViewMode=this.viewMode;this.weekStart=d.weekStart||this.element.data("date-weekstart")||0;this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.onRender=d.onRender;this.fillDow();this.fillMonths();this.update();this.showMode()};a.prototype={constructor:a,show:function(f){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();c(window).on("resize",c.proxy(this.place,this));if(f){f.stopPropagation();f.preventDefault()}if(!this.isInput){}var d=this;c(document).on("mousedown",function(e){if(c(e.target).closest(".datepicker").length==0){d.hide()}});this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide();c(window).off("resize",this.place);this.viewMode=this.startViewMode;this.showMode();if(!this.isInput){c(document).off("mousedown",this.hide)}this.element.trigger({type:"hide",date:this.date})},set:function(){var d=b.formatDate(this.date,this.format);if(!this.isInput){if(this.component){this.element.find("input").prop("value",d)}this.element.data("date",d)}else{this.element.prop("value",d)}},setValue:function(d){if(typeof d==="string"){this.date=b.parseDate(d,this.format)}else{this.date=new Date(d)}this.set();this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0);this.fill()},place:function(){var d=this.component?this.component.offset():this.element.offset();this.picker.css({top:d.top+this.height,left:d.left,marginLeft:0})},update:function(d){this.date=b.parseDate(typeof d==="string"?d:(this.isInput?this.element.prop("value"):this.element.data("date")),this.format);this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0);this.fill()},fillDow:function(){var d=this.weekStart;var e="<tr>";while(d<this.weekStart+7){e+='<th class="dow">'+b.dates.daysMin[(d++)%7]+"</th>"}e+="</tr>";this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){var e="";var d=0;while(d<12){e+='<span class="month">'+b.dates.monthsShort[d++]+"</span>"}this.picker.find(".datepicker-months td").append(e)},fill:function(){var r=new Date(this.viewDate),s=r.getFullYear(),q=r.getMonth(),g=this.date.valueOf();this.picker.find(".datepicker-days th:eq(1)").text(b.dates.months[q]+" "+s);var k=new Date(s,q-1,28,0,0,0,0),t=b.getDaysInMonth(k.getFullYear(),k.getMonth());k.setDate(t);k.setDate(t-(k.getDay()-this.weekStart+7)%7);var n=new Date(k);n.setDate(n.getDate()+42);n=n.valueOf();var m=[];var j,p,e;while(k.valueOf()<n){if(k.getDay()===this.weekStart){m.push("<tr>")}j=this.onRender(k);p=k.getFullYear();e=k.getMonth();if((e<q&&p===s)||p<s){j+=" old"}else{if((e>q&&p===s)||p>s){j+=" new"}}if(k.valueOf()===g){j+=" active"}m.push('<td class="day '+j+'">'+k.getDate()+"</td>");if(k.getDay()===this.weekEnd){m.push("</tr>")}k.setDate(k.getDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(m.join(""));var o=this.date.getFullYear();var f=this.picker.find(".datepicker-months").find("th:eq(1)").text(s).end().find("span").removeClass("active");if(o===s){f.eq(this.date.getMonth()).addClass("active")}m="";s=parseInt(s/10,10)*10;var h=this.picker.find(".datepicker-years").find("th:eq(1)").text(s+"-"+(s+9)).end().find("td");s-=1;for(var l=-1;l<11;l++){m+='<span class="year'+(l===-1||l===10?" old":"")+(o===s?" active":"")+'">'+s+"</span>";s+=1}h.html(m)},click:function(i){i.stopPropagation();i.preventDefault();var h=c(i.target).closest("span, td, th");if(h.length===1){switch(h[0].nodeName.toLowerCase()){case"th":switch(h[0].className){case"switch":this.showMode(1);break;case"prev":case"next":this.viewDate["set"+b.modes[this.viewMode].navFnc].call(this.viewDate,this.viewDate["get"+b.modes[this.viewMode].navFnc].call(this.viewDate)+b.modes[this.viewMode].navStep*(h[0].className==="prev"?-1:1));this.fill();this.set();break}break;case"span":if(h.is(".month")){var g=h.parent().find("span").index(h);this.viewDate.setMonth(g)}else{var f=parseInt(h.text(),10)||0;this.viewDate.setFullYear(f)}if(this.viewMode!==0){this.date=new Date(this.viewDate);this.element.trigger({type:"changeDate",date:this.date,viewMode:b.modes[this.viewMode].clsName})}this.showMode(-1);this.fill();this.set();break;case"td":if(h.is(".day")&&!h.is(".disabled")){var d=parseInt(h.text(),10)||1;var g=this.viewDate.getMonth();if(h.is(".old")){g-=1}else{if(h.is(".new")){g+=1}}var f=this.viewDate.getFullYear();this.date=new Date(f,g,d,0,0,0,0);this.viewDate=new Date(f,g,Math.min(28,d),0,0,0,0);this.fill();this.set();this.element.trigger({type:"changeDate",date:this.date,viewMode:b.modes[this.viewMode].clsName});this.picker.hide()}break}}this.element.valid()},mousedown:function(d){d.stopPropagation();d.preventDefault()},showMode:function(d){if(d){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+d))}this.picker.find(">div").hide().filter(".datepicker-"+b.modes[this.viewMode].clsName).show()}};c.fn.datepicker=function(d,e){return this.each(function(){var h=c(this),g=h.data("datepicker"),f=typeof d==="object"&&d;if(!g){h.data("datepicker",(g=new a(this,c.extend({},c.fn.datepicker.defaults,f))))}if(typeof d==="string"){g[d](e)}})};c.fn.datepicker.defaults={onRender:function(d){return""}};c.fn.datepicker.Constructor=a;var b={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],dates:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},isLeapYear:function(d){return(((d%4===0)&&(d%100!==0))||(d%400===0))},getDaysInMonth:function(d,e){return[31,(b.isLeapYear(d)?29:28),31,30,31,30,31,31,30,31,30,31][e]},parseFormat:function(f){var e=f.match(/[.\/\-\s].*?/),d=f.split(/\W+/);if(!e||!d||d.length===0){throw new Error("Invalid date format.")}return{separator:e,parts:d}},parseDate:function(f,m){var g=f.split(m.separator),f=new Date(),e;f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0);if(g.length===m.parts.length){var k=f.getFullYear(),l=f.getDate(),j=f.getMonth();for(var h=0,d=m.parts.length;h<d;h++){e=parseInt(g[h],10)||1;switch(m.parts[h]){case"dd":case"d":l=e;f.setDate(e);break;case"mm":case"m":j=e-1;f.setMonth(e-1);break;case"yy":k=2000+e;f.setFullYear(2000+e);break;case"yyyy":k=e;f.setFullYear(e);break}}f=new Date(k,j,l,0,0,0)}return f},formatDate:function(d,g){var h={d:d.getDate(),m:d.getMonth()+1,yy:d.getFullYear().toString().substring(2),yyyy:d.getFullYear()};h.dd=(h.d<10?"0":"")+h.d;h.mm=(h.m<10?"0":"")+h.m;var d=[];for(var f=0,e=g.parts.length;f<e;f++){d.push(h[g.parts[f]])}return d.join(g.separator)},headTemplate:'<thead><tr><th class="prev">&lsaquo;</th><th colspan="5" class="switch"></th><th class="next">&rsaquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'};b.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+b.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+b.headTemplate+b.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+b.headTemplate+b.contTemplate+"</table></div></div>"}(window.jQuery);jQuery(".formoid-default-dark-gray").find('input[type=date]').each(function(){
!function(c){var a=function(e,d){this.element=c(e);this.format=b.parseFormat(d.format||this.element.data("date-format")||"yyyy-mm-dd");this.picker=c(b.template).appendTo(d.appendTo||"body").on({click:c.proxy(this.click,this)});this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".add-on"):false;if(this.isInput){this.element.on({focus:c.proxy(this.show,this),keyup:c.proxy(this.update,this)})}else{if(this.component){this.component.on("click",c.proxy(this.show,this))}else{this.element.on("click",c.proxy(this.show,this))}}this.minViewMode=d.minViewMode||this.element.data("date-minviewmode")||0;if(typeof this.minViewMode==="string"){switch(this.minViewMode){case"months":this.minViewMode=1;break;case"years":this.minViewMode=2;break;default:this.minViewMode=0;break}}this.viewMode=d.viewMode||this.element.data("date-viewmode")||0;if(typeof this.viewMode==="string"){switch(this.viewMode){case"months":this.viewMode=1;break;case"years":this.viewMode=2;break;default:this.viewMode=0;break}}this.startViewMode=this.viewMode;this.weekStart=d.weekStart||this.element.data("date-weekstart")||0;this.weekEnd=this.weekStart===0?6:this.weekStart-1;this.onRender=d.onRender;this.fillDow();this.fillMonths();this.update();this.showMode()};a.prototype={constructor:a,show:function(f){this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();c(window).on("resize",c.proxy(this.place,this));if(f){f.stopPropagation();f.preventDefault()}if(!this.isInput){}var d=this;c(document).on("mousedown",function(e){if(c(e.target).closest(".datepicker").length==0){d.hide()}});this.element.trigger({type:"show",date:this.date})},hide:function(){this.picker.hide();c(window).off("resize",this.place);this.viewMode=this.startViewMode;this.showMode();if(!this.isInput){c(document).off("mousedown",this.hide)}this.element.trigger({type:"hide",date:this.date})},set:function(){var d=b.formatDate(this.date,this.format);if(!this.isInput){if(this.component){this.element.find("input").prop("value",d)}this.element.data("date",d)}else{this.element.prop("value",d)}},setValue:function(d){if(typeof d==="string"){this.date=b.parseDate(d,this.format)}else{this.date=new Date(d)}this.set();this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0);this.fill()},place:function(){var d=this.component?this.component.offset():this.element.offset();this.picker.css({top:d.top+this.height,left:d.left,marginLeft:0})},update:function(d){this.date=b.parseDate(typeof d==="string"?d:(this.isInput?this.element.prop("value"):this.element.data("date")),this.format);this.viewDate=new Date(this.date.getFullYear(),this.date.getMonth(),1,0,0,0,0);this.fill()},fillDow:function(){var d=this.weekStart;var e="<tr>";while(d<this.weekStart+7){e+='<th class="dow">'+b.dates.daysMin[(d++)%7]+"</th>"}e+="</tr>";this.picker.find(".datepicker-days thead").append(e)},fillMonths:function(){var e="";var d=0;while(d<12){e+='<span class="month">'+b.dates.monthsShort[d++]+"</span>"}this.picker.find(".datepicker-months td").append(e)},fill:function(){var r=new Date(this.viewDate),s=r.getFullYear(),q=r.getMonth(),g=this.date.valueOf();this.picker.find(".datepicker-days th:eq(1)").text(b.dates.months[q]+" "+s);var k=new Date(s,q-1,28,0,0,0,0),t=b.getDaysInMonth(k.getFullYear(),k.getMonth());k.setDate(t);k.setDate(t-(k.getDay()-this.weekStart+7)%7);var n=new Date(k);n.setDate(n.getDate()+42);n=n.valueOf();var m=[];var j,p,e;while(k.valueOf()<n){if(k.getDay()===this.weekStart){m.push("<tr>")}j=this.onRender(k);p=k.getFullYear();e=k.getMonth();if((e<q&&p===s)||p<s){j+=" old"}else{if((e>q&&p===s)||p>s){j+=" new"}}if(k.valueOf()===g){j+=" active"}m.push('<td class="day '+j+'">'+k.getDate()+"</td>");if(k.getDay()===this.weekEnd){m.push("</tr>")}k.setDate(k.getDate()+1)}this.picker.find(".datepicker-days tbody").empty().append(m.join(""));var o=this.date.getFullYear();var f=this.picker.find(".datepicker-months").find("th:eq(1)").text(s).end().find("span").removeClass("active");if(o===s){f.eq(this.date.getMonth()).addClass("active")}m="";s=parseInt(s/10,10)*10;var h=this.picker.find(".datepicker-years").find("th:eq(1)").text(s+"-"+(s+9)).end().find("td");s-=1;for(var l=-1;l<11;l++){m+='<span class="year'+(l===-1||l===10?" old":"")+(o===s?" active":"")+'">'+s+"</span>";s+=1}h.html(m)},click:function(i){i.stopPropagation();i.preventDefault();var h=c(i.target).closest("span, td, th");if(h.length===1){switch(h[0].nodeName.toLowerCase()){case"th":switch(h[0].className){case"switch":this.showMode(1);break;case"prev":case"next":this.viewDate["set"+b.modes[this.viewMode].navFnc].call(this.viewDate,this.viewDate["get"+b.modes[this.viewMode].navFnc].call(this.viewDate)+b.modes[this.viewMode].navStep*(h[0].className==="prev"?-1:1));this.fill();this.set();break}break;case"span":if(h.is(".month")){var g=h.parent().find("span").index(h);this.viewDate.setMonth(g)}else{var f=parseInt(h.text(),10)||0;this.viewDate.setFullYear(f)}if(this.viewMode!==0){this.date=new Date(this.viewDate);this.element.trigger({type:"changeDate",date:this.date,viewMode:b.modes[this.viewMode].clsName})}this.showMode(-1);this.fill();this.set();break;case"td":if(h.is(".day")&&!h.is(".disabled")){var d=parseInt(h.text(),10)||1;var g=this.viewDate.getMonth();if(h.is(".old")){g-=1}else{if(h.is(".new")){g+=1}}var f=this.viewDate.getFullYear();this.date=new Date(f,g,d,0,0,0,0);this.viewDate=new Date(f,g,Math.min(28,d),0,0,0,0);this.fill();this.set();this.element.trigger({type:"changeDate",date:this.date,viewMode:b.modes[this.viewMode].clsName});this.picker.hide()}break}}this.element.valid()},mousedown:function(d){d.stopPropagation();d.preventDefault()},showMode:function(d){if(d){this.viewMode=Math.max(this.minViewMode,Math.min(2,this.viewMode+d))}this.picker.find(">div").hide().filter(".datepicker-"+b.modes[this.viewMode].clsName).show()}};c.fn.datepicker=function(d,e){return this.each(function(){var h=c(this),g=h.data("datepicker"),f=typeof d==="object"&&d;if(!g){h.data("datepicker",(g=new a(this,c.extend({},c.fn.datepicker.defaults,f))))}if(typeof d==="string"){g[d](e)}})};c.fn.datepicker.defaults={onRender:function(d){return""}};c.fn.datepicker.Constructor=a;var b={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],dates:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},isLeapYear:function(d){return(((d%4===0)&&(d%100!==0))||(d%400===0))},getDaysInMonth:function(d,e){return[31,(b.isLeapYear(d)?29:28),31,30,31,30,31,31,30,31,30,31][e]},parseFormat:function(f){var e=f.match(/[.\/\-\s].*?/),d=f.split(/\W+/);if(!e||!d||d.length===0){throw new Error("Invalid date format.")}return{separator:e,parts:d}},parseDate:function(f,m){var g=f.split(m.separator),f=new Date(),e;f.setHours(0);f.setMinutes(0);f.setSeconds(0);f.setMilliseconds(0);if(g.length===m.parts.length){var k=f.getFullYear(),l=f.getDate(),j=f.getMonth();for(var h=0,d=m.parts.length;h<d;h++){e=parseInt(g[h],10)||1;switch(m.parts[h]){case"dd":case"d":l=e;f.setDate(e);break;case"mm":case"m":j=e-1;f.setMonth(e-1);break;case"yy":k=2000+e;f.setFullYear(2000+e);break;case"yyyy":k=e;f.setFullYear(e);break}}f=new Date(k,j,l,0,0,0)}return f},formatDate:function(d,g){var h={d:d.getDate(),m:d.getMonth()+1,yy:d.getFullYear().toString().substring(2),yyyy:d.getFullYear()};h.dd=(h.d<10?"0":"")+h.d;h.mm=(h.m<10?"0":"")+h.m;var d=[];for(var f=0,e=g.parts.length;f<e;f++){d.push(h[g.parts[f]])}return d.join(g.separator)},headTemplate:'<thead><tr><th class="prev">&lsaquo;</th><th colspan="5" class="switch"></th><th class="next">&rsaquo;</th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>'};b.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+b.headTemplate+'<tbody></tbody></table></div><div class="datepicker-months"><table class="table-condensed">'+b.headTemplate+b.contTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+b.headTemplate+b.contTemplate+"</table></div></div>"}(window.jQuery);jQuery(".dark-grey").find('input[type=date]').each(function(){
var date = $(this);
var text = $('<input type="text">');
text.get(0).className = date.get(0).className;
@@ -70,7 +70,7 @@
date.replaceWith(text);
text.datepicker({
format: date.attr("placeholder") || 'yyyy-mm-dd',
appendTo: jQuery(".formoid-default-dark-gray")
appendTo: jQuery(".dark-grey")
});
});// -----------------------------------------------------------------------------------
// http://formoid.com/
@@ -81,4 +81,4 @@
// Obfuscated by Javascript Obfuscator
// http://javascript-source.com
//***********************************************
jQuery.validator.addMethod("pattern",function(b,a,c){return this.optional(a)||(new RegExp("^(?:"+c+")$")).test(b)},jQuery.format("Please enter the correct value"));jQuery.validator.origRequired=jQuery.validator.methods.required;jQuery.validator.addMethod("required",function(b,a,c){if(/^url$/.test(a.getAttribute("type"))&&($.trim(b)=="http://")){return false}return jQuery.validator.origRequired.call(this,b,a,c)});jQuery.validator.addMethod("name",function(b,a,c){if(/^name\[first\]|name\[last\]$/.test(a.getAttribute("name"))){return this.optional(a)||(new RegExp("^[^0-9\\<\\>\\\\/\\|*\\=\\_\\+\\~\\!\\?\\@\\#\\â„–\\$\\%\\^\\&\\(\\)\\{\\}\\[\\]\\;\\:\\`\\,]+$")).test(b)}return true},jQuery.format("Please enter the correct characters"));jQuery(function(){var a=jQuery;form=a(".formoid-default-dark-gray");form.validate({errorClass:"error-label",wrapper:"label",errorElement:"span",ignore:"",success:function(b,c){if(b.parent().hasClass("tooltip")){b.parent().remove()}else{b.remove()}var d=a(c).parent();d.removeClass("error-field")},errorPlacement:function(b,c){var d=a(c).parent();d.addClass("error-field");b.css("marginLeft",0).appendTo(d||c).addClass("tooltip").addClass("bottom").addClass("error").append(a("<span>").addClass("tooltip-arrow"))}});jQuery("[required=required]").keyup(function(){a(this).valid()})});
jQuery.validator.addMethod("pattern",function(b,a,c){return this.optional(a)||(new RegExp("^(?:"+c+")$")).test(b)},jQuery.format("Please enter the correct value"));jQuery.validator.origRequired=jQuery.validator.methods.required;jQuery.validator.addMethod("required",function(b,a,c){if(/^url$/.test(a.getAttribute("type"))&&($.trim(b)=="http://")){return false}return jQuery.validator.origRequired.call(this,b,a,c)});jQuery.validator.addMethod("name",function(b,a,c){if(/^name\[first\]|name\[last\]$/.test(a.getAttribute("name"))){return this.optional(a)||(new RegExp("^[^0-9\\<\\>\\\\/\\|*\\=\\_\\+\\~\\!\\?\\@\\#\\â„–\\$\\%\\^\\&\\(\\)\\{\\}\\[\\]\\;\\:\\`\\,]+$")).test(b)}return true},jQuery.format("Please enter the correct characters"));jQuery(function(){var a=jQuery;form=a(".dark-grey");form.validate({errorClass:"error-label",wrapper:"label",errorElement:"span",ignore:"",success:function(b,c){if(b.parent().hasClass("tooltip")){b.parent().remove()}else{b.remove()}var d=a(c).parent();d.removeClass("error-field")},errorPlacement:function(b,c){var d=a(c).parent();d.addClass("error-field");b.css("marginLeft",0).appendTo(d||c).addClass("tooltip").addClass("bottom").addClass("error").append(a("<span>").addClass("tooltip-arrow"))}});jQuery("[required=required]").keyup(function(){a(this).valid()})});