4 lines
24 KiB
JavaScript
4 lines
24 KiB
JavaScript
|
!function(){function t(t,e){var i;for(i in e)e.hasOwnProperty(i)&&(t[i]=e[i]);return t}function e(){this.overlay=document.createElement("div"),this.overlay.style.fontFamily="Roboto, sans-serif",this.overlay.style.position="fixed",this.overlay.style.left=0,this.overlay.style.right=0,this.overlay.style.top=0,this.overlay.style.bottom=0,this.overlay.style.width="100%",this.overlay.style.height="100%",this.overlay.style.opacity="1",this.overlay.style.backgroundColor=this.colorOverlay,this.overlay.style.transitionProperty="opacity",this.overlay.style.transitionDuration="300ms",this.overlay.style.transitionTimingFunction="cubic-bezier(.55,0,.1,1)",document.body.appendChild(this.overlay),this.timePicker.body=document.createElement("div");var t=document.createAttribute("unselectable");t.value="on",this.timePicker.body.setAttributeNode(t);var t=document.createAttribute("onselectstart");t.value="return false;",this.timePicker.body.setAttributeNode(t);var t=document.createAttribute("onmousedown");t.value="return false;",this.timePicker.body.setAttributeNode(t);var t=document.createAttribute("style");t.value="-moz-user-select: none; -webkit-user-select: none; -ms-user-select:none; user-select:none;-o-user-select:none;position:relative;margin:auto;width:200px;height:400px;outline:1px solid #ddd;background:#fff;overflow:hidden;margin-top:30px;",this.timePicker.body.setAttributeNode(t),this.overlay.appendChild(this.timePicker.body),this.timePicker.body.style.color=this.fontColorDark,this.timePicker.body.head=document.createElement("div");var t=document.createAttribute("style");t.value="display: table;padding-top: 20px;margin: auto;font-size: 33px;",this.timePicker.body.head.setAttributeNode(t),this.timePicker.body.appendChild(this.timePicker.body.head),this.timePicker.body.head.hours=document.createElement("div");var t=document.createAttribute("style");t.value="display: inline-block;cursor: pointer;",this.timePicker.body.head.hours.setAttributeNode(t),this.timePicker.body.head.appendChild(this.timePicker.body.head.hours);var e=this.dateForm?this.dateForm.value:"12:00 AM",i=/\d+(?=:)/,r=e.match(i);this.timePicker.body.head.hours.innerHTML=r,this.timePicker.body.head.hours.style.color=this.fontColorLight,this.timePicker.body.head.seperator=document.createElement("div");var t=document.createAttribute("style");this.timePicker.body.head.seperator.setAttributeNode(t);var t=document.createAttribute("style");t.value="display: inline-block;",this.timePicker.body.head.seperator.setAttributeNode(t),this.timePicker.body.head.appendChild(this.timePicker.body.head.seperator),this.timePicker.body.head.seperator.innerHTML=":",this.timePicker.body.head.minutes=document.createElement("div");var t=document.createAttribute("style");t.value="display: inline-block;cursor: pointer;",this.timePicker.body.head.minutes.setAttributeNode(t),this.timePicker.body.head.appendChild(this.timePicker.body.head.minutes);var i=/\d+[^\d+(?=:)]/,r=e.match(i);this.timePicker.body.head.minutes.innerHTML=r[0].replace(/\s+/g,""),this.timePicker.body.head.origin=document.createElement("div");var t=document.createAttribute("style");this.timePicker.body.head.origin.setAttributeNode(t);var t=document.createAttribute("style");t.value="display: table;margin: auto;font-size: large;transition-property: color;transition-duration: 0.5s;",this.timePicker.body.head.origin.setAttributeNode(t),this.timePicker.body.head.appendChild(this.timePicker.body.head.origin);var i=/[A-Z]+/,r=e.match(i);this.timePicker.body.head.origin.innerHTML=r[0].replace(/\s+/g,""),this.timePicker.body.time=document.createElement("ol");var t=document.createAttribute("style");t.value="cursor: move;margin: 0;padding: 0;list-style: none;position: absolute;height: 150px;width: 150px;left: 50%;top: 60%;transform: translate(-50%, -50%);font-size: 15px;",this.timePicker.body.time.setAttributeNode(t),this.timePicker.body.appendChild(this.timePicker.body.time),a.call(this),this.timePicker.body.time.picker=document.createElement("div");var t=document.createAttribute("style");t.value="position: absolute;transform-origin: 50%
|
||
|
|
||
|
var timePicker=new UI_MD_TimePicker({});
|
||
|
timePicker.open({});
|