tethys/public/backend/tinyDatePicker.js
Arno Kaimbacher 0dc6ca034e + composer updates
+ CreatingCorporation nur readonly
+  doctypes zusätzlich: 'mixedtype' => 'Mixed Type'
+ bei einer Fehlermeldung beim Submit: kein Reset mehr... nur mehr "retry: edit inputs"
+ Eingabe der Contributor gleich nach der Eingabe der Creator
+ Projekteingabe beim Submitten entfernt
+ Keyword wird nun mit einer default language angelegt
+ elevation und depth-Angaben in Meter (im Label)
+ 'server_date_modified' wird nun auch aktualisiert beim automatischen reject,
falls der Reviewer länger als 14 Tage den Datensatz nicht kontrolliert
+ GeoLocation hat nun eine Doppelbindung -> nicht mehr readonly
2020-06-10 21:09:20 +02:00

1 line
11 KiB
JavaScript

!function(t){var e={};function n(a){if(e[a])return e[a].exports;var o=e[a]={i:a,l:!1,exports:{}};return t[a].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(a,o,function(e){return t[e]}.bind(null,o));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="/",n(n.s=107)}({107:function(t,e,n){t.exports=n(108)},108:function(t,e,n){"use strict";n.r(e);var a=n(57);n.n(a)()(document.querySelector("input[name='time_absolut']"))},57:function(t,e,n){t.exports=function(){"use strict";function t(){var t=new Date;return t.setHours(0,0,0,0),t}function e(t,e){return(t&&t.toDateString())===(e&&e.toDateString())}function n(t,e,n){var a=(t=new Date(t)).getDate(),o=t.getMonth()+e;return t.setDate(1),t.setMonth(n?(12+o)%12:o),t.setDate(a),t.getDate()<a&&t.setDate(0),t}function a(t,e){return(t=new Date(t)).setFullYear(t.getFullYear()+e),t}function o(t){return function(e){return function(t){return(t=new Date(t)).setHours(0,0,0,0),t}("string"==typeof e?t(e):e)}}function r(t,e,n){return t<e?e:t>n?n:t}function i(t,e){var n=void 0;return function(){clearTimeout(n),n=setTimeout(e,t)}}function u(){}function s(){for(var t=arguments,e=t[0],n=1;n<t.length;++n){var a=t[n]||{};for(var o in a)e[o]=a[o]}return e}var c={days:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],today:"Today",clear:"Clear",close:"Close"};function d(e){e=e||{};var n=o((e=s({lang:c,mode:"dp-modal",hilightedDate:t(),format:function(t){return t.getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear()},parse:function(e){var n=new Date(e);return isNaN(n)?t():n},dateClass:function(){},inRange:function(){return!0}},e)).parse);return e.lang=s(c,e.lang),e.parse=n,e.inRange=function(t){var e=t.inRange;return function(n,a){return e(n,a)&&t.min<=n&&t.max>=n}}(e),e.min=n(e.min||a(t(),-100)),e.max=n(e.max||a(t(),100)),e.hilightedDate=e.parse(e.hilightedDate),e}var l={left:37,up:38,right:39,down:40,enter:13,esc:27};function f(t,e,n){return e.addEventListener(t,n,!0),function(){e.removeEventListener(t,n,!0)}}var p=function(){var t=window.CustomEvent;return"function"!=typeof t&&((t=function(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}).prototype=window.Event.prototype),t}(),h={day:{onKeyDown:function(t,e){var n,a,o=t.keyCode,r=o===l.left?-1:o===l.right?1:o===l.up?-7:o===l.down?7:0;o===l.esc?e.close():r&&(t.preventDefault(),e.setState({hilightedDate:(n=e.state.hilightedDate,a=r,(n=new Date(n)).setDate(n.getDate()+a),n)}))},onClick:{"dp-day":function(t,e){e.setState({selectedDate:new Date(parseInt(t.target.getAttribute("data-date")))})},"dp-next":function(t,e){var a=e.state.hilightedDate;e.setState({hilightedDate:n(a,1)})},"dp-prev":function(t,e){var a=e.state.hilightedDate;e.setState({hilightedDate:n(a,-1)})},"dp-today":function(e,n){n.setState({selectedDate:t()})},"dp-clear":function(t,e){e.setState({selectedDate:null})},"dp-close":function(t,e){e.close()},"dp-cal-month":function(t,e){e.setState({view:"month"})},"dp-cal-year":function(t,e){e.setState({view:"year"})}},render:function(n){var a=n.opts,o=a.lang,r=n.state,i=o.days,u=a.dayOffset||0,s=r.selectedDate,c=r.hilightedDate,d=c.getMonth(),l=t().getTime();return'<div class="dp-cal"><header class="dp-cal-header"><button tabindex="-1" type="button" class="dp-prev">Prev</button><button tabindex="-1" type="button" class="dp-cal-month">'+o.months[d]+'</button><button tabindex="-1" type="button" class="dp-cal-year">'+c.getFullYear()+'</button><button tabindex="-1" type="button" class="dp-next">Next</button></header><div class="dp-days">'+i.map(function(t,e){return'<span class="dp-col-header">'+i[(e+u)%i.length]+"</span>"}).join("")+function(t,e,n){var a="",o=new Date(t);o.setDate(1),o.setDate(1-o.getDay()+e),e&&o.getDate()===e+1&&o.setDate(e-6);for(var r=0;r<42;++r)a+=n(o),o.setDate(o.getDate()+1);return a}(c,u,function(t){var o=t.getMonth()!==d,r=!a.inRange(t),i=t.getTime()===l,u="dp-day";return u+=o?" dp-edge-day":"",u+=e(t,c)?" dp-current":"",u+=e(t,s)?" dp-selected":"",u+=r?" dp-day-disabled":"",u+=i?" dp-day-today":"",'<button tabindex="-1" type="button" class="'+(u+=" "+a.dateClass(t,n))+'" data-date="'+t.getTime()+'">'+t.getDate()+"</button>"})+'</div><footer class="dp-cal-footer"><button tabindex="-1" type="button" class="dp-today">'+o.today+'</button><button tabindex="-1" type="button" class="dp-clear">'+o.clear+'</button><button tabindex="-1" type="button" class="dp-close">'+o.close+"</button></footer></div>"}},year:{render:function(t){var e=t.state,n=e.hilightedDate.getFullYear(),a=e.selectedDate.getFullYear();return'<div class="dp-years">'+function(t,e){for(var n="",a=t.opts.max.getFullYear();a>=t.opts.min.getFullYear();--a)n+=e(a);return n}(t,function(t){var e="dp-year";return e+=t===n?" dp-current":"",'<button tabindex="-1" type="button" class="'+(e+=t===a?" dp-selected":"")+'" data-year="'+t+'">'+t+"</button>"})+"</div>"},onKeyDown:function(t,e){var n=t.keyCode,o=e.opts,i=n===l.left||n===l.up?1:n===l.right||n===l.down?-1:0;if(n===l.esc)e.setState({view:"day"});else if(i){t.preventDefault();var u=a(e.state.hilightedDate,i);e.setState({hilightedDate:r(u,o.min,o.max)})}},onClick:{"dp-year":function(t,e){var n,a;e.setState({hilightedDate:(n=e.state.hilightedDate,a=parseInt(t.target.getAttribute("data-year")),(n=new Date(n)).setFullYear(a),n),view:"day"})}}},month:{onKeyDown:function(t,e){var a=t.keyCode,o=a===l.left?-1:a===l.right?1:a===l.up?-3:a===l.down?3:0;a===l.esc?e.setState({view:"day"}):o&&(t.preventDefault(),e.setState({hilightedDate:n(e.state.hilightedDate,o,!0)}))},onClick:{"dp-month":function(t,e){var a,o;e.setState({hilightedDate:(a=e.state.hilightedDate,o=parseInt(t.target.getAttribute("data-month")),n(a,o-a.getMonth())),view:"day"})}},render:function(t){var e=t.opts.lang.months,n=t.state.hilightedDate.getMonth();return'<div class="dp-months">'+e.map(function(t,e){var a="dp-month";return'<button tabindex="-1" type="button" class="'+(a+=n===e?" dp-current":"")+'" data-month="'+e+'">'+t+"</button>"}).join("")+"</div>"}}};function v(t,e,n){var a,o,s=!1,c={el:void 0,opts:n,shouldFocusOnBlur:!0,shouldFocusOnRender:!0,state:{get selectedDate(){return o},set selectedDate(t){t&&!n.inRange(t)||(t?(o=new Date(t),c.state.hilightedDate=o):o=t,c.updateInput(o),e("select"),c.close())},view:"day"},adjustPosition:u,containerHTML:'<div class="dp"></div>',attachToDom:function(){document.body.appendChild(c.el)},updateInput:function(e){var a=new p("change",{bubbles:!0});a.simulated=!0,t.value=e?n.format(e):"",t.dispatchEvent(a)},computeSelectedDate:function(){return n.parse(t.value)},currentView:function(){return h[c.state.view]},open:function(){s||(c.el||(c.el=function(t,e){var n=document.createElement("div");return n.className=t.mode,n.innerHTML=e,n}(n,c.containerHTML),function(t){var e=t.el,n=e.querySelector(".dp");function a(e){e.target.className.split(" ").forEach(function(n){var a=t.currentView().onClick[n];a&&a(e,t)})}e.ontouchstart=u,f("blur",n,i(150,function(){t.hasFocus()||t.close(!0)})),f("keydown",e,function(e){e.keyCode===l.enter?a(e):t.currentView().onKeyDown(e,t)}),f("mousedown",n,function(e){e.target.focus&&e.target.focus(),document.activeElement!==e.target&&(e.preventDefault(),g(t))}),f("click",e,a)}(c)),o=r(c.computeSelectedDate(),n.min,n.max),c.state.hilightedDate=o||n.hilightedDate,c.state.view="day",c.attachToDom(),c.render(),e("open"))},isVisible:function(){return!!c.el&&!!c.el.parentNode},hasFocus:function(){var t=document.activeElement;return c.el&&c.el.contains(t)&&t.className.indexOf("dp-focuser")<0},shouldHide:function(){return c.isVisible()},close:function(n){var a=c.el;if(c.isVisible()){if(a){var o=a.parentNode;o&&o.removeChild(a)}s=!0,n&&c.shouldFocusOnBlur&&function(t){t.focus(),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&t.blur()}(t),setTimeout(function(){s=!1},100),e("close")}},destroy:function(){c.close(),a()},render:function(){if(c.el&&c.el.firstChild){var t=c.hasFocus(),e=c.currentView().render(c);e&&(c.el.firstChild.innerHTML=e),c.adjustPosition(),(t||c.shouldFocusOnRender)&&g(c)}},setState:function(t){for(var n in t)c.state[n]=t[n];e("statechange"),c.render()}};return a=function(t,e){var n=i(5,function(){e.shouldHide()?e.close():e.open()}),a=[f("blur",t,i(150,function(){e.hasFocus()||e.close(!0)})),f("mousedown",t,function(){t===document.activeElement&&n()}),f("focus",t,n),f("input",t,function(t){var n=e.opts.parse(t.target.value);isNaN(n)||e.setState({hilightedDate:n})})];return function(){a.forEach(function(t){t()})}}(t,c),c}function g(t){var e=t.el.querySelector(".dp-current");return e&&e.focus()}function m(t,e,n){var a=v(t,e,n);return a.shouldFocusOnBlur=!1,Object.defineProperty(a,"shouldFocusOnRender",{get:function(){return t!==document.activeElement}}),a.adjustPosition=function(){!function(t,e){var n=t.getBoundingClientRect(),a=window;(function(t,e,n){var a=t.el,o=n.pageYOffset,r=o+e.top,i=a.offsetHeight,u=r+e.height+8,s=r-i-8,c=s>0&&u+i>o+n.innerHeight,d=c?s:u;a.classList&&(a.classList.toggle("dp-is-above",c),a.classList.toggle("dp-is-below",!c)),a.style.top=d+"px"})(e,n,a),function(t,e,n){var a=t.el,o=n.pageXOffset,r=e.left+o,i=n.innerWidth+o,u=a.offsetWidth,s=i-u,c=r+u>i&&s>0?s:r;a.style.left=c+"px"}(e,n,a),e.el.style.visibility=""}(t,a)},a}function b(t,e,n){return t=t&&t.tagName?t:document.querySelector(t),"dp-modal"===n.mode?function(t,e,n){var a=v(t,e,n);return t.readonly=!0,a.containerHTML+='<a href="#" class="dp-focuser">.</a>',a}(t,e,n):"dp-below"===n.mode?m(t,e,n):"dp-permanent"===n.mode?function(t,e,n){var a=v(t,e,n);return a.close=u,a.destroy=u,a.updateInput=u,a.shouldFocusOnRender=n.shouldFocusOnRender,a.computeSelectedDate=function(){return n.hilightedDate},a.attachToDom=function(){t.appendChild(a.el)},a.open(),a}(t,e,n):void 0}function y(){var t={};function e(e,n){(t[e]=t[e]||[]).push(n)}return{on:function(t,n){return n?e(t,n):function(t){for(var n in t)e(n,t[n])}(t),this},emit:function(e,n){(t[e]||[]).forEach(function(t){t(e,n)})},off:function(e,n){return e?t[e]=n?(t[e]||[]).filter(function(t){return t!==n}):[]:t={},this}}}return function(t,e){var n=y(),a=d(e),o=b(t,function(t){n.emit(t,r)},a),r={get state(){return o.state},on:n.on,off:n.off,setState:o.setState,open:o.open,close:o.close,destroy:o.destroy};return r}}()}});