All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.opendoc.My97DatePicker.WdatePicker.js Maven / Gradle / Ivy

/*
 * My97 DatePicker 4.8
 * License: http://www.my97.net/license.asp
 */
var $dp,WdatePicker;(function(){var l={
$langList:[
{name:"en",charset:"UTF-8"},
{name:"zh-cn",charset:"gb2312"},
{name:"zh-tw",charset:"GBK"}
],
$skinList:[
{name:"default",charset:"gb2312"},
{name:"whyGreen",charset:"gb2312"},
{name:"blue",charset:"gb2312"},
{name:"green",charset:"gb2312"},
{name:"simple",charset:"gb2312"},
{name:"ext",charset:"gb2312"},
{name:"blueFresh",charset:"gb2312"},
{name:"twoer",charset:"gb2312"},
{name:"YcloudRed",charset:"gb2312"}],
$wdate:true,
$crossFrame:false,
$preLoad:false,
$dpPath:"",
doubleCalendar:false,
enableKeyboard:true,
enableInputMask:true,
autoUpdateOnChanged:null,
weekMethod:"MSExcel",
position:{},
lang:"auto",
skin:"default",
dateFmt:"yyyy-MM-dd",
realDateFmt:"yyyy-MM-dd",
realTimeFmt:"HH:mm:ss",
realFullFmt:"%Date %Time",
minDate:"0001-01-01 00:00:00",
maxDate:"9999-12-31 23:59:59",
minTime:"00:00:00",
maxTime:"23:59:59",
startDate:"",
alwaysUseStartDate:false,
yearOffset:1911,
firstDayOfWeek:0,
isShowWeek:false,
highLineWeekDay:true,
isShowClear:true,
isShowToday:true,
isShowOK:true,
isShowOthers:true,
readOnly:false,
errDealMode:0,
autoPickDate:null,
qsEnabled:true,
autoShowQS:false,
hmsMenuCfg:{H:[1,6],m:[5,6],s:[15,4]},

opposite:false,specialDates:null,specialDays:null,disabledDates:null,disabledDays:null,onpicking:null,onpicked:null,onclearing:null,oncleared:null,ychanging:null,ychanged:null,Mchanging:null,Mchanged:null,dchanging:null,dchanged:null,Hchanging:null,Hchanged:null,mchanging:null,mchanged:null,schanging:null,schanged:null,eCont:null,vel:null,elProp:"",errMsg:"",quickSel:[],has:{},getRealLang:function(){var d=l.$langList;for(var e=0;e0?1:0;var K=new Date(this.dt.y,this.dt.M,0).getDate();this.dt.d=Math.min(K+M,this.dt.d)}}}}if(this.dt.refresh()){return this.dt}}return""},show:function(){var K=E[z].getElementsByTagName("div"),J=100000;for(var e=0;eJ){J=L}}this.dd.style.zIndex=J+2;r(this.dd,"block");r(this.dd.firstChild,"")},unbind:function(e){e=this.$(e);if(e.initcfg){t(e,"onclick",function(){g(e.initcfg)});t(e,"onfocus",function(){g(e.initcfg)})}},hide:function(){r(this.dd,"none")},attachEvent:k};for(var d in w){E.$dp[d]=w[d]}$dp=E.$dp}function k(I,J,w,d){if(I.addEventListener){var e=J.replace(/on/,"");w._ieEmuEventHandler=function(K){return w(K)};I.addEventListener(e,w._ieEmuEventHandler,d)}else{I.attachEvent(J,w)}}function t(w,I,e){if(w.removeEventListener){var d=I.replace(/on/,"");e._ieEmuEventHandler=function(J){return e(J)};w.removeEventListener(d,e._ieEmuEventHandler,false)}else{w.detachEvent(I,e)}}function C(w,e,d){if(typeof w!=typeof e){return false}if(typeof w=="object"){if(!d){for(var I in w){if(typeof e[I]=="undefined"){return false}if(!C(w[I],e[I],true)){return false}}}return true}else{if(typeof w=="function"&&typeof e=="function"){return w.toString()==e.toString()}else{return w==e}}}function q(){var I,w,d=n[z][H]("script");for(var e=0;e0){I=I.substring(0,w+1)}if(I){break}}return I}function m(w,I,J){var d=n[z][H]("HEAD").item(0),e=n[z].createElement("link");if(d){e.href=w;e.rel="stylesheet";e.type="text/css";if(I){e.title=I}if(J){e.charset=J}d.appendChild(e)}}function p(I){I=I||E;var L=0,d=0;while(I!=E){var N=I.parent[z][H]("iframe");for(var J=0;JI.scrollTop||d.scrollLeft>I.scrollLeft))?d:I;return{top:J.scrollTop,left:J.scrollLeft}}function s(d){try{var w=d?(d.srcElement||d.target):null;if($dp.cal&&!$dp.eCont&&$dp.dd&&w!=$dp.el&&$dp.dd.style.display=="block"){$dp.cal.close()}}catch(d){}}function A(){$dp.status=2}var G,j;function g(M,d){if(!$dp){return}b();var J={};for(var L in M){J[L]=M[L]}for(var L in l){if(L.substring(0,1)!="$"&&J[L]===undefined){J[L]=l[L]}}if(d){if(!w()){j=j||setInterval(function(){if(E[z].readyState=="complete"){clearInterval(j)}g(null,true)},50);return}if($dp.status==0){$dp.status=1;J.el=i;a(J,true)}else{return}}else{if(J.eCont){J.eCont=$dp.$(J.eCont);J.el=i;J.autoPickDate=true;J.qsEnabled=false;a(J)}else{if(l.$preLoad&&$dp.status!=2){return}var I=N();if(n.event===I||I){J.srcEl=I.srcElement||I.target;I.cancelBubble=true}J.el=J.el=$dp.$(J.el||J.srcEl);if(J.el==null){alert("WdatePicker:el is null!\nexample:onclick=\"WdatePicker({el:this})\"");return;}try{if(!J.el||J.el.My97Mark===true||J.el.disabled||($dp.dd&&r($dp.dd)!="none"&&$dp.dd.style.left!="-970px")){if(J.el.My97Mark){J.el.My97Mark=false}return}}catch(K){}if(I&&J.el.nodeType==1&&!C(J.el.initcfg,M)){$dp.unbind(J.el);k(J.el,I.type=="focus"?"onclick":"onfocus",function(){g(M)});J.el.initcfg=M}a(J)}}function w(){if(h&&E!=n&&E[z].readyState!="complete"){return false}return true}function N(){if(f){try{func=N.caller;while(func!=null){var O=func.arguments[0];if(O&&(O+"").indexOf("Event")>=0){return O}func=func.caller}}catch(P){}return null}return event}}function c(e,d){return e.currentStyle?e.currentStyle[d]:document.defaultView.getComputedStyle(e,false)[d]}function r(e,d){if(e){if(d!=null){e.style.display=d}else{return c(e,"display")}}}function a(e,d){var K=e.el?e.el.nodeName:"INPUT";if(d||e.eCont||new RegExp(/input|textarea|div|span|p|a/ig).test(K)){e.elProp=K=="INPUT"?"value":"innerHTML"}else{return}if(e.lang=="auto"){e.lang=h?navigator.browserLanguage.toLowerCase():navigator.language.toLowerCase()}if(!e.eCont){for(var J in e){$dp[J]=e[J]}}if(!$dp.dd||e.eCont||($dp.dd&&(e.getRealLang().name!=$dp.dd.lang||e.skin!=$dp.dd.skin))){if(e.eCont){w(e.eCont,e)}else{$dp.dd=E[z].createElement("DIV");$dp.dd.style.cssText="position:absolute";E[z].body.appendChild($dp.dd);w($dp.dd,e);if(d){$dp.dd.style.left=$dp.dd.style.top="-970px"}else{$dp.show();I($dp)}}}else{if($dp.cal){$dp.show();$dp.cal.init();if(!$dp.eCont){I($dp)}}}function w(V,P){var O=E[z].domain,S=false,M='';V.innerHTML=M;var L=l.$langList,U=l.$skinList,T;try{T=V.lastChild.contentWindow[z]}catch(Q){S=true;V.removeChild(V.lastChild);var N=E[z].createElement("iframe");N.hideFocus=true;N.frameBorder=0;N.scrolling="no";N.src="javascript:(function(){var d=document;d.open();d.domain='"+O+"';})()";V.appendChild(N);setTimeout(function(){T=V.lastChild.contentWindow[z];R()},97);return}R();function R(){var Y=P.getRealLang();V.lang=Y.name;V.skin=P.skin;var X=["