www-thermferm/jqwidgets/jqxresponse.js

Mon, 14 Jan 2019 22:46:27 +0100

author
Michiel Broek <mbroek@mbse.eu>
date
Mon, 14 Jan 2019 22:46:27 +0100
changeset 570
1e0192b295b9
parent 511
2d1d43c3a2c2
child 617
b216f9d4b917
permissions
-rw-r--r--

Removed useless version marks from the xml configuration. Added DCMD profile configuration to install and delete profiles in a fermenter. Removed the old profiles configuration. Removed useless xml configuration error check because none has been triggered in five years, Removed several obsolete upgrade functions. Updated the web liveview.

511
2d1d43c3a2c2 Upgraded jqwidgets to version 4.5.2
Michiel Broek <mbroek@mbse.eu>
parents: 373
diff changeset
1 !function(a){a.jqx.response=function(){this.defineInstance()},a.jqx.response.prototype={defineInstance:function(){this._handlers=new Array,this.refresh();var b=this;this.layouts=[],this.addHandler(a(document),"scroll.jqxresponse",function(){b.scroll=b.getScroll()})},refresh:function(){this.os=this.getOS(),this.browser=this.getBrowser(),this.device=this.getDevice(),this.viewPort=this.getViewPort(),this.document=this.getDocument(),this.scroll=this.getScroll(),this.media=window.matchMedia||window.msMatchMedia||function(){return{}}},refreshSize:function(){this.viewPort=this.getViewPort(),this.document=this.getDocument()},addHandler:function(a,b,c,d){switch(b){case"mousemove":if(window.addEventListener&&!d)return a[0].addEventListener("mousemove",c,!1),!1}a.on?a.on(b,c):a.bind(b,c)},removeHandler:function(a,b,c){return void 0==b?void(a.off?a.off():a.unbind()):void(void 0==c?a.off?a.off(b):a.unbind(b):a.off?a.off(b,c):a.unbind(b,c))},responsive:function(b){this._counter||(this._counter=0);for(var c=this.getDevice().type,d=a(b.container),e=0;e<d.length;e++){var f=d[e];f.style.position="relative",f.style.clear="both";for(var g=(a(f).width(),a(f).children()),h=0;h<g.length;h++){var i=g[h];i.className;i.style.position="relative",i.style.top="0px",a(i).css("float","left"),i._className=i.className,b.colClass&&a(i).addClass(b.colClass)}}var j=function(){for(var e=0;e<d.length;e++){var f=d[e],h=a(f).width(),i=function(d){for(var e=a(f).children(),g=b.margin,h=b.padding,i=b.colOffsets,j=0,k=0;k<e.length;k++){var l=e[k];l.className=l._className;var m=l._className;b.colClass&&(""!=m?m+=" "+b.colClass:m=b.colClass);var n=d/e.length;if(n=b.colWidths[k]?d*b.colWidths[k]:d/e.length,!b.deviceTypes||b.deviceTypes&&b.deviceTypes.indexOf(c)>=0)for(var o=0;o<b.breakpoints.length;o++){var p=b.breakpoints[o-1],q=b.breakpoints[o];o>0&&p.width>=d&&q.width<d?p.colWidths[k]&&(n=d*p.colWidths[k],p.colClass&&(m=""!=l._className?l._className+" "+p.colClass:p.colClass,l.className=m),p.margin?g=p.margin:(p.margin={left:0,right:0,top:0,bottom:0},g=p.margin),p.padding?h=p.padding:(p.padding={left:0,right:0,top:0,bottom:0},h=p.padding),p.colOffsets?i=p.colOffsets:(p.colOffsets=new Array(e.length),i=p.colOffsets)):d<=q.width&&q.colWidths[k]&&(n=d*q.colWidths[k],q.colClass&&(m=""!=l._className?l._className+" "+q.colClass:q.colClass,l.className=m),q.margin?g=q.margin:(q.margin={left:0,right:0,top:0,bottom:0},g=q.margin),q.padding?h=q.padding:(q.padding={left:0,right:0,top:0,bottom:0},h=q.padding),q.colOffsets?i=q.colOffsets:(q.colOffsets=new Array(e.length),i=q.colOffsets))}l.className=m;var r=n;h&&(void 0==h.left&&(h.left=0),void 0==h.top&&(h.top=0),void 0==h.bottom&&(h.bottom=0),void 0==h.right&&(h.right=0),r-=h.left,r-=h.right,l.style.paddingLeft=h.left+"px",l.style.paddingRight=h.right+"px",l.style.paddingTop=h.top+"px",l.style.paddingBottom=h.bottom+"px"),l.style.marginLeft="0px",l.style.marginRight="0px",l.style.marginTop="0px",l.style.marginBottom="0px",g&&(void 0==g.left&&(g.left=0),void 0==g.top&&(g.top=0),void 0==g.bottom&&(g.bottom=0),void 0==g.right&&(g.right=0),r-=g.left,r-=g.right,l.style.marginRight=g.right+"px",l.style.marginLeft=g.left+"px",l.style.marginTop=g.top+"px",l.style.marginBottom=g.bottom+"px"),j+=r,j>=d-1&&j-d<=5&&(r--,j=0),i&&void 0!=i[k]&&(l.style.marginLeft=parseInt(l.style.marginLeft)+i[k]*d+"px"),l.style.width=r+"px"}},j=g.css("visibility");g.css("visibility","hidden"),i(h);var k=a(f).width();h!=k&&(i(k),a(window).trigger("resize")),g.css("visibility",j)}};if(this.layouts.push({object:b,resize:j}),1==this.layouts.length){var k=this;a(window).on("resize.response"+this._counter,function(){for(var a=0;a<k.layouts.length;a++)k.layouts[a].resize()}),a(window).on("orientationchange.response"+this._counter,function(){for(var a=0;a<k.layouts.length;a++)k.layouts[a].resize()}),a(window).on("orientationchanged.response"+this._counter,function(){for(var a=0;a<k.layouts.length;a++)k.layouts[a].resize()})}for(var e=0;e<this.layouts.length;e++)this.layouts[e].resize()},destroy:function(){if(this.removeHandler(a(window),"resize.jqxresponse"),this.removeHandler(a(document),"scroll.jqxresponse"),this._counter>0)for(var b=0;b<this._counter;b++)a(window).off("resize.response"+b),a(window).off("orientationchange.response"+b),a(window).off("orientationchanged.response"+b);for(var b=0;b<this._handlers.length;b++){var c=this._handlers[b];this.removeHandler(a(c),"mousedown.response"+c[0].id),this.removeHandler(a(c),"touchstart.response"+c[0].id),this.removeHandler(a(c),"mousemove.response"+c[0].id),this.removeHandler(a(c),"touchmove.response"+c[0].id),this.removeHandler(a(c),"mouseup.response"+c[0].id),this.removeHandler(a(c),"touchend.response"+c[0].id)}},resize:function(b){var c=this;this.removeHandler(a(window),"resize.jqxresponse"),this.addHandler(a(window),"resize.jqxresponse",function(d){if(b)if(a.isArray(b))for(var e=0;e<b.length;e++)b[e]();else b();c.refreshSize()}),null==b&&this.removeHandler(a(window),"resize.jqxresponse")},pointerDown:function(b,c){if(b&&c){var d=a.jqx.mobile.isTouchDevice(),e=!0;if(d){var f=a.jqx.mobile.getTouchEventName("touchstart")+".response"+b[0].id;null!=c?this.addHandler(a(b),f,function(b){var d=a.jqx.position(b),f=c(b,d,"touch");return e=!1,setTimeout(function(){e=!0},500),f}):this.removeHandler(a(b),f)}null!=c?this.addHandler(a(b),"mousedown.response"+b[0].id,function(b){var d=a.jqx.position(b);if(e)return c(b,d,"mouse")}):this.removeHandler(a(b),"mousedown.response"+b[0].id),this._handlers.push(b)}},pointerUp:function(b,c){if(b){var d=a.jqx.mobile.isTouchDevice(),e=!0;if(d){var f=a.jqx.mobile.getTouchEventName("touchend")+".response"+b[0].id;null!=c?this.addHandler(a(b),f,function(b){var d=a.jqx.position(b),f=c(b,d,"touch");return e=!1,setTimeout(function(){e=!0},500),f}):this.removeHandler(a(b),f)}null!=c?this.addHandler(a(b),"mouseup.response"+b[0].id,function(b){var d=a.jqx.position(b);if(e)return c(b,d,"mouse")}):this.removeHandler(a(b),"mouseup.response"+b[0].id),this._handlers.push(b)}},pointerMove:function(b,c){if(b){var d=a.jqx.mobile.isTouchDevice();if(d){var e=a.jqx.mobile.getTouchEventName("touchmove")+".response"+b[0].id;null!=c?this.addHandler(a(b),e,function(b){var d=a.jqx.mobile.getTouches(b);if(1==d.length){var e=a.jqx.position(b);return c(b,e,"touch")}}):this.removeHandler(a(b),e)}else null!=c?this.addHandler(a(b),"mousemove.response"+b[0].id,function(b){var d=a.jqx.position(b);return c(b,d,"mouse")}):this.removeHandler(a(b),"mousemove.response"+b[0].id);this._handlers.push(b)}},isHidden:function(b){return a.jqx.isHidden(a(b))},inViewPort:function(a){var b=this.viewPort;if(a.getBoundingClientRect){var c=a.getBoundingClientRect?a.getBoundingClientRect():{};return c&&c.bottom>=0&&c.top<=b.height&&c.right>=0&&c.left<=b.width}return!1},getScroll:function(){var a={left:window.pageXOffset||document.scrollLeft,top:window.pageYOffset||document.scrollTop};return void 0==a.left&&(a.left=0),void 0==a.top&&(a.top=0),a},getDocument:function(){return{width:a(document).width(),height:a(document).height()}},getViewPort:function(){return{width:a(window).width(),height:a(window).height()}},getTouch:function(){var b="ontouchstart",c=b in window;if(c)return!0;var b="MSPointerDown",c=b in window;return!!c||!!a.jqx.mobile.isWindowsPhone()},getDevice:function(){var a=this.os.name,b=window.location.search.match(/deviceType=(Tablet|Phone)/),c=window.deviceType,d="";return b&&b[1]?d=b[1]:"iPhone"===c?d="Phone":"iPad"===c?d="Tablet":"Android"!=a&&"iOS"!=a&&/Windows|Linux|MacOS|Mac OS|Mac OS X/.test(a)?d="Desktop":"iOS"==a&&navigator.userAgent.toLowerCase().indexOf("ipad")>=0?d="Tablet":"RIMTablet"==a?d="Tablet":"Android"==a?(d=this.os.version&&this.os.version.substring(0,1).indexOf("3")>=0?"Tablet":this.os.version&&this.os.version.substring(0,1).indexOf("4")>=0&&navigator.userAgent.search(/mobile/i)==-1?"Tablet":"Phone",navigator.userAgent.toLowerCase().indexOf("kindle fire")>=0&&(d="Tablet")):d="Phone",/Windows/.test(a)&&(navigator.userAgent.indexOf("Windows Phone")>=0||navigator.userAgent.indexOf("WPDesktop")>=0||navigator.userAgent.indexOf("IEMobile")>=0||navigator.userAgent.indexOf("ZuneWP7")>=0?d="Phone":navigator.userAgent.indexOf("Touch")>=0&&(d="Tablet",this.getTouch()||(d="Desktop"))),{type:d,touch:this.getTouch(),width:window.screen.width,height:window.screen.height,availWidth:window.screen.availWidth,availHeight:window.screen.availHeight}},canvas:function(){var a=!1,b=document.createElement("canvas");return b&&b.getContext&&b.getContext("2d")&&(a=!0),a},vml:function(){if(void 0==this._vmlSupport){var a=document.body.appendChild(document.createElement("div"));a.innerHTML='<v:shape id="vml_flag1" adj="1" />';var b=a.firstChild;b.style.behavior="url(#default#VML)",this._vmlSupport=!b||"object"==typeof b.adj,a.parentNode.removeChild(a)}return this._vmlSupport},svg:function(){return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")},getBrowser:function(){var b=navigator.userAgent.toLowerCase(),c="",d=null;if(browserNames={msie:{name:"Internet Explorer",eval:/(msie) ([\w.]+)/.exec(b)},webkit:{name:"Webkit",eval:/(webkit)[ \/]([\w.]+)/.exec(b)},chrome:{name:"Chrome",eval:/(chrome)[ \/]([\w.]+)/.exec(b)},safari:{name:"Safari",eval:/(safari)[ \/]([\w.]+)/.exec(b)},edge:{name:"Edge",eval:/Edge/i.exec(b)},opera:{name:"Opera",eval:/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(b)},operamobile:{name:"Opera Mobile",eval:/(opera mobi)(?:.*version|)[ \/]([\w.]+)/.exec(b)||/(opera tablet)(?:.*version|)[ \/]([\w.]+)/.exec(b)},dolphin:{name:"Dolphin",eval:/(dolphin)[ \/]([\w.]+)/.exec(b)},webosbrowser:{name:"webOSBrowser",eval:/(wosbrowser)(?:.*version|)[ \/]([\w.]+)/.exec(b)},chromemobile:{name:"Chrome Mobile",eval:/(crmo)[ \/]([\w.]+)/.exec(b)},silk:{name:"Silk",eval:/(silk)[ \/]([\w.]+)/.exec(b)},firefox:{name:"Firefox",eval:/(firefox)[ \/]([\w.]+)/.exec(b)},msie11:{name:"Internet Explorer 11",eval:b.indexOf("rv:11.0")>=0&&b.indexOf(".net4.0c")>=0},winphone:{name:"Internet Explorer Mobile",eval:b.indexOf("windows phone 8.1")>=0},other:{name:"Other",eval:b.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(b)}},a.each(browserNames,function(a,e){if(this.eval)if("Other"==this.name)d||(d=this.eval,c=this.name);else if("Internet Explorer 11"==this.name)d||(d=["","msie",11],c="Internet Explorer");else if("Edge"==this.name)d=["","edge",b.substring(b.indexOf("edge")+5)],c=this.name;else if("Internet Explorer Mobile"==this.name)d||(d=["","msie",11],c="Internet Explorer");else{if("Chrome"==c&&"Safari"==this.name)return!0;d=this.eval,c=this.name}}),d){var e={name:c,accessName:d[1]||"",version:d[2]||"0",canvas:this.canvas(),svg:this.svg(),vml:this.vml()};e[d[1]]=d[1]}else e={name:"Other",browser:"other",version:""};return e},getOS:function(){var b=null,c="",d=navigator.userAgent,e="Other",f={ios:{name:"iOS",regex:new RegExp("(?:i(?:Pad|Phone|Pod)(?:.*)CPU(?: iPhone)? OS )([^\\s;]+)")},android:{name:"Android",regex:new RegExp("(?:(Android |HTC_|Silk/))([^\\s;]+)")},webos:{name:"webOS",regex:new RegExp("(?:(?:webOS|hpwOS)/)([^\\s;]+)")},blackberry:{name:"BlackBerry",regex:new RegExp("(?:BlackBerry(?:.*)Version/)([^\\s;]+)")},rimTablet:{name:"RIMTablet",regex:new RegExp("(?:RIM Tablet OS )([^\\s;]+)")},chrome:{name:"Chrome OS",regex:new RegExp("CrOS")},mac:{name:"MacOS",regex:new RegExp("mac")},win:{name:"Windows",regex:new RegExp("win")},linux:{name:"Linux",regex:new RegExp("linux")},bada:{name:"Bada",regex:new RegExp("(?:Bada/)([^\\s;]+)")},other:{name:"Other"}},g="",h=[{s:"Windows 3.11",r:/Win16/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 10",r:/(Windows 10|Windows NT 10)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows ME",r:/Windows ME/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"BB10",r:/BB10/},{s:"MeeGo",r:/MeeGo/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(var i in h){var j=h[i];if(j.r.test(d)){g=j.s;break}}var k="";switch(/Windows/.test(g)&&(k=/Windows (.*)/.exec(g)[1],g="Windows"),/BB10/.test(g)&&(k="10",g="BlackBerry"),e){case"Mac OS X":k=/Mac OS X (10[\.\_\d]+)/.exec(d)[1];break;case"Android":k=/Android ([\.\_\d]+)/.exec(d)[1];break;case"iOS":k=/OS (\d+)_(\d+)_?(\d+)?/.exec(nVer),k=k[1]+"."+k[2]+"."+(0|k[3])}return""!=k&&(c=k),a.each(f,function(a,f){if(b=d.match(this.regex)||d.toLowerCase().match(this.regex))return this.name.match(/Windows|Linux|MacOS/)||(c=!b[1]||"HTC_"!=b[1]&&"Silk/"!=b[1]?b[b.length-1]:"2.3"),e={name:this.name,version:c,platform:navigator.platform},!1}),e&&"Other"==e.name&&(e.name=g),e&&""!=e.name&&""!=g&&(e.name=g),e&&""==e.version&&""!=k&&(e.version=k),e}}}(jqxBaseFramework);

mercurial